1import{Accessibility as Vt,Command as It,CommandCollection as St,Context as Pt,ContextPlugin as Ct,EditingKeystrokeHandler as vt,Editor as Ot,ElementApiMixin as Bt,MultiCommand as Lt,PendingActions as Ft,Plugin as b,_DEFAULT_ACCESSIBILITY_GROUP_ID as Wt,_getEditorUsageData as Nt,attachToForm as jt,secureSourceElement as Ut}from"../../../frontend-editor-ckeditor-web/__liferay__/exports/@ckeditor$ckeditor5-core$dist$index.js.js";import{CKEditorError as qt,Collection as Kt,Config as $t,DOCUMENTATION_URL as Gt,DomEmitterMixin as v,ElementReplacer as Xt,EmitterMixin as Yt,EventInfo as J,FocusTracker as Qt,KeystrokeHandler as Jt,Locale as Zt,ObservableMixin as er,Rect as E,ResizeObserver as de,_clearTranslations as tr,_getEmitterId as rr,_getEmitterListenedTo as or,_getUserAgent as nr,_isAndroid as ir,_isBlink as sr,_isGecko as ar,_isMac as lr,_isMediaForcedColors as cr,_isMotionReduced as pr,_isRegExpUnicodePropertySupported as dr,_isSafari as fr,_isWindows as mr,_isiOS as gr,_setEmitterId as ur,_translate as hr,_unifyTranslations as xr,abortableDebounce as br,add as yr,areConnectedThroughProperties as wr,collectStylesheets as _r,compareArrays as Mr,count as Dr,crc32 as Er,createElement as Z,delay as ee,diff as Tr,diffToChanges as kr,env as h,exponentialDelay as Ar,fastDiff as Rr,findClosestScrollableAncestor as Vr,first as Ir,formatHtml as Sr,getAncestors as Pr,getBorderWidths as Cr,getCode as vr,getCommonAncestor as Or,getDataFromElement as Br,getEnvKeystrokeText as Lr,getLanguageDirection as Fr,getLocalizedArrowKeyCodeDirection as Wr,getOptimalPosition as Nr,getPositionedAncestor as jr,getRangeFromMouseEvent as fe,getVisualViewportOffset as Ur,global as g,indexOf as Hr,insertAt as zr,insertToPriorityArray as qr,isArrowKeyCode as Kr,isCombiningMark as $r,isComment as Gr,isForwardArrowKeyCode as Xr,isHighSurrogateHalf as Yr,isInsideCombinedSymbol as Qr,isInsideEmojiSequence as Jr,isInsideSurrogatePair as Zr,isIterable as eo,isLowSurrogateHalf as to,isNode as ro,isRange as oo,isText as no,isValidAttributeName as io,isViewWithFocusTracker as so,isVisible as ao,isWindow as lo,keyCodes as co,logError as po,logWarning as fo,mapsEqual as mo,nth as go,objectToMap as uo,parseBase64EncodedObject as ho,parseKeystroke as xo,priorities as bo,releaseDate as yo,remove as wo,retry as _o,scrollAncestorsToShowTarget as Mo,scrollViewportToShowTarget as Do,setDataInElement as Eo,spliceArray as To,spy as ko,toArray as Ao,toMap as Ro,toUnit as me,uid as te,ver
1sion as Vo,wait as Io}from"../../../frontend-editor-ckeditor-web/__liferay__/exports/@ckeditor$ckeditor5-utils$dist$index.js.js";import{AttributeOperation as Co,Batch as vo,BubblingEmitterMixin as Oo,BubblingEventInfo as Bo,ClickObserver as Lo,CompositionObserver as Fo,Conversion as Wo,ConversionHelpers as No,DataController as jo,Differ as Uo,DomEventObserver as ge,DowncastHelpers as Ho,EditingController as zo,EditingView as qo,FakeSelectionObserver as Ko,FocusObserver as $o,History as Go,HtmlDataProcessor as Xo,InputObserver as Yo,InsertOperation as Qo,KeyObserver as Jo,MarkerCollection as Zo,MarkerOperation as en,Matcher as tn,MergeOperation as rn,Model as on,ModelDocument as nn,ModelDocumentFragment as sn,ModelDocumentSelection as an,ModelElement as ln,ModelLivePosition as cn,ModelLiveRange as R,ModelNode as pn,ModelNodeList as dn,ModelPosition as fn,ModelRange as ue,ModelRootElement as mn,ModelSchemaContext as gn,ModelSelection as un,ModelText as hn,ModelTextProxy as xn,ModelTreeWalker as bn,ModelTypeCheckable as yn,ModelWriter as wn,MouseObserver as he,MoveOperation as _n,MutationObserver as Mn,NoOperation as Dn,Observer as En,OperationFactory as Tn,RenameOperation as kn,RootAttributeOperation as An,RootOperation as Rn,SelectionObserver as Vn,SplitOperation as In,StylesMap as Sn,StylesProcessor as Pn,TabObserver as Cn,TouchObserver as vn,UpcastHelpers as On,UpcastWriter as Bn,ViewAttributeElement as Ln,ViewContainerElement as Fn,ViewDataTransfer as xe,ViewDocument as Wn,ViewDocumentDomEventData as Nn,ViewDocumentFragment as jn,ViewDocumentSelection as Un,ViewDomConverter as Hn,ViewDowncastWriter as zn,ViewEditableElement as qn,ViewElement as Kn,ViewEmptyElement as $n,ViewNode as Gn,ViewPosition as Xn,ViewRange as Yn,ViewRawElement as Qn,ViewRenderer as Jn,ViewRootEditableElement as Zn,ViewSelection as ei,ViewText as ti,ViewTextProxy as ri,ViewTokenList as oi,ViewTreeWalker as ni,ViewTypeCheckable as ii,ViewUIElement as si,ViewUpcastWriter as ai,XmlDataProcessor as li,_DataProcessorBasicHtmlWriter as ci,_DetachOperation as pi,_MapperCache as di,_OperationReplayer as fi,_VIEW_BR_FILLER as mi,_VIEW_INLINE_FILLER as gi,_VIEW_INLINE_FILLER_LENGTH as ui,_VIEW_MARKED_NBSP_FILLER as hi,_VIEW_NBSP_FILLER as xi,_ViewElementConversionConsumables as bi,_autoParagraphEmptyModelRoots as yi,_convertMapToStringifiedObject as wi,_convertMapToTags as _i,_deleteModelContent as Mi,_downcastCleanSelection as Di,_downcastConvertCollapsedSelection as Ei,_downcastConvertRangeSelection as Ti,_downcastCreateViewElementFromDowncastHighlightDescriptor as ki,_downcastInsertAttributesAndChildren as Ai,_downcastInsertElement as Ri,_downcastInsertStructure as Vi,_downcastInsertText as Ii,_downcastInsertUIElement as Si,_downcastRemove as Pi,_downcastWrap as Ci,_dumpTrees as vi,_getDataWithoutViewFiller as Oi,_getModelData as Bi,_getModelNodeAfterPosition as Li,_getModelNodeBeforePosition as Fi,_getModelTextNodeAtPosition as Wi,_getSelectedModelContent as Ni,_getViewData as ji,_initDocumentDumping as Ui,_injectModelSelectionPostFixer as Hi,_injectViewQuirksHandling as zi,_injectViewUIElementHandling as qi,_insertIntoModelNodeList as Ki,_insertModelContent as $i,_insertModelObject as Gi,_isInlineViewFiller as Xi,_isParagraphableModelNode as Yi,_isViewPatternMatched as Qi,_logDocument as Ji,_mergeIntersectingModelRanges as Zi,_modifyModelSelection as es,_moveInModelNodeList as ts,_normalizeConversionConsumables as rs,_normalizeInModelNodeList as os,_operationTransform as ns,_parseModel as is,_parseView as ss,_removeFromModelNodeList as as,_setAttributeInModelNodeList as ls,_setModelData as cs,_setViewData as ps,_startsWithViewFiller as ds,_stringifyModel as fs,_stringifyView as ms,_tryFixingModelRange as gs,_upcastConvertSelectionChange as us,_upcastConvertText as hs,_upcastConvertToModelFragment as xs,_wrapInModelParagraph as bs,addBackgroundStylesRules as ys,addBorderStylesRules as ws,addMarginStylesRules as _s,addPaddingStylesRules as Ms,autoParagraphEmptyRoots as Ds,disableViewPlaceholder as Es,enableViewPlaceholder as Ts,getBoxSidesStyleShorthandValue as ks,getBoxSidesStyleValueReducer as As,getBoxSidesStyleValues as Rs,getPositionStyleShorthandNormalizer as Vs,getShorthandStylesValues as Is,getViewFillerOffset as Ss,hideViewPlaceholder as Ps,isAttachmentStyleValue as Cs,isColorStyleValue as vs,isLengthStyleValue as Os,isLineStyleValue as Bs,isParagraphable as Ls,isPercentageStyleValue as Fs,isPositionStyleValue as Ws,isRepeatStyleValue as Ns,isURLStyleValue as js,needsViewPlaceholder as Us,showViewPlaceholder as Hs,transformOperationSets as zs,wrapInParagraph as qs}from"../../../frontend-editor-ckeditor-web/__liferay__/exports/@ckeditor$ckeditor5-engine$dist$index.js.js";function O(t){return t}function B(t){return t==="__proto__"}function L(t){switch(typeof t){case"number":case"symbol":return!1;case"string":return t.includes(".")||t.includes("[")||t.includes("]")}}function F(t){return typeof t=="string"||typeof t=="symbol"?t:Object.is(t?.valueOf?.(),-0)?"-0":String(t)}function W(t){let e=[],o=t.length;if(o===0)return e;let r=0,n="",a="",i=!1;for(t.charCodeAt(0)===46&&(e.push(""),r++);r<o;){let s=t[r];a?s==="\\"&&r+1<o?(r++,n+=t[r]):s===a?a="":n+=s:i?s==='"'||s==="'"?a=s:s==="]"?(i=!1,e.push(n),n=""):n+=s:s==="["?(i=!0,n&&(e.push(n),n="")):s==="."?n&&(e.push(n),n=""):n+=s,r++}return n&&e.push(n),e}
1function V(t,e,o){if(t==null)return o;switch(typeof e){case"string":{if(B(e))return o;let r=t[e];return r===void 0?L(e)?V(t,W(e),o):o:r}case"number":case"symbol":{typeof e=="number"&&(e=F(e));let r=t[e];return r===void 0?o:r}default:{if(Array.isArray(e))return xt(t,e,o);if(Object.is(e?.valueOf(),-0)?e="-0":e=String(e),B(e))return o;let r=t[e];return r===void 0?o:r}}}function xt(t,e,o){if(e.length===0)return o;let r=t;for(let n=0;n<e.length;n++){if(r==null||B(e[n]))return o;r=r[e[n]]}return r===void 0?o:r}function be(t){return function(e){return V(e,t)}}function ye(t){return t!==null&&(typeof t=="object"||typeof t=="function")}function N(t){return t==null||typeof t!="object"&&typeof t!="function"}function re(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}function we(t,e,o){return typeof o!="function"?k(t,e):oe(t,e,function r(n,a,i,s,l,p){let c=o(n,a,i,s,l,p);return c!==void 0?!!c:oe(n,a,r,p)},new Map)}function oe(t,e,o,r){if(e===t)return!0;switch(typeof e){case"object":return bt(t,e,o,r);case"function":return Object.keys(e).length>0?oe(t,{...e},o,r):re(t,e);default:return ye(t)?typeof e=="string"?e==="":!0:re(t,e)}}function bt(t,e,o,r){if(e==null)return!0;if(Array.isArray(e))return _e(t,e,o,r);if(e instanceof Map)return yt(t,e,o,r);if(e instanceof Set)return wt(t,e,o,r);let n=Object.keys(e);if(t==null)return n.length===0;if(n.length===0)return!0;if(r&&r.has(e))return r.get(e)===t;r&&r.set(e,t);try{for(let a=0;a<n.length;a++){let i=n[a];if(!N(t)&&!(i in t)||e[i]===void 0&&t[i]!==void 0||e[i]===null&&t[i]!==null||!o(t[i],e[i],i,t,e,r))return!1}return!0}finally{r&&r.delete(e)}}function yt(t,e,o,r){if(e.size===0)return!0;if(!(t instanceof Map))return!1;for(let[n,a]of e.entries()){let i=t.get(n);if(o(i,a,n,t,e,r)===!1)return!1}return!0}function _e(t,e,o,r){if(e.length===0)return!0;if(!Array.isArray(t))return!1;let n=new Set;for(let a=0;a<e.length;a++){let i=e[a],s=!1;for(let l=0;l<t.length;l++){if(n.has(l))continue;let p=t[l],c=!1;if(o(p,i,a,t,e,r)&&(c=!0),c){n.add(l),s=!0;break}}if(!s)return!1}return!0}function wt(t,e,o,r){return e.size===0?!0:t instanceof Set?_e([...t],[...e],o,r):!1}function k(t,e){return we(t,e,()=>{})}function Me(t){return Object.getOwnPropertySymbols(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}function j(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}var De="[object RegExp]",U="[object String]",H="[object Number]",z="[object Boolean]",q="[object Arguments]",Ee="[object Symbol]",Te="[object Date]",ke="[object Map]",Ae="[object Set]",Re="[object Array]";var Ve="[object ArrayBuffer]",Ie="[object Object]";var Se="[object DataView]",Pe="[object Uint8Array]",Ce="[object Uint8ClampedArray]",ve="[object Uint16Array]",Oe="[object Uint32Array]";var Be="[object Int8Array]",Le="[object Int16Array]",Fe="[object Int32Array]";var We="[object Float32Array]",Ne="[object Float64Array]";function je(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Ue(t,e){return w(t,void 0,t,new Map,e)}function w(t,e,o,r=new Map,n=void 0){let a=n?.(t,e,o,r);if(a!=null)return a;
1if(N(t))return t;if(r.has(t))return r.get(t);if(Array.isArray(t)){let i=new Array(t.length);r.set(t,i);for(let s=0;s<t.length;s++)i[s]=w(t[s],s,o,r,n);return Object.hasOwn(t,"index")&&(i.index=t.index),Object.hasOwn(t,"input")&&(i.input=t.input),i}if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp){let i=new RegExp(t.source,t.flags);return i.lastIndex=t.lastIndex,i}if(t instanceof Map){let i=new Map;r.set(t,i);for(let[s,l]of t)i.set(s,w(l,s,o,r,n));return i}if(t instanceof Set){let i=new Set;r.set(t,i);for(let s of t)i.add(w(s,void 0,o,r,n));return i}if(typeof Buffer<"u"&&Buffer.isBuffer(t))return t.subarray();if(je(t)){let i=new(Object.getPrototypeOf(t)).constructor(t.length);r.set(t,i);for(let s=0;s<t.length;s++)i[s]=w(t[s],s,o,r,n);return i}if(t instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer)return t.slice(0);if(t instanceof DataView){let i=new DataView(t.buffer.slice(0),t.byteOffset,t.byteLength);return r.set(t,i),y(i,t,o,r,n),i}if(typeof File<"u"&&t instanceof File){let i=new File([t],t.name,{type:t.type});return r.set(t,i),y(i,t,o,r,n),i}if(t instanceof Blob){let i=new Blob([t],{type:t.type});return r.set(t,i),y(i,t,o,r,n),i}if(t instanceof Error){let i=new t.constructor;return r.set(t,i),i.message=t.message,i.name=t.name,i.stack=t.stack,i.cause=t.cause,y(i,t,o,r,n),i}if(typeof t=="object"&&_t(t)){let i=Object.create(Object.getPrototypeOf(t));return r.set(t,i),y(i,t,o,r,n),i}return t}function y(t,e,o=t,r,n){let a=[...Object.keys(e),...Me(e)];for(let i=0;i<a.length;i++){let s=a[i],l=Object.getOwnPropertyDescriptor(t,s);(l==null||l.writable)&&(t[s]=w(e[s],s,o,r,n))}}function _t(t){switch(j(t)){case q:case Re:case Ve:case Se:case z:case Te:case We:case Ne:case Be:case Le:case Fe:case ke:case H:case Ie:case De:case Ae:case U:case Ee:case Pe:case Ce:case ve:case Oe:return!0;default:return!1}}function He(t){return w(t,void 0,t,new Map,void 0)}function ze(t){return t=He(t),e=>k(e,t)}function qe(t,e){return Ue(t,(o,r,n,a)=>{let i=e?.(o,r,n,a);if(i!=null)return i;if(typeof t=="object")switch(Object.prototype.toString.call(t)){case H:case U:case z:{let s=new t.constructor(t?.valueOf());return y(s,t),s}case q:{let s={};return y(s,t),s.length=t.length,s[Symbol.iterator]=t[Symbol.iterator],s}default:return}})}function Ke(t){return qe(t)}var Mt=/^(?:0|[1-9]\d*)$/;function $e(t,e=Number.MAX_SAFE_INTEGER){switch(typeof t){case"number":return Number.isInteger(t)&&t>=0&&t<e;case"symbol":return!1;case"string":return Mt.test(t)}}function Ge(t){return t!==null&&typeof t=="object"&&j(t)==="[object Arguments]"}function Xe(t,e){let o;if(Array.isArray(e)?o=e:typeof e=="string"&&L(e)&&t?.[e]==null?o=W(e):o=[e],o.length===0)return!1;let r=t;for(let n=0;n<o.length;n++){let a=o[n];if((r==null||!Object.hasOwn(r,a))&&!((Array.isArray(r)||Ge(r))&&$e(a)&&a<r.length))return!1;r=r[a]}return!0}function Ye(t,e){switch(typeof t){case"object":{Object.is(t?.valueOf(),-0)&&(t="-0");break}case"number":{t=F(t);break}}return e=Ke(e),function(o){let r=V(o,t);return r===void 0?Xe(o,t):e===void 0?r===void 0:k(r,e)}}function Qe(t){if(t==null)return O;switch(typeof t){case"function":return t;case"object":return Array.isArray(t)&&t.length===2?Ye(t[0],t[1]):ze(t);case"string":case"symbol":case"number":return be(t)}}function Je(t,e,{signal:o,edges:r}={}){let n,a=null,i=r!=null&&r.includes("leading"),s=r==null||r.includes("trailing"),l=()=>{a!==null&&(t.apply(n,a),n=void 0,a=null)},p=()=>{s&&l(),m()},c=null,d=()=>{c!=null&&clearTimeout(c),c=setTimeout(()=>{c=null,p()},e)},f=()=>{c!==null&&(clearTimeout(c),c=null)},m=()=>{f(),n=void 0,a=null},u=()=>{f(),l()},x=function(...C){if(o?.aborted)return;n=this,a=C;let T=c==null;d(),i&&T&&l()};return x.schedule=d,x.cancel=m,x.flush=u,o?.addEventListener("abort",m,{once:!0}),x}function Ze(t,e=0,o={}){typeof o!="object"&&(o={});let{leading:r=!1,trailing:n=!0,maxWait:a}=o,i=Array(2);r&&(i[0]="leading"),n&&(i[1]="trailing");let s,l=null,p=Je(function(...f){s=t.apply(this,f),l=null},e,{edges:i}),c=function(...f){return a!=null&&(l===null&&(l=Date.now()),Date.now()-l>=a)?(s=t.apply(this,f),l=Date.now(),p.cancel(),p.schedule(),s):(p.apply(this,f),s)},d=()=>(p.flush(),s);return c.cancel=p.cancel,c.flush=d,c}function K(t,e=0,o={}){typeof o!="object"&&(o={});let{leading:r=!0,trailing:n=!0}=o;return Ze(t,e,{leading:r,trailing:n,maxWait:e})}function et(t,e){let o={},r=Object.keys(t);for(let n=0;n<r.length;n++){let a=r[n],i=t[a];o[a]=e(i,a,t)}return o}function ne(t,e=O){return t==null?{}:et(t,Qe(e))}import{WIDGET_CLASS_NAME as gl,WIDGET_SELECTED_CLASS_NAME as ul,Widget as tt,WidgetHighlightStack as hl,WidgetResize as xl,WidgetResizeState as bl,WidgetResizer as yl,WidgetToolbarRepository as wl,WidgetTypeAround as _l,_WIDGET_TYPE_AROUND_SELECTION_ATTRIBUTE as Ml,_WidgetSizeView as Dl,_getClosestWidgetTypeAroundDomButton as El,_getClosestWidgetViewElement as Tl,_getWidgetTypeAroundButtonPosition as kl,_getWidgetTypeAroundFakeCaretPosition as Al,calculateResizeHostAncestorWidth as Rl,calculateResizeHostPercentageWidth as Vl,findOptimalInsertionRange as Il,getLabel as Sl,isTypeAroundWidget as Pl,isWidget as A,setHighlightHandling as Cl,setLabel as vl,toWidget as Ol,toWidgetEditable as Bl,verticalWidget
1NavigationHandler as Ll,viewToModelPositionOutsideModelElement as Fl}from"../../../frontend-editor-ckeditor-web/__liferay__/exports/@ckeditor$ckeditor5-widget$dist$index.js.js";import{AccessibilityHelp as jl,AccessibilityHelpContentView as Ul,AriaLiveAnnouncer as Hl,AriaLiveAnnouncerPoliteness as zl,AriaLiveAnnouncerRegionView as ql,AriaLiveAnnouncerView as Kl,AutocompleteView as $l,Badge as Gl,BalloonPanelView as Xl,BalloonToolbar as Yl,BlockButtonView as Ql,BlockToolbar as Jl,BodyCollection as Zl,BoxedEditorUIView as ec,ButtonLabelView as tc,ButtonLabelWithHighlightView as rc,ButtonView as oc,CollapsibleView as nc,ColorGridView as ic,ColorGridsFragmentView as sc,ColorPickerFragmentView as ac,ColorPickerInputRowView as lc,ColorPickerView as cc,ColorSelectorView as pc,ColorTileView as dc,ComponentFactory as fc,ContextualBalloon as mc,CssTransitionDisablerMixin as gc,DefaultMenuBarItems as uc,Dialog as hc,DialogActionsView as xc,DialogContentView as bc,DialogView as yc,DialogViewPosition as wc,DocumentColorCollection as _c,DraggableViewMixin as Mc,DropdownButtonView as Dc,DropdownMenuButtonView as Ec,DropdownMenuListItemButtonView as Tc,DropdownMenuListItemView as kc,DropdownMenuListView as Ac,DropdownMenuNestedMenuPanelView as Rc,DropdownMenuNestedMenuView as Vc,DropdownMenuPanelPositioningFunctions as Ic,DropdownMenuRootListView as Sc,DropdownPanelView as Pc,DropdownView as Cc,EditableUIView as vc,EditorUI as Oc,EditorUIView as Bc,EvaluationBadge as Lc,FileDialogButtonView as Fc,FileDialogListItemButtonView as Wc,FileDialogViewMixin as Nc,FocusCycler as jc,FormHeaderView as Uc,FormRowView as Hc,HighlightedTextView as zc,IconView as qc,IframeView as Kc,InlineEditableUIView as $c,InputBase as Gc,InputNumberView as Xc,InputTextView as Yc,InputView as Qc,ItemsView as Jc,LabelView as Zc,LabelWithHighlightView as ep,LabeledFieldView as tp,LabeledInputView as rp,ListItemButtonView as op,ListItemGroupView as np,ListItemView as ip,ListSeparatorView as sp,ListView as ap,MenuBarMenuButtonView as lp,MenuBarMenuListItemButtonView as cp,MenuBarMenuListItemFileDialogButtonView as pp,MenuBarMenuListItemView as dp,MenuBarMenuListView as fp,MenuBarMenuPanelView as mp,MenuBarMenuView as gp,MenuBarView as up,NESTED_TOOLBAR_ICONS as hp,Notification as xp,PoweredBy as bp,SearchInfoView as yp,SearchResultsView as wp,SearchTextView as _p,SliderView as Mp,SpinnerView as Dp,SplitButtonView as Ep,StickyPanelView as Tp,SwitchButtonView as kp,Template as Ap,TextareaView as Rp,ToolbarLineBreakView as Vp,ToolbarSeparatorView as Ip,ToolbarView as Sp,TooltipManager as Pp,UIModel as Cp,View as rt,ViewCollection as vp,ViewModel as Op,_CheckIconHolderView as Bp,_CollapsibleView as Lp,_ContextualBalloonRotatorView as Fp,_DropdownMenuBehaviors as Wp,_DropdownRootMenuBehaviors as Np,_MenuBarBehaviors as jp,_MenuBarMenuBehaviors as Up,_MenuBarMenuViewPanelPositioningFunctions as Hp,_SearchInfoView as zp,_SearchTextQueryView as qp,_TemplateBinding as Kp,_TemplateIfBinding as $p,_TemplateToBinding as Gp,_convertColor as Xp,_convertColorToHex as Yp,_preventUiViewDefault as Qp,_processMenuBarConfig as Jp,_registerCustomElement as Zp,_tryNormalizeHexColor as ed,addKeyboardHandlingForGrid as td,addListToDropdown as rd,addMenuToDropdown as od,addToolbarToDropdown as nd,clickOutsideHandler as id,createDropdown as sd,createLabeledDropdown as ad,createLabeledInputNumber as ld,createLabeledInputText as cd,createLabeledTextarea as pd,filterGroupAndItemNames as dd,focusChildOnDropdownOpen as fd,getLocalizedColorOptions as md,isFocusable as gd,isViewWithFocusCycler as ud,normalizeColorOptions as hd,normalizeMenuBarConfig as xd,normalizeSingleColorDefinition as bd,normalizeToolbarConfig as yd,submitHandler as wd}from"../../../frontend-editor-ckeditor-web/__liferay__/exports/@ckeditor$ckeditor5-ui$dist$index.js.js";var M=class extends ge{domEventType=["paste","copy","cut","drop","dragover","dragstart","dragend","dragenter","dragleave"];constructor(e){super(e);let o=this.document;this.listenTo(o,"paste",r("clipboardInput"),{priority:"low"}),this.listenTo(o,"drop",r("clipboardInput"),{priority:"low"}),this.listenTo(o,"dragover",r("dragging"),{priority:"low"});function r(n){return(a,i)=>{i.preventDefault();let s=i.dropRange?[i.dropRange]:null,l=new J(o,n);o.fire(l,{dataTransfer:i.dataTransfer,method:a.name,targetRanges:s,target:i.target,domEvent:i.domEvent}),l.stop.called&&i.stopPropagation()}}}onDomEvent(e){let o="clipboardData"in e?e.clipboardData:e.dataTransfer,r=e.type=="drop"||e.type=="paste",n={dataTransfer:new xe(o,{cacheFiles:r})};if(e.type=="drop"||e.type=="dragover"){let a=fe(e);n.dropRange=a&&this.view.domConverter.domRangeToView(a)}this.fire(e.type,e,n)}};function ct(t){return t=t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/\r?\n\r?\n/g,"</p><p>").replace(/\r?\n/g,"<br>").replace(/\t/g," ").replace(/^\s/," ").replace(/\s$/," ").replace(/\s\s/g," "),(t.includes("</p><p>")||t.includes("<br>"))&&(t=`<p>${t}</p>`),t}function pt(t){return t.replace(/<span(?: class="Apple-converted-s
1pace"|)>(\s+)<\/span>/g,(e,o)=>o.length==1?" ":o).replace(/<!--[\s\S]*?-->/g,"")}var ot=["figcaption","li"],nt=["ol","ul"];function ae(t,e){if(e.is("$text")||e.is("$textProxy"))return e.data;if(e.is("element","img")&&e.hasAttribute("alt"))return e.getAttribute("alt");if(e.is("element","br"))return` 2`;let o="",r=null;for(let n of e.getChildren())o+=Dt(n,r)+ae(t,n),r=n;if(e.is("rawElement")){let a=document.implementation.createHTMLDocument("").createElement("div");e.render(a,t),o+=dt(a)}return o}function dt(t){let e="";if(t.nodeType===Node.TEXT_NODE)return t.textContent;if(t.tagName==="BR")return` 3`;for(let o of t.childNodes)e+=dt(o);return e}function Dt(t,e){return e?t.is("element","li")&&!t.isEmpty&&t.getChild(0).is("containerElement")||nt.includes(t.name)&&nt.includes(e.name)?` 4 5`:!t.is("containerElement")&&!e.is("containerElement")?"":ot.includes(t.name)||ot.includes(e.name)?` 6`:t.is("element")&&t.getCustomProperty("dataPipeline:transparentRendering")||e.is("element")&&e.getCustomProperty("dataPipeline:transparentRendering")?"":` 7 8`:""}var I=class extends b{_markersToCopy=new Map;static get pluginName(){return"ClipboardMarkersUtils"}static get isOfficialPlugin(){return!0}_registerMarkerToCopy(e,o){this._markersToCopy.set(e,o)}_copySelectedFragmentWithMarkers(e,o,r=n=>n.model.getSelectedContent(n.model.document.selection)){return this.editor.model.change(n=>{let a=n.model.document.selection;n.setSelection(o);let i=this._insertFakeMarkersIntoSelection(n,n.model.document.selection,e),s=r(n),l=this._removeFakeMarkersInsideElement(n,s);for(let[p,c]of Object.entries(i)){l[p]||=n.createRangeIn(s);for(let d of c)n.remove(d)}s.markers.clear();for(let[p,c]of Object.entries(l))s.markers.set(p,c);return n.setSelection(a),s})}_pasteMarkersIntoTransformedElement(e,o){let r=this._getPasteMarkersFromRangeMap(e);return this.editor.model.change(n=>{let a=this._insertFakeMarkersElements(n,r),i=o(n),s=this._removeFakeMarkersInsideElement(n,i);for(let l of Object.values(a).flat())n.remove(l);for(let[l,p]of Object.entries(s))n.model.markers.has(l)||n.addMarker(l,{usingOperation:!0,affectsData:!0,range:p});return i})}_pasteFragmentWithMarkers(e){let o=this._getPasteMarkersFromRangeMap(e.markers);e.markers.clear();for(let r of o)e.markers.set(r.name,r.range);return this.editor.model.insertContent(e)}_forceMarkersCopy(e,o,r={allowedActions:"all",copyPartiallySelected:!0,duplicateOnPaste:!0}){let n=this._markersToCopy.get(e);this._markersToCopy.set(e,r),o(),n?this._markersToCopy.set(e,n):this._markersToCopy.delete(e)}_isMarkerCopyable(e,o){let r=this._getMarkerClipboardConfig(e);if(!r)return!1;if(!o)return!0;let{allowedActions:n}=r;return n==="all"||n.includes(o)}_hasMarkerConfiguration(e){return!!this._getMarkerClipboardConfig(e)}_getMarkerClipboardConfig(e){let[o]=e.split(":");return this._markersToCopy.get(o)||null}_insertFakeMarkersIntoSelection(e,o,r){let n=this._getCopyableMarkersFromSelection(e,o,r);return this._insertFakeMarkersElements(e,n)}_getCopyableMarkersFromSelection(e,o,r){let n=Array.from(o.getRanges()),a=new Set(n.flatMap(s=>Array.from(e.model.markers.getMarkersIntersectingRange(s)))),i=s=>{if(!this._isMarkerCopyable(s.name,r))return!1;let{copyPartiallySelected:p}=this._getMarkerClipboardConfig(s.name);if(!p){let c=s.getRange();return n.some(d=>d.containsRange(c,!0))}return!0};return Array.from(a).filter(i).map(s=>({name:r==="dragstart"?this._getUniqueMarkerName(s.name):s.name,range:s.getRange()}))}_getPasteMarkersFromRangeMap(e,o=null){let{model:r}=this.editor;return(e instanceof Map?Array.from(e.entries()):Object.entries(e)).flatMap(([a,i])=>{if(!this._hasMarkerConfiguration(a))return[{name:a,range:i}];if(this._isMarkerCopyable(a,o)){let s=this._getMarkerClipboardConfig(a),l=r.markers.has(a)&&r.markers.get(a).getRange().root.rootName==="$graveyard";return(s.duplicateOnPaste||l)&&(a=this._getUniqueMarkerName(a)),[{name:a,range:i}]}return[]})}_insertFakeMarkersElements(e,o){let r={},n=o.flatMap(a=>{let{start:i,end:s}=a.range;return[{position:i,marker:a,type:"start"},{position:s,marker:a,type:"end"}]}).sort(({position:a},{position:i})=>a.isBefore(i)?1:-1);for(let{position:a,marker:i,type:s}of n){let l=e.createElement("$marker",{"data-name":i.name,"data-type":s});r[i.name]||(r[i.name]=[]),r[i.name].push(l),e.insert(l,a)}return r}_removeFakeMarkersInsideElement(e,o){let n=this._getAllFakeMarkersFromElement(e,o).reduce((a,i)=>{let s=i.markerElement&&e.createPositionBefore(i.markerElement),l=a[i.name],p=!1;return l?.start&&l?.end&&(this._getMarkerClipboardConfig(i.name).duplicateOnPaste?a[this._getUniqueMarkerName(i.name)]=a[i.name]:p=!0,l=null),p||(a[i.name]={...l,[i.type]:s}),i.markerElement&&e.remove(i.markerElement),a},{});return ne(n,a=>new ue(a.start||e.createPositionFromPath(o,[0]),a.end||e.createPositionAt(o,"end")))}_getAllFakeMarkersFromElement(e,o){let r=Array.from(e.createRangeIn(o)).flatMap(({item:i})=>{if(!i.is("element","$marker"))return[];let s=i.getAttribute("data-name"),l=i.getAttribute("data-type");return[{markerElement:i,name:s,type:l}]}),n=[],a=[];for(let i of r)i.type==="end"&&(r.some(l=>l.name===i.name&&l.type==="start")||n.push({markerElement:null,name:i.name,type:"start"})),i.type==="start"&&(r.some(l=>l.name===i.name&&l.type==="end")||a.unshift({markerElement:null,name:i.name,type:"end"}));return[...n,...r,...a]}_getUniqueMarkerName(e){let o=e.split(":"),r=te().substring(1,6);return o.length===3?`${o.slice(0,2).join(":")}:${r}`:`${o.join(":")}:${r}`}},D=class extends b{static get pluginName(){return"ClipboardPipeline"}static get isOfficialPlugin(){return!0}static get requires(){return[I]}init(){this.editor.editing.view.addObserver(M),this._setupPasteDrop(),this._setupCopyCut()}_fireOutputTransformationEvent(e,o,r){let n=this.editor.plugins.get("ClipboardMarkersUtils");this.editor.model.enqueueChange({isUndoable:r==="cut"},()=>{let a=n._copySelectedFragmentWithMarkers(r,o);this.fire("outputTransformation",{dataTransfer:e,content:a,method:r})})}_setupPasteDrop(){let e=this.editor,o=e.model,r=e.editing.view,n=r.document,a=this.editor.plugins.get("ClipboardMarkersUtils");this.listenTo(n,"clipboardInput",(i,s)=>{s.method=="paste"&&!e.model.canEditAt(e.model.document.selection)&&i.stop()},{priority:"highest"}),this.listenTo(n,"clipboardInput",(i,s)=>{let l=s.dataTransfer,p;if(s.content)p=s.content;else{let f="";
8l.getData("text/html")?f=pt(l.getData("text/html")):l.getData("text/plain")&&(f=ct(l.getData("text/plain"))),p=this.editor.data.htmlProcessor.toView(f)}let c=new J(this,"inputTransformation"),d=l.getData("application/ckeditor5-editor-id")||null;this.fire(c,{content:p,dataTransfer:l,sourceEditorId:d,targetRanges:s.targetRanges,method:s.method}),c.stop.called&&i.stop(),r.scrollToTheSelection()},{priority:"low"}),this.listenTo(this,"inputTransformation",(i,s)=>{if(s.content.isEmpty)return;let p=this.editor.data.toModel(s.content,"$clipboardHolder");p.childCount!=0&&(i.stop(),o.change(()=>{this.fire("contentInsertion",{content:p,method:s.method,sourceEditorId:s.sourceEditorId,dataTransfer:s.dataTransfer,targetRanges:s.targetRanges})}))},{priority:"low"}),this.listenTo(this,"contentInsertion",(i,s)=>{s.resultRange=a._pasteFragmentWithMarkers(s.content)},{priority:"low"})}_setupCopyCut(){let e=this.editor,o=e.model.document,n=e.editing.view.document,a=(i,s)=>{let l=s.dataTransfer;s.preventDefault(),this._fireOutputTransformationEvent(l,o.selection,i.name)};this.listenTo(n,"copy",a,{priority:"low"}),this.listenTo(n,"cut",(i,s)=>{e.model.canEditAt(e.model.document.selection)?a(i,s):s.preventDefault()},{priority:"low"}),this.listenTo(this,"outputTransformation",(i,s)=>{let l=e.data.toView(s.content,{isClipboardPipeline:!0});n.fire("clipboardOutput",{dataTransfer:s.dataTransfer,content:l,method:s.method})},{priority:"low"}),this.listenTo(n,"clipboardOutput",(i,s)=>{s.content.isEmpty||(s.dataTransfer.setData("text/html",this.editor.data.htmlProcessor.toData(s.content)),s.dataTransfer.setData("text/plain",ae(e.data.htmlProcessor.domConverter,s.content)),s.dataTransfer.setData("application/ckeditor5-editor-id",this.editor.id)),s.method=="cut"&&e.model.deleteContent(o.selection)},{priority:"low"})}},ie=me("px"),G=class extends rt{constructor(){super();let e=this.bindTemplate;this.set({isVisible:!1,left:null,top:null,width:null}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-clipboard-drop-target-line",e.if("isVisible","ck-hidden",o=>!o)],style:{left:e.to("left",o=>ie(o)),top:e.to("top",o=>ie(o)),width:e.to("width",o=>ie(o))}}})}},_=class extends b{removeDropMarkerDelayed=ee(()=>this.removeDropMarker(),40);_updateDropMarkerThrottled=K(e=>this._updateDropMarker(e),40);_reconvertMarkerThrottled=K(()=>{this.editor.model.markers.has("drop-target")&&this.editor.editing.reconvertMarker("drop-target")},0);_dropTargetLineView=new G;_domEmitter=new(v());_scrollables=new Map;static get pluginName(){return"DragDropTarget"}static get isOfficialPlugin(){return!0}init(){this._setupDropMarker()}destroy(){this._domEmitter.stopListening();for(let{resizeObserver:e}of this._scrollables.values())e.destroy();return this._updateDropMarkerThrottled.cancel(),this.removeDropMarkerDelayed.cancel(),this._reconvertMarkerThrottled.cancel(),super.destroy()}updateDropMarker(e,o,r,n,a,i){this.removeDropMarkerDelayed.cancel();let s=it(this.editor,e,o,r,n,a,i);if(s){if(i&&i.containsRange(s))return this.removeDropMarker();this._updateDropMarkerThrottled(s)}}getFinalDropRange(e,o,r,n,a,i){let s=it(this.editor,e,o,r,n,a,i);return this.removeDropMarker(),s}removeDropMarker(){let e=this.editor.model;this.removeDropMarkerDelayed.cancel(),this._updateDropMarkerThrottled.cancel(),this._dropTargetLineView.isVisible=!1,e.markers.has("drop-target")&&e.change(o=>{o.removeMarker("drop-target")})}_setupDropMarker(){let e=this.editor;e.ui.view.body.add(this._dropTargetLineView),e.conversion.for("editingDowncast").markerToHighlight({model:"drop-target",view:{classes:["ck-clipboard-drop-target-range"]}}),e.conversion.for("editingDowncast").markerToElement({model:"drop-target",view:(o,{writer:r})=>{if(e.model.schema.checkChild(o.markerRange.start,"$text"))return this._dropTargetLineView.isVisible=!1,this._createDropTargetPosition(r);o.markerRange.isCollapsed?this._updateDropTargetLine(o.markerRange):this._dropTargetLineView.isVisible=!1}})}_updateDropMarker(e){let o=this.editor,r=o.model.markers;o.model.change(n=>{r.has("drop-target")?r.get("drop-target").getRange().isEqual(e)||n.updateMarker("drop-target",{range:e}):n.addMarker("drop-target",{range:e,usingOperation:!1,affectsData:!1})})}_createDropTargetPosition(e){return e.createUIElement("span",{class:"ck ck-clipboard-drop-target-position"},function(o){let r=this.toDomElement(o);return r.append("\u2060",o.createElement("span"),"\u2060"),r})}_updateDropTargetLine(e){let o=this.editor.editing,r=e.start.nodeBefore,n=e.start.nodeAfter,a=e.start.parent,i=r?o.mapper.toViewElement(r):null,s=i?o.view.domConverter.mapViewToDom(i):null,l=n?o.mapper.toViewElement(n):null,p=l?o.view.domConverter.mapViewToDom(l):null,c=o.mapper.toViewElement(a);if(!c)return;let d=o.view.domConverter.mapViewToDom(c),f=this._getScrollableRect(c),{scrollX:m,scrollY:u}=g.window,x=s?new E(s):null,C=p?new E(p):null,T=new E(d).excludeScrollbarsAndBorders(),le=x?x.bottom:T.top,Y=C?C.top:T.bottom,ce=g.window.getComputedStyle(d),Q=le<=Y?(le+Y)/2:Y;if(f.top<Q&&Q<f.bottom){let gt=T.left+parseFloat(ce.paddingLeft),ut=T.right-parseFloat(ce.paddingRight),pe=M
8ath.max(gt+m,f.left),ht=Math.min(ut+m,f.right);this._dropTargetLineView.set({isVisible:!0,left:pe,top:Q+u,width:ht-pe})}else this._dropTargetLineView.isVisible=!1}_getScrollableRect(e){let o=e.root.rootName,r;if(this._scrollables.has(o))r=this._scrollables.get(o).domElement;else{let n=this.editor.editing.view.domConverter.mapViewToDom(e);r=Tt(n),this._domEmitter.listenTo(r,"scroll",this._reconvertMarkerThrottled,{usePassive:!0});let a=new de(r,this._reconvertMarkerThrottled);this._scrollables.set(o,{domElement:r,resizeObserver:a})}return new E(r).excludeScrollbarsAndBorders()}};function it(t,e,o,r,n,a,i){let s=t.model,l=t.editing.mapper,c=st(t,e);for(;c;){if(!a){if(s.schema.checkChild(c,"$text")){if(o){let d=o[0].start,f=l.toModelPosition(d);if(!i||Array.from(i.getItems({shallow:!0})).every(u=>s.schema.checkChild(f,u))){if(s.schema.checkChild(f,"$text"))return s.createRange(f);if(d)return $(t,st(t,d.parent),r,n)}}}else if(s.schema.isInline(c))return $(t,c,r,n)}if(s.schema.isBlock(c))return $(t,c,r,n);if(s.schema.checkChild(c,"$block")){let d=Array.from(c.getChildren()).filter(u=>u.is("element")&&!Et(t,u)),f=0,m=d.length;if(m==0)return s.createRange(s.createPositionAt(c,"end"));for(;f<m-1;){let u=Math.floor((f+m)/2);ft(t,d[u],r,n)=="before"?m=u:f=u}return $(t,d[f],r,n)}c=c.parent}return null}function Et(t,e){let o=t.editing.mapper,r=t.editing.view.domConverter,n=o.toViewElement(e);if(!n)return!0;let a=r.mapViewToDom(n);return g.window.getComputedStyle(a).float!="none"}function $(t,e,o,r){let n=t.model;return n.createRange(n.createPositionAt(e,ft(t,e,o,r)))}function ft(t,e,o,r){let n=t.editing.mapper,a=t.editing.view.domConverter,i=n.toViewElement(e),s=a.mapViewToDom(i),l=new E(s);return t.model.schema.isInline(e)?o<(l.left+l.right)/2?"before":"after":r<(l.top+l.bottom)/2?"before":"after"}function st(t,e){let o=t.editing.mapper,r=t.editing.view,n=o.toModelElement(e);if(n)return n;let a=r.createPositionBefore(e),i=o.findMappedViewAncestor(a);return o.toModelElement(i)}function Tt(t){let e=t;do{e=e.parentElement;let o=g.window.getComputedStyle(e).overflowY;if(o=="auto"||o=="scroll")break}while(e.tagName!="BODY");return e}var S=class extends b{_isBlockDragging=!1;_domEmitter=new(v());static get pluginName(){return"DragDropBlockToolbar"}static get isOfficialPlugin(){return!0}init(){let e=this.editor;if(this.listenTo(e,"change:isReadOnly",(o,r,n)=>{n?(this.forceDisabled("readOnlyMode"),this._isBlockDragging=!1):this.clearForceDisabled("readOnlyMode")}),h.isAndroid&&this.forceDisabled("noAndroidSupport"),e.plugins.has("BlockToolbar")){let r=e.plugins.get("BlockToolbar").buttonView.element;this._domEmitter.listenTo(r,"dragstart",(n,a)=>this._handleBlockDragStart(a)),this._domEmitter.listenTo(g.document,"dragover",(n,a)=>this._handleBlockDragging(a)),this._domEmitter.listenTo(g.document,"drop",(n,a)=>this._handleBlockDragging(a)),this._domEmitter.listenTo(g.document,"dragend",()=>this._handleBlockDragEnd(),{useCapture:!0}),this.isEnabled&&r.setAttribute("draggable","true"),this.on("change:isEnabled",(n,a,i)=>{r.setAttribute("draggable",i?"true":"false")})}}destroy(){return this._domEmitter.stopListening(),super.destroy()}_handleBlockDragStart(e){if(!this.isEnabled)return;let o=this.editor.model,r=o.document.selection,n=this.editor.editing.view,a=Array.from(r.getSelectedBlocks()),i=o.createRange(o.createPositionBefore(a[0]),o.createPositionAfter(a[a.length-1]));o.change(s=>s.setSelection(i)),this._isBlockDragging=!0,n.focus(),n.getObserver(M).onDomEvent(e)}_handleBlockDragging(e){if(!this.isEnabled||!this._isBlockDragging)return;let o=e.clientX+(this.editor.locale.contentLanguageDirection=="ltr"?100:-100),r=e.clientY,n=document.elementFromPoint(o,r),a=this.editor.editing.view;!n||!n.closest(".ck-editor__editable")||a.getObserver(M).onDomEvent({...e,type:e.type,dataTransfer:e.dataTransfer,target:n,clientX:o,clientY:r,preventDefault:()=>e.preventDefault(),stopPropagation:()=>e.stopPropagation()})}_handleBlockDragEnd(){this._isBlockDragging=!1}},P=class extends b{_draggedRange;_draggingUid;_draggableElement;_clearDraggableAttributesDelayed=ee(()=>this._clearDraggableAttributes(),40);_blockMode=!1;_domEmitter=new(v());_previewContainer;static get pluginName(){return"DragDrop"}static get isOfficialPlugin(){return!0}static get requires(){return[D,tt,_,S]}init(){let e=this.editor,o=e.editing.view;this._draggedRange=null,this._draggingUid="",this._draggableElement=null,o.addObserver(M),o.addObserver(he),this._setupDragging(),this._setupContentInsertionIntegration(),this._setupClipboardInputIntegration(),this._setupDraggableAttributeHandling(),this.listenTo(e,"change:isReadOnly",(r,n,a)=>{a?this.forceDisabled("readOnlyMode"):this.clearForceDisabled("readOnlyMode")}),this.on("change:isEnabled",(r,n,a)=>{a||this._finalizeDragging(!1)}),h.isAndroid&&this.forceDisabled("noAndroidSupport")}destroy(){return this._draggedRange&&(this._draggedRange.detach(),this._draggedRange=null),this._previewContainer&&this._previewContainer.remove(),this._domEmitter.stopListening(),this._clearDraggableAttributesDelayed.cancel(),super.destroy()}_setupDragging(){let e=this.editor,o=e.model,r=e.editing.view,n=r.document,a=e.plugins.get(_);this.listenTo(n,"dragstart",(i,s)=>{if(s.target?.is("editableElement")){s.preventDefault();return}if(this._prepareDraggedRange(s.target),!this._draggedRange){s.preventDefault();return}this._draggingUid=te(),s.dataTransfer.effectAllowed=this.isEnabled?"copyMove":"copy",s.dataTransfer.setData("application/ckeditor5-dragging-uid",this._draggingUid);let l=o.createSelection(this._draggedRange.toRange());this.editor.plugins.get("ClipboardPipeline")._fireOutputTransformationEvent(s.dataTransfer,l,"dragstart");let{dataTransfer:c,domTarget:d,domEvent:f}=s,{clientX:m}=f;this._updatePreview({dataTransfer:c,domTarget:d,clientX:m}),s.stopPropagation(),this.isEnabled||(this._draggedRange.detach(),this._draggedRange=null,this._draggingUid="")},{priority:"low"}),this.listenTo(n,"dragend",(i,s)=>{this._finalizeDragging(!s.dataTransfer.isCanceled&&s.dataTransfer.dropEffect=="move")},{priority:"low"}),this._domEmitter.listenTo(g.document,"dragend",()=>{this._blockMode=!1},{useCapture:!0}),this.listenTo(n,"dragenter",()=>{this.isEnabled&&r.focus()}),this.listenTo(n,"dragleave",()=>{a.removeDropMarkerDelayed()}),this.listenTo(n,"dragging",(i,s)=>{if(!this.isEnabled){s.dataTransfer.dropEffect="none";return}let{clientX:l,clientY:p}=s.domEvent;a.updateDropMarker(s.target,s.targetRanges,l,p,this._blockMode,this._draggedRange),this._draggedRange||(s.dataTransfer.dropEffect="copy"),h.isGecko||(s.dataTransfer.effectAllowed=="copy"?s.dataTransfer.dropEffect="copy":["all","copyMove"].includes(s.dataTransfer.effectAllowed)&&(s.dataTransfer.dropEffect="move")),i.stop()},{priority:"low"})}_setupClipboardInputIntegration(){let e=this.editor,r=e.editing.view.document,n=e.plugins.get(_);this.listenTo(r,"clipboardInput",(a,i)=>{if(i.method!="drop")return;let{clientX:s,clientY:l}=i.domEvent,p=n.getFinalDropRange(i.target,i.targetRanges,s,l,this._blockMode,this._draggedRange);
8if(!p){this._finalizeDragging(!1),a.stop();return}if(this._draggedRange&&this._draggingUid!=i.dataTransfer.getData("application/ckeditor5-dragging-uid")&&(this._draggedRange.detach(),this._draggedRange=null,this._draggingUid=""),at(i.dataTransfer)=="move"&&this._draggedRange&&this._draggedRange.containsRange(p,!0)){this._finalizeDragging(!1),a.stop();return}i.targetRanges=[e.editing.mapper.toViewRange(p)]},{priority:"high"})}_setupContentInsertionIntegration(){let e=this.editor.plugins.get(D);e.on("contentInsertion",(o,r)=>{if(!this.isEnabled||r.method!=="drop")return;let n=r.targetRanges.map(a=>this.editor.editing.mapper.toModelRange(a));this.editor.model.change(a=>a.setSelection(n))},{priority:"high"}),e.on("contentInsertion",(o,r)=>{if(!this.isEnabled||r.method!=="drop")return;let n=at(r.dataTransfer)=="move",a=!r.resultRange||!r.resultRange.isCollapsed;this._finalizeDragging(a&&n)},{priority:"lowest"})}_setupDraggableAttributeHandling(){let e=this.editor,o=e.editing.view,r=o.document;this.listenTo(r,"mousedown",(n,a)=>{if(h.isAndroid||!a)return;this._clearDraggableAttributesDelayed.cancel();let i=lt(a.target);if(h.isBlink&&!e.isReadOnly&&!i&&!r.selection.isCollapsed){let s=r.selection.getSelectedElement();(!s||!A(s))&&(i=r.selection.editableElement)}i&&(o.change(s=>{s.setAttribute("draggable","true",i)}),this._draggableElement=e.editing.mapper.toModelElement(i))}),this.listenTo(r,"mouseup",()=>{h.isAndroid||this._clearDraggableAttributesDelayed()})}_clearDraggableAttributes(){let e=this.editor.editing;e.view.change(o=>{this._draggableElement&&this._draggableElement.root.rootName!="$graveyard"&&o.removeAttribute("draggable",e.mapper.toViewElement(this._draggableElement)),this._draggableElement=null})}_finalizeDragging(e){let o=this.editor,r=o.model;o.plugins.get(_).removeDropMarker(),this._clearDraggableAttributes(),o.plugins.has("WidgetToolbarRepository")&&o.plugins.get("WidgetToolbarRepository").clearForceDisabled("dragDrop"),this._draggingUid="",this._previewContainer&&(this._previewContainer.remove(),this._previewContainer=void 0),this._draggedRange&&(e&&this.isEnabled&&r.change(a=>{let i=r.createSelection(this._draggedRange);r.deleteContent(i,{doNotAutoparagraph:!0});let s=i.getFirstPosition().parent;s.isEmpty&&!r.schema.checkChild(s,"$text")&&r.schema.checkChild(s,"paragraph")&&a.insertElement("paragraph",s,0)}),this._draggedRange.detach(),this._draggedRange=null)}_prepareDraggedRange(e){let o=this.editor,r=o.model,n=r.document.selection,a=e?lt(e):null;if(a){let p=o.editing.mapper.toModelElement(a);this._draggedRange=R.fromRange(r.createRangeOn(p)),this._blockMode=r.schema.isBlock(p),o.plugins.has("WidgetToolbarRepository")&&o.plugins.get("WidgetToolbarRepository").forceDisabled("dragDrop");return}if(n.isCollapsed&&!n.getFirstPosition().parent.isEmpty)return;let i=Array.from(n.getSelectedBlocks()),s=n.getFirstRange();if(i.length==0){this._draggedRange=R.fromRange(s);return}let l=mt(r,i);if(i.length>1)this._draggedRange=R.fromRange(l),this._blockMode=!0;else if(i.length==1){let p=s.start.isTouching(l.start)&&s.end.isTouching(l.end);this._draggedRange=R.fromRange(p?l:s),this._blockMode=p}r.change(p=>p.setSelection(this._draggedRange.toRange()))}_updatePreview({dataTransfer:e,domTarget:o,clientX:r}){let n=this.editor.editing.view,a=n.document.selection.editableElement,i=n.domConverter.mapViewToDom(a),s=g.window.getComputedStyle(i);this._previewContainer?this._previewContainer.firstElementChild&&this._previewContainer.removeChild(this._previewContainer.firstElementChild):(this._previewContainer=Z(g.document,"div",{style:"position: fixed; left: -999999px;"}),g.document.body.appendChild(this._previewContainer));let l=new E(i);if(i.contains(o))return;let p=parseFloat(s.paddingLeft),c=Z(g.document,"div");c.className="ck ck-content",c.style.width=s.width,c.style.paddingLeft=`${l.left-r+p}px`,h.isiOS&&(c.style.backgroundColor="white"),n.domConverter.setContentOf(c,e.getData("text/html")),e.setDragImage(c,0,0),this._previewContainer.appendChild(c)}};function at(t){return h.isGecko?t.dropEffect:["all","copyMove"].includes(t.effectAllowed)?"move":"copy"}function lt(t){if(t.is("editableElement"))return null;
8if(t.hasClass("ck-widget__selection-handle"))return t.findAncestor(A);if(A(t))return t;let e=t.findAncestor(o=>A(o)||o.is("editableElement"));return A(e)?e:null}function mt(t,e){let o=e[0],r=e[e.length-1],n=o.getCommonAncestor(r),a=t.createPositionBefore(o),i=t.createPositionAfter(r);if(n&&n.is("element")&&!t.schema.isLimit(n)){let s=t.createRangeOn(n),l=a.isTouching(s.start),p=i.isTouching(s.end);if(l&&p)return mt(t,[n])}return t.createRange(a,i)}var X=class extends b{static get pluginName(){return"PastePlainText"}static get isOfficialPlugin(){return!0}static get requires(){return[D]}init(){let e=this.editor,o=e.model,r=e.editing.view,n=o.document.selection;r.addObserver(M),e.plugins.get(D).on("contentInsertion",(a,i)=>{kt(i.content,o)&&o.change(s=>{let l=Array.from(n.getAttributes()).filter(([c])=>o.schema.getAttributeProperties(c).isFormatting);n.isCollapsed||o.deleteContent(n,{doNotAutoparagraph:!0}),l.push(...n.getAttributes());let p=s.createRangeIn(i.content);for(let c of p.getItems())for(let d of l)o.schema.checkAttribute(c,d[0])&&s.setAttribute(d[0],d[1],c)})})}};function kt(t,e){let o=e.createRangeIn(t);if(t.childCount==1){let r=t.getChild(0);r.is("element")&&e.schema.isBlock(r)&&!e.schema.isObject(r)&&!e.schema.isLimit(r)&&(o=e.createRangeIn(r))}for(let r of o.getItems())if(!e.schema.isInline(r)||Array.from(r.getAttributeKeys()).find(a=>e.schema.getAttributeProperties(a).isFormatting))return!1;return!0}var se=class extends b{static get pluginName(){return"Clipboard"}static get isOfficialPlugin(){return!0}static get requires(){return[I,D,P,X]}init(){let e=this.editor,o=this.editor.t;e.accessibility.addKeystrokeInfos({keystrokes:[{label:o("Copy selected content"),keystroke:"CTRL+C"},{label:o("Paste content"),keystroke:"CTRL+V"},{label:o("Paste content as plain text"),keystroke:"CTRL+SHIFT+V"}]})}};export{se as Clipboard,I as ClipboardMarkersUtils,M as ClipboardObserver,D as ClipboardPipeline,P as DragDrop,S as DragDropBlockToolbar,_ as DragDropTarget,X as PastePlainText,G as _ClipboardLineVie
8w,P as _DragDrop,S as _DragDropBlockToolbar,_ as _DragDropTarget,pt as _normalizeClipboardData,ct as plainTextToHtml,ae as viewToPlainText}; 9/*! Bundled license information: 10 11@ckeditor/ckeditor5-clipboard/dist/index.js: 12 (** 13 * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved. 14 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options 15 *) 16 (* istanbul ignore next -- @preserve *) 17*/ 18//# sourceMappingURL=@ckeditor$ckeditor5-clipboard$dist$index.js.(KGQWZFTR).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.