golden-logic-ui 1.0.178 → 1.0.180
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/golden-logic-ui.js
CHANGED
|
@@ -59010,9 +59010,17 @@ const XJ = { class: "font-bold ptext-lg dark:text-white" }, ZJ = ["id"], JJ = /*
|
|
|
59010
59010
|
bb(async () => {
|
|
59011
59011
|
await DG(), YJ.init({
|
|
59012
59012
|
selector: "#" + Ve.field_name,
|
|
59013
|
-
|
|
59014
|
-
|
|
59015
|
-
|
|
59013
|
+
height: 500,
|
|
59014
|
+
plugins: [
|
|
59015
|
+
"advlist autolink lists link image charmap print preview anchor",
|
|
59016
|
+
"searchreplace visualblocks codesample fullscreen",
|
|
59017
|
+
"insertdatetime media table paste help wordcount"
|
|
59018
|
+
],
|
|
59019
|
+
toolbar: "undo redo | codesample | formatselect | bold italic backcolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | removeformat | help",
|
|
59020
|
+
skin: !1,
|
|
59021
|
+
// disable import of skins
|
|
59022
|
+
content_css: !1,
|
|
59023
|
+
// disable import of css
|
|
59016
59024
|
setup(ft) {
|
|
59017
59025
|
qe = ft, ft.on("Change", () => {
|
|
59018
59026
|
Pe("update:modelValue", ft.getContent());
|
|
@@ -92,5 +92,5 @@ The conflicting element is`+(us(P.element)?" ":" not ")+"already in the DOM")},d
|
|
|
92
92
|
`+(Ce.altsource?'<source src="'+Ce.altsource+'"'+(Ce.altsourcemime?' type="'+Ce.altsourcemime+'"':"")+` />
|
|
93
93
|
`:"")+"</video>",re=(Ce,be)=>{var mt;const Tt=Ie.extend({},be);if(!Tt.source&&(Ie.extend(Tt,Rt((mt=Tt.embed)!==null&&mt!==void 0?mt:"",Ce.schema)),!Tt.source))return"";Tt.altsource||(Tt.altsource=""),Tt.poster||(Tt.poster=""),Tt.source=Ce.convertURL(Tt.source,"source"),Tt.altsource=Ce.convertURL(Tt.altsource,"source"),Tt.sourcemime=we(Tt.source),Tt.altsourcemime=we(Tt.altsource),Tt.poster=Ce.convertURL(Tt.poster,"poster");const Yn=so(Tt.source);if(Yn&&(Tt.source=Yn.url,Tt.type=Yn.type,Tt.allowfullscreen=Yn.allowFullscreen,Tt.width=Tt.width||String(Yn.w),Tt.height=Tt.height||String(Yn.h)),Tt.embed)return po(Tt.embed,Tt,!0,Ce.schema);{const lo=Pn(Ce),Go=Et(Ce),Xs=W(Ce);return Tt.width=Tt.width||"300",Tt.height=Tt.height||"150",Ie.each(Tt,(Fe,Ao)=>{Tt[Ao]=Ce.dom.encode(""+Fe)}),Tt.type==="iframe"?le(Tt,Xs):Tt.sourcemime==="application/x-shockwave-flash"?Ne(Tt):Tt.sourcemime.indexOf("audio")!==-1?ke(Tt,lo):Y(Tt,Go)}},xe=Ce=>Ce.hasAttribute("data-mce-object")||Ce.hasAttribute("data-ephox-embed-iri"),Se=Ce=>{Ce.on("click keyup touchend",()=>{const be=Ce.selection.getNode();be&&Ce.dom.hasClass(be,"mce-preview-object")&&Ce.dom.getAttrib(be,"data-mce-selected")&&be.setAttribute("data-mce-selected","2")}),Ce.on("ObjectResized",be=>{const mt=be.target;if(mt.getAttribute("data-mce-object")){let Tt=mt.getAttribute("data-mce-html");Tt&&(Tt=unescape(Tt),mt.setAttribute("data-mce-html",escape(po(Tt,{width:String(be.width),height:String(be.height)},!1,Ce.schema))))}})},$e={},G=(Ce,be,mt)=>new Promise((Tt,Yn)=>{const lo=Go=>(Go.html&&($e[Ce.source]=Go),Tt({url:Ce.source,html:Go.html?Go.html:be(Ce)}));$e[Ce.source]?lo($e[Ce.source]):mt({url:Ce.source},lo,Yn)}),Ee=(Ce,be)=>Promise.resolve({html:be(Ce),url:Ce.source}),ze=Ce=>be=>re(Ce,be),Mt=(Ce,be)=>{const mt=St(Ce);return mt?G(be,ze(Ce),mt):Ee(be,ze(Ce))},Nn=Ce=>Dt($e,Ce),Rn=(Ce,be)=>it(be,Ce).bind(mt=>it(mt,"meta")),Wn=(Ce,be,mt)=>Tt=>{const Yn=()=>it(Ce,Tt),lo=()=>it(be,Tt),Go=Ao=>it(Ao,"value").bind(ve=>ve.length>0?dt.some(ve):dt.none()),Xs=()=>Yn().bind(Ao=>oe(Ao)?Go(Ao).orThunk(lo):lo().orThunk(()=>dt.from(Ao))),Fe=()=>lo().orThunk(()=>Yn().bind(Ao=>oe(Ao)?Go(Ao):dt.from(Ao)));return{[Tt]:(Tt===mt?Xs():Fe()).getOr("")}},zn=(Ce,be)=>{const mt={};return it(Ce,"dimensions").each(Tt=>{wn(["width","height"],Yn=>{it(be,Yn).orThunk(()=>it(Tt,Yn)).each(lo=>mt[Yn]=lo)})}),mt},Do=(Ce,be)=>{const mt=be&&be!=="dimensions"?Rn(be,Ce).getOr({}):{},Tt=Wn(Ce,mt,be);return{...Tt("source"),...Tt("altsource"),...Tt("poster"),...Tt("embed"),...zn(Ce,mt)}},Xe=Ce=>{const be={...Ce,source:{value:it(Ce,"source").getOr("")},altsource:{value:it(Ce,"altsource").getOr("")},poster:{value:it(Ce,"poster").getOr("")}};return wn(["width","height"],mt=>{it(Ce,mt).each(Tt=>{const Yn=be.dimensions||{};Yn[mt]=Tt,be.dimensions=Yn})}),be},lt=Ce=>be=>{const mt=be&&be.msg?"Media embed handler error: "+be.msg:"Media embed handler threw unknown error.";Ce.notificationManager.open({type:"error",text:mt})},At=Ce=>{const be=Ce.selection.getNode(),mt=xe(be)?Ce.serializer.serialize(be,{selection:!0}):"",Tt=Rt(mt,Ce.schema),lo=(()=>{if(vo(Tt.source,Tt.type)){const Go=Ce.dom.getRect(be);return{width:Go.w.toString().replace(/px$/,""),height:Go.h.toString().replace(/px$/,"")}}else return{}})();return{embed:mt,...Tt,...lo}},Ft=(Ce,be)=>mt=>{if(Re(mt.url)&&mt.url.trim().length>0){const Tt=mt.html,lo={...Rt(Tt,be.schema),source:mt.url,embed:Tt};Ce.setData(Xe(lo))}},$n=(Ce,be)=>{const mt=Ce.dom.select("*[data-mce-object]");for(let Tt=0;Tt<be.length;Tt++)for(let Yn=mt.length-1;Yn>=0;Yn--)be[Tt]===mt[Yn]&&mt.splice(Yn,1);Ce.selection.select(mt[0])},xo=(Ce,be)=>{const mt=Ce.dom.select("*[data-mce-object]");Ce.insertContent(be),$n(Ce,mt),Ce.nodeChanged()},vo=(Ce,be)=>Ye(be)&&be==="ephox-embed-iri"&&Ye(so(Ce)),fs=(Ce,be)=>((Tt,Yn)=>Tt.width!==Yn.width||Tt.height!==Yn.height)(Ce,be)&&vo(be.source,Ce.type),Bo=(Ce,be,mt)=>{var Tt;be.embed=fs(Ce,be)&&Zn(mt)?re(mt,{...be,embed:""}):po((Tt=be.embed)!==null&&Tt!==void 0?Tt:"",be,!1,mt.schema),be.embed&&(Ce.source===be.source||Nn(be.source))?xo(mt,be.embed):Mt(mt,be).then(Yn=>{xo(mt,Yn.html)}).catch(lt(mt))},Es=Ce=>{const be=At(Ce),mt=Qt(be),Tt=Xe(be),Yn=(Kn,Xn)=>{const fo=Do(Xn.getData(),"source");Kn.source!==fo.source&&(Ft(qn,Ce)({url:fo.source,html:""}),Mt(Ce,fo).then(Ft(qn,Ce)).catch(lt(Ce)))},lo=Kn=>{var Xn;const fo=Do(Kn.getData()),rs=Rt((Xn=fo.embed)!==null&&Xn!==void 0?Xn:"",Ce.schema);Kn.setData(Xe(rs))},Go=(Kn,Xn,fo)=>{const rs=Do(Kn.getData(),Xn),js=fs(fo,rs)&&Zn(Ce)?{...rs,embed:""}:rs,Fa=re(Ce,js);Kn.setData(Xe({...js,embed:Fa}))},Xs=[{name:"source",type:"urlinput",filetype:"media",label:"Source",picker_text:"Browse files"}],Fe=Zn(Ce)?[{type:"sizeinput",name:"dimensions",label:"Constrain proportions",constrain:!0}]:[],Ao={title:"General",name:"general",items:Yt([Xs,Fe])},Be={title:"Embed",items:[{type:"textarea",name:"embed",label:"Paste your embed code below:"}]},It=[];Ue(Ce)&&It.push({name:"altsource",type:"urlinput",filetype:"media",label:"Alternative source URL"}),ce(Ce)&&It.push({name:"poster",type:"urlinput",filetype:"image",label:"Media poster (Image URL)"});const Xt={title:"Advanced",name:"advanced",items:It},En=[Ao,Be];It.length>0&&En.push(Xt);const no={type:"tabpanel",tabs:En},qn=Ce.windowManager.open({title:"Insert/Edit Media",size:"normal",body:no,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:Kn=>{const Xn=Do(Kn.getData());Bo(mt.get(),Xn,Ce),Kn.close()},onChange:(Kn,Xn)=>{switch(Xn.name){case"source":Yn(mt.get(),Kn);break;case"embed":lo(Kn);break;case"dimensions":case"altsource":case"poster":Go(Kn,Xn.name,mt.get());break}mt.set(Do(Kn.getData()))},initialData:Tt})},Kt=Ce=>({showDialog:()=>{Es(Ce)}}),Vo=Ce=>{const be=()=>{Es(Ce)};Ce.addCommand("mceMedia",be)},tr=(Ce,be,mt)=>Ce.length>=be.length&&Ce.substr(mt,mt+be.length)===be,Vr=(Ce,be)=>tr(Ce,be,0);var Rr=tinymce.util.Tools.resolve("tinymce.Env");const kr=Ce=>{const be=Ce.name;return be==="iframe"||be==="video"||be==="audio"},Cs=(Ce,be,mt,Tt=null)=>{const Yn=Ce.attr(mt);return Ye(Yn)?Yn:Dt(be,mt)?null:Tt},zr=(Ce,be,mt)=>{const Tt=be.name==="img"||Ce.name==="video",Yn=Tt?"300":null,lo=Ce.name==="audio"?"30":"150",Go=Tt?lo:null;be.attr({width:Cs(Ce,mt,"width",Yn),height:Cs(Ce,mt,"height",Go)})},Qr=(Ce,be,mt,Tt)=>{const Yn=Qe(Ce.schema).parse(Tt,{context:be});for(;Yn.firstChild;)mt.append(Yn.firstChild)},Ts=(Ce,be)=>{const mt=be.name,Tt=new Nt("img",1);return ur(Ce,be,Tt),zr(be,Tt,{}),Tt.attr({style:be.attr("style"),src:Rr.transparentSrc,"data-mce-object":mt,class:"mce-object mce-object-"+mt}),Tt},ao=(Ce,be)=>{var mt;const Tt=be.name,Yn=new Nt("span",1);Yn.attr({contentEditable:"false",style:be.attr("style"),"data-mce-object":Tt,class:"mce-preview-object mce-object-"+Tt}),ur(Ce,be,Yn);const lo=Ce.dom.parseStyle((mt=be.attr("style"))!==null&&mt!==void 0?mt:""),Go=new Nt(Tt,1);if(zr(be,Go,lo),Go.attr({src:be.attr("src"),style:be.attr("style"),class:be.attr("class")}),Tt==="iframe")Go.attr({allowfullscreen:be.attr("allowfullscreen"),frameborder:"0",sandbox:be.attr("sandbox")});else{wn(["controls","crossorigin","currentTime","loop","muted","poster","preload"],ve=>{Go.attr(ve,be.attr(ve))});const Ao=Yn.attr("data-mce-html");Ye(Ao)&&Qr(Ce,Tt,Go,unescape(Ao))}const Xs=new Nt("span",1);return Xs.attr("class","mce-shim"),Yn.append(Go),Yn.append(Xs),Yn},ur=(Ce,be,mt)=>{var Tt;const Yn=(Tt=be.attributes)!==null&&Tt!==void 0?Tt:[];let lo=Yn.length;for(;lo--;){const Ao=Yn[lo].name;let ve=Yn[lo].value;Ao!=="width"&&Ao!=="height"&&Ao!=="style"&&!Vr(Ao,"data-mce-")&&((Ao==="data"||Ao==="src")&&(ve=Ce.convertURL(ve,Ao)),mt.attr("data-mce-p-"+Ao,ve))}const Go=bn({inner:!0},Ce.schema),Xs=new Nt("div",1);wn(be.children(),Ao=>Xs.append(Ao));const Fe=Go.serialize(Xs);Fe&&(mt.attr("data-mce-html",escape(Fe)),mt.empty())},Je=Ce=>{const be=Ce.attr("class");return Re(be)&&/\btiny-pageembed\b/.test(be)},bt=Ce=>{let be=Ce;for(;be=be.parent;)if(be.attr("data-ephox-embed-iri")||Je(be))return!0;return!1},yn=Ce=>be=>{let mt=be.length,Tt;for(;mt--;)Tt=be[mt],Tt.parent&&(Tt.parent.attr("data-mce-object")||(kr(Tt)&&Ut(Ce)?bt(Tt)||Tt.replace(ao(Ce,Tt)):bt(Tt)||Tt.replace(Ts(Ce,Tt))))},Mn=(Ce,be,mt)=>{const Tt=Ce.options.get,Yn=Tt("xss_sanitization"),lo=cn(Ce);return Qe(Ce.schema,{sanitize:Yn,validate:lo}).parse(mt,{context:be})},To=Ce=>{Ce.on("PreInit",()=>{const{schema:be,serializer:mt,parser:Tt}=Ce,Yn=be.getBoolAttrs();wn("webkitallowfullscreen mozallowfullscreen".split(" "),lo=>{Yn[lo]={}}),st({embed:["wmode"]},(lo,Go)=>{const Xs=be.getElementRule(Go);Xs&&wn(lo,Fe=>{Xs.attributes[Fe]={},Xs.attributesOrder.push(Fe)})}),Tt.addNodeFilter("iframe,video,audio,object,embed",yn(Ce)),mt.addAttributeFilter("data-mce-object",(lo,Go)=>{var Xs;let Fe=lo.length;for(;Fe--;){const Ao=lo[Fe];if(!Ao.parent)continue;const ve=Ao.attr(Go),Be=new Nt(ve,1);if(ve!=="audio"){const no=Ao.attr("class");no&&no.indexOf("mce-preview-object")!==-1&&Ao.firstChild?Be.attr({width:Ao.firstChild.attr("width"),height:Ao.firstChild.attr("height")}):Be.attr({width:Ao.attr("width"),height:Ao.attr("height")})}Be.attr({style:Ao.attr("style")});const It=(Xs=Ao.attributes)!==null&&Xs!==void 0?Xs:[];let Xt=It.length;for(;Xt--;){const no=It[Xt].name;no.indexOf("data-mce-p-")===0&&Be.attr(no.substr(11),It[Xt].value)}const En=Ao.attr("data-mce-html");if(En){const no=Mn(Ce,ve,unescape(En));wn(no.children(),qn=>Be.append(qn))}Ao.replace(Be)}})}),Ce.on("SetContent",()=>{const be=Ce.dom;wn(be.select("span.mce-preview-object"),mt=>{be.select("span.mce-shim",mt).length===0&&be.add(mt,"span",{class:"mce-shim"})})})},is=Ce=>{Ce.on("ResolveName",be=>{let mt;be.target.nodeType===1&&(mt=be.target.getAttribute("data-mce-object"))&&(be.name=mt)})},Hr=Ce=>be=>{const mt=()=>{be.setEnabled(Ce.selection.isEditable())};return Ce.on("NodeChange",mt),mt(),()=>{Ce.off("NodeChange",mt)}},Ur=Ce=>{const be=()=>Ce.execCommand("mceMedia");Ce.ui.registry.addToggleButton("media",{tooltip:"Insert/edit media",icon:"embed",onAction:be,onSetup:mt=>{const Tt=Ce.selection;mt.setActive(xe(Tt.getNode()));const Yn=Tt.selectorChangedWithUnbind("img[data-mce-object],span[data-mce-object],div[data-ephox-embed-iri]",mt.setActive).unbind,lo=Hr(Ce)(mt);return()=>{Yn(),lo()}}}),Ce.ui.registry.addMenuItem("media",{icon:"embed",text:"Media...",onAction:be,onSetup:Hr(Ce)})};var pr=()=>{I.add("media",Ce=>(at(Ce),Vo(Ce),Ur(Ce),is(Ce),To(Ce),Se(Ce),Kt(Ce)))};pr()}(),function(){const I=ve=>{let Be=ve;return{get:()=>Be,set:En=>{Be=En}}};var _e=tinymce.util.Tools.resolve("tinymce.PluginManager");const ie=(ve,Be,It)=>{var Xt;return It(ve,Be.prototype)?!0:((Xt=ve.constructor)===null||Xt===void 0?void 0:Xt.name)===Be.name},He=ve=>{const Be=typeof ve;return ve===null?"null":Be==="object"&&Array.isArray(ve)?"array":Be==="object"&&ie(ve,String,(It,Xt)=>Xt.isPrototypeOf(It))?"string":Be},Re=ve=>Be=>He(Be)===ve,oe=ve=>Be=>typeof Be===ve,qe=Re("string"),te=Re("array"),Ye=oe("boolean"),dt=ve=>ve==null,Jt=ve=>!dt(ve),wn=oe("number"),Yt=()=>{},Qt=ve=>()=>ve,Wt=Qt(!0),st=Qt("[~№|!-*+-\\/:;?@\\[-`{}¡«·»¿;·՚-՟։֊־׀׃׆׳״؉؊،؍؛؞؟٪-٭۔܀-܍߷-߹࠰-࠾࡞।॥॰෴๏๚๛༄-༒༺-༽྅࿐-࿔࿙࿚၊-၏჻፡-፨᐀᙭᙮᚛᚜᛫-᛭᜵᜶។-៖៘-៚᠀-᠊᥄᥅᨞᨟᪠-᪦᪨-᪭᭚-᭠᯼-᯿᰻-᰿᱾᱿᳓‐-‧‰-⁃⁅-⁑⁓-⁞⁽⁾₍₎〈〉❨-❵⟅⟆⟦-⟯⦃-⦘⧘-⧛⧼⧽⳹-⳼⳾⳿⵰⸀-⸮⸰⸱、-〃〈-】〔-〟〰〽゠・꓾꓿꘍-꘏꙳꙾꛲-꛷꡴-꡷꣎꣏꣸-꣺꤮꤯꥟꧁-꧍꧞꧟꩜-꩟꫞꫟꯫﴾﴿︐-︙︰-﹒﹔-﹡﹣﹨﹪﹫!-#%-*,-/:;?@[-]_{}⦅-・]");class it{constructor(Be,It){this.tag=Be,this.value=It}static some(Be){return new it(!0,Be)}static none(){return it.singletonNone}fold(Be,It){return this.tag?It(this.value):Be()}isSome(){return this.tag}isNone(){return!this.tag}map(Be){return this.tag?it.some(Be(this.value)):it.none()}bind(Be){return this.tag?Be(this.value):it.none()}exists(Be){return this.tag&&Be(this.value)}forall(Be){return!this.tag||Be(this.value)}filter(Be){return!this.tag||Be(this.value)?this:it.none()}getOr(Be){return this.tag?this.value:Be}or(Be){return this.tag?this:Be}getOrThunk(Be){return this.tag?this.value:Be()}orThunk(Be){return this.tag?this:Be()}getOrDie(Be){if(this.tag)return this.value;throw new Error(Be??"Called getOrDie on None")}static from(Be){return Jt(Be)?it.some(Be):it.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(Be){this.tag&&Be(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}it.singletonNone=new it(!1);const Dt=st;var q=tinymce.util.Tools.resolve("tinymce.Env"),at=tinymce.util.Tools.resolve("tinymce.util.Tools");const Pn=Array.prototype.slice,Et=Array.prototype.push,W=(ve,Be)=>{const It=ve.length,Xt=new Array(It);for(let En=0;En<It;En++){const no=ve[En];Xt[En]=Be(no,En)}return Xt},Ut=(ve,Be)=>{for(let It=0,Xt=ve.length;It<Xt;It++){const En=ve[It];Be(En,It)}},cn=(ve,Be)=>{for(let It=ve.length-1;It>=0;It--){const Xt=ve[It];Be(Xt,It)}},St=(ve,Be)=>{if(ve.length===0)return[];{let It=Be(ve[0]);const Xt=[];let En=[];for(let no=0,qn=ve.length;no<qn;no++){const Kn=ve[no],Xn=Be(Kn);Xn!==It&&(Xt.push(En),En=[]),It=Xn,En.push(Kn)}return En.length!==0&&Xt.push(En),Xt}},Ue=(ve,Be,It)=>(Ut(ve,(Xt,En)=>{It=Be(It,Xt,En)}),It),ce=ve=>{const Be=[];for(let It=0,Xt=ve.length;It<Xt;++It){if(!te(ve[It]))throw new Error("Arr.flatten item "+It+" was not an array, input: "+ve);Et.apply(Be,ve[It])}return Be},Zn=(ve,Be)=>ce(W(ve,Be)),Ie=(ve,Be)=>{const It=Pn.call(ve,0);return It.sort(Be),It},pe=Object.hasOwnProperty,S=(ve,Be)=>pe.call(ve,Be);typeof window<"u"||Function("return this;")();const je=9,me=11,kt=1,Rt=3,we=ve=>ve.dom.nodeType,bn=(ve=>Be=>we(Be)===ve)(Rt),Qe=(ve,Be,It)=>{if(qe(It)||Ye(It)||wn(It))ve.setAttribute(Be,It+"");else throw console.error("Invalid call to Attribute.set. Key ",Be,":: Value ",It,":: Element ",ve),new Error("Attribute value was not simple")},Zt=(ve,Be,It)=>{Qe(ve.dom,Be,It)},Oe=(ve,Be)=>{const Xt=(Be||document).createElement("div");if(Xt.innerHTML=ve,!Xt.hasChildNodes()||Xt.childNodes.length>1){const En="HTML does not have a single root node";throw console.error(En,ve),new Error(En)}return po(Xt.childNodes[0])},ot=(ve,Be)=>{const Xt=(Be||document).createElement(ve);return po(Xt)},F=(ve,Be)=>{const Xt=(Be||document).createTextNode(ve);return po(Xt)},po=ve=>{if(ve==null)throw new Error("Node cannot be null or undefined");return{dom:ve}},Pt={fromHtml:Oe,fromTag:ot,fromText:F,fromDom:po,fromPoint:(ve,Be,It)=>it.from(ve.dom.elementFromPoint(Be,It)).map(po)},an=ve=>ve.nodeType!==kt&&ve.nodeType!==je&&ve.nodeType!==me||ve.childElementCount===0,so=(ve,Be)=>{const It=Be===void 0?document:Be.dom;return an(It)?[]:W(It.querySelectorAll(ve),Pt.fromDom)},le=ve=>it.from(ve.dom.parentNode).map(Pt.fromDom),Ne=ve=>W(ve.dom.childNodes,Pt.fromDom),ke=(ve,Be)=>({element:ve,offset:Be}),Y=(ve,Be)=>{const It=Ne(ve);return It.length>0&&Be<It.length?ke(It[Be],0):ke(ve,Be)},re=(ve,Be)=>{le(ve).each(Xt=>{Xt.dom.insertBefore(Be.dom,ve.dom)})},xe=(ve,Be)=>{ve.dom.appendChild(Be.dom)},Se=(ve,Be)=>{re(ve,Be),xe(Be,ve)},G=((ve,Be)=>{const It=no=>{if(!ve(no))throw new Error("Can only get "+Be+" value of a "+Be+" node");return Xt(no).getOr("")},Xt=no=>ve(no)?it.from(no.dom.nodeValue):it.none();return{get:It,getOption:Xt,set:(no,qn)=>{if(!ve(no))throw new Error("Can only set raw "+Be+" value of a "+Be+" node");no.dom.nodeValue=qn}}})(bn,"text"),Ee=ve=>G.get(ve),ze=(ve,Be,It)=>(ve.compareDocumentPosition(Be)&It)!==0,Mt=(ve,Be)=>ze(ve,Be,Node.DOCUMENT_POSITION_PRECEDING),Nn=(ve,Be)=>so(Be,ve);var Rn=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker");const Wn=(ve,Be)=>ve.isBlock(Be)||S(ve.schema.getVoidElements(),Be.nodeName),zn=(ve,Be)=>!ve.isEditable(Be),Do=(ve,Be)=>ve.getContentEditable(Be)==="true"&&Be.parentNode&&!ve.isEditable(Be.parentNode),Xe=(ve,Be)=>!ve.isBlock(Be)&&S(ve.schema.getWhitespaceElements(),Be.nodeName),lt=(ve,Be)=>Wn(ve,Be)||zn(ve,Be)||Xe(ve,Be)||Do(ve,Be),At=ve=>ve.nodeType===3,Ft=()=>({sOffset:0,fOffset:0,elements:[]}),$n=(ve,Be)=>Y(Pt.fromDom(ve),Be),xo=(ve,Be,It,Xt,En,no=!0)=>{let qn=no?Be(!1):It;for(;qn;){const Kn=zn(ve,qn);if(Kn||Xe(ve,qn)){if(Kn?Xt.cef(qn):Xt.boundary(qn))break;qn=Be(!0);continue}else if(Wn(ve,qn)){if(Xt.boundary(qn))break}else At(qn)&&Xt.text(qn);if(qn===En)break;qn=Be(!1)}},vo=(ve,Be,It,Xt,En)=>{var no;if(lt(ve,It))return;const qn=(no=ve.getParent(Xt,ve.isBlock))!==null&&no!==void 0?no:ve.getRoot(),Kn=new Rn(It,qn),Xn=En?Kn.next.bind(Kn):Kn.prev.bind(Kn);xo(ve,Xn,It,{boundary:Wt,cef:Wt,text:fo=>{En?Be.fOffset+=fo.length:Be.sOffset+=fo.length,Be.elements.push(Pt.fromDom(fo))}})},fs=(ve,Be,It,Xt,En,no=!0)=>{const qn=new Rn(It,Be),Kn=[];let Xn=Ft();vo(ve,Xn,It,Be,!1);const fo=()=>(Xn.elements.length>0&&(Kn.push(Xn),Xn=Ft()),!1);return xo(ve,qn.next.bind(qn),It,{boundary:fo,cef:rs=>(fo(),En&&Kn.push(...En.cef(rs)),!1),text:rs=>{Xn.elements.push(Pt.fromDom(rs)),En&&En.text(rs,Xn)}},Xt,no),Xt&&vo(ve,Xn,Xt,Be,!0),fo(),Kn},Bo=(ve,Be)=>{const It=$n(Be.startContainer,Be.startOffset),Xt=It.element.dom,En=$n(Be.endContainer,Be.endOffset),no=En.element.dom;return fs(ve,Be.commonAncestorContainer,Xt,no,{text:(qn,Kn)=>{qn===no?Kn.fOffset+=qn.length-En.offset:qn===Xt&&(Kn.sOffset+=It.offset)},cef:qn=>{const Kn=Zn(Nn(Pt.fromDom(qn),"*[contenteditable=true]"),Xn=>{const fo=Xn.dom;return fs(ve,fo,fo)});return Ie(Kn,(Xn,fo)=>Mt(Xn.elements[0].dom,fo.elements[0].dom)?1:-1)}},!1)},Es=(ve,Be)=>Be.collapsed?[]:Bo(ve,Be),Kt=(ve,Be)=>{const It=ve.createRng();return It.selectNode(Be),Es(ve,It)},Vo=(ve,Be)=>Zn(Be,It=>Kt(ve,It)),tr=(ve,Be,It=0,Xt=ve.length)=>{const En=Be.regex;En.lastIndex=It;const no=[];let qn;for(;qn=En.exec(ve);){const Kn=qn[Be.matchIndex],Xn=qn.index+qn[0].indexOf(Kn),fo=Xn+Kn.length;if(fo>Xt)break;no.push({start:Xn,finish:fo}),En.lastIndex=fo}return no},Vr=(ve,Be)=>{const It=Ue(ve,(Xt,En)=>{const no=Ee(En),qn=Xt.last,Kn=qn+no.length,Xn=Zn(Be,(fo,rs)=>fo.start<Kn&&fo.finish>qn?[{element:En,start:Math.max(qn,fo.start)-qn,finish:Math.min(Kn,fo.finish)-qn,matchId:rs}]:[]);return{results:Xt.results.concat(Xn),last:Kn}},{results:[],last:0}).results;return St(It,Xt=>Xt.matchId)},Rr=(ve,Be)=>Zn(Be,It=>{const Xt=It.elements,En=W(Xt,Ee).join(""),no=tr(En,ve,It.sOffset,En.length-It.fOffset);return Vr(Xt,no)}),kr=(ve,Be)=>{cn(ve,(It,Xt)=>{cn(It,En=>{const no=Pt.fromDom(Be.cloneNode(!1));Zt(no,"data-mce-index",Xt);const qn=En.element.dom;if(qn.length===En.finish&&En.start===0)Se(En.element,no);else{qn.length!==En.finish&&qn.splitText(En.finish);const Kn=qn.splitText(En.start);Se(Pt.fromDom(Kn),no)}})})},Cs=(ve,Be,It,Xt)=>{const En=Kt(ve,It),no=Rr(Be,En);return kr(no,Xt),no.length},zr=(ve,Be,It,Xt)=>{const En=It.getBookmark(),no=ve.select("td[data-mce-selected],th[data-mce-selected]"),qn=no.length>0?Vo(ve,no):Es(ve,It.getRng()),Kn=Rr(Be,qn);return kr(Kn,Xt),It.moveToBookmark(En),Kn.length},Qr=ve=>ve.getAttribute("data-mce-index"),Ts=(ve,Be,It,Xt)=>{const En=ve.dom.create("span",{"data-mce-bogus":1});En.className="mce-match-marker";const no=ve.getBody();return pr(ve,Be,!1),Xt?zr(ve.dom,It,ve.selection,En):Cs(ve.dom,It,no,En)},ao=ve=>{var Be;const It=ve.parentNode;ve.firstChild&&It.insertBefore(ve.firstChild,ve),(Be=ve.parentNode)===null||Be===void 0||Be.removeChild(ve)},ur=(ve,Be)=>{const It=[],Xt=at.toArray(ve.getBody().getElementsByTagName("span"));if(Xt.length)for(let En=0;En<Xt.length;En++){const no=Qr(Xt[En]);no===null||!no.length||no===Be.toString()&&It.push(Xt[En])}return It},Je=(ve,Be,It)=>{const Xt=Be.get();let En=Xt.index;const no=ve.dom;It?En+1===Xt.count?En=0:En++:En-1===-1?En=Xt.count-1:En--,no.removeClass(ur(ve,Xt.index),"mce-match-marker-selected");const qn=ur(ve,En);return qn.length?(no.addClass(ur(ve,En),"mce-match-marker-selected"),ve.selection.scrollIntoView(qn[0]),En):-1},bt=(ve,Be)=>{const It=Be.parentNode;ve.remove(Be),It&&ve.isEmpty(It)&&ve.remove(It)},yn=(ve,Be)=>{const Xt="("+ve.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&").replace(/\s/g,"[^\\S\\r\\n\\uFEFF]")+")";return Be?`(?:^|\\s|${Dt()})`+Xt+`(?=$|\\s|${Dt()})`:Xt},Mn=(ve,Be,It,Xt,En,no)=>{const qn=ve.selection,Kn=yn(It,En),Xn=qn.isForward(),fo={regex:new RegExp(Kn,Xt?"g":"gi"),matchIndex:1},rs=Ts(ve,Be,fo,no);if(q.browser.isSafari()&&qn.setRng(qn.getRng(),Xn),rs){const js=Je(ve,Be,!0);Be.set({index:js,count:rs,text:It,matchCase:Xt,wholeWord:En,inSelection:no})}return rs},To=(ve,Be)=>{const It=Je(ve,Be,!0);Be.set({...Be.get(),index:It})},is=(ve,Be)=>{const It=Je(ve,Be,!1);Be.set({...Be.get(),index:It})},Hr=ve=>{const Be=Qr(ve);return Be!==null&&Be.length>0},Ur=(ve,Be,It,Xt,En)=>{const no=Be.get(),qn=no.index;let Kn,Xn=qn;Xt=Xt!==!1;const fo=ve.getBody(),rs=at.grep(at.toArray(fo.getElementsByTagName("span")),Hr);for(let js=0;js<rs.length;js++){const Fa=Qr(rs[js]);let gc=Kn=parseInt(Fa,10);if(En||gc===no.index){for(It.length?(rs[js].innerText=It,ao(rs[js])):bt(ve.dom,rs[js]);rs[++js];)if(gc=parseInt(Qr(rs[js]),10),gc===Kn)bt(ve.dom,rs[js]);else{js--;break}Xt&&Xn--}else Kn>qn&&rs[js].setAttribute("data-mce-index",String(Kn-1))}return Be.set({...no,count:En?0:no.count-1,index:Xn}),Xt?To(ve,Be):is(ve,Be),!En&&Be.get().count>0},pr=(ve,Be,It)=>{let Xt,En;const no=Be.get(),qn=at.toArray(ve.getBody().getElementsByTagName("span"));for(let Kn=0;Kn<qn.length;Kn++){const Xn=Qr(qn[Kn]);Xn!==null&&Xn.length&&(Xn===no.index.toString()&&(Xt||(Xt=qn[Kn].firstChild),En=qn[Kn].firstChild),ao(qn[Kn]))}if(Be.set({...no,index:-1,count:0,text:""}),Xt&&En){const Kn=ve.dom.createRng();return Kn.setStart(Xt,0),Kn.setEnd(En,En.data.length),It!==!1&&ve.selection.setRng(Kn),Kn}else return},Ce=(ve,Be)=>Be.get().count>1,be=(ve,Be)=>Be.get().count>1,mt=(ve,Be)=>({done:Kn=>pr(ve,Be,Kn),find:(Kn,Xn,fo,rs=!1)=>Mn(ve,Be,Kn,Xn,fo,rs),next:()=>To(ve,Be),prev:()=>is(ve,Be),replace:(Kn,Xn,fo)=>Ur(ve,Be,Kn,Xn,fo)}),Tt=ve=>{const Be=I(it.none()),It=()=>Be.get().each(ve);return{clear:()=>{It(),Be.set(it.none())},isSet:()=>Be.get().isSome(),get:()=>Be.get(),set:Kn=>{It(),Be.set(it.some(Kn))}}},Yn=()=>{const ve=Tt(Yt);return{...ve,on:It=>ve.get().each(It)}},lo=(ve,Be)=>{const It=Yn();ve.undoManager.add();const Xt=at.trim(ve.selection.getContent({format:"text"})),En=So=>{So.setEnabled("next",Ce(ve,Be)),So.setEnabled("prev",be(ve,Be))},no=So=>{const es=So.getData(),As=Be.get();Be.set({...As,matchCase:es.matchcase,wholeWord:es.wholewords,inSelection:es.inselection})},qn=(So,es)=>{Ut(["replace","replaceall","prev","next"],ea=>So.setEnabled(ea,!es))},Kn=(So,es)=>{es.redial(kc(So,es.getData()))},Xn=(So,es)=>{q.browser.isSafari()&&q.deviceType.isTouch()&&(es==="find"||es==="replace"||es==="replaceall")&&So.focus(es)},fo=So=>{pr(ve,Be,!1),qn(So,!0),En(So)},rs=So=>{const es=So.getData(),As=Be.get();if(!es.findtext.length){fo(So);return}if(As.text===es.findtext&&As.matchCase===es.matchcase&&As.wholeWord===es.wholewords)To(ve,Be);else{const Oa=Mn(ve,Be,es.findtext,es.matchcase,es.wholewords,es.inselection);Oa<=0&&Kn(!0,So),qn(So,Oa===0)}En(So)},js=Be.get(),Fa={findtext:Xt,replacetext:"",wholewords:js.wholeWord,matchcase:js.matchCase,inselection:js.inSelection},gc=So=>{const es=[{type:"bar",items:[{type:"input",name:"findtext",placeholder:"Find",maximized:!0,inputMode:"search"},{type:"button",name:"prev",text:"Previous",icon:"action-prev",enabled:!1,borderless:!0},{type:"button",name:"next",text:"Next",icon:"action-next",enabled:!1,borderless:!0}]},{type:"input",name:"replacetext",placeholder:"Replace with",inputMode:"search"}];return So&&es.push({type:"alertbanner",level:"error",text:"Could not find the specified string.",icon:"warning"}),es},kc=(So,es)=>({title:"Find and Replace",size:"normal",body:{type:"panel",items:gc(So)},buttons:[{type:"menu",name:"options",icon:"preferences",tooltip:"Preferences",align:"start",items:[{type:"togglemenuitem",name:"matchcase",text:"Match case"},{type:"togglemenuitem",name:"wholewords",text:"Find whole words only"},{type:"togglemenuitem",name:"inselection",text:"Find in selection"}]},{type:"custom",name:"find",text:"Find",primary:!0},{type:"custom",name:"replace",text:"Replace",enabled:!1},{type:"custom",name:"replaceall",text:"Replace all",enabled:!1}],initialData:es,onChange:(As,Oa)=>{So&&Kn(!1,As),Oa.name==="findtext"&&Be.get().count>0&&fo(As)},onAction:(As,Oa)=>{const ea=As.getData();switch(Oa.name){case"find":rs(As);break;case"replace":Ur(ve,Be,ea.replacetext)?En(As):fo(As);break;case"replaceall":Ur(ve,Be,ea.replacetext,!0,!0),fo(As);break;case"prev":is(ve,Be),En(As);break;case"next":To(ve,Be),En(As);break;case"matchcase":case"wholewords":case"inselection":Kn(!1,As),no(As),fo(As);break}Xn(As,Oa.name)},onSubmit:As=>{rs(As),Xn(As,"find")},onClose:()=>{ve.focus(),pr(ve,Be),ve.undoManager.add()}});It.set(ve.windowManager.open(kc(!1,Fa),{inline:"toolbar"}))},Go=(ve,Be)=>{ve.addCommand("SearchReplace",()=>{lo(ve,Be)})},Xs=(ve,Be)=>()=>{lo(ve,Be)},Fe=(ve,Be)=>{ve.ui.registry.addMenuItem("searchreplace",{text:"Find and replace...",shortcut:"Meta+F",onAction:Xs(ve,Be),icon:"search"}),ve.ui.registry.addButton("searchreplace",{tooltip:"Find and replace",onAction:Xs(ve,Be),icon:"search"}),ve.shortcuts.add("Meta+F","",Xs(ve,Be))};var Ao=()=>{_e.add("searchreplace",ve=>{const Be=I({index:-1,count:0,text:"",matchCase:!1,wholeWord:!1,inSelection:!1});return Go(ve,Be),Fe(ve,Be),mt(ve,Be)})};Ao()}(),function(){var I=tinymce.util.Tools.resolve("tinymce.PluginManager");const _e=(G,Ee,ze)=>{var Mt;return ze(G,Ee.prototype)?!0:((Mt=G.constructor)===null||Mt===void 0?void 0:Mt.name)===Ee.name},ie=G=>{const Ee=typeof G;return G===null?"null":Ee==="object"&&Array.isArray(G)?"array":Ee==="object"&&_e(G,String,(ze,Mt)=>Mt.isPrototypeOf(ze))?"string":Ee},He=G=>Ee=>ie(Ee)===G,Re=G=>Ee=>typeof Ee===G,oe=He("string"),qe=He("object"),te=He("array"),Ye=G=>G==null,dt=G=>!Ye(G),Jt=Re("function"),wn=(G,Ee)=>{if(te(G)){for(let ze=0,Mt=G.length;ze<Mt;++ze)if(!Ee(G[ze]))return!1;return!0}return!1},Yt=G=>()=>G;function Qt(G,...Ee){return(...ze)=>{const Mt=Ee.concat(ze);return G.apply(null,Mt)}}const Wt=Yt(!1),fn=G=>G.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");var st=tinymce.util.Tools.resolve("tinymce.util.Tools");const it=G=>Ee=>Ee.options.get(G),Dt=G=>{const Ee=G.options.register;Ee("template_cdate_classes",{processor:"string",default:"cdate"}),Ee("template_mdate_classes",{processor:"string",default:"mdate"}),Ee("template_selected_content_classes",{processor:"string",default:"selcontent"}),Ee("template_preview_replace_values",{processor:"object"}),Ee("template_replace_values",{processor:"object"}),Ee("templates",{processor:ze=>oe(ze)||wn(ze,qe)||Jt(ze),default:[]}),Ee("template_cdate_format",{processor:"string",default:G.translate("%Y-%m-%d")}),Ee("template_mdate_format",{processor:"string",default:G.translate("%Y-%m-%d")})},q=it("template_cdate_classes"),at=it("template_mdate_classes"),Pn=it("template_selected_content_classes"),Et=it("template_preview_replace_values"),W=it("template_replace_values"),Ut=it("templates"),cn=it("template_cdate_format"),St=it("template_mdate_format"),Ue=it("content_style"),ce=it("content_css_cors"),Zn=it("body_class"),Ie=(G,Ee)=>{if(G=""+G,G.length<Ee)for(let ze=0;ze<Ee-G.length;ze++)G="0"+G;return G},pe=(G,Ee,ze=new Date)=>{const Mt="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),Nn="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),Rn="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),Wn="January February March April May June July August September October November December".split(" ");return Ee=Ee.replace("%D","%m/%d/%Y"),Ee=Ee.replace("%r","%I:%M:%S %p"),Ee=Ee.replace("%Y",""+ze.getFullYear()),Ee=Ee.replace("%y",""+ze.getYear()),Ee=Ee.replace("%m",Ie(ze.getMonth()+1,2)),Ee=Ee.replace("%d",Ie(ze.getDate(),2)),Ee=Ee.replace("%H",""+Ie(ze.getHours(),2)),Ee=Ee.replace("%M",""+Ie(ze.getMinutes(),2)),Ee=Ee.replace("%S",""+Ie(ze.getSeconds(),2)),Ee=Ee.replace("%I",""+((ze.getHours()+11)%12+1)),Ee=Ee.replace("%p",ze.getHours()<12?"AM":"PM"),Ee=Ee.replace("%B",""+G.translate(Wn[ze.getMonth()])),Ee=Ee.replace("%b",""+G.translate(Rn[ze.getMonth()])),Ee=Ee.replace("%A",""+G.translate(Nn[ze.getDay()])),Ee=Ee.replace("%a",""+G.translate(Mt[ze.getDay()])),Ee=Ee.replace("%%","%"),Ee};class S{constructor(Ee,ze){this.tag=Ee,this.value=ze}static some(Ee){return new S(!0,Ee)}static none(){return S.singletonNone}fold(Ee,ze){return this.tag?ze(this.value):Ee()}isSome(){return this.tag}isNone(){return!this.tag}map(Ee){return this.tag?S.some(Ee(this.value)):S.none()}bind(Ee){return this.tag?Ee(this.value):S.none()}exists(Ee){return this.tag&&Ee(this.value)}forall(Ee){return!this.tag||Ee(this.value)}filter(Ee){return!this.tag||Ee(this.value)?this:S.none()}getOr(Ee){return this.tag?this.value:Ee}or(Ee){return this.tag?this:Ee}getOrThunk(Ee){return this.tag?this.value:Ee()}orThunk(Ee){return this.tag?this:Ee()}getOrDie(Ee){if(this.tag)return this.value;throw new Error(Ee??"Called getOrDie on None")}static from(Ee){return dt(Ee)?S.some(Ee):S.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(Ee){this.tag&&Ee(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}S.singletonNone=new S(!1);const je=(G,Ee)=>{for(let ze=0,Mt=G.length;ze<Mt;ze++){const Nn=G[ze];if(Ee(Nn,ze))return!0}return!1},me=(G,Ee)=>{const ze=G.length,Mt=new Array(ze);for(let Nn=0;Nn<ze;Nn++){const Rn=G[Nn];Mt[Nn]=Ee(Rn,Nn)}return Mt},kt=(G,Ee,ze)=>{for(let Mt=0,Nn=G.length;Mt<Nn;Mt++){const Rn=G[Mt];if(Ee(Rn,Mt))return S.some(Rn);if(ze(Rn,Mt))break}return S.none()},Rt=(G,Ee)=>kt(G,Ee,Wt),we=Object.hasOwnProperty,Nt=(G,Ee)=>bn(G,Ee)?S.from(G[Ee]):S.none(),bn=(G,Ee)=>we.call(G,Ee);var Qe=tinymce.util.Tools.resolve("tinymce.html.Serializer");const Zt={'"':""","<":"<",">":">","&":"&","'":"'"},Oe=G=>G.replace(/["'<>&]/g,Ee=>Nt(Zt,Ee).getOr(Ee)),ot=(G,Ee,ze)=>je(ze.split(/\s+/),Mt=>G.hasClass(Ee,Mt)),F=(G,Ee)=>Qe({validate:!0},G.schema).serialize(G.parser.parse(Ee,{insert:!0})),po=(G,Ee)=>()=>{const ze=Ut(G);Jt(ze)?ze(Ee):oe(ze)?fetch(ze).then(Mt=>{Mt.ok&&Mt.json().then(Ee)}):Ee(ze)},ht=(G,Ee)=>(st.each(Ee,(ze,Mt)=>{Jt(ze)&&(ze=ze(Mt)),G=G.replace(new RegExp("\\{\\$"+fn(Mt)+"\\}","g"),ze)}),G),Pt=(G,Ee)=>{const ze=G.dom,Mt=W(G);st.each(ze.select("*",Ee),Nn=>{st.each(Mt,(Rn,Wn)=>{ze.hasClass(Nn,Wn)&&Jt(Rn)&&Rn(Nn)})})},an=(G,Ee,ze)=>{const Mt=G.dom,Nn=G.selection.getContent();ze=ht(ze,W(G));let Rn=Mt.create("div",{},F(G,ze));const Wn=Mt.select(".mceTmpl",Rn);Wn&&Wn.length>0&&(Rn=Mt.create("div"),Rn.appendChild(Wn[0].cloneNode(!0))),st.each(Mt.select("*",Rn),zn=>{ot(Mt,zn,q(G))&&(zn.innerHTML=pe(G,cn(G))),ot(Mt,zn,at(G))&&(zn.innerHTML=pe(G,St(G))),ot(Mt,zn,Pn(G))&&(zn.innerHTML=Nn)}),Pt(G,Rn),G.execCommand("mceInsertContent",!1,Rn.innerHTML),G.addVisual()};var so=tinymce.util.Tools.resolve("tinymce.Env");const le=(G,Ee)=>{var ze;let Mt=F(G,Ee);if(Ee.indexOf("<html>")===-1){let Nn="";const Rn=(ze=Ue(G))!==null&&ze!==void 0?ze:"",Wn=ce(G)?' crossorigin="anonymous"':"";st.each(G.contentCSS,$n=>{Nn+='<link type="text/css" rel="stylesheet" href="'+G.documentBaseURI.toAbsolute($n)+'"'+Wn+">"}),Rn&&(Nn+='<style type="text/css">'+Rn+"</style>");const zn=Zn(G),Do=G.dom.encode,lt='<script>document.addEventListener && document.addEventListener("click", function(e) {for (var elm = e.target; elm; elm = elm.parentNode) {if (elm.nodeName === "A" && !('+(so.os.isMacOS()||so.os.isiOS()?"e.metaKey":"e.ctrlKey && !e.altKey")+")) {e.preventDefault();}}}, false);<\/script> ",At=G.getBody().dir,Ft=At?' dir="'+Do(At)+'"':"";Mt='<!DOCTYPE html><html><head><base href="'+Do(G.documentBaseURI.getURI())+'">'+Nn+lt+'</head><body class="'+Do(zn)+'"'+Ft+">"+Mt+"</body></html>"}return ht(Mt,Et(G))},Ne=(G,Ee)=>{const ze=()=>{if(!Ee||Ee.length===0){const At=G.translate("No templates defined.");return G.notificationManager.open({text:At,type:"info"}),S.none()}return S.from(st.map(Ee,(At,Ft)=>{const $n=xo=>xo.url!==void 0;return{selected:Ft===0,text:At.title,value:{url:$n(At)?S.from(At.url):S.none(),content:$n(At)?S.none():S.from(At.content),description:At.description}}}))},Mt=At=>me(At,Ft=>({text:Ft.text,value:Ft.text})),Nn=(At,Ft)=>Rt(At,$n=>$n.text===Ft),Rn=At=>{G.windowManager.alert("Could not load the specified template.",()=>At.focus("template"))},Wn=At=>At.value.url.fold(()=>Promise.resolve(At.value.content.getOr("")),Ft=>fetch(Ft).then($n=>$n.ok?$n.text():Promise.reject())),zn=(At,Ft)=>($n,xo)=>{if(xo.name==="template"){const vo=$n.getData().template;Nn(At,vo).each(fs=>{$n.block("Loading..."),Wn(fs).then(Bo=>{Ft($n,fs,Bo)}).catch(()=>{Ft($n,fs,""),$n.setEnabled("save",!1),Rn($n)})})}},Do=At=>Ft=>{const $n=Ft.getData();Nn(At,$n.template).each(xo=>{Wn(xo).then(vo=>{G.execCommand("mceInsertTemplate",!1,vo),Ft.close()}).catch(()=>{Ft.setEnabled("save",!1),Rn(Ft)})})},Xe=At=>{const Ft=Mt(At),$n=(fs,Bo)=>({title:"Insert Template",size:"large",body:{type:"panel",items:fs},initialData:Bo,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:Do(At),onChange:zn(At,xo)}),xo=(fs,Bo,Es)=>{const Kt=le(G,Es),Vo=[{type:"listbox",name:"template",label:"Templates",items:Ft},{type:"htmlpanel",html:`<p aria-live="polite">${Oe(Bo.value.description)}</p>`},{label:"Preview",type:"iframe",name:"preview",sandboxed:!1,transparent:!1}],tr={template:Bo.text,preview:Kt};fs.unblock(),fs.redial($n(Vo,tr)),fs.focus("template")},vo=G.windowManager.open($n([],{template:"",preview:""}));vo.block("Loading..."),Wn(At[0]).then(fs=>{xo(vo,At[0],fs)}).catch(()=>{xo(vo,At[0],""),vo.setEnabled("save",!1),Rn(vo)})};ze().each(Xe)},ke=G=>Ee=>{Ne(G,Ee)},Y=G=>{G.addCommand("mceInsertTemplate",Qt(an,G)),G.addCommand("mceTemplate",po(G,ke(G)))},re=G=>{G.on("PreProcess",Ee=>{const ze=G.dom,Mt=St(G);st.each(ze.select("div",Ee.node),Nn=>{ze.hasClass(Nn,"mceTmpl")&&(st.each(ze.select("*",Nn),Rn=>{ot(ze,Rn,at(G))&&(Rn.innerHTML=pe(G,Mt))}),Pt(G,Nn))})})},xe=G=>Ee=>{const ze=()=>{Ee.setEnabled(G.selection.isEditable())};return G.on("NodeChange",ze),ze(),()=>{G.off("NodeChange",ze)}},Se=G=>{const Ee=()=>G.execCommand("mceTemplate");G.ui.registry.addButton("template",{icon:"template",tooltip:"Insert template",onSetup:xe(G),onAction:Ee}),G.ui.registry.addMenuItem("template",{icon:"template",text:"Insert template...",onSetup:xe(G),onAction:Ee})};var $e=()=>{I.add("template",G=>{Dt(G),Se(G),Y(G),re(G)})};$e()}(),function(){const I=Yt=>{let Qt=Yt;return{get:()=>Qt,set:st=>{Qt=st}}};var _e=tinymce.util.Tools.resolve("tinymce.PluginManager");const ie=(Yt,Qt)=>{Yt.dispatch("VisualBlocks",{state:Qt})},He=(Yt,Qt,Wt)=>{Yt.dom.toggleClass(Yt.getBody(),"mce-visualblocks"),Wt.set(!Wt.get()),ie(Yt,Wt.get())},Re=(Yt,Qt,Wt)=>{Yt.addCommand("mceVisualBlocks",()=>{He(Yt,Qt,Wt)})},oe=Yt=>Qt=>Qt.options.get(Yt),qe=Yt=>{const Qt=Yt.options.register;Qt("visualblocks_default_state",{processor:"boolean",default:!1})},te=oe("visualblocks_default_state"),Ye=(Yt,Qt,Wt)=>{Yt.on("PreviewFormats AfterPreviewFormats",fn=>{Wt.get()&&Yt.dom.toggleClass(Yt.getBody(),"mce-visualblocks",fn.type==="afterpreviewformats")}),Yt.on("init",()=>{te(Yt)&&He(Yt,Qt,Wt)})},dt=(Yt,Qt)=>Wt=>{Wt.setActive(Qt.get());const fn=st=>Wt.setActive(st.state);return Yt.on("VisualBlocks",fn),()=>Yt.off("VisualBlocks",fn)},Jt=(Yt,Qt)=>{const Wt=()=>Yt.execCommand("mceVisualBlocks");Yt.ui.registry.addToggleButton("visualblocks",{icon:"visualblocks",tooltip:"Show blocks",onAction:Wt,onSetup:dt(Yt,Qt)}),Yt.ui.registry.addToggleMenuItem("visualblocks",{text:"Show blocks",icon:"visualblocks",onAction:Wt,onSetup:dt(Yt,Qt)})};var wn=()=>{_e.add("visualblocks",(Yt,Qt)=>{qe(Yt);const Wt=I(!1);Re(Yt,Qt,Wt),Jt(Yt,Wt),Ye(Yt,Qt,Wt)})};wn()}(),function(){var I=tinymce.util.Tools.resolve("tinymce.PluginManager"),_e=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),ie=tinymce.util.Tools.resolve("tinymce.util.Tools");const He=Ie=>pe=>pe.options.get(Ie),Re=Ie=>{const pe=Ie.options.register;pe("allow_html_in_named_anchor",{processor:"boolean",default:!1})},oe=He("allow_html_in_named_anchor"),qe="a:not([href])",te=Ie=>!Ie,Ye=Ie=>Ie.getAttribute("id")||Ie.getAttribute("name")||"",dt=Ie=>Ie.nodeName.toLowerCase()==="a",Jt=Ie=>dt(Ie)&&!Ie.getAttribute("href")&&Ye(Ie)!=="",wn=Ie=>Jt(Ie)&&!Ie.firstChild,Yt=Ie=>{const pe=Ie.dom;_e(pe).walk(Ie.selection.getRng(),S=>{ie.each(S,je=>{wn(je)&&pe.remove(je,!1)})})},Qt=Ie=>/^[A-Za-z][A-Za-z0-9\-:._]*$/.test(Ie),Wt=Ie=>Ie.dom.getParent(Ie.selection.getStart(),qe),fn=Ie=>{const pe=Wt(Ie);return pe?Ye(pe):""},st=(Ie,pe)=>{Ie.undoManager.transact(()=>{oe(Ie)||Ie.selection.collapse(!0),Ie.selection.isCollapsed()?Ie.insertContent(Ie.dom.createHTML("a",{id:pe})):(Yt(Ie),Ie.formatter.remove("namedAnchor",void 0,void 0,!0),Ie.formatter.apply("namedAnchor",{value:pe}),Ie.addVisual())})},it=(Ie,pe,S)=>{S.removeAttribute("name"),S.id=pe,Ie.addVisual(),Ie.undoManager.add()},Dt=(Ie,pe)=>{const S=Wt(Ie);S?it(Ie,pe,S):st(Ie,pe),Ie.focus()},q=(Ie,pe)=>Qt(pe)?(Dt(Ie,pe),!0):(Ie.windowManager.alert("ID should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores."),!1),at=Ie=>{const pe=fn(Ie);Ie.windowManager.open({title:"Anchor",size:"normal",body:{type:"panel",items:[{name:"id",type:"input",label:"ID",placeholder:"example"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{id:pe},onSubmit:S=>{q(Ie,S.getData().id)&&S.close()}})},Pn=Ie=>{Ie.addCommand("mceAnchor",()=>{at(Ie)})},Et=Ie=>te(Ie.attr("href"))&&!te(Ie.attr("id")||Ie.attr("name")),W=Ie=>Et(Ie)&&!Ie.firstChild,Ut=Ie=>pe=>{for(let S=0;S<pe.length;S++){const je=pe[S];W(je)&&je.attr("contenteditable",Ie)}},cn=Ie=>{Ie.on("PreInit",()=>{Ie.parser.addNodeFilter("a",Ut("false")),Ie.serializer.addNodeFilter("a",Ut(null))})},St=Ie=>{Ie.formatter.register("namedAnchor",{inline:"a",selector:qe,remove:"all",split:!0,deep:!0,attributes:{id:"%value"},onmatch:(pe,S,je)=>Jt(pe)})},Ue=Ie=>pe=>{const S=()=>{pe.setEnabled(Ie.selection.isEditable())};return Ie.on("NodeChange",S),S(),()=>{Ie.off("NodeChange",S)}},ce=Ie=>{const pe=()=>Ie.execCommand("mceAnchor");Ie.ui.registry.addToggleButton("anchor",{icon:"bookmark",tooltip:"Anchor",onAction:pe,onSetup:S=>{const je=Ie.selection.selectorChangedWithUnbind("a:not([href])",S.setActive).unbind,me=Ue(Ie)(S);return()=>{je(),me()}}}),Ie.ui.registry.addMenuItem("anchor",{icon:"bookmark",text:"Anchor...",onAction:pe,onSetup:Ue(Ie)})};var Zn=()=>{I.add("anchor",Ie=>{Re(Ie),cn(Ie),Pn(Ie),ce(Ie),Ie.on("PreInit",()=>{St(Ie)})})};Zn()}(),function(){const I=q=>{let at=q;return{get:()=>at,set:W=>{at=W}}};var _e=tinymce.util.Tools.resolve("tinymce.PluginManager");const ie=q=>()=>q;var He=tinymce.util.Tools.resolve("tinymce.Env");const Re=q=>q.dispatch("ResizeEditor"),oe=q=>at=>at.options.get(q),qe=q=>{const at=q.options.register;at("autoresize_overflow_padding",{processor:"number",default:1}),at("autoresize_bottom_margin",{processor:"number",default:50})},te=oe("min_height"),Ye=oe("max_height"),dt=oe("autoresize_overflow_padding"),Jt=oe("autoresize_bottom_margin"),wn=q=>q.plugins.fullscreen&&q.plugins.fullscreen.isFullscreen(),Yt=(q,at)=>{const Pn=q.getBody();Pn&&(Pn.style.overflowY=at?"":"hidden",at||(Pn.scrollTop=0))},Qt=(q,at,Pn,Et)=>{var W;const Ut=parseInt((W=q.getStyle(at,Pn,Et))!==null&&W!==void 0?W:"",10);return isNaN(Ut)?0:Ut},Wt=q=>{if((q==null?void 0:q.type.toLowerCase())==="setcontent"){const at=q;return at.selection===!0||at.paste===!0}else return!1},fn=(q,at,Pn,Et)=>{var W;const Ut=q.dom,cn=q.getDoc();if(!cn)return;if(wn(q)){Yt(q,!0);return}const St=cn.documentElement,Ue=Et?Et():dt(q),ce=(W=te(q))!==null&&W!==void 0?W:q.getElement().offsetHeight;let Zn=ce;const Ie=Qt(Ut,St,"margin-top",!0),pe=Qt(Ut,St,"margin-bottom",!0);let S=St.offsetHeight+Ie+pe+Ue;S<0&&(S=0);const je=q.getContainer().offsetHeight,me=q.getContentAreaContainer().offsetHeight,kt=je-me;S+kt>ce&&(Zn=S+kt);const Rt=Ye(q);if(Rt&&Zn>Rt?(Zn=Rt,Yt(q,!0)):Yt(q,!1),Zn!==at.get()){const we=Zn-at.get();if(Ut.setStyle(q.getContainer(),"height",Zn+"px"),at.set(Zn),Re(q),He.browser.isSafari()&&(He.os.isMacOS()||He.os.isiOS())){const Nt=q.getWin();Nt.scrollTo(Nt.pageXOffset,Nt.pageYOffset)}q.hasFocus()&&Wt(Pn)&&q.selection.scrollIntoView(),(He.browser.isSafari()||He.browser.isChromium())&&we<0&&fn(q,at,Pn,Et)}},st=(q,at)=>{let Pn=()=>Jt(q),Et,W;q.on("init",Ut=>{Et=0;const cn=dt(q),St=q.dom;St.setStyles(q.getDoc().documentElement,{height:"auto"}),He.browser.isEdge()||He.browser.isIE()?St.setStyles(q.getBody(),{paddingLeft:cn,paddingRight:cn,"min-height":0}):St.setStyles(q.getBody(),{paddingLeft:cn,paddingRight:cn}),fn(q,at,Ut,Pn),Et+=1}),q.on("NodeChange SetContent keyup FullscreenStateChanged ResizeContent",Ut=>{if(Et===1)W=q.getContainer().offsetHeight,fn(q,at,Ut,Pn),Et+=1;else if(Et===2){const cn=W<q.getContainer().offsetHeight;if(cn){const St=q.dom,Ue=q.getDoc();St.setStyles(Ue.documentElement,{"min-height":0}),St.setStyles(q.getBody(),{"min-height":"inherit"})}Pn=cn?ie(0):Pn,Et+=1}else fn(q,at,Ut,Pn)})},it=(q,at)=>{q.addCommand("mceAutoResize",()=>{fn(q,at)})};var Dt=()=>{_e.add("autoresize",q=>{if(qe(q),q.options.isSet("resize")||q.options.set("resize",!1),!q.inline){const at=I(0);it(q,at),st(q,at)}})};Dt()}(),function(){var I=tinymce.util.Tools.resolve("tinymce.PluginManager");const _e=(te,Ye)=>{te.focus(),te.undoManager.transact(()=>{te.setContent(Ye)}),te.selection.setCursorLocation(),te.nodeChanged()},ie=te=>te.getContent({source_view:!0}),He=te=>{const Ye=ie(te);te.windowManager.open({title:"Source Code",size:"large",body:{type:"panel",items:[{type:"textarea",name:"code"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{code:Ye},onSubmit:dt=>{_e(te,dt.getData().code),dt.close()}})},Re=te=>{te.addCommand("mceCodeEditor",()=>{He(te)})},oe=te=>{const Ye=()=>te.execCommand("mceCodeEditor");te.ui.registry.addButton("code",{icon:"sourcecode",tooltip:"Source code",onAction:Ye}),te.ui.registry.addMenuItem("code",{icon:"sourcecode",text:"Source code",onAction:Ye})};var qe=()=>{I.add("code",te=>(Re(te),oe(te),{}))};qe()}(),function(){var I=tinymce.util.Tools.resolve("tinymce.PluginManager");const _e=(Xe,lt,At)=>{var Ft;return At(Xe,lt.prototype)?!0:((Ft=Xe.constructor)===null||Ft===void 0?void 0:Ft.name)===lt.name},ie=Xe=>{const lt=typeof Xe;return Xe===null?"null":lt==="object"&&Array.isArray(Xe)?"array":lt==="object"&&_e(Xe,String,(At,Ft)=>Ft.isPrototypeOf(At))?"string":lt},He=Xe=>lt=>ie(lt)===Xe,Re=Xe=>lt=>typeof lt===Xe,oe=He("string"),qe=Re("boolean"),te=Xe=>Xe==null,Ye=Xe=>!te(Xe),dt=Re("function"),Jt=Re("number"),wn=(Xe,lt)=>At=>Xe(lt(At)),Qt=(Xe=>()=>Xe)(!1);class Wt{constructor(lt,At){this.tag=lt,this.value=At}static some(lt){return new Wt(!0,lt)}static none(){return Wt.singletonNone}fold(lt,At){return this.tag?At(this.value):lt()}isSome(){return this.tag}isNone(){return!this.tag}map(lt){return this.tag?Wt.some(lt(this.value)):Wt.none()}bind(lt){return this.tag?lt(this.value):Wt.none()}exists(lt){return this.tag&<(this.value)}forall(lt){return!this.tag||lt(this.value)}filter(lt){return!this.tag||lt(this.value)?this:Wt.none()}getOr(lt){return this.tag?this.value:lt}or(lt){return this.tag?this:lt}getOrThunk(lt){return this.tag?this.value:lt()}orThunk(lt){return this.tag?this:lt()}getOrDie(lt){if(this.tag)return this.value;throw new Error(lt??"Called getOrDie on None")}static from(lt){return Ye(lt)?Wt.some(lt):Wt.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(lt){this.tag&<(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}Wt.singletonNone=new Wt(!1);const fn=(Xe,lt)=>{const At=Xe.length,Ft=new Array(At);for(let $n=0;$n<At;$n++){const xo=Xe[$n];Ft[$n]=lt(xo,$n)}return Ft},st=(Xe,lt)=>{for(let At=0,Ft=Xe.length;At<Ft;At++){const $n=Xe[At];lt($n,At)}},it=(Xe,lt)=>{const At=[];for(let Ft=0,$n=Xe.length;Ft<$n;Ft++){const xo=Xe[Ft];lt(xo,Ft)&&At.push(xo)}return At},Dt=9,q=11,at=1,Pn=3,Et=(Xe,lt)=>{const Ft=(lt||document).createElement("div");if(Ft.innerHTML=Xe,!Ft.hasChildNodes()||Ft.childNodes.length>1){const $n="HTML does not have a single root node";throw console.error($n,Xe),new Error($n)}return cn(Ft.childNodes[0])},W=(Xe,lt)=>{const Ft=(lt||document).createElement(Xe);return cn(Ft)},Ut=(Xe,lt)=>{const Ft=(lt||document).createTextNode(Xe);return cn(Ft)},cn=Xe=>{if(Xe==null)throw new Error("Node cannot be null or undefined");return{dom:Xe}},Ue={fromHtml:Et,fromTag:W,fromText:Ut,fromDom:cn,fromPoint:(Xe,lt,At)=>Wt.from(Xe.dom.elementFromPoint(lt,At)).map(cn)},ce=(Xe,lt)=>{const At=Xe.dom;if(At.nodeType!==at)return!1;{const Ft=At;if(Ft.matches!==void 0)return Ft.matches(lt);if(Ft.msMatchesSelector!==void 0)return Ft.msMatchesSelector(lt);if(Ft.webkitMatchesSelector!==void 0)return Ft.webkitMatchesSelector(lt);if(Ft.mozMatchesSelector!==void 0)return Ft.mozMatchesSelector(lt);throw new Error("Browser lacks native selectors")}};typeof window<"u"||Function("return this;")();const Zn=Xe=>Xe.dom.nodeName.toLowerCase(),Ie=Xe=>Xe.dom.nodeType,pe=Xe=>lt=>Ie(lt)===Xe,S=pe(at),je=pe(Pn),me=pe(Dt),kt=pe(q),Rt=Xe=>lt=>S(lt)&&Zn(lt)===Xe,we=Xe=>Ue.fromDom(Xe.dom.ownerDocument),Nt=Xe=>me(Xe)?Xe:we(Xe),bn=Xe=>Wt.from(Xe.dom.parentNode).map(Ue.fromDom),Qe=Xe=>fn(Xe.dom.childNodes,Ue.fromDom),Zt=(Xe,lt,At)=>{if(oe(At)||qe(At)||Jt(At))Xe.setAttribute(lt,At+"");else throw console.error("Invalid call to Attribute.set. Key ",lt,":: Value ",At,":: Element ",Xe),new Error("Attribute value was not simple")},Oe=(Xe,lt,At)=>{Zt(Xe.dom,lt,At)},ot=(Xe,lt)=>{Xe.dom.removeAttribute(lt)},F=Xe=>kt(Xe)&&Ye(Xe.dom.host),ht=dt(Element.prototype.attachShadow)&&dt(Node.prototype.getRootNode)?Xe=>Ue.fromDom(Xe.dom.getRootNode()):Nt,Pt=Xe=>{const lt=ht(Xe);return F(lt)?Wt.some(lt):Wt.none()},an=Xe=>Ue.fromDom(Xe.dom.host),so=Xe=>{const lt=je(Xe)?Xe.dom.parentNode:Xe.dom;if(lt==null||lt.ownerDocument===null)return!1;const At=lt.ownerDocument;return Pt(Ue.fromDom(lt)).fold(()=>At.body.contains(lt),wn(so,an))},le=(Xe,lt,At)=>{let Ft=Xe.dom;const $n=dt(At)?At:Qt;for(;Ft.parentNode;){Ft=Ft.parentNode;const xo=Ue.fromDom(Ft);if(lt(xo))return Wt.some(xo);if($n(xo))break}return Wt.none()},Ne=(Xe,lt,At)=>le(Xe,Ft=>ce(Ft,lt),At),ke=Xe=>Xe.style!==void 0&&dt(Xe.style.getPropertyValue),Y=(Xe,lt)=>{const At=Xe.dom,$n=window.getComputedStyle(At).getPropertyValue(lt);return $n===""&&!so(Xe)?re(At,lt):$n},re=(Xe,lt)=>ke(Xe)?Xe.style.getPropertyValue(lt):"",xe=Xe=>Y(Xe,"direction")==="rtl"?"rtl":"ltr",Se=(Xe,lt)=>it(Qe(Xe),lt),$e=(Xe,lt)=>Se(Xe,At=>ce(At,lt)),G=Xe=>bn(Xe).filter(S),Ee=(Xe,lt)=>(lt?Ne(Xe,"ol,ul"):Wt.some(Xe)).getOr(Xe),ze=Rt("li"),Mt=(Xe,lt,At)=>{st(lt,Ft=>{const $n=Ue.fromDom(Ft),xo=ze($n),vo=Ee($n,xo);G(vo).each(Bo=>{if(Xe.setStyle(vo.dom,"direction",null),xe(Bo)===At?ot(vo,"dir"):Oe(vo,"dir",At),xe(vo)!==At&&Xe.setStyle(vo.dom,"direction",At),xo){const Kt=$e(vo,"li[dir],li[style]");st(Kt,Vo=>{ot(Vo,"dir"),Xe.setStyle(Vo.dom,"direction",null)})}})})},Nn=(Xe,lt)=>{Xe.selection.isEditable()&&(Mt(Xe.dom,Xe.selection.getSelectedBlocks(),lt),Xe.nodeChanged())},Rn=Xe=>{Xe.addCommand("mceDirectionLTR",()=>{Nn(Xe,"ltr")}),Xe.addCommand("mceDirectionRTL",()=>{Nn(Xe,"rtl")})},Wn=(Xe,lt)=>At=>{const Ft=$n=>{const xo=Ue.fromDom($n.element);At.setActive(xe(xo)===lt),At.setEnabled(Xe.selection.isEditable())};return Xe.on("NodeChange",Ft),At.setEnabled(Xe.selection.isEditable()),()=>Xe.off("NodeChange",Ft)},zn=Xe=>{Xe.ui.registry.addToggleButton("ltr",{tooltip:"Left to right",icon:"ltr",onAction:()=>Xe.execCommand("mceDirectionLTR"),onSetup:Wn(Xe,"ltr")}),Xe.ui.registry.addToggleButton("rtl",{tooltip:"Right to left",icon:"rtl",onAction:()=>Xe.execCommand("mceDirectionRTL"),onSetup:Wn(Xe,"rtl")})};var Do=()=>{I.add("directionality",Xe=>{Rn(Xe),zn(Xe)})};Do()}(),function(){const I=$e=>{let G=$e;return{get:()=>G,set:Mt=>{G=Mt}}};var _e=tinymce.util.Tools.resolve("tinymce.PluginManager");let ie=0;const He=$e=>{const Ee=new Date().getTime(),ze=Math.floor(Math.random()*1e9);return ie++,$e+"_"+ze+ie+String(Ee)},Re=$e=>({addTab:Ee=>{var ze;const Mt=(ze=Ee.name)!==null&&ze!==void 0?ze:He("tab-name"),Nn=$e.get();Nn[Mt]=Ee,$e.set(Nn)}}),oe=($e,G)=>{$e.addCommand("mceHelp",G)},qe=$e=>G=>G.options.get($e),te=$e=>{const G=$e.options.register;G("help_tabs",{processor:"array"})},Ye=qe("help_tabs"),dt=qe("forced_plugins"),Jt=($e,G)=>{$e.ui.registry.addButton("help",{icon:"help",tooltip:"Help",onAction:G}),$e.ui.registry.addMenuItem("help",{text:"Help",icon:"help",shortcut:"Alt+0",onAction:G})},wn=($e,G,Ee)=>{var ze;return Ee($e,G.prototype)?!0:((ze=$e.constructor)===null||ze===void 0?void 0:ze.name)===G.name},Yt=$e=>{const G=typeof $e;return $e===null?"null":G==="object"&&Array.isArray($e)?"array":G==="object"&&wn($e,String,(Ee,ze)=>ze.isPrototypeOf(Ee))?"string":G},Qt=$e=>G=>Yt(G)===$e,Wt=$e=>G=>typeof G===$e,fn=$e=>G=>$e===G,st=Qt("string"),it=fn(void 0),Dt=$e=>$e==null,q=$e=>!Dt($e),at=Wt("function"),Et=($e=>()=>$e)(!1);class W{constructor(G,Ee){this.tag=G,this.value=Ee}static some(G){return new W(!0,G)}static none(){return W.singletonNone}fold(G,Ee){return this.tag?Ee(this.value):G()}isSome(){return this.tag}isNone(){return!this.tag}map(G){return this.tag?W.some(G(this.value)):W.none()}bind(G){return this.tag?G(this.value):W.none()}exists(G){return this.tag&&G(this.value)}forall(G){return!this.tag||G(this.value)}filter(G){return!this.tag||G(this.value)?this:W.none()}getOr(G){return this.tag?this.value:G}or(G){return this.tag?this:G}getOrThunk(G){return this.tag?this.value:G()}orThunk(G){return this.tag?this:G()}getOrDie(G){if(this.tag)return this.value;throw new Error(G??"Called getOrDie on None")}static from(G){return q(G)?W.some(G):W.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(G){this.tag&&G(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}W.singletonNone=new W(!1);const Ut=Array.prototype.slice,cn=Array.prototype.indexOf,St=($e,G)=>cn.call($e,G),Ue=($e,G)=>St($e,G)>-1,ce=($e,G)=>{const Ee=$e.length,ze=new Array(Ee);for(let Mt=0;Mt<Ee;Mt++){const Nn=$e[Mt];ze[Mt]=G(Nn,Mt)}return ze},Zn=($e,G)=>{const Ee=[];for(let ze=0,Mt=$e.length;ze<Mt;ze++){const Nn=$e[ze];G(Nn,ze)&&Ee.push(Nn)}return Ee},Ie=($e,G,Ee)=>{for(let ze=0,Mt=$e.length;ze<Mt;ze++){const Nn=$e[ze];if(G(Nn,ze))return W.some(Nn);if(Ee(Nn,ze))break}return W.none()},pe=($e,G)=>Ie($e,G,Et),S=($e,G)=>{const Ee=Ut.call($e,0);return Ee.sort(G),Ee},je=Object.keys,me=Object.hasOwnProperty,kt=($e,G)=>Rt($e,G)?W.from($e[G]):W.none(),Rt=($e,G)=>me.call($e,G),we=$e=>{const G=[],Ee=ze=>{G.push(ze)};for(let ze=0;ze<$e.length;ze++)$e[ze].each(Ee);return G};var Nt=tinymce.util.Tools.resolve("tinymce.Resource"),bn=tinymce.util.Tools.resolve("tinymce.util.I18n");const Qe=($e,G)=>Nt.load(`tinymce.html-i18n.help-keynav.${G}`,`${$e}/js/i18n/keynav/${G}.js`),Zt=$e=>Qe($e,bn.getCode()).catch(()=>Qe($e,"en")),Oe=($e,G)=>{$e.on("init",()=>{Zt(G)})},ot=async $e=>({name:"keyboardnav",title:"Keyboard Navigation",items:[{type:"htmlpanel",presets:"document",html:await Zt($e)}]});var F=tinymce.util.Tools.resolve("tinymce.Env");const po=$e=>{const G=F.os.isMacOS()||F.os.isiOS(),Mt=G?{alt:"⌥",ctrl:"⌃",shift:"⇧",meta:"⌘",access:"⌃⌥"}:{meta:"Ctrl ",access:"Shift + Alt "},Nn=$e.split("+"),Rn=ce(Nn,Wn=>{const zn=Wn.toLowerCase().trim();return Rt(Mt,zn)?Mt[zn]:Wn});return G?Rn.join("").replace(/\s/,""):Rn.join("+")},ht=[{shortcuts:["Meta + B"],action:"Bold"},{shortcuts:["Meta + I"],action:"Italic"},{shortcuts:["Meta + U"],action:"Underline"},{shortcuts:["Meta + A"],action:"Select all"},{shortcuts:["Meta + Y","Meta + Shift + Z"],action:"Redo"},{shortcuts:["Meta + Z"],action:"Undo"},{shortcuts:["Access + 1"],action:"Heading 1"},{shortcuts:["Access + 2"],action:"Heading 2"},{shortcuts:["Access + 3"],action:"Heading 3"},{shortcuts:["Access + 4"],action:"Heading 4"},{shortcuts:["Access + 5"],action:"Heading 5"},{shortcuts:["Access + 6"],action:"Heading 6"},{shortcuts:["Access + 7"],action:"Paragraph"},{shortcuts:["Access + 8"],action:"Div"},{shortcuts:["Access + 9"],action:"Address"},{shortcuts:["Alt + 0"],action:"Open help dialog"},{shortcuts:["Alt + F9"],action:"Focus to menubar"},{shortcuts:["Alt + F10"],action:"Focus to toolbar"},{shortcuts:["Alt + F11"],action:"Focus to element path"},{shortcuts:["Ctrl + F9"],action:"Focus to contextual toolbar"},{shortcuts:["Shift + Enter"],action:"Open popup menu for split buttons"},{shortcuts:["Meta + K"],action:"Insert link (if link plugin activated)"},{shortcuts:["Meta + S"],action:"Save (if save plugin activated)"},{shortcuts:["Meta + F"],action:"Find (if searchreplace plugin activated)"},{shortcuts:["Meta + Shift + F"],action:"Switch to or from fullscreen mode"}],Pt=()=>{const $e=ce(ht,Ee=>{const ze=ce(Ee.shortcuts,po).join(" or ");return[Ee.action,ze]});return{name:"shortcuts",title:"Handy Shortcuts",items:[{type:"table",header:["Action","Shortcut"],cells:$e}]}},an=ce([{key:"accordion",name:"Accordion"},{key:"advlist",name:"Advanced List"},{key:"anchor",name:"Anchor"},{key:"autolink",name:"Autolink"},{key:"autoresize",name:"Autoresize"},{key:"autosave",name:"Autosave"},{key:"charmap",name:"Character Map"},{key:"code",name:"Code"},{key:"codesample",name:"Code Sample"},{key:"colorpicker",name:"Color Picker"},{key:"directionality",name:"Directionality"},{key:"emoticons",name:"Emoticons"},{key:"fullscreen",name:"Full Screen"},{key:"help",name:"Help"},{key:"image",name:"Image"},{key:"importcss",name:"Import CSS"},{key:"insertdatetime",name:"Insert Date/Time"},{key:"link",name:"Link"},{key:"lists",name:"Lists"},{key:"media",name:"Media"},{key:"nonbreaking",name:"Nonbreaking"},{key:"pagebreak",name:"Page Break"},{key:"preview",name:"Preview"},{key:"quickbars",name:"Quick Toolbars"},{key:"save",name:"Save"},{key:"searchreplace",name:"Search and Replace"},{key:"table",name:"Table"},{key:"template",name:"Template"},{key:"textcolor",name:"Text Color"},{key:"visualblocks",name:"Visual Blocks"},{key:"visualchars",name:"Visual Characters"},{key:"wordcount",name:"Word Count"},{key:"a11ychecker",name:"Accessibility Checker",type:"premium"},{key:"advcode",name:"Advanced Code Editor",type:"premium"},{key:"advtable",name:"Advanced Tables",type:"premium"},{key:"advtemplate",name:"Advanced Templates",type:"premium",slug:"advanced-templates"},{key:"ai",name:"AI Assistant",type:"premium"},{key:"casechange",name:"Case Change",type:"premium"},{key:"checklist",name:"Checklist",type:"premium"},{key:"editimage",name:"Enhanced Image Editing",type:"premium"},{key:"footnotes",name:"Footnotes",type:"premium"},{key:"typography",name:"Advanced Typography",type:"premium",slug:"advanced-typography"},{key:"mediaembed",name:"Enhanced Media Embed",type:"premium",slug:"introduction-to-mediaembed"},{key:"export",name:"Export",type:"premium"},{key:"formatpainter",name:"Format Painter",type:"premium"},{key:"inlinecss",name:"Inline CSS",type:"premium",slug:"inline-css"},{key:"linkchecker",name:"Link Checker",type:"premium"},{key:"mentions",name:"Mentions",type:"premium"},{key:"mergetags",name:"Merge Tags",type:"premium"},{key:"pageembed",name:"Page Embed",type:"premium"},{key:"permanentpen",name:"Permanent Pen",type:"premium"},{key:"powerpaste",name:"PowerPaste",type:"premium",slug:"introduction-to-powerpaste"},{key:"rtc",name:"Real-Time Collaboration",type:"premium",slug:"rtc-introduction"},{key:"tinymcespellchecker",name:"Spell Checker Pro",type:"premium",slug:"introduction-to-tiny-spellchecker"},{key:"autocorrect",name:"Spelling Autocorrect",type:"premium"},{key:"tableofcontents",name:"Table of Contents",type:"premium"},{key:"tinycomments",name:"Tiny Comments",type:"premium",slug:"introduction-to-tiny-comments"},{key:"tinydrive",name:"Tiny Drive",type:"premium",slug:"tinydrive-introduction"}],$e=>({...$e,type:$e.type||"opensource",slug:$e.slug||$e.key})),so=$e=>{const G=()=>{const Do=Zn(an,({type:At})=>At==="premium"),Xe=S(ce(Do,At=>At.name),(At,Ft)=>At.localeCompare(Ft)),lt=ce(Xe,At=>`<li>${At}</li>`).join("");return"<div><p><b>"+bn.translate("Premium plugins:")+"</b></p><ul>"+lt+'<li class="tox-help__more-link" "><a href="https://www.tiny.cloud/pricing/?utm_campaign=help_dialog_plugin_tab&utm_source=tiny&utm_medium=referral&utm_term=read_more&utm_content=premium_plugin_heading" rel="noopener" target="_blank" data-alloy-tabstop="true" tabindex="-1">'+bn.translate("Learn more...")+"</a></li></ul></div>"},Ee=Do=>`<a data-alloy-tabstop="true" tabindex="-1" href="${Do.url}" target="_blank" rel="noopener">${Do.name}</a>`,ze=(Do,Xe)=>{const lt=Do.plugins[Xe].getMetadata;if(at(lt)){const At=lt();return{name:At.name,html:Ee(At)}}else return{name:Xe,html:Xe}},Mt=(Do,Xe)=>pe(an,lt=>lt.key===Xe).fold(()=>ze(Do,Xe),lt=>{const At=lt.type==="premium"?`${lt.name}*`:lt.name,Ft=Ee({name:At,url:`https://www.tiny.cloud/docs/tinymce/6/${lt.slug}/`});return{name:At,html:Ft}}),Nn=Do=>{const Xe=je(Do.plugins),lt=dt(Do);return it(lt)?Xe:Zn(Xe,At=>!Ue(lt,At))},Rn=Do=>{const Xe=Nn(Do),lt=S(ce(Xe,vo=>Mt(Do,vo)),(vo,fs)=>vo.name.localeCompare(fs.name)),At=ce(lt,vo=>"<li>"+vo.html+"</li>"),Ft=At.length,$n=At.join("");return"<p><b>"+bn.translate(["Plugins installed ({0}):",Ft])+"</b></p><ul>"+$n+"</ul>"};return{name:"plugins",title:"Plugins",items:[{type:"htmlpanel",presets:"document",html:[(Do=>Do==null?"":"<div>"+Rn(Do)+"</div>")($e),G()].join("")}]}};var le=tinymce.util.Tools.resolve("tinymce.EditorManager");const Ne=()=>{const Ee='<a data-alloy-tabstop="true" tabindex="-1" href="https://www.tiny.cloud/docs/tinymce/6/changelog/?utm_campaign=help_dialog_version_tab&utm_source=tiny&utm_medium=referral" rel="noopener" target="_blank">TinyMCE '+((Mt,Nn)=>Mt.indexOf("@")===0?"X.X.X":Mt+"."+Nn)(le.majorVersion,le.minorVersion)+"</a>";return{name:"versions",title:"Version",items:[{type:"htmlpanel",html:"<p>"+bn.translate(["You are using {0}",Ee])+"</p>",presets:"document"}]}},ke=($e,G)=>{const Ee={},ze=ce($e,Mt=>{var Nn;if(st(Mt))return Rt(G,Mt)&&(Ee[Mt]=G[Mt]),Mt;{const Rn=(Nn=Mt.name)!==null&&Nn!==void 0?Nn:He("tab-name");return Ee[Rn]=Mt,Rn}});return{tabs:Ee,names:ze}},Y=$e=>{const G=je($e),Ee=G.indexOf("versions");return Ee!==-1&&(G.splice(Ee,1),G.push("versions")),{tabs:$e,names:G}},re=async($e,G,Ee)=>{const ze=Pt(),Mt=await ot(Ee),Nn=so($e),Rn=Ne(),Wn={[ze.name]:ze,[Mt.name]:Mt,[Nn.name]:Nn,[Rn.name]:Rn,...G.get()};return W.from(Ye($e)).fold(()=>Y(Wn),zn=>ke(zn,Wn))},xe=($e,G,Ee)=>()=>{re($e,G,Ee).then(({tabs:ze,names:Mt})=>{const Nn=ce(Mt,zn=>kt(ze,zn)),Wn={type:"tabpanel",tabs:we(Nn)};$e.windowManager.open({title:"Help",size:"medium",body:Wn,buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}],initialData:{}})})};var Se=()=>{_e.add("help",($e,G)=>{const Ee=I({}),ze=Re(Ee);te($e);const Mt=xe($e,Ee,G);return Jt($e,Mt),oe($e,Mt),$e.shortcuts.add("Alt+0","Open help dialog","mceHelp"),Oe($e,G),ze})};Se()}(),function(){var I=tinymce.util.Tools.resolve("tinymce.PluginManager");const _e=Object.getPrototypeOf,ie=(M,ee,ge)=>{var pt;return ge(M,ee.prototype)?!0:((pt=M.constructor)===null||pt===void 0?void 0:pt.name)===ee.name},He=M=>{const ee=typeof M;return M===null?"null":ee==="object"&&Array.isArray(M)?"array":ee==="object"&&ie(M,String,(ge,pt)=>pt.isPrototypeOf(ge))?"string":ee},Re=M=>ee=>He(ee)===M,oe=M=>ee=>typeof ee===M,qe=M=>ee=>M===ee,te=(M,ee)=>dt(M)&&ie(M,ee,(ge,pt)=>_e(ge)===pt),Ye=Re("string"),dt=Re("object"),Jt=M=>te(M,Object),wn=Re("array"),Yt=qe(null),Qt=oe("boolean"),Wt=M=>M==null,fn=M=>!Wt(M),st=oe("function"),it=oe("number"),Dt=(M,ee)=>{if(wn(M)){for(let ge=0,pt=M.length;ge<pt;++ge)if(!ee(M[ge]))return!1;return!0}return!1},q=()=>{};class at{constructor(ee,ge){this.tag=ee,this.value=ge}static some(ee){return new at(!0,ee)}static none(){return at.singletonNone}fold(ee,ge){return this.tag?ge(this.value):ee()}isSome(){return this.tag}isNone(){return!this.tag}map(ee){return this.tag?at.some(ee(this.value)):at.none()}bind(ee){return this.tag?ee(this.value):at.none()}exists(ee){return this.tag&&ee(this.value)}forall(ee){return!this.tag||ee(this.value)}filter(ee){return!this.tag||ee(this.value)?this:at.none()}getOr(ee){return this.tag?this.value:ee}or(ee){return this.tag?this:ee}getOrThunk(ee){return this.tag?this.value:ee()}orThunk(ee){return this.tag?this:ee()}getOrDie(ee){if(this.tag)return this.value;throw new Error(ee??"Called getOrDie on None")}static from(ee){return fn(ee)?at.some(ee):at.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(ee){this.tag&&ee(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}at.singletonNone=new at(!1);const Pn=Object.keys,Et=Object.hasOwnProperty,W=(M,ee)=>{const ge=Pn(M);for(let pt=0,Sn=ge.length;pt<Sn;pt++){const ts=ge[pt],Hn=M[ts];ee(Hn,ts)}},Ut=M=>(ee,ge)=>{M[ge]=ee},cn=(M,ee,ge,pt)=>{W(M,(Sn,ts)=>{(ee(Sn,ts)?ge:pt)(Sn,ts)})},St=(M,ee)=>{const ge={};return cn(M,ee,Ut(ge),q),ge},Ue=(M,ee)=>Et.call(M,ee),ce=(M,ee)=>Ue(M,ee)&&M[ee]!==void 0&&M[ee]!==null,Zn=Array.prototype.push,Ie=M=>{const ee=[];for(let ge=0,pt=M.length;ge<pt;++ge){if(!wn(M[ge]))throw new Error("Arr.flatten item "+ge+" was not an array, input: "+M);Zn.apply(ee,M[ge])}return ee},pe=(M,ee)=>ee>=0&&ee<M.length?at.some(M[ee]):at.none(),S=M=>pe(M,0),je=(M,ee)=>{for(let ge=0;ge<M.length;ge++){const pt=ee(M[ge],ge);if(pt.isSome())return pt}return at.none()};typeof window<"u"||Function("return this;")();const me=(M,ee,ge)=>{if(Ye(ge)||Qt(ge)||it(ge))M.setAttribute(ee,ge+"");else throw console.error("Invalid call to Attribute.set. Key ",ee,":: Value ",ge,":: Element ",M),new Error("Attribute value was not simple")},kt=(M,ee,ge)=>{me(M.dom,ee,ge)},Rt=(M,ee)=>{M.dom.removeAttribute(ee)},we=(M,ee)=>{const pt=(ee||document).createElement("div");if(pt.innerHTML=M,!pt.hasChildNodes()||pt.childNodes.length>1){const Sn="HTML does not have a single root node";throw console.error(Sn,M),new Error(Sn)}return Qe(pt.childNodes[0])},Nt=(M,ee)=>{const pt=(ee||document).createElement(M);return Qe(pt)},bn=(M,ee)=>{const pt=(ee||document).createTextNode(M);return Qe(pt)},Qe=M=>{if(M==null)throw new Error("Node cannot be null or undefined");return{dom:M}},Oe={fromHtml:we,fromTag:Nt,fromText:bn,fromDom:Qe,fromPoint:(M,ee,ge)=>at.from(M.dom.elementFromPoint(ee,ge)).map(Qe)};var ot=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),F=tinymce.util.Tools.resolve("tinymce.util.URI");const po=M=>M.length>0,ht=M=>ee=>ee.options.get(M),Pt=M=>{const ee=M.options.register;ee("image_dimensions",{processor:"boolean",default:!0}),ee("image_advtab",{processor:"boolean",default:!1}),ee("image_uploadtab",{processor:"boolean",default:!0}),ee("image_prepend_url",{processor:"string",default:""}),ee("image_class_list",{processor:"object[]"}),ee("image_description",{processor:"boolean",default:!0}),ee("image_title",{processor:"boolean",default:!1}),ee("image_caption",{processor:"boolean",default:!1}),ee("image_list",{processor:ge=>{const pt=ge===!1||Ye(ge)||Dt(ge,dt)||st(ge);return pt?{value:ge,valid:pt}:{valid:!1,message:"Must be false, a string, an array or a function."}},default:!1})},an=ht("image_dimensions"),so=ht("image_advtab"),le=ht("image_uploadtab"),Ne=ht("image_prepend_url"),ke=ht("image_class_list"),Y=ht("image_description"),re=ht("image_title"),xe=ht("image_caption"),Se=ht("image_list"),$e=ht("a11y_advanced_options"),G=ht("automatic_uploads"),Ee=M=>po(M.options.get("images_upload_url")),ze=M=>fn(M.options.get("images_upload_handler")),Mt=(M,ee)=>Math.max(parseInt(M,10),parseInt(ee,10)),Nn=M=>new Promise(ee=>{const ge=document.createElement("img"),pt=ts=>{ge.onload=ge.onerror=null,ge.parentNode&&ge.parentNode.removeChild(ge),ee(ts)};ge.onload=()=>{const ts=Mt(ge.width,ge.clientWidth),Hn=Mt(ge.height,ge.clientHeight),yr={width:ts,height:Hn};pt(Promise.resolve(yr))},ge.onerror=()=>{pt(Promise.reject(`Failed to get image dimensions for: ${M}`))};const Sn=ge.style;Sn.visibility="hidden",Sn.position="fixed",Sn.bottom=Sn.left="0px",Sn.width=Sn.height="auto",document.body.appendChild(ge),ge.src=M}),Rn=M=>(M&&(M=M.replace(/px$/,"")),M),Wn=M=>(M.length>0&&/^[0-9]+$/.test(M)&&(M+="px"),M),zn=M=>{if(M.margin){const ee=String(M.margin).split(" ");switch(ee.length){case 1:M["margin-top"]=M["margin-top"]||ee[0],M["margin-right"]=M["margin-right"]||ee[0],M["margin-bottom"]=M["margin-bottom"]||ee[0],M["margin-left"]=M["margin-left"]||ee[0];break;case 2:M["margin-top"]=M["margin-top"]||ee[0],M["margin-right"]=M["margin-right"]||ee[1],M["margin-bottom"]=M["margin-bottom"]||ee[0],M["margin-left"]=M["margin-left"]||ee[1];break;case 3:M["margin-top"]=M["margin-top"]||ee[0],M["margin-right"]=M["margin-right"]||ee[1],M["margin-bottom"]=M["margin-bottom"]||ee[2],M["margin-left"]=M["margin-left"]||ee[1];break;case 4:M["margin-top"]=M["margin-top"]||ee[0],M["margin-right"]=M["margin-right"]||ee[1],M["margin-bottom"]=M["margin-bottom"]||ee[2],M["margin-left"]=M["margin-left"]||ee[3]}delete M.margin}return M},Do=(M,ee)=>{const ge=Se(M);Ye(ge)?fetch(ge).then(pt=>{pt.ok&&pt.json().then(ee)}):st(ge)?ge(ee):ee(ge)},Xe=(M,ee,ge)=>{const pt=()=>{ge.onload=ge.onerror=null,M.selection&&(M.selection.select(ge),M.nodeChanged())};ge.onload=()=>{!ee.width&&!ee.height&&an(M)&&M.dom.setAttribs(ge,{width:String(ge.clientWidth),height:String(ge.clientHeight)}),pt()},ge.onerror=pt},lt=M=>new Promise((ee,ge)=>{const pt=new FileReader;pt.onload=()=>{ee(pt.result)},pt.onerror=()=>{var Sn;ge((Sn=pt.error)===null||Sn===void 0?void 0:Sn.message)},pt.readAsDataURL(M)}),At=M=>M.nodeName==="IMG"&&(M.hasAttribute("data-mce-object")||M.hasAttribute("data-mce-placeholder")),Ft=(M,ee)=>{const ge=M.options.get;return F.isDomSafe(ee,"img",{allow_html_data_urls:ge("allow_html_data_urls"),allow_script_urls:ge("allow_script_urls"),allow_svg_data_urls:ge("allow_svg_data_urls")})},$n=ot.DOM,xo=M=>M.style.marginLeft&&M.style.marginRight&&M.style.marginLeft===M.style.marginRight?Rn(M.style.marginLeft):"",vo=M=>M.style.marginTop&&M.style.marginBottom&&M.style.marginTop===M.style.marginBottom?Rn(M.style.marginTop):"",fs=M=>M.style.borderWidth?Rn(M.style.borderWidth):"",Bo=(M,ee)=>{var ge;return M.hasAttribute(ee)&&(ge=M.getAttribute(ee))!==null&&ge!==void 0?ge:""},Es=M=>M.parentNode!==null&&M.parentNode.nodeName==="FIGURE",Kt=(M,ee,ge)=>{ge===""||ge===null?M.removeAttribute(ee):M.setAttribute(ee,ge)},Vo=M=>{const ee=$n.create("figure",{class:"image"});$n.insertAfter(ee,M),ee.appendChild(M),ee.appendChild($n.create("figcaption",{contentEditable:"true"},"Caption")),ee.contentEditable="false"},tr=M=>{const ee=M.parentNode;fn(ee)&&($n.insertAfter(M,ee),$n.remove(ee))},Vr=M=>{Es(M)?tr(M):Vo(M)},Rr=(M,ee)=>{const ge=M.getAttribute("style"),pt=ee(ge!==null?ge:"");pt.length>0?(M.setAttribute("style",pt),M.setAttribute("data-mce-style",pt)):M.removeAttribute("style")},kr=(M,ee)=>(ge,pt,Sn)=>{const ts=ge.style;ts[pt]?(ts[pt]=Wn(Sn),Rr(ge,ee)):Kt(ge,pt,Sn)},Cs=(M,ee)=>M.style[ee]?Rn(M.style[ee]):Bo(M,ee),zr=(M,ee)=>{const ge=Wn(ee);M.style.marginLeft=ge,M.style.marginRight=ge},Qr=(M,ee)=>{const ge=Wn(ee);M.style.marginTop=ge,M.style.marginBottom=ge},Ts=(M,ee)=>{const ge=Wn(ee);M.style.borderWidth=ge},ao=(M,ee)=>{M.style.borderStyle=ee},ur=M=>{var ee;return(ee=M.style.borderStyle)!==null&&ee!==void 0?ee:""},Je=M=>fn(M)&&M.nodeName==="FIGURE",bt=M=>M.nodeName==="IMG",yn=M=>$n.getAttrib(M,"alt").length===0&&$n.getAttrib(M,"role")==="presentation",Mn=M=>yn(M)?"":Bo(M,"alt"),To=()=>({src:"",alt:"",title:"",width:"",height:"",class:"",style:"",caption:!1,hspace:"",vspace:"",border:"",borderStyle:"",isDecorative:!1}),is=(M,ee)=>{var ge;const pt=document.createElement("img");return Kt(pt,"style",ee.style),(xo(pt)||ee.hspace!=="")&&zr(pt,ee.hspace),(vo(pt)||ee.vspace!=="")&&Qr(pt,ee.vspace),(fs(pt)||ee.border!=="")&&Ts(pt,ee.border),(ur(pt)||ee.borderStyle!=="")&&ao(pt,ee.borderStyle),M((ge=pt.getAttribute("style"))!==null&&ge!==void 0?ge:"")},Hr=(M,ee)=>{const ge=document.createElement("img");if(Tt(M,{...ee,caption:!1},ge),Ce(ge,ee.alt,ee.isDecorative),ee.caption){const pt=$n.create("figure",{class:"image"});return pt.appendChild(ge),pt.appendChild($n.create("figcaption",{contentEditable:"true"},"Caption")),pt.contentEditable="false",pt}else return ge},Ur=(M,ee)=>({src:Bo(ee,"src"),alt:Mn(ee),title:Bo(ee,"title"),width:Cs(ee,"width"),height:Cs(ee,"height"),class:Bo(ee,"class"),style:M(Bo(ee,"style")),caption:Es(ee),hspace:xo(ee),vspace:vo(ee),border:fs(ee),borderStyle:ur(ee),isDecorative:yn(ee)}),pr=(M,ee,ge,pt,Sn)=>{ge[pt]!==ee[pt]&&Sn(M,pt,String(ge[pt]))},Ce=(M,ee,ge)=>{if(ge){$n.setAttrib(M,"role","presentation");const pt=Oe.fromDom(M);kt(pt,"alt","")}else{if(Yt(ee)){const pt=Oe.fromDom(M);Rt(pt,"alt")}else{const pt=Oe.fromDom(M);kt(pt,"alt",ee)}$n.getAttrib(M,"role")==="presentation"&&$n.setAttrib(M,"role","")}},be=(M,ee,ge)=>{(ge.alt!==ee.alt||ge.isDecorative!==ee.isDecorative)&&Ce(M,ge.alt,ge.isDecorative)},mt=(M,ee)=>(ge,pt,Sn)=>{M(ge,Sn),Rr(ge,ee)},Tt=(M,ee,ge)=>{const pt=Ur(M,ge);pr(ge,pt,ee,"caption",(Sn,ts,Hn)=>Vr(Sn)),pr(ge,pt,ee,"src",Kt),pr(ge,pt,ee,"title",Kt),pr(ge,pt,ee,"width",kr("width",M)),pr(ge,pt,ee,"height",kr("height",M)),pr(ge,pt,ee,"class",Kt),pr(ge,pt,ee,"style",mt((Sn,ts)=>Kt(Sn,"style",ts),M)),pr(ge,pt,ee,"hspace",mt(zr,M)),pr(ge,pt,ee,"vspace",mt(Qr,M)),pr(ge,pt,ee,"border",mt(Ts,M)),pr(ge,pt,ee,"borderStyle",mt(ao,M)),be(ge,pt,ee)},Yn=(M,ee)=>{const ge=M.dom.styles.parse(ee),pt=zn(ge),Sn=M.dom.styles.parse(M.dom.styles.serialize(pt));return M.dom.styles.serialize(Sn)},lo=M=>{const ee=M.selection.getNode(),ge=M.dom.getParent(ee,"figure.image");return ge?M.dom.select("img",ge)[0]:ee&&(ee.nodeName!=="IMG"||At(ee))?null:ee},Go=(M,ee)=>{var ge;const pt=M.dom,Sn=St(M.schema.getTextBlockElements(),(Hn,yr)=>!M.schema.isValidChild(yr,"figure")),ts=pt.getParent(ee.parentNode,Hn=>ce(Sn,Hn.nodeName),M.getBody());return ts&&(ge=pt.split(ts,ee))!==null&&ge!==void 0?ge:ee},Xs=M=>{const ee=lo(M);return ee?Ur(ge=>Yn(M,ge),ee):To()},Fe=(M,ee)=>{const ge=Hr(Sn=>Yn(M,Sn),ee);M.dom.setAttrib(ge,"data-mce-id","__mcenew"),M.focus(),M.selection.setContent(ge.outerHTML);const pt=M.dom.select('*[data-mce-id="__mcenew"]')[0];if(M.dom.setAttrib(pt,"data-mce-id",null),Je(pt)){const Sn=Go(M,pt);M.selection.select(Sn)}else M.selection.select(pt)},Ao=(M,ee)=>{M.dom.setAttrib(ee,"src",ee.getAttribute("src"))},ve=(M,ee)=>{if(ee){const ge=M.dom.is(ee.parentNode,"figure.image")?ee.parentNode:ee;M.dom.remove(ge),M.focus(),M.nodeChanged(),M.dom.isEmpty(M.getBody())&&(M.setContent(""),M.selection.setCursorLocation())}},Be=(M,ee)=>{const ge=lo(M);if(ge)if(Tt(pt=>Yn(M,pt),ee,ge),Ao(M,ge),Je(ge.parentNode)){const pt=ge.parentNode;Go(M,pt),M.selection.select(ge.parentNode)}else M.selection.select(ge),Xe(M,ee,ge)},It=(M,ee)=>{const ge=ee.src;return{...ee,src:Ft(M,ge)?ge:""}},Xt=(M,ee)=>{const ge=lo(M);if(ge){const Sn={...Ur(Hn=>Yn(M,Hn),ge),...ee},ts=It(M,Sn);Sn.src?Be(M,ts):ve(M,ge)}else ee.src&&Fe(M,{...To(),...ee})},qn=(M=>(...ee)=>{if(ee.length===0)throw new Error("Can't merge zero objects");const ge={};for(let pt=0;pt<ee.length;pt++){const Sn=ee[pt];for(const ts in Sn)Ue(Sn,ts)&&(ge[ts]=M(ge[ts],Sn[ts]))}return ge})((M,ee)=>Jt(M)&&Jt(ee)?qn(M,ee):ee);var Kn=tinymce.util.Tools.resolve("tinymce.util.ImageUploader"),Xn=tinymce.util.Tools.resolve("tinymce.util.Tools");const fo=M=>Ye(M.value)?M.value:"",rs=M=>Ye(M.text)?M.text:Ye(M.title)?M.title:"",js=(M,ee)=>{const ge=[];return Xn.each(M,pt=>{const Sn=rs(pt);if(pt.menu!==void 0){const ts=js(pt.menu,ee);ge.push({text:Sn,items:ts})}else{const ts=ee(pt);ge.push({text:Sn,value:ts})}}),ge},Fa=(M=fo)=>ee=>ee?at.from(ee).map(ge=>js(ge,M)):at.none(),gc=M=>Fa(fo)(M),kc=M=>Ue(M,"items"),So=(M,ee)=>je(M,ge=>kc(ge)?So(ge.items,ee):ge.value===ee?at.some(ge):at.none()),As={sanitizer:Fa,sanitize:gc,findEntry:(M,ee)=>M.bind(ge=>So(ge,ee))},ea={makeTab:M=>({title:"Advanced",name:"advanced",items:[{type:"grid",columns:2,items:[{type:"input",label:"Vertical space",name:"vspace",inputMode:"numeric"},{type:"input",label:"Horizontal space",name:"hspace",inputMode:"numeric"},{type:"input",label:"Border width",name:"border",inputMode:"numeric"},{type:"listbox",name:"borderstyle",label:"Border style",items:[{text:"Select...",value:""},{text:"Solid",value:"solid"},{text:"Dotted",value:"dotted"},{text:"Dashed",value:"dashed"},{text:"Double",value:"double"},{text:"Groove",value:"groove"},{text:"Ridge",value:"ridge"},{text:"Inset",value:"inset"},{text:"Outset",value:"outset"},{text:"None",value:"none"},{text:"Hidden",value:"hidden"}]}]}]})},hr=M=>{const ee=As.sanitizer(vr=>M.convertURL(vr.value||vr.url||"","src")),ge=new Promise(vr=>{Do(M,Hl=>{vr(ee(Hl).map(Er=>Ie([[{text:"None",value:""}],Er])))})}),pt=As.sanitize(ke(M)),Sn=so(M),ts=le(M),Hn=Ee(M),yr=ze(M),tn=Xs(M),nr=Y(M),Za=re(M),ar=an(M),aa=xe(M),ml=$e(M),gs=G(M),Ja=at.some(Ne(M)).filter(vr=>Ye(vr)&&vr.length>0);return ge.then(vr=>({image:tn,imageList:vr,classList:pt,hasAdvTab:Sn,hasUploadTab:ts,hasUploadUrl:Hn,hasUploadHandler:yr,hasDescription:nr,hasImageTitle:Za,hasDimensions:ar,hasImageCaption:aa,prependURL:Ja,hasAccessibilityOptions:ml,automaticUploads:gs}))},Zs=M=>{const ee={name:"src",type:"urlinput",filetype:"image",label:"Source",picker_text:"Browse files"},ge=M.imageList.map(Za=>({name:"images",type:"listbox",label:"Image list",items:Za})),pt={name:"alt",type:"input",label:"Alternative description",enabled:!(M.hasAccessibilityOptions&&M.image.isDecorative)},Sn={name:"title",type:"input",label:"Image title"},ts={name:"dimensions",type:"sizeinput"},Hn={type:"label",label:"Accessibility",items:[{name:"isDecorative",type:"checkbox",label:"Image is decorative"}]},yr=M.classList.map(Za=>({name:"classes",type:"listbox",label:"Class",items:Za})),tn={type:"label",label:"Caption",items:[{type:"checkbox",name:"caption",label:"Show caption"}]},nr=Za=>Za?{type:"grid",columns:2}:{type:"panel"};return Ie([[ee],ge.toArray(),M.hasAccessibilityOptions&&M.hasDescription?[Hn]:[],M.hasDescription?[pt]:[],M.hasImageTitle?[Sn]:[],M.hasDimensions?[ts]:[],[{...nr(M.classList.isSome()&&M.hasImageCaption),items:Ie([yr.toArray(),M.hasImageCaption?[tn]:[]])}]])},Vl={makeTab:M=>({title:"General",name:"general",items:Zs(M)}),makeItems:Zs},ra={makeTab:M=>({title:"Upload",name:"upload",items:[{type:"dropzone",name:"fileinput"}]})},Ia=M=>({prevImage:As.findEntry(M.imageList,M.image.src),prevAlt:M.image.alt,open:!0}),Wr=M=>({src:{value:M.src,meta:{}},images:M.src,alt:M.alt,title:M.title,dimensions:{width:M.width,height:M.height},classes:M.class,caption:M.caption,style:M.style,vspace:M.vspace,border:M.border,hspace:M.hspace,borderstyle:M.borderStyle,fileinput:[],isDecorative:M.isDecorative}),pc=(M,ee)=>({src:M.src.value,alt:(M.alt===null||M.alt.length===0)&&ee?null:M.alt,title:M.title,width:M.dimensions.width,height:M.dimensions.height,class:M.classes,style:M.style,caption:M.caption,hspace:M.hspace,vspace:M.vspace,border:M.border,borderStyle:M.borderstyle,isDecorative:M.isDecorative}),_c=(M,ee)=>/^(?:[a-zA-Z]+:)?\/\//.test(ee)?at.none():M.prependURL.bind(ge=>ee.substring(0,ge.length)!==ge?at.some(ge+ee):at.none()),wa=(M,ee)=>{const ge=ee.getData();_c(M,ge.src.value).each(pt=>{ee.setData({src:{value:pt,meta:ge.src.meta}})})},Ec=(M,ee,ge)=>{M.hasDescription&&Ye(ge.alt)&&(ee.alt=ge.alt),M.hasAccessibilityOptions&&(ee.isDecorative=ge.isDecorative||ee.isDecorative||!1),M.hasImageTitle&&Ye(ge.title)&&(ee.title=ge.title),M.hasDimensions&&(Ye(ge.width)&&(ee.dimensions.width=ge.width),Ye(ge.height)&&(ee.dimensions.height=ge.height)),Ye(ge.class)&&As.findEntry(M.classList,ge.class).each(pt=>{ee.classes=pt.value}),M.hasImageCaption&&Qt(ge.caption)&&(ee.caption=ge.caption),M.hasAdvTab&&(Ye(ge.style)&&(ee.style=ge.style),Ye(ge.vspace)&&(ee.vspace=ge.vspace),Ye(ge.border)&&(ee.border=ge.border),Ye(ge.hspace)&&(ee.hspace=ge.hspace),Ye(ge.borderstyle)&&(ee.borderstyle=ge.borderstyle))},Tc=(M,ee)=>{const ge=ee.getData(),pt=ge.src.meta;if(pt!==void 0){const Sn=qn({},ge);Ec(M,Sn,pt),ee.setData(Sn)}},Ti=(M,ee,ge,pt)=>{const Sn=pt.getData(),ts=Sn.src.value,Hn=Sn.src.meta||{};!Hn.width&&!Hn.height&&ee.hasDimensions&&(po(ts)?M.imageSize(ts).then(yr=>{ge.open&&pt.setData({dimensions:yr})}).catch(yr=>console.error(yr)):pt.setData({dimensions:{width:"",height:""}}))},hc=(M,ee,ge)=>{const pt=ge.getData(),Sn=As.findEntry(M.imageList,pt.src.value);ee.prevImage=Sn,ge.setData({images:Sn.map(ts=>ts.value).getOr("")})},zl=(M,ee,ge,pt)=>{wa(ee,pt),Tc(ee,pt),Ti(M,ee,ge,pt),hc(ee,ge,pt)},La=(M,ee,ge,pt)=>{const Sn=pt.getData(),ts=As.findEntry(ee.imageList,Sn.images);ts.each(Hn=>{Sn.alt===""||ge.prevImage.map(tn=>tn.text===Sn.alt).getOr(!1)?Hn.value===""?pt.setData({src:Hn,alt:ge.prevAlt}):pt.setData({src:Hn,alt:Hn.text}):pt.setData({src:Hn})}),ge.prevImage=ts,zl(M,ee,ge,pt)},dl=(M,ee,ge,pt)=>{const Sn=pt.getData();pt.block("Uploading image"),S(Sn.fileinput).fold(()=>{pt.unblock()},ts=>{const Hn=URL.createObjectURL(ts),yr=()=>{pt.unblock(),URL.revokeObjectURL(Hn)},tn=nr=>{pt.setData({src:{value:nr,meta:{}}}),pt.showTab("general"),zl(M,ee,ge,pt)};lt(ts).then(nr=>{const Za=M.createBlobCache(ts,Hn,nr);ee.automaticUploads?M.uploadImage(Za).then(ar=>{tn(ar.url),yr()}).catch(ar=>{yr(),M.alertErr(ar)}):(M.addToBlobCache(Za),tn(Za.blobUri()),pt.unblock())})})},Dl=(M,ee,ge)=>(pt,Sn)=>{Sn.name==="src"?zl(M,ee,ge,pt):Sn.name==="images"?La(M,ee,ge,pt):Sn.name==="alt"?ge.prevAlt=pt.getData().alt:Sn.name==="fileinput"?dl(M,ee,ge,pt):Sn.name==="isDecorative"&&pt.setEnabled("alt",!pt.getData().isDecorative)},ri=M=>()=>{M.open=!1},yu=M=>M.hasAdvTab||M.hasUploadUrl||M.hasUploadHandler?{type:"tabpanel",tabs:Ie([[Vl.makeTab(M)],M.hasAdvTab?[ea.makeTab(M)]:[],M.hasUploadTab&&(M.hasUploadUrl||M.hasUploadHandler)?[ra.makeTab(M)]:[]])}:{type:"panel",items:Vl.makeItems(M)},Z=(M,ee,ge)=>pt=>{const Sn=qn(Wr(ee.image),pt.getData()),ts={...Sn,style:is(ge.normalizeCss,pc(Sn,!1))};M.execCommand("mceUpdateImage",!1,pc(ts,ee.hasAccessibilityOptions)),M.editorUpload.uploadImagesAuto(),pt.close()},Ae=M=>ee=>Ft(M,ee)?Nn(M.documentBaseURI.toAbsolute(ee)).then(ge=>({width:String(ge.width),height:String(ge.height)})):Promise.resolve({width:"",height:""}),Ze=M=>(ee,ge,pt)=>{var Sn;return M.editorUpload.blobCache.create({blob:ee,blobUri:ge,name:(Sn=ee.name)===null||Sn===void 0?void 0:Sn.replace(/\.[^\.]+$/,""),filename:ee.name,base64:pt.split(",")[1]})},gt=M=>ee=>{M.editorUpload.blobCache.add(ee)},on=M=>ee=>{M.windowManager.alert(ee)},ho=M=>ee=>Yn(M,ee),Gs=M=>ee=>M.dom.parseStyle(ee),Js=M=>(ee,ge)=>M.dom.serializeStyle(ee,ge),zs=M=>ee=>Kn(M).upload([ee],!1).then(ge=>{var pt;return ge.length===0?Promise.reject("Failed to upload image"):ge[0].status===!1?Promise.reject((pt=ge[0].error)===null||pt===void 0?void 0:pt.message):ge[0]}),rr=M=>{const ee={imageSize:Ae(M),addToBlobCache:gt(M),createBlobCache:Ze(M),alertErr:on(M),normalizeCss:ho(M),parseStyle:Gs(M),serializeStyle:Js(M),uploadImage:zs(M)};return{open:()=>{hr(M).then(pt=>{const Sn=Ia(pt);return{title:"Insert/Edit Image",size:"normal",body:yu(pt),buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:Wr(pt.image),onSubmit:Z(M,pt,ee),onChange:Dl(ee,pt,Sn),onClose:ri(Sn)}}).then(M.windowManager.open)}}},us=M=>{M.addCommand("mceImage",rr(M).open),M.addCommand("mceUpdateImage",(ee,ge)=>{M.undoManager.transact(()=>Xt(M,ge))})},_r=M=>{const ee=M.attr("class");return fn(ee)&&/\bimage\b/.test(ee)},Va=M=>ee=>{let ge=ee.length;const pt=Sn=>{Sn.attr("contenteditable",M?"true":null)};for(;ge--;){const Sn=ee[ge];_r(Sn)&&(Sn.attr("contenteditable",M?"false":null),Xn.each(Sn.getAll("figcaption"),pt))}},ai=M=>{M.on("PreInit",()=>{M.parser.addNodeFilter("figure",Va(!0)),M.serializer.addNodeFilter("figure",Va(!1))})},Tn=M=>ee=>{const ge=()=>{ee.setEnabled(M.selection.isEditable())};return M.on("NodeChange",ge),ge(),()=>{M.off("NodeChange",ge)}},tu=M=>{M.ui.registry.addToggleButton("image",{icon:"image",tooltip:"Insert/edit image",onAction:rr(M).open,onSetup:ee=>{ee.setActive(fn(lo(M)));const ge=M.selection.selectorChangedWithUnbind("img:not([data-mce-object]):not([data-mce-placeholder]),figure.image",ee.setActive).unbind,pt=Tn(M)(ee);return()=>{ge(),pt()}}}),M.ui.registry.addMenuItem("image",{icon:"image",text:"Image...",onAction:rr(M).open,onSetup:Tn(M)}),M.ui.registry.addContextMenu("image",{update:ee=>M.selection.isEditable()&&(Je(ee)||bt(ee)&&!At(ee))?["image"]:[]})};var br=()=>{I.add("image",M=>{Pt(M),ai(M),tu(M),us(M)})};br()}(),function(){var I=tinymce.util.Tools.resolve("tinymce.PluginManager");const _e=(ht,Pt,an)=>{var so;return an(ht,Pt.prototype)?!0:((so=ht.constructor)===null||so===void 0?void 0:so.name)===Pt.name},ie=ht=>{const Pt=typeof ht;return ht===null?"null":Pt==="object"&&Array.isArray(ht)?"array":Pt==="object"&&_e(ht,String,(an,so)=>so.isPrototypeOf(an))?"string":Pt},He=ht=>Pt=>ie(Pt)===ht,Re=ht=>Pt=>typeof Pt===ht,oe=He("string"),qe=He("object"),te=He("array"),Ye=Re("function");var dt=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),Jt=tinymce.util.Tools.resolve("tinymce.EditorManager"),wn=tinymce.util.Tools.resolve("tinymce.Env"),Yt=tinymce.util.Tools.resolve("tinymce.util.Tools");const Qt=ht=>Pt=>Pt.options.get(ht),Wt=ht=>{const Pt=ht.options.register,an=so=>oe(so)||Ye(so)||qe(so);Pt("importcss_merge_classes",{processor:"boolean",default:!0}),Pt("importcss_exclusive",{processor:"boolean",default:!0}),Pt("importcss_selector_converter",{processor:"function"}),Pt("importcss_selector_filter",{processor:an}),Pt("importcss_file_filter",{processor:an}),Pt("importcss_groups",{processor:"object[]"}),Pt("importcss_append",{processor:"boolean",default:!1})},fn=Qt("importcss_merge_classes"),st=Qt("importcss_exclusive"),it=Qt("importcss_selector_converter"),Dt=Qt("importcss_selector_filter"),q=Qt("importcss_groups"),at=Qt("importcss_append"),Pn=Qt("importcss_file_filter"),Et=Qt("skin"),W=Qt("skin_url"),Ut=Array.prototype.push,cn=(ht,Pt)=>{const an=ht.length,so=new Array(an);for(let le=0;le<an;le++){const Ne=ht[le];so[le]=Pt(Ne,le)}return so},St=ht=>{const Pt=[];for(let an=0,so=ht.length;an<so;++an){if(!te(ht[an]))throw new Error("Arr.flatten item "+an+" was not an array, input: "+ht);Ut.apply(Pt,ht[an])}return Pt},Ue=(ht,Pt)=>St(cn(ht,Pt)),ce=()=>{const ht=[],Pt=[],an={};return{addItemToGroup:(ke,Y)=>{an[ke]?an[ke].push(Y):(Pt.push(ke),an[ke]=[Y])},addItem:ke=>{ht.push(ke)},toFormats:()=>Ue(Pt,Y=>{const re=an[Y];return re.length===0?[]:[{title:Y,items:re}]}).concat(ht)}},Zn=/^\.(?:ephox|tiny-pageembed|mce)(?:[.-]+\w+)+$/,Ie=ht=>{const Pt=wn.cacheSuffix;return oe(ht)&&(ht=ht.replace("?"+Pt,"").replace("&"+Pt,"")),ht},pe=(ht,Pt)=>{const an=Et(ht);if(an){const so=W(ht),le=so?ht.documentBaseURI.toAbsolute(so):Jt.baseURL+"/skins/ui/"+an,Ne=Jt.baseURL+"/skins/content/";return Pt===le+"/content"+(ht.inline?".inline":"")+".min.css"||Pt.indexOf(Ne)!==-1}return!1},S=ht=>oe(ht)?Pt=>Pt.indexOf(ht)!==-1:ht instanceof RegExp?Pt=>ht.test(Pt):ht,je=ht=>ht.styleSheet,me=ht=>ht.selectorText,kt=(ht,Pt,an)=>{const so=[],le={},Ne=(ke,Y)=>{let re=ke.href,xe;if(re=Ie(re),!(!re||an&&!an(re,Y)||pe(ht,re))){Yt.each(ke.imports,Se=>{Ne(Se,!0)});try{xe=ke.cssRules||ke.rules}catch{}Yt.each(xe,Se=>{je(Se)&&Se.styleSheet?Ne(Se.styleSheet,!0):me(Se)&&Yt.each(Se.selectorText.split(","),$e=>{so.push(Yt.trim($e))})})}};Yt.each(ht.contentCSS,ke=>{le[ke]=!0}),an||(an=(ke,Y)=>Y||le[ke]);try{Yt.each(Pt.styleSheets,ke=>{Ne(ke)})}catch{}return so},Rt=(ht,Pt)=>{let an={};const so=/^(?:([a-z0-9\-_]+))?(\.[a-z0-9_\-\.]+)$/i.exec(Pt);if(!so)return;const le=so[1],Ne=so[2].substr(1).split(".").join(" "),ke=Yt.makeMap("a,img");return so[1]?(an={title:Pt},ht.schema.getTextBlockElements()[le]?an.block=le:ht.schema.getBlockElements()[le]||ke[le.toLowerCase()]?an.selector=le:an.inline=le):so[2]&&(an={inline:"span",title:Pt.substr(1),classes:Ne}),fn(ht)?an.classes=Ne:an.attributes={class:Ne},an},we=(ht,Pt)=>Yt.grep(ht,an=>!an.filter||an.filter(Pt)),Nt=ht=>Yt.map(ht,Pt=>Yt.extend({},Pt,{original:Pt,selectors:{},filter:S(Pt.filter)})),bn=(ht,Pt)=>Pt===null||st(ht),Qe=(ht,Pt,an,so)=>!(bn(ht,an)?Pt in so:Pt in an.selectors),Zt=(ht,Pt,an,so)=>{bn(ht,an)?so[Pt]=!0:an.selectors[Pt]=!0},Oe=(ht,Pt,an,so)=>{let le;const Ne=it(ht);return so&&so.selector_converter?le=so.selector_converter:Ne?le=Ne:le=()=>Rt(ht,an),le.call(Pt,an,so)},ot=ht=>{ht.on("init",()=>{const Pt=ce(),an={},so=S(Dt(ht)),le=Nt(q(ht)),Ne=(Y,re)=>{if(Qe(ht,Y,re,an)){Zt(ht,Y,re,an);const xe=Oe(ht,ht.plugins.importcss,Y,re);if(xe){const Se=xe.name||dt.DOM.uniqueId();return ht.formatter.register(Se,xe),{title:xe.title,format:Se}}}return null};Yt.each(kt(ht,ht.getDoc(),S(Pn(ht))),Y=>{if(!Zn.test(Y)&&(!so||so(Y))){const re=we(le,Y);if(re.length>0)Yt.each(re,xe=>{const Se=Ne(Y,xe);Se&&Pt.addItemToGroup(xe.title,Se)});else{const xe=Ne(Y,null);xe&&Pt.addItem(xe)}}});const ke=Pt.toFormats();ht.dispatch("addStyleModifications",{items:ke,replace:!at(ht)})})},F=ht=>({convertSelectorToFormat:an=>Rt(ht,an)});var po=()=>{I.add("importcss",ht=>(Wt(ht),ot(ht),F(ht)))};po()}(),function(){var I=tinymce.util.Tools.resolve("tinymce.PluginManager");const _e=(_,B,U)=>{var he;return U(_,B.prototype)?!0:((he=_.constructor)===null||he===void 0?void 0:he.name)===B.name},ie=_=>{const B=typeof _;return _===null?"null":B==="object"&&Array.isArray(_)?"array":B==="object"&&_e(_,String,(U,he)=>he.isPrototypeOf(U))?"string":B},He=_=>B=>ie(B)===_,Re=_=>B=>typeof B===_,oe=He("string"),qe=He("object"),te=He("array"),Ye=Re("boolean"),dt=_=>_==null,Jt=_=>!dt(_),wn=Re("function"),Yt=Re("number"),Qt=()=>{},Wt=(_,B)=>U=>_(B(U)),fn=_=>()=>_,st=(_,B)=>_===B;function it(_,...B){return(...U)=>{const he=B.concat(U);return _.apply(null,he)}}const Dt=_=>B=>!_(B),q=fn(!1);class at{constructor(B,U){this.tag=B,this.value=U}static some(B){return new at(!0,B)}static none(){return at.singletonNone}fold(B,U){return this.tag?U(this.value):B()}isSome(){return this.tag}isNone(){return!this.tag}map(B){return this.tag?at.some(B(this.value)):at.none()}bind(B){return this.tag?B(this.value):at.none()}exists(B){return this.tag&&B(this.value)}forall(B){return!this.tag||B(this.value)}filter(B){return!this.tag||B(this.value)?this:at.none()}getOr(B){return this.tag?this.value:B}or(B){return this.tag?this:B}getOrThunk(B){return this.tag?this.value:B()}orThunk(B){return this.tag?this:B()}getOrDie(B){if(this.tag)return this.value;throw new Error(B??"Called getOrDie on None")}static from(B){return Jt(B)?at.some(B):at.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(B){this.tag&&B(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}at.singletonNone=new at(!1);const Pn=Array.prototype.slice,Et=Array.prototype.indexOf,W=Array.prototype.push,Ut=(_,B)=>Et.call(_,B),cn=(_,B)=>Ut(_,B)>-1,St=(_,B)=>{for(let U=0,he=_.length;U<he;U++){const Pe=_[U];if(B(Pe,U))return!0}return!1},Ue=(_,B)=>{const U=_.length,he=new Array(U);for(let Pe=0;Pe<U;Pe++){const nn=_[Pe];he[Pe]=B(nn,Pe)}return he},ce=(_,B)=>{for(let U=0,he=_.length;U<he;U++){const Pe=_[U];B(Pe,U)}},Zn=(_,B)=>{const U=[];for(let he=0,Pe=_.length;he<Pe;he++){const nn=_[he];B(nn,he)&&U.push(nn)}return U},Ie=(_,B)=>{if(_.length===0)return[];{let U=B(_[0]);const he=[];let Pe=[];for(let nn=0,Jn=_.length;nn<Jn;nn++){const zo=_[nn],Po=B(zo);Po!==U&&(he.push(Pe),Pe=[]),U=Po,Pe.push(zo)}return Pe.length!==0&&he.push(Pe),he}},pe=(_,B,U)=>(ce(_,(he,Pe)=>{U=B(U,he,Pe)}),U),S=(_,B,U)=>{for(let he=0,Pe=_.length;he<Pe;he++){const nn=_[he];if(B(nn,he))return at.some(nn);if(U(nn,he))break}return at.none()},je=(_,B)=>S(_,B,q),me=_=>{const B=[];for(let U=0,he=_.length;U<he;++U){if(!te(_[U]))throw new Error("Arr.flatten item "+U+" was not an array, input: "+_);W.apply(B,_[U])}return B},kt=(_,B)=>me(Ue(_,B)),Rt=_=>{const B=Pn.call(_,0);return B.reverse(),B},we=(_,B)=>B>=0&&B<_.length?at.some(_[B]):at.none(),Nt=_=>we(_,0),bn=_=>we(_,_.length-1),Qe=(_,B)=>{const U=[],he=wn(B)?Pe=>St(U,nn=>B(nn,Pe)):Pe=>cn(U,Pe);for(let Pe=0,nn=_.length;Pe<nn;Pe++){const Jn=_[Pe];he(Jn)||U.push(Jn)}return U},Zt=(_,B,U=st)=>_.exists(he=>U(he,B)),Oe=(_,B,U=st)=>ot(_,B,U).getOr(_.isNone()&&B.isNone()),ot=(_,B,U)=>_.isSome()&&B.isSome()?at.some(U(_.getOrDie(),B.getOrDie())):at.none(),F=8,po=9,ht=11,Pt=1,an=3,so=(_,B)=>{const he=(B||document).createElement("div");if(he.innerHTML=_,!he.hasChildNodes()||he.childNodes.length>1){const Pe="HTML does not have a single root node";throw console.error(Pe,_),new Error(Pe)}return ke(he.childNodes[0])},le=(_,B)=>{const he=(B||document).createElement(_);return ke(he)},Ne=(_,B)=>{const he=(B||document).createTextNode(_);return ke(he)},ke=_=>{if(_==null)throw new Error("Node cannot be null or undefined");return{dom:_}},re={fromHtml:so,fromTag:le,fromText:Ne,fromDom:ke,fromPoint:(_,B,U)=>at.from(_.dom.elementFromPoint(B,U)).map(ke)},xe=(_,B)=>{const U=_.dom;if(U.nodeType!==Pt)return!1;{const he=U;if(he.matches!==void 0)return he.matches(B);if(he.msMatchesSelector!==void 0)return he.msMatchesSelector(B);if(he.webkitMatchesSelector!==void 0)return he.webkitMatchesSelector(B);if(he.mozMatchesSelector!==void 0)return he.mozMatchesSelector(B);throw new Error("Browser lacks native selectors")}},Se=(_,B)=>_.dom===B.dom,$e=(_,B)=>{const U=_.dom,he=B.dom;return U===he?!1:U.contains(he)},G=xe,Ee=typeof window<"u"?window:Function("return this;")(),ze=(_,B)=>{let U=B??Ee;for(let he=0;he<_.length&&U!==void 0&&U!==null;++he)U=U[_[he]];return U},Mt=(_,B)=>{const U=_.split(".");return ze(U,B)},Nn=(_,B)=>Mt(_,B),Rn=(_,B)=>{const U=Nn(_,B);if(U==null)throw new Error(_+" not available on this browser");return U},Wn=Object.getPrototypeOf,zn=_=>Rn("HTMLElement",_),Do=_=>{const B=Mt("ownerDocument.defaultView",_);return qe(_)&&(zn(B).prototype.isPrototypeOf(_)||/^HTML\w*Element$/.test(Wn(_).constructor.name))},Xe=_=>_.dom.nodeName.toLowerCase(),lt=_=>_.dom.nodeType,At=_=>B=>lt(B)===_,Ft=_=>lt(_)===F||Xe(_)==="#comment",$n=_=>xo(_)&&Do(_.dom),xo=At(Pt),vo=At(an),fs=At(po),Bo=At(ht),Es=_=>B=>xo(B)&&Xe(B)===_,Kt=_=>re.fromDom(_.dom.ownerDocument),Vo=_=>fs(_)?_:Kt(_),tr=_=>at.from(_.dom.parentNode).map(re.fromDom),Vr=_=>at.from(_.dom.parentElement).map(re.fromDom),Rr=_=>at.from(_.dom.nextSibling).map(re.fromDom),kr=_=>Ue(_.dom.childNodes,re.fromDom),Cs=(_,B)=>{const U=_.dom.childNodes;return at.from(U[B]).map(re.fromDom)},zr=_=>Cs(_,0),Qr=_=>Cs(_,_.dom.childNodes.length-1),Ts=_=>Bo(_)&&Jt(_.dom.host),ur=wn(Element.prototype.attachShadow)&&wn(Node.prototype.getRootNode)?_=>re.fromDom(_.dom.getRootNode()):Vo,Je=_=>{const B=ur(_);return Ts(B)?at.some(B):at.none()},bt=_=>re.fromDom(_.dom.host),yn=_=>{const B=vo(_)?_.dom.parentNode:_.dom;if(B==null||B.ownerDocument===null)return!1;const U=B.ownerDocument;return Je(re.fromDom(B)).fold(()=>U.body.contains(B),Wt(yn,bt))};var Mn=(_,B,U,he,Pe)=>_(U,he)?at.some(U):wn(Pe)&&Pe(U)?at.none():B(U,he,Pe);const To=(_,B,U)=>{let he=_.dom;const Pe=wn(U)?U:q;for(;he.parentNode;){he=he.parentNode;const nn=re.fromDom(he);if(B(nn))return at.some(nn);if(Pe(nn))break}return at.none()},is=(_,B,U)=>Mn((Pe,nn)=>nn(Pe),To,_,B,U),Hr=(_,B,U)=>To(_,he=>xe(he,B),U),Ur=(_,B,U)=>Mn((Pe,nn)=>xe(Pe,nn),Hr,_,B,U),pr=_=>Ur(_,"[contenteditable]"),Ce=(_,B=!1)=>yn(_)?_.dom.isContentEditable:pr(_).fold(fn(B),U=>be(U)==="true"),be=_=>_.dom.contentEditable,mt=(_,B)=>{tr(_).each(he=>{he.dom.insertBefore(B.dom,_.dom)})},Tt=(_,B)=>{Rr(_).fold(()=>{tr(_).each(Pe=>{lo(Pe,B)})},he=>{mt(he,B)})},Yn=(_,B)=>{zr(_).fold(()=>{lo(_,B)},he=>{_.dom.insertBefore(B.dom,he.dom)})},lo=(_,B)=>{_.dom.appendChild(B.dom)},Go=(_,B)=>{ce(B,U=>{mt(_,U)})},Xs=(_,B)=>{ce(B,U=>{lo(_,U)})},Fe=_=>{_.dom.textContent="",ce(kr(_),B=>{Ao(B)})},Ao=_=>{const B=_.dom;B.parentNode!==null&&B.parentNode.removeChild(B)};var ve=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),Be=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),It=tinymce.util.Tools.resolve("tinymce.util.VK");const Xt=_=>Ue(_,re.fromDom),En=Object.keys,no=(_,B)=>{const U=En(_);for(let he=0,Pe=U.length;he<Pe;he++){const nn=U[he],Jn=_[nn];B(Jn,nn)}},qn=_=>(B,U)=>{_[U]=B},Kn=(_,B,U,he)=>{no(_,(Pe,nn)=>{(B(Pe,nn)?U:he)(Pe,nn)})},Xn=(_,B)=>{const U={};return Kn(_,B,qn(U),Qt),U},fo=(_,B,U)=>{if(oe(U)||Ye(U)||Yt(U))_.setAttribute(B,U+"");else throw console.error("Invalid call to Attribute.set. Key ",B,":: Value ",U,":: Element ",_),new Error("Attribute value was not simple")},rs=(_,B)=>{const U=_.dom;no(B,(he,Pe)=>{fo(U,Pe,he)})},js=_=>pe(_.dom.attributes,(B,U)=>(B[U.name]=U.value,B),{}),Fa=(_,B)=>re.fromDom(_.dom.cloneNode(B)),gc=_=>Fa(_,!0),kc=(_,B)=>{const U=re.fromTag(B),he=js(_);return rs(U,he),U},So=(_,B)=>{const U=kc(_,B);Tt(_,U);const he=kr(_);return Xs(U,he),Ao(_),U};var es=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),As=tinymce.util.Tools.resolve("tinymce.util.Tools");const Oa=_=>B=>Jt(B)&&B.nodeName.toLowerCase()===_,ea=_=>B=>Jt(B)&&_.test(B.nodeName),hr=_=>Jt(_)&&_.nodeType===3,Zs=_=>Jt(_)&&_.nodeType===1,Ma=ea(/^(OL|UL|DL)$/),Vl=ea(/^(OL|UL)$/),Ms=Oa("ol"),ra=ea(/^(LI|DT|DD)$/),Ia=ea(/^(DT|DD)$/),Wr=ea(/^(TH|TD)$/),pc=Oa("br"),_c=_=>{var B;return((B=_.parentNode)===null||B===void 0?void 0:B.firstChild)===_},wa=(_,B)=>Jt(B)&&B.nodeName in _.schema.getTextBlockElements(),Ec=(_,B)=>Jt(_)&&_.nodeName in B,Tc=(_,B)=>Jt(B)&&B.nodeName in _.schema.getVoidElements(),Ti=(_,B)=>pc(B)?_.isBlock(B.nextSibling)&&!pc(B.previousSibling):!1,hc=(_,B,U)=>{const he=_.isEmpty(B);return U&&_.select("span[data-mce-type=bookmark]",B).length>0?!1:he},zl=(_,B)=>_.isChildOf(B,_.getRoot()),La=_=>B=>B.options.get(_),dl=_=>{const B=_.options.register;B("lists_indent_on_tab",{processor:"boolean",default:!0})},Dl=La("lists_indent_on_tab"),ri=La("forced_root_block"),yu=La("forced_root_block_attrs"),Z=(_,B)=>{const U=_.dom,he=_.schema.getBlockElements(),Pe=U.createFragment(),nn=ri(_),Jn=yu(_);let zo,Po,ko=!1;for(Po=U.create(nn,Jn),Ec(B.firstChild,he)||Pe.appendChild(Po);zo=B.firstChild;){const Lr=zo.nodeName;!ko&&(Lr!=="SPAN"||zo.getAttribute("data-mce-type")!=="bookmark")&&(ko=!0),Ec(zo,he)?(Pe.appendChild(zo),Po=null):(Po||(Po=U.create(nn,Jn),Pe.appendChild(Po)),Po.appendChild(zo))}return!ko&&Po&&Po.appendChild(U.create("br",{"data-mce-bogus":"1"})),Pe},Ae=es.DOM,Ze=(_,B,U)=>{const he=ko=>{const Lr=ko.parentNode;Lr&&As.each(Pe,ja=>{Lr.insertBefore(ja,U.parentNode)}),Ae.remove(ko)},Pe=Ae.select('span[data-mce-type="bookmark"]',B),nn=Z(_,U),Jn=Ae.createRng();Jn.setStartAfter(U),Jn.setEndAfter(B);const zo=Jn.extractContents();for(let ko=zo.firstChild;ko;ko=ko.firstChild)if(ko.nodeName==="LI"&&_.dom.isEmpty(ko)){Ae.remove(ko);break}_.dom.isEmpty(zo)||Ae.insertAfter(zo,B),Ae.insertAfter(nn,B);const Po=U.parentElement;Po&&hc(_.dom,Po)&&he(Po),Ae.remove(U),hc(_.dom,B)&&Ae.remove(B)},gt=Es("dd"),on=Es("dt"),ho=(_,B)=>{gt(B)?So(B,"dt"):on(B)&&Vr(B).each(U=>Ze(_,U.dom,B.dom))},Gs=_=>{on(_)&&So(_,"dd")},Js=(_,B,U)=>{B==="Indent"?ce(U,Gs):ce(U,he=>ho(_,he))},zs=(_,B)=>{if(hr(_))return{container:_,offset:B};const U=ve.getNode(_,B);return hr(U)?{container:U,offset:B>=_.childNodes.length?U.data.length:0}:U.previousSibling&&hr(U.previousSibling)?{container:U.previousSibling,offset:U.previousSibling.data.length}:U.nextSibling&&hr(U.nextSibling)?{container:U.nextSibling,offset:0}:{container:_,offset:B}},rr=_=>{const B=_.cloneRange(),U=zs(_.startContainer,_.startOffset);B.setStart(U.container,U.offset);const he=zs(_.endContainer,_.endOffset);return B.setEnd(he.container,he.offset),B},us=["OL","UL","DL"],_r=us.join(","),Va=(_,B)=>{const U=B||_.selection.getStart(!0);return _.dom.getParent(U,_r,Sn(_,U))},ai=(_,B)=>Jt(_)&&B.length===1&&B[0]===_,Tn=_=>Zn(_.querySelectorAll(_r),Ma),tu=_=>{const B=Va(_),U=_.selection.getSelectedBlocks();return ai(B,U)?Tn(B):Zn(U,he=>Ma(he)&&B!==he)},br=(_,B)=>{const U=As.map(B,he=>{const Pe=_.dom.getParent(he,"li,dd,dt",Sn(_,he));return Pe||he});return Qe(U)},M=_=>{const B=_.selection.getSelectedBlocks();return Zn(br(_,B),ra)},ee=_=>Zn(M(_),Ia),ge=(_,B)=>{const U=_.dom.getParents(B,"TD,TH");return U.length>0?U[0]:_.getBody()},pt=(_,B)=>!Ma(B)&&!ra(B)&&St(us,U=>_.isValidChild(B.nodeName,U)),Sn=(_,B)=>{const U=_.dom.getParents(B,_.dom.isBlock);return je(U,Pe=>pt(_.schema,Pe)).getOr(_.getBody())},ts=_=>tr(_).exists(B=>ra(B.dom)&&zr(B).exists(U=>!Ma(U.dom))&&Qr(B).exists(U=>!Ma(U.dom))),Hn=(_,B)=>{const U=_.dom.getParents(B,"ol,ul",Sn(_,B));return bn(U)},yr=_=>{const B=Hn(_,_.selection.getStart()),U=Zn(_.selection.getSelectedBlocks(),Vl);return B.toArray().concat(U)},tn=_=>{const B=_.selection.getStart();return _.dom.getParents(B,"ol,ul",Sn(_,B))},nr=_=>{const B=yr(_),U=tn(_);return je(U,he=>ts(re.fromDom(he))).fold(()=>Za(_,B),he=>[he])},Za=(_,B)=>{const U=Ue(B,he=>Hn(_,he).getOr(he));return Qe(U)},ar=_=>/\btox\-/.test(_.className),aa=(_,B)=>S(_,Ma,Wr).exists(U=>U.nodeName===B&&!ar(U)),ml=(_,B)=>B!==null&&!_.dom.isEditable(B),gs=_=>{const B=Va(_);return ml(_,B)},Ja=(_,B)=>{const U=_.dom.getParent(B,"ol,ul,dl");return ml(_,U)},vr=(_,B)=>{const U=_.selection.getNode();return B({parents:_.dom.getParents(U),element:U}),_.on("NodeChange",B),()=>_.off("NodeChange",B)},Hl=(_,B)=>{const he=document.createDocumentFragment();return ce(_,Pe=>{he.appendChild(Pe.dom)}),re.fromDom(he)},Er=(_,B,U)=>_.dispatch("ListMutation",{action:B,element:U}),gm=(_=>B=>B.replace(_,""))(/^\s+|\s+$/g),df=_=>_.length>0,Is=_=>!df(_),fl=_=>_.style!==void 0&&wn(_.style.getPropertyValue),Ul=(_,B,U)=>{if(!oe(U))throw console.error("Invalid call to CSS.set. Property ",B,":: Value ",U,":: Element ",_),new Error("CSS value must be a string: "+U);fl(_)&&_.style.setProperty(B,U)},Ac=(_,B,U)=>{const he=_.dom;Ul(he,B,U)},Mc=_=>G(_,"OL,UL"),Gu=_=>G(_,"LI"),ps=_=>zr(_).exists(Mc),X=_=>Qr(_).exists(Mc),fe=_=>"listAttributes"in _,ct=_=>"isComment"in _,wt=_=>"isFragment"in _,Fn=_=>_.depth>0,$o=_=>_.isSelected,jr=_=>{const B=kr(_),U=X(_)?B.slice(0,-1):B;return Ue(U,gc)},Qa=(_,B,U)=>tr(_).filter(xo).map(he=>({depth:B,dirty:!1,isSelected:U,content:jr(_),itemAttributes:js(_),listAttributes:js(he),listType:Xe(he),isInPreviousLi:!1})),Tr=(_,B)=>{lo(_.item,B.list)},bc=_=>{for(let B=1;B<_.length;B++)Tr(_[B-1],_[B])},Ls=(_,B)=>{ot(bn(_),Nt(B),Tr)},qr=(_,B)=>{const U={list:re.fromTag(B,_),item:re.fromTag("li",_)};return lo(U.list,U.item),U},ha=(_,B,U)=>{const he=[];for(let Pe=0;Pe<U;Pe++)he.push(qr(_,fe(B)?B.listType:B.parentListType));return he},Dc=(_,B)=>{for(let U=0;U<_.length-1;U++)Ac(_[U].item,"list-style-type","none");bn(_).each(U=>{fe(B)&&(rs(U.list,B.listAttributes),rs(U.item,B.itemAttributes)),Xs(U.item,B.content)})},ma=(_,B)=>{Xe(_.list)!==B.listType&&(_.list=So(_.list,B.listType)),rs(_.list,B.listAttributes)},Ir=(_,B,U)=>{const he=re.fromTag("li",_);return rs(he,B),Xs(he,U),he},ta=(_,B)=>{lo(_.list,B),_.item=B},Ic=(_,B,U)=>{const he=B.slice(0,U.depth);return bn(he).each(Pe=>{if(fe(U)){const nn=Ir(_,U.itemAttributes,U.content);ta(Pe,nn),ma(Pe,U)}else if(wt(U))Xs(Pe.item,U.content);else{const nn=re.fromHtml(`<!--${U.content}-->`);lo(Pe.list,nn)}}),he},Wl=(_,B,U)=>{const he=ha(_,U,U.depth-B.length);return bc(he),Dc(he,U),Ls(B,he),B.concat(he)},mf=(_,B)=>{let U=at.none();const he=pe(B,(Pe,nn,Jn)=>ct(nn)?Jn===0?(U=at.some(nn),Pe):Ic(_,Pe,nn):nn.depth>Pe.length?Wl(_,Pe,nn):Ic(_,Pe,nn),[]);return U.each(Pe=>{const nn=re.fromHtml(`<!--${Pe.content}-->`);Nt(he).each(Jn=>{Yn(Jn.list,nn)})}),Nt(he).map(Pe=>Pe.list)},pm=(_,B)=>{switch(_){case"Indent":B.depth++;break;case"Outdent":B.depth--;break;case"Flatten":B.depth=0}B.dirty=!0},Lc=(_,B)=>{fe(_)&&fe(B)&&(_.listType=B.listType,_.listAttributes={...B.listAttributes})},hm=_=>{_.listAttributes=Xn(_.listAttributes,(B,U)=>U!=="start")},Vc=(_,B)=>{const U=_[B].depth,he=nn=>nn.depth===U&&!nn.dirty,Pe=nn=>nn.depth<U;return S(Rt(_.slice(0,B)),he,Pe).orThunk(()=>S(_.slice(B+1),he,Pe))},ci=_=>(ce(_,(B,U)=>{Vc(_,U).fold(()=>{B.dirty&&fe(B)&&hm(B)},he=>Lc(B,he))}),_),bm=_=>{let B=_;return{get:()=>B,set:Pe=>{B=Pe}}},wu=(_,B,U,he)=>{var Pe;if(Ft(he))return[{depth:_+1,content:(Pe=he.dom.nodeValue)!==null&&Pe!==void 0?Pe:"",dirty:!1,isSelected:!1,isComment:!0}];B.each(zo=>{Se(zo.start,he)&&U.set(!0)});const nn=Qa(he,_,U.get());B.each(zo=>{Se(zo.end,he)&&U.set(!1)});const Jn=Qr(he).filter(Mc).map(zo=>Ai(_,B,U,zo)).getOr([]);return nn.toArray().concat(Jn)},ym=(_,B,U,he)=>zr(he).filter(Mc).fold(()=>wu(_,B,U,he),Pe=>{const nn=pe(kr(he),(Jn,zo,Po)=>{if(Po===0)return Jn;if(Gu(zo))return Jn.concat(wu(_,B,U,zo));{const ko={isFragment:!0,depth:_,content:[zo],isSelected:!1,dirty:!1,parentListType:Xe(Pe)};return Jn.concat(ko)}},[]);return Ai(_,B,U,Pe).concat(nn)}),Ai=(_,B,U,he)=>kt(kr(he),Pe=>{const nn=Mc(Pe)?Ai:ym,Jn=_+1;return nn(Jn,B,U,Pe)}),pg=(_,B)=>{const U=bm(!1),he=0;return Ue(_,Pe=>({sourceList:Pe,entries:Ai(he,B,U,Pe)}))},nu=(_,B)=>{const U=ci(B);return Ue(U,he=>{const Pe=ct(he)?Hl([re.fromHtml(`<!--${he.content}-->`)]):Hl(he.content);return re.fromDom(Z(_,Pe.dom))})},hg=(_,B)=>{const U=ci(B);return mf(_.contentDocument,U).toArray()},bg=(_,B)=>kt(Ie(B,Fn),U=>Nt(U).exists(Fn)?hg(_,U):nu(_,U)),yg=(_,B)=>{ce(Zn(_,$o),U=>pm(B,U))},qu=_=>{const B=Ue(M(_),re.fromDom);return ot(je(B,Dt(ps)),je(Rt(B),Dt(ps)),(U,he)=>({start:U,end:he}))},xp=(_,B,U)=>{const he=pg(B,qu(_));ce(he,Pe=>{yg(Pe.entries,U);const nn=bg(_,Pe.entries);ce(nn,Jn=>{Er(_,U==="Indent"?"IndentList":"OutdentList",Jn.dom)}),Go(Pe.sourceList,nn),Ao(Pe.sourceList)})},ye=(_,B)=>{const U=Xt(nr(_)),he=Xt(ee(_));let Pe=!1;if(U.length||he.length){const nn=_.selection.getBookmark();xp(_,U,B),Js(_,B,he),_.selection.moveToBookmark(nn),_.selection.setRng(rr(_.selection.getRng())),_.nodeChanged(),Pe=!0}return Pe},xu=(_,B)=>!gs(_)&&ye(_,B),Nl=_=>xu(_,"Indent"),Ed=_=>xu(_,"Outdent"),vg=_=>xu(_,"Flatten"),sb="\uFEFF",Ds=_=>_===sb,yc=(_,B,U)=>To(_,B,U).isSome(),Di=(_,B)=>yc(_,it(Se,B));var Ol=tinymce.util.Tools.resolve("tinymce.dom.BookmarkManager");const Cu=es.DOM,jl=_=>{const B={},U=he=>{let Pe=_[he?"startContainer":"endContainer"],nn=_[he?"startOffset":"endOffset"];if(Zs(Pe)){const Jn=Cu.create("span",{"data-mce-type":"bookmark"});Pe.hasChildNodes()?(nn=Math.min(nn,Pe.childNodes.length-1),he?Pe.insertBefore(Jn,Pe.childNodes[nn]):Cu.insertAfter(Jn,Pe.childNodes[nn])):Pe.appendChild(Jn),Pe=Jn,nn=0}B[he?"startContainer":"endContainer"]=Pe,B[he?"startOffset":"endOffset"]=nn};return U(!0),_.collapsed||U(),B},ec=_=>{const B=he=>{const Pe=zo=>{var Po;let ko=(Po=zo.parentNode)===null||Po===void 0?void 0:Po.firstChild,Lr=0;for(;ko;){if(ko===zo)return Lr;(!Zs(ko)||ko.getAttribute("data-mce-type")!=="bookmark")&&Lr++,ko=ko.nextSibling}return-1};let nn=_[he?"startContainer":"endContainer"],Jn=_[he?"startOffset":"endOffset"];if(nn){if(Zs(nn)&&nn.parentNode){const zo=nn;Jn=Pe(nn),nn=nn.parentNode,Cu.remove(zo),!nn.hasChildNodes()&&Cu.isBlock(nn)&&nn.appendChild(Cu.create("br"))}_[he?"startContainer":"endContainer"]=nn,_[he?"startOffset":"endOffset"]=Jn}};B(!0),B();const U=Cu.createRng();return U.setStart(_.startContainer,_.startOffset),_.endContainer&&U.setEnd(_.endContainer,_.endOffset),rr(U)},li=_=>{switch(_){case"UL":return"ToggleUlList";case"OL":return"ToggleOlList";case"DL":return"ToggleDLList"}},wg=(_,B,U)=>{const he=U["list-style-type"]?U["list-style-type"]:null;_.setStyle(B,"list-style-type",he)},Cp=(_,B)=>{As.each(B,(U,he)=>{_.setAttribute(he,U)})},Bl=(_,B,U)=>{Cp(B,U["list-attributes"]),As.each(_.select("li",B),he=>{Cp(he,U["list-item-attributes"])})},Ni=(_,B,U)=>{wg(_,B,U),Bl(_,B,U)},xg=(_,B,U)=>{As.each(U,he=>_.setStyle(B,he,""))},Nc=(_,B)=>Jt(B)&&!Ec(B,_.schema.getBlockElements()),xa=(_,B,U,he)=>{let Pe=B[U?"startContainer":"endContainer"];const nn=B[U?"startOffset":"endOffset"];Zs(Pe)&&(Pe=Pe.childNodes[Math.min(nn,Pe.childNodes.length-1)]||Pe),!U&&pc(Pe.nextSibling)&&(Pe=Pe.nextSibling);const Jn=Po=>{for(;!_.dom.isBlock(Po)&&Po.parentNode&&he!==Po;)Po=Po.parentNode;return Po},zo=(Po,ko)=>{var Lr;const ja=new Be(Po,Jn(Po)),pl=ko?"next":"prev";let ru;for(;ru=ja[pl]();)if(!(Tc(_,ru)||Ds(ru.textContent)||((Lr=ru.textContent)===null||Lr===void 0?void 0:Lr.length)===0))return at.some(ru);return at.none()};if(U&&hr(Pe))if(Ds(Pe.textContent))Pe=zo(Pe,!1).getOr(Pe);else for(Pe.parentNode!==null&&Nc(_,Pe.parentNode)&&(Pe=Pe.parentNode);Pe.previousSibling!==null&&(Nc(_,Pe.previousSibling)||hr(Pe.previousSibling));)Pe=Pe.previousSibling;if(!U&&hr(Pe))if(Ds(Pe.textContent))Pe=zo(Pe,!0).getOr(Pe);else for(Pe.parentNode!==null&&Nc(_,Pe.parentNode)&&(Pe=Pe.parentNode);Pe.nextSibling!==null&&(Nc(_,Pe.nextSibling)||hr(Pe.nextSibling));)Pe=Pe.nextSibling;for(;Pe.parentNode!==he;){const Po=Pe.parentNode;if(wa(_,Pe)||/^(TD|TH)$/.test(Po.nodeName))return Pe;Pe=Po}return Pe},Su=(_,B,U)=>{const he=[],Pe=_.dom,nn=xa(_,B,!0,U),Jn=xa(_,B,!1,U);let zo;const Po=[];for(let ko=nn;ko&&(Po.push(ko),ko!==Jn);ko=ko.nextSibling);return As.each(Po,ko=>{var Lr;if(wa(_,ko)){he.push(ko),zo=null;return}if(Pe.isBlock(ko)||pc(ko)){pc(ko)&&Pe.remove(ko),zo=null;return}const ja=ko.nextSibling;if(Ol.isBookmarkNode(ko)&&(Ma(ja)||wa(_,ja)||!ja&&ko.parentNode===U)){zo=null;return}zo||(zo=Pe.create("p"),(Lr=ko.parentNode)===null||Lr===void 0||Lr.insertBefore(zo,ko),he.push(zo)),zo.appendChild(ko)}),he},Td=(_,B,U)=>{const he=_.getStyle(B,"list-style-type");let Pe=U?U["list-style-type"]:"";return Pe=Pe===null?"":Pe,he===Pe},Gl=(_,B)=>{const U=_.selection.getStart(!0),he=xa(_,B,!0,_.getBody());return Di(re.fromDom(he),re.fromDom(B.commonAncestorContainer))?B.commonAncestorContainer:U},Oc=(_,B,U)=>{const he=_.selection.getRng();let Pe="LI";const nn=Sn(_,Gl(_,he)),Jn=_.dom;if(Jn.getContentEditable(_.selection.getNode())==="false")return;B=B.toUpperCase(),B==="DL"&&(Pe="DT");const zo=jl(he),Po=Zn(Su(_,he,nn),_.dom.isEditable);As.each(Po,ko=>{let Lr;const ja=ko.previousSibling,pl=ko.parentNode;ra(pl)||(ja&&Ma(ja)&&ja.nodeName===B&&Td(Jn,ja,U)?(Lr=ja,ko=Jn.rename(ko,Pe),ja.appendChild(ko)):(Lr=Jn.create(B),pl.insertBefore(Lr,ko),Lr.appendChild(ko),ko=Jn.rename(ko,Pe)),xg(Jn,ko,["margin","margin-right","margin-bottom","margin-left","margin-top","padding","padding-right","padding-bottom","padding-left","padding-top"]),Ni(Jn,Lr,U),Ad(_.dom,Lr))}),_.selection.setRng(ec(zo))},Cg=(_,B)=>Ma(_)&&_.nodeName===(B==null?void 0:B.nodeName),Sp=(_,B,U)=>{const he=_.getStyle(B,"list-style-type",!0),Pe=_.getStyle(U,"list-style-type",!0);return he===Pe},vm=(_,B)=>_.className===B.className,ff=(_,B,U)=>Cg(B,U)&&Sp(_,B,U)&&vm(B,U),Ad=(_,B)=>{let U,he=B.nextSibling;if(ff(_,B,he)){const Pe=he;for(;U=Pe.firstChild;)B.appendChild(U);_.remove(Pe)}if(he=B.previousSibling,ff(_,B,he)){const Pe=he;for(;U=Pe.lastChild;)B.insertBefore(U,B.firstChild);_.remove(Pe)}},Oi=(_,B,U,he)=>{if(B.nodeName!==U){const Pe=_.dom.rename(B,U);Ni(_.dom,Pe,he),Er(_,li(U),Pe)}else Ni(_.dom,B,he),Er(_,li(U),B)},kp=(_,B,U,he)=>{if(B.classList.forEach((Pe,nn,Jn)=>{Pe.startsWith("tox-")&&(Jn.remove(Pe),Jn.length===0&&B.removeAttribute("class"))}),B.nodeName!==U){const Pe=_.dom.rename(B,U);Ni(_.dom,Pe,he),Er(_,li(U),Pe)}else Ni(_.dom,B,he),Er(_,li(U),B)},Ky=(_,B,U,he,Pe)=>{const nn=Ma(B);if(nn&&B.nodeName===he&&!Sg(Pe)&&!ar(B))vg(_);else{Oc(_,he,Pe);const Jn=jl(_.selection.getRng()),zo=nn?[B,...U]:U,Po=nn&&ar(B)?kp:Oi;As.each(zo,ko=>{Po(_,ko,he,Pe)}),_.selection.setRng(ec(Jn))}},Sg=_=>"list-style-type"in _,kg=(_,B,U,he)=>{if(B!==_.getBody())if(B)if(B.nodeName===U&&!Sg(he)&&!ar(B))vg(_);else{const Pe=jl(_.selection.getRng());ar(B)&&B.classList.forEach((Jn,zo,Po)=>{Jn.startsWith("tox-")&&(Po.remove(Jn),Po.length===0&&B.removeAttribute("class"))}),Ni(_.dom,B,he);const nn=_.dom.rename(B,U);Ad(_.dom,nn),_.selection.setRng(ec(Pe)),Oc(_,U,he),Er(_,li(U),nn)}else Oc(_,U,he),Er(_,li(U),B)},Ku=(_,B,U)=>{const he=Va(_);if(Ja(_,he))return;const Pe=tu(_),nn=qe(U)?U:{};Pe.length>0?Ky(_,he,Pe,B,nn):kg(_,he,B,nn)},wm=es.DOM,Dd=(_,B)=>{const U=B.parentElement;if(U&&U.nodeName==="LI"&&U.firstChild===B){const he=U.previousSibling;he&&he.nodeName==="LI"?(he.appendChild(B),hc(_,U)&&wm.remove(U)):wm.setStyle(U,"listStyleType","none")}if(Ma(U)){const he=U.previousSibling;he&&he.nodeName==="LI"&&he.appendChild(B)}},Pr=(_,B)=>{const U=As.grep(_.select("ol,ul",B));As.each(U,he=>{Dd(_,he)})},Kr=(_,B,U,he)=>{let Pe=B.startContainer;const nn=B.startOffset;if(hr(Pe)&&(U?nn<Pe.data.length:nn>0))return Pe;const Jn=_.schema.getNonEmptyElements();Zs(Pe)&&(Pe=ve.getNode(Pe,nn));const zo=new Be(Pe,he);U&&Ti(_.dom,Pe)&&zo.next();const Po=U?zo.next.bind(zo):zo.prev2.bind(zo);for(;Pe=Po();)if(Pe.nodeName==="LI"&&!Pe.hasChildNodes()||Jn[Pe.nodeName]||hr(Pe)&&Pe.data.length>0)return Pe;return null},zc=(_,B)=>{const U=B.childNodes;return U.length===1&&!Ma(U[0])&&_.isBlock(U[0])},_g=_=>at.from(_).map(re.fromDom).filter($n).exists(B=>Ce(B)&&!cn(["details"],Xe(B))),_p=(_,B)=>{zc(_,B)&&_g(B.firstChild)&&_.remove(B.firstChild,!0)},Wa=(_,B,U)=>{let he;const Pe=zc(_,U)?U.firstChild:U;if(_p(_,B),!hc(_,B,!0))for(;he=B.firstChild;)Pe.appendChild(he)},ou=(_,B,U)=>{let he;const Pe=B.parentNode;if(!zl(_,B)||!zl(_,U))return;Ma(U.lastChild)&&(he=U.lastChild),Pe===U.lastChild&&pc(Pe.previousSibling)&&_.remove(Pe.previousSibling);const nn=U.lastChild;nn&&pc(nn)&&B.hasChildNodes()&&_.remove(nn),hc(_,U,!0)&&Fe(re.fromDom(U)),Wa(_,B,U),he&&U.appendChild(he);const zo=$e(re.fromDom(U),re.fromDom(B))?_.getParents(B,Ma,U):[];_.remove(B),ce(zo,Po=>{hc(_,Po)&&Po!==_.getRoot()&&_.remove(Po)})},Hc=(_,B,U)=>{Fe(re.fromDom(U)),ou(_.dom,B,U),_.selection.setCursorLocation(U,0)},Bi=(_,B,U,he)=>{const Pe=_.dom;if(Pe.isEmpty(he))Hc(_,U,he);else{const nn=jl(B);ou(Pe,U,he),_.selection.setRng(ec(nn))}},gf=(_,B,U,he)=>{const Pe=jl(B);ou(_.dom,U,he);const nn=ec(Pe);_.selection.setRng(nn)},Xo=(_,B)=>{const U=_.dom,he=_.selection,Pe=he.getStart(),nn=ge(_,Pe),Jn=U.getParent(he.getStart(),"LI",nn);if(Jn){const zo=Jn.parentElement;if(zo===_.getBody()&&hc(U,zo))return!0;const Po=rr(he.getRng()),ko=U.getParent(Kr(_,Po,B,nn),"LI",nn),Lr=ko&&(B?U.isChildOf(Jn,ko):U.isChildOf(ko,Jn));if(ko&&ko!==Jn&&!Lr)return _.undoManager.transact(()=>{B?Bi(_,Po,ko,Jn):_c(Jn)?Ed(_):gf(_,Po,Jn,ko)}),!0;if(Lr&&!B&&ko!==Jn)return _.undoManager.transact(()=>{if(Po.commonAncestorContainer.parentElement){const ja=jl(Po),pl=Po.commonAncestorContainer.parentElement;Wa(U,Po.commonAncestorContainer.parentElement,ko),pl.remove();const ru=ec(ja);_.selection.setRng(ru)}}),!0;if(!ko&&!B&&Po.startOffset===0&&Po.endOffset===0)return _.undoManager.transact(()=>{vg(_)}),!0}return!1},Qc=(_,B,U)=>{const he=_.getParent(B.parentNode,_.isBlock,U);_.remove(B),he&&_.isEmpty(he)&&_.remove(he)},ku=(_,B)=>{const U=_.dom,he=_.selection.getStart(),Pe=ge(_,he),nn=U.getParent(he,U.isBlock,Pe);if(nn&&U.isEmpty(nn)){const Jn=rr(_.selection.getRng()),zo=U.getParent(Kr(_,Jn,B,Pe),"LI",Pe);if(zo){const Po=pl=>cn(["td","th","caption"],Xe(pl)),ko=pl=>pl.dom===Pe,Lr=is(re.fromDom(zo),Po,ko),ja=is(re.fromDom(Jn.startContainer),Po,ko);return Oe(Lr,ja,Se)?(_.undoManager.transact(()=>{const pl=zo.parentNode;Qc(U,nn,Pe),Ad(U,pl),_.selection.select(zo,!0),_.selection.collapse(B)}),!0):!1}}return!1},Nd=(_,B)=>Xo(_,B)||ku(_,B),pf=_=>{const B=_.selection.getStart(),U=ge(_,B);return _.dom.getParent(B,"LI,DT,DD",U)||M(_).length>0},Ep=_=>pf(_)?(_.undoManager.transact(()=>{_.execCommand("Delete"),Pr(_.dom,_.getBody())}),!0):!1,tc=(_,B)=>{const U=_.selection;return!Ja(_,U.getNode())&&(U.isCollapsed()?Nd(_,B):Ep(_))},fa=_=>{_.on("ExecCommand",B=>{const U=B.command.toLowerCase();(U==="delete"||U==="forwarddelete")&&pf(_)&&Pr(_.dom,_.getBody())}),_.on("keydown",B=>{B.keyCode===It.BACKSPACE?tc(_,!1)&&B.preventDefault():B.keyCode===It.DELETE&&tc(_,!0)&&B.preventDefault()})},gl=_=>({backspaceDelete:B=>{tc(_,B)}}),Ca=(_,B)=>{const U=Va(_);U===null||Ja(_,U)||_.undoManager.transact(()=>{qe(B.styles)&&_.dom.setStyles(U,B.styles),qe(B.attrs)&&no(B.attrs,(he,Pe)=>_.dom.setAttrib(U,Pe,he))})},Od=_=>{const B=Rt(gm(_).split("")),U=Ue(B,(he,Pe)=>{const nn=he.toUpperCase().charCodeAt(0)-65+1;return Math.pow(26,Pe)*nn});return pe(U,(he,Pe)=>he+Pe,0)},Yu=_=>{if(_--,_<0)return"";{const B=_%26,U=Math.floor(_/26),he=Yu(U),Pe=String.fromCharCode(65+B);return he+Pe}},ca=_=>/^[A-Z]+$/.test(_),Ba=_=>/^[a-z]+$/.test(_),ii=_=>/^[0-9]+$/.test(_),Xu=_=>ii(_)?2:ca(_)?0:Ba(_)?1:Is(_)?3:4,ba=_=>{switch(Xu(_)){case 2:return at.some({listStyleType:at.none(),start:_});case 0:return at.some({listStyleType:at.some("upper-alpha"),start:Od(_).toString()});case 1:return at.some({listStyleType:at.some("lower-alpha"),start:Od(_).toString()});case 3:return at.some({listStyleType:at.none(),start:""});case 4:return at.none()}},Eg=_=>{const B=parseInt(_.start,10);return Zt(_.listStyleType,"upper-alpha")?Yu(B):Zt(_.listStyleType,"lower-alpha")?Yu(B).toLowerCase():_.start},Tp=_=>{const B=Va(_);!Ms(B)||Ja(_,B)||_.windowManager.open({title:"List Properties",body:{type:"panel",items:[{type:"input",name:"start",label:"Start list at number",inputMode:"numeric"}]},initialData:{start:Eg({start:_.dom.getAttrib(B,"start","1"),listStyleType:at.from(_.dom.getStyle(B,"list-style-type"))})},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:U=>{const he=U.getData();ba(he.start).each(Pe=>{_.execCommand("mceListUpdate",!1,{attrs:{start:Pe.start==="1"?"":Pe.start},styles:{"list-style-type":Pe.listStyleType.getOr("")}})}),U.close()}})},Qs=(_,B)=>()=>{const U=Va(_);return Jt(U)&&U.nodeName===B},ui=_=>{_.addCommand("mceListProps",()=>{Tp(_)})},Ns=_=>{_.on("BeforeExecCommand",B=>{const U=B.command.toLowerCase();U==="indent"?Nl(_):U==="outdent"&&Ed(_)}),_.addCommand("InsertUnorderedList",(B,U)=>{Ku(_,"UL",U)}),_.addCommand("InsertOrderedList",(B,U)=>{Ku(_,"OL",U)}),_.addCommand("InsertDefinitionList",(B,U)=>{Ku(_,"DL",U)}),_.addCommand("RemoveList",()=>{vg(_)}),ui(_),_.addCommand("mceListUpdate",(B,U)=>{qe(U)&&Ca(_,U)}),_.addQueryStateHandler("InsertUnorderedList",Qs(_,"UL")),_.addQueryStateHandler("InsertOrderedList",Qs(_,"OL")),_.addQueryStateHandler("InsertDefinitionList",Qs(_,"DL"))};var Uc=tinymce.util.Tools.resolve("tinymce.html.Node");const _u=_=>_.type===3,su=_=>_.length===0,as=_=>{const B=(Pe,nn)=>{const Jn=Uc.create("li");ce(Pe,zo=>Jn.append(zo)),nn?_.insert(Jn,nn,!0):_.append(Jn)},U=(Pe,nn)=>_u(nn)?[...Pe,nn]:!su(Pe)&&!_u(nn)?(B(Pe,nn),[]):Pe,he=pe(_.children(),U,[]);su(he)||B(he)},Zu=_=>{_.on("PreInit",()=>{const{parser:B}=_;B.addNodeFilter("ul,ol",U=>ce(U,as))})},Tg=_=>{_.on("keydown",B=>{B.keyCode!==It.TAB||It.metaKeyPressed(B)||_.undoManager.transact(()=>{(B.shiftKey?Ed(_):Nl(_))&&B.preventDefault()})})},Ag=_=>{Dl(_)&&Tg(_),fa(_)},rb=(_,B)=>U=>{const he=Pe=>{U.setActive(aa(Pe.parents,B)),U.setEnabled(!Ja(_,Pe.element)&&_.selection.isEditable())};return U.setEnabled(_.selection.isEditable()),vr(_,he)},Ap=_=>{const B=U=>()=>_.execCommand(U);_.hasPlugin("advlist")||(_.ui.registry.addToggleButton("numlist",{icon:"ordered-list",active:!1,tooltip:"Numbered list",onAction:B("InsertOrderedList"),onSetup:rb(_,"OL")}),_.ui.registry.addToggleButton("bullist",{icon:"unordered-list",active:!1,tooltip:"Bullet list",onAction:B("InsertUnorderedList"),onSetup:rb(_,"UL")}))},hf=(_,B)=>U=>vr(_,Pe=>U.setEnabled(aa(Pe.parents,B)&&!Ja(_,Pe.element))),Dg=_=>{const B={text:"List properties...",icon:"ordered-list",onAction:()=>_.execCommand("mceListProps"),onSetup:hf(_,"OL")};_.ui.registry.addMenuItem("listprops",B),_.ui.registry.addContextMenu("lists",{update:U=>{const he=Va(_,U);return Ms(he)?["listprops"]:[]}})};var xm=()=>{I.add("lists",_=>(dl(_),Zu(_),_.hasPlugin("rtc",!0)?ui(_):(Ag(_),Ns(_)),Ap(_),Dg(_),gl(_)))};xm()}(),function(){var I=tinymce.util.Tools.resolve("tinymce.PluginManager");const _e=it=>Dt=>typeof Dt===it,ie=_e("boolean"),He=_e("number"),Re=it=>Dt=>Dt.options.get(it),oe=it=>{const Dt=it.options.register;Dt("nonbreaking_force_tab",{processor:q=>ie(q)?{value:q?3:0,valid:!0}:He(q)?{value:q,valid:!0}:{valid:!1,message:"Must be a boolean or number."},default:!1}),Dt("nonbreaking_wrap",{processor:"boolean",default:!0})},qe=Re("nonbreaking_force_tab"),te=Re("nonbreaking_wrap"),Ye=(it,Dt)=>{let q="";for(let at=0;at<Dt;at++)q+=it;return q},dt=it=>it.plugins.visualchars?it.plugins.visualchars.isEnabled():!1,Jt=(it,Dt)=>{const q=()=>dt(it)?"mce-nbsp-wrap mce-nbsp":"mce-nbsp-wrap",at=()=>`<span class="${q()}" contenteditable="false">${Ye(" ",Dt)}</span>`,Et=te(it)||it.plugins.visualchars?at():Ye(" ",Dt);it.undoManager.transact(()=>it.insertContent(Et))},wn=it=>{it.addCommand("mceNonBreaking",()=>{Jt(it,1)})};var Yt=tinymce.util.Tools.resolve("tinymce.util.VK");const Qt=it=>{const Dt=qe(it);Dt>0&&it.on("keydown",q=>{if(q.keyCode===Yt.TAB&&!q.isDefaultPrevented()){if(q.shiftKey)return;q.preventDefault(),q.stopImmediatePropagation(),Jt(it,Dt)}})},Wt=it=>Dt=>{const q=()=>{Dt.setEnabled(it.selection.isEditable())};return it.on("NodeChange",q),q(),()=>{it.off("NodeChange",q)}},fn=it=>{const Dt=()=>it.execCommand("mceNonBreaking");it.ui.registry.addButton("nonbreaking",{icon:"non-breaking",tooltip:"Nonbreaking space",onAction:Dt,onSetup:Wt(it)}),it.ui.registry.addMenuItem("nonbreaking",{icon:"non-breaking",text:"Nonbreaking space",onAction:Dt,onSetup:Wt(it)})};var st=()=>{I.add("nonbreaking",it=>{oe(it),wn(it),fn(it),Qt(it)})};st()}(),function(){var I=tinymce.util.Tools.resolve("tinymce.PluginManager"),_e=tinymce.util.Tools.resolve("tinymce.Env");const ie=Wt=>fn=>fn.options.get(Wt),He=Wt=>{const fn=Wt.options.register;fn("pagebreak_separator",{processor:"string",default:"<!-- pagebreak -->"}),fn("pagebreak_split_block",{processor:"boolean",default:!1})},Re=ie("pagebreak_separator"),oe=ie("pagebreak_split_block"),qe="mce-pagebreak",te=Wt=>{const fn=`<img src="${_e.transparentSrc}" class="${qe}" data-mce-resize="false" data-mce-placeholder />`;return Wt?`<p>${fn}</p>`:fn},Ye=Wt=>{const fn=Re(Wt),st=()=>oe(Wt),it=new RegExp(fn.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,Dt=>"\\"+Dt),"gi");Wt.on("BeforeSetContent",Dt=>{Dt.content=Dt.content.replace(it,te(st()))}),Wt.on("PreInit",()=>{Wt.serializer.addNodeFilter("img",Dt=>{let q=Dt.length,at,Pn;for(;q--;)if(at=Dt[q],Pn=at.attr("class"),Pn&&Pn.indexOf(qe)!==-1){const Et=at.parent;if(Et&&Wt.schema.getBlockElements()[Et.name]&&st()){Et.type=3,Et.value=fn,Et.raw=!0,at.remove();continue}at.type=3,at.value=fn,at.raw=!0}})})},dt=Wt=>{Wt.addCommand("mcePageBreak",()=>{Wt.insertContent(te(oe(Wt)))})},Jt=Wt=>{Wt.on("ResolveName",fn=>{fn.target.nodeName==="IMG"&&Wt.dom.hasClass(fn.target,qe)&&(fn.name="pagebreak")})},wn=Wt=>fn=>{const st=()=>{fn.setEnabled(Wt.selection.isEditable())};return Wt.on("NodeChange",st),st(),()=>{Wt.off("NodeChange",st)}},Yt=Wt=>{const fn=()=>Wt.execCommand("mcePageBreak");Wt.ui.registry.addButton("pagebreak",{icon:"page-break",tooltip:"Page break",onAction:fn,onSetup:wn(Wt)}),Wt.ui.registry.addMenuItem("pagebreak",{text:"Page break",icon:"page-break",onAction:fn,onSetup:wn(Wt)})};var Qt=()=>{I.add("pagebreak",Wt=>{He(Wt),dt(Wt),Yt(Wt),Ye(Wt),Jt(Wt)})};Qt()}(),function(){var I=tinymce.util.Tools.resolve("tinymce.PluginManager"),_e=tinymce.util.Tools.resolve("tinymce.Env"),ie=tinymce.util.Tools.resolve("tinymce.util.Tools");const He=Qt=>Wt=>Wt.options.get(Qt),Re=He("content_style"),oe=He("content_css_cors"),qe=He("body_class"),te=He("body_id"),Ye=Qt=>{var Wt;let fn="";const st=Qt.dom.encode,it=(Wt=Re(Qt))!==null&&Wt!==void 0?Wt:"";fn+='<base href="'+st(Qt.documentBaseURI.getURI())+'">';const Dt=oe(Qt)?' crossorigin="anonymous"':"";ie.each(Qt.contentCSS,St=>{fn+='<link type="text/css" rel="stylesheet" href="'+st(Qt.documentBaseURI.toAbsolute(St))+'"'+Dt+">"}),it&&(fn+='<style type="text/css">'+it+"</style>");const q=te(Qt),at=qe(Qt),Et='<script>document.addEventListener && document.addEventListener("click", function(e) {for (var elm = e.target; elm; elm = elm.parentNode) {if (elm.nodeName === "A" && !('+(_e.os.isMacOS()||_e.os.isiOS()?"e.metaKey":"e.ctrlKey && !e.altKey")+")) {e.preventDefault();}}}, false);<\/script> ",W=Qt.getBody().dir,Ut=W?' dir="'+st(W)+'"':"";return"<!DOCTYPE html><html><head>"+fn+'</head><body id="'+st(q)+'" class="mce-content-body '+st(at)+'"'+Ut+">"+Qt.getContent()+Et+"</body></html>"},dt=Qt=>{const Wt=Ye(Qt);Qt.windowManager.open({title:"Preview",size:"large",body:{type:"panel",items:[{name:"preview",type:"iframe",sandboxed:!0,transparent:!1}]},buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}],initialData:{preview:Wt}}).focus("close")},Jt=Qt=>{Qt.addCommand("mcePreview",()=>{dt(Qt)})},wn=Qt=>{const Wt=()=>Qt.execCommand("mcePreview");Qt.ui.registry.addButton("preview",{icon:"preview",tooltip:"Preview",onAction:Wt}),Qt.ui.registry.addMenuItem("preview",{icon:"preview",text:"Preview",onAction:Wt})};var Yt=()=>{I.add("preview",Qt=>{Jt(Qt),wn(Qt)})};Yt()}(),function(){var I=tinymce.util.Tools.resolve("tinymce.PluginManager");const ie=(it=>Dt=>typeof Dt===it)("function");var He=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),Re=tinymce.util.Tools.resolve("tinymce.util.Tools");const oe=it=>Dt=>Dt.options.get(it),qe=it=>{const Dt=it.options.register;Dt("save_enablewhendirty",{processor:"boolean",default:!0}),Dt("save_onsavecallback",{processor:"function"}),Dt("save_oncancelcallback",{processor:"function"})},te=oe("save_enablewhendirty"),Ye=oe("save_onsavecallback"),dt=oe("save_oncancelcallback"),Jt=(it,Dt)=>{it.notificationManager.open({text:Dt,type:"error"})},wn=it=>{const Dt=He.DOM.getParent(it.id,"form");if(te(it)&&!it.isDirty())return;it.save();const q=Ye(it);if(ie(q)){q.call(it,it),it.nodeChanged();return}Dt?(it.setDirty(!1),(!Dt.onsubmit||Dt.onsubmit())&&(typeof Dt.submit=="function"?Dt.submit():Jt(it,"Error: Form submit field collision.")),it.nodeChanged()):Jt(it,"Error: No form element found.")},Yt=it=>{const Dt=Re.trim(it.startContent),q=dt(it);if(ie(q)){q.call(it,it);return}it.resetContent(Dt)},Qt=it=>{it.addCommand("mceSave",()=>{wn(it)}),it.addCommand("mceCancel",()=>{Yt(it)})},Wt=it=>Dt=>{const q=()=>{Dt.setEnabled(!te(it)||it.isDirty())};return q(),it.on("NodeChange dirty",q),()=>it.off("NodeChange dirty",q)},fn=it=>{it.ui.registry.addButton("save",{icon:"save",tooltip:"Save",enabled:!1,onAction:()=>it.execCommand("mceSave"),onSetup:Wt(it)}),it.ui.registry.addButton("cancel",{icon:"cancel",tooltip:"Cancel",enabled:!1,onAction:()=>it.execCommand("mceCancel"),onSetup:Wt(it)}),it.addShortcut("Meta+S","","mceSave")};var st=()=>{I.add("save",it=>{qe(it),fn(it),Qt(it)})};st()}(),function(){var I=tinymce.util.Tools.resolve("tinymce.PluginManager");const _e=(C,A,H)=>{var Q;return H(C,A.prototype)?!0:((Q=C.constructor)===null||Q===void 0?void 0:Q.name)===A.name},ie=C=>{const A=typeof C;return C===null?"null":A==="object"&&Array.isArray(C)?"array":A==="object"&&_e(C,String,(H,Q)=>Q.isPrototypeOf(H))?"string":A},He=C=>A=>ie(A)===C,Re=C=>A=>typeof A===C,oe=C=>A=>C===A,qe=He("string"),te=He("array"),Ye=Re("boolean"),dt=oe(void 0),Jt=C=>C==null,wn=C=>!Jt(C),Yt=Re("function"),Qt=Re("number"),Wt=()=>{},fn=(C,A)=>H=>C(A(H)),st=C=>()=>C,it=C=>C,Dt=(C,A)=>C===A;function q(C,...A){return(...H)=>{const Q=A.concat(H);return C.apply(null,Q)}}const at=C=>{C()},Pn=st(!1),Et=st(!0);class W{constructor(A,H){this.tag=A,this.value=H}static some(A){return new W(!0,A)}static none(){return W.singletonNone}fold(A,H){return this.tag?H(this.value):A()}isSome(){return this.tag}isNone(){return!this.tag}map(A){return this.tag?W.some(A(this.value)):W.none()}bind(A){return this.tag?A(this.value):W.none()}exists(A){return this.tag&&A(this.value)}forall(A){return!this.tag||A(this.value)}filter(A){return!this.tag||A(this.value)?this:W.none()}getOr(A){return this.tag?this.value:A}or(A){return this.tag?this:A}getOrThunk(A){return this.tag?this.value:A()}orThunk(A){return this.tag?this:A()}getOrDie(A){if(this.tag)return this.value;throw new Error(A??"Called getOrDie on None")}static from(A){return wn(A)?W.some(A):W.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(A){this.tag&&A(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}W.singletonNone=new W(!1);const Ut=Object.keys,cn=Object.hasOwnProperty,St=(C,A)=>{const H=Ut(C);for(let Q=0,Le=H.length;Q<Le;Q++){const Bt=H[Q],ln=C[Bt];A(ln,Bt)}},Ue=C=>(A,H)=>{C[H]=A},ce=(C,A,H,Q)=>{St(C,(Le,Bt)=>{(A(Le,Bt)?H:Q)(Le,Bt)})},Zn=(C,A)=>{const H={};return ce(C,A,Ue(H),Wt),H},Ie=(C,A)=>{const H=[];return St(C,(Q,Le)=>{H.push(A(Q,Le))}),H},pe=C=>Ie(C,it),S=C=>Ut(C).length,je=(C,A)=>me(C,A)?W.from(C[A]):W.none(),me=(C,A)=>cn.call(C,A),kt=(C,A)=>me(C,A)&&C[A]!==void 0&&C[A]!==null,Rt=C=>{for(const A in C)if(cn.call(C,A))return!1;return!0},we=Array.prototype.indexOf,Nt=Array.prototype.push,bn=(C,A)=>we.call(C,A),Qe=(C,A)=>bn(C,A)>-1,Zt=(C,A)=>{for(let H=0,Q=C.length;H<Q;H++){const Le=C[H];if(A(Le,H))return!0}return!1},Oe=(C,A)=>{const H=[];for(let Q=0;Q<C;Q++)H.push(A(Q));return H},ot=(C,A)=>{const H=C.length,Q=new Array(H);for(let Le=0;Le<H;Le++){const Bt=C[Le];Q[Le]=A(Bt,Le)}return Q},F=(C,A)=>{for(let H=0,Q=C.length;H<Q;H++){const Le=C[H];A(Le,H)}},po=(C,A)=>{for(let H=C.length-1;H>=0;H--){const Q=C[H];A(Q,H)}},ht=(C,A)=>{const H=[],Q=[];for(let Le=0,Bt=C.length;Le<Bt;Le++){const ln=C[Le];(A(ln,Le)?H:Q).push(ln)}return{pass:H,fail:Q}},Pt=(C,A)=>{const H=[];for(let Q=0,Le=C.length;Q<Le;Q++){const Bt=C[Q];A(Bt,Q)&&H.push(Bt)}return H},an=(C,A,H)=>(po(C,(Q,Le)=>{H=A(H,Q,Le)}),H),so=(C,A,H)=>(F(C,(Q,Le)=>{H=A(H,Q,Le)}),H),le=(C,A,H)=>{for(let Q=0,Le=C.length;Q<Le;Q++){const Bt=C[Q];if(A(Bt,Q))return W.some(Bt);if(H(Bt,Q))break}return W.none()},Ne=(C,A)=>le(C,A,Pn),ke=C=>{const A=[];for(let H=0,Q=C.length;H<Q;++H){if(!te(C[H]))throw new Error("Arr.flatten item "+H+" was not an array, input: "+C);Nt.apply(A,C[H])}return A},Y=(C,A)=>ke(ot(C,A)),re=(C,A)=>{for(let H=0,Q=C.length;H<Q;++H){const Le=C[H];if(A(Le,H)!==!0)return!1}return!0},xe=(C,A)=>{const H={};for(let Q=0,Le=C.length;Q<Le;Q++){const Bt=C[Q];H[String(Bt)]=A(Bt,Q)}return H},Se=(C,A)=>A>=0&&A<C.length?W.some(C[A]):W.none(),$e=C=>Se(C,0),G=C=>Se(C,C.length-1),Ee=(C,A)=>{for(let H=0;H<C.length;H++){const Q=A(C[H],H);if(Q.isSome())return Q}return W.none()},ze=8,Mt=9,Nn=11,Rn=1,Wn=3,zn=(C,A)=>{const Q=(A||document).createElement("div");if(Q.innerHTML=C,!Q.hasChildNodes()||Q.childNodes.length>1){const Le="HTML does not have a single root node";throw console.error(Le,C),new Error(Le)}return lt(Q.childNodes[0])},Do=(C,A)=>{const Q=(A||document).createElement(C);return lt(Q)},Xe=(C,A)=>{const Q=(A||document).createTextNode(C);return lt(Q)},lt=C=>{if(C==null)throw new Error("Node cannot be null or undefined");return{dom:C}},Ft={fromHtml:zn,fromTag:Do,fromText:Xe,fromDom:lt,fromPoint:(C,A,H)=>W.from(C.dom.elementFromPoint(A,H)).map(lt)},$n=(C,A)=>{const H=C.dom;if(H.nodeType!==Rn)return!1;{const Q=H;if(Q.matches!==void 0)return Q.matches(A);if(Q.msMatchesSelector!==void 0)return Q.msMatchesSelector(A);if(Q.webkitMatchesSelector!==void 0)return Q.webkitMatchesSelector(A);if(Q.mozMatchesSelector!==void 0)return Q.mozMatchesSelector(A);throw new Error("Browser lacks native selectors")}},xo=C=>C.nodeType!==Rn&&C.nodeType!==Mt&&C.nodeType!==Nn||C.childElementCount===0,vo=(C,A)=>{const H=A===void 0?document:A.dom;return xo(H)?[]:ot(H.querySelectorAll(C),Ft.fromDom)},fs=(C,A)=>{const H=A===void 0?document:A.dom;return xo(H)?W.none():W.from(H.querySelector(C)).map(Ft.fromDom)},Bo=(C,A)=>C.dom===A.dom,Es=$n;typeof window<"u"||Function("return this;")();const Kt=C=>C.dom.nodeName.toLowerCase(),Vo=C=>C.dom.nodeType,tr=C=>A=>Vo(A)===C,Vr=C=>Vo(C)===ze||Kt(C)==="#comment",Rr=tr(Rn),kr=tr(Wn),Cs=tr(Mt),zr=tr(Nn),Qr=C=>A=>Rr(A)&&Kt(A)===C,Ts=C=>Ft.fromDom(C.dom.ownerDocument),ao=C=>Cs(C)?C:Ts(C),ur=C=>W.from(C.dom.parentNode).map(Ft.fromDom),Je=(C,A)=>{const H=Yt(A)?A:Pn;let Q=C.dom;const Le=[];for(;Q.parentNode!==null&&Q.parentNode!==void 0;){const Bt=Q.parentNode,ln=Ft.fromDom(Bt);if(Le.push(ln),H(ln)===!0)break;Q=Bt}return Le},bt=C=>W.from(C.dom.previousSibling).map(Ft.fromDom),yn=C=>W.from(C.dom.nextSibling).map(Ft.fromDom),Mn=C=>ot(C.dom.childNodes,Ft.fromDom),To=(C,A)=>{const H=C.dom.childNodes;return W.from(H[A]).map(Ft.fromDom)},is=C=>To(C,0),Hr=C=>zr(C)&&wn(C.dom.host),pr=Yt(Element.prototype.attachShadow)&&Yt(Node.prototype.getRootNode)?C=>Ft.fromDom(C.dom.getRootNode()):ao,Ce=C=>{const A=pr(C);return Hr(A)?W.some(A):W.none()},be=C=>Ft.fromDom(C.dom.host),mt=C=>{const A=kr(C)?C.dom.parentNode:C.dom;if(A==null||A.ownerDocument===null)return!1;const H=A.ownerDocument;return Ce(Ft.fromDom(A)).fold(()=>H.body.contains(A),fn(mt,be))};var Tt=(C,A,H,Q,Le)=>C(H,Q)?W.some(H):Yt(Le)&&Le(H)?W.none():A(H,Q,Le);const Yn=(C,A,H)=>{let Q=C.dom;const Le=Yt(H)?H:Pn;for(;Q.parentNode;){Q=Q.parentNode;const Bt=Ft.fromDom(Q);if(A(Bt))return W.some(Bt);if(Le(Bt))break}return W.none()},lo=(C,A,H)=>Tt((Le,Bt)=>Bt(Le),Yn,C,A,H),Go=(C,A)=>{const H=Le=>A(Ft.fromDom(Le));return Ne(C.dom.childNodes,H).map(Ft.fromDom)},Xs=(C,A,H)=>Yn(C,Q=>$n(Q,A),H),Fe=(C,A)=>Go(C,H=>$n(H,A)),Ao=(C,A)=>fs(A,C),ve=(C,A,H)=>Tt((Le,Bt)=>$n(Le,Bt),Xs,C,A,H),Be=C=>ve(C,"[contenteditable]"),It=(C,A=!1)=>mt(C)?C.dom.isContentEditable:Be(C).fold(st(A),H=>Xt(H)==="true"),Xt=C=>C.dom.contentEditable,En=C=>C.nodeName.toLowerCase(),no=C=>Ft.fromDom(C.getBody()),qn=C=>A=>Bo(A,no(C)),Kn=C=>C?C.replace(/px$/,""):"",Xn=C=>/^\d+(\.\d+)?$/.test(C)?C+"px":C,fo=C=>Ft.fromDom(C.selection.getStart()),rs=C=>Ft.fromDom(C.selection.getEnd()),js=C=>lo(C,Qr("table")).forall(It),Fa=(C,A)=>Pt(Mn(C),A),gc=(C,A)=>{let H=[];return F(Mn(C),Q=>{A(Q)&&(H=H.concat([Q])),H=H.concat(gc(Q,A))}),H},kc=(C,A)=>Fa(C,H=>$n(H,A)),So=(C,A)=>vo(A,C),es=(C,A,H)=>{if(qe(H)||Ye(H)||Qt(H))C.setAttribute(A,H+"");else throw console.error("Invalid call to Attribute.set. Key ",A,":: Value ",H,":: Element ",C),new Error("Attribute value was not simple")},As=(C,A,H)=>{es(C.dom,A,H)},Oa=(C,A)=>{const H=C.dom;St(A,(Q,Le)=>{es(H,Le,Q)})},ea=(C,A)=>{const H=C.dom.getAttribute(A);return H===null?void 0:H},hr=(C,A)=>W.from(ea(C,A)),Zs=(C,A)=>{C.dom.removeAttribute(A)},Ma=C=>so(C.dom.attributes,(A,H)=>(A[H.name]=H.value,A),{}),Vl=(C,A,H=Dt)=>C.exists(Q=>H(Q,A)),Ms=C=>{const A=[],H=Q=>{A.push(Q)};for(let Q=0;Q<C.length;Q++)C[Q].each(H);return A},ra=(C,A,H)=>C.isSome()&&A.isSome()?W.some(H(C.getOrDie(),A.getOrDie())):W.none(),Ia=C=>C.bind(it),Wr=(C,A)=>C?W.some(A):W.none(),pc=(C,A)=>C.substring(A),_c=(C,A,H)=>A===""||C.length>=A.length&&C.substr(H,H+A.length)===A,wa=(C,A)=>Ec(C,A)?pc(C,A.length):C,Ec=(C,A)=>_c(C,A,0),Ti=(C=>A=>A.replace(C,""))(/^\s+|\s+$/g),hc=C=>C.length>0,zl=C=>!hc(C),La=(C,A=10)=>{const H=parseInt(C,A);return isNaN(H)?W.none():W.some(H)},dl=C=>{const A=parseFloat(C);return isNaN(A)?W.none():W.some(A)},Dl=C=>C.style!==void 0&&Yt(C.style.getPropertyValue),ri=(C,A,H)=>{if(!qe(H))throw console.error("Invalid call to CSS.set. Property ",A,":: Value ",H,":: Element ",C),new Error("CSS value must be a string: "+H);Dl(C)&&C.style.setProperty(A,H)},yu=(C,A)=>{Dl(C)&&C.style.removeProperty(A)},Z=(C,A,H)=>{const Q=C.dom;ri(Q,A,H)},Ae=(C,A)=>{const H=C.dom,Le=window.getComputedStyle(H).getPropertyValue(A);return Le===""&&!mt(C)?Ze(H,A):Le},Ze=(C,A)=>Dl(C)?C.style.getPropertyValue(A):"",gt=(C,A)=>{const H=C.dom,Q=Ze(H,A);return W.from(Q).filter(Le=>Le.length>0)},on=(C,A)=>{const H=C.dom;yu(H,A),Vl(hr(C,"style").map(Ti),"")&&Zs(C,"style")},ho=(C,A,H=0)=>hr(C,A).map(Q=>parseInt(Q,10)).getOr(H),Gs=(C,A)=>Js(C,A,Et),Js=(C,A,H)=>Y(Mn(C),Q=>$n(Q,A)?H(Q)?[Q]:[]:Js(Q,A,H)),zs=["tfoot","thead","tbody","colgroup"],rr=C=>Qe(zs,C),us=(C,A)=>({rows:C,columns:A}),_r=(C,A,H)=>({element:C,rowspan:A,colspan:H}),Va=(C,A,H,Q,Le,Bt)=>({element:C,rowspan:A,colspan:H,row:Q,column:Le,isLocked:Bt}),ai=(C,A,H)=>({element:C,cells:A,section:H}),Tn=(C,A,H,Q)=>({startRow:C,startCol:A,finishRow:H,finishCol:Q}),tu=(C,A,H)=>({element:C,colspan:A,column:H}),br=(C,A)=>({element:C,columns:A}),M=(C,A,H=Pn)=>{if(H(A))return W.none();if(Qe(C,Kt(A)))return W.some(A);const Q=Le=>$n(Le,"table")||H(Le);return Xs(A,C.join(","),Q)},ee=(C,A)=>M(["td","th"],C,A),ge=C=>Gs(C,"th,td"),pt=C=>$n(C,"colgroup")?kc(C,"col"):Y(Hn(C),A=>kc(A,"col")),Sn=(C,A)=>ve(C,"table",A),ts=C=>Gs(C,"tr"),Hn=C=>Sn(C).fold(st([]),A=>kc(A,"colgroup")),yr=(C,A)=>ot(C,H=>{if(Kt(H)==="colgroup"){const Q=ot(pt(H),Le=>{const Bt=ho(Le,"span",1);return _r(Le,1,Bt)});return ai(H,Q,"colgroup")}else{const Q=ot(ge(H),Le=>{const Bt=ho(Le,"rowspan",1),ln=ho(Le,"colspan",1);return _r(Le,Bt,ln)});return ai(H,Q,A(H))}}),tn=C=>ur(C).map(A=>{const H=Kt(A);return rr(H)?H:"tbody"}).getOr("tbody"),nr=C=>{const A=ts(C),Q=[...Hn(C),...A];return yr(Q,tn)},Za="data-snooker-locked-cols",ar=C=>hr(C,Za).bind(A=>W.from(A.match(/\d+/g))).map(A=>xe(A,Et)),aa=(C,A)=>C+","+A,ml=(C,A,H)=>W.from(C.access[aa(A,H)]),gs=(C,A,H)=>{const Q=Ja(C,Le=>H(A,Le.element));return Q.length>0?W.some(Q[0]):W.none()},Ja=(C,A)=>{const H=Y(C.all,Q=>Q.cells);return Pt(H,A)},vr=C=>{const A={};let H=0;return F(C.cells,Q=>{const Le=Q.colspan;Oe(Le,Bt=>{const ln=H+Bt;A[ln]=tu(Q.element,Le,ln)}),H+=Le}),A},Hl=C=>{const A={},H=[],Le=$e(C).map(Rl=>Rl.element).bind(Sn).bind(ar).getOr({});let Bt=0,ln=0,kn=0;const{pass:uo,fail:Zo}=ht(C,Rl=>Rl.section==="colgroup");F(Zo,Rl=>{const vl=[];F(Rl.cells,fi=>{let Rd=0;for(;A[aa(kn,Rd)]!==void 0;)Rd++;const uu=kt(Le,Rd.toString()),Rg=Va(fi.element,fi.rowspan,fi.colspan,kn,Rd,uu);for(let yf=0;yf<fi.colspan;yf++)for(let _m=0;_m<fi.rowspan;_m++){const Pg=kn+_m,$a=Rd+yf,gi=aa(Pg,$a);A[gi]=Rg,ln=Math.max(ln,$a+1)}vl.push(Rg)}),Bt++,H.push(ai(Rl.element,vl,Rl.section)),kn++});const{columns:la,colgroups:qs}=G(uo).map(Rl=>{const vl=vr(Rl);return{colgroups:[br(Rl.element,pe(vl))],columns:vl}}).getOrThunk(()=>({colgroups:[],columns:{}}));return{grid:us(Bt,ln),access:A,all:H,columns:la,colgroups:qs}},fl={fromTable:C=>{const A=nr(C);return Hl(A)},generate:Hl,getAt:ml,findItem:gs,filterItems:Ja,justCells:C=>Y(C.all,A=>A.cells),justColumns:C=>pe(C.columns),hasColumns:C=>Ut(C.columns).length>0,getColumnAt:(C,A)=>W.from(C.columns[A])};var Ul=tinymce.util.Tools.resolve("tinymce.util.Tools");const Ac=(C,A,H)=>{const Q=C.select("td,th",A);let Le;for(let Bt=0;Bt<Q.length;Bt++){const ln=C.getStyle(Q[Bt],H);if(dt(Le)&&(Le=ln),Le!==ln)return""}return Le},Mc=(C,A,H)=>{Ul.each("left center right".split(" "),Q=>{Q!==H&&C.formatter.remove("align"+Q,{},A)}),H&&C.formatter.apply("align"+H,{},A)},Gu=(C,A,H)=>{Ul.each("top middle bottom".split(" "),Q=>{Q!==H&&C.formatter.remove("valign"+Q,{},A)}),H&&C.formatter.apply("valign"+H,{},A)},ps=(C,A,H)=>{C.dispatch("TableModified",{...H,table:A})},X=(C,A)=>dl(C).getOr(A),fe=(C,A,H)=>X(Ae(C,A),H),ct=(C,A,H,Q)=>{const Le=fe(C,`padding-${H}`,0),Bt=fe(C,`padding-${Q}`,0),ln=fe(C,`border-${H}-width`,0),kn=fe(C,`border-${Q}-width`,0);return A-Le-Bt-ln-kn},wt=(C,A)=>{const H=C.dom,Q=H.getBoundingClientRect().width||H.offsetWidth;return A==="border-box"?Q:ct(C,Q,"left","right")},$o=C=>wt(C,"content-box");var jr=tinymce.util.Tools.resolve("tinymce.Env");const Qa="tableprops tabledelete | tableinsertrowbefore tableinsertrowafter tabledeleterow | tableinsertcolbefore tableinsertcolafter tabledeletecol",Tr=Oe(5,C=>{const A=`${C+1}px`;return{title:A,value:A}}),bc=ot(["Solid","Dotted","Dashed","Double","Groove","Ridge","Inset","Outset","None","Hidden"],C=>({title:C,value:C.toLowerCase()})),Ls="100%",qr=C=>{var A;const H=C.dom,Q=(A=H.getParent(C.selection.getStart(),H.isBlock))!==null&&A!==void 0?A:C.getBody();return $o(Ft.fromDom(Q))+"px"},ha=(C,A)=>bg(C)||!ci(C)?A:hg(C)?{...A,width:qr(C)}:{...A,width:Ls},Dc=(C,A)=>bg(C)||ci(C)?A:hg(C)?{...A,width:qr(C)}:{...A,width:Ls},ma=C=>A=>A.options.get(C),Ir=C=>{const A=C.options.register;A("table_border_widths",{processor:"object[]",default:Tr}),A("table_border_styles",{processor:"object[]",default:bc}),A("table_cell_advtab",{processor:"boolean",default:!0}),A("table_row_advtab",{processor:"boolean",default:!0}),A("table_advtab",{processor:"boolean",default:!0}),A("table_appearance_options",{processor:"boolean",default:!0}),A("table_grid",{processor:"boolean",default:!jr.deviceType.isTouch()}),A("table_cell_class_list",{processor:"object[]",default:[]}),A("table_row_class_list",{processor:"object[]",default:[]}),A("table_class_list",{processor:"object[]",default:[]}),A("table_toolbar",{processor:"string",default:Qa}),A("table_background_color_map",{processor:"object[]",default:[]}),A("table_border_color_map",{processor:"object[]",default:[]})},ta=ma("table_sizing_mode"),Ic=ma("table_border_widths"),Wl=ma("table_border_styles"),mf=ma("table_cell_advtab"),pm=ma("table_row_advtab"),Lc=ma("table_advtab"),hm=ma("table_appearance_options"),Vc=ma("table_grid"),ci=ma("table_style_by_css"),bm=ma("table_cell_class_list"),wu=ma("table_row_class_list"),ym=ma("table_class_list"),Ai=ma("table_toolbar"),pg=ma("table_background_color_map"),nu=ma("table_border_color_map"),hg=C=>ta(C)==="fixed",bg=C=>ta(C)==="responsive",yg=C=>{const A=C.options,H=A.get("table_default_styles");return A.isSet("table_default_styles")?H:ha(C,H)},qu=C=>{const A=C.options,H=A.get("table_default_attributes");return A.isSet("table_default_attributes")?H:Dc(C,H)},xp=(C,A)=>A.column>=C.startCol&&A.column+A.colspan-1<=C.finishCol&&A.row>=C.startRow&&A.row+A.rowspan-1<=C.finishRow,ye=(C,A)=>{let H=!0;const Q=q(xp,A);for(let Le=A.startRow;Le<=A.finishRow;Le++)for(let Bt=A.startCol;Bt<=A.finishCol;Bt++)H=H&&fl.getAt(C,Le,Bt).exists(Q);return H?W.some(A):W.none()},xu=(C,A)=>Tn(Math.min(C.row,A.row),Math.min(C.column,A.column),Math.max(C.row+C.rowspan-1,A.row+A.rowspan-1),Math.max(C.column+C.colspan-1,A.column+A.colspan-1)),Nl=(C,A,H)=>{const Q=fl.findItem(C,A,Bo),Le=fl.findItem(C,H,Bo);return Q.bind(Bt=>Le.map(ln=>xu(Bt,ln)))},Ed=(C,A,H)=>Nl(C,A,H).bind(Q=>ye(C,Q)),vg=(C,A,H)=>{const Q=sb(C);return Ed(Q,A,H)},sb=fl.fromTable,Ds=(C,A)=>{ur(C).each(Q=>{Q.dom.insertBefore(A.dom,C.dom)})},yc=(C,A)=>{yn(C).fold(()=>{ur(C).each(Le=>{Ol(Le,A)})},Q=>{Ds(Q,A)})},Di=(C,A)=>{is(C).fold(()=>{Ol(C,A)},Q=>{C.dom.insertBefore(A.dom,Q.dom)})},Ol=(C,A)=>{C.dom.appendChild(A.dom)},Cu=(C,A)=>{Ds(C,A),Ol(A,C)},jl=(C,A)=>{F(A,(H,Q)=>{const Le=Q===0?C:A[Q-1];yc(Le,H)})},ec=(C,A)=>{F(A,H=>{Ol(C,H)})},li=C=>{const A=C.dom;A.parentNode!==null&&A.parentNode.removeChild(A)},wg=C=>{const A=Mn(C);A.length>0&&jl(C,A),li(C)},Bl=((C,A)=>{const H=Bt=>{if(!C(Bt))throw new Error("Can only get "+A+" value of a "+A+" node");return Q(Bt).getOr("")},Q=Bt=>C(Bt)?W.from(Bt.dom.nodeValue):W.none();return{get:H,getOption:Q,set:(Bt,ln)=>{if(!C(Bt))throw new Error("Can only set raw "+A+" value of a "+A+" node");Bt.dom.nodeValue=ln}}})(kr,"text"),Ni=C=>Bl.get(C),xg=(C,A)=>Bl.set(C,A);var Nc=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","li","table","thead","tbody","tfoot","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"],xa=()=>{const C=Zo=>Ft.fromDom(Zo.dom.cloneNode(!1)),A=Zo=>ao(Zo).dom,H=Zo=>Rr(Zo)?Kt(Zo)==="body"?!0:Qe(Nc,Kt(Zo)):!1,Q=Zo=>Rr(Zo)?Qe(["br","img","hr","input"],Kt(Zo)):!1,Le=Zo=>Rr(Zo)&&ea(Zo,"contenteditable")==="false",Bt=(Zo,la)=>Zo.dom.compareDocumentPosition(la.dom),ln=(Zo,la)=>{const qs=Ma(Zo);Oa(la,qs)},kn=Zo=>{const la=Kt(Zo);return Qe(["script","noscript","iframe","noframes","noembed","title","style","textarea","xmp"],la)},uo=Zo=>Rr(Zo)?hr(Zo,"lang"):W.none();return{up:st({selector:Xs,closest:ve,predicate:Yn,all:Je}),down:st({selector:So,predicate:gc}),styles:st({get:Ae,getRaw:gt,set:Z,remove:on}),attrs:st({get:ea,set:As,remove:Zs,copyTo:ln}),insert:st({before:Ds,after:yc,afterAll:jl,append:Ol,appendAll:ec,prepend:Di,wrap:Cu}),remove:st({unwrap:wg,remove:li}),create:st({nu:Ft.fromTag,clone:C,text:Ft.fromText}),query:st({comparePosition:Bt,prevSibling:bt,nextSibling:yn}),property:st({children:Mn,name:Kt,parent:ur,document:A,isText:kr,isComment:Vr,isElement:Rr,isSpecial:kn,getLanguage:uo,getText:Ni,setText:xg,isBoundary:H,isEmptyTag:Q,isNonEditable:Le}),eq:Bo,is:Es}};const Su=(C,A,H,Q)=>{const Le=H[0],Bt=H.slice(1);return Q(C,A,Le,Bt)},Td=(C,A,H)=>H.length>0?Su(C,A,H,Gl):W.none(),Gl=(C,A,H,Q)=>{const Le=A(C,H);return an(Q,(Bt,ln)=>{const kn=A(C,ln);return Oc(C,Bt,kn)},Le)},Oc=(C,A,H)=>A.bind(Q=>H.filter(q(C.eq,Q))),Cg=Td,Sp=xa(),vm=(C,A)=>Cg(Sp,(H,Q)=>C(Q),A),ff=C=>Xs(C,"table"),Ad=(C,A)=>{const H=So(C,A);return H.length>0?W.some(H):W.none()},Oi=(C,A,H)=>Ao(C,A).bind(Q=>Ao(C,H).bind(Le=>vm(ff,[Q,Le]).map(Bt=>({first:Q,last:Le,table:Bt})))),kp=(C,A)=>Ad(C,A),Ky=(C,A,H)=>Oi(C,A,H).bind(Q=>{const Le=uo=>Bo(C,uo),Bt="thead,tfoot,tbody,table",ln=Xs(Q.first,Bt,Le),kn=Xs(Q.last,Bt,Le);return ln.bind(uo=>kn.bind(Zo=>Bo(uo,Zo)?vg(Q.table,Q.first,Q.last):W.none()))}),Sg=C=>ot(C,Ft.fromDom),kg="data-mce-selected",Ku="td["+kg+"],th["+kg+"]",wm="data-mce-first-selected",Dd="td["+wm+"],th["+wm+"]",Pr="data-mce-last-selected",Kr="td["+Pr+"],th["+Pr+"]",zc={selected:kg,selectedSelector:Ku,firstSelected:wm,firstSelectedSelector:Dd,lastSelected:Pr,lastSelectedSelector:Kr},_g=C=>Sn(C).bind(A=>kp(A,zc.firstSelectedSelector)).fold(st(C),A=>A[0]),_p=C=>(A,H)=>{const Q=Kt(A),Le=Q==="col"||Q==="colgroup"?_g(A):A;return ve(Le,C,H)},Wa=_p("th,td,caption"),ou=_p("th,td"),Hc=C=>Sg(C.model.table.getSelectedCells()),Bi=(C,A)=>{const H=ou(C),Q=H.bind(Le=>Sn(Le)).map(Le=>ts(Le));return ra(H,Q,(Le,Bt)=>Pt(Bt,ln=>Zt(Sg(ln.dom.cells),kn=>ea(kn,A)==="1"||Bo(kn,Le)))).getOr([])},gf=[{text:"None",value:""},{text:"Top",value:"top"},{text:"Middle",value:"middle"},{text:"Bottom",value:"bottom"}],Xo=C=>({value:pf(C)}),Qc=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,ku=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,Nd=C=>Qc.test(C)||ku.test(C),pf=C=>wa(C,"#").toUpperCase(),Ep=C=>Nd(C)?W.some({value:pf(C)}):W.none(),tc=C=>{const A=C.toString(16);return(A.length===1?"0"+A:A).toUpperCase()},fa=C=>{const A=tc(C.red)+tc(C.green)+tc(C.blue);return Xo(A)},gl=/^\s*rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)\s*$/i,Ca=/^\s*rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?(?:\.\d+)?)\s*\)\s*$/i,Od=(C,A,H,Q)=>({red:C,green:A,blue:H,alpha:Q}),Yu=(C,A,H,Q)=>{const Le=parseInt(C,10),Bt=parseInt(A,10),ln=parseInt(H,10),kn=parseFloat(Q);return Od(Le,Bt,ln,kn)},ca=C=>{if(C==="transparent")return W.some(Od(0,0,0,0));const A=gl.exec(C);if(A!==null)return W.some(Yu(A[1],A[2],A[3],"1"));const H=Ca.exec(C);return H!==null?W.some(Yu(H[1],H[2],H[3],H[4])):W.none()},Ba=C=>Ep(C).orThunk(()=>ca(C).map(fa)).getOrThunk(()=>{const A=document.createElement("canvas");A.height=1,A.width=1;const H=A.getContext("2d");H.clearRect(0,0,A.width,A.height),H.fillStyle="#FFFFFF",H.fillStyle=C,H.fillRect(0,0,1,1);const Q=H.getImageData(0,0,1,1).data,Le=Q[0],Bt=Q[1],ln=Q[2],kn=Q[3];return fa(Od(Le,Bt,ln,kn))}),ii=C=>ca(C).map(fa).map(A=>"#"+A.value).getOr(C),Xu=C=>{let A=C;return{get:()=>A,set:Le=>{A=Le}}},ba=C=>{const A=Xu(W.none()),H=()=>A.get().each(C);return{clear:()=>{H(),A.set(W.none())},isSet:()=>A.get().isSome(),get:()=>A.get(),set:kn=>{H(),A.set(W.some(kn))}}},Eg=()=>ba(C=>C.unbind()),Tp=(C,A,H)=>Q=>{const Le=Eg(),Bt=zl(H),ln=()=>{const kn=Hc(C),uo=Zo=>C.formatter.match(A,{value:H},Zo.dom,Bt);Bt?(Q.setActive(!Zt(kn,uo)),Le.set(C.formatter.formatChanged(A,Zo=>Q.setActive(!Zo),!0))):(Q.setActive(re(kn,uo)),Le.set(C.formatter.formatChanged(A,Q.setActive,!1,{value:H})))};return C.initialized?ln():C.on("init",ln),Le.clear},Qs=C=>kt(C,"menu"),ui=C=>ot(C,A=>{const H=A.text||A.title||"";return Qs(A)?{text:H,items:ui(A.menu)}:{text:H,value:A.value}}),Ns=(C,A,H,Q)=>ot(A,Le=>{const Bt=Le.text||Le.title;return Qs(Le)?{type:"nestedmenuitem",text:Bt,getSubmenuItems:()=>Ns(C,Le.menu,H,Q)}:{text:Bt,type:"togglemenuitem",onAction:()=>Q(Le.value),onSetup:Tp(C,H,Le.value)}}),Uc=(C,A)=>H=>{C.execCommand("mceTableApplyCellStyle",!1,{[A]:H})},_u=C=>Y(C,A=>Qs(A)?[{...A,menu:_u(A.menu)}]:hc(A.value)?[A]:[]),su=(C,A,H,Q)=>Le=>Le(Ns(C,A,H,Q)),as=(C,A,H)=>{const Q=ot(A,Le=>({text:Le.title,value:"#"+Ba(Le.value).value,type:"choiceitem"}));return[{type:"fancymenuitem",fancytype:"colorswatch",initData:{colors:Q.length>0?Q:void 0,allowCustomColors:!1},onAction:Le=>{const Bt=Le.value==="remove"?"":Le.value;C.execCommand("mceTableApplyCellStyle",!1,{[H]:Bt})}}]},Zu=C=>()=>{const H=C.queryCommandValue("mceTableRowType")==="header"?"body":"header";C.execCommand("mceTableRowType",!1,{type:H})},Tg=C=>()=>{const H=C.queryCommandValue("mceTableColType")==="th"?"td":"th";C.execCommand("mceTableColType",!1,{type:H})},Ag=C=>{const A=ui(bm(C));return A.length>0?W.some({name:"class",type:"listbox",label:"Class",items:A}):W.none()},rb=[{name:"width",type:"input",label:"Width"},{name:"height",type:"input",label:"Height"},{name:"celltype",type:"listbox",label:"Cell type",items:[{text:"Cell",value:"td"},{text:"Header cell",value:"th"}]},{name:"scope",type:"listbox",label:"Scope",items:[{text:"None",value:""},{text:"Row",value:"row"},{text:"Column",value:"col"},{text:"Row group",value:"rowgroup"},{text:"Column group",value:"colgroup"}]},{name:"halign",type:"listbox",label:"Horizontal align",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{name:"valign",type:"listbox",label:"Vertical align",items:gf}],Ap=C=>rb.concat(Ag(C).toArray()),hf=(C,A)=>{const Q=[{name:"borderstyle",type:"listbox",label:"Border style",items:[{text:"Select...",value:""}].concat(ui(Wl(C)))},{name:"bordercolor",type:"colorinput",label:"Border color"},{name:"backgroundcolor",type:"colorinput",label:"Background color"}];return{title:"Advanced",name:"advanced",items:A==="cell"?[{name:"borderwidth",type:"input",label:"Border width"}].concat(Q):Q}},xm={normal:(C,A)=>{const H=C.dom;return{setAttrib:(ln,kn)=>{H.setAttrib(A,ln,kn)},setStyle:(ln,kn)=>{H.setStyle(A,ln,kn)},setFormat:(ln,kn)=>{kn===""?C.formatter.remove(ln,{value:null},A,!0):C.formatter.apply(ln,{value:kn},A)}}}},_=Qr("th"),B=(C,A)=>C&&A?"sectionCells":C?"section":"cells",U=C=>{const A=C.section==="thead",H=Vl(he(C.cells),"th");return C.section==="tfoot"?{type:"footer"}:A||H?{type:"header",subType:B(A,H)}:{type:"body"}},he=C=>{const A=Pt(C,H=>_(H.element));return A.length===0?W.some("td"):A.length===C.length?W.some("th"):W.none()},Pe=C=>{const A=ot(C,Le=>U(Le).type),H=Qe(A,"header"),Q=Qe(A,"footer");if(!H&&!Q)return W.some("body");{const Le=Qe(A,"body");return H&&!Le&&!Q?W.some("header"):!H&&!Le&&Q?W.some("footer"):W.none()}},nn=C=>{let A=!1,H;return(...Q)=>(A||(A=!0,H=C.apply(null,Q)),H)},Jn=(C,A)=>Ee(C.all,H=>Ne(H.cells,Q=>Bo(A,Q.element))),zo=(C,A,H)=>{const Q=ot(A.selection,Bt=>ee(Bt).bind(ln=>Jn(C,ln)).filter(H)),Le=Ms(Q);return Wr(Le.length>0,Le)},Po=(C,A)=>A.mergable,ko=(C,A)=>A.unmergable,Lr=(C,A)=>zo(C,A,Et),ja=(C,A)=>Jn(C,A).exists(H=>!H.isLocked),pl=(C,A)=>re(A,H=>ja(C,H)),ru=(C,A)=>Po(C,A).filter(H=>pl(C,H.cells)),nc=(C,A)=>ko(C,A).filter(H=>pl(C,H));({...{generate:C=>{if(!te(C))throw new Error("cases must be an array");if(C.length===0)throw new Error("there must be at least one case");const A=[],H={};return F(C,(Q,Le)=>{const Bt=Ut(Q);if(Bt.length!==1)throw new Error("one and only one name per case");const ln=Bt[0],kn=Q[ln];if(H[ln]!==void 0)throw new Error("duplicate key detected:"+ln);if(ln==="cata")throw new Error("cannot have a case named cata (sorry)");if(!te(kn))throw new Error("case arguments must be an array");A.push(ln),H[ln]=(...uo)=>{const Zo=uo.length;if(Zo!==kn.length)throw new Error("Wrong number of arguments to case "+ln+". Expected "+kn.length+" ("+kn+"), got "+Zo);return{fold:(...qs)=>{if(qs.length!==C.length)throw new Error("Wrong number of arguments to fold. Expected "+C.length+", got "+qs.length);return qs[Le].apply(null,uo)},match:qs=>{const Fr=Ut(qs);if(A.length!==Fr.length)throw new Error("Wrong number of arguments to match. Expected: "+A.join(",")+`
|
|
94
94
|
Actual: `+Fr.join(","));if(!re(A,vl=>Qe(Fr,vl)))throw new Error("Not all branches were specified when using match. Specified: "+Fr.join(", ")+`
|
|
95
|
-
Required: `+A.join(", "));return qs[ln].apply(null,uo)},log:qs=>{console.log(qs,{constructors:A,constructor:ln,params:uo})}}}}),H}}.generate([{none:[]},{only:["index"]},{left:["index","next"]},{middle:["prev","index","next"]},{right:["prev","index"]}])});const jn=(C,A)=>{const H=fl.fromTable(C);return Lr(H,A).bind(Le=>{const Bt=Le[Le.length-1],ln=Le[0].row,kn=Bt.row+Bt.rowspan,uo=H.all.slice(ln,kn);return Pe(uo)}).getOr("")},au=C=>Ec(C,"rgb")?ii(C):C,Yy=C=>{const A=Ft.fromDom(C);return{borderwidth:gt(A,"border-width").getOr(""),borderstyle:gt(A,"border-style").getOr(""),bordercolor:gt(A,"border-color").map(au).getOr(""),backgroundcolor:gt(A,"background-color").map(au).getOr("")}},Tu=C=>{const A=C[0],H=C.slice(1);return F(H,Q=>{F(Ut(A),Le=>{St(Q,(Bt,ln)=>{const kn=A[Le];kn!==""&&Le===ln&&kn!==Bt&&(A[Le]="")})})}),A},Sa=(C,A,H,Q)=>Ne(C,Le=>!dt(H.formatter.matchNode(Q,A+Le))).getOr(""),Ju=q(Sa,["left","center","right"],"align"),Ng=q(Sa,["top","middle","bottom"],"valign"),oc=(C,A)=>{const H=yg(C),Q=qu(C),Le=()=>({borderstyle:je(H,"border-style").getOr(""),bordercolor:au(je(H,"border-color").getOr("")),backgroundcolor:au(je(H,"background-color").getOr(""))}),Bt={height:"",width:"100%",cellspacing:"",cellpadding:"",caption:!1,class:"",align:"",border:""},ln=()=>{const la=H["border-width"];return ci(C)&&la?{border:la}:je(Q,"border").fold(()=>({}),qs=>({border:qs}))},kn=A?Le():{},uo=()=>{const la=je(H,"border-spacing").or(je(Q,"cellspacing")).fold(()=>({}),Fr=>({cellspacing:Fr})),qs=je(H,"border-padding").or(je(Q,"cellpadding")).fold(()=>({}),Fr=>({cellpadding:Fr}));return{...la,...qs}};return{...Bt,...H,...Q,...kn,...ln(),...uo()}},cu=C=>Sn(Ft.fromDom(C)).map(A=>{const H={selection:Sg(C.cells)};return jn(A,H)}).getOr(""),Dp=(C,A,H)=>{const Q=(kn,uo)=>{const Zo=gt(Ft.fromDom(uo),"border-width");return ci(C)&&Zo.isSome()?Zo.getOr(""):kn.getAttrib(uo,"border")||Ac(C.dom,uo,"border-width")||Ac(C.dom,uo,"border")||""},Le=C.dom,Bt=ci(C)?Le.getStyle(A,"border-spacing")||Le.getAttrib(A,"cellspacing"):Le.getAttrib(A,"cellspacing")||Le.getStyle(A,"border-spacing"),ln=ci(C)?Ac(Le,A,"padding")||Le.getAttrib(A,"cellpadding"):Le.getAttrib(A,"cellpadding")||Ac(Le,A,"padding");return{width:Le.getStyle(A,"width")||Le.getAttrib(A,"width"),height:Le.getStyle(A,"height")||Le.getAttrib(A,"height"),cellspacing:Bt??"",cellpadding:ln??"",border:Q(Le,A),caption:!!Le.select("caption",A)[0],class:Le.getAttrib(A,"class",""),align:Ju(C,A),...H?Yy(A):{}}},Au=(C,A,H)=>{const Q=C.dom;return{height:Q.getStyle(A,"height")||Q.getAttrib(A,"height"),class:Q.getAttrib(A,"class",""),type:cu(A),align:Ju(C,A),...H?Yy(A):{}}},Xy=(C,A,H,Q)=>{const Le=C.dom,Bt=Q.getOr(A),ln=(kn,uo)=>Le.getStyle(kn,uo)||Le.getAttrib(kn,uo);return{width:ln(Bt,"width"),height:ln(A,"height"),scope:Le.getAttrib(A,"scope"),celltype:En(A),class:Le.getAttrib(A,"class",""),halign:Ju(C,A),valign:Ng(C,A),...H?Yy(A):{}}},Og=(C,A)=>{const H=fl.fromTable(C),Q=fl.justCells(H),Le=Pt(Q,Bt=>Zt(A,ln=>Bo(Bt.element,ln)));return ot(Le,Bt=>({element:Bt.element.dom,column:fl.getColumnAt(H,Bt.column).map(ln=>ln.element.dom)}))},sn=(C,A,H,Q)=>{Q("scope")&&C.setAttrib("scope",H.scope),Q("class")&&C.setAttrib("class",H.class),Q("height")&&C.setStyle("height",Xn(H.height)),Q("width")&&A.setStyle("width",Xn(H.width))},Zy=(C,A,H)=>{H("backgroundcolor")&&C.setFormat("tablecellbackgroundcolor",A.backgroundcolor),H("bordercolor")&&C.setFormat("tablecellbordercolor",A.bordercolor),H("borderstyle")&&C.setFormat("tablecellborderstyle",A.borderstyle),H("borderwidth")&&C.setFormat("tablecellborderwidth",Xn(A.borderwidth))},Bd=(C,A,H,Q)=>{const Le=A.length===1;F(A,Bt=>{const ln=Bt.element,kn=Le?Et:Q,uo=xm.normal(C,ln),Zo=Bt.column.map(la=>xm.normal(C,la)).getOr(uo);sn(uo,Zo,H,kn),mf(C)&&Zy(uo,H,kn),Q("halign")&&Mc(C,ln,H.halign),Q("valign")&&Gu(C,ln,H.valign)})},Qu=(C,A)=>{C.execCommand("mceTableCellType",!1,{type:A.celltype,no_events:!0})},Bg=(C,A,H,Q)=>{const Le=Zn(Q,(Bt,ln)=>H[ln]!==Bt);S(Le)>0&&A.length>=1&&Sn(A[0]).each(Bt=>{const ln=Og(Bt,A),kn=S(Zn(Le,(Zo,la)=>la!=="scope"&&la!=="celltype"))>0,uo=me(Le,"celltype");(kn||me(Le,"scope"))&&Bd(C,ln,Q,q(me,Le)),uo&&Qu(C,Q),ps(C,Bt.dom,{structure:uo,style:kn})})},Yr=(C,A,H,Q)=>{const Le=Q.getData();Q.close(),C.undoManager.transact(()=>{Bg(C,A,H,Le),C.focus()})},cr=(C,A)=>{const H=Sn(A[0]).map(Q=>ot(Og(Q,A),Le=>Xy(C,Le.element,mf(C),Le.column)));return Tu(H.getOrDie())},el=C=>{const A=Hc(C);if(A.length===0)return;const H=cr(C,A),Q={type:"tabpanel",tabs:[{title:"General",name:"general",items:Ap(C)},hf(C,"cell")]},Le={type:"panel",items:[{type:"grid",columns:2,items:Ap(C)}]};C.windowManager.open({title:"Cell Properties",size:"normal",body:mf(C)?Q:Le,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:H,onSubmit:q(Yr,C,A,H)})},Wc=C=>{const A=ui(wu(C));return A.length>0?W.some({name:"class",type:"listbox",label:"Class",items:A}):W.none()},vs=[{type:"listbox",name:"type",label:"Row type",items:[{text:"Header",value:"header"},{text:"Body",value:"body"},{text:"Footer",value:"footer"}]},{type:"listbox",name:"align",label:"Alignment",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{label:"Height",name:"height",type:"input"}],bf=C=>vs.concat(Wc(C).toArray()),vc=(C,A,H)=>{H("class")&&C.setAttrib("class",A.class),H("height")&&C.setStyle("height",Xn(A.height))},ga=(C,A,H)=>{H("backgroundcolor")&&C.setStyle("background-color",A.backgroundcolor),H("bordercolor")&&C.setStyle("border-color",A.bordercolor),H("borderstyle")&&C.setStyle("border-style",A.borderstyle)},Np=(C,A,H,Q)=>{const Bt=A.length===1?Et:Q;F(A,ln=>{const kn=xm.normal(C,ln);vc(kn,H,Bt),pm(C)&&ga(kn,H,Bt),Q("align")&&Mc(C,ln,H.align)})},jt=(C,A)=>{C.execCommand("mceTableRowType",!1,{type:A.type,no_events:!0})},$l=(C,A,H,Q)=>{const Le=Zn(Q,(Bt,ln)=>H[ln]!==Bt);if(S(Le)>0){const Bt=me(Le,"type"),ln=Bt?S(Le)>1:!0;ln&&Np(C,A,Q,q(me,Le)),Bt&&jt(C,Q),Sn(Ft.fromDom(A[0])).each(kn=>ps(C,kn.dom,{structure:Bt,style:ln}))}},$g=(C,A,H,Q)=>{const Le=Q.getData();Q.close(),C.undoManager.transact(()=>{$l(C,A,H,Le),C.focus()})},Vs=C=>{const A=Bi(fo(C),zc.selected);if(A.length===0)return;const H=ot(A,ln=>Au(C,ln.dom,pm(C))),Q=Tu(H),Le={type:"tabpanel",tabs:[{title:"General",name:"general",items:bf(C)},hf(C,"row")]},Bt={type:"panel",items:[{type:"grid",columns:2,items:bf(C)}]};C.windowManager.open({title:"Row Properties",size:"normal",body:pm(C)?Le:Bt,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:Q,onSubmit:q($g,C,ot(A,ln=>ln.dom),Q)})},lu=(C,A,H)=>{const Q=H?[{type:"input",name:"cols",label:"Cols",inputMode:"numeric"},{type:"input",name:"rows",label:"Rows",inputMode:"numeric"}]:[],Le=[{type:"input",name:"width",label:"Width"},{type:"input",name:"height",label:"Height"}],Bt=hm(C)?[{type:"input",name:"cellspacing",label:"Cell spacing",inputMode:"numeric"},{type:"input",name:"cellpadding",label:"Cell padding",inputMode:"numeric"},{type:"input",name:"border",label:"Border width"},{type:"label",label:"Caption",items:[{type:"checkbox",name:"caption",label:"Show caption"}]}]:[],ln=[{type:"listbox",name:"align",label:"Alignment",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]}],kn=A.length>0?[{type:"listbox",name:"class",label:"Class",items:A}]:[];return Q.concat(Le).concat(Bt).concat(ln).concat(kn)},Jy=(C,A,H,Q)=>{if(A.tagName==="TD"||A.tagName==="TH")qe(H)&&wn(Q)?C.setStyle(A,H,Q):C.setStyles(A,H);else if(A.children)for(let Le=0;Le<A.children.length;Le++)Jy(C,A.children[Le],H,Q)},iu=(C,A,H,Q)=>{const Le=C.dom,Bt={},ln={},kn=ci(C),uo=Lc(C);if(dt(H.class)||(Bt.class=H.class),ln.height=Xn(H.height),kn?ln.width=Xn(H.width):Le.getAttrib(A,"width")&&(Bt.width=Kn(H.width)),kn?(ln["border-width"]=Xn(H.border),ln["border-spacing"]=Xn(H.cellspacing)):(Bt.border=H.border,Bt.cellpadding=H.cellpadding,Bt.cellspacing=H.cellspacing),kn&&A.children){const Zo={};if(Q.border&&(Zo["border-width"]=Xn(H.border)),Q.cellpadding&&(Zo.padding=Xn(H.cellpadding)),uo&&Q.bordercolor&&(Zo["border-color"]=H.bordercolor),!Rt(Zo))for(let la=0;la<A.children.length;la++)Jy(Le,A.children[la],Zo)}if(uo){const Zo=H;ln["background-color"]=Zo.backgroundcolor,ln["border-color"]=Zo.bordercolor,ln["border-style"]=Zo.borderstyle}Le.setStyles(A,{...yg(C),...ln}),Le.setAttribs(A,{...qu(C),...Bt})},ab=(C,A,H,Q)=>{const Le=C.dom,Bt=Q.getData(),ln=Zn(Bt,(kn,uo)=>H[uo]!==kn);Q.close(),Bt.class===""&&delete Bt.class,C.undoManager.transact(()=>{if(!A){const kn=La(Bt.cols).getOr(1),uo=La(Bt.rows).getOr(1);C.execCommand("mceInsertTable",!1,{rows:uo,columns:kn}),A=ou(fo(C),qn(C)).bind(Zo=>Sn(Zo,qn(C))).map(Zo=>Zo.dom).getOrDie()}if(S(ln)>0){const kn={border:me(ln,"border"),bordercolor:me(ln,"bordercolor"),cellpadding:me(ln,"cellpadding")};iu(C,A,Bt,kn);const uo=Le.select("caption",A)[0];(uo&&!Bt.caption||!uo&&Bt.caption)&&C.execCommand("mceTableToggleCaption"),Mc(C,A,Bt.align)}if(C.focus(),C.addVisual(),S(ln)>0){const kn=me(ln,"caption"),uo=kn?S(ln)>1:!0;ps(C,A,{structure:kn,style:uo})}})},$i=(C,A)=>{const H=C.dom;let Q,Le=oc(C,Lc(C));A?(Le.cols="1",Le.rows="1",Lc(C)&&(Le.borderstyle="",Le.bordercolor="",Le.backgroundcolor="")):(Q=H.getParent(C.selection.getStart(),"table",C.getBody()),Q?Le=Dp(C,Q,Lc(C)):Lc(C)&&(Le.borderstyle="",Le.bordercolor="",Le.backgroundcolor=""));const Bt=ui(ym(C));Bt.length>0&&Le.class&&(Le.class=Le.class.replace(/\s*mce\-item\-table\s*/g,""));const ln={type:"grid",columns:2,items:lu(C,Bt,A)},kn=()=>({type:"panel",items:[ln]}),uo=()=>({type:"tabpanel",tabs:[{title:"General",name:"general",items:[ln]},hf(C,"table")]}),Zo=Lc(C)?uo():kn();C.windowManager.open({title:"Table Properties",size:"normal",body:Zo,onSubmit:q(ab,C,Q,Le),buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:Le})},cb=C=>{const A=H=>{js(fo(C))&&H()};St({mceTableProps:q($i,C,!1),mceTableRowProps:q(Vs,C),mceTableCellProps:q(el,C),mceInsertTableDialog:q($i,C,!0)},(H,Q)=>C.addCommand(Q,()=>A(H)))},ql=(C,A)=>Fe(C,A).isSome(),Ys=it,Du=C=>{const A=(Q,Le)=>hr(Q,Le).exists(Bt=>parseInt(Bt,10)>1),H=Q=>A(Q,"rowspan")||A(Q,"colspan");return C.length>0&&re(C,H)?W.some(C):W.none()},Cm=(C,A,H)=>A.length<=1?W.none():Ky(C,H.firstSelectedSelector,H.lastSelectedSelector).map(Q=>({bounds:Q,cells:A})),wc=C=>({element:C,mergable:W.none(),unmergable:W.none(),selection:[C]}),lb=(C,A,H)=>({element:H,mergable:Cm(A,C,zc),unmergable:Du(C),selection:Ys(C)}),Sm=C=>{const A=Xu(W.none()),H=Xu([]);let Q=W.none();const Le=Qr("caption"),Bt=Hs=>Q.forall(hs=>!hs[Hs]),ln=()=>Wa(fo(C),qn(C)),kn=()=>Wa(rs(C),qn(C)),uo=()=>ln().bind(Hs=>Ia(ra(Sn(Hs),kn().bind(Sn),(hs,sc)=>Bo(hs,sc)?Le(Hs)?W.some(wc(Hs)):W.some(lb(Hc(C),hs,Hs)):W.none()))),Zo=Hs=>Sn(Hs.element).map(sc=>{const jc=fl.fromTable(sc),ib=Lr(jc,Hs).getOr([]),ed=so(ib,(Gc,Tm)=>(Tm.isLocked&&(Gc.onAny=!0,Tm.column===0?Gc.onFirst=!0:Tm.column+Tm.colspan>=jc.grid.columns&&(Gc.onLast=!0)),Gc),{onAny:!1,onFirst:!1,onLast:!1});return{mergeable:ru(jc,Hs).isSome(),unmergeable:nc(jc,Hs).isSome(),locked:ed}}),la=()=>{A.set(nn(uo)()),Q=A.get().bind(Zo),F(H.get(),at)},qs=Hs=>(Hs(),H.set(H.get().concat([Hs])),()=>{H.set(Pt(H.get(),hs=>hs!==Hs))}),Fr=(Hs,hs)=>qs(()=>A.get().fold(()=>{Hs.setEnabled(!1)},sc=>{Hs.setEnabled(!hs(sc)&&C.selection.isEditable())})),Rl=(Hs,hs,sc)=>qs(()=>A.get().fold(()=>{Hs.setEnabled(!1),Hs.setActive(!1)},jc=>{Hs.setEnabled(!hs(jc)&&C.selection.isEditable()),Hs.setActive(sc(jc))})),vl=Hs=>Q.exists(hs=>hs.locked[Hs]),fi=Hs=>Fr(Hs,hs=>!1),Rd=Hs=>Fr(Hs,hs=>Le(hs.element)),uu=Hs=>hs=>Fr(hs,sc=>Le(sc.element)||vl(Hs)),Rg=Hs=>hs=>Fr(hs,sc=>Le(sc.element)||Hs().isNone()),yf=(Hs,hs)=>sc=>Fr(sc,jc=>Le(jc.element)||Hs().isNone()||vl(hs)),_m=Hs=>Fr(Hs,hs=>Bt("mergeable")),Pg=Hs=>Fr(Hs,hs=>Bt("unmergeable")),$a=Hs=>Rl(Hs,Pn,hs=>Sn(hs.element,qn(C)).exists(jc=>ql(jc,"caption"))),gi=(Hs,hs)=>sc=>Rl(sc,jc=>Le(jc.element),()=>C.queryCommandValue(Hs)===hs),vf=gi("mceTableRowType","header"),Em=gi("mceTableColType","th");return C.on("NodeChange ExecCommand TableSelectorChange",la),{onSetupTable:fi,onSetupCellOrRow:Rd,onSetupColumn:uu,onSetupPasteable:Rg,onSetupPasteableColumn:yf,onSetupMergeable:_m,onSetupUnmergeable:Pg,resetTargets:la,onSetupTableWithCaption:$a,onSetupTableRowHeaders:vf,onSetupTableColumnHeaders:Em,targets:A.get}};var km=tinymce.util.Tools.resolve("tinymce.FakeClipboard");const tl="x-tinymce/dom-table-",$d=tl+"rows",nt=tl+"columns",hl=C=>{var A;const H=(A=km.read())!==null&&A!==void 0?A:[];return Ee(H,Q=>W.from(Q.getType(C)))},di=()=>hl($d),mi=()=>hl(nt),bl=C=>A=>{const H=()=>{A.setEnabled(C.selection.isEditable())};return C.on("NodeChange",H),H(),()=>{C.off("NodeChange",H)}},za=(C,A)=>{C.ui.registry.addMenuButton("table",{tooltip:"Table",icon:"table",onSetup:bl(C),fetch:kn=>kn("inserttable | cell row column | advtablesort | tableprops deletetable")});const H=kn=>()=>C.execCommand(kn),Q=(kn,uo)=>{C.queryCommandSupported(uo.command)&&C.ui.registry.addButton(kn,{...uo,onAction:Yt(uo.onAction)?uo.onAction:H(uo.command)})},Le=(kn,uo)=>{C.queryCommandSupported(uo.command)&&C.ui.registry.addToggleButton(kn,{...uo,onAction:Yt(uo.onAction)?uo.onAction:H(uo.command)})};Q("tableprops",{tooltip:"Table properties",command:"mceTableProps",icon:"table",onSetup:A.onSetupTable}),Q("tabledelete",{tooltip:"Delete table",command:"mceTableDelete",icon:"table-delete-table",onSetup:A.onSetupTable}),Q("tablecellprops",{tooltip:"Cell properties",command:"mceTableCellProps",icon:"table-cell-properties",onSetup:A.onSetupCellOrRow}),Q("tablemergecells",{tooltip:"Merge cells",command:"mceTableMergeCells",icon:"table-merge-cells",onSetup:A.onSetupMergeable}),Q("tablesplitcells",{tooltip:"Split cell",command:"mceTableSplitCells",icon:"table-split-cells",onSetup:A.onSetupUnmergeable}),Q("tableinsertrowbefore",{tooltip:"Insert row before",command:"mceTableInsertRowBefore",icon:"table-insert-row-above",onSetup:A.onSetupCellOrRow}),Q("tableinsertrowafter",{tooltip:"Insert row after",command:"mceTableInsertRowAfter",icon:"table-insert-row-after",onSetup:A.onSetupCellOrRow}),Q("tabledeleterow",{tooltip:"Delete row",command:"mceTableDeleteRow",icon:"table-delete-row",onSetup:A.onSetupCellOrRow}),Q("tablerowprops",{tooltip:"Row properties",command:"mceTableRowProps",icon:"table-row-properties",onSetup:A.onSetupCellOrRow}),Q("tableinsertcolbefore",{tooltip:"Insert column before",command:"mceTableInsertColBefore",icon:"table-insert-column-before",onSetup:A.onSetupColumn("onFirst")}),Q("tableinsertcolafter",{tooltip:"Insert column after",command:"mceTableInsertColAfter",icon:"table-insert-column-after",onSetup:A.onSetupColumn("onLast")}),Q("tabledeletecol",{tooltip:"Delete column",command:"mceTableDeleteCol",icon:"table-delete-column",onSetup:A.onSetupColumn("onAny")}),Q("tablecutrow",{tooltip:"Cut row",command:"mceTableCutRow",icon:"cut-row",onSetup:A.onSetupCellOrRow}),Q("tablecopyrow",{tooltip:"Copy row",command:"mceTableCopyRow",icon:"duplicate-row",onSetup:A.onSetupCellOrRow}),Q("tablepasterowbefore",{tooltip:"Paste row before",command:"mceTablePasteRowBefore",icon:"paste-row-before",onSetup:A.onSetupPasteable(di)}),Q("tablepasterowafter",{tooltip:"Paste row after",command:"mceTablePasteRowAfter",icon:"paste-row-after",onSetup:A.onSetupPasteable(di)}),Q("tablecutcol",{tooltip:"Cut column",command:"mceTableCutCol",icon:"cut-column",onSetup:A.onSetupColumn("onAny")}),Q("tablecopycol",{tooltip:"Copy column",command:"mceTableCopyCol",icon:"duplicate-column",onSetup:A.onSetupColumn("onAny")}),Q("tablepastecolbefore",{tooltip:"Paste column before",command:"mceTablePasteColBefore",icon:"paste-column-before",onSetup:A.onSetupPasteableColumn(mi,"onFirst")}),Q("tablepastecolafter",{tooltip:"Paste column after",command:"mceTablePasteColAfter",icon:"paste-column-after",onSetup:A.onSetupPasteableColumn(mi,"onLast")}),Q("tableinsertdialog",{tooltip:"Insert table",command:"mceInsertTableDialog",icon:"table",onSetup:bl(C)});const Bt=_u(ym(C));Bt.length!==0&&C.queryCommandSupported("mceTableToggleClass")&&C.ui.registry.addMenuButton("tableclass",{icon:"table-classes",tooltip:"Table styles",fetch:su(C,Bt,"tableclass",kn=>C.execCommand("mceTableToggleClass",!1,kn)),onSetup:A.onSetupTable});const ln=_u(bm(C));ln.length!==0&&C.queryCommandSupported("mceTableCellToggleClass")&&C.ui.registry.addMenuButton("tablecellclass",{icon:"table-cell-classes",tooltip:"Cell styles",fetch:su(C,ln,"tablecellclass",kn=>C.execCommand("mceTableCellToggleClass",!1,kn)),onSetup:A.onSetupCellOrRow}),C.queryCommandSupported("mceTableApplyCellStyle")&&(C.ui.registry.addMenuButton("tablecellvalign",{icon:"vertical-align",tooltip:"Vertical align",fetch:su(C,gf,"tablecellverticalalign",Uc(C,"vertical-align")),onSetup:A.onSetupCellOrRow}),C.ui.registry.addMenuButton("tablecellborderwidth",{icon:"border-width",tooltip:"Border width",fetch:su(C,Ic(C),"tablecellborderwidth",Uc(C,"border-width")),onSetup:A.onSetupCellOrRow}),C.ui.registry.addMenuButton("tablecellborderstyle",{icon:"border-style",tooltip:"Border style",fetch:su(C,Wl(C),"tablecellborderstyle",Uc(C,"border-style")),onSetup:A.onSetupCellOrRow}),C.ui.registry.addMenuButton("tablecellbackgroundcolor",{icon:"cell-background-color",tooltip:"Background color",fetch:kn=>kn(as(C,pg(C),"background-color")),onSetup:A.onSetupCellOrRow}),C.ui.registry.addMenuButton("tablecellbordercolor",{icon:"cell-border-color",tooltip:"Border color",fetch:kn=>kn(as(C,nu(C),"border-color")),onSetup:A.onSetupCellOrRow})),Le("tablecaption",{tooltip:"Table caption",icon:"table-caption",command:"mceTableToggleCaption",onSetup:A.onSetupTableWithCaption}),Le("tablerowheader",{tooltip:"Row header",icon:"table-top-header",command:"mceTableRowType",onAction:Zu(C),onSetup:A.onSetupTableRowHeaders}),Le("tablecolheader",{tooltip:"Column header",icon:"table-left-header",command:"mceTableColType",onAction:Tg(C),onSetup:A.onSetupTableColumnHeaders})},Ga=C=>{const A=Q=>C.dom.is(Q,"table")&&C.getBody().contains(Q)&&C.dom.isEditable(Q.parentNode),H=Ai(C);H.length>0&&C.ui.registry.addContextToolbar("table",{predicate:A,items:H,scope:"node",position:"node"})},Qy=C=>A=>{const H=()=>{A.setEnabled(C.selection.isEditable())};return C.on("NodeChange",H),H(),()=>{C.off("NodeChange",H)}},yl=(C,A)=>{const H=qs=>()=>C.execCommand(qs),Q=(qs,Fr)=>C.queryCommandSupported(Fr.command)?(C.ui.registry.addMenuItem(qs,{...Fr,onAction:Yt(Fr.onAction)?Fr.onAction:H(Fr.command)}),!0):!1,Le=(qs,Fr)=>{C.queryCommandSupported(Fr.command)&&C.ui.registry.addToggleMenuItem(qs,{...Fr,onAction:Yt(Fr.onAction)?Fr.onAction:H(Fr.command)})},Bt=qs=>{C.execCommand("mceInsertTable",!1,{rows:qs.numRows,columns:qs.numColumns})},ln=[Q("tableinsertrowbefore",{text:"Insert row before",icon:"table-insert-row-above",command:"mceTableInsertRowBefore",onSetup:A.onSetupCellOrRow}),Q("tableinsertrowafter",{text:"Insert row after",icon:"table-insert-row-after",command:"mceTableInsertRowAfter",onSetup:A.onSetupCellOrRow}),Q("tabledeleterow",{text:"Delete row",icon:"table-delete-row",command:"mceTableDeleteRow",onSetup:A.onSetupCellOrRow}),Q("tablerowprops",{text:"Row properties",icon:"table-row-properties",command:"mceTableRowProps",onSetup:A.onSetupCellOrRow}),Q("tablecutrow",{text:"Cut row",icon:"cut-row",command:"mceTableCutRow",onSetup:A.onSetupCellOrRow}),Q("tablecopyrow",{text:"Copy row",icon:"duplicate-row",command:"mceTableCopyRow",onSetup:A.onSetupCellOrRow}),Q("tablepasterowbefore",{text:"Paste row before",icon:"paste-row-before",command:"mceTablePasteRowBefore",onSetup:A.onSetupPasteable(di)}),Q("tablepasterowafter",{text:"Paste row after",icon:"paste-row-after",command:"mceTablePasteRowAfter",onSetup:A.onSetupPasteable(di)})],kn=[Q("tableinsertcolumnbefore",{text:"Insert column before",icon:"table-insert-column-before",command:"mceTableInsertColBefore",onSetup:A.onSetupColumn("onFirst")}),Q("tableinsertcolumnafter",{text:"Insert column after",icon:"table-insert-column-after",command:"mceTableInsertColAfter",onSetup:A.onSetupColumn("onLast")}),Q("tabledeletecolumn",{text:"Delete column",icon:"table-delete-column",command:"mceTableDeleteCol",onSetup:A.onSetupColumn("onAny")}),Q("tablecutcolumn",{text:"Cut column",icon:"cut-column",command:"mceTableCutCol",onSetup:A.onSetupColumn("onAny")}),Q("tablecopycolumn",{text:"Copy column",icon:"duplicate-column",command:"mceTableCopyCol",onSetup:A.onSetupColumn("onAny")}),Q("tablepastecolumnbefore",{text:"Paste column before",icon:"paste-column-before",command:"mceTablePasteColBefore",onSetup:A.onSetupPasteableColumn(mi,"onFirst")}),Q("tablepastecolumnafter",{text:"Paste column after",icon:"paste-column-after",command:"mceTablePasteColAfter",onSetup:A.onSetupPasteableColumn(mi,"onLast")})],uo=[Q("tablecellprops",{text:"Cell properties",icon:"table-cell-properties",command:"mceTableCellProps",onSetup:A.onSetupCellOrRow}),Q("tablemergecells",{text:"Merge cells",icon:"table-merge-cells",command:"mceTableMergeCells",onSetup:A.onSetupMergeable}),Q("tablesplitcells",{text:"Split cell",icon:"table-split-cells",command:"mceTableSplitCells",onSetup:A.onSetupUnmergeable})];Vc(C)?C.ui.registry.addNestedMenuItem("inserttable",{text:"Table",icon:"table",getSubmenuItems:()=>[{type:"fancymenuitem",fancytype:"inserttable",onAction:Bt}],onSetup:Qy(C)}):C.ui.registry.addMenuItem("inserttable",{text:"Table",icon:"table",onAction:H("mceInsertTableDialog"),onSetup:Qy(C)}),C.ui.registry.addMenuItem("inserttabledialog",{text:"Insert table",icon:"table",onAction:H("mceInsertTableDialog"),onSetup:Qy(C)}),Q("tableprops",{text:"Table properties",onSetup:A.onSetupTable,command:"mceTableProps"}),Q("deletetable",{text:"Delete table",icon:"table-delete-table",onSetup:A.onSetupTable,command:"mceTableDelete"}),Qe(ln,!0)&&C.ui.registry.addNestedMenuItem("row",{type:"nestedmenuitem",text:"Row",getSubmenuItems:st("tableinsertrowbefore tableinsertrowafter tabledeleterow tablerowprops | tablecutrow tablecopyrow tablepasterowbefore tablepasterowafter")}),Qe(kn,!0)&&C.ui.registry.addNestedMenuItem("column",{type:"nestedmenuitem",text:"Column",getSubmenuItems:st("tableinsertcolumnbefore tableinsertcolumnafter tabledeletecolumn | tablecutcolumn tablecopycolumn tablepastecolumnbefore tablepastecolumnafter")}),Qe(uo,!0)&&C.ui.registry.addNestedMenuItem("cell",{type:"nestedmenuitem",text:"Cell",getSubmenuItems:st("tablecellprops tablemergecells tablesplitcells")}),C.ui.registry.addContextMenu("table",{update:()=>(A.resetTargets(),A.targets().fold(st(""),qs=>Kt(qs.element)==="caption"?"tableprops deletetable":"cell row column | advtablesort | tableprops deletetable"))});const Zo=_u(ym(C));Zo.length!==0&&C.queryCommandSupported("mceTableToggleClass")&&C.ui.registry.addNestedMenuItem("tableclass",{icon:"table-classes",text:"Table styles",getSubmenuItems:()=>Ns(C,Zo,"tableclass",qs=>C.execCommand("mceTableToggleClass",!1,qs)),onSetup:A.onSetupTable});const la=_u(bm(C));la.length!==0&&C.queryCommandSupported("mceTableCellToggleClass")&&C.ui.registry.addNestedMenuItem("tablecellclass",{icon:"table-cell-classes",text:"Cell styles",getSubmenuItems:()=>Ns(C,la,"tablecellclass",qs=>C.execCommand("mceTableCellToggleClass",!1,qs)),onSetup:A.onSetupCellOrRow}),C.queryCommandSupported("mceTableApplyCellStyle")&&(C.ui.registry.addNestedMenuItem("tablecellvalign",{icon:"vertical-align",text:"Vertical align",getSubmenuItems:()=>Ns(C,gf,"tablecellverticalalign",Uc(C,"vertical-align")),onSetup:A.onSetupCellOrRow}),C.ui.registry.addNestedMenuItem("tablecellborderwidth",{icon:"border-width",text:"Border width",getSubmenuItems:()=>Ns(C,Ic(C),"tablecellborderwidth",Uc(C,"border-width")),onSetup:A.onSetupCellOrRow}),C.ui.registry.addNestedMenuItem("tablecellborderstyle",{icon:"border-style",text:"Border style",getSubmenuItems:()=>Ns(C,Wl(C),"tablecellborderstyle",Uc(C,"border-style")),onSetup:A.onSetupCellOrRow}),C.ui.registry.addNestedMenuItem("tablecellbackgroundcolor",{icon:"cell-background-color",text:"Background color",getSubmenuItems:()=>as(C,pg(C),"background-color"),onSetup:A.onSetupCellOrRow}),C.ui.registry.addNestedMenuItem("tablecellbordercolor",{icon:"cell-border-color",text:"Border color",getSubmenuItems:()=>as(C,nu(C),"border-color"),onSetup:A.onSetupCellOrRow})),Le("tablecaption",{icon:"table-caption",text:"Table caption",command:"mceTableToggleCaption",onSetup:A.onSetupTableWithCaption}),Le("tablerowheader",{text:"Row header",icon:"table-top-header",command:"mceTableRowType",onAction:Zu(C),onSetup:A.onSetupTableRowHeaders}),Le("tablecolheader",{text:"Column header",icon:"table-left-header",command:"mceTableColType",onAction:Tg(C),onSetup:A.onSetupTableRowHeaders})},Nu=C=>{const A=Sm(C);Ir(C),cb(C),yl(C,A),za(C,A),Ga(C)};var wo=()=>{I.add("table",Nu)};wo()}(),function(){const I=Je=>{let bt=Je;return{get:()=>bt,set:To=>{bt=To}}};var _e=tinymce.util.Tools.resolve("tinymce.PluginManager");const ie=Je=>({isEnabled:()=>Je.get()}),He=(Je,bt)=>Je.dispatch("VisualChars",{state:bt}),Re=(Je,bt,yn)=>{var Mn;return yn(Je,bt.prototype)?!0:((Mn=Je.constructor)===null||Mn===void 0?void 0:Mn.name)===bt.name},oe=Je=>{const bt=typeof Je;return Je===null?"null":bt==="object"&&Array.isArray(Je)?"array":bt==="object"&&Re(Je,String,(yn,Mn)=>Mn.isPrototypeOf(yn))?"string":bt},qe=Je=>bt=>oe(bt)===Je,te=Je=>bt=>typeof bt===Je,Ye=Je=>bt=>Je===bt,dt=qe("string"),Jt=qe("object"),wn=Ye(null),Yt=te("boolean"),Qt=Je=>Je==null,Wt=Je=>!Qt(Je),fn=te("number");class st{constructor(bt,yn){this.tag=bt,this.value=yn}static some(bt){return new st(!0,bt)}static none(){return st.singletonNone}fold(bt,yn){return this.tag?yn(this.value):bt()}isSome(){return this.tag}isNone(){return!this.tag}map(bt){return this.tag?st.some(bt(this.value)):st.none()}bind(bt){return this.tag?bt(this.value):st.none()}exists(bt){return this.tag&&bt(this.value)}forall(bt){return!this.tag||bt(this.value)}filter(bt){return!this.tag||bt(this.value)?this:st.none()}getOr(bt){return this.tag?this.value:bt}or(bt){return this.tag?this:bt}getOrThunk(bt){return this.tag?this.value:bt()}orThunk(bt){return this.tag?this:bt()}getOrDie(bt){if(this.tag)return this.value;throw new Error(bt??"Called getOrDie on None")}static from(bt){return Wt(bt)?st.some(bt):st.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(bt){this.tag&&bt(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}st.singletonNone=new st(!1);const it=(Je,bt)=>{const yn=Je.length,Mn=new Array(yn);for(let To=0;To<yn;To++){const is=Je[To];Mn[To]=bt(is,To)}return Mn},Dt=(Je,bt)=>{for(let yn=0,Mn=Je.length;yn<Mn;yn++){const To=Je[yn];bt(To,yn)}},q=(Je,bt)=>{const yn=[];for(let Mn=0,To=Je.length;Mn<To;Mn++){const is=Je[Mn];bt(is,Mn)&&yn.push(is)}return yn},at=Object.keys,Pn=(Je,bt)=>{const yn=at(Je);for(let Mn=0,To=yn.length;Mn<To;Mn++){const is=yn[Mn],Hr=Je[is];bt(Hr,is)}},Et=typeof window<"u"?window:Function("return this;")(),W=(Je,bt)=>{let yn=bt??Et;for(let Mn=0;Mn<Je.length&&yn!==void 0&&yn!==null;++Mn)yn=yn[Je[Mn]];return yn},Ut=(Je,bt)=>{const yn=Je.split(".");return W(yn,bt)},cn=(Je,bt)=>Ut(Je,bt),St=(Je,bt)=>{const yn=cn(Je,bt);if(yn==null)throw new Error(Je+" not available on this browser");return yn},Ue=Object.getPrototypeOf,ce=Je=>St("HTMLElement",Je),Zn=Je=>{const bt=Ut("ownerDocument.defaultView",Je);return Jt(Je)&&(ce(bt).prototype.isPrototypeOf(Je)||/^HTML\w*Element$/.test(Ue(Je).constructor.name))},Ie=1,pe=3,S=Je=>Je.dom.nodeType,je=Je=>Je.dom.nodeValue,me=Je=>bt=>S(bt)===Je,kt=Je=>Rt(Je)&&Zn(Je.dom),Rt=me(Ie),we=me(pe),Nt=(Je,bt,yn)=>{if(dt(yn)||Yt(yn)||fn(yn))Je.setAttribute(bt,yn+"");else throw console.error("Invalid call to Attribute.set. Key ",bt,":: Value ",yn,":: Element ",Je),new Error("Attribute value was not simple")},bn=(Je,bt,yn)=>{Nt(Je.dom,bt,yn)},Qe=(Je,bt)=>{const yn=Je.dom.getAttribute(bt);return yn===null?void 0:yn},Zt=(Je,bt)=>{Je.dom.removeAttribute(bt)},Oe=(Je,bt)=>{const yn=Qe(Je,bt);return yn===void 0||yn===""?[]:yn.split(" ")},ot=(Je,bt,yn)=>{const To=Oe(Je,bt).concat([yn]);return bn(Je,bt,To.join(" ")),!0},F=(Je,bt,yn)=>{const Mn=q(Oe(Je,bt),To=>To!==yn);return Mn.length>0?bn(Je,bt,Mn.join(" ")):Zt(Je,bt),!1},po=Je=>Je.dom.classList!==void 0,ht=Je=>Oe(Je,"class"),Pt=(Je,bt)=>ot(Je,"class",bt),an=(Je,bt)=>F(Je,"class",bt),so=(Je,bt)=>{po(Je)?Je.dom.classList.add(bt):Pt(Je,bt)},le=Je=>{(po(Je)?Je.dom.classList:ht(Je)).length===0&&Zt(Je,"class")},Ne=(Je,bt)=>{po(Je)?Je.dom.classList.remove(bt):an(Je,bt),le(Je)},ke=(Je,bt)=>{const Mn=(bt||document).createElement("div");if(Mn.innerHTML=Je,!Mn.hasChildNodes()||Mn.childNodes.length>1){const To="HTML does not have a single root node";throw console.error(To,Je),new Error(To)}return xe(Mn.childNodes[0])},Y=(Je,bt)=>{const Mn=(bt||document).createElement(Je);return xe(Mn)},re=(Je,bt)=>{const Mn=(bt||document).createTextNode(Je);return xe(Mn)},xe=Je=>{if(Je==null)throw new Error("Node cannot be null or undefined");return{dom:Je}},$e={fromHtml:ke,fromTag:Y,fromText:re,fromDom:xe,fromPoint:(Je,bt,yn)=>st.from(Je.dom.elementFromPoint(bt,yn)).map(xe)},G={" ":"nbsp","":"shy"},Ee=(Je,bt)=>{let yn="";return Pn(Je,(Mn,To)=>{yn+=To}),new RegExp("["+yn+"]",bt?"g":"")},ze=Je=>{let bt="";return Pn(Je,yn=>{bt&&(bt+=","),bt+="span.mce-"+yn}),bt},Mt=Ee(G),Nn=Ee(G,!0),Rn=ze(G),Wn="mce-nbsp",zn=Je=>Je.dom.contentEditable,Do=Je=>'<span data-mce-bogus="1" class="mce-'+G[Je]+'">'+Je+"</span>",Xe=Je=>Je.nodeName.toLowerCase()==="span"&&Je.classList.contains("mce-nbsp-wrap"),lt=Je=>{const bt=je(Je);return we(Je)&&dt(bt)&&Mt.test(bt)},At=Je=>kt(Je)&&zn(Je)==="false",Ft=(Je,bt)=>{if(kt(Je)&&!Xe(Je.dom)){const yn=zn(Je);if(yn==="true")return!0;if(yn==="false")return!1}return bt},$n=(Je,bt,yn)=>{let Mn=[];const To=Je.dom,is=it(To.childNodes,$e.fromDom),Hr=Ur=>Xe(Ur.dom)||!At(Ur);return Dt(is,Ur=>{yn&&Hr(Ur)&&bt(Ur)&&(Mn=Mn.concat([Ur])),Mn=Mn.concat($n(Ur,bt,Ft(Ur,yn)))}),Mn},xo=(Je,bt)=>{for(;Je.parentNode;){if(Je.parentNode===bt)return bt;Je=Je.parentNode}},vo=Je=>Je.replace(Nn,Do),fs=(Je,bt)=>{const yn=Je.dom,Mn=$n($e.fromDom(bt),lt,Je.dom.isEditable(bt));Dt(Mn,To=>{var is;const Hr=To.dom.parentNode;if(Xe(Hr))so($e.fromDom(Hr),Wn);else{const Ur=vo(yn.encode((is=je(To))!==null&&is!==void 0?is:"")),pr=yn.create("div",{},Ur);let Ce;for(;Ce=pr.lastChild;)yn.insertAfter(Ce,To.dom);Je.dom.remove(To.dom)}})},Bo=(Je,bt)=>{const yn=Je.dom.select(Rn,bt);Dt(yn,Mn=>{Xe(Mn)?Ne($e.fromDom(Mn),Wn):Je.dom.remove(Mn,!0)})},Es=Je=>{const bt=Je.getBody(),yn=Je.selection.getBookmark();let Mn=xo(Je.selection.getNode(),bt);Mn=Mn!==void 0?Mn:bt,Bo(Je,Mn),fs(Je,Mn),Je.selection.moveToBookmark(yn)},Kt=(Je,bt)=>{He(Je,bt.get());const yn=Je.getBody();bt.get()===!0?fs(Je,yn):Bo(Je,yn)},Vo=(Je,bt)=>{bt.set(!bt.get());const yn=Je.selection.getBookmark();Kt(Je,bt),Je.selection.moveToBookmark(yn)},tr=(Je,bt)=>{Je.addCommand("mceVisualChars",()=>{Vo(Je,bt)})},Vr=Je=>bt=>bt.options.get(Je),Rr=Je=>{const bt=Je.options.register;bt("visualchars_default_state",{processor:"boolean",default:!1})},kr=Vr("visualchars_default_state"),Cs=(Je,bt)=>{Je.on("init",()=>{Kt(Je,bt)})},zr=(Je,bt)=>{let yn=null;return{cancel:()=>{wn(yn)||(clearTimeout(yn),yn=null)},throttle:(...is)=>{wn(yn)&&(yn=setTimeout(()=>{yn=null,Je.apply(null,is)},bt))}}},Qr=(Je,bt)=>{const yn=zr(()=>{Es(Je)},300);Je.on("keydown",Mn=>{bt.get()===!0&&(Mn.keyCode===13?Es(Je):yn.throttle())}),Je.on("remove",yn.cancel)},Ts=(Je,bt)=>yn=>{yn.setActive(bt.get());const Mn=To=>yn.setActive(To.state);return Je.on("VisualChars",Mn),()=>Je.off("VisualChars",Mn)},ao=(Je,bt)=>{const yn=()=>Je.execCommand("mceVisualChars");Je.ui.registry.addToggleButton("visualchars",{tooltip:"Show invisible characters",icon:"visualchars",onAction:yn,onSetup:Ts(Je,bt)}),Je.ui.registry.addToggleMenuItem("visualchars",{text:"Show invisible characters",icon:"visualchars",onAction:yn,onSetup:Ts(Je,bt)})};var ur=()=>{_e.add("visualchars",Je=>{Rr(Je);const bt=I(kr(Je));return tr(Je,bt),ao(Je,bt),Qr(Je,bt),Cs(Je,bt),ie(bt)})};ur()}();const LZ={class:"font-bold ptext-lg dark:text-white"},VZ=["id"],zZ=p.createElementVNode("hr",{class:"!opacity-100 bg-gray-200 border-0 dark:bg-gray-700"},null,-1),HZ=["for"],UZ=["name","id","type"],WZ={class:"gl-span-form-error"},jZ={class:"block mt-1 text-sm font-normal leading-5 text-gray-500"},GZ={__name:"GlTinymce",props:{is_required:{type:Boolean,default:!1},show:{type:Boolean,default:!1},error_message:{type:String,default:""},model_value:{type:[String,Number],default:null},modelValue:{type:[String,Number],default:""},type:{type:String,default:"text"},field_name:{type:String,default:""},label_name:{type:String,default:""},description:{type:String,default:""}},emits:["update:modelValue","keydown"],setup(I,{expose:_e,emit:ie}){const He=I,Re=ie,oe=p.ref(null);let qe=null;const te=async()=>{await p.nextTick(),IZ.init({selector:"#"+He.field_name,width:"100%",height:300,plugins:"advlist wordcount autolink autosave charmap codesample emoticons fullscreen insertdatetime link media searchreplace template visualblocks anchor autoresize code directionality help image importcss lists nonbreaking pagebreak preview save table visualchars",setup(dt){qe=dt,dt.on("Change",()=>{Re("update:modelValue",dt.getContent())}),dt.on("init",()=>{dt.setContent(He.modelValue)})}})};p.onMounted(te),p.watch(()=>He.modelValue,dt=>{qe&&qe.getContent()!==dt&&qe.setContent(dt)});const Ye=p.computed({get(){return He.modelValue},set(dt){Re("update:modelValue",dt)}});return _e({focus:()=>oe.value.focus()}),(dt,Jt)=>(p.openBlock(),p.createElementBlock(p.Fragment,null,[I.show?(p.openBlock(),p.createElementBlock("div",{key:0,class:p.normalizeClass(I.field_name)},[p.createElementVNode("h3",LZ,p.toDisplayString(I.label_name),1),p.createElementVNode("p",{id:I.field_name,class:"mb-4 text-base text-gray-900 input_tr_show dark:text-white"},p.toDisplayString(I.model_value),9,VZ),zZ],2)):p.createCommentVNode("",!0),I.show?p.createCommentVNode("",!0):(p.openBlock(),p.createElementBlock("div",{key:1,class:p.normalizeClass(["mb-4",I.field_name])},[p.createElementVNode("label",{class:p.normalizeClass({"gl-label-form":I.error_message=="","gl-label-form-invalid":I.error_message!=="",required:I.is_required}),for:I.field_name},p.toDisplayString(I.label_name),11,HZ),p.withDirectives(p.createElementVNode("textarea",{name:I.field_name,id:I.field_name,class:p.normalizeClass(["tiny",{"gl-textarea-form mt-4":I.error_message=="","gl-textarea-form-invalid mt-4":I.error_message!==""}]),type:I.type,"onUpdate:modelValue":Jt[0]||(Jt[0]=wn=>Ye.value=wn),onKeydown:Jt[1]||(Jt[1]=wn=>dt.$emit("keydown",wn)),ref_key:"input",ref:oe,rows:"4"},null,42,UZ),[[p.vModelText,Ye.value]]),p.createElementVNode("span",WZ,p.toDisplayString(I.error_message),1),p.createElementVNode("small",jZ,p.toDisplayString(I.description),1)],2))],64))}},qZ={compatConfig:{MODE:3},inheritAttrs:!1,emits:["pagination-change-page"],components:{RenderlessPagination:{emits:["pagination-change-page"],props:{data:{type:Object,default:()=>{}},limit:{type:Number,default:0}},computed:{isApiResource(){return!!this.data.meta},currentPage(){return this.isApiResource?this.data.meta.current_page:this.data.current_page},firstPageUrl(){return this.isApiResource?this.data.links.first:null},from(){return this.isApiResource?this.data.meta.from:this.data.from},lastPage(){return this.isApiResource?this.data.meta.last_page:this.data.last_page},lastPageUrl(){return this.isApiResource?this.data.links.last:null},nextPageUrl(){return this.isApiResource?this.data.links.next:this.data.next_page_url},perPage(){return this.isApiResource?this.data.meta.per_page:this.data.per_page},prevPageUrl(){return this.isApiResource?this.data.links.prev:this.data.prev_page_url},to(){return this.isApiResource?this.data.meta.to:this.data.to},total(){return this.isApiResource?this.data.meta.total:this.data.total},pageRange(){if(this.limit===-1)return 0;if(this.limit===0)return this.lastPage;for(var I=this.currentPage,_e=this.lastPage,ie=this.limit,He=I-ie,Re=I+ie+1,oe=[],qe=[],te,Ye=1;Ye<=_e;Ye++)(Ye===1||Ye===_e||Ye>=He&&Ye<Re)&&oe.push(Ye);return oe.forEach(function(dt){te&&(dt-te===2?qe.push(te+1):dt-te!==1&&qe.push("...")),qe.push(dt),te=dt}),qe}},methods:{previousPage(){this.selectPage(this.currentPage-1)},nextPage(){this.selectPage(this.currentPage+1)},selectPage(I){I!=="..."&&this.$emit("pagination-change-page",I)}},render(){return this.$slots.default({data:this.data,limit:this.limit,computed:{isApiResource:this.isApiResource,currentPage:this.currentPage,firstPageUrl:this.firstPageUrl,from:this.from,lastPage:this.lastPage,lastPageUrl:this.lastPageUrl,nextPageUrl:this.nextPageUrl,perPage:this.perPage,prevPageUrl:this.prevPageUrl,to:this.to,total:this.total,pageRange:this.pageRange},prevButtonEvents:{click:I=>{I.preventDefault(),this.previousPage()}},nextButtonEvents:{click:I=>{I.preventDefault(),this.nextPage()}},pageButtonEvents:I=>({click:_e=>{_e.preventDefault(),this.selectPage(I)}})})}}},props:{data:{type:Object,default:()=>{}},limit:{type:Number,default:0},showDisabled:{type:Boolean,default:!1},size:{type:String,default:"default",validator:I=>["small","default","large"].indexOf(I)!==-1},align:{type:String,default:"left",validator:I=>["left","center","right"].indexOf(I)!==-1}},methods:{onPaginationChangePage(I){this.$emit("pagination-change-page",I)}},mounted(){}},KZ={class:"flex flex-col items-center"},YZ={key:0,class:"text-sm text-gray-700 dark:text-gray-400"},XZ={class:"font-semibold text-gray-900 dark:text-white"},ZZ={class:"font-semibold text-gray-900 dark:text-white"},JZ={class:"font-semibold text-gray-900 dark:text-white"},QZ=["tabindex"],eJ=p.createElementVNode("span",{class:"sr-only"},"Previous",-1),tJ=p.createElementVNode("svg",{class:"w-2.5 h-2.5 rtl:rotate-180","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 6 10"},[p.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 1 1 5l4 4"})],-1),nJ=["aria-current"],oJ=["tabindex"],sJ=p.createElementVNode("span",{class:"sr-only"},"Next",-1),rJ=p.createElementVNode("svg",{class:"w-2.5 h-2.5 rtl:rotate-180","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 6 10"},[p.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m1 9 4-4-4-4"})],-1);function aJ(I,_e,ie,He,Re,oe){const qe=p.resolveComponent("RenderlessPagination");return p.openBlock(),p.createBlock(qe,{data:ie.data,limit:ie.limit,onPaginationChangePage:oe.onPaginationChangePage},{default:p.withCtx(te=>[p.createElementVNode("div",KZ,[te.computed.total>te.computed.perPage?(p.openBlock(),p.createElementBlock("span",YZ,[p.createTextVNode(" Showing "),p.createElementVNode("span",XZ,p.toDisplayString(te.computed.from),1),p.createTextVNode(" to "),p.createElementVNode("span",ZZ,p.toDisplayString(te.computed.to),1),p.createTextVNode(" of "),p.createElementVNode("span",JZ,p.toDisplayString(te.computed.total),1),p.createTextVNode(" Entries ")])):p.createCommentVNode("",!0),te.computed.total>te.computed.perPage?(p.openBlock(),p.createElementBlock("ul",p.mergeProps({key:1},I.$attrs,{class:["flex items-center h-8 -space-x-px text-sm",{"pagination-sm":ie.size=="small","pagination-lg":ie.size=="large","justify-content-center":ie.align=="center","justify-content-end":ie.align=="right"}]}),[te.computed.prevPageUrl||ie.showDisabled?(p.openBlock(),p.createElementBlock("li",{key:0,class:p.normalizeClass(["flex items-center justify-center h-8 px-3 leading-tight text-gray-500 bg-white border border-gray-300 ms-0 border-e-0 rounded-s-lg hover:bg-gray-100 hover:text-gray-700 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white",{disabled:!te.computed.prevPageUrl}])},[p.createElementVNode("a",p.mergeProps({class:"page-link",href:"#","aria-label":"Previous",tabindex:!te.computed.prevPageUrl&&-1},p.toHandlers(te.prevButtonEvents,!0)),[p.renderSlot(I.$slots,"prev-nav",{},()=>[eJ,tJ])],16,QZ)],2)):p.createCommentVNode("",!0),(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(te.computed.pageRange,(Ye,dt)=>(p.openBlock(),p.createElementBlock("li",{class:p.normalizeClass(["",{active:Ye==te.computed.currentPage}]),key:dt},[p.createElementVNode("a",p.mergeProps({class:"",href:"#"},p.toHandlers(te.pageButtonEvents(Ye),!0),{"aria-current":Ye==te.computed.currentPage?"page":null,class:Ye==te.computed.currentPage?"z-10 flex items-center justify-center px-3 h-8 leading-tight text-blue-600 border border-blue-300 bg-blue-50 hover:bg-blue-100 hover:text-blue-700 dark:border-gray-700 dark:bg-gray-700 dark:text-white":"flex items-center justify-center px-3 h-8 leading-tight text-gray-500 bg-white border border-gray-300 hover:bg-gray-100 hover:text-gray-700 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white"}),p.toDisplayString(Ye),17,nJ)],2))),128)),te.computed.nextPageUrl||ie.showDisabled?(p.openBlock(),p.createElementBlock("li",{key:1,class:p.normalizeClass(["flex items-center justify-center h-8 px-3 leading-tight text-gray-500 bg-white border border-gray-300 rounded-e-lg hover:bg-gray-100 hover:text-gray-700 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white",{disabled:!te.computed.nextPageUrl}])},[p.createElementVNode("a",p.mergeProps({class:"",href:"#","aria-label":"Next",tabindex:!te.computed.nextPageUrl&&-1},p.toHandlers(te.nextButtonEvents,!0)),[p.renderSlot(I.$slots,"next-nav",{},()=>[sJ,rJ])],16,oJ)],2)):p.createCommentVNode("",!0)],16)):p.createCommentVNode("",!0)])]),_:3},8,["data","limit","onPaginationChangePage"])}const S3=fc(qZ,[["render",aJ]]),cJ={components:{TailwindPagination:S3},props:{data:Array,columns:Array,get_item_url:String,xprops:Object,refreshData:Boolean},data(){return{isLoading:!1,isMounted:!1,limit:5,showDisabled:!1,size:"default",align:"left",search:"",isDropdownOpen:!1,itemLists:[],tableData:[],sortField:this.columns[0].field_name,sortOrder:"desc",pageOptions:[5,10,20,50],perPage:5,page:1}},emits:["editAction","generalAction"],computed:{filteredData(){const I=this.search.toLowerCase();return this.sortData(this.data).filter(ie=>Object.values(ie).some(He=>He.toString().toLowerCase().includes(I)))}},methods:{editAction(I){this.$emit("editAction",I)},generalAction(I){this.$emit("generalAction",I)},forDynCompIs(I){return typeof I=="object"?I:null},GetItemLists(I=1){this.isLoading=!0,this.page=I;const _e={sort:this.sortField,order:this.sortOrder,s:this.search,limit:this.perPage,page:this.page};axios.get(this.xprops.route_get_data,{params:_e}).then(ie=>{this.itemLists=ie.data,this.isLoading=!1}).catch(ie=>{console.error(ie),this.isLoading=!1})},updateSortColumn(I,_e){_e&&(I===this.sortField?this.sortOrder=this.sortOrder==="asc"?"desc":"asc":(this.sortField=I,this.sortOrder="asc"),this.GetItemLists(this.page))},handleSearch(){this.sortField=this.columns[0].field_name,this.sortOrder="asc",this.page=1,this.GetItemLists(this.page)}},mounted(){this.GetItemLists(),this.isMounted=!0},watch:{searchFilter(){this.filteredOptions.length===0?this.selected={}:this.selected=this.filteredOptions[0]},perPage(I){this.page=1,this.perPage=I,this.GetItemLists(this.page)},refreshData(I,_e){this.isMounted&&I!==_e&&this.GetItemLists()}}},lJ={class:"p-2"},iJ={class:"flex flex-col flex-wrap pb-4 space-y-4 xl:flex-row xl:items-center xl:justify-between flex-column sm:space-y-0"},uJ={class:"flex items-center gap-2"},dJ=p.createElementVNode("span",{class:"font-medium"}," Show ",-1),mJ={style:{"margin-top":"9px"}},fJ=p.createElementVNode("span",{class:"font-medium"}," Entries ",-1),gJ=p.createElementVNode("label",{for:"table-search",class:"sr-only"},"Search",-1),pJ={class:"relative"},hJ=p.createElementVNode("div",{class:"absolute inset-y-0 left-0 flex items-center pointer-events-none rtl:inset-r-0 rtl:right-0 ps-3"},[p.createElementVNode("svg",{class:"w-5 h-5 text-gray-500 dark:text-gray-400","aria-hidden":"true",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("path",{"fill-rule":"evenodd",d:"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z","clip-rule":"evenodd"})])],-1),bJ={class:"overflow-auto rounded-lg dark:text-gray-400 dark:bg-gray-800"},yJ={class:"w-full h-full max-w-full overflow-hidden bg-white border-separate xl:overflow-auto lg:border-collapse border-spacing-y-3 lg:border-spacing-y-0 dark:border-strokedark dark:bg-boxdark"},vJ={class:"hidden text-sm font-normal text-center text-gray-500 lg:table-header-group dark:border-strokedark bg-gray-50 dark:bg-gray-700 dark:text-gray-400"},wJ=["onClick"],xJ={key:0,class:"ml-2"},CJ={key:0,class:"fa fa-arrow-up"},SJ={key:1,class:"fa fa-arrow-down"},kJ={key:0},_J=["colspan"],EJ=[p.createElementVNode("div",{role:"status",class:"p-4 space-y-4 border border-gray-200 divide-y divide-gray-200 rounded shadow animate-pulse dark:divide-gray-700 md:p-6 dark:border-gray-700"},[p.createElementVNode("div",{class:"flex items-center justify-between"},[p.createElementVNode("div",null,[p.createElementVNode("div",{class:"h-3 bg-gray-300 rounded-full dark:bg-gray-600 w-24 mb-3"}),p.createElementVNode("div",{class:"w-32 h-2 bg-gray-200 rounded-full dark:bg-gray-700"})]),p.createElementVNode("div",{class:"h-3 bg-gray-300 rounded-full dark:bg-gray-700 w-12"})]),p.createElementVNode("div",{class:"flex items-center justify-between pt-4"},[p.createElementVNode("div",null,[p.createElementVNode("div",{class:"h-3 bg-gray-300 rounded-full dark:bg-gray-600 w-24 mb-3"}),p.createElementVNode("div",{class:"w-32 h-2 bg-gray-200 rounded-full dark:bg-gray-700"})]),p.createElementVNode("div",{class:"h-3 bg-gray-300 rounded-full dark:bg-gray-700 w-12"})]),p.createElementVNode("div",{class:"flex items-center justify-between pt-4"},[p.createElementVNode("div",null,[p.createElementVNode("div",{class:"h-3 bg-gray-300 rounded-full dark:bg-gray-600 w-24 mb-3"}),p.createElementVNode("div",{class:"w-32 h-2 bg-gray-200 rounded-full dark:bg-gray-700"})]),p.createElementVNode("div",{class:"h-3 bg-gray-300 rounded-full dark:bg-gray-700 w-12"})]),p.createElementVNode("div",{class:"flex items-center justify-between pt-4"},[p.createElementVNode("div",null,[p.createElementVNode("div",{class:"h-3 bg-gray-300 rounded-full dark:bg-gray-600 w-24 mb-3"}),p.createElementVNode("div",{class:"w-32 h-2 bg-gray-200 rounded-full dark:bg-gray-700"})]),p.createElementVNode("div",{class:"h-3 bg-gray-300 rounded-full dark:bg-gray-700 w-12"})]),p.createElementVNode("div",{class:"flex items-center justify-between pt-4"},[p.createElementVNode("div",null,[p.createElementVNode("div",{class:"h-3 bg-gray-300 rounded-full dark:bg-gray-600 w-24 mb-3"}),p.createElementVNode("div",{class:"w-32 h-2 bg-gray-200 rounded-full dark:bg-gray-700"})]),p.createElementVNode("div",{class:"h-3 bg-gray-300 rounded-full dark:bg-gray-700 w-12"})]),p.createElementVNode("span",{class:"sr-only"},"Loading...")],-1)],TJ=["data-label"],AJ={class:"overflow-auto max-h-40"},DJ={class:"flex items-center justify-between px-4 py-3 bg-white border-gray-200 sm:px-6 dark:text-gray-400 dark:bg-gray-800"};function NJ(I,_e,ie,He,Re,oe){const qe=p.resolveComponent("dropdown"),te=p.resolveComponent("TailwindPagination");return p.openBlock(),p.createElementBlock("div",lJ,[p.createElementVNode("div",iJ,[p.createElementVNode("div",uJ,[dJ,p.createElementVNode("div",mJ,[p.createVNode(qe,{has_cancel:!1,options:Re.pageOptions,modelValue:Re.perPage,"onUpdate:modelValue":_e[0]||(_e[0]=Ye=>Re.perPage=Ye),is_required:!1,field_name:"perPage",label_name:"",default_value:5,show:!1,placeholder:"Please select an option"},null,8,["options","modelValue"])]),fJ]),gJ,p.createElementVNode("div",pJ,[hJ,p.withDirectives(p.createElementVNode("input",{type:"text","onUpdate:modelValue":_e[1]||(_e[1]=Ye=>Re.search=Ye),onInput:_e[2]||(_e[2]=Ye=>oe.handleSearch()),class:"block w-full p-2 text-sm text-gray-900 border border-gray-300 rounded-lg ps-10 bg-gray-50 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder:"Search ..."},null,544),[[p.vModelText,Re.search]])])]),p.createElementVNode("div",bJ,[p.createElementVNode("table",yJ,[p.createElementVNode("thead",vJ,[p.createElementVNode("tr",null,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(ie.columns,(Ye,dt)=>(p.openBlock(),p.createElementBlock("th",{key:dt,onClick:Jt=>oe.updateSortColumn(Ye.field_name,Ye.sortable),class:"w-full px-4 py-2 lg:w-2/12"},[p.createTextVNode(p.toDisplayString(Ye.field_label)+" ",1),Re.sortField===Ye.field_name?(p.openBlock(),p.createElementBlock("span",xJ,[Re.sortOrder==="asc"?(p.openBlock(),p.createElementBlock("i",CJ)):(p.openBlock(),p.createElementBlock("i",SJ))])):p.createCommentVNode("",!0)],8,wJ))),128))])]),p.createElementVNode("tbody",null,[Re.isLoading?(p.openBlock(),p.createElementBlock("tr",kJ,[p.createElementVNode("td",{colspan:ie.columns.length},EJ,8,_J)])):p.createCommentVNode("",!0),Re.isLoading?p.createCommentVNode("",!0):(p.openBlock(!0),p.createElementBlock(p.Fragment,{key:1},p.renderList(Re.itemLists.data,(Ye,dt)=>(p.openBlock(),p.createElementBlock("tr",{key:dt,class:"bg-white dark:bg-gray-800 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-600 hover:dark:text-gray-200 text-gray-500"},[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(ie.columns,(Jt,wn)=>(p.openBlock(),p.createElementBlock("td",{key:wn,"data-label":Jt.field_label,class:"text-pretty before:content-[attr(data-label)] before:font-bold lg:before:content-none flex md:flex-row flex-col justify-between gap-2 lg:table-cell py-4 px-5 lg:py-2.5 lg:px-4 border dark:border-gray-700"},[p.createElementVNode("div",AJ,[Jt.tdComp?(p.openBlock(),p.createBlock(p.resolveDynamicComponent(oe.forDynCompIs(Jt.tdComp)),{key:0,row:Ye,field:Jt.field_name,xprops:ie.xprops,tdProps:Jt.tdProps,onDeleteAction:_e[3]||(_e[3]=Yt=>oe.GetItemLists()),onEditAction:Yt=>oe.editAction(Ye),onGeneralAction:Yt=>oe.generalAction(Ye)},null,40,["row","field","xprops","tdProps","onEditAction","onGeneralAction"])):(p.openBlock(),p.createElementBlock(p.Fragment,{key:1},[p.createTextVNode(p.toDisplayString(Ye[Jt.field_name]),1)],64))])],8,TJ))),128))]))),128))])])]),p.createElementVNode("div",DJ,[p.createVNode(te,{class:"mt-3 mb-0",data:Re.itemLists,limit:Re.limit,size:Re.size,align:Re.align,onPaginationChangePage:oe.GetItemLists},null,8,["data","limit","size","align","onPaginationChangePage"])])])}const OJ=fc(cJ,[["render",NJ]]),BJ={components:{TailwindPagination:S3},props:{data:Array,columns:Array,get_item_url:String,xprops:Object,refreshData:Boolean,groupField:String},data(){return{isLoading:!1,isMounted:!1,limit:5,showDisabled:!1,size:"default",align:"left",search:"",isDropdownOpen:!1,itemLists:[],tableData:[],sortField:this.columns[0].field_name,sortOrder:"desc",pageOptions:[5,10,20,50],perPage:5,page:1}},emits:["editAction"],computed:{filteredData(){const I=this.search.toLowerCase();return this.sortData(this.data).filter(ie=>Object.values(ie).some(He=>He.toString().toLowerCase().includes(I)))},groupedItems(){return this.groupBy(this.groupField)}},methods:{groupBy(I){return this.itemLists.data?this.itemLists.data.reduce((_e,ie)=>{const He=ie[I];_e[He]||(_e[He]=[]);const Re={...ie};return delete Re[I],_e[He].push(Re),_e},{}):[]},editAction(I){this.$emit("editAction",I)},forDynCompIs(I){return typeof I=="object"?I:null},GetItemLists(I=1){this.isLoading=!0,this.page=I;const _e={sort:this.sortField,order:this.sortOrder,s:this.search,limit:this.perPage,page:this.page};axios.get(this.xprops.route_get_data,{params:_e}).then(ie=>{this.itemLists=ie.data,this.isLoading=!1}).catch(ie=>{console.error(ie),this.isLoading=!1})},updateSortColumn(I,_e){_e&&(I===this.sortField?this.sortOrder=this.sortOrder==="asc"?"desc":"asc":(this.sortField=I,this.sortOrder="asc"),this.GetItemLists(this.page))},handleSearch(){this.sortField=this.columns[0].field_name,this.sortOrder="asc",this.page=1,this.GetItemLists(this.page)}},mounted(){this.GetItemLists(),this.isMounted=!0},watch:{searchFilter(){this.filteredOptions.length===0?this.selected={}:this.selected=this.filteredOptions[0]},perPage(I){this.page=1,this.perPage=I,this.GetItemLists(this.page)},refreshData(I,_e){this.isMounted&&I!==_e&&this.GetItemLists()}}},$J={class:"p-2"},RJ={class:"flex flex-col flex-wrap pb-4 space-y-4 xl:flex-row xl:items-center xl:justify-between flex-column sm:space-y-0"},PJ={class:"flex items-center gap-2"},FJ=p.createElementVNode("span",{class:"font-medium"}," Show ",-1),MJ={style:{"margin-top":"9px"}},IJ=p.createElementVNode("span",{class:"font-medium"}," Entries ",-1),LJ=p.createElementVNode("label",{for:"table-search",class:"sr-only"},"Search",-1),VJ={class:"relative"},zJ=p.createElementVNode("div",{class:"absolute inset-y-0 left-0 flex items-center pointer-events-none rtl:inset-r-0 rtl:right-0 ps-3"},[p.createElementVNode("svg",{class:"w-5 h-5 text-gray-500 dark:text-gray-400","aria-hidden":"true",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("path",{"fill-rule":"evenodd",d:"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z","clip-rule":"evenodd"})])],-1),HJ={class:"overflow-auto rounded-lg dark:text-gray-400 dark:bg-gray-800"},UJ={class:"w-full h-full max-w-full overflow-hidden bg-white border-separate xl:overflow-auto lg:border-collapse border-spacing-y-3 lg:border-spacing-y-0 dark:border-strokedark dark:bg-boxdark"},WJ={class:"hidden text-sm font-normal text-center text-gray-500 lg:table-header-group dark:border-strokedark bg-gray-50 dark:bg-gray-700 dark:text-gray-400"},jJ=["onClick"],GJ={key:0,class:"ml-2"},qJ={key:0,class:"fa fa-arrow-up"},KJ={key:1,class:"fa fa-arrow-down"},YJ={key:0},XJ=["colspan"],ZJ=[p.createElementVNode("div",{role:"status",class:"p-4 space-y-4 border border-gray-200 divide-y divide-gray-200 rounded shadow animate-pulse dark:divide-gray-700 md:p-6 dark:border-gray-700"},[p.createElementVNode("div",{class:"flex items-center justify-between"},[p.createElementVNode("div",null,[p.createElementVNode("div",{class:"h-3 bg-gray-300 rounded-full dark:bg-gray-600 w-24 mb-3"}),p.createElementVNode("div",{class:"w-32 h-2 bg-gray-200 rounded-full dark:bg-gray-700"})]),p.createElementVNode("div",{class:"h-3 bg-gray-300 rounded-full dark:bg-gray-700 w-12"})]),p.createElementVNode("div",{class:"flex items-center justify-between pt-4"},[p.createElementVNode("div",null,[p.createElementVNode("div",{class:"h-3 bg-gray-300 rounded-full dark:bg-gray-600 w-24 mb-3"}),p.createElementVNode("div",{class:"w-32 h-2 bg-gray-200 rounded-full dark:bg-gray-700"})]),p.createElementVNode("div",{class:"h-3 bg-gray-300 rounded-full dark:bg-gray-700 w-12"})]),p.createElementVNode("div",{class:"flex items-center justify-between pt-4"},[p.createElementVNode("div",null,[p.createElementVNode("div",{class:"h-3 bg-gray-300 rounded-full dark:bg-gray-600 w-24 mb-3"}),p.createElementVNode("div",{class:"w-32 h-2 bg-gray-200 rounded-full dark:bg-gray-700"})]),p.createElementVNode("div",{class:"h-3 bg-gray-300 rounded-full dark:bg-gray-700 w-12"})]),p.createElementVNode("div",{class:"flex items-center justify-between pt-4"},[p.createElementVNode("div",null,[p.createElementVNode("div",{class:"h-3 bg-gray-300 rounded-full dark:bg-gray-600 w-24 mb-3"}),p.createElementVNode("div",{class:"w-32 h-2 bg-gray-200 rounded-full dark:bg-gray-700"})]),p.createElementVNode("div",{class:"h-3 bg-gray-300 rounded-full dark:bg-gray-700 w-12"})]),p.createElementVNode("div",{class:"flex items-center justify-between pt-4"},[p.createElementVNode("div",null,[p.createElementVNode("div",{class:"h-3 bg-gray-300 rounded-full dark:bg-gray-600 w-24 mb-3"}),p.createElementVNode("div",{class:"w-32 h-2 bg-gray-200 rounded-full dark:bg-gray-700"})]),p.createElementVNode("div",{class:"h-3 bg-gray-300 rounded-full dark:bg-gray-700 w-12"})]),p.createElementVNode("span",{class:"sr-only"},"Loading...")],-1)],JJ={class:"bg-white dark:bg-gray-800 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-600 hover:dark:text-gray-200 text-gray-500"},QJ=["colspan"],eQ=["data-label"],tQ={class:"overflow-auto max-h-40"},nQ={class:"flex items-center justify-between px-4 py-3 bg-white border-gray-200 sm:px-6 dark:text-gray-400 dark:bg-gray-800"};function oQ(I,_e,ie,He,Re,oe){const qe=p.resolveComponent("dropdown"),te=p.resolveComponent("TailwindPagination");return p.openBlock(),p.createElementBlock("div",$J,[p.createElementVNode("div",RJ,[p.createElementVNode("div",PJ,[FJ,p.createElementVNode("div",MJ,[p.createVNode(qe,{has_cancel:!1,options:Re.pageOptions,modelValue:Re.perPage,"onUpdate:modelValue":_e[0]||(_e[0]=Ye=>Re.perPage=Ye),is_required:!1,field_name:"perPage",label_name:"",default_value:5,show:!1,placeholder:"Please select an option"},null,8,["options","modelValue"])]),IJ]),LJ,p.createElementVNode("div",VJ,[zJ,p.withDirectives(p.createElementVNode("input",{type:"text","onUpdate:modelValue":_e[1]||(_e[1]=Ye=>Re.search=Ye),onInput:_e[2]||(_e[2]=Ye=>oe.handleSearch()),class:"block w-full p-2 text-sm text-gray-900 border border-gray-300 rounded-lg ps-10 bg-gray-50 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder:"Search ..."},null,544),[[p.vModelText,Re.search]])])]),p.createElementVNode("div",HJ,[p.createElementVNode("table",UJ,[p.createElementVNode("thead",WJ,[p.createElementVNode("tr",null,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(ie.columns,(Ye,dt)=>(p.openBlock(),p.createElementBlock("th",{key:dt,onClick:Jt=>oe.updateSortColumn(Ye.field_name,Ye.sortable),class:"w-full px-4 py-2 lg:w-2/12"},[p.createTextVNode(p.toDisplayString(Ye.field_label)+" ",1),Re.sortField===Ye.field_name?(p.openBlock(),p.createElementBlock("span",GJ,[Re.sortOrder==="asc"?(p.openBlock(),p.createElementBlock("i",qJ)):(p.openBlock(),p.createElementBlock("i",KJ))])):p.createCommentVNode("",!0)],8,jJ))),128))])]),p.createElementVNode("tbody",null,[Re.isLoading?(p.openBlock(),p.createElementBlock("tr",YJ,[p.createElementVNode("td",{colspan:ie.columns.length},ZJ,8,XJ)])):p.createCommentVNode("",!0),Re.isLoading?p.createCommentVNode("",!0):(p.openBlock(!0),p.createElementBlock(p.Fragment,{key:1},p.renderList(oe.groupedItems,(Ye,dt)=>(p.openBlock(),p.createElementBlock(p.Fragment,null,[p.createElementVNode("tr",JJ,[p.createElementVNode("td",{colspan:ie.columns.length,class:"text-pretty before:content-[attr(data-label)] before:font-bold lg:before:content-none flex md:flex-row flex-col justify-between gap-2 lg:table-cell py-4 px-5 lg:py-3 lg:px-4 border dark:border-gray-700"},p.toDisplayString(dt),9,QJ)]),(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(Ye,(Jt,wn)=>(p.openBlock(),p.createElementBlock("tr",{key:wn,class:"bg-white dark:bg-gray-800 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-600 hover:dark:text-gray-200 text-gray-500"},[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(ie.columns,(Yt,Qt)=>(p.openBlock(),p.createElementBlock("td",{key:Qt,"data-label":Yt.field_label,class:"text-pretty before:content-[attr(data-label)] before:font-bold lg:before:content-none flex md:flex-row flex-col justify-between gap-2 lg:table-cell py-4 px-5 lg:py-3 lg:px-4 border dark:border-gray-700"},[p.createElementVNode("div",tQ,[Yt.tdComp?(p.openBlock(),p.createBlock(p.resolveDynamicComponent(oe.forDynCompIs(Yt.tdComp)),{key:0,row:Jt,field:Yt.field_name,xprops:ie.xprops,tdProps:Yt.tdProps,onDeleteAction:_e[3]||(_e[3]=Wt=>oe.GetItemLists()),onEditAction:Wt=>oe.editAction(Jt)},null,40,["row","field","xprops","tdProps","onEditAction"])):(p.openBlock(),p.createElementBlock(p.Fragment,{key:1},[p.createTextVNode(p.toDisplayString(Jt[Yt.field_name]),1)],64))])],8,eQ))),128))]))),128))],64))),256))])])]),p.createElementVNode("div",nQ,[p.createVNode(te,{class:"mt-3 mb-0",data:Re.itemLists,limit:Re.limit,size:Re.size,align:Re.align,onPaginationChangePage:oe.GetItemLists},null,8,["data","limit","size","align","onPaginationChangePage"])])])}const sQ=fc(BJ,[["render",oQ]]),rQ={components:{},props:{data:Array,columns:Array},data(){return{showNoOfEntries:[1,2,3,10,20,30,40],search:"",sortKey:"",sortOrder:1,currentPage:1,itemsPerPage:10,jumpToPage:"",maxDisplayedPages:10}},computed:{filteredData(){const I=this.search.toLowerCase();return this.sortData(this.data).filter(ie=>Object.values(ie).some(He=>He!=null&&He.toString().toLowerCase().includes(I)))},totalPages(){return Math.ceil(this.filteredData.length/this.itemsPerPage)},paginatedData(){const I=(this.currentPage-1)*this.itemsPerPage,_e=I+this.itemsPerPage;return this.filteredData.slice(I,_e)},displayedPageNumbers(){let I=Math.max(this.currentPage-Math.floor(this.maxDisplayedPages/2),1),_e=I+this.maxDisplayedPages-1;return _e>this.totalPages&&(_e=this.totalPages,I=Math.max(_e-this.maxDisplayedPages+1,1)),Array.from({length:_e-I+1},(ie,He)=>I+He)},firstItemIndex(){return this.itemsPerPage*(this.currentPage-1)+1},lastItemIndex(){const I=this.itemsPerPage*this.currentPage;return I>this.filteredData.length?this.filteredData.length:I}},methods:{handleItemsPerPageChange(I){this.itemsPerPage=I},goToPage(I){I>=1&&I<=this.totalPages&&(this.currentPage=I)},sort(I){I===this.sortKey?this.sortOrder*=-1:(this.sortKey=I,this.sortOrder=1)},sortData(I){return this.sortKey?I.slice().sort((_e,ie)=>(_e[this.sortKey]<ie[this.sortKey]?-1:1)*this.sortOrder):I},previousPage(){this.currentPage>1&&this.currentPage--},nextPage(){this.currentPage<this.totalPages&&this.currentPage++},firstPage(){this.currentPage=1},lastPage(){this.currentPage=this.totalPages},goToPage(I){I>=1&&I<=this.totalPages&&(this.currentPage=I)}}},aQ={class:"p-2"},cQ={class:"flex flex-wrap pb-4 space-y-4 md:items-center md:justify-between flex-column sm:flex-row sm:space-y-0"},lQ={class:"flex items-center gap-2"},iQ=p.createElementVNode("span",{class:"font-medium"}," Show ",-1),uQ={style:{"margin-top":"9px"}},dQ=p.createElementVNode("span",{class:"font-medium"}," Entries ",-1),mQ=p.createElementVNode("label",{for:"table-search",class:"sr-only"},"Search",-1),fQ={class:"relative"},gQ=p.createElementVNode("div",{class:"absolute inset-y-0 left-0 flex items-center pointer-events-none rtl:inset-r-0 rtl:right-0 ps-3"},[p.createElementVNode("svg",{class:"w-5 h-5 text-gray-500 dark:text-gray-400","aria-hidden":"true",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("path",{"fill-rule":"evenodd",d:"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z","clip-rule":"evenodd"})])],-1),pQ={class:"overflow-auto rounded-lg dark:text-gray-400 dark:bg-gray-800"},hQ={class:"w-full h-full max-w-full overflow-hidden bg-white border-separate xl:overflow-auto lg:border-collapse border-spacing-y-3 lg:border-spacing-y-0 dark:border-strokedark dark:bg-boxdark"},bQ={class:"hidden text-sm font-normal text-center text-gray-700 lg:table-header-group dark:border-strokedark bg-gray-50 dark:bg-gray-700 dark:text-gray-400"},yQ=["onClick"],vQ={key:0,class:"ml-2"},wQ={key:0,class:"fa fa-arrow-up"},xQ={key:1,class:"fa fa-arrow-down"},CQ=["data-label"],SQ=["innerHTML"],kQ={key:0,class:"flex items-center justify-between px-4 py-3 bg-white border-gray-200 sm:px-6 dark:text-gray-400 dark:bg-gray-800"},_Q={class:"flex justify-between flex-1 sm:hidden"},EQ=["disabled"],TQ=["disabled"],AQ={class:"hidden sm:flex sm:flex-1 sm:items-center sm:justify-between"},DQ={class:"text-sm text-gray-700 dark:text-gray-400"},NQ={class:"font-medium"},OQ={class:"font-medium"},BQ={class:"font-medium"},$Q={"aria-label":"Page navigation"},RQ={class:"flex items-center h-8 -space-x-px text-sm"},PQ=["disabled"],FQ=[p.createElementVNode("span",{class:"sr-only"},"Previous",-1),p.createElementVNode("svg",{class:"w-2.5 h-2.5 rtl:rotate-180","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 6 10"},[p.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 1 1 5l4 4"})],-1)],MQ=["onClick"],IQ=["onClick"],LQ=["disabled"],VQ=[p.createElementVNode("span",{class:"sr-only"},"Next",-1),p.createElementVNode("svg",{class:"w-2.5 h-2.5 rtl:rotate-180","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 6 10"},[p.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m1 9 4-4-4-4"})],-1)];function zQ(I,_e,ie,He,Re,oe){const qe=p.resolveComponent("dropdown");return p.openBlock(),p.createElementBlock("div",aQ,[p.createElementVNode("div",cQ,[p.createElementVNode("div",lQ,[iQ,p.createElementVNode("div",uQ,[p.createVNode(qe,{has_cancel:!1,options:Re.showNoOfEntries,modelValue:Re.itemsPerPage,"onUpdate:modelValue":_e[0]||(_e[0]=te=>Re.itemsPerPage=te),is_required:!1,field_name:"NoOfEntries",label_name:"",default_value:10,show:!1,placeholder:"Please select an option"},null,8,["options","modelValue"])]),dQ]),mQ,p.createElementVNode("div",fQ,[gQ,p.withDirectives(p.createElementVNode("input",{type:"text","onUpdate:modelValue":_e[1]||(_e[1]=te=>Re.search=te),class:"block p-2 text-sm text-gray-900 border border-gray-300 rounded-lg ps-10 w-80 bg-gray-50 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder:"Search ..."},null,512),[[p.vModelText,Re.search]])])]),p.createElementVNode("div",pQ,[p.createElementVNode("table",hQ,[p.createElementVNode("thead",bQ,[p.createElementVNode("tr",null,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(ie.columns,(te,Ye)=>(p.openBlock(),p.createElementBlock("th",{key:Ye,onClick:p.withModifiers(dt=>oe.sort(te),["prevent"]),class:"w-full px-4 py-2 lg:w-2/12 capitalize"},[p.createTextVNode(p.toDisplayString(te)+" ",1),Re.sortKey===te?(p.openBlock(),p.createElementBlock("span",vQ,[Re.sortOrder==="asc"?(p.openBlock(),p.createElementBlock("i",wQ)):(p.openBlock(),p.createElementBlock("i",xQ))])):p.createCommentVNode("",!0)],8,yQ))),128))])]),p.createElementVNode("tbody",null,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(oe.paginatedData,(te,Ye)=>(p.openBlock(),p.createElementBlock("tr",{key:Ye,class:"bg-white dark:bg-gray-800 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-600 hover:dark:text-gray-200 text-gray-500"},[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(ie.columns,(dt,Jt)=>(p.openBlock(),p.createElementBlock("td",{key:Jt,"data-label":dt,class:"text-pretty before:content-[attr(data-label)] before:font-bold lg:before:content-none flex md:flex-row flex-col justify-between gap-2 lg:table-cell py-4 px-5 lg:py-2.5 lg:px-4 border dark:border-gray-700"},[p.createElementVNode("p",{class:"text-pretty",innerHTML:te[Jt]},null,8,SQ)],8,CQ))),128))]))),128))])])]),oe.paginatedData.length>0?(p.openBlock(),p.createElementBlock("div",kQ,[p.createElementVNode("div",_Q,[p.createElementVNode("a",{href:"#",onClick:_e[2]||(_e[2]=p.withModifiers((...te)=>oe.previousPage&&oe.previousPage(...te),["prevent"])),disabled:Re.currentPage===1,class:"relative inline-flex items-center px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md hover:bg-gray-50"},"Previous",8,EQ),p.createElementVNode("a",{href:"#",onClick:_e[3]||(_e[3]=p.withModifiers((...te)=>oe.nextPage&&oe.nextPage(...te),["prevent"])),disabled:Re.currentPage===oe.totalPages,class:"relative inline-flex items-center px-4 py-2 ml-3 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md hover:bg-gray-50"},"Next",8,TQ)]),p.createElementVNode("div",AQ,[p.createElementVNode("div",null,[p.createElementVNode("p",DQ,[p.createTextVNode(" Showing "),p.createElementVNode("span",NQ,p.toDisplayString(oe.firstItemIndex),1),p.createTextVNode(" to "),p.createElementVNode("span",OQ,p.toDisplayString(oe.lastItemIndex),1),p.createTextVNode(" of "),p.createElementVNode("span",BQ,p.toDisplayString(oe.filteredData.length),1),p.createTextVNode(" entries ")])]),p.createElementVNode("div",null,[p.createElementVNode("nav",$Q,[p.createElementVNode("ul",RQ,[p.createElementVNode("li",null,[p.createElementVNode("a",{href:"#",onClick:_e[4]||(_e[4]=p.withModifiers((...te)=>oe.previousPage&&oe.previousPage(...te),["prevent"])),disabled:Re.currentPage===1,class:"flex items-center justify-center h-8 px-3 leading-tight text-gray-500 bg-white border border-gray-300 ms-0 border-e-0 rounded-s-lg hover:bg-gray-100 hover:text-gray-700 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white"},FQ,8,PQ)]),(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(oe.displayedPageNumbers,te=>(p.openBlock(),p.createElementBlock(p.Fragment,{key:te},[p.createElementVNode("li",null,[Re.currentPage!==te?(p.openBlock(),p.createElementBlock("a",{key:0,href:"#",onClick:p.withModifiers(Ye=>oe.goToPage(te),["prevent"]),class:"flex items-center justify-center h-8 px-3 leading-tight text-gray-500 bg-white border border-gray-300 hover:bg-gray-100 hover:text-gray-700 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white"},p.toDisplayString(te),9,MQ)):p.createCommentVNode("",!0)]),p.createElementVNode("li",null,[Re.currentPage===te?(p.openBlock(),p.createElementBlock("a",{key:0,href:"#",onClick:p.withModifiers(Ye=>oe.goToPage(te),["prevent"]),"aria-current":"page",class:"z-10 flex items-center justify-center h-8 px-3 leading-tight text-blue-600 border border-blue-300 bg-blue-50 hover:bg-blue-100 hover:text-blue-700 dark:border-gray-700 dark:bg-gray-700 dark:text-white"},p.toDisplayString(te),9,IQ)):p.createCommentVNode("",!0)])],64))),128)),p.createElementVNode("li",null,[p.createElementVNode("a",{href:"#",onClick:_e[5]||(_e[5]=p.withModifiers((...te)=>oe.nextPage&&oe.nextPage(...te),["prevent"])),disabled:Re.currentPage===oe.totalPages,class:"flex items-center justify-center h-8 px-3 leading-tight text-gray-500 bg-white border border-gray-300 rounded-e-lg hover:bg-gray-100 hover:text-gray-700 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white"},VQ,8,LQ)])])])])])])):p.createCommentVNode("",!0)])}const HQ=fc(rQ,[["render",zQ]]),UQ={setup(){const I=p.ref([]),_e=Re=>{I.value.push(Re)},ie=Re=>{const oe=I.value.indexOf(Re);oe>-1&&I.value.splice(oe,1)},He=Re=>{I.value.forEach(oe=>{oe!==Re&&oe.isOpen&&oe.isOpen.value!==void 0&&(oe.isOpen.value=!1)}),Re.isOpen&&Re.isOpen.value!==void 0&&(Re.isOpen.value=!Re.isOpen.value)};return p.provide("accordionsWrapper",{registerAccordion:_e,unregisterAccordion:ie,toggleAccordion:He,accordions:I}),{}}};function WQ(I,_e,ie,He,Re,oe){return p.openBlock(),p.createElementBlock("div",null,[p.renderSlot(I.$slots,"default")])}const jQ=fc(UQ,[["render",WQ]]),GQ={props:{title:{type:String,required:!0}},setup(){const I=p.ref(!1),_e=p.inject("accordionsWrapper"),He=(()=>{var dt=new Date().getTime();typeof performance<"u"&&typeof performance.now=="function"&&(dt+=performance.now());var Jt="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(wn){var Yt=(dt+Math.random()*16)%16|0;return dt=Math.floor(dt/16),(wn==="x"?Yt:Yt&3|8).toString(16)});return Jt})(),Re={isOpen:I,id:He},oe=p.computed(()=>_e.accordions.value),qe=p.computed(()=>oe.value.length>0&&oe.value[0].id===He),te=p.computed(()=>oe.value.length>0&&oe.value[oe.value.length-1].id===He);return p.onMounted(()=>{_e.registerAccordion(Re)}),p.onUnmounted(()=>{_e.unregisterAccordion(Re)}),{isOpen:I,isFirstAccordion:qe,isLastAccordion:te,toggle:()=>{_e.toggleAccordion(Re)}}}},qQ={class:"flex items-center"},KQ={key:0,class:"w-3 h-3 rotate-180 shrink-0","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 10 6"},YQ=[p.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5 5 1 1 5"},null,-1)],XQ={key:1,class:"w-3 h-3 shrink-0","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 10 6"},ZQ=[p.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5 5 1 1 5"},null,-1)];function JQ(I,_e,ie,He,Re,oe){return p.openBlock(),p.createElementBlock("div",null,[p.createElementVNode("h2",null,[p.createElementVNode("button",{onClick:_e[0]||(_e[0]=(...qe)=>He.toggle&&He.toggle(...qe)),type:"button",class:p.normalizeClass(["flex items-center justify-between w-full gap-3 p-5 font-medium text-gray-500 border border-gray-200 rtl:text-right dark:border-gray-700 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-800",{"rounded-t-xl":He.isFirstAccordion,"border-b-0":!He.isLastAccordion,"bg-gray-100 dark:bg-gray-800":He.isOpen}]),"aria-expanded":"true"},[p.createElementVNode("span",qQ,p.toDisplayString(ie.title),1),He.isOpen?p.createCommentVNode("",!0):(p.openBlock(),p.createElementBlock("svg",KQ,YQ)),He.isOpen?(p.openBlock(),p.createElementBlock("svg",XQ,ZQ)):p.createCommentVNode("",!0)],2)]),He.isOpen?(p.openBlock(),p.createElementBlock("div",{key:0,class:p.normalizeClass([{"border-b-0":!He.isLastAccordion,"border-t-0":He.isLastAccordion},"p-5 border border-gray-200 dark:border-gray-700 dark:bg-gray-900"])},[p.renderSlot(I.$slots,"default")],2)):p.createCommentVNode("",!0)])}const QQ=fc(GQ,[["render",JQ]]),eee={class:"flex items-center p-4 text-gray-500 bg-white rounded-lg shadow dark:bg-gray-800 dark:text-gray-400",role:"alert"},tee={key:0,class:"inline-flex items-center justify-center flex-shrink-0 w-8 h-8 text-green-500 bg-green-100 rounded-lg dark:bg-green-800 dark:text-green-200"},nee=[p.createElementVNode("svg",{class:"w-5 h-5","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 20 20"},[p.createElementVNode("path",{d:"M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5Zm3.707 8.207-4 4a1 1 0 0 1-1.414 0l-2-2a1 1 0 0 1 1.414-1.414L9 10.586l3.293-3.293a1 1 0 0 1 1.414 1.414Z"})],-1),p.createElementVNode("span",{class:"sr-only"},"Check icon",-1)],oee={key:1,class:"inline-flex items-center justify-center flex-shrink-0 w-8 h-8 text-red-500 bg-red-100 rounded-lg dark:bg-red-800 dark:text-red-200"},see=[p.createElementVNode("svg",{class:"w-5 h-5","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 20 20"},[p.createElementVNode("path",{d:"M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5Zm3.707 11.793a1 1 0 1 1-1.414 1.414L10 11.414l-2.293 2.293a1 1 0 0 1-1.414-1.414L8.586 10 6.293 7.707a1 1 0 0 1 1.414-1.414L10 8.586l2.293-2.293a1 1 0 0 1 1.414 1.414L11.414 10l2.293 2.293Z"})],-1),p.createElementVNode("span",{class:"sr-only"},"Error icon",-1)],ree={key:2,class:"inline-flex items-center justify-center flex-shrink-0 w-8 h-8 text-orange-500 bg-orange-100 rounded-lg dark:bg-orange-700 dark:text-orange-200"},aee=[p.createElementVNode("svg",{class:"w-5 h-5","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 20 20"},[p.createElementVNode("path",{d:"M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5ZM10 15a1 1 0 1 1 0-2 1 1 0 0 1 0 2Zm1-4a1 1 0 0 1-2 0V6a1 1 0 0 1 2 0v5Z"})],-1),p.createElementVNode("span",{class:"sr-only"},"Warning icon",-1)],cee={class:"ml-3 text-sm font-normal"},lee=[p.createElementVNode("span",{class:"sr-only"},"Close",-1),p.createElementVNode("svg",{"aria-hidden":"true",class:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"})],-1)],iee={__name:"ToastListItem",props:{message:String,duration:{type:Number,default:2e3},type:{type:String,default:"success"}},emits:["remove"],setup(I,{emit:_e}){const ie=I;p.onMounted(()=>{setTimeout(()=>He("remove"),ie.duration)});const He=_e;return(Re,oe)=>(p.openBlock(),p.createElementBlock("div",eee,[ie.type==="success"?(p.openBlock(),p.createElementBlock("div",tee,nee)):p.createCommentVNode("",!0),ie.type==="error"?(p.openBlock(),p.createElementBlock("div",oee,see)):p.createCommentVNode("",!0),ie.type==="warning"?(p.openBlock(),p.createElementBlock("div",ree,aee)):p.createCommentVNode("",!0),p.createElementVNode("div",cee,p.toDisplayString(ie.message),1),p.createElementVNode("button",{onClick:oe[0]||(oe[0]=qe=>He("remove")),type:"button",class:"-mx-1.5 -my-1.5 ml-auto inline-flex h-8 w-8 rounded-lg bg-white p-1.5 text-gray-400 hover:bg-gray-100 hover:text-gray-900 focus:ring-2 focus:ring-gray-300 dark:bg-gray-800 dark:text-gray-500 dark:hover:bg-gray-700 dark:hover:text-white","data-dismiss-target":"#toast-default","aria-label":"Close"},lee)]))}},k3=p.reactive({items:[]}),aT={state:k3,methods:{add(I){k3.items.unshift({key:Symbol(),message:I.message,type:I.type,duration:I.duration})},remove(I){k3.items.splice(I,1)}}},uee={__name:"GlToastList",setup(I){function _e(ie){aT.methods.remove(ie)}return(ie,He)=>(p.openBlock(),p.createBlock(p.TransitionGroup,{tag:"div","enter-from-class":"translate-x-full opacity-0","enter-active-class":"duration-500","leave-active-class":"duration-500","leave-to-class":"translate-x-full opacity-0",class:"fixed z-50 w-full max-w-xs space-y-4 top-4 right-4"},{default:p.withCtx(()=>[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(p.unref(aT).state.items,(Re,oe)=>(p.openBlock(),p.createBlock(iee,{key:Re.key,message:Re.message,type:Re.type,duration:Re.duration,onRemove:qe=>_e(oe)},null,8,["message","type","duration","onRemove"]))),128))]),_:1}))}},dee={key:0,class:"flex justify-center"},mee=[p.createElementVNode("svg",{class:"w-5 h-5","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 4 15"},[p.createElementVNode("path",{d:"M3.5 1.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Zm0 6.041a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Zm0 5.959a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Z"})],-1)],fee={class:"absolute right-0 z-10 mt-5 origin-top-right bg-white divide-y divide-gray-100 rounded-lg shadow w-44 dark:bg-gray-700 dark:divide-gray-600"},gee={class:"py-2 text-sm text-gray-700 dark:text-gray-200","aria-labelledby":"dropdownDividerButton"},pee={key:0},hee=["href"],bee=p.createElementVNode("i",{class:"mr-2 fa-solid fa-list-ul opacity-80"},null,-1),yee={key:1},vee=p.createElementVNode("i",{class:"mr-2 fa-solid fa-trash-can opacity-80"},null,-1),wee={__name:"DatatableAction",props:{field:{type:String,default:""},route_url:{type:String,default:""},row:{type:[Array,Object],default:[]},xprops:{type:Object,default:{}},tdProps:{type:Object,default:{}}},emits:["deleteAction"],setup(I,{emit:_e}){const ie=I,He=p.ref(!1),Re=p.ref(!1),oe=()=>{He.value=!1},qe=()=>{He.value=!0},te=()=>{Re.value=!1},Ye=()=>{Re.value=!0},dt=_e,Jt=()=>{axios.delete(`${ie.xprops.route}/${ie.row.id}`).then(()=>{te(),dt("deleteAction"),aT.methods.add({message:"Item deleted successfully.",type:"success",duration:5e3})}).catch(wn=>{console.log(wn)})};return(wn,Yt)=>{const Qt=p.resolveDirective("click-outside");return p.openBlock(),p.createElementBlock(p.Fragment,null,[p.createVNode(I$,{isOpen:Re.value,onConfirmDelete:Jt,onCancelDelete:te},null,8,["isOpen"]),I.row&&wn.can(`edit_${I.xprops.permission} || delete_${I.xprops.permission}`)?p.withDirectives((p.openBlock(),p.createElementBlock("div",dee,[p.createElementVNode("button",{onClick:qe,class:"inline-flex items-center p-2 text-sm font-medium text-center text-gray-900 bg-white rounded-lg hover:bg-gray-100 focus:ring-4 focus:outline-none dark:text-white focus:ring-gray-50 dark:bg-gray-800 dark:hover:bg-gray-700 dark:focus:ring-gray-600",type:"button"},mee),p.withDirectives(p.createElementVNode("div",fee,[p.createElementVNode("ul",gee,[wn.can(`edit_${I.xprops.permission}`)?(p.openBlock(),p.createElementBlock("li",pee,[p.createElementVNode("a",{href:I.xprops.route+"/"+I.row.id+"/edit",class:"block px-4 py-2 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white"},[bee,p.createTextVNode(" Edit")],8,hee)])):p.createCommentVNode("",!0),wn.can(`delete_${I.xprops.permission}`)?(p.openBlock(),p.createElementBlock("li",yee,[p.createElementVNode("a",{href:"#",onClick:p.withModifiers(Ye,["prevent"]),class:"block px-4 py-2 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white"},[vee,p.createTextVNode(" Remove")])])):p.createCommentVNode("",!0)])],512),[[p.vShow,He.value]])])),[[Qt,oe]]):p.createCommentVNode("",!0)],64)}}},xee={key:0,class:"flex justify-center"},Cee=[p.createElementVNode("svg",{class:"w-5 h-5","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 4 15"},[p.createElementVNode("path",{d:"M3.5 1.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Zm0 6.041a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Zm0 5.959a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Z"})],-1)],See={class:"absolute right-0 z-10 mt-5 origin-top-right bg-white divide-y divide-gray-100 rounded-lg shadow w-44 dark:bg-gray-700 dark:divide-gray-600"},kee={class:"py-2 text-sm text-gray-700 dark:text-gray-200","aria-labelledby":"dropdownDividerButton"},_ee={key:0},Eee=p.createElementVNode("i",{class:"mr-2 fa-solid fa-trash-can opacity-80"},null,-1),Tee={__name:"DatatableDeleteAction",props:{field:{type:String,default:""},route_url:{type:String,default:""},row:{type:[Array,Object],default:[]},xprops:{type:Object,default:{}},tdProps:{type:Object,default:{}}},emits:["deleteAction"],setup(I,{emit:_e}){const ie=I,He=p.ref(!1),Re=p.ref(!1),oe=()=>{He.value=!1},qe=()=>{He.value=!0},te=()=>{Re.value=!1},Ye=()=>{Re.value=!0},dt=_e,Jt=()=>{axios.delete(`${ie.xprops.route}/${ie.row.id}`).then(()=>{te(),dt("deleteAction"),aT.methods.add({message:"Item deleted successfully.",type:"success",duration:5e3})}).catch(wn=>{console.log(wn)})};return(wn,Yt)=>{const Qt=p.resolveDirective("click-outside");return p.openBlock(),p.createElementBlock(p.Fragment,null,[p.createVNode(I$,{isOpen:Re.value,onConfirmDelete:Jt,onCancelDelete:te},null,8,["isOpen"]),I.row&&wn.can(`delete_${I.xprops.permission}`)?p.withDirectives((p.openBlock(),p.createElementBlock("div",xee,[p.createElementVNode("button",{onClick:qe,class:"inline-flex items-center p-2 text-sm font-medium text-center text-gray-900 bg-white rounded-lg hover:bg-gray-100 focus:ring-4 focus:outline-none dark:text-white focus:ring-gray-50 dark:bg-gray-800 dark:hover:bg-gray-700 dark:focus:ring-gray-600",type:"button"},Cee),p.withDirectives(p.createElementVNode("div",See,[p.createElementVNode("ul",kee,[wn.can(`delete_${I.xprops.permission}`)?(p.openBlock(),p.createElementBlock("li",_ee,[p.createElementVNode("a",{href:"#",onClick:p.withModifiers(Ye,["prevent"]),class:"block px-4 py-2 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white"},[Eee,p.createTextVNode(" Remove")])])):p.createCommentVNode("",!0)])],512),[[p.vShow,He.value]])])),[[Qt,oe]]):p.createCommentVNode("",!0)],64)}}},Aee={props:["field","row"],computed:{isArray(){return Array.isArray(this.row)},isObject(){return typeof this.row=="object"},isString(){return typeof this.row=="string"}},mounted(){}},Dee=["href","title"],Nee=p.createElementVNode("svg",{class:"w-3 h-3 text-white me-2","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[p.createElementVNode("path",{"fill-rule":"evenodd",d:"M13 11.15V4a1 1 0 1 0-2 0v7.15L8.78 8.374a1 1 0 1 0-1.56 1.25l4 5a1 1 0 0 0 1.56 0l4-5a1 1 0 1 0-1.56-1.25L13 11.15Z","clip-rule":"evenodd"}),p.createElementVNode("path",{"fill-rule":"evenodd",d:"M9.657 15.874 7.358 13H5a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2h-2.358l-2.3 2.874a3 3 0 0 1-4.685 0ZM17 16a1 1 0 1 0 0 2h.01a1 1 0 1 0 0-2H17Z","clip-rule":"evenodd"})],-1),Oee={key:1,class:"m-1 d-inline-block"},Bee=["href","title"],$ee=p.createElementVNode("svg",{class:"w-3 h-3 text-white me-2","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[p.createElementVNode("path",{"fill-rule":"evenodd",d:"M13 11.15V4a1 1 0 1 0-2 0v7.15L8.78 8.374a1 1 0 1 0-1.56 1.25l4 5a1 1 0 0 0 1.56 0l4-5a1 1 0 1 0-1.56-1.25L13 11.15Z","clip-rule":"evenodd"}),p.createElementVNode("path",{"fill-rule":"evenodd",d:"M9.657 15.874 7.358 13H5a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2h-2.358l-2.3 2.874a3 3 0 0 1-4.685 0ZM17 16a1 1 0 1 0 0 2h.01a1 1 0 1 0 0-2H17Z","clip-rule":"evenodd"})],-1);function Ree(I,_e,ie,He,Re,oe){return p.openBlock(),p.createElementBlock("div",null,[oe.isArray?(p.openBlock(!0),p.createElementBlock(p.Fragment,{key:0},p.renderList(ie.row,(qe,te)=>(p.openBlock(),p.createElementBlock("div",{key:te,class:"m-1 d-inline-block"},[p.createElementVNode("a",{href:qe,title:qe,target:"_blank",class:"inline-flex items-center px-3 py-2 text-xs font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"},[Nee,p.createTextVNode(" Download ")],8,Dee)]))),128)):oe.isString?(p.openBlock(),p.createElementBlock("div",Oee,[p.createElementVNode("a",{href:ie.row,title:ie.row,target:"_blank",class:"inline-flex items-center px-3 py-2 text-xs font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"},[$ee,p.createTextVNode(" Download ")],8,Bee)])):p.createCommentVNode("",!0)])}const Pee=fc(Aee,[["render",Ree]]),Fee={props:["field","row"],computed:{isArray(){return Array.isArray(this.row[this.field])},isObject(){return typeof this.row[this.field]=="object"}}},Mee=["href","title"],Iee=p.createElementVNode("svg",{class:"w-3 h-3 text-white me-2","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[p.createElementVNode("path",{"fill-rule":"evenodd",d:"M13 11.15V4a1 1 0 1 0-2 0v7.15L8.78 8.374a1 1 0 1 0-1.56 1.25l4 5a1 1 0 0 0 1.56 0l4-5a1 1 0 1 0-1.56-1.25L13 11.15Z","clip-rule":"evenodd"}),p.createElementVNode("path",{"fill-rule":"evenodd",d:"M9.657 15.874 7.358 13H5a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2h-2.358l-2.3 2.874a3 3 0 0 1-4.685 0ZM17 16a1 1 0 1 0 0 2h.01a1 1 0 1 0 0-2H17Z","clip-rule":"evenodd"})],-1),Lee={key:1,class:"m-1 d-inline-block"},Vee=["href","title"],zee=p.createElementVNode("svg",{class:"w-3 h-3 text-white me-2","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[p.createElementVNode("path",{"fill-rule":"evenodd",d:"M13 11.15V4a1 1 0 1 0-2 0v7.15L8.78 8.374a1 1 0 1 0-1.56 1.25l4 5a1 1 0 0 0 1.56 0l4-5a1 1 0 1 0-1.56-1.25L13 11.15Z","clip-rule":"evenodd"}),p.createElementVNode("path",{"fill-rule":"evenodd",d:"M9.657 15.874 7.358 13H5a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2h-2.358l-2.3 2.874a3 3 0 0 1-4.685 0ZM17 16a1 1 0 1 0 0 2h.01a1 1 0 1 0 0-2H17Z","clip-rule":"evenodd"})],-1);function Hee(I,_e,ie,He,Re,oe){return p.openBlock(),p.createElementBlock("div",null,[oe.isArray?(p.openBlock(!0),p.createElementBlock(p.Fragment,{key:0},p.renderList(ie.row[ie.field],qe=>(p.openBlock(),p.createElementBlock("div",{key:qe.id,class:"m-1 d-inline-block"},[p.createElementVNode("a",{href:qe.url,title:qe.name,target:"_blank",class:"inline-flex items-center px-3 py-2 text-xs font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"},[Iee,p.createTextVNode(" Download ")],8,Mee)]))),128)):oe.isObject?(p.openBlock(),p.createElementBlock("div",Lee,[p.createElementVNode("a",{href:ie.row[ie.field].url,title:ie.row[ie.field].name,target:"_blank",class:"inline-flex items-center px-3 py-2 text-xs font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"},[zee,p.createTextVNode(" Download ")],8,Vee)])):p.createCommentVNode("",!0)])}const Uee=fc(Fee,[["render",Hee]]),Wee={props:["field","row","tdProps"]},jee={key:0},Gee=["innerHTML"];function qee(I,_e,ie,He,Re,oe){return ie.row[ie.field]?(p.openBlock(),p.createElementBlock("div",jee,[p.createElementVNode("div",{class:"w-full",innerHTML:ie.row[ie.field]},null,8,Gee)])):p.createCommentVNode("",!0)}const Kee=fc(Wee,[["render",qee]]),Yee={props:["field","row","tdProps"],computed:{entry(){const[I,_e]=this.field.split(".");return p.markRaw({key:I,field:_e})},isArray(){return Array.isArray(this.row[this.entry.key])},isObject(){return typeof this.row[this.entry.key]=="object"}}},Xee={class:"flex flex-wrap gap-2"},Zee={key:1,class:"px-2 py-1 text-xs font-medium text-blue-800 bg-blue-100 rounded dark:bg-blue-900 dark:text-blue-300"};function Jee(I,_e,ie,He,Re,oe){return p.openBlock(),p.createElementBlock("div",Xee,[oe.isArray?(p.openBlock(!0),p.createElementBlock(p.Fragment,{key:0},p.renderList(ie.row[oe.entry.key],(qe,te)=>(p.openBlock(),p.createElementBlock("span",{key:te,class:"px-2 py-1 text-xs font-medium text-blue-800 bg-blue-100 rounded dark:bg-blue-900 dark:text-blue-300"},p.toDisplayString(qe[oe.entry.field]),1))),128)):oe.isObject?(p.openBlock(),p.createElementBlock("span",Zee,p.toDisplayString(ie.row[oe.entry.key][oe.entry.field]),1)):p.createCommentVNode("",!0)])}const Qee=fc(Yee,[["render",Jee]]),ete={props:["field","row","tdProps"]},tte={key:0},nte={class:"m-1 d-inline-block"},ote=["href","title"],ste=["src","alt","title"];function rte(I,_e,ie,He,Re,oe){return ie.row[ie.field]?(p.openBlock(),p.createElementBlock("div",tte,[p.createElementVNode("div",nte,[p.createElementVNode("a",{href:ie.row[ie.field].url,title:ie.row[ie.field].name,target:"_blank"},[p.createElementVNode("img",{src:ie.row[ie.field].thumbnail,alt:ie.row[ie.field].name,title:ie.row[ie.field].name},null,8,ste)],8,ote)])])):p.createCommentVNode("",!0)}const ate=fc(ete,[["render",rte],["__scopeId","data-v-3a28c02c"]]),cte={props:["field","row","tdProps"],computed:{isActive(){return this.row[this.field]===1}}},lte={class:"flex flex-wrap gap-2 text-nowrap"},ite={key:0,class:"inline-flex items-center px-2 py-1 text-xs font-medium text-green-800 bg-green-100 rounded-full dark:bg-green-900 dark:text-green-300"},ute=p.createElementVNode("span",{class:"w-2 h-2 bg-green-500 rounded-full me-1"},null,-1),dte={key:1,class:"inline-flex items-center bg-red-100 text-red-800 text-xs font-medium px-2.5 py-0.5 rounded-full dark:bg-red-900 dark:text-red-300"},mte=p.createElementVNode("span",{class:"w-2 h-2 bg-red-500 rounded-full me-1"},null,-1);function fte(I,_e,ie,He,Re,oe){return p.openBlock(),p.createElementBlock("div",lte,[oe.isActive?(p.openBlock(),p.createElementBlock("span",ite,[ute,p.createTextVNode(" Active ")])):oe.isActive?p.createCommentVNode("",!0):(p.openBlock(),p.createElementBlock("span",dte,[mte,p.createTextVNode(" Inactive ")]))])}const gte=fc(cte,[["render",fte]]),pte={props:["field","row","tdProps"],computed:{hasLabelColor(I){const _e=this.tdProps.status_general_labels_color.find(ie=>ie.label===this.row[this.field]);return _e?_e.class:""}}},hte={class:"flex flex-wrap gap-2 text-nowrap"},bte={key:0,class:"inline-flex items-center px-2 py-1 text-xs font-medium text-green-800 bg-green-100 rounded-full dark:bg-green-900 dark:text-green-300"},yte=p.createElementVNode("span",{class:"w-2 h-2 bg-green-500 rounded-full me-1"},null,-1),vte={key:1,class:"inline-flex items-center px-2 py-1 text-xs font-medium text-red-800 bg-red-100 rounded-full dark:bg-red-900 dark:text-red-300"},wte=p.createElementVNode("span",{class:"w-2 h-2 bg-red-500 rounded-full me-1"},null,-1),xte={key:2,class:"inline-flex items-center px-2 py-1 text-xs font-medium text-yellow-800 bg-yellow-100 rounded-full dark:bg-gray-700 dark:text-yellow-300"},Cte=p.createElementVNode("span",{class:"w-2 h-2 bg-yellow-500 rounded-full me-1"},null,-1),Ste={key:3,class:"inline-flex items-center px-2 py-1 text-xs font-medium text-blue-800 bg-blue-100 rounded-full dark:bg-gray-700 dark:text-blue-400"},kte=p.createElementVNode("span",{class:"w-2 h-2 bg-blue-500 rounded-full me-1"},null,-1),_te={key:4,class:"inline-flex items-center px-2 py-1 text-sm text-blue-800 bg-blue-100 rounded-full dark:bg-blue-900 dark:text-blue-300"},Ete=p.createElementVNode("span",{class:"relative flex w-2 h-2 mr-1"},[p.createElementVNode("span",{class:"absolute inline-flex w-full h-full bg-blue-500 rounded-full animate-ping"}),p.createElementVNode("span",{class:"relative inline-flex w-2 h-2 bg-blue-500 rounded-full"})],-1);function Tte(I,_e,ie,He,Re,oe){return p.openBlock(),p.createElementBlock("div",hte,[oe.hasLabelColor=="green"?(p.openBlock(),p.createElementBlock("span",bte,[yte,p.createTextVNode(" "+p.toDisplayString(this.row[this.field]),1)])):p.createCommentVNode("",!0),oe.hasLabelColor=="red"?(p.openBlock(),p.createElementBlock("span",vte,[wte,p.createTextVNode(" "+p.toDisplayString(this.row[this.field]),1)])):p.createCommentVNode("",!0),oe.hasLabelColor=="yellow"?(p.openBlock(),p.createElementBlock("span",xte,[Cte,p.createTextVNode(" "+p.toDisplayString(this.row[this.field]),1)])):p.createCommentVNode("",!0),oe.hasLabelColor=="default"?(p.openBlock(),p.createElementBlock("span",Ste,[kte,p.createTextVNode(" "+p.toDisplayString(this.row[this.field]),1)])):p.createCommentVNode("",!0),oe.hasLabelColor=="animate"?(p.openBlock(),p.createElementBlock("span",_te,[Ete,p.createTextVNode(" "+p.toDisplayString(this.row[this.field]),1)])):p.createCommentVNode("",!0)])}const Ate=fc(pte,[["render",Tte]]),Dte={props:["field","row","tdProps"],computed:{hasLabelColor(){return this.tdProps.specfic_color??""},badgeType(){switch(this.tdProps.badge_type){case"Default":return"rounded text-xs";case"Large":return"rounded text-sm ";case"Bordered":return"rounded text-xs border";case"Pills":return"rounded-full text-xs";default:return""}}}},Nte={class:"flex flex-wrap gap-2 text-nowrap justify-center"};function Ote(I,_e,ie,He,Re,oe){return p.openBlock(),p.createElementBlock("div",Nte,[oe.hasLabelColor=="Default"?(p.openBlock(),p.createElementBlock("span",{key:0,class:p.normalizeClass(["bg-blue-100 text-blue-800 font-medium me-2 px-2.5 py-0.5 dark:bg-blue-900 dark:text-blue-300 border-blue-400",oe.badgeType])},p.toDisplayString(this.row[this.field]),3)):p.createCommentVNode("",!0),oe.hasLabelColor=="Dark"?(p.openBlock(),p.createElementBlock("span",{key:1,class:p.normalizeClass(["bg-gray-100 text-gray-800 font-medium me-2 px-2.5 py-0.5 dark:bg-gray-700 dark:text-gray-300 border-gray-500",oe.badgeType])},p.toDisplayString(this.row[this.field]),3)):p.createCommentVNode("",!0),oe.hasLabelColor=="Red"?(p.openBlock(),p.createElementBlock("span",{key:2,class:p.normalizeClass(["bg-red-100 text-red-800 font-medium me-2 px-2.5 py-0.5 dark:bg-red-900 dark:text-red-300 border-red-400",oe.badgeType])},p.toDisplayString(this.row[this.field]),3)):p.createCommentVNode("",!0),oe.hasLabelColor=="Green"?(p.openBlock(),p.createElementBlock("span",{key:3,class:p.normalizeClass(["bg-green-100 text-green-800 font-medium me-2 px-2.5 py-0.5 dark:bg-green-900 dark:text-green-300 border-green-400",oe.badgeType])},p.toDisplayString(this.row[this.field]),3)):p.createCommentVNode("",!0),oe.hasLabelColor=="Yellow"?(p.openBlock(),p.createElementBlock("span",{key:4,class:p.normalizeClass(["bg-yellow-100 text-yellow-800 font-medium me-2 px-2.5 py-0.5 dark:bg-yellow-900 dark:text-yellow-300 border-yellow-300",oe.badgeType])},p.toDisplayString(this.row[this.field]),3)):p.createCommentVNode("",!0),oe.hasLabelColor=="Indigo"?(p.openBlock(),p.createElementBlock("span",{key:5,class:p.normalizeClass(["bg-indigo-100 text-indigo-800 font-medium me-2 px-2.5 py-0.5 dark:bg-indigo-900 dark:text-indigo-300 border-indigo-400",oe.badgeType])},p.toDisplayString(this.row[this.field]),3)):p.createCommentVNode("",!0),oe.hasLabelColor=="Purple"?(p.openBlock(),p.createElementBlock("span",{key:6,class:p.normalizeClass(["bg-purple-100 text-purple-800 font-medium me-2 px-2.5 py-0.5 dark:bg-purple-900 dark:text-purple-300 border-purple-400",oe.badgeType])},p.toDisplayString(this.row[this.field]),3)):p.createCommentVNode("",!0),oe.hasLabelColor=="Pink"?(p.openBlock(),p.createElementBlock("span",{key:7,class:p.normalizeClass(["bg-pink-100 text-pink-800 font-medium me-2 px-2.5 py-0.5 dark:bg-pink-900 dark:text-pink-300 border-pink-400",oe.badgeType])},p.toDisplayString(this.row[this.field]),3)):p.createCommentVNode("",!0)])}const Bte=fc(Dte,[["render",Ote]]),$te={props:["field","row","tdProps"],computed:{hasLabelColor(I){const _e=this.tdProps.status_general_labels_color.find(ie=>ie.text===this.row[this.field]);return _e?_e.class:""},getLabel(){const I=this.tdProps.status_general_labels_color.find(_e=>_e.text===this.row[this.field]);return I?I.label:""}}},Rte={class:"flex flex-wrap gap-2 text-nowrap"},Pte={key:0,class:"inline-flex items-center px-2 py-1 text-xs font-medium text-green-800 bg-green-100 rounded-full dark:bg-green-900 dark:text-green-300"},Fte=p.createElementVNode("span",{class:"w-2 h-2 bg-green-500 rounded-full me-1"},null,-1),Mte={key:1,class:"inline-flex items-center px-2 py-1 text-xs font-medium text-red-800 bg-red-100 rounded-full dark:bg-red-900 dark:text-red-300"},Ite=p.createElementVNode("span",{class:"w-2 h-2 bg-red-500 rounded-full me-1"},null,-1),Lte={key:2,class:"inline-flex items-center px-2 py-1 text-xs font-medium text-yellow-800 bg-yellow-100 rounded-full dark:bg-gray-700 dark:text-yellow-300"},Vte=p.createElementVNode("span",{class:"w-2 h-2 bg-yellow-500 rounded-full me-1"},null,-1),zte={key:3,class:"inline-flex items-center px-2 py-1 text-xs font-medium text-blue-800 bg-blue-100 rounded-full dark:bg-gray-700 dark:text-blue-400"},Hte=p.createElementVNode("span",{class:"w-2 h-2 bg-blue-500 rounded-full me-1"},null,-1),Ute={key:4,class:"inline-flex items-center px-2 py-1 text-sm text-blue-800 bg-blue-100 rounded-full dark:bg-blue-900 dark:text-blue-300"},Wte=p.createElementVNode("span",{class:"relative flex w-2 h-2 mr-1"},[p.createElementVNode("span",{class:"absolute inline-flex w-full h-full bg-blue-500 rounded-full animate-ping"}),p.createElementVNode("span",{class:"relative inline-flex w-2 h-2 bg-blue-500 rounded-full"})],-1);function jte(I,_e,ie,He,Re,oe){return p.openBlock(),p.createElementBlock("div",Rte,[oe.hasLabelColor=="green"?(p.openBlock(),p.createElementBlock("span",Pte,[Fte,p.createTextVNode(" "+p.toDisplayString(oe.getLabel),1)])):p.createCommentVNode("",!0),oe.hasLabelColor=="red"?(p.openBlock(),p.createElementBlock("span",Mte,[Ite,p.createTextVNode(" "+p.toDisplayString(oe.getLabel),1)])):p.createCommentVNode("",!0),oe.hasLabelColor=="yellow"?(p.openBlock(),p.createElementBlock("span",Lte,[Vte,p.createTextVNode(" "+p.toDisplayString(oe.getLabel),1)])):p.createCommentVNode("",!0),oe.hasLabelColor=="default"?(p.openBlock(),p.createElementBlock("span",zte,[Hte,p.createTextVNode(" "+p.toDisplayString(oe.getLabel),1)])):p.createCommentVNode("",!0),oe.hasLabelColor=="animate"?(p.openBlock(),p.createElementBlock("span",Ute,[Wte,p.createTextVNode(" "+p.toDisplayString(oe.getLabel),1)])):p.createCommentVNode("",!0)])}const Gte=fc($te,[["render",jte]]),qte={props:["field","row","tdProps"],computed:{formattedDate(){if(!this.row[this.field])return"";const I=new Date(this.row[this.field]),_e=I.getFullYear(),ie=I.toLocaleString("default",{month:"long"}),He=I.getDate();let Re=I.getHours();const oe=I.getMinutes(),qe=I.getSeconds(),te=Re>=12?"pm":"am";return Re=Re%12,Re=Re||12,`${ie} ${He}, ${_e}, ${Re}:${oe}:${qe} ${te}`},isActive(){return this.row[this.field]===1}}},Kte={class:"w-full"};function Yte(I,_e,ie,He,Re,oe){return p.openBlock(),p.createElementBlock("div",Kte,p.toDisplayString(oe.formattedDate),1)}const Xte=fc(qte,[["render",Yte]]),Zte={props:["field","row","tdProps"]},Jte={class:"flex flex-wrap gap-2 text-nowrap"},Qte={key:0,class:"inline-flex items-center px-2 py-1 text-sm text-blue-800 bg-blue-100 rounded-full dark:bg-blue-900 dark:text-blue-300"},ene=p.createElementVNode("span",{class:"relative flex w-2 h-2 mr-1"},[p.createElementVNode("span",{class:"absolute inline-flex w-full h-full bg-blue-500 rounded-full animate-ping"}),p.createElementVNode("span",{class:"relative inline-flex w-2 h-2 bg-blue-500 rounded-full"})],-1),tne={key:1,class:"inline-flex items-center px-2 py-1 text-xs font-medium text-yellow-800 bg-yellow-100 rounded-full dark:bg-gray-700 dark:text-yellow-300"},nne=p.createElementVNode("span",{class:"w-2 h-2 bg-yellow-500 rounded-full me-1"},null,-1),one={key:2,class:"inline-flex items-center px-2 py-1 text-xs font-medium text-green-800 bg-green-100 rounded-full dark:bg-green-900 dark:text-green-300"},sne=p.createElementVNode("span",{class:"w-2 h-2 bg-green-500 rounded-full me-1"},null,-1);function rne(I,_e,ie,He,Re,oe){return p.openBlock(),p.createElementBlock("div",Jte,[ie.row[ie.field]===0?(p.openBlock(),p.createElementBlock("span",Qte,[ene,p.createTextVNode(" Provisioning")])):p.createCommentVNode("",!0),ie.row[ie.field]===2?(p.openBlock(),p.createElementBlock("span",tne,[nne,p.createTextVNode(" Paused ")])):p.createCommentVNode("",!0),ie.row[ie.field]===1?(p.openBlock(),p.createElementBlock("span",one,[sne,p.createTextVNode(" Active ")])):p.createCommentVNode("",!0)])}const ane=fc(Zte,[["render",rne]]),cne={props:["field","row","tdProps"]},lne={key:0,class:"text-nowrap"},ine={class:"w-full h-full p-3 mx-0 mt-0 overflow-auto font-mono text-left break-words rounded cursor-default whitespace-nowrap console_styles"};function une(I,_e,ie,He,Re,oe){return ie.row[ie.field]?(p.openBlock(),p.createElementBlock("div",lne,[p.createElementVNode("pre",ine," "+p.toDisplayString(ie.row[ie.field])+`
|
|
95
|
+
Required: `+A.join(", "));return qs[ln].apply(null,uo)},log:qs=>{console.log(qs,{constructors:A,constructor:ln,params:uo})}}}}),H}}.generate([{none:[]},{only:["index"]},{left:["index","next"]},{middle:["prev","index","next"]},{right:["prev","index"]}])});const jn=(C,A)=>{const H=fl.fromTable(C);return Lr(H,A).bind(Le=>{const Bt=Le[Le.length-1],ln=Le[0].row,kn=Bt.row+Bt.rowspan,uo=H.all.slice(ln,kn);return Pe(uo)}).getOr("")},au=C=>Ec(C,"rgb")?ii(C):C,Yy=C=>{const A=Ft.fromDom(C);return{borderwidth:gt(A,"border-width").getOr(""),borderstyle:gt(A,"border-style").getOr(""),bordercolor:gt(A,"border-color").map(au).getOr(""),backgroundcolor:gt(A,"background-color").map(au).getOr("")}},Tu=C=>{const A=C[0],H=C.slice(1);return F(H,Q=>{F(Ut(A),Le=>{St(Q,(Bt,ln)=>{const kn=A[Le];kn!==""&&Le===ln&&kn!==Bt&&(A[Le]="")})})}),A},Sa=(C,A,H,Q)=>Ne(C,Le=>!dt(H.formatter.matchNode(Q,A+Le))).getOr(""),Ju=q(Sa,["left","center","right"],"align"),Ng=q(Sa,["top","middle","bottom"],"valign"),oc=(C,A)=>{const H=yg(C),Q=qu(C),Le=()=>({borderstyle:je(H,"border-style").getOr(""),bordercolor:au(je(H,"border-color").getOr("")),backgroundcolor:au(je(H,"background-color").getOr(""))}),Bt={height:"",width:"100%",cellspacing:"",cellpadding:"",caption:!1,class:"",align:"",border:""},ln=()=>{const la=H["border-width"];return ci(C)&&la?{border:la}:je(Q,"border").fold(()=>({}),qs=>({border:qs}))},kn=A?Le():{},uo=()=>{const la=je(H,"border-spacing").or(je(Q,"cellspacing")).fold(()=>({}),Fr=>({cellspacing:Fr})),qs=je(H,"border-padding").or(je(Q,"cellpadding")).fold(()=>({}),Fr=>({cellpadding:Fr}));return{...la,...qs}};return{...Bt,...H,...Q,...kn,...ln(),...uo()}},cu=C=>Sn(Ft.fromDom(C)).map(A=>{const H={selection:Sg(C.cells)};return jn(A,H)}).getOr(""),Dp=(C,A,H)=>{const Q=(kn,uo)=>{const Zo=gt(Ft.fromDom(uo),"border-width");return ci(C)&&Zo.isSome()?Zo.getOr(""):kn.getAttrib(uo,"border")||Ac(C.dom,uo,"border-width")||Ac(C.dom,uo,"border")||""},Le=C.dom,Bt=ci(C)?Le.getStyle(A,"border-spacing")||Le.getAttrib(A,"cellspacing"):Le.getAttrib(A,"cellspacing")||Le.getStyle(A,"border-spacing"),ln=ci(C)?Ac(Le,A,"padding")||Le.getAttrib(A,"cellpadding"):Le.getAttrib(A,"cellpadding")||Ac(Le,A,"padding");return{width:Le.getStyle(A,"width")||Le.getAttrib(A,"width"),height:Le.getStyle(A,"height")||Le.getAttrib(A,"height"),cellspacing:Bt??"",cellpadding:ln??"",border:Q(Le,A),caption:!!Le.select("caption",A)[0],class:Le.getAttrib(A,"class",""),align:Ju(C,A),...H?Yy(A):{}}},Au=(C,A,H)=>{const Q=C.dom;return{height:Q.getStyle(A,"height")||Q.getAttrib(A,"height"),class:Q.getAttrib(A,"class",""),type:cu(A),align:Ju(C,A),...H?Yy(A):{}}},Xy=(C,A,H,Q)=>{const Le=C.dom,Bt=Q.getOr(A),ln=(kn,uo)=>Le.getStyle(kn,uo)||Le.getAttrib(kn,uo);return{width:ln(Bt,"width"),height:ln(A,"height"),scope:Le.getAttrib(A,"scope"),celltype:En(A),class:Le.getAttrib(A,"class",""),halign:Ju(C,A),valign:Ng(C,A),...H?Yy(A):{}}},Og=(C,A)=>{const H=fl.fromTable(C),Q=fl.justCells(H),Le=Pt(Q,Bt=>Zt(A,ln=>Bo(Bt.element,ln)));return ot(Le,Bt=>({element:Bt.element.dom,column:fl.getColumnAt(H,Bt.column).map(ln=>ln.element.dom)}))},sn=(C,A,H,Q)=>{Q("scope")&&C.setAttrib("scope",H.scope),Q("class")&&C.setAttrib("class",H.class),Q("height")&&C.setStyle("height",Xn(H.height)),Q("width")&&A.setStyle("width",Xn(H.width))},Zy=(C,A,H)=>{H("backgroundcolor")&&C.setFormat("tablecellbackgroundcolor",A.backgroundcolor),H("bordercolor")&&C.setFormat("tablecellbordercolor",A.bordercolor),H("borderstyle")&&C.setFormat("tablecellborderstyle",A.borderstyle),H("borderwidth")&&C.setFormat("tablecellborderwidth",Xn(A.borderwidth))},Bd=(C,A,H,Q)=>{const Le=A.length===1;F(A,Bt=>{const ln=Bt.element,kn=Le?Et:Q,uo=xm.normal(C,ln),Zo=Bt.column.map(la=>xm.normal(C,la)).getOr(uo);sn(uo,Zo,H,kn),mf(C)&&Zy(uo,H,kn),Q("halign")&&Mc(C,ln,H.halign),Q("valign")&&Gu(C,ln,H.valign)})},Qu=(C,A)=>{C.execCommand("mceTableCellType",!1,{type:A.celltype,no_events:!0})},Bg=(C,A,H,Q)=>{const Le=Zn(Q,(Bt,ln)=>H[ln]!==Bt);S(Le)>0&&A.length>=1&&Sn(A[0]).each(Bt=>{const ln=Og(Bt,A),kn=S(Zn(Le,(Zo,la)=>la!=="scope"&&la!=="celltype"))>0,uo=me(Le,"celltype");(kn||me(Le,"scope"))&&Bd(C,ln,Q,q(me,Le)),uo&&Qu(C,Q),ps(C,Bt.dom,{structure:uo,style:kn})})},Yr=(C,A,H,Q)=>{const Le=Q.getData();Q.close(),C.undoManager.transact(()=>{Bg(C,A,H,Le),C.focus()})},cr=(C,A)=>{const H=Sn(A[0]).map(Q=>ot(Og(Q,A),Le=>Xy(C,Le.element,mf(C),Le.column)));return Tu(H.getOrDie())},el=C=>{const A=Hc(C);if(A.length===0)return;const H=cr(C,A),Q={type:"tabpanel",tabs:[{title:"General",name:"general",items:Ap(C)},hf(C,"cell")]},Le={type:"panel",items:[{type:"grid",columns:2,items:Ap(C)}]};C.windowManager.open({title:"Cell Properties",size:"normal",body:mf(C)?Q:Le,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:H,onSubmit:q(Yr,C,A,H)})},Wc=C=>{const A=ui(wu(C));return A.length>0?W.some({name:"class",type:"listbox",label:"Class",items:A}):W.none()},vs=[{type:"listbox",name:"type",label:"Row type",items:[{text:"Header",value:"header"},{text:"Body",value:"body"},{text:"Footer",value:"footer"}]},{type:"listbox",name:"align",label:"Alignment",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{label:"Height",name:"height",type:"input"}],bf=C=>vs.concat(Wc(C).toArray()),vc=(C,A,H)=>{H("class")&&C.setAttrib("class",A.class),H("height")&&C.setStyle("height",Xn(A.height))},ga=(C,A,H)=>{H("backgroundcolor")&&C.setStyle("background-color",A.backgroundcolor),H("bordercolor")&&C.setStyle("border-color",A.bordercolor),H("borderstyle")&&C.setStyle("border-style",A.borderstyle)},Np=(C,A,H,Q)=>{const Bt=A.length===1?Et:Q;F(A,ln=>{const kn=xm.normal(C,ln);vc(kn,H,Bt),pm(C)&&ga(kn,H,Bt),Q("align")&&Mc(C,ln,H.align)})},jt=(C,A)=>{C.execCommand("mceTableRowType",!1,{type:A.type,no_events:!0})},$l=(C,A,H,Q)=>{const Le=Zn(Q,(Bt,ln)=>H[ln]!==Bt);if(S(Le)>0){const Bt=me(Le,"type"),ln=Bt?S(Le)>1:!0;ln&&Np(C,A,Q,q(me,Le)),Bt&&jt(C,Q),Sn(Ft.fromDom(A[0])).each(kn=>ps(C,kn.dom,{structure:Bt,style:ln}))}},$g=(C,A,H,Q)=>{const Le=Q.getData();Q.close(),C.undoManager.transact(()=>{$l(C,A,H,Le),C.focus()})},Vs=C=>{const A=Bi(fo(C),zc.selected);if(A.length===0)return;const H=ot(A,ln=>Au(C,ln.dom,pm(C))),Q=Tu(H),Le={type:"tabpanel",tabs:[{title:"General",name:"general",items:bf(C)},hf(C,"row")]},Bt={type:"panel",items:[{type:"grid",columns:2,items:bf(C)}]};C.windowManager.open({title:"Row Properties",size:"normal",body:pm(C)?Le:Bt,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:Q,onSubmit:q($g,C,ot(A,ln=>ln.dom),Q)})},lu=(C,A,H)=>{const Q=H?[{type:"input",name:"cols",label:"Cols",inputMode:"numeric"},{type:"input",name:"rows",label:"Rows",inputMode:"numeric"}]:[],Le=[{type:"input",name:"width",label:"Width"},{type:"input",name:"height",label:"Height"}],Bt=hm(C)?[{type:"input",name:"cellspacing",label:"Cell spacing",inputMode:"numeric"},{type:"input",name:"cellpadding",label:"Cell padding",inputMode:"numeric"},{type:"input",name:"border",label:"Border width"},{type:"label",label:"Caption",items:[{type:"checkbox",name:"caption",label:"Show caption"}]}]:[],ln=[{type:"listbox",name:"align",label:"Alignment",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]}],kn=A.length>0?[{type:"listbox",name:"class",label:"Class",items:A}]:[];return Q.concat(Le).concat(Bt).concat(ln).concat(kn)},Jy=(C,A,H,Q)=>{if(A.tagName==="TD"||A.tagName==="TH")qe(H)&&wn(Q)?C.setStyle(A,H,Q):C.setStyles(A,H);else if(A.children)for(let Le=0;Le<A.children.length;Le++)Jy(C,A.children[Le],H,Q)},iu=(C,A,H,Q)=>{const Le=C.dom,Bt={},ln={},kn=ci(C),uo=Lc(C);if(dt(H.class)||(Bt.class=H.class),ln.height=Xn(H.height),kn?ln.width=Xn(H.width):Le.getAttrib(A,"width")&&(Bt.width=Kn(H.width)),kn?(ln["border-width"]=Xn(H.border),ln["border-spacing"]=Xn(H.cellspacing)):(Bt.border=H.border,Bt.cellpadding=H.cellpadding,Bt.cellspacing=H.cellspacing),kn&&A.children){const Zo={};if(Q.border&&(Zo["border-width"]=Xn(H.border)),Q.cellpadding&&(Zo.padding=Xn(H.cellpadding)),uo&&Q.bordercolor&&(Zo["border-color"]=H.bordercolor),!Rt(Zo))for(let la=0;la<A.children.length;la++)Jy(Le,A.children[la],Zo)}if(uo){const Zo=H;ln["background-color"]=Zo.backgroundcolor,ln["border-color"]=Zo.bordercolor,ln["border-style"]=Zo.borderstyle}Le.setStyles(A,{...yg(C),...ln}),Le.setAttribs(A,{...qu(C),...Bt})},ab=(C,A,H,Q)=>{const Le=C.dom,Bt=Q.getData(),ln=Zn(Bt,(kn,uo)=>H[uo]!==kn);Q.close(),Bt.class===""&&delete Bt.class,C.undoManager.transact(()=>{if(!A){const kn=La(Bt.cols).getOr(1),uo=La(Bt.rows).getOr(1);C.execCommand("mceInsertTable",!1,{rows:uo,columns:kn}),A=ou(fo(C),qn(C)).bind(Zo=>Sn(Zo,qn(C))).map(Zo=>Zo.dom).getOrDie()}if(S(ln)>0){const kn={border:me(ln,"border"),bordercolor:me(ln,"bordercolor"),cellpadding:me(ln,"cellpadding")};iu(C,A,Bt,kn);const uo=Le.select("caption",A)[0];(uo&&!Bt.caption||!uo&&Bt.caption)&&C.execCommand("mceTableToggleCaption"),Mc(C,A,Bt.align)}if(C.focus(),C.addVisual(),S(ln)>0){const kn=me(ln,"caption"),uo=kn?S(ln)>1:!0;ps(C,A,{structure:kn,style:uo})}})},$i=(C,A)=>{const H=C.dom;let Q,Le=oc(C,Lc(C));A?(Le.cols="1",Le.rows="1",Lc(C)&&(Le.borderstyle="",Le.bordercolor="",Le.backgroundcolor="")):(Q=H.getParent(C.selection.getStart(),"table",C.getBody()),Q?Le=Dp(C,Q,Lc(C)):Lc(C)&&(Le.borderstyle="",Le.bordercolor="",Le.backgroundcolor=""));const Bt=ui(ym(C));Bt.length>0&&Le.class&&(Le.class=Le.class.replace(/\s*mce\-item\-table\s*/g,""));const ln={type:"grid",columns:2,items:lu(C,Bt,A)},kn=()=>({type:"panel",items:[ln]}),uo=()=>({type:"tabpanel",tabs:[{title:"General",name:"general",items:[ln]},hf(C,"table")]}),Zo=Lc(C)?uo():kn();C.windowManager.open({title:"Table Properties",size:"normal",body:Zo,onSubmit:q(ab,C,Q,Le),buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:Le})},cb=C=>{const A=H=>{js(fo(C))&&H()};St({mceTableProps:q($i,C,!1),mceTableRowProps:q(Vs,C),mceTableCellProps:q(el,C),mceInsertTableDialog:q($i,C,!0)},(H,Q)=>C.addCommand(Q,()=>A(H)))},ql=(C,A)=>Fe(C,A).isSome(),Ys=it,Du=C=>{const A=(Q,Le)=>hr(Q,Le).exists(Bt=>parseInt(Bt,10)>1),H=Q=>A(Q,"rowspan")||A(Q,"colspan");return C.length>0&&re(C,H)?W.some(C):W.none()},Cm=(C,A,H)=>A.length<=1?W.none():Ky(C,H.firstSelectedSelector,H.lastSelectedSelector).map(Q=>({bounds:Q,cells:A})),wc=C=>({element:C,mergable:W.none(),unmergable:W.none(),selection:[C]}),lb=(C,A,H)=>({element:H,mergable:Cm(A,C,zc),unmergable:Du(C),selection:Ys(C)}),Sm=C=>{const A=Xu(W.none()),H=Xu([]);let Q=W.none();const Le=Qr("caption"),Bt=Hs=>Q.forall(hs=>!hs[Hs]),ln=()=>Wa(fo(C),qn(C)),kn=()=>Wa(rs(C),qn(C)),uo=()=>ln().bind(Hs=>Ia(ra(Sn(Hs),kn().bind(Sn),(hs,sc)=>Bo(hs,sc)?Le(Hs)?W.some(wc(Hs)):W.some(lb(Hc(C),hs,Hs)):W.none()))),Zo=Hs=>Sn(Hs.element).map(sc=>{const jc=fl.fromTable(sc),ib=Lr(jc,Hs).getOr([]),ed=so(ib,(Gc,Tm)=>(Tm.isLocked&&(Gc.onAny=!0,Tm.column===0?Gc.onFirst=!0:Tm.column+Tm.colspan>=jc.grid.columns&&(Gc.onLast=!0)),Gc),{onAny:!1,onFirst:!1,onLast:!1});return{mergeable:ru(jc,Hs).isSome(),unmergeable:nc(jc,Hs).isSome(),locked:ed}}),la=()=>{A.set(nn(uo)()),Q=A.get().bind(Zo),F(H.get(),at)},qs=Hs=>(Hs(),H.set(H.get().concat([Hs])),()=>{H.set(Pt(H.get(),hs=>hs!==Hs))}),Fr=(Hs,hs)=>qs(()=>A.get().fold(()=>{Hs.setEnabled(!1)},sc=>{Hs.setEnabled(!hs(sc)&&C.selection.isEditable())})),Rl=(Hs,hs,sc)=>qs(()=>A.get().fold(()=>{Hs.setEnabled(!1),Hs.setActive(!1)},jc=>{Hs.setEnabled(!hs(jc)&&C.selection.isEditable()),Hs.setActive(sc(jc))})),vl=Hs=>Q.exists(hs=>hs.locked[Hs]),fi=Hs=>Fr(Hs,hs=>!1),Rd=Hs=>Fr(Hs,hs=>Le(hs.element)),uu=Hs=>hs=>Fr(hs,sc=>Le(sc.element)||vl(Hs)),Rg=Hs=>hs=>Fr(hs,sc=>Le(sc.element)||Hs().isNone()),yf=(Hs,hs)=>sc=>Fr(sc,jc=>Le(jc.element)||Hs().isNone()||vl(hs)),_m=Hs=>Fr(Hs,hs=>Bt("mergeable")),Pg=Hs=>Fr(Hs,hs=>Bt("unmergeable")),$a=Hs=>Rl(Hs,Pn,hs=>Sn(hs.element,qn(C)).exists(jc=>ql(jc,"caption"))),gi=(Hs,hs)=>sc=>Rl(sc,jc=>Le(jc.element),()=>C.queryCommandValue(Hs)===hs),vf=gi("mceTableRowType","header"),Em=gi("mceTableColType","th");return C.on("NodeChange ExecCommand TableSelectorChange",la),{onSetupTable:fi,onSetupCellOrRow:Rd,onSetupColumn:uu,onSetupPasteable:Rg,onSetupPasteableColumn:yf,onSetupMergeable:_m,onSetupUnmergeable:Pg,resetTargets:la,onSetupTableWithCaption:$a,onSetupTableRowHeaders:vf,onSetupTableColumnHeaders:Em,targets:A.get}};var km=tinymce.util.Tools.resolve("tinymce.FakeClipboard");const tl="x-tinymce/dom-table-",$d=tl+"rows",nt=tl+"columns",hl=C=>{var A;const H=(A=km.read())!==null&&A!==void 0?A:[];return Ee(H,Q=>W.from(Q.getType(C)))},di=()=>hl($d),mi=()=>hl(nt),bl=C=>A=>{const H=()=>{A.setEnabled(C.selection.isEditable())};return C.on("NodeChange",H),H(),()=>{C.off("NodeChange",H)}},za=(C,A)=>{C.ui.registry.addMenuButton("table",{tooltip:"Table",icon:"table",onSetup:bl(C),fetch:kn=>kn("inserttable | cell row column | advtablesort | tableprops deletetable")});const H=kn=>()=>C.execCommand(kn),Q=(kn,uo)=>{C.queryCommandSupported(uo.command)&&C.ui.registry.addButton(kn,{...uo,onAction:Yt(uo.onAction)?uo.onAction:H(uo.command)})},Le=(kn,uo)=>{C.queryCommandSupported(uo.command)&&C.ui.registry.addToggleButton(kn,{...uo,onAction:Yt(uo.onAction)?uo.onAction:H(uo.command)})};Q("tableprops",{tooltip:"Table properties",command:"mceTableProps",icon:"table",onSetup:A.onSetupTable}),Q("tabledelete",{tooltip:"Delete table",command:"mceTableDelete",icon:"table-delete-table",onSetup:A.onSetupTable}),Q("tablecellprops",{tooltip:"Cell properties",command:"mceTableCellProps",icon:"table-cell-properties",onSetup:A.onSetupCellOrRow}),Q("tablemergecells",{tooltip:"Merge cells",command:"mceTableMergeCells",icon:"table-merge-cells",onSetup:A.onSetupMergeable}),Q("tablesplitcells",{tooltip:"Split cell",command:"mceTableSplitCells",icon:"table-split-cells",onSetup:A.onSetupUnmergeable}),Q("tableinsertrowbefore",{tooltip:"Insert row before",command:"mceTableInsertRowBefore",icon:"table-insert-row-above",onSetup:A.onSetupCellOrRow}),Q("tableinsertrowafter",{tooltip:"Insert row after",command:"mceTableInsertRowAfter",icon:"table-insert-row-after",onSetup:A.onSetupCellOrRow}),Q("tabledeleterow",{tooltip:"Delete row",command:"mceTableDeleteRow",icon:"table-delete-row",onSetup:A.onSetupCellOrRow}),Q("tablerowprops",{tooltip:"Row properties",command:"mceTableRowProps",icon:"table-row-properties",onSetup:A.onSetupCellOrRow}),Q("tableinsertcolbefore",{tooltip:"Insert column before",command:"mceTableInsertColBefore",icon:"table-insert-column-before",onSetup:A.onSetupColumn("onFirst")}),Q("tableinsertcolafter",{tooltip:"Insert column after",command:"mceTableInsertColAfter",icon:"table-insert-column-after",onSetup:A.onSetupColumn("onLast")}),Q("tabledeletecol",{tooltip:"Delete column",command:"mceTableDeleteCol",icon:"table-delete-column",onSetup:A.onSetupColumn("onAny")}),Q("tablecutrow",{tooltip:"Cut row",command:"mceTableCutRow",icon:"cut-row",onSetup:A.onSetupCellOrRow}),Q("tablecopyrow",{tooltip:"Copy row",command:"mceTableCopyRow",icon:"duplicate-row",onSetup:A.onSetupCellOrRow}),Q("tablepasterowbefore",{tooltip:"Paste row before",command:"mceTablePasteRowBefore",icon:"paste-row-before",onSetup:A.onSetupPasteable(di)}),Q("tablepasterowafter",{tooltip:"Paste row after",command:"mceTablePasteRowAfter",icon:"paste-row-after",onSetup:A.onSetupPasteable(di)}),Q("tablecutcol",{tooltip:"Cut column",command:"mceTableCutCol",icon:"cut-column",onSetup:A.onSetupColumn("onAny")}),Q("tablecopycol",{tooltip:"Copy column",command:"mceTableCopyCol",icon:"duplicate-column",onSetup:A.onSetupColumn("onAny")}),Q("tablepastecolbefore",{tooltip:"Paste column before",command:"mceTablePasteColBefore",icon:"paste-column-before",onSetup:A.onSetupPasteableColumn(mi,"onFirst")}),Q("tablepastecolafter",{tooltip:"Paste column after",command:"mceTablePasteColAfter",icon:"paste-column-after",onSetup:A.onSetupPasteableColumn(mi,"onLast")}),Q("tableinsertdialog",{tooltip:"Insert table",command:"mceInsertTableDialog",icon:"table",onSetup:bl(C)});const Bt=_u(ym(C));Bt.length!==0&&C.queryCommandSupported("mceTableToggleClass")&&C.ui.registry.addMenuButton("tableclass",{icon:"table-classes",tooltip:"Table styles",fetch:su(C,Bt,"tableclass",kn=>C.execCommand("mceTableToggleClass",!1,kn)),onSetup:A.onSetupTable});const ln=_u(bm(C));ln.length!==0&&C.queryCommandSupported("mceTableCellToggleClass")&&C.ui.registry.addMenuButton("tablecellclass",{icon:"table-cell-classes",tooltip:"Cell styles",fetch:su(C,ln,"tablecellclass",kn=>C.execCommand("mceTableCellToggleClass",!1,kn)),onSetup:A.onSetupCellOrRow}),C.queryCommandSupported("mceTableApplyCellStyle")&&(C.ui.registry.addMenuButton("tablecellvalign",{icon:"vertical-align",tooltip:"Vertical align",fetch:su(C,gf,"tablecellverticalalign",Uc(C,"vertical-align")),onSetup:A.onSetupCellOrRow}),C.ui.registry.addMenuButton("tablecellborderwidth",{icon:"border-width",tooltip:"Border width",fetch:su(C,Ic(C),"tablecellborderwidth",Uc(C,"border-width")),onSetup:A.onSetupCellOrRow}),C.ui.registry.addMenuButton("tablecellborderstyle",{icon:"border-style",tooltip:"Border style",fetch:su(C,Wl(C),"tablecellborderstyle",Uc(C,"border-style")),onSetup:A.onSetupCellOrRow}),C.ui.registry.addMenuButton("tablecellbackgroundcolor",{icon:"cell-background-color",tooltip:"Background color",fetch:kn=>kn(as(C,pg(C),"background-color")),onSetup:A.onSetupCellOrRow}),C.ui.registry.addMenuButton("tablecellbordercolor",{icon:"cell-border-color",tooltip:"Border color",fetch:kn=>kn(as(C,nu(C),"border-color")),onSetup:A.onSetupCellOrRow})),Le("tablecaption",{tooltip:"Table caption",icon:"table-caption",command:"mceTableToggleCaption",onSetup:A.onSetupTableWithCaption}),Le("tablerowheader",{tooltip:"Row header",icon:"table-top-header",command:"mceTableRowType",onAction:Zu(C),onSetup:A.onSetupTableRowHeaders}),Le("tablecolheader",{tooltip:"Column header",icon:"table-left-header",command:"mceTableColType",onAction:Tg(C),onSetup:A.onSetupTableColumnHeaders})},Ga=C=>{const A=Q=>C.dom.is(Q,"table")&&C.getBody().contains(Q)&&C.dom.isEditable(Q.parentNode),H=Ai(C);H.length>0&&C.ui.registry.addContextToolbar("table",{predicate:A,items:H,scope:"node",position:"node"})},Qy=C=>A=>{const H=()=>{A.setEnabled(C.selection.isEditable())};return C.on("NodeChange",H),H(),()=>{C.off("NodeChange",H)}},yl=(C,A)=>{const H=qs=>()=>C.execCommand(qs),Q=(qs,Fr)=>C.queryCommandSupported(Fr.command)?(C.ui.registry.addMenuItem(qs,{...Fr,onAction:Yt(Fr.onAction)?Fr.onAction:H(Fr.command)}),!0):!1,Le=(qs,Fr)=>{C.queryCommandSupported(Fr.command)&&C.ui.registry.addToggleMenuItem(qs,{...Fr,onAction:Yt(Fr.onAction)?Fr.onAction:H(Fr.command)})},Bt=qs=>{C.execCommand("mceInsertTable",!1,{rows:qs.numRows,columns:qs.numColumns})},ln=[Q("tableinsertrowbefore",{text:"Insert row before",icon:"table-insert-row-above",command:"mceTableInsertRowBefore",onSetup:A.onSetupCellOrRow}),Q("tableinsertrowafter",{text:"Insert row after",icon:"table-insert-row-after",command:"mceTableInsertRowAfter",onSetup:A.onSetupCellOrRow}),Q("tabledeleterow",{text:"Delete row",icon:"table-delete-row",command:"mceTableDeleteRow",onSetup:A.onSetupCellOrRow}),Q("tablerowprops",{text:"Row properties",icon:"table-row-properties",command:"mceTableRowProps",onSetup:A.onSetupCellOrRow}),Q("tablecutrow",{text:"Cut row",icon:"cut-row",command:"mceTableCutRow",onSetup:A.onSetupCellOrRow}),Q("tablecopyrow",{text:"Copy row",icon:"duplicate-row",command:"mceTableCopyRow",onSetup:A.onSetupCellOrRow}),Q("tablepasterowbefore",{text:"Paste row before",icon:"paste-row-before",command:"mceTablePasteRowBefore",onSetup:A.onSetupPasteable(di)}),Q("tablepasterowafter",{text:"Paste row after",icon:"paste-row-after",command:"mceTablePasteRowAfter",onSetup:A.onSetupPasteable(di)})],kn=[Q("tableinsertcolumnbefore",{text:"Insert column before",icon:"table-insert-column-before",command:"mceTableInsertColBefore",onSetup:A.onSetupColumn("onFirst")}),Q("tableinsertcolumnafter",{text:"Insert column after",icon:"table-insert-column-after",command:"mceTableInsertColAfter",onSetup:A.onSetupColumn("onLast")}),Q("tabledeletecolumn",{text:"Delete column",icon:"table-delete-column",command:"mceTableDeleteCol",onSetup:A.onSetupColumn("onAny")}),Q("tablecutcolumn",{text:"Cut column",icon:"cut-column",command:"mceTableCutCol",onSetup:A.onSetupColumn("onAny")}),Q("tablecopycolumn",{text:"Copy column",icon:"duplicate-column",command:"mceTableCopyCol",onSetup:A.onSetupColumn("onAny")}),Q("tablepastecolumnbefore",{text:"Paste column before",icon:"paste-column-before",command:"mceTablePasteColBefore",onSetup:A.onSetupPasteableColumn(mi,"onFirst")}),Q("tablepastecolumnafter",{text:"Paste column after",icon:"paste-column-after",command:"mceTablePasteColAfter",onSetup:A.onSetupPasteableColumn(mi,"onLast")})],uo=[Q("tablecellprops",{text:"Cell properties",icon:"table-cell-properties",command:"mceTableCellProps",onSetup:A.onSetupCellOrRow}),Q("tablemergecells",{text:"Merge cells",icon:"table-merge-cells",command:"mceTableMergeCells",onSetup:A.onSetupMergeable}),Q("tablesplitcells",{text:"Split cell",icon:"table-split-cells",command:"mceTableSplitCells",onSetup:A.onSetupUnmergeable})];Vc(C)?C.ui.registry.addNestedMenuItem("inserttable",{text:"Table",icon:"table",getSubmenuItems:()=>[{type:"fancymenuitem",fancytype:"inserttable",onAction:Bt}],onSetup:Qy(C)}):C.ui.registry.addMenuItem("inserttable",{text:"Table",icon:"table",onAction:H("mceInsertTableDialog"),onSetup:Qy(C)}),C.ui.registry.addMenuItem("inserttabledialog",{text:"Insert table",icon:"table",onAction:H("mceInsertTableDialog"),onSetup:Qy(C)}),Q("tableprops",{text:"Table properties",onSetup:A.onSetupTable,command:"mceTableProps"}),Q("deletetable",{text:"Delete table",icon:"table-delete-table",onSetup:A.onSetupTable,command:"mceTableDelete"}),Qe(ln,!0)&&C.ui.registry.addNestedMenuItem("row",{type:"nestedmenuitem",text:"Row",getSubmenuItems:st("tableinsertrowbefore tableinsertrowafter tabledeleterow tablerowprops | tablecutrow tablecopyrow tablepasterowbefore tablepasterowafter")}),Qe(kn,!0)&&C.ui.registry.addNestedMenuItem("column",{type:"nestedmenuitem",text:"Column",getSubmenuItems:st("tableinsertcolumnbefore tableinsertcolumnafter tabledeletecolumn | tablecutcolumn tablecopycolumn tablepastecolumnbefore tablepastecolumnafter")}),Qe(uo,!0)&&C.ui.registry.addNestedMenuItem("cell",{type:"nestedmenuitem",text:"Cell",getSubmenuItems:st("tablecellprops tablemergecells tablesplitcells")}),C.ui.registry.addContextMenu("table",{update:()=>(A.resetTargets(),A.targets().fold(st(""),qs=>Kt(qs.element)==="caption"?"tableprops deletetable":"cell row column | advtablesort | tableprops deletetable"))});const Zo=_u(ym(C));Zo.length!==0&&C.queryCommandSupported("mceTableToggleClass")&&C.ui.registry.addNestedMenuItem("tableclass",{icon:"table-classes",text:"Table styles",getSubmenuItems:()=>Ns(C,Zo,"tableclass",qs=>C.execCommand("mceTableToggleClass",!1,qs)),onSetup:A.onSetupTable});const la=_u(bm(C));la.length!==0&&C.queryCommandSupported("mceTableCellToggleClass")&&C.ui.registry.addNestedMenuItem("tablecellclass",{icon:"table-cell-classes",text:"Cell styles",getSubmenuItems:()=>Ns(C,la,"tablecellclass",qs=>C.execCommand("mceTableCellToggleClass",!1,qs)),onSetup:A.onSetupCellOrRow}),C.queryCommandSupported("mceTableApplyCellStyle")&&(C.ui.registry.addNestedMenuItem("tablecellvalign",{icon:"vertical-align",text:"Vertical align",getSubmenuItems:()=>Ns(C,gf,"tablecellverticalalign",Uc(C,"vertical-align")),onSetup:A.onSetupCellOrRow}),C.ui.registry.addNestedMenuItem("tablecellborderwidth",{icon:"border-width",text:"Border width",getSubmenuItems:()=>Ns(C,Ic(C),"tablecellborderwidth",Uc(C,"border-width")),onSetup:A.onSetupCellOrRow}),C.ui.registry.addNestedMenuItem("tablecellborderstyle",{icon:"border-style",text:"Border style",getSubmenuItems:()=>Ns(C,Wl(C),"tablecellborderstyle",Uc(C,"border-style")),onSetup:A.onSetupCellOrRow}),C.ui.registry.addNestedMenuItem("tablecellbackgroundcolor",{icon:"cell-background-color",text:"Background color",getSubmenuItems:()=>as(C,pg(C),"background-color"),onSetup:A.onSetupCellOrRow}),C.ui.registry.addNestedMenuItem("tablecellbordercolor",{icon:"cell-border-color",text:"Border color",getSubmenuItems:()=>as(C,nu(C),"border-color"),onSetup:A.onSetupCellOrRow})),Le("tablecaption",{icon:"table-caption",text:"Table caption",command:"mceTableToggleCaption",onSetup:A.onSetupTableWithCaption}),Le("tablerowheader",{text:"Row header",icon:"table-top-header",command:"mceTableRowType",onAction:Zu(C),onSetup:A.onSetupTableRowHeaders}),Le("tablecolheader",{text:"Column header",icon:"table-left-header",command:"mceTableColType",onAction:Tg(C),onSetup:A.onSetupTableRowHeaders})},Nu=C=>{const A=Sm(C);Ir(C),cb(C),yl(C,A),za(C,A),Ga(C)};var wo=()=>{I.add("table",Nu)};wo()}(),function(){const I=Je=>{let bt=Je;return{get:()=>bt,set:To=>{bt=To}}};var _e=tinymce.util.Tools.resolve("tinymce.PluginManager");const ie=Je=>({isEnabled:()=>Je.get()}),He=(Je,bt)=>Je.dispatch("VisualChars",{state:bt}),Re=(Je,bt,yn)=>{var Mn;return yn(Je,bt.prototype)?!0:((Mn=Je.constructor)===null||Mn===void 0?void 0:Mn.name)===bt.name},oe=Je=>{const bt=typeof Je;return Je===null?"null":bt==="object"&&Array.isArray(Je)?"array":bt==="object"&&Re(Je,String,(yn,Mn)=>Mn.isPrototypeOf(yn))?"string":bt},qe=Je=>bt=>oe(bt)===Je,te=Je=>bt=>typeof bt===Je,Ye=Je=>bt=>Je===bt,dt=qe("string"),Jt=qe("object"),wn=Ye(null),Yt=te("boolean"),Qt=Je=>Je==null,Wt=Je=>!Qt(Je),fn=te("number");class st{constructor(bt,yn){this.tag=bt,this.value=yn}static some(bt){return new st(!0,bt)}static none(){return st.singletonNone}fold(bt,yn){return this.tag?yn(this.value):bt()}isSome(){return this.tag}isNone(){return!this.tag}map(bt){return this.tag?st.some(bt(this.value)):st.none()}bind(bt){return this.tag?bt(this.value):st.none()}exists(bt){return this.tag&&bt(this.value)}forall(bt){return!this.tag||bt(this.value)}filter(bt){return!this.tag||bt(this.value)?this:st.none()}getOr(bt){return this.tag?this.value:bt}or(bt){return this.tag?this:bt}getOrThunk(bt){return this.tag?this.value:bt()}orThunk(bt){return this.tag?this:bt()}getOrDie(bt){if(this.tag)return this.value;throw new Error(bt??"Called getOrDie on None")}static from(bt){return Wt(bt)?st.some(bt):st.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(bt){this.tag&&bt(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}st.singletonNone=new st(!1);const it=(Je,bt)=>{const yn=Je.length,Mn=new Array(yn);for(let To=0;To<yn;To++){const is=Je[To];Mn[To]=bt(is,To)}return Mn},Dt=(Je,bt)=>{for(let yn=0,Mn=Je.length;yn<Mn;yn++){const To=Je[yn];bt(To,yn)}},q=(Je,bt)=>{const yn=[];for(let Mn=0,To=Je.length;Mn<To;Mn++){const is=Je[Mn];bt(is,Mn)&&yn.push(is)}return yn},at=Object.keys,Pn=(Je,bt)=>{const yn=at(Je);for(let Mn=0,To=yn.length;Mn<To;Mn++){const is=yn[Mn],Hr=Je[is];bt(Hr,is)}},Et=typeof window<"u"?window:Function("return this;")(),W=(Je,bt)=>{let yn=bt??Et;for(let Mn=0;Mn<Je.length&&yn!==void 0&&yn!==null;++Mn)yn=yn[Je[Mn]];return yn},Ut=(Je,bt)=>{const yn=Je.split(".");return W(yn,bt)},cn=(Je,bt)=>Ut(Je,bt),St=(Je,bt)=>{const yn=cn(Je,bt);if(yn==null)throw new Error(Je+" not available on this browser");return yn},Ue=Object.getPrototypeOf,ce=Je=>St("HTMLElement",Je),Zn=Je=>{const bt=Ut("ownerDocument.defaultView",Je);return Jt(Je)&&(ce(bt).prototype.isPrototypeOf(Je)||/^HTML\w*Element$/.test(Ue(Je).constructor.name))},Ie=1,pe=3,S=Je=>Je.dom.nodeType,je=Je=>Je.dom.nodeValue,me=Je=>bt=>S(bt)===Je,kt=Je=>Rt(Je)&&Zn(Je.dom),Rt=me(Ie),we=me(pe),Nt=(Je,bt,yn)=>{if(dt(yn)||Yt(yn)||fn(yn))Je.setAttribute(bt,yn+"");else throw console.error("Invalid call to Attribute.set. Key ",bt,":: Value ",yn,":: Element ",Je),new Error("Attribute value was not simple")},bn=(Je,bt,yn)=>{Nt(Je.dom,bt,yn)},Qe=(Je,bt)=>{const yn=Je.dom.getAttribute(bt);return yn===null?void 0:yn},Zt=(Je,bt)=>{Je.dom.removeAttribute(bt)},Oe=(Je,bt)=>{const yn=Qe(Je,bt);return yn===void 0||yn===""?[]:yn.split(" ")},ot=(Je,bt,yn)=>{const To=Oe(Je,bt).concat([yn]);return bn(Je,bt,To.join(" ")),!0},F=(Je,bt,yn)=>{const Mn=q(Oe(Je,bt),To=>To!==yn);return Mn.length>0?bn(Je,bt,Mn.join(" ")):Zt(Je,bt),!1},po=Je=>Je.dom.classList!==void 0,ht=Je=>Oe(Je,"class"),Pt=(Je,bt)=>ot(Je,"class",bt),an=(Je,bt)=>F(Je,"class",bt),so=(Je,bt)=>{po(Je)?Je.dom.classList.add(bt):Pt(Je,bt)},le=Je=>{(po(Je)?Je.dom.classList:ht(Je)).length===0&&Zt(Je,"class")},Ne=(Je,bt)=>{po(Je)?Je.dom.classList.remove(bt):an(Je,bt),le(Je)},ke=(Je,bt)=>{const Mn=(bt||document).createElement("div");if(Mn.innerHTML=Je,!Mn.hasChildNodes()||Mn.childNodes.length>1){const To="HTML does not have a single root node";throw console.error(To,Je),new Error(To)}return xe(Mn.childNodes[0])},Y=(Je,bt)=>{const Mn=(bt||document).createElement(Je);return xe(Mn)},re=(Je,bt)=>{const Mn=(bt||document).createTextNode(Je);return xe(Mn)},xe=Je=>{if(Je==null)throw new Error("Node cannot be null or undefined");return{dom:Je}},$e={fromHtml:ke,fromTag:Y,fromText:re,fromDom:xe,fromPoint:(Je,bt,yn)=>st.from(Je.dom.elementFromPoint(bt,yn)).map(xe)},G={" ":"nbsp","":"shy"},Ee=(Je,bt)=>{let yn="";return Pn(Je,(Mn,To)=>{yn+=To}),new RegExp("["+yn+"]",bt?"g":"")},ze=Je=>{let bt="";return Pn(Je,yn=>{bt&&(bt+=","),bt+="span.mce-"+yn}),bt},Mt=Ee(G),Nn=Ee(G,!0),Rn=ze(G),Wn="mce-nbsp",zn=Je=>Je.dom.contentEditable,Do=Je=>'<span data-mce-bogus="1" class="mce-'+G[Je]+'">'+Je+"</span>",Xe=Je=>Je.nodeName.toLowerCase()==="span"&&Je.classList.contains("mce-nbsp-wrap"),lt=Je=>{const bt=je(Je);return we(Je)&&dt(bt)&&Mt.test(bt)},At=Je=>kt(Je)&&zn(Je)==="false",Ft=(Je,bt)=>{if(kt(Je)&&!Xe(Je.dom)){const yn=zn(Je);if(yn==="true")return!0;if(yn==="false")return!1}return bt},$n=(Je,bt,yn)=>{let Mn=[];const To=Je.dom,is=it(To.childNodes,$e.fromDom),Hr=Ur=>Xe(Ur.dom)||!At(Ur);return Dt(is,Ur=>{yn&&Hr(Ur)&&bt(Ur)&&(Mn=Mn.concat([Ur])),Mn=Mn.concat($n(Ur,bt,Ft(Ur,yn)))}),Mn},xo=(Je,bt)=>{for(;Je.parentNode;){if(Je.parentNode===bt)return bt;Je=Je.parentNode}},vo=Je=>Je.replace(Nn,Do),fs=(Je,bt)=>{const yn=Je.dom,Mn=$n($e.fromDom(bt),lt,Je.dom.isEditable(bt));Dt(Mn,To=>{var is;const Hr=To.dom.parentNode;if(Xe(Hr))so($e.fromDom(Hr),Wn);else{const Ur=vo(yn.encode((is=je(To))!==null&&is!==void 0?is:"")),pr=yn.create("div",{},Ur);let Ce;for(;Ce=pr.lastChild;)yn.insertAfter(Ce,To.dom);Je.dom.remove(To.dom)}})},Bo=(Je,bt)=>{const yn=Je.dom.select(Rn,bt);Dt(yn,Mn=>{Xe(Mn)?Ne($e.fromDom(Mn),Wn):Je.dom.remove(Mn,!0)})},Es=Je=>{const bt=Je.getBody(),yn=Je.selection.getBookmark();let Mn=xo(Je.selection.getNode(),bt);Mn=Mn!==void 0?Mn:bt,Bo(Je,Mn),fs(Je,Mn),Je.selection.moveToBookmark(yn)},Kt=(Je,bt)=>{He(Je,bt.get());const yn=Je.getBody();bt.get()===!0?fs(Je,yn):Bo(Je,yn)},Vo=(Je,bt)=>{bt.set(!bt.get());const yn=Je.selection.getBookmark();Kt(Je,bt),Je.selection.moveToBookmark(yn)},tr=(Je,bt)=>{Je.addCommand("mceVisualChars",()=>{Vo(Je,bt)})},Vr=Je=>bt=>bt.options.get(Je),Rr=Je=>{const bt=Je.options.register;bt("visualchars_default_state",{processor:"boolean",default:!1})},kr=Vr("visualchars_default_state"),Cs=(Je,bt)=>{Je.on("init",()=>{Kt(Je,bt)})},zr=(Je,bt)=>{let yn=null;return{cancel:()=>{wn(yn)||(clearTimeout(yn),yn=null)},throttle:(...is)=>{wn(yn)&&(yn=setTimeout(()=>{yn=null,Je.apply(null,is)},bt))}}},Qr=(Je,bt)=>{const yn=zr(()=>{Es(Je)},300);Je.on("keydown",Mn=>{bt.get()===!0&&(Mn.keyCode===13?Es(Je):yn.throttle())}),Je.on("remove",yn.cancel)},Ts=(Je,bt)=>yn=>{yn.setActive(bt.get());const Mn=To=>yn.setActive(To.state);return Je.on("VisualChars",Mn),()=>Je.off("VisualChars",Mn)},ao=(Je,bt)=>{const yn=()=>Je.execCommand("mceVisualChars");Je.ui.registry.addToggleButton("visualchars",{tooltip:"Show invisible characters",icon:"visualchars",onAction:yn,onSetup:Ts(Je,bt)}),Je.ui.registry.addToggleMenuItem("visualchars",{text:"Show invisible characters",icon:"visualchars",onAction:yn,onSetup:Ts(Je,bt)})};var ur=()=>{_e.add("visualchars",Je=>{Rr(Je);const bt=I(kr(Je));return tr(Je,bt),ao(Je,bt),Qr(Je,bt),Cs(Je,bt),ie(bt)})};ur()}();const LZ={class:"font-bold ptext-lg dark:text-white"},VZ=["id"],zZ=p.createElementVNode("hr",{class:"!opacity-100 bg-gray-200 border-0 dark:bg-gray-700"},null,-1),HZ=["for"],UZ=["name","id","type"],WZ={class:"gl-span-form-error"},jZ={class:"block mt-1 text-sm font-normal leading-5 text-gray-500"},GZ={__name:"GlTinymce",props:{is_required:{type:Boolean,default:!1},show:{type:Boolean,default:!1},error_message:{type:String,default:""},model_value:{type:[String,Number],default:null},modelValue:{type:[String,Number],default:""},type:{type:String,default:"text"},field_name:{type:String,default:""},label_name:{type:String,default:""},description:{type:String,default:""}},emits:["update:modelValue","keydown"],setup(I,{expose:_e,emit:ie}){const He=I,Re=ie,oe=p.ref(null);let qe=null;const te=async()=>{await p.nextTick(),IZ.init({selector:"#"+He.field_name,height:500,plugins:["advlist autolink lists link image charmap print preview anchor","searchreplace visualblocks codesample fullscreen","insertdatetime media table paste help wordcount"],toolbar:"undo redo | codesample | formatselect | bold italic backcolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | removeformat | help",skin:!1,content_css:!1,setup(dt){qe=dt,dt.on("Change",()=>{Re("update:modelValue",dt.getContent())}),dt.on("init",()=>{dt.setContent(He.modelValue)})}})};p.onMounted(te),p.watch(()=>He.modelValue,dt=>{qe&&qe.getContent()!==dt&&qe.setContent(dt)});const Ye=p.computed({get(){return He.modelValue},set(dt){Re("update:modelValue",dt)}});return _e({focus:()=>oe.value.focus()}),(dt,Jt)=>(p.openBlock(),p.createElementBlock(p.Fragment,null,[I.show?(p.openBlock(),p.createElementBlock("div",{key:0,class:p.normalizeClass(I.field_name)},[p.createElementVNode("h3",LZ,p.toDisplayString(I.label_name),1),p.createElementVNode("p",{id:I.field_name,class:"mb-4 text-base text-gray-900 input_tr_show dark:text-white"},p.toDisplayString(I.model_value),9,VZ),zZ],2)):p.createCommentVNode("",!0),I.show?p.createCommentVNode("",!0):(p.openBlock(),p.createElementBlock("div",{key:1,class:p.normalizeClass(["mb-4",I.field_name])},[p.createElementVNode("label",{class:p.normalizeClass({"gl-label-form":I.error_message=="","gl-label-form-invalid":I.error_message!=="",required:I.is_required}),for:I.field_name},p.toDisplayString(I.label_name),11,HZ),p.withDirectives(p.createElementVNode("textarea",{name:I.field_name,id:I.field_name,class:p.normalizeClass(["tiny",{"gl-textarea-form mt-4":I.error_message=="","gl-textarea-form-invalid mt-4":I.error_message!==""}]),type:I.type,"onUpdate:modelValue":Jt[0]||(Jt[0]=wn=>Ye.value=wn),onKeydown:Jt[1]||(Jt[1]=wn=>dt.$emit("keydown",wn)),ref_key:"input",ref:oe,rows:"4"},null,42,UZ),[[p.vModelText,Ye.value]]),p.createElementVNode("span",WZ,p.toDisplayString(I.error_message),1),p.createElementVNode("small",jZ,p.toDisplayString(I.description),1)],2))],64))}},qZ={compatConfig:{MODE:3},inheritAttrs:!1,emits:["pagination-change-page"],components:{RenderlessPagination:{emits:["pagination-change-page"],props:{data:{type:Object,default:()=>{}},limit:{type:Number,default:0}},computed:{isApiResource(){return!!this.data.meta},currentPage(){return this.isApiResource?this.data.meta.current_page:this.data.current_page},firstPageUrl(){return this.isApiResource?this.data.links.first:null},from(){return this.isApiResource?this.data.meta.from:this.data.from},lastPage(){return this.isApiResource?this.data.meta.last_page:this.data.last_page},lastPageUrl(){return this.isApiResource?this.data.links.last:null},nextPageUrl(){return this.isApiResource?this.data.links.next:this.data.next_page_url},perPage(){return this.isApiResource?this.data.meta.per_page:this.data.per_page},prevPageUrl(){return this.isApiResource?this.data.links.prev:this.data.prev_page_url},to(){return this.isApiResource?this.data.meta.to:this.data.to},total(){return this.isApiResource?this.data.meta.total:this.data.total},pageRange(){if(this.limit===-1)return 0;if(this.limit===0)return this.lastPage;for(var I=this.currentPage,_e=this.lastPage,ie=this.limit,He=I-ie,Re=I+ie+1,oe=[],qe=[],te,Ye=1;Ye<=_e;Ye++)(Ye===1||Ye===_e||Ye>=He&&Ye<Re)&&oe.push(Ye);return oe.forEach(function(dt){te&&(dt-te===2?qe.push(te+1):dt-te!==1&&qe.push("...")),qe.push(dt),te=dt}),qe}},methods:{previousPage(){this.selectPage(this.currentPage-1)},nextPage(){this.selectPage(this.currentPage+1)},selectPage(I){I!=="..."&&this.$emit("pagination-change-page",I)}},render(){return this.$slots.default({data:this.data,limit:this.limit,computed:{isApiResource:this.isApiResource,currentPage:this.currentPage,firstPageUrl:this.firstPageUrl,from:this.from,lastPage:this.lastPage,lastPageUrl:this.lastPageUrl,nextPageUrl:this.nextPageUrl,perPage:this.perPage,prevPageUrl:this.prevPageUrl,to:this.to,total:this.total,pageRange:this.pageRange},prevButtonEvents:{click:I=>{I.preventDefault(),this.previousPage()}},nextButtonEvents:{click:I=>{I.preventDefault(),this.nextPage()}},pageButtonEvents:I=>({click:_e=>{_e.preventDefault(),this.selectPage(I)}})})}}},props:{data:{type:Object,default:()=>{}},limit:{type:Number,default:0},showDisabled:{type:Boolean,default:!1},size:{type:String,default:"default",validator:I=>["small","default","large"].indexOf(I)!==-1},align:{type:String,default:"left",validator:I=>["left","center","right"].indexOf(I)!==-1}},methods:{onPaginationChangePage(I){this.$emit("pagination-change-page",I)}},mounted(){}},KZ={class:"flex flex-col items-center"},YZ={key:0,class:"text-sm text-gray-700 dark:text-gray-400"},XZ={class:"font-semibold text-gray-900 dark:text-white"},ZZ={class:"font-semibold text-gray-900 dark:text-white"},JZ={class:"font-semibold text-gray-900 dark:text-white"},QZ=["tabindex"],eJ=p.createElementVNode("span",{class:"sr-only"},"Previous",-1),tJ=p.createElementVNode("svg",{class:"w-2.5 h-2.5 rtl:rotate-180","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 6 10"},[p.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 1 1 5l4 4"})],-1),nJ=["aria-current"],oJ=["tabindex"],sJ=p.createElementVNode("span",{class:"sr-only"},"Next",-1),rJ=p.createElementVNode("svg",{class:"w-2.5 h-2.5 rtl:rotate-180","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 6 10"},[p.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m1 9 4-4-4-4"})],-1);function aJ(I,_e,ie,He,Re,oe){const qe=p.resolveComponent("RenderlessPagination");return p.openBlock(),p.createBlock(qe,{data:ie.data,limit:ie.limit,onPaginationChangePage:oe.onPaginationChangePage},{default:p.withCtx(te=>[p.createElementVNode("div",KZ,[te.computed.total>te.computed.perPage?(p.openBlock(),p.createElementBlock("span",YZ,[p.createTextVNode(" Showing "),p.createElementVNode("span",XZ,p.toDisplayString(te.computed.from),1),p.createTextVNode(" to "),p.createElementVNode("span",ZZ,p.toDisplayString(te.computed.to),1),p.createTextVNode(" of "),p.createElementVNode("span",JZ,p.toDisplayString(te.computed.total),1),p.createTextVNode(" Entries ")])):p.createCommentVNode("",!0),te.computed.total>te.computed.perPage?(p.openBlock(),p.createElementBlock("ul",p.mergeProps({key:1},I.$attrs,{class:["flex items-center h-8 -space-x-px text-sm",{"pagination-sm":ie.size=="small","pagination-lg":ie.size=="large","justify-content-center":ie.align=="center","justify-content-end":ie.align=="right"}]}),[te.computed.prevPageUrl||ie.showDisabled?(p.openBlock(),p.createElementBlock("li",{key:0,class:p.normalizeClass(["flex items-center justify-center h-8 px-3 leading-tight text-gray-500 bg-white border border-gray-300 ms-0 border-e-0 rounded-s-lg hover:bg-gray-100 hover:text-gray-700 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white",{disabled:!te.computed.prevPageUrl}])},[p.createElementVNode("a",p.mergeProps({class:"page-link",href:"#","aria-label":"Previous",tabindex:!te.computed.prevPageUrl&&-1},p.toHandlers(te.prevButtonEvents,!0)),[p.renderSlot(I.$slots,"prev-nav",{},()=>[eJ,tJ])],16,QZ)],2)):p.createCommentVNode("",!0),(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(te.computed.pageRange,(Ye,dt)=>(p.openBlock(),p.createElementBlock("li",{class:p.normalizeClass(["",{active:Ye==te.computed.currentPage}]),key:dt},[p.createElementVNode("a",p.mergeProps({class:"",href:"#"},p.toHandlers(te.pageButtonEvents(Ye),!0),{"aria-current":Ye==te.computed.currentPage?"page":null,class:Ye==te.computed.currentPage?"z-10 flex items-center justify-center px-3 h-8 leading-tight text-blue-600 border border-blue-300 bg-blue-50 hover:bg-blue-100 hover:text-blue-700 dark:border-gray-700 dark:bg-gray-700 dark:text-white":"flex items-center justify-center px-3 h-8 leading-tight text-gray-500 bg-white border border-gray-300 hover:bg-gray-100 hover:text-gray-700 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white"}),p.toDisplayString(Ye),17,nJ)],2))),128)),te.computed.nextPageUrl||ie.showDisabled?(p.openBlock(),p.createElementBlock("li",{key:1,class:p.normalizeClass(["flex items-center justify-center h-8 px-3 leading-tight text-gray-500 bg-white border border-gray-300 rounded-e-lg hover:bg-gray-100 hover:text-gray-700 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white",{disabled:!te.computed.nextPageUrl}])},[p.createElementVNode("a",p.mergeProps({class:"",href:"#","aria-label":"Next",tabindex:!te.computed.nextPageUrl&&-1},p.toHandlers(te.nextButtonEvents,!0)),[p.renderSlot(I.$slots,"next-nav",{},()=>[sJ,rJ])],16,oJ)],2)):p.createCommentVNode("",!0)],16)):p.createCommentVNode("",!0)])]),_:3},8,["data","limit","onPaginationChangePage"])}const S3=fc(qZ,[["render",aJ]]),cJ={components:{TailwindPagination:S3},props:{data:Array,columns:Array,get_item_url:String,xprops:Object,refreshData:Boolean},data(){return{isLoading:!1,isMounted:!1,limit:5,showDisabled:!1,size:"default",align:"left",search:"",isDropdownOpen:!1,itemLists:[],tableData:[],sortField:this.columns[0].field_name,sortOrder:"desc",pageOptions:[5,10,20,50],perPage:5,page:1}},emits:["editAction","generalAction"],computed:{filteredData(){const I=this.search.toLowerCase();return this.sortData(this.data).filter(ie=>Object.values(ie).some(He=>He.toString().toLowerCase().includes(I)))}},methods:{editAction(I){this.$emit("editAction",I)},generalAction(I){this.$emit("generalAction",I)},forDynCompIs(I){return typeof I=="object"?I:null},GetItemLists(I=1){this.isLoading=!0,this.page=I;const _e={sort:this.sortField,order:this.sortOrder,s:this.search,limit:this.perPage,page:this.page};axios.get(this.xprops.route_get_data,{params:_e}).then(ie=>{this.itemLists=ie.data,this.isLoading=!1}).catch(ie=>{console.error(ie),this.isLoading=!1})},updateSortColumn(I,_e){_e&&(I===this.sortField?this.sortOrder=this.sortOrder==="asc"?"desc":"asc":(this.sortField=I,this.sortOrder="asc"),this.GetItemLists(this.page))},handleSearch(){this.sortField=this.columns[0].field_name,this.sortOrder="asc",this.page=1,this.GetItemLists(this.page)}},mounted(){this.GetItemLists(),this.isMounted=!0},watch:{searchFilter(){this.filteredOptions.length===0?this.selected={}:this.selected=this.filteredOptions[0]},perPage(I){this.page=1,this.perPage=I,this.GetItemLists(this.page)},refreshData(I,_e){this.isMounted&&I!==_e&&this.GetItemLists()}}},lJ={class:"p-2"},iJ={class:"flex flex-col flex-wrap pb-4 space-y-4 xl:flex-row xl:items-center xl:justify-between flex-column sm:space-y-0"},uJ={class:"flex items-center gap-2"},dJ=p.createElementVNode("span",{class:"font-medium"}," Show ",-1),mJ={style:{"margin-top":"9px"}},fJ=p.createElementVNode("span",{class:"font-medium"}," Entries ",-1),gJ=p.createElementVNode("label",{for:"table-search",class:"sr-only"},"Search",-1),pJ={class:"relative"},hJ=p.createElementVNode("div",{class:"absolute inset-y-0 left-0 flex items-center pointer-events-none rtl:inset-r-0 rtl:right-0 ps-3"},[p.createElementVNode("svg",{class:"w-5 h-5 text-gray-500 dark:text-gray-400","aria-hidden":"true",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("path",{"fill-rule":"evenodd",d:"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z","clip-rule":"evenodd"})])],-1),bJ={class:"overflow-auto rounded-lg dark:text-gray-400 dark:bg-gray-800"},yJ={class:"w-full h-full max-w-full overflow-hidden bg-white border-separate xl:overflow-auto lg:border-collapse border-spacing-y-3 lg:border-spacing-y-0 dark:border-strokedark dark:bg-boxdark"},vJ={class:"hidden text-sm font-normal text-center text-gray-500 lg:table-header-group dark:border-strokedark bg-gray-50 dark:bg-gray-700 dark:text-gray-400"},wJ=["onClick"],xJ={key:0,class:"ml-2"},CJ={key:0,class:"fa fa-arrow-up"},SJ={key:1,class:"fa fa-arrow-down"},kJ={key:0},_J=["colspan"],EJ=[p.createElementVNode("div",{role:"status",class:"p-4 space-y-4 border border-gray-200 divide-y divide-gray-200 rounded shadow animate-pulse dark:divide-gray-700 md:p-6 dark:border-gray-700"},[p.createElementVNode("div",{class:"flex items-center justify-between"},[p.createElementVNode("div",null,[p.createElementVNode("div",{class:"h-3 bg-gray-300 rounded-full dark:bg-gray-600 w-24 mb-3"}),p.createElementVNode("div",{class:"w-32 h-2 bg-gray-200 rounded-full dark:bg-gray-700"})]),p.createElementVNode("div",{class:"h-3 bg-gray-300 rounded-full dark:bg-gray-700 w-12"})]),p.createElementVNode("div",{class:"flex items-center justify-between pt-4"},[p.createElementVNode("div",null,[p.createElementVNode("div",{class:"h-3 bg-gray-300 rounded-full dark:bg-gray-600 w-24 mb-3"}),p.createElementVNode("div",{class:"w-32 h-2 bg-gray-200 rounded-full dark:bg-gray-700"})]),p.createElementVNode("div",{class:"h-3 bg-gray-300 rounded-full dark:bg-gray-700 w-12"})]),p.createElementVNode("div",{class:"flex items-center justify-between pt-4"},[p.createElementVNode("div",null,[p.createElementVNode("div",{class:"h-3 bg-gray-300 rounded-full dark:bg-gray-600 w-24 mb-3"}),p.createElementVNode("div",{class:"w-32 h-2 bg-gray-200 rounded-full dark:bg-gray-700"})]),p.createElementVNode("div",{class:"h-3 bg-gray-300 rounded-full dark:bg-gray-700 w-12"})]),p.createElementVNode("div",{class:"flex items-center justify-between pt-4"},[p.createElementVNode("div",null,[p.createElementVNode("div",{class:"h-3 bg-gray-300 rounded-full dark:bg-gray-600 w-24 mb-3"}),p.createElementVNode("div",{class:"w-32 h-2 bg-gray-200 rounded-full dark:bg-gray-700"})]),p.createElementVNode("div",{class:"h-3 bg-gray-300 rounded-full dark:bg-gray-700 w-12"})]),p.createElementVNode("div",{class:"flex items-center justify-between pt-4"},[p.createElementVNode("div",null,[p.createElementVNode("div",{class:"h-3 bg-gray-300 rounded-full dark:bg-gray-600 w-24 mb-3"}),p.createElementVNode("div",{class:"w-32 h-2 bg-gray-200 rounded-full dark:bg-gray-700"})]),p.createElementVNode("div",{class:"h-3 bg-gray-300 rounded-full dark:bg-gray-700 w-12"})]),p.createElementVNode("span",{class:"sr-only"},"Loading...")],-1)],TJ=["data-label"],AJ={class:"overflow-auto max-h-40"},DJ={class:"flex items-center justify-between px-4 py-3 bg-white border-gray-200 sm:px-6 dark:text-gray-400 dark:bg-gray-800"};function NJ(I,_e,ie,He,Re,oe){const qe=p.resolveComponent("dropdown"),te=p.resolveComponent("TailwindPagination");return p.openBlock(),p.createElementBlock("div",lJ,[p.createElementVNode("div",iJ,[p.createElementVNode("div",uJ,[dJ,p.createElementVNode("div",mJ,[p.createVNode(qe,{has_cancel:!1,options:Re.pageOptions,modelValue:Re.perPage,"onUpdate:modelValue":_e[0]||(_e[0]=Ye=>Re.perPage=Ye),is_required:!1,field_name:"perPage",label_name:"",default_value:5,show:!1,placeholder:"Please select an option"},null,8,["options","modelValue"])]),fJ]),gJ,p.createElementVNode("div",pJ,[hJ,p.withDirectives(p.createElementVNode("input",{type:"text","onUpdate:modelValue":_e[1]||(_e[1]=Ye=>Re.search=Ye),onInput:_e[2]||(_e[2]=Ye=>oe.handleSearch()),class:"block w-full p-2 text-sm text-gray-900 border border-gray-300 rounded-lg ps-10 bg-gray-50 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder:"Search ..."},null,544),[[p.vModelText,Re.search]])])]),p.createElementVNode("div",bJ,[p.createElementVNode("table",yJ,[p.createElementVNode("thead",vJ,[p.createElementVNode("tr",null,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(ie.columns,(Ye,dt)=>(p.openBlock(),p.createElementBlock("th",{key:dt,onClick:Jt=>oe.updateSortColumn(Ye.field_name,Ye.sortable),class:"w-full px-4 py-2 lg:w-2/12"},[p.createTextVNode(p.toDisplayString(Ye.field_label)+" ",1),Re.sortField===Ye.field_name?(p.openBlock(),p.createElementBlock("span",xJ,[Re.sortOrder==="asc"?(p.openBlock(),p.createElementBlock("i",CJ)):(p.openBlock(),p.createElementBlock("i",SJ))])):p.createCommentVNode("",!0)],8,wJ))),128))])]),p.createElementVNode("tbody",null,[Re.isLoading?(p.openBlock(),p.createElementBlock("tr",kJ,[p.createElementVNode("td",{colspan:ie.columns.length},EJ,8,_J)])):p.createCommentVNode("",!0),Re.isLoading?p.createCommentVNode("",!0):(p.openBlock(!0),p.createElementBlock(p.Fragment,{key:1},p.renderList(Re.itemLists.data,(Ye,dt)=>(p.openBlock(),p.createElementBlock("tr",{key:dt,class:"bg-white dark:bg-gray-800 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-600 hover:dark:text-gray-200 text-gray-500"},[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(ie.columns,(Jt,wn)=>(p.openBlock(),p.createElementBlock("td",{key:wn,"data-label":Jt.field_label,class:"text-pretty before:content-[attr(data-label)] before:font-bold lg:before:content-none flex md:flex-row flex-col justify-between gap-2 lg:table-cell py-4 px-5 lg:py-2.5 lg:px-4 border dark:border-gray-700"},[p.createElementVNode("div",AJ,[Jt.tdComp?(p.openBlock(),p.createBlock(p.resolveDynamicComponent(oe.forDynCompIs(Jt.tdComp)),{key:0,row:Ye,field:Jt.field_name,xprops:ie.xprops,tdProps:Jt.tdProps,onDeleteAction:_e[3]||(_e[3]=Yt=>oe.GetItemLists()),onEditAction:Yt=>oe.editAction(Ye),onGeneralAction:Yt=>oe.generalAction(Ye)},null,40,["row","field","xprops","tdProps","onEditAction","onGeneralAction"])):(p.openBlock(),p.createElementBlock(p.Fragment,{key:1},[p.createTextVNode(p.toDisplayString(Ye[Jt.field_name]),1)],64))])],8,TJ))),128))]))),128))])])]),p.createElementVNode("div",DJ,[p.createVNode(te,{class:"mt-3 mb-0",data:Re.itemLists,limit:Re.limit,size:Re.size,align:Re.align,onPaginationChangePage:oe.GetItemLists},null,8,["data","limit","size","align","onPaginationChangePage"])])])}const OJ=fc(cJ,[["render",NJ]]),BJ={components:{TailwindPagination:S3},props:{data:Array,columns:Array,get_item_url:String,xprops:Object,refreshData:Boolean,groupField:String},data(){return{isLoading:!1,isMounted:!1,limit:5,showDisabled:!1,size:"default",align:"left",search:"",isDropdownOpen:!1,itemLists:[],tableData:[],sortField:this.columns[0].field_name,sortOrder:"desc",pageOptions:[5,10,20,50],perPage:5,page:1}},emits:["editAction"],computed:{filteredData(){const I=this.search.toLowerCase();return this.sortData(this.data).filter(ie=>Object.values(ie).some(He=>He.toString().toLowerCase().includes(I)))},groupedItems(){return this.groupBy(this.groupField)}},methods:{groupBy(I){return this.itemLists.data?this.itemLists.data.reduce((_e,ie)=>{const He=ie[I];_e[He]||(_e[He]=[]);const Re={...ie};return delete Re[I],_e[He].push(Re),_e},{}):[]},editAction(I){this.$emit("editAction",I)},forDynCompIs(I){return typeof I=="object"?I:null},GetItemLists(I=1){this.isLoading=!0,this.page=I;const _e={sort:this.sortField,order:this.sortOrder,s:this.search,limit:this.perPage,page:this.page};axios.get(this.xprops.route_get_data,{params:_e}).then(ie=>{this.itemLists=ie.data,this.isLoading=!1}).catch(ie=>{console.error(ie),this.isLoading=!1})},updateSortColumn(I,_e){_e&&(I===this.sortField?this.sortOrder=this.sortOrder==="asc"?"desc":"asc":(this.sortField=I,this.sortOrder="asc"),this.GetItemLists(this.page))},handleSearch(){this.sortField=this.columns[0].field_name,this.sortOrder="asc",this.page=1,this.GetItemLists(this.page)}},mounted(){this.GetItemLists(),this.isMounted=!0},watch:{searchFilter(){this.filteredOptions.length===0?this.selected={}:this.selected=this.filteredOptions[0]},perPage(I){this.page=1,this.perPage=I,this.GetItemLists(this.page)},refreshData(I,_e){this.isMounted&&I!==_e&&this.GetItemLists()}}},$J={class:"p-2"},RJ={class:"flex flex-col flex-wrap pb-4 space-y-4 xl:flex-row xl:items-center xl:justify-between flex-column sm:space-y-0"},PJ={class:"flex items-center gap-2"},FJ=p.createElementVNode("span",{class:"font-medium"}," Show ",-1),MJ={style:{"margin-top":"9px"}},IJ=p.createElementVNode("span",{class:"font-medium"}," Entries ",-1),LJ=p.createElementVNode("label",{for:"table-search",class:"sr-only"},"Search",-1),VJ={class:"relative"},zJ=p.createElementVNode("div",{class:"absolute inset-y-0 left-0 flex items-center pointer-events-none rtl:inset-r-0 rtl:right-0 ps-3"},[p.createElementVNode("svg",{class:"w-5 h-5 text-gray-500 dark:text-gray-400","aria-hidden":"true",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("path",{"fill-rule":"evenodd",d:"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z","clip-rule":"evenodd"})])],-1),HJ={class:"overflow-auto rounded-lg dark:text-gray-400 dark:bg-gray-800"},UJ={class:"w-full h-full max-w-full overflow-hidden bg-white border-separate xl:overflow-auto lg:border-collapse border-spacing-y-3 lg:border-spacing-y-0 dark:border-strokedark dark:bg-boxdark"},WJ={class:"hidden text-sm font-normal text-center text-gray-500 lg:table-header-group dark:border-strokedark bg-gray-50 dark:bg-gray-700 dark:text-gray-400"},jJ=["onClick"],GJ={key:0,class:"ml-2"},qJ={key:0,class:"fa fa-arrow-up"},KJ={key:1,class:"fa fa-arrow-down"},YJ={key:0},XJ=["colspan"],ZJ=[p.createElementVNode("div",{role:"status",class:"p-4 space-y-4 border border-gray-200 divide-y divide-gray-200 rounded shadow animate-pulse dark:divide-gray-700 md:p-6 dark:border-gray-700"},[p.createElementVNode("div",{class:"flex items-center justify-between"},[p.createElementVNode("div",null,[p.createElementVNode("div",{class:"h-3 bg-gray-300 rounded-full dark:bg-gray-600 w-24 mb-3"}),p.createElementVNode("div",{class:"w-32 h-2 bg-gray-200 rounded-full dark:bg-gray-700"})]),p.createElementVNode("div",{class:"h-3 bg-gray-300 rounded-full dark:bg-gray-700 w-12"})]),p.createElementVNode("div",{class:"flex items-center justify-between pt-4"},[p.createElementVNode("div",null,[p.createElementVNode("div",{class:"h-3 bg-gray-300 rounded-full dark:bg-gray-600 w-24 mb-3"}),p.createElementVNode("div",{class:"w-32 h-2 bg-gray-200 rounded-full dark:bg-gray-700"})]),p.createElementVNode("div",{class:"h-3 bg-gray-300 rounded-full dark:bg-gray-700 w-12"})]),p.createElementVNode("div",{class:"flex items-center justify-between pt-4"},[p.createElementVNode("div",null,[p.createElementVNode("div",{class:"h-3 bg-gray-300 rounded-full dark:bg-gray-600 w-24 mb-3"}),p.createElementVNode("div",{class:"w-32 h-2 bg-gray-200 rounded-full dark:bg-gray-700"})]),p.createElementVNode("div",{class:"h-3 bg-gray-300 rounded-full dark:bg-gray-700 w-12"})]),p.createElementVNode("div",{class:"flex items-center justify-between pt-4"},[p.createElementVNode("div",null,[p.createElementVNode("div",{class:"h-3 bg-gray-300 rounded-full dark:bg-gray-600 w-24 mb-3"}),p.createElementVNode("div",{class:"w-32 h-2 bg-gray-200 rounded-full dark:bg-gray-700"})]),p.createElementVNode("div",{class:"h-3 bg-gray-300 rounded-full dark:bg-gray-700 w-12"})]),p.createElementVNode("div",{class:"flex items-center justify-between pt-4"},[p.createElementVNode("div",null,[p.createElementVNode("div",{class:"h-3 bg-gray-300 rounded-full dark:bg-gray-600 w-24 mb-3"}),p.createElementVNode("div",{class:"w-32 h-2 bg-gray-200 rounded-full dark:bg-gray-700"})]),p.createElementVNode("div",{class:"h-3 bg-gray-300 rounded-full dark:bg-gray-700 w-12"})]),p.createElementVNode("span",{class:"sr-only"},"Loading...")],-1)],JJ={class:"bg-white dark:bg-gray-800 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-600 hover:dark:text-gray-200 text-gray-500"},QJ=["colspan"],eQ=["data-label"],tQ={class:"overflow-auto max-h-40"},nQ={class:"flex items-center justify-between px-4 py-3 bg-white border-gray-200 sm:px-6 dark:text-gray-400 dark:bg-gray-800"};function oQ(I,_e,ie,He,Re,oe){const qe=p.resolveComponent("dropdown"),te=p.resolveComponent("TailwindPagination");return p.openBlock(),p.createElementBlock("div",$J,[p.createElementVNode("div",RJ,[p.createElementVNode("div",PJ,[FJ,p.createElementVNode("div",MJ,[p.createVNode(qe,{has_cancel:!1,options:Re.pageOptions,modelValue:Re.perPage,"onUpdate:modelValue":_e[0]||(_e[0]=Ye=>Re.perPage=Ye),is_required:!1,field_name:"perPage",label_name:"",default_value:5,show:!1,placeholder:"Please select an option"},null,8,["options","modelValue"])]),IJ]),LJ,p.createElementVNode("div",VJ,[zJ,p.withDirectives(p.createElementVNode("input",{type:"text","onUpdate:modelValue":_e[1]||(_e[1]=Ye=>Re.search=Ye),onInput:_e[2]||(_e[2]=Ye=>oe.handleSearch()),class:"block w-full p-2 text-sm text-gray-900 border border-gray-300 rounded-lg ps-10 bg-gray-50 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder:"Search ..."},null,544),[[p.vModelText,Re.search]])])]),p.createElementVNode("div",HJ,[p.createElementVNode("table",UJ,[p.createElementVNode("thead",WJ,[p.createElementVNode("tr",null,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(ie.columns,(Ye,dt)=>(p.openBlock(),p.createElementBlock("th",{key:dt,onClick:Jt=>oe.updateSortColumn(Ye.field_name,Ye.sortable),class:"w-full px-4 py-2 lg:w-2/12"},[p.createTextVNode(p.toDisplayString(Ye.field_label)+" ",1),Re.sortField===Ye.field_name?(p.openBlock(),p.createElementBlock("span",GJ,[Re.sortOrder==="asc"?(p.openBlock(),p.createElementBlock("i",qJ)):(p.openBlock(),p.createElementBlock("i",KJ))])):p.createCommentVNode("",!0)],8,jJ))),128))])]),p.createElementVNode("tbody",null,[Re.isLoading?(p.openBlock(),p.createElementBlock("tr",YJ,[p.createElementVNode("td",{colspan:ie.columns.length},ZJ,8,XJ)])):p.createCommentVNode("",!0),Re.isLoading?p.createCommentVNode("",!0):(p.openBlock(!0),p.createElementBlock(p.Fragment,{key:1},p.renderList(oe.groupedItems,(Ye,dt)=>(p.openBlock(),p.createElementBlock(p.Fragment,null,[p.createElementVNode("tr",JJ,[p.createElementVNode("td",{colspan:ie.columns.length,class:"text-pretty before:content-[attr(data-label)] before:font-bold lg:before:content-none flex md:flex-row flex-col justify-between gap-2 lg:table-cell py-4 px-5 lg:py-3 lg:px-4 border dark:border-gray-700"},p.toDisplayString(dt),9,QJ)]),(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(Ye,(Jt,wn)=>(p.openBlock(),p.createElementBlock("tr",{key:wn,class:"bg-white dark:bg-gray-800 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-600 hover:dark:text-gray-200 text-gray-500"},[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(ie.columns,(Yt,Qt)=>(p.openBlock(),p.createElementBlock("td",{key:Qt,"data-label":Yt.field_label,class:"text-pretty before:content-[attr(data-label)] before:font-bold lg:before:content-none flex md:flex-row flex-col justify-between gap-2 lg:table-cell py-4 px-5 lg:py-3 lg:px-4 border dark:border-gray-700"},[p.createElementVNode("div",tQ,[Yt.tdComp?(p.openBlock(),p.createBlock(p.resolveDynamicComponent(oe.forDynCompIs(Yt.tdComp)),{key:0,row:Jt,field:Yt.field_name,xprops:ie.xprops,tdProps:Yt.tdProps,onDeleteAction:_e[3]||(_e[3]=Wt=>oe.GetItemLists()),onEditAction:Wt=>oe.editAction(Jt)},null,40,["row","field","xprops","tdProps","onEditAction"])):(p.openBlock(),p.createElementBlock(p.Fragment,{key:1},[p.createTextVNode(p.toDisplayString(Jt[Yt.field_name]),1)],64))])],8,eQ))),128))]))),128))],64))),256))])])]),p.createElementVNode("div",nQ,[p.createVNode(te,{class:"mt-3 mb-0",data:Re.itemLists,limit:Re.limit,size:Re.size,align:Re.align,onPaginationChangePage:oe.GetItemLists},null,8,["data","limit","size","align","onPaginationChangePage"])])])}const sQ=fc(BJ,[["render",oQ]]),rQ={components:{},props:{data:Array,columns:Array},data(){return{showNoOfEntries:[1,2,3,10,20,30,40],search:"",sortKey:"",sortOrder:1,currentPage:1,itemsPerPage:10,jumpToPage:"",maxDisplayedPages:10}},computed:{filteredData(){const I=this.search.toLowerCase();return this.sortData(this.data).filter(ie=>Object.values(ie).some(He=>He!=null&&He.toString().toLowerCase().includes(I)))},totalPages(){return Math.ceil(this.filteredData.length/this.itemsPerPage)},paginatedData(){const I=(this.currentPage-1)*this.itemsPerPage,_e=I+this.itemsPerPage;return this.filteredData.slice(I,_e)},displayedPageNumbers(){let I=Math.max(this.currentPage-Math.floor(this.maxDisplayedPages/2),1),_e=I+this.maxDisplayedPages-1;return _e>this.totalPages&&(_e=this.totalPages,I=Math.max(_e-this.maxDisplayedPages+1,1)),Array.from({length:_e-I+1},(ie,He)=>I+He)},firstItemIndex(){return this.itemsPerPage*(this.currentPage-1)+1},lastItemIndex(){const I=this.itemsPerPage*this.currentPage;return I>this.filteredData.length?this.filteredData.length:I}},methods:{handleItemsPerPageChange(I){this.itemsPerPage=I},goToPage(I){I>=1&&I<=this.totalPages&&(this.currentPage=I)},sort(I){I===this.sortKey?this.sortOrder*=-1:(this.sortKey=I,this.sortOrder=1)},sortData(I){return this.sortKey?I.slice().sort((_e,ie)=>(_e[this.sortKey]<ie[this.sortKey]?-1:1)*this.sortOrder):I},previousPage(){this.currentPage>1&&this.currentPage--},nextPage(){this.currentPage<this.totalPages&&this.currentPage++},firstPage(){this.currentPage=1},lastPage(){this.currentPage=this.totalPages},goToPage(I){I>=1&&I<=this.totalPages&&(this.currentPage=I)}}},aQ={class:"p-2"},cQ={class:"flex flex-wrap pb-4 space-y-4 md:items-center md:justify-between flex-column sm:flex-row sm:space-y-0"},lQ={class:"flex items-center gap-2"},iQ=p.createElementVNode("span",{class:"font-medium"}," Show ",-1),uQ={style:{"margin-top":"9px"}},dQ=p.createElementVNode("span",{class:"font-medium"}," Entries ",-1),mQ=p.createElementVNode("label",{for:"table-search",class:"sr-only"},"Search",-1),fQ={class:"relative"},gQ=p.createElementVNode("div",{class:"absolute inset-y-0 left-0 flex items-center pointer-events-none rtl:inset-r-0 rtl:right-0 ps-3"},[p.createElementVNode("svg",{class:"w-5 h-5 text-gray-500 dark:text-gray-400","aria-hidden":"true",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("path",{"fill-rule":"evenodd",d:"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z","clip-rule":"evenodd"})])],-1),pQ={class:"overflow-auto rounded-lg dark:text-gray-400 dark:bg-gray-800"},hQ={class:"w-full h-full max-w-full overflow-hidden bg-white border-separate xl:overflow-auto lg:border-collapse border-spacing-y-3 lg:border-spacing-y-0 dark:border-strokedark dark:bg-boxdark"},bQ={class:"hidden text-sm font-normal text-center text-gray-700 lg:table-header-group dark:border-strokedark bg-gray-50 dark:bg-gray-700 dark:text-gray-400"},yQ=["onClick"],vQ={key:0,class:"ml-2"},wQ={key:0,class:"fa fa-arrow-up"},xQ={key:1,class:"fa fa-arrow-down"},CQ=["data-label"],SQ=["innerHTML"],kQ={key:0,class:"flex items-center justify-between px-4 py-3 bg-white border-gray-200 sm:px-6 dark:text-gray-400 dark:bg-gray-800"},_Q={class:"flex justify-between flex-1 sm:hidden"},EQ=["disabled"],TQ=["disabled"],AQ={class:"hidden sm:flex sm:flex-1 sm:items-center sm:justify-between"},DQ={class:"text-sm text-gray-700 dark:text-gray-400"},NQ={class:"font-medium"},OQ={class:"font-medium"},BQ={class:"font-medium"},$Q={"aria-label":"Page navigation"},RQ={class:"flex items-center h-8 -space-x-px text-sm"},PQ=["disabled"],FQ=[p.createElementVNode("span",{class:"sr-only"},"Previous",-1),p.createElementVNode("svg",{class:"w-2.5 h-2.5 rtl:rotate-180","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 6 10"},[p.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 1 1 5l4 4"})],-1)],MQ=["onClick"],IQ=["onClick"],LQ=["disabled"],VQ=[p.createElementVNode("span",{class:"sr-only"},"Next",-1),p.createElementVNode("svg",{class:"w-2.5 h-2.5 rtl:rotate-180","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 6 10"},[p.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m1 9 4-4-4-4"})],-1)];function zQ(I,_e,ie,He,Re,oe){const qe=p.resolveComponent("dropdown");return p.openBlock(),p.createElementBlock("div",aQ,[p.createElementVNode("div",cQ,[p.createElementVNode("div",lQ,[iQ,p.createElementVNode("div",uQ,[p.createVNode(qe,{has_cancel:!1,options:Re.showNoOfEntries,modelValue:Re.itemsPerPage,"onUpdate:modelValue":_e[0]||(_e[0]=te=>Re.itemsPerPage=te),is_required:!1,field_name:"NoOfEntries",label_name:"",default_value:10,show:!1,placeholder:"Please select an option"},null,8,["options","modelValue"])]),dQ]),mQ,p.createElementVNode("div",fQ,[gQ,p.withDirectives(p.createElementVNode("input",{type:"text","onUpdate:modelValue":_e[1]||(_e[1]=te=>Re.search=te),class:"block p-2 text-sm text-gray-900 border border-gray-300 rounded-lg ps-10 w-80 bg-gray-50 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",placeholder:"Search ..."},null,512),[[p.vModelText,Re.search]])])]),p.createElementVNode("div",pQ,[p.createElementVNode("table",hQ,[p.createElementVNode("thead",bQ,[p.createElementVNode("tr",null,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(ie.columns,(te,Ye)=>(p.openBlock(),p.createElementBlock("th",{key:Ye,onClick:p.withModifiers(dt=>oe.sort(te),["prevent"]),class:"w-full px-4 py-2 lg:w-2/12 capitalize"},[p.createTextVNode(p.toDisplayString(te)+" ",1),Re.sortKey===te?(p.openBlock(),p.createElementBlock("span",vQ,[Re.sortOrder==="asc"?(p.openBlock(),p.createElementBlock("i",wQ)):(p.openBlock(),p.createElementBlock("i",xQ))])):p.createCommentVNode("",!0)],8,yQ))),128))])]),p.createElementVNode("tbody",null,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(oe.paginatedData,(te,Ye)=>(p.openBlock(),p.createElementBlock("tr",{key:Ye,class:"bg-white dark:bg-gray-800 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-600 hover:dark:text-gray-200 text-gray-500"},[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(ie.columns,(dt,Jt)=>(p.openBlock(),p.createElementBlock("td",{key:Jt,"data-label":dt,class:"text-pretty before:content-[attr(data-label)] before:font-bold lg:before:content-none flex md:flex-row flex-col justify-between gap-2 lg:table-cell py-4 px-5 lg:py-2.5 lg:px-4 border dark:border-gray-700"},[p.createElementVNode("p",{class:"text-pretty",innerHTML:te[Jt]},null,8,SQ)],8,CQ))),128))]))),128))])])]),oe.paginatedData.length>0?(p.openBlock(),p.createElementBlock("div",kQ,[p.createElementVNode("div",_Q,[p.createElementVNode("a",{href:"#",onClick:_e[2]||(_e[2]=p.withModifiers((...te)=>oe.previousPage&&oe.previousPage(...te),["prevent"])),disabled:Re.currentPage===1,class:"relative inline-flex items-center px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md hover:bg-gray-50"},"Previous",8,EQ),p.createElementVNode("a",{href:"#",onClick:_e[3]||(_e[3]=p.withModifiers((...te)=>oe.nextPage&&oe.nextPage(...te),["prevent"])),disabled:Re.currentPage===oe.totalPages,class:"relative inline-flex items-center px-4 py-2 ml-3 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md hover:bg-gray-50"},"Next",8,TQ)]),p.createElementVNode("div",AQ,[p.createElementVNode("div",null,[p.createElementVNode("p",DQ,[p.createTextVNode(" Showing "),p.createElementVNode("span",NQ,p.toDisplayString(oe.firstItemIndex),1),p.createTextVNode(" to "),p.createElementVNode("span",OQ,p.toDisplayString(oe.lastItemIndex),1),p.createTextVNode(" of "),p.createElementVNode("span",BQ,p.toDisplayString(oe.filteredData.length),1),p.createTextVNode(" entries ")])]),p.createElementVNode("div",null,[p.createElementVNode("nav",$Q,[p.createElementVNode("ul",RQ,[p.createElementVNode("li",null,[p.createElementVNode("a",{href:"#",onClick:_e[4]||(_e[4]=p.withModifiers((...te)=>oe.previousPage&&oe.previousPage(...te),["prevent"])),disabled:Re.currentPage===1,class:"flex items-center justify-center h-8 px-3 leading-tight text-gray-500 bg-white border border-gray-300 ms-0 border-e-0 rounded-s-lg hover:bg-gray-100 hover:text-gray-700 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white"},FQ,8,PQ)]),(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(oe.displayedPageNumbers,te=>(p.openBlock(),p.createElementBlock(p.Fragment,{key:te},[p.createElementVNode("li",null,[Re.currentPage!==te?(p.openBlock(),p.createElementBlock("a",{key:0,href:"#",onClick:p.withModifiers(Ye=>oe.goToPage(te),["prevent"]),class:"flex items-center justify-center h-8 px-3 leading-tight text-gray-500 bg-white border border-gray-300 hover:bg-gray-100 hover:text-gray-700 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white"},p.toDisplayString(te),9,MQ)):p.createCommentVNode("",!0)]),p.createElementVNode("li",null,[Re.currentPage===te?(p.openBlock(),p.createElementBlock("a",{key:0,href:"#",onClick:p.withModifiers(Ye=>oe.goToPage(te),["prevent"]),"aria-current":"page",class:"z-10 flex items-center justify-center h-8 px-3 leading-tight text-blue-600 border border-blue-300 bg-blue-50 hover:bg-blue-100 hover:text-blue-700 dark:border-gray-700 dark:bg-gray-700 dark:text-white"},p.toDisplayString(te),9,IQ)):p.createCommentVNode("",!0)])],64))),128)),p.createElementVNode("li",null,[p.createElementVNode("a",{href:"#",onClick:_e[5]||(_e[5]=p.withModifiers((...te)=>oe.nextPage&&oe.nextPage(...te),["prevent"])),disabled:Re.currentPage===oe.totalPages,class:"flex items-center justify-center h-8 px-3 leading-tight text-gray-500 bg-white border border-gray-300 rounded-e-lg hover:bg-gray-100 hover:text-gray-700 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white"},VQ,8,LQ)])])])])])])):p.createCommentVNode("",!0)])}const HQ=fc(rQ,[["render",zQ]]),UQ={setup(){const I=p.ref([]),_e=Re=>{I.value.push(Re)},ie=Re=>{const oe=I.value.indexOf(Re);oe>-1&&I.value.splice(oe,1)},He=Re=>{I.value.forEach(oe=>{oe!==Re&&oe.isOpen&&oe.isOpen.value!==void 0&&(oe.isOpen.value=!1)}),Re.isOpen&&Re.isOpen.value!==void 0&&(Re.isOpen.value=!Re.isOpen.value)};return p.provide("accordionsWrapper",{registerAccordion:_e,unregisterAccordion:ie,toggleAccordion:He,accordions:I}),{}}};function WQ(I,_e,ie,He,Re,oe){return p.openBlock(),p.createElementBlock("div",null,[p.renderSlot(I.$slots,"default")])}const jQ=fc(UQ,[["render",WQ]]),GQ={props:{title:{type:String,required:!0}},setup(){const I=p.ref(!1),_e=p.inject("accordionsWrapper"),He=(()=>{var dt=new Date().getTime();typeof performance<"u"&&typeof performance.now=="function"&&(dt+=performance.now());var Jt="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(wn){var Yt=(dt+Math.random()*16)%16|0;return dt=Math.floor(dt/16),(wn==="x"?Yt:Yt&3|8).toString(16)});return Jt})(),Re={isOpen:I,id:He},oe=p.computed(()=>_e.accordions.value),qe=p.computed(()=>oe.value.length>0&&oe.value[0].id===He),te=p.computed(()=>oe.value.length>0&&oe.value[oe.value.length-1].id===He);return p.onMounted(()=>{_e.registerAccordion(Re)}),p.onUnmounted(()=>{_e.unregisterAccordion(Re)}),{isOpen:I,isFirstAccordion:qe,isLastAccordion:te,toggle:()=>{_e.toggleAccordion(Re)}}}},qQ={class:"flex items-center"},KQ={key:0,class:"w-3 h-3 rotate-180 shrink-0","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 10 6"},YQ=[p.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5 5 1 1 5"},null,-1)],XQ={key:1,class:"w-3 h-3 shrink-0","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 10 6"},ZQ=[p.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5 5 1 1 5"},null,-1)];function JQ(I,_e,ie,He,Re,oe){return p.openBlock(),p.createElementBlock("div",null,[p.createElementVNode("h2",null,[p.createElementVNode("button",{onClick:_e[0]||(_e[0]=(...qe)=>He.toggle&&He.toggle(...qe)),type:"button",class:p.normalizeClass(["flex items-center justify-between w-full gap-3 p-5 font-medium text-gray-500 border border-gray-200 rtl:text-right dark:border-gray-700 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-800",{"rounded-t-xl":He.isFirstAccordion,"border-b-0":!He.isLastAccordion,"bg-gray-100 dark:bg-gray-800":He.isOpen}]),"aria-expanded":"true"},[p.createElementVNode("span",qQ,p.toDisplayString(ie.title),1),He.isOpen?p.createCommentVNode("",!0):(p.openBlock(),p.createElementBlock("svg",KQ,YQ)),He.isOpen?(p.openBlock(),p.createElementBlock("svg",XQ,ZQ)):p.createCommentVNode("",!0)],2)]),He.isOpen?(p.openBlock(),p.createElementBlock("div",{key:0,class:p.normalizeClass([{"border-b-0":!He.isLastAccordion,"border-t-0":He.isLastAccordion},"p-5 border border-gray-200 dark:border-gray-700 dark:bg-gray-900"])},[p.renderSlot(I.$slots,"default")],2)):p.createCommentVNode("",!0)])}const QQ=fc(GQ,[["render",JQ]]),eee={class:"flex items-center p-4 text-gray-500 bg-white rounded-lg shadow dark:bg-gray-800 dark:text-gray-400",role:"alert"},tee={key:0,class:"inline-flex items-center justify-center flex-shrink-0 w-8 h-8 text-green-500 bg-green-100 rounded-lg dark:bg-green-800 dark:text-green-200"},nee=[p.createElementVNode("svg",{class:"w-5 h-5","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 20 20"},[p.createElementVNode("path",{d:"M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5Zm3.707 8.207-4 4a1 1 0 0 1-1.414 0l-2-2a1 1 0 0 1 1.414-1.414L9 10.586l3.293-3.293a1 1 0 0 1 1.414 1.414Z"})],-1),p.createElementVNode("span",{class:"sr-only"},"Check icon",-1)],oee={key:1,class:"inline-flex items-center justify-center flex-shrink-0 w-8 h-8 text-red-500 bg-red-100 rounded-lg dark:bg-red-800 dark:text-red-200"},see=[p.createElementVNode("svg",{class:"w-5 h-5","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 20 20"},[p.createElementVNode("path",{d:"M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5Zm3.707 11.793a1 1 0 1 1-1.414 1.414L10 11.414l-2.293 2.293a1 1 0 0 1-1.414-1.414L8.586 10 6.293 7.707a1 1 0 0 1 1.414-1.414L10 8.586l2.293-2.293a1 1 0 0 1 1.414 1.414L11.414 10l2.293 2.293Z"})],-1),p.createElementVNode("span",{class:"sr-only"},"Error icon",-1)],ree={key:2,class:"inline-flex items-center justify-center flex-shrink-0 w-8 h-8 text-orange-500 bg-orange-100 rounded-lg dark:bg-orange-700 dark:text-orange-200"},aee=[p.createElementVNode("svg",{class:"w-5 h-5","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 20 20"},[p.createElementVNode("path",{d:"M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5ZM10 15a1 1 0 1 1 0-2 1 1 0 0 1 0 2Zm1-4a1 1 0 0 1-2 0V6a1 1 0 0 1 2 0v5Z"})],-1),p.createElementVNode("span",{class:"sr-only"},"Warning icon",-1)],cee={class:"ml-3 text-sm font-normal"},lee=[p.createElementVNode("span",{class:"sr-only"},"Close",-1),p.createElementVNode("svg",{"aria-hidden":"true",class:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[p.createElementVNode("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"})],-1)],iee={__name:"ToastListItem",props:{message:String,duration:{type:Number,default:2e3},type:{type:String,default:"success"}},emits:["remove"],setup(I,{emit:_e}){const ie=I;p.onMounted(()=>{setTimeout(()=>He("remove"),ie.duration)});const He=_e;return(Re,oe)=>(p.openBlock(),p.createElementBlock("div",eee,[ie.type==="success"?(p.openBlock(),p.createElementBlock("div",tee,nee)):p.createCommentVNode("",!0),ie.type==="error"?(p.openBlock(),p.createElementBlock("div",oee,see)):p.createCommentVNode("",!0),ie.type==="warning"?(p.openBlock(),p.createElementBlock("div",ree,aee)):p.createCommentVNode("",!0),p.createElementVNode("div",cee,p.toDisplayString(ie.message),1),p.createElementVNode("button",{onClick:oe[0]||(oe[0]=qe=>He("remove")),type:"button",class:"-mx-1.5 -my-1.5 ml-auto inline-flex h-8 w-8 rounded-lg bg-white p-1.5 text-gray-400 hover:bg-gray-100 hover:text-gray-900 focus:ring-2 focus:ring-gray-300 dark:bg-gray-800 dark:text-gray-500 dark:hover:bg-gray-700 dark:hover:text-white","data-dismiss-target":"#toast-default","aria-label":"Close"},lee)]))}},k3=p.reactive({items:[]}),aT={state:k3,methods:{add(I){k3.items.unshift({key:Symbol(),message:I.message,type:I.type,duration:I.duration})},remove(I){k3.items.splice(I,1)}}},uee={__name:"GlToastList",setup(I){function _e(ie){aT.methods.remove(ie)}return(ie,He)=>(p.openBlock(),p.createBlock(p.TransitionGroup,{tag:"div","enter-from-class":"translate-x-full opacity-0","enter-active-class":"duration-500","leave-active-class":"duration-500","leave-to-class":"translate-x-full opacity-0",class:"fixed z-50 w-full max-w-xs space-y-4 top-4 right-4"},{default:p.withCtx(()=>[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(p.unref(aT).state.items,(Re,oe)=>(p.openBlock(),p.createBlock(iee,{key:Re.key,message:Re.message,type:Re.type,duration:Re.duration,onRemove:qe=>_e(oe)},null,8,["message","type","duration","onRemove"]))),128))]),_:1}))}},dee={key:0,class:"flex justify-center"},mee=[p.createElementVNode("svg",{class:"w-5 h-5","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 4 15"},[p.createElementVNode("path",{d:"M3.5 1.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Zm0 6.041a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Zm0 5.959a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Z"})],-1)],fee={class:"absolute right-0 z-10 mt-5 origin-top-right bg-white divide-y divide-gray-100 rounded-lg shadow w-44 dark:bg-gray-700 dark:divide-gray-600"},gee={class:"py-2 text-sm text-gray-700 dark:text-gray-200","aria-labelledby":"dropdownDividerButton"},pee={key:0},hee=["href"],bee=p.createElementVNode("i",{class:"mr-2 fa-solid fa-list-ul opacity-80"},null,-1),yee={key:1},vee=p.createElementVNode("i",{class:"mr-2 fa-solid fa-trash-can opacity-80"},null,-1),wee={__name:"DatatableAction",props:{field:{type:String,default:""},route_url:{type:String,default:""},row:{type:[Array,Object],default:[]},xprops:{type:Object,default:{}},tdProps:{type:Object,default:{}}},emits:["deleteAction"],setup(I,{emit:_e}){const ie=I,He=p.ref(!1),Re=p.ref(!1),oe=()=>{He.value=!1},qe=()=>{He.value=!0},te=()=>{Re.value=!1},Ye=()=>{Re.value=!0},dt=_e,Jt=()=>{axios.delete(`${ie.xprops.route}/${ie.row.id}`).then(()=>{te(),dt("deleteAction"),aT.methods.add({message:"Item deleted successfully.",type:"success",duration:5e3})}).catch(wn=>{console.log(wn)})};return(wn,Yt)=>{const Qt=p.resolveDirective("click-outside");return p.openBlock(),p.createElementBlock(p.Fragment,null,[p.createVNode(I$,{isOpen:Re.value,onConfirmDelete:Jt,onCancelDelete:te},null,8,["isOpen"]),I.row&&wn.can(`edit_${I.xprops.permission} || delete_${I.xprops.permission}`)?p.withDirectives((p.openBlock(),p.createElementBlock("div",dee,[p.createElementVNode("button",{onClick:qe,class:"inline-flex items-center p-2 text-sm font-medium text-center text-gray-900 bg-white rounded-lg hover:bg-gray-100 focus:ring-4 focus:outline-none dark:text-white focus:ring-gray-50 dark:bg-gray-800 dark:hover:bg-gray-700 dark:focus:ring-gray-600",type:"button"},mee),p.withDirectives(p.createElementVNode("div",fee,[p.createElementVNode("ul",gee,[wn.can(`edit_${I.xprops.permission}`)?(p.openBlock(),p.createElementBlock("li",pee,[p.createElementVNode("a",{href:I.xprops.route+"/"+I.row.id+"/edit",class:"block px-4 py-2 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white"},[bee,p.createTextVNode(" Edit")],8,hee)])):p.createCommentVNode("",!0),wn.can(`delete_${I.xprops.permission}`)?(p.openBlock(),p.createElementBlock("li",yee,[p.createElementVNode("a",{href:"#",onClick:p.withModifiers(Ye,["prevent"]),class:"block px-4 py-2 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white"},[vee,p.createTextVNode(" Remove")])])):p.createCommentVNode("",!0)])],512),[[p.vShow,He.value]])])),[[Qt,oe]]):p.createCommentVNode("",!0)],64)}}},xee={key:0,class:"flex justify-center"},Cee=[p.createElementVNode("svg",{class:"w-5 h-5","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 4 15"},[p.createElementVNode("path",{d:"M3.5 1.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Zm0 6.041a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Zm0 5.959a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Z"})],-1)],See={class:"absolute right-0 z-10 mt-5 origin-top-right bg-white divide-y divide-gray-100 rounded-lg shadow w-44 dark:bg-gray-700 dark:divide-gray-600"},kee={class:"py-2 text-sm text-gray-700 dark:text-gray-200","aria-labelledby":"dropdownDividerButton"},_ee={key:0},Eee=p.createElementVNode("i",{class:"mr-2 fa-solid fa-trash-can opacity-80"},null,-1),Tee={__name:"DatatableDeleteAction",props:{field:{type:String,default:""},route_url:{type:String,default:""},row:{type:[Array,Object],default:[]},xprops:{type:Object,default:{}},tdProps:{type:Object,default:{}}},emits:["deleteAction"],setup(I,{emit:_e}){const ie=I,He=p.ref(!1),Re=p.ref(!1),oe=()=>{He.value=!1},qe=()=>{He.value=!0},te=()=>{Re.value=!1},Ye=()=>{Re.value=!0},dt=_e,Jt=()=>{axios.delete(`${ie.xprops.route}/${ie.row.id}`).then(()=>{te(),dt("deleteAction"),aT.methods.add({message:"Item deleted successfully.",type:"success",duration:5e3})}).catch(wn=>{console.log(wn)})};return(wn,Yt)=>{const Qt=p.resolveDirective("click-outside");return p.openBlock(),p.createElementBlock(p.Fragment,null,[p.createVNode(I$,{isOpen:Re.value,onConfirmDelete:Jt,onCancelDelete:te},null,8,["isOpen"]),I.row&&wn.can(`delete_${I.xprops.permission}`)?p.withDirectives((p.openBlock(),p.createElementBlock("div",xee,[p.createElementVNode("button",{onClick:qe,class:"inline-flex items-center p-2 text-sm font-medium text-center text-gray-900 bg-white rounded-lg hover:bg-gray-100 focus:ring-4 focus:outline-none dark:text-white focus:ring-gray-50 dark:bg-gray-800 dark:hover:bg-gray-700 dark:focus:ring-gray-600",type:"button"},Cee),p.withDirectives(p.createElementVNode("div",See,[p.createElementVNode("ul",kee,[wn.can(`delete_${I.xprops.permission}`)?(p.openBlock(),p.createElementBlock("li",_ee,[p.createElementVNode("a",{href:"#",onClick:p.withModifiers(Ye,["prevent"]),class:"block px-4 py-2 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white"},[Eee,p.createTextVNode(" Remove")])])):p.createCommentVNode("",!0)])],512),[[p.vShow,He.value]])])),[[Qt,oe]]):p.createCommentVNode("",!0)],64)}}},Aee={props:["field","row"],computed:{isArray(){return Array.isArray(this.row)},isObject(){return typeof this.row=="object"},isString(){return typeof this.row=="string"}},mounted(){}},Dee=["href","title"],Nee=p.createElementVNode("svg",{class:"w-3 h-3 text-white me-2","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[p.createElementVNode("path",{"fill-rule":"evenodd",d:"M13 11.15V4a1 1 0 1 0-2 0v7.15L8.78 8.374a1 1 0 1 0-1.56 1.25l4 5a1 1 0 0 0 1.56 0l4-5a1 1 0 1 0-1.56-1.25L13 11.15Z","clip-rule":"evenodd"}),p.createElementVNode("path",{"fill-rule":"evenodd",d:"M9.657 15.874 7.358 13H5a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2h-2.358l-2.3 2.874a3 3 0 0 1-4.685 0ZM17 16a1 1 0 1 0 0 2h.01a1 1 0 1 0 0-2H17Z","clip-rule":"evenodd"})],-1),Oee={key:1,class:"m-1 d-inline-block"},Bee=["href","title"],$ee=p.createElementVNode("svg",{class:"w-3 h-3 text-white me-2","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[p.createElementVNode("path",{"fill-rule":"evenodd",d:"M13 11.15V4a1 1 0 1 0-2 0v7.15L8.78 8.374a1 1 0 1 0-1.56 1.25l4 5a1 1 0 0 0 1.56 0l4-5a1 1 0 1 0-1.56-1.25L13 11.15Z","clip-rule":"evenodd"}),p.createElementVNode("path",{"fill-rule":"evenodd",d:"M9.657 15.874 7.358 13H5a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2h-2.358l-2.3 2.874a3 3 0 0 1-4.685 0ZM17 16a1 1 0 1 0 0 2h.01a1 1 0 1 0 0-2H17Z","clip-rule":"evenodd"})],-1);function Ree(I,_e,ie,He,Re,oe){return p.openBlock(),p.createElementBlock("div",null,[oe.isArray?(p.openBlock(!0),p.createElementBlock(p.Fragment,{key:0},p.renderList(ie.row,(qe,te)=>(p.openBlock(),p.createElementBlock("div",{key:te,class:"m-1 d-inline-block"},[p.createElementVNode("a",{href:qe,title:qe,target:"_blank",class:"inline-flex items-center px-3 py-2 text-xs font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"},[Nee,p.createTextVNode(" Download ")],8,Dee)]))),128)):oe.isString?(p.openBlock(),p.createElementBlock("div",Oee,[p.createElementVNode("a",{href:ie.row,title:ie.row,target:"_blank",class:"inline-flex items-center px-3 py-2 text-xs font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"},[$ee,p.createTextVNode(" Download ")],8,Bee)])):p.createCommentVNode("",!0)])}const Pee=fc(Aee,[["render",Ree]]),Fee={props:["field","row"],computed:{isArray(){return Array.isArray(this.row[this.field])},isObject(){return typeof this.row[this.field]=="object"}}},Mee=["href","title"],Iee=p.createElementVNode("svg",{class:"w-3 h-3 text-white me-2","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[p.createElementVNode("path",{"fill-rule":"evenodd",d:"M13 11.15V4a1 1 0 1 0-2 0v7.15L8.78 8.374a1 1 0 1 0-1.56 1.25l4 5a1 1 0 0 0 1.56 0l4-5a1 1 0 1 0-1.56-1.25L13 11.15Z","clip-rule":"evenodd"}),p.createElementVNode("path",{"fill-rule":"evenodd",d:"M9.657 15.874 7.358 13H5a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2h-2.358l-2.3 2.874a3 3 0 0 1-4.685 0ZM17 16a1 1 0 1 0 0 2h.01a1 1 0 1 0 0-2H17Z","clip-rule":"evenodd"})],-1),Lee={key:1,class:"m-1 d-inline-block"},Vee=["href","title"],zee=p.createElementVNode("svg",{class:"w-3 h-3 text-white me-2","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[p.createElementVNode("path",{"fill-rule":"evenodd",d:"M13 11.15V4a1 1 0 1 0-2 0v7.15L8.78 8.374a1 1 0 1 0-1.56 1.25l4 5a1 1 0 0 0 1.56 0l4-5a1 1 0 1 0-1.56-1.25L13 11.15Z","clip-rule":"evenodd"}),p.createElementVNode("path",{"fill-rule":"evenodd",d:"M9.657 15.874 7.358 13H5a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2h-2.358l-2.3 2.874a3 3 0 0 1-4.685 0ZM17 16a1 1 0 1 0 0 2h.01a1 1 0 1 0 0-2H17Z","clip-rule":"evenodd"})],-1);function Hee(I,_e,ie,He,Re,oe){return p.openBlock(),p.createElementBlock("div",null,[oe.isArray?(p.openBlock(!0),p.createElementBlock(p.Fragment,{key:0},p.renderList(ie.row[ie.field],qe=>(p.openBlock(),p.createElementBlock("div",{key:qe.id,class:"m-1 d-inline-block"},[p.createElementVNode("a",{href:qe.url,title:qe.name,target:"_blank",class:"inline-flex items-center px-3 py-2 text-xs font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"},[Iee,p.createTextVNode(" Download ")],8,Mee)]))),128)):oe.isObject?(p.openBlock(),p.createElementBlock("div",Lee,[p.createElementVNode("a",{href:ie.row[ie.field].url,title:ie.row[ie.field].name,target:"_blank",class:"inline-flex items-center px-3 py-2 text-xs font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"},[zee,p.createTextVNode(" Download ")],8,Vee)])):p.createCommentVNode("",!0)])}const Uee=fc(Fee,[["render",Hee]]),Wee={props:["field","row","tdProps"]},jee={key:0},Gee=["innerHTML"];function qee(I,_e,ie,He,Re,oe){return ie.row[ie.field]?(p.openBlock(),p.createElementBlock("div",jee,[p.createElementVNode("div",{class:"w-full",innerHTML:ie.row[ie.field]},null,8,Gee)])):p.createCommentVNode("",!0)}const Kee=fc(Wee,[["render",qee]]),Yee={props:["field","row","tdProps"],computed:{entry(){const[I,_e]=this.field.split(".");return p.markRaw({key:I,field:_e})},isArray(){return Array.isArray(this.row[this.entry.key])},isObject(){return typeof this.row[this.entry.key]=="object"}}},Xee={class:"flex flex-wrap gap-2"},Zee={key:1,class:"px-2 py-1 text-xs font-medium text-blue-800 bg-blue-100 rounded dark:bg-blue-900 dark:text-blue-300"};function Jee(I,_e,ie,He,Re,oe){return p.openBlock(),p.createElementBlock("div",Xee,[oe.isArray?(p.openBlock(!0),p.createElementBlock(p.Fragment,{key:0},p.renderList(ie.row[oe.entry.key],(qe,te)=>(p.openBlock(),p.createElementBlock("span",{key:te,class:"px-2 py-1 text-xs font-medium text-blue-800 bg-blue-100 rounded dark:bg-blue-900 dark:text-blue-300"},p.toDisplayString(qe[oe.entry.field]),1))),128)):oe.isObject?(p.openBlock(),p.createElementBlock("span",Zee,p.toDisplayString(ie.row[oe.entry.key][oe.entry.field]),1)):p.createCommentVNode("",!0)])}const Qee=fc(Yee,[["render",Jee]]),ete={props:["field","row","tdProps"]},tte={key:0},nte={class:"m-1 d-inline-block"},ote=["href","title"],ste=["src","alt","title"];function rte(I,_e,ie,He,Re,oe){return ie.row[ie.field]?(p.openBlock(),p.createElementBlock("div",tte,[p.createElementVNode("div",nte,[p.createElementVNode("a",{href:ie.row[ie.field].url,title:ie.row[ie.field].name,target:"_blank"},[p.createElementVNode("img",{src:ie.row[ie.field].thumbnail,alt:ie.row[ie.field].name,title:ie.row[ie.field].name},null,8,ste)],8,ote)])])):p.createCommentVNode("",!0)}const ate=fc(ete,[["render",rte],["__scopeId","data-v-3a28c02c"]]),cte={props:["field","row","tdProps"],computed:{isActive(){return this.row[this.field]===1}}},lte={class:"flex flex-wrap gap-2 text-nowrap"},ite={key:0,class:"inline-flex items-center px-2 py-1 text-xs font-medium text-green-800 bg-green-100 rounded-full dark:bg-green-900 dark:text-green-300"},ute=p.createElementVNode("span",{class:"w-2 h-2 bg-green-500 rounded-full me-1"},null,-1),dte={key:1,class:"inline-flex items-center bg-red-100 text-red-800 text-xs font-medium px-2.5 py-0.5 rounded-full dark:bg-red-900 dark:text-red-300"},mte=p.createElementVNode("span",{class:"w-2 h-2 bg-red-500 rounded-full me-1"},null,-1);function fte(I,_e,ie,He,Re,oe){return p.openBlock(),p.createElementBlock("div",lte,[oe.isActive?(p.openBlock(),p.createElementBlock("span",ite,[ute,p.createTextVNode(" Active ")])):oe.isActive?p.createCommentVNode("",!0):(p.openBlock(),p.createElementBlock("span",dte,[mte,p.createTextVNode(" Inactive ")]))])}const gte=fc(cte,[["render",fte]]),pte={props:["field","row","tdProps"],computed:{hasLabelColor(I){const _e=this.tdProps.status_general_labels_color.find(ie=>ie.label===this.row[this.field]);return _e?_e.class:""}}},hte={class:"flex flex-wrap gap-2 text-nowrap"},bte={key:0,class:"inline-flex items-center px-2 py-1 text-xs font-medium text-green-800 bg-green-100 rounded-full dark:bg-green-900 dark:text-green-300"},yte=p.createElementVNode("span",{class:"w-2 h-2 bg-green-500 rounded-full me-1"},null,-1),vte={key:1,class:"inline-flex items-center px-2 py-1 text-xs font-medium text-red-800 bg-red-100 rounded-full dark:bg-red-900 dark:text-red-300"},wte=p.createElementVNode("span",{class:"w-2 h-2 bg-red-500 rounded-full me-1"},null,-1),xte={key:2,class:"inline-flex items-center px-2 py-1 text-xs font-medium text-yellow-800 bg-yellow-100 rounded-full dark:bg-gray-700 dark:text-yellow-300"},Cte=p.createElementVNode("span",{class:"w-2 h-2 bg-yellow-500 rounded-full me-1"},null,-1),Ste={key:3,class:"inline-flex items-center px-2 py-1 text-xs font-medium text-blue-800 bg-blue-100 rounded-full dark:bg-gray-700 dark:text-blue-400"},kte=p.createElementVNode("span",{class:"w-2 h-2 bg-blue-500 rounded-full me-1"},null,-1),_te={key:4,class:"inline-flex items-center px-2 py-1 text-sm text-blue-800 bg-blue-100 rounded-full dark:bg-blue-900 dark:text-blue-300"},Ete=p.createElementVNode("span",{class:"relative flex w-2 h-2 mr-1"},[p.createElementVNode("span",{class:"absolute inline-flex w-full h-full bg-blue-500 rounded-full animate-ping"}),p.createElementVNode("span",{class:"relative inline-flex w-2 h-2 bg-blue-500 rounded-full"})],-1);function Tte(I,_e,ie,He,Re,oe){return p.openBlock(),p.createElementBlock("div",hte,[oe.hasLabelColor=="green"?(p.openBlock(),p.createElementBlock("span",bte,[yte,p.createTextVNode(" "+p.toDisplayString(this.row[this.field]),1)])):p.createCommentVNode("",!0),oe.hasLabelColor=="red"?(p.openBlock(),p.createElementBlock("span",vte,[wte,p.createTextVNode(" "+p.toDisplayString(this.row[this.field]),1)])):p.createCommentVNode("",!0),oe.hasLabelColor=="yellow"?(p.openBlock(),p.createElementBlock("span",xte,[Cte,p.createTextVNode(" "+p.toDisplayString(this.row[this.field]),1)])):p.createCommentVNode("",!0),oe.hasLabelColor=="default"?(p.openBlock(),p.createElementBlock("span",Ste,[kte,p.createTextVNode(" "+p.toDisplayString(this.row[this.field]),1)])):p.createCommentVNode("",!0),oe.hasLabelColor=="animate"?(p.openBlock(),p.createElementBlock("span",_te,[Ete,p.createTextVNode(" "+p.toDisplayString(this.row[this.field]),1)])):p.createCommentVNode("",!0)])}const Ate=fc(pte,[["render",Tte]]),Dte={props:["field","row","tdProps"],computed:{hasLabelColor(){return this.tdProps.specfic_color??""},badgeType(){switch(this.tdProps.badge_type){case"Default":return"rounded text-xs";case"Large":return"rounded text-sm ";case"Bordered":return"rounded text-xs border";case"Pills":return"rounded-full text-xs";default:return""}}}},Nte={class:"flex flex-wrap gap-2 text-nowrap justify-center"};function Ote(I,_e,ie,He,Re,oe){return p.openBlock(),p.createElementBlock("div",Nte,[oe.hasLabelColor=="Default"?(p.openBlock(),p.createElementBlock("span",{key:0,class:p.normalizeClass(["bg-blue-100 text-blue-800 font-medium me-2 px-2.5 py-0.5 dark:bg-blue-900 dark:text-blue-300 border-blue-400",oe.badgeType])},p.toDisplayString(this.row[this.field]),3)):p.createCommentVNode("",!0),oe.hasLabelColor=="Dark"?(p.openBlock(),p.createElementBlock("span",{key:1,class:p.normalizeClass(["bg-gray-100 text-gray-800 font-medium me-2 px-2.5 py-0.5 dark:bg-gray-700 dark:text-gray-300 border-gray-500",oe.badgeType])},p.toDisplayString(this.row[this.field]),3)):p.createCommentVNode("",!0),oe.hasLabelColor=="Red"?(p.openBlock(),p.createElementBlock("span",{key:2,class:p.normalizeClass(["bg-red-100 text-red-800 font-medium me-2 px-2.5 py-0.5 dark:bg-red-900 dark:text-red-300 border-red-400",oe.badgeType])},p.toDisplayString(this.row[this.field]),3)):p.createCommentVNode("",!0),oe.hasLabelColor=="Green"?(p.openBlock(),p.createElementBlock("span",{key:3,class:p.normalizeClass(["bg-green-100 text-green-800 font-medium me-2 px-2.5 py-0.5 dark:bg-green-900 dark:text-green-300 border-green-400",oe.badgeType])},p.toDisplayString(this.row[this.field]),3)):p.createCommentVNode("",!0),oe.hasLabelColor=="Yellow"?(p.openBlock(),p.createElementBlock("span",{key:4,class:p.normalizeClass(["bg-yellow-100 text-yellow-800 font-medium me-2 px-2.5 py-0.5 dark:bg-yellow-900 dark:text-yellow-300 border-yellow-300",oe.badgeType])},p.toDisplayString(this.row[this.field]),3)):p.createCommentVNode("",!0),oe.hasLabelColor=="Indigo"?(p.openBlock(),p.createElementBlock("span",{key:5,class:p.normalizeClass(["bg-indigo-100 text-indigo-800 font-medium me-2 px-2.5 py-0.5 dark:bg-indigo-900 dark:text-indigo-300 border-indigo-400",oe.badgeType])},p.toDisplayString(this.row[this.field]),3)):p.createCommentVNode("",!0),oe.hasLabelColor=="Purple"?(p.openBlock(),p.createElementBlock("span",{key:6,class:p.normalizeClass(["bg-purple-100 text-purple-800 font-medium me-2 px-2.5 py-0.5 dark:bg-purple-900 dark:text-purple-300 border-purple-400",oe.badgeType])},p.toDisplayString(this.row[this.field]),3)):p.createCommentVNode("",!0),oe.hasLabelColor=="Pink"?(p.openBlock(),p.createElementBlock("span",{key:7,class:p.normalizeClass(["bg-pink-100 text-pink-800 font-medium me-2 px-2.5 py-0.5 dark:bg-pink-900 dark:text-pink-300 border-pink-400",oe.badgeType])},p.toDisplayString(this.row[this.field]),3)):p.createCommentVNode("",!0)])}const Bte=fc(Dte,[["render",Ote]]),$te={props:["field","row","tdProps"],computed:{hasLabelColor(I){const _e=this.tdProps.status_general_labels_color.find(ie=>ie.text===this.row[this.field]);return _e?_e.class:""},getLabel(){const I=this.tdProps.status_general_labels_color.find(_e=>_e.text===this.row[this.field]);return I?I.label:""}}},Rte={class:"flex flex-wrap gap-2 text-nowrap"},Pte={key:0,class:"inline-flex items-center px-2 py-1 text-xs font-medium text-green-800 bg-green-100 rounded-full dark:bg-green-900 dark:text-green-300"},Fte=p.createElementVNode("span",{class:"w-2 h-2 bg-green-500 rounded-full me-1"},null,-1),Mte={key:1,class:"inline-flex items-center px-2 py-1 text-xs font-medium text-red-800 bg-red-100 rounded-full dark:bg-red-900 dark:text-red-300"},Ite=p.createElementVNode("span",{class:"w-2 h-2 bg-red-500 rounded-full me-1"},null,-1),Lte={key:2,class:"inline-flex items-center px-2 py-1 text-xs font-medium text-yellow-800 bg-yellow-100 rounded-full dark:bg-gray-700 dark:text-yellow-300"},Vte=p.createElementVNode("span",{class:"w-2 h-2 bg-yellow-500 rounded-full me-1"},null,-1),zte={key:3,class:"inline-flex items-center px-2 py-1 text-xs font-medium text-blue-800 bg-blue-100 rounded-full dark:bg-gray-700 dark:text-blue-400"},Hte=p.createElementVNode("span",{class:"w-2 h-2 bg-blue-500 rounded-full me-1"},null,-1),Ute={key:4,class:"inline-flex items-center px-2 py-1 text-sm text-blue-800 bg-blue-100 rounded-full dark:bg-blue-900 dark:text-blue-300"},Wte=p.createElementVNode("span",{class:"relative flex w-2 h-2 mr-1"},[p.createElementVNode("span",{class:"absolute inline-flex w-full h-full bg-blue-500 rounded-full animate-ping"}),p.createElementVNode("span",{class:"relative inline-flex w-2 h-2 bg-blue-500 rounded-full"})],-1);function jte(I,_e,ie,He,Re,oe){return p.openBlock(),p.createElementBlock("div",Rte,[oe.hasLabelColor=="green"?(p.openBlock(),p.createElementBlock("span",Pte,[Fte,p.createTextVNode(" "+p.toDisplayString(oe.getLabel),1)])):p.createCommentVNode("",!0),oe.hasLabelColor=="red"?(p.openBlock(),p.createElementBlock("span",Mte,[Ite,p.createTextVNode(" "+p.toDisplayString(oe.getLabel),1)])):p.createCommentVNode("",!0),oe.hasLabelColor=="yellow"?(p.openBlock(),p.createElementBlock("span",Lte,[Vte,p.createTextVNode(" "+p.toDisplayString(oe.getLabel),1)])):p.createCommentVNode("",!0),oe.hasLabelColor=="default"?(p.openBlock(),p.createElementBlock("span",zte,[Hte,p.createTextVNode(" "+p.toDisplayString(oe.getLabel),1)])):p.createCommentVNode("",!0),oe.hasLabelColor=="animate"?(p.openBlock(),p.createElementBlock("span",Ute,[Wte,p.createTextVNode(" "+p.toDisplayString(oe.getLabel),1)])):p.createCommentVNode("",!0)])}const Gte=fc($te,[["render",jte]]),qte={props:["field","row","tdProps"],computed:{formattedDate(){if(!this.row[this.field])return"";const I=new Date(this.row[this.field]),_e=I.getFullYear(),ie=I.toLocaleString("default",{month:"long"}),He=I.getDate();let Re=I.getHours();const oe=I.getMinutes(),qe=I.getSeconds(),te=Re>=12?"pm":"am";return Re=Re%12,Re=Re||12,`${ie} ${He}, ${_e}, ${Re}:${oe}:${qe} ${te}`},isActive(){return this.row[this.field]===1}}},Kte={class:"w-full"};function Yte(I,_e,ie,He,Re,oe){return p.openBlock(),p.createElementBlock("div",Kte,p.toDisplayString(oe.formattedDate),1)}const Xte=fc(qte,[["render",Yte]]),Zte={props:["field","row","tdProps"]},Jte={class:"flex flex-wrap gap-2 text-nowrap"},Qte={key:0,class:"inline-flex items-center px-2 py-1 text-sm text-blue-800 bg-blue-100 rounded-full dark:bg-blue-900 dark:text-blue-300"},ene=p.createElementVNode("span",{class:"relative flex w-2 h-2 mr-1"},[p.createElementVNode("span",{class:"absolute inline-flex w-full h-full bg-blue-500 rounded-full animate-ping"}),p.createElementVNode("span",{class:"relative inline-flex w-2 h-2 bg-blue-500 rounded-full"})],-1),tne={key:1,class:"inline-flex items-center px-2 py-1 text-xs font-medium text-yellow-800 bg-yellow-100 rounded-full dark:bg-gray-700 dark:text-yellow-300"},nne=p.createElementVNode("span",{class:"w-2 h-2 bg-yellow-500 rounded-full me-1"},null,-1),one={key:2,class:"inline-flex items-center px-2 py-1 text-xs font-medium text-green-800 bg-green-100 rounded-full dark:bg-green-900 dark:text-green-300"},sne=p.createElementVNode("span",{class:"w-2 h-2 bg-green-500 rounded-full me-1"},null,-1);function rne(I,_e,ie,He,Re,oe){return p.openBlock(),p.createElementBlock("div",Jte,[ie.row[ie.field]===0?(p.openBlock(),p.createElementBlock("span",Qte,[ene,p.createTextVNode(" Provisioning")])):p.createCommentVNode("",!0),ie.row[ie.field]===2?(p.openBlock(),p.createElementBlock("span",tne,[nne,p.createTextVNode(" Paused ")])):p.createCommentVNode("",!0),ie.row[ie.field]===1?(p.openBlock(),p.createElementBlock("span",one,[sne,p.createTextVNode(" Active ")])):p.createCommentVNode("",!0)])}const ane=fc(Zte,[["render",rne]]),cne={props:["field","row","tdProps"]},lne={key:0,class:"text-nowrap"},ine={class:"w-full h-full p-3 mx-0 mt-0 overflow-auto font-mono text-left break-words rounded cursor-default whitespace-nowrap console_styles"};function une(I,_e,ie,He,Re,oe){return ie.row[ie.field]?(p.openBlock(),p.createElementBlock("div",lne,[p.createElementVNode("pre",ine," "+p.toDisplayString(ie.row[ie.field])+`
|
|
96
96
|
`,1)])):p.createCommentVNode("",!0)}const dne=fc(cne,[["render",une]]),mne={props:["isOpen","title","button_text"],methods:{confirmAction(){this.$emit("confirm-action")},cancelAction(){this.$emit("cancel-action")}}},fne={key:0,class:"fixed inset-0 z-50 overflow-y-auto",role:"dialog","aria-modal":"true"},gne={class:"flex items-end justify-center min-h-screen px-4 pt-4 pb-20 text-center sm:block sm:p-0"},pne=p.createElementVNode("div",{class:"fixed inset-0 transition-opacity bg-gray-500 bg-opacity-75","aria-hidden":"true"},null,-1),hne=p.createElementVNode("span",{class:"hidden sm:inline-block sm:align-middle sm:h-screen","aria-hidden":"true"},"",-1),bne={class:"inline-block overflow-hidden text-left align-bottom transition-all transform bg-white rounded-lg shadow-xl sm:my-8 sm:align-middle sm:max-w-lg sm:w-full"},yne={class:"px-4 pt-5 pb-4 bg-white sm:p-6 sm:pb-4"},vne={class:"sm:flex sm:items-start"},wne={class:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left"},xne={class:"text-lg font-medium leading-6 text-gray-900"},Cne={class:"mt-2"},Sne={class:"px-4 py-3 bg-gray-50 sm:px-6 sm:flex sm:flex-row-reverse"};function kne(I,_e,ie,He,Re,oe){return ie.isOpen?(p.openBlock(),p.createElementBlock("div",fne,[p.createElementVNode("div",gne,[pne,hne,p.createElementVNode("div",bne,[p.createElementVNode("div",yne,[p.createElementVNode("div",vne,[p.createElementVNode("div",wne,[p.createElementVNode("h3",xne,p.toDisplayString(ie.title),1),p.createElementVNode("div",Cne,[p.renderSlot(I.$slots,"default")])])])]),p.createElementVNode("div",Sne,[p.createElementVNode("button",{onClick:_e[0]||(_e[0]=(...qe)=>oe.confirmAction&&oe.confirmAction(...qe)),type:"button",class:"inline-flex justify-center w-full px-4 py-2 text-base font-medium text-white bg-red-600 border border-transparent rounded-md shadow-sm hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm"},p.toDisplayString(ie.button_text),1),p.createElementVNode("button",{onClick:_e[1]||(_e[1]=(...qe)=>oe.cancelAction&&oe.cancelAction(...qe)),type:"button",class:"inline-flex justify-center w-full px-4 py-2 mt-3 text-base font-medium text-gray-700 bg-white border border-gray-300 rounded-md shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"}," Cancel ")])])])])):p.createCommentVNode("",!0)}const _ne=fc(mne,[["render",kne]]),Ene={class:"w-full"},Tne={class:"mb-2 flex justify-between items-center"},Ane={class:"text-sm font-medium text-gray-900 dark:text-white"},Dne={class:"relative bg-gray-50 rounded-lg dark:bg-gray-700 p-4 h-auto"},Nne={class:"overflow-auto max-h-32"},One={class:"text-sm text-gray-500 dark:text-gray-400"},Bne={class:"absolute top-2 end-2 bg-gray-50 dark:bg-gray-700"},$ne={key:0,class:"inline-flex items-center"},Rne=[p.createElementVNode("svg",{class:"w-3 h-3 me-2","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 18 20"},[p.createElementVNode("path",{d:"M16 1h-3.278A1.992 1.992 0 0 0 11 0H7a1.993 1.993 0 0 0-1.722 1H2a2 2 0 0 0-2 2v15a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V3a2 2 0 0 0-2-2Zm-3 14H5a1 1 0 0 1 0-2h8a1 1 0 0 1 0 2Zm0-4H5a1 1 0 0 1 0-2h8a1 1 0 1 1 0 2Zm0-5H5a1 1 0 0 1 0-2h2V2h4v2h2a1 1 0 1 1 0 2Z"})],-1),p.createElementVNode("span",{class:"text-xs font-semibold"},"Copy",-1)],Pne={key:1,class:"inline-flex items-center"},Fne=[p.createElementVNode("svg",{class:"w-3 h-3 text-blue-700 dark:text-blue-500 me-2","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 12"},[p.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M1 5.917 5.724 10.5 15 1.5"})],-1),p.createElementVNode("span",{class:"text-xs font-semibold text-blue-700 dark:text-blue-500"},"Copied",-1)],Mne={class:"mt-2 text-sm text-gray-500 dark:text-gray-400"},Ine={__name:"GlCodeCopy",props:{label_name:{type:String,default:""},code:{type:String,default:""},description:{type:String,default:""}},setup(I){const _e=I,ie=p.ref(!1),He=oe=>{navigator.clipboard.writeText(oe).then(function(){ie.value=!0,setTimeout(()=>{ie.value=!1},2e3)}).catch(function(qe){console.error("Error copying to clipboard: ",qe)})},Re=p.computed(()=>_e.code);return(oe,qe)=>(p.openBlock(),p.createElementBlock("div",Ene,[p.createElementVNode("div",Tne,[p.createElementVNode("p",Ane,p.toDisplayString(I.label_name),1)]),p.createElementVNode("div",Dne,[p.createElementVNode("div",Nne,[p.createElementVNode("code",One,p.toDisplayString(Re.value),1)]),p.createElementVNode("div",Bne,[p.createElementVNode("button",{onClick:qe[0]||(qe[0]=te=>He(Re.value)),class:"text-gray-900 dark:text-gray-400 m-1 hover:bg-gray-100 dark:bg-gray-800 dark:border-gray-600 dark:hover:bg-gray-700 rounded-lg py-2 px-3 inline-flex items-center justify-center bg-white border-gray-200 border"},[ie.value?p.createCommentVNode("",!0):(p.openBlock(),p.createElementBlock("span",$ne,Rne)),ie.value?(p.openBlock(),p.createElementBlock("span",Pne,Fne)):p.createCommentVNode("",!0)])])]),p.createElementVNode("p",Mne,p.toDisplayString(I.description),1)]))}},Lne={class:"w-full"},Vne={class:"flex justify-between items-center"},zne={class:"gl-label-form"},Hne={class:"flex items-center"},Une={class:"flex-shrink-0 z-10 inline-flex items-center p-2 text-sm font-medium text-center text-gray-900 bg-gray-100 border border-gray-300 rounded-s-lg dark:bg-gray-600 dark:text-white dark:border-gray-600"},Wne={class:"relative w-full"},jne=["value"],Gne={key:0},qne=[p.createElementVNode("svg",{class:"w-4 h-4","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 18 20"},[p.createElementVNode("path",{d:"M16 1h-3.278A1.992 1.992 0 0 0 11 0H7a1.993 1.993 0 0 0-1.722 1H2a2 2 0 0 0-2 2v15a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V3a2 2 0 0 0-2-2Zm-3 14H5a1 1 0 0 1 0-2h8a1 1 0 0 1 0 2Zm0-4H5a1 1 0 0 1 0-2h8a1 1 0 1 1 0 2Zm0-5H5a1 1 0 0 1 0-2h2V2h4v2h2a1 1 0 1 1 0 2Z"})],-1)],Kne={key:1,class:"inline-flex items-center"},Yne=[p.createElementVNode("svg",{class:"w-4 h-4","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 12"},[p.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M1 5.917 5.724 10.5 15 1.5"})],-1)],Xne={class:"mt-2 text-sm text-gray-500 dark:text-gray-400"},Zne={__name:"GlTextCopy",props:{label_name:{type:String,default:""},text_name:{type:String,default:""},code:{type:String,default:""},description:{type:String,default:""}},setup(I){const _e=I,ie=p.ref(!1),He=oe=>{navigator.clipboard.writeText(oe).then(function(){ie.value=!0,setTimeout(()=>{ie.value=!1},2e3)}).catch(function(qe){console.error("Error copying to clipboard: ",qe)})},Re=p.computed(()=>_e.code);return(oe,qe)=>(p.openBlock(),p.createElementBlock("div",Lne,[p.createElementVNode("div",Vne,[p.createElementVNode("label",zne,p.toDisplayString(I.label_name),1)]),p.createElementVNode("div",Hne,[p.createElementVNode("span",Une,p.toDisplayString(I.text_name),1),p.createElementVNode("div",Wne,[p.createElementVNode("input",{type:"text","aria-describedby":"helper-text-explanation",class:"bg-gray-50 border border-e-0 border-gray-300 text-gray-500 dark:text-gray-400 text-sm border-s-0 focus:ring-blue-500 focus:border-blue-500 block w-full p-2 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:focus:ring-blue-500 dark:focus:border-blue-500",value:Re.value,readonly:"",disabled:""},null,8,jne)]),p.createElementVNode("button",{style:{padding:".61rem"},onClick:qe[0]||(qe[0]=te=>He(Re.value)),class:"flex-shrink-0 z-10 inline-flex items-center px-4 text-sm font-medium text-center text-white bg-blue-700 rounded-e-lg hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800 border border-blue-700 dark:border-blue-600 hover:border-blue-800 dark:hover:border-blue-700",type:"button"},[ie.value?p.createCommentVNode("",!0):(p.openBlock(),p.createElementBlock("span",Gne,qne)),ie.value?(p.openBlock(),p.createElementBlock("span",Kne,Yne)):p.createCommentVNode("",!0)])]),p.createElementVNode("p",Xne,p.toDisplayString(I.description),1)]))}};Ws.DatatableStatusTextLabelGeneral=Gte,Ws.GLDatatableCommand=dne,Ws.GLDatatableDateTime=Xte,Ws.GLDatatableStatusServer=ane,Ws.GlAccordion=QQ,Ws.GlAccordionsWrapper=jQ,Ws.GlButton=UK,Ws.GlCard=xK,Ws.GlCodeCopy=Ine,Ws.GlConfirmationModal=_ne,Ws.GlDataTable=HQ,Ws.GlDataTableServerSide=OJ,Ws.GlDataTableServerSideGroupBy=sQ,Ws.GlDatatableAction=wee,Ws.GlDatatableDeleteAction=Tee,Ws.GlDatatableFileDownload=Pee,Ws.GlDatatableFiles=Uee,Ws.GlDatatableHtml=Kee,Ws.GlDatatableList=Qee,Ws.GlDatatablePicture=ate,Ws.GlDatatableStatus=gte,Ws.GlDatatableStatusGeneral=Ate,Ws.GlDatatableStatusSpecficColor=Bte,Ws.GlDeleteConfirmationModal=I$,Ws.GlDropdown=TZ,Ws.GlFilesUpload=dK,Ws.GlLanguageSelector=bK,Ws.GlModal=UX,Ws.GlMultiItemSlide=FX,Ws.GlMultiSelectDropdown=LK,Ws.GlTab=WY,Ws.GlTabsWrapper=VY,Ws.GlTailwindPagination=S3,Ws.GlTextCopy=Zne,Ws.GlTextInput=NY,Ws.GlTextTranslate=CY,Ws.GlTextarea=PZ,Ws.GlTextareaTranslate=eY,Ws.GlTinymce=GZ,Ws.GlTinymceTranslate=dY,Ws.GlToast=aT,Ws.GlToastList=uee,Ws.GlToggleBox=oZ,Object.defineProperty(Ws,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"./dist/style.css": "./dist/style.css"
|
|
18
18
|
},
|
|
19
19
|
"private": false,
|
|
20
|
-
"version": "1.0.
|
|
20
|
+
"version": "1.0.180",
|
|
21
21
|
"scripts": {
|
|
22
22
|
"dev": "vite",
|
|
23
23
|
"build": "vite build",
|
|
@@ -33,6 +33,6 @@
|
|
|
33
33
|
"sass": "^1.75.0",
|
|
34
34
|
"tailwindcss": "^3.4.1",
|
|
35
35
|
"vite": "^5.2.0",
|
|
36
|
-
"tinymce": "^6.
|
|
36
|
+
"tinymce": "^6.8.3"
|
|
37
37
|
}
|
|
38
38
|
}
|