/*!
* @license Copyright (c) 2003-2024, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md.
*
* Plugins: Alignment, AutoFormat, AutoImage, AutoLink, BlockQuote, Bold, DataFilter, DataSchema, FindAndReplace, GeneralHtmlSupport, Heading, HorizontalLine, Image, ImageCaption, ImageInsert, ImageStyle, ImageToolbar, ImageUpload, Indent, IndentBlock, Italic, Link, LinkImage, List, MediaEmbed, MediaEmbedToolbar, PasteFromOffice, RemoveFormat, SourceEditing, SpecialCharacters, SpecialCharactersText, Strikethrough, Style, Table, TableToolbar, TextTransformations, Underline, WordCount
*/
(function(t){const e=t["en"]=t["en"]||{};e.dictionary=Object.assign(e.dictionary||{},{"%0 of %1":"%0 of %1",Accept:"Accept","Advanced options":"Advanced options","Align cell text to the bottom":"Align cell text to the bottom","Align cell text to the center":"Align cell text to the center","Align cell text to the left":"Align cell text to the left","Align cell text to the middle":"Align cell text to the middle","Align cell text to the right":"Align cell text to the right","Align cell text to the top":"Align cell text to the top","Align center":"Align center","Align left":"Align left","Align right":"Align right","Align table to the left":"Align table to the left","Align table to the right":"Align table to the right",Alignment:"Alignment",All:"All","Almost equal to":"Almost equal to",Angle:"Angle","Approximately equal to":"Approximately equal to",Aquamarine:"Aquamarine",Arrows:"Arrows","Asterisk operator":"Asterisk operator","Austral sign":"Austral sign","back with leftwards arrow above":"back with leftwards arrow above",Background:"Background","Bitcoin sign":"Bitcoin sign",Black:"Black","Block quote":"Block quote","Block styles":"Block styles",Blue:"Blue",Bold:"Bold",Border:"Border","Break text":"Break text","Bulleted List":"Bulleted List","Bulleted list styles toolbar":"Bulleted list styles toolbar",Cancel:"Cancel","Caption for image: %0":"Caption for image: %0","Caption for the image":"Caption for the image","Cedi sign":"Cedi sign","Cell properties":"Cell properties","Cent sign":"Cent sign","Center table":"Center table","Centered image":"Centered image","Change image text alternative":"Change image text alternative","Character categories":"Character categories","Characters: %0":"Characters: %0","Choose heading":"Choose heading",Circle:"Circle",Clear:"Clear","Click to edit block":"Click to edit block",Close:"Close",Code:"Code","Colon sign":"Colon sign",Color:"Color","Color picker":"Color picker",Column:"Column","Contains as member":"Contains as member","Copyright sign":"Copyright sign","Cruzeiro sign":"Cruzeiro sign",Currency:"Currency","Currency sign":"Currency sign",Dashed:"Dashed",Decimal:"Decimal","Decimal with leading zero":"Decimal with leading zero","Decrease indent":"Decrease indent","Degree sign":"Degree sign","Delete column":"Delete column","Delete row":"Delete row","Dim grey":"Dim grey",Dimensions:"Dimensions",Disc:"Disc","Division sign":"Division sign","Dollar sign":"Dollar sign","Dong sign":"Dong sign",Dotted:"Dotted",Double:"Double","Double dagger":"Double dagger","Double exclamation mark":"Double exclamation mark","Double low-9 quotation mark":"Double low-9 quotation mark","Double question mark":"Double question mark",Downloadable:"Downloadable","downwards arrow to bar":"downwards arrow to bar","downwards dashed arrow":"downwards dashed arrow","downwards double arrow":"downwards double arrow","downwards simple arrow":"downwards simple arrow","Drachma sign":"Drachma sign","Drag to move":"Drag to move","Dropdown toolbar":"Dropdown toolbar","Edit block":"Edit block","Edit link":"Edit link","Editor block content toolbar":"Editor block content toolbar","Editor contextual toolbar":"Editor contextual toolbar","Editor dialog":"Editor dialog","Editor editing area: %0":"Editor editing area: %0","Editor toolbar":"Editor toolbar","Element of":"Element of","Em dash":"Em dash","Empty set":"Empty set","En dash":"En dash","end with leftwards arrow above":"end with leftwards arrow above","Enter image caption":"Enter image caption","Enter table caption":"Enter table caption","Euro sign":"Euro sign","Euro-currency sign":"Euro-currency sign","Exclamation question mark":"Exclamation question mark",Find:"Find","Find and replace":"Find and replace","Find in text…":"Find in text…","For all":"For all","Fraction slash":"Fraction slash","French franc sign":"French franc sign","Full size image":"Full size image","German penny sign":"German penny sign","Greater-than or equal to":"Greater-than or equal to","Greater-than sign":"Greater-than sign",Green:"Green",Grey:"Grey",Groove:"Groove","Guarani sign":"Guarani sign","Header column":"Header column","Header row":"Header row",Heading:"Heading","Heading 1":"Heading 1","Heading 2":"Heading 2","Heading 3":"Heading 3","Heading 4":"Heading 4","Heading 5":"Heading 5","Heading 6":"Heading 6",Height:"Height",HEX:"HEX","Horizontal ellipsis":"Horizontal ellipsis","Horizontal line":"Horizontal line","Horizontal text alignment toolbar":"Horizontal text alignment toolbar","Hryvnia sign":"Hryvnia sign","HTML object":"HTML object","Identical to":"Identical to","Image resize list":"Image resize list","Image toolbar":"Image toolbar","image widget":"image widget","In line":"In line","Increase indent":"Increase indent","Indian rupee sign":"Indian rupee sign",Infinity:"Infinity",Insert:"Insert","Insert column left":"Insert column left","Insert column right":"Insert column right","Insert image":"Insert image","Insert image via URL":"Insert image via URL","Insert media":"Insert media","Insert paragraph after block":"Insert paragraph after block","Insert paragraph before block":"Insert paragraph before block","Insert row above":"Insert row above","Insert row below":"Insert row below","Insert table":"Insert table",Inset:"Inset",Integral:"Integral",Intersection:"Intersection","Inverted exclamation mark":"Inverted exclamation mark","Inverted question mark":"Inverted question mark",Italic:"Italic",Justify:"Justify","Justify cell text":"Justify cell text","Kip sign":"Kip sign",Latin:"Latin","Latin capital letter a with breve":"Latin capital letter a with breve","Latin capital letter a with macron":"Latin capital letter a with macron","Latin capital letter a with ogonek":"Latin capital letter a with ogonek","Latin capital letter c with acute":"Latin capital letter c with acute","Latin capital letter c with caron":"Latin capital letter c with caron","Latin capital letter c with circumflex":"Latin capital letter c with circumflex","Latin capital letter c with dot above":"Latin capital letter c with dot above","Latin capital letter d with caron":"Latin capital letter d with caron","Latin capital letter d with stroke":"Latin capital letter d with stroke","Latin capital letter e with breve":"Latin capital letter e with breve","Latin capital letter e with caron":"Latin capital letter e with caron","Latin capital letter e with dot above":"Latin capital letter e with dot above","Latin capital letter e with macron":"Latin capital letter e with macron","Latin capital letter e with ogonek":"Latin capital letter e with ogonek","Latin capital letter eng":"Latin capital letter eng","Latin capital letter g with breve":"Latin capital letter g with breve","Latin capital letter g with cedilla":"Latin capital letter g with cedilla","Latin capital letter g with circumflex":"Latin capital letter g with circumflex","Latin capital letter g with dot above":"Latin capital letter g with dot above","Latin capital letter h with circumflex":"Latin capital letter h with circumflex","Latin capital letter h with stroke":"Latin capital letter h with stroke","Latin capital letter i with breve":"Latin capital letter i with breve","Latin capital letter i with dot above":"Latin capital letter i with dot above","Latin capital letter i with macron":"Latin capital letter i with macron","Latin capital letter i with ogonek":"Latin capital letter i with ogonek","Latin capital letter i with tilde":"Latin capital letter i with tilde","Latin capital letter j with circumflex":"Latin capital letter j with circumflex","Latin capital letter k with cedilla":"Latin capital letter k with cedilla","Latin capital letter l with acute":"Latin capital letter l with acute","Latin capital letter l with caron":"Latin capital letter l with caron","Latin capital letter l with cedilla":"Latin capital letter l with cedilla","Latin capital letter l with middle dot":"Latin capital letter l with middle dot","Latin capital letter l with stroke":"Latin capital letter l with stroke","Latin capital letter n with acute":"Latin capital letter n with acute","Latin capital letter n with caron":"Latin capital letter n with caron","Latin capital letter n with cedilla":"Latin capital letter n with cedilla","Latin capital letter o with breve":"Latin capital letter o with breve","Latin capital letter o with double acute":"Latin capital letter o with double acute","Latin capital letter o with macron":"Latin capital letter o with macron","Latin capital letter r with acute":"Latin capital letter r with acute","Latin capital letter r with caron":"Latin capital letter r with caron","Latin capital letter r with cedilla":"Latin capital letter r with cedilla","Latin capital letter s with acute":"Latin capital letter s with acute","Latin capital letter s with caron":"Latin capital letter s with caron","Latin capital letter s with cedilla":"Latin capital letter s with cedilla","Latin capital letter s with circumflex":"Latin capital letter s with circumflex","Latin capital letter t with caron":"Latin capital letter t with caron","Latin capital letter t with cedilla":"Latin capital letter t with cedilla","Latin capital letter t with stroke":"Latin capital letter t with stroke","Latin capital letter u with breve":"Latin capital letter u with breve","Latin capital letter u with double acute":"Latin capital letter u with double acute","Latin capital letter u with macron":"Latin capital letter u with macron","Latin capital letter u with ogonek":"Latin capital letter u with ogonek","Latin capital letter u with ring above":"Latin capital letter u with ring above","Latin capital letter u with tilde":"Latin capital letter u with tilde","Latin capital letter w with circumflex":"Latin capital letter w with circumflex","Latin capital letter y with circumflex":"Latin capital letter y with circumflex","Latin capital letter y with diaeresis":"Latin capital letter y with diaeresis","Latin capital letter z with acute":"Latin capital letter z with acute","Latin capital letter z with caron":"Latin capital letter z with caron","Latin capital letter z with dot above":"Latin capital letter z with dot above","Latin capital ligature ij":"Latin capital ligature ij","Latin capital ligature oe":"Latin capital ligature oe","Latin small letter a with breve":"Latin small letter a with breve","Latin small letter a with macron":"Latin small letter a with macron","Latin small letter a with ogonek":"Latin small letter a with ogonek","Latin small letter c with acute":"Latin small letter c with acute","Latin small letter c with caron":"Latin small letter c with caron","Latin small letter c with circumflex":"Latin small letter c with circumflex","Latin small letter c with dot above":"Latin small letter c with dot above","Latin small letter d with caron":"Latin small letter d with caron","Latin small letter d with stroke":"Latin small letter d with stroke","Latin small letter dotless i":"Latin small letter dotless i","Latin small letter e with breve":"Latin small letter e with breve","Latin small letter e with caron":"Latin small letter e with caron","Latin small letter e with dot above":"Latin small letter e with dot above","Latin small letter e with macron":"Latin small letter e with macron","Latin small letter e with ogonek":"Latin small letter e with ogonek","Latin small letter eng":"Latin small letter eng","Latin small letter f with hook":"Latin small letter f with hook","Latin small letter g with breve":"Latin small letter g with breve","Latin small letter g with cedilla":"Latin small letter g with cedilla","Latin small letter g with circumflex":"Latin small letter g with circumflex","Latin small letter g with dot above":"Latin small letter g with dot above","Latin small letter h with circumflex":"Latin small letter h with circumflex","Latin small letter h with stroke":"Latin small letter h with stroke","Latin small letter i with breve":"Latin small letter i with breve","Latin small letter i with macron":"Latin small letter i with macron","Latin small letter i with ogonek":"Latin small letter i with ogonek","Latin small letter i with tilde":"Latin small letter i with tilde","Latin small letter j with circumflex":"Latin small letter j with circumflex","Latin small letter k with cedilla":"Latin small letter k with cedilla","Latin small letter kra":"Latin small letter kra","Latin small letter l with acute":"Latin small letter l with acute","Latin small letter l with caron":"Latin small letter l with caron","Latin small letter l with cedilla":"Latin small letter l with cedilla","Latin small letter l with middle dot":"Latin small letter l with middle dot","Latin small letter l with stroke":"Latin small letter l with stroke","Latin small letter long s":"Latin small letter long s","Latin small letter n preceded by apostrophe":"Latin small letter n preceded by apostrophe","Latin small letter n with acute":"Latin small letter n with acute","Latin small letter n with caron":"Latin small letter n with caron","Latin small letter n with cedilla":"Latin small letter n with cedilla","Latin small letter o with breve":"Latin small letter o with breve","Latin small letter o with double acute":"Latin small letter o with double acute","Latin small letter o with macron":"Latin small letter o with macron","Latin small letter r with acute":"Latin small letter r with acute","Latin small letter r with caron":"Latin small letter r with caron","Latin small letter r with cedilla":"Latin small letter r with cedilla","Latin small letter s with acute":"Latin small letter s with acute","Latin small letter s with caron":"Latin small letter s with caron","Latin small letter s with cedilla":"Latin small letter s with cedilla","Latin small letter s with circumflex":"Latin small letter s with circumflex","Latin small letter t with caron":"Latin small letter t with caron","Latin small letter t with cedilla":"Latin small letter t with cedilla","Latin small letter t with stroke":"Latin small letter t with stroke","Latin small letter u with breve":"Latin small letter u with breve","Latin small letter u with double acute":"Latin small letter u with double acute","Latin small letter u with macron":"Latin small letter u with macron","Latin small letter u with ogonek":"Latin small letter u with ogonek","Latin small letter u with ring above":"Latin small letter u with ring above","Latin small letter u with tilde":"Latin small letter u with tilde","Latin small letter w with circumflex":"Latin small letter w with circumflex","Latin small letter y with circumflex":"Latin small letter y with circumflex","Latin small letter z with acute":"Latin small letter z with acute","Latin small letter z with caron":"Latin small letter z with caron","Latin small letter z with dot above":"Latin small letter z with dot above","Latin small ligature ij":"Latin small ligature ij","Latin small ligature oe":"Latin small ligature oe","Left aligned image":"Left aligned image","Left double quotation mark":"Left double quotation mark","Left single quotation mark":"Left single quotation mark","Left-pointing double angle quotation mark":"Left-pointing double angle quotation mark","leftwards arrow to bar":"leftwards arrow to bar","leftwards dashed arrow":"leftwards dashed arrow","leftwards double arrow":"leftwards double arrow","leftwards simple arrow":"leftwards simple arrow","Less-than or equal to":"Less-than or equal to","Less-than sign":"Less-than sign","Light blue":"Light blue","Light green":"Light green","Light grey":"Light grey",Link:"Link","Link image":"Link image","Link URL":"Link URL","Lira sign":"Lira sign","List properties":"List properties","Livre tournois sign":"Livre tournois sign","Logical and":"Logical and","Logical or":"Logical or","Lower-latin":"Lower-latin","Lower–roman":"Lower–roman",Macron:"Macron","Manat sign":"Manat sign","Match case":"Match case",Mathematical:"Mathematical","Media toolbar":"Media toolbar","Media URL":"Media URL","media widget":"media widget","Merge cell down":"Merge cell down","Merge cell left":"Merge cell left","Merge cell right":"Merge cell right","Merge cell up":"Merge cell up","Merge cells":"Merge cells","Mill sign":"Mill sign","Minus sign":"Minus sign","Multiple styles":"Multiple styles","Multiplication sign":"Multiplication sign","N-ary product":"N-ary product","N-ary summation":"N-ary summation",Nabla:"Nabla","Naira sign":"Naira sign","New sheqel sign":"New sheqel sign",Next:"Next","Next result":"Next result","No results found":"No results found","No searchable items":"No searchable items",None:"None","Nordic mark sign":"Nordic mark sign","Not an element of":"Not an element of","Not equal to":"Not equal to","Not sign":"Not sign","Numbered List":"Numbered List","Numbered list styles toolbar":"Numbered list styles toolbar","on with exclamation mark with left right arrow above":"on with exclamation mark with left right arrow above","Open in a new tab":"Open in a new tab","Open link in new tab":"Open link in new tab","Open media in new tab":"Open media in new tab",Orange:"Orange",Original:"Original",Outset:"Outset",Overline:"Overline",Padding:"Padding",Paragraph:"Paragraph","Paragraph sign":"Paragraph sign","Partial differential":"Partial differential","Paste the media URL in the input.":"Paste the media URL in the input.","Per mille sign":"Per mille sign","Per ten thousand sign":"Per ten thousand sign","Peseta sign":"Peseta sign","Peso sign":"Peso sign","Plus-minus sign":"Plus-minus sign","Pound sign":"Pound sign","Press Enter to type after or press Shift + Enter to type before the widget":"Press Enter to type after or press Shift + Enter to type before the widget",Previous:"Previous","Previous result":"Previous result","Proportional to":"Proportional to",Purple:"Purple","Question exclamation mark":"Question exclamation mark",Red:"Red",Redo:"Redo","Registered sign":"Registered sign","Remove color":"Remove color","Remove Format":"Remove Format",Replace:"Replace","Replace all":"Replace all","Replace from computer":"Replace from computer","Replace image":"Replace image","Replace image from computer":"Replace image from computer","Replace with…":"Replace with…","Resize image":"Resize image","Resize image to %0":"Resize image to %0","Resize image to the original size":"Resize image to the original size","Restore default":"Restore default","Reversed order":"Reversed order","Reversed paragraph sign":"Reversed paragraph sign","Rich Text Editor":"Rich Text Editor",Ridge:"Ridge","Right aligned image":"Right aligned image","Right double quotation mark":"Right double quotation mark","Right single quotation mark":"Right single quotation mark","Right-pointing double angle quotation mark":"Right-pointing double angle quotation mark","rightwards arrow to bar":"rightwards arrow to bar","rightwards dashed arrow":"rightwards dashed arrow","rightwards double arrow":"rightwards double arrow","rightwards simple arrow":"rightwards simple arrow",Row:"Row","Ruble sign":"Ruble sign","Rupee sign":"Rupee sign",Save:"Save","Section sign":"Section sign","Select all":"Select all","Select column":"Select column","Select row":"Select row","Show more items":"Show more items","Side image":"Side image","Single left-pointing angle quotation mark":"Single left-pointing angle quotation mark","Single low-9 quotation mark":"Single low-9 quotation mark","Single right-pointing angle quotation mark":"Single right-pointing angle quotation mark",Solid:"Solid","soon with rightwards arrow above":"soon with rightwards arrow above",Source:"Source","Special characters":"Special characters","Spesmilo sign":"Spesmilo sign","Split cell horizontally":"Split cell horizontally","Split cell vertically":"Split cell vertically",Square:"Square","Square root":"Square root","Start at":"Start at","Start index must be greater than 0.":"Start index must be greater than 0.",Strikethrough:"Strikethrough",Style:"Style",Styles:"Styles",Subscript:"Subscript",Superscript:"Superscript","Table alignment toolbar":"Table alignment toolbar","Table cell text alignment":"Table cell text alignment","Table properties":"Table properties","Table toolbar":"Table toolbar","Tenge sign":"Tenge sign",Text:"Text","Text alignment":"Text alignment","Text alignment toolbar":"Text alignment toolbar","Text alternative":"Text alternative","Text styles":"Text styles","Text to find must not be empty.":"Text to find must not be empty.",'The color is invalid. Try "#FF0000" or "rgb(255,0,0)" or "red".':'The color is invalid. Try "#FF0000" or "rgb(255,0,0)" or "red".',"The URL must not be empty.":"The URL must not be empty.",'The value is invalid. Try "10px" or "2em" or simply "2".':'The value is invalid. Try "10px" or "2em" or simply "2".',"There exists":"There exists","This link has no URL":"This link has no URL","This media URL is not supported.":"This media URL is not supported.","Tilde operator":"Tilde operator","Tip: Find some text first in order to replace it.":"Tip: Find some text first in order to replace it.","Tip: Paste the URL into the content to embed faster.":"Tip: Paste the URL into the content to embed faster.","To-do List":"To-do List","Toggle caption off":"Toggle caption off","Toggle caption on":"Toggle caption on","Toggle the circle list style":"Toggle the circle list style","Toggle the decimal list style":"Toggle the decimal list style","Toggle the decimal with leading zero list style":"Toggle the decimal with leading zero list style","Toggle the disc list style":"Toggle the disc list style","Toggle the lower–latin list style":"Toggle the lower–latin list style","Toggle the lower–roman list style":"Toggle the lower–roman list style","Toggle the square list style":"Toggle the square list style","Toggle the upper–latin list style":"Toggle the upper–latin list style","Toggle the upper–roman list style":"Toggle the upper–roman list style","top with upwards arrow above":"top with upwards arrow above","Trade mark sign":"Trade mark sign","Tugrik sign":"Tugrik sign","Turkish lira sign":"Turkish lira sign",Turquoise:"Turquoise","Two dot leader":"Two dot leader","Type or paste your content here.":"Type or paste your content here.","Type your title":"Type your title",Underline:"Underline",Undo:"Undo",Union:"Union",Unlink:"Unlink","up down arrow with base":"up down arrow with base",Update:"Update","Update image URL":"Update image URL","Upload failed":"Upload failed","Upload from computer":"Upload from computer","Upload image from computer":"Upload image from computer","Upload in progress":"Upload in progress","Upper-latin":"Upper-latin","Upper-roman":"Upper-roman","upwards arrow to bar":"upwards arrow to bar","upwards dashed arrow":"upwards dashed arrow","upwards double arrow":"upwards double arrow","upwards simple arrow":"upwards simple arrow","Vertical text alignment toolbar":"Vertical text alignment toolbar","Vulgar fraction one half":"Vulgar fraction one half","Vulgar fraction one quarter":"Vulgar fraction one quarter","Vulgar fraction three quarters":"Vulgar fraction three quarters",White:"White","Whole words only":"Whole words only","Widget toolbar":"Widget toolbar",Width:"Width","Won sign":"Won sign","Words: %0":"Words: %0","Wrap text":"Wrap text",Yellow:"Yellow","Yen sign":"Yen sign"})})(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
/*!
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md.
*/(function t(e,n){if(typeof exports==="object"&&typeof module==="object")module.exports=n();else if(typeof define==="function"&&define.amd)define([],n);else if(typeof exports==="object")exports["ClassicEditor"]=n();else e["ClassicEditor"]=n()})(self,(()=>(()=>{var t={5480:(t,e,n)=>{const i=n(3168);const o={};for(const t of Object.keys(i)){o[i[t]]=t}const r={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};t.exports=r;for(const t of Object.keys(r)){if(!("channels"in r[t])){throw new Error("missing channels property: "+t)}if(!("labels"in r[t])){throw new Error("missing channel labels property: "+t)}if(r[t].labels.length!==r[t].channels){throw new Error("channel and label counts mismatch: "+t)}const{channels:e,labels:n}=r[t];delete r[t].channels;delete r[t].labels;Object.defineProperty(r[t],"channels",{value:e});Object.defineProperty(r[t],"labels",{value:n})}r.rgb.hsl=function(t){const e=t[0]/255;const n=t[1]/255;const i=t[2]/255;const o=Math.min(e,n,i);const r=Math.max(e,n,i);const s=r-o;let a;let c;if(r===o){a=0}else if(e===r){a=(n-i)/s}else if(n===r){a=2+(i-e)/s}else if(i===r){a=4+(e-n)/s}a=Math.min(a*60,360);if(a<0){a+=360}const l=(o+r)/2;if(r===o){c=0}else if(l<=.5){c=s/(r+o)}else{c=s/(2-r-o)}return[a,c*100,l*100]};r.rgb.hsv=function(t){let e;let n;let i;let o;let r;const s=t[0]/255;const a=t[1]/255;const c=t[2]/255;const l=Math.max(s,a,c);const d=l-Math.min(s,a,c);const u=function(t){return(l-t)/6/d+1/2};if(d===0){o=0;r=0}else{r=d/l;e=u(s);n=u(a);i=u(c);if(s===l){o=i-n}else if(a===l){o=1/3+e-i}else if(c===l){o=2/3+n-e}if(o<0){o+=1}else if(o>1){o-=1}}return[o*360,r*100,l*100]};r.rgb.hwb=function(t){const e=t[0];const n=t[1];let i=t[2];const o=r.rgb.hsl(t)[0];const s=1/255*Math.min(e,Math.min(n,i));i=1-1/255*Math.max(e,Math.max(n,i));return[o,s*100,i*100]};r.rgb.cmyk=function(t){const e=t[0]/255;const n=t[1]/255;const i=t[2]/255;const o=Math.min(1-e,1-n,1-i);const r=(1-e-o)/(1-o)||0;const s=(1-n-o)/(1-o)||0;const a=(1-i-o)/(1-o)||0;return[r*100,s*100,a*100,o*100]};function s(t,e){return(t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]-e[2])**2}r.rgb.keyword=function(t){const e=o[t];if(e){return e}let n=Infinity;let r;for(const e of Object.keys(i)){const o=i[e];const a=s(t,o);if(a.04045?((e+.055)/1.055)**2.4:e/12.92;n=n>.04045?((n+.055)/1.055)**2.4:n/12.92;i=i>.04045?((i+.055)/1.055)**2.4:i/12.92;const o=e*.4124+n*.3576+i*.1805;const r=e*.2126+n*.7152+i*.0722;const s=e*.0193+n*.1192+i*.9505;return[o*100,r*100,s*100]};r.rgb.lab=function(t){const e=r.rgb.xyz(t);let n=e[0];let i=e[1];let o=e[2];n/=95.047;i/=100;o/=108.883;n=n>.008856?n**(1/3):7.787*n+16/116;i=i>.008856?i**(1/3):7.787*i+16/116;o=o>.008856?o**(1/3):7.787*o+16/116;const s=116*i-16;const a=500*(n-i);const c=200*(i-o);return[s,a,c]};r.hsl.rgb=function(t){const e=t[0]/360;const n=t[1]/100;const i=t[2]/100;let o;let r;let s;if(n===0){s=i*255;return[s,s,s]}if(i<.5){o=i*(1+n)}else{o=i+n-i*n}const a=2*i-o;const c=[0,0,0];for(let t=0;t<3;t++){r=e+1/3*-(t-1);if(r<0){r++}if(r>1){r--}if(6*r<1){s=a+(o-a)*6*r}else if(2*r<1){s=o}else if(3*r<2){s=a+(o-a)*(2/3-r)*6}else{s=a}c[t]=s*255}return c};r.hsl.hsv=function(t){const e=t[0];let n=t[1]/100;let i=t[2]/100;let o=n;const r=Math.max(i,.01);i*=2;n*=i<=1?i:2-i;o*=r<=1?r:2-r;const s=(i+n)/2;const a=i===0?2*o/(r+o):2*n/(i+n);return[e,a*100,s*100]};r.hsv.rgb=function(t){const e=t[0]/60;const n=t[1]/100;let i=t[2]/100;const o=Math.floor(e)%6;const r=e-Math.floor(e);const s=255*i*(1-n);const a=255*i*(1-n*r);const c=255*i*(1-n*(1-r));i*=255;switch(o){case 0:return[i,c,s];case 1:return[a,i,s];case 2:return[s,i,c];case 3:return[s,a,i];case 4:return[c,s,i];case 5:return[i,s,a]}};r.hsv.hsl=function(t){const e=t[0];const n=t[1]/100;const i=t[2]/100;const o=Math.max(i,.01);let r;let s;s=(2-n)*i;const a=(2-n)*o;r=n*o;r/=a<=1?a:2-a;r=r||0;s/=2;return[e,r*100,s*100]};r.hwb.rgb=function(t){const e=t[0]/360;let n=t[1]/100;let i=t[2]/100;const o=n+i;let r;if(o>1){n/=o;i/=o}const s=Math.floor(6*e);const a=1-i;r=6*e-s;if((s&1)!==0){r=1-r}const c=n+r*(a-n);let l;let d;let u;switch(s){default:case 6:case 0:l=a;d=c;u=n;break;case 1:l=c;d=a;u=n;break;case 2:l=n;d=a;u=c;break;case 3:l=n;d=c;u=a;break;case 4:l=c;d=n;u=a;break;case 5:l=a;d=n;u=c;break}return[l*255,d*255,u*255]};r.cmyk.rgb=function(t){const e=t[0]/100;const n=t[1]/100;const i=t[2]/100;const o=t[3]/100;const r=1-Math.min(1,e*(1-o)+o);const s=1-Math.min(1,n*(1-o)+o);const a=1-Math.min(1,i*(1-o)+o);return[r*255,s*255,a*255]};r.xyz.rgb=function(t){const e=t[0]/100;const n=t[1]/100;const i=t[2]/100;let o;let r;let s;o=e*3.2406+n*-1.5372+i*-.4986;r=e*-.9689+n*1.8758+i*.0415;s=e*.0557+n*-.204+i*1.057;o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92;r=r>.0031308?1.055*r**(1/2.4)-.055:r*12.92;s=s>.0031308?1.055*s**(1/2.4)-.055:s*12.92;o=Math.min(Math.max(0,o),1);r=Math.min(Math.max(0,r),1);s=Math.min(Math.max(0,s),1);return[o*255,r*255,s*255]};r.xyz.lab=function(t){let e=t[0];let n=t[1];let i=t[2];e/=95.047;n/=100;i/=108.883;e=e>.008856?e**(1/3):7.787*e+16/116;n=n>.008856?n**(1/3):7.787*n+16/116;i=i>.008856?i**(1/3):7.787*i+16/116;const o=116*n-16;const r=500*(e-n);const s=200*(n-i);return[o,r,s]};r.lab.xyz=function(t){const e=t[0];const n=t[1];const i=t[2];let o;let r;let s;r=(e+16)/116;o=n/500+r;s=r-i/200;const a=r**3;const c=o**3;const l=s**3;r=a>.008856?a:(r-16/116)/7.787;o=c>.008856?c:(o-16/116)/7.787;s=l>.008856?l:(s-16/116)/7.787;o*=95.047;r*=100;s*=108.883;return[o,r,s]};r.lab.lch=function(t){const e=t[0];const n=t[1];const i=t[2];let o;const r=Math.atan2(i,n);o=r*360/2/Math.PI;if(o<0){o+=360}const s=Math.sqrt(n*n+i*i);return[e,s,o]};r.lch.lab=function(t){const e=t[0];const n=t[1];const i=t[2];const o=i/360*2*Math.PI;const r=n*Math.cos(o);const s=n*Math.sin(o);return[e,r,s]};r.rgb.ansi16=function(t,e=null){const[n,i,o]=t;let s=e===null?r.rgb.hsv(t)[2]:e;s=Math.round(s/50);if(s===0){return 30}let a=30+(Math.round(o/255)<<2|Math.round(i/255)<<1|Math.round(n/255));if(s===2){a+=60}return a};r.hsv.ansi16=function(t){return r.rgb.ansi16(r.hsv.rgb(t),t[2])};r.rgb.ansi256=function(t){const e=t[0];const n=t[1];const i=t[2];if(e===n&&n===i){if(e<8){return 16}if(e>248){return 231}return Math.round((e-8)/247*24)+232}const o=16+36*Math.round(e/255*5)+6*Math.round(n/255*5)+Math.round(i/255*5);return o};r.ansi16.rgb=function(t){let e=t%10;if(e===0||e===7){if(t>50){e+=3.5}e=e/10.5*255;return[e,e,e]}const n=(~~(t>50)+1)*.5;const i=(e&1)*n*255;const o=(e>>1&1)*n*255;const r=(e>>2&1)*n*255;return[i,o,r]};r.ansi256.rgb=function(t){if(t>=232){const e=(t-232)*10+8;return[e,e,e]}t-=16;let e;const n=Math.floor(t/36)/5*255;const i=Math.floor((e=t%36)/6)/5*255;const o=e%6/5*255;return[n,i,o]};r.rgb.hex=function(t){const e=((Math.round(t[0])&255)<<16)+((Math.round(t[1])&255)<<8)+(Math.round(t[2])&255);const n=e.toString(16).toUpperCase();return"000000".substring(n.length)+n};r.hex.rgb=function(t){const e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e){return[0,0,0]}let n=e[0];if(e[0].length===3){n=n.split("").map((t=>t+t)).join("")}const i=parseInt(n,16);const o=i>>16&255;const r=i>>8&255;const s=i&255;return[o,r,s]};r.rgb.hcg=function(t){const e=t[0]/255;const n=t[1]/255;const i=t[2]/255;const o=Math.max(Math.max(e,n),i);const r=Math.min(Math.min(e,n),i);const s=o-r;let a;let c;if(s<1){a=r/(1-s)}else{a=0}if(s<=0){c=0}else if(o===e){c=(n-i)/s%6}else if(o===n){c=2+(i-e)/s}else{c=4+(e-n)/s}c/=6;c%=1;return[c*360,s*100,a*100]};r.hsl.hcg=function(t){const e=t[1]/100;const n=t[2]/100;const i=n<.5?2*e*n:2*e*(1-n);let o=0;if(i<1){o=(n-.5*i)/(1-i)}return[t[0],i*100,o*100]};r.hsv.hcg=function(t){const e=t[1]/100;const n=t[2]/100;const i=e*n;let o=0;if(i<1){o=(n-i)/(1-i)}return[t[0],i*100,o*100]};r.hcg.rgb=function(t){const e=t[0]/360;const n=t[1]/100;const i=t[2]/100;if(n===0){return[i*255,i*255,i*255]}const o=[0,0,0];const r=e%1*6;const s=r%1;const a=1-s;let c=0;switch(Math.floor(r)){case 0:o[0]=1;o[1]=s;o[2]=0;break;case 1:o[0]=a;o[1]=1;o[2]=0;break;case 2:o[0]=0;o[1]=1;o[2]=s;break;case 3:o[0]=0;o[1]=a;o[2]=1;break;case 4:o[0]=s;o[1]=0;o[2]=1;break;default:o[0]=1;o[1]=0;o[2]=a}c=(1-n)*i;return[(n*o[0]+c)*255,(n*o[1]+c)*255,(n*o[2]+c)*255]};r.hcg.hsv=function(t){const e=t[1]/100;const n=t[2]/100;const i=e+n*(1-e);let o=0;if(i>0){o=e/i}return[t[0],o*100,i*100]};r.hcg.hsl=function(t){const e=t[1]/100;const n=t[2]/100;const i=n*(1-e)+.5*e;let o=0;if(i>0&&i<.5){o=e/(2*i)}else if(i>=.5&&i<1){o=e/(2*(1-i))}return[t[0],o*100,i*100]};r.hcg.hwb=function(t){const e=t[1]/100;const n=t[2]/100;const i=e+n*(1-e);return[t[0],(i-e)*100,(1-i)*100]};r.hwb.hcg=function(t){const e=t[1]/100;const n=t[2]/100;const i=1-n;const o=i-e;let r=0;if(o<1){r=(i-o)/(1-o)}return[t[0],o*100,r*100]};r.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]};r.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]};r.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]};r.gray.hsl=function(t){return[0,0,t[0]]};r.gray.hsv=r.gray.hsl;r.gray.hwb=function(t){return[0,100,t[0]]};r.gray.cmyk=function(t){return[0,0,0,t[0]]};r.gray.lab=function(t){return[t[0],0,0]};r.gray.hex=function(t){const e=Math.round(t[0]/100*255)&255;const n=(e<<16)+(e<<8)+e;const i=n.toString(16).toUpperCase();return"000000".substring(i.length)+i};r.rgb.gray=function(t){const e=(t[0]+t[1]+t[2])/3;return[e/255*100]}},2868:(t,e,n)=>{const i=n(5480);const o=n(1396);const r={};const s=Object.keys(i);function a(t){const e=function(...e){const n=e[0];if(n===undefined||n===null){return n}if(n.length>1){e=n}return t(e)};if("conversion"in t){e.conversion=t.conversion}return e}function c(t){const e=function(...e){const n=e[0];if(n===undefined||n===null){return n}if(n.length>1){e=n}const i=t(e);if(typeof i==="object"){for(let t=i.length,e=0;e{r[t]={};Object.defineProperty(r[t],"channels",{value:i[t].channels});Object.defineProperty(r[t],"labels",{value:i[t].labels});const e=o(t);const n=Object.keys(e);n.forEach((n=>{const i=e[n];r[t][n]=c(i);r[t][n].raw=a(i)}))}));t.exports=r},1396:(t,e,n)=>{const i=n(5480);function o(){const t={};const e=Object.keys(i);for(let n=e.length,i=0;i{"use strict";t.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},1296:(t,e,n)=>{"use strict";n.d(e,{c:()=>c});var i=n(4432);var o=n.n(i);var r=n(2312);var s=n.n(r);var a=s()(o());a.push([t.id,".ck-content code{background-color:hsla(0,0%,78%,.3);border-radius:2px;padding:.15em}.ck.ck-editor__editable .ck-code_selected{background-color:hsla(0,0%,78%,.5)}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-basic-styles/theme/code.css"],names:[],mappings:"AAKA,iBACC,kCAAuC,CAEvC,iBAAkB,CADlB,aAED,CAEA,0CACC,kCACD",sourcesContent:["/*\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck-content code {\n\tbackground-color: hsla(0, 0%, 78%, 0.3);\n\tpadding: .15em;\n\tborder-radius: 2px;\n}\n\n.ck.ck-editor__editable .ck-code_selected {\n\tbackground-color: hsla(0, 0%, 78%, 0.5);\n}\n"],sourceRoot:""}]);const c=a},5304:(t,e,n)=>{"use strict";n.d(e,{c:()=>c});var i=n(4432);var o=n.n(i);var r=n(2312);var s=n.n(r);var a=s()(o());a.push([t.id,".ck-content blockquote{border-left:5px solid #ccc;font-style:italic;margin-left:0;margin-right:0;overflow:hidden;padding-left:1.5em;padding-right:1.5em}.ck-content[dir=rtl] blockquote{border-left:0;border-right:5px solid #ccc}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-block-quote/theme/blockquote.css"],names:[],mappings:"AAKA,uBAWC,0BAAsC,CADtC,iBAAkB,CAFlB,aAAc,CACd,cAAe,CAPf,eAAgB,CAIhB,kBAAmB,CADnB,mBAOD,CAEA,gCACC,aAAc,CACd,2BACD",sourcesContent:['/*\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck-content blockquote {\n\t/* See #12 */\n\toverflow: hidden;\n\n\t/* https://github.com/ckeditor/ckeditor5-block-quote/issues/15 */\n\tpadding-right: 1.5em;\n\tpadding-left: 1.5em;\n\n\tmargin-left: 0;\n\tmargin-right: 0;\n\tfont-style: italic;\n\tborder-left: solid 5px hsl(0, 0%, 80%);\n}\n\n.ck-content[dir="rtl"] blockquote {\n\tborder-left: 0;\n\tborder-right: solid 5px hsl(0, 0%, 80%);\n}\n'],sourceRoot:""}]);const c=a},2040:(t,e,n)=>{"use strict";n.d(e,{c:()=>c});var i=n(4432);var o=n.n(i);var r=n(2312);var s=n.n(r);var a=s()(o());a.push([t.id,'.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position{display:inline;pointer-events:none;position:relative}.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position span{position:absolute;width:0}.ck.ck-editor__editable .ck-widget:-webkit-drag>.ck-widget__selection-handle,.ck.ck-editor__editable .ck-widget:-webkit-drag>.ck-widget__type-around{display:none}.ck.ck-clipboard-drop-target-line{pointer-events:none;position:absolute}:root{--ck-clipboard-drop-target-dot-width:12px;--ck-clipboard-drop-target-dot-height:8px;--ck-clipboard-drop-target-color:var(--ck-color-focus-border)}.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position span{background:var(--ck-clipboard-drop-target-color);border:1px solid var(--ck-clipboard-drop-target-color);bottom:calc(var(--ck-clipboard-drop-target-dot-height)*-.5);margin-left:-1px;top:calc(var(--ck-clipboard-drop-target-dot-height)*-.5)}.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position span:after{border-color:var(--ck-clipboard-drop-target-color) transparent transparent transparent;border-style:solid;border-width:calc(var(--ck-clipboard-drop-target-dot-height)) calc(var(--ck-clipboard-drop-target-dot-width)*.5) 0 calc(var(--ck-clipboard-drop-target-dot-width)*.5);content:"";display:block;height:0;left:50%;position:absolute;top:calc(var(--ck-clipboard-drop-target-dot-height)*-.5);transform:translateX(-50%);width:0}.ck.ck-editor__editable .ck-widget.ck-clipboard-drop-target-range{outline:var(--ck-widget-outline-thickness) solid var(--ck-clipboard-drop-target-color)!important}.ck.ck-editor__editable .ck-widget:-webkit-drag{zoom:.6;outline:none!important}.ck.ck-clipboard-drop-target-line{background:var(--ck-clipboard-drop-target-color);border:1px solid var(--ck-clipboard-drop-target-color);height:0;margin-top:-1px}.ck.ck-clipboard-drop-target-line:before{border-style:solid;content:"";height:0;position:absolute;top:calc(var(--ck-clipboard-drop-target-dot-width)*-.5);width:0}[dir=ltr] .ck.ck-clipboard-drop-target-line:before{border-color:transparent transparent transparent var(--ck-clipboard-drop-target-color);border-width:calc(var(--ck-clipboard-drop-target-dot-width)*.5) 0 calc(var(--ck-clipboard-drop-target-dot-width)*.5) var(--ck-clipboard-drop-target-dot-height);left:-1px}[dir=rtl] .ck.ck-clipboard-drop-target-line:before{border-color:transparent var(--ck-clipboard-drop-target-color) transparent transparent;border-width:calc(var(--ck-clipboard-drop-target-dot-width)*.5) var(--ck-clipboard-drop-target-dot-height) calc(var(--ck-clipboard-drop-target-dot-width)*.5) 0;right:-1px}',"",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-clipboard/theme/clipboard.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-clipboard/clipboard.css"],names:[],mappings:"AASC,8DACC,cAAe,CAEf,mBAAoB,CADpB,iBAOD,CAJC,mEACC,iBAAkB,CAClB,OACD,CAWA,qJACC,YACD,CAIF,kCAEC,mBAAoB,CADpB,iBAED,CC9BA,MACC,yCAA0C,CAC1C,yCAA0C,CAC1C,6DACD,CAOE,mEAIC,gDAAiD,CADjD,sDAAuD,CAFvD,2DAA8D,CAI9D,gBAAiB,CAHjB,wDAqBD,CAfC,yEAWC,sFAAuF,CAEvF,kBAAmB,CADnB,qKAA0K,CAX1K,UAAW,CAIX,aAAc,CAFd,QAAS,CAIT,QAAS,CADT,iBAAkB,CAElB,wDAA2D,CAE3D,0BAA2B,CAR3B,OAYD,CAOF,kEACC,gGACD,CAKA,gDACC,OAAS,CACT,sBACD,CAGD,kCAGC,gDAAiD,CADjD,sDAAuD,CADvD,QAAS,CAGT,eAwBD,CAtBC,yCAMC,kBAAmB,CALnB,UAAW,CAIX,QAAS,CAHT,iBAAkB,CAClB,uDAA0D,CAC1D,OAiBD,CArBA,mDAYE,sFAAuF,CADvF,+JAAoK,CAFpK,SAYF,CArBA,mDAmBE,sFAAuF,CADvF,+JAAmK,CAFnK,UAKF",sourcesContent:["/*\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck.ck-editor__editable {\n\t/*\n\t * Vertical drop target (in text).\n\t */\n\t& .ck.ck-clipboard-drop-target-position {\n\t\tdisplay: inline;\n\t\tposition: relative;\n\t\tpointer-events: none;\n\n\t\t& span {\n\t\t\tposition: absolute;\n\t\t\twidth: 0;\n\t\t}\n\t}\n\n\t/*\n\t * Styles of the widget being dragged (its preview).\n\t */\n\t& .ck-widget:-webkit-drag {\n\t\t& > .ck-widget__selection-handle {\n\t\t\tdisplay: none;\n\t\t}\n\n\t\t& > .ck-widget__type-around {\n\t\t\tdisplay: none;\n\t\t}\n\t}\n}\n\n.ck.ck-clipboard-drop-target-line {\n\tposition: absolute;\n\tpointer-events: none;\n}\n","/*\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import \"@ckeditor/ckeditor5-ui/theme/mixins/_dir.css\";\n\n:root {\n\t--ck-clipboard-drop-target-dot-width: 12px;\n\t--ck-clipboard-drop-target-dot-height: 8px;\n\t--ck-clipboard-drop-target-color: var(--ck-color-focus-border);\n}\n\n.ck.ck-editor__editable {\n\t/*\n\t * Vertical drop target (in text).\n\t */\n\t& .ck.ck-clipboard-drop-target-position {\n\t\t& span {\n\t\t\tbottom: calc(-.5 * var(--ck-clipboard-drop-target-dot-height));\n\t\t\ttop: calc(-.5 * var(--ck-clipboard-drop-target-dot-height));\n\t\t\tborder: 1px solid var(--ck-clipboard-drop-target-color);\n\t\t\tbackground: var(--ck-clipboard-drop-target-color);\n\t\t\tmargin-left: -1px;\n\n\t\t\t/* The triangle above the marker */\n\t\t\t&::after {\n\t\t\t\tcontent: '';\n\t\t\t\twidth: 0;\n\t\t\t\theight: 0;\n\n\t\t\t\tdisplay: block;\n\t\t\t\tposition: absolute;\n\t\t\t\tleft: 50%;\n\t\t\t\ttop: calc(-.5 * var(--ck-clipboard-drop-target-dot-height));\n\n\t\t\t\ttransform: translateX(-50%);\n\t\t\t\tborder-color: var(--ck-clipboard-drop-target-color) transparent transparent transparent;\n\t\t\t\tborder-width: calc(var(--ck-clipboard-drop-target-dot-height)) calc(.5 * var(--ck-clipboard-drop-target-dot-width)) 0 calc(.5 * var(--ck-clipboard-drop-target-dot-width));\n\t\t\t\tborder-style: solid;\n\t\t\t}\n\t\t}\n\t}\n\n\t/*\n\t * Styles of the widget that it a drop target.\n\t */\n\t& .ck-widget.ck-clipboard-drop-target-range {\n\t\toutline: var(--ck-widget-outline-thickness) solid var(--ck-clipboard-drop-target-color) !important;\n\t}\n\n\t/*\n\t * Styles of the widget being dragged (its preview).\n\t */\n\t& .ck-widget:-webkit-drag {\n\t\tzoom: 0.6;\n\t\toutline: none !important;\n\t}\n}\n\n.ck.ck-clipboard-drop-target-line {\n\theight: 0;\n\tborder: 1px solid var(--ck-clipboard-drop-target-color);\n\tbackground: var(--ck-clipboard-drop-target-color);\n\tmargin-top: -1px;\n\n\t&::before {\n\t\tcontent: '';\n\t\tposition: absolute;\n\t\ttop: calc(-.5 * var(--ck-clipboard-drop-target-dot-width));\n\t\twidth: 0;\n\t\theight: 0;\n\t\tborder-style: solid;\n\n\t\t@mixin ck-dir ltr {\n\t\t\tleft: -1px;\n\n\t\t\tborder-width: calc(.5 * var(--ck-clipboard-drop-target-dot-width)) 0 calc(.5 * var(--ck-clipboard-drop-target-dot-width)) var(--ck-clipboard-drop-target-dot-height);\n\t\t\tborder-color: transparent transparent transparent var(--ck-clipboard-drop-target-color);\n\t\t}\n\n\t\t@mixin ck-dir rtl {\n\t\t\tright: -1px;\n\n\t\t\tborder-width:calc(.5 * var(--ck-clipboard-drop-target-dot-width)) var(--ck-clipboard-drop-target-dot-height) calc(.5 * var(--ck-clipboard-drop-target-dot-width)) 0;\n\t\t\tborder-color: transparent var(--ck-clipboard-drop-target-color) transparent transparent;\n\t\t}\n\t}\n}\n"],sourceRoot:""}]);const c=a},8584:(t,e,n)=>{"use strict";n.d(e,{c:()=>c});var i=n(4432);var o=n.n(i);var r=n(2312);var s=n.n(r);var a=s()(o());a.push([t.id,".ck.ck-editor{position:relative}.ck.ck-editor .ck-editor__top .ck-sticky-panel .ck-toolbar{z-index:var(--ck-z-panel)}.ck.ck-editor__top .ck-sticky-panel .ck-toolbar{border-radius:0}.ck-rounded-corners .ck.ck-editor__top .ck-sticky-panel .ck-toolbar,.ck.ck-editor__top .ck-sticky-panel .ck-toolbar.ck-rounded-corners{border-radius:var(--ck-border-radius);border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-editor__top .ck-sticky-panel .ck-toolbar{border-bottom-width:0}.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar{border-bottom-width:1px;border-radius:0}.ck-rounded-corners .ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar,.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar.ck-rounded-corners{border-radius:var(--ck-border-radius);border-radius:0}.ck.ck-editor__main>.ck-editor__editable{background:var(--ck-color-base-background);border-radius:0}.ck-rounded-corners .ck.ck-editor__main>.ck-editor__editable,.ck.ck-editor__main>.ck-editor__editable.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-top-right-radius:0}.ck.ck-editor__main>.ck-editor__editable:not(.ck-focused){border-color:var(--ck-color-base-border)}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-editor-classic/theme/classiceditor.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-editor-classic/classiceditor.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css"],names:[],mappings:"AAKA,cAIC,iBAMD,CAJC,2DAEC,yBACD,CCLC,gDCED,eDKC,CAPA,uICMA,qCAAsC,CDJpC,2BAA4B,CAC5B,4BAIF,CAPA,gDAMC,qBACD,CAEA,iFACC,uBAAwB,CCR1B,eDaC,CANA,yMCHA,qCAAsC,CDOpC,eAEF,CAKF,yCAEC,0CAA2C,CCpB3C,eD8BD,CAZA,yHCdE,qCAAsC,CDmBtC,wBAAyB,CACzB,yBAMF,CAHC,0DACC,wCACD",sourcesContent:["/*\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck.ck-editor {\n\t/* All the elements within `.ck-editor` are positioned relatively to it.\n\t If any element needs to be positioned with respect to the , etc.,\n\t it must land outside of the `.ck-editor` in DOM. */\n\tposition: relative;\n\n\t& .ck-editor__top .ck-sticky-panel .ck-toolbar {\n\t\t/* https://github.com/ckeditor/ckeditor5-editor-classic/issues/62 */\n\t\tz-index: var(--ck-z-panel);\n\t}\n}\n",'/*\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import "../mixins/_rounded.css";\n\n.ck.ck-editor__top {\n\t& .ck-sticky-panel {\n\t\t& .ck-toolbar {\n\t\t\t@mixin ck-rounded-corners {\n\t\t\t\tborder-bottom-left-radius: 0;\n\t\t\t\tborder-bottom-right-radius: 0;\n\t\t\t}\n\n\t\t\tborder-bottom-width: 0;\n\t\t}\n\n\t\t& .ck-sticky-panel__content_sticky .ck-toolbar {\n\t\t\tborder-bottom-width: 1px;\n\n\t\t\t@mixin ck-rounded-corners {\n\t\t\t\tborder-radius: 0;\n\t\t\t}\n\t\t}\n\t}\n}\n\n/* Note: Use ck-editor__main to make sure these styles don\'t apply to other editor types */\n.ck.ck-editor__main > .ck-editor__editable {\n\t/* https://github.com/ckeditor/ckeditor5-theme-lark/issues/113 */\n\tbackground: var(--ck-color-base-background);\n\n\t@mixin ck-rounded-corners {\n\t\tborder-top-left-radius: 0;\n\t\tborder-top-right-radius: 0;\n\t}\n\n\t&:not(.ck-focused) {\n\t\tborder-color: var(--ck-color-base-border);\n\t}\n}\n',"/*\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * Implements rounded corner interface for .ck-rounded-corners class.\n *\n * @see $ck-border-radius\n */\n@define-mixin ck-rounded-corners {\n\tborder-radius: 0;\n\n\t@nest .ck-rounded-corners &,\n\t&.ck-rounded-corners {\n\t\tborder-radius: var(--ck-border-radius);\n\t\t@mixin-content;\n\t}\n}\n"],sourceRoot:""}]);const c=a},152:(t,e,n)=>{"use strict";n.d(e,{c:()=>c});var i=n(4432);var o=n.n(i);var r=n(2312);var s=n.n(r);var a=s()(o());a.push([t.id,".ck .ck-placeholder,.ck.ck-placeholder{position:relative}.ck .ck-placeholder:before,.ck.ck-placeholder:before{content:attr(data-placeholder);left:0;pointer-events:none;position:absolute;right:0}.ck.ck-read-only .ck-placeholder:before{display:none}.ck.ck-reset_all .ck-placeholder{position:relative}.ck .ck-placeholder:before,.ck.ck-placeholder:before{color:var(--ck-color-engine-placeholder-text);cursor:text}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-engine/theme/placeholder.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-engine/placeholder.css"],names:[],mappings:"AAMA,uCAEC,iBAWD,CATC,qDAIC,8BAA+B,CAF/B,MAAO,CAKP,mBAAoB,CANpB,iBAAkB,CAElB,OAKD,CAKA,wCACC,YACD,CAQD,iCACC,iBACD,CC5BC,qDAEC,6CAA8C,CAD9C,WAED",sourcesContent:["/*\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/* See ckeditor/ckeditor5#936. */\n.ck.ck-placeholder,\n.ck .ck-placeholder {\n\tposition: relative;\n\n\t&::before {\n\t\tposition: absolute;\n\t\tleft: 0;\n\t\tright: 0;\n\t\tcontent: attr(data-placeholder);\n\n\t\t/* See ckeditor/ckeditor5#469. */\n\t\tpointer-events: none;\n\t}\n}\n\n/* See ckeditor/ckeditor5#1987. */\n.ck.ck-read-only .ck-placeholder {\n\t&::before {\n\t\tdisplay: none;\n\t}\n}\n\n/*\n * Rules for the `ck-placeholder` are loaded before the rules for `ck-reset_all` in the base CKEditor 5 DLL build.\n * This fix overwrites the incorrectly set `position: static` from `ck-reset_all`.\n * See https://github.com/ckeditor/ckeditor5/issues/11418.\n */\n.ck.ck-reset_all .ck-placeholder {\n\tposition: relative;\n}\n","/*\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/* See ckeditor/ckeditor5#936. */\n.ck.ck-placeholder, .ck .ck-placeholder {\n\t&::before {\n\t\tcursor: text;\n\t\tcolor: var(--ck-color-engine-placeholder-text);\n\t}\n}\n"],sourceRoot:""}]);const c=a},7148:(t,e,n)=>{"use strict";n.d(e,{c:()=>c});var i=n(4432);var o=n.n(i);var r=n(2312);var s=n.n(r);var a=s()(o());a.push([t.id,".ck.ck-editor__editable span[data-ck-unsafe-element]{display:none}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-engine/theme/renderer.css"],names:[],mappings:"AAMA,qDACC,YACD",sourcesContent:["/*\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/* Elements marked by the Renderer as hidden should be invisible in the editor. */\n.ck.ck-editor__editable span[data-ck-unsafe-element] {\n\tdisplay: none;\n}\n"],sourceRoot:""}]);const c=a},4531:(t,e,n)=>{"use strict";n.d(e,{c:()=>c});var i=n(4432);var o=n.n(i);var r=n(2312);var s=n.n(r);var a=s()(o());a.push([t.id,".ck-find-result{background:var(--ck-color-highlight-background);color:var(--ck-color-text)}.ck-find-result_selected{background:#ff9633}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-find-and-replace/theme/findandreplace.css"],names:[],mappings:"AAKA,gBACC,+CAAgD,CAChD,0BACD,CAEA,yBACC,kBACD",sourcesContent:["/*\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck-find-result {\n\tbackground: var(--ck-color-highlight-background);\n\tcolor: var(--ck-color-text);\n}\n\n.ck-find-result_selected {\n\tbackground: hsl(29, 100%, 60%);\n}\n"],sourceRoot:""}]);const c=a},6060:(t,e,n)=>{"use strict";n.d(e,{c:()=>c});var i=n(4432);var o=n.n(i);var r=n(2312);var s=n.n(r);var a=s()(o());a.push([t.id,".ck.ck-find-and-replace-form{max-width:100%;& .ck-find-and-replace-form__inputs,.ck-find-and-replace-form__actions{display:flex}& .ck-find-and-replace-form__inputs.ck-find-and-replace-form__inputs .ck-results-counter,.ck-find-and-replace-form__actions.ck-find-and-replace-form__inputs .ck-results-counter{position:absolute}}.ck.ck-find-and-replace-form{width:400px}.ck.ck-find-and-replace-form:focus{outline:none}.ck.ck-find-and-replace-form .ck-find-and-replace-form__actions,.ck.ck-find-and-replace-form .ck-find-and-replace-form__inputs{align-content:stretch;align-items:center;flex:1 1 auto;flex-direction:row;flex-wrap:wrap;margin:0;padding:var(--ck-spacing-large)}.ck.ck-find-and-replace-form .ck-find-and-replace-form__actions>.ck-button,.ck.ck-find-and-replace-form .ck-find-and-replace-form__inputs>.ck-button{flex:0 0 auto}[dir=ltr] .ck.ck-find-and-replace-form .ck-find-and-replace-form__actions>*+*,[dir=ltr] .ck.ck-find-and-replace-form .ck-find-and-replace-form__inputs>*+*{margin-left:var(--ck-spacing-standard)}[dir=rtl] .ck.ck-find-and-replace-form .ck-find-and-replace-form__actions>*+*,[dir=rtl] .ck.ck-find-and-replace-form .ck-find-and-replace-form__inputs>*+*{margin-right:var(--ck-spacing-standard)}.ck.ck-find-and-replace-form .ck-find-and-replace-form__actions .ck-labeled-field-view,.ck.ck-find-and-replace-form .ck-find-and-replace-form__inputs .ck-labeled-field-view{flex:1 1 auto}.ck.ck-find-and-replace-form .ck-find-and-replace-form__actions .ck-labeled-field-view .ck-input,.ck.ck-find-and-replace-form .ck-find-and-replace-form__inputs .ck-labeled-field-view .ck-input{min-width:50px;width:100%}.ck.ck-find-and-replace-form .ck-find-and-replace-form__inputs{align-items:flex-start}.ck.ck-find-and-replace-form .ck-find-and-replace-form__inputs>.ck-button-prev>.ck-icon{transform:rotate(90deg)}.ck.ck-find-and-replace-form .ck-find-and-replace-form__inputs>.ck-button-next>.ck-icon{transform:rotate(-90deg)}.ck.ck-find-and-replace-form .ck-find-and-replace-form__inputs .ck-results-counter{top:50%;transform:translateY(-50%)}[dir=ltr] .ck.ck-find-and-replace-form .ck-find-and-replace-form__inputs .ck-results-counter{right:var(--ck-spacing-standard)}[dir=rtl] .ck.ck-find-and-replace-form .ck-find-and-replace-form__inputs .ck-results-counter{left:var(--ck-spacing-standard)}.ck.ck-find-and-replace-form .ck-find-and-replace-form__inputs .ck-results-counter{color:var(--ck-color-base-border)}.ck.ck-find-and-replace-form .ck-find-and-replace-form__inputs>.ck-labeled-field-replace{flex:0 0 100%;padding-top:var(--ck-spacing-standard)}[dir=ltr] .ck.ck-find-and-replace-form .ck-find-and-replace-form__inputs>.ck-labeled-field-replace{margin-left:0}[dir=rtl] .ck.ck-find-and-replace-form .ck-find-and-replace-form__inputs>.ck-labeled-field-replace{margin-right:0}.ck.ck-find-and-replace-form .ck-find-and-replace-form__actions{flex-wrap:wrap;justify-content:flex-end;margin-top:calc(var(--ck-spacing-large)*-1)}.ck.ck-find-and-replace-form .ck-find-and-replace-form__actions>.ck-button-find{font-weight:700}.ck.ck-find-and-replace-form .ck-find-and-replace-form__actions>.ck-button-find .ck-button__label{padding-left:var(--ck-spacing-large);padding-right:var(--ck-spacing-large)}.ck.ck-find-and-replace-form .ck-switchbutton{align-items:center;display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:space-between;width:100%}@media screen and (max-width:600px){.ck.ck-find-and-replace-form{max-width:100%;width:300px}.ck.ck-find-and-replace-form.ck-find-and-replace-form__input{flex-wrap:wrap}.ck.ck-find-and-replace-form.ck-find-and-replace-form__input .ck-labeled-field-view{flex:1 0 auto;margin-bottom:var(--ck-spacing-standard);width:100%}.ck.ck-find-and-replace-form.ck-find-and-replace-form__input>.ck-button{text-align:center}.ck.ck-find-and-replace-form.ck-find-and-replace-form__input>.ck-button:first-of-type{flex:1 1 auto}[dir=ltr] .ck.ck-find-and-replace-form.ck-find-and-replace-form__input>.ck-button:first-of-type{margin-left:0}[dir=rtl] .ck.ck-find-and-replace-form.ck-find-and-replace-form__input>.ck-button:first-of-type{margin-right:0}.ck.ck-find-and-replace-form.ck-find-and-replace-form__input>.ck-button:first-of-type .ck-button__label{text-align:center;width:100%}.ck.ck-find-and-replace-form.ck-find-and-replace-form__actions>:not(.ck-labeled-field-view){flex:1 1 auto;flex-wrap:wrap}.ck.ck-find-and-replace-form.ck-find-and-replace-form__actions>:not(.ck-labeled-field-view)>.ck-button{text-align:center}.ck.ck-find-and-replace-form.ck-find-and-replace-form__actions>:not(.ck-labeled-field-view)>.ck-button:first-of-type{flex:1 1 auto}[dir=ltr] .ck.ck-find-and-replace-form.ck-find-and-replace-form__actions>:not(.ck-labeled-field-view)>.ck-button:first-of-type{margin-left:0}[dir=rtl] .ck.ck-find-and-replace-form.ck-find-and-replace-form__actions>:not(.ck-labeled-field-view)>.ck-button:first-of-type{margin-right:0}.ck.ck-find-and-replace-form.ck-find-and-replace-form__actions>:not(.ck-labeled-field-view)>.ck-button .ck-button__label{text-align:center;width:100%}}","",{version:3,sources:["webpack://./node_modules/@ckeditor/ckeditor5-find-and-replace/theme/findandreplaceform.css","webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-find-and-replace/findandreplaceform.css","webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css"],names:[],mappings:"AAKA,6BACC,cAAe,CAEf,uEACC,YAMD,CAHC,iLACC,iBACD,CAEF,CCRA,6BACC,WAoHD,CA9GC,mCACC,YACD,CAGA,+HAMC,qBAAsB,CADtB,kBAAmB,CAHnB,aAAc,CACd,kBAAmB,CACnB,cAAe,CAKf,QAAS,CADT,+BA4BD,CAzBC,qJACC,aACD,CAGC,2JACC,sCACD,CAIA,2JACC,uCACD,CAGD,6KACC,aAMD,CAJC,iMAEC,cAAe,CADf,UAED,CAMF,+DAEC,sBAqCD,CAnCC,wFACC,uBACD,CAEA,wFACC,wBACD,CAEA,mFACC,OAAQ,CACR,0BAWD,CAbA,6FAKE,gCAQF,CAbA,6FASE,+BAIF,CAbA,mFAYC,iCACD,CAEA,yFACC,aAAc,CACd,sCASD,CAXA,mGAKE,aAMF,CAXA,mGASE,cAEF,CAID,gEACC,cAAe,CACf,wBAAyB,CACzB,2CAWD,CATC,gFACC,eAOD,CAJC,kGACC,oCAAqC,CACrC,qCACD,CAIF,8CAMC,kBAAmB,CAJnB,YAAa,CACb,kBAAmB,CACnB,gBAAiB,CACjB,6BAA8B,CAJ9B,UAMD,CCtHA,oCD0HA,6BAIC,cAAe,CAHf,WA+DD,CAzDC,6DACC,cA4BD,CA1BC,oFACC,aAAc,CAEd,wCAAyC,CADzC,UAED,CAEA,wEACC,iBAkBD,CAhBC,sFACC,aAcD,CAfA,gGAIE,aAWF,CAfA,gGAQE,cAOF,CAJC,wGAEC,iBAAkB,CADlB,UAED,CAMH,4FAEC,aAAc,CADd,cAuBD,CApBC,uGACC,iBAkBD,CAhBC,qHACC,aASD,CAVA,+HAIE,aAMF,CAVA,+HAQE,cAEF,CAEA,yHAEC,iBAAkB,CADlB,UAED,CCrLH",sourcesContent:["/*\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck.ck-find-and-replace-form {\n\tmax-width: 100%;\n\n\t& .ck-find-and-replace-form__inputs, .ck-find-and-replace-form__actions {\n\t\tdisplay: flex;\n\n\t\t/* The inputs area styles */\n\t\t&.ck-find-and-replace-form__inputs .ck-results-counter {\n\t\t\tposition: absolute;\n\t\t}\n\t}\n}\n",'/*\n * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n@import "@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css";\n@import "@ckeditor/ckeditor5-ui/theme/mixins/_dir.css";\n\n.ck.ck-find-and-replace-form {\n\twidth: 400px;\n\n\t/*\n\t * The
").replace(/\r?\n/g," ").replace(/\t/g," ").replace(/^\s/," ").replace(/\s$/," ").replace(/\s\s/g," ");if(t.includes("
")||t.includes(" ")){t=`
${t}
`}return t}function xM(t){return t.replace(/(\s+)<\/span>/g,((t,e)=>{if(e.length==1){return" "}return e})).replace(//g,"")}const EM=["figcaption","li"];const DM=["ol","ul"];function TM(t){if(t.is("$text")||t.is("$textProxy")){return t.data}if(t.is("element","img")&&t.hasAttribute("alt")){return t.getAttribute("alt")}if(t.is("element","br")){return"\n"}let e="";let n=null;for(const i of t.getChildren()){e+=SM(i,n)+TM(i);n=i}return e}function SM(t,e){if(!e){return""}if(t.is("element","li")&&!t.isEmpty&&t.getChild(0).is("containerElement")){return"\n\n"}if(DM.includes(t.name)&&DM.includes(e.name)){return"\n\n"}if(!t.is("containerElement")&&!e.is("containerElement")){return""}if(EM.includes(t.name)||EM.includes(e.name)){return"\n"}return"\n\n"}class IM extends bh{static get pluginName(){return"ClipboardPipeline"}init(){const t=this.editor;const e=t.editing.view;e.addObserver(_M);this._setupPasteDrop();this._setupCopyCut()}_fireOutputTransformationEvent(t,e,n){const i=this.editor.model.getSelectedContent(e);this.fire("outputTransformation",{dataTransfer:t,content:i,method:n})}_setupPasteDrop(){const t=this.editor;const e=t.model;const n=t.editing.view;const i=n.document;this.listenTo(i,"clipboardInput",((e,n)=>{if(n.method=="paste"&&!t.model.canEditAt(t.model.document.selection)){e.stop()}}),{priority:"highest"});this.listenTo(i,"clipboardInput",((t,e)=>{const i=e.dataTransfer;let o;if(e.content){o=e.content}else{let t="";if(i.getData("text/html")){t=xM(i.getData("text/html"))}else if(i.getData("text/plain")){t=yM(i.getData("text/plain"))}o=this.editor.data.htmlProcessor.toView(t)}const r=new D(this,"inputTransformation");this.fire(r,{content:o,dataTransfer:i,targetRanges:e.targetRanges,method:e.method});if(r.stop.called){t.stop()}n.scrollToTheSelection()}),{priority:"low"});this.listenTo(this,"inputTransformation",((t,n)=>{if(n.content.isEmpty){return}const i=this.editor.data;const o=i.toModel(n.content,"$clipboardHolder");if(o.childCount==0){return}t.stop();e.change((()=>{this.fire("contentInsertion",{content:o,method:n.method,dataTransfer:n.dataTransfer,targetRanges:n.targetRanges})}))}),{priority:"low"});this.listenTo(this,"contentInsertion",((t,n)=>{n.resultRange=e.insertContent(n.content)}),{priority:"low"})}_setupCopyCut(){const t=this.editor;const e=t.model.document;const n=t.editing.view;const i=n.document;const o=(t,n)=>{const i=n.dataTransfer;n.preventDefault();this._fireOutputTransformationEvent(i,e.selection,t.name)};this.listenTo(i,"copy",o,{priority:"low"});this.listenTo(i,"cut",((e,n)=>{if(!t.model.canEditAt(t.model.document.selection)){n.preventDefault()}else{o(e,n)}}),{priority:"low"});this.listenTo(this,"outputTransformation",((e,n)=>{const o=t.data.toView(n.content);i.fire("clipboardOutput",{dataTransfer:n.dataTransfer,content:o,method:n.method})}),{priority:"low"});this.listenTo(i,"clipboardOutput",((n,i)=>{if(!i.content.isEmpty){i.dataTransfer.setData("text/html",this.editor.data.htmlProcessor.toData(i.content));i.dataTransfer.setData("text/plain",TM(i.content))}if(i.method=="cut"){t.model.deleteContent(e.selection)}}),{priority:"low"})}}class BM extends($()){constructor(){super(...arguments);this._stack=[]}add(t,e){const n=this._stack;const i=n[0];this._insertDescriptor(t);const o=n[0];if(i!==o&&!MM(i,o)){this.fire("change:top",{oldDescriptor:i,newDescriptor:o,writer:e})}}remove(t,e){const n=this._stack;const i=n[0];this._removeDescriptor(t);const o=n[0];if(i!==o&&!MM(i,o)){this.fire("change:top",{oldDescriptor:i,newDescriptor:o,writer:e})}}_insertDescriptor(t){const e=this._stack;const n=e.findIndex((e=>e.id===t.id));if(MM(t,e[n])){return}if(n>-1){e.splice(n,1)}let i=0;while(e[i]&&LM(e[i],t)){i++}e.splice(i,0,t)}_removeDescriptor(t){const e=this._stack;const n=e.findIndex((e=>e.id===t));if(n>-1){e.splice(n,1)}}}function MM(t,e){return t&&e&&t.priority==e.priority&&NM(t.classes)==NM(e.classes)}function LM(t,e){if(t.priority>e.priority){return true}else if(t.priorityNM(e.classes)}function NM(t){return Array.isArray(t)?t.sort().join(","):t}const PM=' ';const zM="ck-widget";const RM="ck-widget_selected";function VM(t){if(!t.is("element")){return false}return!!t.getCustomProperty("widget")}function OM(t,e,n={}){if(!t.is("containerElement")){throw new N("widget-to-widget-wrong-element-type",null,{element:t})}e.setAttribute("contenteditable","false",t);e.addClass(zM,t);e.setCustomProperty("widget",true,t);t.getFillerOffset=KM;e.setCustomProperty("widgetLabel",[],t);if(n.label){UM(t,n.label)}if(n.hasSelectionHandle){YM(t,e)}HM(t,e);return t}function FM(t,e,n){if(e.classes){n.addClass(ol(e.classes),t)}if(e.attributes){for(const i in e.attributes){n.setAttribute(i,e.attributes[i],t)}}}function jM(t,e,n){if(e.classes){n.removeClass(ol(e.classes),t)}if(e.attributes){for(const i in e.attributes){n.removeAttribute(i,t)}}}function HM(t,e,n=FM,i=jM){const o=new BM;o.on("change:top",((e,o)=>{if(o.oldDescriptor){i(t,o.oldDescriptor,o.writer)}if(o.newDescriptor){n(t,o.newDescriptor,o.writer)}}));const r=(t,e,n)=>o.add(e,n);const s=(t,e,n)=>o.remove(e,n);e.setCustomProperty("addHighlight",r,t);e.setCustomProperty("removeHighlight",s,t)}function UM(t,e){const n=t.getCustomProperty("widgetLabel");n.push(e)}function WM(t){const e=t.getCustomProperty("widgetLabel");return e.reduce(((t,e)=>{if(typeof e==="function"){return t?t+". "+e():e()}else{return t?t+". "+e:e}}),"")}function GM(t,e,n={}){e.addClass(["ck-editor__editable","ck-editor__nested-editable"],t);e.setAttribute("role","textbox",t);if(n.label){e.setAttribute("aria-label",n.label,t)}e.setAttribute("contenteditable",t.isReadOnly?"false":"true",t);t.on("change:isReadOnly",((n,i,o)=>{e.setAttribute("contenteditable",o?"false":"true",t)}));t.on("change:isFocused",((n,i,o)=>{if(o){e.addClass("ck-editor__nested-editable_focused",t)}else{e.removeClass("ck-editor__nested-editable_focused",t)}}));HM(t,e);return t}function qM(t,e){const n=t.getSelectedElement();if(n){const i=eL(t);if(i){return e.createRange(e.createPositionAt(n,i))}}return e.schema.findOptimalInsertionRange(t)}function $M(t,e){return(n,i)=>{const{mapper:o,viewPosition:r}=i;const s=o.findMappedViewAncestor(r);if(!e(s)){return}const a=o.toModelElement(s);i.modelPosition=t.createPositionAt(a,r.isAtStart?"before":"after")}}function KM(){return null}function YM(t,e){const n=e.createUIElement("div",{class:"ck ck-widget__selection-handle"},(function(t){const e=this.toDomElement(t);const n=new Cd;n.set("content",PM);n.render();e.appendChild(n.element);return e}));e.insert(e.createPositionAt(t,0),n);e.addClass(["ck-widget_with-selection-handle"],t)}const QM="widget-type-around";function ZM(t,e,n){return!!t&&VM(t)&&!n.isInline(e)}function JM(t){return t.closest(".ck-widget__type-around__button")}function XM(t){return t.classList.contains("ck-widget__type-around__button_before")?"before":"after"}function tL(t,e){const n=t.closest(".ck-widget");return e.mapDomToView(n)}function eL(t){return t.getAttribute(QM)}const nL=' ';var iL=n(4380);var oL={injectType:"singletonStyleTag",attributes:{"data-cke":true}};oL.insert="head";oL.singleton=true;var rL=Pl()(iL.c,oL);const sL=iL.c.locals||{};const aL=["before","after"];const cL=(new DOMParser).parseFromString(nL,"image/svg+xml").firstChild;const lL="ck-widget__type-around_disabled";class dL extends bh{constructor(){super(...arguments);this._currentFakeCaretModelElement=null}static get pluginName(){return"WidgetTypeAround"}static get requires(){return[oM,LI]}init(){const t=this.editor;const e=t.editing.view;this.on("change:isEnabled",((n,i,o)=>{e.change((t=>{for(const n of e.document.roots){if(o){t.removeClass(lL,n)}else{t.addClass(lL,n)}}}));if(!o){t.model.change((t=>{t.removeSelectionAttribute(QM)}))}}));this._enableTypeAroundUIInjection();this._enableInsertingParagraphsOnButtonClick();this._enableInsertingParagraphsOnEnterKeypress();this._enableInsertingParagraphsOnTypingKeystroke();this._enableTypeAroundFakeCaretActivationUsingKeyboardArrows();this._enableDeleteIntegration();this._enableInsertContentIntegration();this._enableInsertObjectIntegration();this._enableDeleteContentIntegration()}destroy(){super.destroy();this._currentFakeCaretModelElement=null}_insertParagraph(t,e){const n=this.editor;const i=n.editing.view;const o=n.model.schema.getAttributesWithProperty(t,"copyOnReplace",true);n.execute("insertParagraph",{position:n.model.createPositionAt(t,e),attributes:o});i.focus();i.scrollToTheSelection()}_listenToIfEnabled(t,e,n,i){this.listenTo(t,e,((...t)=>{if(this.isEnabled){n(...t)}}),i)}_insertParagraphAccordingToFakeCaretPosition(){const t=this.editor;const e=t.model;const n=e.document.selection;const i=eL(n);if(!i){return false}const o=n.getSelectedElement();this._insertParagraph(o,i);return true}_enableTypeAroundUIInjection(){const t=this.editor;const e=t.model.schema;const n=t.locale.t;const i={before:n("Insert paragraph before block"),after:n("Insert paragraph after block")};t.editing.downcastDispatcher.on("insert",((t,o,r)=>{const s=r.mapper.toViewElement(o.item);if(!s){return}if(ZM(s,o.item,e)){uL(r.writer,i,s);const t=s.getCustomProperty("widgetLabel");t.push((()=>this.isEnabled?n("Press Enter to type after or press Shift + Enter to type before the widget"):""))}}),{priority:"low"})}_enableTypeAroundFakeCaretActivationUsingKeyboardArrows(){const t=this.editor;const e=t.model;const n=e.document.selection;const i=e.schema;const o=t.editing.view;this._listenToIfEnabled(o.document,"arrowKey",((t,e)=>{this._handleArrowKeyPress(t,e)}),{context:[VM,"$text"],priority:"high"});this._listenToIfEnabled(n,"change:range",((e,n)=>{if(!n.directChange){return}t.model.change((t=>{t.removeSelectionAttribute(QM)}))}));this._listenToIfEnabled(e.document,"change:data",(()=>{const e=n.getSelectedElement();if(e){const n=t.editing.mapper.toViewElement(e);if(ZM(n,e,i)){return}}t.model.change((t=>{t.removeSelectionAttribute(QM)}))}));this._listenToIfEnabled(t.editing.downcastDispatcher,"selection",((t,e,n)=>{const o=n.writer;if(this._currentFakeCaretModelElement){const t=n.mapper.toViewElement(this._currentFakeCaretModelElement);if(t){o.removeClass(aL.map(r),t);this._currentFakeCaretModelElement=null}}const s=e.selection.getSelectedElement();if(!s){return}const a=n.mapper.toViewElement(s);if(!ZM(a,s,i)){return}const c=eL(e.selection);if(!c){return}o.addClass(r(c),a);this._currentFakeCaretModelElement=s}));this._listenToIfEnabled(t.ui.focusTracker,"change:isFocused",((e,n,i)=>{if(!i){t.model.change((t=>{t.removeSelectionAttribute(QM)}))}}));function r(t){return`ck-widget_type-around_show-fake-caret_${t}`}}_handleArrowKeyPress(t,e){const n=this.editor;const i=n.model;const o=i.document.selection;const r=i.schema;const s=n.editing.view;const a=e.keyCode;const c=el(a,n.locale.contentLanguageDirection);const l=s.document.selection.getSelectedElement();const d=n.editing.mapper.toModelElement(l);let u;if(ZM(l,d,r)){u=this._handleArrowKeyPressOnSelectedWidget(c)}else if(o.isCollapsed){u=this._handleArrowKeyPressWhenSelectionNextToAWidget(c)}else if(!e.shiftKey){u=this._handleArrowKeyPressWhenNonCollapsedSelection(c)}if(u){e.preventDefault();t.stop()}}_handleArrowKeyPressOnSelectedWidget(t){const e=this.editor;const n=e.model;const i=n.document.selection;const o=eL(i);return n.change((e=>{if(o){const n=o===(t?"after":"before");if(!n){e.removeSelectionAttribute(QM);return true}}else{e.setSelectionAttribute(QM,t?"after":"before");return true}return false}))}_handleArrowKeyPressWhenSelectionNextToAWidget(t){const e=this.editor;const n=e.model;const i=n.schema;const o=e.plugins.get("Widget");const r=o._getObjectElementNextToSelection(t);const s=e.editing.mapper.toViewElement(r);if(ZM(s,r,i)){n.change((e=>{o._setSelectionOverElement(r);e.setSelectionAttribute(QM,t?"before":"after")}));return true}return false}_handleArrowKeyPressWhenNonCollapsedSelection(t){const e=this.editor;const n=e.model;const i=n.schema;const o=e.editing.mapper;const r=n.document.selection;const s=t?r.getLastPosition().nodeBefore:r.getFirstPosition().nodeAfter;const a=o.toViewElement(s);if(ZM(a,s,i)){n.change((e=>{e.setSelection(s,"on");e.setSelectionAttribute(QM,t?"after":"before")}));return true}return false}_enableInsertingParagraphsOnButtonClick(){const t=this.editor;const e=t.editing.view;this._listenToIfEnabled(e.document,"mousedown",((n,i)=>{const o=JM(i.domTarget);if(!o){return}const r=XM(o);const s=tL(o,e.domConverter);const a=t.editing.mapper.toModelElement(s);this._insertParagraph(a,r);i.preventDefault();n.stop()}))}_enableInsertingParagraphsOnEnterKeypress(){const t=this.editor;const e=t.model.document.selection;const n=t.editing.view;this._listenToIfEnabled(n.document,"enter",((n,i)=>{if(n.eventPhase!="atTarget"){return}const o=e.getSelectedElement();const r=t.editing.mapper.toViewElement(o);const s=t.model.schema;let a;if(this._insertParagraphAccordingToFakeCaretPosition()){a=true}else if(ZM(r,o,s)){this._insertParagraph(o,i.isSoft?"before":"after");a=true}if(a){i.preventDefault();n.stop()}}),{context:VM})}_enableInsertingParagraphsOnTypingKeystroke(){const t=this.editor;const e=t.editing.view.document;this._listenToIfEnabled(e,"insertText",((t,n)=>{if(this._insertParagraphAccordingToFakeCaretPosition()){n.selection=e.selection}}),{priority:"high"});if(l.isAndroid){this._listenToIfEnabled(e,"keydown",((t,e)=>{if(e.keyCode==229){this._insertParagraphAccordingToFakeCaretPosition()}}))}else{this._listenToIfEnabled(e,"compositionstart",(()=>{this._insertParagraphAccordingToFakeCaretPosition()}),{priority:"high"})}}_enableDeleteIntegration(){const t=this.editor;const e=t.editing.view;const n=t.model;const i=n.schema;this._listenToIfEnabled(e.document,"delete",((e,o)=>{if(e.eventPhase!="atTarget"){return}const r=eL(n.document.selection);if(!r){return}const s=o.direction;const a=n.document.selection.getSelectedElement();const c=r==="before";const l=s=="forward";const d=c===l;if(d){t.execute("delete",{selection:n.createSelection(a,"on")})}else{const e=i.getNearestSelectionRange(n.createPositionAt(a,r),s);if(e){if(!e.isCollapsed){n.change((n=>{n.setSelection(e);t.execute(l?"deleteForward":"delete")}))}else{const o=n.createSelection(e.start);n.modifySelection(o,{direction:s});if(!o.focus.isEqual(e.start)){n.change((n=>{n.setSelection(e);t.execute(l?"deleteForward":"delete")}))}else{const t=gL(i,e.start.parent);n.deleteContent(n.createSelection(t,"on"),{doNotAutoparagraph:true})}}}}o.preventDefault();e.stop()}),{context:VM})}_enableInsertContentIntegration(){const t=this.editor;const e=this.editor.model;const n=e.document.selection;this._listenToIfEnabled(t.model,"insertContent",((t,[i,o])=>{if(o&&!o.is("documentSelection")){return}const r=eL(n);if(!r){return}t.stop();return e.change((t=>{const o=n.getSelectedElement();const s=e.createPositionAt(o,r);const a=t.createSelection(s);const c=e.insertContent(i,a);t.setSelection(a);return c}))}),{priority:"high"})}_enableInsertObjectIntegration(){const t=this.editor;const e=this.editor.model;const n=e.document.selection;this._listenToIfEnabled(t.model,"insertObject",((t,e)=>{const[,i,o={}]=e;if(i&&!i.is("documentSelection")){return}const r=eL(n);if(!r){return}o.findOptimalPosition=r;e[3]=o}),{priority:"high"})}_enableDeleteContentIntegration(){const t=this.editor;const e=this.editor.model;const n=e.document.selection;this._listenToIfEnabled(t.model,"deleteContent",((t,[e])=>{if(e&&!e.is("documentSelection")){return}const i=eL(n);if(i){t.stop()}}),{priority:"high"})}}function uL(t,e,n){const i=t.createUIElement("div",{class:"ck ck-reset_all ck-widget__type-around"},(function(t){const n=this.toDomElement(t);hL(n,e);mL(n);return n}));t.insert(t.createPositionAt(n,"end"),i)}function hL(t,e){for(const n of aL){const i=new Hl({tag:"div",attributes:{class:["ck","ck-widget__type-around__button",`ck-widget__type-around__button_${n}`],title:e[n],"aria-hidden":"true"},children:[t.ownerDocument.importNode(cL,true)]});t.appendChild(i.render())}}function mL(t){const e=new Hl({tag:"div",attributes:{class:["ck","ck-widget__type-around__fake-caret"]}});t.appendChild(e.render())}function gL(t,e){let n=e;for(const i of e.getAncestors({parentFirst:true})){if(i.childCount>1||t.isLimit(i)){break}n=i}return n}function fL(t){const e=t.model;return(n,i)=>{const o=i.keyCode==$c.arrowup;const r=i.keyCode==$c.arrowdown;const s=i.shiftKey;const a=e.document.selection;if(!o&&!r){return}const c=r;if(s&&AL(a,c)){return}const l=pL(t,a,c);if(!l){return}if(l.isCollapsed){if(a.isCollapsed){return}else if(s){return}}if(l.isCollapsed||wL(t,l,c)){e.change((t=>{const n=c?l.end:l.start;if(s){const i=e.createSelection(a.anchor);i.setFocus(n);t.setSelection(i)}else{t.setSelection(n)}}));n.stop();i.preventDefault();i.stopPropagation()}}}function pL(t,e,n){const i=t.model;if(n){const t=e.isCollapsed?e.focus:e.getLastPosition();const n=bL(i,t,"forward");if(!n){return null}const o=i.createRange(t,n);const r=kL(i.schema,o,"backward");if(r){return i.createRange(t,r)}return null}else{const t=e.isCollapsed?e.focus:e.getFirstPosition();const n=bL(i,t,"backward");if(!n){return null}const o=i.createRange(n,t);const r=kL(i.schema,o,"forward");if(r){return i.createRange(r,t)}return null}}function bL(t,e,n){const i=t.schema;const o=t.createRangeIn(e.root);const r=n=="forward"?"elementStart":"elementEnd";for(const{previousPosition:t,item:s,type:a}of o.getWalker({startPosition:e,direction:n})){if(i.isLimit(s)&&!i.isInline(s)){return t}if(a==r&&i.isBlock(s)){return null}}return null}function kL(t,e,n){const i=n=="backward"?e.end:e.start;if(t.checkChild(i,"$text")){return i}for(const{nextPosition:i}of e.getWalker({direction:n})){if(t.checkChild(i,"$text")){return i}}return null}function wL(t,e,n){const i=t.model;const o=t.view.domConverter;if(n){const t=i.createSelection(e.start);i.modifySelection(t);if(!t.focus.isAtEnd&&!e.start.isEqual(t.focus)){e=i.createRange(t.focus,e.end)}}const r=t.mapper.toViewRange(e);const s=o.viewRangeToDom(r);const a=uc.getDomRangeRects(s);let c;for(const t of a){if(c===undefined){c=Math.round(t.bottom);continue}if(Math.round(t.top)>=c){return false}c=Math.max(c,Math.round(t.bottom))}return true}function AL(t,e){return!t.isCollapsed&&t.isBackward==e}var CL=n(2472);var _L={injectType:"singletonStyleTag",attributes:{"data-cke":true}};_L.insert="head";_L.singleton=true;var vL=Pl()(CL.c,_L);const yL=CL.c.locals||{};class xL extends bh{constructor(){super(...arguments);this._previouslySelected=new Set}static get pluginName(){return"Widget"}static get requires(){return[dL,LI]}init(){const t=this.editor;const e=t.editing.view;const n=e.document;this.editor.editing.downcastDispatcher.on("selection",((e,n,i)=>{const o=i.writer;const r=n.selection;if(r.isCollapsed){return}const s=r.getSelectedElement();if(!s){return}const a=t.editing.mapper.toViewElement(s);if(!VM(a)){return}if(!i.consumable.consume(r,"selection")){return}o.setSelection(o.createRangeOn(a),{fake:true,label:WM(a)})}));this.editor.editing.downcastDispatcher.on("selection",((t,e,n)=>{this._clearPreviouslySelectedWidgets(n.writer);const i=n.writer;const o=i.document.selection;let r=null;for(const t of o.getRanges()){for(const e of t){const t=e.item;if(VM(t)&&!DL(t,r)){i.addClass(RM,t);this._previouslySelected.add(t);r=t}}}}),{priority:"low"});e.addObserver(k_);this.listenTo(n,"mousedown",((...t)=>this._onMousedown(...t)));this.listenTo(n,"arrowKey",((...t)=>{this._handleSelectionChangeOnArrowKeyPress(...t)}),{context:[VM,"$text"]});this.listenTo(n,"arrowKey",((...t)=>{this._preventDefaultOnArrowKeyPress(...t)}),{context:"$root"});this.listenTo(n,"arrowKey",fL(this.editor.editing),{context:"$text"});this.listenTo(n,"delete",((t,e)=>{if(this._handleDelete(e.direction=="forward")){e.preventDefault();t.stop()}}),{context:"$root"})}_onMousedown(t,e){const n=this.editor;const i=n.editing.view;const o=i.document;let r=e.target;if(e.domEvent.detail>=3){if(this._selectBlockContent(r)){e.preventDefault()}return}if(EL(r)){return}if(!VM(r)){r=r.findAncestor(VM);if(!r){return}}if(l.isAndroid){e.preventDefault()}if(!o.isFocused){i.focus()}const s=n.editing.mapper.toModelElement(r);this._setSelectionOverElement(s)}_selectBlockContent(t){const e=this.editor;const n=e.model;const i=e.editing.mapper;const o=n.schema;const r=i.findMappedViewAncestor(this.editor.editing.view.createPositionAt(t,0));const s=TL(i.toModelElement(r),n.schema);if(!s){return false}n.change((t=>{const e=!o.isLimit(s)?SL(t.createPositionAfter(s),o):null;const n=t.createPositionAt(s,0);const i=e?t.createPositionAt(e,0):t.createPositionAt(s,"end");t.setSelection(t.createRange(n,i))}));return true}_handleSelectionChangeOnArrowKeyPress(t,e){const n=e.keyCode;const i=this.editor.model;const o=i.schema;const r=i.document.selection;const s=r.getSelectedElement();const a=Xc(n,this.editor.locale.contentLanguageDirection);const c=a=="down"||a=="right";const l=a=="up"||a=="down";if(s&&o.isObject(s)){const n=c?r.getLastPosition():r.getFirstPosition();const s=o.getNearestSelectionRange(n,c?"forward":"backward");if(s){i.change((t=>{t.setSelection(s)}));e.preventDefault();t.stop()}return}if(!r.isCollapsed&&!e.shiftKey){const n=r.getFirstPosition();const s=r.getLastPosition();const a=n.nodeAfter;const l=s.nodeBefore;if(a&&o.isObject(a)||l&&o.isObject(l)){i.change((t=>{t.setSelection(c?s:n)}));e.preventDefault();t.stop()}return}if(!r.isCollapsed){return}const d=this._getObjectElementNextToSelection(c);if(d&&o.isObject(d)){if(o.isInline(d)&&l){return}this._setSelectionOverElement(d);e.preventDefault();t.stop()}}_preventDefaultOnArrowKeyPress(t,e){const n=this.editor.model;const i=n.schema;const o=n.document.selection.getSelectedElement();if(o&&i.isObject(o)){e.preventDefault();t.stop()}}_handleDelete(t){const e=this.editor.model.document;const n=e.selection;if(!this.editor.model.canEditAt(n)){return}if(!n.isCollapsed){return}const i=this._getObjectElementNextToSelection(t);if(i){this.editor.model.change((t=>{let e=n.anchor.parent;while(e.isEmpty){const n=e;e=n.parent;t.remove(n)}this._setSelectionOverElement(i)}));return true}}_setSelectionOverElement(t){this.editor.model.change((e=>{e.setSelection(e.createRangeOn(t))}))}_getObjectElementNextToSelection(t){const e=this.editor.model;const n=e.schema;const i=e.document.selection;const o=e.createSelection(i);e.modifySelection(o,{direction:t?"forward":"backward"});if(o.isEqual(i)){return null}const r=t?o.focus.nodeBefore:o.focus.nodeAfter;if(!!r&&n.isObject(r)){return r}return null}_clearPreviouslySelectedWidgets(t){for(const e of this._previouslySelected){t.removeClass(RM,e)}this._previouslySelected.clear()}}function EL(t){let e=t;while(e){if(e.is("editableElement")&&!e.is("rootElement")){return true}if(VM(e)){return false}e=e.parent}return false}function DL(t,e){if(!e){return false}return Array.from(t.getAncestors()).includes(e)}function TL(t,e){for(const n of t.getAncestors({includeSelf:true,parentFirst:true})){if(e.checkChild(n,"$text")){return n}if(e.isLimit(n)&&!e.isObject(n)){break}}return null}function SL(t,e){const n=new Qb({startPosition:t});for(const{item:t}of n){if(e.isLimit(t)||!t.is("element")){return null}if(e.checkChild(t,"$text")){return t}}return null}class IL extends bh{constructor(){super(...arguments);this._toolbarDefinitions=new Map}static get requires(){return[TT]}static get pluginName(){return"WidgetToolbarRepository"}init(){const t=this.editor;if(t.plugins.has("BalloonToolbar")){const e=t.plugins.get("BalloonToolbar");this.listenTo(e,"show",(e=>{if(LL(t.editing.view.document.selection)){e.stop()}}),{priority:"high"})}this._balloon=this.editor.plugins.get("ContextualBalloon");this.on("change:isEnabled",(()=>{this._updateToolbarsVisibility()}));this.listenTo(t.ui,"update",(()=>{this._updateToolbarsVisibility()}));this.listenTo(t.ui.focusTracker,"change:isFocused",(()=>{this._updateToolbarsVisibility()}),{priority:"low"})}destroy(){super.destroy();for(const t of this._toolbarDefinitions.values()){t.view.destroy()}}register(t,{ariaLabel:e,items:n,getRelatedElement:i,balloonClassName:o="ck-toolbar-container"}){if(!n.length){P("widget-toolbar-no-items",{toolbarId:t});return}const r=this.editor;const s=r.t;const a=new Py(r.locale);a.ariaLabel=e||s("Widget toolbar");if(this._toolbarDefinitions.has(t)){throw new N("widget-toolbar-duplicated",this,{toolbarId:t})}const c={view:a,getRelatedElement:i,balloonClassName:o,itemsConfig:n,initialized:false};r.ui.addToolbar(a,{isContextual:true,beforeFocus:()=>{const t=i(r.editing.view.document.selection);if(t){this._showToolbar(c,t)}},afterBlur:()=>{this._hideToolbar(c)}});this._toolbarDefinitions.set(t,c)}_updateToolbarsVisibility(){let t=0;let e=null;let n=null;for(const i of this._toolbarDefinitions.values()){const o=i.getRelatedElement(this.editor.editing.view.document.selection);if(!this.isEnabled||!o){if(this._isToolbarInBalloon(i)){this._hideToolbar(i)}}else if(!this.editor.ui.focusTracker.isFocused){if(this._isToolbarVisible(i)){this._hideToolbar(i)}}else{const r=o.getAncestors().length;if(r>t){t=r;e=o;n=i}}}if(n){this._showToolbar(n,e)}}_hideToolbar(t){this._balloon.remove(t.view);this.stopListening(this._balloon,"change:visibleView")}_showToolbar(t,e){if(this._isToolbarVisible(t)){BL(this.editor,e)}else if(!this._isToolbarInBalloon(t)){if(!t.initialized){t.initialized=true;t.view.fillFromConfig(t.itemsConfig,this.editor.ui.componentFactory)}this._balloon.add({view:t.view,position:ML(this.editor,e),balloonClassName:t.balloonClassName});this.listenTo(this._balloon,"change:visibleView",(()=>{for(const t of this._toolbarDefinitions.values()){if(this._isToolbarVisible(t)){const e=t.getRelatedElement(this.editor.editing.view.document.selection);BL(this.editor,e)}}}))}}_isToolbarVisible(t){return this._balloon.visibleView===t.view}_isToolbarInBalloon(t){return this._balloon.hasView(t.view)}}function BL(t,e){const n=t.plugins.get("ContextualBalloon");const i=ML(t,e);n.updatePosition(i)}function ML(t,e){const n=t.editing.view;const i=yD.defaultPositions;return{target:n.domConverter.mapViewToDom(e),positions:[i.northArrowSouth,i.northArrowSouthWest,i.northArrowSouthEast,i.southArrowNorth,i.southArrowNorthWest,i.southArrowNorthEast,i.viewportStickyNorth]}}function LL(t){const e=t.getSelectedElement();return!!(e&&VM(e))}class NL extends(mt()){constructor(t){super();this.set("activeHandlePosition",null);this.set("proposedWidthPercents",null);this.set("proposedWidth",null);this.set("proposedHeight",null);this.set("proposedHandleHostWidth",null);this.set("proposedHandleHostHeight",null);this._options=t;this._referenceCoordinates=null}get originalWidth(){return this._originalWidth}get originalHeight(){return this._originalHeight}get originalWidthPercents(){return this._originalWidthPercents}get aspectRatio(){return this._aspectRatio}begin(t,e,n){const i=new uc(e);this.activeHandlePosition=VL(t);this._referenceCoordinates=zL(e,OL(this.activeHandlePosition));this._originalWidth=i.width;this._originalHeight=i.height;this._aspectRatio=i.width/i.height;const o=n.style.width;if(o&&o.match(/^\d+(\.\d*)?%$/)){this._originalWidthPercents=parseFloat(o)}else{this._originalWidthPercents=PL(n,i)}}update(t){this.proposedWidth=t.width;this.proposedHeight=t.height;this.proposedWidthPercents=t.widthPercents;this.proposedHandleHostWidth=t.handleHostWidth;this.proposedHandleHostHeight=t.handleHostHeight}}function PL(t,e){const n=t.parentElement;let i=parseFloat(n.ownerDocument.defaultView.getComputedStyle(n).width);const o=5;let r=0;let s=n;while(isNaN(i)){s=s.parentElement;if(++r>o){return 0}i=parseFloat(n.ownerDocument.defaultView.getComputedStyle(s).width)}return e.width/i*100}function zL(t,e){const n=new uc(t);const i=e.split("-");const o={x:i[1]=="right"?n.right:n.left,y:i[0]=="bottom"?n.bottom:n.top};o.x+=t.ownerDocument.defaultView.scrollX;o.y+=t.ownerDocument.defaultView.scrollY;return o}function RL(t){return`ck-widget__resizer__handle-${t}`}function VL(t){const e=["top-left","top-right","bottom-right","bottom-left"];for(const n of e){if(t.classList.contains(RL(n))){return n}}}function OL(t){const e=t.split("-");const n={top:"bottom",bottom:"top",left:"right",right:"left"};return`${n[e[0]]}-${n[e[1]]}`}class FL extends Fl{constructor(){super();const t=this.bindTemplate;this.setTemplate({tag:"div",attributes:{class:["ck","ck-size-view",t.to("_viewPosition",(t=>t?`ck-orientation-${t}`:""))],style:{display:t.if("_isVisible","none",(t=>!t))}},children:[{text:t.to("_label")}]})}_bindToState(t,e){this.bind("_isVisible").to(e,"proposedWidth",e,"proposedHeight",((t,e)=>t!==null&&e!==null));this.bind("_label").to(e,"proposedHandleHostWidth",e,"proposedHandleHostHeight",e,"proposedWidthPercents",((e,n,i)=>{if(t.unit==="px"){return`${e}×${n}`}else{return`${i}%`}}));this.bind("_viewPosition").to(e,"activeHandlePosition",e,"proposedHandleHostWidth",e,"proposedHandleHostHeight",((t,e,n)=>e<50||n<50?"above-center":t))}_dismiss(){this.unbind();this._isVisible=false}}class jL extends(mt()){constructor(t){super();this._viewResizerWrapper=null;this._options=t;this.set("isEnabled",true);this.set("isSelected",false);this.bind("isVisible").to(this,"isEnabled",this,"isSelected",((t,e)=>t&&e));this.decorate("begin");this.decorate("cancel");this.decorate("commit");this.decorate("updateSize");this.on("commit",(t=>{if(!this.state.proposedWidth&&!this.state.proposedWidthPercents){this._cleanup();t.stop()}}),{priority:"high"})}get state(){return this._state}show(){const t=this._options.editor.editing.view;t.change((t=>{t.removeClass("ck-hidden",this._viewResizerWrapper)}))}hide(){const t=this._options.editor.editing.view;t.change((t=>{t.addClass("ck-hidden",this._viewResizerWrapper)}))}attach(){const t=this;const e=this._options.viewElement;const n=this._options.editor.editing.view;n.change((n=>{const i=n.createUIElement("div",{class:"ck ck-reset_all ck-widget__resizer"},(function(e){const n=this.toDomElement(e);t._appendHandles(n);t._appendSizeUI(n);return n}));n.insert(n.createPositionAt(e,"end"),i);n.addClass("ck-widget_with-resizer",e);this._viewResizerWrapper=i;if(!this.isVisible){this.hide()}}));this.on("change:isVisible",(()=>{if(this.isVisible){this.show();this.redraw()}else{this.hide()}}))}begin(t){this._state=new NL(this._options);this._sizeView._bindToState(this._options,this.state);this._initialViewWidth=this._options.viewElement.getStyle("width");this.state.begin(t,this._getHandleHost(),this._getResizeHost())}updateSize(t){const e=this._proposeNewSize(t);const n=this._options.editor.editing.view;n.change((t=>{const n=this._options.unit||"%";const i=(n==="%"?e.widthPercents:e.width)+n;t.setStyle("width",i,this._options.viewElement)}));const i=this._getHandleHost();const o=new uc(i);const r=Math.round(o.width);const s=Math.round(o.height);const a=new uc(i);e.width=Math.round(a.width);e.height=Math.round(a.height);this.redraw(o);this.state.update({...e,handleHostWidth:r,handleHostHeight:s})}commit(){const t=this._options.unit||"%";const e=(t==="%"?this.state.proposedWidthPercents:this.state.proposedWidth)+t;this._options.editor.editing.view.change((()=>{this._cleanup();this._options.onCommit(e)}))}cancel(){this._cleanup()}destroy(){this.cancel()}redraw(t){const e=this._domResizerWrapper;if(!WL(e)){return}const n=e.parentElement;const i=this._getHandleHost();const o=this._viewResizerWrapper;const r=[o.getStyle("width"),o.getStyle("height"),o.getStyle("left"),o.getStyle("top")];let s;if(n.isSameNode(i)){const e=t||new uc(i);s=[e.width+"px",e.height+"px",undefined,undefined]}else{s=[i.offsetWidth+"px",i.offsetHeight+"px",i.offsetLeft+"px",i.offsetTop+"px"]}if(Et(r,s)!=="same"){this._options.editor.editing.view.change((t=>{t.setStyle({width:s[0],height:s[1],left:s[2],top:s[3]},o)}))}}containsHandle(t){return this._domResizerWrapper.contains(t)}static isResizeHandle(t){return t.classList.contains("ck-widget__resizer__handle")}_cleanup(){this._sizeView._dismiss();const t=this._options.editor.editing.view;t.change((t=>{t.setStyle("width",this._initialViewWidth,this._options.viewElement)}))}_proposeNewSize(t){const e=this.state;const n=UL(t);const i=this._options.isCentered?this._options.isCentered(this):true;const o={x:e._referenceCoordinates.x-(n.x+e.originalWidth),y:n.y-e.originalHeight-e._referenceCoordinates.y};if(i&&e.activeHandlePosition.endsWith("-right")){o.x=n.x-(e._referenceCoordinates.x+e.originalWidth)}if(i){o.x*=2}let r=Math.abs(e.originalWidth+o.x);let s=Math.abs(e.originalHeight+o.y);const a=r/e.aspectRatio>s?"width":"height";if(a=="width"){s=r/e.aspectRatio}else{r=s*e.aspectRatio}return{width:Math.round(r),height:Math.round(s),widthPercents:Math.min(Math.round(e.originalWidthPercents/e.originalWidth*r*100)/100,100)}}_getResizeHost(){const t=this._domResizerWrapper.parentElement;return this._options.getResizeHost(t)}_getHandleHost(){const t=this._domResizerWrapper.parentElement;return this._options.getHandleHost(t)}get _domResizerWrapper(){return this._options.editor.editing.view.domConverter.mapViewToDom(this._viewResizerWrapper)}_appendHandles(t){const e=["top-left","top-right","bottom-right","bottom-left"];for(const n of e){t.appendChild(new Hl({tag:"div",attributes:{class:`ck-widget__resizer__handle ${HL(n)}`}}).render())}}_appendSizeUI(t){this._sizeView=new FL;this._sizeView.render();t.appendChild(this._sizeView.element)}}function HL(t){return`ck-widget__resizer__handle-${t}`}function UL(t){return{x:t.pageX,y:t.pageY}}function WL(t){return t&&t.ownerDocument&&t.ownerDocument.contains(t)}var GL=n(2808);var qL={injectType:"singletonStyleTag",attributes:{"data-cke":true}};qL.insert="head";qL.singleton=true;var $L=Pl()(GL.c,qL);const KL=GL.c.locals||{};class YL extends bh{constructor(){super(...arguments);this._resizers=new Map}static get pluginName(){return"WidgetResize"}init(){const t=this.editor.editing;const e=nc.window.document;this.set("selectedResizer",null);this.set("_activeResizer",null);t.view.addObserver(k_);this._observer=new(Za());this.listenTo(t.view.document,"mousedown",this._mouseDownListener.bind(this),{priority:"high"});this._observer.listenTo(e,"mousemove",this._mouseMoveListener.bind(this));this._observer.listenTo(e,"mouseup",this._mouseUpListener.bind(this));this._redrawSelectedResizerThrottled=VD((()=>this.redrawSelectedResizer()),200);this.editor.ui.on("update",this._redrawSelectedResizerThrottled);this.editor.model.document.on("change",(()=>{for(const[t,e]of this._resizers){if(!t.isAttached()){this._resizers.delete(t);e.destroy()}}}),{priority:"lowest"});this._observer.listenTo(nc.window,"resize",this._redrawSelectedResizerThrottled);const n=this.editor.editing.view.document.selection;n.on("change",(()=>{const t=n.getSelectedElement();const e=this.getResizerByViewElement(t)||null;if(e){this.select(e)}else{this.deselect()}}))}redrawSelectedResizer(){if(this.selectedResizer&&this.selectedResizer.isVisible){this.selectedResizer.redraw()}}destroy(){super.destroy();this._observer.stopListening();for(const t of this._resizers.values()){t.destroy()}this._redrawSelectedResizerThrottled.cancel()}select(t){this.deselect();this.selectedResizer=t;this.selectedResizer.isSelected=true}deselect(){if(this.selectedResizer){this.selectedResizer.isSelected=false}this.selectedResizer=null}attachTo(t){const e=new jL(t);const n=this.editor.plugins;e.attach();if(n.has("WidgetToolbarRepository")){const t=n.get("WidgetToolbarRepository");e.on("begin",(()=>{t.forceDisabled("resize")}),{priority:"lowest"});e.on("cancel",(()=>{t.clearForceDisabled("resize")}),{priority:"highest"});e.on("commit",(()=>{t.clearForceDisabled("resize")}),{priority:"highest"})}this._resizers.set(t.viewElement,e);const i=this.editor.editing.view.document.selection;const o=i.getSelectedElement();if(this.getResizerByViewElement(o)==e){this.select(e)}return e}getResizerByViewElement(t){return this._resizers.get(t)}_getResizerByHandle(t){for(const e of this._resizers.values()){if(e.containsHandle(t)){return e}}}_mouseDownListener(t,e){const n=e.domTarget;if(!jL.isResizeHandle(n)){return}this._activeResizer=this._getResizerByHandle(n)||null;if(this._activeResizer){this._activeResizer.begin(n);t.stop();e.preventDefault()}}_mouseMoveListener(t,e){if(this._activeResizer){this._activeResizer.updateSize(e)}}_mouseUpListener(){if(this._activeResizer){this._activeResizer.commit();this._activeResizer=null}}}const QL=Cc("px");class ZL extends Fl{constructor(){super();const t=this.bindTemplate;this.set({isVisible:false,left:null,top:null,width:null});this.setTemplate({tag:"div",attributes:{class:["ck","ck-clipboard-drop-target-line",t.if("isVisible","ck-hidden",(t=>!t))],style:{left:t.to("left",(t=>QL(t))),top:t.to("top",(t=>QL(t))),width:t.to("width",(t=>QL(t)))}}})}}class JL extends bh{constructor(){super(...arguments);this.removeDropMarkerDelayed=_l((()=>this.removeDropMarker()),40);this._updateDropMarkerThrottled=VD((t=>this._updateDropMarker(t)),40);this._reconvertMarkerThrottled=VD((()=>{if(this.editor.model.markers.has("drop-target")){this.editor.editing.reconvertMarker("drop-target")}}),0);this._dropTargetLineView=new ZL;this._domEmitter=new(Za());this._scrollables=new Map}static get pluginName(){return"DragDropTarget"}init(){this._setupDropMarker()}destroy(){this._domEmitter.stopListening();for(const{resizeObserver:t}of this._scrollables.values()){t.destroy()}this._updateDropMarkerThrottled.cancel();this.removeDropMarkerDelayed.cancel();this._reconvertMarkerThrottled.cancel();return super.destroy()}updateDropMarker(t,e,n,i,o,r){this.removeDropMarkerDelayed.cancel();const s=XL(this.editor,t,e,n,i,o,r);if(!s){return}if(r&&r.containsRange(s)){return this.removeDropMarker()}this._updateDropMarkerThrottled(s)}getFinalDropRange(t,e,n,i,o,r){const s=XL(this.editor,t,e,n,i,o,r);this.removeDropMarker();return s}removeDropMarker(){const t=this.editor.model;this.removeDropMarkerDelayed.cancel();this._updateDropMarkerThrottled.cancel();this._dropTargetLineView.isVisible=false;if(t.markers.has("drop-target")){t.change((t=>{t.removeMarker("drop-target")}))}}_setupDropMarker(){const t=this.editor;t.ui.view.body.add(this._dropTargetLineView);t.conversion.for("editingDowncast").markerToHighlight({model:"drop-target",view:{classes:["ck-clipboard-drop-target-range"]}});t.conversion.for("editingDowncast").markerToElement({model:"drop-target",view:(e,{writer:n})=>{if(t.model.schema.checkChild(e.markerRange.start,"$text")){this._dropTargetLineView.isVisible=false;return this._createDropTargetPosition(n)}else{if(e.markerRange.isCollapsed){this._updateDropTargetLine(e.markerRange)}else{this._dropTargetLineView.isVisible=false}}}})}_updateDropMarker(t){const e=this.editor;const n=e.model.markers;e.model.change((e=>{if(n.has("drop-target")){if(!n.get("drop-target").getRange().isEqual(t)){e.updateMarker("drop-target",{range:t})}}else{e.addMarker("drop-target",{range:t,usingOperation:false,affectsData:false})}}))}_createDropTargetPosition(t){return t.createUIElement("span",{class:"ck ck-clipboard-drop-target-position"},(function(t){const e=this.toDomElement(t);e.append("",t.createElement("span"),"");return e}))}_updateDropTargetLine(t){const e=this.editor.editing;const n=t.start.nodeBefore;const i=t.start.nodeAfter;const o=t.start.parent;const r=n?e.mapper.toViewElement(n):null;const s=r?e.view.domConverter.mapViewToDom(r):null;const a=i?e.mapper.toViewElement(i):null;const c=a?e.view.domConverter.mapViewToDom(a):null;const l=e.mapper.toViewElement(o);if(!l){return}const d=e.view.domConverter.mapViewToDom(l);const u=this._getScrollableRect(l);const{scrollX:h,scrollY:m}=nc.window;const g=s?new uc(s):null;const f=c?new uc(c):null;const p=new uc(d).excludeScrollbarsAndBorders();const b=g?g.bottom:p.top;const k=f?f.top:p.bottom;const w=nc.window.getComputedStyle(d);const A=b<=k?(b+k)/2:k;if(u.topa.schema.checkChild(r,t)));if(l){if(a.schema.checkChild(r,"$text")){return a.createRange(r)}else if(e){return eN(t,iN(t,e.parent),i,o)}}}}else if(a.schema.isInline(d)){return eN(t,d,i,o)}}if(a.schema.isBlock(d)){return eN(t,d,i,o)}else if(a.schema.checkChild(d,"$block")){const e=Array.from(d.getChildren()).filter((e=>e.is("element")&&!tN(t,e)));let n=0;let r=e.length;if(r==0){return a.createRange(a.createPositionAt(d,"end"))}while(n{if(n){this.forceDisabled("readOnlyMode");this._isBlockDragging=false}else{this.clearForceDisabled("readOnlyMode")}}));if(l.isAndroid){this.forceDisabled("noAndroidSupport")}if(t.plugins.has("BlockToolbar")){const e=t.plugins.get("BlockToolbar");const n=e.buttonView.element;this._domEmitter.listenTo(n,"dragstart",((t,e)=>this._handleBlockDragStart(e)));this._domEmitter.listenTo(nc.document,"dragover",((t,e)=>this._handleBlockDragging(e)));this._domEmitter.listenTo(nc.document,"drop",((t,e)=>this._handleBlockDragging(e)));this._domEmitter.listenTo(nc.document,"dragend",(()=>this._handleBlockDragEnd()),{useCapture:true});if(this.isEnabled){n.setAttribute("draggable","true")}this.on("change:isEnabled",((t,e,i)=>{n.setAttribute("draggable",i?"true":"false")}))}}destroy(){this._domEmitter.stopListening();return super.destroy()}_handleBlockDragStart(t){if(!this.isEnabled){return}const e=this.editor.model;const n=e.document.selection;const i=this.editor.editing.view;const o=Array.from(n.getSelectedBlocks());const r=e.createRange(e.createPositionBefore(o[0]),e.createPositionAfter(o[o.length-1]));e.change((t=>t.setSelection(r)));this._isBlockDragging=true;i.focus();i.getObserver(_M).onDomEvent(t)}_handleBlockDragging(t){if(!this.isEnabled||!this._isBlockDragging){return}const e=t.clientX+(this.editor.locale.contentLanguageDirection=="ltr"?100:-100);const n=t.clientY;const i=document.elementFromPoint(e,n);const o=this.editor.editing.view;if(!i||!i.closest(".ck-editor__editable")){return}o.getObserver(_M).onDomEvent({...t,type:t.type,dataTransfer:t.dataTransfer,target:i,clientX:e,clientY:n,preventDefault:()=>t.preventDefault(),stopPropagation:()=>t.stopPropagation()})}_handleBlockDragEnd(){this._isBlockDragging=false}}var sN=n(2040);var aN={injectType:"singletonStyleTag",attributes:{"data-cke":true}};aN.insert="head";aN.singleton=true;var cN=Pl()(sN.c,aN);const lN=sN.c.locals||{};class dN extends bh{constructor(){super(...arguments);this._clearDraggableAttributesDelayed=_l((()=>this._clearDraggableAttributes()),40);this._blockMode=false;this._domEmitter=new(Za())}static get pluginName(){return"DragDrop"}static get requires(){return[IM,xL,JL,rN]}init(){const t=this.editor;const e=t.editing.view;this._draggedRange=null;this._draggingUid="";this._draggableElement=null;e.addObserver(_M);e.addObserver(k_);this._setupDragging();this._setupContentInsertionIntegration();this._setupClipboardInputIntegration();this._setupDraggableAttributeHandling();this.listenTo(t,"change:isReadOnly",((t,e,n)=>{if(n){this.forceDisabled("readOnlyMode")}else{this.clearForceDisabled("readOnlyMode")}}));this.on("change:isEnabled",((t,e,n)=>{if(!n){this._finalizeDragging(false)}}));if(l.isAndroid){this.forceDisabled("noAndroidSupport")}}destroy(){if(this._draggedRange){this._draggedRange.detach();this._draggedRange=null}if(this._previewContainer){this._previewContainer.remove()}this._domEmitter.stopListening();this._clearDraggableAttributesDelayed.cancel();return super.destroy()}_setupDragging(){const t=this.editor;const e=t.model;const n=t.editing.view;const i=n.document;const o=t.plugins.get(JL);this.listenTo(i,"dragstart",((t,n)=>{if(n.target&&n.target.is("editableElement")){n.preventDefault();return}this._prepareDraggedRange(n.target);if(!this._draggedRange){n.preventDefault();return}this._draggingUid=S();n.dataTransfer.effectAllowed=this.isEnabled?"copyMove":"copy";n.dataTransfer.setData("application/ckeditor5-dragging-uid",this._draggingUid);const i=e.createSelection(this._draggedRange.toRange());const o=this.editor.plugins.get("ClipboardPipeline");o._fireOutputTransformationEvent(n.dataTransfer,i,"dragstart");const{dataTransfer:r,domTarget:s,domEvent:a}=n;const{clientX:c}=a;this._updatePreview({dataTransfer:r,domTarget:s,clientX:c});n.stopPropagation();if(!this.isEnabled){this._draggedRange.detach();this._draggedRange=null;this._draggingUid=""}}),{priority:"low"});this.listenTo(i,"dragend",((t,e)=>{this._finalizeDragging(!e.dataTransfer.isCanceled&&e.dataTransfer.dropEffect=="move")}),{priority:"low"});this._domEmitter.listenTo(nc.document,"dragend",(()=>{this._blockMode=false}),{useCapture:true});this.listenTo(i,"dragenter",(()=>{if(!this.isEnabled){return}n.focus()}));this.listenTo(i,"dragleave",(()=>{o.removeDropMarkerDelayed()}));this.listenTo(i,"dragging",((t,e)=>{if(!this.isEnabled){e.dataTransfer.dropEffect="none";return}const{clientX:n,clientY:i}=e.domEvent;o.updateDropMarker(e.target,e.targetRanges,n,i,this._blockMode,this._draggedRange);if(!this._draggedRange){e.dataTransfer.dropEffect="copy"}if(!l.isGecko){if(e.dataTransfer.effectAllowed=="copy"){e.dataTransfer.dropEffect="copy"}else if(["all","copyMove"].includes(e.dataTransfer.effectAllowed)){e.dataTransfer.dropEffect="move"}}t.stop()}),{priority:"low"})}_setupClipboardInputIntegration(){const t=this.editor;const e=t.editing.view;const n=e.document;const i=t.plugins.get(JL);this.listenTo(n,"clipboardInput",((e,n)=>{if(n.method!="drop"){return}const{clientX:o,clientY:r}=n.domEvent;const s=i.getFinalDropRange(n.target,n.targetRanges,o,r,this._blockMode,this._draggedRange);if(!s){this._finalizeDragging(false);e.stop();return}if(this._draggedRange&&this._draggingUid!=n.dataTransfer.getData("application/ckeditor5-dragging-uid")){this._draggedRange.detach();this._draggedRange=null;this._draggingUid=""}const a=uN(n.dataTransfer)=="move";if(a&&this._draggedRange&&this._draggedRange.containsRange(s,true)){this._finalizeDragging(false);e.stop();return}n.targetRanges=[t.editing.mapper.toViewRange(s)]}),{priority:"high"})}_setupContentInsertionIntegration(){const t=this.editor.plugins.get(IM);t.on("contentInsertion",((t,e)=>{if(!this.isEnabled||e.method!=="drop"){return}const n=e.targetRanges.map((t=>this.editor.editing.mapper.toModelRange(t)));this.editor.model.change((t=>t.setSelection(n)))}),{priority:"high"});t.on("contentInsertion",((t,e)=>{if(!this.isEnabled||e.method!=="drop"){return}const n=uN(e.dataTransfer)=="move";const i=!e.resultRange||!e.resultRange.isCollapsed;this._finalizeDragging(i&&n)}),{priority:"lowest"})}_setupDraggableAttributeHandling(){const t=this.editor;const e=t.editing.view;const n=e.document;this.listenTo(n,"mousedown",((i,o)=>{if(l.isAndroid||!o){return}this._clearDraggableAttributesDelayed.cancel();let r=hN(o.target);if(l.isBlink&&!t.isReadOnly&&!r&&!n.selection.isCollapsed){const t=n.selection.getSelectedElement();if(!t||!VM(t)){r=n.selection.editableElement}}if(r){e.change((t=>{t.setAttribute("draggable","true",r)}));this._draggableElement=t.editing.mapper.toModelElement(r)}}));this.listenTo(n,"mouseup",(()=>{if(!l.isAndroid){this._clearDraggableAttributesDelayed()}}))}_clearDraggableAttributes(){const t=this.editor.editing;t.view.change((e=>{if(this._draggableElement&&this._draggableElement.root.rootName!="$graveyard"){e.removeAttribute("draggable",t.mapper.toViewElement(this._draggableElement))}this._draggableElement=null}))}_finalizeDragging(t){const e=this.editor;const n=e.model;const i=e.plugins.get(JL);i.removeDropMarker();this._clearDraggableAttributes();if(e.plugins.has("WidgetToolbarRepository")){const t=e.plugins.get("WidgetToolbarRepository");t.clearForceDisabled("dragDrop")}this._draggingUid="";if(this._previewContainer){this._previewContainer.remove();this._previewContainer=undefined}if(!this._draggedRange){return}if(t&&this.isEnabled){n.change((t=>{const e=n.createSelection(this._draggedRange);n.deleteContent(e,{doNotAutoparagraph:true});const i=e.getFirstPosition().parent;if(i.isEmpty&&!n.schema.checkChild(i,"$text")&&n.schema.checkChild(i,"paragraph")){t.insertElement("paragraph",i,0)}}))}this._draggedRange.detach();this._draggedRange=null}_prepareDraggedRange(t){const e=this.editor;const n=e.model;const i=n.document.selection;const o=t?hN(t):null;if(o){const t=e.editing.mapper.toModelElement(o);this._draggedRange=Ck.fromRange(n.createRangeOn(t));this._blockMode=n.schema.isBlock(t);if(e.plugins.has("WidgetToolbarRepository")){const t=e.plugins.get("WidgetToolbarRepository");t.forceDisabled("dragDrop")}return}if(i.isCollapsed&&!i.getFirstPosition().parent.isEmpty){return}const r=Array.from(i.getSelectedBlocks());const s=i.getFirstRange();if(r.length==0){this._draggedRange=Ck.fromRange(s);return}const a=mN(n,r);if(r.length>1){this._draggedRange=Ck.fromRange(a);this._blockMode=true}else if(r.length==1){const t=s.start.isTouching(a.start)&&s.end.isTouching(a.end);this._draggedRange=Ck.fromRange(t?a:s);this._blockMode=t}n.change((t=>t.setSelection(this._draggedRange.toRange())))}_updatePreview({dataTransfer:t,domTarget:e,clientX:n}){const i=this.editor.editing.view;const o=i.document.selection.editableElement;const r=i.domConverter.mapViewToDom(o);const s=nc.window.getComputedStyle(r);if(!this._previewContainer){this._previewContainer=ie(nc.document,"div",{style:"position: fixed; left: -999999px;"});nc.document.body.appendChild(this._previewContainer)}else if(this._previewContainer.firstElementChild){this._previewContainer.removeChild(this._previewContainer.firstElementChild)}const a=new uc(r);if(r.contains(e)){return}const c=parseFloat(s.paddingLeft);const d=ie(nc.document,"div");d.className="ck ck-content";d.style.width=s.width;d.style.paddingLeft=`${a.left-n+c}px`;if(l.isiOS){d.style.backgroundColor="white"}d.innerHTML=t.getData("text/html");t.setDragImage(d,0,0);this._previewContainer.appendChild(d)}}function uN(t){if(l.isGecko){return t.dropEffect}return["all","copyMove"].includes(t.effectAllowed)?"move":"copy"}function hN(t){if(t.is("editableElement")){return null}if(t.hasClass("ck-widget__selection-handle")){return t.findAncestor(VM)}if(VM(t)){return t}const e=t.findAncestor((t=>VM(t)||t.is("editableElement")));if(VM(e)){return e}return null}function mN(t,e){const n=e[0];const i=e[e.length-1];const o=n.getCommonAncestor(i);const r=t.createPositionBefore(n);const s=t.createPositionAfter(i);if(o&&o.is("element")&&!t.schema.isLimit(o)){const e=t.createRangeOn(o);const n=r.isTouching(e.start);const i=s.isTouching(e.end);if(n&&i){return mN(t,[o])}}return t.createRange(r,s)}class gN extends bh{static get pluginName(){return"PastePlainText"}static get requires(){return[IM]}init(){const t=this.editor;const e=t.model;const n=t.editing.view;const i=n.document;const o=e.document.selection;let r=false;n.addObserver(_M);this.listenTo(i,"keydown",((t,e)=>{r=e.shiftKey}));t.plugins.get(IM).on("contentInsertion",((t,n)=>{if(!r&&!fN(n.content,e.schema)){return}e.change((t=>{const i=Array.from(o.getAttributes()).filter((([t])=>e.schema.getAttributeProperties(t).isFormatting));if(!o.isCollapsed){e.deleteContent(o,{doNotAutoparagraph:true})}i.push(...o.getAttributes());const r=t.createRangeIn(n.content);for(const e of r.getItems()){if(e.is("$textProxy")){t.setAttributes(i,e)}}}))}))}}function fN(t,e){if(t.childCount>1){return false}const n=t.getChild(0);if(e.isObject(n)){return false}return Array.from(n.getAttributeKeys()).length==0}class pN extends bh{static get pluginName(){return"Clipboard"}static get requires(){return[IM,dN,gN]}}class bN extends wh{constructor(t){super(t);this.affectsData=false}execute(){const t=this.editor.model;const e=t.document.selection;let n=t.schema.getLimitElement(e);if(e.containsEntireContent(n)||!kN(t.schema,n)){do{n=n.parent;if(!n){return}}while(!kN(t.schema,n))}t.change((t=>{t.setSelection(n,"in")}))}}function kN(t,e){return t.isLimit(e)&&(t.checkChild(e,"$text")||t.checkChild(e,"paragraph"))}const wN=Qc("Ctrl+A");class AN extends bh{static get pluginName(){return"SelectAllEditing"}init(){const t=this.editor;const e=t.editing.view;const n=e.document;t.commands.add("selectAll",new bN(t));this.listenTo(n,"keydown",((e,n)=>{if(Yc(n)===wN){t.execute("selectAll");n.preventDefault()}}))}}const CN=' ';class _N extends bh{static get pluginName(){return"SelectAllUI"}init(){const t=this.editor;t.ui.componentFactory.add("selectAll",(e=>{const n=t.commands.get("selectAll");const i=new Dd(e);const o=e.t;i.set({label:o("Select all"),icon:CN,keystroke:"Ctrl+A",tooltip:true});i.bind("isEnabled").to(n,"isEnabled");this.listenTo(i,"execute",(()=>{t.execute("selectAll");t.editing.view.focus()}));return i}))}}class vN extends bh{static get requires(){return[AN,_N]}static get pluginName(){return"SelectAll"}}class yN extends wh{constructor(t){super(t);this._stack=[];this._createdBatches=new WeakSet;this.refresh();this._isEnabledBasedOnSelection=false;this.listenTo(t.data,"set",((t,e)=>{e[1]={...e[1]};const n=e[1];if(!n.batchType){n.batchType={isUndoable:false}}}),{priority:"high"});this.listenTo(t.data,"set",((t,e)=>{const n=e[1];if(!n.batchType.isUndoable){this.clearStack()}}))}refresh(){this.isEnabled=this._stack.length>0}get createdBatches(){return this._createdBatches}addBatch(t){const e=this.editor.model.document.selection;const n={ranges:e.hasOwnRange?Array.from(e.getRanges()):[],isBackward:e.isBackward};this._stack.push({batch:t,selection:n});this.refresh()}clearStack(){this._stack=[];this.refresh()}_restoreSelection(t,e,n){const i=this.editor.model;const o=i.document;const r=[];const s=t.map((t=>t.getTransformedByOperations(n)));const a=s.flat();for(const t of s){const e=t.filter((t=>t.root!=o.graveyard)).filter((t=>!EN(t,a)));if(!e.length){continue}xN(e);r.push(e[0])}if(r.length){i.change((t=>{t.setSelection(r,{backward:e})}))}}_undo(t,e){const n=this.editor.model;const i=n.document;this._createdBatches.add(e);const o=t.operations.slice().filter((t=>t.isDocumentOperation));o.reverse();for(const t of o){const o=t.baseVersion+1;const r=Array.from(i.history.getOperations(o));const s=cC([t.getReversed()],r,{useRelations:true,document:this.editor.model.document,padWithNoOps:false,forceWeakRemove:true});const a=s.operationsA;for(let o of a){const r=o.affectedSelectable;if(r&&!n.canEditAt(r)){o=new ZA(o.baseVersion)}e.addOperation(o);n.applyOperation(o);i.history.setOperationAsUndone(t,o)}}}}function xN(t){t.sort(((t,e)=>t.start.isBefore(e.start)?-1:1));for(let e=1;ee!==t&&e.containsRange(t,true)))}class DN extends yN{execute(t=null){const e=t?this._stack.findIndex((e=>e.batch==t)):this._stack.length-1;const n=this._stack.splice(e,1)[0];const i=this.editor.model.createBatch({isUndo:true});this.editor.model.enqueueChange(i,(()=>{this._undo(n.batch,i);const t=this.editor.model.document.history.getOperations(n.batch.baseVersion);this._restoreSelection(n.selection.ranges,n.selection.isBackward,t)}));this.fire("revert",n.batch,i);this.refresh()}}class TN extends yN{execute(){const t=this._stack.pop();const e=this.editor.model.createBatch({isUndo:true});this.editor.model.enqueueChange(e,(()=>{const n=t.batch.operations[t.batch.operations.length-1];const i=n.baseVersion+1;const o=this.editor.model.document.history.getOperations(i);this._restoreSelection(t.selection.ranges,t.selection.isBackward,o);this._undo(t.batch,e)}));this.refresh()}}class SN extends bh{constructor(){super(...arguments);this._batchRegistry=new WeakSet}static get pluginName(){return"UndoEditing"}init(){const t=this.editor;this._undoCommand=new DN(t);this._redoCommand=new TN(t);t.commands.add("undo",this._undoCommand);t.commands.add("redo",this._redoCommand);this.listenTo(t.model,"applyOperation",((t,e)=>{const n=e[0];if(!n.isDocumentOperation){return}const i=n.batch;const o=this._redoCommand.createdBatches.has(i);const r=this._undoCommand.createdBatches.has(i);const s=this._batchRegistry.has(i);if(s){return}this._batchRegistry.add(i);if(!i.isUndoable){return}if(o){this._undoCommand.addBatch(i)}else if(!r){this._undoCommand.addBatch(i);this._redoCommand.clearStack()}}),{priority:"highest"});this.listenTo(this._undoCommand,"revert",((t,e,n)=>{this._redoCommand.addBatch(n)}));t.keystrokes.set("CTRL+Z","undo");t.keystrokes.set("CTRL+Y","redo");t.keystrokes.set("CTRL+SHIFT+Z","redo")}}class IN extends bh{static get pluginName(){return"UndoUI"}init(){const t=this.editor;const e=t.locale;const n=t.t;const i=e.uiLanguageDirection=="ltr"?Ty.undo:Ty.redo;const o=e.uiLanguageDirection=="ltr"?Ty.redo:Ty.undo;this._addButton("undo",n("Undo"),"CTRL+Z",i);this._addButton("redo",n("Redo"),"CTRL+Y",o)}_addButton(t,e,n,i){const o=this.editor;o.ui.componentFactory.add(t,(r=>{const s=o.commands.get(t);const a=new Dd(r);a.set({label:e,icon:i,keystroke:n,tooltip:true});a.bind("isEnabled").to(s,"isEnabled");this.listenTo(a,"execute",(()=>{o.execute(t);o.editing.view.focus()}));return a}))}}class BN extends bh{static get requires(){return[SN,IN]}static get pluginName(){return"Undo"}}class MN extends bh{static get requires(){return[pN,oM,vN,dM,NI,BN]}static get pluginName(){return"Essentials"}}var LN=n(6976);var NN={injectType:"singletonStyleTag",attributes:{"data-cke":true}};NN.insert="head";NN.singleton=true;var PN=Pl()(LN.c,NN);const zN=LN.c.locals||{};var RN=n(6060);var VN={injectType:"singletonStyleTag",attributes:{"data-cke":true}};VN.insert="head";VN.singleton=true;var ON=Pl()(RN.c,VN);const FN=RN.c.locals||{};class jN extends Fl{constructor(t){super(t);const e=t.t;this.children=this.createCollection();this.set("matchCount",0);this.set("highlightOffset",0);this.set("isDirty",false);this.set("_areCommandsEnabled",{});this.set("_resultsCounterText","");this.set("_matchCase",false);this.set("_wholeWordsOnly",false);this.bind("_searchResultsFound").to(this,"matchCount",this,"isDirty",((t,e)=>t>0&&!e));this._findInputView=this._createInputField(e("Find in text…"));this._findPrevButtonView=this._createButton({label:e("Previous result"),class:"ck-button-prev",icon:Ty.previousArrow,keystroke:"Shift+F3",tooltip:true});this._findNextButtonView=this._createButton({label:e("Next result"),class:"ck-button-next",icon:Ty.previousArrow,keystroke:"F3",tooltip:true});this._replaceInputView=this._createInputField(e("Replace with…"),"ck-labeled-field-replace");this._inputsDivView=this._createInputsDiv();this._matchCaseSwitchView=this._createMatchCaseSwitch();this._wholeWordsOnlySwitchView=this._createWholeWordsOnlySwitch();this._advancedOptionsCollapsibleView=this._createAdvancedOptionsCollapsible();this._replaceAllButtonView=this._createButton({label:e("Replace all"),class:"ck-button-replaceall",withText:true});this._replaceButtonView=this._createButton({label:e("Replace"),class:"ck-button-replace",withText:true});this._findButtonView=this._createButton({label:e("Find"),class:"ck-button-find ck-button-action",withText:true});this._actionButtonsDivView=this._createActionButtonsDiv();this._focusTracker=new pl;this._keystrokes=new bl;this._focusables=new Ml;this.focusCycler=new lh({focusables:this._focusables,focusTracker:this._focusTracker,keystrokeHandler:this._keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});this.children.addMany([this._inputsDivView,this._advancedOptionsCollapsibleView,this._actionButtonsDivView]);this.setTemplate({tag:"form",attributes:{class:["ck","ck-find-and-replace-form"],tabindex:"-1"},children:this.children})}render(){super.render();o({view:this});this._initFocusCycling();this._initKeystrokeHandling()}destroy(){super.destroy();this._focusTracker.destroy();this._keystrokes.destroy()}focus(t){if(t===-1){this.focusCycler.focusLast()}else{this.focusCycler.focusFirst()}}reset(){this._findInputView.errorText=null;this.isDirty=true}get _textToFind(){return this._findInputView.fieldView.element.value}get _textToReplace(){return this._replaceInputView.fieldView.element.value}_createInputsDiv(){const t=this.locale;const e=t.t;const n=new Fl(t);this._findInputView.fieldView.on("input",(()=>{this.isDirty=true}));this._findPrevButtonView.delegate("execute").to(this,"findPrevious");this._findNextButtonView.delegate("execute").to(this,"findNext");this._findPrevButtonView.bind("isEnabled").to(this,"_areCommandsEnabled",(({findPrevious:t})=>t));this._findNextButtonView.bind("isEnabled").to(this,"_areCommandsEnabled",(({findNext:t})=>t));this._injectFindResultsCounter();this._replaceInputView.bind("isEnabled").to(this,"_areCommandsEnabled",this,"_searchResultsFound",(({replace:t},e)=>t&&e));this._replaceInputView.bind("infoText").to(this._replaceInputView,"isEnabled",this._replaceInputView,"isFocused",((t,n)=>{if(t||!n){return""}return e("Tip: Find some text first in order to replace it.")}));n.setTemplate({tag:"div",attributes:{class:["ck","ck-find-and-replace-form__inputs"]},children:[this._findInputView,this._findPrevButtonView,this._findNextButtonView,this._replaceInputView]});return n}_onFindButtonExecute(){if(!this._textToFind){const t=this.t;this._findInputView.errorText=t("Text to find must not be empty.");return}this.isDirty=false;this.fire("findNext",{searchText:this._textToFind,matchCase:this._matchCase,wholeWords:this._wholeWordsOnly})}_injectFindResultsCounter(){const t=this.locale;const e=t.t;const n=this.bindTemplate;const i=new Fl(this.locale);this.bind("_resultsCounterText").to(this,"highlightOffset",this,"matchCount",((t,n)=>e("%0 of %1",[t,n])));i.setTemplate({tag:"span",attributes:{class:["ck","ck-results-counter",n.if("isDirty","ck-hidden")]},children:[{text:n.to("_resultsCounterText")}]});const o=()=>{const e=this._findInputView.fieldView.element;if(!e||!Ec(e)){return}const n=new uc(i.element).width;const o=t.uiLanguageDirection==="ltr"?"paddingRight":"paddingLeft";if(!n){e.style[o]=""}else{e.style[o]=`calc( 2 * var(--ck-spacing-standard) + ${n}px )`}};this.on("change:_resultsCounterText",o,{priority:"low"});this.on("change:isDirty",o,{priority:"low"});this._findInputView.template.children[0].children.push(i)}_createAdvancedOptionsCollapsible(){const t=this.locale.t;const e=new Vd(this.locale,[this._matchCaseSwitchView,this._wholeWordsOnlySwitchView]);e.set({label:t("Advanced options"),isCollapsed:true});return e}_createActionButtonsDiv(){const t=new Fl(this.locale);this._replaceButtonView.bind("isEnabled").to(this,"_areCommandsEnabled",this,"_searchResultsFound",(({replace:t},e)=>t&&e));this._replaceAllButtonView.bind("isEnabled").to(this,"_areCommandsEnabled",this,"_searchResultsFound",(({replaceAll:t},e)=>t&&e));this._replaceButtonView.on("execute",(()=>{this.fire("replace",{searchText:this._textToFind,replaceText:this._textToReplace})}));this._replaceAllButtonView.on("execute",(()=>{this.fire("replaceAll",{searchText:this._textToFind,replaceText:this._textToReplace});this.focus()}));this._findButtonView.on("execute",this._onFindButtonExecute.bind(this));t.setTemplate({tag:"div",attributes:{class:["ck","ck-find-and-replace-form__actions"]},children:[this._replaceAllButtonView,this._replaceButtonView,this._findButtonView]});return t}_createMatchCaseSwitch(){const t=this.locale.t;const e=new Md(this.locale);e.set({label:t("Match case"),withText:true});e.bind("isOn").to(this,"_matchCase");e.on("execute",(()=>{this._matchCase=!this._matchCase;this.isDirty=true}));return e}_createWholeWordsOnlySwitch(){const t=this.locale.t;const e=new Md(this.locale);e.set({label:t("Whole words only"),withText:true});e.bind("isOn").to(this,"_wholeWordsOnly");e.on("execute",(()=>{this._wholeWordsOnly=!this._wholeWordsOnly;this.isDirty=true}));return e}_initFocusCycling(){const t=[this._findInputView,this._findPrevButtonView,this._findNextButtonView,this._replaceInputView,this._advancedOptionsCollapsibleView.buttonView,this._matchCaseSwitchView,this._wholeWordsOnlySwitchView,this._replaceAllButtonView,this._replaceButtonView,this._findButtonView];t.forEach((t=>{this._focusables.add(t);this._focusTracker.add(t.element)}))}_initKeystrokeHandling(){const t=t=>t.stopPropagation();const e=t=>{t.stopPropagation();t.preventDefault()};this._keystrokes.listenTo(this.element);this._keystrokes.set("f3",(t=>{e(t);this._findNextButtonView.fire("execute")}));this._keystrokes.set("shift+f3",(t=>{e(t);this._findPrevButtonView.fire("execute")}));this._keystrokes.set("enter",(t=>{const n=t.target;if(n===this._findInputView.fieldView.element){if(this._areCommandsEnabled.findNext){this._findNextButtonView.fire("execute")}else{this._findButtonView.fire("execute")}e(t)}else if(n===this._replaceInputView.fieldView.element&&!this.isDirty){this._replaceButtonView.fire("execute");e(t)}}));this._keystrokes.set("shift+enter",(t=>{const n=t.target;if(n!==this._findInputView.fieldView.element){return}if(this._areCommandsEnabled.findPrevious){this._findPrevButtonView.fire("execute")}else{this._findButtonView.fire("execute")}e(t)}));this._keystrokes.set("arrowright",t);this._keystrokes.set("arrowleft",t);this._keystrokes.set("arrowup",t);this._keystrokes.set("arrowdown",t)}_createButton(t){const e=new Dd(this.locale);e.set(t);return e}_createInputField(t,e){const n=new Ou(this.locale,Ax);n.label=t;n.class=e;return n}}const HN=' ';class UN extends bh{static get requires(){return[fD]}static get pluginName(){return"FindAndReplaceUI"}constructor(t){super(t);t.config.define("findAndReplace.uiType","dialog");this.formView=null}init(){const t=this.editor;const e=t.config.get("findAndReplace.uiType")==="dropdown";const n=t.commands.get("find");t.ui.componentFactory.add("findAndReplace",(()=>{let i;if(e){i=this._createDropdown();i.bind("isEnabled").to(n)}else{i=this._createDialogButton();i.bind("isEnabled").to(n)}t.keystrokes.set("Ctrl+F",((e,o)=>{if(!n.isEnabled){return}if(i instanceof ah){const t=i.buttonView;if(!t.isOn){t.fire("execute")}}else{if(i.isOn){t.plugins.get("Dialog").view.focus()}else{i.fire("execute")}}o()}));return i}))}_createDropdown(){const t=this.editor;const e=t.locale.t;const n=sx(t.locale);n.once("change:isOpen",(()=>{this.formView=this._createFormView();this.formView.children.add(new JE(t.locale,{label:e("Find and replace")}),0);n.panelView.children.add(this.formView)}));n.on("change:isOpen",((t,e,n)=>{if(n){this._setupFormView()}else{this.fire("searchReseted")}}),{priority:"low"});n.buttonView.set({icon:HN,label:e("Find and replace"),keystroke:"CTRL+F",tooltip:true});return n}_createDialogButton(){const t=this.editor;const e=new Dd(t.locale);const n=t.plugins.get("Dialog");const i=t.locale.t;e.set({icon:HN,label:i("Find and replace"),keystroke:"CTRL+F",tooltip:true});e.bind("isOn").to(n,"id",(t=>t==="findAndReplace"));e.on("execute",(()=>{if(!this.formView){this.formView=this._createFormView()}if(e.isOn){n.hide()}else{n.show({id:"findAndReplace",title:i("Find and replace"),content:this.formView,position:dD.EDITOR_TOP_SIDE,onShow:()=>{this._setupFormView()},onHide:()=>{this.fire("searchReseted")}})}}));return e}_createFormView(){const t=this.editor;const n=new(e(jN))(t.locale);const i=t.commands;const o=this.editor.plugins.get("FindAndReplaceEditing");const r=o.state;const s={before:-1,same:0,after:1,different:1};n.bind("highlightOffset").to(r,"highlightedResult",(t=>{if(!t){return 0}return Array.from(r.results).sort(((t,e)=>s[t.marker.getStart().compareWith(e.marker.getStart())])).indexOf(t)+1}));n.listenTo(r.results,"change",(()=>{n.matchCount=r.results.length}));const a=i.get("findNext");const c=i.get("findPrevious");const l=i.get("replace");const d=i.get("replaceAll");n.bind("_areCommandsEnabled").to(a,"isEnabled",c,"isEnabled",l,"isEnabled",d,"isEnabled",((t,e,n,i)=>({findNext:t,findPrevious:e,replace:n,replaceAll:i})));n.delegate("findNext","findPrevious","replace","replaceAll").to(this);n.on("change:isDirty",((t,e,n)=>{if(n){this.fire("searchReseted")}}));return n}_setupFormView(){this.formView.disableCssTransitions();this.formView.reset();this.formView._findInputView.fieldView.select();this.formView.enableCssTransitions()}}class WN extends wh{constructor(t,e){super(t);this.isEnabled=true;this.affectsData=false;this._state=e}execute(t,{matchCase:e,wholeWords:n}={}){const{editor:i}=this;const{model:o}=i;const r=i.plugins.get("FindAndReplaceUtils");let s;if(typeof t==="string"){s=r.findByTextCallback(t,{matchCase:e,wholeWords:n});this._state.searchText=t}else{s=t}const a=o.document.getRootNames().reduce(((t,e)=>r.updateFindResultFromRange(o.createRangeIn(o.document.getRoot(e)),o,s,t)),null);this._state.clear(o);this._state.results.addMany(a);this._state.highlightedResult=a.get(0);if(typeof t==="string"){this._state.searchText=t}this._state.matchCase=!!e;this._state.matchWholeWords=!!n;return{results:a,findCallback:s}}}class GN extends wh{constructor(t,e){super(t);this.isEnabled=true;this._state=e;this._isEnabledBasedOnSelection=false}_replace(t,e){const{model:n}=this.editor;const i=e.marker.getRange();if(!n.canEditAt(i)){return}n.change((o=>{if(i.root.rootName==="$graveyard"){this._state.results.remove(e);return}let r={};for(const t of i.getItems()){if(t.is("$text")||t.is("$textProxy")){r=t.getAttributes();break}}n.insertContent(o.createText(t,r),i);if(this._state.results.has(e)){this._state.results.remove(e)}}))}}class qN extends GN{execute(t,e){this._replace(t,e)}}class $N extends GN{execute(t,e){const{editor:n}=this;const{model:i}=n;const o=n.plugins.get("FindAndReplaceUtils");const r=e instanceof gl?e:i.document.getRootNames().reduce(((t,n)=>o.updateFindResultFromRange(i.createRangeIn(i.document.getRoot(n)),i,o.findByTextCallback(e,this._state),t)),null);if(r.length){i.change((()=>{[...r].forEach((e=>{this._replace(t,e)}))}))}}}class KN extends wh{constructor(t,e){super(t);this.affectsData=false;this._state=e;this.isEnabled=false;this.listenTo(this._state.results,"change",(()=>{this.isEnabled=this._state.results.length>1}))}refresh(){this.isEnabled=this._state.results.length>1}execute(){const t=this._state.results;const e=t.getIndex(this._state.highlightedResult);const n=e+1>=t.length?0:e+1;this._state.highlightedResult=this._state.results.get(n)}}class YN extends KN{execute(){const t=this._state.results;const e=t.getIndex(this._state.highlightedResult);const n=e-1<0?this._state.results.length-1:e-1;this._state.highlightedResult=this._state.results.get(n)}}class QN extends(mt()){constructor(t){super();this.set("results",new gl);this.set("highlightedResult",null);this.set("searchText","");this.set("replaceText","");this.set("matchCase",false);this.set("matchWholeWords",false);this.results.on("change",((e,{removed:n,index:i})=>{if(Array.from(n).length){let e=false;t.change((i=>{for(const o of n){if(this.highlightedResult===o){e=true}if(t.markers.has(o.marker.name)){i.removeMarker(o.marker)}}}));if(e){const t=i>=this.results.length?0:i;this.highlightedResult=this.results.get(t)}}}))}clear(t){this.searchText="";t.change((e=>{if(this.highlightedResult){const n=this.highlightedResult.marker.name.split(":")[1];const i=t.markers.get(`findResultHighlighted:${n}`);if(i){e.removeMarker(i)}}[...this.results].forEach((({marker:t})=>{e.removeMarker(t)}))}));this.results.clear()}}class ZN extends bh{static get pluginName(){return"FindAndReplaceUtils"}updateFindResultFromRange(t,e,n,i){const o=i||new gl;e.change((i=>{[...t].forEach((({type:t,item:r})=>{if(t==="elementStart"){if(e.schema.checkChild(r,"$text")){const t=n({item:r,text:this.rangeToText(e.createRangeIn(r))});if(!t){return}t.forEach((t=>{const e=`findResult:${S()}`;const n=i.addMarker(e,{usingOperation:false,affectsData:false,range:i.createRange(i.createPositionAt(r,t.start),i.createPositionAt(r,t.end))});const s=JN(o,n);o.add({id:e,label:t.label,marker:n},s)}))}}}))}));return o}rangeToText(t){return Array.from(t.getItems()).reduce(((t,e)=>{if(!(e.is("$text")||e.is("$textProxy"))){return`${t}\n`}return t+e.data}),"")}findByTextCallback(t,e){let n="gu";if(!e.matchCase){n+="i"}let i=`(${UT(t)})`;if(e.wholeWords){const e="[^a-zA-ZÀ-ɏḀ-ỿ]";if(!new RegExp("^"+e).test(t)){i=`(^|${e}|_)${i}`}if(!new RegExp(e+"$").test(t)){i=`${i}(?=_|${e}|$)`}}const o=new RegExp(i,n);function r({text:t}){const e=[...t.matchAll(o)];return e.map(XN)}return r}}function JN(t,e){const n=t.find((({marker:t})=>e.getStart().isBefore(t.getStart())));return n?t.getIndex(n):t.length}function XN(t){const e=t.length-1;let n=t.index;if(t.length===3){n+=t[1].length}return{label:t[e],start:n,end:n+t[e].length}}var tP=n(4531);var eP={injectType:"singletonStyleTag",attributes:{"data-cke":true}};eP.insert="head";eP.singleton=true;var nP=Pl()(tP.c,eP);const iP=tP.c.locals||{};const oP="ck-find-result_selected";function rP(t,e,n){const i=new Set;const o=new Set;const r=e.model;const s=r.document.differ.getChanges();s.forEach((t=>{if(t.name==="$text"||r.schema.isInline(t.position.nodeAfter)){i.add(t.position.parent);[...r.markers.getMarkersAtPosition(t.position)].forEach((t=>{o.add(t.name)}))}else if(t.type==="insert"){i.add(t.position.nodeAfter)}}));r.document.differ.getChangedMarkers().forEach((({name:t,data:{newRange:e}})=>{if(e&&e.start.root.rootName==="$graveyard"){o.add(t)}}));i.forEach((t=>{const e=[...r.markers.getMarkersIntersectingRange(r.createRangeIn(t))];e.forEach((t=>o.add(t.name)))}));r.change((e=>{o.forEach((n=>{if(t.has(n)){t.remove(n)}e.removeMarker(n)}))}));i.forEach((i=>{const o=e.plugins.get("FindAndReplaceUtils");o.updateFindResultFromRange(r.createRangeOn(i),r,n,t)}))}class sP extends bh{static get requires(){return[ZN]}static get pluginName(){return"FindAndReplaceEditing"}init(){this._activeResults=null;this.state=new QN(this.editor.model);this._defineConverters();this._defineCommands();this.listenTo(this.state,"change:highlightedResult",((t,e,n,i)=>{const{model:o}=this.editor;o.change((t=>{if(i){const e=i.marker.name.split(":")[1];const n=o.markers.get(`findResultHighlighted:${e}`);if(n){t.removeMarker(n)}}if(n){const e=n.marker.name.split(":")[1];t.addMarker(`findResultHighlighted:${e}`,{usingOperation:false,affectsData:false,range:n.marker.getRange()})}}))}));const t=(t,e,n)=>{if(n){const t=this.editor.editing.view.domConverter;const e=this.editor.editing.mapper.toViewRange(n.marker.getRange());Lc({target:t.viewRangeToDom(e),viewportOffset:40})}};const e=Su(t.bind(this),32);this.listenTo(this.state,"change:highlightedResult",e,{priority:"low"});this.listenTo(this.editor,"destroy",e.cancel)}find(t){const{editor:e}=this;const{model:n}=e;const{findCallback:i,results:o}=e.execute("find",t);this._activeResults=o;this.listenTo(n.document,"change:data",(()=>rP(this._activeResults,e,i)));return this._activeResults}stop(){if(!this._activeResults){return}this.stopListening(this.editor.model.document);this.state.clear(this.editor.model);this._activeResults=null}_defineCommands(){this.editor.commands.add("find",new WN(this.editor,this.state));this.editor.commands.add("findNext",new KN(this.editor,this.state));this.editor.commands.add("findPrevious",new YN(this.editor,this.state));this.editor.commands.add("replace",new qN(this.editor,this.state));this.editor.commands.add("replaceAll",new $N(this.editor,this.state))}_defineConverters(){const{editor:t}=this;t.conversion.for("editingDowncast").markerToHighlight({model:"findResult",view:({markerName:t})=>{const[,e]=t.split(":");return{name:"span",classes:["ck-find-result"],attributes:{"data-find-result":e}}}});t.conversion.for("editingDowncast").markerToHighlight({model:"findResultHighlighted",view:({markerName:t})=>{const[,e]=t.split(":");return{name:"span",classes:[oP],attributes:{"data-find-result":e}}}})}}class aP extends bh{static get requires(){return[sP,UN]}static get pluginName(){return"FindAndReplace"}init(){const t=this.editor.plugins.get("FindAndReplaceUI");const e=this.editor.plugins.get("FindAndReplaceEditing");const n=e.state;t.on("findNext",((t,e)=>{if(e){n.searchText=e.searchText;this.editor.execute("find",e.searchText,e)}else{this.editor.execute("findNext")}}));t.on("findPrevious",((t,e)=>{if(e&&n.searchText!==e.searchText){this.editor.execute("find",e.searchText)}else{this.editor.execute("findPrevious")}}));t.on("replace",((t,e)=>{if(n.searchText!==e.searchText){this.editor.execute("find",e.searchText)}const i=n.highlightedResult;if(i){this.editor.execute("replace",e.replaceText,i)}}));t.on("replaceAll",((t,e)=>{if(n.searchText!==e.searchText){this.editor.execute("find",e.searchText)}this.editor.execute("replaceAll",e.replaceText,n.results)}));t.on("searchReseted",(()=>{n.clear(this.editor.model);e.stop()}))}}class cP extends wh{constructor(t){super(t);this._isEnabledBasedOnSelection=false}refresh(){const t=this.editor.model;const e=t.document;const n=fl(e.selection.getSelectedBlocks());this.value=!!n&&n.is("element","paragraph");this.isEnabled=!!n&&lP(n,t.schema)}execute(t={}){const e=this.editor.model;const n=e.document;const i=t.selection||n.selection;if(!e.canEditAt(i)){return}e.change((t=>{const n=i.getSelectedBlocks();for(const i of n){if(!i.is("element","paragraph")&&lP(i,e.schema)){t.rename(i,"paragraph")}}}))}}function lP(t,e){return e.checkChild(t.parent,"paragraph")&&!e.isObject(t)}class dP extends wh{constructor(t){super(t);this._isEnabledBasedOnSelection=false}execute(t){const e=this.editor.model;const n=t.attributes;let i=t.position;if(!e.canEditAt(i)){return}e.change((t=>{i=this._findPositionToInsertParagraph(i,t);if(!i){return}const o=t.createElement("paragraph");if(n){e.schema.setAllowedAttributes(o,n,t)}e.insertContent(o,i);t.setSelection(o,"in")}))}_findPositionToInsertParagraph(t,e){const n=this.editor.model;if(n.schema.checkChild(t,"paragraph")){return t}const i=n.schema.findAllowedParent(t,"paragraph");if(!i){return null}const o=t.parent;const r=n.schema.checkChild(o,"$text");if(o.isEmpty||r&&t.isAtEnd){return n.createPositionAfter(o)}if(!o.isEmpty&&r&&t.isAtStart){return n.createPositionBefore(o)}return e.split(t,i).position}}class uP extends bh{static get pluginName(){return"Paragraph"}init(){const t=this.editor;const e=t.model;t.commands.add("paragraph",new cP(t));t.commands.add("insertParagraph",new dP(t));e.schema.register("paragraph",{inheritAllFrom:"$block"});t.conversion.elementToElement({model:"paragraph",view:"p"});t.conversion.for("upcast").elementToElement({model:(t,{writer:e})=>{if(!uP.paragraphLikeElements.has(t.name)){return null}if(t.isEmpty){return null}return e.createElement("paragraph")},view:/.+/,converterPriority:"low"})}}uP.paragraphLikeElements=new Set(["blockquote","dd","div","dt","h1","h2","h3","h4","h5","h6","li","p","td","th"]);const hP=uP;const mP=Ty.paragraph;class gP extends(null&&Plugin){static get requires(){return[Paragraph]}init(){const t=this.editor;const e=t.t;t.ui.componentFactory.add("paragraph",(n=>{const i=new ButtonView(n);const o=t.commands.get("paragraph");i.label=e("Paragraph");i.icon=mP;i.tooltip=true;i.isToggleable=true;i.bind("isEnabled").to(o);i.bind("isOn").to(o,"value");i.on("execute",(()=>{t.execute("paragraph")}));return i}))}}class fP extends wh{constructor(t,e){super(t);this.modelElements=e}refresh(){const t=fl(this.editor.model.document.selection.getSelectedBlocks());this.value=!!t&&this.modelElements.includes(t.name)&&t.name;this.isEnabled=!!t&&this.modelElements.some((e=>pP(t,e,this.editor.model.schema)))}execute(t){const e=this.editor.model;const n=e.document;const i=t.value;e.change((t=>{const o=Array.from(n.selection.getSelectedBlocks()).filter((t=>pP(t,i,e.schema)));for(const e of o){if(!e.is("element",i)){t.rename(e,i)}}}))}}function pP(t,e,n){return n.checkChild(t.parent,e)&&!n.isObject(t)}const bP="paragraph";class kP extends bh{static get pluginName(){return"HeadingEditing"}constructor(t){super(t);t.config.define("heading",{options:[{model:"paragraph",title:"Paragraph",class:"ck-heading_paragraph"},{model:"heading1",view:"h2",title:"Heading 1",class:"ck-heading_heading1"},{model:"heading2",view:"h3",title:"Heading 2",class:"ck-heading_heading2"},{model:"heading3",view:"h4",title:"Heading 3",class:"ck-heading_heading3"}]})}static get requires(){return[hP]}init(){const t=this.editor;const e=t.config.get("heading.options");const n=[];for(const i of e){if(i.model==="paragraph"){continue}t.model.schema.register(i.model,{inheritAllFrom:"$block"});t.conversion.elementToElement(i);n.push(i.model)}this._addDefaultH1Conversion(t);t.commands.add("heading",new fP(t,n))}afterInit(){const t=this.editor;const e=t.commands.get("enter");const n=t.config.get("heading.options");if(e){this.listenTo(e,"afterExecute",((e,i)=>{const o=t.model.document.selection.getFirstPosition().parent;const r=n.some((t=>o.is("element",t.model)));if(r&&!o.is("element",bP)&&o.childCount===0){i.writer.rename(o,bP)}}))}}_addDefaultH1Conversion(t){t.conversion.for("upcast").elementToElement({model:"heading1",view:"h1",converterPriority:B.low+1})}}function wP(t){const e=t.t;const n={Paragraph:e("Paragraph"),"Heading 1":e("Heading 1"),"Heading 2":e("Heading 2"),"Heading 3":e("Heading 3"),"Heading 4":e("Heading 4"),"Heading 5":e("Heading 5"),"Heading 6":e("Heading 6")};return t.config.get("heading.options").map((t=>{const e=n[t.title];if(e&&e!=t.title){t.title=e}return t}))}var AP=n(7776);var CP={injectType:"singletonStyleTag",attributes:{"data-cke":true}};CP.insert="head";CP.singleton=true;var _P=Pl()(AP.c,CP);const vP=AP.c.locals||{};class yP extends bh{static get pluginName(){return"HeadingUI"}init(){const t=this.editor;const e=t.t;const n=wP(t);const i=e("Choose heading");const o=e("Heading");t.ui.componentFactory.add("heading",(e=>{const r={};const s=new gl;const a=t.commands.get("heading");const c=t.commands.get("paragraph");const l=[a];for(const t of n){const e={type:"button",model:new kT({label:t.title,class:t.class,role:"menuitemradio",withText:true})};if(t.model==="paragraph"){e.model.bind("isOn").to(c,"value");e.model.set("commandName","paragraph");l.push(c)}else{e.model.bind("isOn").to(a,"value",(e=>e===t.model));e.model.set({commandName:"heading",commandValue:t.model})}s.add(e);r[t.model]=t.title}const d=sx(e);lx(d,s,{ariaLabel:o,role:"menu"});d.buttonView.set({ariaLabel:o,ariaLabelledBy:undefined,isOn:false,withText:true,tooltip:o});d.extendTemplate({attributes:{class:["ck-heading-dropdown"]}});d.bind("isEnabled").toMany(l,"isEnabled",((...t)=>t.some((t=>t))));d.buttonView.bind("label").to(a,"value",c,"value",((t,e)=>{const n=t||e&&"paragraph";if(typeof n==="boolean"){return i}if(!r[n]){return i}return r[n]}));this.listenTo(d,"execute",(e=>{const{commandName:n,commandValue:i}=e.source;t.execute(n,i?{value:i}:undefined);t.editing.view.focus()}));return d}))}}class xP extends bh{static get requires(){return[kP,yP]}static get pluginName(){return"Heading"}}const EP={heading1:Ty.heading1,heading2:Ty.heading2,heading3:Ty.heading3,heading4:Ty.heading4,heading5:Ty.heading5,heading6:Ty.heading6};class DP extends(null&&Plugin){init(){const t=getLocalizedOptions(this.editor);t.filter((t=>t.model!=="paragraph")).map((t=>this._createButton(t)))}_createButton(t){const e=this.editor;e.ui.componentFactory.add(t.model,(n=>{const i=new ButtonView(n);const o=e.commands.get("heading");i.label=t.title;i.icon=t.icon||EP[t.model];i.tooltip=true;i.isToggleable=true;i.bind("isEnabled").to(o);i.bind("isOn").to(o,"value",(e=>e==t.model));i.on("execute",(()=>{e.execute("heading",{value:t.model});e.editing.view.focus()}));return i}))}}const TP=new Set(["paragraph","heading1","heading2","heading3","heading4","heading5","heading6"]);class SP extends bh{constructor(){super(...arguments);this._bodyPlaceholder=new Map}static get pluginName(){return"Title"}static get requires(){return["Paragraph"]}init(){const t=this.editor;const e=t.model;e.schema.register("title",{isBlock:true,allowIn:"$root"});e.schema.register("title-content",{isBlock:true,allowIn:"title",allowAttributes:["alignment"]});e.schema.extend("$text",{allowIn:"title-content"});e.schema.addAttributeCheck((t=>{if(t.endsWith("title-content $text")){return false}}));t.editing.mapper.on("modelToViewPosition",BP(t.editing.view));t.data.mapper.on("modelToViewPosition",BP(t.editing.view));t.conversion.for("downcast").elementToElement({model:"title-content",view:"h1"});t.conversion.for("downcast").add((t=>t.on("insert:title",((t,e,n)=>{n.consumable.consume(e.item,t.name)}))));t.data.upcastDispatcher.on("element:h1",IP,{priority:"high"});t.data.upcastDispatcher.on("element:h2",IP,{priority:"high"});t.data.upcastDispatcher.on("element:h3",IP,{priority:"high"});e.document.registerPostFixer((t=>this._fixTitleContent(t)));e.document.registerPostFixer((t=>this._fixTitleElement(t)));e.document.registerPostFixer((t=>this._fixBodyElement(t)));e.document.registerPostFixer((t=>this._fixExtraParagraph(t)));this._attachPlaceholders();this._attachTabPressHandling()}getTitle(t={}){const e=t.rootName?t.rootName:undefined;const n=this._getTitleElement(e);const i=n.getChild(0);return this.editor.data.stringify(i,t)}getBody(t={}){const e=this.editor;const n=e.data;const i=e.model;const o=t.rootName?t.rootName:undefined;const r=e.model.document.getRoot(o);const s=e.editing.view;const a=new Tf(s.document);const c=i.createRangeIn(r);const l=a.createDocumentFragment();const d=i.createPositionAfter(r.getChild(0));const u=i.createRange(d,i.createPositionAt(r,"end"));const h=new Map;for(const t of i.markers){const e=u.getIntersection(t.getRange());if(e){h.set(t.name,e)}}n.mapper.clearBindings();n.mapper.bindElements(r,l);n.downcastDispatcher.convert(c,h,a,t);a.remove(a.createRangeOn(l.getChild(0)));return e.data.processor.toData(l)}_getTitleElement(t){const e=this.editor.model.document.getRoot(t);for(const t of e.getChildren()){if(MP(t)){return t}}}_fixTitleContent(t){let e=false;for(const n of this.editor.model.document.getRootNames()){const i=this._getTitleElement(n);if(!i||i.maxOffset===1){continue}const o=Array.from(i.getChildren());o.shift();for(const e of o){t.move(t.createRangeOn(e),i,"after");t.rename(e,"paragraph")}e=true}return e}_fixTitleElement(t){let e=false;const n=this.editor.model;for(const i of this.editor.model.document.getRoots()){const o=Array.from(i.getChildren()).filter(MP);const r=o[0];const s=i.getChild(0);if(s.is("element","title")){if(o.length>1){NP(o,t,n);e=true}continue}if(!r&&!TP.has(s.name)){const n=t.createElement("title");t.insert(n,i);t.insertElement("title-content",n);e=true;continue}if(TP.has(s.name)){LP(s,t,n)}else{t.move(t.createRangeOn(r),i,0)}NP(o,t,n);e=true}return e}_fixBodyElement(t){let e=false;for(const n of this.editor.model.document.getRootNames()){const i=this.editor.model.document.getRoot(n);if(i.childCount<2){const o=t.createElement("paragraph");t.insert(o,i,1);this._bodyPlaceholder.set(n,o);e=true}}return e}_fixExtraParagraph(t){let e=false;for(const n of this.editor.model.document.getRootNames()){const i=this.editor.model.document.getRoot(n);const o=this._bodyPlaceholder.get(n);if(zP(o,i)){this._bodyPlaceholder.delete(n);t.remove(o);e=true}}return e}_attachPlaceholders(){const t=this.editor;const e=t.t;const n=t.editing.view;const i=t.sourceElement;const o=t.config.get("title.placeholder")||e("Type your title");const r=t.config.get("placeholder")||i&&i.tagName.toLowerCase()==="textarea"&&i.getAttribute("placeholder")||e("Type or paste your content here.");t.editing.downcastDispatcher.on("insert:title-content",((t,e,i)=>{const r=i.mapper.toViewElement(e.item);r.placeholder=o;Bh({view:n,element:r,keepOnFocus:true})}));const s=new Map;n.document.registerPostFixer((t=>{let e=false;for(const i of n.document.roots){if(i.isEmpty){continue}const n=i.getChild(1);const o=s.get(i.rootName);if(n!==o){if(o){Nh(t,o);t.removeAttribute("data-placeholder",o)}t.setAttribute("data-placeholder",r,n);s.set(i.rootName,n);e=true}if(Ph(n,true)&&i.childCount===2&&n.name==="p"){e=Lh(t,n)?true:e}else{e=Nh(t,n)?true:e}}return e}))}_attachTabPressHandling(){const t=this.editor;const e=t.model;t.keystrokes.set("TAB",((t,n)=>{e.change((t=>{const i=e.document.selection;const o=Array.from(i.getSelectedBlocks());if(o.length===1&&o[0].is("element","title-content")){const e=i.getFirstPosition().root;const o=e.getChild(1);t.setSelection(o,0);n()}}))}));t.keystrokes.set("SHIFT + TAB",((n,i)=>{e.change((n=>{const o=e.document.selection;if(!o.isCollapsed){return}const r=fl(o.getSelectedBlocks());const s=o.getFirstPosition();const a=t.model.document.getRoot(s.root.rootName);const c=a.getChild(0);const l=a.getChild(1);if(r===l&&s.isAtStart){n.setSelection(c.getChild(0),0);i()}}))}))}}function IP(t,e,n){const i=e.modelCursor;const o=e.viewItem;if(!i.isAtStart||!i.parent.is("element","$root")){return}if(!n.consumable.consume(o,{name:true})){return}const r=n.writer;const s=r.createElement("title");const a=r.createElement("title-content");r.append(a,s);r.insert(s,i);n.convertChildren(o,a);n.updateConversionResult(s,e)}function BP(t){return(e,n)=>{const i=n.modelPosition.parent;if(!i.is("element","title")){return}const o=i.parent;const r=n.mapper.toViewElement(o);n.viewPosition=t.createPositionAt(r,0);e.stop()}}function MP(t){return t.is("element","title")}function LP(t,e,n){const i=e.createElement("title");e.insert(i,t,"before");e.insert(t,i,0);e.rename(t,"title-content");n.schema.removeDisallowedAttributes([t],e)}function NP(t,e,n){let i=false;for(const o of t){if(o.index!==0){PP(o,e,n);i=true}}return i}function PP(t,e,n){const i=t.getChild(0);if(i.isEmpty){e.remove(t);return}e.move(e.createRangeOn(i),t,"before");e.rename(i,"paragraph");e.remove(t);n.schema.removeDisallowedAttributes([i],e)}function zP(t,e){if(!t||!t.is("element","paragraph")||t.childCount){return false}if(e.childCount<=2||e.getChild(e.childCount-1)!==t){return false}return true}class RP extends wh{refresh(){const t=this.editor.model;const e=t.schema;const n=t.document.selection;this.isEnabled=VP(n,e,t)}execute(){const t=this.editor.model;t.change((e=>{const n=e.createElement("horizontalLine");t.insertObject(n,null,null,{setSelection:"after"})}))}}function VP(t,e,n){const i=OP(t,n);return e.checkChild(i,"horizontalLine")}function OP(t,e){const n=qM(t,e);const i=n.start.parent;if(i.isEmpty&&!i.is("element","$root")){return i.parent}return i}var FP=n(4292);var jP={injectType:"singletonStyleTag",attributes:{"data-cke":true}};jP.insert="head";jP.singleton=true;var HP=Pl()(FP.c,jP);const UP=FP.c.locals||{};class WP extends bh{static get pluginName(){return"HorizontalLineEditing"}init(){const t=this.editor;const e=t.model.schema;const n=t.t;const i=t.conversion;e.register("horizontalLine",{inheritAllFrom:"$blockObject"});i.for("dataDowncast").elementToElement({model:"horizontalLine",view:(t,{writer:e})=>e.createEmptyElement("hr")});i.for("editingDowncast").elementToStructure({model:"horizontalLine",view:(t,{writer:e})=>{const i=n("Horizontal line");const o=e.createContainerElement("div",null,e.createEmptyElement("hr"));e.addClass("ck-horizontal-line",o);e.setCustomProperty("hr",true,o);return GP(o,e,i)}});i.for("upcast").elementToElement({view:"hr",model:"horizontalLine"});t.commands.add("horizontalLine",new RP(t))}}function GP(t,e,n){e.setCustomProperty("horizontalLine",true,t);return OM(t,e,{label:n})}class qP extends bh{static get pluginName(){return"HorizontalLineUI"}init(){const t=this.editor;const e=t.t;t.ui.componentFactory.add("horizontalLine",(n=>{const i=t.commands.get("horizontalLine");const o=new Dd(n);o.set({label:e("Horizontal line"),icon:Ty.horizontalLine,tooltip:true});o.bind("isEnabled").to(i,"isEnabled");this.listenTo(o,"execute",(()=>{t.execute("horizontalLine");t.editing.view.focus()}));return o}))}}class $P extends bh{static get requires(){return[WP,qP,xL]}static get pluginName(){return"HorizontalLine"}}function KP(t,e,n,i){var o=-1,r=t==null?0:t.length;if(i&&r){n=t[++o]}while(++o=i?t:zm(t,e,n)}const lR=cR;var dR="\\ud800-\\udfff",uR="\\u0300-\\u036f",hR="\\ufe20-\\ufe2f",mR="\\u20d0-\\u20ff",gR=uR+hR+mR,fR="\\ufe0e\\ufe0f";var pR="\\u200d";var bR=RegExp("["+pR+dR+gR+fR+"]");function kR(t){return bR.test(t)}const wR=kR;function AR(t){return t.split("")}const CR=AR;var _R="\\ud800-\\udfff",vR="\\u0300-\\u036f",yR="\\ufe20-\\ufe2f",xR="\\u20d0-\\u20ff",ER=vR+yR+xR,DR="\\ufe0e\\ufe0f";var TR="["+_R+"]",SR="["+ER+"]",IR="\\ud83c[\\udffb-\\udfff]",BR="(?:"+SR+"|"+IR+")",MR="[^"+_R+"]",LR="(?:\\ud83c[\\udde6-\\uddff]){2}",NR="[\\ud800-\\udbff][\\udc00-\\udfff]",PR="\\u200d";var zR=BR+"?",RR="["+DR+"]?",VR="(?:"+PR+"(?:"+[MR,LR,NR].join("|")+")"+RR+zR+")*",OR=RR+zR+VR,FR="(?:"+[MR+SR+"?",SR,LR,NR,TR].join("|")+")";var jR=RegExp(IR+"(?="+IR+")|"+FR+OR,"g");function HR(t){return t.match(jR)||[]}const UR=HR;function WR(t){return wR(t)?UR(t):CR(t)}const GR=WR;function qR(t){return function(e){e=xm(e);var n=wR(e)?GR(e):undefined;var i=n?n[0]:e.charAt(0);var o=n?lR(n,1).join(""):e.slice(1);return i[t]()+o}}const $R=qR;var KR=$R("toUpperCase");const YR=KR;var QR=aR((function(t,e,n){return t+(n?" ":"")+YR(e)}));const ZR=QR;function JR(t,e,n,i){if(e){tV(t,e,i)}if(n){XR(t,n,i)}}function XR(t,e,n){if(e.attributes){for(const[i,o]of Object.entries(e.attributes)){t.setAttribute(i,o,n)}}if(e.styles){t.setStyle(e.styles,n)}if(e.classes){t.addClass(e.classes,n)}}function tV(t,e,n){if(e.attributes){for(const[i]of Object.entries(e.attributes)){t.removeAttribute(i,n)}}if(e.styles){for(const i of Object.keys(e.styles)){t.removeStyle(i,n)}}if(e.classes){t.removeClass(e.classes,n)}}function eV(t,e){const n=jb(t);let i="attributes";for(i in e){if(i=="classes"){n[i]=Array.from(new Set([...t[i]||[],...e[i]]))}else{n[i]={...t[i],...e[i]}}}return n}function nV(t,e,n,i,o){const r=e.getAttribute(n);const s={};for(const t of["attributes","styles","classes"]){if(t!=i){if(r&&r[t]){s[t]=r[t]}continue}if(i=="classes"){const e=new Set(r&&r.classes||[]);o(e);if(e.size){s[t]=Array.from(e)}continue}const e=new Map(Object.entries(r&&r[t]||{}));o(e);if(e.size){s[t]=Object.fromEntries(e)}}if(Object.keys(s).length){if(e.is("documentSelection")){t.setSelectionAttribute(n,s)}else{t.setAttribute(n,s,e)}}else if(r){if(e.is("documentSelection")){t.removeSelectionAttribute(n)}else{t.removeAttribute(n,e)}}}function iV(t){return ZR(t).replace(/ /g,"")}function oV(t){return`html${iV(t)}Attributes`}function rV({model:t}){return(e,n)=>n.writer.createElement(t,{htmlContent:e.getCustomProperty("$rawContent")})}function sV(t,{view:e,isInline:n}){const i=t.t;return(t,{writer:o})=>{const r=i("HTML object");const s=aV(e,t,o);const a=t.getAttribute(oV(e));o.addClass("html-object-embed__content",s);if(a){XR(o,a,s)}const c=o.createContainerElement(n?"span":"div",{class:"html-object-embed","data-html-object-embed-label":r},s);return OM(c,o,{label:r})}}function aV(t,e,n){return n.createRawElement(t,null,((t,n)=>{n.setContentOf(t,e.getAttribute("htmlContent"))}))}function cV({view:t,model:e,allowEmpty:n},i){return e=>{e.on(`element:${t}`,((t,e,r)=>{let s=i.processViewAttributes(e.viewItem,r);if(!s&&!r.consumable.test(e.viewItem,{name:true})){return}s=s||{};r.consumable.consume(e.viewItem,{name:true});if(!e.modelRange){e=Object.assign(e,r.convertChildren(e.viewItem,e.modelCursor))}if(n&&e.modelRange.isCollapsed&&Object.keys(s).length){const t=r.writer.createElement("htmlEmptyElement");if(!r.safeInsert(t,e.modelCursor)){return}const n=r.getSplitParts(t);e.modelRange=r.writer.createRange(e.modelRange.start,r.writer.createPositionAfter(n[n.length-1]));r.updateConversionResult(t,e);o(t,s,r);return}for(const t of e.modelRange.getItems()){o(t,s,r)}}),{priority:"low"})};function o(t,n,i){if(i.schema.checkAttribute(t,e)){const o=t.getAttribute(e);const r=eV(n,o||{});i.writer.setAttribute(e,r,t)}}}function lV({model:t,view:e},n){return(i,{writer:o,consumable:r})=>{if(!i.hasAttribute(t)){return null}const s=o.createContainerElement(e);const a=i.getAttribute(t);r.consume(i,`attribute:${t}`);XR(o,a,s);s.getFillerOffset=()=>null;return n?OM(s,o):s}}function dV({priority:t,view:e}){return(n,i)=>{if(!n){return}const{writer:o}=i;const r=o.createAttributeElement(e,null,{priority:t});XR(o,n,r);return r}}function uV({view:t},e){return n=>{n.on(`element:${t}`,((t,n,i)=>{if(!n.modelRange||n.modelRange.isCollapsed){return}const o=e.processViewAttributes(n.viewItem,i);if(!o){return}i.writer.setAttribute(oV(n.viewItem.name),o,n.modelRange)}),{priority:"low"})}}function hV({view:t,model:e}){return n=>{n.on(`attribute:${oV(t)}:${e}`,((t,e,n)=>{if(!n.consumable.consume(e.item,t.name)){return}const{attributeOldValue:i,attributeNewValue:o}=e;const r=n.writer;const s=n.mapper.toViewElement(e.item);JR(r,i,o,s)}))}}const mV={block:[{model:"codeBlock",view:"pre"},{model:"paragraph",view:"p"},{model:"blockQuote",view:"blockquote"},{model:"listItem",view:"li"},{model:"pageBreak",view:"div"},{model:"rawHtml",view:"div"},{model:"table",view:"table"},{model:"tableRow",view:"tr"},{model:"tableCell",view:"td"},{model:"tableCell",view:"th"},{model:"tableColumnGroup",view:"colgroup"},{model:"tableColumn",view:"col"},{model:"caption",view:"caption"},{model:"caption",view:"figcaption"},{model:"imageBlock",view:"img"},{model:"imageInline",view:"img"},{model:"htmlP",view:"p",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlBlockquote",view:"blockquote",modelSchema:{inheritAllFrom:"$container"}},{model:"htmlTable",view:"table",modelSchema:{allowWhere:"$block",isBlock:true}},{model:"htmlTbody",view:"tbody",modelSchema:{allowIn:"htmlTable",isBlock:false}},{model:"htmlThead",view:"thead",modelSchema:{allowIn:"htmlTable",isBlock:false}},{model:"htmlTfoot",view:"tfoot",modelSchema:{allowIn:"htmlTable",isBlock:false}},{model:"htmlCaption",view:"caption",modelSchema:{allowIn:"htmlTable",allowChildren:"$text",isBlock:false}},{model:"htmlColgroup",view:"colgroup",modelSchema:{allowIn:"htmlTable",allowChildren:"col",isBlock:false}},{model:"htmlCol",view:"col",modelSchema:{allowIn:"htmlColgroup",isBlock:false}},{model:"htmlTr",view:"tr",modelSchema:{allowIn:["htmlTable","htmlThead","htmlTbody"],isLimit:true}},{model:"htmlTd",view:"td",modelSchema:{allowIn:"htmlTr",allowContentOf:"$container",isLimit:true,isBlock:false}},{model:"htmlTh",view:"th",modelSchema:{allowIn:"htmlTr",allowContentOf:"$container",isLimit:true,isBlock:false}},{model:"htmlFigure",view:"figure",modelSchema:{inheritAllFrom:"$container",isBlock:false}},{model:"htmlFigcaption",view:"figcaption",modelSchema:{allowIn:"htmlFigure",allowChildren:"$text",isBlock:false}},{model:"htmlAddress",view:"address",modelSchema:{inheritAllFrom:"$container",isBlock:false}},{model:"htmlAside",view:"aside",modelSchema:{inheritAllFrom:"$container",isBlock:false}},{model:"htmlMain",view:"main",modelSchema:{inheritAllFrom:"$container",isBlock:false}},{model:"htmlDetails",view:"details",modelSchema:{inheritAllFrom:"$container",isBlock:false}},{model:"htmlSummary",view:"summary",modelSchema:{allowChildren:"$text",allowIn:"htmlDetails",isBlock:false}},{model:"htmlDiv",view:"div",paragraphLikeModel:"htmlDivParagraph",modelSchema:{inheritAllFrom:"$container"}},{model:"htmlFieldset",view:"fieldset",modelSchema:{inheritAllFrom:"$container",isBlock:false}},{model:"htmlLegend",view:"legend",modelSchema:{allowIn:"htmlFieldset",allowChildren:"$text"}},{model:"htmlHeader",view:"header",modelSchema:{inheritAllFrom:"$container",isBlock:false}},{model:"htmlFooter",view:"footer",modelSchema:{inheritAllFrom:"$container",isBlock:false}},{model:"htmlForm",view:"form",modelSchema:{inheritAllFrom:"$container",isBlock:true}},{model:"htmlHgroup",view:"hgroup",modelSchema:{allowChildren:["htmlH1","htmlH2","htmlH3","htmlH4","htmlH5","htmlH6"],isBlock:false}},{model:"htmlH1",view:"h1",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlH2",view:"h2",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlH3",view:"h3",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlH4",view:"h4",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlH5",view:"h5",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlH6",view:"h6",modelSchema:{inheritAllFrom:"$block"}},{model:"$htmlList",modelSchema:{allowWhere:"$container",allowChildren:["$htmlList","htmlLi"],isBlock:false}},{model:"htmlDir",view:"dir",modelSchema:{inheritAllFrom:"$htmlList"}},{model:"htmlMenu",view:"menu",modelSchema:{inheritAllFrom:"$htmlList"}},{model:"htmlUl",view:"ul",modelSchema:{inheritAllFrom:"$htmlList"}},{model:"htmlOl",view:"ol",modelSchema:{inheritAllFrom:"$htmlList"}},{model:"htmlLi",view:"li",modelSchema:{allowIn:"$htmlList",allowChildren:"$text",isBlock:false}},{model:"htmlPre",view:"pre",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlArticle",view:"article",modelSchema:{inheritAllFrom:"$container",isBlock:false}},{model:"htmlSection",view:"section",modelSchema:{inheritAllFrom:"$container",isBlock:false}},{model:"htmlNav",view:"nav",modelSchema:{inheritAllFrom:"$container",isBlock:false}},{model:"htmlDivDl",view:"div",modelSchema:{allowChildren:["htmlDt","htmlDd"],allowIn:"htmlDl"}},{model:"htmlDl",view:"dl",modelSchema:{allowWhere:"$container",allowChildren:["htmlDt","htmlDd","htmlDivDl"],isBlock:false}},{model:"htmlDt",view:"dt",modelSchema:{allowChildren:"$block",isBlock:false}},{model:"htmlDd",view:"dd",modelSchema:{allowChildren:"$block",isBlock:false}},{model:"htmlCenter",view:"center",modelSchema:{inheritAllFrom:"$container",isBlock:false}}],inline:[{model:"htmlLiAttributes",view:"li",appliesToBlock:true,coupledAttribute:"listItemId"},{model:"htmlOlAttributes",view:"ol",appliesToBlock:true,coupledAttribute:"listItemId"},{model:"htmlUlAttributes",view:"ul",appliesToBlock:true,coupledAttribute:"listItemId"},{model:"htmlFigureAttributes",view:"figure",appliesToBlock:"table"},{model:"htmlTheadAttributes",view:"thead",appliesToBlock:"table"},{model:"htmlTbodyAttributes",view:"tbody",appliesToBlock:"table"},{model:"htmlFigureAttributes",view:"figure",appliesToBlock:"imageBlock"},{model:"htmlAcronym",view:"acronym",attributeProperties:{copyOnEnter:true,isFormatting:true}},{model:"htmlTt",view:"tt",attributeProperties:{copyOnEnter:true,isFormatting:true}},{model:"htmlFont",view:"font",attributeProperties:{copyOnEnter:true,isFormatting:true}},{model:"htmlTime",view:"time",attributeProperties:{copyOnEnter:true,isFormatting:true}},{model:"htmlVar",view:"var",attributeProperties:{copyOnEnter:true,isFormatting:true}},{model:"htmlBig",view:"big",attributeProperties:{copyOnEnter:true,isFormatting:true}},{model:"htmlSmall",view:"small",attributeProperties:{copyOnEnter:true,isFormatting:true}},{model:"htmlSamp",view:"samp",attributeProperties:{copyOnEnter:true,isFormatting:true}},{model:"htmlQ",view:"q",attributeProperties:{copyOnEnter:true,isFormatting:true}},{model:"htmlOutput",view:"output",attributeProperties:{copyOnEnter:true,isFormatting:true}},{model:"htmlKbd",view:"kbd",attributeProperties:{copyOnEnter:true,isFormatting:true}},{model:"htmlBdi",view:"bdi",attributeProperties:{copyOnEnter:true,isFormatting:true}},{model:"htmlBdo",view:"bdo",attributeProperties:{copyOnEnter:true,isFormatting:true}},{model:"htmlAbbr",view:"abbr",attributeProperties:{copyOnEnter:true,isFormatting:true}},{model:"htmlA",view:"a",priority:5,coupledAttribute:"linkHref"},{model:"htmlStrong",view:"strong",coupledAttribute:"bold",attributeProperties:{copyOnEnter:true,isFormatting:true}},{model:"htmlB",view:"b",coupledAttribute:"bold",attributeProperties:{copyOnEnter:true,isFormatting:true}},{model:"htmlI",view:"i",coupledAttribute:"italic",attributeProperties:{copyOnEnter:true,isFormatting:true}},{model:"htmlEm",view:"em",coupledAttribute:"italic",attributeProperties:{copyOnEnter:true,isFormatting:true}},{model:"htmlS",view:"s",coupledAttribute:"strikethrough",attributeProperties:{copyOnEnter:true,isFormatting:true}},{model:"htmlDel",view:"del",coupledAttribute:"strikethrough",attributeProperties:{copyOnEnter:true,isFormatting:true}},{model:"htmlIns",view:"ins",attributeProperties:{copyOnEnter:true,isFormatting:true}},{model:"htmlU",view:"u",coupledAttribute:"underline",attributeProperties:{copyOnEnter:true,isFormatting:true}},{model:"htmlSub",view:"sub",coupledAttribute:"subscript",attributeProperties:{copyOnEnter:true,isFormatting:true}},{model:"htmlSup",view:"sup",coupledAttribute:"superscript",attributeProperties:{copyOnEnter:true,isFormatting:true}},{model:"htmlCode",view:"code",coupledAttribute:"code",attributeProperties:{copyOnEnter:true,isFormatting:true}},{model:"htmlMark",view:"mark",attributeProperties:{copyOnEnter:true,isFormatting:true}},{model:"htmlSpan",view:"span",attributeProperties:{copyOnEnter:true,isFormatting:true}},{model:"htmlCite",view:"cite",attributeProperties:{copyOnEnter:true,isFormatting:true}},{model:"htmlLabel",view:"label",attributeProperties:{copyOnEnter:true,isFormatting:true}},{model:"htmlDfn",view:"dfn",attributeProperties:{copyOnEnter:true,isFormatting:true}},{model:"htmlObject",view:"object",isObject:true,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlIframe",view:"iframe",isObject:true,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlInput",view:"input",isObject:true,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlButton",view:"button",isObject:true,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlTextarea",view:"textarea",isObject:true,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlSelect",view:"select",isObject:true,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlVideo",view:"video",isObject:true,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlEmbed",view:"embed",isObject:true,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlOembed",view:"oembed",isObject:true,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlAudio",view:"audio",isObject:true,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlImg",view:"img",isObject:true,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlCanvas",view:"canvas",isObject:true,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlMeter",view:"meter",isObject:true,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlProgress",view:"progress",isObject:true,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlScript",view:"script",modelSchema:{allowWhere:["$text","$block"],isInline:true}},{model:"htmlStyle",view:"style",modelSchema:{allowWhere:["$text","$block"],isInline:true}},{model:"htmlCustomElement",view:"$customElement",modelSchema:{allowWhere:["$text","$block"],allowAttributesOf:"$inlineObject",isInline:true}}]};var gV=Ig((function(t,e,n,i){sg(t,e,n,i)}));const fV=gV;class pV extends bh{constructor(){super(...arguments);this._definitions=[]}static get pluginName(){return"DataSchema"}init(){for(const t of mV.block){this.registerBlockElement(t)}for(const t of mV.inline){this.registerInlineElement(t)}}registerBlockElement(t){this._definitions.push({...t,isBlock:true})}registerInlineElement(t){this._definitions.push({...t,isInline:true})}extendBlockElement(t){this._extendDefinition({...t,isBlock:true})}extendInlineElement(t){this._extendDefinition({...t,isInline:true})}getDefinitionsForView(t,e=false){const n=new Set;for(const i of this._getMatchingViewDefinitions(t)){if(e){for(const t of this._getReferences(i.model)){n.add(t)}}n.add(i)}return n}getDefinitionsForModel(t){return this._definitions.filter((e=>e.model==t))}_getMatchingViewDefinitions(t){return this._definitions.filter((e=>e.view&&bV(t,e.view)))}*_getReferences(t){const e=["inheritAllFrom","inheritTypesFrom","allowWhere","allowContentOf","allowAttributesOf"];const n=this._definitions.filter((e=>e.model==t));for(const{modelSchema:i}of n){if(!i){continue}for(const n of e){for(const e of ol(i[n]||[])){const n=this._definitions.filter((t=>t.model==e));for(const i of n){if(e!==t){yield*this._getReferences(i.model);yield i}}}}}}_extendDefinition(t){const e=Array.from(this._definitions.entries()).filter((([,e])=>e.model==t.model));if(e.length==0){this._definitions.push(t);return}for(const[n,i]of e){this._definitions[n]=fV({},i,t,((t,e)=>Array.isArray(t)?t.concat(e):undefined))}}}function bV(t,e){if(typeof t==="string"){return t===e}if(t instanceof RegExp){return t.test(e)}return false}function kV(t,e,n,i){var o=t.length,r=n+(i?1:-1);while(i?r--:++r-1){if(a!==t){SV.call(a,c,1)}SV.call(t,c,1)}}return t}const BV=IV;function MV(t,e){return t&&t.length&&e&&e.length?BV(t,e):t}const LV=MV;var NV=Eg(LV);const PV=NV;var zV=n(6204);var RV={injectType:"singletonStyleTag",attributes:{"data-cke":true}};RV.insert="head";RV.singleton=true;var VV=Pl()(zV.c,RV);const OV=zV.c.locals||{};class FV extends bh{constructor(t){super(t);this._dataSchema=t.plugins.get("DataSchema");this._allowedAttributes=new $h;this._disallowedAttributes=new $h;this._allowedElements=new Set;this._disallowedElements=new Set;this._dataInitialized=false;this._coupledAttributes=null;this._registerElementsAfterInit();this._registerElementHandlers();this._registerCoupledAttributesPostFixer();this._registerAssociatedHtmlAttributesPostFixer()}static get pluginName(){return"DataFilter"}static get requires(){return[pV,xL]}loadAllowedConfig(t){for(const e of t){const t=e.name||/[\s\S]+/;const n=$V(e);this.allowElement(t);n.forEach((t=>this.allowAttributes(t)))}}loadDisallowedConfig(t){for(const e of t){const t=e.name||/[\s\S]+/;const n=$V(e);if(n.length==0){this.disallowElement(t)}else{n.forEach((t=>this.disallowAttributes(t)))}}}loadAllowedEmptyElementsConfig(t){for(const e of t){this.allowEmptyElement(e)}}allowElement(t){for(const e of this._dataSchema.getDefinitionsForView(t,true)){this._addAllowedElement(e);this._coupledAttributes=null}}disallowElement(t){for(const e of this._dataSchema.getDefinitionsForView(t,false)){this._disallowedElements.add(e.view)}}allowEmptyElement(t){for(const e of this._dataSchema.getDefinitionsForView(t,true)){if(e.isInline){this._dataSchema.extendInlineElement({...e,allowEmpty:true})}}}allowAttributes(t){this._allowedAttributes.add(t)}disallowAttributes(t){this._disallowedAttributes.add(t)}processViewAttributes(t,e){jV(t,e,this._disallowedAttributes);return jV(t,e,this._allowedAttributes)}_addAllowedElement(t){if(this._allowedElements.has(t)){return}this._allowedElements.add(t);if("appliesToBlock"in t&&typeof t.appliesToBlock=="string"){for(const e of this._dataSchema.getDefinitionsForModel(t.appliesToBlock)){if(e.isBlock){this._addAllowedElement(e)}}}if(this._dataInitialized){this.editor.data.once("set",(()=>{this._fireRegisterEvent(t)}),{priority:B.highest+1})}}_registerElementsAfterInit(){this.editor.data.on("init",(()=>{this._dataInitialized=true;for(const t of this._allowedElements){this._fireRegisterEvent(t)}}),{priority:B.highest+1})}_registerElementHandlers(){this.on("register",((t,e)=>{const n=this.editor.model.schema;if(e.isObject&&!n.isRegistered(e.model)){this._registerObjectElement(e)}else if(e.isBlock){this._registerBlockElement(e)}else if(e.isInline){this._registerInlineElement(e)}else{throw new N("data-filter-invalid-definition",null,e)}t.stop()}),{priority:"lowest"})}_registerCoupledAttributesPostFixer(){const t=this.editor.model;const e=t.document.selection;t.document.registerPostFixer((e=>{const n=t.document.differ.getChanges();let i=false;const o=this._getCoupledAttributesMap();for(const t of n){if(t.type!="attribute"||t.attributeNewValue!==null){continue}const n=o.get(t.attributeKey);if(!n){continue}for(const{item:o}of t.range.getWalker()){for(const t of n){if(o.hasAttribute(t)){e.removeAttribute(t,o);i=true}}}}return i}));this.listenTo(e,"change:attribute",((n,{attributeKeys:i})=>{const o=new Set;const r=this._getCoupledAttributesMap();for(const t of i){if(e.hasAttribute(t)){continue}const n=r.get(t);if(!n){continue}for(const t of n){if(e.hasAttribute(t)){o.add(t)}}}if(o.size==0){return}t.change((t=>{for(const e of o){t.removeSelectionAttribute(e)}}))}))}_registerAssociatedHtmlAttributesPostFixer(){const t=this.editor.model;t.document.registerPostFixer((e=>{const n=t.document.differ.getChanges();let i=false;for(const o of n){if(o.type!=="insert"||o.name==="$text"){continue}for(const n of o.attributes.keys()){if(!n.startsWith("html")||!n.endsWith("Attributes")){continue}if(!t.schema.checkAttribute(o.name,n)){e.removeAttribute(n,o.position.nodeAfter);i=true}}}return i}))}_getCoupledAttributesMap(){if(this._coupledAttributes){return this._coupledAttributes}this._coupledAttributes=new Map;for(const t of this._allowedElements){if(t.coupledAttribute&&t.model){const e=this._coupledAttributes.get(t.coupledAttribute);if(e){e.push(t.model)}else{this._coupledAttributes.set(t.coupledAttribute,[t.model])}}}return this._coupledAttributes}_fireRegisterEvent(t){if(t.view&&this._disallowedElements.has(t.view)){return}this.fire(t.view?`register:${t.view}`:"register",t)}_registerObjectElement(t){const e=this.editor;const n=e.model.schema;const i=e.conversion;const{view:o,model:r}=t;n.register(r,t.modelSchema);if(!o){return}n.extend(t.model,{allowAttributes:[oV(o),"htmlContent"]});e.data.registerRawContentMatcher({name:o});i.for("upcast").elementToElement({view:o,model:rV(t),converterPriority:B.low+2});i.for("upcast").add(uV(t,this));i.for("editingDowncast").elementToStructure({model:{name:r,attributes:[oV(o)]},view:sV(e,t)});i.for("dataDowncast").elementToElement({model:r,view:(t,{writer:e})=>aV(o,t,e)});i.for("dataDowncast").add(hV(t))}_registerBlockElement(t){const e=this.editor;const n=e.model.schema;const i=e.conversion;const{view:o,model:r}=t;if(!n.isRegistered(t.model)){n.register(t.model,t.modelSchema);if(!o){return}i.for("upcast").elementToElement({model:r,view:o,converterPriority:B.low+2});i.for("downcast").elementToElement({model:r,view:o})}if(!o){return}n.extend(t.model,{allowAttributes:oV(o)});i.for("upcast").add(uV(t,this));i.for("downcast").add(hV(t))}_registerInlineElement(t){const e=this.editor;const n=e.model.schema;const i=e.conversion;const o=t.model;if(t.appliesToBlock){return}n.extend("$text",{allowAttributes:o});if(t.attributeProperties){n.setAttributeProperties(o,t.attributeProperties)}i.for("upcast").add(cV(t,this));i.for("downcast").attributeToElement({model:o,view:dV(t)});if(!t.allowEmpty){return}n.setAttributeProperties(o,{copyFromObject:false});if(!n.isRegistered("htmlEmptyElement")){n.register("htmlEmptyElement",{inheritAllFrom:"$inlineObject"})}e.data.htmlProcessor.domConverter.registerInlineObjectMatcher((e=>{if(e.name==t.view&&e.isEmpty&&Array.from(e.getAttributeKeys()).length){return{name:true}}return null}));i.for("editingDowncast").elementToElement({model:"htmlEmptyElement",view:lV(t,true)});i.for("dataDowncast").elementToElement({model:"htmlEmptyElement",view:lV(t)})}}function jV(t,e,n){const i=HV(t,e,n);const{attributes:o,styles:r,classes:s}=WV(i);const a={};if(o.size){for(const t of o){if(!xc(t)){o.delete(t)}}}if(o.size){a.attributes=GV(o,(e=>t.getAttribute(e)))}if(r.size){a.styles=GV(r,(e=>t.getStyle(e)))}if(s.size){a.classes=Array.from(s)}if(!Object.keys(a).length){return null}return a}function HV(t,{consumable:e},n){const i=n.matchAll(t)||[];const o=[];for(const n of i){UV(e,t,n);delete n.match.name;e.consume(t,n.match);o.push(n)}return o}function UV(t,e,n){for(const i of["attributes","classes","styles"]){const o=n.match[i];if(!o){continue}for(const n of Array.from(o)){if(!t.test(e,{[i]:[n]})){PV(o,n)}}}}function WV(t){const e={attributes:new Set,classes:new Set,styles:new Set};for(const n of t){for(const t in e){const i=n.match[t]||[];i.forEach((n=>e[t].add(n)))}}return e}function GV(t,e){const n={};for(const i of t){const t=e(i);if(t!==undefined){n[i]=e(i)}}return n}function qV(t,e){const{name:n}=t;const i=t[e];if(fe(i)){return Object.entries(i).map((([t,i])=>({name:n,[e]:{[t]:i}})))}if(Array.isArray(i)){return i.map((t=>({name:n,[e]:[t]})))}return[t]}function $V(t){const{name:e,attributes:n,classes:i,styles:o}=t;const r=[];if(n){r.push(...qV({name:e,attributes:n},"attributes"))}if(i){r.push(...qV({name:e,classes:i},"classes"))}if(o){r.push(...qV({name:e,styles:o},"styles"))}return r}class KV extends bh{static get requires(){return[FV]}static get pluginName(){return"CodeBlockElementSupport"}init(){if(!this.editor.plugins.has("CodeBlockEditing")){return}const t=this.editor.plugins.get(FV);t.on("register:pre",((e,n)=>{if(n.model!=="codeBlock"){return}const i=this.editor;const o=i.model.schema;const r=i.conversion;o.extend("codeBlock",{allowAttributes:["htmlPreAttributes","htmlContentAttributes"]});r.for("upcast").add(YV(t));r.for("downcast").add(QV());e.stop()}))}}function YV(t){return e=>{e.on("element:code",((e,n,i)=>{const o=n.viewItem;const r=o.parent;if(!r||!r.is("element","pre")){return}s(r,"htmlPreAttributes");s(o,"htmlContentAttributes");function s(e,o){const r=t.processViewAttributes(e,i);if(r){i.writer.setAttribute(o,r,n.modelRange)}}}),{priority:"low"})}}function QV(){return t=>{t.on("attribute:htmlPreAttributes:codeBlock",((t,e,n)=>{if(!n.consumable.consume(e.item,t.name)){return}const{attributeOldValue:i,attributeNewValue:o}=e;const r=n.mapper.toViewElement(e.item);const s=r.parent;JR(n.writer,i,o,s)}));t.on("attribute:htmlContentAttributes:codeBlock",((t,e,n)=>{if(!n.consumable.consume(e.item,t.name)){return}const{attributeOldValue:i,attributeNewValue:o}=e;const r=n.mapper.toViewElement(e.item);JR(n.writer,i,o,r)}))}}class ZV extends bh{static get requires(){return[FV]}static get pluginName(){return"DualContentModelElementSupport"}init(){const t=this.editor.plugins.get(FV);t.on("register",((t,e)=>{const n=e;const i=this.editor;const o=i.model.schema;const r=i.conversion;if(!n.paragraphLikeModel){return}if(o.isRegistered(n.model)||o.isRegistered(n.paragraphLikeModel)){return}const s={model:n.paragraphLikeModel,view:n.view};o.register(n.model,n.modelSchema);o.register(s.model,{inheritAllFrom:"$block"});r.for("upcast").elementToElement({view:n.view,model:(t,{writer:e})=>{if(this._hasBlockContent(t)){return e.createElement(n.model)}return e.createElement(s.model)},converterPriority:B.low+.5});r.for("downcast").elementToElement({view:n.view,model:n.model});this._addAttributeConversion(n);r.for("downcast").elementToElement({view:s.view,model:s.model});this._addAttributeConversion(s);t.stop()}))}_hasBlockContent(t){const e=this.editor.editing.view;const n=e.domConverter.blockElements;for(const i of e.createRangeIn(t).getItems()){if(i.is("element")&&n.includes(i.name)){return true}}return false}_addAttributeConversion(t){const e=this.editor;const n=e.conversion;const i=e.plugins.get(FV);e.model.schema.extend(t.model,{allowAttributes:oV(t.view)});n.for("upcast").add(uV(t,i));n.for("downcast").add(hV(t))}}class JV extends bh{static get requires(){return[pV,oM]}static get pluginName(){return"HeadingElementSupport"}init(){const t=this.editor;if(!t.plugins.has("HeadingEditing")){return}const e=t.config.get("heading.options");this.registerHeadingElements(t,e)}registerHeadingElements(t,e){const n=t.plugins.get(pV);const i=[];for(const t of e){if("model"in t&&"view"in t){n.registerBlockElement({view:t.view,model:t.model});i.push(t.model)}}n.extendBlockElement({model:"htmlHgroup",modelSchema:{allowChildren:i}})}}function XV(t,e,n){const i=t.createRangeOn(e);for(const{item:t}of i.getWalker()){if(t.is("element",n)){return t}}}class tO extends bh{static get requires(){return[FV]}static get pluginName(){return"ImageElementSupport"}init(){const t=this.editor;if(!t.plugins.has("ImageInlineEditing")&&!t.plugins.has("ImageBlockEditing")){return}const e=t.model.schema;const n=t.conversion;const i=t.plugins.get(FV);i.on("register:figure",(()=>{n.for("upcast").add(iO(i))}));i.on("register:img",((o,r)=>{if(r.model!=="imageBlock"&&r.model!=="imageInline"){return}if(e.isRegistered("imageBlock")){e.extend("imageBlock",{allowAttributes:["htmlImgAttributes","htmlFigureAttributes","htmlLinkAttributes"]})}if(e.isRegistered("imageInline")){e.extend("imageInline",{allowAttributes:["htmlA","htmlImgAttributes"]})}n.for("upcast").add(eO(i));n.for("downcast").add(oO());if(t.plugins.has("LinkImage")){n.for("upcast").add(nO(i,t))}o.stop()}))}}function eO(t){return e=>{e.on("element:img",((e,n,i)=>{if(!n.modelRange){return}const o=n.viewItem;const r=t.processViewAttributes(o,i);if(r){i.writer.setAttribute("htmlImgAttributes",r,n.modelRange)}}),{priority:"low"})}}function nO(t,e){const n=e.plugins.get("ImageUtils");return e=>{e.on("element:a",((e,i,o)=>{const r=i.viewItem;const s=n.findViewImgElement(r);if(!s){return}const a=i.modelCursor.parent;if(!a.is("element","imageBlock")){return}const c=t.processViewAttributes(r,o);if(c){o.writer.setAttribute("htmlLinkAttributes",c,a)}}),{priority:"low"})}}function iO(t){return e=>{e.on("element:figure",((e,n,i)=>{const o=n.viewItem;if(!n.modelRange||!o.hasClass("image")){return}const r=t.processViewAttributes(o,i);if(r){i.writer.setAttribute("htmlFigureAttributes",r,n.modelRange)}}),{priority:"low"})}}function oO(){return t=>{e("htmlImgAttributes");n("img","htmlImgAttributes");n("figure","htmlFigureAttributes");n("a","htmlLinkAttributes");function e(e){t.on(`attribute:${e}:imageInline`,((t,e,n)=>{if(!n.consumable.consume(e.item,t.name)){return}const{attributeOldValue:i,attributeNewValue:o}=e;const r=n.mapper.toViewElement(e.item);JR(n.writer,i,o,r)}),{priority:"low"})}function n(e,n){t.on(`attribute:${n}:imageBlock`,((t,n,i)=>{if(!i.consumable.test(n.item,t.name)){return}const{attributeOldValue:o,attributeNewValue:r}=n;const s=i.mapper.toViewElement(n.item);const a=XV(i.writer,s,e);if(a){JR(i.writer,o,r,a);i.consumable.consume(n.item,t.name)}}),{priority:"low"});if(e==="a"){t.on("attribute:linkHref:imageBlock",((t,e,n)=>{if(!n.consumable.consume(e.item,"attribute:htmlLinkAttributes:imageBlock")){return}const i=n.mapper.toViewElement(e.item);const o=XV(n.writer,i,"a");XR(n.writer,e.item.getAttribute("htmlLinkAttributes"),o)}),{priority:"low"})}}}}class rO extends bh{static get requires(){return[FV]}static get pluginName(){return"MediaEmbedElementSupport"}init(){const t=this.editor;if(!t.plugins.has("MediaEmbed")||t.config.get("mediaEmbed.previewsInData")){return}const e=t.model.schema;const n=t.conversion;const i=this.editor.plugins.get(FV);const o=this.editor.plugins.get(pV);const r=t.config.get("mediaEmbed.elementName");o.registerBlockElement({model:"media",view:r});i.on("register:figure",(()=>{n.for("upcast").add(aO(i))}));i.on(`register:${r}`,((t,o)=>{if(o.model!=="media"){return}e.extend("media",{allowAttributes:[oV(r),"htmlFigureAttributes"]});n.for("upcast").add(sO(i,r));n.for("dataDowncast").add(cO(r));t.stop()}))}}function sO(t,e){const n=(n,i,o)=>{const r=i.viewItem;s(r,oV(e));function s(e,n){const r=t.processViewAttributes(e,o);if(r){o.writer.setAttribute(n,r,i.modelRange)}}};return t=>{t.on(`element:${e}`,n,{priority:"low"})}}function aO(t){return e=>{e.on("element:figure",((e,n,i)=>{const o=n.viewItem;if(!n.modelRange||!o.hasClass("media")){return}const r=t.processViewAttributes(o,i);if(r){i.writer.setAttribute("htmlFigureAttributes",r,n.modelRange)}}),{priority:"low"})}}function cO(t){return e=>{n(t,oV(t));n("figure","htmlFigureAttributes");function n(t,n){e.on(`attribute:${n}:media`,((e,n,i)=>{if(!i.consumable.consume(n.item,e.name)){return}const{attributeOldValue:o,attributeNewValue:r}=n;const s=i.mapper.toViewElement(n.item);const a=XV(i.writer,s,t);JR(i.writer,o,r,a)}))}}}class lO extends bh{static get requires(){return[FV]}static get pluginName(){return"ScriptElementSupport"}init(){const t=this.editor.plugins.get(FV);t.on("register:script",((e,n)=>{const i=this.editor;const o=i.model.schema;const r=i.conversion;o.register("htmlScript",n.modelSchema);o.extend("htmlScript",{allowAttributes:["htmlScriptAttributes","htmlContent"],isContent:true});i.data.registerRawContentMatcher({name:"script"});r.for("upcast").elementToElement({view:"script",model:rV(n)});r.for("upcast").add(uV(n,t));r.for("downcast").elementToElement({model:"htmlScript",view:(t,{writer:e})=>aV("script",t,e)});r.for("downcast").add(hV(n));e.stop()}))}}class dO extends bh{static get requires(){return[FV]}static get pluginName(){return"TableElementSupport"}init(){const t=this.editor;if(!t.plugins.has("TableEditing")){return}const e=t.model.schema;const n=t.conversion;const i=t.plugins.get(FV);const o=t.plugins.get("TableUtils");i.on("register:figure",(()=>{n.for("upcast").add(mO(i))}));i.on("register:table",((r,s)=>{if(s.model!=="table"){return}e.extend("table",{allowAttributes:["htmlTableAttributes","htmlFigureAttributes","htmlTheadAttributes","htmlTbodyAttributes"]});n.for("upcast").add(hO(i));n.for("downcast").add(gO());t.model.document.registerPostFixer(uO(t.model,o));r.stop()}))}}function uO(t,e){return n=>{const i=t.document.differ.getChanges();let o=false;for(const t of i){if(t.type!="attribute"||t.attributeKey!="headingRows"){continue}const i=t.range.start.nodeAfter;const r=i.getAttribute("htmlTheadAttributes");const s=i.getAttribute("htmlTbodyAttributes");if(r&&!t.attributeNewValue){n.removeAttribute("htmlTheadAttributes",i);o=true}else if(s&&t.attributeNewValue==e.getRows(i)){n.removeAttribute("htmlTbodyAttributes",i);o=true}}return o}}function hO(t){return e=>{e.on("element:table",((e,n,i)=>{if(!n.modelRange){return}const o=n.viewItem;r(o,"htmlTableAttributes");for(const t of o.getChildren()){if(t.is("element","thead")){r(t,"htmlTheadAttributes")}if(t.is("element","tbody")){r(t,"htmlTbodyAttributes")}}function r(e,o){const r=t.processViewAttributes(e,i);if(r){i.writer.setAttribute(o,r,n.modelRange)}}}),{priority:"low"})}}function mO(t){return e=>{e.on("element:figure",((e,n,i)=>{const o=n.viewItem;if(!n.modelRange||!o.hasClass("table")){return}const r=t.processViewAttributes(o,i);if(r){i.writer.setAttribute("htmlFigureAttributes",r,n.modelRange)}}),{priority:"low"})}}function gO(){return t=>{e("table","htmlTableAttributes");e("figure","htmlFigureAttributes");e("thead","htmlTheadAttributes");e("tbody","htmlTbodyAttributes");function e(e,n){t.on(`attribute:${n}:table`,((t,n,i)=>{if(!i.consumable.test(n.item,t.name)){return}const o=i.mapper.toViewElement(n.item);const r=XV(i.writer,o,e);if(!r){return}i.consumable.consume(n.item,t.name);JR(i.writer,n.attributeOldValue,n.attributeNewValue,r)}))}}}class fO extends bh{static get requires(){return[FV]}static get pluginName(){return"StyleElementSupport"}init(){const t=this.editor.plugins.get(FV);t.on("register:style",((e,n)=>{const i=this.editor;const o=i.model.schema;const r=i.conversion;o.register("htmlStyle",n.modelSchema);o.extend("htmlStyle",{allowAttributes:["htmlStyleAttributes","htmlContent"],isContent:true});i.data.registerRawContentMatcher({name:"style"});r.for("upcast").elementToElement({view:"style",model:rV(n)});r.for("upcast").add(uV(n,t));r.for("downcast").elementToElement({model:"htmlStyle",view:(t,{writer:e})=>aV("style",t,e)});r.for("downcast").add(hV(n));e.stop()}))}}class pO extends bh{static get requires(){return[FV]}static get pluginName(){return"ListElementSupport"}init(){const t=this.editor;if(!t.plugins.has("ListEditing")){return}const e=t.model.schema;const n=t.conversion;const i=t.plugins.get(FV);const o=t.plugins.get("ListEditing");const r=["ul","ol","li"];o.registerDowncastStrategy({scope:"item",attributeName:"htmlLiAttributes",setAttributeOnDowncast:XR});o.registerDowncastStrategy({scope:"list",attributeName:"htmlUlAttributes",setAttributeOnDowncast:XR});o.registerDowncastStrategy({scope:"list",attributeName:"htmlOlAttributes",setAttributeOnDowncast:XR});i.on("register",((t,o)=>{if(!r.includes(o.view)){return}t.stop();if(e.checkAttribute("$block","htmlLiAttributes")){return}const s=r.map((t=>oV(t)));e.extend("$listItem",{allowAttributes:s});n.for("upcast").add((t=>{t.on("element:ul",bO("htmlUlAttributes",i),{priority:"low"});t.on("element:ol",bO("htmlOlAttributes",i),{priority:"low"});t.on("element:li",bO("htmlLiAttributes",i),{priority:"low"})}))}));o.on("postFixer",((t,{listNodes:e,writer:n})=>{for(const{node:i,previousNodeInList:o}of e){if(!o){continue}if(o.getAttribute("listType")==i.getAttribute("listType")){const e=kO(o.getAttribute("listType"));const r=o.getAttribute(e);if(!YA(i.getAttribute(e),r)&&n.model.schema.checkAttribute(i,e)){n.setAttribute(e,r,i);t.return=true}}if(o.getAttribute("listItemId")==i.getAttribute("listItemId")){const e=o.getAttribute("htmlLiAttributes");if(!YA(i.getAttribute("htmlLiAttributes"),e)&&n.model.schema.checkAttribute(i,"htmlLiAttributes")){n.setAttribute("htmlLiAttributes",e,i);t.return=true}}}}));o.on("postFixer",((t,{listNodes:e,writer:n})=>{for(const{node:i}of e){const e=i.getAttribute("listType");if(e!=="numbered"&&i.getAttribute("htmlOlAttributes")){n.removeAttribute("htmlOlAttributes",i);t.return=true}if(e==="numbered"&&i.getAttribute("htmlUlAttributes")){n.removeAttribute("htmlUlAttributes",i);t.return=true}}}))}afterInit(){const t=this.editor;if(!t.commands.get("indentList")){return}const e=t.commands.get("indentList");this.listenTo(e,"afterExecute",((e,n)=>{t.model.change((e=>{for(const i of n){const n=kO(i.getAttribute("listType"));if(!t.model.schema.checkAttribute(i,n)){continue}e.setAttribute(n,{},i)}}))}))}}function bO(t,e){return(n,i,o)=>{const r=i.viewItem;if(!i.modelRange){Object.assign(i,o.convertChildren(i.viewItem,i.modelCursor))}const s=e.processViewAttributes(r,o);for(const e of i.modelRange.getItems({shallow:true})){if(!e.hasAttribute("listItemId")){continue}if(e.hasAttribute(t)){continue}if(o.writer.model.schema.checkAttribute(e,t)){o.writer.setAttribute(t,s||{},e)}}}}function kO(t){return t==="numbered"?"htmlOlAttributes":"htmlUlAttributes"}class wO extends bh{static get requires(){return[FV,pV]}static get pluginName(){return"CustomElementSupport"}init(){const t=this.editor.plugins.get(FV);const e=this.editor.plugins.get(pV);t.on("register:$customElement",((n,i)=>{n.stop();const o=this.editor;const r=o.model.schema;const s=o.conversion;const a=o.editing.view.domConverter.unsafeElements;const c=o.data.htmlProcessor.domConverter.preElements;r.register(i.model,i.modelSchema);r.extend(i.model,{allowAttributes:["htmlElementName","htmlCustomElementAttributes","htmlContent"],isContent:true});o.data.htmlProcessor.domConverter.registerRawContentMatcher({name:"template"});s.for("upcast").elementToElement({view:/.*/,model:(n,r)=>{if(n.name=="$comment"){return null}if(!AO(n.name)){return null}if(e.getDefinitionsForView(n.name).size){return null}if(!a.includes(n.name)){a.push(n.name)}if(!c.includes(n.name)){c.push(n.name)}const s=r.writer.createElement(i.model,{htmlElementName:n.name});const l=t.processViewAttributes(n,r);if(l){r.writer.setAttribute("htmlCustomElementAttributes",l,s)}let d;if(n.is("element","template")&&n.getCustomProperty("$rawContent")){d=n.getCustomProperty("$rawContent")}else{const t=new w_(n.document);const e=t.createDocumentFragment(n);const i=o.data.htmlProcessor.domConverter.viewToDom(e);const r=i.firstChild;while(r.firstChild){i.appendChild(r.firstChild)}r.remove();d=o.data.htmlProcessor.htmlWriter.getHtml(i)}r.writer.setAttribute("htmlContent",d,s);for(const{item:t}of o.editing.view.createRangeIn(n)){r.consumable.consume(t,{name:true})}return s},converterPriority:"low"});s.for("editingDowncast").elementToElement({model:{name:i.model,attributes:["htmlElementName","htmlCustomElementAttributes","htmlContent"]},view:(t,{writer:e})=>{const n=t.getAttribute("htmlElementName");const i=e.createRawElement(n);if(t.hasAttribute("htmlCustomElementAttributes")){XR(e,t.getAttribute("htmlCustomElementAttributes"),i)}return i}});s.for("dataDowncast").elementToElement({model:{name:i.model,attributes:["htmlElementName","htmlCustomElementAttributes","htmlContent"]},view:(t,{writer:e})=>{const n=t.getAttribute("htmlElementName");const i=t.getAttribute("htmlContent");const o=e.createRawElement(n,null,((t,e)=>{e.setContentOf(t,i)}));if(t.hasAttribute("htmlCustomElementAttributes")){XR(e,t.getAttribute("htmlCustomElementAttributes"),o)}return o}})}))}}function AO(t){try{document.createElement(t)}catch(t){return false}return true}class CO extends bh{static get pluginName(){return"GeneralHtmlSupport"}static get requires(){return[FV,KV,ZV,JV,tO,rO,lO,dO,fO,pO,wO]}init(){const t=this.editor;const e=t.plugins.get(FV);e.loadAllowedEmptyElementsConfig(t.config.get("htmlSupport.allowEmpty")||[]);e.loadAllowedConfig(t.config.get("htmlSupport.allow")||[]);e.loadDisallowedConfig(t.config.get("htmlSupport.disallow")||[])}getGhsAttributeNameForElement(t){const e=this.editor.plugins.get("DataSchema");const n=Array.from(e.getDefinitionsForView(t,false));const i=n.find((t=>t.isInline&&!n[0].isObject));if(i){return i.model}return oV(t)}addModelHtmlClass(t,e,n){const i=this.editor.model;const o=this.getGhsAttributeNameForElement(t);i.change((t=>{for(const r of _O(i,n,o)){nV(t,r,o,"classes",(t=>{for(const n of ol(e)){t.add(n)}}))}}))}removeModelHtmlClass(t,e,n){const i=this.editor.model;const o=this.getGhsAttributeNameForElement(t);i.change((t=>{for(const r of _O(i,n,o)){nV(t,r,o,"classes",(t=>{for(const n of ol(e)){t.delete(n)}}))}}))}setModelHtmlAttributes(t,e,n){const i=this.editor.model;const o=this.getGhsAttributeNameForElement(t);i.change((t=>{for(const r of _O(i,n,o)){nV(t,r,o,"attributes",(t=>{for(const[n,i]of Object.entries(e)){t.set(n,i)}}))}}))}removeModelHtmlAttributes(t,e,n){const i=this.editor.model;const o=this.getGhsAttributeNameForElement(t);i.change((t=>{for(const r of _O(i,n,o)){nV(t,r,o,"attributes",(t=>{for(const n of ol(e)){t.delete(n)}}))}}))}setModelHtmlStyles(t,e,n){const i=this.editor.model;const o=this.getGhsAttributeNameForElement(t);i.change((t=>{for(const r of _O(i,n,o)){nV(t,r,o,"styles",(t=>{for(const[n,i]of Object.entries(e)){t.set(n,i)}}))}}))}removeModelHtmlStyles(t,e,n){const i=this.editor.model;const o=this.getGhsAttributeNameForElement(t);i.change((t=>{for(const r of _O(i,n,o)){nV(t,r,o,"styles",(t=>{for(const n of ol(e)){t.delete(n)}}))}}))}}function*_O(t,e,n){if(!e){return}if(!(Symbol.iterator in e)&&e.is("documentSelection")&&e.isCollapsed){if(t.schema.checkAttributeInSelection(e,n)){yield e}}else{for(const i of vO(t,e,n)){yield*i.getItems({shallow:true})}}}function vO(t,e,n){if(!(Symbol.iterator in e)&&(e.is("node")||e.is("$text")||e.is("$textProxy"))){if(t.schema.checkAttribute(e,n)){return[t.createRangeOn(e)]}else{return[]}}else{return t.schema.getValidRanges(t.createSelection(e).getRanges(),n)}}class yO extends(null&&Plugin){static get pluginName(){return"HtmlComment"}init(){const t=this.editor;const e=new Map;t.data.processor.skipComments=false;t.model.schema.addAttributeCheck(((t,e)=>{if(t.endsWith("$root")&&e.startsWith("$comment")){return true}}));t.conversion.for("upcast").elementToMarker({view:"$comment",model:t=>{const n=uid();const i=`$comment:${n}`;const o=t.getCustomProperty("$rawContent");e.set(i,o);return i}});t.conversion.for("dataDowncast").markerToElement({model:"$comment",view:(t,{writer:e})=>{let n=undefined;for(const e of this.editor.model.document.getRootNames()){n=this.editor.model.document.getRoot(e);if(n.hasAttribute(t.markerName)){break}}const i=t.markerName;const o=n.getAttribute(i);const r=e.createUIElement("$comment");e.setCustomProperty("$rawContent",o,r);return r}});t.model.document.registerPostFixer((n=>{let i=false;const o=t.model.document.differ.getChangedMarkers().filter((t=>t.name.startsWith("$comment:")));for(const t of o){const{oldRange:o,newRange:r}=t.data;if(o&&r&&o.root==r.root){continue}if(o){const e=o.root;if(e.hasAttribute(t.name)){n.removeAttribute(t.name,e);i=true}}if(r){const o=r.root;if(o.rootName=="$graveyard"){n.removeMarker(t.name);i=true}else if(!o.hasAttribute(t.name)){n.setAttribute(t.name,e.get(t.name)||"",o);i=true}}}return i}));t.data.on("set",(()=>{for(const e of t.model.markers.getMarkersGroup("$comment")){this.removeHtmlComment(e.name)}}),{priority:"high"});t.model.on("deleteContent",((e,[n])=>{for(const e of n.getRanges()){const n=t.model.schema.getLimitElement(e);const i=t.model.createPositionAt(n,0);const o=t.model.createPositionAt(n,"end");let r;if(i.isTouching(e.start)&&o.isTouching(e.end)){r=this.getHtmlCommentsInRange(t.model.createRange(i,o))}else{r=this.getHtmlCommentsInRange(e,{skipBoundaries:true})}for(const t of r){this.removeHtmlComment(t)}}}),{priority:"high"})}createHtmlComment(t,e){const n=uid();const i=this.editor;const o=i.model;const r=o.document.getRoot(t.root.rootName);const s=`$comment:${n}`;return o.change((n=>{const i=n.createRange(t);n.addMarker(s,{usingOperation:true,affectsData:true,range:i});n.setAttribute(s,e,r);return s}))}removeHtmlComment(t){const e=this.editor;const n=e.model.markers.get(t);if(!n){return false}e.model.change((t=>{t.removeMarker(n)}));return true}getHtmlCommentData(t){const e=this.editor;const n=e.model.markers.get(t);if(!n){return null}let i="";for(const e of this.editor.model.document.getRoots()){if(e.hasAttribute(t)){i=e.getAttribute(t);break}}return{content:i,position:n.getStart()}}getHtmlCommentsInRange(t,{skipBoundaries:e=false}={}){const n=!e;return Array.from(this.editor.model.markers.getMarkersGroup("$comment")).filter((e=>i(e,t))).map((t=>t.name));function i(t,e){const i=t.getRange().start;return(i.isAfter(e.start)||n&&i.isEqual(e.start))&&(i.isBefore(e.end)||n&&i.isEqual(e.end))}}}class xO extends(null&&HtmlDataProcessor){toView(t){if(!t.match(/<(?:html|body|head|meta)(?:\s[^>]*)?>/i)){return super.toView(t)}let e="";let n="";t=t.replace(/]*>/i,(t=>{e=t;return""}));t=t.replace(/<\?xml\s[^?]*\?>/i,(t=>{n=t;return""}));const i=this._toDom(t);const o=this.domConverter.domToView(i,{skipComments:this.skipComments});const r=new UpcastWriter(o.document);r.setCustomProperty("$fullPageDocument",i.ownerDocument.documentElement.outerHTML,o);if(e){r.setCustomProperty("$fullPageDocType",e,o)}if(n){r.setCustomProperty("$fullPageXmlDeclaration",n,o)}return o}toData(t){let e=super.toData(t);const n=t.getCustomProperty("$fullPageDocument");const i=t.getCustomProperty("$fullPageDocType");const o=t.getCustomProperty("$fullPageXmlDeclaration");if(n){e=n.replace(/<\/body\s*>/,e+"$&");if(i){e=i+"\n"+e}if(o){e=o+"\n"+e}}return e}}class EO extends(null&&Plugin){static get pluginName(){return"FullPage"}init(){const t=this.editor;const e=["$fullPageDocument","$fullPageDocType","$fullPageXmlDeclaration"];t.data.processor=new HtmlPageDataProcessor(t.data.viewDocument);t.model.schema.extend("$root",{allowAttributes:e});t.data.on("toModel",((n,[i])=>{const o=t.model.document.getRoot();t.model.change((t=>{for(const n of e){const e=i.getCustomProperty(n);if(e){t.setAttribute(n,e,o)}}}))}),{priority:"low"});t.data.on("toView",((t,[n])=>{if(!n.is("rootElement")){return}const i=n;const o=t.return;if(!i.hasAttribute("$fullPageDocument")){return}const r=new UpcastWriter(o.document);for(const t of e){const e=i.getAttribute(t);if(e){r.setCustomProperty(t,e,o)}}}),{priority:"low"});t.data.on("set",(()=>{const n=t.model.document.getRoot();t.model.change((t=>{for(const i of e){if(n.hasAttribute(i)){t.removeAttribute(i,n)}}}))}),{priority:"high"});t.data.on("get",((t,e)=>{if(!e[0]){e[0]={}}e[0].trim=false}),{priority:"high"})}}function DO(t){return t.createContainerElement("span",{class:"image-inline"},t.createEmptyElement("img"))}function TO(t){return t.createContainerElement("figure",{class:"image"},[t.createEmptyElement("img"),t.createSlot("children")])}function SO(t,e){const n=t.plugins.get("ImageUtils");const i=t.plugins.has("ImageInlineEditing")&&t.plugins.has("ImageBlockEditing");return t=>{if(!n.isInlineImageView(t)){return null}if(!i){return o(t)}const r=t.getStyle("display")=="block"||t.findAncestor(n.isBlockImageView)?"imageBlock":"imageInline";if(r!==e){return null}return o(t)};function o(t){const e={name:true};if(t.hasAttribute("src")){e.attributes=["src"]}return e}}function IO(t,e){const n=fl(e.getSelectedBlocks());if(!n||t.isObject(n)){return"imageBlock"}if(n.isEmpty&&n.name!="listItem"){return"imageBlock"}return"imageInline"}function BO(t){if(t&&t.endsWith("px")){return parseInt(t)}return null}function MO(t){const e=BO(t.getStyle("width"));const n=BO(t.getStyle("height"));return!!(e&&n)}const LO=/^(image|image-inline)$/;class NO extends bh{constructor(){super(...arguments);this._domEmitter=new(Za())}static get pluginName(){return"ImageUtils"}isImage(t){return this.isInlineImage(t)||this.isBlockImage(t)}isInlineImageView(t){return!!t&&t.is("element","img")}isBlockImageView(t){return!!t&&t.is("element","figure")&&t.hasClass("image")}insertImage(t={},e=null,n=null,i={}){const o=this.editor;const r=o.model;const s=r.document.selection;const a=VO(o,e||s,n);t={...Object.fromEntries(s.getAttributes()),...t};for(const e in t){if(!r.schema.checkAttribute(a,e)){delete t[e]}}return r.change((n=>{const{setImageSizes:o=true}=i;const s=n.createElement(a,t);r.insertObject(s,e,null,{setSelection:"on",findOptimalPosition:!e&&a!="imageInline"?"auto":undefined});if(s.parent){if(o){this.setImageNaturalSizeAttributes(s)}return s}return null}))}setImageNaturalSizeAttributes(t){const e=t.getAttribute("src");if(!e){return}if(t.getAttribute("width")||t.getAttribute("height")){return}this.editor.model.change((n=>{const i=new nc.window.Image;this._domEmitter.listenTo(i,"load",(()=>{if(!t.getAttribute("width")&&!t.getAttribute("height")){this.editor.model.enqueueChange(n.batch,(e=>{e.setAttribute("width",i.naturalWidth,t);e.setAttribute("height",i.naturalHeight,t)}))}this._domEmitter.stopListening(i,"load")}));i.src=e}))}getClosestSelectedImageWidget(t){const e=t.getFirstPosition();if(!e){return null}const n=t.getSelectedElement();if(n&&this.isImageWidget(n)){return n}let i=e.parent;while(i){if(i.is("element")&&this.isImageWidget(i)){return i}i=i.parent}return null}getClosestSelectedImageElement(t){const e=t.getSelectedElement();return this.isImage(e)?e:t.getFirstPosition().findAncestor("imageBlock")}getImageWidgetFromImageView(t){return t.findAncestor({classes:LO})}isImageAllowed(){const t=this.editor.model;const e=t.document.selection;return PO(this.editor,e)&&zO(e)}toImageWidget(t,e,n){e.setCustomProperty("image",true,t);const i=()=>{const e=this.findViewImgElement(t);const i=e.getAttribute("alt");return i?`${i} ${n}`:n};return OM(t,e,{label:i})}isImageWidget(t){return!!t.getCustomProperty("image")&&VM(t)}isBlockImage(t){return!!t&&t.is("element","imageBlock")}isInlineImage(t){return!!t&&t.is("element","imageInline")}findViewImgElement(t){if(this.isInlineImageView(t)){return t}const e=this.editor.editing.view;for(const{item:n}of e.createRangeIn(t)){if(this.isInlineImageView(n)){return n}}}destroy(){this._domEmitter.stopListening();return super.destroy()}}function PO(t,e){const n=VO(t,e,null);if(n=="imageBlock"){const n=RO(e,t.model);if(t.model.schema.checkChild(n,"imageBlock")){return true}}else if(t.model.schema.checkChild(e.focus,"imageInline")){return true}return false}function zO(t){return[...t.focus.getAncestors()].every((t=>!t.is("element","imageBlock")))}function RO(t,e){const n=qM(t,e);const i=n.start.parent;if(i.isEmpty&&!i.is("element","$root")){return i.parent}return i}function VO(t,e,n){const i=t.model.schema;const o=t.config.get("image.insert.type");if(!t.plugins.has("ImageBlockEditing")){return"imageInline"}if(!t.plugins.has("ImageInlineEditing")){return"imageBlock"}if(n){return n}if(o==="inline"){return"imageInline"}if(o!=="auto"){return"imageBlock"}if(e.is("selection")){return IO(i,e)}return i.checkChild(e,"imageInline")?"imageInline":"imageBlock"}const OO=new RegExp(String(/^(http(s)?:\/\/)?[\w-]+\.[\w.~:/[\]@!$&'()*+,;=%-]+/.source+/\.(jpg|jpeg|png|gif|ico|webp|JPG|JPEG|PNG|GIF|ICO|WEBP)/.source+/(\?[\w.~:/[\]@!$&'()*+,;=%-]*)?/.source+/(#[\w.~:/[\]@!$&'()*+,;=%-]*)?$/.source));class FO extends bh{static get requires(){return[pN,NO,BN,LI]}static get pluginName(){return"AutoImage"}constructor(t){super(t);this._timeoutId=null;this._positionToInsert=null}init(){const t=this.editor;const e=t.model.document;const n=t.plugins.get("ClipboardPipeline");this.listenTo(n,"inputTransformation",(()=>{const t=e.selection.getFirstRange();const n=pC.fromPosition(t.start);n.stickiness="toPrevious";const i=pC.fromPosition(t.end);i.stickiness="toNext";e.once("change:data",(()=>{this._embedImageBetweenPositions(n,i);n.detach();i.detach()}),{priority:"high"})}));t.commands.get("undo").on("execute",(()=>{if(this._timeoutId){nc.window.clearTimeout(this._timeoutId);this._positionToInsert.detach();this._timeoutId=null;this._positionToInsert=null}}),{priority:"high"})}_embedImageBetweenPositions(t,e){const n=this.editor;const i=new Ck(t,e);const o=i.getWalker({ignoreElementEnd:true});const r=Object.fromEntries(n.model.document.selection.getAttributes());const s=this.editor.plugins.get("ImageUtils");let a="";for(const t of o){if(t.item.is("$textProxy")){a+=t.item.data}}a=a.trim();if(!a.match(OO)){i.detach();return}this._positionToInsert=pC.fromPosition(t);this._timeoutId=setTimeout((()=>{const t=n.commands.get("insertImage");if(!t.isEnabled){i.detach();return}n.model.change((t=>{this._timeoutId=null;t.remove(i);i.detach();let e;if(this._positionToInsert.root.rootName!=="$graveyard"){e=this._positionToInsert.toPosition()}s.insertImage({...r,src:a},e);this._positionToInsert.detach();this._positionToInsert=null}));const e=n.plugins.get("Delete");e.requestUndoOnBackspace()}),100)}}class jO extends wh{refresh(){const t=this.editor;const e=t.plugins.get("ImageUtils");const n=e.getClosestSelectedImageElement(this.editor.model.document.selection);this.isEnabled=!!n;if(this.isEnabled&&n.hasAttribute("alt")){this.value=n.getAttribute("alt")}else{this.value=false}}execute(t){const e=this.editor;const n=e.plugins.get("ImageUtils");const i=e.model;const o=n.getClosestSelectedImageElement(i.document.selection);i.change((e=>{e.setAttribute("alt",t.newValue,o)}))}}class HO extends bh{static get requires(){return[NO]}static get pluginName(){return"ImageTextAlternativeEditing"}init(){this.editor.commands.add("imageTextAlternative",new jO(this.editor))}}var UO=n(3412);var WO={injectType:"singletonStyleTag",attributes:{"data-cke":true}};WO.insert="head";WO.singleton=true;var GO=Pl()(UO.c,WO);const qO=UO.c.locals||{};class $O extends Fl{constructor(t){super(t);const e=this.locale.t;this.focusTracker=new pl;this.keystrokes=new bl;this.labeledInput=this._createLabeledInputView();this.saveButtonView=this._createButton(e("Save"),Ty.check,"ck-button-save");this.saveButtonView.type="submit";this.cancelButtonView=this._createButton(e("Cancel"),Ty.cancel,"ck-button-cancel","cancel");this._focusables=new Ml;this._focusCycler=new lh({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});this.setTemplate({tag:"form",attributes:{class:["ck","ck-text-alternative-form","ck-responsive-form"],tabindex:"-1"},children:[this.labeledInput,this.saveButtonView,this.cancelButtonView]})}render(){super.render();this.keystrokes.listenTo(this.element);o({view:this});[this.labeledInput,this.saveButtonView,this.cancelButtonView].forEach((t=>{this._focusables.add(t);this.focusTracker.add(t.element)}))}destroy(){super.destroy();this.focusTracker.destroy();this.keystrokes.destroy()}_createButton(t,e,n,i){const o=new Dd(this.locale);o.set({label:t,icon:e,tooltip:true});o.extendTemplate({attributes:{class:n}});if(i){o.delegate("execute").to(this,i)}return o}_createLabeledInputView(){const t=this.locale.t;const e=new Ou(this.locale,Ax);e.label=t("Text alternative");return e}}function KO(t){const e=t.plugins.get("ContextualBalloon");const n=t.plugins.get("ImageUtils");if(n.getClosestSelectedImageWidget(t.editing.view.document.selection)){const n=YO(t);e.updatePosition(n)}}function YO(t){const e=t.editing.view;const n=yD.defaultPositions;const i=t.plugins.get("ImageUtils");return{target:e.domConverter.mapViewToDom(i.getClosestSelectedImageWidget(e.document.selection)),positions:[n.northArrowSouth,n.northArrowSouthWest,n.northArrowSouthEast,n.southArrowNorth,n.southArrowNorthWest,n.southArrowNorthEast,n.viewportStickyNorth]}}class QO extends bh{static get requires(){return[TT]}static get pluginName(){return"ImageTextAlternativeUI"}init(){this._createButton()}destroy(){super.destroy();if(this._form){this._form.destroy()}}_createButton(){const t=this.editor;const e=t.t;t.ui.componentFactory.add("imageTextAlternative",(n=>{const i=t.commands.get("imageTextAlternative");const o=new Dd(n);o.set({label:e("Change image text alternative"),icon:Ty.textAlternative,tooltip:true});o.bind("isEnabled").to(i,"isEnabled");o.bind("isOn").to(i,"value",(t=>!!t));this.listenTo(o,"execute",(()=>{this._showForm()}));return o}))}_createForm(){const n=this.editor;const i=n.editing.view;const o=i.document;const r=n.plugins.get("ImageUtils");this._balloon=this.editor.plugins.get("ContextualBalloon");this._form=new(e($O))(n.locale);this._form.render();this.listenTo(this._form,"submit",(()=>{n.execute("imageTextAlternative",{newValue:this._form.labeledInput.fieldView.element.value});this._hideForm(true)}));this.listenTo(this._form,"cancel",(()=>{this._hideForm(true)}));this._form.keystrokes.set("Esc",((t,e)=>{this._hideForm(true);e()}));this.listenTo(n.ui,"update",(()=>{if(!r.getClosestSelectedImageWidget(o.selection)){this._hideForm(true)}else if(this._isVisible){KO(n)}}));t({emitter:this._form,activator:()=>this._isVisible,contextElements:()=>[this._balloon.view.element],callback:()=>this._hideForm()})}_showForm(){if(this._isVisible){return}if(!this._form){this._createForm()}const t=this.editor;const e=t.commands.get("imageTextAlternative");const n=this._form.labeledInput;this._form.disableCssTransitions();if(!this._isInBalloon){this._balloon.add({view:this._form,position:YO(t)})}n.fieldView.value=n.fieldView.element.value=e.value||"";this._form.labeledInput.fieldView.select();this._form.enableCssTransitions()}_hideForm(t=false){if(!this._isInBalloon){return}if(this._form.focusTracker.isFocused){this._form.saveButtonView.focus()}this._balloon.remove(this._form);if(t){this.editor.editing.view.focus()}}get _isVisible(){return!!this._balloon&&this._balloon.visibleView===this._form}get _isInBalloon(){return!!this._balloon&&this._balloon.hasView(this._form)}}class ZO extends bh{static get requires(){return[HO,QO]}static get pluginName(){return"ImageTextAlternative"}}function JO(t){const e=(e,n,i)=>{if(!i.consumable.test(n.viewItem,{name:true,classes:"image"})){return}const o=t.findViewImgElement(n.viewItem);if(!o||!i.consumable.test(o,{name:true})){return}i.consumable.consume(n.viewItem,{name:true,classes:"image"});const r=i.convertItem(o,n.modelCursor);const s=fl(r.modelRange.getItems());if(!s){i.consumable.revert(n.viewItem,{name:true,classes:"image"});return}i.convertChildren(n.viewItem,s);i.updateConversionResult(s,n)};return t=>{t.on("element:figure",e)}}function XO(t){const e=["srcset","media","type","sizes"];const n=(n,i,o)=>{const r=i.viewItem;if(!o.consumable.test(r,{name:true})){return}const s=new Map;for(const t of r.getChildren()){if(t.is("element","source")){const n={};for(const i of e){if(t.hasAttribute(i)){if(o.consumable.test(t,{attributes:i})){n[i]=t.getAttribute(i)}}}if(Object.keys(n).length){s.set(t,n)}}}const a=t.findViewImgElement(r);if(!a){return}let c=i.modelCursor.parent;if(!c.is("element","imageBlock")){const t=o.convertItem(a,i.modelCursor);i.modelRange=t.modelRange;i.modelCursor=t.modelCursor;c=first(t.modelRange.getItems())}o.consumable.consume(r,{name:true});for(const[t,e]of s){o.consumable.consume(t,{attributes:Object.keys(e)})}if(s.size){o.writer.setAttribute("sources",Array.from(s.values()),c)}o.convertChildren(r,c)};return t=>{t.on("element:picture",n)}}function tF(t,e){const n=(e,n,i)=>{if(!i.consumable.consume(n.item,e.name)){return}const o=i.writer;const r=i.mapper.toViewElement(n.item);const s=t.findViewImgElement(r);if(n.attributeNewValue===null){o.removeAttribute("srcset",s);o.removeAttribute("sizes",s)}else{if(n.attributeNewValue){o.setAttribute("srcset",n.attributeNewValue,s);o.setAttribute("sizes","100vw",s)}}};return t=>{t.on(`attribute:srcset:${e}`,n)}}function eF(t){const e=(e,n,i)=>{if(!i.consumable.consume(n.item,e.name)){return}const o=i.writer;const r=i.mapper.toViewElement(n.item);const s=t.findViewImgElement(r);const a=n.attributeNewValue;if(a&&a.length){const t=o.createContainerElement("picture",null,a.map((t=>o.createEmptyElement("source",t))));const e=[];let n=s.parent;while(n&&n.is("attributeElement")){const t=n.parent;o.unwrap(o.createRangeOn(s),n);e.unshift(n);n=t}o.insert(o.createPositionBefore(s),t);o.move(o.createRangeOn(s),o.createPositionAt(t,"end"));for(const n of e){o.wrap(o.createRangeOn(t),n)}}else if(s.parent.is("element","picture")){const t=s.parent;o.move(o.createRangeOn(s),o.createPositionBefore(t));o.remove(t)}};return t=>{t.on("attribute:sources:imageBlock",e);t.on("attribute:sources:imageInline",e)}}function nF(t,e,n){const i=(e,n,i)=>{if(!i.consumable.consume(n.item,e.name)){return}const o=i.writer;const r=i.mapper.toViewElement(n.item);const s=t.findViewImgElement(r);o.setAttribute(n.attributeKey,n.attributeNewValue||"",s)};return t=>{t.on(`attribute:${n}:${e}`,i)}}class iF extends _p{observe(t){this.listenTo(t,"load",((t,e)=>{const n=e.target;if(this.checkShouldIgnoreEventFromTarget(n)){return}if(n.tagName=="IMG"){this._fireEvents(e)}}),{useCapture:true})}stopObserving(t){this.stopListening(t)}_fireEvents(t){if(this.isEnabled){this.document.fire("layoutChanged");this.document.fire("imageLoaded",t)}}}class oF extends wh{constructor(t){super(t);const e=t.config.get("image.insert.type");if(!t.plugins.has("ImageBlockEditing")){if(e==="block"){P("image-block-plugin-required")}}if(!t.plugins.has("ImageInlineEditing")){if(e==="inline"){P("image-inline-plugin-required")}}}refresh(){const t=this.editor.plugins.get("ImageUtils");this.isEnabled=t.isImageAllowed()}execute(t){const e=ol(t.source);const n=this.editor.model.document.selection;const i=this.editor.plugins.get("ImageUtils");const o=Object.fromEntries(n.getAttributes());e.forEach(((t,e)=>{const r=n.getSelectedElement();if(typeof t==="string"){t={src:t}}if(e&&r&&i.isImage(r)){const e=this.editor.model.createPositionAfter(r);i.insertImage({...t,...o},e)}else{i.insertImage({...t,...o})}}))}}class rF extends wh{constructor(t){super(t);this.decorate("cleanupImage")}refresh(){const t=this.editor;const e=t.plugins.get("ImageUtils");const n=this.editor.model.document.selection.getSelectedElement();this.isEnabled=e.isImage(n);this.value=this.isEnabled?n.getAttribute("src"):null}execute(t){const e=this.editor.model.document.selection.getSelectedElement();const n=this.editor.plugins.get("ImageUtils");this.editor.model.change((i=>{i.setAttribute("src",t.source,e);this.cleanupImage(i,e);n.setImageNaturalSizeAttributes(e)}))}cleanupImage(t,e){t.removeAttribute("srcset",e);t.removeAttribute("sizes",e);t.removeAttribute("sources",e);t.removeAttribute("width",e);t.removeAttribute("height",e);t.removeAttribute("alt",e)}}class sF extends bh{static get requires(){return[NO]}static get pluginName(){return"ImageEditing"}init(){const t=this.editor;const e=t.conversion;t.editing.view.addObserver(iF);e.for("upcast").attributeToAttribute({view:{name:"img",key:"alt"},model:"alt"}).attributeToAttribute({view:{name:"img",key:"srcset"},model:"srcset"});const n=new oF(t);const i=new rF(t);t.commands.add("insertImage",n);t.commands.add("replaceImageSource",i);t.commands.add("imageInsert",n)}}class aF extends bh{static get requires(){return[NO]}static get pluginName(){return"ImageSizeAttributes"}afterInit(){this._registerSchema();this._registerConverters("imageBlock");this._registerConverters("imageInline")}_registerSchema(){if(this.editor.plugins.has("ImageBlockEditing")){this.editor.model.schema.extend("imageBlock",{allowAttributes:["width","height"]})}if(this.editor.plugins.has("ImageInlineEditing")){this.editor.model.schema.extend("imageInline",{allowAttributes:["width","height"]})}}_registerConverters(t){const e=this.editor;const n=e.plugins.get("ImageUtils");const i=t==="imageBlock"?"figure":"img";e.conversion.for("upcast").attributeToAttribute({view:{name:i,styles:{width:/.+/}},model:{key:"width",value:t=>{if(MO(t)){return BO(t.getStyle("width"))}return null}}}).attributeToAttribute({view:{name:i,key:"width"},model:"width"}).attributeToAttribute({view:{name:i,styles:{height:/.+/}},model:{key:"height",value:t=>{if(MO(t)){return BO(t.getStyle("height"))}return null}}}).attributeToAttribute({view:{name:i,key:"height"},model:"height"});e.conversion.for("editingDowncast").add((t=>{o(t,"width","width",true);o(t,"height","height",true)}));e.conversion.for("dataDowncast").add((t=>{o(t,"width","width",false);o(t,"height","height",false)}));function o(e,i,o,r){e.on(`attribute:${i}:${t}`,((e,i,s)=>{if(!s.consumable.consume(i.item,e.name)){return}const a=s.writer;const c=s.mapper.toViewElement(i.item);const l=n.findViewImgElement(c);if(i.attributeNewValue!==null){a.setAttribute(o,i.attributeNewValue,l)}else{a.removeAttribute(o,l)}if(i.item.hasAttribute("sources")){return}const d=i.item.hasAttribute("resizedWidth");if(t==="imageInline"&&!d&&!r){return}const u=i.item.getAttribute("width");const h=i.item.getAttribute("height");if(u&&h){a.setStyle("aspect-ratio",`${u}/${h}`,l)}}))}}}class cF extends wh{constructor(t,e){super(t);this._modelElementName=e}refresh(){const t=this.editor;const e=t.plugins.get("ImageUtils");const n=e.getClosestSelectedImageElement(this.editor.model.document.selection);if(this._modelElementName==="imageBlock"){this.isEnabled=e.isInlineImage(n)}else{this.isEnabled=e.isBlockImage(n)}}execute(t={}){const e=this.editor;const n=this.editor.model;const i=e.plugins.get("ImageUtils");const o=i.getClosestSelectedImageElement(n.document.selection);const r=Object.fromEntries(o.getAttributes());if(!r.src&&!r.uploadId){return null}return n.change((e=>{const{setImageSizes:s=true}=t;const a=Array.from(n.markers).filter((t=>t.getRange().containsItem(o)));const c=i.insertImage(r,n.createSelection(o,"on"),this._modelElementName,{setImageSizes:s});if(!c){return null}const l=e.createRangeOn(c);for(const t of a){const n=t.getRange();const i=n.root.rootName!="$graveyard"?n.getJoined(l,true):l;e.updateMarker(t,{range:i})}return{oldElement:o,newElement:c}}))}}var lF=n(7688);var dF={injectType:"singletonStyleTag",attributes:{"data-cke":true}};dF.insert="head";dF.singleton=true;var uF=Pl()(lF.c,dF);const hF=lF.c.locals||{};class mF extends bh{static get requires(){return[NO]}static get pluginName(){return"ImagePlaceholder"}afterInit(){this._setupSchema();this._setupConversion();this._setupLoadListener()}_setupSchema(){const t=this.editor.model.schema;if(t.isRegistered("imageBlock")){t.extend("imageBlock",{allowAttributes:["placeholder"]})}if(t.isRegistered("imageInline")){t.extend("imageInline",{allowAttributes:["placeholder"]})}}_setupConversion(){const t=this.editor;const e=t.conversion;const n=t.plugins.get("ImageUtils");e.for("editingDowncast").add((t=>{t.on("attribute:placeholder",((t,e,i)=>{if(!i.consumable.test(e.item,t.name)){return}if(!e.item.is("element","imageBlock")&&!e.item.is("element","imageInline")){return}i.consumable.consume(e.item,t.name);const o=i.writer;const r=i.mapper.toViewElement(e.item);const s=n.findViewImgElement(r);if(e.attributeNewValue){o.addClass("image_placeholder",s);o.setStyle("background-image",`url(${e.attributeNewValue})`,s);o.setCustomProperty("editingPipeline:doNotReuseOnce",true,s)}else{o.removeClass("image_placeholder",s);o.removeStyle("background-image",s)}}))}))}_setupLoadListener(){const t=this.editor;const e=t.model;const n=t.editing;const i=n.view;const o=t.plugins.get("ImageUtils");i.addObserver(iF);this.listenTo(i.document,"imageLoaded",((t,r)=>{const s=i.domConverter.mapDomToView(r.target);if(!s){return}const a=o.getImageWidgetFromImageView(s);if(!a){return}const c=n.mapper.toModelElement(a);if(!c||!c.hasAttribute("placeholder")){return}e.enqueueChange({isUndoable:false},(t=>{t.removeAttribute("placeholder",c)}))}))}}class gF extends bh{static get requires(){return[sF,aF,NO,mF,IM]}static get pluginName(){return"ImageBlockEditing"}init(){const t=this.editor;const e=t.model.schema;e.register("imageBlock",{inheritAllFrom:"$blockObject",allowAttributes:["alt","src","srcset"]});this._setupConversion();if(t.plugins.has("ImageInlineEditing")){t.commands.add("imageTypeBlock",new cF(this.editor,"imageBlock"));this._setupClipboardIntegration()}}_setupConversion(){const t=this.editor;const e=t.t;const n=t.conversion;const i=t.plugins.get("ImageUtils");n.for("dataDowncast").elementToStructure({model:"imageBlock",view:(t,{writer:e})=>TO(e)});n.for("editingDowncast").elementToStructure({model:"imageBlock",view:(t,{writer:n})=>i.toImageWidget(TO(n),n,e("image widget"))});n.for("downcast").add(nF(i,"imageBlock","src")).add(nF(i,"imageBlock","alt")).add(tF(i,"imageBlock"));n.for("upcast").elementToElement({view:SO(t,"imageBlock"),model:(t,{writer:e})=>e.createElement("imageBlock",t.hasAttribute("src")?{src:t.getAttribute("src")}:undefined)}).add(JO(i))}_setupClipboardIntegration(){const t=this.editor;const e=t.model;const n=t.editing.view;const i=t.plugins.get("ImageUtils");const o=t.plugins.get("ClipboardPipeline");this.listenTo(o,"inputTransformation",((o,r)=>{const s=Array.from(r.content.getChildren());let a;if(!s.every(i.isInlineImageView)){return}if(r.targetRanges){a=t.editing.mapper.toModelRange(r.targetRanges[0])}else{a=e.document.selection.getFirstRange()}const c=e.createSelection(a);if(IO(e.schema,c)==="imageBlock"){const t=new w_(n.document);const e=s.map((e=>t.createElement("figure",{class:"image"},e)));r.content=t.createDocumentFragment(e)}}));this.listenTo(o,"contentInsertion",((t,n)=>{if(n.method!=="paste"){return}e.change((t=>{const e=t.createRangeIn(n.content);for(const t of e.getItems()){if(t.is("element","imageBlock")){i.setImageNaturalSizeAttributes(t)}}}))}))}}var fF=n(9932);var pF={injectType:"singletonStyleTag",attributes:{"data-cke":true}};pF.insert="head";pF.singleton=true;var bF=Pl()(fF.c,pF);const kF=fF.c.locals||{};class wF extends Fl{constructor(t,e=[]){super(t);this.focusTracker=new pl;this.keystrokes=new bl;this._focusables=new Ml;this.children=this.createCollection();this._focusCycler=new lh({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});for(const t of e){this.children.add(t);this._focusables.add(t);if(t instanceof Vd){this._focusables.addMany(t.children)}}if(this._focusables.length>1){for(const t of this._focusables){if(AF(t)){t.focusCycler.on("forwardCycle",(t=>{this._focusCycler.focusNext();t.stop()}));t.focusCycler.on("backwardCycle",(t=>{this._focusCycler.focusPrevious();t.stop()}))}}}this.setTemplate({tag:"form",attributes:{class:["ck","ck-image-insert-form"],tabindex:-1},children:this.children})}render(){super.render();o({view:this});for(const t of this._focusables){this.focusTracker.add(t.element)}this.keystrokes.listenTo(this.element);const t=t=>t.stopPropagation();this.keystrokes.set("arrowright",t);this.keystrokes.set("arrowleft",t);this.keystrokes.set("arrowup",t);this.keystrokes.set("arrowdown",t)}destroy(){super.destroy();this.focusTracker.destroy();this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}}function AF(t){return"focusCycler"in t}class CF extends bh{static get pluginName(){return"ImageInsertUI"}static get requires(){return[NO]}constructor(t){super(t);this._integrations=new Map;t.config.define("image.insert.integrations",["upload","assetManager","url"])}init(){const t=this.editor;const e=t.model.document.selection;const n=t.plugins.get("ImageUtils");this.set("isImageSelected",false);this.listenTo(t.model.document,"change",(()=>{this.isImageSelected=n.isImage(e.getSelectedElement())}));const i=t=>this._createToolbarComponent(t);t.ui.componentFactory.add("insertImage",i);t.ui.componentFactory.add("imageInsert",i)}registerIntegration({name:t,observable:e,buttonViewCreator:n,formViewCreator:i,requiresForm:o}){if(this._integrations.has(t)){P("image-insert-integration-exists",{name:t})}this._integrations.set(t,{observable:e,buttonViewCreator:n,formViewCreator:i,requiresForm:!!o})}_createToolbarComponent(t){const e=this.editor;const n=t.t;const i=this._prepareIntegrations();if(!i.length){return null}let o;const r=i[0];if(i.length==1){if(!r.requiresForm){return r.buttonViewCreator(true)}o=r.buttonViewCreator(true)}else{const e=r.buttonViewCreator(false);o=new Zy(t,e);o.tooltip=true;o.bind("label").to(this,"isImageSelected",(t=>t?n("Replace image"):n("Insert image")))}const s=this.dropdownView=sx(t,o);const a=i.map((({observable:t})=>t));s.bind("isEnabled").toMany(a,"isEnabled",((...t)=>t.some((t=>t))));s.once("change:isOpen",(()=>{const t=i.map((({formViewCreator:t})=>t(i.length==1)));const n=new wF(e.locale,t);s.panelView.children.add(n)}));return s}_prepareIntegrations(){const t=this.editor;const e=t.config.get("image.insert.integrations");const n=[];if(!e.length){P("image-insert-integrations-not-specified");return n}for(const t of e){if(!this._integrations.has(t)){if(!["upload","assetManager","url"].includes(t)){P("image-insert-unknown-integration",{item:t})}continue}n.push(this._integrations.get(t))}if(!n.length){P("image-insert-integrations-not-registered")}return n}}var _F=n(7600);var vF={injectType:"singletonStyleTag",attributes:{"data-cke":true}};vF.insert="head";vF.singleton=true;var yF=Pl()(_F.c,vF);const xF=_F.c.locals||{};class EF extends bh{static get requires(){return[gF,xL,ZO,CF]}static get pluginName(){return"ImageBlock"}}class DF extends bh{static get requires(){return[sF,aF,NO,mF,IM]}static get pluginName(){return"ImageInlineEditing"}init(){const t=this.editor;const e=t.model.schema;e.register("imageInline",{inheritAllFrom:"$inlineObject",allowAttributes:["alt","src","srcset"]});e.addChildCheck(((t,e)=>{if(t.endsWith("caption")&&e.name==="imageInline"){return false}}));this._setupConversion();if(t.plugins.has("ImageBlockEditing")){t.commands.add("imageTypeInline",new cF(this.editor,"imageInline"));this._setupClipboardIntegration()}}_setupConversion(){const t=this.editor;const e=t.t;const n=t.conversion;const i=t.plugins.get("ImageUtils");n.for("dataDowncast").elementToElement({model:"imageInline",view:(t,{writer:e})=>e.createEmptyElement("img")});n.for("editingDowncast").elementToStructure({model:"imageInline",view:(t,{writer:n})=>i.toImageWidget(DO(n),n,e("image widget"))});n.for("downcast").add(nF(i,"imageInline","src")).add(nF(i,"imageInline","alt")).add(tF(i,"imageInline"));n.for("upcast").elementToElement({view:SO(t,"imageInline"),model:(t,{writer:e})=>e.createElement("imageInline",t.hasAttribute("src")?{src:t.getAttribute("src")}:undefined)})}_setupClipboardIntegration(){const t=this.editor;const e=t.model;const n=t.editing.view;const i=t.plugins.get("ImageUtils");const o=t.plugins.get("ClipboardPipeline");this.listenTo(o,"inputTransformation",((o,r)=>{const s=Array.from(r.content.getChildren());let a;if(!s.every(i.isBlockImageView)){return}if(r.targetRanges){a=t.editing.mapper.toModelRange(r.targetRanges[0])}else{a=e.document.selection.getFirstRange()}const c=e.createSelection(a);if(IO(e.schema,c)==="imageInline"){const t=new w_(n.document);const e=s.map((e=>{if(e.childCount===1){Array.from(e.getAttributes()).forEach((n=>t.setAttribute(...n,i.findViewImgElement(e))));return e.getChild(0)}else{return e}}));r.content=t.createDocumentFragment(e)}}));this.listenTo(o,"contentInsertion",((t,n)=>{if(n.method!=="paste"){return}e.change((t=>{const e=t.createRangeIn(n.content);for(const t of e.getItems()){if(t.is("element","imageInline")){i.setImageNaturalSizeAttributes(t)}}}))}))}}class TF extends bh{static get requires(){return[DF,xL,ZO,CF]}static get pluginName(){return"ImageInline"}}class SF extends bh{static get requires(){return[EF,TF]}static get pluginName(){return"Image"}}class IF extends bh{static get pluginName(){return"ImageCaptionUtils"}static get requires(){return[NO]}getCaptionFromImageModelElement(t){for(const e of t.getChildren()){if(!!e&&e.is("element","caption")){return e}}return null}getCaptionFromModelSelection(t){const e=this.editor.plugins.get("ImageUtils");const n=t.getFirstPosition().findAncestor("caption");if(!n){return null}if(e.isBlockImage(n.parent)){return n}return null}matchImageCaptionViewElement(t){const e=this.editor.plugins.get("ImageUtils");if(t.name=="figcaption"&&e.isBlockImageView(t.parent)){return{name:true}}return null}}class BF extends wh{refresh(){const t=this.editor;const e=t.plugins.get("ImageCaptionUtils");const n=t.plugins.get("ImageUtils");if(!t.plugins.has(gF)){this.isEnabled=false;this.value=false;return}const i=t.model.document.selection;const o=i.getSelectedElement();if(!o){const t=e.getCaptionFromModelSelection(i);this.isEnabled=!!t;this.value=!!t;return}this.isEnabled=n.isImage(o);if(!this.isEnabled){this.value=false}else{this.value=!!e.getCaptionFromImageModelElement(o)}}execute(t={}){const{focusCaptionOnShow:e}=t;this.editor.model.change((t=>{if(this.value){this._hideImageCaption(t)}else{this._showImageCaption(t,e)}}))}_showImageCaption(t,e){const n=this.editor.model;const i=n.document.selection;const o=this.editor.plugins.get("ImageCaptionEditing");const r=this.editor.plugins.get("ImageUtils");let s=i.getSelectedElement();const a=o._getSavedCaption(s);if(r.isInlineImage(s)){this.editor.execute("imageTypeBlock");s=i.getSelectedElement()}const c=a||t.createElement("caption");t.append(c,s);if(e){t.setSelection(c,"in")}}_hideImageCaption(t){const e=this.editor;const n=e.model.document.selection;const i=e.plugins.get("ImageCaptionEditing");const o=e.plugins.get("ImageCaptionUtils");let r=n.getSelectedElement();let s;if(r){s=o.getCaptionFromImageModelElement(r)}else{s=o.getCaptionFromModelSelection(n);r=s.parent}i._saveCaption(r,s);t.setSelection(r,"on");t.remove(s)}}class MF extends bh{static get requires(){return[NO,IF]}static get pluginName(){return"ImageCaptionEditing"}constructor(t){super(t);this._savedCaptionsMap=new WeakMap}init(){const t=this.editor;const e=t.model.schema;if(!e.isRegistered("caption")){e.register("caption",{allowIn:"imageBlock",allowContentOf:"$block",isLimit:true})}else{e.extend("caption",{allowIn:"imageBlock"})}t.commands.add("toggleImageCaption",new BF(this.editor));this._setupConversion();this._setupImageTypeCommandsIntegration();this._registerCaptionReconversion()}_setupConversion(){const t=this.editor;const e=t.editing.view;const n=t.plugins.get("ImageUtils");const i=t.plugins.get("ImageCaptionUtils");const o=t.t;t.conversion.for("upcast").elementToElement({view:t=>i.matchImageCaptionViewElement(t),model:"caption"});t.conversion.for("dataDowncast").elementToElement({model:"caption",view:(t,{writer:e})=>{if(!n.isBlockImage(t.parent)){return null}return e.createContainerElement("figcaption")}});t.conversion.for("editingDowncast").elementToElement({model:"caption",view:(t,{writer:i})=>{if(!n.isBlockImage(t.parent)){return null}const r=i.createEditableElement("figcaption");i.setCustomProperty("imageCaption",true,r);r.placeholder=o("Enter image caption");Bh({view:e,element:r,keepOnFocus:true});const s=t.parent.getAttribute("alt");const a=s?o("Caption for image: %0",[s]):o("Caption for the image");return GM(r,i,{label:a})}})}_setupImageTypeCommandsIntegration(){const t=this.editor;const e=t.plugins.get("ImageUtils");const n=t.plugins.get("ImageCaptionUtils");const i=t.commands.get("imageTypeInline");const o=t.commands.get("imageTypeBlock");const r=t=>{if(!t.return){return}const{oldElement:i,newElement:o}=t.return;if(!i){return}if(e.isBlockImage(i)){const t=n.getCaptionFromImageModelElement(i);if(t){this._saveCaption(o,t);return}}const r=this._getSavedCaption(i);if(r){this._saveCaption(o,r)}};if(i){this.listenTo(i,"execute",r,{priority:"low"})}if(o){this.listenTo(o,"execute",r,{priority:"low"})}}_getSavedCaption(t){const e=this._savedCaptionsMap.get(t);return e?Kb.fromJSON(e):null}_saveCaption(t,e){this._savedCaptionsMap.set(t,e.toJSON())}_registerCaptionReconversion(){const t=this.editor;const e=t.model;const n=t.plugins.get("ImageUtils");const i=t.plugins.get("ImageCaptionUtils");e.document.on("change:data",(()=>{const o=e.document.differ.getChanges();for(const e of o){if(e.attributeKey!=="alt"){continue}const o=e.range.start.nodeAfter;if(n.isBlockImage(o)){const e=i.getCaptionFromImageModelElement(o);if(!e){return}t.editing.reconvertItem(e)}}}))}}class LF extends bh{static get requires(){return[IF]}static get pluginName(){return"ImageCaptionUI"}init(){const t=this.editor;const e=t.editing.view;const n=t.plugins.get("ImageCaptionUtils");const i=t.t;t.ui.componentFactory.add("toggleImageCaption",(o=>{const r=t.commands.get("toggleImageCaption");const s=new Dd(o);s.set({icon:Ty.caption,tooltip:true,isToggleable:true});s.bind("isOn","isEnabled").to(r,"value","isEnabled");s.bind("label").to(r,"value",(t=>t?i("Toggle caption off"):i("Toggle caption on")));this.listenTo(s,"execute",(()=>{t.execute("toggleImageCaption",{focusCaptionOnShow:true});const i=n.getCaptionFromModelSelection(t.model.document.selection);if(i){const n=t.editing.mapper.toViewElement(i);e.scrollToTheSelection();e.change((t=>{t.addClass("image__caption_highlighted",n)}))}t.editing.view.focus()}));return s}))}}var NF=n(4592);var PF={injectType:"singletonStyleTag",attributes:{"data-cke":true}};PF.insert="head";PF.singleton=true;var zF=Pl()(NF.c,PF);const RF=NF.c.locals||{};class VF extends bh{static get requires(){return[MF,LF]}static get pluginName(){return"ImageCaption"}}class OF extends(mt()){constructor(){super();const t=new window.FileReader;this._reader=t;this._data=undefined;this.set("loaded",0);t.onprogress=t=>{this.loaded=t.loaded}}get error(){return this._reader.error}get data(){return this._data}read(t){const e=this._reader;this.total=t.size;return new Promise(((n,i)=>{e.onload=()=>{const t=e.result;this._data=t;n(t)};e.onerror=()=>{i("error")};e.onabort=()=>{i("aborted")};this._reader.readAsDataURL(t)}))}abort(){this._reader.abort()}}class FF extends bh{constructor(){super(...arguments);this.loaders=new gl;this._loadersMap=new Map;this._pendingAction=null}static get pluginName(){return"FileRepository"}static get requires(){return[wv]}init(){this.loaders.on("change",(()=>this._updatePendingAction()));this.set("uploaded",0);this.set("uploadTotal",null);this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",((t,e)=>e?t/e*100:0))}getLoader(t){return this._loadersMap.get(t)||null}createLoader(t){if(!this.createUploadAdapter){P("filerepository-no-upload-adapter");return null}const e=new jF(Promise.resolve(t),this.createUploadAdapter);this.loaders.add(e);this._loadersMap.set(t,e);if(t instanceof Promise){e.file.then((t=>{this._loadersMap.set(t,e)})).catch((()=>{}))}e.on("change:uploaded",(()=>{let t=0;for(const e of this.loaders){t+=e.uploaded}this.uploaded=t}));e.on("change:uploadTotal",(()=>{let t=0;for(const e of this.loaders){if(e.uploadTotal){t+=e.uploadTotal}}this.uploadTotal=t}));return e}destroyLoader(t){const e=t instanceof jF?t:this.getLoader(t);e._destroy();this.loaders.remove(e);this._loadersMap.forEach(((t,n)=>{if(t===e){this._loadersMap.delete(n)}}))}_updatePendingAction(){const t=this.editor.plugins.get(wv);if(this.loaders.length){if(!this._pendingAction){const e=this.editor.t;const n=t=>`${e("Upload in progress")} ${parseInt(t)}%.`;this._pendingAction=t.add(n(this.uploadedPercent));this._pendingAction.bind("message").to(this,"uploadedPercent",n)}}else{t.remove(this._pendingAction);this._pendingAction=null}}}class jF extends(mt()){constructor(t,e){super();this.id=S();this._filePromiseWrapper=this._createFilePromiseWrapper(t);this._adapter=e(this);this._reader=new OF;this.set("status","idle");this.set("uploaded",0);this.set("uploadTotal",null);this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",((t,e)=>e?t/e*100:0));this.set("uploadResponse",null)}get file(){if(!this._filePromiseWrapper){return Promise.resolve(null)}else{return this._filePromiseWrapper.promise.then((t=>this._filePromiseWrapper?t:null))}}get data(){return this._reader.data}read(){if(this.status!="idle"){throw new N("filerepository-read-wrong-status",this)}this.status="reading";return this.file.then((t=>this._reader.read(t))).then((t=>{if(this.status!=="reading"){throw this.status}this.status="idle";return t})).catch((t=>{if(t==="aborted"){this.status="aborted";throw"aborted"}this.status="error";throw this._reader.error?this._reader.error:t}))}upload(){if(this.status!="idle"){throw new N("filerepository-upload-wrong-status",this)}this.status="uploading";return this.file.then((()=>this._adapter.upload())).then((t=>{this.uploadResponse=t;this.status="idle";return t})).catch((t=>{if(this.status==="aborted"){throw"aborted"}this.status="error";throw t}))}abort(){const t=this.status;this.status="aborted";if(!this._filePromiseWrapper.isFulfilled){this._filePromiseWrapper.promise.catch((()=>{}));this._filePromiseWrapper.rejecter("aborted")}else if(t=="reading"){this._reader.abort()}else if(t=="uploading"&&this._adapter.abort){this._adapter.abort()}this._destroy()}_destroy(){this._filePromiseWrapper=undefined;this._reader=undefined;this._adapter=undefined;this.uploadResponse=undefined}_createFilePromiseWrapper(t){const e={};e.promise=new Promise(((n,i)=>{e.rejecter=i;e.isFulfilled=false;t.then((t=>{e.isFulfilled=true;n(t)})).catch((t=>{e.isFulfilled=true;i(t)}))}));return e}}class HF extends Dd{constructor(t){super(t);this.buttonView=this;this._fileInputView=new UF(t);this._fileInputView.bind("acceptedType").to(this);this._fileInputView.bind("allowMultipleFiles").to(this);this._fileInputView.delegate("done").to(this);this.on("execute",(()=>{this._fileInputView.open()}));this.extendTemplate({attributes:{class:"ck-file-dialog-button"}})}render(){super.render();this.children.add(this._fileInputView)}}class UF extends Fl{constructor(t){super(t);this.set("acceptedType",undefined);this.set("allowMultipleFiles",false);const e=this.bindTemplate;this.setTemplate({tag:"input",attributes:{class:["ck-hidden"],type:"file",tabindex:"-1",accept:e.to("acceptedType"),multiple:e.to("allowMultipleFiles")},on:{change:e.to((()=>{if(this.element&&this.element.files&&this.element.files.length){this.fire("done",this.element.files)}this.element.value=""}))}})}open(){this.element.click()}}class WF extends(null&&Plugin){static get requires(){return[FileRepository]}static get pluginName(){return"Base64UploadAdapter"}init(){this.editor.plugins.get(FileRepository).createUploadAdapter=t=>new GF(t)}}class GF{constructor(t){this.loader=t}upload(){return new Promise(((t,e)=>{const n=this.reader=new window.FileReader;n.addEventListener("load",(()=>{t({default:n.result})}));n.addEventListener("error",(t=>{e(t)}));n.addEventListener("abort",(()=>{e()}));this.loader.file.then((t=>{n.readAsDataURL(t)}))}))}abort(){this.reader.abort()}}class qF extends(null&&Plugin){static get requires(){return[FileRepository]}static get pluginName(){return"SimpleUploadAdapter"}init(){const t=this.editor.config.get("simpleUpload");if(!t){return}if(!t.uploadUrl){logWarning("simple-upload-adapter-missing-uploadurl");return}this.editor.plugins.get(FileRepository).createUploadAdapter=e=>new $F(e,t)}}class $F{constructor(t,e){this.loader=t;this.options=e}upload(){return this.loader.file.then((t=>new Promise(((e,n)=>{this._initRequest();this._initListeners(e,n,t);this._sendRequest(t)}))))}abort(){if(this.xhr){this.xhr.abort()}}_initRequest(){const t=this.xhr=new XMLHttpRequest;t.open("POST",this.options.uploadUrl,true);t.responseType="json"}_initListeners(t,e,n){const i=this.xhr;const o=this.loader;const r=`Couldn't upload file: ${n.name}.`;i.addEventListener("error",(()=>e(r)));i.addEventListener("abort",(()=>e()));i.addEventListener("load",(()=>{const n=i.response;if(!n||n.error){return e(n&&n.error&&n.error.message?n.error.message:r)}const o=n.url?{default:n.url}:n.urls;t({...n,urls:o})}));if(i.upload){i.upload.addEventListener("progress",(t=>{if(t.lengthComputable){o.uploadTotal=t.total;o.uploaded=t.loaded}}))}}_sendRequest(t){const e=this.options.headers||{};const n=this.options.withCredentials||false;for(const t of Object.keys(e)){this.xhr.setRequestHeader(t,e[t])}this.xhr.withCredentials=n;const i=new FormData;i.append("upload",t);this.xhr.send(i)}}function KF(t){const e=t.map((t=>t.replace("+","\\+")));return new RegExp(`^image\\/(${e.join("|")})$`)}function YF(t){return new Promise(((e,n)=>{const i=t.getAttribute("src");fetch(i).then((t=>t.blob())).then((t=>{const n=ZF(t,i);const o=n.replace("image/","");const r=`image.${o}`;const s=new File([t],r,{type:n});e(s)})).catch((t=>t&&t.name==="TypeError"?JF(i).then(e).catch(n):n(t)))}))}function QF(t,e){if(!t.isInlineImageView(e)||!e.getAttribute("src")){return false}return!!e.getAttribute("src").match(/^data:image\/\w+;base64,/g)||!!e.getAttribute("src").match(/^blob:/g)}function ZF(t,e){if(t.type){return t.type}else if(e.match(/data:(image\/\w+);base64/)){return e.match(/data:(image\/\w+);base64/)[1].toLowerCase()}else{return"image/jpeg"}}function JF(t){return XF(t).then((e=>{const n=ZF(e,t);const i=n.replace("image/","");const o=`image.${i}`;return new File([e],o,{type:n})}))}function XF(t){return new Promise(((e,n)=>{const i=nc.document.createElement("img");i.addEventListener("load",(()=>{const t=nc.document.createElement("canvas");t.width=i.width;t.height=i.height;const o=t.getContext("2d");o.drawImage(i,0,0);t.toBlob((t=>t?e(t):n()))}));i.addEventListener("error",(()=>n()));i.src=t}))}class tj extends bh{static get pluginName(){return"ImageUploadUI"}init(){const t=this.editor;const e=t.t;const n=n=>{const i=new HF(n);const o=t.commands.get("uploadImage");const r=t.config.get("image.upload.types");const s=KF(r);i.set({acceptedType:r.map((t=>`image/${t}`)).join(","),allowMultipleFiles:true,label:e("Upload image from computer"),icon:Ty.imageUpload,tooltip:true});i.bind("isEnabled").to(o);i.on("done",((e,n)=>{const i=Array.from(n).filter((t=>s.test(t.type)));if(i.length){t.execute("uploadImage",{file:i});t.editing.view.focus()}}));return i};t.ui.componentFactory.add("uploadImage",n);t.ui.componentFactory.add("imageUpload",n);if(t.plugins.has("ImageInsertUI")){const n=t.plugins.get("ImageInsertUI");const i=t.commands.get("uploadImage");n.registerIntegration({name:"upload",observable:i,buttonViewCreator:()=>{const i=t.ui.componentFactory.create("uploadImage");i.bind("label").to(n,"isImageSelected",(t=>t?e("Replace image from computer"):e("Upload image from computer")));return i},formViewCreator:()=>{const i=t.ui.componentFactory.create("uploadImage");i.withText=true;i.bind("label").to(n,"isImageSelected",(t=>t?e("Replace from computer"):e("Upload from computer")));i.on("execute",(()=>{n.dropdownView.isOpen=false}));return i}})}}}var ej=n(4868);var nj={injectType:"singletonStyleTag",attributes:{"data-cke":true}};nj.insert="head";nj.singleton=true;var ij=Pl()(ej.c,nj);const oj=ej.c.locals||{};var rj=n(9954);var sj={injectType:"singletonStyleTag",attributes:{"data-cke":true}};sj.insert="head";sj.singleton=true;var aj=Pl()(rj.c,sj);const cj=rj.c.locals||{};var lj=n(3104);var dj={injectType:"singletonStyleTag",attributes:{"data-cke":true}};dj.insert="head";dj.singleton=true;var uj=Pl()(lj.c,dj);const hj=lj.c.locals||{};class mj extends bh{static get pluginName(){return"ImageUploadProgress"}constructor(t){super(t);this.uploadStatusChange=(t,e,n)=>{const i=this.editor;const o=e.item;const r=o.getAttribute("uploadId");if(!n.consumable.consume(e.item,t.name)){return}const s=i.plugins.get("ImageUtils");const a=i.plugins.get(FF);const c=r?e.attributeNewValue:null;const l=this.placeholder;const d=i.editing.mapper.toViewElement(o);const u=n.writer;if(c=="reading"){gj(d,u);pj(s,l,d,u);return}if(c=="uploading"){const t=a.loaders.get(r);gj(d,u);if(!t){pj(s,l,d,u)}else{bj(d,u);kj(d,u,t,i.editing.view);xj(s,d,u,t)}return}if(c=="complete"&&a.loaders.get(r)){Aj(d,u,i.editing.view)}wj(d,u);bj(d,u);fj(d,u)};this.placeholder="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="}init(){const t=this.editor;if(t.plugins.has("ImageBlockEditing")){t.editing.downcastDispatcher.on("attribute:uploadStatus:imageBlock",this.uploadStatusChange)}if(t.plugins.has("ImageInlineEditing")){t.editing.downcastDispatcher.on("attribute:uploadStatus:imageInline",this.uploadStatusChange)}}}function gj(t,e){if(!t.hasClass("ck-appear")){e.addClass("ck-appear",t)}}function fj(t,e){e.removeClass("ck-appear",t)}function pj(t,e,n,i){if(!n.hasClass("ck-image-upload-placeholder")){i.addClass("ck-image-upload-placeholder",n)}const o=t.findViewImgElement(n);if(o.getAttribute("src")!==e){i.setAttribute("src",e,o)}if(!vj(n,"placeholder")){i.insert(i.createPositionAfter(o),_j(i))}}function bj(t,e){if(t.hasClass("ck-image-upload-placeholder")){e.removeClass("ck-image-upload-placeholder",t)}yj(t,e,"placeholder")}function kj(t,e,n,i){const o=Cj(e);e.insert(e.createPositionAt(t,"end"),o);n.on("change:uploadedPercent",((t,e,n)=>{i.change((t=>{t.setStyle("width",n+"%",o)}))}))}function wj(t,e){yj(t,e,"progressBar")}function Aj(t,e,n){const i=e.createUIElement("div",{class:"ck-image-upload-complete-icon"});e.insert(e.createPositionAt(t,"end"),i);setTimeout((()=>{n.change((t=>t.remove(t.createRangeOn(i))))}),3e3)}function Cj(t){const e=t.createUIElement("div",{class:"ck-progress-bar"});t.setCustomProperty("progressBar",true,e);return e}function _j(t){const e=t.createUIElement("div",{class:"ck-upload-placeholder-loader"});t.setCustomProperty("placeholder",true,e);return e}function vj(t,e){for(const n of t.getChildren()){if(n.getCustomProperty(e)){return n}}}function yj(t,e,n){const i=vj(t,n);if(i){e.remove(e.createRangeOn(i))}}function xj(t,e,n,i){if(i.data){const o=t.findViewImgElement(e);n.setAttribute("src",i.data,o)}}class Ej extends wh{refresh(){const t=this.editor;const e=t.plugins.get("ImageUtils");const n=t.model.document.selection.getSelectedElement();this.isEnabled=e.isImageAllowed()||e.isImage(n)}execute(t){const e=ol(t.file);const n=this.editor.model.document.selection;const i=this.editor.plugins.get("ImageUtils");const o=Object.fromEntries(n.getAttributes());e.forEach(((t,e)=>{const r=n.getSelectedElement();if(e&&r&&i.isImage(r)){const e=this.editor.model.createPositionAfter(r);this._uploadImage(t,o,e)}else{this._uploadImage(t,o)}}))}_uploadImage(t,e,n){const i=this.editor;const o=i.plugins.get(FF);const r=o.createLoader(t);const s=i.plugins.get("ImageUtils");if(!r){return}s.insertImage({...e,uploadId:r.id},n)}}class Dj extends bh{static get requires(){return[FF,bT,IM,NO]}static get pluginName(){return"ImageUploadEditing"}constructor(t){super(t);t.config.define("image",{upload:{types:["jpeg","png","gif","bmp","webp","tiff"]}});this._uploadImageElements=new Map}init(){const t=this.editor;const e=t.model.document;const n=t.conversion;const i=t.plugins.get(FF);const o=t.plugins.get("ImageUtils");const r=t.plugins.get("ClipboardPipeline");const s=KF(t.config.get("image.upload.types"));const a=new Ej(t);t.commands.add("uploadImage",a);t.commands.add("imageUpload",a);n.for("upcast").attributeToAttribute({view:{name:"img",key:"uploadId"},model:"uploadId"});this.listenTo(t.editing.view.document,"clipboardInput",((e,n)=>{if(Tj(n.dataTransfer)){return}const i=Array.from(n.dataTransfer.files).filter((t=>{if(!t){return false}return s.test(t.type)}));if(!i.length){return}e.stop();t.model.change((e=>{if(n.targetRanges){e.setSelection(n.targetRanges.map((e=>t.editing.mapper.toModelRange(e))))}t.execute("uploadImage",{file:i})}))}));this.listenTo(r,"inputTransformation",((e,n)=>{const r=Array.from(t.editing.view.createRangeIn(n.content)).map((t=>t.item)).filter((t=>QF(o,t)&&!t.getAttribute("uploadProcessed"))).map((t=>({promise:YF(t),imageElement:t})));if(!r.length){return}const s=new w_(t.editing.view.document);for(const t of r){s.setAttribute("uploadProcessed",true,t.imageElement);const e=i.createLoader(t.promise);if(e){s.setAttribute("src","",t.imageElement);s.setAttribute("uploadId",e.id,t.imageElement)}}}));t.editing.view.document.on("dragover",((t,e)=>{e.preventDefault()}));e.on("change",(()=>{const n=e.differ.getChanges({includeChangesInGraveyard:true}).reverse();const o=new Set;for(const e of n){if(e.type=="insert"&&e.name!="$text"){const n=e.position.nodeAfter;const r=e.position.root.rootName=="$graveyard";for(const e of Sj(t,n)){const t=e.getAttribute("uploadId");if(!t){continue}const n=i.loaders.get(t);if(!n){continue}if(r){if(!o.has(t)){n.abort()}}else{o.add(t);this._uploadImageElements.set(t,e);if(n.status=="idle"){this._readAndUpload(n)}}}}}}));this.on("uploadComplete",((t,{imageElement:e,data:n})=>{const i=n.urls?n.urls:n;this.editor.model.change((t=>{t.setAttribute("src",i.default,e);this._parseAndSetSrcsetAttributeOnImage(i,e,t);o.setImageNaturalSizeAttributes(e)}))}),{priority:"low"})}afterInit(){const t=this.editor.model.schema;if(this.editor.plugins.has("ImageBlockEditing")){t.extend("imageBlock",{allowAttributes:["uploadId","uploadStatus"]})}if(this.editor.plugins.has("ImageInlineEditing")){t.extend("imageInline",{allowAttributes:["uploadId","uploadStatus"]})}}_readAndUpload(t){const e=this.editor;const n=e.model;const i=e.locale.t;const o=e.plugins.get(FF);const r=e.plugins.get(bT);const s=e.plugins.get("ImageUtils");const a=this._uploadImageElements;n.enqueueChange({isUndoable:false},(e=>{e.setAttribute("uploadStatus","reading",a.get(t.id))}));return t.read().then((()=>{const i=t.upload();const o=a.get(t.id);if(l.isSafari){const t=e.editing.mapper.toViewElement(o);const n=s.findViewImgElement(t);e.editing.view.once("render",(()=>{if(!n.parent){return}const t=e.editing.view.domConverter.mapViewToDom(n.parent);if(!t){return}const i=t.style.display;t.style.display="none";t._ckHack=t.offsetHeight;t.style.display=i}))}n.enqueueChange({isUndoable:false},(t=>{t.setAttribute("uploadStatus","uploading",o)}));return i})).then((e=>{n.enqueueChange({isUndoable:false},(n=>{const i=a.get(t.id);n.setAttribute("uploadStatus","complete",i);this.fire("uploadComplete",{data:e,imageElement:i})}));c()})).catch((e=>{if(t.status!=="error"&&t.status!=="aborted"){throw e}if(t.status=="error"&&e){r.showWarning(e,{title:i("Upload failed"),namespace:"upload"})}n.enqueueChange({isUndoable:false},(e=>{e.remove(a.get(t.id))}));c()}));function c(){n.enqueueChange({isUndoable:false},(e=>{const n=a.get(t.id);e.removeAttribute("uploadId",n);e.removeAttribute("uploadStatus",n);a.delete(t.id)}));o.destroyLoader(t)}}_parseAndSetSrcsetAttributeOnImage(t,e,n){let i=0;const o=Object.keys(t).filter((t=>{const e=parseInt(t,10);if(!isNaN(e)){i=Math.max(i,e);return true}})).map((e=>`${t[e]} ${e}w`)).join(", ");if(o!=""){const t={srcset:o};if(!e.hasAttribute("width")&&!e.hasAttribute("height")){t.width=i}n.setAttributes(t,e)}}}function Tj(t){return Array.from(t.types).includes("text/html")&&t.getData("text/html")!==""}function Sj(t,e){const n=t.plugins.get("ImageUtils");return Array.from(t.model.createRangeOn(e)).filter((t=>n.isImage(t.item))).map((t=>t.item))}class Ij extends bh{static get pluginName(){return"ImageUpload"}static get requires(){return[Dj,tj,mj]}}class Bj extends Fl{constructor(t){super(t);this.set("imageURLInputValue","");this.set("isImageSelected",false);this.set("isEnabled",true);this.focusTracker=new pl;this.keystrokes=new bl;this._focusables=new Ml;this.focusCycler=new lh({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});this.urlInputView=this._createUrlInputView();this.insertButtonView=this._createInsertButton();this.cancelButtonView=this._createCancelButton();this._focusables.addMany([this.urlInputView,this.insertButtonView,this.cancelButtonView]);this.setTemplate({tag:"div",attributes:{class:["ck","ck-image-insert-url"]},children:[this.urlInputView,{tag:"div",attributes:{class:["ck","ck-image-insert-url__action-row"]},children:[this.insertButtonView,this.cancelButtonView]}]})}render(){super.render();for(const t of this._focusables){this.focusTracker.add(t.element)}this.keystrokes.listenTo(this.element)}destroy(){super.destroy();this.focusTracker.destroy();this.keystrokes.destroy()}_createUrlInputView(){const t=this.locale;const e=t.t;const n=new Ou(t,Ax);n.bind("label").to(this,"isImageSelected",(t=>t?e("Update image URL"):e("Insert image via URL")));n.bind("isEnabled").to(this);n.fieldView.placeholder="https://example.com/image.png";n.fieldView.bind("value").to(this,"imageURLInputValue",(t=>t||""));n.fieldView.on("input",(()=>{this.imageURLInputValue=n.fieldView.element.value.trim()}));return n}_createInsertButton(){const t=this.locale;const e=t.t;const n=new Dd(t);n.set({icon:Ty.check,class:"ck-button-save",type:"submit",withText:true});n.bind("label").to(this,"isImageSelected",(t=>t?e("Update"):e("Insert")));n.bind("isEnabled").to(this,"imageURLInputValue",this,"isEnabled",((...t)=>t.every((t=>t))));n.delegate("execute").to(this,"submit");return n}_createCancelButton(){const t=this.locale;const e=t.t;const n=new Dd(t);n.set({label:e("Cancel"),icon:Ty.cancel,class:"ck-button-cancel",withText:true});n.bind("isEnabled").to(this);n.delegate("execute").to(this,"cancel");return n}focus(t){if(t===-1){this.focusCycler.focusLast()}else{this.focusCycler.focusFirst()}}}class Mj extends bh{static get pluginName(){return"ImageInsertViaUrlUI"}static get requires(){return[CF]}init(){this._imageInsertUI=this.editor.plugins.get("ImageInsertUI");const t=this.editor.commands.get("insertImage");this._imageInsertUI.registerIntegration({name:"url",observable:t,requiresForm:true,buttonViewCreator:t=>this._createInsertUrlButton(t),formViewCreator:t=>this._createInsertUrlView(t)})}_createInsertUrlView(t){const e=this.editor;const n=e.locale;const i=n.t;const o=e.commands.get("replaceImageSource");const r=e.commands.get("insertImage");const s=new Bj(n);const a=t?null:new Vd(n,[s]);s.bind("isImageSelected").to(this._imageInsertUI);s.bind("isEnabled").toMany([r,o],"isEnabled",((...t)=>t.some((t=>t))));s.imageURLInputValue=o.value||"";this._imageInsertUI.dropdownView.on("change:isOpen",(()=>{if(this._imageInsertUI.dropdownView.isOpen){s.imageURLInputValue=o.value||"";if(a){a.isCollapsed=true}}}),{priority:"low"});s.on("submit",(()=>{if(o.isEnabled){e.execute("replaceImageSource",{source:s.imageURLInputValue})}else{e.execute("insertImage",{source:s.imageURLInputValue})}this._closePanel()}));s.on("cancel",(()=>this._closePanel()));if(a){a.set({isCollapsed:true});a.bind("label").to(this._imageInsertUI,"isImageSelected",(t=>t?i("Update image URL"):i("Insert image via URL")));return a}return s}_createInsertUrlButton(t){const e=t?ch:Dd;const n=this.editor;const i=new e(n.locale);const o=n.locale.t;i.set({icon:Ty.imageUrl,tooltip:true});i.bind("label").to(this._imageInsertUI,"isImageSelected",(t=>t?o("Update image URL"):o("Insert image via URL")));return i}_closePanel(){this.editor.editing.view.focus();this._imageInsertUI.dropdownView.isOpen=false}}class Lj extends bh{static get pluginName(){return"ImageInsertViaUrl"}static get requires(){return[Mj,CF]}}class Nj extends bh{static get pluginName(){return"ImageInsert"}static get requires(){return[Ij,Lj,CF]}}class Pj extends wh{refresh(){const t=this.editor;const e=t.plugins.get("ImageUtils");const n=e.getClosestSelectedImageElement(t.model.document.selection);this.isEnabled=!!n;if(!n||!n.hasAttribute("resizedWidth")){this.value=null}else{this.value={width:n.getAttribute("resizedWidth"),height:null}}}execute(t){const e=this.editor;const n=e.model;const i=e.plugins.get("ImageUtils");const o=i.getClosestSelectedImageElement(n.document.selection);this.value={width:t.width,height:null};if(o){n.change((e=>{e.setAttribute("resizedWidth",t.width,o);e.removeAttribute("resizedHeight",o);i.setImageNaturalSizeAttributes(o)}))}}}class zj extends bh{static get requires(){return[NO]}static get pluginName(){return"ImageResizeEditing"}constructor(t){super(t);t.config.define("image",{resizeUnit:"%",resizeOptions:[{name:"resizeImage:original",value:null,icon:"original"},{name:"resizeImage:25",value:"25",icon:"small"},{name:"resizeImage:50",value:"50",icon:"medium"},{name:"resizeImage:75",value:"75",icon:"large"}]})}init(){const t=this.editor;const e=new Pj(t);this._registerSchema();this._registerConverters("imageBlock");this._registerConverters("imageInline");t.commands.add("resizeImage",e);t.commands.add("imageResize",e)}_registerSchema(){if(this.editor.plugins.has("ImageBlockEditing")){this.editor.model.schema.extend("imageBlock",{allowAttributes:["resizedWidth","resizedHeight"]})}if(this.editor.plugins.has("ImageInlineEditing")){this.editor.model.schema.extend("imageInline",{allowAttributes:["resizedWidth","resizedHeight"]})}}_registerConverters(t){const e=this.editor;const n=e.plugins.get("ImageUtils");e.conversion.for("downcast").add((e=>e.on(`attribute:resizedWidth:${t}`,((t,e,n)=>{if(!n.consumable.consume(e.item,t.name)){return}const i=n.writer;const o=n.mapper.toViewElement(e.item);if(e.attributeNewValue!==null){i.setStyle("width",e.attributeNewValue,o);i.addClass("image_resized",o)}else{i.removeStyle("width",o);i.removeClass("image_resized",o)}}))));e.conversion.for("dataDowncast").attributeToAttribute({model:{name:t,key:"resizedHeight"},view:t=>({key:"style",value:{height:t}})});e.conversion.for("editingDowncast").add((e=>e.on(`attribute:resizedHeight:${t}`,((e,i,o)=>{if(!o.consumable.consume(i.item,e.name)){return}const r=o.writer;const s=o.mapper.toViewElement(i.item);const a=t==="imageInline"?n.findViewImgElement(s):s;if(i.attributeNewValue!==null){r.setStyle("height",i.attributeNewValue,a)}else{r.removeStyle("height",a)}}))));e.conversion.for("upcast").attributeToAttribute({view:{name:t==="imageBlock"?"figure":"img",styles:{width:/.+/}},model:{key:"resizedWidth",value:t=>{if(MO(t)){return null}return t.getStyle("width")}}});e.conversion.for("upcast").attributeToAttribute({view:{name:t==="imageBlock"?"figure":"img",styles:{height:/.+/}},model:{key:"resizedHeight",value:t=>{if(MO(t)){return null}return t.getStyle("height")}}})}}const Rj={small:Ty.objectSizeSmall,medium:Ty.objectSizeMedium,large:Ty.objectSizeLarge,original:Ty.objectSizeFull};class Vj extends bh{static get requires(){return[zj]}static get pluginName(){return"ImageResizeButtons"}constructor(t){super(t);this._resizeUnit=t.config.get("image.resizeUnit")}init(){const t=this.editor;const e=t.config.get("image.resizeOptions");const n=t.commands.get("resizeImage");this.bind("isEnabled").to(n);for(const t of e){this._registerImageResizeButton(t)}this._registerImageResizeDropdown(e)}_registerImageResizeButton(t){const e=this.editor;const{name:n,value:i,icon:o}=t;const r=i?i+this._resizeUnit:null;e.ui.componentFactory.add(n,(n=>{const i=new Dd(n);const s=e.commands.get("resizeImage");const a=this._getOptionLabelValue(t,true);if(!Rj[o]){throw new N("imageresizebuttons-missing-icon",e,t)}i.set({label:a,icon:Rj[o],tooltip:a,isToggleable:true});i.bind("isEnabled").to(this);i.bind("isOn").to(s,"value",Oj(r));this.listenTo(i,"execute",(()=>{e.execute("resizeImage",{width:r})}));return i}))}_registerImageResizeDropdown(t){const e=this.editor;const n=e.t;const i=t.find((t=>!t.value));const o=o=>{const r=e.commands.get("resizeImage");const s=sx(o,ch);const a=s.buttonView;const c=n("Resize image");a.set({tooltip:c,commandValue:i.value,icon:Rj.medium,isToggleable:true,label:this._getOptionLabelValue(i),withText:true,class:"ck-resize-image-button",ariaLabel:c,ariaLabelledBy:undefined});a.bind("label").to(r,"value",(t=>{if(t&&t.width){return t.width}else{return this._getOptionLabelValue(i)}}));s.bind("isEnabled").to(this);lx(s,(()=>this._getResizeDropdownListItemDefinitions(t,r)),{ariaLabel:n("Image resize list"),role:"menu"});this.listenTo(s,"execute",(t=>{e.execute(t.source.commandName,{width:t.source.commandValue});e.editing.view.focus()}));return s};e.ui.componentFactory.add("resizeImage",o);e.ui.componentFactory.add("imageResize",o)}_getOptionLabelValue(t,e=false){const n=this.editor.t;if(t.label){return t.label}else if(e){if(t.value){return n("Resize image to %0",t.value+this._resizeUnit)}else{return n("Resize image to the original size")}}else{if(t.value){return t.value+this._resizeUnit}else{return n("Original")}}}_getResizeDropdownListItemDefinitions(t,e){const n=new gl;t.map((t=>{const i=t.value?t.value+this._resizeUnit:null;const o={type:"button",model:new kT({commandName:"resizeImage",commandValue:i,label:this._getOptionLabelValue(t),role:"menuitemradio",withText:true,icon:null})};o.model.bind("isOn").to(e,"value",Oj(i));n.add(o)}));return n}}function Oj(t){return e=>{const n=e;if(t===null&&n===t){return true}return n!==null&&n.width===t}}const Fj=null&&"figure.image.ck-widget > img,"+"figure.image.ck-widget > picture > img,"+"figure.image.ck-widget > a > img,"+"figure.image.ck-widget > a > picture > img,"+"span.image-inline.ck-widget > img,"+"span.image-inline.ck-widget > picture > img";const jj="image_resized";class Hj extends(null&&Plugin){static get requires(){return[WidgetResize,ImageUtils]}static get pluginName(){return"ImageResizeHandles"}init(){const t=this.editor.commands.get("resizeImage");this.bind("isEnabled").to(t);this._setupResizerCreator()}_setupResizerCreator(){const t=this.editor;const e=t.editing.view;const n=t.plugins.get("ImageUtils");e.addObserver(ImageLoadObserver);this.listenTo(e.document,"imageLoaded",((i,o)=>{if(!o.target.matches(Fj)){return}const r=t.editing.view.domConverter;const s=r.domToView(o.target);const a=n.getImageWidgetFromImageView(s);let c=this.editor.plugins.get(WidgetResize).getResizerByViewElement(a);if(c){c.redraw();return}const l=t.editing.mapper;const d=l.toModelElement(a);c=t.plugins.get(WidgetResize).attachTo({unit:t.config.get("image.resizeUnit"),modelElement:d,viewElement:a,editor:t,getHandleHost(t){return t.querySelector("img")},getResizeHost(){return r.mapViewToDom(l.toViewElement(d.parent))},isCentered(){const t=d.getAttribute("imageStyle");return!t||t=="block"||t=="alignCenter"},onCommit(n){e.change((t=>{t.removeClass(jj,a)}));t.execute("resizeImage",{width:n})}});c.on("updateSize",(()=>{if(!a.hasClass(jj)){e.change((t=>{t.addClass(jj,a)}))}const t=d.name==="imageInline"?s:a;if(t.getStyle("height")){e.change((e=>{e.removeStyle("height",t)}))}}));c.bind("isEnabled").to(this)}))}}var Uj=n(7744);var Wj={injectType:"singletonStyleTag",attributes:{"data-cke":true}};Wj.insert="head";Wj.singleton=true;var Gj=Pl()(Uj.c,Wj);const qj=Uj.c.locals||{};class $j extends(null&&Plugin){static get requires(){return[ImageResizeEditing,ImageResizeHandles,ImageResizeButtons]}static get pluginName(){return"ImageResize"}}class Kj extends wh{constructor(t,e){super(t);this._defaultStyles={imageBlock:false,imageInline:false};this._styles=new Map(e.map((t=>{if(t.isDefault){for(const e of t.modelElements){this._defaultStyles[e]=t.name}}return[t.name,t]})))}refresh(){const t=this.editor;const e=t.plugins.get("ImageUtils");const n=e.getClosestSelectedImageElement(this.editor.model.document.selection);this.isEnabled=!!n;if(!this.isEnabled){this.value=false}else if(n.hasAttribute("imageStyle")){this.value=n.getAttribute("imageStyle")}else{this.value=this._defaultStyles[n.name]}}execute(t={}){const e=this.editor;const n=e.model;const i=e.plugins.get("ImageUtils");n.change((e=>{const o=t.value;const{setImageSizes:r=true}=t;let s=i.getClosestSelectedImageElement(n.document.selection);if(o&&this.shouldConvertImageType(o,s)){this.editor.execute(i.isBlockImage(s)?"imageTypeInline":"imageTypeBlock",{setImageSizes:r});s=i.getClosestSelectedImageElement(n.document.selection)}if(!o||this._styles.get(o).isDefault){e.removeAttribute("imageStyle",s)}else{e.setAttribute("imageStyle",o,s)}if(r){i.setImageNaturalSizeAttributes(s)}}))}shouldConvertImageType(t,e){const n=this._styles.get(t).modelElements;return!n.includes(e.name)}}const{objectFullWidth:Yj,objectInline:Qj,objectLeft:Zj,objectRight:Jj,objectCenter:Xj,objectBlockLeft:tH,objectBlockRight:eH}=Ty;const nH={get inline(){return{name:"inline",title:"In line",icon:Qj,modelElements:["imageInline"],isDefault:true}},get alignLeft(){return{name:"alignLeft",title:"Left aligned image",icon:Zj,modelElements:["imageBlock","imageInline"],className:"image-style-align-left"}},get alignBlockLeft(){return{name:"alignBlockLeft",title:"Left aligned image",icon:tH,modelElements:["imageBlock"],className:"image-style-block-align-left"}},get alignCenter(){return{name:"alignCenter",title:"Centered image",icon:Xj,modelElements:["imageBlock"],className:"image-style-align-center"}},get alignRight(){return{name:"alignRight",title:"Right aligned image",icon:Jj,modelElements:["imageBlock","imageInline"],className:"image-style-align-right"}},get alignBlockRight(){return{name:"alignBlockRight",title:"Right aligned image",icon:eH,modelElements:["imageBlock"],className:"image-style-block-align-right"}},get block(){return{name:"block",title:"Centered image",icon:Xj,modelElements:["imageBlock"],isDefault:true}},get side(){return{name:"side",title:"Side image",icon:Jj,modelElements:["imageBlock"],className:"image-style-side"}}};const iH={full:Yj,left:tH,right:eH,center:Xj,inlineLeft:Zj,inlineRight:Jj,inline:Qj};const oH=[{name:"imageStyle:wrapText",title:"Wrap text",defaultItem:"imageStyle:alignLeft",items:["imageStyle:alignLeft","imageStyle:alignRight"]},{name:"imageStyle:breakText",title:"Break text",defaultItem:"imageStyle:block",items:["imageStyle:alignBlockLeft","imageStyle:block","imageStyle:alignBlockRight"]}];function rH(t){const e=t.configuredStyles.options||[];const n=e.map((t=>cH(t))).filter((e=>lH(e,t)));return n}function sH(t,e){if(t&&e){return{options:["inline","alignLeft","alignRight","alignCenter","alignBlockLeft","alignBlockRight","block","side"]}}else if(t){return{options:["block","side"]}}else if(e){return{options:["inline","alignLeft","alignRight"]}}return{}}function aH(t){if(t.has("ImageBlockEditing")&&t.has("ImageInlineEditing")){return[...oH]}else{return[]}}function cH(t){if(typeof t==="string"){if(!nH[t]){t={name:t}}else{t={...nH[t]}}}else{t=dH(nH[t.name],t)}if(typeof t.icon==="string"){t.icon=iH[t.icon]||t.icon}return t}function lH(t,{isBlockPluginLoaded:e,isInlinePluginLoaded:n}){const{modelElements:i,name:o}=t;if(!i||!i.length||!o){uH({style:t});return false}else{const o=[e?"imageBlock":null,n?"imageInline":null];if(!i.some((t=>o.includes(t)))){P("image-style-missing-dependency",{style:t,missingPlugins:i.map((t=>t==="imageBlock"?"ImageBlockEditing":"ImageInlineEditing"))});return false}}return true}function dH(t,e){const n={...e};for(const i in t){if(!Object.prototype.hasOwnProperty.call(e,i)){n[i]=t[i]}}return n}function uH(t){P("image-style-configuration-definition-invalid",t)}const hH={normalizeStyles:rH,getDefaultStylesConfiguration:sH,getDefaultDropdownDefinitions:aH,warnInvalidStyle:uH,DEFAULT_OPTIONS:nH,DEFAULT_ICONS:iH,DEFAULT_DROPDOWN_DEFINITIONS:oH};function mH(t){return(e,n,i)=>{if(!i.consumable.consume(n.item,e.name)){return}const o=fH(n.attributeNewValue,t);const r=fH(n.attributeOldValue,t);const s=i.mapper.toViewElement(n.item);const a=i.writer;if(r){a.removeClass(r.className,s)}if(o){a.addClass(o.className,s)}}}function gH(t){const e={imageInline:t.filter((t=>!t.isDefault&&t.modelElements.includes("imageInline"))),imageBlock:t.filter((t=>!t.isDefault&&t.modelElements.includes("imageBlock")))};return(t,n,i)=>{if(!n.modelRange){return}const o=n.viewItem;const r=fl(n.modelRange.getItems());if(!r){return}if(!i.schema.checkAttribute(r,"imageStyle")){return}for(const t of e[r.name]){if(i.consumable.consume(o,{classes:t.className})){i.writer.setAttribute("imageStyle",t.name,r)}}}}function fH(t,e){for(const n of e){if(n.name===t){return n}}}class pH extends bh{static get pluginName(){return"ImageStyleEditing"}static get requires(){return[NO]}init(){const{normalizeStyles:t,getDefaultStylesConfiguration:e}=hH;const n=this.editor;const i=n.plugins.has("ImageBlockEditing");const o=n.plugins.has("ImageInlineEditing");n.config.define("image.styles",e(i,o));this.normalizedStyles=t({configuredStyles:n.config.get("image.styles"),isBlockPluginLoaded:i,isInlinePluginLoaded:o});this._setupConversion(i,o);this._setupPostFixer();n.commands.add("imageStyle",new Kj(n,this.normalizedStyles))}_setupConversion(t,e){const n=this.editor;const i=n.model.schema;const o=mH(this.normalizedStyles);const r=gH(this.normalizedStyles);n.editing.downcastDispatcher.on("attribute:imageStyle",o);n.data.downcastDispatcher.on("attribute:imageStyle",o);if(t){i.extend("imageBlock",{allowAttributes:"imageStyle"});n.data.upcastDispatcher.on("element:figure",r,{priority:"low"})}if(e){i.extend("imageInline",{allowAttributes:"imageStyle"});n.data.upcastDispatcher.on("element:img",r,{priority:"low"})}}_setupPostFixer(){const t=this.editor;const e=t.model.document;const n=t.plugins.get(NO);const i=new Map(this.normalizedStyles.map((t=>[t.name,t])));e.registerPostFixer((t=>{let o=false;for(const r of e.differ.getChanges()){if(r.type=="insert"||r.type=="attribute"&&r.attributeKey=="imageStyle"){let e=r.type=="insert"?r.position.nodeAfter:r.range.start.nodeAfter;if(e&&e.is("element","paragraph")&&e.childCount>0){e=e.getChild(0)}if(!n.isImage(e)){continue}const s=e.getAttribute("imageStyle");if(!s){continue}const a=i.get(s);if(!a||!a.modelElements.includes(e.name)){t.removeAttribute("imageStyle",e);o=true}}}return o}))}}var bH=n(1100);var kH={injectType:"singletonStyleTag",attributes:{"data-cke":true}};kH.insert="head";kH.singleton=true;var wH=Pl()(bH.c,kH);const AH=bH.c.locals||{};class CH extends bh{static get requires(){return[pH]}static get pluginName(){return"ImageStyleUI"}get localizedDefaultStylesTitles(){const t=this.editor.t;return{"Wrap text":t("Wrap text"),"Break text":t("Break text"),"In line":t("In line"),"Full size image":t("Full size image"),"Side image":t("Side image"),"Left aligned image":t("Left aligned image"),"Centered image":t("Centered image"),"Right aligned image":t("Right aligned image")}}init(){const t=this.editor.plugins;const e=this.editor.config.get("image.toolbar")||[];const n=t.get("ImageStyleEditing");const i=_H(n.normalizedStyles,this.localizedDefaultStylesTitles);for(const t of i){this._createButton(t)}const o=_H([...e.filter(st),...hH.getDefaultDropdownDefinitions(t)],this.localizedDefaultStylesTitles);for(const t of o){this._createDropdown(t,i)}}_createDropdown(t,e){const n=this.editor.ui.componentFactory;n.add(t.name,(i=>{let o;const{defaultItem:r,items:s,title:a}=t;const c=s.filter((t=>e.find((({name:e})=>vH(e)===t)))).map((t=>{const e=n.create(t);if(t===r){o=e}return e}));if(s.length!==c.length){hH.warnInvalidStyle({dropdown:t})}const l=sx(i,Zy);const d=l.buttonView;const u=d.arrowView;ax(l,c,{enableActiveItemFocusOnDropdownOpen:true});d.set({label:yH(a,o.label),class:null,tooltip:true});u.unbind("label");u.set({label:a});d.bind("icon").toMany(c,"isOn",((...t)=>{const e=t.findIndex(cg);return e<0?o.icon:c[e].icon}));d.bind("label").toMany(c,"isOn",((...t)=>{const e=t.findIndex(cg);return yH(a,e<0?o.label:c[e].label)}));d.bind("isOn").toMany(c,"isOn",((...t)=>t.some(cg)));d.bind("class").toMany(c,"isOn",((...t)=>t.some(cg)?"ck-splitbutton_flatten":undefined));d.on("execute",(()=>{if(!c.some((({isOn:t})=>t))){o.fire("execute")}else{l.isOpen=!l.isOpen}}));l.bind("isEnabled").toMany(c,"isEnabled",((...t)=>t.some(cg)));this.listenTo(l,"execute",(()=>{this.editor.editing.view.focus()}));return l}))}_createButton(t){const e=t.name;this.editor.ui.componentFactory.add(vH(e),(n=>{const i=this.editor.commands.get("imageStyle");const o=new Dd(n);o.set({label:t.title,icon:t.icon,tooltip:true,isToggleable:true});o.bind("isEnabled").to(i,"isEnabled");o.bind("isOn").to(i,"value",(t=>t===e));o.on("execute",this._executeCommand.bind(this,e));return o}))}_executeCommand(t){this.editor.execute("imageStyle",{value:t});this.editor.editing.view.focus()}}function _H(t,e){for(const n of t){if(e[n.title]){n.title=e[n.title]}}return t}function vH(t){return`imageStyle:${t}`}function yH(t,e){return(t?t+": ":"")+e}class xH extends bh{static get requires(){return[pH,CH]}static get pluginName(){return"ImageStyle"}}class EH extends bh{static get requires(){return[IL,NO]}static get pluginName(){return"ImageToolbar"}afterInit(){const t=this.editor;const e=t.t;const n=t.plugins.get(IL);const i=t.plugins.get("ImageUtils");n.register("image",{ariaLabel:e("Image toolbar"),items:DH(t.config.get("image.toolbar")||[]),getRelatedElement:t=>i.getClosestSelectedImageWidget(t)})}}function DH(t){return t.map((t=>st(t)?t.name:t))}class TH extends(null&&Plugin){static get requires(){return[ImageEditing,ImageUtils]}static get pluginName(){return"PictureEditing"}afterInit(){const t=this.editor;if(t.plugins.has("ImageBlockEditing")){t.model.schema.extend("imageBlock",{allowAttributes:["sources"]})}if(t.plugins.has("ImageInlineEditing")){t.model.schema.extend("imageInline",{allowAttributes:["sources"]})}this._setupConversion();this._setupImageUploadEditingIntegration()}_setupConversion(){const t=this.editor;const e=t.conversion;const n=t.plugins.get("ImageUtils");e.for("upcast").add(upcastPicture(n));e.for("downcast").add(downcastSourcesAttribute(n))}_setupImageUploadEditingIntegration(){const t=this.editor;if(!t.plugins.has("ImageUploadEditing")){return}const e=t.plugins.get("ImageUploadEditing");this.listenTo(e,"uploadComplete",((e,{imageElement:n,data:i})=>{const o=i.sources;if(!o){return}t.model.change((t=>{t.setAttributes({sources:o},n)}))}))}}class SH extends bh{static get pluginName(){return"IndentEditing"}init(){const t=this.editor;t.commands.add("indent",new Ch(t));t.commands.add("outdent",new Ch(t))}}class IH extends bh{static get pluginName(){return"IndentUI"}init(){const t=this.editor;const e=t.locale;const n=t.t;const i=e.uiLanguageDirection=="ltr"?Ty.indent:Ty.outdent;const o=e.uiLanguageDirection=="ltr"?Ty.outdent:Ty.indent;this._defineButton("indent",n("Increase indent"),i);this._defineButton("outdent",n("Decrease indent"),o)}_defineButton(t,e,n){const i=this.editor;i.ui.componentFactory.add(t,(o=>{const r=i.commands.get(t);const s=new Dd(o);s.set({label:e,icon:n,tooltip:true});s.bind("isEnabled").to(r,"isEnabled");this.listenTo(s,"execute",(()=>{i.execute(t);i.editing.view.focus()}));return s}))}}class BH extends bh{static get pluginName(){return"Indent"}static get requires(){return[SH,IH]}}class MH extends wh{constructor(t,e){super(t);this._indentBehavior=e}refresh(){const t=this.editor;const e=t.model;const n=fl(e.document.selection.getSelectedBlocks());if(!n||!this._isIndentationChangeAllowed(n)){this.isEnabled=false;return}this.isEnabled=this._indentBehavior.checkEnabled(n.getAttribute("blockIndent"))}execute(){const t=this.editor.model;const e=this._getBlocksToChange();t.change((t=>{for(const n of e){const e=n.getAttribute("blockIndent");const i=this._indentBehavior.getNextIndent(e);if(i){t.setAttribute("blockIndent",i,n)}else{t.removeAttribute("blockIndent",n)}}}))}_getBlocksToChange(){const t=this.editor.model;const e=t.document.selection;const n=Array.from(e.getSelectedBlocks());return n.filter((t=>this._isIndentationChangeAllowed(t)))}_isIndentationChangeAllowed(t){const e=this.editor;if(!e.model.schema.checkAttribute(t,"blockIndent")){return false}if(!e.plugins.has("ListUtils")){return true}if(!this._indentBehavior.isForward){return true}const n=e.plugins.get("ListUtils");return!n.isListItemBlock(t)}}class LH{constructor(t){this.isForward=t.direction==="forward";this.offset=t.offset;this.unit=t.unit}checkEnabled(t){const e=parseFloat(t||"0");return this.isForward||e>0}getNextIndent(t){const e=parseFloat(t||"0");const n=!t||t.endsWith(this.unit);if(!n){return this.isForward?this.offset+this.unit:undefined}const i=this.isForward?this.offset:-this.offset;const o=e+i;return o>0?o+this.unit:undefined}}class NH{constructor(t){this.isForward=t.direction==="forward";this.classes=t.classes}checkEnabled(t){const e=this.classes.indexOf(t);if(this.isForward){return e=0}}getNextIndent(t){const e=this.classes.indexOf(t);const n=this.isForward?1:-1;return this.classes[e+n]}}const PH=["paragraph","heading1","heading2","heading3","heading4","heading5","heading6"];class zH extends bh{constructor(t){super(t);t.config.define("indentBlock",{offset:40,unit:"px"})}static get pluginName(){return"IndentBlock"}init(){const t=this.editor;const e=t.config.get("indentBlock");if(e.classes&&e.classes.length){this._setupConversionUsingClasses(e.classes);t.commands.add("indentBlock",new MH(t,new NH({direction:"forward",classes:e.classes})));t.commands.add("outdentBlock",new MH(t,new NH({direction:"backward",classes:e.classes})))}else{t.data.addStyleProcessorRules(lv);this._setupConversionUsingOffset();t.commands.add("indentBlock",new MH(t,new LH({direction:"forward",offset:e.offset,unit:e.unit})));t.commands.add("outdentBlock",new MH(t,new LH({direction:"backward",offset:e.offset,unit:e.unit})))}}afterInit(){const t=this.editor;const e=t.model.schema;const n=t.commands.get("indent");const i=t.commands.get("outdent");const o=t.config.get("heading.options");const r=o&&o.map((t=>t.model));const s=r||PH;s.forEach((t=>{if(e.isRegistered(t)){e.extend(t,{allowAttributes:"blockIndent"})}}));e.setAttributeProperties("blockIndent",{isFormatting:true});n.registerChildCommand(t.commands.get("indentBlock"));i.registerChildCommand(t.commands.get("outdentBlock"))}_setupConversionUsingOffset(){const t=this.editor.conversion;const e=this.editor.locale;const n=e.contentLanguageDirection==="rtl"?"margin-right":"margin-left";t.for("upcast").attributeToAttribute({view:{styles:{[n]:/[\s\S]+/}},model:{key:"blockIndent",value:t=>{if(!t.is("element","li")){return t.getStyle(n)}}}});t.for("downcast").attributeToAttribute({model:"blockIndent",view:t=>({key:"style",value:{[n]:t}})})}_setupConversionUsingClasses(t){const e={model:{key:"blockIndent",values:[]},view:{}};for(const n of t){e.model.values.push(n);e.view[n]={key:"class",value:[n]}}this.editor.conversion.attributeToAttribute(e)}}class RH{constructor(){this._definitions=new Set}get length(){return this._definitions.size}add(t){if(Array.isArray(t)){t.forEach((t=>this._definitions.add(t)))}else{this._definitions.add(t)}}getDispatcher(){return t=>{t.on("attribute:linkHref",((t,e,n)=>{if(!n.consumable.test(e.item,"attribute:linkHref")){return}if(!(e.item.is("selection")||n.schema.isInline(e.item))){return}const i=n.writer;const o=i.document.selection;for(const t of this._definitions){const r=i.createAttributeElement("a",t.attributes,{priority:5});if(t.classes){i.addClass(t.classes,r)}for(const e in t.styles){i.setStyle(e,t.styles[e],r)}i.setCustomProperty("link",true,r);if(t.callback(e.attributeNewValue)){if(e.item.is("selection")){i.wrap(o.getFirstRange(),r)}else{i.wrap(n.mapper.toViewRange(e.range),r)}}else{i.unwrap(n.mapper.toViewRange(e.range),r)}}}),{priority:"high"})}}getDispatcherForLinkedImage(){return t=>{t.on("attribute:linkHref:imageBlock",((t,e,{writer:n,mapper:i})=>{const o=i.toViewElement(e.item);const r=Array.from(o.getChildren()).find((t=>t.is("element","a")));for(const t of this._definitions){const i=wl(t.attributes);if(t.callback(e.attributeNewValue)){for(const[t,e]of i){if(t==="class"){n.addClass(e,r)}else{n.setAttribute(t,e,r)}}if(t.classes){n.addClass(t.classes,r)}for(const e in t.styles){n.setStyle(e,t.styles[e],r)}}else{for(const[t,e]of i){if(t==="class"){n.removeClass(e,r)}else{n.removeAttribute(t,r)}}if(t.classes){n.removeClass(t.classes,r)}for(const e in t.styles){n.removeStyle(e,r)}}}}))}}}const VH=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g;const OH=/^(?:(?:https?|ftps?|mailto):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))/i;const FH=/^[\S]+@((?![-_])(?:[-\w\u00a1-\uffff]{0,63}[^-_]\.))+(?:[a-z\u00a1-\uffff]{2,})$/i;const jH=/^((\w+:(\/{2,})?)|(\W))/i;const HH="Ctrl+K";function UH(t){return t.is("attributeElement")&&!!t.getCustomProperty("link")}function WH(t,{writer:e}){const n=e.createAttributeElement("a",{href:t},{priority:5});e.setCustomProperty("link",true,n);return n}function GH(t){const e=String(t);return qH(e)?e:"#"}function qH(t){const e=t.replace(VH,"");return!!e.match(OH)}function $H(t,e){const n={"Open in a new tab":t("Open in a new tab"),Downloadable:t("Downloadable")};e.forEach((t=>{if("label"in t&&n[t.label]){t.label=n[t.label]}return t}));return e}function KH(t){const e=[];if(t){for(const[n,i]of Object.entries(t)){const t=Object.assign({},i,{id:`link${YR(n)}`});e.push(t)}}return e}function YH(t,e){if(!t){return false}return e.checkAttribute(t.name,"linkHref")}function QH(t){return FH.test(t)}function ZH(t,e){const n=QH(t)?"mailto:":e;const i=!!n&&!JH(t);return t&&i?n+t:t}function JH(t){return jH.test(t)}function XH(t){window.open(t,"_blank","noopener")}class tU extends wh{constructor(){super(...arguments);this.manualDecorators=new gl;this.automaticDecorators=new RH}restoreManualDecoratorStates(){for(const t of this.manualDecorators){t.value=this._getDecoratorStateFromModel(t.id)}}refresh(){const t=this.editor.model;const e=t.document.selection;const n=e.getSelectedElement()||fl(e.getSelectedBlocks());if(YH(n,t.schema)){this.value=n.getAttribute("linkHref");this.isEnabled=t.schema.checkAttribute(n,"linkHref")}else{this.value=e.getAttribute("linkHref");this.isEnabled=t.schema.checkAttributeInSelection(e,"linkHref")}for(const t of this.manualDecorators){t.value=this._getDecoratorStateFromModel(t.id)}}execute(t,e={}){const n=this.editor.model;const i=n.document.selection;const o=[];const r=[];for(const t in e){if(e[t]){o.push(t)}else{r.push(t)}}n.change((e=>{if(i.isCollapsed){const s=i.getFirstPosition();if(i.hasAttribute("linkHref")){const a=eU(i);let c=tB(s,"linkHref",i.getAttribute("linkHref"),n);if(i.getAttribute("linkHref")===a){c=this._updateLinkContent(n,e,c,t)}e.setAttribute("linkHref",t,c);o.forEach((t=>{e.setAttribute(t,true,c)}));r.forEach((t=>{e.removeAttribute(t,c)}));e.setSelection(e.createPositionAfter(c.end.nodeBefore))}else if(t!==""){const r=wl(i.getAttributes());r.set("linkHref",t);o.forEach((t=>{r.set(t,true)}));const{end:a}=n.insertContent(e.createText(t,r),s);e.setSelection(a)}["linkHref",...o,...r].forEach((t=>{e.removeSelectionAttribute(t)}))}else{const s=n.schema.getValidRanges(i.getRanges(),"linkHref");const a=[];for(const t of i.getSelectedBlocks()){if(n.schema.checkAttribute(t,"linkHref")){a.push(e.createRangeOn(t))}}const c=a.slice();for(const t of s){if(this._isRangeToUpdate(t,a)){c.push(t)}}for(const s of c){let a=s;if(c.length===1){const o=eU(i);if(i.getAttribute("linkHref")===o){a=this._updateLinkContent(n,e,s,t);e.setSelection(e.createSelection(a))}}e.setAttribute("linkHref",t,a);o.forEach((t=>{e.setAttribute(t,true,a)}));r.forEach((t=>{e.removeAttribute(t,a)}))}}}))}_getDecoratorStateFromModel(t){const e=this.editor.model;const n=e.document.selection;const i=n.getSelectedElement();if(YH(i,e.schema)){return i.getAttribute(t)}return n.getAttribute(t)}_isRangeToUpdate(t,e){for(const n of e){if(n.containsRange(t)){return false}}return true}_updateLinkContent(t,e,n,i){const o=e.createText(i,{linkHref:i});return t.insertContent(o,n)}}function eU(t){if(t.isCollapsed){const e=t.getFirstPosition();return e.textNode&&e.textNode.data}else{const e=Array.from(t.getFirstRange().getItems());if(e.length>1){return null}const n=e[0];if(n.is("$text")||n.is("$textProxy")){return n.data}return null}}class nU extends wh{refresh(){const t=this.editor.model;const e=t.document.selection;const n=e.getSelectedElement();if(YH(n,t.schema)){this.isEnabled=t.schema.checkAttribute(n,"linkHref")}else{this.isEnabled=t.schema.checkAttributeInSelection(e,"linkHref")}}execute(){const t=this.editor;const e=this.editor.model;const n=e.document.selection;const i=t.commands.get("link");e.change((t=>{const o=n.isCollapsed?[tB(n.getFirstPosition(),"linkHref",n.getAttribute("linkHref"),e)]:e.schema.getValidRanges(n.getRanges(),"linkHref");for(const e of o){t.removeAttribute("linkHref",e);if(i){for(const n of i.manualDecorators){t.removeAttribute(n.id,e)}}}}))}}class iU extends(mt()){constructor({id:t,label:e,attributes:n,classes:i,styles:o,defaultValue:r}){super();this.id=t;this.set("value",undefined);this.defaultValue=r;this.label=e;this.attributes=n;this.classes=i;this.styles=o}_createPattern(){return{attributes:this.attributes,classes:this.classes,styles:this.styles}}}var oU=n(6088);var rU={injectType:"singletonStyleTag",attributes:{"data-cke":true}};rU.insert="head";rU.singleton=true;var sU=Pl()(oU.c,rU);const aU=oU.c.locals||{};const cU="ck-link_selected";const lU="automatic";const dU="manual";const uU=/^(https?:)?\/\//;class hU extends bh{static get pluginName(){return"LinkEditing"}static get requires(){return[RI,AI,IM]}constructor(t){super(t);t.config.define("link",{allowCreatingEmptyLinks:false,addTargetToExternalLinks:false})}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:"linkHref"});t.conversion.for("dataDowncast").attributeToElement({model:"linkHref",view:WH});t.conversion.for("editingDowncast").attributeToElement({model:"linkHref",view:(t,e)=>WH(GH(t),e)});t.conversion.for("upcast").elementToAttribute({view:{name:"a",attributes:{href:true}},model:{key:"linkHref",value:t=>t.getAttribute("href")}});t.commands.add("link",new tU(t));t.commands.add("unlink",new nU(t));const e=$H(t.t,KH(t.config.get("link.decorators")));this._enableAutomaticDecorators(e.filter((t=>t.mode===lU)));this._enableManualDecorators(e.filter((t=>t.mode===dU)));const n=t.plugins.get(RI);n.registerAttribute("linkHref");nB(t,"linkHref","a",cU);this._enableLinkOpen();this._enableSelectionAttributesFixer();this._enableClipboardIntegration()}_enableAutomaticDecorators(t){const e=this.editor;const n=e.commands.get("link");const i=n.automaticDecorators;if(e.config.get("link.addTargetToExternalLinks")){i.add({id:"linkIsExternal",mode:lU,callback:t=>!!t&&uU.test(t),attributes:{target:"_blank",rel:"noopener noreferrer"}})}i.add(t);if(i.length){e.conversion.for("downcast").add(i.getDispatcher())}}_enableManualDecorators(t){if(!t.length){return}const e=this.editor;const n=e.commands.get("link");const i=n.manualDecorators;t.forEach((t=>{e.model.schema.extend("$text",{allowAttributes:t.id});const n=new iU(t);i.add(n);e.conversion.for("downcast").attributeToElement({model:n.id,view:(t,{writer:e,schema:i},{item:o})=>{if(!(o.is("selection")||i.isInline(o))){return}if(t){const t=e.createAttributeElement("a",n.attributes,{priority:5});if(n.classes){e.addClass(n.classes,t)}for(const i in n.styles){e.setStyle(i,n.styles[i],t)}e.setCustomProperty("link",true,t);return t}}});e.conversion.for("upcast").elementToAttribute({view:{name:"a",...n._createPattern()},model:{key:n.id}})}))}_enableLinkOpen(){const t=this.editor;const e=t.editing.view;const n=e.document;this.listenTo(n,"click",((t,e)=>{const n=l.isMac?e.domEvent.metaKey:e.domEvent.ctrlKey;if(!n){return}let i=e.domTarget;if(i.tagName.toLowerCase()!="a"){i=i.closest("a")}if(!i){return}const o=i.getAttribute("href");if(!o){return}t.stop();e.preventDefault();XH(o)}),{context:"$capture"});this.listenTo(n,"keydown",((e,n)=>{const i=t.commands.get("link");const o=i.value;const r=!!o&&n.keyCode===$c.enter&&n.altKey;if(!r){return}e.stop();XH(o)}))}_enableSelectionAttributesFixer(){const t=this.editor;const e=t.model;const n=e.document.selection;this.listenTo(n,"change:attribute",((t,{attributeKeys:i})=>{if(!i.includes("linkHref")||n.hasAttribute("linkHref")){return}e.change((t=>{mU(t,gU(e.schema))}))}))}_enableClipboardIntegration(){const t=this.editor;const e=t.model;const n=this.editor.config.get("link.defaultProtocol");if(!n){return}this.listenTo(t.plugins.get("ClipboardPipeline"),"contentInsertion",((t,i)=>{e.change((t=>{const e=t.createRangeIn(i.content);for(const i of e.getItems()){if(i.hasAttribute("linkHref")){const e=ZH(i.getAttribute("linkHref"),n);t.setAttribute("linkHref",e,i)}}}))}))}}function mU(t,e){t.removeSelectionAttribute("linkHref");for(const n of e){t.removeSelectionAttribute(n)}}function gU(t){const e=t.getDefinition("$text").allowAttributes;return e.filter((t=>t.startsWith("link")))}var fU=n(1340);var pU={injectType:"singletonStyleTag",attributes:{"data-cke":true}};pU.insert="head";pU.singleton=true;var bU=Pl()(fU.c,pU);const kU=fU.c.locals||{};class wU extends Fl{constructor(t,e){super(t);this.focusTracker=new pl;this.keystrokes=new bl;this._focusables=new Ml;const n=t.t;this.urlInputView=this._createUrlInput();this.saveButtonView=this._createButton(n("Save"),Ty.check,"ck-button-save");this.saveButtonView.type="submit";this.cancelButtonView=this._createButton(n("Cancel"),Ty.cancel,"ck-button-cancel","cancel");this._manualDecoratorSwitches=this._createManualDecoratorSwitches(e);this.children=this._createFormChildren(e.manualDecorators);this._focusCycler=new lh({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});const i=["ck","ck-link-form","ck-responsive-form"];if(e.manualDecorators.length){i.push("ck-link-form_layout-vertical","ck-vertical-form")}this.setTemplate({tag:"form",attributes:{class:i,tabindex:"-1"},children:this.children})}getDecoratorSwitchesState(){return Array.from(this._manualDecoratorSwitches).reduce(((t,e)=>{t[e.name]=e.isOn;return t}),{})}render(){super.render();o({view:this});const t=[this.urlInputView,...this._manualDecoratorSwitches,this.saveButtonView,this.cancelButtonView];t.forEach((t=>{this._focusables.add(t);this.focusTracker.add(t.element)}));this.keystrokes.listenTo(this.element)}destroy(){super.destroy();this.focusTracker.destroy();this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}_createUrlInput(){const t=this.locale.t;const e=new Ou(this.locale,Ax);e.label=t("Link URL");return e}_createButton(t,e,n,i){const o=new Dd(this.locale);o.set({label:t,icon:e,tooltip:true});o.extendTemplate({attributes:{class:n}});if(i){o.delegate("execute").to(this,i)}return o}_createManualDecoratorSwitches(t){const e=this.createCollection();for(const n of t.manualDecorators){const i=new Md(this.locale);i.set({name:n.id,label:n.label,withText:true});i.bind("isOn").toMany([n,t],"value",((t,e)=>e===undefined&&t===undefined?!!n.defaultValue:!!t));i.on("execute",(()=>{n.set("value",!i.isOn)}));e.add(i)}return e}_createFormChildren(t){const e=this.createCollection();e.add(this.urlInputView);if(t.length){const t=new Fl;t.setTemplate({tag:"ul",children:this._manualDecoratorSwitches.map((t=>({tag:"li",children:[t],attributes:{class:["ck","ck-list__item"]}}))),attributes:{class:["ck","ck-reset","ck-list"]}});e.add(t)}e.add(this.saveButtonView);e.add(this.cancelButtonView);return e}}var AU=n(3362);var CU={injectType:"singletonStyleTag",attributes:{"data-cke":true}};CU.insert="head";CU.singleton=true;var _U=Pl()(AU.c,CU);const vU=AU.c.locals||{};const yU=' ';class xU extends Fl{constructor(t){super(t);this.focusTracker=new pl;this.keystrokes=new bl;this._focusables=new Ml;const e=t.t;this.previewButtonView=this._createPreviewButton();this.unlinkButtonView=this._createButton(e("Unlink"),yU,"unlink");this.editButtonView=this._createButton(e("Edit link"),Ty.pencil,"edit");this.set("href",undefined);this._focusCycler=new lh({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});this.setTemplate({tag:"div",attributes:{class:["ck","ck-link-actions","ck-responsive-form"],tabindex:"-1"},children:[this.previewButtonView,this.editButtonView,this.unlinkButtonView]})}render(){super.render();const t=[this.previewButtonView,this.editButtonView,this.unlinkButtonView];t.forEach((t=>{this._focusables.add(t);this.focusTracker.add(t.element)}));this.keystrokes.listenTo(this.element)}destroy(){super.destroy();this.focusTracker.destroy();this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}_createButton(t,e,n){const i=new Dd(this.locale);i.set({label:t,icon:e,tooltip:true});i.delegate("execute").to(this,n);return i}_createPreviewButton(){const t=new Dd(this.locale);const e=this.bindTemplate;const n=this.t;t.set({withText:true,tooltip:n("Open link in new tab")});t.extendTemplate({attributes:{class:["ck","ck-link-actions__preview"],href:e.to("href",(t=>t&&GH(t))),target:"_blank",rel:"noopener noreferrer"}});t.bind("label").to(this,"href",(t=>t||n("This link has no URL")));t.bind("isEnabled").to(this,"href",(t=>!!t));t.template.tag="a";t.template.eventListeners={};return t}}const EU=' ';const DU="link-ui";class TU extends bh{constructor(){super(...arguments);this.actionsView=null;this.formView=null}static get requires(){return[TT]}static get pluginName(){return"LinkUI"}init(){const t=this.editor;t.editing.view.addObserver(b_);this._balloon=t.plugins.get(TT);this._createToolbarLinkButton();this._enableBalloonActivators();t.conversion.for("editingDowncast").markerToHighlight({model:DU,view:{classes:["ck-fake-link-selection"]}});t.conversion.for("editingDowncast").markerToElement({model:DU,view:{name:"span",classes:["ck-fake-link-selection","ck-fake-link-selection_collapsed"]}})}destroy(){super.destroy();if(this.formView){this.formView.destroy()}if(this.actionsView){this.actionsView.destroy()}}_createViews(){this.actionsView=this._createActionsView();this.formView=this._createFormView();this._enableUserBalloonInteractions()}_createActionsView(){const t=this.editor;const e=new xU(t.locale);const n=t.commands.get("link");const i=t.commands.get("unlink");e.bind("href").to(n,"value");e.editButtonView.bind("isEnabled").to(n);e.unlinkButtonView.bind("isEnabled").to(i);this.listenTo(e,"edit",(()=>{this._addFormView()}));this.listenTo(e,"unlink",(()=>{t.execute("unlink");this._hideUI()}));e.keystrokes.set("Esc",((t,e)=>{this._hideUI();e()}));e.keystrokes.set(HH,((t,e)=>{this._addFormView();e()}));return e}_createFormView(){const t=this.editor;const n=t.commands.get("link");const i=t.config.get("link.defaultProtocol");const o=t.config.get("link.allowCreatingEmptyLinks");const r=new(e(wU))(t.locale,n);r.urlInputView.fieldView.bind("value").to(n,"value");r.urlInputView.bind("isEnabled").to(n,"isEnabled");r.saveButtonView.bind("isEnabled").to(n,"isEnabled",r.urlInputView,"isEmpty",((t,e)=>t&&(o||!e)));this.listenTo(r,"submit",(()=>{const{value:e}=r.urlInputView.fieldView.element;const n=ZH(e,i);t.execute("link",n,r.getDecoratorSwitchesState());this._closeFormView()}));this.listenTo(r,"cancel",(()=>{this._closeFormView()}));r.keystrokes.set("Esc",((t,e)=>{this._closeFormView();e()}));return r}_createToolbarLinkButton(){const t=this.editor;const e=t.commands.get("link");const n=t.t;t.ui.componentFactory.add("link",(t=>{const i=new Dd(t);i.isEnabled=true;i.label=n("Link");i.icon=EU;i.keystroke=HH;i.tooltip=true;i.isToggleable=true;i.bind("isEnabled").to(e,"isEnabled");i.bind("isOn").to(e,"value",(t=>!!t));this.listenTo(i,"execute",(()=>this._showUI(true)));return i}))}_enableBalloonActivators(){const t=this.editor;const e=t.editing.view.document;this.listenTo(e,"click",(()=>{const t=this._getSelectedLinkElement();if(t){this._showUI()}}));t.keystrokes.set(HH,((e,n)=>{n();if(t.commands.get("link").isEnabled){this._showUI(true)}}))}_enableUserBalloonInteractions(){this.editor.keystrokes.set("Tab",((t,e)=>{if(this._areActionsVisible&&!this.actionsView.focusTracker.isFocused){this.actionsView.focus();e()}}),{priority:"high"});this.editor.keystrokes.set("Esc",((t,e)=>{if(this._isUIVisible){this._hideUI();e()}}));t({emitter:this.formView,activator:()=>this._isUIInPanel,contextElements:()=>[this._balloon.view.element],callback:()=>this._hideUI()})}_addActionsView(){if(!this.actionsView){this._createViews()}if(this._areActionsInPanel){return}this._balloon.add({view:this.actionsView,position:this._getBalloonPositionData()})}_addFormView(){if(!this.formView){this._createViews()}if(this._isFormInPanel){return}const t=this.editor;const e=t.commands.get("link");this.formView.disableCssTransitions();this._balloon.add({view:this.formView,position:this._getBalloonPositionData()});this.formView.urlInputView.fieldView.value=e.value||"";if(this._balloon.visibleView===this.formView){this.formView.urlInputView.fieldView.select()}this.formView.enableCssTransitions()}_closeFormView(){const t=this.editor.commands.get("link");t.restoreManualDecoratorStates();if(t.value!==undefined){this._removeFormView()}else{this._hideUI()}}_removeFormView(){if(this._isFormInPanel){this.formView.saveButtonView.focus();this.formView.urlInputView.fieldView.reset();this._balloon.remove(this.formView);this.editor.editing.view.focus();this._hideFakeVisualSelection()}}_showUI(t=false){if(!this.formView){this._createViews()}if(!this._getSelectedLinkElement()){this._showFakeVisualSelection();this._addActionsView();if(t){this._balloon.showStack("main")}this._addFormView()}else{if(this._areActionsVisible){this._addFormView()}else{this._addActionsView()}if(t){this._balloon.showStack("main")}}this._startUpdatingUI()}_hideUI(){if(!this._isUIInPanel){return}const t=this.editor;this.stopListening(t.ui,"update");this.stopListening(this._balloon,"change:visibleView");t.editing.view.focus();this._removeFormView();this._balloon.remove(this.actionsView);this._hideFakeVisualSelection()}_startUpdatingUI(){const t=this.editor;const e=t.editing.view.document;let n=this._getSelectedLinkElement();let i=r();const o=()=>{const t=this._getSelectedLinkElement();const e=r();if(n&&!t||!n&&e!==i){this._hideUI()}else if(this._isUIVisible){this._balloon.updatePosition(this._getBalloonPositionData())}n=t;i=e};function r(){return e.selection.focus.getAncestors().reverse().find((t=>t.is("element")))}this.listenTo(t.ui,"update",o);this.listenTo(this._balloon,"change:visibleView",o)}get _isFormInPanel(){return!!this.formView&&this._balloon.hasView(this.formView)}get _areActionsInPanel(){return!!this.actionsView&&this._balloon.hasView(this.actionsView)}get _areActionsVisible(){return!!this.actionsView&&this._balloon.visibleView===this.actionsView}get _isUIInPanel(){return this._isFormInPanel||this._areActionsInPanel}get _isUIVisible(){const t=this._balloon.visibleView;return!!this.formView&&t==this.formView||this._areActionsVisible}_getBalloonPositionData(){const t=this.editor.editing.view;const e=this.editor.model;const n=t.document;let i;if(e.markers.has(DU)){const e=Array.from(this.editor.editing.mapper.markerNameToElements(DU));const n=t.createRange(t.createPositionBefore(e[0]),t.createPositionAfter(e[e.length-1]));i=t.domConverter.viewRangeToDom(n)}else{i=()=>{const e=this._getSelectedLinkElement();return e?t.domConverter.mapViewToDom(e):t.domConverter.viewRangeToDom(n.selection.getFirstRange())}}return{target:i}}_getSelectedLinkElement(){const t=this.editor.editing.view;const e=t.document.selection;const n=e.getSelectedElement();if(e.isCollapsed||n&&VM(n)){return SU(e.getFirstPosition())}else{const n=e.getFirstRange().getTrimmed();const i=SU(n.start);const o=SU(n.end);if(!i||i!=o){return null}if(t.createRangeIn(i).getTrimmed().isEqual(n)){return i}else{return null}}}_showFakeVisualSelection(){const t=this.editor.model;t.change((e=>{const n=t.document.selection.getFirstRange();if(t.markers.has(DU)){e.updateMarker(DU,{range:n})}else{if(n.start.isAtEnd){const i=n.start.getLastMatchingPosition((({item:e})=>!t.schema.isContent(e)),{boundaries:n});e.addMarker(DU,{usingOperation:false,affectsData:false,range:e.createRange(i,n.end)})}else{e.addMarker(DU,{usingOperation:false,affectsData:false,range:n})}}}))}_hideFakeVisualSelection(){const t=this.editor.model;if(t.markers.has(DU)){t.change((t=>{t.removeMarker(DU)}))}}}function SU(t){return t.getAncestors().find((t=>UH(t)))||null}const IU=4;const BU=new RegExp("(^|\\s)"+"("+"("+"(?:(?:(?:https?|ftp):)?\\/\\/)"+"(?:\\S+(?::\\S*)?@)?"+"(?:"+"(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])"+"(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}"+"(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))"+"|"+"("+"((?!www\\.)|(www\\.))"+"(?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.)+"+"(?:[a-z\\u00a1-\\uffff]{2,63})"+")"+")"+"(?::\\d{2,5})?"+"(?:[/?#]\\S*)?"+")"+"|"+"("+"(www.|(\\S+@))"+"((?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.))+"+"(?:[a-z\\u00a1-\\uffff]{2,63})"+")"+")$","i");const MU=2;class LU extends bh{static get requires(){return[LI,hU]}static get pluginName(){return"AutoLink"}init(){const t=this.editor;const e=t.model.document.selection;e.on("change:range",(()=>{this.isEnabled=!e.anchor.parent.is("element","codeBlock")}));this._enableTypingHandling()}afterInit(){this._enableEnterHandling();this._enableShiftEnterHandling();this._enablePasteLinking()}_expandLinkRange(t,e){if(e.textNode&&e.textNode.hasAttribute("linkHref")){return tB(e,"linkHref",e.textNode.getAttribute("linkHref"),t)}else{return null}}_selectEntireLinks(t,e){const n=this.editor;const i=n.model;const o=i.document.selection;const r=o.getFirstPosition();const s=o.getLastPosition();let a=e.getJoined(this._expandLinkRange(i,r)||e);if(a){a=a.getJoined(this._expandLinkRange(i,s)||e)}if(a&&(a.start.isBefore(r)||a.end.isAfter(s))){t.setSelection(a)}}_enablePasteLinking(){const t=this.editor;const e=t.model;const n=e.document.selection;const i=t.plugins.get("ClipboardPipeline");const o=t.commands.get("link");i.on("inputTransformation",((t,i)=>{if(!this.isEnabled||!o.isEnabled||n.isCollapsed||i.method!=="paste"){return}if(n.rangeCount>1){return}const r=n.getFirstRange();const s=i.dataTransfer.getData("text/plain");if(!s){return}const a=s.match(BU);if(a&&a[2]===s){e.change((t=>{this._selectEntireLinks(t,r);o.execute(s)}));t.stop()}}),{priority:"high"})}_enableTypingHandling(){const t=this.editor;const e=new zI(t.model,(t=>{if(!NU(t)){return}const e=PU(t.substr(0,t.length-1));if(e){return{url:e}}}));e.on("matched:data",((e,n)=>{const{batch:i,range:o,url:r}=n;if(!i.isTyping){return}const s=o.end.getShiftedBy(-1);const a=s.getShiftedBy(-r.length);const c=t.model.createRange(a,s);this._applyAutoLink(r,c)}));e.bind("isEnabled").to(this)}_enableEnterHandling(){const t=this.editor;const e=t.model;const n=t.commands.get("enter");if(!n){return}n.on("execute",(()=>{const t=e.document.selection.getFirstPosition();if(!t.parent.previousSibling){return}const n=e.createRangeIn(t.parent.previousSibling);this._checkAndApplyAutoLinkOnRange(n)}))}_enableShiftEnterHandling(){const t=this.editor;const e=t.model;const n=t.commands.get("shiftEnter");if(!n){return}n.on("execute",(()=>{const t=e.document.selection.getFirstPosition();const n=e.createRange(e.createPositionAt(t.parent,0),t.getShiftedBy(-1));this._checkAndApplyAutoLinkOnRange(n)}))}_checkAndApplyAutoLinkOnRange(t){const e=this.editor.model;const{text:n,range:i}=PI(t,e);const o=PU(n);if(o){const t=e.createRange(i.end.getShiftedBy(-o.length),i.end);this._applyAutoLink(o,t)}}_applyAutoLink(t,e){const n=this.editor.model;const i=this.editor.config.get("link.defaultProtocol");const o=ZH(t,i);if(!this.isEnabled||!zU(e,n)||!JH(o)||RU(e)){return}this._persistAutoLink(o,e)}_persistAutoLink(t,e){const n=this.editor.model;const i=this.editor.plugins.get("Delete");n.enqueueChange((o=>{o.setAttribute("linkHref",t,e);n.enqueueChange((()=>{i.requestUndoOnBackspace()}))}))}}function NU(t){return t.length>IU&&t[t.length-1]===" "&&t[t.length-2]!==" "}function PU(t){const e=BU.exec(t);return e?e[MU]:null}function zU(t,e){return e.schema.checkAttributeInSelection(e.createSelection(t),"linkHref")}function RU(t){const e=t.start.nodeAfter;return!!e&&e.hasAttribute("linkHref")}class VU extends bh{static get requires(){return[hU,TU,LU]}static get pluginName(){return"Link"}}class OU extends bh{static get requires(){return["ImageEditing","ImageUtils",hU]}static get pluginName(){return"LinkImageEditing"}afterInit(){const t=this.editor;const e=t.model.schema;if(t.plugins.has("ImageBlockEditing")){e.extend("imageBlock",{allowAttributes:["linkHref"]})}t.conversion.for("upcast").add(FU(t));t.conversion.for("downcast").add(jU(t));this._enableAutomaticDecorators();this._enableManualDecorators()}_enableAutomaticDecorators(){const t=this.editor;const e=t.commands.get("link");const n=e.automaticDecorators;if(n.length){t.conversion.for("downcast").add(n.getDispatcherForLinkedImage())}}_enableManualDecorators(){const t=this.editor;const e=t.commands.get("link");for(const n of e.manualDecorators){if(t.plugins.has("ImageBlockEditing")){t.model.schema.extend("imageBlock",{allowAttributes:n.id})}if(t.plugins.has("ImageInlineEditing")){t.model.schema.extend("imageInline",{allowAttributes:n.id})}t.conversion.for("downcast").add(HU(n));t.conversion.for("upcast").add(UU(t,n))}}}function FU(t){const e=t.plugins.has("ImageInlineEditing");const n=t.plugins.get("ImageUtils");return t=>{t.on("element:a",((t,i,o)=>{const r=i.viewItem;const s=n.findViewImgElement(r);if(!s){return}const a=s.findAncestor((t=>n.isBlockImageView(t)));if(e&&!a){return}const c={attributes:["href"]};if(!o.consumable.consume(r,c)){return}const l=r.getAttribute("href");if(!l){return}let d=i.modelCursor.parent;if(!d.is("element","imageBlock")){const t=o.convertItem(s,i.modelCursor);i.modelRange=t.modelRange;i.modelCursor=t.modelCursor;d=i.modelCursor.nodeBefore}if(d&&d.is("element","imageBlock")){o.writer.setAttribute("linkHref",l,d)}}),{priority:"high"})}}function jU(t){const e=t.plugins.get("ImageUtils");return t=>{t.on("attribute:linkHref:imageBlock",((t,n,i)=>{if(!i.consumable.consume(n.item,t.name)){return}const o=i.mapper.toViewElement(n.item);const r=i.writer;const s=Array.from(o.getChildren()).find((t=>t.is("element","a")));const a=e.findViewImgElement(o);const c=a.parent.is("element","picture")?a.parent:a;if(s){if(n.attributeNewValue){r.setAttribute("href",n.attributeNewValue,s)}else{r.move(r.createRangeOn(c),r.createPositionAt(o,0));r.remove(s)}}else{const t=r.createContainerElement("a",{href:n.attributeNewValue});r.insert(r.createPositionAt(o,0),t);r.move(r.createRangeOn(c),r.createPositionAt(t,0))}}),{priority:"high"})}}function HU(t){return e=>{e.on(`attribute:${t.id}:imageBlock`,((e,n,i)=>{const o=i.mapper.toViewElement(n.item);const r=Array.from(o.getChildren()).find((t=>t.is("element","a")));if(!r){return}for(const[e,n]of wl(t.attributes)){i.writer.setAttribute(e,n,r)}if(t.classes){i.writer.addClass(t.classes,r)}for(const e in t.styles){i.writer.setStyle(e,t.styles[e],r)}}))}}function UU(t,e){const n=t.plugins.has("ImageInlineEditing");const i=t.plugins.get("ImageUtils");return t=>{t.on("element:a",((t,o,r)=>{const s=o.viewItem;const a=i.findViewImgElement(s);if(!a){return}const c=a.findAncestor((t=>i.isBlockImageView(t)));if(n&&!c){return}const l=new $h(e._createPattern());const d=l.match(s);if(!d){return}if(!r.consumable.consume(s,d.match)){return}const u=o.modelCursor.nodeBefore||o.modelCursor.parent;r.writer.setAttribute(e.id,true,u)}),{priority:"high"})}}class WU extends bh{static get requires(){return[hU,TU,"ImageBlockEditing"]}static get pluginName(){return"LinkImageUI"}init(){const t=this.editor;const e=t.editing.view.document;this.listenTo(e,"click",((e,n)=>{if(this._isSelectedLinkedImage(t.model.document.selection)){n.preventDefault();e.stop()}}),{priority:"high"});this._createToolbarLinkImageButton()}_createToolbarLinkImageButton(){const t=this.editor;const e=t.t;t.ui.componentFactory.add("linkImage",(n=>{const i=new Dd(n);const o=t.plugins.get("LinkUI");const r=t.commands.get("link");i.set({isEnabled:true,label:e("Link image"),icon:EU,keystroke:HH,tooltip:true,isToggleable:true});i.bind("isEnabled").to(r,"isEnabled");i.bind("isOn").to(r,"value",(t=>!!t));this.listenTo(i,"execute",(()=>{if(this._isSelectedLinkedImage(t.model.document.selection)){o._addActionsView()}else{o._showUI(true)}}));return i}))}_isSelectedLinkedImage(t){const e=t.getSelectedElement();const n=this.editor.plugins.get("ImageUtils");return n.isImage(e)&&e.hasAttribute("linkHref")}}var GU=n(6712);var qU={injectType:"singletonStyleTag",attributes:{"data-cke":true}};qU.insert="head";qU.singleton=true;var $U=Pl()(GU.c,qU);const KU=GU.c.locals||{};class YU extends bh{static get requires(){return[OU,WU]}static get pluginName(){return"LinkImage"}}class QU{constructor(t,e){this._startElement=t;this._referenceIndent=t.getAttribute("listIndent");this._isForward=e.direction=="forward";this._includeSelf=!!e.includeSelf;this._sameAttributes=ol(e.sameAttributes||[]);this._sameIndent=!!e.sameIndent;this._lowerIndent=!!e.lowerIndent;this._higherIndent=!!e.higherIndent}static first(t,e){const n=new this(t,e);const i=n[Symbol.iterator]();return fl(i)}*[Symbol.iterator](){const t=[];for(const{node:e}of ZU(this._getStartNode(),this._isForward?"forward":"backward")){const n=e.getAttribute("listIndent");if(nthis._referenceIndent){if(!this._higherIndent){continue}if(!this._isForward){t.push(e);continue}}else{if(!this._sameIndent){if(this._higherIndent){if(t.length){yield*t;t.length=0}break}continue}if(this._sameAttributes.some((t=>e.getAttribute(t)!==this._startElement.getAttribute(t)))){break}}if(t.length){yield*t;t.length=0}yield e}}_getStartNode(){if(this._includeSelf){return this._startElement}return this._isForward?this._startElement.nextSibling:this._startElement.previousSibling}}function*ZU(t,e="forward"){const n=e=="forward";const i=[];let o=null;while(tW(t)){let e=null;if(o){const n=t.getAttribute("listIndent");const r=o.getAttribute("listIndent");if(n>r){i[r]=o}else if(nt.getAttribute("listIndent"))));const r=new Map;for(const t of n){r.set(t,QU.first(t,{lowerIndent:true}))}for(const t of n){if(i.has(t)){continue}i.add(t);const n=t.getAttribute("listIndent")-1;if(n<0){mW(t,e);continue}if(t.getAttribute("listIndent")==o){const n=wW(t,r.get(t),e);for(const t of n){i.add(t)}if(n.length){continue}}e.setAttribute("listIndent",n,t)}return pW(i)}function mW(t,e){t=ol(t);for(const n of t){if(n.is("element","listItem")){e.rename(n,"paragraph")}}for(const n of t){for(const t of n.getAttributeKeys()){if(t.startsWith("list")){e.removeAttribute(t,n)}}}return t}function gW(t){if(!t.length){return false}const e=t[0].getAttribute("listItemId");if(!e){return false}return!t.some((t=>t.getAttribute("listItemId")!=e))}function fW(t,e){const n=[];let i=Number.POSITIVE_INFINITY;for(const{node:o}of ZU(t.nextSibling,"forward")){const t=o.getAttribute("listIndent");if(t==0){break}if(tt.root.rootName!=="$graveyard")).sort(((t,e)=>t.index-e.index))}function bW(t){const e=t.document.selection.getSelectedElement();if(!e){return null}if(t.schema.isObject(e)&&t.schema.isBlock(e)){return e}return null}function kW(t,e){return e.checkChild(t.parent,"listItem")&&e.checkChild(t,"$text")&&!e.isObject(t)}function wW(t,e,n){const i=nW(e,{direction:"forward"});if(i.pop().index>t.index){return dW(t,e,n)}return[]}class AW extends wh{constructor(t,e){super(t);this._direction=e}refresh(){this.isEnabled=this._checkEnabled()}execute(){const t=this.editor.model;const e=CW(t.document.selection);t.change((t=>{const n=[];if(gW(e)&&!rW(e[0])){if(this._direction=="forward"){n.push(...uW(e,t))}n.push(...lW(e[0],t))}else{if(this._direction=="forward"){n.push(...uW(e,t,{expand:true}))}else{n.push(...hW(e,t))}}for(const e of n){if(!e.hasAttribute("listType")){continue}const n=QU.first(e,{sameIndent:true});if(n){t.setAttribute("listType",n.getAttribute("listType"),e)}}this._fireAfterExecute(n)}))}_fireAfterExecute(t){this.fire("afterExecute",pW(new Set(t)))}_checkEnabled(){let t=CW(this.editor.model.document.selection);let e=t[0];if(!e){return false}if(this._direction=="backward"){return true}if(gW(t)&&!rW(t[0])){return true}t=aW(t);e=t[0];const n=QU.first(e,{sameIndent:true});if(!n){return false}if(n.getAttribute("listType")==e.getAttribute("listType")){return true}return false}}function CW(t){const e=Array.from(t.getSelectedBlocks());const n=e.findIndex((t=>!tW(t)));if(n!=-1){e.length=n}return e}class _W extends wh{constructor(t,e){super(t);this.type=e}refresh(){this.value=this._getValue();this.isEnabled=this._checkEnabled()}execute(t={}){const e=this.editor.model;const n=e.document;const i=bW(e);const o=Array.from(n.selection.getSelectedBlocks()).filter((t=>e.schema.checkAttribute(t,"listType")||kW(t,e.schema)));const r=t.forceValue!==undefined?!t.forceValue:this.value;e.change((t=>{if(r){const e=o[o.length-1];const n=nW(e,{direction:"forward"});const i=[];if(n.length>1){i.push(...lW(n[1],t))}i.push(...mW(o,t));i.push(...fW(e,t));this._fireAfterExecute(i)}else if((i||n.selection.isCollapsed)&&tW(o[0])){const e=oW(i||o[0]);for(const n of e){t.setAttribute("listType",this.type,n)}this._fireAfterExecute(e)}else{const n=[];for(const i of o){if(!i.hasAttribute("listType")){if(!i.is("element","listItem")&&kW(i,e.schema)){t.rename(i,"listItem")}t.setAttributes({listIndent:0,listItemId:XU.next(),listType:this.type},i);n.push(i)}else{for(const e of aW(i,{withNested:false})){if(e.getAttribute("listType")!=this.type){t.setAttribute("listType",this.type,e);n.push(e)}}}}this._fireAfterExecute(n)}}))}_fireAfterExecute(t){this.fire("afterExecute",pW(new Set(t)))}_getValue(){const t=this.editor.model.document.selection;const e=Array.from(t.getSelectedBlocks());if(!e.length){return false}for(const t of e){if(t.getAttribute("listType")!=this.type){return false}}return true}_checkEnabled(){const t=this.editor.model;const e=t.schema;const n=t.document.selection;const i=Array.from(n.getSelectedBlocks());if(!i.length){return false}if(this.value){return true}for(const t of i){if(e.checkAttribute(t,"listType")||kW(t,e)){return true}}return false}}class vW extends wh{constructor(t,e){super(t);this._direction=e}refresh(){this.isEnabled=this._checkEnabled()}execute({shouldMergeOnBlocksContentLevel:t=false}={}){const e=this.editor.model;const n=e.document.selection;const i=[];e.change((o=>{const{firstElement:r,lastElement:s}=this._getMergeSubjectElements(n,t);const a=r.getAttribute("listIndent")||0;const c=s.getAttribute("listIndent");const l=s.getAttribute("listItemId");if(a!=c){const t=iW(s);i.push(...uW([s,...t],o,{indentBy:a-c,expand:a{const e=lW(this._getStartBlock(),t);this._fireAfterExecute(e)}))}_fireAfterExecute(t){this.fire("afterExecute",pW(new Set(t)))}_checkEnabled(){const t=this.editor.model.document.selection;const e=this._getStartBlock();return t.isCollapsed&&tW(e)&&!rW(e)}_getStartBlock(){const t=this.editor.model.document;const e=t.selection.getFirstPosition().parent;return this._direction=="before"?e:e.nextSibling}}class xW extends bh{static get pluginName(){return"ListUtils"}expandListBlocksToCompleteList(t){return cW(t)}isFirstBlockOfListItem(t){return rW(t)}isListItemBlock(t){return tW(t)}expandListBlocksToCompleteItems(t,e={}){return aW(t,e)}}function EW(t){return t.is("element","ol")||t.is("element","ul")}function DW(t){return t.is("element","li")}function TW(t){let e=0;let n=t.parent;while(n){if(DW(n)){e++}else{const t=n.previousSibling;if(t&&DW(t)){e++}}n=n.parent}return e}function SW(t,e,n,i=MW(n,e)){return t.createAttributeElement(BW(n),null,{priority:2*e/100-100,id:i})}function IW(t,e,n){return t.createAttributeElement("li",null,{priority:(2*e+1)/100-100,id:n})}function BW(t){return t=="numbered"?"ol":"ul"}function MW(t,e){return`list-${t}-${e}`}function LW(t,e){const n=t.nodeBefore;if(!tW(n)){const n=t.nodeAfter;if(tW(n)){e.set(n,n)}}else{let t=n;for(const{node:n}of ZU(t,"backward")){t=n;if(e.has(t)){return}}e.set(n,t)}}function NW(t,e){let n=0;let i=-1;let o=null;let r=false;for(const{node:s}of t){const t=s.getAttribute("listIndent");if(t>n){let a;if(o===null){o=t-n;a=n}else{if(o>t){o=t}a=t-o}if(a>i+1){a=i+1}e.setAttribute("listIndent",a,s);r=true;i=a}else{o=null;n=t+1;i=t}}return r}function PW(t,e,n){const i=new Set;let o=false;for(const{node:r}of t){if(i.has(r)){continue}let t=r.getAttribute("listType");let s=r.getAttribute("listItemId");if(e.has(s)){s=XU.next()}e.add(s);if(r.is("element","listItem")){if(r.getAttribute("listItemId")!=s){n.setAttribute("listItemId",s,r);o=true}continue}for(const e of nW(r,{direction:"forward"})){i.add(e);if(e.getAttribute("listType")!=t){s=XU.next();t=e.getAttribute("listType")}if(e.getAttribute("listItemId")!=s){n.setAttribute("listItemId",s,e);o=true}}}return o}function zW(){return(t,e,n)=>{const{writer:i,schema:o}=n;if(!e.modelRange){return}const r=Array.from(e.modelRange.getItems({shallow:true})).filter((t=>o.checkAttribute(t,"listItemId")));if(!r.length){return}const s=XU.next();const a=TW(e.viewItem);let c=e.viewItem.parent&&e.viewItem.parent.is("element","ol")?"numbered":"bulleted";const l=r[0].getAttribute("listType");if(l){c=l}const d={listItemId:s,listIndent:a,listType:c};for(const t of r){if(!t.hasAttribute("listItemId")){i.setAttributes(d,t)}}if(r.length>1){if(r[1].getAttribute("listItemId")!=d.listItemId){n.keepEmptyElement(r[0])}}}}function RW(){return(t,e,n)=>{if(!n.consumable.test(e.viewItem,{name:true})){return}const i=new w_(e.viewItem.document);for(const t of Array.from(e.viewItem.getChildren())){if(!DW(t)&&!EW(t)){i.remove(t)}}}}function VW(t,e,n,i){return()=>{const i=t.document.differ.getChanges();const s=[];const a=new Map;const c=new Set;for(const t of i){if(t.type=="insert"&&t.name!="$text"){LW(t.position,a);if(!t.attributes.has("listItemId")){LW(t.position.getShiftedBy(t.length),a)}else{c.add(t.position.nodeAfter)}}else if(t.type=="remove"&&t.attributes.has("listItemId")){LW(t.position,a)}else if(t.type=="attribute"){const e=t.range.start.nodeAfter;if(n.includes(t.attributeKey)){LW(t.range.start,a);if(t.attributeNewValue===null){LW(t.range.start.getShiftedBy(1),a);if(r(e)){s.push(e)}}else{c.add(e)}}else if(tW(e)){if(r(e)){s.push(e)}}}}for(const t of a.values()){s.push(...o(t,c))}for(const t of new Set(s)){e.reconvertItem(t)}};function o(t,e){const i=[];const o=new Set;const a=[];for(const{node:c,previous:l}of ZU(t,"forward")){if(o.has(c)){continue}const t=c.getAttribute("listIndent");if(l&&tn.includes(t))));const d=nW(c,{direction:"forward"});for(const t of d){o.add(t);if(r(t,d)){i.push(t)}else if(s(t,a,e)){i.push(t)}}}return i}function r(t,o){const r=e.mapper.toViewElement(t);if(!r){return false}const s=i.fire("checkElement",{modelElement:t,viewElement:r});if(s){return true}if(!t.is("element","paragraph")&&!t.is("element","listItem")){return false}const a=$W(t,n,o);if(a&&r.is("element","p")){return true}else if(!a&&r.is("element","span")){return true}return false}function s(t,n,o){if(o.has(t)){return false}const r=e.mapper.toViewElement(t);let s=n.length-1;for(let t=r.parent;!t.is("editableElement");t=t.parent){const e=DW(t);const o=EW(t);if(!o&&!e){continue}const r=`checkAttributes:${e?"item":"list"}`;const a=i.fire(r,{viewElement:t,modelAttributes:n[s]});if(a){break}if(o){s--;if(s<0){return false}}}return true}}function OW(t,e,n,{dataPipeline:i}={}){const o=qW(t);return(r,s,a)=>{const{writer:c,mapper:l,consumable:d}=a;const u=s.item;if(!t.includes(s.attributeKey)){return}if(!o(u,d)){return}const h=jW(u,l,n);HW(h,c,l);WW(h,c);const m=UW(u,h,e,c,{dataPipeline:i});GW(u,m,e,c)}}function FW(t,{dataPipeline:e}={}){return(n,{writer:i})=>{if(!$W(n,t)){return null}if(!e){return i.createContainerElement("span",{class:"ck-list-bogus-paragraph"})}const o=i.createContainerElement("p");i.setCustomProperty("dataPipeline:transparentRendering",true,o);return o}}function jW(t,e,n){const i=n.createRangeOn(t);const o=e.toViewRange(i).getTrimmed();return o.end.nodeBefore}function HW(t,e,n){while(t.parent.is("attributeElement")&&t.parent.getCustomProperty("listItemWrapper")){e.unwrap(e.createRangeIn(t.parent),t.parent)}const i=e.createPositionBefore(t).getWalker({direction:"backward"});const o=[];for(const{item:t}of i){if(t.is("element")&&n.toModelElement(t)){break}if(t.is("element")&&t.getCustomProperty("listItemMarker")){o.push(t)}}for(const t of o){e.remove(t)}}function UW(t,e,n,i,{dataPipeline:o}){let r=i.createRangeOn(e);if(!rW(t)){return r}for(const s of n){if(s.scope!="itemMarker"){continue}const n=s.createElement(i,t,{dataPipeline:o});if(!n){continue}i.setCustomProperty("listItemMarker",true,n);i.insert(r.start,n);r=i.createRange(i.createPositionBefore(n),i.createPositionAfter(e));if(!s.createWrapperElement||!s.canWrapElement){continue}const a=s.createWrapperElement(i,t,{dataPipeline:o});i.setCustomProperty("listItemWrapper",true,a);if(s.canWrapElement(t)){r=i.wrap(r,a)}else{r=i.wrap(i.createRangeOn(n),a);r=i.createRange(r.start,i.createPositionAfter(e))}}return r}function WW(t,e){let n=t.parent;while(n.is("attributeElement")&&["ul","ol","li"].includes(n.name)){const i=n.parent;e.unwrap(e.createRangeOn(t),n);n=i}}function GW(t,e,n,i){if(!t.hasAttribute("listIndent")){return}const o=t.getAttribute("listIndent");let r=t;for(let t=o;t>=0;t--){const o=IW(i,t,r.getAttribute("listItemId"));const s=SW(i,t,r.getAttribute("listType"));for(const t of n){if((t.scope=="list"||t.scope=="item")&&r.hasAttribute(t.attributeName)){t.setAttributeOnDowncast(i,r.getAttribute(t.attributeName),t.scope=="list"?s:o)}}e=i.wrap(e,o);e=i.wrap(e,s);if(t==0){break}r=QU.first(r,{lowerIndent:true});if(!r){break}}}function qW(t){return(e,n)=>{const i=[];for(const n of t){if(e.hasAttribute(n)){i.push(`attribute:${n}`)}}if(!i.every((t=>n.test(e,t)!==false))){return false}i.forEach((t=>n.consume(e,t)));return true}}function $W(t,e,n=eW(t)){if(!tW(t)){return false}for(const n of t.getAttributeKeys()){if(n.startsWith("selection:")){continue}if(!e.includes(n)){return false}}return n.length<2}var KW=n(9224);var YW={injectType:"singletonStyleTag",attributes:{"data-cke":true}};YW.insert="head";YW.singleton=true;var QW=Pl()(KW.c,YW);const ZW=KW.c.locals||{};var JW=n(6532);var XW={injectType:"singletonStyleTag",attributes:{"data-cke":true}};XW.insert="head";XW.singleton=true;var tG=Pl()(JW.c,XW);const eG=JW.c.locals||{};const nG=["listType","listIndent","listItemId"];class iG extends bh{static get pluginName(){return"ListEditing"}static get requires(){return[oM,LI,xW,IM]}constructor(t){super(t);this._downcastStrategies=[];t.config.define("list.multiBlock",true)}init(){const t=this.editor;const e=t.model;const n=t.config.get("list.multiBlock");if(t.plugins.has("LegacyListEditing")){throw new N("list-feature-conflict",this,{conflictPlugin:"LegacyListEditing"})}e.schema.register("$listItem",{allowAttributes:nG});if(n){e.schema.extend("$container",{allowAttributesOf:"$listItem"});e.schema.extend("$block",{allowAttributesOf:"$listItem"});e.schema.extend("$blockObject",{allowAttributesOf:"$listItem"})}else{e.schema.register("listItem",{inheritAllFrom:"$block",allowAttributesOf:"$listItem"})}for(const t of nG){e.schema.setAttributeProperties(t,{copyOnReplace:true})}t.commands.add("numberedList",new _W(t,"numbered"));t.commands.add("bulletedList",new _W(t,"bulleted"));t.commands.add("indentList",new AW(t,"forward"));t.commands.add("outdentList",new AW(t,"backward"));t.commands.add("splitListItemBefore",new yW(t,"before"));t.commands.add("splitListItemAfter",new yW(t,"after"));if(n){t.commands.add("mergeListItemBackward",new vW(t,"backward"));t.commands.add("mergeListItemForward",new vW(t,"forward"))}this._setupDeleteIntegration();this._setupEnterIntegration();this._setupTabIntegration();this._setupClipboardIntegration()}afterInit(){const t=this.editor;const e=t.commands;const n=e.get("indent");const i=e.get("outdent");if(n){n.registerChildCommand(e.get("indentList"),{priority:"high"})}if(i){i.registerChildCommand(e.get("outdentList"),{priority:"lowest"})}this._setupModelPostFixing();this._setupConversion()}registerDowncastStrategy(t){this._downcastStrategies.push(t)}getListAttributeNames(){return[...nG,...this._downcastStrategies.map((t=>t.attributeName))]}_setupDeleteIntegration(){const t=this.editor;const e=t.commands.get("mergeListItemBackward");const n=t.commands.get("mergeListItemForward");this.listenTo(t.editing.view.document,"delete",((i,o)=>{const r=t.model.document.selection;if(bW(t.model)){return}t.model.change((()=>{const s=r.getFirstPosition();if(r.isCollapsed&&o.direction=="backward"){if(!s.isAtStart){return}const n=s.parent;if(!tW(n)){return}const r=QU.first(n,{sameAttributes:"listType",sameIndent:true});if(!r&&n.getAttribute("listIndent")===0){if(!sW(n)){t.execute("splitListItemAfter")}t.execute("outdentList")}else{if(!e||!e.isEnabled){return}e.execute({shouldMergeOnBlocksContentLevel:sG(t.model,"backward")})}o.preventDefault();i.stop()}else{if(r.isCollapsed&&!r.getLastPosition().isAtEnd){return}if(!n||!n.isEnabled){return}n.execute({shouldMergeOnBlocksContentLevel:sG(t.model,"forward")});o.preventDefault();i.stop()}}))}),{context:"li"})}_setupEnterIntegration(){const t=this.editor;const e=t.model;const n=t.commands;const i=n.get("enter");this.listenTo(t.editing.view.document,"enter",((n,i)=>{const o=e.document;const r=o.selection.getFirstPosition().parent;if(o.selection.isCollapsed&&tW(r)&&r.isEmpty&&!i.isSoft){const e=rW(r);const o=sW(r);if(e&&o){t.execute("outdentList");i.preventDefault();n.stop()}else if(e&&!o){t.execute("splitListItemAfter");i.preventDefault();n.stop()}else if(o){t.execute("splitListItemBefore");i.preventDefault();n.stop()}}}),{context:"li"});this.listenTo(i,"afterExecute",(()=>{const e=n.get("splitListItemBefore");e.refresh();if(!e.isEnabled){return}const i=t.model.document;const o=i.selection.getLastPosition().parent;const r=eW(o);if(r.length===2){e.execute()}}))}_setupTabIntegration(){const t=this.editor;this.listenTo(t.editing.view.document,"tab",((e,n)=>{const i=n.shiftKey?"outdentList":"indentList";const o=this.editor.commands.get(i);if(o.isEnabled){t.execute(i);n.stopPropagation();n.preventDefault();e.stop()}}),{context:"li"})}_setupConversion(){const t=this.editor;const e=t.model;const n=this.getListAttributeNames();const i=t.config.get("list.multiBlock");const o=i?"paragraph":"listItem";t.conversion.for("upcast").elementToElement({view:"li",model:(t,{writer:e})=>e.createElement(o,{listType:""})}).elementToElement({view:"p",model:(t,{writer:e})=>{if(t.parent&&t.parent.is("element","li")){return e.createElement(o,{listType:""})}return null},converterPriority:"high"}).add((t=>{t.on("element:li",zW());t.on("element:ul",RW(),{priority:"high"});t.on("element:ol",RW(),{priority:"high"})}));if(!i){t.conversion.for("downcast").elementToElement({model:"listItem",view:"p"})}t.conversion.for("editingDowncast").elementToElement({model:o,view:FW(n),converterPriority:"high"}).add((t=>{t.on("attribute",OW(n,this._downcastStrategies,e))}));t.conversion.for("dataDowncast").elementToElement({model:o,view:FW(n,{dataPipeline:true}),converterPriority:"high"}).add((t=>{t.on("attribute",OW(n,this._downcastStrategies,e,{dataPipeline:true}))}));this.listenTo(e.document,"change:data",VW(e,t.editing,n,this),{priority:"high"});this.on("checkAttributes:item",((t,{viewElement:e,modelAttributes:n})=>{if(e.id!=n.listItemId){t.return=true;t.stop()}}));this.on("checkAttributes:list",((t,{viewElement:e,modelAttributes:n})=>{if(e.name!=BW(n.listType)||e.id!=MW(n.listType,n.listIndent)){t.return=true;t.stop()}}))}_setupModelPostFixing(){const t=this.editor.model;const e=this.getListAttributeNames();t.document.registerPostFixer((n=>oG(t,n,e,this)));this.on("postFixer",((t,{listNodes:e,writer:n})=>{t.return=NW(e,n)||t.return}),{priority:"high"});this.on("postFixer",((t,{listNodes:e,writer:n,seenIds:i})=>{t.return=PW(e,i,n)||t.return}),{priority:"high"})}_setupClipboardIntegration(){const t=this.editor.model;const e=this.editor.plugins.get("ClipboardPipeline");this.listenTo(t,"insertContent",rG(t),{priority:"high"});this.listenTo(e,"outputTransformation",((e,n)=>{t.change((t=>{const e=Array.from(n.content.getChildren());const i=e[e.length-1];if(e.length>1&&i.is("element")&&i.isEmpty){const n=e.slice(0,-1);if(n.every(tW)){t.remove(i)}}if(n.method=="copy"||n.method=="cut"){const e=Array.from(n.content.getChildren());const i=gW(e);if(i){mW(e,t)}}}))}))}}function oG(t,e,n,i){const o=t.document.differ.getChanges();const r=new Map;const s=i.editor.config.get("list.multiBlock");let a=false;for(const i of o){if(i.type=="insert"&&i.name!="$text"){const o=i.position.nodeAfter;if(!t.schema.checkAttribute(o,"listItemId")){for(const t of Array.from(o.getAttributeKeys())){if(n.includes(t)){e.removeAttribute(t,o);a=true}}}LW(i.position,r);if(!i.attributes.has("listItemId")){LW(i.position.getShiftedBy(i.length),r)}for(const{item:e,previousPosition:n}of t.createRangeIn(o)){if(tW(e)){LW(n,r)}}}else if(i.type=="remove"){LW(i.position,r)}else if(i.type=="attribute"&&n.includes(i.attributeKey)){LW(i.range.start,r);if(i.attributeNewValue===null){LW(i.range.start.getShiftedBy(1),r)}}if(!s&&i.type=="attribute"&&nG.includes(i.attributeKey)){const t=i.range.start.nodeAfter;if(i.attributeNewValue===null&&t&&t.is("element","listItem")){e.rename(t,"paragraph");a=true}else if(i.attributeOldValue===null&&t&&t.is("element")&&t.name!="listItem"){e.rename(t,"listItem");a=true}}}const c=new Set;for(const t of r.values()){a=i.fire("postFixer",{listNodes:new JU(t),listHead:t,writer:e,seenIds:c})||a}return a}function rG(t){return(e,[n,i])=>{const o=n.is("documentFragment")?Array.from(n.getChildren()):[n];if(!o.length){return}const r=i?t.createSelection(i):t.document.selection;const s=r.getFirstPosition();let a;if(tW(s.parent)){a=s.parent}else if(tW(s.nodeBefore)){a=s.nodeBefore}else{return}t.change((t=>{const e=a.getAttribute("listType");const n=a.getAttribute("listIndent");const i=o[0].getAttribute("listIndent")||0;const r=Math.max(n-i,0);for(const n of o){const i=tW(n);if(a.is("element","listItem")&&n.is("element","paragraph")){t.rename(n,"listItem")}t.setAttributes({listIndent:(i?n.getAttribute("listIndent"):0)+r,listItemId:i?n.getAttribute("listItemId"):XU.next(),listType:e},n)}}))}}function sG(t,e){const n=t.document.selection;if(!n.isCollapsed){return!bW(t)}if(e==="forward"){return true}const i=n.getFirstPosition();const o=i.parent;const r=o.previousSibling;if(t.schema.isObject(r)){return false}if(r.isEmpty){return true}return gW([o,r])}function aG(t,e,n,i){t.ui.componentFactory.add(e,(o=>{const r=t.commands.get(e);const s=new Dd(o);s.set({label:n,icon:i,tooltip:true,isToggleable:true});s.bind("isOn","isEnabled").to(r,"value","isEnabled");s.on("execute",(()=>{t.execute(e);t.editing.view.focus()}));return s}))}class cG extends bh{static get pluginName(){return"ListUI"}init(){const t=this.editor.t;aG(this.editor,"numberedList",t("Numbered List"),Ty.numberedList);aG(this.editor,"bulletedList",t("Bulleted List"),Ty.bulletedList)}}class lG extends bh{static get requires(){return[iG,cG]}static get pluginName(){return"List"}}class dG extends wh{refresh(){const t=this._getValue();this.value=t;this.isEnabled=t!=null}execute({startIndex:t=1}={}){const e=this.editor.model;const n=e.document;let i=Array.from(n.selection.getSelectedBlocks()).filter((t=>tW(t)&&t.getAttribute("listType")=="numbered"));i=cW(i);e.change((e=>{for(const n of i){e.setAttribute("listStart",t>=0?t:1,n)}}))}_getValue(){const t=this.editor.model;const e=t.document;const n=fl(e.selection.getSelectedBlocks());if(n&&tW(n)&&n.getAttribute("listType")=="numbered"){return n.getAttribute("listStart")}return null}}const uG={};const hG={};const mG={};const gG=[{listStyle:"disc",typeAttribute:"disc",listType:"bulleted"},{listStyle:"circle",typeAttribute:"circle",listType:"bulleted"},{listStyle:"square",typeAttribute:"square",listType:"bulleted"},{listStyle:"decimal",typeAttribute:"1",listType:"numbered"},{listStyle:"decimal-leading-zero",typeAttribute:null,listType:"numbered"},{listStyle:"lower-roman",typeAttribute:"i",listType:"numbered"},{listStyle:"upper-roman",typeAttribute:"I",listType:"numbered"},{listStyle:"lower-alpha",typeAttribute:"a",listType:"numbered"},{listStyle:"upper-alpha",typeAttribute:"A",listType:"numbered"},{listStyle:"lower-latin",typeAttribute:"a",listType:"numbered"},{listStyle:"upper-latin",typeAttribute:"A",listType:"numbered"}];for(const{listStyle:t,typeAttribute:e,listType:n}of gG){uG[t]=n;hG[t]=e;if(e){mG[e]=t}}function fG(){return gG.map((t=>t.listStyle))}function pG(t){return uG[t]||null}function bG(t){return mG[t]||null}function kG(t){return hG[t]||null}class wG extends wh{constructor(t,e,n){super(t);this.defaultType=e;this._supportedTypes=n}refresh(){this.value=this._getValue();this.isEnabled=this._checkEnabled()}execute(t={}){const e=this.editor.model;const n=e.document;e.change((e=>{this._tryToConvertItemsToList(t);let i=Array.from(n.selection.getSelectedBlocks()).filter((t=>t.hasAttribute("listType")));if(!i.length){return}i=cW(i);for(const n of i){e.setAttribute("listStyle",t.type||this.defaultType,n)}}))}isStyleTypeSupported(t){if(!this._supportedTypes){return true}return this._supportedTypes.includes(t)}_getValue(){const t=fl(this.editor.model.document.selection.getSelectedBlocks());if(tW(t)){return t.getAttribute("listStyle")}return null}_checkEnabled(){const t=this.editor;const e=t.commands.get("numberedList");const n=t.commands.get("bulletedList");return e.isEnabled||n.isEnabled}_tryToConvertItemsToList(t){if(!t.type){return}const e=pG(t.type);if(!e){return}const n=this.editor;const i=`${e}List`;const o=n.commands.get(i);if(!o.value){n.execute(i)}}}class AG extends wh{refresh(){const t=this._getValue();this.value=t;this.isEnabled=t!=null}execute(t={}){const e=this.editor.model;const n=e.document;let i=Array.from(n.selection.getSelectedBlocks()).filter((t=>tW(t)&&t.getAttribute("listType")=="numbered"));i=cW(i);e.change((e=>{for(const n of i){e.setAttribute("listReversed",!!t.reversed,n)}}))}_getValue(){const t=this.editor.model;const e=t.document;const n=fl(e.selection.getSelectedBlocks());if(tW(n)&&n.getAttribute("listType")=="numbered"){return n.getAttribute("listReversed")}return null}}function CG(t){return(e,n,i)=>{const{writer:o,schema:r,consumable:s}=i;if(s.test(n.viewItem,t.viewConsumables)===false){return}if(!n.modelRange){Object.assign(n,i.convertChildren(n.viewItem,n.modelCursor))}let a=false;for(const e of n.modelRange.getItems({shallow:true})){if(!r.checkAttribute(e,t.attributeName)){continue}if(!t.appliesToListItem(e)){continue}if(e.hasAttribute(t.attributeName)){continue}o.setAttribute(t.attributeName,t.getAttributeOnUpcast(n.viewItem),e);a=true}if(a){s.consume(n.viewItem,t.viewConsumables)}}}class _G extends bh{static get pluginName(){return"ListPropertiesUtils"}getAllSupportedStyleTypes(){return fG()}getListTypeFromListStyleType(t){return pG(t)}getListStyleTypeFromTypeAttribute(t){return bG(t)}getTypeAttributeFromListStyleType(t){return kG(t)}}const vG="default";class yG extends bh{static get requires(){return[iG,_G]}static get pluginName(){return"ListPropertiesEditing"}constructor(t){super(t);t.config.define("list.properties",{styles:true,startIndex:false,reversed:false})}init(){const t=this.editor;const e=t.model;const n=t.plugins.get(iG);const i=t.config.get("list.properties");const o=xG(i);for(const i of o){i.addCommand(t);e.schema.extend("$listItem",{allowAttributes:i.attributeName});n.registerDowncastStrategy({scope:"list",attributeName:i.attributeName,setAttributeOnDowncast(t,e,n){i.setAttributeOnDowncast(t,e,n)}})}t.conversion.for("upcast").add((t=>{for(const e of o){t.on("element:ol",CG(e));t.on("element:ul",CG(e))}}));n.on("checkAttributes:list",((t,{viewElement:e,modelAttributes:n})=>{for(const i of o){if(i.getAttributeOnUpcast(e)!=n[i.attributeName]){t.return=true;t.stop()}}}));this.listenTo(t.commands.get("indentList"),"afterExecute",((t,n)=>{e.change((t=>{for(const e of n){for(const n of o){if(n.appliesToListItem(e)){t.setAttribute(n.attributeName,n.defaultValue,e)}}}}))}));n.on("postFixer",((t,{listNodes:e,writer:n})=>{for(const{node:i}of e){for(const e of o){if(e.hasValidAttribute(i)){continue}if(e.appliesToListItem(i)){n.setAttribute(e.attributeName,e.defaultValue,i)}else{n.removeAttribute(e.attributeName,i)}t.return=true}}}));n.on("postFixer",((t,{listNodes:e,writer:n})=>{for(const{node:i,previousNodeInList:r}of e){if(!r){continue}if(r.getAttribute("listType")!=i.getAttribute("listType")){continue}for(const e of o){const{attributeName:o}=e;if(!e.appliesToListItem(i)){continue}const s=r.getAttribute(o);if(i.getAttribute(o)!=s){n.setAttribute(o,s,i);t.return=true}}}}))}}function xG(t){const e=[];if(t.styles){const n=typeof t.styles=="object"&&t.styles.useAttribute;e.push({attributeName:"listStyle",defaultValue:vG,viewConsumables:{styles:"list-style-type"},addCommand(t){let e=fG();if(n){e=e.filter((t=>!!kG(t)))}t.commands.add("listStyle",new wG(t,vG,e))},appliesToListItem(t){return t.getAttribute("listType")=="numbered"||t.getAttribute("listType")=="bulleted"},hasValidAttribute(t){if(!this.appliesToListItem(t)){return!t.hasAttribute("listStyle")}if(!t.hasAttribute("listStyle")){return false}const e=t.getAttribute("listStyle");if(e==vG){return true}return pG(e)==t.getAttribute("listType")},setAttributeOnDowncast(t,e,i){if(e&&e!==vG){if(n){const n=kG(e);if(n){t.setAttribute("type",n,i);return}}else{t.setStyle("list-style-type",e,i);return}}t.removeStyle("list-style-type",i);t.removeAttribute("type",i)},getAttributeOnUpcast(t){const e=t.getStyle("list-style-type");if(e){return e}const n=t.getAttribute("type");if(n){return bG(n)}return vG}})}if(t.reversed){e.push({attributeName:"listReversed",defaultValue:false,viewConsumables:{attributes:"reversed"},addCommand(t){t.commands.add("listReversed",new AG(t))},appliesToListItem(t){return t.getAttribute("listType")=="numbered"},hasValidAttribute(t){return this.appliesToListItem(t)==t.hasAttribute("listReversed")},setAttributeOnDowncast(t,e,n){if(e){t.setAttribute("reversed","reversed",n)}else{t.removeAttribute("reversed",n)}},getAttributeOnUpcast(t){return t.hasAttribute("reversed")}})}if(t.startIndex){e.push({attributeName:"listStart",defaultValue:1,viewConsumables:{attributes:"start"},addCommand(t){t.commands.add("listStart",new dG(t))},appliesToListItem(t){return t.getAttribute("listType")=="numbered"},hasValidAttribute(t){return this.appliesToListItem(t)==t.hasAttribute("listStart")},setAttributeOnDowncast(t,e,n){if(e==0||e>1){t.setAttribute("start",e,n)}else{t.removeAttribute("start",n)}},getAttributeOnUpcast(t){const e=t.getAttribute("start");return e>=0?e:1}})}return e}var EG=n(7672);var DG={injectType:"singletonStyleTag",attributes:{"data-cke":true}};DG.insert="head";DG.singleton=true;var TG=Pl()(EG.c,DG);const SG=EG.c.locals||{};class IG extends Fl{constructor(t,{enabledProperties:e,styleButtonViews:n,styleGridAriaLabel:i}){super(t);this.stylesView=null;this.additionalPropertiesCollapsibleView=null;this.startIndexFieldView=null;this.reversedSwitchButtonView=null;this.focusTracker=new pl;this.keystrokes=new bl;this.focusables=new Ml;const o=["ck","ck-list-properties"];this.children=this.createCollection();this.focusCycler=new lh({focusables:this.focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});if(e.styles){this.stylesView=this._createStylesView(n,i);this.children.add(this.stylesView)}else{o.push("ck-list-properties_without-styles")}if(e.startIndex||e.reversed){this._addNumberedListPropertyViews(e);o.push("ck-list-properties_with-numbered-properties")}this.setTemplate({tag:"div",attributes:{class:o},children:this.children})}render(){super.render();if(this.stylesView){this.focusables.add(this.stylesView);this.focusTracker.add(this.stylesView.element);if(this.startIndexFieldView||this.reversedSwitchButtonView){this.focusables.add(this.children.last.buttonView);this.focusTracker.add(this.children.last.buttonView.element)}for(const t of this.stylesView.children){this.stylesView.focusTracker.add(t.element)}r({keystrokeHandler:this.stylesView.keystrokes,focusTracker:this.stylesView.focusTracker,gridItems:this.stylesView.children,numberOfColumns:()=>nc.window.getComputedStyle(this.stylesView.element).getPropertyValue("grid-template-columns").split(" ").length,uiLanguageDirection:this.locale&&this.locale.uiLanguageDirection})}if(this.startIndexFieldView){this.focusables.add(this.startIndexFieldView);this.focusTracker.add(this.startIndexFieldView.element);const t=t=>t.stopPropagation();this.keystrokes.set("arrowright",t);this.keystrokes.set("arrowleft",t);this.keystrokes.set("arrowup",t);this.keystrokes.set("arrowdown",t)}if(this.reversedSwitchButtonView){this.focusables.add(this.reversedSwitchButtonView);this.focusTracker.add(this.reversedSwitchButtonView.element)}this.keystrokes.listenTo(this.element)}focus(){this.focusCycler.focusFirst()}focusLast(){this.focusCycler.focusLast()}destroy(){super.destroy();this.focusTracker.destroy();this.keystrokes.destroy()}_createStylesView(t,e){const n=new Fl(this.locale);n.children=n.createCollection();n.children.addMany(t);n.setTemplate({tag:"div",attributes:{"aria-label":e,class:["ck","ck-list-styles-list"]},children:n.children});n.children.delegate("execute").to(this);n.focus=function(){this.children.first.focus()};n.focusTracker=new pl;n.keystrokes=new bl;n.render();n.keystrokes.listenTo(n.element);return n}_addNumberedListPropertyViews(t){const e=this.locale.t;const n=[];if(t.startIndex){this.startIndexFieldView=this._createStartIndexField();n.push(this.startIndexFieldView)}if(t.reversed){this.reversedSwitchButtonView=this._createReversedSwitchButton();n.push(this.reversedSwitchButtonView)}if(t.styles){this.additionalPropertiesCollapsibleView=new Vd(this.locale,n);this.additionalPropertiesCollapsibleView.set({label:e("List properties"),isCollapsed:true});this.additionalPropertiesCollapsibleView.buttonView.bind("isEnabled").toMany(n,"isEnabled",((...t)=>t.some((t=>t))));this.additionalPropertiesCollapsibleView.buttonView.on("change:isEnabled",((t,e,n)=>{if(!n){this.additionalPropertiesCollapsibleView.isCollapsed=true}}));this.children.add(this.additionalPropertiesCollapsibleView)}else{this.children.addMany(n)}}_createStartIndexField(){const t=this.locale.t;const e=new Ou(this.locale,Cx);e.set({label:t("Start at"),class:"ck-numbered-list-properties__start-index"});e.fieldView.set({min:0,step:1,value:1,inputMode:"numeric"});e.fieldView.on("input",(()=>{const n=e.fieldView.element;const i=n.valueAsNumber;if(Number.isNaN(i)){return}if(!n.checkValidity()){e.errorText=t("Start index must be greater than 0.")}else{this.fire("listStart",{startIndex:i})}}));return e}_createReversedSwitchButton(){const t=this.locale.t;const e=new Md(this.locale);e.set({withText:true,label:t("Reversed order"),class:"ck-numbered-list-properties__reversed-order"});e.delegate("execute").to(this,"listReversed");return e}}const BG=' ';const MG=' ';const LG=' ';const NG=' ';const PG=' ';const zG=' ';const RG=' ';const VG=' ';const OG=' ';var FG=n(784);var jG={injectType:"singletonStyleTag",attributes:{"data-cke":true}};jG.insert="head";jG.singleton=true;var HG=Pl()(FG.c,jG);const UG=FG.c.locals||{};class WG extends bh{static get pluginName(){return"ListPropertiesUI"}init(){const t=this.editor;const e=t.locale.t;const n=t.config.get("list.properties");if(n.styles){t.ui.componentFactory.add("bulletedList",GG({editor:t,parentCommandName:"bulletedList",buttonLabel:e("Bulleted List"),buttonIcon:Ty.bulletedList,styleGridAriaLabel:e("Bulleted list styles toolbar"),styleDefinitions:[{label:e("Toggle the disc list style"),tooltip:e("Disc"),type:"disc",icon:BG},{label:e("Toggle the circle list style"),tooltip:e("Circle"),type:"circle",icon:MG},{label:e("Toggle the square list style"),tooltip:e("Square"),type:"square",icon:LG}]}))}if(n.styles||n.startIndex||n.reversed){t.ui.componentFactory.add("numberedList",GG({editor:t,parentCommandName:"numberedList",buttonLabel:e("Numbered List"),buttonIcon:Ty.numberedList,styleGridAriaLabel:e("Numbered list styles toolbar"),styleDefinitions:[{label:e("Toggle the decimal list style"),tooltip:e("Decimal"),type:"decimal",icon:NG},{label:e("Toggle the decimal with leading zero list style"),tooltip:e("Decimal with leading zero"),type:"decimal-leading-zero",icon:PG},{label:e("Toggle the lower–roman list style"),tooltip:e("Lower–roman"),type:"lower-roman",icon:zG},{label:e("Toggle the upper–roman list style"),tooltip:e("Upper-roman"),type:"upper-roman",icon:RG},{label:e("Toggle the lower–latin list style"),tooltip:e("Lower-latin"),type:"lower-latin",icon:VG},{label:e("Toggle the upper–latin list style"),tooltip:e("Upper-latin"),type:"upper-latin",icon:OG}]}))}}}function GG({editor:t,parentCommandName:e,buttonLabel:n,buttonIcon:i,styleGridAriaLabel:o,styleDefinitions:r}){const s=t.commands.get(e);return a=>{const c=sx(a,Zy);const l=c.buttonView;c.bind("isEnabled").to(s);c.class="ck-list-styles-dropdown";l.on("execute",(()=>{t.execute(e);t.editing.view.focus()}));l.set({label:n,icon:i,tooltip:true,isToggleable:true});l.bind("isOn").to(s,"value",(t=>!!t));c.once("change:isOpen",(()=>{const n=$G({editor:t,dropdownView:c,parentCommandName:e,styleGridAriaLabel:o,styleDefinitions:r});c.panelView.children.add(n)}));c.on("execute",(()=>{t.editing.view.focus()}));return c}}function qG({editor:t,listStyleCommand:e,parentCommandName:n}){const i=t.locale;const o=t.commands.get(n);return({label:n,type:r,icon:s,tooltip:a})=>{const c=new Dd(i);c.set({label:n,icon:s,tooltip:a});e.on("change:value",(()=>{c.isOn=e.value===r}));c.on("execute",(()=>{if(o.value){if(e.value!==r){t.execute("listStyle",{type:r})}else{t.execute("listStyle",{type:e.defaultType})}}else{t.model.change((()=>{t.execute("listStyle",{type:r})}))}}));return c}}function $G({editor:t,dropdownView:e,parentCommandName:n,styleDefinitions:i,styleGridAriaLabel:o}){const r=t.locale;const s=t.config.get("list.properties");let a=null;if(n!="numberedList"){s.startIndex=false;s.reversed=false}if(s.styles){const e=t.commands.get("listStyle");const o=qG({editor:t,parentCommandName:n,listStyleCommand:e});const r=typeof e.isStyleTypeSupported=="function"?t=>e.isStyleTypeSupported(t.type):()=>true;a=i.filter(r).map(o)}const c=new IG(r,{styleGridAriaLabel:o,enabledProperties:s,styleButtonViews:a});if(s.styles){ux(e,(()=>c.stylesView.children.find((t=>t.isOn))))}if(s.startIndex){const e=t.commands.get("listStart");c.startIndexFieldView.bind("isEnabled").to(e);c.startIndexFieldView.fieldView.bind("value").to(e);c.on("listStart",((e,n)=>t.execute("listStart",n)))}if(s.reversed){const e=t.commands.get("listReversed");c.reversedSwitchButtonView.bind("isEnabled").to(e);c.reversedSwitchButtonView.bind("isOn").to(e,"value",(t=>!!t));c.on("listReversed",(()=>{const n=e.value;t.execute("listReversed",{reversed:!n})}))}c.delegate("execute").to(e);return c}class KG extends bh{static get requires(){return[yG,WG]}static get pluginName(){return"ListProperties"}}class YG extends wh{constructor(t){super(t);this.on("execute",(()=>{this.refresh()}),{priority:"highest"})}refresh(){const t=this._getSelectedItems();this.value=this._getValue(t);this.isEnabled=!!t.length}execute(t={}){this.editor.model.change((e=>{const n=this._getSelectedItems();const i=t.forceValue===undefined?!this._getValue(n):t.forceValue;for(const t of n){if(i){e.setAttribute("todoListChecked",true,t)}else{e.removeAttribute("todoListChecked",t)}}}))}_getValue(t){return t.every((t=>t.getAttribute("todoListChecked")))}_getSelectedItems(){const t=this.editor.model;const e=t.schema;const n=t.document.selection.getFirstRange();const i=n.start.parent;const o=[];if(e.checkAttribute(i,"todoListChecked")){o.push(...eW(i))}for(const t of n.getItems({shallow:true})){if(e.checkAttribute(t,"todoListChecked")&&!o.includes(t)){o.push(...eW(t))}}return o}}class QG extends Ep{constructor(){super(...arguments);this.domEventType=["change"]}onDomEvent(t){if(t.target){const e=this.view.domConverter.mapDomToView(t.target);if(e&&e.is("element","input")&&e.getAttribute("type")=="checkbox"&&e.findAncestor({classes:"todo-list__label"})){this.fire("todoCheckboxChange",t)}}}}const ZG=Qc("Ctrl+Enter");class JG extends bh{static get pluginName(){return"TodoListEditing"}static get requires(){return[iG]}init(){const t=this.editor;const e=t.model;const n=t.editing;const i=t.plugins.get(iG);const o=t.config.get("list.multiBlock");const r=o?"paragraph":"listItem";t.commands.add("todoList",new _W(t,"todo"));t.commands.add("checkTodoList",new YG(t));n.view.addObserver(QG);e.schema.extend("$listItem",{allowAttributes:"todoListChecked"});e.schema.addAttributeCheck(((t,e)=>{const n=t.last;if(e!="todoListChecked"){return}if(!n.getAttribute("listItemId")||n.getAttribute("listType")!="todo"){return false}}));t.conversion.for("upcast").add((t=>{t.on("element:input",XG());t.on("element:label",tq({name:"label",classes:"todo-list__label"}));t.on("element:label",tq({name:"label",classes:["todo-list__label","todo-list__label_without-description"]}));t.on("element:span",tq({name:"span",classes:"todo-list__label__description"}));t.on("element:ul",eq({name:"ul",classes:"todo-list"}))}));t.conversion.for("downcast").elementToElement({model:r,view:(t,{writer:e})=>{if(nq(t,i.getListAttributeNames())){return e.createContainerElement("span",{class:"todo-list__label__description"})}},converterPriority:"highest"});i.registerDowncastStrategy({scope:"list",attributeName:"listType",setAttributeOnDowncast(t,e,n){if(e=="todo"){t.addClass("todo-list",n)}else{t.removeClass("todo-list",n)}}});i.registerDowncastStrategy({scope:"itemMarker",attributeName:"todoListChecked",createElement(t,e,{dataPipeline:n}){if(e.getAttribute("listType")!="todo"){return null}const i=t.createEmptyElement("input",{type:"checkbox",...e.getAttribute("todoListChecked")?{checked:"checked"}:null,...n?{disabled:"disabled"}:{tabindex:"-1"}});if(n){return i}return t.createContainerElement("span",{contenteditable:"false"},i)},canWrapElement(t){return nq(t,i.getListAttributeNames())},createWrapperElement(t,e,{dataPipeline:n}){const o=["todo-list__label"];if(!nq(e,i.getListAttributeNames())){o.push("todo-list__label_without-description")}return t.createAttributeElement(n?"label":"span",{class:o.join(" ")})}});n.mapper.registerViewToModelLength("input",(t=>{if(t.getAttribute("type")=="checkbox"&&t.findAncestor({classes:"todo-list__label"})){return 0}return n.mapper.toModelElement(t)?1:0}));i.on("checkElement",((t,{modelElement:e,viewElement:n})=>{const o=nq(e,i.getListAttributeNames());const r=n.hasClass("todo-list__label__description");if(r!=o){t.return=true;t.stop()}}));i.on("checkElement",((e,{modelElement:n,viewElement:i})=>{const o=n.getAttribute("listType")=="todo"&&rW(n);let r=false;const s=t.editing.view.createPositionBefore(i).getWalker({direction:"backward"});for(const{item:e}of s){if(e.is("element")&&t.editing.mapper.toModelElement(e)){break}if(e.is("element","input")&&e.getAttribute("type")=="checkbox"){r=true}}if(r!=o){e.return=true;e.stop()}}));i.on("postFixer",((t,{listNodes:e,writer:n})=>{for(const{node:i,previousNodeInList:o}of e){if(!o){continue}if(o.getAttribute("listItemId")!=i.getAttribute("listItemId")){continue}const e=o.hasAttribute("todoListChecked");const r=i.hasAttribute("todoListChecked");if(r&&!e){n.removeAttribute("todoListChecked",i);t.return=true}else if(!r&&e){n.setAttribute("todoListChecked",true,i);t.return=true}}}));e.document.registerPostFixer((t=>{const n=e.document.differ.getChanges();let i=false;for(const e of n){if(e.type=="attribute"&&e.attributeKey=="listType"){const n=e.range.start.nodeAfter;if(e.attributeOldValue=="todo"&&n.hasAttribute("todoListChecked")){t.removeAttribute("todoListChecked",n);i=true}}else if(e.type=="insert"&&e.name!="$text"){for(const{item:n}of t.createRangeOn(e.position.nodeAfter)){if(n.is("element")&&n.getAttribute("listType")!="todo"&&n.hasAttribute("todoListChecked")){t.removeAttribute("todoListChecked",n);i=true}}}}return i}));this.listenTo(n.view.document,"keydown",((e,n)=>{if(Yc(n)===ZG){t.execute("checkTodoList");e.stop()}}),{priority:"high"});this.listenTo(n.view.document,"todoCheckboxChange",((t,e)=>{const i=e.target;if(!i||!i.is("element","input")){return}const o=n.view.createPositionAfter(i);const r=n.mapper.toModelPosition(o);const s=r.parent;if(s&&tW(s)&&s.getAttribute("listType")=="todo"){this._handleCheckmarkChange(s)}}));this.listenTo(n.view.document,"arrowKey",oq(e,t.locale),{context:"$text"});this.listenTo(n.mapper,"viewToModelPosition",((t,n)=>{const i=n.viewPosition.parent;const o=i.is("attributeElement","li")&&n.viewPosition.offset==0;const r=rq(i)&&n.viewPosition.offset<=1;const s=i.is("element","span")&&i.getAttribute("contenteditable")=="false"&&rq(i.parent);if(!o&&!r&&!s){return}const a=n.modelPosition.nodeAfter;if(a&&a.getAttribute("listType")=="todo"){n.modelPosition=e.createPositionAt(a,0)}}),{priority:"low"})}_handleCheckmarkChange(t){const e=this.editor;const n=e.model;const i=Array.from(n.document.selection.getRanges());n.change((n=>{n.setSelection(t,"end");e.execute("checkTodoList");n.setSelection(i)}))}}function XG(){return(t,e,n)=>{const i=e.modelCursor;const o=i.parent;const r=e.viewItem;if(!n.consumable.test(r,{name:true})){return}if(r.getAttribute("type")!="checkbox"||!i.isAtStart||!o.hasAttribute("listType")){return}n.consumable.consume(r,{name:true});const s=n.writer;s.setAttribute("listType","todo",o);if(e.viewItem.hasAttribute("checked")){s.setAttribute("todoListChecked",true,o)}e.modelRange=s.createRange(i)}}function tq(t){const e=new $h(t);return(t,n,i)=>{const o=e.match(n.viewItem);if(!o){return}if(!i.consumable.consume(n.viewItem,o.match)){return}Object.assign(n,i.convertChildren(n.viewItem,n.modelCursor))}}function eq(t){const e=new $h(t);return(t,n,i)=>{const o=e.match(n.viewItem);if(!o){return}const r=o.match;r.name=false;i.consumable.consume(n.viewItem,r)}}function nq(t,e){return(t.is("element","paragraph")||t.is("element","listItem"))&&t.getAttribute("listType")=="todo"&&rW(t)&&iq(t,e)}function iq(t,e){for(const n of t.getAttributeKeys()){if(n.startsWith("selection:")){continue}if(!e.includes(n)){return false}}return true}function oq(t,e){return(n,i)=>{const o=Xc(i.keyCode,e.contentLanguageDirection);const r=t.schema;const s=t.document.selection;if(!s.isCollapsed){return}const a=s.getFirstPosition();const c=a.parent;if(o=="right"&&a.isAtEnd){const e=r.getNearestSelectionRange(t.createPositionAfter(c),"forward");if(!e){return}const o=e.start.parent;if(o&&tW(o)&&o.getAttribute("listType")=="todo"){t.change((t=>t.setSelection(e)));i.preventDefault();i.stopPropagation();n.stop()}}else if(o=="left"&&a.isAtStart&&tW(c)&&c.getAttribute("listType")=="todo"){const e=r.getNearestSelectionRange(t.createPositionBefore(c),"backward");if(!e){return}t.change((t=>t.setSelection(e)));i.preventDefault();i.stopPropagation();n.stop()}}}function rq(t){return!!t&&t.is("attributeElement")&&t.hasClass("todo-list__label")}class sq extends bh{static get pluginName(){return"TodoListUI"}init(){const t=this.editor.t;aG(this.editor,"todoList",t("To-do List"),Ty.todoList)}}var aq=n(72);var cq={injectType:"singletonStyleTag",attributes:{"data-cke":true}};cq.insert="head";cq.singleton=true;var lq=Pl()(aq.c,cq);const dq=aq.c.locals||{};class uq extends bh{static get requires(){return[JG,sq]}static get pluginName(){return"TodoList"}}class hq extends wh{constructor(t,e){super(t);this.type=e}refresh(){this.value=this._getValue();this.isEnabled=this._checkEnabled()}execute(t={}){const e=this.editor.model;const n=e.document;const i=Array.from(n.selection.getSelectedBlocks()).filter((t=>gq(t,e.schema)));const o=t.forceValue!==undefined?!t.forceValue:this.value;e.change((t=>{if(o){let e=i[i.length-1].nextSibling;let n=Number.POSITIVE_INFINITY;let o=[];while(e&&e.name=="listItem"&&e.getAttribute("listIndent")!==0){const t=e.getAttribute("listIndent");if(t=n){if(r>o.getAttribute("listIndent")){r=o.getAttribute("listIndent")}if(o.getAttribute("listIndent")==r){t[e?"unshift":"push"](o)}o=o[e?"previousSibling":"nextSibling"]}}}function gq(t,e){return e.checkChild(t.parent,"listItem")&&!e.isObject(t)}class fq extends wh{constructor(t,e){super(t);this._indentBy=e=="forward"?1:-1}refresh(){this.isEnabled=this._checkEnabled()}execute(){const t=this.editor.model;const e=t.document;let n=Array.from(e.selection.getSelectedBlocks());t.change((t=>{const e=n[n.length-1];let i=e.nextSibling;while(i&&i.name=="listItem"&&i.getAttribute("listIndent")>e.getAttribute("listIndent")){n.push(i);i=i.nextSibling}if(this._indentBy<0){n=n.reverse()}for(const e of n){const n=e.getAttribute("listIndent")+this._indentBy;if(n<0){t.rename(e,"paragraph")}else{t.setAttribute("listIndent",n,e)}}this.fire("_executeCleanup",n)}))}_checkEnabled(){const t=fl(this.editor.model.document.selection.getSelectedBlocks());if(!t||!t.is("element","listItem")){return false}if(this._indentBy>0){const e=t.getAttribute("listIndent");const n=t.getAttribute("listType");let i=t.previousSibling;while(i&&i.is("element","listItem")&&i.getAttribute("listIndent")>=e){if(i.getAttribute("listIndent")==e){return i.getAttribute("listType")==n}i=i.previousSibling}return false}return true}}function pq(t){const e=t.createContainerElement("li");e.getFillerOffset=Tq;return e}function bq(t,e){const n=e.mapper;const i=e.writer;const o=t.getAttribute("listType")=="numbered"?"ol":"ul";const r=pq(i);const s=i.createContainerElement(o,null);i.insert(i.createPositionAt(s,0),r);n.bindElements(t,r);return r}function kq(t,e,n,i){const o=e.parent;const r=n.mapper;const s=n.writer;let a=r.toViewPosition(i.createPositionBefore(t));const c=Cq(t.previousSibling,{sameIndent:true,smallerIndent:true,listIndent:t.getAttribute("listIndent")});const l=t.previousSibling;if(c&&c.getAttribute("listIndent")==t.getAttribute("listIndent")){const t=r.toViewElement(c);a=s.breakContainer(s.createPositionAfter(t))}else{if(l&&l.name=="listItem"){a=r.toViewPosition(i.createPositionAt(l,"end"));const t=r.findMappedViewAncestor(a);const e=_q(t);if(e){a=s.createPositionBefore(e)}else{a=s.createPositionAt(t,"end")}}else{a=r.toViewPosition(i.createPositionBefore(t))}}a=Aq(a);s.insert(a,o);if(l&&l.name=="listItem"){const t=r.toViewElement(l);const n=s.createRange(s.createPositionAt(t,0),a);const i=n.getWalker({ignoreElementEnd:true});for(const t of i){if(t.item.is("element","li")){const n=s.breakContainer(s.createPositionBefore(t.item));const o=t.item.parent;const r=s.createPositionAt(e,"end");wq(s,r.nodeBefore,r.nodeAfter);s.move(s.createRangeOn(o),r);i._position=n}}}else{const n=o.nextSibling;if(n&&(n.is("element","ul")||n.is("element","ol"))){let i=null;for(const e of n.getChildren()){const n=r.toModelElement(e);if(n&&n.getAttribute("listIndent")>t.getAttribute("listIndent")){i=e}else{break}}if(i){s.breakContainer(s.createPositionAfter(i));s.move(s.createRangeOn(i.parent),s.createPositionAt(e,"end"))}}}wq(s,o,o.nextSibling);wq(s,o.previousSibling,o)}function wq(t,e,n){if(!e||!n||e.name!="ul"&&e.name!="ol"){return null}if(e.name!=n.name||e.getAttribute("class")!==n.getAttribute("class")){return null}return t.mergeContainers(t.createPositionAfter(e))}function Aq(t){return t.getLastMatchingPosition((t=>t.item.is("uiElement")))}function Cq(t,e){const n=!!e.sameIndent;const i=!!e.smallerIndent;const o=e.listIndent;let r=t;while(r&&r.name=="listItem"){const t=r.getAttribute("listIndent");if(n&&o==t||i&&o>t){return r}if(e.direction==="forward"){r=r.nextSibling}else{r=r.previousSibling}}return null}function _q(t){for(const e of t.getChildren()){if(e.name=="ul"||e.name=="ol"){return e}}return null}function vq(t,e){const n=[];const i=t.parent;const o={ignoreElementEnd:false,startPosition:t,shallow:true,direction:e};const r=i.getAttribute("listIndent");const s=[...new Qb(o)].filter((t=>t.item.is("element"))).map((t=>t.item));for(const t of s){if(!t.is("element","listItem")){break}if(t.getAttribute("listIndent")r){continue}if(t.getAttribute("listType")!==i.getAttribute("listType")){break}if(t.getAttribute("listStyle")!==i.getAttribute("listStyle")){break}if(t.getAttribute("listReversed")!==i.getAttribute("listReversed")){break}if(t.getAttribute("listStart")!==i.getAttribute("listStart")){break}if(e==="backward"){n.unshift(t)}else{n.push(t)}}return n}function yq(t){const e=t.document;let n=[...e.selection.getSelectedBlocks()].filter((t=>t.is("element","listItem"))).map((e=>{const n=t.change((t=>t.createPositionAt(e,0)));return[...vq(n,"backward"),...vq(n,"forward")]})).flat();n=[...new Set(n)];return n}const xq=["disc","circle","square"];const Eq=["decimal","decimal-leading-zero","lower-roman","upper-roman","lower-latin","upper-latin"];function Dq(t){if(xq.includes(t)){return"bulleted"}if(Eq.includes(t)){return"numbered"}return null}function Tq(){const t=!this.isEmpty&&(this.getChild(0).name=="ul"||this.getChild(0).name=="ol");if(this.isEmpty||t){return 0}return $g.call(this)}class Sq extends bh{static get pluginName(){return"LegacyListUtils"}getListTypeFromListStyleType(t){return Dq(t)}getSelectedListItems(t){return yq(t)}getSiblingNodes(t,e){return vq(t,e)}}function Iq(t){return(e,n,i)=>{const o=i.consumable;if(!o.test(n.item,"insert")||!o.test(n.item,"attribute:listType")||!o.test(n.item,"attribute:listIndent")){return}o.consume(n.item,"insert");o.consume(n.item,"attribute:listType");o.consume(n.item,"attribute:listIndent");const r=n.item;const s=bq(r,i);kq(r,s,i,t)}}function Bq(t){return(e,n,i)=>{const o=i.mapper.toViewPosition(n.position);const r=o.getLastMatchingPosition((t=>!t.item.is("element","li")));const s=r.nodeAfter;const a=i.writer;a.breakContainer(a.createPositionBefore(s));a.breakContainer(a.createPositionAfter(s));const c=s.parent;const l=c.previousSibling;const d=a.createRangeOn(c);const u=a.remove(d);if(l&&l.nextSibling){wq(a,l,l.nextSibling)}const h=i.mapper.toModelElement(s);qq(h.getAttribute("listIndent")+1,n.position,d.start,s,i,t);for(const t of a.createRangeIn(u).getItems()){i.mapper.unbindViewElement(t)}e.stop()}}const Mq=(t,e,n)=>{if(!n.consumable.test(e.item,t.name)){return}const i=n.mapper.toViewElement(e.item);const o=n.writer;o.breakContainer(o.createPositionBefore(i));o.breakContainer(o.createPositionAfter(i));const r=i.parent;const s=e.attributeNewValue=="numbered"?"ol":"ul";o.rename(s,r)};const Lq=(t,e,n)=>{n.consumable.consume(e.item,t.name);const i=n.mapper.toViewElement(e.item);const o=i.parent;const r=n.writer;wq(r,o,o.nextSibling);wq(r,o.previousSibling,o)};function Nq(t){return(e,n,i)=>{if(!i.consumable.consume(n.item,"attribute:listIndent")){return}const o=i.mapper.toViewElement(n.item);const r=i.writer;r.breakContainer(r.createPositionBefore(o));r.breakContainer(r.createPositionAfter(o));const s=o.parent;const a=s.previousSibling;const c=r.createRangeOn(s);r.remove(c);if(a&&a.nextSibling){wq(r,a,a.nextSibling)}qq(n.attributeOldValue+1,n.range.start,c.start,o,i,t);kq(n.item,o,i,t);for(const t of n.item.getChildren()){i.consumable.consume(t,"insert")}}}const Pq=(t,e,n)=>{if(!n.consumable.test(e.item,t.name)){return}if(e.item.name!="listItem"){let t=n.mapper.toViewPosition(e.range.start);const i=n.writer;const o=[];while(t.parent.name=="ul"||t.parent.name=="ol"){t=i.breakContainer(t);if(t.parent.name!="li"){break}const e=t;const n=i.createPositionAt(t.parent,"end");if(!e.isEqual(n)){const t=i.remove(i.createRange(e,n));o.push(t)}t=i.createPositionAfter(t.parent)}if(o.length>0){for(let e=0;e0){const e=wq(i,n,n.nextSibling);if(e&&e.parent==n){t.offset--}}}wq(i,t.nodeBefore,t.nodeAfter)}}};const zq=(t,e,n)=>{const i=n.mapper.toViewPosition(e.position);const o=i.nodeBefore;const r=i.nodeAfter;wq(n.writer,o,r)};const Rq=(t,e,n)=>{if(n.consumable.consume(e.viewItem,{name:true})){const t=n.writer;const i=t.createElement("listItem");const o=Kq(e.viewItem);t.setAttribute("listIndent",o,i);const r=e.viewItem.parent&&e.viewItem.parent.name=="ol"?"numbered":"bulleted";t.setAttribute("listType",r,i);if(!n.safeInsert(i,e.modelCursor)){return}const s=Wq(i,e.viewItem.getChildren(),n);e.modelRange=t.createRange(e.modelCursor,s);n.updateConversionResult(i,e)}};const Vq=(t,e,n)=>{if(n.consumable.test(e.viewItem,{name:true})){const t=Array.from(e.viewItem.getChildren());for(const e of t){const t=!(e.is("element","li")||$q(e));if(t){e._remove()}}}};const Oq=(t,e,n)=>{if(n.consumable.test(e.viewItem,{name:true})){if(e.viewItem.childCount===0){return}const t=[...e.viewItem.getChildren()];let n=false;for(const e of t){if(n&&!$q(e)){e._remove()}if($q(e)){n=true}}}};function Fq(t){return(e,n)=>{if(n.isPhantom){return}const i=n.modelPosition.nodeBefore;if(i&&i.is("element","listItem")){const e=n.mapper.toViewElement(i);const o=e.getAncestors().find($q);const r=t.createPositionAt(e,0).getWalker();for(const t of r){if(t.type=="elementStart"&&t.item.is("element","li")){n.viewPosition=t.previousPosition;break}else if(t.type=="elementEnd"&&t.item==o){n.viewPosition=t.nextPosition;break}}}}}function jq(t){return(e,n)=>{const i=n.viewPosition;const o=i.parent;const r=n.mapper;if(o.name=="ul"||o.name=="ol"){if(!i.isAtEnd){const e=r.toModelElement(i.nodeAfter);n.modelPosition=t.createPositionBefore(e)}else{const e=r.toModelElement(i.nodeBefore);const o=r.getModelLength(i.nodeBefore);n.modelPosition=t.createPositionBefore(e).getShiftedBy(o)}e.stop()}else if(o.name=="li"&&i.nodeBefore&&(i.nodeBefore.name=="ul"||i.nodeBefore.name=="ol")){const s=r.toModelElement(o);let a=1;let c=i.nodeBefore;while(c&&$q(c)){a+=r.getModelLength(c);c=c.previousSibling}n.modelPosition=t.createPositionBefore(s).getShiftedBy(a);e.stop()}}}function Hq(t,e){const n=t.document.differ.getChanges();const i=new Map;let o=false;for(const i of n){if(i.type=="insert"&&i.name=="listItem"){r(i.position)}else if(i.type=="insert"&&i.name!="listItem"){if(i.name!="$text"){const n=i.position.nodeAfter;if(n.hasAttribute("listIndent")){e.removeAttribute("listIndent",n);o=true}if(n.hasAttribute("listType")){e.removeAttribute("listType",n);o=true}if(n.hasAttribute("listStyle")){e.removeAttribute("listStyle",n);o=true}if(n.hasAttribute("listReversed")){e.removeAttribute("listReversed",n);o=true}if(n.hasAttribute("listStart")){e.removeAttribute("listStart",n);o=true}for(const e of Array.from(t.createRangeIn(n)).filter((t=>t.item.is("element","listItem")))){r(e.previousPosition)}}const n=i.position.getShiftedBy(i.length);r(n)}else if(i.type=="remove"&&i.name=="listItem"){r(i.position)}else if(i.type=="attribute"&&i.attributeKey=="listIndent"){r(i.range.start)}else if(i.type=="attribute"&&i.attributeKey=="listType"){r(i.range.start)}}for(const t of i.values()){s(t);a(t)}return o;function r(t){const e=t.nodeBefore;if(!e||!e.is("element","listItem")){const e=t.nodeAfter;if(e&&e.is("element","listItem")){i.set(e,e)}}else{let t=e;if(i.has(t)){return}for(let e=t.previousSibling;e&&e.is("element","listItem");e=t.previousSibling){t=e;if(i.has(t)){return}}i.set(e,t)}}function s(t){let n=0;let i=null;while(t&&t.is("element","listItem")){const r=t.getAttribute("listIndent");if(r>n){let s;if(i===null){i=r-n;s=n}else{if(i>r){i=r}s=r-i}e.setAttribute("listIndent",s,t);o=true}else{i=null;n=t.getAttribute("listIndent")+1}t=t.nextSibling}}function a(t){let n=[];let i=null;while(t&&t.is("element","listItem")){const r=t.getAttribute("listIndent");if(i&&i.getAttribute("listIndent")>r){n=n.slice(0,r+1)}if(r!=0){if(n[r]){const i=n[r];if(t.getAttribute("listType")!=i){e.setAttribute("listType",i,t);o=true}}else{n[r]=t.getAttribute("listType")}}i=t;t=t.nextSibling}}}const Uq=function(t,[e,n]){const i=this;let o=e.is("documentFragment")?e.getChild(0):e;let r;if(!n){r=i.document.selection}else{r=i.createSelection(n)}if(o&&o.is("element","listItem")){const t=r.getFirstPosition();let e=null;if(t.parent.is("element","listItem")){e=t.parent}else if(t.nodeBefore&&t.nodeBefore.is("element","listItem")){e=t.nodeBefore}if(e){const t=e.getAttribute("listIndent");if(t>0){while(o&&o.is("element","listItem")){o._setAttribute("listIndent",o.getAttribute("listIndent")+t);o=o.nextSibling}}}}};function Wq(t,e,n){const{writer:i,schema:o}=n;let r=i.createPositionAfter(t);for(const s of e){if(s.name=="ul"||s.name=="ol"){r=n.convertItem(s,r).modelCursor}else{const e=n.convertItem(s,i.createPositionAt(t,"end"));const a=e.modelRange.start.nodeAfter;const c=a&&a.is("element")&&!o.checkChild(t,a.name);if(c){if(e.modelCursor.parent.is("element","listItem")){t=e.modelCursor.parent}else{t=Gq(e.modelCursor)}r=i.createPositionAfter(t)}}}return r}function Gq(t){const e=new Qb({startPosition:t});let n;do{n=e.next()}while(!n.value.item.is("element","listItem"));return n.value.item}function qq(t,e,n,i,o,r){const s=Cq(e.nodeBefore,{sameIndent:true,smallerIndent:true,listIndent:t});const a=o.mapper;const c=o.writer;const l=s?s.getAttribute("listIndent"):null;let d;if(!s){d=n}else if(l==t){const t=a.toViewElement(s).parent;d=c.createPositionAfter(t)}else{const t=r.createPositionAt(s,"end");d=a.toViewPosition(t)}d=Aq(d);for(const t of[...i.getChildren()]){if($q(t)){d=c.move(c.createRangeOn(t),d).end;wq(c,t,t.nextSibling);wq(c,t.previousSibling,t)}}}function $q(t){return t.is("element","ol")||t.is("element","ul")}function Kq(t){let e=0;let n=t.parent;while(n){if(n.is("element","li")){e++}else{const t=n.previousSibling;if(t&&t.is("element","li")){e++}}n=n.parent}return e}class Yq extends bh{static get pluginName(){return"LegacyListEditing"}static get requires(){return[oM,LI,Sq]}init(){const t=this.editor;t.model.schema.register("listItem",{inheritAllFrom:"$block",allowAttributes:["listType","listIndent"]});const e=t.data;const n=t.editing;t.model.document.registerPostFixer((e=>Hq(t.model,e)));n.mapper.registerViewToModelLength("li",Qq);e.mapper.registerViewToModelLength("li",Qq);n.mapper.on("modelToViewPosition",Fq(n.view));n.mapper.on("viewToModelPosition",jq(t.model));e.mapper.on("modelToViewPosition",Fq(n.view));t.conversion.for("editingDowncast").add((e=>{e.on("insert",Pq,{priority:"high"});e.on("insert:listItem",Iq(t.model));e.on("attribute:listType:listItem",Mq,{priority:"high"});e.on("attribute:listType:listItem",Lq,{priority:"low"});e.on("attribute:listIndent:listItem",Nq(t.model));e.on("remove:listItem",Bq(t.model));e.on("remove",zq,{priority:"low"})}));t.conversion.for("dataDowncast").add((e=>{e.on("insert",Pq,{priority:"high"});e.on("insert:listItem",Iq(t.model))}));t.conversion.for("upcast").add((t=>{t.on("element:ul",Vq,{priority:"high"});t.on("element:ol",Vq,{priority:"high"});t.on("element:li",Oq,{priority:"high"});t.on("element:li",Rq)}));t.model.on("insertContent",Uq,{priority:"high"});t.commands.add("numberedList",new hq(t,"numbered"));t.commands.add("bulletedList",new hq(t,"bulleted"));t.commands.add("indentList",new fq(t,"forward"));t.commands.add("outdentList",new fq(t,"backward"));const i=n.view.document;this.listenTo(i,"enter",((t,e)=>{const n=this.editor.model.document;const i=n.selection.getLastPosition().parent;if(n.selection.isCollapsed&&i.name=="listItem"&&i.isEmpty){this.editor.execute("outdentList");e.preventDefault();t.stop()}}),{context:"li"});this.listenTo(i,"delete",((t,e)=>{if(e.direction!=="backward"){return}const n=this.editor.model.document.selection;if(!n.isCollapsed){return}const i=n.getFirstPosition();if(!i.isAtStart){return}const o=i.parent;if(o.name!=="listItem"){return}const r=o.previousSibling&&o.previousSibling.name==="listItem";if(r){return}this.editor.execute("outdentList");e.preventDefault();t.stop()}),{context:"li"});this.listenTo(t.editing.view.document,"tab",((e,n)=>{const i=n.shiftKey?"outdentList":"indentList";const o=this.editor.commands.get(i);if(o.isEnabled){t.execute(i);n.stopPropagation();n.preventDefault();e.stop()}}),{context:"li"})}afterInit(){const t=this.editor.commands;const e=t.get("indent");const n=t.get("outdent");if(e){e.registerChildCommand(t.get("indentList"))}if(n){n.registerChildCommand(t.get("outdentList"))}}}function Qq(t){let e=1;for(const n of t.getChildren()){if(n.name=="ul"||n.name=="ol"){for(const t of n.getChildren()){e+=Qq(t)}}}return e}class Zq extends(null&&Plugin){static get requires(){return[LegacyListEditing,ListUI]}static get pluginName(){return"LegacyList"}}class Jq extends wh{constructor(t,e){super(t);this.defaultType=e}refresh(){this.value=this._getValue();this.isEnabled=this._checkEnabled()}execute(t={}){this._tryToConvertItemsToList(t);const e=this.editor.model;const n=yq(e);if(!n.length){return}e.change((e=>{for(const i of n){e.setAttribute("listStyle",t.type||this.defaultType,i)}}))}_getValue(){const t=this.editor.model.document.selection.getFirstPosition().parent;if(t&&t.is("element","listItem")){return t.getAttribute("listStyle")}return null}_checkEnabled(){const t=this.editor;const e=t.commands.get("numberedList");const n=t.commands.get("bulletedList");return e.isEnabled||n.isEnabled}_tryToConvertItemsToList(t){if(!t.type){return}const e=Dq(t.type);if(!e){return}const n=this.editor;const i=`${e}List`;const o=n.commands.get(i);if(!o.value){n.execute(i)}}}class Xq extends wh{refresh(){const t=this._getValue();this.value=t;this.isEnabled=t!=null}execute(t={}){const e=this.editor.model;const n=yq(e).filter((t=>t.getAttribute("listType")=="numbered"));e.change((e=>{for(const i of n){e.setAttribute("listReversed",!!t.reversed,i)}}))}_getValue(){const t=this.editor.model.document.selection.getFirstPosition().parent;if(t&&t.is("element","listItem")&&t.getAttribute("listType")=="numbered"){return t.getAttribute("listReversed")}return null}}class t$ extends wh{refresh(){const t=this._getValue();this.value=t;this.isEnabled=t!=null}execute({startIndex:t=1}={}){const e=this.editor.model;const n=yq(e).filter((t=>t.getAttribute("listType")=="numbered"));e.change((e=>{for(const i of n){e.setAttribute("listStart",t>=0?t:1,i)}}))}_getValue(){const t=this.editor.model.document.selection.getFirstPosition().parent;if(t&&t.is("element","listItem")&&t.getAttribute("listType")=="numbered"){return t.getAttribute("listStart")}return null}}const e$="default";class n$ extends bh{static get requires(){return[Yq]}static get pluginName(){return"LegacyListPropertiesEditing"}constructor(t){super(t);t.config.define("list",{properties:{styles:true,startIndex:false,reversed:false}})}init(){const t=this.editor;const e=t.model;const n=t.config.get("list.properties");const i=i$(n);e.schema.extend("listItem",{allowAttributes:i.map((t=>t.attributeName))});for(const e of i){e.addCommand(t)}this.listenTo(t.commands.get("indentList"),"_executeCleanup",s$(t,i));this.listenTo(t.commands.get("outdentList"),"_executeCleanup",a$(t,i));this.listenTo(t.commands.get("bulletedList"),"_executeCleanup",h$(t));this.listenTo(t.commands.get("numberedList"),"_executeCleanup",h$(t));e.document.registerPostFixer(c$(t,i));t.conversion.for("upcast").add(o$(i));t.conversion.for("downcast").add(r$(i));this._mergeListAttributesWhileMergingLists(i)}afterInit(){const t=this.editor;if(t.commands.get("todoList")){t.model.document.registerPostFixer(u$(t))}}_mergeListAttributesWhileMergingLists(t){const e=this.editor;const n=e.model;let i;this.listenTo(n,"deleteContent",((t,[e])=>{const n=e.getFirstPosition();const o=e.getLastPosition();if(n.parent===o.parent){return}if(!n.parent.is("element","listItem")){return}const r=o.parent.nextSibling;if(!r||!r.is("element","listItem")){return}const s=Cq(n.parent,{sameIndent:true,listIndent:r.getAttribute("listIndent")});if(!s){return}if(s.getAttribute("listType")===r.getAttribute("listType")){i=s}}),{priority:"high"});this.listenTo(n,"deleteContent",(()=>{if(!i){return}n.change((e=>{const n=Cq(i.nextSibling,{sameIndent:true,listIndent:i.getAttribute("listIndent"),direction:"forward"});if(!n){i=null;return}const o=[n,...vq(e.createPositionAt(n,0),"forward")];for(const n of o){for(const o of t){if(o.appliesToListItem(n)){const t=o.attributeName;const r=i.getAttribute(t);e.setAttribute(t,r,n)}}}}));i=null}),{priority:"low"})}}function i$(t){const e=[];if(t.styles){e.push({attributeName:"listStyle",defaultValue:e$,addCommand(t){t.commands.add("listStyle",new Jq(t,e$))},appliesToListItem(){return true},setAttributeOnDowncast(t,e,n){if(e&&e!==e$){t.setStyle("list-style-type",e,n)}else{t.removeStyle("list-style-type",n)}},getAttributeOnUpcast(t){return t.getStyle("list-style-type")||e$}})}if(t.reversed){e.push({attributeName:"listReversed",defaultValue:false,addCommand(t){t.commands.add("listReversed",new Xq(t))},appliesToListItem(t){return t.getAttribute("listType")=="numbered"},setAttributeOnDowncast(t,e,n){if(e){t.setAttribute("reversed","reversed",n)}else{t.removeAttribute("reversed",n)}},getAttributeOnUpcast(t){return t.hasAttribute("reversed")}})}if(t.startIndex){e.push({attributeName:"listStart",defaultValue:1,addCommand(t){t.commands.add("listStart",new t$(t))},appliesToListItem(t){return t.getAttribute("listType")=="numbered"},setAttributeOnDowncast(t,e,n){if(e==0||e>1){t.setAttribute("start",e,n)}else{t.removeAttribute("start",n)}},getAttributeOnUpcast(t){const e=t.getAttribute("start");return e>=0?e:1}})}return e}function o$(t){return e=>{e.on("element:li",((e,n,i)=>{if(!n.modelRange){return}const o=n.viewItem.parent;const r=n.modelRange.start.nodeAfter||n.modelRange.end.nodeBefore;for(const e of t){if(e.appliesToListItem(r)){const t=e.getAttributeOnUpcast(o);i.writer.setAttribute(e.attributeName,t,r)}}}),{priority:"low"})}}function r$(t){return n=>{for(const i of t){n.on(`attribute:${i.attributeName}:listItem`,((t,n,o)=>{const r=o.writer;const s=n.item;const a=Cq(s.previousSibling,{sameIndent:true,listIndent:s.getAttribute("listIndent"),direction:"backward"});const c=o.mapper.toViewElement(s);if(!e(s,a)){r.breakContainer(r.createPositionBefore(c))}i.setAttributeOnDowncast(r,n.attributeNewValue,c.parent)}),{priority:"low"})}};function e(t,e){return e&&t.getAttribute("listType")===e.getAttribute("listType")&&t.getAttribute("listIndent")===e.getAttribute("listIndent")&&t.getAttribute("listStyle")===e.getAttribute("listStyle")&&t.getAttribute("listReversed")===e.getAttribute("listReversed")&&t.getAttribute("listStart")===e.getAttribute("listStart")}}function s$(t,e){return(n,i)=>{const o=i[0];const r=o.getAttribute("listIndent");const s=i.filter((t=>t.getAttribute("listIndent")===r));let a=null;if(o.previousSibling.getAttribute("listIndent")+1!==r){a=Cq(o.previousSibling,{sameIndent:true,direction:"backward",listIndent:r})}t.model.change((t=>{for(const n of s){for(const i of e){if(i.appliesToListItem(n)){const e=a==null?i.defaultValue:a.getAttribute(i.attributeName);t.setAttribute(i.attributeName,e,n)}}}}))}}function a$(t,e){return(n,i)=>{i=i.reverse().filter((t=>t.is("element","listItem")));if(!i.length){return}const o=i[0].getAttribute("listIndent");const r=i[0].getAttribute("listType");let s=i[0].previousSibling;if(s.is("element","listItem")){while(s.getAttribute("listIndent")!==o){s=s.previousSibling}}else{s=null}if(!s){s=i[i.length-1].nextSibling}if(!s||!s.is("element","listItem")){return}if(s.getAttribute("listType")!==r){return}t.model.change((t=>{const n=i.filter((t=>t.getAttribute("listIndent")===o));for(const i of n){for(const n of e){if(n.appliesToListItem(i)){const e=n.attributeName;const o=s.getAttribute(e);t.setAttribute(e,o,i)}}}}))}}function c$(t,e){return n=>{let i=false;const o=m$(t.model.document.differ.getChanges()).filter((t=>t.getAttribute("listType")!=="todo"));if(!o.length){return i}let r=o[o.length-1].nextSibling;if(!r||!r.is("element","listItem")){r=o[0].previousSibling;if(r){const t=o[0].getAttribute("listIndent");while(r.is("element","listItem")&&r.getAttribute("listIndent")!==t){r=r.previousSibling;if(!r){break}}}}for(const t of e){const e=t.attributeName;for(const s of o){if(!t.appliesToListItem(s)){n.removeAttribute(e,s);continue}if(!s.hasAttribute(e)){if(l$(r,s,t)){n.setAttribute(e,r.getAttribute(e),s)}else{n.setAttribute(e,t.defaultValue,s)}i=true}else{const o=s.previousSibling;if(d$(o,s,t.attributeName)){n.setAttribute(e,o.getAttribute(e),s);i=true}}}}return i}}function l$(t,e,n){if(!t){return false}const i=t.getAttribute(n.attributeName);if(!i){return false}if(i==n.defaultValue){return false}if(t.getAttribute("listType")!==e.getAttribute("listType")){return false}return true}function d$(t,e,n){if(!t||!t.is("element","listItem")){return false}if(e.getAttribute("listType")!==t.getAttribute("listType")){return false}const i=t.getAttribute("listIndent");if(i<1||i!==e.getAttribute("listIndent")){return false}const o=t.getAttribute(n);if(!o||o===e.getAttribute(n)){return false}return true}function u$(t){return e=>{const n=m$(t.model.document.differ.getChanges()).filter((t=>t.getAttribute("listType")==="todo"&&(t.hasAttribute("listStyle")||t.hasAttribute("listReversed")||t.hasAttribute("listStart"))));if(!n.length){return false}for(const t of n){e.removeAttribute("listStyle",t);e.removeAttribute("listReversed",t);e.removeAttribute("listStart",t)}return true}}function h$(t){return(e,n)=>{n=n.filter((t=>t.is("element","listItem")));t.model.change((t=>{for(const e of n){t.removeAttribute("listStyle",e)}}))}}function m$(t){const e=[];for(const n of t){const t=g$(n);if(t&&t.is("element","listItem")){e.push(t)}}return e}function g$(t){if(t.type==="attribute"){return t.range.start.nodeAfter}if(t.type==="insert"){return t.position.nodeAfter}return null}class f$ extends(null&&Plugin){static get requires(){return[LegacyListPropertiesEditing,ListPropertiesUI]}static get pluginName(){return"LegacyListProperties"}}const p$="todoListChecked";class b$ extends wh{constructor(t){super(t);this._selectedElements=[];this.on("execute",(()=>{this.refresh()}),{priority:"highest"})}refresh(){this._selectedElements=this._getSelectedItems();this.value=this._selectedElements.every((t=>!!t.getAttribute(p$)));this.isEnabled=!!this._selectedElements.length}_getSelectedItems(){const t=this.editor.model;const e=t.schema;const n=t.document.selection.getFirstRange();const i=n.start.parent;const o=[];if(e.checkAttribute(i,p$)){o.push(i)}for(const t of n.getItems()){if(e.checkAttribute(t,p$)&&!o.includes(t)){o.push(t)}}return o}execute(t={}){this.editor.model.change((e=>{for(const n of this._selectedElements){const i=t.forceValue===undefined?!this.value:t.forceValue;if(i){e.setAttribute(p$,true,n)}else{e.removeAttribute(p$,n)}}}))}}function k$(t,e){return(n,i,o)=>{const r=o.consumable;if(!r.test(i.item,"insert")||!r.test(i.item,"attribute:listType")||!r.test(i.item,"attribute:listIndent")){return}if(i.item.getAttribute("listType")!="todo"){return}const s=i.item;r.consume(s,"insert");r.consume(s,"attribute:listType");r.consume(s,"attribute:listIndent");r.consume(s,"attribute:todoListChecked");const a=o.writer;const c=generateLiInUl(s,o);const l=!!s.getAttribute("todoListChecked");const d=y$(s,a,l,e);const u=a.createContainerElement("span",{class:"todo-list__label__description"});a.addClass("todo-list",c.parent);a.insert(a.createPositionAt(c,0),d);a.insert(a.createPositionAfter(d),u);injectViewList(s,c,o,t)}}function w$(t){return(e,n,i)=>{const o=i.consumable;if(!o.test(n.item,"insert")||!o.test(n.item,"attribute:listType")||!o.test(n.item,"attribute:listIndent")){return}if(n.item.getAttribute("listType")!="todo"){return}const r=n.item;o.consume(r,"insert");o.consume(r,"attribute:listType");o.consume(r,"attribute:listIndent");o.consume(r,"attribute:todoListChecked");const s=i.writer;const a=generateLiInUl(r,i);s.addClass("todo-list",a.parent);const c=s.createContainerElement("label",{class:"todo-list__label"});const l=s.createEmptyElement("input",{type:"checkbox",disabled:"disabled"});const d=s.createContainerElement("span",{class:"todo-list__label__description"});if(r.getAttribute("todoListChecked")){s.setAttribute("checked","checked",l)}s.insert(s.createPositionAt(a,0),c);s.insert(s.createPositionAt(c,0),l);s.insert(s.createPositionAfter(l),d);injectViewList(r,a,i,t)}}const A$=(t,e,n)=>{const i=e.modelCursor;const o=i.parent;const r=e.viewItem;if(r.getAttribute("type")!="checkbox"||o.name!="listItem"||!i.isAtStart){return}if(!n.consumable.consume(r,{name:true})){return}const s=n.writer;s.setAttribute("listType","todo",o);if(e.viewItem.hasAttribute("checked")){s.setAttribute("todoListChecked",true,o)}e.modelRange=s.createRange(i)};function C$(t,e){return(n,i,o)=>{if(!o.consumable.consume(i.item,n.name)){return}const r=o.mapper.toViewElement(i.item);const s=o.writer;const a=x$(r,e);if(i.attributeNewValue=="todo"){const e=!!i.item.getAttribute("todoListChecked");const n=y$(i.item,s,e,t);const o=s.createContainerElement("span",{class:"todo-list__label__description"});const a=s.createRangeIn(r);const c=findNestedList(r);const l=positionAfterUiElements(a.start);const d=c?s.createPositionBefore(c):a.end;const u=s.createRange(l,d);s.addClass("todo-list",r.parent);s.move(u,s.createPositionAt(o,0));s.insert(s.createPositionAt(r,0),n);s.insert(s.createPositionAfter(n),o)}else if(i.attributeOldValue=="todo"){const t=E$(r,e);s.removeClass("todo-list",r.parent);s.remove(a);s.move(s.createRangeIn(t),s.createPositionBefore(t));s.remove(t)}}}function _$(t){return(e,n,i)=>{if(n.item.getAttribute("listType")!="todo"){return}if(!i.consumable.consume(n.item,"attribute:todoListChecked")){return}const{mapper:o,writer:r}=i;const s=!!n.item.getAttribute("todoListChecked");const a=o.toViewElement(n.item);const c=a.getChild(0);const l=y$(n.item,r,s,t);r.insert(r.createPositionAfter(c),l);r.remove(c)}}function v$(t){return(e,n)=>{const i=n.modelPosition;const o=i.parent;if(!o.is("element","listItem")||o.getAttribute("listType")!="todo"){return}const r=n.mapper.toViewElement(o);const s=E$(r,t);if(s){n.viewPosition=n.mapper.findPositionIn(s,i.offset)}}}function y$(t,e,n,i){const o=e.createUIElement("label",{class:"todo-list__label",contenteditable:false},(function(e){const o=createElement(document,"input",{type:"checkbox",tabindex:"-1"});if(n){o.setAttribute("checked","checked")}o.addEventListener("change",(()=>i(t)));const r=this.toDomElement(e);r.appendChild(o);return r}));return o}function x$(t,e){const n=e.createRangeIn(t);for(const t of n){if(t.item.is("uiElement","label")){return t.item}}}function E$(t,e){const n=e.createRangeIn(t);for(const t of n){if(t.item.is("containerElement","span")&&t.item.hasClass("todo-list__label__description")){return t.item}}}const D$=Qc("Ctrl+Enter");class T$ extends(null&&Plugin){static get pluginName(){return"LegacyTodoListEditing"}static get requires(){return[LegacyListEditing]}init(){const t=this.editor;const{editing:e,data:n,model:i}=t;i.schema.extend("listItem",{allowAttributes:["todoListChecked"]});i.schema.addAttributeCheck(((t,e)=>{const n=t.last;if(e=="todoListChecked"&&n.name=="listItem"&&n.getAttribute("listType")!="todo"){return false}}));t.commands.add("todoList",new LegacyListCommand(t,"todo"));const o=new LegacyCheckTodoListCommand(t);t.commands.add("checkTodoList",o);t.commands.add("todoListCheck",o);n.downcastDispatcher.on("insert:listItem",dataModelViewInsertion(i),{priority:"high"});n.upcastDispatcher.on("element:input",dataViewModelCheckmarkInsertion,{priority:"high"});e.downcastDispatcher.on("insert:listItem",modelViewInsertion(i,(t=>this._handleCheckmarkChange(t))),{priority:"high"});e.downcastDispatcher.on("attribute:listType:listItem",modelViewChangeType((t=>this._handleCheckmarkChange(t)),e.view));e.downcastDispatcher.on("attribute:todoListChecked:listItem",modelViewChangeChecked((t=>this._handleCheckmarkChange(t))));e.mapper.on("modelToViewPosition",mapModelToViewPosition(e.view));n.mapper.on("modelToViewPosition",mapModelToViewPosition(e.view));this.listenTo(e.view.document,"arrowKey",S$(i,t.locale),{context:"li"});this.listenTo(e.view.document,"keydown",((e,n)=>{if(getCode(n)===D$){t.execute("checkTodoList");e.stop()}}),{priority:"high"});const r=new Set;this.listenTo(i,"applyOperation",((t,e)=>{const n=e[0];if(n.type=="rename"&&n.oldName=="listItem"){const t=n.position.nodeAfter;if(t.hasAttribute("todoListChecked")){r.add(t)}}else if(n.type=="changeAttribute"&&n.key=="listType"&&n.oldValue==="todo"){for(const t of n.range.getItems()){if(t.hasAttribute("todoListChecked")&&t.getAttribute("listType")!=="todo"){r.add(t)}}}}));i.document.registerPostFixer((t=>{let e=false;for(const n of r){t.removeAttribute("todoListChecked",n);e=true}r.clear();return e}))}_handleCheckmarkChange(t){const e=this.editor;const n=e.model;const i=Array.from(n.document.selection.getRanges());n.change((n=>{n.setSelection(t,"end");e.execute("checkTodoList");n.setSelection(i)}))}}function S$(t,e){return(n,i)=>{const o=getLocalizedArrowKeyCodeDirection(i.keyCode,e.contentLanguageDirection);if(o!="left"){return}const r=t.schema;const s=t.document.selection;if(!s.isCollapsed){return}const a=s.getFirstPosition();const c=a.parent;if(c.name==="listItem"&&c.getAttribute("listType")=="todo"&&a.isAtStart){const e=r.getNearestSelectionRange(t.createPositionBefore(c),"backward");if(e){t.change((t=>t.setSelection(e)))}i.preventDefault();i.stopPropagation();n.stop()}}}class I$ extends(null&&Plugin){static get requires(){return[LegacyTodoListEditing,TodoListUI]}static get pluginName(){return"LegacyTodoList"}}class B$ extends(null&&Plugin){static get pluginName(){return"AdjacentListsSupport"}init(){const t=this.editor;const e=t.model;e.schema.register("listSeparator",{allowWhere:"$block",isBlock:true});t.conversion.for("upcast").add((t=>{t.on("element:ol",M$());t.on("element:ul",M$())})).elementToElement({model:"listSeparator",view:"ck-list-separator"});t.conversion.for("editingDowncast").elementToElement({model:"listSeparator",view:{name:"div",classes:["ck-list-separator","ck-hidden"]}});t.conversion.for("dataDowncast").elementToElement({model:"listSeparator",view:(t,e)=>{const n=e.writer.createContainerElement("ck-list-separator");e.writer.setCustomProperty("dataPipeline:transparentRendering",true,n);n.getFillerOffset=()=>null;return n}})}}function M$(){return(t,e,n)=>{const i=e.viewItem;const o=i.nextSibling;if(!o){return}if(i.name!==o.name){return}if(!e.modelRange){Object.assign(e,n.convertChildren(e.viewItem,e.modelCursor))}const r=n.writer;const s=r.createElement("listSeparator");if(!n.safeInsert(s,e.modelCursor)){return}const a=n.getSplitParts(s);e.modelRange=r.createRange(e.modelRange.start,r.createPositionAfter(a[a.length-1]));n.updateConversionResult(s,e)}}class L$ extends bh{static get requires(){return[lG]}static get pluginName(){return"DocumentList"}constructor(t){super(t);P("plugin-obsolete-documentlist",{pluginName:"DocumentList"})}}class N$ extends bh{static get requires(){return[KG]}static get pluginName(){return"DocumentListProperties"}constructor(t){super(t);P("plugin-obsolete-documentlistproperties",{pluginName:"DocumentListProperties"})}}class P$ extends bh{static get requires(){return[uq]}static get pluginName(){return"TodoDocumentList"}constructor(t){super(t);P("plugin-obsolete-tododocumentlist",{pluginName:"TodoDocumentList"})}}function z$(t,e){const n=(n,i,o)=>{if(!o.consumable.consume(i.item,n.name)){return}const r=i.attributeNewValue;const s=o.writer;const a=o.mapper.toViewElement(i.item);const c=[...a.getChildren()].find((t=>t.getCustomProperty("media-content")));s.remove(c);const l=t.getMediaViewElement(s,r,e);s.insert(s.createPositionAt(a,0),l)};return t=>{t.on("attribute:url:media",n)}}function R$(t,e,n){e.setCustomProperty("media",true,t);return OM(t,e,{label:n})}function V$(t){const e=t.getSelectedElement();if(e&&O$(e)){return e}return null}function O$(t){return!!t.getCustomProperty("media")&&VM(t)}function F$(t,e,n,i){return t.createContainerElement("figure",{class:"media"},[e.getMediaViewElement(t,n,i),t.createSlot()])}function j$(t){const e=t.getSelectedElement();if(e&&e.is("element","media")){return e}return null}function H$(t,e,n,i){t.change((o=>{const r=o.createElement("media",{url:e});t.insertObject(r,n,null,{setSelection:"on",findOptimalPosition:i?"auto":undefined})}))}class U$ extends wh{refresh(){const t=this.editor.model;const e=t.document.selection;const n=j$(e);this.value=n?n.getAttribute("url"):undefined;this.isEnabled=G$(e)||W$(e,t)}execute(t){const e=this.editor.model;const n=e.document.selection;const i=j$(n);if(i){e.change((e=>{e.setAttribute("url",t,i)}))}else{H$(e,t,n,true)}}}function W$(t,e){const n=qM(t,e);let i=n.start.parent;if(i.isEmpty&&!e.schema.isLimit(i)){i=i.parent}return e.schema.checkChild(i,"media")}function G$(t){const e=t.getSelectedElement();return!!e&&e.name==="media"}const q$=' ';const $$="0 0 64 42";class K${constructor(t,e){const n=e.providers;const i=e.extraProviders||[];const o=new Set(e.removeProviders);const r=n.concat(i).filter((t=>{const e=t.name;if(!e){P("media-embed-no-provider-name",{provider:t});return false}return!o.has(e)}));this.locale=t;this.providerDefinitions=r}hasMedia(t){return!!this._getMedia(t)}getMediaViewElement(t,e,n){return this._getMedia(e).getViewElement(t,n)}_getMedia(t){if(!t){return new Y$(this.locale)}t=t.trim();for(const e of this.providerDefinitions){const n=e.html;const i=ol(e.url);for(const e of i){const i=this._getUrlMatches(t,e);if(i){return new Y$(this.locale,t,i,n)}}}return null}_getUrlMatches(t,e){let n=t.match(e);if(n){return n}let i=t.replace(/^https?:\/\//,"");n=i.match(e);if(n){return n}i=i.replace(/^www\./,"");n=i.match(e);if(n){return n}return null}}class Y${constructor(t,e,n,i){this.url=this._getValidUrl(e);this._locale=t;this._match=n;this._previewRenderer=i}getViewElement(t,e){const n={};let i;if(e.renderForEditingView||e.renderMediaPreview&&this.url&&this._previewRenderer){if(this.url){n["data-oembed-url"]=this.url}if(e.renderForEditingView){n.class="ck-media__wrapper"}const o=this._getPreviewHtml(e);i=t.createRawElement("div",n,((t,e)=>{e.setContentOf(t,o)}))}else{if(this.url){n.url=this.url}i=t.createEmptyElement(e.elementName,n)}t.setCustomProperty("media-content",true,i);return i}_getPreviewHtml(t){if(this._previewRenderer){return this._previewRenderer(this._match)}else{if(this.url&&t.renderForEditingView){return this._getPlaceholderHtml()}return""}}_getPlaceholderHtml(){const t=new Cd;const e=this._locale.t;t.content=q$;t.viewBox=$$;const n=new Hl({tag:"div",attributes:{class:"ck ck-reset_all ck-media__placeholder"},children:[{tag:"div",attributes:{class:"ck-media__placeholder__icon"},children:[t]},{tag:"a",attributes:{class:"ck-media__placeholder__url",target:"_blank",rel:"noopener noreferrer",href:this.url,"data-cke-tooltip-text":e("Open media in new tab")},children:[{tag:"span",attributes:{class:"ck-media__placeholder__url__text"},children:[this.url]}]}]}).render();return n.outerHTML}_getValidUrl(t){if(!t){return null}if(t.match(/^https?/)){return t}return"https://"+t}}var Q$=n(5554);var Z$={injectType:"singletonStyleTag",attributes:{"data-cke":true}};Z$.insert="head";Z$.singleton=true;var J$=Pl()(Q$.c,Z$);const X$=Q$.c.locals||{};class tK extends bh{static get pluginName(){return"MediaEmbedEditing"}constructor(t){super(t);t.config.define("mediaEmbed",{elementName:"oembed",providers:[{name:"dailymotion",url:[/^dailymotion\.com\/video\/(\w+)/,/^dai.ly\/(\w+)/],html:t=>{const e=t[1];return''+`"+"
"}},{name:"spotify",url:[/^open\.spotify\.com\/(artist\/\w+)/,/^open\.spotify\.com\/(album\/\w+)/,/^open\.spotify\.com\/(track\/\w+)/],html:t=>{const e=t[1];return''+`"+"
"}},{name:"youtube",url:[/^(?:m\.)?youtube\.com\/watch\?v=([\w-]+)(?:&t=(\d+))?/,/^(?:m\.)?youtube\.com\/v\/([\w-]+)(?:\?t=(\d+))?/,/^youtube\.com\/embed\/([\w-]+)(?:\?start=(\d+))?/,/^youtu\.be\/([\w-]+)(?:\?t=(\d+))?/],html:t=>{const e=t[1];const n=t[2];return''+`VIDEO "+"
"}},{name:"vimeo",url:[/^vimeo\.com\/(\d+)/,/^vimeo\.com\/[^/]+\/[^/]+\/video\/(\d+)/,/^vimeo\.com\/album\/[^/]+\/video\/(\d+)/,/^vimeo\.com\/channels\/[^/]+\/(\d+)/,/^vimeo\.com\/groups\/[^/]+\/videos\/(\d+)/,/^vimeo\.com\/ondemand\/[^/]+\/(\d+)/,/^player\.vimeo\.com\/video\/(\d+)/],html:t=>{const e=t[1];return''+`"+"
"}},{name:"instagram",url:/^instagram\.com\/p\/(\w+)/},{name:"twitter",url:/^twitter\.com/},{name:"googleMaps",url:[/^google\.com\/maps/,/^goo\.gl\/maps/,/^maps\.google\.com/,/^maps\.app\.goo\.gl/]},{name:"flickr",url:/^flickr\.com/},{name:"facebook",url:/^facebook\.com/}]});this.registry=new K$(t.locale,t.config.get("mediaEmbed"))}init(){const t=this.editor;const e=t.model.schema;const n=t.t;const i=t.conversion;const o=t.config.get("mediaEmbed.previewsInData");const r=t.config.get("mediaEmbed.elementName");const s=this.registry;t.commands.add("mediaEmbed",new U$(t));e.register("media",{inheritAllFrom:"$blockObject",allowAttributes:["url"]});i.for("dataDowncast").elementToStructure({model:"media",view:(t,{writer:e})=>{const n=t.getAttribute("url");return F$(e,s,n,{elementName:r,renderMediaPreview:!!n&&o})}});i.for("dataDowncast").add(z$(s,{elementName:r,renderMediaPreview:o}));i.for("editingDowncast").elementToStructure({model:"media",view:(t,{writer:e})=>{const i=t.getAttribute("url");const o=F$(e,s,i,{elementName:r,renderForEditingView:true});return R$(o,e,n("media widget"))}});i.for("editingDowncast").add(z$(s,{elementName:r,renderForEditingView:true}));i.for("upcast").elementToElement({view:t=>["oembed",r].includes(t.name)&&t.getAttribute("url")?{name:true}:null,model:(t,{writer:e})=>{const n=t.getAttribute("url");if(s.hasMedia(n)){return e.createElement("media",{url:n})}return null}}).elementToElement({view:{name:"div",attributes:{"data-oembed-url":true}},model:(t,{writer:e})=>{const n=t.getAttribute("data-oembed-url");if(s.hasMedia(n)){return e.createElement("media",{url:n})}return null}}).add((t=>{const e=(t,e,n)=>{if(!n.consumable.consume(e.viewItem,{name:true,classes:"media"})){return}const{modelRange:i,modelCursor:o}=n.convertChildren(e.viewItem,e.modelCursor);e.modelRange=i;e.modelCursor=o;const r=fl(i.getItems());if(!r){n.consumable.revert(e.viewItem,{name:true,classes:"media"})}};t.on("element:figure",e)}))}}const eK=/^(?:http(s)?:\/\/)?[\w-]+\.[\w-.~:/?#[\]@!$&'()*+,;=%]+$/;class nK extends bh{static get requires(){return[pN,LI,BN]}static get pluginName(){return"AutoMediaEmbed"}constructor(t){super(t);this._timeoutId=null;this._positionToInsert=null}init(){const t=this.editor;const e=t.model.document;const n=t.plugins.get("ClipboardPipeline");this.listenTo(n,"inputTransformation",(()=>{const t=e.selection.getFirstRange();const n=pC.fromPosition(t.start);n.stickiness="toPrevious";const i=pC.fromPosition(t.end);i.stickiness="toNext";e.once("change:data",(()=>{this._embedMediaBetweenPositions(n,i);n.detach();i.detach()}),{priority:"high"})}));const i=t.commands.get("undo");i.on("execute",(()=>{if(this._timeoutId){nc.window.clearTimeout(this._timeoutId);this._positionToInsert.detach();this._timeoutId=null;this._positionToInsert=null}}),{priority:"high"})}_embedMediaBetweenPositions(t,e){const n=this.editor;const i=n.plugins.get(tK).registry;const o=new Ck(t,e);const r=o.getWalker({ignoreElementEnd:true});let s="";for(const t of r){if(t.item.is("$textProxy")){s+=t.item.data}}s=s.trim();if(!s.match(eK)){o.detach();return}if(!i.hasMedia(s)){o.detach();return}const a=n.commands.get("mediaEmbed");if(!a.isEnabled){o.detach();return}this._positionToInsert=pC.fromPosition(t);this._timeoutId=nc.window.setTimeout((()=>{n.model.change((t=>{this._timeoutId=null;t.remove(o);o.detach();let e=null;if(this._positionToInsert.root.rootName!=="$graveyard"){e=this._positionToInsert}H$(n.model,s,e,false);this._positionToInsert.detach();this._positionToInsert=null}));n.plugins.get(LI).requestUndoOnBackspace()}),100)}}var iK=n(5045);var oK={injectType:"singletonStyleTag",attributes:{"data-cke":true}};oK.insert="head";oK.singleton=true;var rK=Pl()(iK.c,oK);const sK=iK.c.locals||{};class aK extends Fl{constructor(t,e){super(e);const n=e.t;this.focusTracker=new pl;this.keystrokes=new bl;this.set("mediaURLInputValue","");this.urlInputView=this._createUrlInput();this.saveButtonView=this._createButton(n("Save"),Ty.check,"ck-button-save");this.saveButtonView.type="submit";this.saveButtonView.bind("isEnabled").to(this,"mediaURLInputValue",(t=>!!t));this.cancelButtonView=this._createButton(n("Cancel"),Ty.cancel,"ck-button-cancel","cancel");this._focusables=new Ml;this._focusCycler=new lh({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});this._validators=t;this.setTemplate({tag:"form",attributes:{class:["ck","ck-media-form","ck-responsive-form"],tabindex:"-1"},children:[this.urlInputView,this.saveButtonView,this.cancelButtonView]})}render(){super.render();o({view:this});const t=[this.urlInputView,this.saveButtonView,this.cancelButtonView];t.forEach((t=>{this._focusables.add(t);this.focusTracker.add(t.element)}));this.keystrokes.listenTo(this.element);const e=t=>t.stopPropagation();this.keystrokes.set("arrowright",e);this.keystrokes.set("arrowleft",e);this.keystrokes.set("arrowup",e);this.keystrokes.set("arrowdown",e)}destroy(){super.destroy();this.focusTracker.destroy();this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}get url(){return this.urlInputView.fieldView.element.value.trim()}set url(t){this.urlInputView.fieldView.element.value=t.trim()}isValid(){this.resetFormStatus();for(const t of this._validators){const e=t(this);if(e){this.urlInputView.errorText=e;return false}}return true}resetFormStatus(){this.urlInputView.errorText=null;this.urlInputView.infoText=this._urlInputViewInfoDefault}_createUrlInput(){const t=this.locale.t;const e=new Ou(this.locale,Ax);const n=e.fieldView;this._urlInputViewInfoDefault=t("Paste the media URL in the input.");this._urlInputViewInfoTip=t("Tip: Paste the URL into the content to embed faster.");e.label=t("Media URL");e.infoText=this._urlInputViewInfoDefault;n.on("input",(()=>{e.infoText=n.element.value?this._urlInputViewInfoTip:this._urlInputViewInfoDefault;this.mediaURLInputValue=n.element.value.trim()}));return e}_createButton(t,e,n,i){const o=new Dd(this.locale);o.set({label:t,icon:e,tooltip:true});o.extendTemplate({attributes:{class:n}});if(i){o.delegate("execute").to(this,i)}return o}}const cK=' ';class lK extends bh{static get requires(){return[tK]}static get pluginName(){return"MediaEmbedUI"}init(){const t=this.editor;const e=t.commands.get("mediaEmbed");t.ui.componentFactory.add("mediaEmbed",(t=>{const n=sx(t);this._setUpDropdown(n,e);return n}))}_setUpDropdown(t,n){const i=this.editor;const o=i.t;const r=t.buttonView;const s=i.plugins.get(tK).registry;t.once("change:isOpen",(()=>{const o=new(e(aK))(dK(i.t,s),i.locale);t.panelView.children.add(o);r.on("open",(()=>{o.disableCssTransitions();o.url=n.value||"";o.urlInputView.fieldView.select();o.enableCssTransitions()}),{priority:"low"});t.on("submit",(()=>{if(o.isValid()){i.execute("mediaEmbed",o.url);i.editing.view.focus()}}));t.on("change:isOpen",(()=>o.resetFormStatus()));t.on("cancel",(()=>{i.editing.view.focus()}));o.delegate("submit","cancel").to(t);o.urlInputView.fieldView.bind("value").to(n,"value");o.urlInputView.bind("isEnabled").to(n,"isEnabled")}));t.bind("isEnabled").to(n);r.set({label:o("Insert media"),icon:cK,tooltip:true})}}function dK(t,e){return[e=>{if(!e.url.length){return t("The URL must not be empty.")}},n=>{if(!e.hasMedia(n.url)){return t("This media URL is not supported.")}}]}var uK=n(8800);var hK={injectType:"singletonStyleTag",attributes:{"data-cke":true}};hK.insert="head";hK.singleton=true;var mK=Pl()(uK.c,hK);const gK=uK.c.locals||{};class fK extends bh{static get requires(){return[tK,lK,nK,xL]}static get pluginName(){return"MediaEmbed"}}class pK extends bh{static get requires(){return[IL]}static get pluginName(){return"MediaEmbedToolbar"}afterInit(){const t=this.editor;const e=t.t;const n=t.plugins.get(IL);n.register("mediaEmbed",{ariaLabel:e("Media toolbar"),items:t.config.get("mediaEmbed.toolbar")||[],getRelatedElement:V$})}}function bK(t,e){if(!t.childCount){return}const n=new w_(t.document);const i=wK(t,n);if(!i.length){return}let o=null;let r=1;i.forEach(((t,s)=>{const a=TK(i[s-1],t);const c=a?null:i[s-1];const l=IK(c,t);if(a){o=null;r=1}if(!o||l!==0){const i=AK(t,e);if(!o){o=yK(i,t.element,n)}else if(t.indent>r){const t=o.getChild(o.childCount-1);const e=t.getChild(t.childCount-1);o=yK(i,e,n);r+=1}else if(t.indent1){n.setAttribute("start",t.startIndex,o)}return o}function xK(t,e){DK(t,e);e.removeStyle("text-indent",t);return e.rename("li",t)}function EK(t){const e={};const n=t.getStyle("mso-list");if(n){const t=n.match(/(^|\s{1,100})l(\d+)/i);const i=n.match(/\s{0,100}lfo(\d+)/i);const o=n.match(/\s{0,100}level(\d+)/i);if(t&&i&&o){e.id=t[2];e.order=i[1];e.indent=parseInt(o[1])}}return e}function DK(t,e){const n=new $h({name:"span",styles:{"mso-list":"Ignore"}});const i=e.createRangeIn(t);for(const t of i){if(t.type==="elementStart"&&n.match(t.item)){e.remove(t.item)}}}function TK(t,e){if(!t){return true}if(t.id!==e.id){if(e.indent-t.indent===1){return false}return true}const n=e.element.previousSibling;if(!n){return true}return!SK(n)}function SK(t){return t.is("element","ol")||t.is("element","ul")}function IK(t,e){return t?e.indent-t.indent:e.indent-1}function BK(t,e){const n=t.getAncestors({parentFirst:true});let i=null;let o=0;for(const t of n){if(t.is("element","ul")||t.is("element","ol")){o++}if(o===e){i=t;break}}return i}function MK(t,e){if(!t.childCount){return}const n=new w_(t.document);const i=NK(t,n);PK(i,t,n);RK(i,t,n);zK(t,n);const o=VK(t,n);if(o.length){FK(o,OK(e),n)}}function LK(t){return btoa(t.match(/\w{2}/g).map((t=>String.fromCharCode(parseInt(t,16)))).join(""))}function NK(t,e){const n=e.createRangeIn(t);const i=new $h({name:/v:(.+)/});const o=[];for(const t of n){if(t.type!="elementStart"){continue}const e=t.item;const n=e.previousSibling;const r=n&&n.is("element")?n.name:null;if(i.match(e)&&e.getAttribute("o:gfxdata")&&r!=="v:shapetype"){o.push(t.item.getAttribute("id"))}}return o}function PK(t,e,n){const i=n.createRangeIn(e);const o=new $h({name:"img"});const r=[];for(const e of i){if(e.item.is("element")&&o.match(e.item)){const n=e.item;const i=n.getAttribute("v:shapes")?n.getAttribute("v:shapes").split(" "):[];if(i.length&&i.every((e=>t.indexOf(e)>-1))){r.push(n)}else if(!n.getAttribute("src")){r.push(n)}}}for(const t of r){n.remove(t)}}function zK(t,e){const n=e.createRangeIn(t);const i=new $h({name:/v:(.+)/});const o=[];for(const t of n){if(t.type=="elementStart"&&i.match(t.item)){o.push(t.item)}}for(const t of o){e.remove(t)}}function RK(t,e,n){const i=n.createRangeIn(e);const o=[];for(const e of i){if(e.type=="elementStart"&&e.item.is("element","v:shape")){const n=e.item.getAttribute("id");if(t.includes(n)){continue}if(!r(e.item.parent.getChildren(),n)){o.push(e.item)}}}for(const t of o){const e={src:s(t)};if(t.hasAttribute("alt")){e.alt=t.getAttribute("alt")}const i=n.createElement("img",e);n.insertChild(t.index+1,i,t.parent)}function r(t,e){for(const n of t){if(n.is("element")){if(n.name=="img"&&n.getAttribute("v:shapes")==e){return true}if(r(n.getChildren(),e)){return true}}}return false}function s(t){for(const e of t.getChildren()){if(e.is("element")&&e.getAttribute("src")){return e.getAttribute("src")}}}}function VK(t,e){const n=e.createRangeIn(t);const i=new $h({name:"img"});const o=[];for(const t of n){if(t.item.is("element")&&i.match(t.item)){if(t.item.getAttribute("src").startsWith("file://")){o.push(t.item)}}}return o}function OK(t){if(!t){return[]}const e=/{\\pict[\s\S]+?\\bliptag-?\d+(\\blipupi-?\d+)?({\\\*\\blipuid\s?[\da-fA-F]+)?[\s}]*?/;const n=new RegExp("(?:("+e.source+"))([\\da-fA-F\\s]+)\\}","g");const i=t.match(n);const o=[];if(i){for(const t of i){let n=false;if(t.includes("\\pngblip")){n="image/png"}else if(t.includes("\\jpegblip")){n="image/jpeg"}if(n){o.push({hex:t.replace(e,"").replace(/[^\da-fA-F]/g,""),type:n})}}}return o}function FK(t,e,n){if(t.length===e.length){for(let i=0;i/i;const UK=/xmlns:o="urn:schemas-microsoft-com/i;class WK{constructor(t){this.document=t}isActive(t){return HK.test(t)||UK.test(t)}execute(t){const{body:e,stylesString:n}=t._parsedData;bK(e,n);MK(e,t.dataTransfer.getData("text/rtf"));jK(e);t.content=e}}function GK(t,e){for(const n of t.getChildren()){if(n.is("element","b")&&n.getStyle("font-weight")==="normal"){const i=t.getChildIndex(n);e.remove(n);e.insertChild(i,n.getChildren(),t)}}}function qK(t,e){const n=new hf(e.document.stylesProcessor);const i=new fp(n,{renderingMode:"data"});const o=i.blockElements;const r=i.inlineObjectElements;const s=[];for(const n of e.createRangeIn(t)){const t=n.item;if(t.is("element","br")){const n=$K(t,"forward",e,{blockElements:o,inlineObjectElements:r});const i=$K(t,"backward",e,{blockElements:o,inlineObjectElements:r});const a=KK(n,o);const c=KK(i,o);if(c||a){s.push(t)}}}for(const t of s){if(t.hasClass("Apple-interchange-newline")){e.remove(t)}else{e.replace(t,e.createElement("p"))}}}function $K(t,e,n,{blockElements:i,inlineObjectElements:o}){let r=n.createPositionAt(t,e=="forward"?"after":"before");r=r.getLastMatchingPosition((({item:t})=>t.is("element")&&!i.includes(t.name)&&!o.includes(t.name)),{direction:e});return e=="forward"?r.nodeAfter:r.nodeBefore}function KK(t,e){return!!t&&t.is("element")&&e.includes(t.name)}const YK=/id=("|')docs-internal-guid-[-0-9a-f]+("|')/i;class QK{constructor(t){this.document=t}isActive(t){return YK.test(t)}execute(t){const e=new w_(this.document);const{body:n}=t._parsedData;GK(n,e);kK(n,e);qK(n,e);t.content=n}}function ZK(t,e){for(const n of t.getChildren()){if(n.is("element","table")&&n.hasAttribute("xmlns")){e.removeAttribute("xmlns",n)}}}function JK(t,e){for(const n of t.getChildren()){if(n.is("element","google-sheets-html-origin")){const i=t.getChildIndex(n);e.remove(n);e.insertChild(i,n.getChildren(),t)}}}function XK(t,e){for(const n of t.getChildren()){if(n.is("element","table")&&n.getStyle("width")==="0px"){e.removeStyle("width",n)}}}function tY(t,e){for(const n of Array.from(t.getChildren())){if(n.is("element","style")){e.remove(n)}}}const eY=/[^\S\r\n]*?)[\r\n]+([^\S\r\n]*<\/span>)/g,"$1$2").replace(/<\/span>/g,"").replace(/()[\r\n]+(<\/span>)/g,"$1 $2").replace(/ <\//g," ").replace(/ <\/o:p>/g," ").replace(/( |\u00A0)<\/o:p>/g,"").replace(/>([^\S\r\n]*[\r\n]\s*)<")}function oY(t){t.querySelectorAll("span[style*=spacerun]").forEach((t=>{const e=t;const n=e.innerText.length||0;e.innerText=Array(n+1).join(" ").substr(0,n)}))}function rY(t){return t.replace(/(\s+)<\/span>/g,((t,e)=>e.length===1?" ":Array(e.length+1).join(" ").substr(0,e.length)))}function sY(t,e){const n=new DOMParser;t=t.replace(/