import{Command as k,Plugin as b}from"@ckeditor/ckeditor5-core";import{Delete as Rt}from"@ckeditor/ckeditor5-typing";import{Enter as Mt}from"@ckeditor/ckeditor5-enter";import{toArray as C,first as E,uid as pi,env as ct,CKEditorError as bi,FocusTracker as Dt,KeystrokeHandler as zt,global as hi,getCode as Ut,parseKeystroke as $t,getLocalizedArrowKeyCodeDirection as Wt,createElement as Ii}from"@ckeditor/ckeditor5-utils";import{_normalizeFontSizeOptions as qt}from"@ckeditor/ckeditor5-font";import{ClipboardPipeline as yi}from"@ckeditor/ckeditor5-clipboard";import{ButtonView as at,MenuBarMenuListItemButtonView as ki,View as jt,ViewCollection as Ai,FocusCycler as wi,addKeyboardHandlingForGrid as Li,CollapsibleView as vi,LabeledFieldView as _i,createLabeledInputNumber as Ti,SwitchButtonView as Si,createDropdown as Ci,SplitButtonView as xi,MenuBarMenuView as Ei,focusChildOnDropdownOpen as Pi}from"@ckeditor/ckeditor5-ui";import{IconNumberedList as ut,IconBulletedList as dt,IconListStyleDisc as Bi,IconListStyleCircle as Fi,IconListStyleSquare as Vi,IconListStyleDecimal as Ni,IconListStyleDecimalLeadingZero as Oi,IconListStyleLowerRoman as Ri,IconListStyleUpperRoman as Mi,IconListStyleLowerLatin as Di,IconListStyleUpperLatin as zi,IconListStyleArabicIndic as Ui,IconTodoList as $i}from"@ckeditor/ckeditor5-icons";import{DomEventObserver as Wi,Matcher as Kt,ModelTreeWalker as Yt,getViewFillerOffset as qi}from"@ckeditor/ckeditor5-engine";/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class A{_startElement;_referenceIndent;_isForward;_includeSelf;_sameAttributes;_sameIndent;_lowerIndent;_higherIndent;constructor(t,i){this._startElement=t,this._referenceIndent=t.getAttribute("listIndent"),this._isForward=i.direction=="forward",this._includeSelf=!!i.includeSelf,this._sameAttributes=C(i.sameAttributes||[]),this._sameIndent=!!i.sameIndent,this._lowerIndent=!!i.lowerIndent,this._higherIndent=!!i.higherIndent}static first(t,i){const s=new this(t,i)[Symbol.iterator]();return E(s)}*[Symbol.iterator](){const t=[];for(const{node:i}of new P(this._getStartNode(),this._isForward?"forward":"backward")){const e=i.getAttribute("listIndent");if(e<this._referenceIndent){if(!this._lowerIndent)break;this._referenceIndent=e}else if(e>this._referenceIndent){if(!this._higherIndent)continue;if(!this._isForward){t.push(i);continue}}else{if(!this._sameIndent){if(this._higherIndent){t.length&&(yield*t,t.length=0);break}continue}if(this._sameAttributes.some(s=>i.getAttribute(s)!==this._startElement.getAttribute(s)))break}t.length&&(yield*t,t.length=0),yield i}}_getStartNode(){return this._includeSelf?this._startElement:this._isForward?this._startElement.nextSibling:this._startElement.previousSibling}}class P{_node;_isForward;_previousNodesByIndent=[];_previous=null;_previousNodeIndent=null;constructor(t,i="forward"){this._node=t,this._isForward=i==="forward"}[Symbol.iterator](){return this}next(){if(!g(this._node))return{done:!0,value:void 0};const t=this._node.getAttribute("listIndent");let i=null;if(this._previous){const s=this._previousNodeIndent;t>s?this._previousNodesByIndent[s]=this._previous:t<s?(i=this._previousNodesByIndent[t]||null,this._previousNodesByIndent.length=t):i=this._previous}const e={node:this._node,previous:this._previous,previousNodeInList:i};return this._previous=this._node,this._previousNodeIndent=t,this._node=this._isForward?this._node.nextSibling:this._node.previousSibling,{value:e,done:!1}}}class Ht{_listHead;constructor(t){this._listHead=t}[Symbol.iterator](){return new P(this._listHead)}}/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class B{static next(){return pi()}}function g(n){return!!n&&n.is("element")&&n.hasAttribute("listItemId")}function T(n,t={}){return[...S(n,{...t,direction:"backward"}),...S(n,{...t,direction:"forward"})]}function S(n,t={}){const i=t.direction=="forward",e=Array.from(new A(n,{...t,includeSelf:i,sameIndent:!0,sameAttributes:"listItemId"}));return i?e:e.reverse()}function Gt(n){return Array.from(new A(n,{direction:"forward",higherIndent:!0}))}function mt(n,t){const i=new A(n,{sameIndent:!0,sameAttributes:"listType",...t}),e=new A(n,{sameIndent:!0,sameAttributes:"listType",includeSelf:!0,direction:"forward",...t});return[...Array.from(i).reverse(),...e]}function _(n){return!A.first(n,{sameIndent:!0,sameAttributes:"listItemId"})}function ft(n){return!A.first(n,{direction:"forward",sameIndent:!0,sameAttributes:"listItemId"})}function F(n,t={}){n=C(n);const i=t.withNested!==!1,e=new Set;for(const s of n)for(const r of T(s,{higherIndent:i}))e.add(r);return x(e)}function z(n){n=C(n);const t=new Set;for(const i of n)for(const e of mt(i))t.add(e);return x(t)}function j(n,t){const i=S(n,{direction:"forward"}),e=B.next();for(const s of i)t.setAttribute("listItemId",e,s);return i}function K(n,t,i){const e={};for(const[r,o]of t.getAttributes())r.startsWith("list")&&(e[r]=o);const s=S(n,{direction:"forward"});for(const r of s)i.setAttributes(e,r);return s}function Y(n,t,{expand:i,indentBy:e=1,attributeNames:s}){n=C(n);const r=i?F(n):n;for(const o of r){const l=o.getAttribute("listIndent")+e;l<0?U(o,t,s):t.setAttribute("listIndent",l,o)}return r}function Xt(n,t,{attributeNames:i}){n=C(n);const e=F(n),s=new Set,r=Math.min(...e.map(l=>l.getAttribute("listIndent"))),o=new Map;for(const l of e)o.set(l,A.first(l,{lowerIndent:!0}));for(const l of e){if(s.has(l))continue;s.add(l);const c=l.getAttribute("listIndent")-1;if(c<0){U(l,t,i);continue}if(l.getAttribute("listIndent")==r){const a=Ki(l,o.get(l),t);for(const u of a)s.add(u);if(a.length)continue}t.setAttribute("listIndent",c,l)}return x(s)}function U(n,t,i){n=C(n);for(const e of n)e.is("element","listItem")&&t.rename(e,"paragraph");for(const e of n)for(const s of e.getAttributeKeys())i.includes(s)&&t.removeAttribute(s,e);return n}function V(n){if(!n.length)return!1;const t=n[0].getAttribute("listItemId");return t?!n.some(i=>i.getAttribute("listItemId")!=t):!1}function Zt(n,t){const i=[];let e=Number.POSITIVE_INFINITY;for(const{node:s}of new P(n.nextSibling)){const r=s.getAttribute("listIndent");if(r==0)break;r<e&&(e=r);const o=r-e;t.setAttribute("listIndent",o,s),i.push(s)}return i}function x(n){return Array.from(n).filter(t=>t.root.rootName!=="$graveyard").sort((t,i)=>t.index-i.index)}function N(n){const t=n.document.selection.getSelectedElement();return t&&n.schema.isObject(t)&&n.schema.isBlock(t)?t:null}function H(n,t){return t.checkChild(n.parent,"listItem")&&t.checkChild(n,"$text")&&!t.isObject(n)}function $(n){return n=="numbered"||n=="customNumbered"}function ji(n){return!A.first(n,{sameIndent:!0,sameAttributes:"listType"})}function Ki(n,t,i){return S(t,{direction:"forward"}).pop().index>n.index?K(n,t,i):[]}/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class gt extends k{_direction;constructor(t,i){super(t),this._direction=i}refresh(){this.isEnabled=this._checkEnabled()}execute(){const t=this.editor,i=t.model,e=Jt(i.document.selection),r=t.plugins.get("ListEditing").getListAttributeNames();i.change(o=>{const l=[];V(e)&&!_(e[0])?(this._direction=="forward"&&l.push(...Y(e,o,{attributeNames:r})),l.push(...j(e[0],o))):this._direction=="forward"?l.push(...Y(e,o,{expand:!0,attributeNames:r})):l.push(...Xt(e,o,{attributeNames:r}));for(const c of l){if(!c.hasAttribute("listType"))continue;const a=A.first(c,{sameIndent:!0});a&&o.setAttribute("listType",a.getAttribute("listType"),c)}this._fireAfterExecute(l)})}_fireAfterExecute(t){this.fire("afterExecute",x(new Set(t)))}_checkEnabled(){let t=Jt(this.editor.model.document.selection),i=t[0];if(!i)return!1;if(this._direction=="backward"||V(t)&&!_(t[0]))return!0;t=F(t),i=t[0];const e=A.first(i,{sameIndent:!0});return e?e.getAttribute("listType")==i.getAttribute("listType"):!1}}function Jt(n){const t=Array.from(n.getSelectedBlocks()),i=t.findIndex(e=>!g(e));return i!=-1&&(t.length=i),t}/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class O extends k{type;_listWalkerOptions;constructor(t,i,e={}){super(t),this.type=i,this._listWalkerOptions=e.multiLevel?{higherIndent:!0,lowerIndent:!0,sameAttributes:[]}:void 0}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(t={}){const i=this.editor.model,e=i.document,s=N(i),r=Array.from(e.selection.getSelectedBlocks()).filter(l=>i.schema.checkAttribute(l,"listType")||H(l,i.schema)),o=t.forceValue!==void 0?!t.forceValue:this.value;i.change(l=>{if(o){const c=r[r.length-1],u=this.editor.plugins.get("ListEditing").getListAttributeNames(),d=S(c,{direction:"forward"}),m=[];d.length>1&&m.push(...j(d[1],l)),m.push(...U(r,l,u)),m.push(...Zt(c,l)),this._fireAfterExecute(m)}else if((s||e.selection.isCollapsed)&&g(r[0])){const c=mt(s||r[0],this._listWalkerOptions);for(const a of c)l.setAttributes({...t.additionalAttributes,listType:this.type},a);this._fireAfterExecute(c)}else{const c=[];for(const a of r)if(!a.hasAttribute("listType"))!a.is("element","listItem")&&H(a,i.schema)&&l.rename(a,"listItem"),l.setAttributes({...t.additionalAttributes,listIndent:0,listItemId:B.next(),listType:this.type},a),c.push(a);else for(const u of F(a,{withNested:!1}))u.getAttribute("listType")!=this.type&&(l.setAttributes({...t.additionalAttributes,listType:this.type},u),c.push(u));this._fireAfterExecute(c)}})}_fireAfterExecute(t){this.fire("afterExecute",x(new Set(t)))}_getValue(){const t=this.editor.model.document.selection,i=Array.from(t.getSelectedBlocks());if(!i.length)return!1;for(const e of i)if(e.getAttribute("listType")!=this.type)return!1;return!0}_checkEnabled(){const t=this.editor.model,i=t.schema,e=t.document.selection,s=Array.from(e.getSelectedBlocks());if(!s.length)return!1;if(this.value)return!0;for(const r of s)if(i.checkAttribute(r,"listType")||H(r,i))return!0;return!1}}/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class pt extends k{_direction;constructor(t,i){super(t),this._direction=i}refresh(){this.isEnabled=this._checkEnabled()}execute({shouldMergeOnBlocksContentLevel:t=!1}={}){const i=this.editor,e=i.model,s=e.document.selection,r=[],l=i.plugins.get("ListEditing").getListAttributeNames();e.change(c=>{const{firstElement:a,lastElement:u}=this._getMergeSubjectElements(s,t),d=a.getAttribute("listIndent")||0,m=u.getAttribute("listIndent"),f=u.getAttribute("listItemId");if(d!=m){const p=Gt(u);r.push(...Y([u,...p],c,{indentBy:d-m,expand:d<m,attributeNames:l}))}if(t){let p=s;s.isCollapsed&&(p=c.createSelection(c.createRange(c.createPositionAt(a,"end"),c.createPositionAt(u,0)))),e.deleteContent(p,{doNotResetEntireContent:s.isCollapsed});const h=p.getLastPosition().parent,I=h.nextSibling;r.push(h),I&&I!==u&&I.getAttribute("listItemId")==f&&r.push(...K(I,h,c))}else r.push(...K(u,a,c));this._fireAfterExecute(r)})}_fireAfterExecute(t){this.fire("afterExecute",x(new Set(t)))}_checkEnabled(){const t=this.editor.model,i=t.document.selection,e=N(t);if(i.isCollapsed||e){const s=e||i.getFirstPosition().parent;if(!g(s))return!1;const r=this._direction=="backward"?s.previousSibling:s.nextSibling;if(!r||V([s,r]))return!1}else{const s=i.getLastPosition(),r=i.getFirstPosition();if(s.parent===r.parent||!g(s.parent))return!1}return!0}_getMergeSubjectElements(t,i){const e=this.editor.model,s=N(e);let r,o;if(t.isCollapsed||s){const l=s||t.getFirstPosition().parent,c=_(l);this._direction=="backward"?(o=l,c&&!i?r=A.first(l,{sameIndent:!0,lowerIndent:!0}):r=l.previousSibling):(r=l,o=l.nextSibling)}else r=t.getFirstPosition().parent,o=t.getLastPosition().parent;return{firstElement:r,lastElement:o}}}/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class bt extends k{_direction;constructor(t,i){super(t),this._direction=i}refresh(){this.isEnabled=this._checkEnabled()}execute(){this.editor.model.change(i=>{const e=j(this._getStartBlock(),i);this._fireAfterExecute(e)})}_fireAfterExecute(t){this.fire("afterExecute",x(new Set(t)))}_checkEnabled(){const t=this.editor.model.document.selection,i=this._getStartBlock();return t.isCollapsed&&g(i)&&!_(i)}_getStartBlock(){const i=this.editor.model.document.selection.getFirstPosition().parent;return this._direction=="before"?i:i.nextSibling}}/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class Qt extends b{static get pluginName(){return"ListItemBoldIntegration"}static get isOfficialPlugin(){return!0}static get requires(){return[y]}init(){const t=this.editor,i=t.plugins.get("ListFormatting"),e=t.plugins.get(y);!t.plugins.has("BoldEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting")||(i.registerFormatAttribute("bold","listItemBold"),e.registerDowncastStrategy({scope:"item",attributeName:"listItemBold",setAttributeOnDowncast(s,r,o,l){r&&(s.addClass("ck-list-marker-bold",o),ct.isSafari&&!(l&&l.dataPipeline)&&s.setStyle("--ck-content-list-marker-dummy-bold","0",o))}}))}afterInit(){const t=this.editor,i=t.model;!t.plugins.has("BoldEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting")||(i.schema.extend("$listItem",{allowAttributes:"listItemBold"}),i.schema.setAttributeProperties("listItemBold",{isFormatting:!0}),i.schema.addAttributeCheck(e=>{if(!e.last.getAttribute("listItemId"))return!1},"listItemBold"),t.conversion.for("upcast").attributeToAttribute({model:"listItemBold",view:{name:"li",classes:"ck-list-marker-bold"}}))}}/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class te extends b{static get pluginName(){return"ListItemItalicIntegration"}static get isOfficialPlugin(){return!0}static get requires(){return[y]}init(){const t=this.editor,i=t.plugins.get("ListFormatting"),e=t.plugins.get(y);!t.plugins.has("ItalicEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting")||(i.registerFormatAttribute("italic","listItemItalic"),e.registerDowncastStrategy({scope:"item",attributeName:"listItemItalic",setAttributeOnDowncast(s,r,o,l){r&&(s.addClass("ck-list-marker-italic",o),ct.isSafari&&!(l&&l.dataPipeline)&&s.setStyle("--ck-content-list-marker-dummy-italic","0",o))}}))}afterInit(){const t=this.editor,i=t.model;!t.plugins.has("ItalicEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting")||(i.schema.extend("$listItem",{allowAttributes:"listItemItalic"}),i.schema.setAttributeProperties("listItemItalic",{isFormatting:!0}),i.schema.addAttributeCheck(e=>{if(!e.last.getAttribute("listItemId"))return!1},"listItemItalic"),t.conversion.for("upcast").attributeToAttribute({model:"listItemItalic",view:{name:"li",classes:"ck-list-marker-italic"}}))}}/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class ee extends b{static get pluginName(){return"ListItemFontSizeIntegration"}static get isOfficialPlugin(){return!0}static get requires(){return[y]}init(){const t=this.editor,i=t.plugins.get("ListFormatting"),e=t.plugins.get(y);if(!t.plugins.has("FontSizeEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting"))return;const s=qt(t.config.get("fontSize.options"));i.registerFormatAttribute("fontSize","listItemFontSize"),e.registerDowncastStrategy({scope:"item",attributeName:"listItemFontSize",setAttributeOnDowncast(r,o,l,c){if(o){const a=s.find(u=>u.model==o);a&&a.view&&typeof a.view!="string"?a.view.styles?(r.addClass("ck-list-marker-font-size",l),r.setStyle("--ck-content-list-marker-font-size",a.view.styles["font-size"],l)):a.view.classes&&(r.addClass(`ck-list-marker-font-size-${o}`,l),ct.isSafari&&!(c&&c.dataPipeline)&&r.setStyle("--ck-content-list-marker-dummy-font-size","0",l)):(r.addClass("ck-list-marker-font-size",l),r.setStyle("--ck-content-list-marker-font-size",o,l))}}})}afterInit(){const t=this.editor,i=t.model;if(!t.plugins.has("FontSizeEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting"))return;i.schema.extend("$listItem",{allowAttributes:"listItemFontSize"}),i.schema.setAttributeProperties("listItemFontSize",{isFormatting:!0}),i.schema.addAttributeCheck(s=>{if(!s.last.getAttribute("listItemId"))return!1},"listItemFontSize"),t.conversion.for("upcast").elementToAttribute({model:{key:"listItemFontSize",value:s=>s.getStyle("--ck-content-list-marker-font-size")},view:{name:"li",classes:"ck-list-marker-font-size",styles:{"--ck-content-list-marker-font-size":/.*/}}});const e=qt(t.config.get("fontSize.options"));for(const s of e)s.model&&s.view&&t.conversion.for("upcast").elementToAttribute({model:{key:"listItemFontSize",value:s.model},view:{name:"li",classes:`ck-list-marker-font-size-${s.model}`}})}}/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class ie extends b{static get pluginName(){return"ListItemFontColorIntegration"}static get isOfficialPlugin(){return!0}static get requires(){return[y]}init(){const t=this.editor,i=t.plugins.get("ListFormatting"),e=t.plugins.get(y);!t.plugins.has("FontColorEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting")||(i.registerFormatAttribute("fontColor","listItemFontColor"),e.registerDowncastStrategy({scope:"item",attributeName:"listItemFontColor",setAttributeOnDowncast(s,r,o){r&&(s.addClass("ck-list-marker-color",o),s.setStyle("--ck-content-list-marker-color",r,o))}}))}afterInit(){const t=this.editor,i=t.model;!t.plugins.has("FontColorEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting")||(i.schema.extend("$listItem",{allowAttributes:"listItemFontColor"}),i.schema.setAttributeProperties("listItemFontColor",{isFormatting:!0}),i.schema.addAttributeCheck(e=>{if(!e.last.getAttribute("listItemId"))return!1},"listItemFontColor"),t.conversion.for("upcast").attributeToAttribute({model:{key:"listItemFontColor",value:e=>e.getStyle("--ck-content-list-marker-color")},view:{name:"li",classes:"ck-list-marker-color",styles:{"--ck-content-list-marker-color":/.*/}}}))}}/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class se extends b{static get pluginName(){return"ListItemFontFamilyIntegration"}static get isOfficialPlugin(){return!0}static get requires(){return[y]}init(){const t=this.editor,i=t.plugins.get("ListFormatting"),e=t.plugins.get(y);!t.plugins.has("FontFamilyEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting")||(i.registerFormatAttribute("fontFamily","listItemFontFamily"),e.registerDowncastStrategy({scope:"item",attributeName:"listItemFontFamily",setAttributeOnDowncast(s,r,o){r&&(s.addClass("ck-list-marker-font-family",o),s.setStyle("--ck-content-list-marker-font-family",r,o))}}))}afterInit(){const t=this.editor,i=t.model;!t.plugins.has("FontFamilyEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting")||(i.schema.extend("$listItem",{allowAttributes:"listItemFontFamily"}),i.schema.setAttributeProperties("listItemFontFamily",{isFormatting:!0}),i.schema.addAttributeCheck(e=>{if(!e.last.getAttribute("listItemId"))return!1},"listItemFontFamily"),t.conversion.for("upcast").attributeToAttribute({model:{key:"listItemFontFamily",value:e=>e.getStyle("--ck-content-list-marker-font-family")},view:{name:"li",classes:"ck-list-marker-font-family",styles:{"--ck-content-list-marker-font-family":/.*/}}}))}}function R(n,{insertAt:t}={}){if(!n||typeof document>"u")return;const i=document.head||document.getElementsByTagName("head")[0],e=document.createElement("style");e.type="text/css",window.litNonce&&e.setAttribute("nonce",window.litNonce),t==="top"&&i.firstChild?i.insertBefore(e,i.firstChild):i.appendChild(e),e.styleSheet?e.styleSheet.cssText=n:e.appendChild(document.createTextNode(n))}R(":root{--ck-content-list-marker-color:var(--ck-content-font-color);--ck-content-list-marker-font-family:var(--ck-content-font-family);--ck-content-list-marker-font-size:var(--ck-content-font-size)}.ck-content li>p:first-of-type{margin-top:0}.ck-content li>p:only-of-type{margin-bottom:0;margin-top:0}.ck-content li.ck-list-marker-bold::marker{font-weight:700}.ck-content li.ck-list-marker-italic::marker{font-style:italic}.ck-content li.ck-list-marker-color::marker{color:var(--ck-content-list-marker-color)}.ck-content li.ck-list-marker-font-family::marker{font-family:var(--ck-content-list-marker-font-family)}.ck-content li.ck-list-marker-font-size::marker{font-size:var(--ck-content-list-marker-font-size)}.ck-content li.ck-list-marker-font-size-tiny::marker{font-size:var(--ck-content-font-size-tiny)}.ck-content li.ck-list-marker-font-size-small::marker{font-size:var(--ck-content-font-size-small)}.ck-content li.ck-list-marker-font-size-big::marker{font-size:var(--ck-content-font-size-big)}.ck-content li.ck-list-marker-font-size-huge::marker{font-size:var(--ck-content-font-size-huge)}");/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class ne extends b{_loadedFormatting={};static get pluginName(){return"ListFormatting"}static get isOfficialPlugin(){return!0}static get requires(){return[Qt,te,ee,ie,se]}constructor(t){super(t),t.config.define("list.enableListItemMarkerFormatting",!0)}afterInit(){this.editor.config.get("list.enableListItemMarkerFormatting")&&this._registerPostfixerForListItemFormatting()}_registerPostfixerForListItemFormatting(){const t=this.editor.model;t.document.registerPostFixer(i=>{const e=t.document.differ.getChanges(),s=new Set;let r=!1;for(const o of e)if(o.type==="attribute")(o.attributeKey=="listItemId"||o.attributeKey=="listType"||this._isInlineOrSelectionFormatting(o.attributeKey)||Object.values(this._loadedFormatting).includes(o.attributeKey))&&(g(o.range.start.nodeAfter)?s.add(o.range.start.nodeAfter):g(o.range.start.parent)&&s.add(o.range.start.parent));else if(g(o.position.nodeAfter)&&s.add(o.position.nodeAfter),g(o.position.nodeBefore)&&s.add(o.position.nodeBefore),g(o.position.parent)&&s.add(o.position.parent),o.type=="insert"&&o.name!="$text"){const l=i.createRangeIn(o.position.nodeAfter);for(const c of l.getItems())g(c)&&s.add(c)}for(const o of s){const l=Yi(t,o,Object.keys(this._loadedFormatting));for(const[c,a]of Object.entries(l)){const u=this._loadedFormatting[c];(a&&Hi(i,o,u,a)||!a&&Gi(i,o,u))&&(r=!0)}}return r})}registerFormatAttribute(t,i){this._loadedFormatting[t]=i}_isInlineOrSelectionFormatting(t){return t.replace(/^selection:/,"")in this._loadedFormatting}}function Yi(n,t,i){if(_(t))return re(n,t,i);const e=T(t);return re(n,e[0],i)}function re(n,t,i){if(!Xi(t)||n.schema.isLimit(t))return Object.fromEntries(i.map(l=>[l]));if(t.isEmpty)return Object.fromEntries(i.map(l=>[l,t.getAttribute(`selection:${l}`)]));const e=new Set(i),s={},o=n.createRangeIn(t).getWalker({ignoreElementEnd:!0});for(const{item:l}of o){for(const c of e)if(n.schema.checkAttribute(l,c)){const a=l.getAttribute(c);a===void 0?(e.delete(c),s[c]=void 0):s[c]===void 0?s[c]=a:s[c]!==a&&(e.delete(c),s[c]=void 0)}else c in s||(s[c]=void 0);if(!e.size)break;n.schema.isLimit(l)&&o.jumpTo(n.createPositionAfter(l))}return s}function Hi(n,t,i,e){const s=T(t);let r=!1;for(const o of s)(!o.hasAttribute(i)||o.getAttribute(i)!==e)&&(n.setAttribute(i,e,o),r=!0);return r}function Gi(n,t,i){const e=T(t);let s=!1;for(const r of e)r.hasAttribute(i)&&(n.removeAttribute(i,r),s=!0);return s}function Xi(n){return["numbered","bulleted","customNumbered","customBulleted"].includes(n.getAttribute("listType"))}/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class oe extends b{static get pluginName(){return"ListUtils"}static get isOfficialPlugin(){return!0}expandListBlocksToCompleteList(t){return z(t)}isFirstBlockOfListItem(t){return _(t)}isListItemBlock(t){return g(t)}expandListBlocksToCompleteItems(t,i={}){return F(t,i)}isNumberedListType(t){return $(t)}isFirstListItemInList(t){return ji(t)}}/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/function le(n){return n.is("element","ol")||n.is("element","ul")}function G(n){return n.is("element","li")}function ce(n){let t=0,i=n.parent;for(;i;){if(G(i))t++;else{const e=i.previousSibling;e&&G(e)&&t++}i=i.parent}return t}function ae(n,t,i,e=It(i,t)){return n.createAttributeElement(ht(i),null,{priority:2*t/100-100,id:e})}function ue(n,t,i){return n.createAttributeElement("li",null,{priority:(2*t+1)/100-100,id:i})}function ht(n){return n=="numbered"||n=="customNumbered"?"ol":"ul"}function It(n,t){return`list-${n}-${t}`}/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/function L(n,t,i){const e=n.nodeBefore;if(g(e)){let s=e;for(const{node:r}of new P(s,"backward"))if(s=r,i.has(s)||(i.add(s),t.has(e)))return;t.add(s)}else{const s=n.nodeAfter;g(s)&&t.add(s)}}function de(n,t){let i=0,e=-1,s=null,r=!1;for(const{node:o}of n){const l=o.getAttribute("listIndent");if(l>i){let c;s===null?(s=l-i,c=i):(s>l&&(s=l),c=l-s),c>e+1&&(c=e+1),t.setAttribute("listIndent",c,o),r=!0,e=c}else s=null,i=l+1,e=l}return r}function me(n,t,i){const e=new Set;let s=!1;for(const{node:r}of n){if(e.has(r))continue;let o=r.getAttribute("listType"),l=r.getAttribute("listItemId");if(t.has(l)&&(l=B.next()),t.add(l),r.is("element","listItem")){r.getAttribute("listItemId")!=l&&(i.setAttribute("listItemId",l,r),s=!0);continue}for(const c of S(r,{direction:"forward"}))e.add(c),c.getAttribute("listType")!=o&&(l=B.next(),o=c.getAttribute("listType")),c.getAttribute("listItemId")!=l&&(i.setAttribute("listItemId",l,c),s=!0)}return s}/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/function fe(){return(n,t,i)=>{const{writer:e,schema:s}=i;if(!t.modelRange)return;const r=Array.from(t.modelRange.getItems({shallow:!0})).filter(d=>s.checkAttribute(d,"listItemId"));if(!r.length)return;const o=t.viewItem.getAttribute("data-list-item-id")||B.next();i.consumable.consume(t.viewItem,{attributes:"data-list-item-id"});const l=ce(t.viewItem);let c=t.viewItem.parent&&t.viewItem.parent.is("element","ol")?"numbered":"bulleted";const a=r[0].getAttribute("listType");a&&(c=a);const u={listItemId:o,listIndent:l,listType:c};for(const d of r)d.hasAttribute("listItemId")||e.setAttributes(u,d);r.length>1&&r[1].getAttribute("listItemId")!=u.listItemId&&i.keepEmptyElement(r[0])}}function ge(n,t,i,e){return()=>{const c=n.document.differ.getChanges(),a=[],u=new Set,d=new Set,m=new Set;for(const f of c)if(f.type=="insert"&&f.name!="$text")L(f.position,u,m),f.attributes.has("listItemId")?d.add(f.position.nodeAfter):L(f.position.getShiftedBy(f.length),u,m);else if(f.type=="remove"&&f.attributes.has("listItemId"))L(f.position,u,m);else if(f.type=="attribute"){const p=f.range.start.nodeAfter;i.includes(f.attributeKey)?(L(f.range.start,u,m),f.attributeNewValue===null?(L(f.range.start.getShiftedBy(1),u,m),r(p)&&a.push(p)):d.add(p)):g(p)&&r(p)&&a.push(p)}for(const f of u.values())a.push(...s(f,d));for(const f of new Set(a))t.reconvertItem(f)};function s(c,a){const u=[],d=new Set,m=[];for(const{node:f,previous:p}of new P(c)){if(d.has(f))continue;const h=f.getAttribute("listIndent");p&&h<p.getAttribute("listIndent")&&(m.length=h+1),m[h]={modelAttributes:Object.fromEntries(Array.from(f.getAttributes()).filter(([w])=>i.includes(w))),modelElement:f};const I=S(f,{direction:"forward"});for(const w of I)d.add(w),(r(w,I)||l(w,m,a))&&u.push(w)}return u}function r(c,a){const u=t.mapper.toViewElement(c);if(!u)return!1;if(o(u)||e.fire("checkElement",{modelElement:c,viewElement:u}))return!0;if(!c.is("element","paragraph")&&!c.is("element","listItem"))return!1;const m=ye(c,i,a);return m&&u.is("element","p")?!0:!!(!m&&u.is("element","span"))}function o(c){for(c=c.parent;c.is("attributeElement")&&["ol","ul","li"].includes(c.name);)c=c.parent;return!!(c.getCustomProperty("$structureSlotParent")&&!t.mapper.toModelElement(c))}function l(c,a,u){if(u.has(c))return!1;const d=t.mapper.toViewElement(c);let m=a.length-1;for(let f=d.parent;!f.is("editableElement");f=f.parent){const p=G(f),h=le(f);if(!h&&!p)continue;const I=`checkAttributes:${p?"item":"list"}`;if(e.fire(I,{viewElement:f,modelAttributes:a[m].modelAttributes,modelReferenceElement:a[m].modelElement}))break;if(h&&(m--,m<0))return!1}return!0}}function yt(n,t,i,{dataPipeline:e}={}){const s=ts(n,t);return(r,o,l)=>{const{writer:c,mapper:a,consumable:u}=l,d=o.item;if(!n.includes(o.attributeKey)||!s(d,u))return;const m={...l.options,dataPipeline:e},f=be(d,a,i,c);Ie(f,c,a),Ji(f,c);const p=Zi(d,f,t,c,m);Qi(d,p,t,c,m)}}function pe(n){return(t,i,e)=>{const{writer:s,mapper:r}=e,o=t.name.split(":")[1];if(!n.checkAttribute(o,"listItemId"))return;const l=r.toViewPosition(i.position),c=i.position.getShiftedBy(i.length),a=r.toViewPosition(c,{isPhantom:!0}),d=s.createRange(l,a).getTrimmed().end.nodeBefore;/* istanbul ignore next -- @preserve */d&&Ie(d,s,r)}}function kt(n,{dataPipeline:t}={}){return(i,{writer:e})=>{if(!ye(i,n))return null;if(!t)return e.createContainerElement("span",{class:"ck-list-bogus-paragraph"});const s=e.createContainerElement("p");return e.setCustomProperty("dataPipeline:transparentRendering",!0,s),s}}function be(n,t,i,e){const s=i.createRangeOn(n),o=t.toViewRange(s).getTrimmed().getWalker();for(const{item:l}of o)if(l.is("element")&&l.getCustomProperty("listItemMarker"))o.jumpTo(e.createPositionAfter(l));else if(l.is("element")&&!l.getCustomProperty("listItemWrapper"))return l}function he(n,t){return(i,e)=>{if(e.modelPosition.offset>0)return;const s=e.modelPosition.parent;if(!g(s)||!n.some(a=>a.scope=="itemMarker"&&a.canInjectMarkerIntoElement&&a.canInjectMarkerIntoElement(s)))return;const r=e.mapper.toViewElement(s),o=t.createRangeIn(r),l=o.getWalker();let c=o.start;for(const{item:a}of l){if(a.is("element")&&e.mapper.toModelElement(a)||a.is("$textProxy"))break;a.is("element")&&a.getCustomProperty("listItemMarker")&&(c=t.createPositionAfter(a),l.skip(({previousPosition:u})=>!u.isEqual(c)))}e.viewPosition=c}}function Ie(n,t,i){for(;n.parent.is("attributeElement")&&n.parent.getCustomProperty("listItemWrapper");)t.unwrap(t.createRangeOn(n),n.parent);const e=[];s(t.createPositionBefore(n).getWalker({direction:"backward"})),s(t.createRangeIn(n).getWalker());for(const r of e)t.remove(r);function s(r){for(const{item:o}of r){if(o.is("element")&&i.toModelElement(o))break;o.is("element")&&o.getCustomProperty("listItemMarker")&&e.push(o)}}}function Zi(n,t,i,e,{dataPipeline:s}){let r=e.createRangeOn(t);if(!_(n))return r;for(const o of i){if(o.scope!="itemMarker")continue;const l=o.createElement(e,n,{dataPipeline:s});if(!l||(e.setCustomProperty("listItemMarker",!0,l),o.canInjectMarkerIntoElement&&o.canInjectMarkerIntoElement(n)?e.insert(e.createPositionAt(t,0),l):(e.insert(r.start,l),r=e.createRange(e.createPositionBefore(l),e.createPositionAfter(t))),!o.createWrapperElement||!o.canWrapElement))continue;const c=o.createWrapperElement(e,n,{dataPipeline:s});e.setCustomProperty("listItemWrapper",!0,c),o.canWrapElement(n)?r=e.wrap(r,c):(r=e.wrap(e.createRangeOn(l),c),r=e.createRange(r.start,e.createPositionAfter(t)))}return r}function Ji(n,t){let i=n.parent;for(;i.is("attributeElement")&&["ul","ol","li"].includes(i.name);){const e=i.parent;t.unwrap(t.createRangeOn(n),i),i=e}}function Qi(n,t,i,e,s){if(!n.hasAttribute("listIndent"))return;const r=n.getAttribute("listIndent");let o=n;for(let l=r;l>=0;l--){const c=ue(e,l,o.getAttribute("listItemId")),a=ae(e,l,o.getAttribute("listType"));for(const u of i)(u.scope=="list"||u.scope=="item")&&o.hasAttribute(u.attributeName)&&u.setAttributeOnDowncast(e,o.getAttribute(u.attributeName),u.scope=="list"?a:c,s,o);if(t=e.wrap(t,c),t=e.wrap(t,a),l==0||(o=A.first(o,{lowerIndent:!0}),!o))break}}function ts(n,t){const i=t.filter(e=>e.consume===!1).map(e=>e.attributeName);return(e,s)=>{const r=[];for(const o of n)e.hasAttribute(o)&&!i.includes(o)&&r.push(`attribute:${o}`);return r.every(o=>s.test(e,o)!==!1)?(r.forEach(o=>s.consume(e,o)),!0):!1}}function ye(n,t,i=T(n)){if(!g(n))return!1;for(const e of n.getAttributeKeys())if(!(e.startsWith("selection:")||e=="htmlEmptyBlock")&&!t.includes(e))return!1;return i.length<2}R(".ck-editor__editable .ck-list-bogus-paragraph{display:block}"),R(".ck-content ol{list-style-type:decimal}.ck-content ol ol{list-style-type:lower-latin}.ck-content ol ol ol{list-style-type:lower-roman}.ck-content ol ol ol ol{list-style-type:upper-latin}.ck-content ol ol ol ol ol{list-style-type:upper-roman}.ck-content ul{list-style-type:disc}.ck-content ul ul{list-style-type:circle}.ck-content ul ul ul,.ck-content ul ul ul ul{list-style-type:square}");/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/const X=["listType","listIndent","listItemId"];class y extends b{_downcastStrategies=[];static get pluginName(){return"ListEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[Mt,Rt,oe,yi,ne]}constructor(t){super(t),t.config.define("list.multiBlock",!0)}init(){const t=this.editor,i=t.model,e=t.config.get("list.multiBlock");if(t.plugins.has("LegacyListEditing"))throw new bi("list-feature-conflict",this,{conflictPlugin:"LegacyListEditing"});i.schema.register("$listItem",{allowAttributes:X}),e?(i.schema.extend("$container",{allowAttributesOf:"$listItem"}),i.schema.extend("$block",{allowAttributesOf:"$listItem"}),i.schema.extend("$blockObject",{allowAttributesOf:"$listItem"})):i.schema.register("listItem",{inheritAllFrom:"$block",allowAttributesOf:"$listItem"});for(const s of X)i.schema.setAttributeProperties(s,{copyOnReplace:!0});t.commands.add("numberedList",new O(t,"numbered")),t.commands.add("bulletedList",new O(t,"bulleted")),t.commands.add("customNumberedList",new O(t,"customNumbered",{multiLevel:!0})),t.commands.add("customBulletedList",new O(t,"customBulleted",{multiLevel:!0})),t.commands.add("indentList",new gt(t,"forward")),t.commands.add("outdentList",new gt(t,"backward")),t.commands.add("splitListItemBefore",new bt(t,"before")),t.commands.add("splitListItemAfter",new bt(t,"after")),e&&(t.commands.add("mergeListItemBackward",new pt(t,"backward")),t.commands.add("mergeListItemForward",new pt(t,"forward"))),this._setupDeleteIntegration(),this._setupEnterIntegration(),this._setupTabIntegration(),this._setupClipboardIntegration(),this._setupAccessibilityIntegration(),this._setupListItemIdConversionStrategy()}afterInit(){const i=this.editor.commands,e=i.get("indent"),s=i.get("outdent");e&&e.registerChildCommand(i.get("indentList"),{priority:"high"}),s&&s.registerChildCommand(i.get("outdentList"),{priority:"lowest"}),this._setupModelPostFixing(),this._setupConversion()}registerDowncastStrategy(t){this._downcastStrategies.push(t)}getListAttributeNames(){return[...X,...this._downcastStrategies.map(t=>t.attributeName)]}_setupDeleteIntegration(){const t=this.editor,i=t.commands.get("mergeListItemBackward"),e=t.commands.get("mergeListItemForward");this.listenTo(t.editing.view.document,"delete",(s,r)=>{const o=t.model.document.selection;N(t.model)||t.model.change(()=>{const l=o.getFirstPosition();if(o.isCollapsed&&r.direction=="backward"){if(!l.isAtStart)return;const c=l.parent;if(!g(c))return;if(!A.first(c,{sameAttributes:"listType",sameIndent:!0})&&c.getAttribute("listIndent")===0)ft(c)||t.execute("splitListItemAfter"),t.execute("outdentList");else{if(!i||!i.isEnabled)return;i.execute({shouldMergeOnBlocksContentLevel:ke(t.model,"backward")})}r.preventDefault(),s.stop()}else{if(o.isCollapsed&&!o.getLastPosition().isAtEnd||!e||!e.isEnabled)return;e.execute({shouldMergeOnBlocksContentLevel:ke(t.model,"forward")}),r.preventDefault(),s.stop()}})},{context:"li"})}_setupEnterIntegration(){const t=this.editor,i=t.model,e=t.commands,s=e.get("enter");this.listenTo(t.editing.view.document,"enter",(r,o)=>{const l=i.document,c=l.selection.getFirstPosition().parent;if(l.selection.isCollapsed&&g(c)&&c.isEmpty&&!o.isSoft){const a=_(c),u=ft(c);a&&u?(t.execute("outdentList"),o.preventDefault(),r.stop()):a&&!u?(t.execute("splitListItemAfter"),o.preventDefault(),r.stop()):u&&(t.execute("splitListItemBefore"),o.preventDefault(),r.stop())}},{context:"li"}),this.listenTo(s,"afterExecute",()=>{const r=e.get("splitListItemBefore");if(r.refresh(),!r.isEnabled)return;const l=t.model.document.selection.getLastPosition().parent;T(l).length===2&&r.execute()})}_setupTabIntegration(){const t=this.editor;this.listenTo(t.editing.view.document,"tab",(i,e)=>{const s=e.shiftKey?"outdentList":"indentList";this.editor.commands.get(s).isEnabled&&(t.execute(s),e.stopPropagation(),e.preventDefault(),i.stop())},{context:"li"})}_setupConversion(){const t=this.editor,i=t.model,e=this.getListAttributeNames(),s=t.config.get("list.multiBlock"),r=s?"paragraph":"listItem";t.conversion.for("upcast").elementToElement({view:"li",model:(l,{writer:c})=>c.createElement(r,{listType:""})}).elementToElement({view:"p",model:(l,{writer:c})=>l.parent&&l.parent.is("element","li")?c.createElement(r,{listType:""}):null,converterPriority:"high"}).add(l=>{l.on("element:li",fe())}),s||t.conversion.for("downcast").elementToElement({model:"listItem",view:"p"}),t.conversion.for("editingDowncast").elementToElement({model:r,view:kt(e),converterPriority:"high"}).add(l=>{l.on("attribute",yt(e,this._downcastStrategies,i)),l.on("remove",pe(i.schema))}),t.conversion.for("dataDowncast").elementToElement({model:r,view:kt(e,{dataPipeline:!0}),converterPriority:"high"}).add(l=>{l.on("attribute",yt(e,this._downcastStrategies,i,{dataPipeline:!0}))});const o=he(this._downcastStrategies,t.editing.view);t.editing.mapper.on("modelToViewPosition",o),t.data.mapper.on("modelToViewPosition",o),this.listenTo(i.document,"change:data",ge(i,t.editing,e,this),{priority:"high"}),this.on("checkAttributes:item",(l,{viewElement:c,modelAttributes:a})=>{c.id!=a.listItemId&&(l.return=!0,l.stop())}),this.on("checkAttributes:list",(l,{viewElement:c,modelAttributes:a})=>{(c.name!=ht(a.listType)||c.id!=It(a.listType,a.listIndent))&&(l.return=!0,l.stop())})}_setupModelPostFixing(){const t=this.editor.model,i=this.getListAttributeNames();t.document.registerPostFixer(e=>es(t,e,i,this)),this.on("postFixer",(e,{listNodes:s,writer:r})=>{e.return=de(s,r)||e.return},{priority:"high"}),this.on("postFixer",(e,{listNodes:s,writer:r,seenIds:o})=>{e.return=me(s,o,r)||e.return},{priority:"high"})}_setupClipboardIntegration(){const t=this.editor.model,i=this.editor.plugins.get("ClipboardPipeline");this.listenTo(t,"insertContent",is(t),{priority:"high"}),this.listenTo(i,"outputTransformation",(e,s)=>{t.change(r=>{const o=Array.from(s.content.getChildren()),l=o[o.length-1];if(o.length>1&&l.is("element")&&l.isEmpty&&o.slice(0,-1).every(g)&&r.remove(l),s.method=="copy"||s.method=="cut"){const c=Array.from(s.content.getChildren());V(c)&&U(c,r,this.getListAttributeNames())}})})}_setupAccessibilityIntegration(){const t=this.editor,i=t.t;t.accessibility.addKeystrokeInfoGroup({id:"list",label:i("Keystrokes that can be used in a list"),keystrokes:[{label:i("Increase list item indent"),keystroke:"Tab"},{label:i("Decrease list item indent"),keystroke:"Shift+Tab"}]})}_setupListItemIdConversionStrategy(){this.registerDowncastStrategy({scope:"item",attributeName:"listItemId",setAttributeOnDowncast(t,i,e,s){s&&(s.skipListItemIds||s.isClipboardPipeline)||t.setAttribute("data-list-item-id",i,e)}})}}function es(n,t,i,e){const s=n.document.differ.getChanges(),r=new Set,o=new Set,l=e.editor.config.get("list.multiBlock");let c=!1;for(const u of s){if(u.type=="insert"&&u.name!="$text"){const d=u.position.nodeAfter;if(!n.schema.checkAttribute(d,"listItemId"))for(const m of Array.from(d.getAttributeKeys()))i.includes(m)&&(t.removeAttribute(m,d),c=!0);L(u.position,o,r),u.attributes.has("listItemId")||L(u.position.getShiftedBy(u.length),o,r);for(const{item:m,previousPosition:f}of n.createRangeIn(d))g(m)&&L(f,o,r)}else u.type=="remove"?L(u.position,o,r):u.type=="attribute"&&i.includes(u.attributeKey)&&(L(u.range.start,o,r),u.attributeNewValue===null&&L(u.range.start.getShiftedBy(1),o,r));if(!l&&u.type=="attribute"&&X.includes(u.attributeKey)){const d=u.range.start.nodeAfter;u.attributeNewValue===null&&d&&d.is("element","listItem")?(t.rename(d,"paragraph"),c=!0):u.attributeOldValue===null&&d&&d.is("element")&&d.name!="listItem"&&(t.rename(d,"listItem"),c=!0)}}const a=new Set;for(const u of o.values())c=e.fire("postFixer",{listNodes:new Ht(u),listHead:u,writer:t,seenIds:a})||c;return c}function is(n){return(t,[i,e])=>{const s=i.is("documentFragment")?Array.from(i.getChildren()):[i];if(!s.length)return;const o=(e?n.createSelection(e):n.document.selection).getFirstPosition();let l;if(g(o.parent))l=o.parent;else if(g(o.nodeBefore)&&g(o.nodeAfter))l=o.nodeBefore;else return;n.change(c=>{const a=l.getAttribute("listType"),u=l.getAttribute("listIndent"),d=s[0].getAttribute("listIndent")||0,m=Math.max(u-d,0);for(const f of s){const p=g(f);l.is("element","listItem")&&f.is("element","paragraph")&&c.rename(f,"listItem"),c.setAttributes({listIndent:(p?f.getAttribute("listIndent"):0)+m,listItemId:p?f.getAttribute("listItemId"):B.next(),listType:a},f)}})}}function ke(n,t){const i=n.document.selection;if(!i.isCollapsed)return!N(n);if(t==="forward")return!0;const s=i.getFirstPosition().parent,r=s.previousSibling;return n.schema.isObject(r)?!1:r.isEmpty?!0:V([s,r])}/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/function Z(n,t,i,e){n.ui.componentFactory.add(t,()=>{const s=Ae(at,n,t,i,e);return s.set({tooltip:!0,isToggleable:!0}),s}),n.ui.componentFactory.add(`menuBar:${t}`,()=>{const s=Ae(ki,n,t,i,e);return s.set({role:"menuitemcheckbox",isToggleable:!0}),s})}function Ae(n,t,i,e,s){const r=t.commands.get(i),o=new n(t.locale);return o.set({label:e,icon:s}),o.bind("isOn","isEnabled").to(r,"value","isEnabled"),o.on("execute",()=>{t.execute(i),t.editing.view.focus()}),o}/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class At extends b{static get pluginName(){return"ListUI"}static get isOfficialPlugin(){return!0}init(){const t=this.editor.t;this.editor.ui.componentFactory.has("numberedList")||Z(this.editor,"numberedList",t("Numbered List"),ut),this.editor.ui.componentFactory.has("bulletedList")||Z(this.editor,"bulletedList",t("Bulleted List"),dt)}}/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class ss extends b{static get requires(){return[y,At]}static get pluginName(){return"List"}static get isOfficialPlugin(){return!0}}/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class we extends k{refresh(){const t=this._getValue();this.value=t,this.isEnabled=t!=null}execute({startIndex:t=1}={}){const i=this.editor.model,e=i.document;let s=Array.from(e.selection.getSelectedBlocks()).filter(r=>g(r)&&$(r.getAttribute("listType")));s=z(s),i.change(r=>{for(const o of s)r.setAttribute("listStart",t>=0?t:1,o)})}_getValue(){const i=this.editor.model.document,e=E(i.selection.getSelectedBlocks());return e&&g(e)&&$(e.getAttribute("listType"))?e.getAttribute("listStart"):null}}/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/const Le={},ve={},_e={},Te=[{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"},{listStyle:"arabic-indic",typeAttribute:null,listType:"numbered"}];for(const{listStyle:n,typeAttribute:t,listType:i}of Te)Le[n]=i,ve[n]=t,t&&(_e[t]=n);function wt(){return Te.map(n=>n.listStyle)}function J(n){return Le[n]||null}function Lt(n){return _e[n]||null}function Q(n){return ve[n]||null}function vt(n){switch(n){case"lower-alpha":return"lower-latin";case"upper-alpha":return"upper-latin";default:return n}}/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class Se extends k{defaultType;_supportedTypes;constructor(t,i,e){super(t),this.defaultType=i,this._supportedTypes=e}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(t={}){const i=this.editor.model,e=i.document;i.change(s=>{this._tryToConvertItemsToList(t);let r=Array.from(e.selection.getSelectedBlocks()).filter(o=>o.hasAttribute("listType"));if(r.length){r=z(r);for(const o of r)s.setAttribute("listStyle",t.type||this.defaultType,o)}})}isStyleTypeSupported(t){return this._supportedTypes?this._supportedTypes.includes(t):!0}_getValue(){const t=E(this.editor.model.document.selection.getSelectedBlocks());return g(t)?t.getAttribute("listStyle"):null}_checkEnabled(){const t=this.editor,i=t.commands.get("numberedList"),e=t.commands.get("bulletedList");return i.isEnabled||e.isEnabled}_tryToConvertItemsToList(t){if(!t.type)return;const i=J(t.type);if(!i)return;const e=this.editor,s=`${i}List`;e.commands.get(s).value||e.execute(s)}}/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class Ce extends k{refresh(){const t=this._getValue();this.value=t,this.isEnabled=t!=null}execute(t={}){const i=this.editor.model,e=i.document;let s=Array.from(e.selection.getSelectedBlocks()).filter(r=>g(r)&&r.getAttribute("listType")=="numbered");s=z(s),i.change(r=>{for(const o of s)r.setAttribute("listReversed",!!t.reversed,o)})}_getValue(){const i=this.editor.model.document,e=E(i.selection.getSelectedBlocks());return g(e)&&e.getAttribute("listType")=="numbered"?e.getAttribute("listReversed"):null}}/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/function _t(n){return(t,i,e)=>{const{writer:s,schema:r,consumable:o}=e;if(o.test(i.viewItem,n.viewConsumables)===!1)return;i.modelRange||Object.assign(i,e.convertChildren(i.viewItem,i.modelCursor));let l=!1;for(const c of i.modelRange.getItems({shallow:!0}))r.checkAttribute(c,n.attributeName)&&n.appliesToListItem(c)&&(c.hasAttribute(n.attributeName)||(s.setAttribute(n.attributeName,n.getAttributeOnUpcast(i.viewItem),c),l=!0));l&&o.consume(i.viewItem,n.viewConsumables)}}/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class xe extends b{static get pluginName(){return"ListPropertiesUtils"}static get isOfficialPlugin(){return!0}getAllSupportedStyleTypes(){return wt()}getListTypeFromListStyleType(t){return J(t)}getListStyleTypeFromTypeAttribute(t){return Lt(t)}getTypeAttributeFromListStyleType(t){return Q(t)}}function ns(n){return Number.isSafeInteger(n)&&n>=0}function rs(n){return n!=null&&typeof n!="function"&&ns(n.length)}function tt(n){return n==="__proto__"}function Ee(n){switch(typeof n){case"number":case"symbol":return!1;case"string":return n.includes(".")||n.includes("[")||n.includes("]")}}function Pe(n){return typeof n=="string"||typeof n=="symbol"?n:Object.is(n?.valueOf?.(),-0)?"-0":String(n)}function Tt(n){const t=[],i=n.length;if(i===0)return t;let e=0,s="",r="",o=!1;for(n.charCodeAt(0)===46&&(t.push(""),e++);e<i;){const l=n[e];r?l==="\\"&&e+1<i?(e++,s+=n[e]):l===r?r="":s+=l:o?l==='"'||l==="'"?r=l:l==="]"?(o=!1,t.push(s),s=""):s+=l:l==="["?(o=!0,s&&(t.push(s),s="")):l==="."?s&&(t.push(s),s=""):s+=l,e++}return s&&t.push(s),t}function Be(n,t,i){if(n==null)return i;switch(typeof t){case"string":{if(tt(t))return i;const e=n[t];return e===void 0?Ee(t)?Be(n,Tt(t),i):i:e}case"number":case"symbol":{typeof t=="number"&&(t=Pe(t));const e=n[t];return e===void 0?i:e}default:{if(Array.isArray(t))return os(n,t,i);if(Object.is(t?.valueOf(),-0)?t="-0":t=String(t),tt(t))return i;const e=n[t];return e===void 0?i:e}}}function os(n,t,i){if(t.length===0)return i;let e=n;for(let s=0;s<t.length;s++){if(e==null||tt(t[s]))return i;e=e[t[s]]}return e===void 0?i:e}function Fe(n){return n!==null&&(typeof n=="object"||typeof n=="function")}function ls(n,t){return n===t||Number.isNaN(n)&&Number.isNaN(t)}function cs(n){return n==null?n===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(n)}const as=/^(?:0|[1-9]\d*)$/;function Ve(n,t=Number.MAX_SAFE_INTEGER){switch(typeof n){case"number":return Number.isInteger(n)&&n>=0&&n<t;case"symbol":return!1;case"string":return as.test(n)}}function us(n){return n!==null&&typeof n=="object"&&cs(n)==="[object Arguments]"}function ds(n,t){let i;if(Array.isArray(t)?i=t:typeof t=="string"&&Ee(t)&&n?.[t]==null?i=Tt(t):i=[t],i.length===0)return!1;let e=n;for(let s=0;s<i.length;s++){const r=i[s];if((e==null||!Object.hasOwn(e,r))&&!((Array.isArray(e)||us(e))&&Ve(r)&&r<e.length))return!1;e=e[r]}return!0}function ms(n){return typeof n=="symbol"||n instanceof Symbol}const fs=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,gs=/^\w*$/;function ps(n,t){return Array.isArray(n)?!1:typeof n=="number"||typeof n=="boolean"||n==null||ms(n)?!0:typeof n=="string"&&(gs.test(n)||!fs.test(n))||t!=null&&Object.hasOwn(t,n)}function bs(n){return n==null}const hs=(n,t,i)=>{const e=n[t];(!(Object.hasOwn(n,t)&&ls(e,i))||i===void 0&&!(t in n))&&(n[t]=i)};function Is(n,t,i,e){if(n==null&&!Fe(n))return n;const s=ps(t,n)?[t]:Array.isArray(t)?t:typeof t=="string"?Tt(t):[t];let r=n;for(let o=0;o<s.length&&r!=null;o++){const l=Pe(s[o]);if(tt(l))continue;let c;if(o===s.length-1)c=i(r[l]);else{const a=r[l],u=e?.(a,l,n);c=u!==void 0?u:Fe(a)?a:Ve(s[o+1])?[]:{}}hs(r,l,c),r=r[l]}return n}function ys(n,t,i){return Is(n,t,()=>i,()=>{})}function Ne(n,...t){if(bs(n))return{};const i={};for(let e=0;e<t.length;e++){let s=t[e];switch(typeof s){case"object":{Array.isArray(s)||(rs(s)?s=Array.from(s):s=[s]);break}case"string":case"symbol":case"number":{s=[s];break}}for(const r of s){const o=Be(n,r);o===void 0&&!ds(n,r)||(typeof r=="string"&&Object.hasOwn(n,r)?i[r]=o:ys(i,r,o))}}return i}/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/function St(n){const{startIndex:t,reversed:i,styles:e}=n;return{styles:ks(e),startIndex:t||!1,reversed:i||!1}}function ks(n){const t={listTypes:["bulleted","numbered"],useAttribute:!1,listStyleTypes:{numbered:["decimal","decimal-leading-zero","lower-roman","upper-roman","lower-latin","upper-latin"],bulleted:["disc","circle","square"]}};return n===!0||(n?Array.isArray(n)||typeof n=="string"?(t.listTypes=C(n),t.listStyleTypes=Ne(t.listStyleTypes,t.listTypes)):(t.listTypes=n.listTypes?C(n.listTypes):t.listTypes,t.useAttribute=!!n.useAttribute,n.listStyleTypes?t.listStyleTypes=n.listStyleTypes:t.listStyleTypes=Ne(t.listStyleTypes,t.listTypes)):(t.listTypes=[],t.listStyleTypes={})),t}/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/const W="default";class Oe extends b{static get requires(){return[y,xe]}static get pluginName(){return"ListPropertiesEditing"}static get licenseFeatureCode(){return"LP"}static get isOfficialPlugin(){return!0}static get isPremiumPlugin(){return!0}constructor(t){super(t),t.config.define("list.properties",{styles:!0,startIndex:!1,reversed:!1})}init(){const t=this.editor,i=t.model,e=t.plugins.get(y),s=t.config.get("list.properties"),r=As(s);for(const o of r)o.addCommand(t),i.schema.extend("$listItem",{allowAttributes:o.attributeName}),e.registerDowncastStrategy({scope:"list",attributeName:o.attributeName,setAttributeOnDowncast(l,c,a){o.setAttributeOnDowncast(l,c,a)}});t.conversion.for("upcast").add(o=>{for(const l of r)o.on("element:ol",_t(l)),o.on("element:ul",_t(l))}),e.on("checkAttributes:list",(o,{viewElement:l,modelAttributes:c,modelReferenceElement:a})=>{for(const u of r)u.appliesToListItem(a)&&u.getAttributeOnUpcast(l)!=c[u.attributeName]&&(o.return=!0,o.stop())}),this.listenTo(t.commands.get("indentList"),"afterExecute",(o,l)=>{i.change(c=>{for(const a of l)for(const u of r)u.appliesToListItem(a)&&c.setAttribute(u.attributeName,u.defaultValue,a)})}),e.on("postFixer",(o,{listNodes:l,writer:c})=>{for(const{node:a}of l)for(const u of r)u.hasValidAttribute(a)||(u.appliesToListItem(a)?c.setAttribute(u.attributeName,u.defaultValue,a):c.removeAttribute(u.attributeName,a),o.return=!0)}),e.on("postFixer",(o,{listNodes:l,writer:c})=>{for(const{node:a,previousNodeInList:u}of l)if(u&&u.getAttribute("listType")==a.getAttribute("listType"))for(const d of r){const{attributeName:m}=d;if(!d.appliesToListItem(a))continue;const f=u.getAttribute(m);a.getAttribute(m)!=f&&(c.setAttribute(m,f,a),o.return=!0)}})}}function As(n){const t=[],i=St(n);if(n.styles){const e=i.styles.useAttribute;t.push({attributeName:"listStyle",defaultValue:W,viewConsumables:{styles:"list-style-type"},addCommand(s){let r=wt();e&&(r=r.filter(o=>!!Q(o))),s.commands.add("listStyle",new Se(s,W,r))},appliesToListItem(s){return s.getAttribute("listType")=="numbered"||s.getAttribute("listType")=="bulleted"},hasValidAttribute(s){if(!this.appliesToListItem(s))return!s.hasAttribute("listStyle");if(!s.hasAttribute("listStyle"))return!1;const r=s.getAttribute("listStyle");return r==W?!0:J(r)==s.getAttribute("listType")},setAttributeOnDowncast(s,r,o){if(r&&r!==W)if(e){const l=Q(r);if(l){s.setAttribute("type",l,o);return}}else{s.setStyle("list-style-type",r,o);return}s.removeStyle("list-style-type",o),s.removeAttribute("type",o)},getAttributeOnUpcast(s){const r=s.getStyle("list-style-type");if(r)return vt(r);const o=s.getAttribute("type");return o?Lt(o):W}})}return n.reversed&&t.push({attributeName:"listReversed",defaultValue:!1,viewConsumables:{attributes:"reversed"},addCommand(e){e.commands.add("listReversed",new Ce(e))},appliesToListItem(e){return e.getAttribute("listType")=="numbered"},hasValidAttribute(e){return this.appliesToListItem(e)==e.hasAttribute("listReversed")},setAttributeOnDowncast(e,s,r){s?e.setAttribute("reversed","reversed",r):e.removeAttribute("reversed",r)},getAttributeOnUpcast(e){return e.hasAttribute("reversed")}}),n.startIndex&&t.push({attributeName:"listStart",defaultValue:1,viewConsumables:{attributes:"start"},addCommand(e){e.commands.add("listStart",new we(e))},appliesToListItem(e){return $(e.getAttribute("listType"))},hasValidAttribute(e){return this.appliesToListItem(e)==e.hasAttribute("listStart")},setAttributeOnDowncast(e,s,r){s==0||s>1?e.setAttribute("start",s,r):e.removeAttribute("start",r)},getAttributeOnUpcast(e){const s=e.getAttribute("start");return s>=0?s:1}}),t}R(".ck.ck-list-properties.ck-list-properties_without-styles{padding:var(--ck-spacing-large)}.ck.ck-list-properties.ck-list-properties_without-styles>*{min-width:14em}.ck.ck-list-properties.ck-list-properties_without-styles>*+*{margin-top:var(--ck-spacing-standard)}.ck.ck-list-properties.ck-list-properties_with-numbered-properties>.ck-list-styles-list{grid-template-columns:repeat(4,auto)}.ck.ck-list-properties.ck-list-properties_with-numbered-properties>.ck-collapsible{border-top:1px solid var(--ck-color-base-border)}.ck.ck-list-properties.ck-list-properties_with-numbered-properties>.ck-collapsible>.ck-collapsible__children>*{width:100%}.ck.ck-list-properties.ck-list-properties_with-numbered-properties>.ck-collapsible>.ck-collapsible__children>*+*{margin-top:var(--ck-spacing-standard)}.ck.ck-list-properties .ck.ck-numbered-list-properties__start-index .ck-input{min-width:auto;width:100%}.ck.ck-list-properties .ck.ck-numbered-list-properties__reversed-order{background:transparent;margin-bottom:calc(var(--ck-spacing-tiny)*-1);padding-left:0;padding-right:0}.ck.ck-list-properties .ck.ck-numbered-list-properties__reversed-order:active,.ck.ck-list-properties .ck.ck-numbered-list-properties__reversed-order:hover{background:none;border-color:transparent;box-shadow:none}");/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class Ct extends jt{children;stylesView=null;additionalPropertiesCollapsibleView=null;startIndexFieldView=null;reversedSwitchButtonView=null;focusTracker=new Dt;keystrokes=new zt;focusables=new Ai;focusCycler;constructor(t,{enabledProperties:i,styleButtonViews:e,styleGridAriaLabel:s}){super(t);const r=["ck","ck-list-properties"];this.children=this.createCollection(),this.focusCycler=new wi({focusables:this.focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),e&&e.length?(this.stylesView=this._createStylesView(e,s),this.children.add(this.stylesView)):r.push("ck-list-properties_without-styles"),(i.startIndex||i.reversed)&&(this._addNumberedListPropertyViews(i),r.push("ck-list-properties_with-numbered-properties")),this.setTemplate({tag:"div",attributes:{class:r},children:this.children})}render(){if(super.render(),this.stylesView){this.focusables.add(this.stylesView),this.focusTracker.add(this.stylesView.element),(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);Li({keystrokeHandler:this.stylesView.keystrokes,focusTracker:this.stylesView.focusTracker,gridItems:this.stylesView.children,numberOfColumns:()=>hi.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=i=>i.stopPropagation();this.keystrokes.set("arrowright",t),this.keystrokes.set("arrowleft",t),this.keystrokes.set("arrowup",t),this.keystrokes.set("arrowdown",t)}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,i){const e=new jt(this.locale);return e.children=e.createCollection(),e.children.addMany(t),e.setTemplate({tag:"div",attributes:{"aria-label":i,class:["ck","ck-list-styles-list"]},children:e.children}),e.children.delegate("execute").to(this),e.focus=function(){for(const s of this.children)if(s instanceof at&&s.isOn){s.focus();return}this.children.first.focus()},e.focusTracker=new Dt,e.keystrokes=new zt,e.render(),e.keystrokes.listenTo(e.element),e}_addNumberedListPropertyViews(t){const i=this.locale.t,e=[];t.startIndex&&(this.startIndexFieldView=this._createStartIndexField(),e.push(this.startIndexFieldView)),t.reversed&&(this.reversedSwitchButtonView=this._createReversedSwitchButton(),e.push(this.reversedSwitchButtonView)),this.stylesView?(this.additionalPropertiesCollapsibleView=new vi(this.locale,e),this.additionalPropertiesCollapsibleView.set({label:i("List properties"),isCollapsed:!0}),this.additionalPropertiesCollapsibleView.buttonView.bind("isEnabled").toMany(e,"isEnabled",(...s)=>s.some(r=>r)),this.additionalPropertiesCollapsibleView.buttonView.on("change:isEnabled",(s,r,o)=>{o||(this.additionalPropertiesCollapsibleView.isCollapsed=!0)}),this.children.add(this.additionalPropertiesCollapsibleView)):this.children.addMany(e)}_createStartIndexField(){const t=this.locale.t,i=new _i(this.locale,Ti);return i.set({label:t("Start at"),class:"ck-numbered-list-properties__start-index"}),i.fieldView.set({min:0,step:1,value:1,inputMode:"numeric"}),i.fieldView.on("input",()=>{const e=i.fieldView.element,s=e.valueAsNumber;if(Number.isNaN(s)){i.errorText=t("Invalid start index value.");return}e.checkValidity()?this.fire("listStart",{startIndex:s}):i.errorText=t("Start index must be greater than 0.")}),i}_createReversedSwitchButton(){const t=this.locale.t,i=new Si(this.locale);return i.set({withText:!0,label:t("Reversed order"),class:"ck-numbered-list-properties__reversed-order"}),i.delegate("execute").to(this,"listReversed"),i}}R(".ck.ck-list-styles-list{display:grid}:root{--ck-list-style-button-size:44px}.ck.ck-list-styles-list{column-gap:var(--ck-spacing-medium);grid-template-columns:repeat(3,auto);padding:var(--ck-spacing-large);row-gap:var(--ck-spacing-medium)}.ck.ck-list-styles-list .ck-button{box-sizing:content-box;margin:0;padding:0}.ck.ck-list-styles-list .ck-button,.ck.ck-list-styles-list .ck-button .ck-icon{height:var(--ck-list-style-button-size);width:var(--ck-list-style-button-size)}");/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class xt extends b{static get pluginName(){return"ListPropertiesUI"}static get isOfficialPlugin(){return!0}init(){const t=this.editor,i=t.locale.t,e=t.config.get("list.properties"),s=St(e),r=s.styles.listTypes;if(r.includes("bulleted")){const o=[{label:i("Toggle the disc list style"),tooltip:i("Disc"),type:"disc",icon:Bi},{label:i("Toggle the circle list style"),tooltip:i("Circle"),type:"circle",icon:Fi},{label:i("Toggle the square list style"),tooltip:i("Square"),type:"square",icon:Vi}],l=i("Bulleted List"),c=i("Bulleted list styles toolbar"),a="bulletedList";t.ui.componentFactory.add(a,Re({editor:t,normalizedConfig:s,parentCommandName:a,buttonLabel:l,buttonIcon:dt,styleGridAriaLabel:c,styleDefinitions:o})),t.ui.componentFactory.add(`menuBar:${a}`,De({editor:t,normalizedConfig:s,parentCommandName:a,buttonLabel:l,styleGridAriaLabel:c,styleDefinitions:o}))}if(r.includes("numbered")||e.startIndex||e.reversed){const o=[{label:i("Toggle the decimal list style"),tooltip:i("Decimal"),type:"decimal",icon:Ni},{label:i("Toggle the decimal with leading zero list style"),tooltip:i("Decimal with leading zero"),type:"decimal-leading-zero",icon:Oi},{label:i("Toggle the lower\u2013roman list style"),tooltip:i("Lower\u2013roman"),type:"lower-roman",icon:Ri},{label:i("Toggle the upper\u2013roman list style"),tooltip:i("Upper-roman"),type:"upper-roman",icon:Mi},{label:i("Toggle the lower\u2013latin list style"),tooltip:i("Lower-latin"),type:"lower-latin",icon:Di},{label:i("Toggle the upper\u2013latin list style"),tooltip:i("Upper-latin"),type:"upper-latin",icon:zi},{label:i("Toggle the arabic-indic list style"),tooltip:i("Arabic-indic"),type:"arabic-indic",icon:Ui}],l=i("Numbered List"),c=i("Numbered list styles toolbar"),a="numberedList";t.ui.componentFactory.add(a,Re({editor:t,normalizedConfig:s,parentCommandName:a,buttonLabel:l,buttonIcon:ut,styleGridAriaLabel:c,styleDefinitions:o})),r.includes("numbered")&&t.ui.componentFactory.add(`menuBar:${a}`,De({editor:t,normalizedConfig:s,parentCommandName:a,buttonLabel:l,styleGridAriaLabel:c,styleDefinitions:o}))}}}function Re({editor:n,normalizedConfig:t,parentCommandName:i,buttonLabel:e,buttonIcon:s,styleGridAriaLabel:r,styleDefinitions:o}){const l=n.commands.get(i);return c=>{const a=Ci(c,xi),u=a.buttonView;return a.bind("isEnabled").to(l),a.class="ck-list-styles-dropdown",u.on("execute",()=>{n.execute(i),n.editing.view.focus()}),u.set({label:e,icon:s,tooltip:!0,isToggleable:!0}),u.bind("isOn").to(l,"value",d=>!!d),a.once("change:isOpen",()=>{const d=ws({editor:n,normalizedConfig:t,dropdownView:a,parentCommandName:i,styleGridAriaLabel:r,styleDefinitions:o});a.panelView.children.add(d)}),a.on("execute",()=>{n.editing.view.focus()}),a}}function Me({editor:n,listStyleCommand:t,parentCommandName:i}){const e=n.locale,s=n.commands.get(i);return({label:r,type:o,icon:l,tooltip:c})=>{const a=new at(e);return a.set({label:r,icon:l,tooltip:c}),a.bind("isOn").to(t,"value",u=>u===o),a.on("execute",()=>{s.value?t.value===o?n.execute(i):t.value!==o&&n.execute("listStyle",{type:o}):n.model.change(()=>{n.execute("listStyle",{type:o})})}),a}}function ws({editor:n,normalizedConfig:t,dropdownView:i,parentCommandName:e,styleDefinitions:s,styleGridAriaLabel:r}){const o=n.locale,l={...t,...e!="numberedList"?{startIndex:!1,reversed:!1}:null},c=e.replace("List","");let a=null;if(t.styles.listTypes.includes(c)){const d=n.commands.get("listStyle"),m=Me({editor:n,parentCommandName:e,listStyleCommand:d}),f=t.styles.listStyleTypes;let p=s;if(f){const I=f[c];I&&(p=s.filter(w=>I.includes(w.type)))}const h=ze(d);a=p.filter(h).map(m)}const u=new Ct(o,{styleGridAriaLabel:r,enabledProperties:l,styleButtonViews:a});if(t.styles.listTypes.includes(c)&&Pi(i,()=>u.stylesView.children.find(d=>d.isOn)),l.startIndex){const d=n.commands.get("listStart");u.startIndexFieldView.bind("isEnabled").to(d),u.startIndexFieldView.fieldView.bind("value").to(d),u.on("listStart",(m,f)=>n.execute("listStart",f))}if(l.reversed){const d=n.commands.get("listReversed");u.reversedSwitchButtonView.bind("isEnabled").to(d),u.reversedSwitchButtonView.bind("isOn").to(d,"value",m=>!!m),u.on("listReversed",()=>{const m=d.value;n.execute("listReversed",{reversed:!m})})}return u.delegate("execute").to(i),u}function De({editor:n,normalizedConfig:t,parentCommandName:i,buttonLabel:e,styleGridAriaLabel:s,styleDefinitions:r}){return o=>{const l=new Ei(o),c=n.commands.get(i),a=n.commands.get("listStyle"),u=ze(a),d=Me({editor:n,parentCommandName:i,listStyleCommand:a}),m=t.styles.listStyleTypes;let f=r;if(m){const I=c.type,w=m[I];w&&(f=r.filter(gi=>w.includes(gi.type)))}const p=f.filter(u).map(d),h=new Ct(o,{styleGridAriaLabel:s,enabledProperties:{...t,startIndex:!1,reversed:!1},styleButtonViews:p});return h.delegate("execute").to(l),l.buttonView.set({label:e,icon:i==="bulletedList"?dt:ut}),l.panelView.children.add(h),l.bind("isEnabled").to(c,"isEnabled"),l.on("execute",()=>{n.editing.view.focus()}),l}}function ze(n){return typeof n.isStyleTypeSupported=="function"?t=>n.isStyleTypeSupported(t.type):()=>!0}/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class Ls extends b{static get requires(){return[Oe,xt]}static get pluginName(){return"ListProperties"}static get isOfficialPlugin(){return!0}}/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class Ue extends k{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(i=>{const e=this._getSelectedItems(),s=t.forceValue===void 0?!this._getValue(e):t.forceValue;for(const r of e)s?i.setAttribute("todoListChecked",!0,r):i.removeAttribute("todoListChecked",r)})}_getValue(t){return t.every(i=>i.getAttribute("todoListChecked"))}_getSelectedItems(){const t=this.editor.model,i=t.schema,e=t.document.selection.getFirstRange(),s=e.start.parent,r=[];i.checkAttribute(s,"todoListChecked")&&r.push(...T(s));for(const o of e.getItems({shallow:!0}))i.checkAttribute(o,"todoListChecked")&&!r.includes(o)&&r.push(...T(o));return r}}/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class $e extends Wi{domEventType=["change"];onDomEvent(t){if(t.target){const i=this.view.domConverter.mapDomToView(t.target);i&&i.is("element","input")&&i.getAttribute("type")=="checkbox"&&i.findAncestor({classes:"todo-list__label"})&&this.fire("todoCheckboxChange",t)}}}/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/const vs=$t("Ctrl+Enter");class We extends b{static get pluginName(){return"TodoListEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[y]}init(){const t=this.editor,i=t.model,e=t.editing,s=t.plugins.get(y),o=t.config.get("list.multiBlock")?"paragraph":"listItem";t.commands.add("todoList",new O(t,"todo")),t.commands.add("checkTodoList",new Ue(t)),e.view.addObserver($e),i.schema.extend("$listItem",{allowAttributes:"todoListChecked"}),i.schema.addAttributeCheck(l=>{const c=l.last;if(!c.getAttribute("listItemId")||c.getAttribute("listType")!="todo")return!1},"todoListChecked"),t.conversion.for("upcast").add(l=>{l.on("element:input",Ts()),l.on("element:li",_s(),{priority:"low"}),l.on("element:label",Et({name:"label",classes:"todo-list__label"})),l.on("element:label",Et({name:"label",classes:["todo-list__label","todo-list__label_without-description"]})),l.on("element:span",Et({name:"span",classes:"todo-list__label__description"})),l.on("element:ul",Ss({name:"ul",classes:"todo-list"}))}),t.conversion.for("downcast").elementToElement({model:o,view:(l,{writer:c})=>{if(et(l,s.getListAttributeNames()))return c.createContainerElement("span",{class:"todo-list__label__description"})},converterPriority:"highest"}),s.registerDowncastStrategy({scope:"list",attributeName:"listType",setAttributeOnDowncast(l,c,a){c=="todo"?l.addClass("todo-list",a):l.removeClass("todo-list",a)}}),s.registerDowncastStrategy({scope:"itemMarker",attributeName:"todoListChecked",createElement(l,c,{dataPipeline:a}){if(c.getAttribute("listType")!="todo")return null;const u=l.createUIElement("input",{type:"checkbox",...c.getAttribute("todoListChecked")?{checked:"checked"}:null,...a?{disabled:"disabled"}:{tabindex:"-1"}});if(a)return u;const d=l.createContainerElement("span",{contenteditable:"false"},u);return d.getFillerOffset=()=>null,d},canWrapElement(l){return et(l,s.getListAttributeNames())},createWrapperElement(l,c,{dataPipeline:a}){const u=["todo-list__label"];return et(c,s.getListAttributeNames())||u.push("todo-list__label_without-description"),l.createAttributeElement(a?"label":"span",{class:u.join(" ")})}}),s.on("checkElement",(l,{modelElement:c,viewElement:a})=>{const u=et(c,s.getListAttributeNames());a.hasClass("todo-list__label__description")!=u&&(l.return=!0,l.stop())}),s.on("checkElement",(l,{modelElement:c,viewElement:a})=>{const u=c.getAttribute("listType")=="todo"&&_(c);let d=!1;const m=t.editing.view.createPositionBefore(a).getWalker({direction:"backward"});for(const{item:f}of m){if(f.is("element")&&t.editing.mapper.toModelElement(f))break;f.is("element","input")&&f.getAttribute("type")=="checkbox"&&(d=!0)}d!=u&&(l.return=!0,l.stop())}),s.on("postFixer",(l,{listNodes:c,writer:a})=>{for(const{node:u,previousNodeInList:d}of c){if(!d||d.getAttribute("listItemId")!=u.getAttribute("listItemId"))continue;const m=d.hasAttribute("todoListChecked"),f=u.hasAttribute("todoListChecked");f&&!m?(a.removeAttribute("todoListChecked",u),l.return=!0):!f&&m&&(a.setAttribute("todoListChecked",!0,u),l.return=!0)}}),i.document.registerPostFixer(l=>{const c=i.document.differ.getChanges();let a=!1;for(const u of c)if(u.type=="attribute"&&u.attributeKey=="listType"){const d=u.range.start.nodeAfter;u.attributeOldValue=="todo"&&d.hasAttribute("todoListChecked")&&(l.removeAttribute("todoListChecked",d),a=!0)}else if(u.type=="insert"&&u.name!="$text")for(const{item:d}of l.createRangeOn(u.position.nodeAfter))d.is("element")&&d.getAttribute("listType")!="todo"&&d.hasAttribute("todoListChecked")&&(l.removeAttribute("todoListChecked",d),a=!0);return a}),this.listenTo(e.view.document,"keydown",(l,c)=>{Ut(c)===vs&&(t.execute("checkTodoList"),l.stop())},{priority:"high"}),this.listenTo(e.view.document,"todoCheckboxChange",(l,c)=>{const a=c.target;if(!a||!a.is("element","input"))return;const u=e.view.createPositionAfter(a),m=e.mapper.toModelPosition(u).parent;m&&g(m)&&m.getAttribute("listType")=="todo"&&this._handleCheckmarkChange(m)}),this.listenTo(e.view.document,"arrowKey",xs(i,t.locale),{context:"$text"}),this.listenTo(e.mapper,"viewToModelPosition",(l,c)=>{const a=c.viewPosition.parent,u=a.is("attributeElement","li")&&c.viewPosition.offset==0,d=qe(a)&&c.viewPosition.offset<=1,m=a.is("element","span")&&a.getAttribute("contenteditable")=="false"&&qe(a.parent);if(!u&&!d&&!m)return;const f=c.modelPosition.nodeAfter;f&&f.getAttribute("listType")=="todo"&&(c.modelPosition=i.createPositionAt(f,0))},{priority:"low"}),this._initAriaAnnouncements()}_handleCheckmarkChange(t){const i=this.editor,e=i.model,s=Array.from(e.document.selection.getRanges());e.change(r=>{r.setSelection(t,"end"),i.execute("checkTodoList"),r.setSelection(s)})}_initAriaAnnouncements(){const{model:t,ui:i,t:e}=this.editor;let s=null;i&&t.document.selection.on("change:range",()=>{const r=t.document.selection.focus.parent,o=je(s),l=je(r);o&&!l?i.ariaLiveAnnouncer.announce(e("Leaving a to-do list")):!o&&l&&i.ariaLiveAnnouncer.announce(e("Entering a to-do list")),s=r})}}function _s(){return(n,t,i)=>{const{writer:e,schema:s}=i;if(!t.modelRange)return;const r=Array.from(t.modelRange.getItems({shallow:!0})).filter(o=>o.getAttribute("listType")==="todo"&&s.checkAttribute(o,"listItemId")).reduce((o,l)=>{const c=l.getAttribute("listItemId");return o.has(c)||o.set(c,T(l)),o},new Map);for(const[,o]of r.entries())if(o.some(l=>l.getAttribute("todoListChecked")))for(const l of o)e.setAttribute("todoListChecked",!0,l)}}function Ts(){return(n,t,i)=>{const e=t.modelCursor,s=e.parent,r=t.viewItem;if(!i.consumable.test(r,{name:!0})||r.getAttribute("type")!="checkbox"||!e.isAtStart||!s.hasAttribute("listType"))return;i.consumable.consume(r,{name:!0});const o=i.writer;o.setAttribute("listType","todo",s),t.viewItem.hasAttribute("checked")&&o.setAttribute("todoListChecked",!0,s),t.modelRange=o.createRange(e)}}function Et(n){const t=new Kt(n);return(i,e,s)=>{const r=t.match(e.viewItem);r&&s.consumable.consume(e.viewItem,r.match)&&Object.assign(e,s.convertChildren(e.viewItem,e.modelCursor))}}function Ss(n){const t=new Kt(n);return(i,e,s)=>{const r=t.match(e.viewItem);if(!r)return;const o=r.match;o.name=!1,s.consumable.consume(e.viewItem,o)}}function et(n,t){return(n.is("element","paragraph")||n.is("element","listItem"))&&n.getAttribute("listType")=="todo"&&_(n)&&Cs(n,t)}function Cs(n,t){for(const i of n.getAttributeKeys())if(!i.startsWith("selection:")&&!t.includes(i))return!1;return!0}function xs(n,t){return(i,e)=>{const s=Wt(e.keyCode,t.contentLanguageDirection),r=n.schema,o=n.document.selection;if(!o.isCollapsed)return;const l=o.getFirstPosition(),c=l.parent;if(s=="right"&&l.isAtEnd){const a=r.getNearestSelectionRange(n.createPositionAfter(c),"forward");if(!a)return;const u=a.start.parent;u&&g(u)&&u.getAttribute("listType")=="todo"&&(n.change(d=>d.setSelection(a)),e.preventDefault(),e.stopPropagation(),i.stop())}else if(s=="left"&&l.isAtStart&&g(c)&&c.getAttribute("listType")=="todo"){const a=r.getNearestSelectionRange(n.createPositionBefore(c),"backward");if(!a)return;n.change(u=>u.setSelection(a)),e.preventDefault(),e.stopPropagation(),i.stop()}}}function qe(n){return!!n&&n.is("attributeElement")&&n.hasClass("todo-list__label")}function je(n){return!n||!n.is("element","paragraph")&&!n.is("element","listItem")?!1:n.getAttribute("listType")=="todo"}/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class Pt extends b{static get pluginName(){return"TodoListUI"}static get isOfficialPlugin(){return!0}init(){const t=this.editor.t;Z(this.editor,"todoList",t("To-do List"),$i)}}R(':root{--ck-content-todo-list-checkmark-size:16px}.ck-content .todo-list{list-style:none}.ck-content .todo-list li{margin-bottom:5px;position:relative}.ck-content .todo-list li .todo-list{margin-top:5px}.ck-content .todo-list .todo-list__label>input{-webkit-appearance:none;border:0;display:inline-block;height:var(--ck-content-todo-list-checkmark-size);left:-25px;margin-left:0;margin-right:-15px;position:relative;right:0;vertical-align:middle;width:var(--ck-content-todo-list-checkmark-size)}.ck-content[dir=rtl] .todo-list .todo-list__label>input{left:0;margin-left:-15px;margin-right:0;right:-25px}.ck-content .todo-list .todo-list__label>input:before{border:1px solid #333;border-radius:2px;box-sizing:border-box;content:"";display:block;height:100%;position:absolute;transition:box-shadow .25s ease-in-out;width:100%}@media (prefers-reduced-motion:reduce){.ck-content .todo-list .todo-list__label>input:before{transition:none}}.ck-content .todo-list .todo-list__label>input:after{border-color:transparent;border-style:solid;border-width:0 calc(var(--ck-content-todo-list-checkmark-size)/8) calc(var(--ck-content-todo-list-checkmark-size)/8) 0;box-sizing:content-box;content:"";display:block;height:calc(var(--ck-content-todo-list-checkmark-size)/2.6);left:calc(var(--ck-content-todo-list-checkmark-size)/3);pointer-events:none;position:absolute;top:calc(var(--ck-content-todo-list-checkmark-size)/5.3);transform:rotate(45deg);width:calc(var(--ck-content-todo-list-checkmark-size)/5.3)}.ck-content .todo-list .todo-list__label>input[checked]:before{background:#26ab33;border-color:#26ab33}.ck-content .todo-list .todo-list__label>input[checked]:after{border-color:#fff}.ck-content .todo-list .todo-list__label .todo-list__label__description{vertical-align:middle}.ck-content .todo-list .todo-list__label.todo-list__label_without-description input[type=checkbox]{position:absolute}.ck-editor__editable.ck-content .todo-list .todo-list__label>input,.ck-editor__editable.ck-content .todo-list .todo-list__label>span[contenteditable=false]>input{cursor:pointer}.ck-editor__editable.ck-content .todo-list .todo-list__label>input:hover:before,.ck-editor__editable.ck-content .todo-list .todo-list__label>span[contenteditable=false]>input:hover:before{box-shadow:0 0 0 5px rgba(0,0,0,.1)}.ck-editor__editable.ck-content .todo-list .todo-list__label>span[contenteditable=false]>input{-webkit-appearance:none;border:0;display:inline-block;height:var(--ck-content-todo-list-checkmark-size);left:-25px;margin-left:0;margin-right:-15px;position:relative;right:0;vertical-align:middle;width:var(--ck-content-todo-list-checkmark-size)}.ck-editor__editable.ck-content[dir=rtl] .todo-list .todo-list__label>span[contenteditable=false]>input{left:0;margin-left:-15px;margin-right:0;right:-25px}.ck-editor__editable.ck-content .todo-list .todo-list__label>span[contenteditable=false]>input:before{border:1px solid #333;border-radius:2px;box-sizing:border-box;content:"";display:block;height:100%;position:absolute;transition:box-shadow .25s ease-in-out;width:100%}@media (prefers-reduced-motion:reduce){.ck-editor__editable.ck-content .todo-list .todo-list__label>span[contenteditable=false]>input:before{transition:none}}.ck-editor__editable.ck-content .todo-list .todo-list__label>span[contenteditable=false]>input:after{border-color:transparent;border-style:solid;border-width:0 calc(var(--ck-content-todo-list-checkmark-size)/8) calc(var(--ck-content-todo-list-checkmark-size)/8) 0;box-sizing:content-box;content:"";display:block;height:calc(var(--ck-content-todo-list-checkmark-size)/2.6);left:calc(var(--ck-content-todo-list-checkmark-size)/3);pointer-events:none;position:absolute;top:calc(var(--ck-content-todo-list-checkmark-size)/5.3);transform:rotate(45deg);width:calc(var(--ck-content-todo-list-checkmark-size)/5.3)}.ck-editor__editable.ck-content .todo-list .todo-list__label>span[contenteditable=false]>input[checked]:before{background:#26ab33;border-color:#26ab33}.ck-editor__editable.ck-content .todo-list .todo-list__label>span[contenteditable=false]>input[checked]:after{border-color:#fff}.ck-editor__editable.ck-content .todo-list .todo-list__label.todo-list__label_without-description input[type=checkbox]{position:absolute}');/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class Es extends b{static get requires(){return[We,Pt]}static get pluginName(){return"TodoList"}static get isOfficialPlugin(){return!0}}/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class it extends k{type;constructor(t,i){super(t),this.type=i}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(t={}){const i=this.editor.model,e=i.document,s=Array.from(e.selection.getSelectedBlocks()).filter(o=>Ye(o,i.schema)),r=t.forceValue!==void 0?!t.forceValue:this.value;i.change(o=>{if(r){let l=s[s.length-1].nextSibling,c=Number.POSITIVE_INFINITY,a=[];for(;l&&l.name=="listItem"&&l.getAttribute("listIndent")!==0;){const u=l.getAttribute("listIndent");u<c&&(c=u);const d=u-c;a.push({element:l,listIndent:d}),l=l.nextSibling}a=a.reverse();for(const u of a)o.setAttribute("listIndent",u.listIndent,u.element)}if(!r){let l=Number.POSITIVE_INFINITY;for(const c of s)c.is("element","listItem")&&c.getAttribute("listIndent")<l&&(l=c.getAttribute("listIndent"));l=l===0?1:l,Ke(s,!0,l),Ke(s,!1,l)}for(const l of s.reverse())r&&l.name=="listItem"?o.rename(l,"paragraph"):!r&&l.name!="listItem"?(o.setAttributes({listType:this.type,listIndent:0},l),o.rename(l,"listItem")):!r&&l.name=="listItem"&&l.getAttribute("listType")!=this.type&&o.setAttribute("listType",this.type,l);this.fire("_executeCleanup",s)})}_getValue(){const t=E(this.editor.model.document.selection.getSelectedBlocks());return!!t&&t.is("element","listItem")&&t.getAttribute("listType")==this.type}_checkEnabled(){if(this.value)return!0;const t=this.editor.model.document.selection,i=this.editor.model.schema,e=E(t.getSelectedBlocks());return e?Ye(e,i):!1}}function Ke(n,t,i){const e=t?n[0]:n[n.length-1];if(e.is("element","listItem")){let s=e[t?"previousSibling":"nextSibling"],r=e.getAttribute("listIndent");for(;s&&s.is("element","listItem")&&s.getAttribute("listIndent")>=i;)r>s.getAttribute("listIndent")&&(r=s.getAttribute("listIndent")),s.getAttribute("listIndent")==r&&n[t?"unshift":"push"](s),s=s[t?"previousSibling":"nextSibling"]}}function Ye(n,t){return t.checkChild(n.parent,"listItem")&&!t.isObject(n)}/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class Bt extends k{_indentBy;constructor(t,i){super(t),this._indentBy=i=="forward"?1:-1}refresh(){this.isEnabled=this._checkEnabled()}execute(){const t=this.editor.model,i=t.document;let e=Array.from(i.selection.getSelectedBlocks());t.change(s=>{const r=e[e.length-1];let o=r.nextSibling;for(;o&&o.name=="listItem"&&o.getAttribute("listIndent")>r.getAttribute("listIndent");)e.push(o),o=o.nextSibling;this._indentBy<0&&(e=e.reverse());for(const l of e){const c=l.getAttribute("listIndent")+this._indentBy;c<0?s.rename(l,"paragraph"):s.setAttribute("listIndent",c,l)}this.fire("_executeCleanup",e)})}_checkEnabled(){const t=E(this.editor.model.document.selection.getSelectedBlocks());if(!t||!t.is("element","listItem"))return!1;if(this._indentBy>0){const i=t.getAttribute("listIndent"),e=t.getAttribute("listType");let s=t.previousSibling;for(;s&&s.is("element","listItem")&&s.getAttribute("listIndent")>=i;){if(s.getAttribute("listIndent")==i)return s.getAttribute("listType")==e;s=s.previousSibling}return!1}return!0}}/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/function Ps(n){const t=n.createContainerElement("li");return t.getFillerOffset=Vs,t}function Ft(n,t){const i=t.mapper,e=t.writer,s=n.getAttribute("listType")=="numbered"?"ol":"ul",r=Ps(e),o=e.createContainerElement(s,null);return e.insert(e.createPositionAt(o,0),r),i.bindElements(n,r),r}function st(n,t,i,e){const s=t.parent,r=i.mapper,o=i.writer;let l=r.toViewPosition(e.createPositionBefore(n));const c=M(n.previousSibling,{sameIndent:!0,smallerIndent:!0,listIndent:n.getAttribute("listIndent")}),a=n.previousSibling;if(c&&c.getAttribute("listIndent")==n.getAttribute("listIndent")){const u=r.toViewElement(c);l=o.breakContainer(o.createPositionAfter(u))}else if(a&&a.name=="listItem"){l=r.toViewPosition(e.createPositionAt(a,"end"));const u=r.findMappedViewAncestor(l),d=He(u);d?l=o.createPositionBefore(d):l=o.createPositionAt(u,"end")}else l=r.toViewPosition(e.createPositionBefore(n));if(l=Vt(l),o.insert(l,s),a&&a.name=="listItem"){const u=r.toViewElement(a),m=o.createRange(o.createPositionAt(u,0),l).getWalker({ignoreElementEnd:!0});for(const f of m)if(f.item.is("element","li")){const p=o.breakContainer(o.createPositionBefore(f.item)),h=f.item.parent,I=o.createPositionAt(t,"end");v(o,I.nodeBefore,I.nodeAfter),o.move(o.createRangeOn(h),I),m._position=p}}else{const u=s.nextSibling;if(u&&(u.is("element","ul")||u.is("element","ol"))){let d=null;for(const m of u.getChildren()){const f=r.toModelElement(m);if(f&&f.getAttribute("listIndent")>n.getAttribute("listIndent"))d=m;else break}d&&(o.breakContainer(o.createPositionAfter(d)),o.move(o.createRangeOn(d.parent),o.createPositionAt(t,"end")))}}v(o,s,s.nextSibling),v(o,s.previousSibling,s)}function v(n,t,i){return!t||!i||t.name!="ul"&&t.name!="ol"||t.name!=i.name||t.getAttribute("class")!==i.getAttribute("class")?null:n.mergeContainers(n.createPositionAfter(t))}function Vt(n){return n.getLastMatchingPosition(t=>t.item.is("uiElement"))}function M(n,t){const i=!!t.sameIndent,e=!!t.smallerIndent,s=t.listIndent;let r=n;for(;r&&r.name=="listItem";){const o=r.getAttribute("listIndent");if(i&&s==o||e&&s>o)return r;t.direction==="forward"?r=r.nextSibling:r=r.previousSibling}return null}function He(n){for(const t of n.getChildren())if(t.name=="ul"||t.name=="ol")return t;return null}function nt(n,t){const i=[],e=n.parent,s={ignoreElementEnd:!1,startPosition:n,shallow:!0,direction:t},r=e.getAttribute("listIndent"),o=[...new Yt(s)].filter(l=>l.item.is("element")).map(l=>l.item);for(const l of o){if(!l.is("element","listItem")||l.getAttribute("listIndent")<r)break;if(!(l.getAttribute("listIndent")>r)){if(l.getAttribute("listType")!==e.getAttribute("listType")||l.getAttribute("listStyle")!==e.getAttribute("listStyle")||l.getAttribute("listReversed")!==e.getAttribute("listReversed")||l.getAttribute("listStart")!==e.getAttribute("listStart"))break;t==="backward"?i.unshift(l):i.push(l)}}return i}function rt(n){let i=[...n.document.selection.getSelectedBlocks()].filter(e=>e.is("element","listItem")).map(e=>{const s=n.change(r=>r.createPositionAt(e,0));return[...nt(s,"backward"),...nt(s,"forward")]}).flat();return i=[...new Set(i)],i}const Bs=["disc","circle","square"],Fs=["decimal","decimal-leading-zero","lower-roman","upper-roman","lower-latin","upper-latin"];function Ge(n){return Bs.includes(n)?"bulleted":Fs.includes(n)?"numbered":null}function Vs(){const n=!this.isEmpty&&(this.getChild(0).name=="ul"||this.getChild(0).name=="ol");return this.isEmpty||n?0:qi.call(this)}/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class Xe extends b{static get pluginName(){return"LegacyListUtils"}static get isOfficialPlugin(){return!0}getListTypeFromListStyleType(t){return Ge(t)}getSelectedListItems(t){return rt(t)}getSiblingNodes(t,i){return nt(t,i)}}/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/function Ze(n){return(t,i,e)=>{const s=e.consumable;if(!s.test(i.item,"insert")||!s.test(i.item,"attribute:listType")||!s.test(i.item,"attribute:listIndent"))return;s.consume(i.item,"insert"),s.consume(i.item,"attribute:listType"),s.consume(i.item,"attribute:listIndent");const r=i.item,o=Ft(r,e);st(r,o,e,n)}}function Ns(n){return(t,i,e)=>{const o=e.mapper.toViewPosition(i.position).getLastMatchingPosition(f=>!f.item.is("element","li")).nodeAfter,l=e.writer;l.breakContainer(l.createPositionBefore(o)),l.breakContainer(l.createPositionAfter(o));const c=o.parent,a=c.previousSibling,u=l.createRangeOn(c),d=l.remove(u);a&&a.nextSibling&&v(l,a,a.nextSibling);const m=e.mapper.toModelElement(o);ei(m.getAttribute("listIndent")+1,i.position,u.start,o,e,n);for(const f of l.createRangeIn(d).getItems())e.mapper.unbindViewElement(f);t.stop()}}const Os=(n,t,i)=>{if(!i.consumable.test(t.item,n.name))return;const e=i.mapper.toViewElement(t.item),s=i.writer;s.breakContainer(s.createPositionBefore(e)),s.breakContainer(s.createPositionAfter(e));const r=e.parent,o=t.attributeNewValue=="numbered"?"ol":"ul";s.rename(o,r)},Rs=(n,t,i)=>{i.consumable.consume(t.item,n.name);const s=i.mapper.toViewElement(t.item).parent,r=i.writer;v(r,s,s.nextSibling),v(r,s.previousSibling,s)};function Ms(n){return(t,i,e)=>{if(!e.consumable.consume(i.item,"attribute:listIndent"))return;const s=e.mapper.toViewElement(i.item),r=e.writer;r.breakContainer(r.createPositionBefore(s)),r.breakContainer(r.createPositionAfter(s));const o=s.parent,l=o.previousSibling,c=r.createRangeOn(o);r.remove(c),l&&l.nextSibling&&v(r,l,l.nextSibling),ei(i.attributeOldValue+1,i.range.start,c.start,s,e,n),st(i.item,s,e,n);for(const a of i.item.getChildren())e.consumable.consume(a,"insert")}}const Je=(n,t,i)=>{if(i.consumable.test(t.item,n.name)&&t.item.name!="listItem"){let e=i.mapper.toViewPosition(t.range.start);const s=i.writer,r=[];for(;(e.parent.name=="ul"||e.parent.name=="ol")&&(e=s.breakContainer(e),e.parent.name=="li");){const o=e,l=s.createPositionAt(e.parent,"end");if(!o.isEqual(l)){const c=s.remove(s.createRange(o,l));r.push(c)}e=s.createPositionAfter(e.parent)}if(r.length>0){for(let o=0;o<r.length;o++){const l=e.nodeBefore;if(e=s.insert(e,r[o]).end,o>0){const a=v(s,l,l.nextSibling);a&&a.parent==l&&e.offset--}}v(s,e.nodeBefore,e.nodeAfter)}}},Ds=(n,t,i)=>{const e=i.mapper.toViewPosition(t.position),s=e.nodeBefore,r=e.nodeAfter;v(i.writer,s,r)},zs=(n,t,i)=>{if(i.consumable.consume(t.viewItem,{name:!0})){const e=i.writer,s=e.createElement("listItem"),r=Ys(t.viewItem);e.setAttribute("listIndent",r,s);const o=t.viewItem.parent&&t.viewItem.parent.name=="ol"?"numbered":"bulleted";if(e.setAttribute("listType",o,s),!i.safeInsert(s,t.modelCursor))return;const l=js(s,t.viewItem.getChildren(),i);t.modelRange=e.createRange(t.modelCursor,l),i.updateConversionResult(s,t)}},Qe=(n,t,i)=>{if(i.consumable.test(t.viewItem,{name:!0})){const e=Array.from(t.viewItem.getChildren());for(const s of e)!(s.is("element","li")||D(s))&&s._remove()}},Us=(n,t,i)=>{if(i.consumable.test(t.viewItem,{name:!0})){if(t.viewItem.childCount===0)return;const e=[...t.viewItem.getChildren()];let s=!1;for(const r of e)s&&!D(r)&&r._remove(),D(r)&&(s=!0)}};function ti(n){return(t,i)=>{if(i.isPhantom)return;const e=i.modelPosition.nodeBefore;if(e&&e.is("element","listItem")){const s=i.mapper.toViewElement(e),r=s.getAncestors().find(D),o=n.createPositionAt(s,0).getWalker();for(const l of o)if(l.type=="elementStart"&&l.item.is("element","li")){i.viewPosition=l.previousPosition;break}else if(l.type=="elementEnd"&&l.item==r){i.viewPosition=l.nextPosition;break}}}}function $s(n){return(t,i)=>{const e=i.viewPosition,s=e.parent,r=i.mapper;if(s.name=="ul"||s.name=="ol"){if(e.isAtEnd){const o=r.toModelElement(e.nodeBefore),l=r.getModelLength(e.nodeBefore);i.modelPosition=n.createPositionBefore(o).getShiftedBy(l)}else{const o=r.toModelElement(e.nodeAfter);i.modelPosition=n.createPositionBefore(o)}t.stop()}else if(s.name=="li"&&e.nodeBefore&&(e.nodeBefore.name=="ul"||e.nodeBefore.name=="ol")){const o=r.toModelElement(s);let l=1,c=e.nodeBefore;for(;c&&D(c);)l+=r.getModelLength(c),c=c.previousSibling;i.modelPosition=n.createPositionBefore(o).getShiftedBy(l),t.stop()}}}function Ws(n,t){const i=n.document.differ.getChanges(),e=new Map;let s=!1;for(const c of i)if(c.type=="insert"&&c.name=="listItem")r(c.position);else if(c.type=="insert"&&c.name!="listItem"){if(c.name!="$text"){const u=c.position.nodeAfter;u.hasAttribute("listIndent")&&(t.removeAttribute("listIndent",u),s=!0),u.hasAttribute("listType")&&(t.removeAttribute("listType",u),s=!0),u.hasAttribute("listStyle")&&(t.removeAttribute("listStyle",u),s=!0),u.hasAttribute("listReversed")&&(t.removeAttribute("listReversed",u),s=!0),u.hasAttribute("listStart")&&(t.removeAttribute("listStart",u),s=!0);for(const d of Array.from(n.createRangeIn(u)).filter(m=>m.item.is("element","listItem")))r(d.previousPosition)}const a=c.position.getShiftedBy(c.length);r(a)}else c.type=="remove"&&c.name=="listItem"?r(c.position):(c.type=="attribute"&&c.attributeKey=="listIndent"||c.type=="attribute"&&c.attributeKey=="listType")&&r(c.range.start);for(const c of e.values())o(c),l(c);return s;function r(c){const a=c.nodeBefore;if(!a||!a.is("element","listItem")){const u=c.nodeAfter;u&&u.is("element","listItem")&&e.set(u,u)}else{let u=a;if(e.has(u))return;for(let d=u.previousSibling;d&&d.is("element","listItem");d=u.previousSibling)if(u=d,e.has(u))return;e.set(a,u)}}function o(c){let a=0,u=null;for(;c&&c.is("element","listItem");){const d=c.getAttribute("listIndent");if(d>a){let m;u===null?(u=d-a,m=a):(u>d&&(u=d),m=d-u),t.setAttribute("listIndent",m,c),s=!0}else u=null,a=c.getAttribute("listIndent")+1;c=c.nextSibling}}function l(c){let a=[],u=null;for(;c&&c.is("element","listItem");){const d=c.getAttribute("listIndent");if(u&&u.getAttribute("listIndent")>d&&(a=a.slice(0,d+1)),d!=0)if(a[d]){const m=a[d];c.getAttribute("listType")!=m&&(t.setAttribute("listType",m,c),s=!0)}else a[d]=c.getAttribute("listType");u=c,c=c.nextSibling}}}const qs=function(n,[t,i]){const e=this;let s=t.is("documentFragment")?t.getChild(0):t,r;if(i?r=e.createSelection(i):r=e.document.selection,s&&s.is("element","listItem")){const o=r.getFirstPosition();let l=null;if(o.parent.is("element","listItem")?l=o.parent:o.nodeBefore&&o.nodeBefore.is("element","listItem")&&(l=o.nodeBefore),l){const c=l.getAttribute("listIndent");if(c>0)for(;s&&s.is("element","listItem");)s._setAttribute("listIndent",s.getAttribute("listIndent")+c),s=s.nextSibling}}};function js(n,t,i){const{writer:e,schema:s}=i;let r=e.createPositionAfter(n);for(const o of t)if(o.name=="ul"||o.name=="ol")r=i.convertItem(o,r).modelCursor;else{const l=i.convertItem(o,e.createPositionAt(n,"end")),c=l.modelRange.start.nodeAfter;c&&c.is("element")&&!s.checkChild(n,c.name)&&(l.modelCursor.parent.is("element","listItem")?n=l.modelCursor.parent:n=Ks(l.modelCursor),r=e.createPositionAfter(n))}return r}function Ks(n){const t=new Yt({startPosition:n});let i;do i=t.next();while(!i.value.item.is("element","listItem"));return i.value.item}function ei(n,t,i,e,s,r){const o=M(t.nodeBefore,{sameIndent:!0,smallerIndent:!0,listIndent:n}),l=s.mapper,c=s.writer,a=o?o.getAttribute("listIndent"):null;let u;if(!o)u=i;else if(a==n){const d=l.toViewElement(o).parent;u=c.createPositionAfter(d)}else{const d=r.createPositionAt(o,"end");u=l.toViewPosition(d)}u=Vt(u);for(const d of[...e.getChildren()])D(d)&&(u=c.move(c.createRangeOn(d),u).end,v(c,d,d.nextSibling),v(c,d.previousSibling,d))}function D(n){return n.is("element","ol")||n.is("element","ul")}function Ys(n){let t=0,i=n.parent;for(;i;){if(i.is("element","li"))t++;else{const e=i.previousSibling;e&&e.is("element","li")&&t++}i=i.parent}return t}/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class ot extends b{static get pluginName(){return"LegacyListEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[Mt,Rt,Xe]}init(){const t=this.editor;t.model.schema.register("listItem",{inheritAllFrom:"$block",allowAttributes:["listType","listIndent"]});const i=t.data,e=t.editing;t.model.document.registerPostFixer(r=>Ws(t.model,r)),e.mapper.registerViewToModelLength("li",Nt),i.mapper.registerViewToModelLength("li",Nt),e.mapper.on("modelToViewPosition",ti(e.view)),e.mapper.on("viewToModelPosition",$s(t.model)),i.mapper.on("modelToViewPosition",ti(e.view)),t.conversion.for("editingDowncast").add(r=>{r.on("insert",Je,{priority:"high"}),r.on("insert:listItem",Ze(t.model)),r.on("attribute:listType:listItem",Os,{priority:"high"}),r.on("attribute:listType:listItem",Rs,{priority:"low"}),r.on("attribute:listIndent:listItem",Ms(t.model)),r.on("remove:listItem",Ns(t.model)),r.on("remove",Ds,{priority:"low"})}),t.conversion.for("dataDowncast").add(r=>{r.on("insert",Je,{priority:"high"}),r.on("insert:listItem",Ze(t.model))}),t.conversion.for("upcast").add(r=>{r.on("element:ul",Qe,{priority:"high"}),r.on("element:ol",Qe,{priority:"high"}),r.on("element:li",Us,{priority:"high"}),r.on("element:li",zs)}),t.model.on("insertContent",qs,{priority:"high"}),t.commands.add("numberedList",new it(t,"numbered")),t.commands.add("bulletedList",new it(t,"bulleted")),t.commands.add("indentList",new Bt(t,"forward")),t.commands.add("outdentList",new Bt(t,"backward"));const s=e.view.document;this.listenTo(s,"enter",(r,o)=>{const l=this.editor.model.document,c=l.selection.getLastPosition().parent;l.selection.isCollapsed&&c.name=="listItem"&&c.isEmpty&&(this.editor.execute("outdentList"),o.preventDefault(),r.stop())},{context:"li"}),this.listenTo(s,"delete",(r,o)=>{if(o.direction!=="backward")return;const l=this.editor.model.document.selection;if(!l.isCollapsed)return;const c=l.getFirstPosition();if(!c.isAtStart)return;const a=c.parent;a.name!=="listItem"||a.previousSibling&&a.previousSibling.name==="listItem"||(this.editor.execute("outdentList"),o.preventDefault(),r.stop())},{context:"li"}),this.listenTo(t.editing.view.document,"tab",(r,o)=>{const l=o.shiftKey?"outdentList":"indentList";this.editor.commands.get(l).isEnabled&&(t.execute(l),o.stopPropagation(),o.preventDefault(),r.stop())},{context:"li"})}afterInit(){const t=this.editor.commands,i=t.get("indent"),e=t.get("outdent");i&&i.registerChildCommand(t.get("indentList")),e&&e.registerChildCommand(t.get("outdentList"))}}function Nt(n){let t=1;for(const i of n.getChildren())if(i.name=="ul"||i.name=="ol")for(const e of i.getChildren())t+=Nt(e);return t}/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class Hs extends b{static get requires(){return[ot,At]}static get pluginName(){return"LegacyList"}static get isOfficialPlugin(){return!0}}/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class ii extends k{defaultType;constructor(t,i){super(t),this.defaultType=i}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(t={}){this._tryToConvertItemsToList(t);const i=this.editor.model,e=rt(i);e.length&&i.change(s=>{for(const r of e)s.setAttribute("listStyle",t.type||this.defaultType,r)})}_getValue(){const t=this.editor.model.document.selection.getFirstPosition().parent;return t&&t.is("element","listItem")?t.getAttribute("listStyle"):null}_checkEnabled(){const t=this.editor,i=t.commands.get("numberedList"),e=t.commands.get("bulletedList");return i.isEnabled||e.isEnabled}_tryToConvertItemsToList(t){if(!t.type)return;const i=Ge(t.type);/* istanbul ignore next -- @preserve */if(!i)return;const e=this.editor,s=`${i}List`;e.commands.get(s).value||e.execute(s)}}/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class si extends k{refresh(){const t=this._getValue();this.value=t,this.isEnabled=t!=null}execute(t={}){const i=this.editor.model,e=rt(i).filter(s=>s.getAttribute("listType")=="numbered");i.change(s=>{for(const r of e)s.setAttribute("listReversed",!!t.reversed,r)})}_getValue(){const t=this.editor.model.document.selection.getFirstPosition().parent;return t&&t.is("element","listItem")&&t.getAttribute("listType")=="numbered"?t.getAttribute("listReversed"):null}}/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class ni extends k{refresh(){const t=this._getValue();this.value=t,this.isEnabled=t!=null}execute({startIndex:t=1}={}){const i=this.editor.model,e=rt(i).filter(s=>s.getAttribute("listType")=="numbered");i.change(s=>{for(const r of e)s.setAttribute("listStart",t>=0?t:1,r)})}_getValue(){const t=this.editor.model.document.selection.getFirstPosition().parent;return t&&t.is("element","listItem")&&t.getAttribute("listType")=="numbered"?t.getAttribute("listStart"):null}}/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/const lt="default";class ri extends b{static get requires(){return[ot]}static get pluginName(){return"LegacyListPropertiesEditing"}static get isOfficialPlugin(){return!0}constructor(t){super(t),t.config.define("list",{properties:{styles:!0,startIndex:!1,reversed:!1}})}init(){const t=this.editor,i=t.model,e=t.config.get("list.properties"),s=Gs(e);i.schema.extend("listItem",{allowAttributes:s.map(r=>r.attributeName)});for(const r of s)r.addCommand(t);this.listenTo(t.commands.get("indentList"),"_executeCleanup",Js(t,s)),this.listenTo(t.commands.get("outdentList"),"_executeCleanup",Qs(t,s)),this.listenTo(t.commands.get("bulletedList"),"_executeCleanup",oi(t)),this.listenTo(t.commands.get("numberedList"),"_executeCleanup",oi(t)),i.document.registerPostFixer(tn(t,s)),t.conversion.for("upcast").add(Xs(s)),t.conversion.for("downcast").add(Zs(s)),this._mergeListAttributesWhileMergingLists(s)}afterInit(){const t=this.editor;t.commands.get("todoList")&&t.model.document.registerPostFixer(nn(t))}_mergeListAttributesWhileMergingLists(t){const e=this.editor.model;let s;this.listenTo(e,"deleteContent",(r,[o])=>{const l=o.getFirstPosition(),c=o.getLastPosition();if(l.parent===c.parent||!l.parent.is("element","listItem"))return;const a=c.parent.nextSibling;if(!a||!a.is("element","listItem"))return;const u=M(l.parent,{sameIndent:!0,listIndent:a.getAttribute("listIndent")});u&&u.getAttribute("listType")===a.getAttribute("listType")&&(s=u)},{priority:"high"}),this.listenTo(e,"deleteContent",()=>{s&&(e.change(r=>{const o=M(s.nextSibling,{sameIndent:!0,listIndent:s.getAttribute("listIndent"),direction:"forward"});if(!o){s=null;return}const l=[o,...nt(r.createPositionAt(o,0),"forward")];for(const c of l)for(const a of t)if(a.appliesToListItem(c)){const u=a.attributeName,d=s.getAttribute(u);r.setAttribute(u,d,c)}}),s=null)},{priority:"low"})}}function Gs(n){const t=[];return n.styles&&t.push({attributeName:"listStyle",defaultValue:lt,addCommand(i){i.commands.add("listStyle",new ii(i,lt))},appliesToListItem(){return!0},setAttributeOnDowncast(i,e,s){e&&e!==lt?i.setStyle("list-style-type",e,s):i.removeStyle("list-style-type",s)},getAttributeOnUpcast(i){return vt(i.getStyle("list-style-type"))||lt}}),n.reversed&&t.push({attributeName:"listReversed",defaultValue:!1,addCommand(i){i.commands.add("listReversed",new si(i))},appliesToListItem(i){return i.getAttribute("listType")=="numbered"},setAttributeOnDowncast(i,e,s){e?i.setAttribute("reversed","reversed",s):i.removeAttribute("reversed",s)},getAttributeOnUpcast(i){return i.hasAttribute("reversed")}}),n.startIndex&&t.push({attributeName:"listStart",defaultValue:1,addCommand(i){i.commands.add("listStart",new ni(i))},appliesToListItem(i){return i.getAttribute("listType")=="numbered"},setAttributeOnDowncast(i,e,s){e==0||e>1?i.setAttribute("start",e,s):i.removeAttribute("start",s)},getAttributeOnUpcast(i){const e=i.getAttribute("start");return e>=0?e:1}}),t}function Xs(n){return t=>{t.on("element:li",(i,e,s)=>{if(!e.modelRange)return;const r=e.viewItem.parent,o=e.modelRange.start.nodeAfter||e.modelRange.end.nodeBefore;for(const l of n)if(l.appliesToListItem(o)){const c=l.getAttributeOnUpcast(r);s.writer.setAttribute(l.attributeName,c,o)}},{priority:"low"})}}function Zs(n){return i=>{for(const e of n)i.on(`attribute:${e.attributeName}:listItem`,(s,r,o)=>{const l=o.writer,c=r.item,a=M(c.previousSibling,{sameIndent:!0,listIndent:c.getAttribute("listIndent"),direction:"backward"}),u=o.mapper.toViewElement(c);t(c,a)||l.breakContainer(l.createPositionBefore(u)),e.setAttributeOnDowncast(l,r.attributeNewValue,u.parent)},{priority:"low"})};function t(i,e){return e&&i.getAttribute("listType")===e.getAttribute("listType")&&i.getAttribute("listIndent")===e.getAttribute("listIndent")&&i.getAttribute("listStyle")===e.getAttribute("listStyle")&&i.getAttribute("listReversed")===e.getAttribute("listReversed")&&i.getAttribute("listStart")===e.getAttribute("listStart")}}function Js(n,t){return(i,e)=>{const s=e[0],r=s.getAttribute("listIndent"),o=e.filter(c=>c.getAttribute("listIndent")===r);let l=null;s.previousSibling.getAttribute("listIndent")+1!==r&&(l=M(s.previousSibling,{sameIndent:!0,direction:"backward",listIndent:r})),n.model.change(c=>{for(const a of o)for(const u of t)if(u.appliesToListItem(a)){const d=l==null?u.defaultValue:l.getAttribute(u.attributeName);c.setAttribute(u.attributeName,d,a)}})}}function Qs(n,t){return(i,e)=>{if(e=e.reverse().filter(l=>l.is("element","listItem")),!e.length)return;const s=e[0].getAttribute("listIndent"),r=e[0].getAttribute("listType");let o=e[0].previousSibling;if(o.is("element","listItem"))for(;o.getAttribute("listIndent")!==s;)o=o.previousSibling;else o=null;o||(o=e[e.length-1].nextSibling),!(!o||!o.is("element","listItem"))&&o.getAttribute("listType")===r&&n.model.change(l=>{const c=e.filter(a=>a.getAttribute("listIndent")===s);for(const a of c)for(const u of t)if(u.appliesToListItem(a)){const d=u.attributeName,m=o.getAttribute(d);l.setAttribute(d,m,a)}})}}function tn(n,t){return i=>{let e=!1;const s=li(n.model.document.differ.getChanges()).filter(o=>o.getAttribute("listType")!=="todo");if(!s.length)return e;let r=s[s.length-1].nextSibling;if((!r||!r.is("element","listItem"))&&(r=s[0].previousSibling,r)){const o=s[0].getAttribute("listIndent");for(;r.is("element","listItem")&&r.getAttribute("listIndent")!==o&&(r=r.previousSibling,!!r););}for(const o of t){const l=o.attributeName;for(const c of s){if(!o.appliesToListItem(c)){i.removeAttribute(l,c);continue}if(!c.hasAttribute(l))en(r,c,o)?i.setAttribute(l,r.getAttribute(l),c):i.setAttribute(l,o.defaultValue,c),e=!0;else{const a=c.previousSibling;sn(a,c,o.attributeName)&&(i.setAttribute(l,a.getAttribute(l),c),e=!0)}}}return e}}function en(n,t,i){if(!n)return!1;const e=n.getAttribute(i.attributeName);return!(!e||e==i.defaultValue||n.getAttribute("listType")!==t.getAttribute("listType"))}function sn(n,t,i){if(!n||!n.is("element","listItem")||t.getAttribute("listType")!==n.getAttribute("listType"))return!1;const e=n.getAttribute("listIndent");if(e<1||e!==t.getAttribute("listIndent"))return!1;const s=n.getAttribute(i);return!(!s||s===t.getAttribute(i))}function nn(n){return t=>{const i=li(n.model.document.differ.getChanges()).filter(e=>e.getAttribute("listType")==="todo"&&(e.hasAttribute("listStyle")||e.hasAttribute("listReversed")||e.hasAttribute("listStart")));if(!i.length)return!1;for(const e of i)t.removeAttribute("listStyle",e),t.removeAttribute("listReversed",e),t.removeAttribute("listStart",e);return!0}}function oi(n){return(t,i)=>{i=i.filter(e=>e.is("element","listItem")),n.model.change(e=>{for(const s of i)e.removeAttribute("listStyle",s)})}}function li(n){const t=[];for(const i of n){const e=rn(i);e&&e.is("element","listItem")&&t.push(e)}return t}function rn(n){return n.type==="attribute"?n.range.start.nodeAfter:n.type==="insert"?n.position.nodeAfter:null}/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class on extends b{static get requires(){return[ri,xt]}static get pluginName(){return"LegacyListProperties"}static get isOfficialPlugin(){return!0}}/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/const q="todoListChecked";class ci extends k{_selectedElements;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(q)),this.isEnabled=!!this._selectedElements.length}_getSelectedItems(){const t=this.editor.model,i=t.schema,e=t.document.selection.getFirstRange(),s=e.start.parent,r=[];i.checkAttribute(s,q)&&r.push(s);for(const o of e.getItems())i.checkAttribute(o,q)&&!r.includes(o)&&r.push(o);return r}execute(t={}){this.editor.model.change(i=>{for(const e of this._selectedElements)(t.forceValue===void 0?!this.value:t.forceValue)?i.setAttribute(q,!0,e):i.removeAttribute(q,e)})}}/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/function ln(n,t){return(i,e,s)=>{const r=s.consumable;if(!r.test(e.item,"insert")||!r.test(e.item,"attribute:listType")||!r.test(e.item,"attribute:listIndent")||e.item.getAttribute("listType")!="todo")return;const o=e.item;r.consume(o,"insert"),r.consume(o,"attribute:listType"),r.consume(o,"attribute:listIndent"),r.consume(o,"attribute:todoListChecked");const l=s.writer,c=Ft(o,s),a=!!o.getAttribute("todoListChecked"),u=Ot(o,l,a,t),d=l.createContainerElement("span",{class:"todo-list__label__description"});l.addClass("todo-list",c.parent),l.insert(l.createPositionAt(c,0),u),l.insert(l.createPositionAfter(u),d),st(o,c,s,n)}}function cn(n){return(t,i,e)=>{const s=e.consumable;if(!s.test(i.item,"insert")||!s.test(i.item,"attribute:listType")||!s.test(i.item,"attribute:listIndent")||i.item.getAttribute("listType")!="todo")return;const r=i.item;s.consume(r,"insert"),s.consume(r,"attribute:listType"),s.consume(r,"attribute:listIndent"),s.consume(r,"attribute:todoListChecked");const o=e.writer,l=Ft(r,e);o.addClass("todo-list",l.parent);const c=o.createContainerElement("label",{class:"todo-list__label"}),a=o.createEmptyElement("input",{type:"checkbox",disabled:"disabled"}),u=o.createContainerElement("span",{class:"todo-list__label__description"});r.getAttribute("todoListChecked")&&o.setAttribute("checked","checked",a),o.insert(o.createPositionAt(l,0),c),o.insert(o.createPositionAt(c,0),a),o.insert(o.createPositionAfter(a),u),st(r,l,e,n)}}const an=(n,t,i)=>{const e=t.modelCursor,s=e.parent,r=t.viewItem;if(r.getAttribute("type")!="checkbox"||s.name!="listItem"||!e.isAtStart||!i.consumable.consume(r,{name:!0}))return;const o=i.writer;o.setAttribute("listType","todo",s),t.viewItem.hasAttribute("checked")&&o.setAttribute("todoListChecked",!0,s),t.modelRange=o.createRange(e)};function un(n,t){return(i,e,s)=>{if(!s.consumable.consume(e.item,i.name))return;const r=s.mapper.toViewElement(e.item),o=s.writer,l=mn(r,t);if(e.attributeNewValue=="todo"){const c=!!e.item.getAttribute("todoListChecked"),a=Ot(e.item,o,c,n),u=o.createContainerElement("span",{class:"todo-list__label__description"}),d=o.createRangeIn(r),m=He(r),f=Vt(d.start),p=m?o.createPositionBefore(m):d.end,h=o.createRange(f,p);o.addClass("todo-list",r.parent),o.move(h,o.createPositionAt(u,0)),o.insert(o.createPositionAt(r,0),a),o.insert(o.createPositionAfter(a),u)}else if(e.attributeOldValue=="todo"){const c=ui(r,t);o.removeClass("todo-list",r.parent),o.remove(l),o.move(o.createRangeIn(c),o.createPositionBefore(c)),o.remove(c)}}}function dn(n){return(t,i,e)=>{if(i.item.getAttribute("listType")!="todo"||!e.consumable.consume(i.item,"attribute:todoListChecked"))return;const{mapper:s,writer:r}=e,o=!!i.item.getAttribute("todoListChecked"),c=s.toViewElement(i.item).getChild(0),a=Ot(i.item,r,o,n);r.insert(r.createPositionAfter(c),a),r.remove(c)}}function ai(n){return(t,i)=>{const e=i.modelPosition,s=e.parent;if(!s.is("element","listItem")||s.getAttribute("listType")!="todo")return;const r=i.mapper.toViewElement(s),o=ui(r,n);o&&(i.viewPosition=i.mapper.findPositionIn(o,e.offset))}}function Ot(n,t,i,e){return t.createUIElement("label",{class:"todo-list__label",contenteditable:!1},function(r){const o=Ii(document,"input",{type:"checkbox",tabindex:"-1"});i&&o.setAttribute("checked","checked"),o.addEventListener("change",()=>e(n));const l=this.toDomElement(r);return l.appendChild(o),l})}function mn(n,t){const i=t.createRangeIn(n);for(const e of i)if(e.item.is("uiElement","label"))return e.item}function ui(n,t){const i=t.createRangeIn(n);for(const e of i)if(e.item.is("containerElement","span")&&e.item.hasClass("todo-list__label__description"))return e.item}/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/const fn=$t("Ctrl+Enter");class di extends b{static get pluginName(){return"LegacyTodoListEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[ot]}init(){const t=this.editor,{editing:i,data:e,model:s}=t;s.schema.extend("listItem",{allowAttributes:["todoListChecked"]}),s.schema.addAttributeCheck((l,c)=>{const a=l.last;if(c=="todoListChecked"&&a.name=="listItem"&&a.getAttribute("listType")!="todo")return!1}),t.commands.add("todoList",new it(t,"todo"));const r=new ci(t);t.commands.add("checkTodoList",r),t.commands.add("todoListCheck",r),e.downcastDispatcher.on("insert:listItem",cn(s),{priority:"high"}),e.upcastDispatcher.on("element:input",an,{priority:"high"}),i.downcastDispatcher.on("insert:listItem",ln(s,l=>this._handleCheckmarkChange(l)),{priority:"high"}),i.downcastDispatcher.on("attribute:listType:listItem",un(l=>this._handleCheckmarkChange(l),i.view)),i.downcastDispatcher.on("attribute:todoListChecked:listItem",dn(l=>this._handleCheckmarkChange(l))),i.mapper.on("modelToViewPosition",ai(i.view)),e.mapper.on("modelToViewPosition",ai(i.view)),this.listenTo(i.view.document,"arrowKey",gn(s,t.locale),{context:"li"}),this.listenTo(i.view.document,"keydown",(l,c)=>{Ut(c)===fn&&(t.execute("checkTodoList"),l.stop())},{priority:"high"});const o=new Set;this.listenTo(s,"applyOperation",(l,c)=>{const a=c[0];if(a.type=="rename"&&a.oldName=="listItem"){const u=a.position.nodeAfter;u.hasAttribute("todoListChecked")&&o.add(u)}else if(a.type=="changeAttribute"&&a.key=="listType"&&a.oldValue==="todo")for(const u of a.range.getItems())u.hasAttribute("todoListChecked")&&u.getAttribute("listType")!=="todo"&&o.add(u)}),s.document.registerPostFixer(l=>{let c=!1;for(const a of o)l.removeAttribute("todoListChecked",a),c=!0;return o.clear(),c}),this._initAriaAnnouncements()}_handleCheckmarkChange(t){const i=this.editor,e=i.model,s=Array.from(e.document.selection.getRanges());e.change(r=>{r.setSelection(t,"end"),i.execute("checkTodoList"),r.setSelection(s)})}_initAriaAnnouncements(){const{model:t,ui:i,t:e}=this.editor;let s=null;i&&t.document.selection.on("change:range",()=>{const r=t.document.selection.focus.parent,o=mi(s),l=mi(r);o&&!l?i.ariaLiveAnnouncer.announce(e("Leaving a to-do list")):!o&&l&&i.ariaLiveAnnouncer.announce(e("Entering a to-do list")),s=r})}}function gn(n,t){return(i,e)=>{if(Wt(e.keyCode,t.contentLanguageDirection)!="left")return;const r=n.schema,o=n.document.selection;if(!o.isCollapsed)return;const l=o.getFirstPosition(),c=l.parent;if(c.name==="listItem"&&c.getAttribute("listType")=="todo"&&l.isAtStart){const a=r.getNearestSelectionRange(n.createPositionBefore(c),"backward");a&&n.change(u=>u.setSelection(a)),e.preventDefault(),e.stopPropagation(),i.stop()}}}function mi(n){return!!n&&n.is("element","listItem")&&n.getAttribute("listType")==="todo"}/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class pn extends b{static get requires(){return[di,Pt]}static get pluginName(){return"LegacyTodoList"}static get isOfficialPlugin(){return!0}}/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/class bn extends b{static get pluginName(){return"AdjacentListsSupport"}static get isOfficialPlugin(){return!0}init(){const t=this.editor;t.model.schema.register("listSeparator",{allowWhere:"$block",isBlock:!0}),t.conversion.for("upcast").add(e=>{e.on("element:ol",fi()),e.on("element:ul",fi())}).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:(e,s)=>{const r=s.writer.createContainerElement("ck-list-separator");return s.writer.setCustomProperty("dataPipeline:transparentRendering",!0,r),r.getFillerOffset=()=>null,r}})}}function fi(){return(n,t,i)=>{const e=t.viewItem,s=e.nextSibling;if(!s||e.name!==s.name)return;t.modelRange||Object.assign(t,i.convertChildren(t.viewItem,t.modelCursor));const r=i.writer,o=r.createElement("listSeparator");if(!i.safeInsert(o,t.modelCursor))return;const l=i.getSplitParts(o);t.modelRange=r.createRange(t.modelRange.start,r.createPositionAfter(l[l.length-1])),i.updateConversionResult(o,t)}}export{bn as AdjacentListsSupport,Ue as CheckTodoListCommand,ci as LegacyCheckTodoListCommand,Bt as LegacyIndentCommand,Hs as LegacyList,it as LegacyListCommand,ot as LegacyListEditing,on as LegacyListProperties,ri as LegacyListPropertiesEditing,si as LegacyListReversedCommand,ni as LegacyListStartCommand,ii as LegacyListStyleCommand,Xe as LegacyListUtils,pn as LegacyTodoList,di as LegacyTodoListEditing,ss as List,O as ListCommand,y as ListEditing,ne as ListFormatting,gt as ListIndentCommand,Qt as ListItemBoldIntegration,ie as ListItemFontColorIntegration,se as ListItemFontFamilyIntegration,ee as ListItemFontSizeIntegration,te as ListItemItalicIntegration,pt as ListMergeCommand,Ls as ListProperties,Oe as ListPropertiesEditing,xt as ListPropertiesUI,xe as ListPropertiesUtils,Ce as ListReversedCommand,bt as ListSplitCommand,we as ListStartCommand,Se as ListStyleCommand,At as ListUI,oe as ListUtils,Es as TodoList,We as TodoListEditing,Pt as TodoListUI,Ht as _ListBlocksIterable,Ct as _ListPropertiesView,A as _ListWalker,P as _SiblingListBlocksIterator,$e as _TodoCheckboxChangeObserver,H as _canBecomeSimpleListItem,ae as _createListElement,ue as _createListItemElement,Z as _createListUIComponents,he as _createModelToViewListPositionMapper,F as _expandListBlocksToCompleteItems,z as _expandListBlocksToCompleteList,L as _findAndAddListHeadToMap,be as _findMappedListItemViewElement,de as _fixListIndents,me as _fixListItemIds,T as _getAllListItemBlocks,wt as _getAllSupportedListStyleTypes,ce as _getListIndent,S as _getListItemBlocks,mt as _getListItems,Lt as _getListStyleTypeFromTypeAttribute,J as _getListTypeFromListStyleType,Gt as _getNestedListBlocks,St as _getNormalizedListConfig,N as _getSelectedBlockObject,Q as _getTypeAttributeFromListStyleType,It as _getViewElementIdForListType,ht as _getViewElementNameForListType,Y as _indentListBlocks,_ as _isFirstBlockOfListItem,ft as _isLastBlockOfListItem,g as _isListItemBlock,G as _isListItemView,le as _isListView,$ as _isNumberedListType,V as _isSingleListItem,kt as _listItemBogusParagraphCreator,yt as _listItemDowncastConverter,pe as _listItemDowncastRemoveConverter,fe as _listItemUpcastConverter,_t as _listPropertiesUpcastConverter,K as _mergeListItemBefore,vt as _normalizeListStyle,Zt as _outdentFollowingListItems,Xt as _outdentListBlocksWithMerge,ge as _reconvertListItemsOnDataChange,U as _removeListAttributes,x as _sortListBlocks,j as _splitListItemBefore};
