1var J=Object.defineProperty;var ue=Object.getOwnPropertyDescriptor;var me=Object.getOwnPropertyNames;var de=Object.prototype.hasOwnProperty;var pe=(n,e)=>{for(var t in e)J(n,t,{get:e[t],enumerable:!0})},Y=(n,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of me(e))!de.call(n,i)&&i!==t&&J(n,i,{get:()=>e[i],enumerable:!(o=ue(e,i))||o.enumerable});return n},T=(n,e,t)=>(Y(n,e,"default"),t&&Y(t,e,"default"));var V={};pe(V,{Delete:()=>F,DeleteCommand:()=>O,Input:()=>P,InsertTextCommand:()=>D,TextTransformation:()=>K,TextWatcher:()=>W,TwoStepCaretMovement:()=>Q,Typing:()=>U,TypingChangeBuffer:()=>S,_DeleteObserver:()=>L,findAttributeRange:()=>le,findAttributeRangeBound:()=>H,getLastTextLine:()=>ae,inlineHighlight:()=>Re});var b={};T(b,Oe);import*as Oe from"../../../frontend-editor-ckeditor-web/__liferay__/exports/@ckeditor$ckeditor5-core$dist$index.js.js";var m={};T(m,Be);import*as Be from"../../../frontend-editor-ckeditor-web/__liferay__/exports/@ckeditor$ckeditor5-utils$dist$index.js.js";var d={};T(d,Ie);import*as Ie from"../../../frontend-editor-ckeditor-web/__liferay__/exports/@ckeditor$ckeditor5-engine$dist$index.js.js";function X(n,e,{signal:t,edges:o}={}){let i,r=null,a=o!=null&&o.includes("leading"),s=o==null||o.includes("trailing"),l=()=>{r!==null&&(n.apply(i,r),i=void 0,r=null)},f=()=>{s&&l(),x()},c=null,u=()=>{c!=null&&clearTimeout(c),c=setTimeout(()=>{c=null,f()},e)},p=()=>{c!==null&&(clearTimeout(c),c=null)},x=()=>{p(),i=void 0,r=null},h=()=>{p(),l()},g=function(..._){if(t?.aborted)return;i=this,r=_;let B=c==null;u(),a&&B&&l()};return g.schedule=u,g.cancel=x,g.flush=h,t?.addEventListener("abort",x,{once:!0}),g}function M(n,e=0,t={}){typeof t!="object"&&(t={});let{leading:o=!1,trailing:i=!0,maxWait:r}=t,a=Array(2);o&&(a[0]="leading"),i&&(a[1]="trailing");let s,l=null,f=X(function(...p){s=n.apply(this,p),l=null},e,{edges:a}),c=function(...p){return r!=null&&(l===null&&(l=Date.now()),Date.now()-l>=r)?(s=n.apply(this,p),l=Date.now(),f.cancel(),f.schedule(),s):(f.apply(this,p),s)},u=()=>(f.flush(),s);return c.cancel=f.cancel,c.flush=u,c}function z(n){if(n==null)return"";if(typeof n=="string")return n;if(Array.isArray(n))return n.map(z).join(",");let e=String(n);return e==="0"&&Object.is(Number(n),-0)?"-0":e}function Z(n){return n.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&")}function G(n){return Z(z(n))}var S=class{model;limit;_isLocked;_size;_batch=null;_changeCallback;_selectionChangeCallback;constructor(e,t=20){this.model=e,this._size=0,this.limit=t,this._isLocked=!1,this._changeCallback=(o,i)=>{i.isLocal&&i.isUndoable&&i!==this._batch&&this._reset(!0)},this._selectionChangeCallback=()=>{this._reset()},this.model.document.on("change",this._changeCallback),this.model.document.selection.on("change:range",this._selectionChangeCallback),this.model.document.selection.on("change:attribute",this._selectionChangeCallback)}get batch(){return this._batch||(this._batch=this.model.createBatch({isTyping:!0})),this._batch}get size(){return this._size}input(e){this._size+=e,this._size>=this.limit&&this._reset(!0)}get isLocked(){return this._isLocked}lock(){this._isLocked=!0}unlock(){this._isLocked=!1}destroy(){this.model.document.off("change",this._changeCallback),this.model.document.selection.off("change:range",this._selectionChangeCallback),this.model.document.selection.off("change:attribute",this._selectionChangeCallback)}_reset(e=!1){(!this.isLocked||e)&&(this._batch=null,this._size=0)}},D=class extends b.Command{_buffer;constructor(e,t){super(e),this._buffer=new S(e.model,t),this._isEnabledBasedOnSelection=!1}get buffer(){return this._buffer}destroy(){super.destroy(),this._buffer.destroy()}execute(e={}){let t=this.editor.model,o=t.document,i=e.text||"",r=i.length,a=o.selection;if(e.selection?a=e.selection:e.range&&(a=t.createSelection(e.range)),!t.canEditAt(a))return;let s=e.resultRange;t.enqueueChange(this._buffer.batch,l=>{this._buffer.lock();let f=Array.from(o.selection.getAttributes());t.deleteContent(a),i&&t.insertContent(l.createText(i,f),a),s?l.setSelection(s):a.is("documentSelection")||l.setSelection(a),this._buffer.unlock(),this._buffer.input(r)})}},ie=["insertText","insertReplacementText"],he=[...ie,"insertCompositionText"],$=class extends d.Observer{focusObserver;constructor(e){super(e),this.focusObserver=e.getObserver(d.FocusObserver);let t=m.env.isAndroid?he:ie,o=e.document;o.on("beforeinput",(i,r)=>{if(!this.isEnabled)return;let{data:a,targetRanges:s,inputType:l,domEvent:f,isComposing:c}=r;if(!t.includes(l))return;this.focusObserver.flush();let u=new m.EventInfo(o,"insertText");o.fire(u,new d.ViewDocumentDomEventData(e,f,{text:a,selection:e.createSelection(s),isComposing:c})),u.stop.called&&i.stop()}),m.env.isAndroid||o.on("compositionend",(i,{data:r,domEvent:a})=>{this.isEnabled&&r&&o.fire("insertText",new d.ViewDocumentDomEventData(e,a,{text:r,isComposing:!0}))},{priority:"low"})}observe(){}stopObserving(){}},P=class extends b.Plugin{_typingQueue;static get pluginName(){return"Input"}static get isOfficialPlugin(){return!0}init(){let e=this.editor,t=e.model,o=e.editing.view,i=e.editing.mapper,r=t.document.selection;this._typingQueue=new j(e),o.addObserver($);let a=new D(e,e.config.get("typing.undoStep")||20);e.commands.add("insertText",a),e.commands.add("input",a),this.listenTo(o.document,"beforeinput",()=>{this._typingQueue.flush("next beforeinput")},{priority:"high"}),this.listenTo(o.document,"insertText",(s,l)=>{let{text:f,selection:c}=l;if(o.document.selection.isFake&&c&&o.document.selection.isSimilar(c)&&l.preventDefault(),c&&Array.from(c.getRanges()).some(h=>!h.isCollapsed)&&l.preventDefault(),!a.isEnabled){l.preventDefault();return}let u;c?u=Array.from(c.getRanges()).map(h=>i.toModelRange(h)).map(h=>(0,d._tryFixingModelRange)(h,t.schema)||h):u=Array.from(r.getRanges());let p=f;if(m.env.isAndroid){let h=Array.from(u[0].getItems()).reduce((g,_)=>g+(_.is("$textProxy")?_.data:""),"");if(h&&(h.length<=p.length?p.startsWith(h)&&(p=p.substring(h.length),u[0].start=u[0].start.getShiftedBy(h.length)):h.startsWith(p)&&(u[0].start=u[0].start.getShiftedBy(p.length),p="")),p.length==0&&u[0].isCollapsed)return}let x={text:p,selection:t.createSelection(u)};this._typingQueue.push(x,!!l.isComposing),l.domEvent.defaultPrevented&&this._typingQueue.flush("beforeinput default prevented")}),m.env.isAndroid?this.listenTo(o.document,"keydown",(s,l)=>{r.isCollapsed||l.keyCode!=229||!o.document.isComposing||ee(t,a)}):this.listenTo(o.document,"compositionstart",()=>{r.isCollapsed||ee(t,a)},{priority:"high"}),this.listenTo(o.document,"mutations",(s,{mutations:l})=>
1{if(this._typingQueue.hasAffectedElements())for(let{node:f}of l){let c=ge(f,i),u=i.toModelElement(c);if(this._typingQueue.isElementAffected(u)){this._typingQueue.flush("mutations");return}}}),this.listenTo(o.document,"compositionend",()=>{this._typingQueue.flush("before composition end")},{priority:"high"}),this.listenTo(o.document,"compositionend",()=>{this._typingQueue.flush("after composition end");let s=[];if(this._typingQueue.hasAffectedElements())for(let l of this._typingQueue.flushAffectedElements()){let f=i.toViewElement(l);f&&s.push({type:"children",node:f})}(s.length||!m.env.isAndroid)&&o.document.fire("mutations",{mutations:s})},{priority:"lowest"})}destroy(){super.destroy(),this._typingQueue.destroy()}},j=class{editor;flushDebounced=M(()=>this.flush("timeout"),50);_queue=[];_isComposing=!1;_affectedElements=new Set;constructor(e){this.editor=e}destroy(){for(this.flushDebounced.cancel(),this._affectedElements.clear();this._queue.length;)this.shift()}get length(){return this._queue.length}push(e,t){let o={text:e.text};if(e.selection){o.selectionRanges=[];for(let i of e.selection.getRanges())o.selectionRanges.push(d.ModelLiveRange.fromRange(i)),this._affectedElements.add(i.start.parent)}this._queue.push(o),this._isComposing||=t,this.flushDebounced()}shift(){let e=this._queue.shift(),t={text:e.text};if(e.selectionRanges){let o=e.selectionRanges.map(i=>xe(i)).filter(i=>!!i);o.length&&(t.selection=this.editor.model.createSelection(o))}return t}flush(e){let t=this.editor,o=t.model,i=t.editing.view;if(this.flushDebounced.cancel(),!this._queue.length)return;let a=t.commands.get("insertText").buffer;o.enqueueChange(a.batch,()=>{for(a.lock();this._queue.length;){let s=this.shift();t.execute("insertText",s)}a.unlock(),this._isComposing||this._affectedElements.clear(),this._isComposing=!1}),i.scrollToTheSelection()}isElementAffected(e){return this._affectedElements.has(e)}hasAffectedElements(){return this._affectedElements.size>0}flushAffectedElements(){let e=Array.from(this._affectedElements);return this._affectedElements.clear(),e}};function ee(n,e){if(!e.isEnabled)return;let t=e.buffer;t.lock(),n.enqueueChange(t.batch,()=>{n.deleteContent(n.document.selection)}),t.unlock()}function xe(n){let e=n.toRange();return n.detach(),e.root.rootName=="$graveyard"?null:e}function ge(n,e){let t=n.is("$text")?n.parent:n;for(;!e.toModelElement(t);)t=t.parent;return t}var O=class extends b.Command{direction;_buffer;constructor(e,t){super(e),this.direction=t,this._buffer=new S(e.model,e.config.get("typing.undoStep")),this._isEnabledBasedOnSelection=!1}get buffer(){return this._buffer}execute(e={}){let t=this.editor.model,o=t.document;t.enqueueChange(this._buffer.batch,i=>{this._buffer.lock();let r=i.createSelection(e.selection||o.selection);if(!t.canEditAt(r))return;let a=e.sequence||1,s=r.isCollapsed;if(r.isCollapsed&&t.modifySelection(r,{direction:this.direction,unit:e.unit,treatEmojiAsSingleUnit:!0}),this._shouldEntireContentBeReplacedWithParagraph(a)){this._replaceEntireContentWithParagraph(i);return}if(this._shouldReplaceFirstBlockWithParagraph(r,a)){this.editor.execute("paragraph",{selection:r});return}if(r.isCollapsed)return;let l=0;
1r.getFirstRange().getMinimalFlatRanges().forEach(f=>{l+=(0,m.count)(f.getWalker({singleCharacters:!0,ignoreElementEnd:!0,shallow:!0}))}),t.deleteContent(r,{doNotResetEntireContent:s,direction:this.direction}),this._buffer.input(l),i.setSelection(r),this._buffer.unlock()})}_shouldEntireContentBeReplacedWithParagraph(e){if(e>1)return!1;let t=this.editor.model,i=t.document.selection,r=t.schema.getLimitElement(i);if(!(i.isCollapsed&&i.containsEntireContent(r))||!t.schema.checkChild(r,"paragraph"))return!1;let s=r.getChild(0);return!(s&&s.is("element","paragraph"))}_replaceEntireContentWithParagraph(e){let t=this.editor.model,i=t.document.selection,r=t.schema.getLimitElement(i),a=e.createElement("paragraph");e.remove(e.createRangeIn(r)),e.insert(a,r),e.setSelection(a,0)}_shouldReplaceFirstBlockWithParagraph(e,t){let o=this.editor.model;if(t>1||this.direction!="backward"||!e.isCollapsed)return!1;let i=e.getFirstPosition(),r=o.schema.getLimitElement(i),a=r.getChild(0);return!(i.parent!=a||!e.containsEntireContent(a)||!o.schema.checkChild(r,"paragraph")||a.name=="paragraph")}},be="character",te="word",ye="codePoint",E="selection",A="backward",R="forward",se={deleteContent:{unit:E,direction:A},deleteContentBackward:{unit:ye,direction:A},deleteWordBackward:{unit:te,direction:A},deleteHardLineBackward:{unit:E,direction:A},deleteSoftLineBackward:{unit:E,direction:A},deleteContentForward:{unit:be,direction:R},deleteWordForward:{unit:te,direction:R},deleteHardLineForward:{unit:E,direction:R},deleteSoftLineForward:{unit:E,direction:R}},L=class extends d.Observer{constructor(e){super(e);let t=e.document,o=0;t.on("keydown",()=>{o++}),t.on("keyup",()=>{o=0}),t.on("beforeinput",(i,r)=>{if(!this.isEnabled)return;let{targetRanges:a,domEvent:s,inputType:l}=r,f=se[l];if(!f)return;let c={direction:f.direction,unit:f.unit,sequence:o};c.unit==E&&(c.selectionToRemove=e.createSelection(a[0])),l==="deleteContentBackward"&&(m.env.isAndroid&&(c.sequence=1),ve(a)&&(c.unit=E,c.selectionToRemove=e.createSelection(a)));let u=new d.BubblingEventInfo(t,"delete",a[0]);t.fire(u,new d.ViewDocumentDomEventData(e,s,c)),u.stop.called&&i.stop()}),m.env.isBlink&&_e(this)}observe(){}stopObserving(){}};function _e(n){let e=n.view,t=e.document,o=null,i=!1;t.on("keydown",(s,{keyCode:l})=>{o=l,i=!1}),t.on("keyup",(s,{keyCode:l,domEvent:f})=>{let c=t.selection,u=n.isEnabled&&l==o&&r(l)&&!c.isCollapsed&&!i;if(o=null,u){let p=c.getFirstRange(),x=new d.BubblingEventInfo(t,"delete",p),h={unit:E,direction:a(l),selectionToRemove:c};t.fire(x,new d.ViewDocumentDomEventData(e,f,h))}}),t.on("beforeinput",(s,{inputType:l})=>{let f=se[l];r(o)&&f&&f.direction==a(o)&&(i=!0)},{priority:"high"}),t.on("beforeinput",(s,{inputType:l,data:f})=>{o==m.keyCodes.delete&&l=="insertText"&&f=="\x7F"&&s.stop()},{priority:"high"});function r(s){return s==m.keyCodes.backspace||s==m.keyCodes.delete}function a(s){return s==m.keyCodes.backspace?A:R}}function ve(n){if(n.length!=1||n[0].isCollapsed)return!1;let e=n[0].getWalker({direction:"backward",singleCharacters:!0,ignoreElementEnd:!0}),t=0;for(let{nextPosition:o,item:i}of e){if(o.parent.is("$text")){let r=o.parent.data,a=o.offset;if((0,m.isInsideSurrogatePair)(r,a)||(0,m.isInsideCombinedSymbol)(r,a)||(0,m.isInsideEmojiSequence)(r,a))continue;t++}else(i.is("containerElement")||i.is("emptyElement"))&&t++;if(t>1)return!0}return!1}var F=class extends b.Plugin{_undoOnBackspace;static get pluginName(){return"Delete"}static get isOfficialPlugin(){return!0}init(){let e=this.editor,t=e.editing.view,o=t.document,i=e.model.document;t.addObserver(L),this._undoOnBackspace=!1;let r=new O(e,"forward");e.commands.add("deleteForward",r),e.commands.add("forwardDelete",r),e.commands.add("delete",new O(e,"backward")),this.listenTo(o,"delete",(a,s)=>{o.isComposing||s.preventDefault();let{direction:l,sequence:f,selectionToRemove:c,unit:u}=s,p=l==="forward"?"deleteForward":"delete",x={sequence:f};if(u=="selection"){let h=Array.from(c.getRanges()).map(g=>e.editing.mapper.toModelRange(g)).map(g=>(0,d._tryFixingModelRange)(g,e.model.schema)||g);x.selection=e.model.createSelection(h)}else x.unit=u;e.execute(p,x),t.scrollToTheSelection()},{priority:"low"}),this.listenTo(o,"keydown",(a,s)=>{if(o.isComposing||s.keyCode!=m.keyCodes.backspace||!i.selection.isCollapsed)return;let l=e.model.schema.getLimitElement(i.selection),f=e.model.createPositionAt(l,0);if(f.isTouching(i.selection.getFirstPosition())){s.preventDefault();let c=e.model.schema.getNearestSelectionRange(f,"forward");if(!c)return;let u=t.createSelection(e.editing.mapper.toViewRange(c)),p=u.getFirstRange(),x=new d.BubblingEventInfo(document,"delete",p),h={unit:"selection",direction:"backward",selectionToRemove:u};o.fire(x,new d.ViewDocumentDomEventData(t,s.domEvent,h))}}),this.editor.plugins.has("UndoEditing")&&(this.listenTo(o,"delete",(a,s)=>
1{this._undoOnBackspace&&s.direction=="backward"&&s.sequence==1&&s.unit=="codePoint"&&(this._undoOnBackspace=!1,e.execute("undo"),s.preventDefault(),a.stop())},{context:"$capture"}),this.listenTo(i,"change",()=>{this._undoOnBackspace=!1}))}requestUndoOnBackspace(){this.editor.plugins.has("UndoEditing")&&(this._undoOnBackspace=!0)}},U=class extends b.Plugin{static get requires(){return[P,F]}static get pluginName(){return"Typing"}static get isOfficialPlugin(){return!0}};function ae(n,e){let t=n.start;return{text:Array.from(n.getWalker({ignoreElementEnd:!1})).reduce((i,{item:r})=>r.is("$text")||r.is("$textProxy")?i+r.data:(t=e.createPositionAfter(r),""),""),range:e.createRange(t,n.end)}}var W=class extends(0,m.ObservableMixin)(){model;testCallback;_hasMatch;constructor(e,t){super(),this.model=e,this.testCallback=t,this._hasMatch=!1,this.set("isEnabled",!0),this.on("change:isEnabled",()=>{this.isEnabled?this._startListening():(this.stopListening(e.document.selection),this.stopListening(e.document))}),this._startListening()}get hasMatch(){return this._hasMatch}_startListening(){let t=this.model.document;this.listenTo(t.selection,"change:range",(o,{directChange:i})=>{if(i){if(!t.selection.isCollapsed){this.hasMatch&&(this.fire("unmatched"),this._hasMatch=!1);return}this._evaluateTextBeforeSelection("selection")}}),this.listenTo(t,"change:data",(o,i)=>{i.isUndo||!i.isLocal||this._evaluateTextBeforeSelection("data",{batch:i})})}_evaluateTextBeforeSelection(e,t={}){let o=this.model,r=o.document.selection,a=o.createRange(o.createPositionAt(r.focus.parent,0),r.focus),{text:s,range:l}=ae(a,o),f=this.testCallback(s);if(!f&&this.hasMatch&&this.fire("unmatched"),this._hasMatch=!!f,f){let c=Object.assign(t,{text:s,range:l});typeof f=="object"&&Object.assign(c,f),this.fire(`matched:${e}`,c)}}},Q=class extends b.Plugin{attributes;_overrideUid;_isNextGravityRestorationSkipped=!1;static get pluginName(){return"TwoStepCaretMovement"}static get isOfficialPlugin(){return!0}constructor(e){super(e),this.attributes=new Set,this._overrideUid=null}init(){let e=this.editor,t=e.model,o=e.editing.view,i=e.locale,r=t.document.selection;this.listenTo(o.document,"arrowKey",(a,s)=>{if(!r.isCollapsed||s.shiftKey||s.altKey||s.ctrlKey)return;let l=s.keyCode==m.keyCodes.arrowright,f=s.keyCode==m.keyCodes.arrowleft;if(!l&&!f)return;let c=i.contentLanguageDirection,u=!1;c==="ltr"&&l||c==="rtl"&&f?u=this._handleForwardMovement(s):u=this._handleBackwardMovement(s),u===!0&&a.stop()},{context:"$text",priority:"highest"}),this.listenTo(r,"change:range",(a,s)=>{if(this._isNextGravityRestorationSkipped){this._isNextGravityRestorationSkipped=!1;return}this._isGravityOverridden&&(!s.directChange&&y(r.getFirstPosition(),this.attributes)||this._restoreGravity())}),this._enableClickingAfterNode(),this._enableInsertContentSelectionAttributesFixer(),this._handleDeleteContentAfterNode()}registerAttribute(e){this.attributes.add(e)}_handleForwardMovement(e){let t=this.attributes,o=this.editor.model,i=o.document.selection,r=i.getFirstPosition();return this._isGravityOverridden||r.isAtStart&&v(i,t)?!1:y(r,t)?(e&&w(e),v(i,t)&&y(r,t,!0)?k(o,t):this._overrideGravity(),!0):!1}_handleBackwardMovement(e){let t=this.attributes,o=this.editor.model,i=o.document.selection,r=i.getFirstPosition();return this._isGravityOverridden?(e&&w(e),this._restoreGravity(),y(r,t,!0)?k(o,t):I(o,t,r),!0):r.isAtStart?v(i,t)?(e&&w(e),I(o,t,r),!0):!1:!v(i,t)&&y(r,t,!0)?(e&&w(e),I(o,t,r),!0):oe(r,t)?r.isAtEnd&&!v(i,t)&&y(r,t)?(e&&w(e),I(o,t,r),!0):(this._isNextGravityRestorationSkipped=!0,this._overrideGravity(),!1):!1}_enableClickingAfterNode(){let e=this.editor,t=e.model,o=t.document.selection,i=e.editing.view.document;e.editing.view.addObserver(d.MouseObserver),e.editing.view.addObserver(d.TouchObserver);let r=!1,a=!1;this.listenTo(i,"touchstart",()=>{a=!1,r=!0}),this.listenTo(i,"mousedown",()=>{a=!0}),this.listenTo(i,"selectionChange",()=>{let s=this.attributes;if(!a&&!r||(a=!1,r=!1,!o.isCollapsed)||!v(o,s))return;let l=o.getFirstPosition();y(l,s)&&(l.isAtStart||y(l,s,!0)?k(t,s):this._isGravityOverridden||this._overrideGravity())})}_enableInsertContentSelectionAttributesFixer(){let t=this.editor.model,o=t.document.selection,i=this.attributes;this.listenTo(t,"insertContent",()=>{let r=o.getFirstPosition();v(o,i)&&y(r,i)&&k(t,i)},{priority:"low"})}_handleDeleteContentAfterNode(){let e=this.editor,t=e.model,o=t.document.selection,i=e.editing.view,r=!1,a=!1;this.listenTo(i.document,"delete",(s,l)=>{r=l.direction==="backward"},{priority:"high"}),this.listenTo(t,"deleteContent",()=>{if(!r)return;let s=o.getFirstPosition();a=v(o,this.attributes)&&!oe(s,this.attributes)},{priority:"high"}),this.listenTo(t,"deleteContent",()=>{r&&(r=!1,!a&&e.model.enqueueChange(()=>{let s=o.getFirstPosition();v(o,this.attributes)&&y(s,this.attributes)&&(s.isAtStart||y(s,this.attributes,!0)?k(t,this.attributes):this._isGravityOverridden||this._overrideGravity())}))},{priority:"low"})}get _isGravityOverridden(){return!!this._overrideUid}_overrideGravity(){this._overrideUid=this.editor.model.change(e=>e.overrideSelectionGravity())}_restoreGravity(){this.editor.model.change(e=>{e.restoreSelectionGravity(this._overrideUid),this._overrideUid=null})}};function v(n,e){for(let t of e)if(n.hasAttribute(t))return!0;return!1}function I(n,e,t){let o=t.nodeBefore;n.change(i=>{if(o){let r=[],a=n.schema.isObject(o)&&n.schema.isInline(o);for(let[s,l]of o.getAttributes())n.schema.checkAttribute("$text",s)&&(!a||n.schema.getAttributeProperties(s).copyFromObject!==!1)&&r.push([s,l]);i.setSelectionAttribute(r)}else i.removeSelectionAttribute(e)})}function k(n,e){n.change(t=>{t.removeSelectionAttribute(e)})}function w(n){n.preventDefault()}function oe(n,e){let t=n.getShiftedBy(-1);return y(t,e)}function y(n,e,t=!1){let{nodeBefore:o,nodeAfter:i}=n;for(let r of e){let a=o?o.getAttribute(r):void 0,s=i?i.getAttribute(r):void 0;if(!(t&&(a===void 0||s===void 0))&&s!==a)return!0}return!1}var re={copyright:{from:"(c)",to:"\xA9"},registeredTrademark:{from:"(r)",to:"\xAE"},trademark:{from:"(tm)",to:"\u2122"},oneHalf:{from:/(^|[^/a-z0-9])(1\/2)([^/a-z0-9])$/i,to:[null,"\xBD",null]},oneThird:{from:/(^|[^/a-z0-9])(1\/3)([^/a-z0-9])$/i,to:[null,"\u2153",null]},twoThirds:{from:/(^|[^/a-z0-9])(2\/3)([^/a-z0-9])$/i,to:[null,"\u2154",null]},oneForth:{from:/(^|[^/a-z0-9])(1\/4)([^/a-z0-9])$/i,to:[null,"\xBC",null]},threeQuarters:{from:/(^|[^/a-z0-9])(3\/4)([^/a-z0-9])$/i,to:[null,"\xBE",null]},lessThanOrEqual:{from:"<=",to:"\u2264"},greaterThanOrEqual:{from:">=",to:"\u2265"},notEqual:{from:"!=",to:"\u2260"},arrowLeft:{from:"<-",to:"\u2190"},arrowRight:{from:"->",to:"\u2192"},horizontalEllipsis:{from:"...",to:"\u2026"},enDash:{from:/(^| )(--)( )$/,to:[null,"\u2013",null]},emDash:{from:/(^| )(---)( )$/,to:[null,"\u2014",null]},quotesPrimary:{from:C('"'),to:[null,"\u201C",null,"\u201D"]},quotesSecondary:{from:C("'"),to:[null,"\u2018",null,"\u2019"]},quotesPrimaryEnGb:{from:C("'"),to:[null,"\u2018",null,"\u2019"]},quotesSecondaryEnGb:{from:C('"'),to:[null,"\u201C",null,"\u201D"]},quotesPrimaryPl:{from:C('"'),to:[null,"\u201E",null,"\u201D"]},quotesSecondaryPl:{from:C("'"),to:[null,"\u201A",null,"\u2019"]}},ne={symbols:["copyright","registeredTrademark","trademark"],mathematical:["oneHalf","oneThird","twoThirds","oneForth","threeQuarters","lessThanOrEqual","greaterThanOrEqual","notEqual","arrowLeft","arrowRight"],typography:["horizontalEllipsis","enDash","emDash"],quotes:["quotesPrimary","quotesSecondary"]},Ee=["symbols","mathematical","typography","quotes"],K=class extends b.Plugin{static get requires(){return["Delete","Input"]}static get pluginName(){return"TextTransformation"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.config.define("typing",{transformations:{include:Ee}})}init(){let t=this.editor.model.document.selection;t.on("change:range",()=>{this.isEnabled=!t.anchor.parent.is("element","codeBlock")}),this._enableTransformationWatchers()}_enableTransformationWatchers(){let e=this.editor,t=e.model,o=e.plugins.get("Delete"),i=ke(e.config.get("typing.transformations")),r=s=>{for(let l of i)if(l.from.test(s))return{normalizedTransformation:l}},a=new W(e.model,r);a.on("matched:data",(s,l)=>{if(!l.batch.isTyping)return;let{from:f,to:c}=l.normalizedTransformation,u=f.exec(l.text),p=c(u.slice(1)),x=l.range,h=u.index;t.enqueueChange(g=>{for(let _=1;_<u.length;_++){let B=u[_],q=p[_-1];if(q==null){h+=B.length;continue}let N=x.start.getShiftedBy(h),fe=t.createRange(N,N.getShiftedBy(B.length)),ce=Ae(N);t.insertContent(g.createText(q,ce),fe),h+=q.length}t.enqueueChange(()=>{o.requestUndoOnBackspace()})})}),a.bind("isEnabled").to(this)}};function Te(n){return typeof n=="string"?new RegExp(`(${G(n)})$`):n}function Ce(n){return typeof n=="string"?()=>[n]:n instanceof Array?()=>n:n}function Ae(n){return(n.textNode?n.textNode:n.nodeAfter).getAttributes()}function C(n){return new RegExp(`(^|\\s)(${n})([^${n}]*)(${n})$`)}function ke(n){let e=n.extra||[],t=n.remove||[],o=r=>!t.includes(r),i=n.include.concat(e).filter(o);return we(i).filter(o).map(r=>typeof r=="string"&&re[r]?re[r]:r).filter(r=>typeof r=="object").map(r=>({from:Te(r.from),to:Ce(r.to)}))}function we(n){let e=new Set;for(let t of n)if(typeof t=="string"&&ne[t])for(let o of ne[t])e.add(o);else e.add(t);return Array.from(e)}function le(n,e,t,o){return o.createRange(H(n,e,t,!0,o),H(n,e,t,!1,o))}function H(n,e,t,o,i){let r=n.textNode||(o?n.nodeBefore:n.nodeAfter),a=null;for(;r&&r.getAttribute(e)==t;)a=r,r=o?r.previousSibling:r.nextSibling;return a?i.createPositionAt(a,o?"before":"after"):n}function Re(n,e,t,o){let i=n.editing.view,r=new Set;i.document.registerPostFixer(a=>{let s=n.model.document.selection,l=!1;if(s.hasAttribute(e)){let f=le(s.getFirstPosition(),e,s.getAttribute(e),n.model),c=n.editing.mapper.toViewRange(f);for(let u of c.getItems())u.is("element",t)&&!u.hasClass(o)&&(a.addClass(o,u),r.add(u),l=!0)}return l}),n.conversion.for("editingDowncast").add(a=>{a.on("insert",s,{priority:"highest"}),a.on("remove",s,{priority:"highest"}),a.on("attribute",s,{priority:"highest"}),a.on("selection",s,{priority:"highest"});function s(){i.change(l=>{for(let f of r.values())l.removeClass(o,f),r.delete(f)})}})}var{Delete:He,DeleteCommand:Ve,Input:Ye,InsertTextCommand:Je,TextTransformation:Xe,TextWatcher:Ze,TwoStepCaretMovement:et,Typing:tt,TypingChangeBuffer:ot,_DeleteObserver:rt,findAttributeRange:nt,findAttributeRangeBound:it,getLastTextLine:st,inlineHighlight:at,__esMo
1dule:lt}=V;export{He as Delete,Ve as DeleteCommand,Ye as Input,Je as InsertTextCommand,Xe as TextTransformation,Ze as TextWatcher,et as TwoStepCaretMovement,tt as Typing,ot as TypingChangeBuffer,rt as _DeleteObserver,lt as __esModule,nt as findAttributeRange,it as findAttributeRangeBound,st as getLastTextLine,at as inlineHighlight}; 2/*! Bundled license information: 3 4@ckeditor/ckeditor5-typing/dist/index.js: 5 (** 6 * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved. 7 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 8 *) 9*/ 10//# sourceMappingURL=@ckeditor$ckeditor5-typing$dist$index.js.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.