@ckeditor/ckeditor5-list
Version:
Ordered and unordered lists feature to CKEditor 5.
5 lines • 104 kB
JavaScript
!function(t){const e=t.en=t.en||{};e.dictionary=Object.assign(e.dictionary||{},{"Bulleted List":"Bulleted List","Bulleted list styles toolbar":"Bulleted list styles toolbar",Circle:"Circle",Decimal:"Decimal","Decimal with leading zero":"Decimal with leading zero","Decrease list item indent":"Decrease list item indent",Disc:"Disc","Entering a to-do list":"Entering a to-do list","Increase list item indent":"Increase list item indent","Invalid start index value.":"Invalid start index value.","Keystrokes that can be used in a list":"Keystrokes that can be used in a list","Leaving a to-do list":"Leaving a to-do list","List properties":"List properties","Lower-latin":"Lower-latin","Lower–roman":"Lower–roman","Numbered List":"Numbered List","Numbered list styles toolbar":"Numbered list styles toolbar","Reversed order":"Reversed order",Square:"Square","Start at":"Start at","Start index must be greater than 0.":"Start index must be greater than 0.","To-do List":"To-do List","Toggle the circle list style":"Toggle the circle list style","Toggle the decimal list style":"Toggle the decimal list style","Toggle the decimal with leading zero list style":"Toggle the decimal with leading zero list style","Toggle the disc list style":"Toggle the disc list style","Toggle the lower–latin list style":"Toggle the lower–latin list style","Toggle the lower–roman list style":"Toggle the lower–roman list style","Toggle the square list style":"Toggle the square list style","Toggle the upper–latin list style":"Toggle the upper–latin list style","Toggle the upper–roman list style":"Toggle the upper–roman list style","Upper-latin":"Upper-latin","Upper-roman":"Upper-roman"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})),
/*!
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md.
*/(()=>{var t={21:t=>{"use strict";t.exports=function(t,e){Object.keys(e).forEach((function(i){t.setAttribute(i,e[i])}))}},51:t=>{"use strict";t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},128:t=>{"use strict";var e={};t.exports=function(t,i){var n=function(t){if(void 0===e[t]){var i=document.querySelector(t);if(window.HTMLIFrameElement&&i instanceof window.HTMLIFrameElement)try{i=i.contentDocument.head}catch(t){i=null}e[t]=i}return e[t]}(t);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");n.appendChild(i)}},137:(t,e,i)=>{"use strict";i.d(e,{A:()=>l});var n=i(758),s=i.n(n),r=i(935),o=i.n(r)()(s());o.push([t.id,".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}",""]);const l=o},237:t=>{"use strict";t.exports=CKEditor5.dll},263:(t,e,i)=>{"use strict";i.d(e,{A:()=>l});var n=i(758),s=i.n(n),r=i(935),o=i.n(r)()(s());o.push([t.id,".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)}",""]);const l=o},266:(t,e,i)=>{"use strict";i.d(e,{A:()=>l});var n=i(758),s=i.n(n),r=i(935),o=i.n(r)()(s());o.push([t.id,".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}",""]);const l=o},311:(t,e,i)=>{t.exports=i(237)("./src/ui.js")},331:(t,e,i)=>{t.exports=i(237)("./src/clipboard.js")},355:(t,e,i)=>{t.exports=i(237)("./src/icons.js")},358:(t,e,i)=>{"use strict";i.d(e,{A:()=>l});var n=i(758),s=i.n(n),r=i(935),o=i.n(r)()(s());o.push([t.id,".ck-editor__editable .ck-list-bogus-paragraph{display:block}",""]);const l=o},507:(t,e,i)=>{t.exports=i(237)("./src/enter.js")},584:(t,e,i)=>{t.exports=i(237)("./src/utils.js")},591:t=>{"use strict";var e=[];function i(t){for(var i=-1,n=0;n<e.length;n++)if(e[n].identifier===t){i=n;break}return i}function n(t,n){for(var r={},o=[],l=0;l<t.length;l++){var a=t[l],c=n.base?a[0]+n.base:a[0],d=r[c]||0,u="".concat(c," ").concat(d);r[c]=d+1;var m=i(u),p={css:a[1],media:a[2],sourceMap:a[3],supports:a[4],layer:a[5]};if(-1!==m)e[m].references++,e[m].updater(p);else{var f=s(p,n);n.byIndex=l,e.splice(l,0,{identifier:u,updater:f,references:1})}o.push(u)}return o}function s(t,e){var i=e.domAPI(e);i.update(t);return function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap&&e.supports===t.supports&&e.layer===t.layer)return;i.update(t=e)}else i.remove()}}t.exports=function(t,s){var r=n(t=t||[],s=s||{});return function(t){t=t||[];for(var o=0;o<r.length;o++){var l=i(r[o]);e[l].references--}for(var a=n(t,s),c=0;c<r.length;c++){var d=i(r[c]);0===e[d].references&&(e[d].updater(),e.splice(d,1))}r=a}}},639:t=>{"use strict";var e,i=(e=[],function(t,i){return e[t]=i,e.filter(Boolean).join("\n")});function n(t,e,n,s){var r;if(n)r="";else{r="",s.supports&&(r+="@supports (".concat(s.supports,") {")),s.media&&(r+="@media ".concat(s.media," {"));var o=void 0!==s.layer;o&&(r+="@layer".concat(s.layer.length>0?" ".concat(s.layer):""," {")),r+=s.css,o&&(r+="}"),s.media&&(r+="}"),s.supports&&(r+="}")}if(t.styleSheet)t.styleSheet.cssText=i(e,r);else{var l=document.createTextNode(r),a=t.childNodes;a[e]&&t.removeChild(a[e]),a.length?t.insertBefore(l,a[e]):t.appendChild(l)}}var s={singleton:null,singletonCounter:0};t.exports=function(t){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var e=s.singletonCounter++,i=s.singleton||(s.singleton=t.insertStyleElement(t));return{update:function(t){n(i,e,!1,t)},remove:function(t){n(i,e,!0,t)}}}},758:t=>{"use strict";t.exports=function(t){return t[1]}},782:(t,e,i)=>{t.exports=i(237)("./src/core.js")},783:(t,e,i)=>{t.exports=i(237)("./src/engine.js")},825:(t,e,i)=>{"use strict";i.d(e,{A:()=>l});var n=i(758),s=i.n(n),r=i(935),o=i.n(r)()(s());o.push([t.id,':root{--ck-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-todo-list-checkmark-size);left:-25px;margin-left:0;margin-right:-15px;position:relative;right:0;vertical-align:middle;width:var(--ck-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-todo-list-checkmark-size)/8) calc(var(--ck-todo-list-checkmark-size)/8) 0;box-sizing:content-box;content:"";display:block;height:calc(var(--ck-todo-list-checkmark-size)/2.6);left:calc(var(--ck-todo-list-checkmark-size)/3);pointer-events:none;position:absolute;top:calc(var(--ck-todo-list-checkmark-size)/5.3);transform:rotate(45deg);width:calc(var(--ck-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-todo-list-checkmark-size);left:-25px;margin-left:0;margin-right:-15px;position:relative;right:0;vertical-align:middle;width:var(--ck-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-todo-list-checkmark-size)/8) calc(var(--ck-todo-list-checkmark-size)/8) 0;box-sizing:content-box;content:"";display:block;height:calc(var(--ck-todo-list-checkmark-size)/2.6);left:calc(var(--ck-todo-list-checkmark-size)/3);pointer-events:none;position:absolute;top:calc(var(--ck-todo-list-checkmark-size)/5.3);transform:rotate(45deg);width:calc(var(--ck-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}',""]);const l=o},834:(t,e,i)=>{t.exports=i(237)("./src/typing.js")},935:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var i="",n=void 0!==e[5];return e[4]&&(i+="@supports (".concat(e[4],") {")),e[2]&&(i+="@media ".concat(e[2]," {")),n&&(i+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),i+=t(e),n&&(i+="}"),e[2]&&(i+="}"),e[4]&&(i+="}"),i})).join("")},e.i=function(t,i,n,s,r){"string"==typeof t&&(t=[[null,t,void 0]]);var o={};if(n)for(var l=0;l<this.length;l++){var a=this[l][0];null!=a&&(o[a]=!0)}for(var c=0;c<t.length;c++){var d=[].concat(t[c]);n&&o[d[0]]||(void 0!==r&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=r),i&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=i):d[2]=i),s&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=s):d[4]="".concat(s)),e.push(d))}},e}}},e={};function i(n){var s=e[n];if(void 0!==s)return s.exports;var r=e[n]={id:n,exports:{}};return t[n](r,r.exports,i),r.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};(()=>{"use strict";i.r(n),i.d(n,{AdjacentListsSupport:()=>si,DocumentList:()=>oi,DocumentListProperties:()=>li,LegacyIndentCommand:()=>le,LegacyList:()=>Re,LegacyListEditing:()=>Be,LegacyListProperties:()=>Ge,LegacyListPropertiesEditing:()=>je,LegacyListUtils:()=>we,LegacyTodoList:()=>ni,LegacyTodoListEditing:()=>ei,List:()=>gt,ListCommand:()=>P,ListEditing:()=>at,ListIndentCommand:()=>x,ListProperties:()=>qt,ListPropertiesEditing:()=>Nt,ListPropertiesUI:()=>Mt,ListPropertiesUtils:()=>Ct,ListUI:()=>ft,ListUtils:()=>N,TodoDocumentList:()=>ai,TodoList:()=>ne,TodoListEditing:()=>Yt,TodoListUI:()=>te});var t=i(782),e=i(834),s=i(507),r=i(584);class o{_startElement;_referenceIndent;_isForward;_includeSelf;_sameAttributes;_sameIndent;_lowerIndent;_higherIndent;constructor(t,e){this._startElement=t,this._referenceIndent=t.getAttribute("listIndent"),this._isForward="forward"==e.direction,this._includeSelf=!!e.includeSelf,this._sameAttributes=(0,r.toArray)(e.sameAttributes||[]),this._sameIndent=!!e.sameIndent,this._lowerIndent=!!e.lowerIndent,this._higherIndent=!!e.higherIndent}static first(t,e){const i=new this(t,e)[Symbol.iterator]();return(0,r.first)(i)}*[Symbol.iterator](){const t=[];for(const{node:e}of new l(this._getStartNode(),this._isForward?"forward":"backward")){const i=e.getAttribute("listIndent");if(i<this._referenceIndent){if(!this._lowerIndent)break;this._referenceIndent=i}else if(i>this._referenceIndent){if(!this._higherIndent)continue;if(!this._isForward){t.push(e);continue}}else{if(!this._sameIndent){if(this._higherIndent){t.length&&(yield*t,t.length=0);break}continue}if(this._sameAttributes.some((t=>e.getAttribute(t)!==this._startElement.getAttribute(t))))break}t.length&&(yield*t,t.length=0),yield e}}_getStartNode(){return this._includeSelf?this._startElement:this._isForward?this._startElement.nextSibling:this._startElement.previousSibling}}class l{_node;_isForward;_previousNodesByIndent=[];_previous=null;_previousNodeIndent=null;constructor(t,e="forward"){this._node=t,this._isForward="forward"===e}[Symbol.iterator](){return this}next(){if(!d(this._node))return{done:!0,value:void 0};const t=this._node.getAttribute("listIndent");let e=null;if(this._previous){const i=this._previousNodeIndent;t>i?this._previousNodesByIndent[i]=this._previous:t<i?(e=this._previousNodesByIndent[t]||null,this._previousNodesByIndent.length=t):e=this._previous}const i={node:this._node,previous:this._previous,previousNodeInList:e};return this._previous=this._node,this._previousNodeIndent=t,this._node=this._isForward?this._node.nextSibling:this._node.previousSibling,{value:i,done:!1}}}class a{_listHead;constructor(t){this._listHead=t}[Symbol.iterator](){return new l(this._listHead)}}class c{static next(){return(0,r.uid)()}}function d(t){return!!t&&t.is("element")&&t.hasAttribute("listItemId")}function u(t,e={}){return[...m(t,{...e,direction:"backward"}),...m(t,{...e,direction:"forward"})]}function m(t,e={}){const i="forward"==e.direction,n=Array.from(new o(t,{...e,includeSelf:i,sameIndent:!0,sameAttributes:"listItemId"}));return i?n:n.reverse()}function p(t,e){const i=new o(t,{sameIndent:!0,sameAttributes:"listType",...e}),n=new o(t,{sameIndent:!0,sameAttributes:"listType",includeSelf:!0,direction:"forward",...e});return[...Array.from(i).reverse(),...n]}function f(t){return!o.first(t,{sameIndent:!0,sameAttributes:"listItemId"})}function g(t){return!o.first(t,{direction:"forward",sameIndent:!0,sameAttributes:"listItemId"})}function b(t,e={}){t=(0,r.toArray)(t);const i=!1!==e.withNested,n=new Set;for(const e of t)for(const t of u(e,{higherIndent:i}))n.add(t);return v(n)}function h(t){t=(0,r.toArray)(t);const e=new Set;for(const i of t)for(const t of p(i))e.add(t);return v(e)}function y(t,e){const i=m(t,{direction:"forward"}),n=c.next();for(const t of i)e.setAttribute("listItemId",n,t);return i}function A(t,e,i){const n={};for(const[t,i]of e.getAttributes())t.startsWith("list")&&(n[t]=i);const s=m(t,{direction:"forward"});for(const t of s)i.setAttributes(n,t);return s}function w(t,e,{expand:i,indentBy:n=1}={}){t=(0,r.toArray)(t);const s=i?b(t):t;for(const t of s){const i=t.getAttribute("listIndent")+n;i<0?I(t,e):e.setAttribute("listIndent",i,t)}return s}function I(t,e){t=(0,r.toArray)(t);for(const i of t)i.is("element","listItem")&&e.rename(i,"paragraph");for(const i of t)for(const t of i.getAttributeKeys())t.startsWith("list")&&e.removeAttribute(t,i);return t}function k(t){if(!t.length)return!1;const e=t[0].getAttribute("listItemId");return!!e&&!t.some((t=>t.getAttribute("listItemId")!=e))}function v(t){return Array.from(t).filter((t=>"$graveyard"!==t.root.rootName)).sort(((t,e)=>t.index-e.index))}function _(t){const e=t.document.selection.getSelectedElement();return e&&t.schema.isObject(e)&&t.schema.isBlock(e)?e:null}function T(t,e){return e.checkChild(t.parent,"listItem")&&e.checkChild(t,"$text")&&!e.isObject(t)}function L(t){return"numbered"==t||"customNumbered"==t}function S(t,e,i){return m(e,{direction:"forward"}).pop().index>t.index?A(t,e,i):[]}class x extends t.Command{_direction;constructor(t,e){super(t),this._direction=e}refresh(){this.isEnabled=this._checkEnabled()}execute(){const t=this.editor.model,e=C(t.document.selection);t.change((t=>{const i=[];k(e)&&!f(e[0])?("forward"==this._direction&&i.push(...w(e,t)),i.push(...y(e[0],t))):"forward"==this._direction?i.push(...w(e,t,{expand:!0})):i.push(...function(t,e){const i=b(t=(0,r.toArray)(t)),n=new Set,s=Math.min(...i.map((t=>t.getAttribute("listIndent")))),l=new Map;for(const t of i)l.set(t,o.first(t,{lowerIndent:!0}));for(const t of i){if(n.has(t))continue;n.add(t);const i=t.getAttribute("listIndent")-1;if(i<0)I(t,e);else{if(t.getAttribute("listIndent")==s){const i=S(t,l.get(t),e);for(const t of i)n.add(t);if(i.length)continue}e.setAttribute("listIndent",i,t)}}return v(n)}(e,t));for(const e of i){if(!e.hasAttribute("listType"))continue;const i=o.first(e,{sameIndent:!0});i&&t.setAttribute("listType",i.getAttribute("listType"),e)}this._fireAfterExecute(i)}))}_fireAfterExecute(t){this.fire("afterExecute",v(new Set(t)))}_checkEnabled(){let t=C(this.editor.model.document.selection),e=t[0];if(!e)return!1;if("backward"==this._direction)return!0;if(k(t)&&!f(t[0]))return!0;t=b(t),e=t[0];const i=o.first(e,{sameIndent:!0});return!!i&&i.getAttribute("listType")==e.getAttribute("listType")}}function C(t){const e=Array.from(t.getSelectedBlocks()),i=e.findIndex((t=>!d(t)));return-1!=i&&(e.length=i),e}class P extends t.Command{type;_listWalkerOptions;constructor(t,e,i={}){super(t),this.type=e,this._listWalkerOptions=i.multiLevel?{higherIndent:!0,lowerIndent:!0,sameAttributes:[]}:void 0}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(t={}){const e=this.editor.model,i=e.document,n=_(e),s=Array.from(i.selection.getSelectedBlocks()).filter((t=>e.schema.checkAttribute(t,"listType")||T(t,e.schema))),r=void 0!==t.forceValue?!t.forceValue:this.value;e.change((o=>{if(r){const t=s[s.length-1],e=m(t,{direction:"forward"}),i=[];e.length>1&&i.push(...y(e[1],o)),i.push(...I(s,o)),i.push(...function(t,e){const i=[];let n=Number.POSITIVE_INFINITY;for(const{node:s}of new l(t.nextSibling)){const t=s.getAttribute("listIndent");if(0==t)break;t<n&&(n=t);const r=t-n;e.setAttribute("listIndent",r,s),i.push(s)}return i}(t,o)),this._fireAfterExecute(i)}else if((n||i.selection.isCollapsed)&&d(s[0])){const e=p(n||s[0],this._listWalkerOptions);for(const i of e)o.setAttributes({...t.additionalAttributes,listType:this.type},i);this._fireAfterExecute(e)}else{const i=[];for(const n of s)if(n.hasAttribute("listType"))for(const e of b(n,{withNested:!1}))e.getAttribute("listType")!=this.type&&(o.setAttributes({...t.additionalAttributes,listType:this.type},e),i.push(e));else!n.is("element","listItem")&&T(n,e.schema)&&o.rename(n,"listItem"),o.setAttributes({...t.additionalAttributes,listIndent:0,listItemId:c.next(),listType:this.type},n),i.push(n);this._fireAfterExecute(i)}}))}_fireAfterExecute(t){this.fire("afterExecute",v(new Set(t)))}_getValue(){const t=this.editor.model.document.selection,e=Array.from(t.getSelectedBlocks());if(!e.length)return!1;for(const t of e)if(t.getAttribute("listType")!=this.type)return!1;return!0}_checkEnabled(){const t=this.editor.model,e=t.schema,i=t.document.selection,n=Array.from(i.getSelectedBlocks());if(!n.length)return!1;if(this.value)return!0;for(const t of n)if(e.checkAttribute(t,"listType")||T(t,e))return!0;return!1}}class E extends t.Command{_direction;constructor(t,e){super(t),this._direction=e}refresh(){this.isEnabled=this._checkEnabled()}execute({shouldMergeOnBlocksContentLevel:t=!1}={}){const e=this.editor.model,i=e.document.selection,n=[];e.change((s=>{const{firstElement:r,lastElement:l}=this._getMergeSubjectElements(i,t),a=r.getAttribute("listIndent")||0,c=l.getAttribute("listIndent"),d=l.getAttribute("listItemId");if(a!=c){const t=(u=l,Array.from(new o(u,{direction:"forward",higherIndent:!0})));n.push(...w([l,...t],s,{indentBy:a-c,expand:a<c}))}var u;if(t){let t=i;i.isCollapsed&&(t=s.createSelection(s.createRange(s.createPositionAt(r,"end"),s.createPositionAt(l,0)))),e.deleteContent(t,{doNotResetEntireContent:i.isCollapsed});const o=t.getLastPosition().parent,a=o.nextSibling;n.push(o),a&&a!==l&&a.getAttribute("listItemId")==d&&n.push(...A(a,o,s))}else n.push(...A(l,r,s));this._fireAfterExecute(n)}))}_fireAfterExecute(t){this.fire("afterExecute",v(new Set(t)))}_checkEnabled(){const t=this.editor.model,e=t.document.selection,i=_(t);if(e.isCollapsed||i){const t=i||e.getFirstPosition().parent;if(!d(t))return!1;const n="backward"==this._direction?t.previousSibling:t.nextSibling;if(!n)return!1;if(k([t,n]))return!1}else{const t=e.getLastPosition(),i=e.getFirstPosition();if(t.parent===i.parent)return!1;if(!d(t.parent))return!1}return!0}_getMergeSubjectElements(t,e){const i=_(this.editor.model);let n,s;if(t.isCollapsed||i){const r=i||t.getFirstPosition().parent,l=f(r);"backward"==this._direction?(s=r,n=l&&!e?o.first(r,{sameIndent:!0,lowerIndent:!0}):r.previousSibling):(n=r,s=r.nextSibling)}else n=t.getFirstPosition().parent,s=t.getLastPosition().parent;return{firstElement:n,lastElement:s}}}class V extends t.Command{_direction;constructor(t,e){super(t),this._direction=e}refresh(){this.isEnabled=this._checkEnabled()}execute(){this.editor.model.change((t=>{const e=y(this._getStartBlock(),t);this._fireAfterExecute(e)}))}_fireAfterExecute(t){this.fire("afterExecute",v(new Set(t)))}_checkEnabled(){const t=this.editor.model.document.selection,e=this._getStartBlock();return t.isCollapsed&&d(e)&&!f(e)}_getStartBlock(){const t=this.editor.model.document.selection.getFirstPosition().parent;return"before"==this._direction?t:t.nextSibling}}class N extends t.Plugin{static get pluginName(){return"ListUtils"}static get isOfficialPlugin(){return!0}expandListBlocksToCompleteList(t){return h(t)}isFirstBlockOfListItem(t){return f(t)}isListItemBlock(t){return d(t)}expandListBlocksToCompleteItems(t,e={}){return b(t,e)}isNumberedListType(t){return L(t)}}function B(t){return t.is("element","ol")||t.is("element","ul")}function O(t){return t.is("element","li")}function R(t,e,i,n=M(i,e)){return t.createAttributeElement(F(i),null,{priority:2*e/100-100,id:n})}function D(t,e,i){return t.createAttributeElement("li",null,{priority:(2*e+1)/100-100,id:i})}function F(t){return"numbered"==t||"customNumbered"==t?"ol":"ul"}function M(t,e){return`list-${t}-${e}`}function z(t,e,i){const n=t.nodeBefore;if(d(n)){let t=n;for(const{node:s}of new l(t,"backward")){if(t=s,i.has(t))return;if(i.add(t),e.has(n))return}e.add(t)}else{const i=t.nodeAfter;d(i)&&e.add(i)}}function j(){return(t,e,i)=>{const{writer:n,schema:s}=i;if(!e.modelRange)return;const r=Array.from(e.modelRange.getItems({shallow:!0})).filter((t=>s.checkAttribute(t,"listItemId")));if(!r.length)return;const o=c.next(),l=function(t){let e=0,i=t.parent;for(;i;){if(O(i))e++;else{const t=i.previousSibling;t&&O(t)&&e++}i=i.parent}return e}(e.viewItem);let a=e.viewItem.parent&&e.viewItem.parent.is("element","ol")?"numbered":"bulleted";const d=r[0].getAttribute("listType");d&&(a=d);const u={listItemId:o,listIndent:l,listType:a};for(const t of r)t.hasAttribute("listItemId")||n.setAttributes(u,t);r.length>1&&r[1].getAttribute("listItemId")!=u.listItemId&&i.keepEmptyElement(r[0])}}function K(t,e,i,{dataPipeline:n}={}){const s=function(t){return(e,i)=>{const n=[];for(const i of t)e.hasAttribute(i)&&n.push(`attribute:${i}`);return!!n.every((t=>!1!==i.test(e,t)))&&(n.forEach((t=>i.consume(e,t))),!0)}}(t);return(r,l,a)=>{const{writer:c,mapper:d,consumable:u}=a,m=l.item;if(!t.includes(l.attributeKey))return;if(!s(m,u))return;const p=function(t,e,i){const n=i.createRangeOn(t),s=e.toViewRange(n).getTrimmed();return s.end.nodeBefore}(m,d,i);q(p,c,d),function(t,e){let i=t.parent;for(;i.is("attributeElement")&&["ul","ol","li"].includes(i.name);){const n=i.parent;e.unwrap(e.createRangeOn(t),i),i=n}}(p,c);const g=function(t,e,i,n,{dataPipeline:s}){let r=n.createRangeOn(e);if(!f(t))return r;for(const o of i){if("itemMarker"!=o.scope)continue;const i=o.createElement(n,t,{dataPipeline:s});if(!i)continue;if(n.setCustomProperty("listItemMarker",!0,i),o.canInjectMarkerIntoElement&&o.canInjectMarkerIntoElement(t)?n.insert(n.createPositionAt(e,0),i):(n.insert(r.start,i),r=n.createRange(n.createPositionBefore(i),n.createPositionAfter(e))),!o.createWrapperElement||!o.canWrapElement)continue;const l=o.createWrapperElement(n,t,{dataPipeline:s});n.setCustomProperty("listItemWrapper",!0,l),o.canWrapElement(t)?r=n.wrap(r,l):(r=n.wrap(n.createRangeOn(i),l),r=n.createRange(r.start,n.createPositionAfter(e)))}return r}(m,p,e,c,{dataPipeline:n});!function(t,e,i,n){if(!t.hasAttribute("listIndent"))return;const s=t.getAttribute("listIndent");let r=t;for(let t=s;t>=0;t--){const s=D(n,t,r.getAttribute("listItemId")),l=R(n,t,r.getAttribute("listType"));for(const t of i)"list"!=t.scope&&"item"!=t.scope||!r.hasAttribute(t.attributeName)||t.setAttributeOnDowncast(n,r.getAttribute(t.attributeName),"list"==t.scope?l:s);if(e=n.wrap(e,s),e=n.wrap(e,l),0==t)break;if(r=o.first(r,{lowerIndent:!0}),!r)break}}(m,g,e,c)}}function U(t,{dataPipeline:e}={}){return(i,{writer:n})=>{if(!$(i,t))return null;if(!e)return n.createContainerElement("span",{class:"ck-list-bogus-paragraph"});const s=n.createContainerElement("p");return n.setCustomProperty("dataPipeline:transparentRendering",!0,s),s}}function q(t,e,i){for(;t.parent.is("attributeElement")&&t.parent.getCustomProperty("listItemWrapper");)e.unwrap(e.createRangeOn(t),t.parent);const n=[];s(e.createPositionBefore(t).getWalker({direction:"backward"})),s(e.createRangeIn(t).getWalker());for(const t of n)e.remove(t);function s(t){for(const{item:e}of t){if(e.is("element")&&i.toModelElement(e))break;e.is("element")&&e.getCustomProperty("listItemMarker")&&n.push(e)}}}function $(t,e,i=u(t)){if(!d(t))return!1;for(const i of t.getAttributeKeys())if(!i.startsWith("selection:")&&"htmlEmptyBlock"!=i&&!e.includes(i))return!1;return i.length<2}var W=i(331),G=i(591),H=i.n(G),Y=i(639),Z=i.n(Y),J=i(128),Q=i.n(J),X=i(21),tt=i.n(X),et=i(51),it=i.n(et),nt=i(358),st={attributes:{"data-cke":!0}};st.setAttributes=tt(),st.insert=Q().bind(null,"head"),st.domAPI=Z(),st.insertStyleElement=it();H()(nt.A,st);nt.A&&nt.A.locals&&nt.A.locals;var rt=i(137),ot={attributes:{"data-cke":!0}};ot.setAttributes=tt(),ot.insert=Q().bind(null,"head"),ot.domAPI=Z(),ot.insertStyleElement=it();H()(rt.A,ot);rt.A&&rt.A.locals&&rt.A.locals;const lt=["listType","listIndent","listItemId"];class at extends t.Plugin{_downcastStrategies=[];static get pluginName(){return"ListEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[s.Enter,e.Delete,N,W.ClipboardPipeline]}constructor(t){super(t),t.config.define("list.multiBlock",!0)}init(){const t=this.editor,e=t.model,i=t.config.get("list.multiBlock");if(t.plugins.has("LegacyListEditing"))throw new r.CKEditorError("list-feature-conflict",this,{conflictPlugin:"LegacyListEditing"});e.schema.register("$listItem",{allowAttributes:lt}),i?(e.schema.extend("$container",{allowAttributesOf:"$listItem"}),e.schema.extend("$block",{allowAttributesOf:"$listItem"}),e.schema.extend("$blockObject",{allowAttributesOf:"$listItem"})):e.schema.register("listItem",{inheritAllFrom:"$block",allowAttributesOf:"$listItem"});for(const t of lt)e.schema.setAttributeProperties(t,{copyOnReplace:!0});t.commands.add("numberedList",new P(t,"numbered")),t.commands.add("bulletedList",new P(t,"bulleted")),t.commands.add("customNumberedList",new P(t,"customNumbered",{multiLevel:!0})),t.commands.add("customBulletedList",new P(t,"customBulleted",{multiLevel:!0})),t.commands.add("indentList",new x(t,"forward")),t.commands.add("outdentList",new x(t,"backward")),t.commands.add("splitListItemBefore",new V(t,"before")),t.commands.add("splitListItemAfter",new V(t,"after")),i&&(t.commands.add("mergeListItemBackward",new E(t,"backward")),t.commands.add("mergeListItemForward",new E(t,"forward"))),this._setupDeleteIntegration(),this._setupEnterIntegration(),this._setupTabIntegration(),this._setupClipboardIntegration(),this._setupAccessibilityIntegration()}afterInit(){const t=this.editor.commands,e=t.get("indent"),i=t.get("outdent");e&&e.registerChildCommand(t.get("indentList"),{priority:"high"}),i&&i.registerChildCommand(t.get("outdentList"),{priority:"lowest"}),this._setupModelPostFixing(),this._setupConversion()}registerDowncastStrategy(t){this._downcastStrategies.push(t)}getListAttributeNames(){return[...lt,...this._downcastStrategies.map((t=>t.attributeName))]}_setupDeleteIntegration(){const t=this.editor,e=t.commands.get("mergeListItemBackward"),i=t.commands.get("mergeListItemForward");this.listenTo(t.editing.view.document,"delete",((n,s)=>{const r=t.model.document.selection;_(t.model)||t.model.change((()=>{const l=r.getFirstPosition();if(r.isCollapsed&&"backward"==s.direction){if(!l.isAtStart)return;const i=l.parent;if(!d(i))return;if(o.first(i,{sameAttributes:"listType",sameIndent:!0})||0!==i.getAttribute("listIndent")){if(!e||!e.isEnabled)return;e.execute({shouldMergeOnBlocksContentLevel:ct(t.model,"backward")})}else g(i)||t.execute("splitListItemAfter"),t.execute("outdentList");s.preventDefault(),n.stop()}else{if(r.isCollapsed&&!r.getLastPosition().isAtEnd)return;if(!i||!i.isEnabled)return;i.execute({shouldMergeOnBlocksContentLevel:ct(t.model,"forward")}),s.preventDefault(),n.stop()}}))}),{context:"li"})}_setupEnterIntegration(){const t=this.editor,e=t.model,i=t.commands,n=i.get("enter");this.listenTo(t.editing.view.document,"enter",((i,n)=>{const s=e.document,r=s.selection.getFirstPosition().parent;if(s.selection.isCollapsed&&d(r)&&r.isEmpty&&!n.isSoft){const e=f(r),s=g(r);e&&s?(t.execute("outdentList"),n.preventDefault(),i.stop()):e&&!s?(t.execute("splitListItemAfter"),n.preventDefault(),i.stop()):s&&(t.execute("splitListItemBefore"),n.preventDefault(),i.stop())}}),{context:"li"}),this.listenTo(n,"afterExecute",(()=>{const e=i.get("splitListItemBefore");if(e.refresh(),!e.isEnabled)return;2===u(t.model.document.selection.getLastPosition().parent).length&&e.execute()}))}_setupTabIntegration(){const t=this.editor;this.listenTo(t.editing.view.document,"tab",((e,i)=>{const n=i.shiftKey?"outdentList":"indentList";this.editor.commands.get(n).isEnabled&&(t.execute(n),i.stopPropagation(),i.preventDefault(),e.stop())}),{context:"li"})}_setupConversion(){const t=this.editor,e=t.model,i=this.getListAttributeNames(),n=t.config.get("list.multiBlock"),s=n?"paragraph":"listItem";t.conversion.for("upcast").elementToElement({view:"li",model:(t,{writer:e})=>e.createElement(s,{listType:""})}).elementToElement({view:"p",model:(t,{writer:e})=>t.parent&&t.parent.is("element","li")?e.createElement(s,{listType:""}):null,converterPriority:"high"}).add((t=>{t.on("element:li",j())})),n||t.conversion.for("downcast").elementToElement({model:"listItem",view:"p"}),t.conversion.for("editingDowncast").elementToElement({model:s,view:U(i),converterPriority:"high"}).add((t=>{var n;t.on("attribute",K(i,this._downcastStrategies,e)),t.on("remove",(n=e.schema,(t,e,i)=>{const{writer:s,mapper:r}=i,o=t.name.split(":")[1];if(!n.checkAttribute(o,"listItemId"))return;const l=r.toViewPosition(e.position),a=e.position.getShiftedBy(e.length),c=r.toViewPosition(a,{isPhantom:!0}),d=s.createRange(l,c).getTrimmed().end.nodeBefore;d&&q(d,s,r)}))})),t.conversion.for("dataDowncast").elementToElement({model:s,view:U(i,{dataPipeline:!0}),converterPriority:"high"}).add((t=>{t.on("attribute",K(i,this._downcastStrategies,e,{dataPipeline:!0}))}));const r=(o=this._downcastStrategies,a=t.editing.view,(t,e)=>{if(e.modelPosition.offset>0)return;const i=e.modelPosition.parent;if(!d(i))return;if(!o.some((t=>"itemMarker"==t.scope&&t.canInjectMarkerIntoElement&&t.canInjectMarkerIntoElement(i))))return;const n=e.mapper.toViewElement(i),s=a.createRangeIn(n),r=s.getWalker();let l=s.start;for(const{item:t}of r){if(t.is("element")&&e.mapper.toModelElement(t)||t.is("$textProxy"))break;t.is("element")&&t.getCustomProperty("listItemMarker")&&(l=a.createPositionAfter(t),r.skip((({previousPosition:t})=>!t.isEqual(l))))}e.viewPosition=l});var o,a;t.editing.mapper.on("modelToViewPosition",r),t.data.mapper.on("modelToViewPosition",r),this.listenTo(e.document,"change:data",function(t,e,i,n){return()=>{const n=t.document.differ.getChanges(),o=[],l=new Set,a=new Set,c=new Set;for(const t of n)if("insert"==t.type&&"$text"!=t.name)z(t.position,l,c),t.attributes.has("listItemId")?a.add(t.position.nodeAfter):z(t.position.getShiftedBy(t.length),l,c);else if("remove"==t.type&&t.attributes.has("listItemId"))z(t.position,l,c);else if("attribute"==t.type){const e=t.range.start.nodeAfter;i.includes(t.attributeKey)?(z(t.range.start,l,c),null===t.attributeNewValue?(z(t.range.start.getShiftedBy(1),l,c),r(e)&&o.push(e)):a.add(e)):d(e)&&r(e)&&o.push(e)}for(const t of l.values())o.push(...s(t,a));for(const t of new Set(o))e.reconvertItem(t)};function s(t,e){const n=[],s=new Set,a=[];for(const{node:c,previous:d}of new l(t)){if(s.has(c))continue;const t=c.getAttribute("listIndent");d&&t<d.getAttribute("listIndent")&&(a.length=t+1),a[t]=Object.fromEntries(Array.from(c.getAttributes()).filter((([t])=>i.includes(t))));const l=m(c,{direction:"forward"});for(const t of l)s.add(t),(r(t,l)||o(t,a,e))&&n.push(t)}return n}function r(t,s){const r=e.mapper.toViewElement(t);if(!r)return!1;if(n.fire("checkElement",{modelElement:t,viewElement:r}))return!0;if(!t.is("element","paragraph")&&!t.is("element","listItem"))return!1;const o=$(t,i,s);return!(!o||!r.is("element","p"))||!(o||!r.is("element","span"))}function o(t,i,s){if(s.has(t))return!1;const r=e.mapper.toViewElement(t);let o=i.length-1;for(let t=r.parent;!t.is("editableElement");t=t.parent){const e=O(t),s=B(t);if(!s&&!e)continue;const r="checkAttributes:"+(e?"item":"list");if(n.fire(r,{viewElement:t,modelAttributes:i[o]}))break;if(s&&(o--,o<0))return!1}return!0}}(e,t.editing,i,this),{priority:"high"}),this.on("checkAttributes:item",((t,{viewElement:e,modelAttributes:i})=>{e.id!=i.listItemId&&(t.return=!0,t.stop())})),this.on("checkAttributes:list",((t,{viewElement:e,modelAttributes:i})=>{e.name==F(i.listType)&&e.id==M(i.listType,i.listIndent)||(t.return=!0,t.stop())}))}_setupModelPostFixing(){const t=this.editor.model,e=this.getListAttributeNames();t.document.registerPostFixer((i=>function(t,e,i,n){const s=t.document.differ.getChanges(),r=new Set,o=new Set,l=n.editor.config.get("list.multiBlock");let c=!1;for(const n of s){if("insert"==n.type&&"$text"!=n.name){const s=n.position.nodeAfter;if(!t.schema.checkAttribute(s,"listItemId"))for(const t of Array.from(s.getAttributeKeys()))i.includes(t)&&(e.removeAttribute(t,s),c=!0);z(n.position,o,r),n.attributes.has("listItemId")||z(n.position.getShiftedBy(n.length),o,r);for(const{item:e,previousPosition:i}of t.createRangeIn(s))d(e)&&z(i,o,r)}else"remove"==n.type?z(n.position,o,r):"attribute"==n.type&&i.includes(n.attributeKey)&&(z(n.range.start,o,r),null===n.attributeNewValue&&z(n.range.start.getShiftedBy(1),o,r));if(!l&&"attribute"==n.type&<.includes(n.attributeKey)){const t=n.range.start.nodeAfter;null===n.attributeNewValue&&t&&t.is("element","listItem")?(e.rename(t,"paragraph"),c=!0):null===n.attributeOldValue&&t&&t.is("element")&&"listItem"!=t.name&&(e.rename(t,"listItem"),c=!0)}}const u=new Set;for(const t of o.values())c=n.fire("postFixer",{listNodes:new a(t),listHead:t,writer:e,seenIds:u})||c;return c}(t,i,e,this))),this.on("postFixer",((t,{listNodes:e,writer:i})=>{t.return=function(t,e){let i=0,n=-1,s=null,r=!1;for(const{node:o}of t){const t=o.getAttribute("listIndent");if(t>i){let l;null===s?(s=t-i,l=i):(s>t&&(s=t),l=t-s),l>n+1&&(l=n+1),e.setAttribute("listIndent",l,o),r=!0,n=l}else s=null,i=t+1,n=t}return r}(e,i)||t.return}),{priority:"high"}),this.on("postFixer",((t,{listNodes:e,writer:i,seenIds:n})=>{t.return=function(t,e,i){const n=new Set;let s=!1;for(const{node:r}of t){if(n.has(r))continue;let t=r.getAttribute("listType"),o=r.getAttribute("listItemId");if(e.has(o)&&(o=c.next()),e.add(o),r.is("element","listItem"))r.getAttribute("listItemId")!=o&&(i.setAttribute("listItemId",o,r),s=!0);else for(const e of m(r,{direction:"forward"}))n.add(e),e.getAttribute("listType")!=t&&(o=c.next(),t=e.getAttribute("listType")),e.getAttribute("listItemId")!=o&&(i.setAttribute("listItemId",o,e),s=!0)}return s}(e,n,i)||t.return}),{priority:"high"})}_setupClipboardIntegration(){const t=this.editor.model,e=this.editor.plugins.get("ClipboardPipeline");this.listenTo(t,"insertContent",function(t){return(e,[i,n])=>{const s=i.is("documentFragment")?Array.from(i.getChildren()):[i];if(!s.length)return;const r=(n?t.createSelection(n):t.document.selection).getFirstPosition();let o;if(d(r.parent))o=r.parent;else{if(!d(r.nodeBefore)||!d(r.nodeAfter))return;o=r.nodeBefore}t.change((t=>{const e=o.getAttribute("listType"),i=o.getAttribute("listIndent"),n=s[0].getAttribute("listIndent")||0,r=Math.max(i-n,0);for(const i of s){const n=d(i);o.is("element","listItem")&&i.is("element","paragraph")&&t.rename(i,"listItem"),t.setAttributes({listIndent:(n?i.getAttribute("listIndent"):0)+r,listItemId:n?i.getAttribute("listItemId"):c.next(),listType:e},i)}}))}}(t),{priority:"high"}),this.listenTo(e,"outputTransformation",((e,i)=>{t.change((t=>{const e=Array.from(i.content.getChildren()),n=e[e.length-1];if(e.length>1&&n.is("element")&&n.isEmpty){e.slice(0,-1).every(d)&&t.remove(n)}if("copy"==i.method||"cut"==i.method){const e=Array.from(i.content.getChildren());k(e)&&I(e,t)}}))}))}_setupAccessibilityIntegration(){const t=this.editor,e=t.t;t.accessibility.addKeystrokeInfoGroup({id:"list",label:e("Keystrokes that can be used in a list"),keystrokes:[{label:e("Increase list item indent"),keystroke:"Tab"},{label:e("Decrease list item indent"),keystroke:"Shift+Tab"}]})}}function ct(t,e){const i=t.document.selection;if(!i.isCollapsed)return!_(t);if("forward"===e)return!0;const n=i.getFirstPosition().parent,s=n.previousSibling;return!t.schema.isObject(s)&&(!!s.isEmpty||k([n,s]))}var dt=i(311);function ut(t,e,i,n){t.ui.componentFactory.add(e,(()=>{const s=mt(dt.ButtonView,t,e,i,n);return s.set({tooltip:!0,isToggleable:!0}),s})),t.ui.componentFactory.add(`menuBar:${e}`,(()=>{const s=mt(dt.MenuBarMenuListItemButtonView,t,e,i,n);return s.set({role:"menuitemcheckbox",isToggleable:!0}),s}))}function mt(t,e,i,n,s){const r=e.commands.get(i),o=new t(e.locale);return o.set({label:n,icon:s}),o.bind("isOn","isEnabled").to(r,"value","isEnabled"),o.on("execute",(()=>{e.execute(i),e.editing.view.focus()})),o}var pt=i(355);class ft extends t.Plugin{static get pluginName(){return"ListUI"}static get isOfficialPlugin(){return!0}init(){const t=this.editor.t;this.editor.ui.componentFactory.has("numberedList")||ut(this.editor,"numberedList",t("Numbered List"),pt.IconNumberedList),this.editor.ui.componentFactory.has("bulletedList")||ut(this.editor,"bulletedList",t("Bulleted List"),pt.IconBulletedList)}}class gt extends t.Plugin{static get requires(){return[at,ft]}static get pluginName(){return"List"}static get isOfficialPlugin(){return!0}}class bt extends t.Command{refresh(){const t=this._getValue();this.value=t,this.isEnabled=null!=t}execute({startIndex:t=1}={}){const e=this.editor.model,i=e.document;let n=Array.from(i.selection.getSelectedBlocks()).filter((t=>d(t)&&L(t.getAttribute("listType"))));n=h(n),e.change((e=>{for(const i of n)e.setAttribute("listStart",t>=0?t:1,i)}))}_getValue(){const t=this.editor.model.document,e=(0,r.first)(t.selection.getSelectedBlocks());return e&&d(e)&&L(e.getAttribute("listType"))?e.getAttribute("listStart"):null}}const ht={},yt={},At={},wt=[{listStyle:"disc",typeAttribute:"disc",listType:"bulleted"},{listStyle:"circle",typeAttribute:"circle",listType:"bulleted"},{listStyle:"square",typeAttribute:"square",listType:"bulleted"},{listStyle:"decimal",typeAttribute:"1",listType:"numbered"},{listStyle:"decimal-leading-zero",typeAttribute:null,listType:"numbered"},{listStyle:"lower-roman",typeAttribute:"i",listType:"numbered"},{listStyle:"upper-roman",typeAttribute:"I",listType:"numbered"},{listStyle:"lower-alpha",typeAttribute:"a",listType:"numbered"},{listStyle:"upper-alpha",typeAttribute:"A",listType:"numbered"},{listStyle:"lower-latin",typeAttribute:"a",listType:"numbered"},{listStyle:"upper-latin",typeAttribute:"A",listType:"numbered"}];for(const{listStyle:t,typeAttribute:e,listType:i}of wt)ht[t]=i,yt[t]=e,e&&(At[e]=t);function It(){return wt.map((t=>t.listStyle))}function kt(t){return ht[t]||null}function vt(t){return At[t]||null}function _t(t){return yt[t]||null}function Tt(t){switch(t){case"lower-alpha":return"lower-latin";case"upper-alpha":return"upper-latin";default:return t}}class Lt extends t.Command{defaultType;_supportedTypes;constructor(t,e,i){super(t),this.defaultType=e,this._supportedTypes=i}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(t={}){const e=this.editor.model,i=e.document;e.change((e=>{this._tryToConvertItemsToList(t);let n=Array.from(i.selection.getSelectedBlocks()).filter((t=>t.hasAttribute("listType")));if(n.length){n=h(n);for(const i of n)e.setAttribute("listStyle",t.type||this.defaultType,i)}}))}isStyleTypeSupported(t){return!this._supportedTypes||this._supportedTypes.includes(t)}_getValue(){const t=(0,r.first)(this.editor.model.document.selection.getSelectedBlocks());return d(t)?t.getAttribute("listStyle"):null}_checkEnabled(){const t=this.editor,e=t.commands.get("numberedList"),i=t.commands.get("bulletedList");return e.isEnabled||i.isEnabled}_tryToConvertItemsToList(t){if(!t.type)return;const e=kt(t.type);if(!e)return;const i=this.editor,n=`${e}List`;i.commands.get(n).value||i.execute(n)}}class St extends t.Command{refresh(){const t=this._getValue();this.value=t,this.isEnabled=null!=t}execute(t={}){const e=this.editor.model,i=e.document;let n=Array.from(i.selection.getSelectedBlocks()).filter((t=>d(t)&&"numbered"==t.getAttribute("listType")));n=h(n),e.change((e=>{for(const i of n)e.setAttribute("listReversed",!!t.reversed,i)}))}_getValue(){const t=this.editor.model.document,e=(0,r.first)(t.selection.getSelectedBlocks());return d(e)&&"numbered"==e.getAttribute("listType")?e.getAttribute("listReversed"):null}}function xt(t){return(e,i,n)=>{const{writer:s,schema:r,consumable:o}=n;if(!1===o.test(i.viewItem,t.viewConsumables))return;i.modelRange||Object.assign(i,n.convertChildren(i.viewItem,i.modelCursor));let l=!1;for(const e of i.modelRange.getItems({shallow:!0}))r.checkAttribute(e,t.attributeName)&&t.appliesToListItem(e)&&(e.hasAttribute(t.attributeName)||(s.setAttribute(t.attributeName,t.getAttributeOnUpcast(i.viewItem),e),l=!0));l&&o.consume(i.viewItem,t.viewConsumables)}}class Ct extends t.Plugin{static get pluginName(){return"ListPropertiesUtils"}static get isOfficialPlugin(){return!0}getAllSupportedStyleTypes(){return It()}getListTypeFromListStyleType(t){return kt(t)}getListStyleTypeFromTypeAttribute(t){return vt(t)}getTypeAttributeFromListStyleType(t){return _t(t)}}function Pt(t){const{startIndex:e,reversed:i,styles:n}=t;return{styles:Et(n),startIndex:e||!1,reversed:i||!1}}function Et(t){const e={listTypes:["bulleted","numbered"],useAttribute:!1};return!0===t||(t?Array.isArray(t)||"string"==typeof t?e.listTypes=(0,r.toArray)(t):(e.listTypes=t.listTypes?(0,r.toArray)(t.listTypes):e.listTypes,e.useAttribute=!!t.useAttribute,t.listStyleTypes&&(e.listStyleTypes=t.listStyleTypes)):e.listTypes=[]),e}const Vt="default";class Nt extends t.Plugin{static get requires(){return[at,Ct]}static get pluginName(){return"ListPropertiesEditing"}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,e=t.model,i=t.plugins.get(at),n=function(t){const e=[],i=Pt(t);if(t.styles){const t=i.styles.useAttribute;e.push({attributeName:"listStyle",defaultValue:Vt,viewConsumables:{styles:"list-style-type"},addCommand(e){let i=It();t&&(i=i.filter((t=>!!_t(t)))),e.commands.add("listStyle",new Lt(e,Vt,i))},appliesToListItem:t=>"numbered"==t.getAttribute("listType")||"bulleted"==t.getAttribute("listType"),hasValidAttribute(t){if(!this.appliesToListItem(t))return!t.hasAttribute("listStyle");if(!t.hasAttribute("listStyle"))return!1;const e=t.getAttribute("listStyle");return e==Vt||kt(e)==t.getAttribute("listType")},setAttributeOnDowncast(e,i,n){if(i&&i!==Vt){if(!t)return void e.setStyle("list-style-type",i,n);{const t=_t(i);if(t)return void e.setAttribute("type",t,n)}}e.removeStyle("list-style-type",n),e.removeAttribute("type",n)},getAttributeOnUpcast(t){const e=t.getStyle("list-style-type");if(e)return Tt(e);const i=t.getAttribute("type");return i?vt(i):Vt}})}t.reversed&&e.push({attributeName:"listReversed",defaultValue:!1,viewConsumables:{attributes:"reversed"},addCommand(t){t.commands.add("listReversed",new St(t))},appliesToListItem:t=>"numbered"==t.getAttribute("listType"),hasValidAttribute(t){return this.appliesToListItem(t)==t.hasAttribute("listReversed")},setAttributeOnDowncast(t,e,i){e?t.setAttribute("reversed","reversed",i):t.removeAttribute("reversed",i)},getAttributeOnUpcast:t=>t.hasAttribute("reversed")});t.startIndex&&e.push({attributeName:"listStart",defaultValue:1,viewConsumables:{attributes:"start"},addCommand(t){t.commands.add("listStart",new bt(t))},appliesToListItem:t=>L(t.getAttribute("listType")),hasValidAttribute(t){return this.appliesToListItem(t)==t.hasAttribute("listStart")},setAttributeOnDowncast(t,e,i){0==e||e>1?t.setAttribute("start",e,i):t.removeAttribute("start",i)},getAttributeOnUpcast(t){const e=t.getAttribute("start");return e>=0?e:1}});return e}(t.config.get("list.properties"));for(const s of n)s.addCommand(t),e.schema.extend("$listItem",{allowAttributes:s.attributeName}),i.registerDowncastStrategy({scope:"list",attributeName:s.attributeName,setAttributeOnDowncast(t,e,i){s.setAttributeOnDowncast(t,e,i)}});t.conversion.for("upcast").add((t=>{for(const e of n)t.on("element:ol",xt(e)),t.on("element:ul",xt(e))})),i.on("checkAttributes:list",((t,{viewElement:e,modelAttributes:i})=>{for(const s of n)s.getAttributeOnUpcast(e)!=i[s.attributeName]&&(t.return=!0,t.stop())})),this.listenTo(t.commands.get("indentList"),"afterExecute",((t,i)=>{e.change((t=>{for(const e of i)for(const i of n)i.appliesToListItem(e)&&t.setAttribute(i.attributeName,i.defaultValue,e)}))})),i.on("postFixer",((t,{listNodes:e,writer:i})=>{for(const{node:s}of e)for(const e of n)e.hasValidAttribute(s)||(e.appliesToListItem(s)?i.setAttribute(e.attributeName,e.defaultValue,s):i.removeAttribute(e.attributeName,s),t.return=!0)})),i.on("postFixer",((t,{listNodes:e,writer:i})=>{for(const{node:s,previousNodeInList:r}of e)if(r&&r.getAttribute("listType")==s.getAttribute("listType"))for(const e of n){const{attributeName:n}=e;if(!e.appliesToListItem(s))continue;const o=r.getAttribute(n);s.getAttribute(n)!=o&&(i.setAttribute(n,o,s),t.return=!0)}}))}}var Bt=i(266),Ot={attributes:{"data-cke":!0}};Ot.setAttributes=tt(),Ot.insert=Q().bind(null,"head"),Ot.domAPI=Z(),Ot.insertStyleElement=it();H()(Bt.A,Ot);Bt.A&&Bt.A.locals&&Bt.A.locals;class Rt extends dt.View{children;stylesView=null;additionalPropertiesCollapsibleView=null;startIndexFieldView=null;reversedSwitchButtonView=null;focusTracker=new r.FocusTracker;keystrokes=new r.KeystrokeHandler;focusables=new dt.ViewCollection;focusCycler;constructor(t,{enabledProperties:e,styleButtonViews:i,styleGridAriaLabel:n}){super(t);const s=["ck","ck-list-properties"];this.children=this.createCollection(),this.focusCycler=new dt.FocusCycler({focusables:this.focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),i&&i.length?(this.stylesView=this._createStylesView(i,n),this.children.add(this.stylesView)):s.push("ck-list-properties_without-styles"),(e.startIndex||e.reversed)&&(this._addNumberedListPropertyViews(e),s.p