var TN=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Dye(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}var Nc={exports:{}};/** * @license * Lodash * Copyright OpenJS Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */(function(o,e){(function(){var t,s="4.17.21",a=200,l="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",f="Expected a function",d="Invalid `variable` option passed into `_.template`",h="__lodash_hash_undefined__",b=500,w="__lodash_placeholder__",k=1,T=2,R=4,$=1,Q=2,F=1,U=2,ee=4,I=8,te=16,oe=32,ne=64,G=128,ye=256,Se=512,Ae=30,Oe="...",ue=800,rt=16,nt=1,St=2,V=3,ht=1/0,We=9007199254740991,Ct=17976931348623157e292,Ot=0/0,$e=4294967295,Je=$e-1,an=$e>>>1,Tt=[["ary",G],["bind",F],["bindKey",U],["curry",I],["curryRight",te],["flip",Se],["partial",oe],["partialRight",ne],["rearg",ye]],An="[object Arguments]",Xe="[object Array]",wt="[object AsyncFunction]",he="[object Boolean]",Zo="[object Date]",ao="[object DOMException]",wn="[object Error]",Co="[object Function]",zo="[object GeneratorFunction]",yt="[object Map]",Wt="[object Number]",mt="[object Null]",Ie="[object Object]",Gt="[object Promise]",gn="[object Proxy]",Dt="[object RegExp]",Dn="[object Set]",Hn="[object String]",ps="[object Symbol]",oo="[object Undefined]",Ss="[object WeakMap]",Mr="[object WeakSet]",Rs="[object ArrayBuffer]",er="[object DataView]",Xs="[object Float32Array]",wa="[object Float64Array]",ur="[object Int8Array]",$s="[object Int16Array]",jr="[object Int32Array]",$o="[object Uint8Array]",Mo="[object Uint8ClampedArray]",Rr="[object Uint16Array]",Ls="[object Uint32Array]",aa=/\b__p \+= '';/g,bs=/\b(__p \+=) '' \+/g,_a=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ln=/&(?:amp|lt|gt|quot|#39);/g,vs=/[&<>"']/g,Qi=RegExp(ln.source),ze=RegExp(vs.source),et=/<%-([\s\S]+?)%>/g,At=/<%([\s\S]+?)%>/g,Vt=/<%=([\s\S]+?)%>/g,Xn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,uo=/^\w*$/,Oo=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,un=/[\\^$.*+?()[\]{}|]/g,os=RegExp(un.source),Eo=/^\s+/,fs=/\s/,kr=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Lr=/\{\n\/\* \[wrapped with (.+)\] \*/,Vs=/,? & /,Ur=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Zi=/[()=,{}\[\]\/\s]/,Fa=/\\(\\)?/g,vi=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,qe=/\w*$/,je=/^[-+]0x[0-9a-f]+$/i,It=/^0b[01]+$/i,Ut=/^\[object .+?Constructor\]$/,fo=/^0o[0-7]+$/i,Lo=/^(?:0|[1-9]\d*)$/,Go=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Jr=/($^)/,at=/['\n\r\u2028\u2029\\]/g,Xo="\\ud800-\\udfff",Ni="\\u0300-\\u036f",la="\\ufe20-\\ufe2f",ma="\\u20d0-\\u20ff",gr=Ni+la+ma,Ic="\\u2700-\\u27bf",wc="a-z\\xdf-\\xf6\\xf8-\\xff",tl="\\xac\\xb1\\xd7\\xf7",ga="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",tr="\\u2000-\\u206f",Ar=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ki="A-Z\\xc0-\\xd6\\xd8-\\xde",gl="\\ufe0e\\ufe0f",_c=tl+ga+tr+Ar,Jc="['\u2019]",_u="["+Xo+"]",yr="["+_c+"]",nl="["+gr+"]",Su="\\d+",eu="["+Ic+"]",Ul="["+wc+"]",Aa="[^"+Xo+_c+Su+Ic+wc+Ki+"]",Dr="\\ud83c[\\udffb-\\udfff]",Lm="(?:"+nl+"|"+Dr+")",_f="[^"+Xo+"]",xr="(?:\\ud83c[\\udde6-\\uddff]){2}",Qa="[\\ud800-\\udbff][\\udc00-\\udfff]",ca="["+Ki+"]",Ji="\\u200d",Cu="(?:"+Ul+"|"+Aa+")",Bc="(?:"+ca+"|"+Aa+")",Za="(?:"+Jc+"(?:d|ll|m|re|s|t|ve))?",Lc="(?:"+Jc+"(?:D|LL|M|RE|S|T|VE))?",Sc=Lm+"?",wd="["+gl+"]?",Hf="(?:"+Ji+"(?:"+[_f,xr,Qa].join("|")+")"+wd+Sc+")*",ku="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Yl="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Fc=wd+Sc+Hf,Sf="(?:"+[eu,xr,Qa].join("|")+")"+Fc,tu="(?:"+[_f+nl+"?",nl,xr,Qa,_u].join("|")+")",_d=RegExp(Jc,"g"),Te=RegExp(nl,"g"),tt=RegExp(Dr+"(?="+Dr+")|"+tu+Fc,"g"),gt=RegExp([ca+"?"+Ul+"+"+Za+"(?="+[yr,ca,"$"].join("|")+")",Bc+"+"+Lc+"(?="+[yr,ca+Cu,"$"].join("|")+")",ca+"?"+Cu+"+"+Za,ca+"+"+Lc,Yl,ku,Su,Sf].join("|"),"g"),Nt=RegExp("["+Ji+Xo+gr+gl+"]"),On=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Ro=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],$r=-1,ys={};ys[Xs]=ys[wa]=ys[ur]=ys[$s]=ys[jr]=ys[$o]=ys[Mo]=ys[Rr]=ys[Ls]=!0,ys[An]=ys[Xe]=ys[Rs]=ys[he]=ys[er]=ys[Zo]=ys[wn]=ys[Co]=ys[yt]=ys[Wt]=ys[Ie]=ys[Dt]=ys[Dn]=ys[Hn]=ys[Ss]=!1;var as={};as[An]=as[Xe]=as[Rs]=as[er]=as[he]=as[Zo]=as[Xs]=as[wa]=as[ur]=as[$s]=as[jr]=as[yt]=as[Wt]=as[Ie]=as[Dt]=as[Dn]=as[Hn]=as[ps]=as[$o]=as[Mo]=as[Rr]=as[Ls]=!0,as[wn]=as[Co]=as[Ss]=!1;var Ai={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},js={"&":"&","<":"<",">":">",'"':""","'":"'"},zi={"&":"&","<":"<",">":">",""":'"',"'":"'"},xu={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Sd=parseFloat,Gn=parseInt,Fm=typeof TN=="object"&&TN&&TN.Object===Object&&TN,Hi=typeof self=="object"&&self&&self.Object===Object&&self,me=Fm||Hi||Function("return this")(),Ne=e&&!e.nodeType&&e,Ue=Ne&&!0&&o&&!o.nodeType&&o,Bt=Ue&&Ue.exports===Ne,Ln=Bt&&Fm.process,es=function(){try{var pt=Ue&&Ue.require&&Ue.require("util").types;return pt||Ln&&Ln.binding&&Ln.binding("util")}catch{}}(),so=es&&es.isArrayBuffer,Oi=es&&es.isDate,hn=es&&es.isMap,qr=es&&es.isRegExp,Bl=es&&es.isSet,ea=es&&es.isTypedArray;function ri(pt,cn,rn){switch(rn.length){case 0:return pt.call(cn);case 1:return pt.call(cn,rn[0]);case 2:return pt.call(cn,rn[0],rn[1]);case 3:return pt.call(cn,rn[0],rn[1],rn[2])}return pt.apply(cn,rn)}function Cf(pt,cn,rn,Ao){for(var nr=-1,Yr=pt==null?0:pt.length;++nr-1}function Vf(pt,cn,rn){for(var Ao=-1,nr=pt==null?0:pt.length;++Ao-1;);return rn}function Xf(pt,cn){for(var rn=pt.length;rn--&&za(cn,pt[rn],0)>-1;);return rn}function Gd(pt,cn){for(var rn=pt.length,Ao=0;rn--;)pt[rn]===cn&&++Ao;return Ao}var Fg=Lg(Ai),Qm=Lg(js);function Fl(pt){return"\\"+xu[pt]}function Zm(pt,cn){return pt==null?t:pt[cn]}function sl(pt){return Nt.test(pt)}function xf(pt){return On.test(pt)}function Yh(pt){for(var cn,rn=[];!(cn=pt.next()).done;)rn.push(cn.value);return rn}function qu(pt){var cn=-1,rn=Array(pt.size);return pt.forEach(function(Ao,nr){rn[++cn]=[nr,Ao]}),rn}function Xh(pt,cn){return function(rn){return pt(cn(rn))}}function Qc(pt,cn){for(var rn=-1,Ao=pt.length,nr=0,Yr=[];++rn-1}function X1(S,A){var Z=this.__data__,le=Ad(Z,S);return le<0?(++this.size,Z.push([S,A])):Z[le][1]=A,this}Pu.prototype.clear=Ku,Pu.prototype.delete=t0,Pu.prototype.get=n0,Pu.prototype.has=o0,Pu.prototype.set=X1;function Kf(S){var A=-1,Z=S==null?0:S.length;for(this.clear();++A=A?S:A)),S}function Ts(S,A,Z,le,Ce,Ve){var ft,xt=A&k,zt=A&T,bn=A&R;if(Z&&(ft=Ce?Z(S,le,Ce,Ve):Z(S)),ft!==t)return ft;if(!Ol(S))return S;var Zn=Sr(S);if(Zn){if(ft=Ay(S),!xt)return cu(S,ft)}else{var Vn=Tl(S),Fo=Vn==Co||Vn==zo;if(hg(S))return Jm(S,xt);if(Vn==Ie||Vn==An||Fo&&!Ce){if(ft=zt||Fo?{}:ro(S),!xt)return zt?fh(S,q1(ft,S)):ng(S,Ju(ft,S))}else{if(!as[Vn])return Ce?S:{};ft=Dy(S,Vn,xt)}}Ve||(Ve=new xc);var ms=Ve.get(S);if(ms)return ms;Ve.set(S,ft),s1(S)?S.forEach(function(Zs){ft.add(Ts(Zs,A,Z,Zs,S,Ve))}):En(S)&&S.forEach(function(Zs,gi){ft.set(gi,Ts(Zs,A,Z,gi,S,Ve))});var Ns=bn?zt?Si:ig:zt?df:nc,zr=Zn?t:Ns(S);return ks(zr||S,function(Zs,gi){zr&&(gi=Zs,Zs=S[gi]),Um(ft,gi,Ts(Zs,A,Z,gi,S,Ve))}),ft}function Dd(S){var A=nc(S);return function(Z){return xl(Z,S,A)}}function xl(S,A,Z){var le=Z.length;if(S==null)return!le;for(S=yi(S);le--;){var Ce=Z[le],Ve=A[Ce],ft=S[Ce];if(ft===t&&!(Ce in S)||!Ve(ft))return!1}return!0}function ef(S,A,Z){if(typeof S!="function")throw new Sa(f);return rp(function(){S.apply(t,Z)},A)}function Va(S,A,Z,le){var Ce=-1,Ve=Ii,ft=!0,xt=S.length,zt=[],bn=A.length;if(!xt)return zt;Z&&(A=pa(A,Ha(Z))),le?(Ve=Vf,ft=!1):A.length>=a&&(Ve=Vi,ft=!1,A=new lo(A));e:for(;++CeCe?0:Ce+Z),le=le===t||le>Ce?Ce:Xr(le),le<0&&(le+=Ce),le=Z>le?0:Kv(le);Z0&&Z(xt)?A>1?Wa(xt,A-1,Z,le,Ce):Wf(Ce,xt):le||(Ce[Ce.length]=xt)}return Ce}var Xg=f0(),zc=f0(!0);function Jf(S,A){return S&&Xg(S,A,nc)}function ed(S,A){return S&&zc(S,A,nc)}function Wp(S,A){return lc(A,function(Z){return fm(S[Z])})}function Zl(S,A){A=om(A,S);for(var Z=0,le=A.length;S!=null&&ZA}function Kl(S,A){return S!=null&&ii.call(S,A)}function a0(S,A){return S!=null&&A in yi(S)}function Ym(S,A,Z){return S>=Er(A,Z)&&S=120&&Zn.length>=120)?new lo(ft&&Zn):t}Zn=S[0];var Vn=-1,Fo=xt[0];e:for(;++Vn-1;)xt!==S&&nh.call(xt,zt,1),nh.call(S,zt,1);return S}function tf(S,A){for(var Z=S?A.length:0,le=Z-1;Z--;){var Ce=A[Z];if(Z==le||Ce!==Ve){var Ve=Ce;im(Ce)?nh.call(S,Ce,1):Mf(S,Ce)}}return S}function Pf(S,A){return S+Ke(Bi()*(A-S+1))}function lh(S,A,Z,le){for(var Ce=-1,Ve=ho(_e((A-S)/(Z||1)),0),ft=rn(Ve);Ve--;)ft[le?Ve:++Ce]=S,S+=Z;return ft}function ch(S,A){var Z="";if(!S||A<1||A>We)return Z;do A%2&&(Z+=S),A=Ke(A/2),A&&(S+=S);while(A);return Z}function fr(S,A){return Ny(t_(S,A,hf),S+"")}function jm(S){return Mu(mb(S))}function qm(S,A){var Z=mb(S);return Vc(Z,ba(A,0,Z.length))}function oa(S,A,Z,le){if(!Ol(S))return S;A=om(A,S);for(var Ce=-1,Ve=A.length,ft=Ve-1,xt=S;xt!=null&&++CeCe?0:Ce+A),Z=Z>Ce?Ce:Z,Z<0&&(Z+=Ce),Ce=A>Z?0:Z-A>>>0,A>>>=0;for(var Ve=rn(Ce);++le>>1,ft=S[Ve];ft!==null&&!il(ft)&&(Z?ft<=A:ft=a){var bn=A?null:Ey(S);if(bn)return jh(bn);ft=!1,Ce=Vi,zt=new lo}else zt=A?[]:xt;e:for(;++le=le?S:Ps(S,A,Z)}var Pd=zp||function(S){return me.clearTimeout(S)};function Jm(S,A){if(A)return S.slice();var Z=S.length,le=U1?U1(Z):new S.constructor(Z);return S.copy(le),le}function eg(S){var A=new S.constructor(S.byteLength);return new Kh(A).set(new Kh(S)),A}function sm(S,A){var Z=A?eg(S.buffer):S.buffer;return new S.constructor(Z,S.byteOffset,S.byteLength)}function nf(S){var A=new S.constructor(S.source,qe.exec(S));return A.lastIndex=S.lastIndex,A}function u0(S){return qf?yi(qf.call(S)):{}}function J1(S,A){var Z=A?eg(S.buffer):S.buffer;return new S.constructor(Z,S.byteOffset,S.length)}function Jw(S,A){if(S!==A){var Z=S!==t,le=S===null,Ce=S===S,Ve=il(S),ft=A!==t,xt=A===null,zt=A===A,bn=il(A);if(!xt&&!bn&&!Ve&&S>A||Ve&&ft&&zt&&!xt&&!bn||le&&ft&&zt||!Z&&zt||!Ce)return 1;if(!le&&!Ve&&!bn&&S=xt)return zt;var bn=Z[le];return zt*(bn=="desc"?-1:1)}}return S.index-A.index}function Gg(S,A,Z,le){for(var Ce=-1,Ve=S.length,ft=Z.length,xt=-1,zt=A.length,bn=ho(Ve-ft,0),Zn=rn(zt+bn),Vn=!le;++xt1?Z[Ce-1]:t,ft=Ce>2?Z[2]:t;for(Ve=S.length>3&&typeof Ve=="function"?(Ce--,Ve):t,ft&&of(Z[0],Z[1],ft)&&(Ve=Ce<3?t:Ve,Ce=1),A=yi(A);++le-1?Ce[Ve?A[ft]:ft]:t}}function Nv(S){return $d(function(A){var Z=A.length,le=Z,Ce=Du.prototype.thru;for(S&&A.reverse();le--;){var Ve=A[le];if(typeof Ve!="function")throw new Sa(f);if(Ce&&!ft&&Id(Ve)=="wrapper")var ft=new Du([],!0)}for(le=ft?le:Z;++le1&&Ci.reverse(),Zn&&ztxt))return!1;var bn=Ve.get(S),Zn=Ve.get(A);if(bn&&Zn)return bn==A&&Zn==S;var Vn=-1,Fo=!0,ms=Z&Q?new lo:t;for(Ve.set(S,A),Ve.set(A,S);++Vn1?"& ":"")+A[le],A=A.join(Z>2?", ":" "),S.replace(kr,`{ /* [wrapped with `+A+`] */ `)}function Py(S){return Sr(S)||um(S)||!!(kd&&S&&S[kd])}function im(S,A){var Z=typeof S;return A=A==null?We:A,!!A&&(Z=="number"||Z!="symbol"&&Lo.test(S))&&S>-1&&S%1==0&&S0){if(++A>=ue)return arguments[0]}else A=0;return S.apply(t,arguments)}}function Vc(S,A){var Z=-1,le=S.length,Ce=le-1;for(A=A===t?le:A;++Z1?S[A-1]:t;return Z=typeof Z=="function"?(S.pop(),Z):t,Vv(S,Z)});function cp(S){var A=Ee(S);return A.__chain__=!0,A}function Gp(S,A){return A(S),S}function Kp(S,A){return A(S)}var cg=$d(function(S){var A=S.length,Z=A?S[0]:0,le=this.__wrapped__,Ce=function(Ve){return Ui(Ve,S)};return A>1||this.__actions__.length||!(le instanceof hi)||!im(Z)?this.thru(Ce):(le=le.slice(Z,+Z+(A?1:0)),le.__actions__.push({func:Kp,args:[Ce],thisArg:t}),new Du(le,this.__chain__).thru(function(Ve){return A&&!Ve.length&&Ve.push(t),Ve}))});function Wv(){return cp(this)}function sa(){return new Du(this.value(),this.__chain__)}function lf(){this.__values__===t&&(this.__values__=u2(this.value()));var S=this.__index__>=this.__values__.length,A=S?t:this.__values__[this.__index__++];return{done:S,value:A}}function rb(){return this}function KC(S){for(var A,Z=this;Z instanceof Wg;){var le=Qv(Z);le.__index__=0,le.__values__=t,A?Ce.__wrapped__=le:A=le;var Ce=le;Z=Z.__wrapped__}return Ce.__wrapped__=S,A}function Yy(){var S=this.__wrapped__;if(S instanceof hi){var A=S;return this.__actions__.length&&(A=new hi(this)),A=A.reverse(),A.__actions__.push({func:Kp,args:[Ea],thisArg:t}),new Du(A,this.__chain__)}return this.thru(Ea)}function JC(){return jg(this.__wrapped__,this.__actions__)}var Jp=$u(function(S,A,Z){ii.call(S,Z)?++S[Z]:mi(S,Z,1)});function ib(S,A,Z){var le=Sr(S)?Di:nn;return Z&&of(S,A,Z)&&(A=t),le(S,Qs(A,3))}function sd(S,A){var Z=Sr(S)?lc:xa;return Z(S,Qs(A,3))}var Xy=sg(Zv),h_=sg(Fy);function m_(S,A){return Wa(t1(S,A),1)}function ek(S,A){return Wa(t1(S,A),ht)}function g_(S,A,Z){return Z=Z===t?1:Xr(Z),Wa(t1(S,A),Z)}function C0(S,A){var Z=Sr(S)?ks:ka;return Z(S,Qs(A,3))}function k0(S,A){var Z=Sr(S)?nu:Vp;return Z(S,Qs(A,3))}var p_=$u(function(S,A,Z){ii.call(S,Z)?S[Z].push(A):mi(S,Z,[A])});function jy(S,A,Z,le){S=mu(S)?S:mb(S),Z=Z&&!le?Xr(Z):0;var Ce=S.length;return Z<0&&(Z=ho(Ce+Z,0)),If(S)?Z<=Ce&&S.indexOf(A,Z)>-1:!!Ce&&za(S,A,Z)>-1}var e1=fr(function(S,A,Z){var le=-1,Ce=typeof A=="function",Ve=mu(S)?rn(S.length):[];return ka(S,function(ft){Ve[++le]=Ce?ri(A,ft,Z):fc(ft,A,Z)}),Ve}),b_=$u(function(S,A,Z){mi(S,Z,A)});function t1(S,A){var Z=Sr(S)?pa:lt;return Z(S,Qs(A,3))}function ug(S,A,Z,le){return S==null?[]:(Sr(A)||(A=A==null?[]:[A]),Z=le?t:Z,Sr(Z)||(Z=Z==null?[]:[Z]),_i(S,A,Z))}var Uv=$u(function(S,A,Z){S[Z?0:1].push(A)},function(){return[[],[]]});function cf(S,A,Z){var le=Sr(S)?pr:Yf,Ce=arguments.length<3;return le(S,Qs(A,4),Z,Ce,ka)}function ab(S,A,Z){var le=Sr(S)?Yu:Yf,Ce=arguments.length<3;return le(S,Qs(A,4),Z,Ce,Vp)}function qs(S,A){var Z=Sr(S)?lc:xa;return Z(S,wh(Qs(A,3)))}function hu(S){var A=Sr(S)?Mu:jm;return A(S)}function fg(S,A,Z){(Z?of(S,A,Z):A===t)?A=1:A=Xr(A);var le=Sr(S)?Hp:qm;return le(S,A)}function qy(S){var A=Sr(S)?j1:Gm;return A(S)}function Yi(S){if(S==null)return 0;if(mu(S))return If(S)?jf(S):S.length;var A=Tl(S);return A==yt||A==Dn?S.size:j(S).length}function Gy(S,A,Z){var le=Sr(S)?Xu:Fr;return Z&&of(S,A,Z)&&(A=t),le(S,Qs(A,3))}var dg=fr(function(S,A){if(S==null)return[];var Z=A.length;return Z>1&&of(S,A[0],A[1])?A=[]:Z>2&&of(A[0],A[1],A[2])&&(A=[A[0]]),_i(S,Wa(A,1),[])}),Oa=J||function(){return me.Date.now()};function cm(S,A){if(typeof A!="function")throw new Sa(f);return S=Xr(S),function(){if(--S<1)return A.apply(this,arguments)}}function Ht(S,A,Z){return A=Z?t:A,A=S&&A==null?S.length:A,Rd(S,G,t,t,t,t,A)}function x0(S,A){var Z;if(typeof A!="function")throw new Sa(f);return S=Xr(S),function(){return--S>0&&(Z=A.apply(this,arguments)),S<=1&&(A=t),Z}}var Ky=fr(function(S,A,Z){var le=F;if(Z.length){var Ce=Qc(Z,uu(Ky));le|=oe}return Rd(S,le,A,Z,Ce)}),E0=fr(function(S,A,Z){var le=F|U;if(Z.length){var Ce=Qc(Z,uu(E0));le|=oe}return Rd(A,le,S,Z,Ce)});function yh(S,A,Z){A=Z?t:A;var le=Rd(S,I,t,t,t,t,t,A);return le.placeholder=yh.placeholder,le}function uf(S,A,Z){A=Z?t:A;var le=Rd(S,te,t,t,t,t,t,A);return le.placeholder=uf.placeholder,le}function lb(S,A,Z){var le,Ce,Ve,ft,xt,zt,bn=0,Zn=!1,Vn=!1,Fo=!0;if(typeof S!="function")throw new Sa(f);A=id(A)||0,Ol(Z)&&(Zn=!!Z.leading,Vn="maxWait"in Z,Ve=Vn?ho(id(Z.maxWait)||0,A):Ve,Fo="trailing"in Z?!!Z.trailing:Fo);function ms(Ta){var gm=le,ad=Ce;return le=Ce=t,bn=Ta,ft=S.apply(ad,gm),ft}function Ns(Ta){return bn=Ta,xt=rp(gi,A),Zn?ms(Ta):ft}function zr(Ta){var gm=Ta-zt,ad=Ta-bn,C2=A-gm;return Vn?Er(C2,Ve-ad):C2}function Zs(Ta){var gm=Ta-zt,ad=Ta-bn;return zt===t||gm>=A||gm<0||Vn&&ad>=Ve}function gi(){var Ta=Oa();if(Zs(Ta))return Ci(Ta);xt=rp(gi,zr(Ta))}function Ci(Ta){return xt=t,Fo&&le?ms(Ta):(le=Ce=t,ft)}function pu(){xt!==t&&Pd(xt),bn=0,le=zt=Ce=xt=t}function Bu(){return xt===t?ft:Ci(Oa())}function Bf(){var Ta=Oa(),gm=Zs(Ta);if(le=arguments,Ce=this,zt=Ta,gm){if(xt===t)return Ns(zt);if(Vn)return Pd(xt),xt=rp(gi,A),ms(zt)}return xt===t&&(xt=rp(gi,A)),ft}return Bf.cancel=pu,Bf.flush=Bu,Bf}var Yv=fr(function(S,A){return ef(S,1,A)}),Jy=fr(function(S,A,Z){return ef(S,id(A)||0,Z)});function Xv(S){return Rd(S,Se)}function T0(S,A){if(typeof S!="function"||A!=null&&typeof A!="function")throw new Sa(f);var Z=function(){var le=arguments,Ce=A?A.apply(this,le):le[0],Ve=Z.cache;if(Ve.has(Ce))return Ve.get(Ce);var ft=S.apply(this,le);return Z.cache=Ve.set(Ce,ft)||Ve,ft};return Z.cache=new(T0.Cache||Kf),Z}T0.Cache=Kf;function wh(S){if(typeof S!="function")throw new Sa(f);return function(){var A=arguments;switch(A.length){case 0:return!S.call(this);case 1:return!S.call(this,A[0]);case 2:return!S.call(this,A[0],A[1]);case 3:return!S.call(this,A[0],A[1],A[2])}return!S.apply(this,A)}}function rd(S){return x0(2,S)}var Nu=Ra(function(S,A){A=A.length==1&&Sr(A[0])?pa(A[0],Ha(Qs())):pa(Wa(A,1),Ha(Qs()));var Z=A.length;return fr(function(le){for(var Ce=-1,Ve=Er(le.length,Z);++Ce=A}),um=Et(function(){return arguments}())?Et:function(S){return Pl(S)&&ii.call(S,"callee")&&!Jh.call(S,"callee")},Sr=rn.isArray,y_=so?Ha(so):Ec;function mu(S){return S!=null&&o1(S.length)&&!fm(S)}function Dl(S){return Pl(S)&&mu(S)}function o2(S){return S===!0||S===!1||Pl(S)&&Ua(S)==he}var hg=Pn||hm,gc=Oi?Ha(Oi):su;function kT(S){return Pl(S)&&S.nodeType===1&&!cb(S)}function mg(S){if(S==null)return!0;if(mu(S)&&(Sr(S)||typeof S=="string"||typeof S.splice=="function"||hg(S)||Bd(S)||um(S)))return!S.length;var A=Tl(S);if(A==yt||A==Dn)return!S.size;if(op(S))return!j(S).length;for(var Z in S)if(ii.call(S,Z))return!1;return!0}function tk(S,A){return dc(S,A)}function nk(S,A,Z){Z=typeof Z=="function"?Z:t;var le=Z?Z(S,A):t;return le===t?dc(S,A,t,Z):!!le}function s2(S){if(!Pl(S))return!1;var A=Ua(S);return A==wn||A==ao||typeof S.message=="string"&&typeof S.name=="string"&&!cb(S)}function r2(S){return typeof S=="number"&&_n(S)}function fm(S){if(!Ol(S))return!1;var A=Ua(S);return A==Co||A==zo||A==wt||A==gn}function i2(S){return typeof S=="number"&&S==Xr(S)}function o1(S){return typeof S=="number"&&S>-1&&S%1==0&&S<=We}function Ol(S){var A=typeof S;return S!=null&&(A=="object"||A=="function")}function Pl(S){return S!=null&&typeof S=="object"}var En=hn?Ha(hn):Xa;function ok(S,A){return S===A||ja(S,A,mh(A))}function tc(S,A,Z){return Z=typeof Z=="function"?Z:t,ja(S,A,mh(A),Z)}function sk(S){return l2(S)&&S!=+S}function a2(S){if($f(S))throw new nr(l);return Xm(S)}function no(S){return S===null}function Tc(S){return S==null}function l2(S){return typeof S=="number"||Pl(S)&&Ua(S)==Wt}function cb(S){if(!Pl(S)||Ua(S)!=Ie)return!1;var A=Hm(S);if(A===null)return!0;var Z=ii.call(A,"constructor")&&A.constructor;return typeof Z=="function"&&Z instanceof Z&&Gu.call(Z)==W1}var ff=qr?Ha(qr):ru;function Gv(S){return i2(S)&&S>=-We&&S<=We}var s1=Bl?Ha(Bl):l0;function If(S){return typeof S=="string"||!Sr(S)&&Pl(S)&&Ua(S)==Hn}function il(S){return typeof S=="symbol"||Pl(S)&&Ua(S)==ps}var Bd=ea?Ha(ea):Ho;function Ld(S){return S===t}function Uc(S){return Pl(S)&&Tl(S)==Ss}function ub(S){return Pl(S)&&Ua(S)==Mr}var c2=li(De),w_=li(function(S,A){return S<=A});function u2(S){if(!S)return[];if(mu(S))return If(S)?Xl(S):cu(S);if(ai&&S[ai])return Yh(S[ai]());var A=Tl(S),Z=A==yt?qu:A==Dn?jh:mb;return Z(S)}function _h(S){if(!S)return S===0?S:0;if(S=id(S),S===ht||S===-ht){var A=S<0?-1:1;return A*Ct}return S===S?S:0}function Xr(S){var A=_h(S),Z=A%1;return A===A?Z?A-Z:A:0}function Kv(S){return S?ba(Xr(S),0,$e):0}function id(S){if(typeof S=="number")return S;if(il(S))return Ot;if(Ol(S)){var A=typeof S.valueOf=="function"?S.valueOf():S;S=Ol(A)?A+"":A}if(typeof S!="string")return S===0?S:+S;S=Ll(S);var Z=It.test(S);return Z||fo.test(S)?Gn(S.slice(2),Z?2:8):je.test(S)?Ot:+S}function __(S){return Rf(S,df(S))}function S_(S){return S?ba(Xr(S),-We,We):S===0?S:0}function fa(S){return S==null?"":Gi(S)}var rk=Md(function(S,A){if(op(A)||mu(A)){Rf(A,nc(A),S);return}for(var Z in A)ii.call(A,Z)&&Um(S,Z,A[Z])}),Jv=Md(function(S,A){Rf(A,df(A),S)}),eO=Md(function(S,A,Z,le){Rf(A,df(A),S,le)}),C_=Md(function(S,A,Z,le){Rf(A,nc(A),S,le)}),ik=$d(Ui);function fb(S,A){var Z=Tf(S);return A==null?Z:Ju(Z,A)}var k_=fr(function(S,A){S=yi(S);var Z=-1,le=A.length,Ce=le>2?A[2]:t;for(Ce&&of(A[0],A[1],Ce)&&(le=1);++Z1),Ve}),Rf(S,Si(S),Z),le&&(Z=Ts(Z,k|T|R,VC));for(var Ce=A.length;Ce--;)Mf(Z,A[Ce]);return Z});function D_(S,A){return dp(S,wh(Qs(A)))}var P_=$d(function(S,A){return S==null?{}:or(S,A)});function dp(S,A){if(S==null)return{};var Z=pa(Si(S),function(le){return[le]});return A=Qs(A),_r(S,Z,function(le,Ce){return A(le,Ce[0])})}function dk(S,A,Z){A=om(A,S);var le=-1,Ce=A.length;for(Ce||(Ce=1,S=t);++leA){var le=S;S=A,A=le}if(Z||S%1||A%1){var Ce=Bi();return Er(S+Ce*(A-S+Sd("1e-"+((Ce+"").length-1))),A)}return Pf(S,A)}var $_=dh(function(S,A,Z){return A=A.toLowerCase(),S+(Z?Sh(A):A)});function Sh(S){return gb(fa(S).toLowerCase())}function R0(S){return S=fa(S),S&&S.replace(Go,Fg).replace(Te,"")}function N_(S,A,Z){S=fa(S),A=Gi(A);var le=S.length;Z=Z===t?le:ba(Xr(Z),0,le);var Ce=Z;return Z-=A.length,Z>=0&&S.slice(Z,Ce)==A}function Ch(S){return S=fa(S),S&&ze.test(S)?S.replace(vs,Qm):S}function hp(S){return S=fa(S),S&&os.test(S)?S.replace(un,"\\$&"):S}var h2=dh(function(S,A,Z){return S+(Z?"-":"")+A.toLowerCase()}),I_=dh(function(S,A,Z){return S+(Z?" ":"")+A.toLowerCase()}),iO=Rv("toLowerCase");function gk(S,A,Z){S=fa(S),A=Xr(A);var le=A?jf(S):0;if(!A||le>=A)return S;var Ce=(A-le)/2;return Jg(Ke(Ce),Z)+S+Jg(_e(Ce),Z)}function B_(S,A,Z){S=fa(S),A=Xr(A);var le=A?jf(S):0;return A&&le>>0,Z?(S=fa(S),S&&(typeof A=="string"||A!=null&&!ff(A))&&(A=Gi(A),!A&&sl(S))?uh(Xl(S),0,Z):S.split(A,Z)):[]}var Ok=dh(function(S,A,Z){return S+(Z?" ":"")+gb(A)});function yk(S,A,Z){return S=fa(S),Z=Z==null?0:ba(Xr(Z),0,S.length),A=Gi(A),S.slice(Z,Z+A.length)==A}function Z_(S,A,Z){var le=Ee.templateSettings;Z&&of(S,A,Z)&&(A=t),S=fa(S),A=eO({},A,le,e_);var Ce=eO({},A.imports,le.imports,e_),Ve=nc(Ce),ft=qi(Ce,Ve),xt,zt,bn=0,Zn=A.interpolate||Jr,Vn="__p += '",Fo=Jd((A.escape||Jr).source+"|"+Zn.source+"|"+(Zn===Vt?vi:Jr).source+"|"+(A.evaluate||Jr).source+"|$","g"),ms="//# sourceURL="+(ii.call(A,"sourceURL")?(A.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++$r+"]")+` `;S.replace(Fo,function(Zs,gi,Ci,pu,Bu,Bf){return Ci||(Ci=pu),Vn+=S.slice(bn,Bf).replace(at,Fl),gi&&(xt=!0,Vn+=`' + __e(`+gi+`) + '`),Bu&&(zt=!0,Vn+=`'; `+Bu+`; __p += '`),Ci&&(Vn+=`' + ((__t = (`+Ci+`)) == null ? '' : __t) + '`),bn=Bf+Zs.length,Zs}),Vn+=`'; `;var Ns=ii.call(A,"variable")&&A.variable;if(!Ns)Vn=`with (obj) { `+Vn+` } `;else if(Zi.test(Ns))throw new nr(d);Vn=(zt?Vn.replace(aa,""):Vn).replace(bs,"$1").replace(_a,"$1;"),Vn="function("+(Ns||"obj")+`) { `+(Ns?"":`obj || (obj = {}); `)+"var __t, __p = ''"+(xt?", __e = _.escape":"")+(zt?`, __j = Array.prototype.join; function print() { __p += __j.call(arguments, '') } `:`; `)+Vn+`return __p }`;var zr=p2(function(){return Yr(Ve,ms+"return "+Vn).apply(t,ft)});if(zr.source=Vn,s2(zr))throw zr;return zr}function m2(S){return fa(S).toLowerCase()}function g2(S){return fa(S).toUpperCase()}function wk(S,A,Z){if(S=fa(S),S&&(Z||A===t))return Ll(S);if(!S||!(A=Gi(A)))return S;var le=Xl(S),Ce=Xl(A),Ve=cc(le,Ce),ft=Xf(le,Ce)+1;return uh(le,Ve,ft).join("")}function _k(S,A,Z){if(S=fa(S),S&&(Z||A===t))return S.slice(0,Qg(S)+1);if(!S||!(A=Gi(A)))return S;var le=Xl(S),Ce=Xf(le,Xl(A))+1;return uh(le,0,Ce).join("")}function aO(S,A,Z){if(S=fa(S),S&&(Z||A===t))return S.replace(Eo,"");if(!S||!(A=Gi(A)))return S;var le=Xl(S),Ce=cc(le,Xl(A));return uh(le,Ce).join("")}function z_(S,A){var Z=Ae,le=Oe;if(Ol(A)){var Ce="separator"in A?A.separator:Ce;Z="length"in A?Xr(A.length):Z,le="omission"in A?Gi(A.omission):le}S=fa(S);var Ve=S.length;if(sl(S)){var ft=Xl(S);Ve=ft.length}if(Z>=Ve)return S;var xt=Z-jf(le);if(xt<1)return le;var zt=ft?uh(ft,0,xt).join(""):S.slice(0,xt);if(Ce===t)return zt+le;if(ft&&(xt+=zt.length-xt),ff(Ce)){if(S.slice(xt).search(Ce)){var bn,Zn=zt;for(Ce.global||(Ce=Jd(Ce.source,fa(qe.exec(Ce))+"g")),Ce.lastIndex=0;bn=Ce.exec(Zn);)var Vn=bn.index;zt=zt.slice(0,Vn===t?xt:Vn)}}else if(S.indexOf(Gi(Ce),xt)!=xt){var Fo=zt.lastIndexOf(Ce);Fo>-1&&(zt=zt.slice(0,Fo))}return zt+le}function lO(S){return S=fa(S),S&&Qi.test(S)?S.replace(ln,Ge):S}var $0=dh(function(S,A,Z){return S+(Z?" ":"")+A.toUpperCase()}),gb=Rv("toUpperCase");function cO(S,A,Z){return S=fa(S),A=Z?t:A,A===t?xf(S)?Zg(S):qd(S):S.match(A)||[]}var p2=fr(function(S,A){try{return ri(S,t,A)}catch(Z){return s2(Z)?Z:new nr(Z)}}),H_=$d(function(S,A){return ks(A,function(Z){Z=sf(Z),mi(S,Z,Ky(S[Z],S))}),S});function b2(S){var A=S==null?0:S.length,Z=Qs();return S=A?pa(S,function(le){if(typeof le[1]!="function")throw new Sa(f);return[Z(le[0]),le[1]]}):[],fr(function(le){for(var Ce=-1;++CeWe)return[];var Z=$e,le=Er(S,$e);A=Qs(A),S-=$e;for(var Ce=Pr(le,A);++Z0||A<0)?new hi(Z):(S<0?Z=Z.takeRight(-S):S&&(Z=Z.drop(S)),A!==t&&(A=Xr(A),Z=A<0?Z.dropRight(-A):Z.take(A-S)),Z)},hi.prototype.takeRightWhile=function(S){return this.reverse().takeWhile(S).reverse()},hi.prototype.toArray=function(){return this.take($e)},Jf(hi.prototype,function(S,A){var Z=/^(?:filter|find|map|reject)|While$/.test(A),le=/^(?:head|last)$/.test(A),Ce=Ee[le?"take"+(A=="last"?"Right":""):A],Ve=le||/^find/.test(A);!Ce||(Ee.prototype[A]=function(){var ft=this.__wrapped__,xt=le?[1]:arguments,zt=ft instanceof hi,bn=xt[0],Zn=zt||Sr(ft),Vn=function(gi){var Ci=Ce.apply(Ee,Wf([gi],xt));return le&&Fo?Ci[0]:Ci};Zn&&Z&&typeof bn=="function"&&bn.length!=1&&(zt=Zn=!1);var Fo=this.__chain__,ms=!!this.__actions__.length,Ns=Ve&&!Fo,zr=zt&&!ms;if(!Ve&&Zn){ft=zr?ft:new hi(this);var Zs=S.apply(ft,xt);return Zs.__actions__.push({func:Kp,args:[Vn],thisArg:t}),new Du(Zs,Fo)}return Ns&&zr?S.apply(this,xt):(Zs=this.thru(Vn),Ns?le?Zs.value()[0]:Zs.value():Zs)})}),ks(["pop","push","shift","sort","splice","unshift"],function(S){var A=Cd[S],Z=/^(?:push|sort|unshift)$/.test(S)?"tap":"thru",le=/^(?:pop|shift)$/.test(S);Ee.prototype[S]=function(){var Ce=arguments;if(le&&!this.__chain__){var Ve=this.value();return A.apply(Sr(Ve)?Ve:[],Ce)}return this[Z](function(ft){return A.apply(Sr(ft)?ft:[],Ce)})}}),Jf(hi.prototype,function(S,A){var Z=Ee[A];if(Z){var le=Z.name+"";ii.call(na,le)||(na[le]=[]),na[le].push({name:A,func:Z})}}),na[sr(t,U).name]=[{name:"wrapper",func:t}],hi.prototype.clone=Dv,hi.prototype.reverse=Y1,hi.prototype.value=e0,Ee.prototype.at=cg,Ee.prototype.chain=Wv,Ee.prototype.commit=sa,Ee.prototype.next=lf,Ee.prototype.plant=KC,Ee.prototype.reverse=Yy,Ee.prototype.toJSON=Ee.prototype.valueOf=Ee.prototype.value=JC,Ee.prototype.first=Ee.prototype.head,ai&&(Ee.prototype[ai]=rb),Ee},qh=V1();Ue?((Ue.exports=qh)._=qh,Ne._=qh):me._=qh}).call(TN)})(Nc,Nc.exports);const Pye=Nc.exports;var Age={exports:{}},Bse={exports:{}},Dge=function(e,t){return function(){for(var a=new Array(arguments.length),l=0;l"u"}function Rye(o){return o!==null&&!poe(o)&&o.constructor!==null&&!poe(o.constructor)&&typeof o.constructor.isBuffer=="function"&&o.constructor.isBuffer(o)}function Pge(o){return BC.call(o)==="[object ArrayBuffer]"}function $ye(o){return BC.call(o)==="[object FormData]"}function Nye(o){var e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(o):e=o&&o.buffer&&Pge(o.buffer),e}function Iye(o){return typeof o=="string"}function Bye(o){return typeof o=="number"}function Mge(o){return o!==null&&typeof o=="object"}function gz(o){if(BC.call(o)!=="[object Object]")return!1;var e=Object.getPrototypeOf(o);return e===null||e===Object.prototype}function Lye(o){return BC.call(o)==="[object Date]"}function Fye(o){return BC.call(o)==="[object File]"}function Qye(o){return BC.call(o)==="[object Blob]"}function Rge(o){return BC.call(o)==="[object Function]"}function Zye(o){return Mge(o)&&Rge(o.pipe)}function zye(o){return BC.call(o)==="[object URLSearchParams]"}function Hye(o){return o.trim?o.trim():o.replace(/^\s+|\s+$/g,"")}function Vye(){return typeof navigator<"u"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")?!1:typeof window<"u"&&typeof document<"u"}function Fse(o,e){if(!(o===null||typeof o>"u"))if(typeof o!="object"&&(o=[o]),Lse(o))for(var t=0,s=o.length;t"u"||(U4.isArray(h)?b=b+"[]":h=[h],U4.forEach(h,function(k){U4.isDate(k)?k=k.toISOString():U4.isObject(k)&&(k=JSON.stringify(k)),l.push(Mae(b)+"="+Mae(k))}))}),a=l.join("&")}if(a){var f=e.indexOf("#");f!==-1&&(e=e.slice(0,f)),e+=(e.indexOf("?")===-1?"?":"&")+a}return e},Yye=Fp;function $H(){this.handlers=[]}$H.prototype.use=function(e,t,s){return this.handlers.push({fulfilled:e,rejected:t,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1};$H.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)};$H.prototype.forEach=function(e){Yye.forEach(this.handlers,function(s){s!==null&&e(s)})};var Xye=$H,jye=Fp,qye=function(e,t){jye.forEach(e,function(a,l){l!==t&&l.toUpperCase()===t.toUpperCase()&&(e[t]=a,delete e[l])})},Nge=function(e,t,s,a,l){return e.config=t,s&&(e.code=s),e.request=a,e.response=l,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},e},Nte,Rae;function Ige(){if(Rae)return Nte;Rae=1;var o=Nge;return Nte=function(t,s,a,l,f){var d=new Error(t);return o(d,s,a,l,f)},Nte}var Ite,$ae;function Gye(){if($ae)return Ite;$ae=1;var o=Ige();return Ite=function(t,s,a){var l=a.config.validateStatus;!a.status||!l||l(a.status)?t(a):s(o("Request failed with status code "+a.status,a.config,null,a.request,a))},Ite}var Bte,Nae;function Kye(){if(Nae)return Bte;Nae=1;var o=Fp;return Bte=o.isStandardBrowserEnv()?function(){return{write:function(s,a,l,f,d,h){var b=[];b.push(s+"="+encodeURIComponent(a)),o.isNumber(l)&&b.push("expires="+new Date(l).toGMTString()),o.isString(f)&&b.push("path="+f),o.isString(d)&&b.push("domain="+d),h===!0&&b.push("secure"),document.cookie=b.join("; ")},read:function(s){var a=document.cookie.match(new RegExp("(^|;\\s*)("+s+")=([^;]*)"));return a?decodeURIComponent(a[3]):null},remove:function(s){this.write(s,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}(),Bte}var Lte,Iae;function Jye(){return Iae||(Iae=1,Lte=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}),Lte}var Fte,Bae;function e2e(){return Bae||(Bae=1,Fte=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}),Fte}var Qte,Lae;function t2e(){if(Lae)return Qte;Lae=1;var o=Jye(),e=e2e();return Qte=function(s,a){return s&&!o(a)?e(s,a):a},Qte}var Zte,Fae;function n2e(){if(Fae)return Zte;Fae=1;var o=Fp,e=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];return Zte=function(s){var a={},l,f,d;return s&&o.forEach(s.split(` `),function(b){if(d=b.indexOf(":"),l=o.trim(b.substr(0,d)).toLowerCase(),f=o.trim(b.substr(d+1)),l){if(a[l]&&e.indexOf(l)>=0)return;l==="set-cookie"?a[l]=(a[l]?a[l]:[]).concat([f]):a[l]=a[l]?a[l]+", "+f:f}}),a},Zte}var zte,Qae;function o2e(){if(Qae)return zte;Qae=1;var o=Fp;return zte=o.isStandardBrowserEnv()?function(){var t=/(msie|trident)/i.test(navigator.userAgent),s=document.createElement("a"),a;function l(f){var d=f;return t&&(s.setAttribute("href",d),d=s.href),s.setAttribute("href",d),{href:s.href,protocol:s.protocol?s.protocol.replace(/:$/,""):"",host:s.host,search:s.search?s.search.replace(/^\?/,""):"",hash:s.hash?s.hash.replace(/^#/,""):"",hostname:s.hostname,port:s.port,pathname:s.pathname.charAt(0)==="/"?s.pathname:"/"+s.pathname}}return a=l(window.location.href),function(d){var h=o.isString(d)?l(d):d;return h.protocol===a.protocol&&h.host===a.host}}():function(){return function(){return!0}}(),zte}var Hte,Zae;function NH(){if(Zae)return Hte;Zae=1;function o(e){this.message=e}return o.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},o.prototype.__CANCEL__=!0,Hte=o,Hte}var Vte,zae;function Hae(){if(zae)return Vte;zae=1;var o=Fp,e=Gye(),t=Kye(),s=$ge,a=t2e(),l=n2e(),f=o2e(),d=Ige(),h=IH(),b=NH();return Vte=function(k){return new Promise(function(R,$){var Q=k.data,F=k.headers,U=k.responseType,ee;function I(){k.cancelToken&&k.cancelToken.unsubscribe(ee),k.signal&&k.signal.removeEventListener("abort",ee)}o.isFormData(Q)&&delete F["Content-Type"];var te=new XMLHttpRequest;if(k.auth){var oe=k.auth.username||"",ne=k.auth.password?unescape(encodeURIComponent(k.auth.password)):"";F.Authorization="Basic "+btoa(oe+":"+ne)}var G=a(k.baseURL,k.url);te.open(k.method.toUpperCase(),s(G,k.params,k.paramsSerializer),!0),te.timeout=k.timeout;function ye(){if(!!te){var Ae="getAllResponseHeaders"in te?l(te.getAllResponseHeaders()):null,Oe=!U||U==="text"||U==="json"?te.responseText:te.response,ue={data:Oe,status:te.status,statusText:te.statusText,headers:Ae,config:k,request:te};e(function(nt){R(nt),I()},function(nt){$(nt),I()},ue),te=null}}if("onloadend"in te?te.onloadend=ye:te.onreadystatechange=function(){!te||te.readyState!==4||te.status===0&&!(te.responseURL&&te.responseURL.indexOf("file:")===0)||setTimeout(ye)},te.onabort=function(){!te||($(d("Request aborted",k,"ECONNABORTED",te)),te=null)},te.onerror=function(){$(d("Network Error",k,null,te)),te=null},te.ontimeout=function(){var Oe=k.timeout?"timeout of "+k.timeout+"ms exceeded":"timeout exceeded",ue=k.transitional||h.transitional;k.timeoutErrorMessage&&(Oe=k.timeoutErrorMessage),$(d(Oe,k,ue.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",te)),te=null},o.isStandardBrowserEnv()){var Se=(k.withCredentials||f(G))&&k.xsrfCookieName?t.read(k.xsrfCookieName):void 0;Se&&(F[k.xsrfHeaderName]=Se)}"setRequestHeader"in te&&o.forEach(F,function(Oe,ue){typeof Q>"u"&&ue.toLowerCase()==="content-type"?delete F[ue]:te.setRequestHeader(ue,Oe)}),o.isUndefined(k.withCredentials)||(te.withCredentials=!!k.withCredentials),U&&U!=="json"&&(te.responseType=k.responseType),typeof k.onDownloadProgress=="function"&&te.addEventListener("progress",k.onDownloadProgress),typeof k.onUploadProgress=="function"&&te.upload&&te.upload.addEventListener("progress",k.onUploadProgress),(k.cancelToken||k.signal)&&(ee=function(Ae){!te||($(!Ae||Ae&&Ae.type?new b("canceled"):Ae),te.abort(),te=null)},k.cancelToken&&k.cancelToken.subscribe(ee),k.signal&&(k.signal.aborted?ee():k.signal.addEventListener("abort",ee))),Q||(Q=null),te.send(Q)})},Vte}var Wte,Vae;function IH(){if(Vae)return Wte;Vae=1;var o=Fp,e=qye,t=Nge,s={"Content-Type":"application/x-www-form-urlencoded"};function a(h,b){!o.isUndefined(h)&&o.isUndefined(h["Content-Type"])&&(h["Content-Type"]=b)}function l(){var h;return(typeof XMLHttpRequest<"u"||typeof process<"u"&&Object.prototype.toString.call(process)==="[object process]")&&(h=Hae()),h}function f(h,b,w){if(o.isString(h))try{return(b||JSON.parse)(h),o.trim(h)}catch(k){if(k.name!=="SyntaxError")throw k}return(w||JSON.stringify)(h)}var d={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:l(),transformRequest:[function(b,w){return e(w,"Accept"),e(w,"Content-Type"),o.isFormData(b)||o.isArrayBuffer(b)||o.isBuffer(b)||o.isStream(b)||o.isFile(b)||o.isBlob(b)?b:o.isArrayBufferView(b)?b.buffer:o.isURLSearchParams(b)?(a(w,"application/x-www-form-urlencoded;charset=utf-8"),b.toString()):o.isObject(b)||w&&w["Content-Type"]==="application/json"?(a(w,"application/json"),f(b)):b}],transformResponse:[function(b){var w=this.transitional||d.transitional,k=w&&w.silentJSONParsing,T=w&&w.forcedJSONParsing,R=!k&&this.responseType==="json";if(R||T&&o.isString(b)&&b.length)try{return JSON.parse(b)}catch($){if(R)throw $.name==="SyntaxError"?t($,this,"E_JSON_PARSE"):$}return b}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(b){return b>=200&&b<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};return o.forEach(["delete","get","head"],function(b){d.headers[b]={}}),o.forEach(["post","put","patch"],function(b){d.headers[b]=o.merge(s)}),Wte=d,Wte}var s2e=Fp,r2e=IH(),i2e=function(e,t,s){var a=this||r2e;return s2e.forEach(s,function(f){e=f.call(a,e,t)}),e},Ute,Wae;function Bge(){return Wae||(Wae=1,Ute=function(e){return!!(e&&e.__CANCEL__)}),Ute}var Uae=Fp,Yte=i2e,a2e=Bge(),l2e=IH(),c2e=NH();function Xte(o){if(o.cancelToken&&o.cancelToken.throwIfRequested(),o.signal&&o.signal.aborted)throw new c2e("canceled")}var u2e=function(e){Xte(e),e.headers=e.headers||{},e.data=Yte.call(e,e.data,e.headers,e.transformRequest),e.headers=Uae.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),Uae.forEach(["delete","get","head","post","put","patch","common"],function(a){delete e.headers[a]});var t=e.adapter||l2e.adapter;return t(e).then(function(a){return Xte(e),a.data=Yte.call(e,a.data,a.headers,e.transformResponse),a},function(a){return a2e(a)||(Xte(e),a&&a.response&&(a.response.data=Yte.call(e,a.response.data,a.response.headers,e.transformResponse))),Promise.reject(a)})},E1=Fp,Lge=function(e,t){t=t||{};var s={};function a(w,k){return E1.isPlainObject(w)&&E1.isPlainObject(k)?E1.merge(w,k):E1.isPlainObject(k)?E1.merge({},k):E1.isArray(k)?k.slice():k}function l(w){if(E1.isUndefined(t[w])){if(!E1.isUndefined(e[w]))return a(void 0,e[w])}else return a(e[w],t[w])}function f(w){if(!E1.isUndefined(t[w]))return a(void 0,t[w])}function d(w){if(E1.isUndefined(t[w])){if(!E1.isUndefined(e[w]))return a(void 0,e[w])}else return a(void 0,t[w])}function h(w){if(w in t)return a(e[w],t[w]);if(w in e)return a(void 0,e[w])}var b={url:f,method:f,data:f,baseURL:d,transformRequest:d,transformResponse:d,paramsSerializer:d,timeout:d,timeoutMessage:d,withCredentials:d,adapter:d,responseType:d,xsrfCookieName:d,xsrfHeaderName:d,onUploadProgress:d,onDownloadProgress:d,decompress:d,maxContentLength:d,maxBodyLength:d,transport:d,httpAgent:d,httpsAgent:d,cancelToken:d,socketPath:d,responseEncoding:d,validateStatus:h};return E1.forEach(Object.keys(e).concat(Object.keys(t)),function(k){var T=b[k]||l,R=T(k);E1.isUndefined(R)&&T!==h||(s[k]=R)}),s},jte,Yae;function Fge(){return Yae||(Yae=1,jte={version:"0.25.0"}),jte}var f2e=Fge().version,Qse={};["object","boolean","number","function","string","symbol"].forEach(function(o,e){Qse[o]=function(s){return typeof s===o||"a"+(e<1?"n ":" ")+o}});var Xae={};Qse.transitional=function(e,t,s){function a(l,f){return"[Axios v"+f2e+"] Transitional option '"+l+"'"+f+(s?". "+s:"")}return function(l,f,d){if(e===!1)throw new Error(a(f," has been removed"+(t?" in "+t:"")));return t&&!Xae[f]&&(Xae[f]=!0,console.warn(a(f," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(l,f,d):!0}};function d2e(o,e,t){if(typeof o!="object")throw new TypeError("options must be an object");for(var s=Object.keys(o),a=s.length;a-- >0;){var l=s[a],f=e[l];if(f){var d=o[l],h=d===void 0||f(d,l,o);if(h!==!0)throw new TypeError("option "+l+" must be "+h);continue}if(t!==!0)throw Error("Unknown option "+l)}}var h2e={assertOptions:d2e,validators:Qse},Qge=Fp,m2e=$ge,jae=Xye,qae=u2e,BH=Lge,Zge=h2e,Y4=Zge.validators;function Q6(o){this.defaults=o,this.interceptors={request:new jae,response:new jae}}Q6.prototype.request=function(e,t){if(typeof e=="string"?(t=t||{},t.url=e):t=e||{},!t.url)throw new Error("Provided config url is not valid");t=BH(this.defaults,t),t.method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var s=t.transitional;s!==void 0&&Zge.assertOptions(s,{silentJSONParsing:Y4.transitional(Y4.boolean),forcedJSONParsing:Y4.transitional(Y4.boolean),clarifyTimeoutError:Y4.transitional(Y4.boolean)},!1);var a=[],l=!0;this.interceptors.request.forEach(function(R){typeof R.runWhen=="function"&&R.runWhen(t)===!1||(l=l&&R.synchronous,a.unshift(R.fulfilled,R.rejected))});var f=[];this.interceptors.response.forEach(function(R){f.push(R.fulfilled,R.rejected)});var d;if(!l){var h=[qae,void 0];for(Array.prototype.unshift.apply(h,a),h=h.concat(f),d=Promise.resolve(t);h.length;)d=d.then(h.shift(),h.shift());return d}for(var b=t;a.length;){var w=a.shift(),k=a.shift();try{b=w(b)}catch(T){k(T);break}}try{d=qae(b)}catch(T){return Promise.reject(T)}for(;f.length;)d=d.then(f.shift(),f.shift());return d};Q6.prototype.getUri=function(e){if(!e.url)throw new Error("Provided config url is not valid");return e=BH(this.defaults,e),m2e(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")};Qge.forEach(["delete","get","head","options"],function(e){Q6.prototype[e]=function(t,s){return this.request(BH(s||{},{method:e,url:t,data:(s||{}).data}))}});Qge.forEach(["post","put","patch"],function(e){Q6.prototype[e]=function(t,s,a){return this.request(BH(a||{},{method:e,url:t,data:s}))}});var g2e=Q6,qte,Gae;function p2e(){if(Gae)return qte;Gae=1;var o=NH();function e(t){if(typeof t!="function")throw new TypeError("executor must be a function.");var s;this.promise=new Promise(function(f){s=f});var a=this;this.promise.then(function(l){if(!!a._listeners){var f,d=a._listeners.length;for(f=0;fo;function Z6(o,e){for(const t in e)o[t]=e[t];return o}function Vge(o){return o()}function tle(){return Object.create(null)}function $i(o){o.forEach(Vge)}function Vb(o){return typeof o=="function"}function po(o,e){return o!=o?e==e:o!==e||o&&typeof o=="object"||typeof o=="function"}let TZ;function nle(o,e){return TZ||(TZ=document.createElement("a")),TZ.href=e,o===TZ.href}function S2e(o){return Object.keys(o).length===0}function Wge(o,e,t,s){if(o){const a=Uge(o,e,t,s);return o[0](a)}}function Uge(o,e,t,s){return o[1]&&s?Z6(t.ctx.slice(),o[1](s(e))):t.ctx}function Yge(o,e,t,s){if(o[2]&&s){const a=o[2](s(t));if(e.dirty===void 0)return a;if(typeof a=="object"){const l=[],f=Math.max(e.dirty.length,a.length);for(let d=0;d32){const e=[],t=o.ctx.length/32;for(let s=0;swindow.performance.now():()=>Date.now(),Zse=qge?o=>requestAnimationFrame(o):pn;const fD=new Set;function Kge(o){fD.forEach(e=>{e.c(o)||(fD.delete(e),e.f())}),fD.size!==0&&Zse(Kge)}function Jge(o){let e;return fD.size===0&&Zse(Kge),{promise:new Promise(t=>{fD.add(e={c:o,f:t})}),abort(){fD.delete(e)}}}const C2e=typeof window<"u"?window:typeof globalThis<"u"?globalThis:global;function X(o,e){o.appendChild(e)}function epe(o){if(!o)return document;const e=o.getRootNode?o.getRootNode():o.ownerDocument;return e&&e.host?e:o.ownerDocument}function k2e(o){const e=ie("style");return x2e(epe(o),e),e.sheet}function x2e(o,e){return X(o.head||o,e),e.sheet}function Re(o,e,t){o.insertBefore(e,t||null)}function Me(o){o.parentNode&&o.parentNode.removeChild(o)}function ia(o,e){for(let t=0;to.removeEventListener(e,t,s)}function Uu(o){return function(e){return e.preventDefault(),o.call(this,e)}}function H(o,e,t){t==null?o.removeAttribute(e):o.getAttribute(e)!==t&&o.setAttribute(e,t)}function zse(o){let e;return{p(...t){e=t,e.forEach(s=>o.push(s))},r(){e.forEach(t=>o.splice(o.indexOf(t),1))}}}function Zz(o){return o===""?null:+o}function E2e(o){return Array.from(o.childNodes)}function Wn(o,e){e=""+e,o.data!==e&&(o.data=e)}function hr(o,e){o.value=e==null?"":e}function rs(o,e,t,s){t==null?o.style.removeProperty(e):o.style.setProperty(e,t,s?"important":"")}function AZ(o,e,t){for(let s=0;s>>0}function D2e(o,e){const t={stylesheet:k2e(e),rules:{}};return zz.set(o,t),t}function voe(o,e,t,s,a,l,f,d=0){const h=16.666/s;let b=`{ `;for(let F=0;F<=1;F+=h){const U=e+(t-e)*l(F);b+=F*100+`%{${f(U,1-U)}} `}const w=b+`100% {${f(t,1-t)}} }`,k=`__svelte_${A2e(w)}_${d}`,T=epe(o),{stylesheet:R,rules:$}=zz.get(T)||D2e(T,o);$[k]||($[k]=!0,R.insertRule(`@keyframes ${k} ${w}`,R.cssRules.length));const Q=o.style.animation||"";return o.style.animation=`${Q?`${Q}, `:""}${k} ${s}ms linear ${a}ms 1 both`,Hz+=1,k}function ope(o,e){const t=(o.style.animation||"").split(", "),s=t.filter(e?l=>l.indexOf(e)<0:l=>l.indexOf("__svelte")===-1),a=t.length-s.length;a&&(o.style.animation=s.join(", "),Hz-=a,Hz||P2e())}function P2e(){Zse(()=>{Hz||(zz.forEach(o=>{const{ownerNode:e}=o.stylesheet;e&&Me(e)}),zz.clear())})}function spe(o,e,t,s){if(!e)return pn;const a=o.getBoundingClientRect();if(e.left===a.left&&e.right===a.right&&e.top===a.top&&e.bottom===a.bottom)return pn;const{delay:l=0,duration:f=300,easing:d=Hge,start:h=Gge()+l,end:b=h+f,tick:w=pn,css:k}=t(o,{from:e,to:a},s);let T=!0,R=!1,$;function Q(){k&&($=voe(o,0,1,f,l,d,k)),l||(R=!0)}function F(){k&&ope(o,$),T=!1}return Jge(U=>{if(!R&&U>=h&&(R=!0),R&&U>=b&&(w(1,0),F()),!T)return!1;if(R){const ee=U-h,I=0+1*d(ee/f);w(I,1-I)}return!0}),Q(),w(0,1),F}function rpe(o){const e=getComputedStyle(o);if(e.position!=="absolute"&&e.position!=="fixed"){const{width:t,height:s}=e,a=o.getBoundingClientRect();o.style.position="absolute",o.style.width=t,o.style.height=s,M2e(o,a)}}function M2e(o,e){const t=o.getBoundingClientRect();if(e.left!==t.left||e.top!==t.top){const s=getComputedStyle(o),a=s.transform==="none"?"":s.transform;o.style.transform=`${a} translate(${e.left-t.left}px, ${e.top-t.top}px)`}}let m6;function KN(o){m6=o}function ZD(){if(!m6)throw new Error("Function called outside component initialization");return m6}function H1(o){ZD().$$.on_mount.push(o)}function ipe(o){ZD().$$.after_update.push(o)}function Hse(o){ZD().$$.on_destroy.push(o)}function Qp(){const o=ZD();return(e,t,{cancelable:s=!1}={})=>{const a=o.$$.callbacks[e];if(a){const l=npe(e,t,{cancelable:s});return a.slice().forEach(f=>{f.call(o,l)}),!l.defaultPrevented}return!0}}function JN(o,e){return ZD().$$.context.set(o,e),e}function si(o){return ZD().$$.context.get(o)}function bz(o,e){const t=o.$$.callbacks[e.type];t&&t.slice().forEach(s=>s.call(this,e))}const eD=[],Uo=[];let dD=[];const Ooe=[],R2e=Promise.resolve();let yoe=!1;function $2e(){yoe||(yoe=!0,R2e.then(ape))}function EC(o){dD.push(o)}function mr(o){Ooe.push(o)}const Jte=new Set;let X4=0;function ape(){if(X4!==0)return;const o=m6;do{try{for(;X4o.indexOf(s)===-1?e.push(s):t.push(s)),t.forEach(s=>s()),dD=e}let AN;function B2e(){return AN||(AN=Promise.resolve(),AN.then(()=>{AN=null})),AN}function ene(o,e,t){o.dispatchEvent(npe(`${e?"intro":"outro"}${t}`))}const vz=new Set;let Bw;function wo(){Bw={r:0,c:[],p:Bw}}function _o(){Bw.r||$i(Bw.c),Bw=Bw.p}function xe(o,e){o&&o.i&&(vz.delete(o),o.i(e))}function Qe(o,e,t,s){if(o&&o.o){if(vz.has(o))return;vz.add(o),Bw.c.push(()=>{vz.delete(o),s&&(t&&o.d(1),s())}),o.o(e)}else s&&s()}const L2e={duration:0};function Vz(o,e,t,s){const a={direction:"both"};let l=e(o,t,a),f=s?0:1,d=null,h=null,b=null;function w(){b&&ope(o,b)}function k(R,$){const Q=R.b-f;return $*=Math.abs(Q),{a:f,b:R.b,d:Q,duration:$,start:R.start,end:R.start+$,group:R.group}}function T(R){const{delay:$=0,duration:Q=300,easing:F=Hge,tick:U=pn,css:ee}=l||L2e,I={start:Gge()+$,b:R};R||(I.group=Bw,Bw.r+=1),d||h?h=I:(ee&&(w(),b=voe(o,f,R,Q,$,F,ee)),R&&U(0,1),d=k(I,Q),EC(()=>ene(o,R,"start")),Jge(te=>{if(h&&te>h.start&&(d=k(h,Q),h=null,ene(o,d.b,"start"),ee&&(w(),b=voe(o,f,d.b,d.duration,0,F,l.css))),d){if(te>=d.end)U(f=d.b,1-f),ene(o,d.b,"end"),h||(d.b?w():--d.group.r||$i(d.group.c)),d=null;else if(te>=d.start){const oe=te-d.start;f=d.a+d.d*F(oe/d.duration),U(f,1-f)}}return!!(d||h)}))}return{run(R){Vb(l)?B2e().then(()=>{l=l(a),T(R)}):T(R)},end(){w(),d=h=null}}}function z6(o,e){o.d(1),e.delete(o.key)}function kv(o,e){Qe(o,1,1,()=>{e.delete(o.key)})}function lpe(o,e){o.f(),kv(o,e)}function Uh(o,e,t,s,a,l,f,d,h,b,w,k){let T=o.length,R=l.length,$=T;const Q={};for(;$--;)Q[o[$].key]=$;const F=[],U=new Map,ee=new Map,I=[];for($=R;$--;){const G=k(a,l,$),ye=t(G);let Se=f.get(ye);Se?s&&I.push(()=>Se.p(G,e)):(Se=b(ye,G),Se.c()),U.set(ye,F[$]=Se),ye in Q&&ee.set(ye,Math.abs($-Q[ye]))}const te=new Set,oe=new Set;function ne(G){xe(G,1),G.m(d,w),f.set(G.key,G),w=G.first,R--}for(;T&&R;){const G=F[R-1],ye=o[T-1],Se=G.key,Ae=ye.key;G===ye?(w=G.first,T--,R--):U.has(Ae)?!f.has(Se)||te.has(Se)?ne(G):oe.has(Ae)?T--:ee.get(Se)>ee.get(Ae)?(oe.add(Se),ne(G)):(te.add(Ae),T--):(h(ye,f),T--)}for(;T--;){const G=o[T];U.has(G.key)||h(G,f)}for(;R;)ne(F[R-1]);return $i(I),F}function LH(o,e){const t={},s={},a={$$scope:1};let l=o.length;for(;l--;){const f=o[l],d=e[l];if(d){for(const h in f)h in d||(s[h]=1);for(const h in d)a[h]||(t[h]=d[h],a[h]=1);o[l]=d}else for(const h in f)a[h]=1}for(const f in s)f in t||(t[f]=void 0);return t}function FH(o){return typeof o=="object"&&o!==null?o:{}}function cr(o,e,t){const s=o.$$.props[e];s!==void 0&&(o.$$.bound[s]=t,t(o.$$.ctx[s]))}function tn(o){o&&o.c()}function Kt(o,e,t,s){const{fragment:a,after_update:l}=o.$$;a&&a.m(e,t),s||EC(()=>{const f=o.$$.on_mount.map(Vge).filter(Vb);o.$$.on_destroy?o.$$.on_destroy.push(...f):$i(f),o.$$.on_mount=[]}),l.forEach(EC)}function Jt(o,e){const t=o.$$;t.fragment!==null&&(I2e(t.after_update),$i(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function F2e(o,e){o.$$.dirty[0]===-1&&(eD.push(o),$2e(),o.$$.dirty.fill(0)),o.$$.dirty[e/31|0]|=1<{const $=R.length?R[0]:T;return b.ctx&&a(b.ctx[k],b.ctx[k]=$)&&(!b.skip_bound&&b.bound[k]&&b.bound[k]($),w&&F2e(o,k)),T}):[],b.update(),w=!0,$i(b.before_update),b.fragment=s?s(b.ctx):!1,e.target){if(e.hydrate){const k=E2e(e.target);b.fragment&&b.fragment.l(k),k.forEach(Me)}else b.fragment&&b.fragment.c();e.intro&&xe(o.$$.fragment),Kt(o,e.target,e.anchor,e.customElement),ape()}KN(h)}class vo{$destroy(){Jt(this,1),this.$destroy=pn}$on(e,t){if(!Vb(t))return pn;const s=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return s.push(t),()=>{const a=s.indexOf(t);a!==-1&&s.splice(a,1)}}$set(e){this.$$set&&!S2e(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}function rle(o){let e,t;return{c(){e=ie("div"),t=Xt(o[0]),H(e,"class","alert alert-danger"),H(e,"role","alert")},m(s,a){Re(s,e,a),X(e,t)},p(s,a){a&1&&Wn(t,s[0])},d(s){s&&Me(e)}}}function Q2e(o){let e,t=o[0]&&rle(o);return{c(){t&&t.c(),e=Bs()},m(s,a){t&&t.m(s,a),Re(s,e,a)},p(s,[a]){s[0]?t?t.p(s,a):(t=rle(s),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},i:pn,o:pn,d(s){t&&t.d(s),s&&Me(e)}}}function Z2e(o,e,t){let{message:s=""}=e;return o.$$set=a=>{"message"in a&&t(0,s=a.message)},[s]}class H6 extends vo{constructor(e){super(),bo(this,e,Z2e,Q2e,po,{message:0})}}function z2e(o){let e,t,s,a;return{c(){e=ie("button"),t=ie("span"),s=Ze(),a=Xt(o[0]),H(t,"class","spinner-border spinner-border-sm"),H(t,"role","status"),H(t,"aria-hidden","true"),H(e,"type","submit"),H(e,"class","btn btn-primary btn-spinner"),e.disabled=o[1]},m(l,f){Re(l,e,f),X(e,t),X(e,s),X(e,a)},p(l,[f]){f&1&&Wn(a,l[0]),f&2&&(e.disabled=l[1])},i:pn,o:pn,d(l){l&&Me(e)}}}function H2e(o,e,t){let{label:s=""}=e,{disabled:a=!1}=e;return o.$$set=l=>{"label"in l&&t(0,s=l.label),"disabled"in l&&t(1,a=l.disabled)},[s,a]}class SD extends vo{constructor(e){super(),bo(this,e,H2e,z2e,po,{label:0,disabled:1})}}function V2e(o){let e,t,s,a,l,f,d,h,b,w,k,T,R,$,Q,F,U,ee,I;return t=new H6({props:{message:o[2]}}),F=new SD({props:{label:"Register"}}),{c(){e=ie("div"),tn(t.$$.fragment),s=Ze(),a=ie("form"),l=ie("div"),f=ie("label"),f.textContent="Name",d=Ze(),h=ie("input"),b=Ze(),w=ie("div"),k=ie("label"),k.textContent="Email address",T=Ze(),R=ie("input"),$=Ze(),Q=ie("div"),tn(F.$$.fragment),H(f,"for","name"),H(f,"class","form-label"),H(h,"type","text"),H(h,"class","form-control"),H(h,"id","name"),H(l,"class","mb-3"),H(k,"for","email"),H(k,"class","form-label"),H(R,"type","email"),H(R,"class","form-control"),H(R,"id","email"),H(w,"class","mb-3"),H(Q,"class","text-center mt-5 d-block"),H(e,"class","wrapper-tiny")},m(te,oe){Re(te,e,oe),Kt(t,e,null),X(e,s),X(e,a),X(a,l),X(l,f),X(l,d),X(l,h),hr(h,o[1]),X(a,b),X(a,w),X(w,k),X(w,T),X(w,R),hr(R,o[0]),X(a,$),X(a,Q),Kt(F,Q,null),U=!0,ee||(I=[vn(h,"input",o[4]),vn(R,"input",o[5]),vn(a,"submit",o[3])],ee=!0)},p(te,[oe]){const ne={};oe&4&&(ne.message=te[2]),t.$set(ne),oe&2&&h.value!==te[1]&&hr(h,te[1]),oe&1&&R.value!==te[0]&&hr(R,te[0])},i(te){U||(xe(t.$$.fragment,te),xe(F.$$.fragment,te),U=!0)},o(te){Qe(t.$$.fragment,te),Qe(F.$$.fragment,te),U=!1},d(te){te&&Me(e),Jt(t),Jt(F),ee=!1,$i(I)}}}function W2e(o,e,t){const s=si("channel");let a="",{email:l=""}=e,f="";function d(w){w.preventDefault(),t(2,f=""),axios.post(s.lucentUrl+"/register",{name:a,email:l}).then(()=>{window.location=s.lucentUrl+"/login"}).catch(k=>{var T;t(2,f=(T=k.response)==null?void 0:T.data.error),console.log({errorMessage:f})})}function h(){a=this.value,t(1,a)}function b(){l=this.value,t(0,l)}return o.$$set=w=>{"email"in w&&t(0,l=w.email)},[l,a,f,d,h,b]}class U2e extends vo{constructor(e){super(),bo(this,e,W2e,V2e,po,{email:0})}}function Y2e(o){let e,t,s,a,l,f,d,h,b,w,k;return h=new SD({props:{label:"Login"}}),{c(){e=ie("form"),t=ie("div"),s=ie("label"),s.textContent="Email address",a=Ze(),l=ie("input"),f=Ze(),d=ie("div"),tn(h.$$.fragment),H(s,"for","emailaddress"),H(s,"class","form-label"),H(l,"type","email"),H(l,"class","form-control"),H(l,"id","emailaddress"),l.required=!0,H(t,"class","mb-3"),H(d,"class","text-center mt-5 d-block")},m(T,R){Re(T,e,R),X(e,t),X(t,s),X(t,a),X(t,l),hr(l,o[0]),X(e,f),X(e,d),Kt(h,d,null),b=!0,w||(k=[vn(l,"input",o[3]),vn(e,"submit",o[2])],w=!0)},p(T,R){R&1&&l.value!==T[0]&&hr(l,T[0])},i(T){b||(xe(h.$$.fragment,T),b=!0)},o(T){Qe(h.$$.fragment,T),b=!1},d(T){T&&Me(e),Jt(h),w=!1,$i(k)}}}function X2e(o){let e,t;return{c(){e=ie("div"),t=Xt(o[1]),H(e,"class","alert alert-info"),H(e,"role","alert")},m(s,a){Re(s,e,a),X(e,t)},p(s,a){a&2&&Wn(t,s[1])},i:pn,o:pn,d(s){s&&Me(e)}}}function j2e(o){let e,t,s,a;const l=[X2e,Y2e],f=[];function d(h,b){return h[1]?0:1}return t=d(o),s=f[t]=l[t](o),{c(){e=ie("div"),s.c(),H(e,"class","wrapper-tiny")},m(h,b){Re(h,e,b),f[t].m(e,null),a=!0},p(h,[b]){let w=t;t=d(h),t===w?f[t].p(h,b):(wo(),Qe(f[w],1,1,()=>{f[w]=null}),_o(),s=f[t],s?s.p(h,b):(s=f[t]=l[t](h),s.c()),xe(s,1),s.m(e,null))},i(h){a||(xe(s),a=!0)},o(h){Qe(s),a=!1},d(h){h&&Me(e),f[t].d()}}}function q2e(o,e,t){const s=si("channel");let a="",l="";function f(h){h.preventDefault(),axios.post(s.lucentUrl+"/login",{email:a}).then(b=>{console.log(b),t(1,l="You will receive an email with a login link")}).catch(b=>{})}function d(){a=this.value,t(0,a)}return[a,l,f,d]}class G2e extends vo{constructor(e){super(),bo(this,e,q2e,j2e,po,{})}}function cpe(o){const e=o-1;return e*e*e+1}function upe(o){return--o*o*o*o*o+1}function Wz(o,{delay:e=0,duration:t=400,easing:s=cpe,x:a=0,y:l=0,opacity:f=0}={}){const d=getComputedStyle(o),h=+d.opacity,b=d.transform==="none"?"":d.transform,w=h*(1-f),[k,T]=ole(a),[R,$]=ole(l);return{delay:e,duration:t,easing:s,css:(Q,F)=>` transform: ${b} translate(${(1-Q)*k}${T}, ${(1-Q)*R}${$}); opacity: ${h-w*F}`}}function ile(o){let e,t,s,a;return{c(){e=ie("div"),t=Xt(o[1]),H(e,"class","lx-alert text-white bg-success border-1 border rounded px-3 py-0 text-center svelte-190ow44"),H(e,"role","alert")},m(l,f){Re(l,e,f),X(e,t),a=!0},p(l,f){(!a||f&2)&&Wn(t,l[1])},i(l){a||(EC(()=>{!a||(s||(s=Vz(e,Wz,{duration:500},!0)),s.run(1))}),a=!0)},o(l){s||(s=Vz(e,Wz,{duration:500},!1)),s.run(0),a=!1},d(l){l&&Me(e),l&&s&&s.end()}}}function K2e(o){let e,t,s=o[0]&&ile(o);return{c(){s&&s.c(),e=Bs()},m(a,l){s&&s.m(a,l),Re(a,e,l),t=!0},p(a,[l]){a[0]?s?(s.p(a,l),l&1&&xe(s,1)):(s=ile(a),s.c(),xe(s,1),s.m(e.parentNode,e)):s&&(wo(),Qe(s,1,1,()=>{s=null}),_o())},i(a){t||(xe(s),t=!0)},o(a){Qe(s),t=!1},d(a){s&&s.d(a),a&&Me(e)}}}function J2e(o,e,t){let s,a;function l(f="Saved"){t(1,s=f),t(0,a=!0),setTimeout(function(){t(0,a=!1)},2e3)}return t(1,s="Saved"),t(0,a=!1),[a,s,l]}class Vse extends vo{constructor(e){super(),bo(this,e,J2e,K2e,po,{show:2})}get show(){return this.$$.ctx[2]}}function ewe(o){let e,t,s,a,l,f,d,h,b,w,k,T,R,$,Q={};return e=new Vse({props:Q}),o[4](e),k=new SD({props:{label:"Enter"}}),{c(){tn(e.$$.fragment),t=Ze(),s=ie("div"),a=ie("form"),l=ie("div"),f=ie("h3"),d=Xt("Login as "),h=Xt(o[0]),b=Ze(),w=ie("div"),tn(k.$$.fragment),H(l,"class","mb-3 text-center"),H(w,"class","text-center mt-5 d-block"),H(s,"class","wrapper-tiny")},m(F,U){Kt(e,F,U),Re(F,t,U),Re(F,s,U),X(s,a),X(a,l),X(l,f),X(f,d),X(f,h),X(a,b),X(a,w),Kt(k,w,null),T=!0,R||($=vn(a,"submit",o[2]),R=!0)},p(F,[U]){const ee={};e.$set(ee),(!T||U&1)&&Wn(h,F[0])},i(F){T||(xe(e.$$.fragment,F),xe(k.$$.fragment,F),T=!0)},o(F){Qe(e.$$.fragment,F),Qe(k.$$.fragment,F),T=!1},d(F){o[4](null),Jt(e,F),F&&Me(t),F&&Me(s),Jt(k),R=!1,$()}}}function twe(o,e,t){const s=si("channel");let{email:a}=e,{token:l}=e,f;function d(b){b.preventDefault(),axios.post(s.lucentUrl+"/verify",{email:a,token:l}).then(w=>{window.location=s.lucentUrl}).catch(w=>{})}function h(b){Uo[b?"unshift":"push"](()=>{f=b,t(1,f)})}return o.$$set=b=>{"email"in b&&t(0,a=b.email),"token"in b&&t(3,l=b.token)},[a,f,d,l,h]}class nwe extends vo{constructor(e){super(),bo(this,e,twe,ewe,po,{email:0,token:3})}}function owe(o){let e,t,s;return{c(){e=ie("div"),t=ie("div"),s=Xt(o[2]),H(t,"class","avatar__letters"),H(e,"class","avatar"),H(e,"title",o[0]),rs(e,"background-color",o[3][o[4]]),rs(e,"height",o[1]+"px"),rs(e,"width",o[1]+"px"),rs(e,"font-size",o[1]/2+"px")},m(a,l){Re(a,e,l),X(e,t),X(t,s)},p(a,[l]){l&4&&Wn(s,a[2]),l&1&&H(e,"title",a[0]),l&2&&rs(e,"height",a[1]+"px"),l&2&&rs(e,"width",a[1]+"px"),l&2&&rs(e,"font-size",a[1]/2+"px")},i:pn,o:pn,d(a){a&&Me(e)}}}function swe(o,e,t){let{name:s}=e,{side:a=48}=e;const l=["#00AA55","#009FD4","#B381B3","#939393","#E3BC00","#D47500","#DC2A2A","#3ede91","#377dd4","#0256b0","#053d82","#3d026e","#b378e3","#c4065c","#543208","#d97811","#0c6b40"];let f="";s.split(" ").length>1?f=s.split(" ")[0].charAt(0).toUpperCase()+s.split(" ")[1].charAt(0).toUpperCase():f=s.split(" ")[0].charAt(0).toUpperCase()+s.split(" ")[0].charAt(1).toUpperCase();let h=(s.charCodeAt(1)+s.length)%19;return o.$$set=b=>{"name"in b&&t(0,s=b.name),"side"in b&&t(1,a=b.side)},[s,a,f,l,h]}class by extends vo{constructor(e){super(),bo(this,e,swe,owe,po,{name:0,side:1})}}function rwe(o){let e,t,s,a,l,f,d,h,b,w,k,T,R,$,Q,F,U,ee,I,te,oe,ne,G,ye,Se,Ae;t=new H6({props:{message:o[2]}});let Oe={};return a=new Vse({props:Oe}),o[8](a),d=new by({props:{name:o[4].name}}),R=new SD({props:{label:"Update"}}),I=new SD({props:{label:"Update"}}),{c(){e=ie("div"),tn(t.$$.fragment),s=Ze(),tn(a.$$.fragment),l=Ze(),f=ie("h3"),tn(d.$$.fragment),h=Ze(),b=ie("form"),w=ie("div"),k=ie("input"),T=Ze(),tn(R.$$.fragment),$=Ze(),Q=ie("form"),F=ie("div"),U=ie("input"),ee=Ze(),tn(I.$$.fragment),te=Ze(),oe=ie("div"),ne=ie("a"),G=Xt(`Logout from this device`),H(f,"class","header-small mb-5"),H(k,"type","text"),H(k,"class","form-control"),H(k,"placeholder","Name"),k.required=!0,H(w,"class","input-group mb-3"),H(U,"type","email"),H(U,"class","form-control"),H(U,"placeholder","Email"),U.required=!0,H(F,"class","input-group mb-3"),H(ne,"class","list-group-item list-group-item-action"),H(ne,"href",o[5].lucentUrl+"/logout"),H(oe,"class","list-group"),H(e,"class","wrapper-tiny")},m(ue,rt){Re(ue,e,rt),Kt(t,e,null),X(e,s),Kt(a,e,null),X(e,l),X(e,f),Kt(d,f,null),X(e,h),X(e,b),X(b,w),X(w,k),hr(k,o[0]),X(w,T),Kt(R,w,null),X(e,$),X(e,Q),X(Q,F),X(F,U),hr(U,o[1]),X(F,ee),Kt(I,F,null),X(e,te),X(e,oe),X(oe,ne),X(ne,G),ye=!0,Se||(Ae=[vn(k,"input",o[9]),vn(b,"submit",o[6]),vn(U,"input",o[10]),vn(Q,"submit",o[7])],Se=!0)},p(ue,[rt]){const nt={};rt&4&&(nt.message=ue[2]),t.$set(nt);const St={};a.$set(St),rt&1&&k.value!==ue[0]&&hr(k,ue[0]),rt&2&&U.value!==ue[1]&&hr(U,ue[1])},i(ue){ye||(xe(t.$$.fragment,ue),xe(a.$$.fragment,ue),xe(d.$$.fragment,ue),xe(R.$$.fragment,ue),xe(I.$$.fragment,ue),ye=!0)},o(ue){Qe(t.$$.fragment,ue),Qe(a.$$.fragment,ue),Qe(d.$$.fragment,ue),Qe(R.$$.fragment,ue),Qe(I.$$.fragment,ue),ye=!1},d(ue){ue&&Me(e),Jt(t),o[8](null),Jt(a),Jt(d),Jt(R),Jt(I),Se=!1,$i(Ae)}}}function iwe(o,e,t){const s=si("user"),a=si("channel");let l=s.name,f=s.email,d="",h;function b($){$.preventDefault(),t(2,d=""),axios.post(a.lucentUrl+"/account/update-name",{name:l}).then(Q=>{h.show()}).catch(Q=>{var F;t(2,d=(F=Q.response)==null?void 0:F.data.error),console.log({errorMessage:d})})}function w($){$.preventDefault(),t(2,d=""),axios.post(a.lucentUrl+"/account/update-email",{email:f}).then(Q=>{h.show()}).catch(Q=>{var F;t(2,d=(F=Q.response)==null?void 0:F.data.error),console.log({errorMessage:d})})}function k($){Uo[$?"unshift":"push"](()=>{h=$,t(3,h)})}function T(){l=this.value,t(0,l)}function R(){f=this.value,t(1,f)}return[l,f,d,h,s,a,b,w,k,T,R]}class awe extends vo{constructor(e){super(),bo(this,e,iwe,rwe,po,{})}}function lwe(o){let e,t,s,a=o[3].name+"",l,f,d,h,b,w;const k=[{title:o[0]},o[2]];var T=o[4][o[1]];function R($){let Q={};for(let F=0;F{Jt(U,1)}),_o()}T?(b=xC(T,R()),tn(b.$$.fragment),xe(b.$$.fragment,1),Kt(b,h,null)):b=null}else T&&b.$set(F)},i($){w||(b&&xe(b.$$.fragment,$),w=!0)},o($){b&&Qe(b.$$.fragment,$),w=!1},d($){$&&Me(e),$&&Me(d),$&&Me(h),b&&Jt(b)}}}function cwe(o,e,t){const s={register:U2e,login:G2e,verify:nwe,profile:awe};let{title:a}=e,{view:l}=e,{user:f}=e,{data:d}=e,{channel:h}=e;return JN("channel",h),JN("user",f),o.$$set=b=>{"title"in b&&t(0,a=b.title),"view"in b&&t(1,l=b.view),"user"in b&&t(5,f=b.user),"data"in b&&t(2,d=b.data),"channel"in b&&t(3,h=b.channel)},[a,l,d,h,s,f]}class uwe extends vo{constructor(e){super(),bo(this,e,cwe,lwe,po,{title:0,view:1,user:5,data:2,channel:3})}}function ale(o){let e,t;return{c(){e=ie("span"),t=Xt(o[4]),H(e,"class","text-muted")},m(s,a){Re(s,e,a),X(e,t)},p(s,a){a&16&&Wn(t,s[4])},d(s){s&&Me(e)}}}function fwe(o){let e,t,s=!1,a,l,f,d,h,b,w,k=o[4]&&ale(o);return h=zse(o[7][0]),{c(){e=ie("div"),t=ie("input"),a=Ze(),l=ie("label"),f=Xt(o[1]),d=Ze(),k&&k.c(),H(t,"class","form-check-input"),H(t,"type","radio"),t.__value=o[3],t.value=t.__value,H(t,"name",o[2]),H(t,"id",o[5]),H(l,"class","form-check-label"),H(l,"for",o[5]),H(e,"class","form-check"),h.p(t)},m(T,R){Re(T,e,R),X(e,t),t.checked=t.__value===o[0],X(e,a),X(e,l),X(l,f),X(e,d),k&&k.m(e,null),b||(w=vn(t,"change",o[6]),b=!0)},p(T,[R]){R&8&&(t.__value=T[3],t.value=t.__value,s=!0),R&4&&H(t,"name",T[2]),(s||R&1)&&(t.checked=t.__value===T[0]),R&2&&Wn(f,T[1]),T[4]?k?k.p(T,R):(k=ale(T),k.c(),k.m(e,null)):k&&(k.d(1),k=null)},i:pn,o:pn,d(T){T&&Me(e),k&&k.d(),h.r(),b=!1,w()}}}function dwe(o,e,t){let{label:s}=e,{name:a}=e,{group:l}=e,{value:f}=e,{help:d}=e,h=Nc.exports.uniqueId();const b=[[]];function w(){l=this.__value,t(0,l)}return o.$$set=k=>{"label"in k&&t(1,s=k.label),"name"in k&&t(2,a=k.name),"group"in k&&t(0,l=k.group),"value"in k&&t(3,f=k.value),"help"in k&&t(4,d=k.help)},[l,s,a,f,d,h,w,b]}class hwe extends vo{constructor(e){super(),bo(this,e,dwe,fwe,po,{label:1,name:2,group:0,value:3,help:4})}}function lle(o,e,t){const s=o.slice();return s[7]=e[t],s}function cle(o,e,t){const s=o.slice();return s[7]=e[t],s}function ule(o){let e,t=o[7]+"",s,a,l;function f(...d){return o[4](o[7],...d)}return{c(){e=ie("button"),s=Xt(t),H(e,"class","dropdown-item text-capitalize")},m(d,h){Re(d,e,h),X(e,s),a||(l=vn(e,"click",f),a=!0)},p(d,h){o=d,h&2&&t!==(t=o[7]+"")&&Wn(s,t)},d(d){d&&Me(e),a=!1,l()}}}function fle(o){let e=o[0].roles.includes(o[7]),t,s=e&&ule(o);return{c(){s&&s.c(),t=Bs()},m(a,l){s&&s.m(a,l),Re(a,t,l)},p(a,l){l&3&&(e=a[0].roles.includes(a[7])),e?s?s.p(a,l):(s=ule(a),s.c(),s.m(t.parentNode,t)):s&&(s.d(1),s=null)},d(a){s&&s.d(a),a&&Me(t)}}}function dle(o){let e,t=o[7]+"",s,a,l,f;function d(...h){return o[5](o[7],...h)}return{c(){e=ie("button"),s=Xt(t),a=Ze(),H(e,"class","dropdown-item text-capitalize")},m(h,b){Re(h,e,b),X(e,s),X(e,a),l||(f=vn(e,"click",d),l=!0)},p(h,b){o=h,b&2&&t!==(t=o[7]+"")&&Wn(s,t)},d(h){h&&Me(e),l=!1,f()}}}function hle(o){let e=!o[0].roles.includes(o[7]),t,s=e&&dle(o);return{c(){s&&s.c(),t=Bs()},m(a,l){s&&s.m(a,l),Re(a,t,l)},p(a,l){l&3&&(e=!a[0].roles.includes(a[7])),e?s?s.p(a,l):(s=dle(a),s.c(),s.m(t.parentNode,t)):s&&(s.d(1),s=null)},d(a){s&&s.d(a),a&&Me(t)}}}function mwe(o){var ht;let e,t,s,a,l,f,d,h=o[0].name+"",b,w,k=o[0].email+"",T,R,$,Q,F,U,ee,I,te,oe,ne,G,ye,Se,Ae,Oe,ue;s=new by({props:{name:(ht=o[0].name)!=null?ht:"",side:32}});let rt=o[1],nt=[];for(let We=0;We',ye=Ze(),Se=ie("h6"),Se.textContent="Add role",Ae=Ze();for(let We=0;We{!ue||(Oe||(Oe=Vz(e,Wz,{duration:200},!0)),Oe.run(1))}),ue=!0)},o(We){Qe(s.$$.fragment,We),Oe||(Oe=Vz(e,Wz,{duration:200},!1)),Oe.run(0),ue=!1},d(We){We&&Me(e),Jt(s),ia(nt,We),ia(V,We),We&&Oe&&Oe.end()}}}function gwe(o,e,t){const s=Qp();let{member:a}=e,{roles:l}=e;function f(w,k){w.preventDefault();let T=a.roles.filter(R=>R!==k);s("update",{user:a.id,roles:T})}function d(w,k){w.preventDefault();let T=[...a.roles,k];console.log(a.roles),console.log(k),console.log(T),s("update",{user:a.id,roles:T})}const h=(w,k)=>f(k,w),b=(w,k)=>d(k,w);return o.$$set=w=>{"member"in w&&t(0,a=w.member),"roles"in w&&t(1,l=w.roles)},[a,l,f,d,h,b]}class pwe extends vo{constructor(e){super(),bo(this,e,gwe,mwe,po,{member:0,roles:1})}}function mle(o,e,t){const s=o.slice();return s[15]=e[t],s}function gle(o,e,t){const s=o.slice();return s[18]=e[t],s}function ple(o){let e,t,s;function a(f){o[13](f)}let l={value:o[18],name:"role",label:o[18]};return o[3]!==void 0&&(l.group=o[3]),e=new hwe({props:l}),Uo.push(()=>cr(e,"group",a)),{c(){tn(e.$$.fragment)},m(f,d){Kt(e,f,d),s=!0},p(f,d){const h={};!t&&d&8&&(t=!0,h.group=f[3],mr(()=>t=!1)),e.$set(h)},i(f){s||(xe(e.$$.fragment,f),s=!0)},o(f){Qe(e.$$.fragment,f),s=!1},d(f){Jt(e,f)}}}function ble(o){let e,t;return e=new pwe({props:{member:o[15],roles:o[6].roles}}),e.$on("update",o[9]),e.$on("reinvite",o[14]),{c(){tn(e.$$.fragment)},m(s,a){Kt(e,s,a),t=!0},p(s,a){const l={};a&1&&(l.member=s[15]),e.$set(l)},i(s){t||(xe(e.$$.fragment,s),t=!0)},o(s){Qe(e.$$.fragment,s),t=!1},d(s){Jt(e,s)}}}function bwe(o){let e,t,s,a,l,f,d,h,b,w,k,T,R,$,Q,F,U,ee,I,te,oe,ne,G,ye,Se,Ae,Oe,ue,rt,nt;l=new H6({props:{message:o[4]}});let St={};d=new Vse({props:St}),o[10](d);let V=o[6].roles.filter(vle),ht=[];for(let Je=0;JeQe(ht[Je],1,1,()=>{ht[Je]=null});G=new SD({props:{label:"Invite"}});let Ct=o[0],Ot=[];for(let Je=0;JeQe(Ot[Je],1,1,()=>{Ot[Je]=null});return{c(){e=ie("div"),t=ie("div"),s=ie("h3"),s.textContent="Invite people",a=Ze(),tn(l.$$.fragment),f=Ze(),tn(d.$$.fragment),h=Ze(),b=ie("form"),w=ie("div"),k=ie("label"),k.textContent="Invitee Name",T=Ze(),R=ie("input"),$=Ze(),Q=ie("div"),F=ie("label"),F.textContent="Invitee Email Address",U=Ze(),ee=ie("input"),I=Ze(),te=ie("div");for(let Je=0;Jeo!=="removed";function vwe(o,e,t){const s=si("channel");let{users:a}=e,l,f,d,h="",b;function w(ee){ee.preventDefault(),k(l,f,d)}function k(ee,I,te){t(4,h=""),axios.post(s.lucentUrl+"/members/invite",{name:ee,email:I,roles:[te]}).then(oe=>{b.show("User was invited"),t(0,a=[...a,oe.data.user]),t(1,l=null),t(2,f=null),t(3,d=null)}).catch(oe=>{var ne,G,ye;t(4,h=(ye=(G=(ne=oe.response)==null?void 0:ne.data)==null?void 0:G.error)!=null?ye:"")})}function T(ee){ee.preventDefault(),t(4,h=""),axios.post(s.lucentUrl+"/members/update",{id:ee.detail.user,roles:ee.detail.roles}).then(I=>{b.show("Users updated"),t(0,a=I.data.users)}).catch(I=>{var te,oe,ne;t(4,h=(ne=(oe=(te=I.response)==null?void 0:te.data)==null?void 0:oe.error)!=null?ne:"")})}function R(ee){Uo[ee?"unshift":"push"](()=>{b=ee,t(5,b)})}function $(){l=this.value,t(1,l)}function Q(){f=this.value,t(2,f)}function F(ee){d=ee,t(3,d)}const U=ee=>k(ee.detail.email,ee.detail.role);return o.$$set=ee=>{"users"in ee&&t(0,a=ee.users)},[a,l,f,d,h,b,s,w,k,T,R,$,Q,F,U]}class Owe extends vo{constructor(e){super(),bo(this,e,vwe,bwe,po,{users:0})}}function ywe(o){let e,t,s;return{c(){e=ie("div"),t=ie("div"),s=Xt(o[0]),H(t,"class","header-normal"),H(e,"class","wrapper-normal ")},m(a,l){Re(a,e,l),X(e,t),X(t,s)},p(a,[l]){l&1&&Wn(s,a[0])},i:pn,o:pn,d(a){a&&Me(e)}}}function wwe(o,e,t){let{title:s}=e;return o.$$set=a=>{"title"in a&&t(0,s=a.title)},[s]}class _we extends vo{constructor(e){super(),bo(this,e,wwe,ywe,po,{title:0})}}function Swe(o){let e,t=o[5].path+"";return{c(){e=tpe("svg"),H(e,"class","bi svelte-1coky4l"),H(e,"xmlns","http://www.w3.org/2000/svg"),H(e,"width",o[0]),H(e,"height",o[1]),H(e,"viewBox",o[5].viewBox),H(e,"aria-labelledby",o[2]),H(e,"role","presentation"),H(e,"stroke",o[4]),H(e,"fill",o[3])},m(s,a){Re(s,e,a),e.innerHTML=t},p(s,[a]){a&1&&H(e,"width",s[0]),a&2&&H(e,"height",s[1]),a&4&&H(e,"aria-labelledby",s[2]),a&16&&H(e,"stroke",s[4]),a&8&&H(e,"fill",s[3])},i:pn,o:pn,d(s){s&&Me(e)}}}function Cwe(o,e,t){const s={"trash-can":{path:'',viewBox:"0 0 448 512"},"circle-chevron-down":{path:'',viewBox:"0 0 512 512"},"circle-chevron-up":{path:'',viewBox:"0 0 512 512"},ellipsis:{path:'',viewBox:"0 0 448 512"},"ellipsis-vertical":{path:'',viewBox:"0 0 128 512"},"angles-down":{path:'',viewBox:"0 0 384 512"},"angle-right":{path:'',viewBox:"0 0 256 512"},"photo-film":{path:'',viewBox:"0 0 640 512"},file:{path:'',viewBox:"0 0 384 512"},"circle-info":{path:'',viewBox:"0 0 512 512"},"table-columns":{path:'',viewBox:"0 0 512 512"},"arrow-down-a-z":{path:'',viewBox:"0 0 512 512"},"arrow-up-short-wide":{path:'',viewBox:"0 0 576 512"},"arrow-down-wide-short":{path:'',viewBox:"0 0 576 512"},filter:{path:'',viewBox:"0 0 512 512"},calendar:{path:'',viewBox:"0 0 448 512"},pencil:{path:'',viewBox:"0 0 512 512"},database:{path:'',viewBox:"0 0 448 512"},dice:{path:'',viewBox:"0 0 640 512"},"triangle-exclamation":{path:'',viewBox:"0 0 512 512"},eye:{path:'',viewBox:"0 0 576 512"},"circle-plus":{path:'',viewBox:"0 0 512 512"},"magnifying-glass":{path:'',viewBox:"0 0 512 512"},expand:{path:'',viewBox:"0 0 448 512"},compress:{path:'',viewBox:"0 0 448 512"},check:{path:'',viewBox:"0 0 448 512"}};let{width:a=16}=e,{height:l=16}=e,{icon:f=""}=e,{fill:d="currentColor"}=e,{stroke:h="currentColor"}=e,b=s[f];return o.$$set=w=>{"width"in w&&t(0,a=w.width),"height"in w&&t(1,l=w.height),"icon"in w&&t(2,f=w.icon),"fill"in w&&t(3,d=w.fill),"stroke"in w&&t(4,h=w.stroke)},[a,l,f,d,h,b]}class ml extends vo{constructor(e){super(),bo(this,e,Cwe,Swe,po,{width:0,height:1,icon:2,fill:3,stroke:4})}}/*! * mustache.js - Logic-less {{mustache}} templates with JavaScript * http://github.com/janl/mustache.js */var kwe=Object.prototype.toString,zD=Array.isArray||function(e){return kwe.call(e)==="[object Array]"};function Wse(o){return typeof o=="function"}function xwe(o){return zD(o)?"array":typeof o}function tne(o){return o.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Ole(o,e){return o!=null&&typeof o=="object"&&e in o}function Ewe(o,e){return o!=null&&typeof o!="object"&&o.hasOwnProperty&&o.hasOwnProperty(e)}var Twe=RegExp.prototype.test;function Awe(o,e){return Twe.call(o,e)}var Dwe=/\S/;function Pwe(o){return!Awe(Dwe,o)}var Mwe={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};function Rwe(o){return String(o).replace(/[&<>"'`=\/]/g,function(t){return Mwe[t]})}var $we=/\s*/,Nwe=/\s+/,yle=/\s*=/,Iwe=/\s*\}/,Bwe=/#|\^|\/|>|\{|&|=|!/;function Lwe(o,e){if(!o)return[];var t=!1,s=[],a=[],l=[],f=!1,d=!1,h="",b=0;function w(){if(f&&!d)for(;l.length;)delete a[l.pop()];else l=[];f=!1,d=!1}var k,T,R;function $(ye){if(typeof ye=="string"&&(ye=ye.split(Nwe,2)),!zD(ye)||ye.length!==2)throw new Error("Invalid tags: "+ye);k=new RegExp(tne(ye[0])+"\\s*"),T=new RegExp("\\s*"+tne(ye[1])),R=new RegExp("\\s*"+tne("}"+ye[1]))}$(e||Lp.tags);for(var Q=new V6(o),F,U,ee,I,te,oe;!Q.eos();){if(F=Q.pos,ee=Q.scanUntil(k),ee)for(var ne=0,G=ee.length;ne"?te=[U,ee,F,Q.pos,h,b,t]:te=[U,ee,F,Q.pos],b++,a.push(te),U==="#"||U==="^")s.push(te);else if(U==="/"){if(oe=s.pop(),!oe)throw new Error('Unopened section "'+ee+'" at '+F);if(oe[1]!==ee)throw new Error('Unclosed section "'+oe[1]+'" at '+F)}else U==="name"||U==="{"||U==="&"?d=!0:U==="="&&$(ee)}if(w(),oe=s.pop(),oe)throw new Error('Unclosed section "'+oe[1]+'" at '+Q.pos);return Qwe(Fwe(a))}function Fwe(o){for(var e=[],t,s,a=0,l=o.length;a0?s[s.length-1][4]:e;break;default:t.push(a)}return e}function V6(o){this.string=o,this.tail=o,this.pos=0}V6.prototype.eos=function(){return this.tail===""};V6.prototype.scan=function(e){var t=this.tail.match(e);if(!t||t.index!==0)return"";var s=t[0];return this.tail=this.tail.substring(s.length),this.pos+=s.length,s};V6.prototype.scanUntil=function(e){var t=this.tail.search(e),s;switch(t){case-1:s=this.tail,this.tail="";break;case 0:s="";break;default:s=this.tail.substring(0,t),this.tail=this.tail.substring(t)}return this.pos+=s.length,s};function CD(o,e){this.view=o,this.cache={".":this.view},this.parent=e}CD.prototype.push=function(e){return new CD(e,this)};CD.prototype.lookup=function(e){var t=this.cache,s;if(t.hasOwnProperty(e))s=t[e];else{for(var a=this,l,f,d,h=!1;a;){if(e.indexOf(".")>0)for(l=a.view,f=e.split("."),d=0;l!=null&&d"?b=this.renderPartial(d,t,s,l):h==="&"?b=this.unescapedValue(d,t):h==="name"?b=this.escapedValue(d,t,l):h==="text"&&(b=this.rawValue(d)),b!==void 0&&(f+=b);return f};Bg.prototype.renderSection=function(e,t,s,a,l){var f=this,d="",h=t.lookup(e[1]);function b(T){return f.render(T,t,s,l)}if(!!h){if(zD(h))for(var w=0,k=h.length;w0||!s)&&(l[f]=a+l[f]);return l.join(` `)};Bg.prototype.renderPartial=function(e,t,s,a){if(!!s){var l=this.getConfigTags(a),f=Wse(s)?s(e[1]):s[e[1]];if(f!=null){var d=e[6],h=e[5],b=e[4],w=f;h==0&&b&&(w=this.indentPartial(f,b,d));var k=this.parse(w,l);return this.renderTokens(k,t,s,w,a)}}};Bg.prototype.unescapedValue=function(e,t){var s=t.lookup(e[1]);if(s!=null)return s};Bg.prototype.escapedValue=function(e,t,s){var a=this.getConfigEscape(s)||Lp.escape,l=t.lookup(e[1]);if(l!=null)return typeof l=="number"&&a===Lp.escape?String(l):a(l)};Bg.prototype.rawValue=function(e){return e[1]};Bg.prototype.getConfigTags=function(e){return zD(e)?e:e&&typeof e=="object"?e.tags:void 0};Bg.prototype.getConfigEscape=function(e){if(e&&typeof e=="object"&&!zD(e))return e.escape};var Lp={name:"mustache.js",version:"4.2.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(o){g6.templateCache=o},get templateCache(){return g6.templateCache}},g6=new Bg;Lp.clearCache=function(){return g6.clearCache()};Lp.parse=function(e,t){return g6.parse(e,t)};Lp.render=function(e,t,s,a){if(typeof e!="string")throw new TypeError('Invalid template! Template should be a "string" but "'+xwe(e)+'" was given as the first argument for mustache#render(template, view, partials)');return g6.render(e,t,s,a)};Lp.escape=Rwe;Lp.Scanner=V6;Lp.Context=CD;Lp.Writer=Bg;function woe(o){return woe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},woe(o)}function Yb(o,e){if(e.length1?"s":"")+" required, but only "+e.length+" present")}function Wh(o){Yb(1,arguments);var e=Object.prototype.toString.call(o);return o instanceof Date||woe(o)==="object"&&e==="[object Date]"?new Date(o.getTime()):typeof o=="number"||e==="[object Number]"?new Date(o):((typeof o=="string"||e==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}var Zwe={};function zwe(){return Zwe}function wle(o){var e=new Date(Date.UTC(o.getFullYear(),o.getMonth(),o.getDate(),o.getHours(),o.getMinutes(),o.getSeconds(),o.getMilliseconds()));return e.setUTCFullYear(o.getFullYear()),o.getTime()-e.getTime()}function Oz(o,e){Yb(2,arguments);var t=Wh(o),s=Wh(e),a=t.getTime()-s.getTime();return a<0?-1:a>0?1:a}function Hwe(o,e){Yb(2,arguments);var t=Wh(o),s=Wh(e),a=t.getFullYear()-s.getFullYear(),l=t.getMonth()-s.getMonth();return a*12+l}function Vwe(o,e){return Yb(2,arguments),Wh(o).getTime()-Wh(e).getTime()}var _le={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(e){return e<0?Math.ceil(e):Math.floor(e)}},Wwe="trunc";function Uwe(o){return o?_le[o]:_le[Wwe]}function Ywe(o){Yb(1,arguments);var e=Wh(o);return e.setHours(23,59,59,999),e}function Xwe(o){Yb(1,arguments);var e=Wh(o),t=e.getMonth();return e.setFullYear(e.getFullYear(),t+1,0),e.setHours(23,59,59,999),e}function jwe(o){Yb(1,arguments);var e=Wh(o);return Ywe(e).getTime()===Xwe(e).getTime()}function qwe(o,e){Yb(2,arguments);var t=Wh(o),s=Wh(e),a=Oz(t,s),l=Math.abs(Hwe(t,s)),f;if(l<1)f=0;else{t.getMonth()===1&&t.getDate()>27&&t.setDate(30),t.setMonth(t.getMonth()-a*l);var d=Oz(t,s)===-a;jwe(Wh(o))&&l===1&&Oz(o,s)===1&&(d=!1),f=a*(l-Number(d))}return f===0?0:f}function Gwe(o,e,t){Yb(2,arguments);var s=Vwe(o,e)/1e3;return Uwe(t==null?void 0:t.roundingMethod)(s)}var Kwe={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Jwe=function(e,t,s){var a,l=Kwe[e];return typeof l=="string"?a=l:t===1?a=l.one:a=l.other.replace("{{count}}",t.toString()),s!=null&&s.addSuffix?s.comparison&&s.comparison>0?"in "+a:a+" ago":a};const e_e=Jwe;function nne(o){return function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.width?String(e.width):o.defaultWidth,s=o.formats[t]||o.formats[o.defaultWidth];return s}}var t_e={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},n_e={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},o_e={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},s_e={date:nne({formats:t_e,defaultWidth:"full"}),time:nne({formats:n_e,defaultWidth:"full"}),dateTime:nne({formats:o_e,defaultWidth:"full"})};const r_e=s_e;var i_e={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},a_e=function(e,t,s,a){return i_e[e]};const l_e=a_e;function DN(o){return function(e,t){var s=t!=null&&t.context?String(t.context):"standalone",a;if(s==="formatting"&&o.formattingValues){var l=o.defaultFormattingWidth||o.defaultWidth,f=t!=null&&t.width?String(t.width):l;a=o.formattingValues[f]||o.formattingValues[l]}else{var d=o.defaultWidth,h=t!=null&&t.width?String(t.width):o.defaultWidth;a=o.values[h]||o.values[d]}var b=o.argumentCallback?o.argumentCallback(e):e;return a[b]}}var c_e={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},u_e={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},f_e={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},d_e={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},h_e={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},m_e={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},g_e=function(e,t){var s=Number(e),a=s%100;if(a>20||a<10)switch(a%10){case 1:return s+"st";case 2:return s+"nd";case 3:return s+"rd"}return s+"th"},p_e={ordinalNumber:g_e,era:DN({values:c_e,defaultWidth:"wide"}),quarter:DN({values:u_e,defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:DN({values:f_e,defaultWidth:"wide"}),day:DN({values:d_e,defaultWidth:"wide"}),dayPeriod:DN({values:h_e,defaultWidth:"wide",formattingValues:m_e,defaultFormattingWidth:"wide"})};const b_e=p_e;function PN(o){return function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=t.width,a=s&&o.matchPatterns[s]||o.matchPatterns[o.defaultMatchWidth],l=e.match(a);if(!l)return null;var f=l[0],d=s&&o.parsePatterns[s]||o.parsePatterns[o.defaultParseWidth],h=Array.isArray(d)?O_e(d,function(k){return k.test(f)}):v_e(d,function(k){return k.test(f)}),b;b=o.valueCallback?o.valueCallback(h):h,b=t.valueCallback?t.valueCallback(b):b;var w=e.slice(f.length);return{value:b,rest:w}}}function v_e(o,e){for(var t in o)if(o.hasOwnProperty(t)&&e(o[t]))return t}function O_e(o,e){for(var t=0;t1&&arguments[1]!==void 0?arguments[1]:{},s=e.match(o.matchPattern);if(!s)return null;var a=s[0],l=e.match(o.parsePattern);if(!l)return null;var f=o.valueCallback?o.valueCallback(l[0]):l[0];f=t.valueCallback?t.valueCallback(f):f;var d=e.slice(a.length);return{value:f,rest:d}}}var w_e=/^(\d+)(th|st|nd|rd)?/i,__e=/\d+/i,S_e={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},C_e={any:[/^b/i,/^(a|c)/i]},k_e={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},x_e={any:[/1/i,/2/i,/3/i,/4/i]},E_e={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},T_e={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},A_e={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},D_e={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},P_e={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},M_e={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},R_e={ordinalNumber:y_e({matchPattern:w_e,parsePattern:__e,valueCallback:function(e){return parseInt(e,10)}}),era:PN({matchPatterns:S_e,defaultMatchWidth:"wide",parsePatterns:C_e,defaultParseWidth:"any"}),quarter:PN({matchPatterns:k_e,defaultMatchWidth:"wide",parsePatterns:x_e,defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:PN({matchPatterns:E_e,defaultMatchWidth:"wide",parsePatterns:T_e,defaultParseWidth:"any"}),day:PN({matchPatterns:A_e,defaultMatchWidth:"wide",parsePatterns:D_e,defaultParseWidth:"any"}),dayPeriod:PN({matchPatterns:P_e,defaultMatchWidth:"any",parsePatterns:M_e,defaultParseWidth:"any"})};const $_e=R_e;var N_e={code:"en-US",formatDistance:e_e,formatLong:r_e,formatRelative:l_e,localize:b_e,match:$_e,options:{weekStartsOn:0,firstWeekContainsDate:1}};const I_e=N_e;function fpe(o,e){if(o==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(o[t]=e[t]);return o}function B_e(o){return fpe({},o)}var Sle=1440,L_e=2520,one=43200,F_e=86400;function Q_e(o,e,t){var s,a;Yb(2,arguments);var l=zwe(),f=(s=(a=t==null?void 0:t.locale)!==null&&a!==void 0?a:l.locale)!==null&&s!==void 0?s:I_e;if(!f.formatDistance)throw new RangeError("locale must contain formatDistance property");var d=Oz(o,e);if(isNaN(d))throw new RangeError("Invalid time value");var h=fpe(B_e(t),{addSuffix:Boolean(t==null?void 0:t.addSuffix),comparison:d}),b,w;d>0?(b=Wh(e),w=Wh(o)):(b=Wh(o),w=Wh(e));var k=Gwe(w,b),T=(wle(w)-wle(b))/1e3,R=Math.round((k-T)/60),$;if(R<2)return t!=null&&t.includeSeconds?k<5?f.formatDistance("lessThanXSeconds",5,h):k<10?f.formatDistance("lessThanXSeconds",10,h):k<20?f.formatDistance("lessThanXSeconds",20,h):k<40?f.formatDistance("halfAMinute",0,h):k<60?f.formatDistance("lessThanXMinutes",1,h):f.formatDistance("xMinutes",1,h):R===0?f.formatDistance("lessThanXMinutes",1,h):f.formatDistance("xMinutes",R,h);if(R<45)return f.formatDistance("xMinutes",R,h);if(R<90)return f.formatDistance("aboutXHours",1,h);if(Rh.name===(e==null?void 0:e.schema));if(!(s!=null&&s.titleTemplate))return kle(s,e);let a=e.data,f=Lp.parse(s.titleTemplate).filter(h=>h[0]=="name").map(h=>h[1]).filter(h=>{let b=s.fields.find(w=>w.name===h);return(b==null?void 0:b.info.name)==="reference"}).reduce((h,b)=>{let w=t.edges.find(T=>T.source===e.id&&T.field===b),k=t.records.find(T=>T.id===(w==null?void 0:w.target));return h[b]=vd(o,k,t),h},{});a={...a,...f};let d=Lp.render(s.titleTemplate,a);return!d||d===""?kle(s,e):mpe(d.slice(0,300))}function kle(o,e){var t;return(o==null?void 0:o.type)==="files"?e._file.path:mpe(e==null?void 0:e.data[(t=o.fields.filter(s=>s.info.name==="text")[0])==null?void 0:t.name]).slice(0,300)}function xle(o){let e,t,s;return{c(){e=ie("a"),t=Xt(o[1]),H(e,"href",s=o[3].lucentUrl+"/records/"+o[0].id),H(e,"class","text-decoration-none rounded py-1 px-2 d-inline-block svelte-nbbgyi"),H(e,"title",o[1]),rs(e,"border","2px solid "+(o[2].color?o[2].color:"#999"),1),rs(e,"white-space","nowrap")},m(a,l){Re(a,e,l),X(e,t)},p(a,l){l&2&&Wn(t,a[1]),l&1&&s!==(s=a[3].lucentUrl+"/records/"+a[0].id)&&H(e,"href",s),l&2&&H(e,"title",a[1]),l&4&&rs(e,"border","2px solid "+(a[2].color?a[2].color:"#999"),1)},d(a){a&&Me(e)}}}function Z_e(o){var s;let e,t=((s=o[0])==null?void 0:s.data)&&xle(o);return{c(){t&&t.c(),e=Bs()},m(a,l){t&&t.m(a,l),Re(a,e,l)},p(a,[l]){var f;(f=a[0])!=null&&f.data?t?t.p(a,l):(t=xle(a),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},i:pn,o:pn,d(a){t&&t.d(a),a&&Me(e)}}}function z_e(o,e,t){let s,a;const l=si("channel");let{record:f}=e,{graph:d}=e;return o.$$set=h=>{"record"in h&&t(0,f=h.record),"graph"in h&&t(4,d=h.graph)},o.$$.update=()=>{o.$$.dirty&1&&t(2,s=l.schemas.find(h=>h.name===f.schema)),o.$$.dirty&17&&t(1,a=vd(l.schemas,f,d))},[f,a,s,l,d]}class W6 extends vo{constructor(e){super(),bo(this,e,z_e,Z_e,po,{record:0,graph:4})}}function Ele(o,e,t){const s=o.slice();return s[2]=e[t],s[4]=t,s}function Tle(o){let e,t,s=o[0].reverse(),a=[];for(let f=0;fQe(a[f],1,1,()=>{a[f]=null});return{c(){e=ie("div");for(let f=0;f0&&Tle(o);return{c(){s&&s.c(),e=Bs()},m(a,l){s&&s.m(a,l),Re(a,e,l),t=!0},p(a,[l]){a[0].length>0?s?(s.p(a,l),l&1&&xe(s,1)):(s=Tle(a),s.c(),xe(s,1),s.m(e.parentNode,e)):s&&(wo(),Qe(s,1,1,()=>{s=null}),_o())},i(a){t||(xe(s),t=!0)},o(a){Qe(s),t=!1},d(a){s&&s.d(a),a&&Me(e)}}}function W_e(o,e,t){let{managerRecords:s}=e,{graph:a}=e;return o.$$set=l=>{"managerRecords"in l&&t(0,s=l.managerRecords),"graph"in l&&t(1,a=l.graph)},[s,a]}class U_e extends vo{constructor(e){super(),bo(this,e,W_e,V_e,po,{managerRecords:0,graph:1})}}function Y_e(o){let e;return{c(){e=Xt("New Record")},m(t,s){Re(t,e,s)},p:pn,d(t){t&&Me(e)}}}function X_e(o){let e=vd(o[5].schemas,o[3],o[2])+"",t;return{c(){t=Xt(e)},m(s,a){Re(s,t,a)},p(s,a){a&12&&e!==(e=vd(s[5].schemas,s[3],s[2])+"")&&Wn(t,e)},d(s){s&&Me(t)}}}function Dle(o){let e,t,s,a,l,f,d,h,b,w,k,T,R,$,Q,F,U;s=new ml({props:{icon:"ellipsis"}});let ee=!o[4]&&Ple(o);return{c(){e=ie("div"),t=ie("button"),tn(s.$$.fragment),a=Ze(),l=ie("div"),f=ie("h6"),f.textContent="Record Actions",d=Ze(),h=ie("a"),b=Xt("Create new"),k=Ze(),ee&&ee.c(),T=Ze(),R=ie("a"),$=Xt("Revisions"),H(t,"class","btn btn-link btn-sm"),H(t,"type","button"),H(t,"data-bs-toggle","dropdown"),H(t,"aria-expanded","false"),H(f,"class","dropdown-header"),H(h,"class","dropdown-item"),H(h,"href",w=o[5].lucentUrl+"/records/new?schema="+o[1].name),H(R,"class","dropdown-item"),H(R,"href",o[5].lucentUrl),H(l,"class","dropdown-menu"),H(e,"class","dropdown d-inline-block")},m(I,te){Re(I,e,te),X(e,t),Kt(s,t,null),X(e,a),X(e,l),X(l,f),X(l,d),X(l,h),X(h,b),X(l,k),ee&&ee.m(l,null),X(l,T),X(l,R),X(R,$),Q=!0,F||(U=vn(R,"click",Uu(o[7])),F=!0)},p(I,te){(!Q||te&2&&w!==(w=I[5].lucentUrl+"/records/new?schema="+I[1].name))&&H(h,"href",w),I[4]?ee&&(ee.d(1),ee=null):ee?ee.p(I,te):(ee=Ple(I),ee.c(),ee.m(l,T))},i(I){Q||(xe(s.$$.fragment,I),Q=!0)},o(I){Qe(s.$$.fragment,I),Q=!1},d(I){I&&Me(e),Jt(s),ee&&ee.d(),F=!1,U()}}}function Ple(o){let e,t,s,a;return{c(){e=ie("a"),t=Xt("Clone"),H(e,"class","dropdown-item"),H(e,"href",o[5].lucentUrl)},m(l,f){Re(l,e,f),X(e,t),s||(a=vn(e,"click",o[6]),s=!0)},p:pn,d(l){l&&Me(e),s=!1,a()}}}function j_e(o){let e,t,s=o[1].label.toUpperCase()+"",a,l,f,d,h,b;function w($,Q){return $[4]?Y_e:X_e}let k=w(o),T=k(o),R=!o[4]&&Dle(o);return{c(){e=ie("h3"),t=ie("a"),a=Xt(s),f=Ze(),d=ie("span"),T.c(),h=Ze(),R&&R.c(),H(t,"class","text-muted d-block text-decoration-none fs-6 mb-1"),H(t,"href",l=o[5].lucentUrl+"/content/"+o[1].name),H(d,"class","text-dark d-block"),H(e,"class","header-normal mt-5 mb-0")},m($,Q){Re($,e,Q),X(e,t),X(t,a),X(e,f),X(e,d),T.m(d,null),X(e,h),R&&R.m(e,null),b=!0},p($,[Q]){(!b||Q&2)&&s!==(s=$[1].label.toUpperCase()+"")&&Wn(a,s),(!b||Q&2&&l!==(l=$[5].lucentUrl+"/content/"+$[1].name))&&H(t,"href",l),k===(k=w($))&&T?T.p($,Q):(T.d(1),T=k($),T&&(T.c(),T.m(d,null))),$[4]?R&&(wo(),Qe(R,1,1,()=>{R=null}),_o()):R?(R.p($,Q),Q&16&&xe(R,1)):(R=Dle($),R.c(),xe(R,1),R.m(e,null))},i($){b||(xe(R),b=!0)},o($){Qe(R),b=!1},d($){$&&Me(e),T.d(),R&&R.d()}}}function q_e(o,e,t){const s=si("channel");let{schema:a}=e,{graph:l}=e,{record:f}=e,{isCreateMode:d}=e,{activeContentTab:h}=e;function b(k){k.preventDefault(),axios.post(s.lucentUrl+"/records/clone/"+f.id).then(T=>{window.location=s.lucentUrl+"/records/"+T.data.id}).catch(T=>{})}const w=k=>t(0,h="_info");return o.$$set=k=>{"schema"in k&&t(1,a=k.schema),"graph"in k&&t(2,l=k.graph),"record"in k&&t(3,f=k.record),"isCreateMode"in k&&t(4,d=k.isCreateMode),"activeContentTab"in k&&t(0,h=k.activeContentTab)},[h,a,l,f,d,s,b,w]}class G_e extends vo{constructor(e){super(),bo(this,e,q_e,j_e,po,{schema:1,graph:2,record:3,isCreateMode:4,activeContentTab:0})}}function gpe(o){return ppe()[o]}function ppe(){return{published:{value:"published",text:"Published",bg:"success",color:"white"},trashed:{value:"trashed",text:"Trashed",bg:"danger",color:"white"},draft:{value:"draft",text:"Draft",bg:"warning",color:"dark"}}}function Mle(o,e,t){const s=o.slice();return s[10]=e[t],s}function Rle(o){let e,t=o[10].text+"",s,a,l,f;function d(...h){return o[9](o[10],...h)}return{c(){e=ie("button"),s=Xt(t),a=Ze(),H(e,"type","button"),H(e,"class","dropdown-item my-2 rounded w-100 bg-"+o[10].bg+" text-"+o[10].color)},m(h,b){Re(h,e,b),X(e,s),X(e,a),l||(f=vn(e,"click",d),l=!0)},p(h,b){o=h},d(h){h&&Me(e),l=!1,f()}}}function $le(o){let e,t=o[10].value!==o[0]&&Rle(o);return{c(){t&&t.c(),e=Bs()},m(s,a){t&&t.m(s,a),Re(s,e,a)},p(s,a){s[10].value!==s[0]?t?t.p(s,a):(t=Rle(s),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(s){t&&t.d(s),s&&Me(e)}}}function K_e(o){let e,t,s;return{c(){e=ie("a"),t=Xt("Preview"),H(e,"href",s=o[5].previewTargetUrl+"?schema="+o[2].name+"&id="+o[1].id),H(e,"target","_blank"),H(e,"class","btn btn-info ms-3")},m(a,l){Re(a,e,l),X(e,t)},p(a,l){l&6&&s!==(s=a[5].previewTargetUrl+"?schema="+a[2].name+"&id="+a[1].id)&&H(e,"href",s)},d(a){a&&Me(e)}}}function J_e(o){let e,t,s,a=o[4].text+"",l,f,d,h,b,w,k,T,R,$,Q,F=o[6],U=[];for(let I=0;I{h=R,t(3,h)})}const T=(R,$)=>w($,R.value);return o.$$set=R=>{"status"in R&&t(0,l=R.status),"record"in R&&t(1,f=R.record),"schema"in R&&t(2,d=R.schema)},o.$$.update=()=>{o.$$.dirty&1&&t(4,s=gpe(l))},[l,f,d,h,s,a,b,w,k,T]}class bpe extends vo{constructor(e){super(),bo(this,e,eSe,J_e,po,{status:0,record:1,schema:2})}}function Nle(o){return o._file.mime==="image/svg+xml"?_oe(o):si("channel").filesUrl+`/thumbs/${o._file.path}`}function _oe(o){return si("channel").filesUrl+`/${o._file.path}`}function Ile(o){let e,t,s,a,l;const f=[nSe,tSe],d=[];function h(b,w){return w&1&&(e=null),e==null&&(e=!!b[0]._file.mime.startsWith("image")),e?0:1}return t=h(o,-1),s=d[t]=f[t](o),{c(){s.c(),a=Bs()},m(b,w){d[t].m(b,w),Re(b,a,w),l=!0},p(b,w){let k=t;t=h(b,w),t===k?d[t].p(b,w):(wo(),Qe(d[k],1,1,()=>{d[k]=null}),_o(),s=d[t],s?s.p(b,w):(s=d[t]=f[t](b),s.c()),xe(s,1),s.m(a.parentNode,a))},i(b){l||(xe(s),l=!0)},o(b){Qe(s),l=!1},d(b){d[t].d(b),b&&Me(a)}}}function tSe(o){let e,t,s,a,l,f=o[0]._file.path.split(".").pop()+"",d,h,b,w;return t=new ml({props:{icon:"file",width:o[3],height:o[3]}}),{c(){e=ie("a"),tn(t.$$.fragment),s=Ze(),a=ie("span"),l=Xt("."),d=Xt(f),H(a,"class","ms-2"),rs(a,"font-size",o[4]+"px"),H(e,"href",h=o[5].lucentUrl+"/records/"+o[0].id),H(e,"title",b=o[0]._file.path),H(e,"class","btn btn-outline-primary btn-sm d-flex align-items-center justify-content-center"),rs(e,"width",o[2]+"px"),rs(e,"height",o[2]+"px")},m(k,T){Re(k,e,T),Kt(t,e,null),X(e,s),X(e,a),X(a,l),X(a,d),w=!0},p(k,T){const R={};T&8&&(R.width=k[3]),T&8&&(R.height=k[3]),t.$set(R),(!w||T&1)&&f!==(f=k[0]._file.path.split(".").pop()+"")&&Wn(d,f),(!w||T&16)&&rs(a,"font-size",k[4]+"px"),(!w||T&1&&h!==(h=k[5].lucentUrl+"/records/"+k[0].id))&&H(e,"href",h),(!w||T&1&&b!==(b=k[0]._file.path))&&H(e,"title",b),(!w||T&4)&&rs(e,"width",k[2]+"px"),(!w||T&4)&&rs(e,"height",k[2]+"px")},i(k){w||(xe(t.$$.fragment,k),w=!0)},o(k){Qe(t.$$.fragment,k),w=!1},d(k){k&&Me(e),Jt(t)}}}function nSe(o){let e,t,s,a,l,f;return{c(){e=ie("a"),t=ie("img"),H(t,"class","rounded w-100"),nle(t.src,s=Nle(o[0]))||H(t,"src",s),H(t,"alt",a=o[0]._file.path),H(e,"href",l=o[5].lucentUrl+"/records/"+o[0].id),H(e,"title",f=o[0]._file.path),H(e,"class","d-flex align-items-center justify-content-center "),rs(e,"width",o[2]+"px"),rs(e,"height",o[2]+"px")},m(d,h){Re(d,e,h),X(e,t)},p(d,h){h&1&&!nle(t.src,s=Nle(d[0]))&&H(t,"src",s),h&1&&a!==(a=d[0]._file.path)&&H(t,"alt",a),h&1&&l!==(l=d[5].lucentUrl+"/records/"+d[0].id)&&H(e,"href",l),h&1&&f!==(f=d[0]._file.path)&&H(e,"title",f),h&4&&rs(e,"width",d[2]+"px"),h&4&&rs(e,"height",d[2]+"px")},i:pn,o:pn,d(d){d&&Me(e)}}}function Ble(o){let e,t=o[0]._file.path+"",s,a,l;return{c(){e=ie("a"),s=Xt(t),H(e,"href",a=o[5].lucentUrl+"/records/"+o[0].id),H(e,"title",l=o[0]._file.path),H(e,"class","preview-file-filename lx-small-text text-decoration-none")},m(f,d){Re(f,e,d),X(e,s)},p(f,d){d&1&&t!==(t=f[0]._file.path+"")&&Wn(s,t),d&1&&a!==(a=f[5].lucentUrl+"/records/"+f[0].id)&&H(e,"href",a),d&1&&l!==(l=f[0]._file.path)&&H(e,"title",l)},d(f){f&&Me(e)}}}function oSe(o){let e,t,s,a=o[0]&&Ile(o),l=o[1]&&Ble(o);return{c(){a&&a.c(),e=Ze(),l&&l.c(),t=Bs()},m(f,d){a&&a.m(f,d),Re(f,e,d),l&&l.m(f,d),Re(f,t,d),s=!0},p(f,[d]){f[0]?a?(a.p(f,d),d&1&&xe(a,1)):(a=Ile(f),a.c(),xe(a,1),a.m(e.parentNode,e)):a&&(wo(),Qe(a,1,1,()=>{a=null}),_o()),f[1]?l?l.p(f,d):(l=Ble(f),l.c(),l.m(t.parentNode,t)):l&&(l.d(1),l=null)},i(f){s||(xe(a),s=!0)},o(f){Qe(a),s=!1},d(f){a&&a.d(f),f&&Me(e),l&&l.d(f),f&&Me(t)}}}function sSe(o,e,t){let{record:s}=e;const a=si("channel");let{size:l="small"}=e,{showFilename:f=!1}=e,d,h,b;return l=="large"?(d=256,h=32,b="20"):l=="medium"?(d=128,h=12,b="17"):l=="small"?(d=64,h=12,b="15"):l=="tiny"&&(d=42,h=12,b="13"),o.$$set=w=>{"record"in w&&t(0,s=w.record),"size"in w&&t(6,l=w.size),"showFilename"in w&&t(1,f=w.showFilename)},[s,f,d,h,b,a,l]}class Yw extends vo{constructor(e){super(),bo(this,e,sSe,oSe,po,{record:0,size:6,showFilename:1})}}function Lle(o){let e,t,s,a,l,f,d,h,b,w,k=o[0]._file.path+"",T,R,$,Q,F,U,ee=o[0]._file.originalName+"",I,te,oe,ne,G,ye,Se=o[0]._file.mime+"",Ae,Oe,ue,rt,nt,St,V,ht=(o[0]._file.size/1024).toFixed(1)+"",We,Ct,Ot,$e,Je,an,Tt,An=o[0]._file.checksum+"",Xe,wt,he,Zo,ao,wn,Co=o[0]._file.path+"",zo,yt,Wt;s=new Yw({props:{record:o[0],size:"large"}});let mt=o[0]._file.width&&Fle(o);return{c(){e=ie("div"),t=ie("div"),tn(s.$$.fragment),a=Ze(),l=ie("div"),f=ie("ul"),d=ie("li"),h=ie("span"),h.textContent="Filename",b=Ze(),w=ie("span"),T=Xt(k),R=Ze(),$=ie("li"),Q=ie("span"),Q.textContent="Original name",F=Ze(),U=ie("span"),I=Xt(ee),te=Ze(),oe=ie("li"),ne=ie("span"),ne.textContent="Mime type",G=Ze(),ye=ie("span"),Ae=Xt(Se),Oe=Ze(),mt&&mt.c(),ue=Ze(),rt=ie("li"),nt=ie("span"),nt.textContent="File size",St=Ze(),V=ie("span"),We=Xt(ht),Ct=Xt("kB"),Ot=Ze(),$e=ie("li"),Je=ie("span"),Je.textContent="Checksum",an=Ze(),Tt=ie("span"),Xe=Xt(An),wt=Ze(),he=ie("li"),Zo=ie("span"),Zo.textContent="Download",ao=Ze(),wn=ie("a"),zo=Xt(Co),H(t,"class","col"),rs(t,"max-width","276px"),H(h,"class","text-muted"),H(d,"class","list-group-item border-primary"),H(Q,"class","text-muted"),H($,"class","list-group-item border-primary"),H(ne,"class","text-muted"),H(oe,"class","list-group-item border-primary"),H(nt,"class","text-muted"),H(rt,"class","list-group-item border-primary"),H(Je,"class","text-muted"),H($e,"class","list-group-item border-primary"),H(Zo,"class","text-muted"),H(wn,"href",yt=_oe(o[0])),H(he,"class","list-group-item border-primary"),H(f,"class","list-group svelte-1qb90xc"),H(l,"class","col"),H(e,"class","row mb-4")},m(Ie,Gt){Re(Ie,e,Gt),X(e,t),Kt(s,t,null),X(e,a),X(e,l),X(l,f),X(f,d),X(d,h),X(d,b),X(d,w),X(w,T),X(f,R),X(f,$),X($,Q),X($,F),X($,U),X(U,I),X(f,te),X(f,oe),X(oe,ne),X(oe,G),X(oe,ye),X(ye,Ae),X(f,Oe),mt&&mt.m(f,null),X(f,ue),X(f,rt),X(rt,nt),X(rt,St),X(rt,V),X(V,We),X(V,Ct),X(f,Ot),X(f,$e),X($e,Je),X($e,an),X($e,Tt),X(Tt,Xe),X(f,wt),X(f,he),X(he,Zo),X(he,ao),X(he,wn),X(wn,zo),Wt=!0},p(Ie,Gt){const gn={};Gt&1&&(gn.record=Ie[0]),s.$set(gn),(!Wt||Gt&1)&&k!==(k=Ie[0]._file.path+"")&&Wn(T,k),(!Wt||Gt&1)&&ee!==(ee=Ie[0]._file.originalName+"")&&Wn(I,ee),(!Wt||Gt&1)&&Se!==(Se=Ie[0]._file.mime+"")&&Wn(Ae,Se),Ie[0]._file.width?mt?mt.p(Ie,Gt):(mt=Fle(Ie),mt.c(),mt.m(f,ue)):mt&&(mt.d(1),mt=null),(!Wt||Gt&1)&&ht!==(ht=(Ie[0]._file.size/1024).toFixed(1)+"")&&Wn(We,ht),(!Wt||Gt&1)&&An!==(An=Ie[0]._file.checksum+"")&&Wn(Xe,An),(!Wt||Gt&1)&&Co!==(Co=Ie[0]._file.path+"")&&Wn(zo,Co),(!Wt||Gt&1&&yt!==(yt=_oe(Ie[0])))&&H(wn,"href",yt)},i(Ie){Wt||(xe(s.$$.fragment,Ie),Wt=!0)},o(Ie){Qe(s.$$.fragment,Ie),Wt=!1},d(Ie){Ie&&Me(e),Jt(s),mt&&mt.d()}}}function Fle(o){let e,t,s,a,l=o[0]._file.width+"",f,d,h=o[0]._file.height+"",b;return{c(){e=ie("li"),t=ie("span"),t.textContent="Dimensions",s=Ze(),a=ie("span"),f=Xt(l),d=Xt("x"),b=Xt(h),H(t,"class","text-muted"),H(e,"class","list-group-item border-primary")},m(w,k){Re(w,e,k),X(e,t),X(e,s),X(e,a),X(a,f),X(a,d),X(a,b)},p(w,k){k&1&&l!==(l=w[0]._file.width+"")&&Wn(f,l),k&1&&h!==(h=w[0]._file.height+"")&&Wn(b,h)},d(w){w&&Me(e)}}}function rSe(o){let e,t,s=o[1].type==="files"&&Lle(o);return{c(){s&&s.c(),e=Bs()},m(a,l){s&&s.m(a,l),Re(a,e,l),t=!0},p(a,[l]){a[1].type==="files"?s?(s.p(a,l),l&2&&xe(s,1)):(s=Lle(a),s.c(),xe(s,1),s.m(e.parentNode,e)):s&&(wo(),Qe(s,1,1,()=>{s=null}),_o())},i(a){t||(xe(s),t=!0)},o(a){Qe(s),t=!1},d(a){s&&s.d(a),a&&Me(e)}}}function iSe(o,e,t){let{record:s}=e,{schema:a}=e;return o.$$set=l=>{"record"in l&&t(0,s=l.record),"schema"in l&&t(1,a=l.schema)},[s,a]}class vpe extends vo{constructor(e){super(),bo(this,e,iSe,rSe,po,{record:0,schema:1})}}function Qle(o,e,t){const s=o.slice();return s[9]=e[t],s}function Zle(o){let e,t=o[1],s=[];for(let a=0;a1&&Zle(o);return{c(){t&&t.c(),e=Bs()},m(s,a){t&&t.m(s,a),Re(s,e,a)},p(s,[a]){s[1].length>1?t?t.p(s,a):(t=Zle(s),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},i:pn,o:pn,d(s){t&&t.d(s),s&&Me(e)}}}function lSe(o,e,t){var T,R;let{schema:s}=e,{isCreateMode:a}=e,{active:l=""}=e,f=(R=(T=s.groups)==null?void 0:T.map($=>({label:$,name:$})))!=null?R:[],d={label:"Main",name:""},h={label:"Graph",name:"_graph"};a?f=[d,...f]:f=[d,...f,h];function b($){$.preventDefault(),t(0,l="_graph")}function w($,Q){$.preventDefault(),Q=="_graph"?b($):t(0,l=Q)}const k=($,Q)=>w(Q,$.name);return o.$$set=$=>{"schema"in $&&t(3,s=$.schema),"isCreateMode"in $&&t(4,a=$.isCreateMode),"active"in $&&t(0,l=$.active)},[l,f,w,s,a,k]}class Ope extends vo{constructor(e){super(),bo(this,e,lSe,aSe,po,{schema:3,isCreateMode:4,active:0})}}function Hle(o,e,t){const s=o.slice();return s[11]=e[t],s}function Vle(o){let e=[],t=new Map,s,a=o[3];const l=d=>d[11].id;for(let d=0;d{axios.get("/records/suggestions",{params:{schema:l.optionsFrom,field:l.optionsField,value:d,ui:l.ui}}).then(Q=>{t(3,s=Q.data)}).catch(Q=>{console.log(Q)})},500);function b($,Q){$.preventDefault(),t(0,f=Q.data[l.optionsField]),t(1,d="")}const w=($,Q)=>b(Q,$),k=($,Q)=>b(Q,$),T=$=>{t(0,f=d),t(1,d="")},R=$=>{t(0,f=d),t(1,d="")};return o.$$set=$=>{"field"in $&&t(2,l=$.field),"value"in $&&t(0,f=$.value),"search"in $&&t(1,d=$.search)},t(3,s=[]),[f,d,l,s,a,b,h,w,k,T,R]}class QH extends vo{constructor(e){super(),bo(this,e,dSe,fSe,po,{field:2,value:0,search:1,update:6})}get update(){return this.$$.ctx[6]}}function Yle(o,e,t){const s=o.slice();return s[11]=e[t][0],s[12]=e[t][1],s}function Xle(o,e,t){const s=o.slice();return s[8]=e[t],s}function jle(o){let e,t;function s(f,d){return d&1&&(e=null),e==null&&(e=!!Array.isArray(f[0].selectOptions)),e?mSe:hSe}let a=s(o,-1),l=a(o);return{c(){l.c(),t=Bs()},m(f,d){l.m(f,d),Re(f,t,d)},p(f,d){a===(a=s(f,d))&&l?l.p(f,d):(l.d(1),l=a(f),l&&(l.c(),l.m(t.parentNode,t)))},d(f){l.d(f),f&&Me(t)}}}function hSe(o){let e=[],t=new Map,s,a=Object.entries(o[0].selectOptions);const l=f=>f[11];for(let f=0;ff[8];for(let f=0;ff(T,k),h=(k,T)=>f(T,k),b=(k,T)=>f(T,k),w=(k,T)=>f(T,k);return o.$$set=k=>{"field"in k&&t(0,s=k.field),"value"in k&&t(2,a=k.value),"search"in k&&t(3,l=k.search)},[s,f,a,l,d,h,b,w]}class bSe extends vo{constructor(e){super(),bo(this,e,pSe,gSe,po,{field:0,value:2,search:3})}}function Im(o,e){return o&&o[e]?o[e].message:null}function vSe(o){let e,t,s,a;return{c(){e=ie("input"),H(e,"type","text"),H(e,"id",o[3]),H(e,"class","form-control"),H(e,"autocomplete","off"),e.readOnly=t=o[1].readonly&&!o[2],is(e,"is-invalid",o[7])},m(l,f){Re(l,e,f),hr(e,o[0]),s||(a=vn(e,"input",o[18]),s=!0)},p(l,f){f&8&&H(e,"id",l[3]),f&6&&t!==(t=l[1].readonly&&!l[2])&&(e.readOnly=t),f&1&&e.value!==l[0]&&hr(e,l[0]),f&128&&is(e,"is-invalid",l[7])},i:pn,o:pn,d(l){l&&Me(e),s=!1,a()}}}function OSe(o){let e,t,s,a,l,f,d,h,b,w,k,T,R;function $(ee){o[15](ee)}function Q(ee){o[16](ee)}let F={field:o[1]};o[0]!==void 0&&(F.value=o[0]),o[6]!==void 0&&(F.search=o[6]),f=new bSe({props:F}),Uo.push(()=>cr(f,"value",$)),Uo.push(()=>cr(f,"search",Q));let U=o[0]&&Kle(o);return{c(){e=ie("div"),t=ie("input"),a=Ze(),l=ie("div"),tn(f.$$.fragment),b=Ze(),U&&U.c(),w=Bs(),H(t,"type","search"),H(t,"id",o[3]),H(t,"class","form-control dropdown-toggle"),H(t,"placeholder","Search for options"),H(t,"data-bs-toggle","dropdown"),H(t,"autocomplete","off"),t.readOnly=s=o[1].readonly&&!o[2],is(t,"is-invalid",o[7]),H(l,"class","dropdown-menu w-100"),H(e,"class","dropdown")},m(ee,I){Re(ee,e,I),X(e,t),hr(t,o[6]),X(e,a),X(e,l),Kt(f,l,null),Re(ee,b,I),U&&U.m(ee,I),Re(ee,w,I),k=!0,T||(R=vn(t,"input",o[14]),T=!0)},p(ee,I){(!k||I&8)&&H(t,"id",ee[3]),(!k||I&6&&s!==(s=ee[1].readonly&&!ee[2]))&&(t.readOnly=s),I&64&&t.value!==ee[6]&&hr(t,ee[6]),(!k||I&128)&&is(t,"is-invalid",ee[7]);const te={};I&2&&(te.field=ee[1]),!d&&I&1&&(d=!0,te.value=ee[0],mr(()=>d=!1)),!h&&I&64&&(h=!0,te.search=ee[6],mr(()=>h=!1)),f.$set(te),ee[0]?U?U.p(ee,I):(U=Kle(ee),U.c(),U.m(w.parentNode,w)):U&&(U.d(1),U=null)},i(ee){k||(xe(f.$$.fragment,ee),k=!0)},o(ee){Qe(f.$$.fragment,ee),k=!1},d(ee){ee&&Me(e),Jt(f),ee&&Me(b),U&&U.d(ee),ee&&Me(w),T=!1,R()}}}function ySe(o){let e,t,s,a,l,f,d,h,b,w,k=o[1].optionsFrom&&Jle(o),T=o[0]&&ece(o);return{c(){e=ie("div"),t=ie("input"),a=Ze(),l=ie("div"),k&&k.c(),f=Ze(),T&&T.c(),d=Bs(),H(t,"type","search"),H(t,"id",o[3]),H(t,"class","form-control dropdown-toggle"),H(t,"placeholder","Search for options"),H(t,"data-bs-toggle","dropdown"),H(t,"autocomplete","off"),t.readOnly=s=o[1].readonly&&!o[2],is(t,"is-invalid",o[7]),H(l,"class","dropdown-menu w-100"),H(e,"class","dropdown")},m(R,$){Re(R,e,$),X(e,t),hr(t,o[6]),X(e,a),X(e,l),k&&k.m(l,null),Re(R,f,$),T&&T.m(R,$),Re(R,d,$),h=!0,b||(w=[vn(t,"keyup",function(){Vb(o[4].update)&&o[4].update.apply(this,arguments)}),vn(t,"focus",function(){Vb(o[4].update)&&o[4].update.apply(this,arguments)}),vn(t,"input",o[9])],b=!0)},p(R,$){o=R,(!h||$&8)&&H(t,"id",o[3]),(!h||$&6&&s!==(s=o[1].readonly&&!o[2]))&&(t.readOnly=s),$&64&&t.value!==o[6]&&hr(t,o[6]),(!h||$&128)&&is(t,"is-invalid",o[7]),o[1].optionsFrom?k?(k.p(o,$),$&2&&xe(k,1)):(k=Jle(o),k.c(),xe(k,1),k.m(l,null)):k&&(wo(),Qe(k,1,1,()=>{k=null}),_o()),o[0]?T?T.p(o,$):(T=ece(o),T.c(),T.m(d.parentNode,d)):T&&(T.d(1),T=null)},i(R){h||(xe(k),h=!0)},o(R){Qe(k),h=!1},d(R){R&&Me(e),k&&k.d(),R&&Me(f),T&&T.d(R),R&&Me(d),b=!1,$i(w)}}}function Kle(o){let e,t,s,a,l,f,d;function h(k,T){return T&2&&(s=null),s==null&&(s=!!Array.isArray(k[1].selectOptions)),s?_Se:wSe}let b=h(o,-1),w=b(o);return{c(){e=ie("span"),t=ie("div"),w.c(),a=Ze(),l=ie("button"),H(l,"type","button"),H(l,"class","btn-close btn-sm ms-1"),rs(l,"font-size","10px"),H(l,"aria-label","Close"),H(t,"class","d-flex align-items-center "),H(e,"class","badge rounded-pill bg-light text-dark fs-6 mt-3")},m(k,T){Re(k,e,T),X(e,t),w.m(t,null),X(t,a),X(t,l),f||(d=vn(l,"click",Uu(o[17])),f=!0)},p(k,T){b===(b=h(k,T))&&w?w.p(k,T):(w.d(1),w=b(k),w&&(w.c(),w.m(t,a)))},d(k){k&&Me(e),w.d(),f=!1,d()}}}function wSe(o){let e=o[1].selectOptions[o[0]]+"",t;return{c(){t=Xt(e)},m(s,a){Re(s,t,a)},p(s,a){a&3&&e!==(e=s[1].selectOptions[s[0]]+"")&&Wn(t,e)},d(s){s&&Me(t)}}}function _Se(o){let e;return{c(){e=Xt(o[0])},m(t,s){Re(t,e,s)},p(t,s){s&1&&Wn(e,t[0])},d(t){t&&Me(e)}}}function Jle(o){let e,t,s,a;function l(h){o[11](h)}function f(h){o[12](h)}let d={field:o[1]};return o[0]!==void 0&&(d.value=o[0]),o[6]!==void 0&&(d.search=o[6]),e=new QH({props:d}),o[10](e),Uo.push(()=>cr(e,"value",l)),Uo.push(()=>cr(e,"search",f)),{c(){tn(e.$$.fragment)},m(h,b){Kt(e,h,b),a=!0},p(h,b){const w={};b&2&&(w.field=h[1]),!t&&b&1&&(t=!0,w.value=h[0],mr(()=>t=!1)),!s&&b&64&&(s=!0,w.search=h[6],mr(()=>s=!1)),e.$set(w)},i(h){a||(xe(e.$$.fragment,h),a=!0)},o(h){Qe(e.$$.fragment,h),a=!1},d(h){o[10](null),Jt(e,h)}}}function ece(o){let e,t,s,a,l,f,d;return{c(){e=ie("span"),t=ie("div"),s=Xt(o[0]),a=Ze(),l=ie("button"),H(l,"type","button"),H(l,"class","btn-close btn-sm ms-1"),rs(l,"font-size","10px"),H(l,"aria-label","Close"),H(t,"class","d-flex align-items-center "),H(e,"class","badge rounded-pill bg-light text-dark fs-6 mt-3")},m(h,b){Re(h,e,b),X(e,t),X(t,s),X(t,a),X(t,l),f||(d=vn(l,"click",Uu(o[13])),f=!0)},p(h,b){b&1&&Wn(s,h[0])},d(h){h&&Me(e),f=!1,d()}}}function tce(o){let e,t;return{c(){e=ie("div"),t=Xt(o[7]),H(e,"class","invalid-feedback d-block")},m(s,a){Re(s,e,a),X(e,t)},p(s,a){a&128&&Wn(t,s[7])},d(s){s&&Me(e)}}}function SSe(o){let e,t,s,a,l;const f=[ySe,OSe,vSe],d=[];function h(w,k){return w[5]?0:w[1].selectOptions?1:2}t=h(o),s=d[t]=f[t](o);let b=o[7]&&tce(o);return{c(){e=ie("div"),s.c(),a=Ze(),b&&b.c(),H(e,"class","mb-0")},m(w,k){Re(w,e,k),d[t].m(e,null),X(e,a),b&&b.m(e,null),l=!0},p(w,[k]){let T=t;t=h(w),t===T?d[t].p(w,k):(wo(),Qe(d[T],1,1,()=>{d[T]=null}),_o(),s=d[t],s?s.p(w,k):(s=d[t]=f[t](w),s.c()),xe(s,1),s.m(e,a)),w[7]?b?b.p(w,k):(b=tce(w),b.c(),b.m(e,null)):b&&(b.d(1),b=null)},i(w){l||(xe(s),l=!0)},o(w){Qe(s),l=!1},d(w){w&&Me(e),d[t].d(),b&&b.d()}}}function CSe(o,e,t){let s,a,l,{field:f}=e,{value:d}=e,{isCreateMode:h}=e,{validationErrors:b}=e,{id:w}=e,k;function T(){a=this.value,t(6,a)}function R(ne){Uo[ne?"unshift":"push"](()=>{k=ne,t(4,k)})}function $(ne){d=ne,t(0,d)}function Q(ne){a=ne,t(6,a)}const F=ne=>t(0,d="");function U(){a=this.value,t(6,a)}function ee(ne){d=ne,t(0,d)}function I(ne){a=ne,t(6,a)}const te=ne=>t(0,d="");function oe(){d=this.value,t(0,d)}return o.$$set=ne=>{"field"in ne&&t(1,f=ne.field),"value"in ne&&t(0,d=ne.value),"isCreateMode"in ne&&t(2,h=ne.isCreateMode),"validationErrors"in ne&&t(8,b=ne.validationErrors),"id"in ne&&t(3,w=ne.id)},o.$$.update=()=>{o.$$.dirty&258&&t(7,s=Im(b,f.name)),o.$$.dirty&6&&t(5,l=f.optionsFrom&&!(f.readonly&&!h))},t(6,a=""),[d,f,h,w,k,l,a,s,b,T,R,$,Q,F,U,ee,I,te,oe]}class ype extends vo{constructor(e){super(),bo(this,e,CSe,SSe,po,{field:1,value:0,isCreateMode:2,validationErrors:8,id:3})}}function nce(o){let e,t;return{c(){e=ie("div"),t=Xt(o[4]),H(e,"class","invalid-feedback d-block")},m(s,a){Re(s,e,a),X(e,t)},p(s,a){a&16&&Wn(t,s[4])},d(s){s&&Me(e)}}}function kSe(o){let e,t,s,a,l,f,d=o[4]&&nce(o);return{c(){e=ie("div"),t=ie("input"),a=Ze(),d&&d.c(),H(t,"type","text"),H(t,"id",o[3]),H(t,"class","form-control"),H(t,"autocomplete","off"),t.readOnly=s=o[1].readonly&&!o[2],is(t,"is-invalid",o[4]),H(e,"class","mb-0")},m(h,b){Re(h,e,b),X(e,t),hr(t,o[0]),X(e,a),d&&d.m(e,null),l||(f=vn(t,"input",o[6]),l=!0)},p(h,[b]){b&8&&H(t,"id",h[3]),b&6&&s!==(s=h[1].readonly&&!h[2])&&(t.readOnly=s),b&1&&t.value!==h[0]&&hr(t,h[0]),b&16&&is(t,"is-invalid",h[4]),h[4]?d?d.p(h,b):(d=nce(h),d.c(),d.m(e,null)):d&&(d.d(1),d=null)},i:pn,o:pn,d(h){h&&Me(e),d&&d.d(),l=!1,f()}}}function xSe(o,e,t){let s,{field:a}=e,{value:l}=e,{isCreateMode:f}=e,{validationErrors:d}=e,{id:h}=e;function b(){l=this.value,t(0,l)}return o.$$set=w=>{"field"in w&&t(1,a=w.field),"value"in w&&t(0,l=w.value),"isCreateMode"in w&&t(2,f=w.isCreateMode),"validationErrors"in w&&t(5,d=w.validationErrors),"id"in w&&t(3,h=w.id)},o.$$.update=()=>{o.$$.dirty&34&&t(4,s=Im(d,a.name))},[l,a,f,h,s,d,b]}class wpe extends vo{constructor(e){super(),bo(this,e,xSe,kSe,po,{field:1,value:0,isCreateMode:2,validationErrors:5,id:3})}}function U6(o,e,t,s,a=""){let l=t.map(d=>({target:d.id,source:e.id,sourceSchema:e.schema,targetSchema:d.schema,field:s,rank:""})),f=o.edges;return a==="replace"&&(f=f.filter(d=>d.field!==field.name)),o.records=Nc.exports.uniqBy([...o.records,...t],d=>d.id),o.edges=Nc.exports.uniqBy([...f,...l],d=>d.source+d.target+d.field),o}function ESe(o){let e,t=o[0].text+"",s;return{c(){e=ie("span"),s=Xt(t),H(e,"class","badge text-bg-"+o[0].bg),rs(e,"max-width","84px")},m(a,l){Re(a,e,l),X(e,s)},p:pn,i:pn,o:pn,d(a){a&&Me(e)}}}function TSe(o,e,t){let{status:s}=e,a=gpe(s);return o.$$set=l=>{"status"in l&&t(1,s=l.status)},[a,s]}class Use extends vo{constructor(e){super(),bo(this,e,TSe,ESe,po,{status:1})}}function ASe(o){let e,t,s;return t=new Yw({props:{record:o[0],size:"small"}}),{c(){e=ie("div"),tn(t.$$.fragment),rs(e,"max-width","94px"),rs(e,"margin-right","15px")},m(a,l){Re(a,e,l),Kt(t,e,null),s=!0},p(a,l){const f={};l&1&&(f.record=a[0]),t.$set(f)},i(a){s||(xe(t.$$.fragment,a),s=!0)},o(a){Qe(t.$$.fragment,a),s=!1},d(a){a&&Me(e),Jt(t)}}}function oce(o){let e,t;return e=new Use({props:{status:o[0].status}}),{c(){tn(e.$$.fragment)},m(s,a){Kt(e,s,a),t=!0},p(s,a){const l={};a&1&&(l.status=s[0].status),e.$set(l)},i(s){t||(xe(e.$$.fragment,s),t=!0)},o(s){Qe(e.$$.fragment,s),t=!1},d(s){Jt(e,s)}}}function sce(o){let e,t,s,a,l,f;return s=new ml({props:{icon:"trash-can"}}),{c(){e=ie("div"),t=ie("button"),tn(s.$$.fragment),H(t,"class","trash-button text-dark btn btn-sm btn-link svelte-dof9cm"),H(e,"class","position-absolute end-0"),rs(e,"top","5px")},m(d,h){Re(d,e,h),X(e,t),Kt(s,t,null),a=!0,l||(f=vn(t,"click",o[6]),l=!0)},p:pn,i(d){a||(xe(s.$$.fragment,d),a=!0)},o(d){Qe(s.$$.fragment,d),a=!1},d(d){d&&Me(e),Jt(s),l=!1,f()}}}function DSe(o){let e,t,s,a,l,f,d,h,b,w,k,T,R,$,Q=o[4].type==="files"&&ASe(o),F=o[0].status==="draft"&&oce(o),U=o[2]&&sce(o);return{c(){var ee;e=ie("div"),t=ie("div"),Q&&Q.c(),s=Ze(),a=ie("div"),l=ie("a"),f=Xt(o[5]),h=Ze(),b=ie("small"),b.textContent=`${o[4].label}`,w=Ze(),k=ie("small"),F&&F.c(),T=Ze(),U&&U.c(),H(l,"class","title-link m-0 fs-5 text-decoration-none text-dark d-block svelte-dof9cm"),H(l,"href",d=o[3].lucentUrl+"/records/"+o[0].id),H(l,"title",o[5]),H(b,"class","text-muted"),H(k,"class","text-muted"),H(a,"class","overflow-hidden"),H(t,"class","card-body d-flex"),H(e,"class",R="card mb-2 bg-light "+o[1]+" svelte-dof9cm"),rs(e,"border-color",(ee=o[4].color)!=null?ee:"#ccc"),rs(e,"border-width","1px")},m(ee,I){Re(ee,e,I),X(e,t),Q&&Q.m(t,null),X(t,s),X(t,a),X(a,l),X(l,f),X(a,h),X(a,b),X(a,w),X(a,k),F&&F.m(k,null),X(e,T),U&&U.m(e,null),$=!0},p(ee,[I]){ee[4].type==="files"&&Q.p(ee,I),(!$||I&1&&d!==(d=ee[3].lucentUrl+"/records/"+ee[0].id))&&H(l,"href",d),ee[0].status==="draft"?F?(F.p(ee,I),I&1&&xe(F,1)):(F=oce(ee),F.c(),xe(F,1),F.m(k,null)):F&&(wo(),Qe(F,1,1,()=>{F=null}),_o()),ee[2]?U?(U.p(ee,I),I&4&&xe(U,1)):(U=sce(ee),U.c(),xe(U,1),U.m(e,null)):U&&(wo(),Qe(U,1,1,()=>{U=null}),_o()),(!$||I&2&&R!==(R="card mb-2 bg-light "+ee[1]+" svelte-dof9cm"))&&H(e,"class",R)},i(ee){$||(xe(Q),xe(F),xe(U),$=!0)},o(ee){Qe(Q),Qe(F),Qe(U),$=!1},d(ee){ee&&Me(e),Q&&Q.d(),F&&F.d(),U&&U.d()}}}function PSe(o,e,t){const s=Qp(),a=si("channel");let{graph:l}=e,{record:f}=e,{classes:d=""}=e,{hasDelete:h=!1}=e,b=a.schemas.find(T=>T.name===f.schema),w=vd(a.schemas,f,l);function k(T){T.preventDefault(),s("remove",f.id)}return o.$$set=T=>{"graph"in T&&t(7,l=T.graph),"record"in T&&t(0,f=T.record),"classes"in T&&t(1,d=T.classes),"hasDelete"in T&&t(2,h=T.hasDelete)},[f,d,h,a,b,w,k,l]}class Y6 extends vo{constructor(e){super(),bo(this,e,PSe,DSe,po,{graph:7,record:0,classes:1,hasDelete:2})}}function HD(o,e,t,s){var d,h;if(console.log(o),console.log(e),o===e)return t;let a=(d=t==null?void 0:t.filter(b=>b.field===s))!=null?d:[],l=(h=t==null?void 0:t.filter(b=>b.field!==s))!=null?h:[],f=a.splice(o,1)[0];return a.splice(e,0,f),[...l,...a]}function rce(o,e,t){const s=o.slice();return s[23]=e[t],s}function ice(o){let e,t,s,a;function l(h){o[13](h)}function f(h){o[14](h)}let d={field:o[23],schema:o[2],record:o[0],validationErrors:o[4],isCreateMode:o[3]};return o[0].data!==void 0&&(d.data=o[0].data),o[1]!==void 0&&(d.graph=o[1]),e=new fOe({props:d}),Uo.push(()=>cr(e,"data",l)),Uo.push(()=>cr(e,"graph",f)),{c(){tn(e.$$.fragment)},m(h,b){Kt(e,h,b),a=!0},p(h,b){const w={};b&4&&(w.schema=h[2]),b&1&&(w.record=h[0]),b&16&&(w.validationErrors=h[4]),b&8&&(w.isCreateMode=h[3]),!t&&b&1&&(t=!0,w.data=h[0].data,mr(()=>t=!1)),!s&&b&2&&(s=!0,w.graph=h[1],mr(()=>s=!1)),e.$set(w)},i(h){a||(xe(e.$$.fragment,h),a=!0)},o(h){Qe(e.$$.fragment,h),a=!1},d(h){Jt(e,h)}}}function ace(o,e){let t,s,a,l=e[5]===e[23].group&&ice(e);return{key:o,first:null,c(){t=Bs(),l&&l.c(),s=Bs(),this.first=t},m(f,d){Re(f,t,d),l&&l.m(f,d),Re(f,s,d),a=!0},p(f,d){e=f,e[5]===e[23].group?l?(l.p(e,d),d&32&&xe(l,1)):(l=ice(e),l.c(),xe(l,1),l.m(s.parentNode,s)):l&&(wo(),Qe(l,1,1,()=>{l=null}),_o())},i(f){a||(xe(l),a=!0)},o(f){Qe(l),a=!1},d(f){f&&Me(t),l&&l.d(f),f&&Me(s)}}}function lce(o){let e,t,s;function a(f){o[15](f)}let l={schema:o[2]};return o[0].status!==void 0&&(l.status=o[0].status),e=new bpe({props:l}),Uo.push(()=>cr(e,"status",a)),{c(){tn(e.$$.fragment)},m(f,d){Kt(e,f,d),s=!0},p(f,d){const h={};d&4&&(h.schema=f[2]),!t&&d&1&&(t=!0,h.status=f[0].status,mr(()=>t=!1)),e.$set(h)},i(f){s||(xe(e.$$.fragment,f),s=!0)},o(f){Qe(e.$$.fragment,f),s=!1},d(f){Jt(e,f)}}}function MSe(o){let e,t,s,a,l,f;return{c(){e=ie("button"),t=ie("span"),s=Xt(` Save`),H(t,"class","spinner-border spinner-border-sm"),H(t,"role","status"),H(t,"aria-hidden","true"),e.disabled=a=!o[6],H(e,"class","ms-2 btn btn-primary btn-spinner")},m(d,h){Re(d,e,h),X(e,t),X(e,s),l||(f=vn(e,"click",o[11]),l=!0)},p(d,h){h&64&&a!==(a=!d[6])&&(e.disabled=a)},d(d){d&&Me(e),l=!1,f()}}}function RSe(o){let e,t,s;return{c(){e=ie("button"),e.innerHTML=` Add`,H(e,"class","ms-2 btn btn-primary btn-spinner")},m(a,l){Re(a,e,l),t||(s=vn(e,"click",o[11]),t=!0)},p:pn,d(a){a&&Me(e),t=!1,s()}}}function $Se(o){let e,t,s,a,l,f,d,h,b,w=[],k=new Map,T,R,$,Q,F,U,ee,I,te;t=new H6({props:{message:o[7]}});function oe(rt){o[12](rt)}let ne={schema:o[2],isCreateMode:o[3],record:o[0]};o[5]!==void 0&&(ne.active=o[5]),l=new Ope({props:ne}),Uo.push(()=>cr(l,"active",oe)),h=new vpe({props:{record:o[0],schema:o[2]}});let G=o[8];const ye=rt=>rt[23].name;for(let rt=0;rtf=!1)),l.$set(V);const ht={};nt&1&&(ht.record=rt[0]),nt&4&&(ht.schema=rt[2]),h.$set(ht),nt&319&&(G=rt[8],wo(),w=Uh(w,nt,ye,1,rt,G,k,a,kv,ace,null,rce),_o()),rt[2].hasDrafts?Se?(Se.p(rt,nt),nt&4&&xe(Se,1)):(Se=lce(rt),Se.c(),xe(Se,1),Se.m($,Q)):Se&&(wo(),Qe(Se,1,1,()=>{Se=null}),_o()),Oe===(Oe=Ae(rt))&&ue?ue.p(rt,nt):(ue.d(1),ue=Oe(rt),ue&&(ue.c(),ue.m($,F)))},i(rt){if(!ee){xe(t.$$.fragment,rt),xe(l.$$.fragment,rt),xe(h.$$.fragment,rt);for(let nt=0;ntSe.name!=="id"),Q="_default";d.fields.reduce((Se,Ae)=>{var Oe;return Ae.ui==="tab"?(Q=Ae.name,Se):(Se[Q]=[...(Oe=Se[Q])!=null?Oe:[],Ae.name],Se)},[]),H1(()=>{F()});function F(){k={data:JSON.parse(JSON.stringify(h.data)),schema:h.schema,status:h.status,_sys:JSON.parse(JSON.stringify(h._sys)),_file:JSON.parse(JSON.stringify(h._file)),edges:JSON.parse(JSON.stringify(b.edges))}}ipe(()=>{t(6,R=ee())});function U(Se){return R?Se.returnValue="You have unsaved changes. Are you sure you want to exit?":(delete Se.returnValue,"...")}function ee(){return w?!1:!Nc.exports.isEqual(k,{data:h.data,schema:h.schema,status:h.status,_sys:h._sys,_file:h._file,edges:b.edges})}function I(Se){Se.preventDefault(),f("cancel")}function te(Se){return Se.preventDefault(),console.log("SAVE: Attempt"),t(4,s=null),t(7,a=""),new Promise(function(Ae,Oe){var ue,rt;if(!R&&!w){Ae(null);return}if(!h){Ae(null);return}t(1,b.edges=(rt=(ue=b.edges)==null?void 0:ue.filter(nt=>!nt._isTrashed&&nt.source===h.id))!=null?rt:[],b),axios.post(l.lucentUrl+"/records",{record:h,edges:b.edges,isCreateMode:w}).then(function(nt){console.log("SAVE: SAVED INLINE"),t(0,h=nt.data.records[0]),t(1,b=nt.data),w||F(),f("inlinesaved",{records:[h]}),Ae(null)}).catch(function(nt){nt.response&&(typeof nt.response.data.error=="string"?t(7,a=nt.response.data.error):t(4,s=nt.response.data.error)),Ae(null)})})}function oe(Se){T=Se,t(5,T)}function ne(Se){o.$$.not_equal(h.data,Se)&&(h.data=Se,t(0,h))}function G(Se){b=Se,t(1,b)}function ye(Se){o.$$.not_equal(h.status,Se)&&(h.status=Se,t(0,h))}return o.$$set=Se=>{"schema"in Se&&t(2,d=Se.schema),"record"in Se&&t(0,h=Se.record),"graph"in Se&&t(1,b=Se.graph),"isCreateMode"in Se&&t(3,w=Se.isCreateMode)},o.$$.update=()=>{o.$$.dirty&16&&t(7,a=s?`Record submission failed. ${Object.entries(s).length} error(s)`:null)},t(4,s=null),[h,b,d,w,s,T,R,a,$,U,I,te,oe,ne,G,ye]}class _pe extends vo{constructor(e){super(),bo(this,e,NSe,$Se,po,{schema:2,record:0,graph:1,isCreateMode:3})}}function cce(o,e,t){const s=o.slice();return s[19]=e[t],s}function uce(o,e,t){const s=o.slice();return s[22]=e[t],s}function fce(o){let e,t=o[22].label+"",s;return{c(){e=ie("option"),s=Xt(t),e.__value=o[22],e.value=e.__value},m(a,l){Re(a,e,l),X(e,s)},p:pn,d(a){a&&Me(e)}}}function dce(o){let e,t=o[19].label+"",s,a;return{c(){e=ie("option"),s=Xt(t),e.__value=a=o[19],e.value=e.__value},m(l,f){Re(l,e,f),X(e,s)},p(l,f){f&2&&t!==(t=l[19].label+"")&&Wn(s,t),f&2&&a!==(a=l[19])&&(e.__value=a,e.value=e.__value)},d(l){l&&Me(e)}}}function ISe(o){let e,t,s,a,l,f,d,h,b,w,k,T,R,$,Q,F,U,ee,I,te,oe,ne,G,ye,Se,Ae,Oe,ue,rt,nt;a=new ml({props:{icon:"filter"}});let St=o[5],V=[];for(let Ct=0;CtAdvanced filters',ye=Ze(),Se=ie("form"),Ae=ie("div"),Oe=ie("input"),H(f,"class","ms-1"),H(s,"class","btn btn-sm btn-outline-primary dropdown-toggle d-flex align-items-center"),H(s,"type","button"),H(s,"data-bs-toggle","dropdown"),H(s,"data-bs-auto-close","outside"),H(s,"aria-expanded","false"),H(w,"class","form-select"),o[0]===void 0&&EC(()=>o[13].call(w)),H(b,"class","px-3 py-1 d-flex align-items-center"),H(R,"class","form-select"),o[4]===void 0&&EC(()=>o[14].call(R)),H(T,"class","px-3 py-1 d-flex align-items-center"),H(F,"type","text"),H(F,"class","form-control"),H(Q,"class","px-3 py-1 d-flex align-items-center"),H(I,"class","btn btn-outline-primary"),H(I,"type","button"),H(ee,"class","px-3 py-1 d-flex align-items-center"),H(Oe,"type","search"),H(Oe,"class","form-control"),H(Oe,"placeholder","Advanced filters"),Oe.required=!0,H(Ae,"class","px-3 py-1 d-flex align-items-center"),H(h,"class","dropdown-menu"),rs(h,"width","300px"),H(t,"class","btn-group"),H(e,"class","mx-2 d-flex align-items-center")},m(Ct,Ot){Re(Ct,e,Ot),X(e,t),X(t,s),Kt(a,s,null),X(s,l),X(s,f),X(t,d),X(t,h),X(h,b),X(b,w);for(let $e=0;$ene.files===!1));let R=[...f.fields,...T].filter(ne=>!["file","json","tab"].includes(ne.ui)),$,Q="";function F(ne){ne.preventDefault();let G="";f.fields.find(Ae=>Ae.name===$.name)&&(G="data.");let ye=`filter[${G+$.name}_${a.name}]`;const Se=new URL(w!=null?w:window.location.href);Se.searchParams.set("skip","0"),Se.searchParams.set(ye,Q),b?l("refresh",Se):window.location=Se}function U(ne){var Oe,ue;ne.preventDefault();let G=(Oe=k.split("=")[0])!=null?Oe:"";if(!G)return;let ye=`filter[${G}]`,Se=(ue=k.split("=")[1])!=null?ue:"";if(!Se)return;const Ae=new URL(w!=null?w:window.location.href);Ae.searchParams.set("skip","0"),Ae.searchParams.set(ye,Se),b?l("refresh",Ae):window.location=Ae}function ee(){$=sle(this),t(0,$),t(5,R)}function I(){a=sle(this),t(4,a),t(1,s),t(10,h),t(0,$),t(1,s),t(10,h),t(0,$)}function te(){Q=this.value,t(3,Q)}function oe(){k=this.value,t(2,k)}return o.$$set=ne=>{"schema"in ne&&t(8,f=ne.schema),"systemFields"in ne&&t(9,d=ne.systemFields),"operators"in ne&&t(10,h=ne.operators),"inModal"in ne&&t(11,b=ne.inModal),"modalUrl"in ne&&t(12,w=ne.modalUrl)},o.$$.update=()=>{o.$$.dirty&1025&&t(1,s=h.filter(ne=>ne.uis.includes($==null?void 0:$.ui)||ne.uis[0]=="*")),o.$$.dirty&2&&t(4,a=s[0])},[$,s,k,Q,a,R,F,U,f,d,h,b,w,ee,I,te,oe]}class LSe extends vo{constructor(e){super(),bo(this,e,BSe,ISe,po,{schema:8,systemFields:9,operators:10,inModal:11,modalUrl:12})}}function FSe(o){let e,t,s,a,l,f,d,h;return{c(){e=ie("fieldset"),t=ie("label"),s=Xt(`Upload file `),a=ie("span"),a.innerHTML='Loading...',l=Ze(),f=ie("input"),H(a,"class","spinner-border spinner-border-sm"),H(a,"role","status"),H(a,"aria-hidden","true"),H(f,"class","form-control"),H(f,"type","file"),H(f,"id","formFile"),f.multiple=!0,H(f,"accept",QSe),f.disabled=o[0],f.hidden=!0,H(t,"class","btn btn-primary btn-sm btn-spinner "),e.disabled=o[0]},m(b,w){Re(b,e,w),X(e,t),X(t,s),X(t,a),X(t,l),X(t,f),d||(h=vn(f,"input",o[1]),d=!0)},p(b,[w]){w&1&&(f.disabled=b[0]),w&1&&(e.disabled=b[0])},i:pn,o:pn,d(b){b&&Me(e),d=!1,h()}}}let QSe="";function ZSe(o,e,t){const s=Qp(),a=si("channel");let{schema:l}=e,f=[],d=!1;function h(b){t(0,d=!0),f=b.target.files?[...b.target.files]:[];let w=new FormData;w.append("schema",l.name),Array.from(f).forEach(function(k){w.append("files[]",k)}),s("beforeUpload",f),axios.post(a.lucentUrl+"/files/upload",w,{headers:{"Content-Type":"multipart/form-data"}}).then(k=>{k.data.error?s("uploadError",k.data.error):s("uploadComplete",k.data),t(0,d=!1)}).catch(k=>{t(0,d=!1),console.log(k.response.data)})}return o.$$set=b=>{"schema"in b&&t(2,l=b.schema)},[d,h,l]}class zSe extends vo{constructor(e){super(),bo(this,e,ZSe,FSe,po,{schema:2})}}function hce(o,e,t){const s=o.slice();return s[18]=e[t],s}function mce(o,e,t){const s=o.slice();return s[18]=e[t],s}function HSe(o){let e,t;return e=new ml({props:{icon:"arrow-up-short-wide"}}),{c(){tn(e.$$.fragment)},m(s,a){Kt(e,s,a),t=!0},i(s){t||(xe(e.$$.fragment,s),t=!0)},o(s){Qe(e.$$.fragment,s),t=!1},d(s){Jt(e,s)}}}function VSe(o){let e,t;return e=new ml({props:{icon:"arrow-down-wide-short"}}),{c(){tn(e.$$.fragment)},m(s,a){Kt(e,s,a),t=!0},i(s){t||(xe(e.$$.fragment,s),t=!0)},o(s){Qe(e.$$.fragment,s),t=!1},d(s){Jt(e,s)}}}function gce(o){let e,t,s,a,l,f,d,h,b,w,k,T=o[18].label+"",R,$,Q,F,U;a=new ml({props:{icon:"arrow-up-short-wide"}});function ee(...oe){return o[10](o[18],...oe)}h=new ml({props:{icon:"arrow-down-wide-short"}});function I(...oe){return o[11](o[18],...oe)}function te(...oe){return o[12](o[18],...oe)}return{c(){e=ie("div"),t=ie("div"),s=ie("button"),tn(a.$$.fragment),f=Ze(),d=ie("button"),tn(h.$$.fragment),w=Ze(),k=ie("button"),R=Xt(T),$=Ze(),H(s,"title","Sort Ascending"),H(s,"class",l="btn btn-sm "+(o[18].name==o[0]?"btn-primary":"btn-outline-primary")),H(d,"title","Sort Descending"),H(d,"class",b="btn btn-sm "+("-"+o[18].name==o[0]?"btn-primary":"btn-outline-primary")),H(k,"title","Sort Ascending"),H(k,"class","btn btn-sm btn-outline-primary w-100 text-nowrap"),rs(k,"overflow","hidden"),H(t,"class","btn-group w-100"),H(e,"class","col-4 px-3 py-1 d-flex align-items-center")},m(oe,ne){Re(oe,e,ne),X(e,t),X(t,s),Kt(a,s,null),X(t,f),X(t,d),Kt(h,d,null),X(t,w),X(t,k),X(k,R),X(e,$),Q=!0,F||(U=[vn(s,"click",ee),vn(d,"click",I),vn(k,"click",te)],F=!0)},p(oe,ne){o=oe,(!Q||ne&5&&l!==(l="btn btn-sm "+(o[18].name==o[0]?"btn-primary":"btn-outline-primary")))&&H(s,"class",l),(!Q||ne&5&&b!==(b="btn btn-sm "+("-"+o[18].name==o[0]?"btn-primary":"btn-outline-primary")))&&H(d,"class",b),(!Q||ne&4)&&T!==(T=o[18].label+"")&&Wn(R,T)},i(oe){Q||(xe(a.$$.fragment,oe),xe(h.$$.fragment,oe),Q=!0)},o(oe){Qe(a.$$.fragment,oe),Qe(h.$$.fragment,oe),Q=!1},d(oe){oe&&Me(e),Jt(a),Jt(h),F=!1,$i(U)}}}function pce(o){let e,t,s,a,l,f,d,h,b,w,k,T=o[18].label+"",R,$,Q,F,U;a=new ml({props:{icon:"arrow-up-short-wide"}});function ee(...oe){return o[13](o[18],...oe)}h=new ml({props:{icon:"arrow-down-wide-short"}});function I(...oe){return o[14](o[18],...oe)}function te(...oe){return o[15](o[18],...oe)}return{c(){e=ie("div"),t=ie("div"),s=ie("button"),tn(a.$$.fragment),f=Ze(),d=ie("button"),tn(h.$$.fragment),w=Ze(),k=ie("button"),R=Xt(T),$=Ze(),H(s,"title","Sort Ascending"),H(s,"class",l="btn btn-sm "+(o[18].name==o[0]?"btn-primary":"btn-outline-primary")),H(d,"title","Sort Descending"),H(d,"class",b="btn btn-sm "+("-"+o[18].name==o[0]?"btn-primary":"btn-outline-primary")),H(k,"title","Sort Ascending"),H(k,"class","btn btn-sm btn-outline-primary w-100 text-nowrap"),rs(k,"overflow","hidden"),H(t,"class","btn-group w-100"),H(e,"class","col-4 px-3 py-1 d-flex align-items-center")},m(oe,ne){Re(oe,e,ne),X(e,t),X(t,s),Kt(a,s,null),X(t,f),X(t,d),Kt(h,d,null),X(t,w),X(t,k),X(k,R),X(e,$),Q=!0,F||(U=[vn(s,"click",ee),vn(d,"click",I),vn(k,"click",te)],F=!0)},p(oe,ne){o=oe,(!Q||ne&3&&l!==(l="btn btn-sm "+(o[18].name==o[0]?"btn-primary":"btn-outline-primary")))&&H(s,"class",l),(!Q||ne&3&&b!==(b="btn btn-sm "+("-"+o[18].name==o[0]?"btn-primary":"btn-outline-primary")))&&H(d,"class",b),(!Q||ne&2)&&T!==(T=o[18].label+"")&&Wn(R,T)},i(oe){Q||(xe(a.$$.fragment,oe),xe(h.$$.fragment,oe),Q=!0)},o(oe){Qe(a.$$.fragment,oe),Qe(h.$$.fragment,oe),Q=!1},d(oe){oe&&Me(e),Jt(a),Jt(h),F=!1,$i(U)}}}function WSe(o){let e,t,s,a,l,f,d,h=o[3].label+"",b,w,k,T,R,$,Q,F,U;const ee=[VSe,HSe],I=[];function te(Oe,ue){return ue&1&&(s=null),s==null&&(s=!!Oe[0].startsWith("-")),s?0:1}a=te(o,-1),l=I[a]=ee[a](o);let oe=o[2],ne=[];for(let Oe=0;OeQe(ne[Oe],1,1,()=>{ne[Oe]=null});let ye=o[1],Se=[];for(let Oe=0;OeQe(Se[Oe],1,1,()=>{Se[Oe]=null});return{c(){e=ie("div"),t=ie("button"),l.c(),f=Ze(),d=ie("span"),b=Xt(h),w=Ze(),k=ie("div"),T=ie("div");for(let Oe=0;Oe{I[rt]=null}),_o(),l=I[a],l||(l=I[a]=ee[a](Oe),l.c()),xe(l,1),l.m(t,f)),(!U||ue&8)&&h!==(h=Oe[3].label+"")&&Wn(b,h),ue&53){oe=Oe[2];let nt;for(nt=0;ntye.name===ne.name)?"":"data.";return T(G+ne.name)}function $(oe,ne){oe.preventDefault();let G=k.includes(ye=>ye.name===ne.name)?"":"data.";return T("-"+G+ne.name)}const Q=(oe,ne)=>R(ne,oe),F=(oe,ne)=>$(ne,oe),U=(oe,ne)=>R(ne,oe),ee=(oe,ne)=>R(ne,oe),I=(oe,ne)=>$(ne,oe),te=(oe,ne)=>R(ne,oe);return o.$$set=oe=>{"schema"in oe&&t(6,d=oe.schema),"sort"in oe&&t(0,h=oe.sort),"inModal"in oe&&t(7,b=oe.inModal),"modalUrl"in oe&&t(8,w=oe.modalUrl),"systemFields"in oe&&t(9,k=oe.systemFields)},o.$$.update=()=>{o.$$.dirty&577&&t(3,s=[...d.fields,...k].find(oe=>oe.name===h||"-"+oe.name===h||"data."+oe.name===h||"-data."+oe.name===h)),o.$$.dirty&64&&t(2,a=d.fields.filter(oe=>!["reference","file","json","id","tab"].includes(oe.ui))),o.$$.dirty&512&&t(1,l=k),o.$$.dirty&576&&d.type==="collection"&&t(1,l=k.filter(oe=>oe.files===!1))},[h,l,a,s,R,$,d,b,w,k,Q,F,U,ee,I,te]}class YSe extends vo{constructor(e){super(),bo(this,e,USe,WSe,po,{schema:6,sort:0,inModal:7,modalUrl:8,systemFields:9})}}function XSe(o){var R,$;let e,t,s,a,l=(($=(R=o[0].find(o[9]))==null?void 0:R.symbol)!=null?$:"")+"",f,d,h,b,w,k,T;return{c(){e=ie("span"),t=ie("div"),s=Xt(o[4]),a=Ze(),f=Xt(l),d=Ze(),h=Xt(o[2]),b=Ze(),w=ie("button"),H(w,"type","button"),H(w,"class","btn-close btn-close ms-1"),H(w,"aria-label","Close"),H(t,"class","d-flex align-items-center justify-content-center"),H(e,"class","applied-filter d-inline-block border border-primary rounded lx-small-text me-1 px-2 py-1 svelte-6qi3g8"),rs(e,"line-height","22px ")},m(Q,F){Re(Q,e,F),X(e,t),X(t,s),X(t,a),X(t,f),X(t,d),X(t,h),X(t,b),X(t,w),k||(T=vn(w,"click",o[10]),k=!0)},p(Q,[F]){var U,ee;F&1&&l!==(l=((ee=(U=Q[0].find(Q[9]))==null?void 0:U.symbol)!=null?ee:"")+"")&&Wn(f,l),F&4&&Wn(h,Q[2])},i:pn,o:pn,d(Q){Q&&Me(e),k=!1,T()}}}function jSe(o,e,t){var ee,I;const s=Qp();let{schema:a}=e,{operators:l}=e,{key:f}=e,{value:d}=e,{inModal:h}=e,{modalUrl:b}=e,w=f.split("_"),k=(ee=w[w.length-1])!=null?ee:"eq",T=f.replace("_"+k,""),R=a.fields.find(te=>te.name===T),$=(I=R==null?void 0:R.label)!=null?I:T;function Q(te,oe){te.preventDefault();let ne=`filter[${oe}]`;const G=new URL(b!=null?b:window.location.href);G.searchParams.set("skip","0"),G.searchParams.delete(ne),h?s("refresh",G):window.location=G}const F=te=>te.name===k,U=te=>Q(te,f);return o.$$set=te=>{"schema"in te&&t(6,a=te.schema),"operators"in te&&t(0,l=te.operators),"key"in te&&t(1,f=te.key),"value"in te&&t(2,d=te.value),"inModal"in te&&t(7,h=te.inModal),"modalUrl"in te&&t(8,b=te.modalUrl)},[l,f,d,k,$,Q,a,h,b,F,U]}class qSe extends vo{constructor(e){super(),bo(this,e,jSe,XSe,po,{schema:6,operators:0,key:1,value:2,inModal:7,modalUrl:8})}}function bce(o,e,t){const s=o.slice();return s[19]=e[t][0],s[20]=e[t][1],s}function GSe(o){let e,t,s;return t=new zSe({props:{schema:o[0]}}),t.$on("uploadComplete",o[11]),{c(){e=ie("div"),tn(t.$$.fragment),H(e,"class","d-inline-block ms-1")},m(a,l){Re(a,e,l),Kt(t,e,null),s=!0},p(a,l){const f={};l&1&&(f.schema=a[0]),t.$set(f)},i(a){s||(xe(t.$$.fragment,a),s=!0)},o(a){Qe(t.$$.fragment,a),s=!1},d(a){a&&Me(e),Jt(t)}}}function KSe(o){let e,t=!o[4]&&o[6]&&vce(o);return{c(){t&&t.c(),e=Bs()},m(s,a){t&&t.m(s,a),Re(s,e,a)},p(s,a){!s[4]&&s[6]?t?t.p(s,a):(t=vce(s),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},i:pn,o:pn,d(s){t&&t.d(s),s&&Me(e)}}}function vce(o){let e,t,s;return{c(){e=ie("a"),t=Xt("New Record"),H(e,"href",s=o[8].lucentUrl+"/records/new?schema="+o[0].name),H(e,"class","btn btn-sm btn-primary")},m(a,l){Re(a,e,l),X(e,t)},p(a,l){l&1&&s!==(s=a[8].lucentUrl+"/records/new?schema="+a[0].name)&&H(e,"href",s)},d(a){a&&Me(e)}}}function Oce(o){let e,t,s,a,l,f;s=new ml({props:{icon:"ellipsis-vertical"}});function d(w,k){return w[3].status_in==="trashed"?eCe:JSe}let h=d(o),b=h(o);return{c(){e=ie("div"),t=ie("button"),tn(s.$$.fragment),a=Ze(),l=ie("ul"),b.c(),H(t,"class","btn btn-link btn-sm"),H(t,"type","button"),H(t,"data-bs-toggle","dropdown"),H(t,"aria-expanded","false"),H(l,"class","dropdown-menu"),H(e,"class","dropdown d-inline-block")},m(w,k){Re(w,e,k),X(e,t),Kt(s,t,null),X(e,a),X(e,l),b.m(l,null),f=!0},p(w,k){h===(h=d(w))&&b?b.p(w,k):(b.d(1),b=h(w),b&&(b.c(),b.m(l,null)))},i(w){f||(xe(s.$$.fragment,w),f=!0)},o(w){Qe(s.$$.fragment,w),f=!1},d(w){w&&Me(e),Jt(s),b.d()}}}function JSe(o){let e,t,s,a,l,f,d,h;return{c(){e=ie("li"),t=ie("a"),s=Xt("Export to CSV"),a=Ze(),l=ie("li"),f=ie("a"),d=Xt("View trashed records"),H(t,"class","dropdown-item"),H(t,"href",o[9]),H(f,"class","dropdown-item"),H(f,"href",h=o[8].lucentUrl+"/content/"+o[0].name+"?filter[status_in]=trashed")},m(b,w){Re(b,e,w),X(e,t),X(t,s),Re(b,a,w),Re(b,l,w),X(l,f),X(f,d)},p(b,w){w&1&&h!==(h=b[8].lucentUrl+"/content/"+b[0].name+"?filter[status_in]=trashed")&&H(f,"href",h)},d(b){b&&Me(e),b&&Me(a),b&&Me(l)}}}function eCe(o){let e,t=o[6]&&yce(o);return{c(){t&&t.c(),e=Bs()},m(s,a){t&&t.m(s,a),Re(s,e,a)},p(s,a){s[6]?t?t.p(s,a):(t=yce(s),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(s){t&&t.d(s),s&&Me(e)}}}function yce(o){let e,t,s,a;return{c(){e=ie("li"),t=ie("a"),s=Xt("Empty trash"),H(t,"class","dropdown-item"),H(t,"href",a=o[8].lucentUrl+"/content/"+o[0].name+"/emptyTrash")},m(l,f){Re(l,e,f),X(e,t),X(t,s)},p(l,f){f&1&&a!==(a=l[8].lucentUrl+"/content/"+l[0].name+"/emptyTrash")&&H(t,"href",a)},d(l){l&&Me(e)}}}function wce(o){let e,t,s=Object.entries(o[3]),a=[];for(let f=0;fQe(a[f],1,1,()=>{a[f]=null});return{c(){e=ie("div");for(let f=0;f0,F,U,ee,I;s=new YSe({props:{schema:o[0],sort:o[1],systemFields:o[7],inModal:o[4],modalUrl:o[5]}}),s.$on("refresh",o[13]);function te(Oe){o[14](Oe)}let oe={systemFields:o[7],operators:o[2],filter:o[3],inModal:o[4],modalUrl:o[5]};o[0]!==void 0&&(oe.schema=o[0]),l=new LSe({props:oe}),Uo.push(()=>cr(l,"schema",te)),l.$on("refresh",o[15]);const ne=[KSe,GSe],G=[];function ye(Oe,ue){return Oe[0].type==="collection"?0:1}k=ye(o),T=G[k]=ne[k](o);let Se=!o[4]&&Oce(o),Ae=Q&&wce(o);return{c(){e=ie("div"),t=ie("div"),tn(s.$$.fragment),a=Ze(),tn(l.$$.fragment),d=Ze(),h=ie("form"),h.innerHTML='',b=Ze(),w=ie("div"),T.c(),R=Ze(),Se&&Se.c(),$=Ze(),Ae&&Ae.c(),F=Bs(),H(h,"method","GET"),H(t,"class","d-flex align-items-center"),H(w,"class","d-flex align-items-center "),H(e,"class","mb-3 d-flex align-items-center justify-content-between")},m(Oe,ue){Re(Oe,e,ue),X(e,t),Kt(s,t,null),X(t,a),Kt(l,t,null),X(t,d),X(t,h),X(e,b),X(e,w),G[k].m(w,null),X(w,R),Se&&Se.m(w,null),Re(Oe,$,ue),Ae&&Ae.m(Oe,ue),Re(Oe,F,ue),U=!0,ee||(I=vn(h,"submit",o[10]),ee=!0)},p(Oe,[ue]){const rt={};ue&1&&(rt.schema=Oe[0]),ue&2&&(rt.sort=Oe[1]),ue&128&&(rt.systemFields=Oe[7]),ue&16&&(rt.inModal=Oe[4]),ue&32&&(rt.modalUrl=Oe[5]),s.$set(rt);const nt={};ue&128&&(nt.systemFields=Oe[7]),ue&4&&(nt.operators=Oe[2]),ue&8&&(nt.filter=Oe[3]),ue&16&&(nt.inModal=Oe[4]),ue&32&&(nt.modalUrl=Oe[5]),!f&&ue&1&&(f=!0,nt.schema=Oe[0],mr(()=>f=!1)),l.$set(nt);let St=k;k=ye(Oe),k===St?G[k].p(Oe,ue):(wo(),Qe(G[St],1,1,()=>{G[St]=null}),_o(),T=G[k],T?T.p(Oe,ue):(T=G[k]=ne[k](Oe),T.c()),xe(T,1),T.m(w,R)),Oe[4]?Se&&(wo(),Qe(Se,1,1,()=>{Se=null}),_o()):Se?(Se.p(Oe,ue),ue&16&&xe(Se,1)):(Se=Oce(Oe),Se.c(),xe(Se,1),Se.m(w,null)),ue&8&&(Q=Object.entries(Oe[3]).length>0),Q?Ae?(Ae.p(Oe,ue),ue&8&&xe(Ae,1)):(Ae=wce(Oe),Ae.c(),xe(Ae,1),Ae.m(F.parentNode,F)):Ae&&(wo(),Qe(Ae,1,1,()=>{Ae=null}),_o())},i(Oe){U||(xe(s.$$.fragment,Oe),xe(l.$$.fragment,Oe),xe(T),xe(Se),xe(Ae),U=!0)},o(Oe){Qe(s.$$.fragment,Oe),Qe(l.$$.fragment,Oe),Qe(T),Qe(Se),Qe(Ae),U=!1},d(Oe){Oe&&Me(e),Jt(s),Jt(l),G[k].d(),Se&&Se.d(),Oe&&Me($),Ae&&Ae.d(Oe),Oe&&Me(F),ee=!1,I()}}}function nCe(o,e,t){const s=si("channel"),a=Qp();let{sort:l}=e,{schema:f}=e,{operators:d}=e,{filter:h}=e,{inModal:b}=e,{modalUrl:w}=e,{isWritable:k}=e,{records:T}=e,{systemFields:R=[]}=e,$=new URL(window.location.href),Q=$.pathname+"/csv?"+$.searchParams.toString();function F(ne){ne.preventDefault();const G=new FormData(ne.target);let ye=G.keys().next().value,Se=G.values().next().value;const Ae=new URL(w!=null?w:window.location.href);Ae.searchParams.set("skip","0"),Ae.searchParams.set(ye,Se),b?a("refresh",Ae):window.location=Ae}function U(ne){t(12,T=ne.detail)}function ee(ne){bz.call(this,o,ne)}function I(ne){f=ne,t(0,f)}function te(ne){bz.call(this,o,ne)}function oe(ne){bz.call(this,o,ne)}return o.$$set=ne=>{"sort"in ne&&t(1,l=ne.sort),"schema"in ne&&t(0,f=ne.schema),"operators"in ne&&t(2,d=ne.operators),"filter"in ne&&t(3,h=ne.filter),"inModal"in ne&&t(4,b=ne.inModal),"modalUrl"in ne&&t(5,w=ne.modalUrl),"isWritable"in ne&&t(6,k=ne.isWritable),"records"in ne&&t(12,T=ne.records),"systemFields"in ne&&t(7,R=ne.systemFields)},[f,l,d,h,b,w,k,R,s,Q,F,U,T,ee,I,te,oe]}class oCe extends vo{constructor(e){super(),bo(this,e,nCe,tCe,po,{sort:1,schema:0,operators:2,filter:3,inModal:4,modalUrl:5,isWritable:6,records:12,systemFields:7})}}function Sce(o,e,t){const s=o.slice();return s[9]=e[t],s}function sCe(o){let e,t=o[9]+"",s,a,l,f;function d(...h){return o[7](o[9],...h)}return{c(){e=ie("a"),s=Xt(t),H(e,"class","page-link"),H(e,"href",a=o[2](o[9]))},m(h,b){Re(h,e,b),X(e,s),l||(f=vn(e,"click",d),l=!0)},p(h,b){o=h,b&1&&t!==(t=o[9]+"")&&Wn(s,t),b&1&&a!==(a=o[2](o[9]))&&H(e,"href",a)},d(h){h&&Me(e),l=!1,f()}}}function rCe(o){let e,t=o[9]+"",s;return{c(){e=ie("span"),s=Xt(t),H(e,"class","page-link active")},m(a,l){Re(a,e,l),X(e,s)},p(a,l){l&1&&t!==(t=a[9]+"")&&Wn(s,t)},d(a){a&&Me(e)}}}function Cce(o){let e,t;function s(f,d){return f[1]==f[9]?rCe:sCe}let a=s(o),l=a(o);return{c(){e=ie("li"),l.c(),t=Ze(),H(e,"class","page-item")},m(f,d){Re(f,e,d),l.m(e,null),X(e,t)},p(f,d){a===(a=s(f))&&l?l.p(f,d):(l.d(1),l=a(f),l&&(l.c(),l.m(e,t)))},d(f){f&&Me(e),l.d()}}}function iCe(o){let e,t=o[0],s=[];for(let a=0;aw(R,T);return o.$$set=T=>{"pages"in T&&t(0,a=T.pages),"limit"in T&&t(4,l=T.limit),"currentPage"in T&&t(1,f=T.currentPage),"inModal"in T&&t(5,d=T.inModal),"modalUrl"in T&&t(6,h=T.modalUrl)},[a,f,b,w,l,d,h,k]}class lCe extends vo{constructor(e){super(),bo(this,e,aCe,iCe,po,{pages:0,limit:4,currentPage:1,inModal:5,modalUrl:6})}}function kce(o){let e,t,s,a,l,f,d,h,b,w;return a=new lCe({props:{pages:o[7],currentPage:o[6],limit:o[2],inModal:o[0],modalUrl:o[1]}}),a.$on("refresh",o[10]),{c(){e=ie("li"),t=ie("a"),t.textContent="First",s=Ze(),tn(a.$$.fragment),l=Ze(),f=ie("li"),d=ie("a"),d.textContent="Last",H(t,"href","/"),H(t,"class","page-link"),H(e,"class","page-item disabled"),is(e,"disabled",o[6]===1),H(d,"class","page-link"),H(d,"href","/"),is(d,"disabled",o[6]===o[5]),H(f,"class","page-item")},m(k,T){Re(k,e,T),X(e,t),Re(k,s,T),Kt(a,k,T),Re(k,l,T),Re(k,f,T),X(f,d),h=!0,b||(w=[vn(t,"click",o[9]),vn(d,"click",o[8])],b=!0)},p(k,T){(!h||T&64)&&is(e,"disabled",k[6]===1);const R={};T&128&&(R.pages=k[7]),T&64&&(R.currentPage=k[6]),T&4&&(R.limit=k[2]),T&1&&(R.inModal=k[0]),T&2&&(R.modalUrl=k[1]),a.$set(R),(!h||T&96)&&is(d,"disabled",k[6]===k[5])},i(k){h||(xe(a.$$.fragment,k),h=!0)},o(k){Qe(a.$$.fragment,k),h=!1},d(k){k&&Me(e),k&&Me(s),Jt(a,k),k&&Me(l),k&&Me(f),b=!1,$i(w)}}}function cCe(o){let e,t,s,a,l,f,d=+o[3]+1+"",h,b,w,k=(+o[3]+o[2]>o[4]?o[4]:+o[3]+o[2])+"",T,R,$,Q,F,U,ee=o[5]>1&&kce(o);return{c(){e=ie("nav"),t=ie("ul"),ee&&ee.c(),s=Ze(),a=ie("p"),l=Xt(`Showing `),f=ie("span"),h=Xt(d),b=Xt(` to `),w=ie("span"),T=Xt(k),R=Xt(` of `),$=ie("span"),Q=Xt(o[4]),F=Xt(` total`),H(t,"class","pagination justify-content-center"),H(f,"class","font-medium"),H(w,"class","font-medium"),H($,"class","font-medium"),H(a,"class","text-muted text-center")},m(I,te){Re(I,e,te),X(e,t),ee&&ee.m(t,null),Re(I,s,te),Re(I,a,te),X(a,l),X(a,f),X(f,h),X(a,b),X(a,w),X(w,T),X(a,R),X(a,$),X($,Q),X(a,F),U=!0},p(I,[te]){I[5]>1?ee?(ee.p(I,te),te&32&&xe(ee,1)):(ee=kce(I),ee.c(),xe(ee,1),ee.m(t,null)):ee&&(wo(),Qe(ee,1,1,()=>{ee=null}),_o()),(!U||te&8)&&d!==(d=+I[3]+1+"")&&Wn(h,d),(!U||te&28)&&k!==(k=(+I[3]+I[2]>I[4]?I[4]:+I[3]+I[2])+"")&&Wn(T,k),(!U||te&16)&&Wn(Q,I[4])},i(I){U||(xe(ee),U=!0)},o(I){Qe(ee),U=!1},d(I){I&&Me(e),ee&&ee.d(),I&&Me(s),I&&Me(a)}}}function uCe(o,e,t){let s,a,l;const f=Qp();let{inModal:d}=e,{modalUrl:h}=e,{limit:b}=e,{skip:w}=e,{total:k}=e;function T(F){F.preventDefault(),$(s)}function R(F){F.preventDefault(),$(1)}function $(F){const U=new URL(h!=null?h:window.location.href);let ee=F*b-b;U.searchParams.set("skip",ee),d?f("refresh",U):window.location=U}function Q(F){bz.call(this,o,F)}return o.$$set=F=>{"inModal"in F&&t(0,d=F.inModal),"modalUrl"in F&&t(1,h=F.modalUrl),"limit"in F&&t(2,b=F.limit),"skip"in F&&t(3,w=F.skip),"total"in F&&t(4,k=F.total)},o.$$.update=()=>{o.$$.dirty&20&&t(5,s=Math.ceil(k/b)),o.$$.dirty&12&&t(6,a=Math.ceil((w-1)/b)+1),o.$$.dirty&96&&t(7,l=Nc.exports.range(a-3,a+4).filter(F=>F>0&&F<=s))},[d,h,b,w,k,s,a,l,T,R,Q]}class fCe extends vo{constructor(e){super(),bo(this,e,uCe,cCe,po,{inModal:0,modalUrl:1,limit:2,skip:3,total:4})}}function dCe(o){let e,t,s;return{c(){e=ie("button"),e.textContent="Move to trash",H(e,"type","button"),H(e,"class","btn btn-sm btn-outline-primary")},m(a,l){Re(a,e,l),t||(s=vn(e,"click",Uu(o[9])),t=!0)},p:pn,d(a){a&&Me(e),t=!1,s()}}}function hCe(o){let e,t,s,a,l,f,d=o[1].hasDrafts&&xce(o);return{c(){e=ie("button"),e.textContent="Publish",t=Ze(),d&&d.c(),s=Ze(),a=ie("button"),a.textContent="Delete forever",H(e,"type","button"),H(e,"class","btn btn-sm btn-outline-primary"),H(a,"type","button"),H(a,"class","btn btn-sm btn-outline-primary")},m(h,b){Re(h,e,b),Re(h,t,b),d&&d.m(h,b),Re(h,s,b),Re(h,a,b),l||(f=[vn(e,"click",Uu(o[7])),vn(a,"click",Uu(o[3]))],l=!0)},p(h,b){h[1].hasDrafts?d?d.p(h,b):(d=xce(h),d.c(),d.m(s.parentNode,s)):d&&(d.d(1),d=null)},d(h){h&&Me(e),h&&Me(t),d&&d.d(h),h&&Me(s),h&&Me(a),l=!1,$i(f)}}}function xce(o){let e,t,s;return{c(){e=ie("button"),e.textContent="Make Draft",H(e,"type","button"),H(e,"class","btn btn-sm btn-outline-primary")},m(a,l){Re(a,e,l),t||(s=vn(e,"click",Uu(o[8])),t=!0)},p:pn,d(a){a&&Me(e),t=!1,s()}}}function mCe(o){let e,t,s=o[0].length+"",a,l,f,d,h,b,w,k,T,R;function $(U,ee){return U[2].status_in==="trashed"?hCe:dCe}let Q=$(o),F=Q(o);return{c(){e=ie("div"),t=ie("span"),a=Xt(s),l=Xt(" records selected"),f=Ze(),d=ie("div"),h=ie("button"),h.textContent="Publish",b=Ze(),w=ie("button"),w.textContent="Make Draft",k=Ze(),F.c(),H(t,"class","me-2"),H(h,"type","button"),H(h,"class","btn btn-sm btn-outline-primary"),H(w,"type","button"),H(w,"class","btn btn-sm btn-outline-primary"),H(d,"class","btn-group "),H(d,"role","group"),H(d,"aria-label","Basic example"),H(e,"class","d-flex align-items-center mb-3")},m(U,ee){Re(U,e,ee),X(e,t),X(t,a),X(t,l),X(e,f),X(e,d),X(d,h),X(d,b),X(d,w),X(d,k),F.m(d,null),T||(R=[vn(h,"click",Uu(o[5])),vn(w,"click",Uu(o[6]))],T=!0)},p(U,[ee]){ee&1&&s!==(s=U[0].length+"")&&Wn(a,s),Q===(Q=$(U))&&F?F.p(U,ee):(F.d(1),F=Q(U),F&&(F.c(),F.m(d,null)))},i:pn,o:pn,d(U){U&&Me(e),F.d(),T=!1,$i(R)}}}function gCe(o,e,t){const s=si("channel");let{selected:a}=e,{schema:l}=e,{filter:f}=e;function d($){$.preventDefault(),axios.post(s.lucentUrl+"/records/delete",{ids:a.map(Q=>Q.id)}).then(Q=>{window.location.reload()}).catch(Q=>{console.log(Q)})}function h($,Q){axios.post(s.lucentUrl+"/records/status/"+Q,{schemaName:l.name,records:a}).then(F=>{window.location.reload()}).catch(F=>{console.log(F)})}const b=$=>h($,"published"),w=$=>h($,"draft"),k=$=>h($,"published"),T=$=>h($,"draft"),R=$=>h($,"trashed");return o.$$set=$=>{"selected"in $&&t(0,a=$.selected),"schema"in $&&t(1,l=$.schema),"filter"in $&&t(2,f=$.filter)},[a,l,f,d,h,b,w,k,T,R]}class pCe extends vo{constructor(e){super(),bo(this,e,gCe,mCe,po,{selected:0,schema:1,filter:2})}}function bCe(o){let e;return{c(){e=Xt(o[0])},m(t,s){Re(t,e,s)},p(t,[s]){s&1&&Wn(e,t[0])},i:pn,o:pn,d(t){t&&Me(e)}}}function vCe(o,e,t){let{value:s}=e;return o.$$set=a=>{"value"in a&&t(0,s=a.value)},[s]}class OCe extends vo{constructor(e){super(),bo(this,e,vCe,bCe,po,{value:0})}}function Ece(o){let e,t,s,a;return{c(){e=ie("div"),t=ie("span"),s=Ze(),a=Xt(o[0]),H(t,"class","color border border-2 svelte-78o2k4"),rs(t,"background",o[0]),H(e,"class","d-inline-flex")},m(l,f){Re(l,e,f),X(e,t),X(e,s),X(e,a)},p(l,f){f&1&&rs(t,"background",l[0]),f&1&&Wn(a,l[0])},d(l){l&&Me(e)}}}function yCe(o){let e,t=o[0]&&Ece(o);return{c(){t&&t.c(),e=Bs()},m(s,a){t&&t.m(s,a),Re(s,e,a)},p(s,[a]){s[0]?t?t.p(s,a):(t=Ece(s),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},i:pn,o:pn,d(s){t&&t.d(s),s&&Me(e)}}}function wCe(o,e,t){let{value:s}=e;return o.$$set=a=>{"value"in a&&t(0,s=a.value)},[s]}class _Ce extends vo{constructor(e){super(),bo(this,e,wCe,yCe,po,{value:0})}}function Tce(o,e,t){const s=o.slice();return s[5]=e[t],s}function Ace(o){let e,t,s,a;return t=new W6({props:{schemas:o[0],graph:o[1],record:o[5]}}),{c(){e=ie("span"),tn(t.$$.fragment),s=Ze(),H(e,"class","mr-3")},m(l,f){Re(l,e,f),Kt(t,e,null),X(e,s),a=!0},p(l,f){const d={};f&1&&(d.schemas=l[0]),f&2&&(d.graph=l[1]),f&4&&(d.record=l[5]),t.$set(d)},i(l){a||(xe(t.$$.fragment,l),a=!0)},o(l){Qe(t.$$.fragment,l),a=!1},d(l){l&&Me(e),Jt(t)}}}function SCe(o){let e,t,s=o[2],a=[];for(let f=0;fQe(a[f],1,1,()=>{a[f]=null});return{c(){e=ie("div");for(let f=0;f{"record"in h&&t(3,a=h.record),"field"in h&&t(4,l=h.field),"schemas"in h&&t(0,f=h.schemas),"graph"in h&&t(1,d=h.graph)},o.$$.update=()=>{var h,b;o.$$.dirty&26&&t(2,s=(b=(h=d.edges)==null?void 0:h.filter(w=>w.field===l.name&&w.source===a.id).map(w=>d.records.find(k=>k.id===w.target)).filter(w=>!!w))!=null?b:[])},[f,d,s,a,l]}class Spe extends vo{constructor(e){super(),bo(this,e,CCe,SCe,po,{record:3,field:4,schemas:0,graph:1})}}function kCe(o){let e;return{c(){e=Xt(o[0])},m(t,s){Re(t,e,s)},p(t,[s]){s&1&&Wn(e,t[0])},i:pn,o:pn,d(t){t&&Me(e)}}}function xCe(o,e,t){let{value:s}=e;return o.$$set=a=>{"value"in a&&t(0,s=a.value)},[s]}class ECe extends vo{constructor(e){super(),bo(this,e,xCe,kCe,po,{value:0})}}function TCe(o){let e,t;return{c(){e=ie("div"),t=Xt(o[0]),H(e,"title",o[0]),H(e,"data-bs-toggle","tooltip"),H(e,"data-bs-placement","top"),H(e,"class","svelte-1ft053t")},m(s,a){Re(s,e,a),X(e,t)},p(s,[a]){a&1&&Wn(t,s[0]),a&1&&H(e,"title",s[0])},i:pn,o:pn,d(s){s&&Me(e)}}}function ACe(o,e,t){let{value:s}=e;return o.$$set=a=>{"value"in a&&t(0,s=a.value)},[s]}class sne extends vo{constructor(e){super(),bo(this,e,ACe,TCe,po,{value:0})}}function DCe(o){let e,t;return{c(){e=ie("a"),t=Xt(o[0]),H(e,"href",o[0]),H(e,"target","_blank")},m(s,a){Re(s,e,a),X(e,t)},p(s,[a]){a&1&&Wn(t,s[0]),a&1&&H(e,"href",s[0])},i:pn,o:pn,d(s){s&&Me(e)}}}function PCe(o,e,t){let{value:s}=e;return o.$$set=a=>{"value"in a&&t(0,s=a.value)},[s]}class MCe extends vo{constructor(e){super(),bo(this,e,PCe,DCe,po,{value:0})}}function RCe(o){let e;return{c(){e=Xt(o[0])},m(t,s){Re(t,e,s)},p(t,[s]){s&1&&Wn(e,t[0])},i:pn,o:pn,d(t){t&&Me(e)}}}function $Ce(o,e,t){let{value:s}=e;return o.$$set=a=>{"value"in a&&t(0,s=a.value)},[s]}class Dce extends vo{constructor(e){super(),bo(this,e,$Ce,RCe,po,{value:0})}}function Pce(o,e,t){const s=o.slice();return s[4]=e[t],s}function Mce(o){let e,t,s,a;return t=new Yw({props:{record:o[4],size:"tiny"}}),{c(){e=ie("div"),tn(t.$$.fragment),s=Ze(),H(e,"class","me-1")},m(l,f){Re(l,e,f),Kt(t,e,null),X(e,s),a=!0},p:pn,i(l){a||(xe(t.$$.fragment,l),a=!0)},o(l){Qe(t.$$.fragment,l),a=!1},d(l){l&&Me(e),Jt(t)}}}function NCe(o){let e,t,s=o[0],a=[];for(let f=0;fQe(a[f],1,1,()=>{a[f]=null});return{c(){e=ie("div");for(let f=0;fh.field===a.name&&h.source===s.id).map(h=>l.records.find(b=>b.id===h.target));return console.log(f),o.$$set=h=>{"record"in h&&t(1,s=h.record),"field"in h&&t(2,a=h.field),"graph"in h&&t(3,l=h.graph)},[f,s,a,l]}class Cpe extends vo{constructor(e){super(),bo(this,e,ICe,NCe,po,{record:1,field:2,graph:3})}}function BCe(o){let e,t;return{c(){e=ie("span"),t=Xt(o[0]),H(e,"class","badge rounded-pill bg-primary bg-opacity-75"),rs(e,"max-width","64px"),rs(e,"overflow","hidden"),rs(e,"white-space","nowrap"),rs(e,"text-overflow","ellipsis"),H(e,"title",o[0]),H(e,"data-bs-toggle","tooltip")},m(s,a){Re(s,e,a),X(e,t)},p(s,[a]){a&1&&Wn(t,s[0]),a&1&&H(e,"title",s[0])},i:pn,o:pn,d(s){s&&Me(e)}}}function LCe(o,e,t){let{value:s}=e;return o.$$set=a=>{"value"in a&&t(0,s=a.value)},[s]}class FCe extends vo{constructor(e){super(),bo(this,e,LCe,BCe,po,{value:0})}}function QCe(o){let e,t;return{c(){e=ie("div"),t=Xt(o[0]),H(e,"class","svelte-1ft053t")},m(s,a){Re(s,e,a),X(e,t)},p(s,[a]){a&1&&Wn(t,s[0])},i:pn,o:pn,d(s){s&&Me(e)}}}function ZCe(o,e,t){let{value:s}=e;return o.$$set=a=>{"value"in a&&t(0,s=a.value)},[s]}class zCe extends vo{constructor(e){super(),bo(this,e,ZCe,QCe,po,{value:0})}}function HCe(o){let e,t,s;var a=o[4][o[0].info.name];function l(f){return{props:{value:f[2].data[f[0].name],record:f[2],graph:f[3],schema:f[1],field:f[0]}}}return a&&(e=xC(a,l(o))),{c(){e&&tn(e.$$.fragment),t=Bs()},m(f,d){e&&Kt(e,f,d),Re(f,t,d),s=!0},p(f,[d]){const h={};if(d&5&&(h.value=f[2].data[f[0].name]),d&4&&(h.record=f[2]),d&8&&(h.graph=f[3]),d&2&&(h.schema=f[1]),d&1&&(h.field=f[0]),d&1&&a!==(a=f[4][f[0].info.name])){if(e){wo();const b=e;Qe(b.$$.fragment,1,0,()=>{Jt(b,1)}),_o()}a?(e=xC(a,l(f)),tn(e.$$.fragment),xe(e.$$.fragment,1),Kt(e,t.parentNode,t)):e=null}else a&&e.$set(h)},i(f){s||(e&&xe(e.$$.fragment,f),s=!0)},o(f){e&&Qe(e.$$.fragment,f),s=!1},d(f){f&&Me(t),e&&Jt(e,f)}}}function VCe(o,e,t){const s={text:sne,slug:sne,rich:zCe,textarea:sne,color:_Ce,checkbox:OCe,reference:Spe,number:ECe,url:MCe,date:Dce,datetime:Dce,uuid:FCe,file:Cpe};let{field:a}=e,{schema:l}=e,{record:f}=e,{graph:d}=e;return o.$$set=h=>{"field"in h&&t(0,a=h.field),"schema"in h&&t(1,l=h.schema),"record"in h&&t(2,f=h.record),"graph"in h&&t(3,d=h.graph)},[a,l,f,d,s]}class kpe extends vo{constructor(e){super(),bo(this,e,VCe,HCe,po,{field:0,schema:1,record:2,graph:3})}}function Np(o,e){var t,s;return o&&(s=(t=o.find(a=>a.id===e))==null?void 0:t.name)!=null?s:e}function Rce(o,e,t){const s=o.slice();return s[6]=e[t],s[8]=t,s}function $ce(o){let e,t,s,a;return t=new kpe({props:{record:o[3],schema:o[0],graph:o[2],field:o[6]}}),{c(){e=ie("td"),tn(t.$$.fragment),H(e,"class",s="field-ui-"+o[6].info.name),is(e,"is-sort","-"+o[6].name==o[4]||o[6].name==o[4])},m(l,f){Re(l,e,f),Kt(t,e,null),a=!0},p(l,f){const d={};f&8&&(d.record=l[3]),f&1&&(d.schema=l[0]),f&4&&(d.graph=l[2]),f&32&&(d.field=l[6]),t.$set(d),(!a||f&32&&s!==(s="field-ui-"+l[6].info.name))&&H(e,"class",s),(!a||f&48)&&is(e,"is-sort","-"+l[6].name==l[4]||l[6].name==l[4])},i(l){a||(xe(t.$$.fragment,l),a=!0)},o(l){Qe(t.$$.fragment,l),a=!1},d(l){l&&Me(e),Jt(t)}}}function Nce(o){let e,t,s;return t=new Use({props:{status:o[3].status}}),{c(){e=ie("td"),tn(t.$$.fragment),H(e,"class","text-center"),is(e,"is-sort",o[4]=="-status"||o[4]=="status")},m(a,l){Re(a,e,l),Kt(t,e,null),s=!0},p(a,l){const f={};l&8&&(f.status=a[3].status),t.$set(f),(!s||l&16)&&is(e,"is-sort",a[4]=="-status"||a[4]=="status")},i(a){s||(xe(t.$$.fragment,a),s=!0)},o(a){Qe(t.$$.fragment,a),s=!1},d(a){a&&Me(e),Jt(t)}}}function Ice(o){let e,t,s;return t=new by({props:{name:Np(o[1],o[3]._sys.createdBy),side:24}}),{c(){e=ie("td"),tn(t.$$.fragment),H(e,"class","text-center"),is(e,"is-sort",o[4]=="-_sys.createdBy"||o[4]=="_sys.createdBy")},m(a,l){Re(a,e,l),Kt(t,e,null),s=!0},p(a,l){const f={};l&10&&(f.name=Np(a[1],a[3]._sys.createdBy)),t.$set(f),(!s||l&16)&&is(e,"is-sort",a[4]=="-_sys.createdBy"||a[4]=="_sys.createdBy")},i(a){s||(xe(t.$$.fragment,a),s=!0)},o(a){Qe(t.$$.fragment,a),s=!1},d(a){a&&Me(e),Jt(t)}}}function Bce(o){let e,t,s;return t=new by({props:{name:Np(o[1],o[3]._sys.updatedBy),side:24}}),{c(){e=ie("td"),tn(t.$$.fragment),H(e,"class","text-center"),is(e,"is-sort",o[4]=="-_sys.updatedBy"||o[4]=="_sys.updatedBy")},m(a,l){Re(a,e,l),Kt(t,e,null),s=!0},p(a,l){const f={};l&10&&(f.name=Np(a[1],a[3]._sys.updatedBy)),t.$set(f),(!s||l&16)&&is(e,"is-sort",a[4]=="-_sys.updatedBy"||a[4]=="_sys.updatedBy")},i(a){s||(xe(t.$$.fragment,a),s=!0)},o(a){Qe(t.$$.fragment,a),s=!1},d(a){a&&Me(e),Jt(t)}}}function Lce(o){let e,t=ly(o[3]._sys.createdAt)+"",s;return{c(){e=ie("td"),s=Xt(t),is(e,"is-sort",o[4]=="-_sys.createdAt"||o[4]=="_sys.createdAt")},m(a,l){Re(a,e,l),X(e,s)},p(a,l){l&8&&t!==(t=ly(a[3]._sys.createdAt)+"")&&Wn(s,t),l&16&&is(e,"is-sort",a[4]=="-_sys.createdAt"||a[4]=="_sys.createdAt")},d(a){a&&Me(e)}}}function Fce(o){let e,t=ly(o[3]._sys.updatedAt)+"",s;return{c(){e=ie("td"),s=Xt(t),is(e,"is-sort",o[4]=="-_sys.updatedAt"||o[4]=="_sys.updatedAt")},m(a,l){Re(a,e,l),X(e,s)},p(a,l){l&8&&t!==(t=ly(a[3]._sys.updatedAt)+"")&&Wn(s,t),l&16&&is(e,"is-sort",a[4]=="-_sys.updatedAt"||a[4]=="_sys.updatedAt")},d(a){a&&Me(e)}}}function WCe(o){let e,t=o[0].visible.includes("status"),s,a=o[0].visible.includes("_sys.createdBy"),l,f=o[0].visible.includes("_sys.updatedBy"),d,h=o[0].visible.includes("_sys.createdAt"),b,w=o[0].visible.includes("_sys.updatedAt"),k,T,R=o[5],$=[];for(let oe=0;oeQe($[oe],1,1,()=>{$[oe]=null});let F=t&&Nce(o),U=a&&Ice(o),ee=f&&Bce(o),I=h&&Lce(o),te=w&&Fce(o);return{c(){for(let oe=0;oe<$.length;oe+=1)$[oe].c();e=Ze(),F&&F.c(),s=Ze(),U&&U.c(),l=Ze(),ee&&ee.c(),d=Ze(),I&&I.c(),b=Ze(),te&&te.c(),k=Bs()},m(oe,ne){for(let G=0;G<$.length;G+=1)$[G]&&$[G].m(oe,ne);Re(oe,e,ne),F&&F.m(oe,ne),Re(oe,s,ne),U&&U.m(oe,ne),Re(oe,l,ne),ee&&ee.m(oe,ne),Re(oe,d,ne),I&&I.m(oe,ne),Re(oe,b,ne),te&&te.m(oe,ne),Re(oe,k,ne),T=!0},p(oe,[ne]){if(ne&61){R=oe[5];let G;for(G=0;G{F=null}),_o()),ne&1&&(a=oe[0].visible.includes("_sys.createdBy")),a?U?(U.p(oe,ne),ne&1&&xe(U,1)):(U=Ice(oe),U.c(),xe(U,1),U.m(l.parentNode,l)):U&&(wo(),Qe(U,1,1,()=>{U=null}),_o()),ne&1&&(f=oe[0].visible.includes("_sys.updatedBy")),f?ee?(ee.p(oe,ne),ne&1&&xe(ee,1)):(ee=Bce(oe),ee.c(),xe(ee,1),ee.m(d.parentNode,d)):ee&&(wo(),Qe(ee,1,1,()=>{ee=null}),_o()),ne&1&&(h=oe[0].visible.includes("_sys.createdAt")),h?I?I.p(oe,ne):(I=Lce(oe),I.c(),I.m(b.parentNode,b)):I&&(I.d(1),I=null),ne&1&&(w=oe[0].visible.includes("_sys.updatedAt")),w?te?te.p(oe,ne):(te=Fce(oe),te.c(),te.m(k.parentNode,k)):te&&(te.d(1),te=null)},i(oe){if(!T){for(let ne=0;ne{"schema"in b&&t(0,s=b.schema),"users"in b&&t(1,a=b.users),"graph"in b&&t(2,l=b.graph),"record"in b&&t(3,f=b.record),"sort"in b&&t(4,d=b.sort),"visibleColumns"in b&&t(5,h=b.visibleColumns)},[s,a,l,f,d,h]}class YCe extends vo{constructor(e){super(),bo(this,e,UCe,WCe,po,{schema:0,users:1,graph:2,record:3,sort:4,visibleColumns:5})}}function Qce(o,e,t){const s=o.slice();return s[16]=e[t],s}function Zce(o,e,t){const s=o.slice();return s[19]=e[t],s}function zce(o,e,t){const s=o.slice();return s[22]=e[t],s}function Hce(o){let e,t,s,a,l,f;return{c(){e=ie("th"),t=ie("input"),t.indeterminate=s=o[0].length>0&&o[0].length0&&d[0].lengthI[16].id;for(let I=0;I0}function Q(I,te){R.find(ne=>ne.id==te.id)?t(0,R=R.filter(ne=>ne.id!==te.id)):t(0,R=[...R,te])}const F=I=>l.visible.includes(I.name),U=(I,te)=>te.id===I.id,ee=(I,te)=>Q(te,I);return o.$$set=I=>{"schema"in I&&t(1,l=I.schema),"users"in I&&t(2,f=I.users),"records"in I&&t(3,d=I.records),"graph"in I&&t(4,h=I.graph),"systemFields"in I&&t(5,b=I.systemFields),"sort"in I&&t(6,w=I.sort),"inModal"in I&&t(7,k=I.inModal),"isWritable"in I&&t(8,T=I.isWritable),"selected"in I&&t(0,R=I.selected)},o.$$.update=()=>{o.$$.dirty&2&&t(9,s=l.fields.filter(I=>l.visible.includes(I.name)))},[R,l,f,d,h,b,w,k,T,s,a,$,Q,F,U,ee]}class qCe extends vo{constructor(e){super(),bo(this,e,jCe,XCe,po,{schema:1,users:2,records:3,graph:4,systemFields:5,sort:6,inModal:7,isWritable:8,selected:0})}}function Xce(o,e,t){const s=o.slice();return s[23]=e[t],s}function GCe(o){let e,t,s,a;function l(h){o[18](h)}function f(h){o[19](h)}let d={systemFields:o[12],sort:o[2],operators:o[3],filter:o[4],inModal:o[13],modalUrl:o[8],isWritable:o[14]};return o[0]!==void 0&&(d.schema=o[0]),o[1]!==void 0&&(d.records=o[1]),e=new oCe({props:d}),Uo.push(()=>cr(e,"schema",l)),Uo.push(()=>cr(e,"records",f)),e.$on("refresh",o[17]),{c(){tn(e.$$.fragment)},m(h,b){Kt(e,h,b),a=!0},p(h,b){const w={};b&4096&&(w.systemFields=h[12]),b&4&&(w.sort=h[2]),b&8&&(w.operators=h[3]),b&16&&(w.filter=h[4]),b&8192&&(w.inModal=h[13]),b&256&&(w.modalUrl=h[8]),b&16384&&(w.isWritable=h[14]),!t&&b&1&&(t=!0,w.schema=h[0],mr(()=>t=!1)),!s&&b&2&&(s=!0,w.records=h[1],mr(()=>s=!1)),e.$set(w)},i(h){a||(xe(e.$$.fragment,h),a=!0)},o(h){Qe(e.$$.fragment,h),a=!1},d(h){Jt(e,h)}}}function KCe(o){let e,t;return e=new pCe({props:{schema:o[0],selected:o[9],inModal:o[13],filter:o[4]}}),{c(){tn(e.$$.fragment)},m(s,a){Kt(e,s,a),t=!0},p(s,a){const l={};a&1&&(l.schema=s[0]),a&512&&(l.selected=s[9]),a&8192&&(l.inModal=s[13]),a&16&&(l.filter=s[4]),e.$set(l)},i(s){t||(xe(e.$$.fragment,s),t=!0)},o(s){Qe(e.$$.fragment,s),t=!1},d(s){Jt(e,s)}}}function JCe(o){let e,t=[],s=new Map,a,l=o[1];const f=d=>d[23].id;for(let d=0;dcr(e,"selected",a)),{c(){tn(e.$$.fragment)},m(f,d){Kt(e,f,d),s=!0},p(f,d){const h={};d&2&&(h.records=f[1]),d&2048&&(h.graph=f[11]),d&1&&(h.schema=f[0]),d&4&&(h.sort=f[2]),d&4096&&(h.systemFields=f[12]),d&8192&&(h.inModal=f[13]),d&1024&&(h.users=f[10]),d&16384&&(h.isWritable=f[14]),!t&&d&512&&(t=!0,h.selected=f[9],mr(()=>t=!1)),e.$set(h)},i(f){s||(xe(e.$$.fragment,f),s=!0)},o(f){Qe(e.$$.fragment,f),s=!1},d(f){Jt(e,f)}}}function jce(o){let e,t,s,a,l,f;function d(...b){return o[21](o[23],...b)}function h(...b){return o[22](o[23],...b)}return{c(){e=ie("div"),t=ie("input"),H(t,"class","form-check-input "),H(t,"type","checkbox"),t.checked=s=o[9].find(d),t.value=a=o[23],H(e,"class","form-check svelte-1xyvs2b")},m(b,w){Re(b,e,w),X(e,t),l||(f=vn(t,"change",h),l=!0)},p(b,w){o=b,w&514&&s!==(s=o[9].find(d))&&(t.checked=s),w&2&&a!==(a=o[23])&&(t.value=a)},d(b){b&&Me(e),l=!1,f()}}}function qce(o,e){let t,s,a,l,f,d,h,b=e[23]._file.path+"",w,k,T,R,$,Q=e[23]._file.mime+"",F,U,ee,I=e[14]&&jce(e);return f=new Yw({props:{record:e[23],size:"medium"}}),{key:o,first:null,c(){t=ie("div"),s=ie("div"),I&&I.c(),a=Ze(),l=ie("div"),tn(f.$$.fragment),d=Ze(),h=ie("a"),w=Xt(b),R=Ze(),$=ie("span"),F=Xt(Q),U=Ze(),H(l,"class","d-flex justify-content-center"),H(h,"href",k=e[15].lucentUrl+"/records/"+e[23].id),H(h,"title",T=e[23]._file.path),H(h,"class","d-block text-center overflow-hidden text-nowrap my-2 "),rs(h,"text-overflow","ellipsis"),rs(h,"font-size","13px"),rs(h,"color","#333"),H($,"class","lx-small-text text-muted d-block text-center"),H(s,"class","file-wrapper rounded p-2 mb-4 bg-light"),is(s,"selected",e[9].includes(e[23])),H(t,"class","col-6 col-md-4"),this.first=t},m(te,oe){Re(te,t,oe),X(t,s),I&&I.m(s,null),X(s,a),X(s,l),Kt(f,l,null),X(s,d),X(s,h),X(h,w),X(s,R),X(s,$),X($,F),X(t,U),ee=!0},p(te,oe){e=te,e[14]?I?I.p(e,oe):(I=jce(e),I.c(),I.m(s,a)):I&&(I.d(1),I=null);const ne={};oe&2&&(ne.record=e[23]),f.$set(ne),(!ee||oe&2)&&b!==(b=e[23]._file.path+"")&&Wn(w,b),(!ee||oe&2&&k!==(k=e[15].lucentUrl+"/records/"+e[23].id))&&H(h,"href",k),(!ee||oe&2&&T!==(T=e[23]._file.path))&&H(h,"title",T),(!ee||oe&2)&&Q!==(Q=e[23]._file.mime+"")&&Wn(F,Q),(!ee||oe&514)&&is(s,"selected",e[9].includes(e[23]))},i(te){ee||(xe(f.$$.fragment,te),ee=!0)},o(te){Qe(f.$$.fragment,te),ee=!1},d(te){te&&Me(t),I&&I.d(),Jt(f)}}}function tke(o){let e,t,s,a=o[0].label+"",l,f,d,h,b,w,k,T,R,$,Q;const F=[KCe,GCe],U=[];function ee(ne,G){return ne[9].length>0&&!ne[13]&&ne[14]?0:1}d=ee(o),h=U[d]=F[d](o);const I=[eke,JCe],te=[];function oe(ne,G){return ne[0].type==="collection"?0:1}return w=oe(o),k=te[w]=I[w](o),$=new fCe({props:{limit:o[5],skip:o[6],total:o[7],inModal:o[13],modalUrl:o[8]}}),$.$on("refresh",o[17]),{c(){e=ie("div"),t=ie("div"),s=ie("h3"),l=Xt(a),f=Ze(),h.c(),b=Ze(),k.c(),R=Ze(),tn($.$$.fragment),H(s,"class","header-normal mb-5 "),H(t,"class",T="lx-card mb-4 "+(o[13]?"mt-0":"mt-5")),H(e,"class","wrapper-large transparent ")},m(ne,G){Re(ne,e,G),X(e,t),X(t,s),X(s,l),X(t,f),U[d].m(t,null),X(t,b),te[w].m(t,null),X(e,R),Kt($,e,null),Q=!0},p(ne,[G]){(!Q||G&1)&&a!==(a=ne[0].label+"")&&Wn(l,a);let ye=d;d=ee(ne),d===ye?U[d].p(ne,G):(wo(),Qe(U[ye],1,1,()=>{U[ye]=null}),_o(),h=U[d],h?h.p(ne,G):(h=U[d]=F[d](ne),h.c()),xe(h,1),h.m(t,b));let Se=w;w=oe(ne),w===Se?te[w].p(ne,G):(wo(),Qe(te[Se],1,1,()=>{te[Se]=null}),_o(),k=te[w],k?k.p(ne,G):(k=te[w]=I[w](ne),k.c()),xe(k,1),k.m(t,null)),(!Q||G&8192&&T!==(T="lx-card mb-4 "+(ne[13]?"mt-0":"mt-5")))&&H(t,"class",T);const Ae={};G&32&&(Ae.limit=ne[5]),G&64&&(Ae.skip=ne[6]),G&128&&(Ae.total=ne[7]),G&8192&&(Ae.inModal=ne[13]),G&256&&(Ae.modalUrl=ne[8]),$.$set(Ae)},i(ne){Q||(xe(h),xe(k),xe($.$$.fragment,ne),Q=!0)},o(ne){Qe(h),Qe(k),Qe($.$$.fragment,ne),Q=!1},d(ne){ne&&Me(e),U[d].d(),te[w].d(),Jt($)}}}function nke(o,e,t){const s=si("channel");let{schema:a}=e,{users:l}=e,{records:f}=e,{graph:d}=e,{systemFields:h}=e,{sort:b}=e,{operators:w}=e,{filter:k}=e,{limit:T}=e,{skip:R}=e,{total:$}=e,{inModal:Q}=e,{modalUrl:F}=e,{selected:U=[]}=e,{isWritable:ee=!1}=e;function I(Ae,Oe){U.find(rt=>rt.id===Oe.id)?t(9,U=U.filter(rt=>rt.id!==Oe.id)):t(9,U=[...U,Oe])}function te(Ae){const Oe=Ae.detail;axios.get(Oe).then(ue=>{t(1,f=ue.data.records),t(2,b=ue.data.sort),t(3,w=ue.data.operators),t(4,k=ue.data.filter),t(6,R=ue.data.skip),t(5,T=ue.data.limit),t(7,$=ue.data.total),t(8,F=ue.data.modalUrl)}).catch(ue=>{console.log(ue)})}function oe(Ae){a=Ae,t(0,a)}function ne(Ae){f=Ae,t(1,f)}function G(Ae){U=Ae,t(9,U)}const ye=(Ae,Oe)=>Oe.id===Ae.id,Se=(Ae,Oe)=>I(Oe,Ae);return o.$$set=Ae=>{"schema"in Ae&&t(0,a=Ae.schema),"users"in Ae&&t(10,l=Ae.users),"records"in Ae&&t(1,f=Ae.records),"graph"in Ae&&t(11,d=Ae.graph),"systemFields"in Ae&&t(12,h=Ae.systemFields),"sort"in Ae&&t(2,b=Ae.sort),"operators"in Ae&&t(3,w=Ae.operators),"filter"in Ae&&t(4,k=Ae.filter),"limit"in Ae&&t(5,T=Ae.limit),"skip"in Ae&&t(6,R=Ae.skip),"total"in Ae&&t(7,$=Ae.total),"inModal"in Ae&&t(13,Q=Ae.inModal),"modalUrl"in Ae&&t(8,F=Ae.modalUrl),"selected"in Ae&&t(9,U=Ae.selected),"isWritable"in Ae&&t(14,ee=Ae.isWritable)},[a,f,b,w,k,T,R,$,F,U,l,d,h,Q,ee,s,I,te,oe,ne,G,ye,Se]}class xpe extends vo{constructor(e){super(),bo(this,e,nke,tke,po,{schema:0,users:10,records:1,graph:11,systemFields:12,sort:2,operators:3,filter:4,limit:5,skip:6,total:7,inModal:13,modalUrl:8,selected:9,isWritable:14})}}function Gce(o){let e,t,s,a,l,f,d,h,b,w,k,T,R,$,Q,F,U,ee,I,te,oe,ne,G=o[1].length>0&&Kce(o);const ye=[o[2]];function Se(Oe){o[8](Oe)}let Ae={};for(let Oe=0;Oecr(ee,"selected",Se)),{c(){e=ie("div"),t=ie("div"),s=ie("div"),a=ie("div"),l=ie("div"),f=ie("button"),d=Xt("Insert"),b=Ze(),w=ie("button"),k=Xt("Replace"),R=Ze(),G&&G.c(),$=Ze(),Q=ie("button"),F=Ze(),U=ie("div"),tn(ee.$$.fragment),H(f,"type","button"),H(f,"class","btn btn-primary me-1"),f.disabled=h=o[1].length===0,H(w,"type","button"),H(w,"class","btn btn-outline-primary me-3"),w.disabled=T=o[1].length===0,H(l,"class","d-flex align-items-center"),H(Q,"type","button"),H(Q,"class","btn-close"),H(Q,"data-bs-dismiss","modal"),H(Q,"aria-label","Close"),H(a,"class","modal-header"),H(U,"class","modal-body"),H(s,"class","modal-content svelte-1mf5922"),H(t,"class","modal-dialog modal-dialog-centered modal-dialog-scrollable svelte-1mf5922"),H(e,"class","modal fade show"),H(e,"tabindex","-1"),H(e,"aria-modal","true"),H(e,"role","dialog"),rs(e,"background","rgba(100,100,100,.6)"),is(e,"d-block",o[0])},m(Oe,ue){Re(Oe,e,ue),X(e,t),X(t,s),X(s,a),X(a,l),X(l,f),X(f,d),X(l,b),X(l,w),X(w,k),X(l,R),G&&G.m(l,null),X(a,$),X(a,Q),X(s,F),X(s,U),Kt(ee,U,null),te=!0,oe||(ne=[vn(f,"click",o[3]),vn(w,"click",o[4]),vn(Q,"click",Uu(o[7]))],oe=!0)},p(Oe,ue){(!te||ue&2&&h!==(h=Oe[1].length===0))&&(f.disabled=h),(!te||ue&2&&T!==(T=Oe[1].length===0))&&(w.disabled=T),Oe[1].length>0?G?G.p(Oe,ue):(G=Kce(Oe),G.c(),G.m(l,null)):G&&(G.d(1),G=null);const rt=ue&4?LH(ye,[FH(Oe[2])]):{};!I&&ue&2&&(I=!0,rt.selected=Oe[1],mr(()=>I=!1)),ee.$set(rt),(!te||ue&1)&&is(e,"d-block",Oe[0])},i(Oe){te||(xe(ee.$$.fragment,Oe),te=!0)},o(Oe){Qe(ee.$$.fragment,Oe),te=!1},d(Oe){Oe&&Me(e),G&&G.d(),Jt(ee),oe=!1,$i(ne)}}}function Kce(o){let e,t=o[1].length+"",s,a;return{c(){e=ie("span"),s=Xt(t),a=Xt(" records selected"),H(e,"class","")},m(l,f){Re(l,e,f),X(e,s),X(e,a)},p(l,f){f&2&&t!==(t=l[1].length+"")&&Wn(s,t)},d(l){l&&Me(e)}}}function oke(o){let e,t,s=o[2].schema&&Gce(o);return{c(){s&&s.c(),e=Bs()},m(a,l){s&&s.m(a,l),Re(a,e,l),t=!0},p(a,[l]){a[2].schema?s?(s.p(a,l),l&4&&xe(s,1)):(s=Gce(a),s.c(),xe(s,1),s.m(e.parentNode,e)):s&&(wo(),Qe(s,1,1,()=>{s=null}),_o())},i(a){t||(xe(s),t=!0)},o(a){Qe(s),t=!1},d(a){s&&s.d(a),a&&Me(e)}}}function ske(o,e,t){let s;const a=Qp(),l=si("channel");let f=!1,d=[];function h(Q){t(0,f=!0),w(Q)}function b(){t(0,f=!1),t(1,d=[])}function w(Q){axios.get(l.lucentUrl+"/content/"+Q).then(F=>{t(2,s=F.data)}).catch(F=>console.log(F))}function k(Q){Q.preventDefault(),a("insert",{records:d,action:"insert"})}function T(Q){Q.preventDefault(),a("insert",{records:d,action:"replace"})}const R=Q=>t(0,f=!1);function $(Q){d=Q,t(1,d)}return t(2,s={}),[f,d,s,k,T,h,b,R,$]}class Yse extends vo{constructor(e){super(),bo(this,e,ske,oke,po,{open:5,close:6})}get open(){return this.$$.ctx[5]}get close(){return this.$$.ctx[6]}}function Jce(o,e,t){const s=o.slice();return s[18]=e[t],s}function rke(o){let e,t,s,a,l,f,d,h,b;return f=new ml({props:{icon:"magnifying-glass"}}),{c(){e=ie("div"),t=ie("div"),s=ie("button"),s.textContent="New",a=Ze(),l=ie("button"),tn(f.$$.fragment),H(s,"class","btn btn-sm btn-primary"),H(l,"class","btn btn-sm btn-outline-primary"),H(t,"class","mb-2"),H(e,"class","pb-2 text-start")},m(w,k){Re(w,e,k),X(e,t),X(t,s),X(t,a),X(t,l),Kt(f,l,null),d=!0,h||(b=[vn(s,"click",o[12]),vn(l,"click",o[13])],h=!0)},p:pn,i(w){d||(xe(f.$$.fragment,w),d=!0)},o(w){Qe(f.$$.fragment,w),d=!1},d(w){w&&Me(e),Jt(f),h=!1,$i(b)}}}function ike(o){let e,t,s,a,l,f,d;t=new ml({props:{width:24,height:24,icon:"circle-plus"}});let h=o[4]&&eue(o);return{c(){e=ie("button"),tn(t.$$.fragment),s=Ze(),h&&h.c(),a=Bs(),H(e,"type","button"),H(e,"class","btn btn-lg btn-link text-decoration-none inline-card-button svelte-1lp73xk"),is(e,"is-first",!o[1])},m(b,w){Re(b,e,w),Kt(t,e,null),Re(b,s,w),h&&h.m(b,w),Re(b,a,w),l=!0,f||(d=vn(e,"click",Uu(o[9])),f=!0)},p(b,w){(!l||w&2)&&is(e,"is-first",!b[1]),b[4]?h?(h.p(b,w),w&16&&xe(h,1)):(h=eue(b),h.c(),xe(h,1),h.m(a.parentNode,a)):h&&(wo(),Qe(h,1,1,()=>{h=null}),_o())},i(b){l||(xe(t.$$.fragment,b),xe(h),l=!0)},o(b){Qe(t.$$.fragment,b),Qe(h),l=!1},d(b){b&&Me(e),Jt(t),b&&Me(s),h&&h.d(b),b&&Me(a),f=!1,d()}}}function eue(o){let e,t,s=o[0],a=[];for(let f=0;fQe(a[f],1,1,()=>{a[f]=null});return{c(){e=ie("div");for(let f=0;f1?0:1}e=b(o),t=h[e]=d[e](o);let w=o[3]&&nue(o),k={};return l=new Yse({props:k}),o[15](l),l.$on("insert",o[7]),{c(){t.c(),s=Ze(),w&&w.c(),a=Ze(),tn(l.$$.fragment)},m(T,R){h[e].m(T,R),Re(T,s,R),w&&w.m(T,R),Re(T,a,R),Kt(l,T,R),f=!0},p(T,[R]){let $=e;e=b(T),e===$?h[e].p(T,R):(wo(),Qe(h[$],1,1,()=>{h[$]=null}),_o(),t=h[e],t?t.p(T,R):(t=h[e]=d[e](T),t.c()),xe(t,1),t.m(s.parentNode,s)),T[3]?w?(w.p(T,R),R&8&&xe(w,1)):(w=nue(T),w.c(),xe(w,1),w.m(a.parentNode,a)):w&&(wo(),Qe(w,1,1,()=>{w=null}),_o());const Q={};l.$set(Q)},i(T){f||(xe(t),xe(w),xe(l.$$.fragment,T),f=!0)},o(T){Qe(t),Qe(w),Qe(l.$$.fragment,T),f=!1},d(T){h[e].d(T),T&&Me(s),w&&w.d(T),T&&Me(a),o[15](null),Jt(l,T)}}}function lke(o,e,t){let s;const a=Qp(),l=si("channel");let{schemas:f}=e,{recordId:d}=e,h,b;function w(oe,ne){oe.preventDefault(),h.open(ne)}function k(oe){oe.preventDefault(),console.log("Save inline"),t(3,b=null),a("save",{records:oe.detail.records,after:d})}function T(oe){oe.preventDefault(),h.close(),t(4,s=!1),a("insert",{records:oe.detail.records,after:d})}function R(oe,ne){oe.preventDefault(),axios.get(l.lucentUrl+"/records/newInline?schema="+ne).then(G=>{t(3,b=G.data),t(4,s=!1)}).catch(G=>{console.log(G)})}const $=oe=>t(4,s=!s),Q=(oe,ne)=>R(ne,oe.name),F=(oe,ne)=>w(ne,oe.name),U=oe=>R(oe,f[0].name),ee=oe=>w(oe,f[0].name),I=oe=>t(3,b=null);function te(oe){Uo[oe?"unshift":"push"](()=>{h=oe,t(2,h)})}return o.$$set=oe=>{"schemas"in oe&&t(0,f=oe.schemas),"recordId"in oe&&t(1,d=oe.recordId)},t(4,s=!1),[f,d,h,b,s,w,k,T,R,$,Q,F,U,ee,I,te]}class X6 extends vo{constructor(e){super(),bo(this,e,lke,ake,po,{schemas:0,recordId:1})}}/**! * Sortable 1.15.0 * @author RubaXa * @author owenm * @license MIT */function oue(o,e){var t=Object.keys(o);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(o);e&&(s=s.filter(function(a){return Object.getOwnPropertyDescriptor(o,a).enumerable})),t.push.apply(t,s)}return t}function vy(o){for(var e=1;e=0)&&(t[a]=o[a]);return t}function fke(o,e){if(o==null)return{};var t=uke(o,e),s,a;if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(o);for(a=0;a=0)&&(!Object.prototype.propertyIsEnumerable.call(o,s)||(t[s]=o[s]))}return t}var dke="1.15.0";function Lw(o){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(o)}var Xw=Lw(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),j6=Lw(/Edge/i),sue=Lw(/firefox/i),e6=Lw(/safari/i)&&!Lw(/chrome/i)&&!Lw(/android/i),Epe=Lw(/iP(ad|od|hone)/i),Tpe=Lw(/chrome/i)&&Lw(/android/i),Ape={capture:!1,passive:!1};function dl(o,e,t){o.addEventListener(e,t,!Xw&&Ape)}function La(o,e,t){o.removeEventListener(e,t,!Xw&&Ape)}function Uz(o,e){if(!!e){if(e[0]===">"&&(e=e.substring(1)),o)try{if(o.matches)return o.matches(e);if(o.msMatchesSelector)return o.msMatchesSelector(e);if(o.webkitMatchesSelector)return o.webkitMatchesSelector(e)}catch{return!1}return!1}}function hke(o){return o.host&&o!==document&&o.host.nodeType?o.host:o.parentNode}function ry(o,e,t,s){if(o){t=t||document;do{if(e!=null&&(e[0]===">"?o.parentNode===t&&Uz(o,e):Uz(o,e))||s&&o===t)return o;if(o===t)break}while(o=hke(o))}return null}var rue=/\s+/g;function M1(o,e,t){if(o&&e)if(o.classList)o.classList[t?"add":"remove"](e);else{var s=(" "+o.className+" ").replace(rue," ").replace(" "+e+" "," ");o.className=(s+(t?" "+e:"")).replace(rue," ")}}function Vr(o,e,t){var s=o&&o.style;if(s){if(t===void 0)return document.defaultView&&document.defaultView.getComputedStyle?t=document.defaultView.getComputedStyle(o,""):o.currentStyle&&(t=o.currentStyle),e===void 0?t:t[e];!(e in s)&&e.indexOf("webkit")===-1&&(e="-webkit-"+e),s[e]=t+(typeof t=="string"?"":"px")}}function hD(o,e){var t="";if(typeof o=="string")t=o;else do{var s=Vr(o,"transform");s&&s!=="none"&&(t=s+" "+t)}while(!e&&(o=o.parentNode));var a=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return a&&new a(t)}function Dpe(o,e,t){if(o){var s=o.getElementsByTagName(e),a=0,l=s.length;if(t)for(;a=l:f=a<=l,!f)return s;if(s===dy())break;s=yC(s,!1)}return!1}function kD(o,e,t,s){for(var a=0,l=0,f=o.children;l2&&arguments[2]!==void 0?arguments[2]:{},a=s.evt,l=fke(s,wke);q6.pluginEvent.bind(Wr)(e,t,vy({dragEl:Vo,parentEl:Wu,ghostEl:Ti,rootEl:Gc,nextEl:KE,lastDownEl:wz,cloneEl:yu,cloneHidden:vC,dragStarted:HN,putSortable:Qh,activeSortable:Wr.active,originalEvent:a,oldIndex:aD,oldDraggableIndex:n6,newIndex:$1,newDraggableIndex:gC,hideGhostForTarget:Bpe,unhideGhostForTarget:Lpe,cloneNowHidden:function(){vC=!0},cloneNowShown:function(){vC=!1},dispatchSortableEvent:function(d){Pg({sortable:t,name:d,originalEvent:a})}},l))};function Pg(o){yke(vy({putSortable:Qh,cloneEl:yu,targetEl:Vo,rootEl:Gc,oldIndex:aD,oldDraggableIndex:n6,newIndex:$1,newDraggableIndex:gC},o))}var Vo,Wu,Ti,Gc,KE,wz,yu,vC,aD,$1,n6,gC,DZ,Qh,tD=!1,Yz=!1,Xz=[],XE,yv,ane,lne,lue,cue,HN,q4,o6,s6=!1,PZ=!1,_z,Pm,cne=[],Soe=!1,jz=[],ZH=typeof document<"u",MZ=Epe,uue=j6||Xw?"cssFloat":"float",_ke=ZH&&!Tpe&&!Epe&&"draggable"in document.createElement("div"),$pe=function(){if(!!ZH){if(Xw)return!1;var o=document.createElement("x");return o.style.cssText="pointer-events:auto",o.style.pointerEvents==="auto"}}(),Npe=function(e,t){var s=Vr(e),a=parseInt(s.width)-parseInt(s.paddingLeft)-parseInt(s.paddingRight)-parseInt(s.borderLeftWidth)-parseInt(s.borderRightWidth),l=kD(e,0,t),f=kD(e,1,t),d=l&&Vr(l),h=f&&Vr(f),b=d&&parseInt(d.marginLeft)+parseInt(d.marginRight)+pd(l).width,w=h&&parseInt(h.marginLeft)+parseInt(h.marginRight)+pd(f).width;if(s.display==="flex")return s.flexDirection==="column"||s.flexDirection==="column-reverse"?"vertical":"horizontal";if(s.display==="grid")return s.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(l&&d.float&&d.float!=="none"){var k=d.float==="left"?"left":"right";return f&&(h.clear==="both"||h.clear===k)?"vertical":"horizontal"}return l&&(d.display==="block"||d.display==="flex"||d.display==="table"||d.display==="grid"||b>=a&&s[uue]==="none"||f&&s[uue]==="none"&&b+w>a)?"vertical":"horizontal"},Ske=function(e,t,s){var a=s?e.left:e.top,l=s?e.right:e.bottom,f=s?e.width:e.height,d=s?t.left:t.top,h=s?t.right:t.bottom,b=s?t.width:t.height;return a===d||l===h||a+f/2===d+b/2},Cke=function(e,t){var s;return Xz.some(function(a){var l=a[B1].options.emptyInsertThreshold;if(!(!l||Xse(a))){var f=pd(a),d=e>=f.left-l&&e<=f.right+l,h=t>=f.top-l&&t<=f.bottom+l;if(d&&h)return s=a}}),s},Ipe=function(e){function t(l,f){return function(d,h,b,w){var k=d.options.group.name&&h.options.group.name&&d.options.group.name===h.options.group.name;if(l==null&&(f||k))return!0;if(l==null||l===!1)return!1;if(f&&l==="clone")return l;if(typeof l=="function")return t(l(d,h,b,w),f)(d,h,b,w);var T=(f?d:h).options.group.name;return l===!0||typeof l=="string"&&l===T||l.join&&l.indexOf(T)>-1}}var s={},a=e.group;(!a||yz(a)!="object")&&(a={name:a}),s.name=a.name,s.checkPull=t(a.pull,!0),s.checkPut=t(a.put),s.revertClone=a.revertClone,e.group=s},Bpe=function(){!$pe&&Ti&&Vr(Ti,"display","none")},Lpe=function(){!$pe&&Ti&&Vr(Ti,"display","")};ZH&&!Tpe&&document.addEventListener("click",function(o){if(Yz)return o.preventDefault(),o.stopPropagation&&o.stopPropagation(),o.stopImmediatePropagation&&o.stopImmediatePropagation(),Yz=!1,!1},!0);var jE=function(e){if(Vo){e=e.touches?e.touches[0]:e;var t=Cke(e.clientX,e.clientY);if(t){var s={};for(var a in e)e.hasOwnProperty(a)&&(s[a]=e[a]);s.target=s.rootEl=t,s.preventDefault=void 0,s.stopPropagation=void 0,t[B1]._onDragOver(s)}}},kke=function(e){Vo&&Vo.parentNode[B1]._isOutsideThisEl(e.target)};function Wr(o,e){if(!(o&&o.nodeType&&o.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(o));this.el=o,this.options=e=zw({},e),o[B1]=this;var t={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(o.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Npe(o,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(f,d){f.setData("Text",d.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:Wr.supportPointer!==!1&&"PointerEvent"in window&&!e6,emptyInsertThreshold:5};q6.initializePlugins(this,o,t);for(var s in t)!(s in e)&&(e[s]=t[s]);Ipe(e);for(var a in this)a.charAt(0)==="_"&&typeof this[a]=="function"&&(this[a]=this[a].bind(this));this.nativeDraggable=e.forceFallback?!1:_ke,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?dl(o,"pointerdown",this._onTapStart):(dl(o,"mousedown",this._onTapStart),dl(o,"touchstart",this._onTapStart)),this.nativeDraggable&&(dl(o,"dragover",this),dl(o,"dragenter",this)),Xz.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),zw(this,bke())}Wr.prototype={constructor:Wr,_isOutsideThisEl:function(e){!this.el.contains(e)&&e!==this.el&&(q4=null)},_getDirection:function(e,t){return typeof this.options.direction=="function"?this.options.direction.call(this,e,t,Vo):this.options.direction},_onTapStart:function(e){if(!!e.cancelable){var t=this,s=this.el,a=this.options,l=a.preventOnFilter,f=e.type,d=e.touches&&e.touches[0]||e.pointerType&&e.pointerType==="touch"&&e,h=(d||e).target,b=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||h,w=a.filter;if(Rke(s),!Vo&&!(/mousedown|pointerdown/.test(f)&&e.button!==0||a.disabled)&&!b.isContentEditable&&!(!this.nativeDraggable&&e6&&h&&h.tagName.toUpperCase()==="SELECT")&&(h=ry(h,a.draggable,s,!1),!(h&&h.animated)&&wz!==h)){if(aD=Ib(h),n6=Ib(h,a.draggable),typeof w=="function"){if(w.call(this,e,h,this)){Pg({sortable:t,rootEl:b,name:"filter",targetEl:h,toEl:s,fromEl:s}),Dp("filter",t,{evt:e}),l&&e.cancelable&&e.preventDefault();return}}else if(w&&(w=w.split(",").some(function(k){if(k=ry(b,k.trim(),s,!1),k)return Pg({sortable:t,rootEl:k,name:"filter",targetEl:h,fromEl:s,toEl:s}),Dp("filter",t,{evt:e}),!0}),w)){l&&e.cancelable&&e.preventDefault();return}a.handle&&!ry(b,a.handle,s,!1)||this._prepareDragStart(e,d,h)}}},_prepareDragStart:function(e,t,s){var a=this,l=a.el,f=a.options,d=l.ownerDocument,h;if(s&&!Vo&&s.parentNode===l){var b=pd(s);if(Gc=l,Vo=s,Wu=Vo.parentNode,KE=Vo.nextSibling,wz=s,DZ=f.group,Wr.dragged=Vo,XE={target:Vo,clientX:(t||e).clientX,clientY:(t||e).clientY},lue=XE.clientX-b.left,cue=XE.clientY-b.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,Vo.style["will-change"]="all",h=function(){if(Dp("delayEnded",a,{evt:e}),Wr.eventCanceled){a._onDrop();return}a._disableDelayedDragEvents(),!sue&&a.nativeDraggable&&(Vo.draggable=!0),a._triggerDragStart(e,t),Pg({sortable:a,name:"choose",originalEvent:e}),M1(Vo,f.chosenClass,!0)},f.ignore.split(",").forEach(function(w){Dpe(Vo,w.trim(),une)}),dl(d,"dragover",jE),dl(d,"mousemove",jE),dl(d,"touchmove",jE),dl(d,"mouseup",a._onDrop),dl(d,"touchend",a._onDrop),dl(d,"touchcancel",a._onDrop),sue&&this.nativeDraggable&&(this.options.touchStartThreshold=4,Vo.draggable=!0),Dp("delayStart",this,{evt:e}),f.delay&&(!f.delayOnTouchOnly||t)&&(!this.nativeDraggable||!(j6||Xw))){if(Wr.eventCanceled){this._onDrop();return}dl(d,"mouseup",a._disableDelayedDrag),dl(d,"touchend",a._disableDelayedDrag),dl(d,"touchcancel",a._disableDelayedDrag),dl(d,"mousemove",a._delayedDragTouchMoveHandler),dl(d,"touchmove",a._delayedDragTouchMoveHandler),f.supportPointer&&dl(d,"pointermove",a._delayedDragTouchMoveHandler),a._dragStartTimer=setTimeout(h,f.delay)}else h()}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){Vo&&une(Vo),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;La(e,"mouseup",this._disableDelayedDrag),La(e,"touchend",this._disableDelayedDrag),La(e,"touchcancel",this._disableDelayedDrag),La(e,"mousemove",this._delayedDragTouchMoveHandler),La(e,"touchmove",this._delayedDragTouchMoveHandler),La(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||e.pointerType=="touch"&&e,!this.nativeDraggable||t?this.options.supportPointer?dl(document,"pointermove",this._onTouchMove):t?dl(document,"touchmove",this._onTouchMove):dl(document,"mousemove",this._onTouchMove):(dl(Vo,"dragend",this),dl(Gc,"dragstart",this._onDragStart));try{document.selection?Sz(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(e,t){if(tD=!1,Gc&&Vo){Dp("dragStarted",this,{evt:t}),this.nativeDraggable&&dl(document,"dragover",kke);var s=this.options;!e&&M1(Vo,s.dragClass,!1),M1(Vo,s.ghostClass,!0),Wr.active=this,e&&this._appendGhost(),Pg({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(yv){this._lastX=yv.clientX,this._lastY=yv.clientY,Bpe();for(var e=document.elementFromPoint(yv.clientX,yv.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(yv.clientX,yv.clientY),e!==t);)t=e;if(Vo.parentNode[B1]._isOutsideThisEl(e),t)do{if(t[B1]){var s=void 0;if(s=t[B1]._onDragOver({clientX:yv.clientX,clientY:yv.clientY,target:e,rootEl:t}),s&&!this.options.dragoverBubble)break}e=t}while(t=t.parentNode);Lpe()}},_onTouchMove:function(e){if(XE){var t=this.options,s=t.fallbackTolerance,a=t.fallbackOffset,l=e.touches?e.touches[0]:e,f=Ti&&hD(Ti,!0),d=Ti&&f&&f.a,h=Ti&&f&&f.d,b=MZ&&Pm&&aue(Pm),w=(l.clientX-XE.clientX+a.x)/(d||1)+(b?b[0]-cne[0]:0)/(d||1),k=(l.clientY-XE.clientY+a.y)/(h||1)+(b?b[1]-cne[1]:0)/(h||1);if(!Wr.active&&!tD){if(s&&Math.max(Math.abs(l.clientX-this._lastX),Math.abs(l.clientY-this._lastY))=0&&(Pg({rootEl:Wu,name:"add",toEl:Wu,fromEl:Gc,originalEvent:e}),Pg({sortable:this,name:"remove",toEl:Wu,originalEvent:e}),Pg({rootEl:Wu,name:"sort",toEl:Wu,fromEl:Gc,originalEvent:e}),Pg({sortable:this,name:"sort",toEl:Wu,originalEvent:e})),Qh&&Qh.save()):$1!==aD&&$1>=0&&(Pg({sortable:this,name:"update",toEl:Wu,originalEvent:e}),Pg({sortable:this,name:"sort",toEl:Wu,originalEvent:e})),Wr.active&&(($1==null||$1===-1)&&($1=aD,gC=n6),Pg({sortable:this,name:"end",toEl:Wu,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){Dp("nulling",this),Gc=Vo=Wu=Ti=KE=yu=wz=vC=XE=yv=HN=$1=gC=aD=n6=q4=o6=Qh=DZ=Wr.dragged=Wr.ghost=Wr.clone=Wr.active=null,jz.forEach(function(e){e.checked=!0}),jz.length=ane=lne=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":Vo&&(this._onDragOver(e),xke(e));break;case"selectstart":e.preventDefault();break}},toArray:function(){for(var e=[],t,s=this.el.children,a=0,l=s.length,f=this.options;as.right+a||o.clientX<=s.right&&o.clientY>s.bottom&&o.clientX>=s.left:o.clientX>s.right&&o.clientY>s.top||o.clientX<=s.right&&o.clientY>s.bottom+a}function Dke(o,e,t,s,a,l,f,d){var h=s?o.clientY:o.clientX,b=s?t.height:t.width,w=s?t.top:t.left,k=s?t.bottom:t.right,T=!1;if(!f){if(d&&_zw+b*l/2:hk-_z)return-o6}else if(h>w+b*(1-a)/2&&hk-b*l/2)?h>w+b/2?1:-1:0}function Pke(o){return Ib(Vo){f[w]=null}),_o(),t=f[e],t?t.p(h,b):(t=f[e]=l[e](h),t.c()),xe(t,1),t.m(s.parentNode,s))},i(h){a||(xe(t),a=!0)},o(h){Qe(t),a=!1},d(h){f[e].d(h),h&&Me(s)}}}function Lke(o,e,t){let{$$slots:s={},$$scope:a}=e,{sortableClass:l}=e,{isTable:f=!1}=e,{sortableInstance:d}=e;const h=Qp();let b;H1(()=>{let T={animation:150,easing:"cubic-bezier(1, 0, 0, 1)",onUpdate(R){h("update",{source:R.oldIndex,target:R.newIndex})},onMove(R){}};t(3,d=Wr.create(b,T))});function w(T){Uo[T?"unshift":"push"](()=>{b=T,t(2,b)})}function k(T){Uo[T?"unshift":"push"](()=>{b=T,t(2,b)})}return o.$$set=T=>{"sortableClass"in T&&t(0,l=T.sortableClass),"isTable"in T&&t(1,f=T.isTable),"sortableInstance"in T&&t(3,d=T.sortableInstance),"$$scope"in T&&t(4,a=T.$$scope)},[l,f,b,d,a,s,w,k]}class G6 extends vo{constructor(e){super(),bo(this,e,Lke,Bke,po,{sortableClass:0,isTable:1,sortableInstance:3})}}function due(o,e,t){const s=o.slice();return s[11]=e[t],s}function hue(o){let e,t;return{c(){e=ie("div"),t=Xt(o[1]),H(e,"class","invalid-feedback d-block mb-3")},m(s,a){Re(s,e,a),X(e,t)},p(s,a){a&2&&Wn(t,s[1])},d(s){s&&Me(e)}}}function mue(o){let e,t;return e=new G6({props:{sortableClass:"row row-cols-3 mt-3",$$slots:{default:[Fke]},$$scope:{ctx:o}}}),e.$on("update",o[4]),{c(){tn(e.$$.fragment)},m(s,a){Kt(e,s,a),t=!0},p(s,a){const l={};a&16385&&(l.$$scope={dirty:a,ctx:s}),e.$set(l)},i(s){t||(xe(e.$$.fragment,s),t=!0)},o(s){Qe(e.$$.fragment,s),t=!1},d(s){Jt(e,s)}}}function gue(o,e){let t,s,a,l;return s=new Y6({props:{classes:"h-100",record:e[11],hasDelete:!0}}),s.$on("remove",e[3]),{key:o,first:null,c(){t=ie("div"),tn(s.$$.fragment),a=Ze(),H(t,"class","col mb-3"),this.first=t},m(f,d){Re(f,t,d),Kt(s,t,null),X(t,a),l=!0},p(f,d){e=f;const h={};d&1&&(h.record=e[11]),s.$set(h)},i(f){l||(xe(s.$$.fragment,f),l=!0)},o(f){Qe(s.$$.fragment,f),l=!1},d(f){f&&Me(t),Jt(s)}}}function Fke(o){let e=[],t=new Map,s,a,l=o[0];const f=d=>d[11].id;for(let d=0;d0&&mue(o);return{c(){d&&d.c(),e=Ze(),t=ie("div"),tn(s.$$.fragment),a=Ze(),h&&h.c(),l=Bs(),H(t,"class","inline-card-wrapper")},m(b,w){d&&d.m(b,w),Re(b,e,w),Re(b,t,w),Kt(s,t,null),Re(b,a,w),h&&h.m(b,w),Re(b,l,w),f=!0},p(b,[w]){b[1]?d?d.p(b,w):(d=hue(b),d.c(),d.m(e.parentNode,e)):d&&(d.d(1),d=null),b[0].length>0?h?(h.p(b,w),w&1&&xe(h,1)):(h=mue(b),h.c(),xe(h,1),h.m(l.parentNode,l)):h&&(wo(),Qe(h,1,1,()=>{h=null}),_o())},i(b){f||(xe(s.$$.fragment,b),xe(h),f=!0)},o(b){Qe(s.$$.fragment,b),Qe(h),f=!1},d(b){d&&d.d(b),b&&Me(e),b&&Me(t),Jt(s),b&&Me(a),h&&h.d(b),b&&Me(l)}}}function Zke(o,e,t){let s,a;const l=si("channel");let{record:f}=e,{field:d}=e,{graph:h}=e,{validationErrors:b}=e,w=l.schemas.filter($=>d.collections.includes($.name));function k($){$.preventDefault(),t(6,h.edges=h.edges.filter(Q=>!(Q.target===$.detail&&Q.field===d.name)),h)}function T($){t(6,h.edges=HD($.detail.source,$.detail.target,h.edges,d.name),h)}function R($){$.preventDefault(),t(6,h=U6(h,f,$.detail.records,d.name,$.detail.action))}return o.$$set=$=>{"record"in $&&t(7,f=$.record),"field"in $&&t(8,d=$.field),"graph"in $&&t(6,h=$.graph),"validationErrors"in $&&t(9,b=$.validationErrors)},o.$$.update=()=>{var $;o.$$.dirty&768&&t(1,s=Im(b,d.name)),o.$$.dirty&448&&t(0,a=($=h.edges.filter(Q=>Q.field===d.name).map(Q=>h.records.find(F=>F.id==Q.target&&f.id==Q.source)).filter(Q=>!!(Q!=null&&Q.id)))!=null?$:[])},[a,s,w,k,T,R,h,f,d,b]}class zke extends vo{constructor(e){super(),bo(this,e,Zke,Qke,po,{record:7,field:8,graph:6,validationErrors:9})}}function pue(o,e,t){const s=o.slice();return s[21]=e[t],s}function Hke(o){let e,t,s,a,l,f,d,h,b,w,k,T,R,$,Q,F,U,ee,I,te,oe,ne,G,ye,Se,Ae,Oe,ue,rt,nt;f=new ml({props:{icon:"pencil",width:12,height:12}});const St=[Yke,Uke],V=[];function ht(Tt,An){return Tt[7]?0:1}b=ht(o),w=V[b]=St[b](o),$=new ml({props:{icon:"ellipsis"}});let We=!o[1]&&bue(o),Ct=!o[2]&&vue(o),Ot=o[8].type==="files"&&Xke(o),$e=o[8].fields.filter(yue),Je=[];for(let Tt=0;Tt<$e.length;Tt+=1)Je[Tt]=Oue(pue(o,$e,Tt));const an=Tt=>Qe(Je[Tt],1,1,()=>{Je[Tt]=null});return{c(){e=ie("div"),t=ie("div"),s=ie("small"),s.textContent=`${o[8].label}`,a=Ze(),l=ie("button"),tn(f.$$.fragment),d=Ze(),h=ie("button"),w.c(),k=Ze(),T=ie("div"),R=ie("button"),tn($.$$.fragment),Q=Ze(),F=ie("div"),U=ie("a"),ee=Xt("Edit in new tab"),te=Ze(),oe=ie("button"),oe.textContent="Remove",ne=Ze(),G=ie("div"),We&&We.c(),ye=Ze(),Ct&&Ct.c(),Se=Ze(),Ae=ie("div"),Ot&&Ot.c(),Oe=Ze();for(let Tt=0;Tt{V[Xe]=null}),_o(),w=V[b],w||(w=V[b]=St[b](Tt),w.c()),xe(w,1),w.m(h,null)),(!ue||An&1&&I!==(I="/records/"+Tt[0].id))&&H(U,"href",I),Tt[1]?We&&(wo(),Qe(We,1,1,()=>{We=null}),_o()):We?(We.p(Tt,An),An&2&&xe(We,1)):(We=bue(Tt),We.c(),xe(We,1),We.m(G,ye)),Tt[2]?Ct&&(wo(),Qe(Ct,1,1,()=>{Ct=null}),_o()):Ct?(Ct.p(Tt,An),An&4&&xe(Ct,1)):(Ct=vue(Tt),Ct.c(),xe(Ct,1),Ct.m(G,null)),Tt[8].type==="files"&&Ot.p(Tt,An),An&257){$e=Tt[8].fields.filter(yue);let wt;for(wt=0;wt<$e.length;wt+=1){const he=pue(Tt,$e,wt);Je[wt]?(Je[wt].p(he,An),xe(Je[wt],1)):(Je[wt]=Oue(he),Je[wt].c(),xe(Je[wt],1),Je[wt].m(Ae,null))}for(wo(),wt=$e.length;wt{f[w]=null}),_o(),s=f[t],s?s.p(h,b):(s=f[t]=l[t](h),s.c()),xe(s,1),s.m(e,null))},i(h){a||(xe(s),a=!0)},o(h){Qe(s),a=!1},d(h){h&&Me(e),f[t].d()}}}const yue=o=>!(o.trashed||["tab"].includes(o.ui)||["id"].includes(o.name));function Jke(o,e,t){let s,a;const l=si("channel"),f=Qp();let{isFirst:d}=e,{isLast:h}=e,{toDelete:b=!1}=e,{record:w}=e,k,T,R=l.schemas.find(ye=>ye.name===w.schema);function $(ye){ye.preventDefault(),axios.get(l.lucentUrl+"/records/editInline/"+w.id).then(Se=>{t(0,w=Se.data),t(4,k=Se.data.record),t(5,T=Se.data.graph),t(6,s=!0)}).catch(Se=>{console.log(Se)})}function Q(ye){ye.preventDefault(),f("moveup")}function F(ye){ye.preventDefault(),f("movedn")}function U(ye){ye.preventDefault(),f("inlinesaved",ye.detail),t(6,s=!1)}function ee(ye){ye.preventDefault(),f("remove",w.id)}function I(ye){ye.preventDefault(),f("trash",w.id)}function te(ye){ye.preventDefault(),f("undoremove",w.id)}function oe(ye){ye.preventDefault(),t(6,s=!1)}H1(()=>{t(6,s=!1)});function ne(ye){ye.preventDefault(),axios.post(l.lucentUrl+"/records/status/trashed",[w]).then(Se=>{f("remove",w.id)}).catch(Se=>{console.log(Se)})}const G=ye=>t(7,a=!a);return o.$$set=ye=>{"isFirst"in ye&&t(1,d=ye.isFirst),"isLast"in ye&&t(2,h=ye.isLast),"toDelete"in ye&&t(3,b=ye.toDelete),"record"in ye&&t(0,w=ye.record)},t(6,s=!1),t(7,a=!1),[w,d,h,b,k,T,s,a,R,$,Q,F,U,ee,I,te,oe,ne,G]}class exe extends vo{constructor(e){super(),bo(this,e,Jke,Kke,po,{isFirst:1,isLast:2,toDelete:3,record:0})}}function Qpe(o,{from:e,to:t},s={}){const a=getComputedStyle(o),l=a.transform==="none"?"":a.transform,[f,d]=a.transformOrigin.split(" ").map(parseFloat),h=e.left+e.width*f/t.width-(t.left+f),b=e.top+e.height*d/t.height-(t.top+d),{delay:w=0,duration:k=R=>Math.sqrt(R)*120,easing:T=cpe}=s;return{delay:w,duration:Vb(k)?k(Math.sqrt(h*h+b*b)):k,easing:T,css:(R,$)=>{const Q=$*h,F=$*b,U=R+$*e.width/t.width,ee=R+$*e.height/t.height;return`transform: ${l} translate(${Q}px, ${F}px) scale(${U}, ${ee});`}}}function wue(o,e,t){const s=o.slice();return s[18]=e[t],s[19]=e,s[20]=t,s}function _ue(o){let e,t;return{c(){e=ie("div"),t=Xt(o[3]),H(e,"class","invalid-feedback d-block mb-3")},m(s,a){Re(s,e,a),X(e,t)},p(s,a){a&8&&Wn(t,s[3])},d(s){s&&Me(e)}}}function Sue(o){let e=[],t=new Map,s,a,l=o[2];const f=d=>d[18].id;for(let d=0;dcr(s,"record",T)),s.$on("inlinesaved",e[5]),s.$on("moveup",R),s.$on("movedn",$),s.$on("remove",e[6]),s.$on("undoremove",e[8]),s.$on("trash",e[7]),f=new X6({props:{field:e[1],recordId:e[18].id,schemas:e[4]}}),f.$on("insert",e[9]),f.$on("save",e[9]),{key:o,first:null,c(){t=ie("div"),tn(s.$$.fragment),l=Ze(),tn(f.$$.fragment),d=Ze(),H(t,"class","inline-card-wrapper"),this.first=t},m(F,U){Re(F,t,U),Kt(s,t,null),X(t,l),Kt(f,t,null),X(t,d),w=!0},p(F,U){e=F;const ee={};U&4&&(ee.isFirst=e[20]===0),U&4&&(ee.isLast=e[20]+1===e[2].length),U&7&&(ee.toDelete=e[0].edges.find(k)._isTrashed),!a&&U&4&&(a=!0,ee.record=e[18],mr(()=>a=!1)),s.$set(ee);const I={};U&2&&(I.field=e[1]),U&4&&(I.recordId=e[18].id),f.$set(I)},r(){h=t.getBoundingClientRect()},f(){rpe(t),b()},a(){b(),b=spe(t,h,Qpe,{delay:250,duration:250,easing:upe})},i(F){w||(xe(s.$$.fragment,F),xe(f.$$.fragment,F),w=!0)},o(F){Qe(s.$$.fragment,F),Qe(f.$$.fragment,F),w=!1},d(F){F&&Me(t),Jt(s),Jt(f)}}}function txe(o){let e,t,s,a,l,f,d=o[3]&&_ue(o);s=new X6({props:{field:o[1],recordId:null,schemas:o[4]}}),s.$on("insert",o[9]),s.$on("save",o[9]);let h=o[2].length>0&&Sue(o);return{c(){d&&d.c(),e=Ze(),t=ie("div"),tn(s.$$.fragment),a=Ze(),h&&h.c(),l=Bs(),H(t,"class","inline-card-wrapper")},m(b,w){d&&d.m(b,w),Re(b,e,w),Re(b,t,w),Kt(s,t,null),Re(b,a,w),h&&h.m(b,w),Re(b,l,w),f=!0},p(b,[w]){b[3]?d?d.p(b,w):(d=_ue(b),d.c(),d.m(e.parentNode,e)):d&&(d.d(1),d=null);const k={};w&2&&(k.field=b[1]),s.$set(k),b[2].length>0?h?(h.p(b,w),w&4&&xe(h,1)):(h=Sue(b),h.c(),xe(h,1),h.m(l.parentNode,l)):h&&(wo(),Qe(h,1,1,()=>{h=null}),_o())},i(b){f||(xe(s.$$.fragment,b),xe(h),f=!0)},o(b){Qe(s.$$.fragment,b),Qe(h),f=!1},d(b){d&&d.d(b),b&&Me(e),b&&Me(t),Jt(s),b&&Me(a),h&&h.d(b),b&&Me(l)}}}function nxe(o,e,t){let s,a;const l=si("channel");let{field:f}=e,{record:d}=e,{graph:h}=e,{validationErrors:b}=e,w=l.schemas.filter(oe=>f.collections.includes(oe.name));function k(oe){const ne=oe.detail.records[0];t(0,h.edges=h.edges.map(G=>G.source===ne.id?ne:G),h)}function T(oe){oe.preventDefault(),t(0,h.edges=h.edges.filter(ne=>!(ne.target===oe.detail&&ne.field===f.name)),h)}function R(oe){oe.preventDefault(),t(0,h.edges=h.edges.map(ne=>(ne.target===oe.detail&&ne.field===f.name&&(ne._isTrashed=!0),ne)),h)}function $(oe){oe.preventDefault(),t(0,h.edges=h.edges.map(ne=>(ne.target===oe.detail&&ne.field===f.name&&delete ne._isTrashed,ne)),h)}function Q(oe){var Oe;oe.preventDefault();const ne=oe.detail.records,G=(Oe=oe.detail.after)!=null?Oe:null,ye=oe.detail.action;let Se=ne.map(ue=>({target:ue.id,source:d.id,sourceSchema:d.schema,targetSchema:ue.schema,field:f.name,rank:""})),Ae=h.edges;if(ye==="replace"&&(Ae=Ae.filter(ue=>ue.field!==f.name)),t(0,h.records=Nc.exports.uniqBy([...h.records,...ne],ue=>ue.id),h),t(0,h.edges=Nc.exports.uniqBy([...Ae,...Se],ue=>ue.target+ue.field),h),!G)t(0,h.edges=Nc.exports.uniqBy([...Se,...Ae],ue=>ue.target+ue.field),h);else{let ue=!1,rt=Ae.reduce((nt,St)=>(ue?nt.after.push(St):nt.before.push(St),ue===!1&&St.target===G&&(ue=!0),nt),{before:[],after:[]});t(0,h.edges=Nc.exports.uniqBy([...rt.before,...Se,...rt.after],nt=>nt.target+nt.field),h)}}function F(oe,ne,G){t(0,h.edges=HD(ne,G,h.edges,f.name),h)}const U=(oe,ne)=>ne.field===f.name&&ne.target===oe.id;function ee(oe,ne,G,ye){G[ye]=oe,t(2,a),t(0,h),t(1,f),t(11,d)}const I=(oe,ne)=>F(ne,oe,oe-1),te=(oe,ne)=>F(ne,oe,oe+1);return o.$$set=oe=>{"field"in oe&&t(1,f=oe.field),"record"in oe&&t(11,d=oe.record),"graph"in oe&&t(0,h=oe.graph),"validationErrors"in oe&&t(12,b=oe.validationErrors)},o.$$.update=()=>{var oe;o.$$.dirty&4098&&t(3,s=Im(b,f.name)),o.$$.dirty&2051&&t(2,a=(oe=h.edges.filter(ne=>ne.field===f.name).map(ne=>h.records.find(G=>G.id==ne.target&&d.id==ne.source)).filter(ne=>!!(ne!=null&&ne.id)))!=null?oe:[])},[h,f,a,s,w,k,T,R,$,Q,F,d,b,U,ee,I,te]}class oxe extends vo{constructor(e){super(),bo(this,e,nxe,txe,po,{field:1,record:11,graph:0,validationErrors:12})}}function Zpe(o,e,t=null){return t?o.reduce((s,a)=>(s.push(a),a.id===t&&s.push({meta:e,id:Cle(),value:null}),s),[]):[{meta:e,id:Cle(),value:null},...o]}function kue(o,e,t){const s=o.slice();return s[7]=e[t],s}function xue(o){let e,t=o[1].fields,s=[];for(let a=0;at(2,s=!s),b=(w,k)=>d(k,w);return o.$$set=w=>{"blockId"in w&&t(0,a=w.blockId),"blockData"in w&&t(4,l=w.blockData),"blockSchema"in w&&t(1,f=w.blockSchema)},t(2,s=!1),[a,f,s,d,l,h,b]}class ixe extends vo{constructor(e){super(),bo(this,e,rxe,sxe,po,{blockId:0,blockData:4,blockSchema:1})}}function axe(o){let e,t,s,a,l;return{c(){e=ie("div"),t=ie("input"),H(t,"type","text"),H(t,"id",s=o[0].id),H(t,"class","form-control"),H(t,"autocomplete","off"),H(e,"class","mb-0")},m(f,d){Re(f,e,d),X(e,t),hr(t,o[0].value),a||(l=vn(t,"input",o[1]),a=!0)},p(f,[d]){d&1&&s!==(s=f[0].id)&&H(t,"id",s),d&1&&t.value!==f[0].value&&hr(t,f[0].value)},i:pn,o:pn,d(f){f&&Me(e),a=!1,l()}}}function lxe(o,e,t){let{block:s}=e;function a(){s.value=this.value,t(0,s)}return o.$$set=l=>{"block"in l&&t(0,s=l.block)},[s,a]}class cxe extends vo{constructor(e){super(),bo(this,e,lxe,axe,po,{block:0})}}function uxe(o){let e,t,s,a,l;return{c(){e=ie("div"),t=ie("textarea"),H(t,"id",s=o[0].id),H(t,"class","form-control svelte-1er4ovm"),H(t,"autocomplete","off"),H(e,"class","mb-0")},m(f,d){Re(f,e,d),X(e,t),hr(t,o[0].value),o[3](t),a||(l=[vn(t,"input",o[2]),vn(t,"input",zpe)],a=!0)},p(f,[d]){d&1&&s!==(s=f[0].id)&&H(t,"id",s),d&1&&hr(t,f[0].value)},i:pn,o:pn,d(f){f&&Me(e),o[3](null),a=!1,$i(l)}}}function zpe(o){let e;o.target?e=o.target:e=o,e.style.overflow="hidden",e.style.height="1px",e.style.height=+e.scrollHeight+"px"}function fxe(o,e,t){let{block:s}=e,a;H1(()=>{zpe(a)});function l(){s.value=this.value,t(0,s)}function f(d){Uo[d?"unshift":"push"](()=>{a=d,t(1,a)})}return o.$$set=d=>{"block"in d&&t(0,s=d.block)},[s,a,l,f]}class dxe extends vo{constructor(e){super(),bo(this,e,fxe,uxe,po,{block:0})}}var Hpe={exports:{}};(function(o){(function(){var e=function(n){if(n===null)return"null";if(n===void 0)return"undefined";var i=typeof n;return i==="object"&&(Array.prototype.isPrototypeOf(n)||n.constructor&&n.constructor.name==="Array")?"array":i==="object"&&(String.prototype.isPrototypeOf(n)||n.constructor&&n.constructor.name==="String")?"string":i},t=function(n){return["undefined","boolean","number","string","function","xml","null"].indexOf(n)!==-1},s=function(n,i){var c=Array.prototype.slice.call(n);return c.sort(i)},a=function(n,i){return l(function(c,m){return n.eq(i(c),i(m))})},l=function(n){return{eq:n}},f=l(function(n,i){return n===i}),d=f,h=function(n){return l(function(i,c){if(i.length!==c.length)return!1;for(var m=i.length,p=0;p{var m;return c(n,i.prototype)?!0:((m=n.constructor)===null||m===void 0?void 0:m.name)===i.name},$=n=>{const i=typeof n;return n===null?"null":i==="object"&&Array.isArray(n)?"array":i==="object"&&R(n,String,(c,m)=>m.isPrototypeOf(c))?"string":i},Q=n=>i=>$(i)===n,F=n=>i=>typeof i===n,U=n=>i=>n===i,ee=(n,i)=>te(n)&&R(n,i,(c,m)=>T(c)===m),I=Q("string"),te=Q("object"),oe=n=>ee(n,Object),ne=Q("array"),G=U(null),ye=F("boolean"),Se=U(void 0),Ae=n=>n==null,Oe=n=>!Ae(n),ue=F("function"),rt=F("number"),nt=(n,i)=>{if(ne(n)){for(let c=0,m=n.length;c{},V=(n,i)=>(...c)=>n(i.apply(null,c)),ht=(n,i)=>c=>n(i(c)),We=n=>()=>n,Ct=n=>n,Ot=(n,i)=>n===i;function $e(n,...i){return(...c)=>{const m=i.concat(c);return n.apply(null,m)}}const Je=n=>i=>!n(i),an=n=>()=>{throw new Error(n)},Tt=n=>n(),An=n=>{n()},Xe=We(!1),wt=We(!0);class he{constructor(i,c){this.tag=i,this.value=c}static some(i){return new he(!0,i)}static none(){return he.singletonNone}fold(i,c){return this.tag?c(this.value):i()}isSome(){return this.tag}isNone(){return!this.tag}map(i){return this.tag?he.some(i(this.value)):he.none()}bind(i){return this.tag?i(this.value):he.none()}exists(i){return this.tag&&i(this.value)}forall(i){return!this.tag||i(this.value)}filter(i){return!this.tag||i(this.value)?this:he.none()}getOr(i){return this.tag?this.value:i}or(i){return this.tag?this:i}getOrThunk(i){return this.tag?this.value:i()}orThunk(i){return this.tag?this:i()}getOrDie(i){if(this.tag)return this.value;throw new Error(i!=null?i:"Called getOrDie on None")}static from(i){return Oe(i)?he.some(i):he.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(i){this.tag&&i(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}he.singletonNone=new he(!1);const Zo=Array.prototype.slice,ao=Array.prototype.indexOf,wn=Array.prototype.push,Co=(n,i)=>ao.call(n,i),zo=(n,i)=>{const c=Co(n,i);return c===-1?he.none():he.some(c)},yt=(n,i)=>Co(n,i)>-1,Wt=(n,i)=>{for(let c=0,m=n.length;c{const c=n.length,m=new Array(c);for(let p=0;p{for(let c=0,m=n.length;c{for(let c=n.length-1;c>=0;c--){const m=n[c];i(m,c)}},gn=(n,i)=>{const c=[],m=[];for(let p=0,y=n.length;p{const c=[];for(let m=0,p=n.length;m(Gt(n,(m,p)=>{c=i(c,m,p)}),c),Hn=(n,i,c)=>(Ie(n,(m,p)=>{c=i(c,m,p)}),c),ps=(n,i,c)=>{for(let m=0,p=n.length;mps(n,i,Xe),Ss=(n,i)=>{for(let c=0,m=n.length;c{const i=[];for(let c=0,m=n.length;cMr(mt(n,i)),er=(n,i)=>{for(let c=0,m=n.length;c{const i=Zo.call(n,0);return i.reverse(),i},wa=(n,i)=>Dt(n,c=>!yt(i,c)),ur=(n,i)=>{const c={};for(let m=0,p=n.length;m{const c=Zo.call(n,0);return c.sort(i),c},jr=(n,i)=>i>=0&&ijr(n,0),Mo=n=>jr(n,n.length-1),Rr=ue(Array.from)?Array.from:n=>Zo.call(n),Ls=(n,i)=>{for(let c=0;c{const c=[],m=ue(i)?p=>Wt(c,y=>i(y,p)):p=>yt(c,p);for(let p=0,y=n.length;p{const c=bs(n);for(let m=0,p=c.length;mQi(n,(c,m)=>({k:m,v:i(c,m)})),Qi=(n,i)=>{const c={};return ln(n,(m,p)=>{const y=i(m,p);c[y.k]=y.v}),c},ze=n=>(i,c)=>{n[c]=i},et=(n,i,c,m)=>{ln(n,(p,y)=>{(i(p,y)?c:m)(p,y)})},At=(n,i)=>{const c={},m={};return et(n,i,ze(c),ze(m)),{t:c,f:m}},Vt=(n,i)=>{const c={};return et(n,i,ze(c),St),c},Xn=(n,i)=>{const c=[];return ln(n,(m,p)=>{c.push(i(m,p))}),c},uo=n=>Xn(n,Ct),Oo=(n,i)=>un(n,i)?he.from(n[i]):he.none(),un=(n,i)=>_a.call(n,i),os=(n,i)=>un(n,i)&&n[i]!==void 0&&n[i]!==null,Eo=(n,i,c=k)=>w(c).eq(n,i),fs=n=>{const i={};return Ie(n,c=>{i[c]={}}),bs(i)},kr=n=>n.length!==void 0,Lr=Array.isArray,Vs=n=>{if(Lr(n))return n;{const i=[];for(let c=0,m=n.length;c{if(!n)return!1;if(c=c||n,kr(n)){for(let m=0,p=n.length;m{const c=[];return Ur(n,(m,p)=>{c.push(i(m,p,n))}),c},Fa=(n,i)=>{const c=[];return Ur(n,(m,p)=>{(!i||i(m,p,n))&&c.push(m)}),c},vi=(n,i)=>{if(n){for(let c=0,m=n.length;c{let p=Se(c)?n[0]:c;for(let y=0;y{for(let m=0,p=n.length;mn[n.length-1],Ut=n=>{let i=!1,c;return(...m)=>(i||(i=!0,c=n.apply(null,m)),c)},fo=(n,i,c,m)=>{const p=n.isiOS()&&/ipad/i.test(c)===!0,y=n.isiOS()&&!p,x=n.isiOS()||n.isAndroid(),M=x||m("(pointer:coarse)"),L=p||!y&&x&&m("(min-device-width:768px)"),q=y||x&&!L,ae=i.isSafari()&&n.isiOS()&&/safari/i.test(c)===!1,fe=!q&&!L&&!ae;return{isiPad:We(p),isiPhone:We(y),isTablet:We(L),isPhone:We(q),isTouch:We(M),isAndroid:n.isAndroid,isiOS:n.isiOS,isWebView:We(ae),isDesktop:We(fe)}},Lo=(n,i)=>{for(let c=0;c{const c=Lo(n,i);if(!c)return{major:0,minor:0};const m=p=>Number(i.replace(c,"$"+p));return Xo(m(1),m(2))},Jr=(n,i)=>{const c=String(i).toLowerCase();return n.length===0?at():Go(n,c)},at=()=>Xo(0,0),Xo=(n,i)=>({major:n,minor:i}),Ni={nu:Xo,detect:Jr,unknown:at},la=(n,i)=>Ls(i.brands,c=>{const m=c.brand.toLowerCase();return oo(n,p=>{var y;return m===((y=p.brand)===null||y===void 0?void 0:y.toLowerCase())}).map(p=>({current:p.name,version:Ni.nu(parseInt(c.version,10),0)}))}),ma=(n,i)=>{const c=String(i).toLowerCase();return oo(n,m=>m.search(c))},gr=(n,i)=>ma(n,i).map(c=>{const m=Ni.detect(c.versionRegexes,i);return{current:c.name,version:m}}),Ic=(n,i)=>ma(n,i).map(c=>{const m=Ni.detect(c.versionRegexes,i);return{current:c.name,version:m}}),wc=(n,i)=>n.substring(i),tl=(n,i,c)=>i===""||n.length>=i.length&&n.substr(c,c+i.length)===i,ga=(n,i)=>Ar(n,i)?wc(n,i.length):n,tr=(n,i,c=0,m)=>{const p=n.indexOf(i,c);return p!==-1?Se(m)?!0:p+i.length<=m:!1},Ar=(n,i)=>tl(n,i,0),Ki=(n,i)=>tl(n,i,n.length-i.length),gl=n=>i=>i.replace(n,""),_c=gl(/^\s+|\s+$/g),Jc=gl(/^\s+/g),_u=gl(/\s+$/g),yr=n=>n.length>0,nl=n=>!yr(n),Su=(n,i)=>i<=0?"":new Array(i+1).join(n),eu=(n,i=10)=>{const c=parseInt(n,i);return isNaN(c)?he.none():he.some(c)},Ul=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Aa=n=>i=>tr(i,n),Dr=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:n=>tr(n,"edge/")&&tr(n,"chrome")&&tr(n,"safari")&&tr(n,"applewebkit")},{name:"Chromium",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Ul],search:n=>tr(n,"chrome")&&!tr(n,"chromeframe")},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:n=>tr(n,"msie")||tr(n,"trident")},{name:"Opera",versionRegexes:[Ul,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Aa("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Aa("firefox")},{name:"Safari",versionRegexes:[Ul,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:n=>(tr(n,"safari")||tr(n,"mobile/"))&&tr(n,"applewebkit")}],Lm=[{name:"Windows",search:Aa("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:n=>tr(n,"iphone")||tr(n,"ipad"),versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Aa("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"macOS",search:Aa("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Aa("linux"),versionRegexes:[]},{name:"Solaris",search:Aa("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Aa("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:Aa("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],_f={browsers:We(Dr),oses:We(Lm)},xr="Edge",Qa="Chromium",ca="IE",Ji="Opera",Cu="Firefox",Bc="Safari",Za=()=>Lc({current:void 0,version:Ni.unknown()}),Lc=n=>{const i=n.current,c=n.version,m=p=>()=>i===p;return{current:i,version:c,isEdge:m(xr),isChromium:m(Qa),isIE:m(ca),isOpera:m(Ji),isFirefox:m(Cu),isSafari:m(Bc)}},Sc={unknown:Za,nu:Lc,edge:We(xr),chromium:We(Qa),ie:We(ca),opera:We(Ji),firefox:We(Cu),safari:We(Bc)},wd="Windows",Hf="iOS",ku="Android",Yl="Linux",Fc="macOS",Sf="Solaris",tu="FreeBSD",_d="ChromeOS",Te=()=>tt({current:void 0,version:Ni.unknown()}),tt=n=>{const i=n.current,c=n.version,m=p=>()=>i===p;return{current:i,version:c,isWindows:m(wd),isiOS:m(Hf),isAndroid:m(ku),isMacOS:m(Fc),isLinux:m(Yl),isSolaris:m(Sf),isFreeBSD:m(tu),isChromeOS:m(_d)}},gt={unknown:Te,nu:tt,windows:We(wd),ios:We(Hf),android:We(ku),linux:We(Yl),macos:We(Fc),solaris:We(Sf),freebsd:We(tu),chromeos:We(_d)},On={detect:(n,i,c)=>{const m=_f.browsers(),p=_f.oses(),y=i.bind(L=>la(m,L)).orThunk(()=>gr(m,n)).fold(Sc.unknown,Sc.nu),x=Ic(p,n).fold(gt.unknown,gt.nu),M=fo(x,y,n,c);return{browser:y,os:x,deviceType:M}}},Ro=n=>window.matchMedia(n).matches;let $r=Ut(()=>On.detect(navigator.userAgent,he.from(navigator.userAgentData),Ro));const ys=()=>$r(),as=navigator.userAgent,Ai=ys(),js=Ai.browser,zi=Ai.os,xu=Ai.deviceType,Sd=as.indexOf("Windows Phone")!==-1,Gn={transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",documentMode:js.isIE()?document.documentMode||7:10,cacheSuffix:null,container:null,canHaveCSP:!js.isIE(),windowsPhone:Sd,browser:{current:js.current,version:js.version,isChromium:js.isChromium,isEdge:js.isEdge,isFirefox:js.isFirefox,isIE:js.isIE,isOpera:js.isOpera,isSafari:js.isSafari},os:{current:zi.current,version:zi.version,isAndroid:zi.isAndroid,isChromeOS:zi.isChromeOS,isFreeBSD:zi.isFreeBSD,isiOS:zi.isiOS,isLinux:zi.isLinux,isMacOS:zi.isMacOS,isSolaris:zi.isSolaris,isWindows:zi.isWindows},deviceType:{isDesktop:xu.isDesktop,isiPad:xu.isiPad,isiPhone:xu.isiPhone,isPhone:xu.isPhone,isTablet:xu.isTablet,isTouch:xu.isTouch,isWebView:xu.isWebView}},Fm=/^\s*|\s*$/g,Hi=n=>Ae(n)?"":(""+n).replace(Fm,""),me=(n,i)=>i?i==="array"&&Lr(n)?!0:typeof n===i:n!==void 0,Ne=(n,i,c={})=>{const m=I(n)?n.split(i||","):n||[];let p=m.length;for(;p--;)c[m[p]]={};return c},Ue=un,Bt=(n,...i)=>{for(let c=0;ci.call(m,p,y,c)===!1?!1:(Ln(p,i,c,m),!0)))},hn={trim:Hi,isArray:Lr,is:me,toArray:Vs,makeMap:Ne,each:Ur,map:Zi,grep:Fa,inArray:vi,hasOwn:Ue,extend:Bt,walk:Ln,resolve:(n,i=window)=>{const c=n.split(".");for(let m=0,p=c.length;mne(n)?n:n===""?[]:Zi(n.split(i||","),Hi),_addCacheSuffix:n=>{const i=Gn.cacheSuffix;return i&&(n+=(n.indexOf("?")===-1?"?":"&")+i),n}},qr=(n,i,c=Ot)=>n.exists(m=>c(m,i)),Bl=(n,i,c=Ot)=>ri(n,i,c).getOr(n.isNone()&&i.isNone()),ea=n=>{const i=[],c=m=>{i.push(m)};for(let m=0;mn.isSome()&&i.isSome()?he.some(c(n.getOrDie(),i.getOrDie())):he.none(),Cf=(n,i,c,m)=>n.isSome()&&i.isSome()&&c.isSome()?he.some(m(n.getOrDie(),i.getOrDie(),c.getOrDie())):he.none(),ks=(n,i)=>n?he.some(i):he.none(),nu=typeof window<"u"?window:Function("return this;")(),Di=(n,i)=>{let c=i!=null?i:nu;for(let m=0;m{const c=n.split(".");return Di(c,i)},Ii=(n,i)=>lc(n,i),Vf=(n,i)=>{const c=Ii(n,i);if(c==null)throw new Error(n+" not available on this browser");return c},pa=Object.getPrototypeOf,Wf=n=>Vf("HTMLElement",n),pr=n=>{const i=lc("ownerDocument.defaultView",n);return te(n)&&(Wf(i).prototype.isPrototypeOf(n)||/^HTML\w*Element$/.test(pa(n).constructor.name))},Yu=8,Xu=9,Cc=11,Uf=1,qd=3,ei=n=>n.dom.nodeName.toLowerCase(),ta=n=>n.dom.nodeType,za=n=>i=>ta(i)===n,Gb=n=>ta(n)===Yu||ei(n)==="#comment",Pi=n=>kl(n)&&pr(n.dom),kl=za(Uf),ol=za(qd),Lg=za(Xu),Yf=za(Cc),kc=n=>i=>kl(i)&&ei(i)===n,kf=(n,i,c)=>{if(I(c)||ye(c)||rt(c))n.setAttribute(i,c+"");else throw console.error("Invalid call to Attribute.set. Key ",i,":: Value ",c,":: Element ",n),new Error("Attribute value was not simple")},Pr=(n,i,c)=>{kf(n.dom,i,c)},ju=(n,i)=>{const c=n.dom;ln(i,(m,p)=>{kf(c,p,m)})},Ll=(n,i)=>{const c=n.dom.getAttribute(i);return c===null?void 0:c},Ha=(n,i)=>he.from(Ll(n,i)),qi=(n,i)=>{const c=n.dom;return c&&c.hasAttribute?c.hasAttribute(i):!1},Vi=(n,i)=>{n.dom.removeAttribute(i)},cc=n=>{const i=n.dom.attributes;return i==null||i.length===0},Xf=n=>Hn(n.dom.attributes,(i,c)=>(i[c.name]=c.value,i),{}),Gd=(n,i)=>{const c=Ll(n,i);return c===void 0||c===""?[]:c.split(" ")},Fg=(n,i,c)=>{const p=Gd(n,i).concat([c]);return Pr(n,i,p.join(" ")),!0},Qm=(n,i,c)=>{const m=Dt(Gd(n,i),p=>p!==c);return m.length>0?Pr(n,i,m.join(" ")):Vi(n,i),!1},Fl=n=>n.dom.classList!==void 0,Zm=n=>Gd(n,"class"),sl=(n,i)=>Fg(n,"class",i),xf=(n,i)=>Qm(n,"class",i),Yh=(n,i)=>yt(Zm(n),i)?xf(n,i):sl(n,i),qu=(n,i)=>{Fl(n)?n.dom.classList.add(i):sl(n,i)},Xh=n=>{(Fl(n)?n.dom.classList:Zm(n)).length===0&&Vi(n,"class")},Qc=(n,i)=>{Fl(n)?n.dom.classList.remove(i):xf(n,i),Xh(n)},jh=(n,i)=>{const c=Fl(n)?n.dom.classList.toggle(i):Yh(n,i);return Xh(n),c},Ef=(n,i)=>Fl(n)&&n.dom.classList.contains(i),Zp=(n,i)=>{const m=(i||document).createElement("div");if(m.innerHTML=n,!m.hasChildNodes()||m.childNodes.length>1){const p="HTML does not have a single root node";throw console.error(p,n),new Error(p)}return Xl(m.childNodes[0])},zm=(n,i)=>{const m=(i||document).createElement(n);return Xl(m)},jf=(n,i)=>{const m=(i||document).createTextNode(n);return Xl(m)},Xl=n=>{if(n==null)throw new Error("Node cannot be null or undefined");return{dom:n}},Ge={fromHtml:Zp,fromTag:zm,fromText:jf,fromDom:Xl,fromPoint:(n,i,c)=>he.from(n.dom.elementFromPoint(i,c)).map(Xl)},Kd=(n,i)=>{const c=[],m=y=>(c.push(y),i(y));let p=i(n);do p=p.bind(m);while(p.isSome());return c},Eu=(n,i)=>{const c=n.dom;if(c.nodeType!==Uf)return!1;{const m=c;if(m.matches!==void 0)return m.matches(i);if(m.msMatchesSelector!==void 0)return m.msMatchesSelector(i);if(m.webkitMatchesSelector!==void 0)return m.webkitMatchesSelector(i);if(m.mozMatchesSelector!==void 0)return m.mozMatchesSelector(i);throw new Error("Browser lacks native selectors")}},Zg=n=>n.nodeType!==Uf&&n.nodeType!==Xu&&n.nodeType!==Cc||n.childElementCount===0,V1=(n,i)=>{const c=i===void 0?document:i.dom;return Zg(c)?[]:mt(c.querySelectorAll(n),Ge.fromDom)},qh=(n,i)=>{const c=i===void 0?document:i.dom;return Zg(c)?he.none():he.from(c.querySelector(n)).map(Ge.fromDom)},pt=(n,i)=>n.dom===i.dom,cn=(n,i)=>{const c=n.dom,m=i.dom;return c===m?!1:c.contains(m)},rn=n=>Ge.fromDom(n.dom.ownerDocument),Ao=n=>Lg(n)?n:rn(n),nr=n=>Ge.fromDom(Ao(n).dom.documentElement),Yr=n=>Ge.fromDom(Ao(n).dom.defaultView),fi=n=>he.from(n.dom.parentNode).map(Ge.fromDom),yi=n=>he.from(n.dom.parentElement).map(Ge.fromDom),Jd=(n,i)=>{const c=ue(i)?i:Xe;let m=n.dom;const p=[];for(;m.parentNode!==null&&m.parentNode!==void 0;){const y=m.parentNode,x=Ge.fromDom(y);if(p.push(x),c(x)===!0)break;m=y}return p},Kb=n=>{const i=c=>Dt(c,m=>!pt(n,m));return fi(n).map(Da).map(i).getOr([])},Sa=n=>he.from(n.dom.previousSibling).map(Ge.fromDom),Cd=n=>he.from(n.dom.nextSibling).map(Ge.fromDom),zg=n=>Xs(Kd(n,Sa)),rl=n=>Kd(n,Cd),Da=n=>mt(n.dom.childNodes,Ge.fromDom),Gu=(n,i)=>{const c=n.dom.childNodes;return he.from(c[i]).map(Ge.fromDom)},ii=n=>Gu(n,0),Tu=n=>Gu(n,n.dom.childNodes.length-1),uc=n=>n.dom.childNodes.length,Gh=n=>n.dom.hasChildNodes(),W1=n=>{const i=n.dom.head;if(i==null)throw new Error("Head is not available yet");return Ge.fromDom(i)},eh=n=>Yf(n)&&Oe(n.dom.host),Hg=ue(Element.prototype.attachShadow)&&ue(Node.prototype.getRootNode),th=We(Hg),jl=Hg?n=>Ge.fromDom(n.dom.getRootNode()):Ao,Kh=n=>eh(n)?n:W1(Ao(n)),U1=n=>eh(n)?n:Ge.fromDom(Ao(n).dom.body),Hm=n=>{const i=jl(n);return eh(i)?he.some(i):he.none()},Vg=n=>Ge.fromDom(n.dom.host),Jh=n=>{if(th()&&Oe(n.target)){const i=Ge.fromDom(n.target);if(kl(i)&&nh(i)&&n.composed&&n.composedPath){const c=n.composedPath();if(c)return $o(c)}}return he.from(n.target)},nh=n=>Oe(n.dom.shadowRoot),kd=n=>{const i=ol(n)?n.dom.parentNode:n.dom;if(i==null||i.ownerDocument===null)return!1;const c=i.ownerDocument;return Hm(Ge.fromDom(i)).fold(()=>c.body.contains(i),ht(kd,Vg))};var ai=(n,i,c,m,p)=>n(c,m)?he.some(c):ue(p)&&p(c)?he.none():i(c,m,p);const di=(n,i,c)=>{let m=n.dom;const p=ue(c)?c:Xe;for(;m.parentNode;){m=m.parentNode;const y=Ge.fromDom(m);if(i(y))return he.some(y);if(p(y))break}return he.none()},Ql=(n,i,c)=>ai((p,y)=>y(p),di,n,i,c),zp=(n,i)=>{const c=n.dom;return c.parentNode?J(Ge.fromDom(c.parentNode),m=>!pt(n,m)&&i(m)):he.none()},J=(n,i)=>{const c=p=>i(Ge.fromDom(p));return oo(n.dom.childNodes,c).map(Ge.fromDom)},ce=(n,i)=>{const c=m=>{for(let p=0;pdi(n,m=>Eu(m,i),c),Ke=(n,i)=>qh(i,n),it=(n,i,c)=>ai((p,y)=>Eu(p,y),_e,n,i,c),Pn=n=>it(n,"[contenteditable]"),_n=(n,i=!1)=>kd(n)?n.dom.isContentEditable:Pn(n).fold(We(i),c=>Ko(c)==="true"),Ko=n=>n.dom.contentEditable,ss=n=>n.style!==void 0&&ue(n.style.getPropertyValue),ho=(n,i,c)=>{if(!I(c))throw console.error("Invalid call to CSS.set. Property ",i,":: Value ",c,":: Element ",n),new Error("CSS value must be a string: "+c);ss(n)&&n.style.setProperty(i,c)},Er=(n,i)=>{ss(n)&&n.style.removeProperty(i)},ql=(n,i,c)=>{const m=n.dom;ho(m,i,c)},ua=(n,i)=>{const c=n.dom;ln(i,(m,p)=>{ho(c,p,m)})},Bi=(n,i)=>{const c=n.dom,p=window.getComputedStyle(c).getPropertyValue(i);return p===""&&!kd(n)?Au(c,i):p},Au=(n,i)=>ss(n)?n.style.getPropertyValue(i):"",Pa=(n,i)=>{const c=n.dom,m=Au(c,i);return he.from(m).filter(p=>p.length>0)},em=n=>{const i={},c=n.dom;if(ss(c))for(let m=0;m{const c=n.dom;Er(c,i),qr(Ha(n,"style").map(_c),"")&&Vi(n,"style")},Wi=n=>n.dom.offsetWidth,Ca=(n,i)=>{fi(n).each(m=>{m.dom.insertBefore(i.dom,n.dom)})},ou=(n,i)=>{Cd(n).fold(()=>{fi(n).each(p=>{na(p,i)})},m=>{Ca(m,i)})},oh=(n,i)=>{ii(n).fold(()=>{na(n,i)},m=>{n.dom.insertBefore(i.dom,m.dom)})},na=(n,i)=>{n.dom.appendChild(i.dom)},Jb=(n,i)=>{Ca(n,i),na(i,n)},Av=(n,i)=>{Ie(i,(c,m)=>{const p=m===0?n:i[m-1];ou(p,c)})},ti=(n,i)=>{Ie(i,c=>{na(n,c)})},xd=n=>{n.dom.textContent="",Ie(Da(n),i=>{wr(i)})},wr=n=>{const i=n.dom;i.parentNode!==null&&i.parentNode.removeChild(i)},Gl=n=>{const i=Da(n);i.length>0&&Av(n,i),wr(n)},qf=(n,i)=>{const m=(i||document).createElement("div");return m.innerHTML=n,Da(Ge.fromDom(m))},sh=n=>mt(n,Ge.fromDom),Ee=n=>n.dom.innerHTML,Tf=(n,i)=>{const m=rn(n).dom,p=Ge.fromDom(m.createDocumentFragment()),y=qf(i,m);ti(p,y),xd(n),na(n,p)},Wg=n=>{const i=Ge.fromTag("div"),c=Ge.fromDom(n.dom.cloneNode(!0));return na(i,c),Ee(i)},Du=(n,i,c,m,p,y,x)=>({target:n,x:i,y:c,stop:m,prevent:p,kill:y,raw:x}),hi=n=>{const i=Ge.fromDom(Jh(n).getOr(n.target)),c=()=>n.stopPropagation(),m=()=>n.preventDefault(),p=V(m,c);return Du(i,n.clientX,n.clientY,c,m,p,n)},Dv=(n,i)=>c=>{n(c)&&i(hi(c))},Y1=(n,i,c,m,p)=>{const y=Dv(c,m);return n.dom.addEventListener(i,y,p),{unbind:$e(Gf,n,i,y,p)}},e0=(n,i,c,m)=>Y1(n,i,c,m,!1),Gf=(n,i,c,m)=>{n.dom.removeEventListener(i,c,m)},Wm=(n,i)=>({left:n,top:i,translate:(m,p)=>Wm(n+m,i+p)}),Ug=Wm,Pv=n=>{const i=n.getBoundingClientRect();return Ug(i.left,i.top)},Af=(n,i)=>n!==void 0?n:i!==void 0?i:0,ky=n=>{const i=n.dom.ownerDocument,c=i.body,m=i.defaultView,p=i.documentElement;if(c===n.dom)return Ug(c.offsetLeft,c.offsetTop);const y=Af(m==null?void 0:m.pageYOffset,p.scrollTop),x=Af(m==null?void 0:m.pageXOffset,p.scrollLeft),M=Af(p.clientTop,c.clientTop),L=Af(p.clientLeft,c.clientLeft);return Pu(n).translate(x-L,y-M)},Pu=n=>{const i=n.dom,m=i.ownerDocument.body;return m===i?Ug(m.offsetLeft,m.offsetTop):kd(n)?Pv(i):Ug(0,0)},Ku=n=>{const i=n!==void 0?n.dom:document,c=i.body.scrollLeft||i.documentElement.scrollLeft,m=i.body.scrollTop||i.documentElement.scrollTop;return Ug(c,m)},t0=(n,i,c)=>{const p=(c!==void 0?c.dom:document).defaultView;p&&p.scrollTo(n,i)},n0=(n,i)=>{ys().browser.isSafari()&&ue(n.dom.scrollIntoViewIfNeeded)?n.dom.scrollIntoViewIfNeeded(!1):n.dom.scrollIntoView(i)},o0=n=>{const i=n===void 0?window:n;return ys().browser.isFirefox()?he.none():he.from(i.visualViewport)},X1=(n,i,c,m)=>({x:n,y:i,width:c,height:m,right:n+c,bottom:i+m}),Kf=n=>{const i=n===void 0?window:n,c=i.document,m=Ku(Ge.fromDom(c));return o0(i).fold(()=>{const p=i.document.documentElement,y=p.clientWidth,x=p.clientHeight;return X1(m.left,m.top,y,x)},p=>X1(Math.max(p.pageLeft,m.left),Math.max(p.pageTop,m.top),p.width,p.height))},s0=(n,i)=>Dt(Da(n),i),r0=(n,i)=>{let c=[];return Ie(Da(n),m=>{i(m)&&(c=c.concat([m])),c=c.concat(r0(m,i))}),c},pl=(n,i)=>V1(i,n),xy=(n,i,c)=>_e(n,i,c).isSome();class wi{constructor(i,c){this.node=i,this.rootNode=c,this.current=this.current.bind(this),this.next=this.next.bind(this),this.prev=this.prev.bind(this),this.prev2=this.prev2.bind(this)}current(){return this.node}next(i){return this.node=this.findSibling(this.node,"firstChild","nextSibling",i),this.node}prev(i){return this.node=this.findSibling(this.node,"lastChild","previousSibling",i),this.node}prev2(i){return this.node=this.findPreviousNode(this.node,i),this.node}findSibling(i,c,m,p){if(i){if(!p&&i[c])return i[c];if(i!==this.rootNode){let y=i[m];if(y)return y;for(let x=i.parentNode;x&&x!==this.rootNode;x=x.parentNode)if(y=x[m],y)return y}}}findPreviousNode(i,c){if(i){const m=i.previousSibling;if(this.rootNode&&m===this.rootNode)return;if(m){if(!c){for(let y=m.lastChild;y;y=y.lastChild)if(!y.lastChild)return y}return m}const p=i.parentNode;if(p&&p!==this.rootNode)return p}}}const lo=n=>i=>!!i&&i.nodeType===n,Ed=n=>!!n&&!Object.getPrototypeOf(n),Jn=lo(1),xc=n=>{const i=n.toLowerCase();return c=>Oe(c)&&c.nodeName.toLowerCase()===i},Df=n=>{const i=n.map(c=>c.toLowerCase());return c=>{if(c&&c.nodeName){const m=c.nodeName.toLowerCase();return yt(i,m)}return!1}},rh=(n,i)=>{const c=i.toLowerCase().split(" ");return m=>{if(Jn(m)){const p=m.ownerDocument.defaultView;if(p)for(let y=0;yi=>Jn(i)&&i.hasAttribute(n),Yg=(n,i)=>c=>Jn(c)&&c.getAttribute(n)===i,Td=n=>Jn(n)&&n.hasAttribute("data-mce-bogus"),bl=n=>Jn(n)&&n.getAttribute("data-mce-bogus")==="all",Mu=n=>Jn(n)&&n.tagName==="TABLE",Hp=n=>i=>!!(Jn(i)&&(i.contentEditable===n||i.getAttribute("data-mce-contenteditable")===n)),j1=Df(["textarea","input"]),Sn=lo(3),Um=lo(4),Ad=lo(7),ih=lo(8),Ju=lo(9),q1=lo(11),mi=xc("br"),Ui=xc("img"),ba=Hp("true"),Ts=Hp("false"),Dd=Df(["td","th"]),xl=Df(["td","th","caption"]),ef=Df(["video","audio","object","embed"]),Va=xc("li"),ka=xc("details"),Vp=xc("summary"),nn="\uFEFF",Gr="\xA0",i0=n=>n===nn,xa=n=>n.replace(/\uFEFF/g,""),Xg=((n,i)=>{const c=y=>{if(!n(y))throw new Error("Can only get "+i+" value of a "+i+" node");return m(y).getOr("")},m=y=>n(y)?he.from(y.dom.nodeValue):he.none();return{get:c,getOption:m,set:(y,x)=>{if(!n(y))throw new Error("Can only set raw "+i+" value of a "+i+" node");y.dom.nodeValue=x}}})(ol,"text"),zc=n=>Xg.get(n),Jf=n=>Xg.getOption(n),ed=(n,i)=>Xg.set(n,i),Wp=["article","aside","details","div","dt","figcaption","footer","form","fieldset","header","hgroup","html","main","nav","section","summary","body","p","dl","multicol","dd","figure","address","center","blockquote","h1","h2","h3","h4","h5","h6","listing","xmp","pre","plaintext","menu","dir","ul","ol","li","hr","table","tbody","thead","tfoot","th","tr","td","caption"],Zl=["td","th"],Tr=["thead","tbody","tfoot"],Ua=["h1","h2","h3","h4","h5","h6","p","div","address","pre","form","blockquote","center","dir","fieldset","header","footer","article","section","hgroup","aside","nav","figure"],ah=["h1","h2","h3","h4","h5","h6"],Kl=["li","dd","dt"],a0=["ul","ol","dl"],Ym=["pre","script","textarea","style"],G1=["pre"].concat(ah),Ya=n=>{let i;return c=>(i=i||ur(n,wt),un(i,ei(c)))},fc=Ya(Wp),Et=n=>ei(n)==="table",Ec=n=>kl(n)&&!fc(n),su=n=>kl(n)&&ei(n)==="br",dc=Ya(Ua),Ru=Ya(a0),Xa=Ya(Kl),ja=Ya(Tr),Xm=Ya(Zl),ru=Ya(Ym),l0=Ya(G1),Ho=n=>l0(n)||Ec(n),z=n=>{const i=[];let c=n.dom;for(;c;)i.push(Ge.fromDom(c)),c=c.lastChild;return i},j=n=>{const i=pl(n,"br"),c=Dt(z(n).slice(-1),su);i.length===c.length&&Ie(c,wr)},ve=()=>{const n=Ge.fromTag("br");return Pr(n,"data-mce-bogus","1"),n},De=n=>{xd(n),na(n,ve())},lt=n=>{Tu(n).each(i=>{Sa(i).each(c=>{fc(n)&&su(i)&&fc(c)&&wr(i)})})},Ft=nn,Cn=i0,Bn=xa,Yo=Jn,ts=Sn,_i=n=>(ts(n)&&(n=n.parentNode),Yo(n)&&n.hasAttribute("data-mce-caret")),or=n=>ts(n)&&Cn(n.data),_r=n=>_i(n)||or(n),Hc=n=>n.firstChild!==n.lastChild||!mi(n.firstChild),iu=(n,i)=>{var c;const p=((c=n.ownerDocument)!==null&&c!==void 0?c:document).createTextNode(Ft),y=n.parentNode;if(i){const x=n.previousSibling;if(ts(x)){if(_r(x))return x;if(fr(x))return x.splitText(x.data.length-1)}y==null||y.insertBefore(p,n)}else{const x=n.nextSibling;if(ts(x)){if(_r(x))return x;if(ch(x))return x.splitText(1),x}n.nextSibling?y==null||y.insertBefore(p,n.nextSibling):y==null||y.appendChild(p)}return p},tf=n=>{const i=n.container();return Sn(i)?i.data.charAt(n.offset())===Ft||n.isAtStart()&&or(i.previousSibling):!1},Pf=n=>{const i=n.container();return Sn(i)?i.data.charAt(n.offset()-1)===Ft||n.isAtEnd()&&or(i.nextSibling):!1},lh=(n,i,c)=>{var m;const y=((m=i.ownerDocument)!==null&&m!==void 0?m:document).createElement(n);y.setAttribute("data-mce-caret",c?"before":"after"),y.setAttribute("data-mce-bogus","all"),y.appendChild(ve().dom);const x=i.parentNode;return c?x==null||x.insertBefore(y,i):i.nextSibling?x==null||x.insertBefore(y,i.nextSibling):x==null||x.appendChild(y),y},ch=n=>ts(n)&&n.data[0]===Ft,fr=n=>ts(n)&&n.data[n.data.length-1]===Ft,jm=n=>{var i;const c=n.getElementsByTagName("br"),m=c[c.length-1];Td(m)&&((i=m.parentNode)===null||i===void 0||i.removeChild(m))},qm=n=>n&&n.hasAttribute("data-mce-caret")?(jm(n),n.removeAttribute("data-mce-caret"),n.removeAttribute("data-mce-bogus"),n.removeAttribute("style"),n.removeAttribute("data-mce-style"),n.removeAttribute("_moz_abspos"),n):null,oa=n=>_i(n.startContainer),au=ba,Up=Ts,Gm=mi,Ps=Sn,Fr=Df(["script","style","textarea"]),Ma=Df(["img","input","textarea","hr","iframe","video","audio","object","embed"]),hc=Df(["table"]),K1=_r,El=n=>K1(n)?!1:Ps(n)?!Fr(n.parentNode):Ma(n)||Gm(n)||hc(n)||lu(n),Gi=n=>Jn(n)&&n.getAttribute("unselectable")==="true",lu=n=>!Gi(n)&&Up(n),Mf=(n,i)=>{for(let c=n.parentNode;c&&c!==i;c=c.parentNode){if(lu(c))return!1;if(au(c))return!0}return!0},Kw=n=>lu(n)?!Hn(Rr(n.getElementsByTagName("*")),(i,c)=>i||au(c),!1):!1,tm=n=>Ma(n)||Kw(n),jg=(n,i)=>El(n)&&Mf(n,i),nm=/^[ \t\r\n]*$/,Km=n=>nm.test(n),qg=n=>{for(const i of n)if(!i0(i))return!1;return!0},c0=n=>" \f \v".indexOf(n)!==-1,om=n=>n===` `||n==="\r",Ra=(n,i)=>i=0?om(n[i]):!1,uh=(n,i=4,c=!0,m=!0)=>{const p=Su(" ",i),y=n.replace(/\t/g,p);return Hn(y,(M,L)=>c0(L)||L===Gr?M.pcIsSpace||M.str===""&&c||M.str.length===y.length-1&&m||Ra(y,M.str.length+1)?{pcIsSpace:!1,str:M.str+Gr}:{pcIsSpace:!0,str:M.str+" "}:{pcIsSpace:om(L),str:M.str+L},{pcIsSpace:!1,str:""}).str},Pd=(n,i)=>{const c=Ge.fromDom(i),m=Ge.fromDom(n);return xy(m,"pre,code",$e(pt,c))},Jm=(n,i)=>Sn(n)&&Km(n.data)&&!Pd(n,i),eg=n=>Jn(n)&&n.nodeName==="A"&&!n.hasAttribute("href")&&(n.hasAttribute("name")||n.hasAttribute("id")),sm=(n,i)=>El(n)&&!Jm(n,i)||eg(n)||nf(n),nf=Zc("data-mce-bookmark"),u0=Zc("data-mce-bogus"),J1=Yg("data-mce-bogus","all"),Jw=(n,i)=>{let c=0;if(sm(n,n))return!1;{let m=n.firstChild;if(!m)return!0;const p=new wi(m,n);do{if(i){if(J1(m)){m=p.next(!0);continue}if(u0(m)){m=p.next();continue}}if(mi(m)){c++,m=p.next();continue}if(sm(m,n))return!1;m=p.next()}while(m);return c<=1}},$a=(n,i=!0)=>Jw(n.dom,i),Gg="data-mce-block",tg=n=>Dt(bs(n),i=>!/[A-Z]/.test(i)),cu=n=>tg(n).join(","),Rf=(n,i)=>Oe(i.querySelector(n))?(i.setAttribute(Gg,"true"),i.getAttribute("data-mce-selected")==="inline-boundary"&&i.removeAttribute("data-mce-selected"),!0):(i.removeAttribute(Gg),!1),ng=(n,i)=>{const c=cu(n.getTransparentElements()),m=cu(n.getBlockElements());return Dt(i.querySelectorAll(c),p=>Rf(m,p))},fh=(n,i)=>{var c;const m=i?"lastChild":"firstChild";for(let p=n[m];p;p=p[m])if($a(Ge.fromDom(p))){(c=p.parentNode)===null||c===void 0||c.removeChild(p);return}},$u=(n,i)=>{const c=document.createRange(),m=n.parentNode;if(m){c.setStartBefore(n),c.setEndBefore(i);const p=c.extractContents();fh(p,!0),c.setStartAfter(i),c.setEndAfter(n);const y=c.extractContents();fh(y,!1),$a(Ge.fromDom(p))||m.insertBefore(p,n),$a(Ge.fromDom(i))||m.insertBefore(i,n),$a(Ge.fromDom(y))||m.insertBefore(y,n),m.removeChild(n)}},Md=(n,i,c)=>{const m=n.getBlockElements(),p=Ge.fromDom(i),y=M=>ei(M)in m,x=M=>pt(M,p);Ie(sh(c),M=>{di(M,y,x).each(L=>{const q=s0(M,ae=>y(ae)&&!n.isValidChild(ei(L),ei(ae)));if(q.length>0){const ae=yi(L);Ie(q,fe=>{di(fe,y,x).each(be=>{$u(be.dom,fe.dom)})}),ae.each(fe=>ng(n,fe.dom))}})})},og=(n,i,c)=>{Ie([...c,...sg(n,i)?[i]:[]],m=>Ie(pl(Ge.fromDom(m),m.nodeName.toLowerCase()),p=>{Nv(n,p.dom)&&Gl(p)}))},f0=(n,i)=>{const c=ng(n,i);Md(n,i,c),og(n,i,c)},Mv=(n,i)=>{if($v(n,i)){const c=cu(n.getBlockElements());Rf(c,i)}},Rv=(n,i,c)=>{const m=y=>pt(y,Ge.fromDom(i)),p=Jd(Ge.fromDom(c),m);jr(p,p.length-2).filter(kl).fold(()=>f0(n,i),y=>f0(n,y.dom))},dh=n=>n.hasAttribute(Gg),Kg=(n,i)=>un(n.getTransparentElements(),i),$v=(n,i)=>Jn(i)&&Kg(n,i.nodeName),sg=(n,i)=>$v(n,i)&&dh(i),Nv=(n,i)=>$v(n,i)&&!dh(i),sr=(n,i)=>i.type===1&&Kg(n,i.name)&&I(i.attr(Gg)),Do=ys().browser,hh=n=>oo(n,kl),eb=n=>Do.isFirefox()&&ei(n)==="table"?hh(Da(n)).filter(i=>ei(i)==="caption").bind(i=>hh(rl(i)).map(c=>{const m=c.dom.offsetTop,p=i.dom.offsetTop,y=i.dom.offsetHeight;return m<=p?-y:0})).getOr(0):0,Jg=(n,i)=>n.children&&yt(n.children,i),HC=(n,i,c)=>{let m=0,p=0;const y=n.ownerDocument;if(c=c||n,i){if(c===n&&i.getBoundingClientRect&&Bi(Ge.fromDom(n),"position")==="static"){const M=i.getBoundingClientRect();return m=M.left+(y.documentElement.scrollLeft||n.scrollLeft)-y.documentElement.clientLeft,p=M.top+(y.documentElement.scrollTop||n.scrollTop)-y.documentElement.clientTop,{x:m,y:p}}let x=i;for(;x&&x!==c&&x.nodeType&&!Jg(x,c);){const M=x;m+=M.offsetLeft||0,p+=M.offsetTop||0,x=M.offsetParent}for(x=i.parentNode;x&&x!==c&&x.nodeType&&!Jg(x,c);)m-=x.scrollLeft||0,p-=x.scrollTop||0,x=x.parentNode;p+=eb(Ge.fromDom(i))}return{x:m,y:p}},Iv=(n,i={})=>{let c=0;const m={},p=Ge.fromDom(n),y=Ao(p),x=Pe=>{i.referrerPolicy=Pe},M=Pe=>{i.contentCssCors=Pe},L=Pe=>{na(Kh(p),Pe)},q=Pe=>{const He=Kh(p);Ke(He,"#"+Pe).each(wr)},ae=Pe=>Oo(m,Pe).getOrThunk(()=>({id:"mce-u"+c++,passed:[],failed:[],count:0})),fe=Pe=>new Promise((He,dt)=>{let bt;const _t=hn._addCacheSuffix(Pe),Mt=ae(_t);m[_t]=Mt,Mt.count++;const dn=(Zt,yn)=>{Ie(Zt,An),Mt.status=yn,Mt.passed=[],Mt.failed=[],bt&&(bt.onload=null,bt.onerror=null,bt=null)},zn=()=>dn(Mt.passed,2),Nn=()=>dn(Mt.failed,3);if(He&&Mt.passed.push(He),dt&&Mt.failed.push(dt),Mt.status===1)return;if(Mt.status===2){zn();return}if(Mt.status===3){Nn();return}Mt.status=1;const Lt=Ge.fromTag("link",y.dom);ju(Lt,{rel:"stylesheet",type:"text/css",id:Mt.id}),i.contentCssCors&&Pr(Lt,"crossOrigin","anonymous"),i.referrerPolicy&&Pr(Lt,"referrerpolicy",i.referrerPolicy),bt=Lt.dom,bt.onload=zn,bt.onerror=Nn,L(Lt),Pr(Lt,"href",_t)}),be=Pe=>Promise.allSettled(mt(Pe,dt=>fe(dt).then(We(dt)))).then(dt=>{const bt=gn(dt,_t=>_t.status==="fulfilled");return bt.fail.length>0?Promise.reject(mt(bt.fail,_t=>_t.reason)):mt(bt.pass,_t=>_t.value)}),Le=Pe=>{const He=hn._addCacheSuffix(Pe);Oo(m,He).each(dt=>{--dt.count===0&&(delete m[He],q(dt.id))})};return{load:fe,loadAll:be,unload:Le,unloadAll:Pe=>{Ie(Pe,He=>{Le(He)})},_setReferrerPolicy:x,_setContentCssCors:M}},Bv=(()=>{const n=new WeakMap;return{forElement:(c,m)=>{const y=jl(c).dom;return he.from(n.get(y)).getOrThunk(()=>{const x=Iv(y,m);return n.set(y,x),x})}}})(),tb=n=>n.nodeName.toLowerCase()==="span",Ey=(n,i)=>Oe(n)&&(sm(n,i)||Ec(Ge.fromDom(n))),on=(n,i)=>{const c=new wi(n,i).prev(!1),m=new wi(n,i).next(!1),p=Se(c)||Ey(c,i),y=Se(m)||Ey(m,i);return p&&y},Rd=n=>tb(n)&&n.getAttribute("data-mce-type")==="bookmark",e_=(n,i)=>Sn(n)&&n.data.length>0&&on(n,i),d0=n=>Jn(n)?n.childNodes.length>0:!1,VC=n=>q1(n)||Ju(n),rg=(n,i,c)=>{var m;const p=c||i;if(Jn(i)&&Rd(i))return i;const y=i.childNodes;for(let x=y.length-1;x>=0;x--)rg(n,y[x],p);if(Jn(i)){const x=i.childNodes;x.length===1&&Rd(x[0])&&((m=i.parentNode)===null||m===void 0||m.insertBefore(x[0],i))}return!VC(i)&&!sm(i,p)&&!d0(i)&&!e_(i,p)&&n.remove(i),i},Ty=hn.makeMap,rm=/[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,$d=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,ig=/[<>&\"\']/g,Si=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,Nd={128:"\u20AC",130:"\u201A",131:"\u0192",132:"\u201E",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02C6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017D",145:"\u2018",146:"\u2019",147:"\u201C",148:"\u201D",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02DC",153:"\u2122",154:"\u0161",155:"\u203A",156:"\u0153",158:"\u017E",159:"\u0178"},Id={'"':""","'":"'","<":"<",">":">","&":"&","`":"`"},uu={"<":"<",">":">","&":"&",""":'"',"'":"'"},Qs=n=>{const i=Ge.fromTag("div").dom;return i.innerHTML=n,i.textContent||i.innerText||n},Yp=(n,i)=>{const c={};if(n){const m=n.split(",");i=i||10;for(let p=0;pn.replace(i?rm:$d,c=>Id[c]||c),WC=n=>(""+n).replace(ig,i=>Id[i]||i),h0=(n,i)=>n.replace(i?rm:$d,c=>c.length>1?"&#"+((c.charCodeAt(0)-55296)*1024+(c.charCodeAt(1)-56320)+65536)+";":Id[c]||"&#"+c.charCodeAt(0)+";"),Lv=(n,i,c)=>{const m=c||mh;return n.replace(i?rm:$d,p=>Id[p]||m[p]||p)},tp={encodeRaw:ep,encodeAllRaw:WC,encodeNumeric:h0,encodeNamed:Lv,getEncodeFunc:(n,i)=>{const c=Yp(i)||mh,m=(x,M)=>x.replace(M?rm:$d,L=>Id[L]!==void 0?Id[L]:c[L]!==void 0?c[L]:L.length>1?"&#"+((L.charCodeAt(0)-55296)*1024+(L.charCodeAt(1)-56320)+65536)+";":"&#"+L.charCodeAt(0)+";"),p=(x,M)=>Lv(x,M,c),y=Ty(n.replace(/\+/g,","));return y.named&&y.numeric?m:y.named?i?p:Lv:y.numeric?h0:ep},decode:n=>n.replace(Si,(i,c)=>c?(c.charAt(0).toLowerCase()==="x"?c=parseInt(c.substr(1),16):c=parseInt(c,10),c>65535?(c-=65536,String.fromCharCode(55296+(c>>10),56320+(c&1023))):Nd[c]||String.fromCharCode(c)):uu[i]||mh[i]||Qs(i))},Al=(n,i)=>(n=hn.trim(n),n?n.split(i||" "):[]),Ay=n=>new RegExp("^"+n.replace(/([?+*])/g,".$1")+"$"),ro=n=>{const i=/^(~)?(.+)$/;return Rs(Al(n,","),c=>{const m=i.exec(c);if(m){const p=m[1]==="~",y=p?"span":"div",x=m[2];return[{inline:p,cloneName:y,name:x}]}else return[]})},Dy=n=>{let i,c,m,p;if(i="id accesskey class dir lang style tabindex title role",c="address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul",m="a abbr b bdo br button cite code del dfn em embed i iframe img input ins kbd label map noscript object q s samp script select small span strong sub sup textarea u var #text #comment",n!=="html4"){const y="a ins del canvas map";i+=" contenteditable contextmenu draggable dropzone hidden spellcheck translate",c+=" article aside details dialog figure main header footer hgroup section nav "+y,m+=" audio canvas command datalist mark meter output picture progress time wbr video ruby bdi keygen"}return n!=="html5-strict"&&(i+=" xml:lang",m=[m,"acronym applet basefont big font strike tt"].join(" "),c=[c,"center dir isindex noframes"].join(" "),p=[c,m].join(" ")),p=p||[c,m].join(" "),{globalAttributes:i,blockContent:c,phrasingContent:m,flowContent:p}},UC=n=>{const{globalAttributes:i,phrasingContent:c,flowContent:m}=Dy(n),p={},y=(M,L="",q="")=>{const ae=Al(q),fe=Al(M);let be=fe.length;for(;be--;){const Le=Al([i,L].join(" "));p[fe[be]]={attributes:ur(Le,We({})),attributesOrder:Le,children:ur(ae,We({}))}}},x=(M,L)=>{const q=Al(M),ae=Al(L);let fe=q.length;for(;fe--;){const be=p[q[fe]];for(let Le=0,Ye=ae.length;Le{y(q,"",c)}),Ie(Al("center dir isindex noframes"),q=>{y(q,"",m)})),y("html","manifest","head body"),y("head","","base command link meta noscript script style title"),y("title hr noscript br"),y("base","href target"),y("link","href rel media hreflang type sizes hreflang"),y("meta","name http-equiv content charset"),y("style","media type scoped"),y("script","src async defer type charset"),y("body","onafterprint onbeforeprint onbeforeunload onblur onerror onfocus onhashchange onload onmessage onoffline ononline onpagehide onpageshow onpopstate onresize onscroll onstorage onunload",m),y("dd div","",m),y("address dt caption","",n==="html4"?c:m),y("h1 h2 h3 h4 h5 h6 pre p abbr code var samp kbd sub sup i b u bdo span legend em strong small s cite dfn","",c),y("blockquote","cite",m),y("ol","reversed start type","li"),y("ul","","li"),y("li","value",m),y("dl","","dt dd"),y("a","href target rel media hreflang type",n==="html4"?c:m),y("q","cite",c),y("ins del","cite datetime",m),y("img","src sizes srcset alt usemap ismap width height"),y("iframe","src name width height",m),y("embed","src type width height"),y("object","data type typemustmatch name usemap form width height",[m,"param"].join(" ")),y("param","name value"),y("map","name",[m,"area"].join(" ")),y("area","alt coords shape href target rel media hreflang type"),y("table","border","caption colgroup thead tfoot tbody tr"+(n==="html4"?" col":"")),y("colgroup","span","col"),y("col","span"),y("tbody thead tfoot","","tr"),y("tr","","td th"),y("td","colspan rowspan headers",m),y("th","colspan rowspan headers scope abbr",m),y("form","accept-charset action autocomplete enctype method name novalidate target",m),y("fieldset","disabled form name",[m,"legend"].join(" ")),y("label","form for",c),y("input","accept alt autocomplete checked dirname disabled form formaction formenctype formmethod formnovalidate formtarget height list max maxlength min multiple name pattern readonly required size src step type value width"),y("button","disabled form formaction formenctype formmethod formnovalidate formtarget name type value",n==="html4"?m:c),y("select","disabled form multiple name required size","option optgroup"),y("optgroup","disabled label","option"),y("option","disabled label selected value"),y("textarea","cols dirname disabled form maxlength name readonly required rows wrap"),y("menu","type label",[m,"li"].join(" ")),y("noscript","",m),n!=="html4"&&(y("wbr"),y("ruby","",[c,"rt rp"].join(" ")),y("figcaption","",m),y("mark rt rp summary bdi","",c),y("canvas","width height",m),y("video","src crossorigin poster preload autoplay mediagroup loop muted controls width height buffered",[m,"track source"].join(" ")),y("audio","src crossorigin preload autoplay mediagroup loop muted controls buffered volume",[m,"track source"].join(" ")),y("picture","","img source"),y("source","src srcset type media sizes"),y("track","kind src srclang label default"),y("datalist","",[c,"option"].join(" ")),y("article section nav aside main header footer","",m),y("hgroup","","h1 h2 h3 h4 h5 h6"),y("figure","",[m,"figcaption"].join(" ")),y("time","datetime",c),y("dialog","open",m),y("command","type label icon disabled checked radiogroup command"),y("output","for form name",c),y("progress","value max",c),y("meter","value min max low high optimum",c),y("details","open",[m,"summary"].join(" ")),y("keygen","autofocus challenge disabled form keytype name")),n!=="html5-strict"&&(x("script","language xml:space"),x("style","xml:space"),x("object","declare classid code codebase codetype archive standby align border hspace vspace"),x("embed","align name hspace vspace"),x("param","valuetype type"),x("a","charset name rev shape coords"),x("br","clear"),x("applet","codebase archive code object alt name width height align hspace vspace"),x("img","name longdesc align border hspace vspace"),x("iframe","longdesc frameborder marginwidth marginheight scrolling align"),x("font basefont","size color face"),x("input","usemap align"),x("select"),x("textarea"),x("h1 h2 h3 h4 h5 h6 div p legend caption","align"),x("ul","type compact"),x("li","type"),x("ol dl menu dir","compact"),x("pre","width xml:space"),x("hr","align noshade size width"),x("isindex","prompt"),x("table","summary width frame rules cellspacing cellpadding align bgcolor"),x("col","width align char charoff valign"),x("colgroup","width align char charoff valign"),x("thead","align char charoff valign"),x("tr","align char charoff valign bgcolor"),x("th","axis align char charoff valign nowrap bgcolor width height"),x("form","accept"),x("td","abbr axis scope align char charoff valign nowrap bgcolor width height"),x("tfoot","align char charoff valign"),x("tbody","align char charoff valign"),x("area","nohref"),x("body","background bgcolor text link vlink alink")),n!=="html4"&&(x("input button select textarea","autofocus"),x("input textarea","placeholder"),x("a","download"),x("link script img","crossorigin"),x("img","loading"),x("iframe","sandbox seamless allow allowfullscreen loading")),n!=="html4"&&Ie([p.video,p.audio],M=>{delete M.children.audio,delete M.children.video}),Ie(Al("a form meter progress dfn"),M=>{p[M]&&delete p[M].children[M]}),delete p.caption.children.table,delete p.script,p},Py=n=>n==="-"?"remove":"add",im=n=>{const i=/^([+\-]?)([A-Za-z0-9_\-.\u00b7\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u037d\u037f-\u1fff\u200c-\u200d\u203f-\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]+)\[([^\]]+)]$/;return Rs(Al(n,","),c=>{const m=i.exec(c);if(m){const p=m[1],y=p?Py(p):"replace",x=m[2],M=Al(m[3],"|");return[{operation:y,name:x,validChildren:M}]}else return[]})},of=(n,i)=>{const c=/^([!\-])?(\w+[\\:]:\w+|[^=~<]+)?(?:([=~<])(.*))?$/,m=/[*?+]/,{attributes:p,attributesOrder:y}=i;return Ie(Al(n,"|"),x=>{const M=c.exec(x);if(M){const L={},q=M[1],ae=M[2].replace(/[\\:]:/g,":"),fe=M[3],be=M[4];if(q==="!"&&(i.attributesRequired=i.attributesRequired||[],i.attributesRequired.push(ae),L.required=!0),q==="-"){delete p[ae],y.splice(hn.inArray(y,ae),1);return}if(fe&&(fe==="="?(i.attributesDefault=i.attributesDefault||[],i.attributesDefault.push({name:ae,value:be}),L.defaultValue=be):fe==="~"?(i.attributesForced=i.attributesForced||[],i.attributesForced.push({name:ae,value:be}),L.forcedValue=be):fe==="<"&&(L.validValues=hn.makeMap(be,"?"))),m.test(ae)){const Le=L;i.attributePatterns=i.attributePatterns||[],Le.pattern=Ay(ae),i.attributePatterns.push(Le)}else p[ae]||y.push(ae),p[ae]=L}})},gh=(n,i)=>{ln(n.attributes,(c,m)=>{i.attributes[m]=c}),i.attributesOrder.push(...n.attributesOrder)},np=(n,i)=>{const c=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)])?$/;return Rs(Al(i,","),m=>{const p=c.exec(m);if(p){const y=p[1],x=p[2],M=p[3],L=p[4],q=p[5],ae={attributes:{},attributesOrder:[]};if(n.each(fe=>gh(fe,ae)),y==="#"?ae.paddEmpty=!0:y==="-"&&(ae.removeEmpty=!0),L==="!"&&(ae.removeEmptyAttrs=!0),q&&of(q,ae),M&&(ae.outputName=x),x==="@")if(n.isNone())n=he.some(ae);else return[];return[M?{name:x,element:ae,aliasName:M}:{name:x,element:ae}]}else return[]})},ph={},m0=hn.makeMap,$f=hn.each,op=hn.extend,My=hn.explode,Xp=(n,i={})=>{const c=m0(n," ",m0(n.toUpperCase()," "));return op(c,i)},td=n=>Xp("td th li dt dd figcaption caption details summary",n.getTextBlockElements()),Ry=(n,i)=>{if(n){const c={};return I(n)&&(n={"*":n}),$f(n,(m,p)=>{c[p]=c[p.toUpperCase()]=i==="map"?m0(m,/[, ]/):My(m,/[, ]/)}),c}else return},bh=(n={})=>{var i;const c={},m={};let p=[];const y={},x={},M=(co,Us,ci)=>{const Ka=n[co];if(Ka)return m0(Ka,/[, ]/,m0(Ka.toUpperCase(),/[, ]/));{let Ei=ph[co];return Ei||(Ei=Xp(Us,ci),ph[co]=Ei),Ei}},L=(i=n.schema)!==null&&i!==void 0?i:"html5",q=UC(L);n.verify_html===!1&&(n.valid_elements="*[*]");const ae=Ry(n.valid_styles),fe=Ry(n.invalid_styles,"map"),be=Ry(n.valid_classes,"map"),Le=M("whitespace_elements","pre script noscript style textarea video audio iframe object code"),Ye=M("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr"),Pe=M("void_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr track"),He=M("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls allowfullscreen"),dt="td th iframe video audio object script code",bt=M("non_empty_elements",dt+" pre",Pe),_t=M("move_caret_before_on_enter_elements",dt+" table",Pe),Mt=M("text_block_elements","h1 h2 h3 h4 h5 h6 p div address pre form blockquote center dir fieldset header footer article section hgroup aside main nav figure"),dn=M("block_elements","hr table tbody thead tfoot th tr td li ol ul caption dl dt dd noscript menu isindex option datalist select optgroup figcaption details summary",Mt),zn=M("text_inline_elements","span strong b em i font s strike u var cite dfn code mark q sup sub samp"),Nn=M("transparent_elements","a ins del canvas map");$f("script noscript iframe noframes noembed title style textarea xmp plaintext".split(" "),co=>{x[co]=new RegExp("]*>","gi")});const Lt=co=>{const Us=he.from(c["@"]),ci=/[*?+]/;Ie(np(Us,co!=null?co:""),({name:Ka,element:Ei,aliasName:Pc})=>{if(Pc&&(c[Pc]=Ei),ci.test(Ka)){const Ih=Ei;Ih.pattern=Ay(Ka),p.push(Ih)}else c[Ka]=Ei})},Zt=co=>{p=[],Ie(bs(c),Us=>{delete c[Us]}),Lt(co)},yn=co=>{delete ph.text_block_elements,delete ph.block_elements,Ie(ro(co!=null?co:""),({inline:Us,name:ci,cloneName:Ka})=>{if(m[ci]=m[Ka],y[ci]=Ka,bt[ci.toUpperCase()]={},bt[ci]={},Us||(dn[ci.toUpperCase()]={},dn[ci]={}),!c[ci]){let Ei=c[Ka];Ei=op({},Ei),delete Ei.removeEmptyAttrs,delete Ei.removeEmpty,c[ci]=Ei}ln(m,(Ei,Pc)=>{Ei[Ka]&&(m[Pc]=Ei=op({},m[Pc]),Ei[ci]=Ei[Ka])})})},go=co=>{Ie(im(co!=null?co:""),({operation:Us,name:ci,validChildren:Ka})=>{const Ei=Us==="replace"?{"#comment":{}}:m[ci];Ie(Ka,Pc=>{Us==="remove"?delete Ei[Pc]:Ei[Pc]={}}),m[ci]=Ei})},Po=co=>{const Us=c[co];if(Us)return Us;let ci=p.length;for(;ci--;){const Ka=p[ci];if(Ka.pattern.test(co))return Ka}};n.valid_elements?(Zt(n.valid_elements),$f(q,(co,Us)=>{m[Us]=co.children})):($f(q,(co,Us)=>{c[Us]={attributes:co.attributes,attributesOrder:co.attributesOrder},m[Us]=co.children}),$f(Al("strong/b em/i"),co=>{const Us=Al(co,"/");c[Us[1]].outputName=Us[0]}),$f(zn,(co,Us)=>{c[Us]&&(n.padd_empty_block_inline_children&&(c[Us].paddInEmptyBlock=!0),c[Us].removeEmpty=!0)}),$f(Al("ol ul blockquote a table tbody"),co=>{c[co]&&(c[co].removeEmpty=!0)}),$f(Al("p h1 h2 h3 h4 h5 h6 th td pre div address caption li summary"),co=>{c[co]&&(c[co].paddEmpty=!0)}),$f(Al("span"),co=>{c[co].removeEmptyAttrs=!0})),yn(n.custom_elements),go(n.valid_children),Lt(n.extended_valid_elements),go("+ol[ul|ol],+ul[ul|ol]"),$f({dd:"dl",dt:"dl",li:"ul ol",td:"tr",th:"tr",tr:"tbody thead tfoot",tbody:"table",thead:"table",tfoot:"table",legend:"fieldset",area:"map",param:"video audio object"},(co,Us)=>{c[Us]&&(c[Us].parentsRequired=Al(co))}),n.invalid_elements&&$f(My(n.invalid_elements),co=>{c[co]&&delete c[co]}),Po("span")||Lt("span[!data-mce-type|*]");const Cs=We(ae),Ws=We(fe),Ir=We(be),pi=We(He),ul=We(dn),Il=We(Mt),bc=We(zn),Mn=We(Object.seal(Pe)),eo=We(Ye),Cr=We(bt),Is=We(_t),ko=We(Le),Rn=We(Nn),Tn=We(Object.seal(x)),jo=(co,Us)=>{const ci=m[co.toLowerCase()];return!!(ci&&ci[Us.toLowerCase()])},Ks=(co,Us)=>{const ci=Po(co);if(ci)if(Us){if(ci.attributes[Us])return!0;const Ka=ci.attributePatterns;if(Ka){let Ei=Ka.length;for(;Ei--;)if(Ka[Ei].pattern.test(Us))return!0}}else return!0;return!1},Kr=We(y);return{type:L,children:m,elements:c,getValidStyles:Cs,getValidClasses:Ir,getBlockElements:ul,getInvalidStyles:Ws,getVoidElements:Mn,getTextBlockElements:Il,getTextInlineElements:bc,getBoolAttrs:pi,getElementRule:Po,getSelfClosingElements:eo,getNonEmptyElements:Cr,getMoveCaretBeforeOnEnterElements:Is,getWhitespaceElements:ko,getTransparentElements:Rn,getSpecialElements:Tn,isValidChild:jo,isValid:Ks,getCustomElements:Kr,addValidElements:Lt,setValidElements:Zt,addCustomElements:yn,addValidChildren:go}},Fv=(n={},i)=>{const c=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,m=/\s*([^:]+):\s*([^;]+);?/g,p=/\s+$/,y={};let x,M;const L=nn;i&&(x=i.getValidStyles(),M=i.getInvalidStyles());const q=(`\\" \\' \\; \\: ; : `+L).split(" ");for(let fe=0;fe{const be={};let Le=!1;const Ye=n.url_converter,Pe=n.url_converter_scope||ae,He=(Lt,Zt,yn)=>{const go=be[Lt+"-top"+Zt];if(!go)return;const Po=be[Lt+"-right"+Zt];if(!Po)return;const Cs=be[Lt+"-bottom"+Zt];if(!Cs)return;const Ws=be[Lt+"-left"+Zt];if(!Ws)return;const Ir=[go,Po,Cs,Ws];let pi=Ir.length-1;for(;pi--&&Ir[pi]===Ir[pi+1];);pi>-1&&yn||(be[Lt+Zt]=pi===-1?Ir[0]:Ir.join(" "),delete be[Lt+"-top"+Zt],delete be[Lt+"-right"+Zt],delete be[Lt+"-bottom"+Zt],delete be[Lt+"-left"+Zt])},dt=Lt=>{const Zt=be[Lt];if(!Zt)return;const yn=Zt.indexOf(",")>-1?[Zt]:Zt.split(" ");let go=yn.length;for(;go--;)if(yn[go]!==yn[0])return!1;return be[Lt]=yn[0],!0},bt=(Lt,Zt,yn,go)=>{!dt(Zt)||!dt(yn)||!dt(go)||(be[Lt]=be[Zt]+" "+be[yn]+" "+be[go],delete be[Zt],delete be[yn],delete be[go])},_t=Lt=>(Le=!0,y[Lt]),Mt=(Lt,Zt)=>(Le&&(Lt=Lt.replace(/\uFEFF[0-9]/g,yn=>y[yn])),Zt||(Lt=Lt.replace(/\\([\'\";:])/g,"$1")),Lt),dn=Lt=>String.fromCharCode(parseInt(Lt.slice(1),16)),zn=Lt=>Lt.replace(/\\[0-9a-f]+/gi,dn),Nn=(Lt,Zt,yn,go,Po,Cs)=>{if(Po=Po||Cs,Po)return Po=Mt(Po),"'"+Po.replace(/\'/g,"\\'")+"'";if(Zt=Mt(Zt||yn||go||""),!n.allow_script_urls){const Ws=Zt.replace(/[\s\r\n]+/g,"");if(/(java|vb)script:/i.test(Ws)||!n.allow_svg_data_urls&&/^data:image\/svg/i.test(Ws))return""}return Ye&&(Zt=Ye.call(Pe,Zt,"style")),"url('"+Zt.replace(/\'/g,"\\'")+"')"};if(fe){fe=fe.replace(/[\u0000-\u001F]/g,""),fe=fe.replace(/\\[\"\';:\uFEFF]/g,_t).replace(/\"[^\"]+\"|\'[^\']+\'/g,Zt=>Zt.replace(/[;:]/g,_t));let Lt;for(;Lt=m.exec(fe);){m.lastIndex=Lt.index+Lt[0].length;let Zt=Lt[1].replace(p,"").toLowerCase(),yn=Lt[2].replace(p,"");if(Zt&&yn){if(Zt=zn(Zt),yn=zn(yn),Zt.indexOf(L)!==-1||Zt.indexOf('"')!==-1||!n.allow_script_urls&&(Zt==="behavior"||/expression\s*\(|\/\*|\*\//.test(yn)))continue;Zt==="font-weight"&&yn==="700"?yn="bold":(Zt==="color"||Zt==="background-color")&&(yn=yn.toLowerCase()),yn=yn.replace(c,Nn),be[Zt]=Le?Mt(yn,!0):yn}}He("border","",!0),He("border","-width"),He("border","-color"),He("border","-style"),He("padding",""),He("margin",""),bt("border","border-width","border-style","border-color"),be.border==="medium none"&&delete be.border,be["border-image"]==="none"&&delete be["border-image"]}return be},serialize:(fe,be)=>{let Le="";const Ye=(He,dt)=>{const bt=dt[He];if(bt)for(let _t=0,Mt=bt.length;_t0?" ":"")+dn+": "+zn+";")}},Pe=(He,dt)=>{if(!M||!dt)return!0;let bt=M["*"];return bt&&bt[He]?!1:(bt=M[dt],!(bt&&bt[He]))};return be&&x?(Ye("*",x),Ye(be,x)):ln(fe,(He,dt)=>{He&&Pe(dt,be)&&(Le+=(Le.length>0?" ":"")+dt+": "+He+";")}),Le}};return ae},t_={keyLocation:!0,layerX:!0,layerY:!0,returnValue:!0,webkitMovementX:!0,webkitMovementY:!0,keyIdentifier:!0,mozPressure:!0},$y=n=>n instanceof Event||ue(n.initEvent),sp=n=>n.isDefaultPrevented===wt||n.isDefaultPrevented===Xe,Nf=n=>Ae(n.preventDefault)||$y(n),fu=(n,i)=>{const c=i!=null?i:{};for(const m in n)un(t_,m)||(c[m]=n[m]);return Oe(n.composedPath)&&(c.composedPath=()=>n.composedPath()),c},rp=(n,i,c,m)=>{var p;const y=fu(i,m);return y.type=n,Ae(y.target)&&(y.target=(p=y.srcElement)!==null&&p!==void 0?p:c),Nf(i)&&(y.preventDefault=()=>{y.defaultPrevented=!0,y.isDefaultPrevented=wt,ue(i.preventDefault)&&i.preventDefault()},y.stopPropagation=()=>{y.cancelBubble=!0,y.isPropagationStopped=wt,ue(i.stopPropagation)&&i.stopPropagation()},y.stopImmediatePropagation=()=>{y.isImmediatePropagationStopped=wt,y.stopPropagation()},sp(y)||(y.isDefaultPrevented=y.defaultPrevented===!0?wt:Xe,y.isPropagationStopped=y.cancelBubble===!0?wt:Xe,y.isImmediatePropagationStopped=Xe)),y},Ny="mce-data-",n_=/^(?:mouse|contextmenu)|click/,g0=(n,i,c,m)=>{n.addEventListener(i,c,m||!1)},Vc=(n,i,c,m)=>{n.removeEventListener(i,c,m||!1)},p0=n=>Oe(n)&&n_.test(n.type),sf=(n,i)=>{const c=rp(n.type,n,document,i);if(p0(n)&&Se(n.pageX)&&!Se(n.clientX)){const m=c.target.ownerDocument||document,p=m.documentElement,y=m.body,x=c;x.pageX=n.clientX+(p&&p.scrollLeft||y&&y.scrollLeft||0)-(p&&p.clientLeft||y&&y.clientLeft||0),x.pageY=n.clientY+(p&&p.scrollTop||y&&y.scrollTop||0)-(p&&p.clientTop||y&&y.clientTop||0)}return c},ip=(n,i,c)=>{const m=n.document,p={type:"ready"};if(c.domLoaded){i(p);return}const y=()=>m.readyState==="complete"||m.readyState==="interactive"&&m.body,x=()=>{Vc(n,"DOMContentLoaded",x),Vc(n,"load",x),c.domLoaded||(c.domLoaded=!0,i(p)),n=null};y()?x():g0(n,"DOMContentLoaded",x),c.domLoaded||g0(n,"load",x)};class am{constructor(){this.domLoaded=!1,this.events={},this.count=1,this.expando=Ny+(+new Date).toString(32),this.hasFocusIn="onfocusin"in document.documentElement,this.count=1}bind(i,c,m,p){const y=this;let x;const M=window,L=be=>{y.executeHandlers(sf(be||M.event),q)};if(!i||Sn(i)||ih(i))return m;let q;i[y.expando]?q=i[y.expando]:(q=y.count++,i[y.expando]=q,y.events[q]={}),p=p||i;const ae=c.split(" ");let fe=ae.length;for(;fe--;){let be=ae[fe],Le=L,Ye=!1,Pe=!1;if(be==="DOMContentLoaded"&&(be="ready"),y.domLoaded&&be==="ready"&&i.readyState==="complete"){m.call(p,sf({type:be}));continue}!y.hasFocusIn&&(be==="focusin"||be==="focusout")&&(Ye=!0,Pe=be==="focusin"?"focus":"blur",Le=He=>{const dt=sf(He||M.event);dt.type=dt.type==="focus"?"focusin":"focusout",y.executeHandlers(dt,q)}),x=y.events[q][be],x?be==="ready"&&y.domLoaded?m(sf({type:be})):x.push({func:m,scope:p}):(y.events[q][be]=x=[{func:m,scope:p}],x.fakeName=Pe,x.capture=Ye,x.nativeHandler=Le,be==="ready"?ip(i,Le,y):g0(i,Pe||be,Le,Ye))}return i=x=null,m}unbind(i,c,m){if(!i||Sn(i)||ih(i))return this;const p=i[this.expando];if(p){let y=this.events[p];if(c){const x=c.split(" ");let M=x.length;for(;M--;){const L=x[M],q=y[L];if(q){if(m){let ae=q.length;for(;ae--;)if(q[ae].func===m){const fe=q.nativeHandler,be=q.fakeName,Le=q.capture,Ye=q.slice(0,ae).concat(q.slice(ae+1));Ye.nativeHandler=fe,Ye.fakeName=be,Ye.capture=Le,y[L]=Ye}}(!m||q.length===0)&&(delete y[L],Vc(i,q.fakeName||L,q.nativeHandler,q.capture))}}}else ln(y,(x,M)=>{Vc(i,x.fakeName||M,x.nativeHandler,x.capture)}),y={};for(const x in y)if(un(y,x))return this;delete this.events[p];try{delete i[this.expando]}catch{i[this.expando]=null}}return this}fire(i,c,m){return this.dispatch(i,c,m)}dispatch(i,c,m){if(!i||Sn(i)||ih(i))return this;const p=sf({type:c,target:i},m);do{const y=i[this.expando];y&&this.executeHandlers(p,y),i=i.parentNode||i.ownerDocument||i.defaultView||i.parentWindow}while(i&&!p.isPropagationStopped());return this}clean(i){if(!i||Sn(i)||ih(i))return this;if(i[this.expando]&&this.unbind(i),i.getElementsByTagName||(i=i.document),i&&i.getElementsByTagName){this.unbind(i);const c=i.getElementsByTagName("*");let m=c.length;for(;m--;)i=c[m],i[this.expando]&&this.unbind(i)}return this}destroy(){this.events={}}cancel(i){return i&&(i.preventDefault(),i.stopImmediatePropagation()),!1}executeHandlers(i,c){const m=this.events[c],p=m&&m[i.type];if(p)for(let y=0,x=p.length;y{Ae(c)||c===""?Vi(n,i):Pr(n,i,c)},b0=n=>n.replace(/[A-Z]/g,i=>"-"+i.toLowerCase()),nb=(n,i)=>{let c=0;if(n)for(let m=n.nodeType,p=n.previousSibling;p;p=p.previousSibling){const y=p.nodeType;i&&Sn(p)&&(y===m||!p.data.length)||(c++,m=y)}return c},By=(n,i)=>{const c=Ll(i,"style"),m=n.serialize(n.parse(c),ei(i));ap(i,jp,m)},Ly=(n,i)=>rt(n)?un(Iy,i)?n+"":n+"px":n,s_=(n,i,c)=>{const m=b0(i);Ae(c)||c===""?Vm(n,m):ql(n,m,Ly(c,m))},YC=(n,i,c)=>{const m=i.keep_values,p={set:(x,M,L)=>{const q=Ge.fromDom(x);ue(i.url_converter)&&Oe(M)&&(M=i.url_converter.call(i.url_converter_scope||c(),String(M),L,x));const ae="data-mce-"+L;ap(q,ae,M),ap(q,L,M)},get:(x,M)=>{const L=Ge.fromDom(x);return Ll(L,"data-mce-"+M)||Ll(L,M)}},y={style:{set:(x,M)=>{const L=Ge.fromDom(x);m&&ap(L,jp,M),Vi(L,"style"),I(M)&&ua(L,n.parse(M))},get:x=>{const M=Ge.fromDom(x),L=Ll(M,jp)||Ll(M,"style");return n.serialize(n.parse(L),ei(M))}}};return m&&(y.href=y.src=p),y},Qr=(n,i={})=>{const c={},m=window,p={};let y=0;const x=!0,M=!0,L=Bv.forElement(Ge.fromDom(n),{contentCssCors:i.contentCssCors,referrerPolicy:i.referrerPolicy}),q=[],ae=i.schema?i.schema:bh({}),fe=Fv({url_converter:i.url_converter,url_converter_scope:i.url_converter_scope},i.schema),be=i.ownEvents?new am:am.Event,Le=ae.getBlockElements(),Ye=Rt=>I(Rt)?un(Le,Rt):Jn(Rt)&&(un(Le,Rt.nodeName)||sg(ae,Rt)),Pe=Rt=>Rt&&n&&I(Rt)?n.getElementById(Rt):Rt,He=Rt=>{const $t=Pe(Rt);return Oe($t)?Ge.fromDom($t):null},dt=(Rt,$t,$n="")=>{let xn;const Io=He(Rt);if(Oe(Io)&&kl(Io)){const br=Mw[$t];br&&br.get?xn=br.get(Io.dom,$t):xn=Ll(Io,$t)}return Oe(xn)?xn:$n},bt=Rt=>{const $t=Pe(Rt);return Ae($t)?[]:$t.attributes},_t=(Rt,$t,$n)=>{eo(Rt,xn=>{if(Jn(xn)){const Io=Ge.fromDom(xn),br=$n===""?null:$n,ha=Ll(Io,$t),Mc=Mw[$t];Mc&&Mc.set?Mc.set(Io.dom,br,$t):ap(Io,$t,br),ha!==br&&i.onSetAttrib&&i.onSetAttrib({attrElm:Io.dom,attrName:$t,attrValue:br})}})},Mt=(Rt,$t)=>Rt.cloneNode($t),dn=()=>i.root_element||n.body,zn=Rt=>{const $t=Kf(Rt);return{x:$t.x,y:$t.y,w:$t.width,h:$t.height}},Nn=(Rt,$t)=>HC(n.body,Pe(Rt),$t),Lt=(Rt,$t,$n)=>{eo(Rt,xn=>{const Io=Ge.fromDom(xn);s_(Io,$t,$n),i.update_styles&&By(fe,Io)})},Zt=(Rt,$t)=>{eo(Rt,$n=>{const xn=Ge.fromDom($n);ln($t,(Io,br)=>{s_(xn,br,Io)}),i.update_styles&&By(fe,xn)})},yn=(Rt,$t,$n)=>{const xn=Pe(Rt);if(!(Ae(xn)||!Jn(xn)))return $n?Bi(Ge.fromDom(xn),b0($t)):($t=$t.replace(/-(\D)/g,(Io,br)=>br.toUpperCase()),$t==="float"&&($t="cssFloat"),xn.style?xn.style[$t]:void 0)},go=Rt=>{const $t=Pe(Rt);if(!$t)return{w:0,h:0};let $n=yn($t,"width"),xn=yn($t,"height");return(!$n||$n.indexOf("px")===-1)&&($n="0"),(!xn||xn.indexOf("px")===-1)&&(xn="0"),{w:parseInt($n,10)||$t.offsetWidth||$t.clientWidth,h:parseInt(xn,10)||$t.offsetHeight||$t.clientHeight}},Po=Rt=>{const $t=Pe(Rt),$n=Nn($t),xn=go($t);return{x:$n.x,y:$n.y,w:xn.w,h:xn.h}},Cs=(Rt,$t)=>{if(!Rt)return!1;const $n=ne(Rt)?Rt:[Rt];return Wt($n,xn=>Eu(Ge.fromDom(xn),$t))},Ws=(Rt,$t,$n,xn)=>{const Io=[];let br=Pe(Rt);xn=xn===void 0;const ha=$n||(dn().nodeName!=="BODY"?dn().parentNode:null);if(I($t))if($t==="*")$t=Jn;else{const Mc=$t;$t=Ou=>Cs(Ou,Mc)}for(;br&&!(br===ha||Ae(br.nodeType)||Ju(br)||q1(br));){if(!$t||$t(br))if(xn)Io.push(br);else return[br];br=br.parentNode}return xn?Io:null},Ir=(Rt,$t,$n)=>{const xn=Ws(Rt,$t,$n,!1);return xn&&xn.length>0?xn[0]:null},pi=(Rt,$t,$n)=>{let xn=$t;if(Rt){I($t)&&(xn=Io=>Cs(Io,$t));for(let Io=Rt[$n];Io;Io=Io[$n])if(ue(xn)&&xn(Io))return Io}return null},ul=(Rt,$t)=>pi(Rt,$t,"nextSibling"),Il=(Rt,$t)=>pi(Rt,$t,"previousSibling"),bc=Rt=>ue(Rt.querySelectorAll),Mn=(Rt,$t)=>{var $n,xn;const Io=(xn=($n=Pe($t))!==null&&$n!==void 0?$n:i.root_element)!==null&&xn!==void 0?xn:n;return bc(Io)?Rr(Io.querySelectorAll(Rt)):[]},eo=function(Rt,$t,$n){const xn=$n!=null?$n:this;if(ne(Rt)){const Io=[];return Qv(Rt,(br,ha)=>{const Mc=Pe(br);Mc&&Io.push($t.call(xn,Mc,ha))}),Io}else{const Io=Pe(Rt);return Io?$t.call(xn,Io):!1}},Cr=(Rt,$t)=>{eo(Rt,$n=>{ln($t,(xn,Io)=>{_t($n,Io,xn)})})},Is=(Rt,$t)=>{eo(Rt,$n=>{const xn=Ge.fromDom($n);Tf(xn,$t)})},ko=(Rt,$t,$n,xn,Io)=>eo(Rt,br=>{const ha=I($t)?n.createElement($t):$t;return Oe($n)&&Cr(ha,$n),xn&&(!I(xn)&&xn.nodeType?ha.appendChild(xn):I(xn)&&Is(ha,xn)),Io?ha:br.appendChild(ha)}),Rn=(Rt,$t,$n)=>ko(n.createElement(Rt),Rt,$t,$n,!0),Tn=tp.decode,jo=tp.encodeAllRaw,Ks=(Rt,$t,$n="")=>{let xn="<"+Rt;for(const Io in $t)os($t,Io)&&(xn+=" "+Io+'="'+jo($t[Io])+'"');return nl($n)&&un(ae.getVoidElements(),Rt)?xn+" />":xn+">"+$n+""},Kr=Rt=>{const $t=n.createElement("div"),$n=n.createDocumentFragment();$n.appendChild($t),Rt&&($t.innerHTML=Rt);let xn;for(;xn=$t.firstChild;)$n.appendChild(xn);return $n.removeChild($t),$n},co=(Rt,$t)=>eo(Rt,$n=>{const xn=Ge.fromDom($n);return $t&&Ie(Da(xn),Io=>{ol(Io)&&Io.dom.length===0?wr(Io):Ca(xn,Io)}),wr(xn),xn.dom}),Us=Rt=>eo(Rt,$t=>{const $n=$t.attributes;for(let xn=$n.length-1;xn>=0;xn--)$t.removeAttributeNode($n.item(xn))}),ci=Rt=>fe.parse(Rt),Ka=(Rt,$t)=>fe.serialize(Rt,$t),Ei=Rt=>{if(x1!==Qr.DOM&&n===document){if(c[Rt])return;c[Rt]=!0}let $t=n.getElementById("mceDefaultStyles");if(!$t){$t=n.createElement("style"),$t.id="mceDefaultStyles",$t.type="text/css";const $n=n.head;$n.firstChild?$n.insertBefore($t,$n.firstChild):$n.appendChild($t)}$t.styleSheet?$t.styleSheet.cssText+=Rt:$t.appendChild(n.createTextNode(Rt))},Pc=Rt=>{Rt||(Rt=""),Ie(Rt.split(","),$t=>{p[$t]=!0,L.load($t).catch(St)})},Ih=(Rt,$t,$n)=>{eo(Rt,xn=>{if(Jn(xn)){const Io=Ge.fromDom(xn),br=$t.split(" ");Ie(br,ha=>{Oe($n)?($n?qu:Qc)(Io,ha):jh(Io,ha)})}})},Yd=(Rt,$t)=>{Ih(Rt,$t,!0)},Tm=(Rt,$t)=>{Ih(Rt,$t,!1)},jO=(Rt,$t)=>{const $n=He(Rt),xn=$t.split(" ");return Oe($n)&&er(xn,Io=>Ef($n,Io))},Dw=Rt=>{eo(Rt,$t=>Vm(Ge.fromDom($t),"display"))},qO=Rt=>{eo(Rt,$t=>ql(Ge.fromDom($t),"display","none"))},GO=Rt=>{const $t=He(Rt);return Oe($t)&&qr(Pa($t,"display"),"none")},B4=Rt=>(Rt||"mce_")+y++,L4=Rt=>{const $t=He(Rt);return Oe($t)?Jn($t.dom)?$t.dom.outerHTML:Wg($t):""},F4=(Rt,$t)=>{eo(Rt,$n=>{Jn($n)&&($n.outerHTML=$t)})},BE=(Rt,$t)=>{const $n=Pe($t);return eo(Rt,xn=>{const Io=$n==null?void 0:$n.parentNode,br=$n==null?void 0:$n.nextSibling;return Io&&(br?Io.insertBefore(xn,br):Io.appendChild(xn)),xn})},LE=(Rt,$t,$n)=>eo($t,xn=>{var Io;const br=ne($t)?Rt.cloneNode(!0):Rt;return $n&&Qv(o_(xn.childNodes),ha=>{br.appendChild(ha)}),(Io=xn.parentNode)===null||Io===void 0||Io.replaceChild(br,xn),xn}),FE=(Rt,$t)=>{if(Rt.nodeName!==$t.toUpperCase()){const $n=Rn($t);return Qv(bt(Rt),xn=>{_t($n,xn.nodeName,dt(Rt,xn.nodeName))}),LE($n,Rt,!0),$n}else return Rt},lC=(Rt,$t)=>{let $n=Rt;for(;$n;){let xn=$t;for(;xn&&$n!==xn;)xn=xn.parentNode;if($n===xn)break;$n=$n.parentNode}return!$n&&Rt.ownerDocument?Rt.ownerDocument.documentElement:$n},k1=Rt=>{if(Jn(Rt)){const $t=Rt.nodeName.toLowerCase()==="a"&&!dt(Rt,"href")&&dt(Rt,"id");if(dt(Rt,"name")||dt(Rt,"data-mce-bookmark")||$t)return!0}return!1},cC=(Rt,$t,$n)=>{let xn=0;if(k1(Rt))return!1;const Io=Rt.firstChild;if(Io){const br=new wi(Io,Rt),ha=ae?ae.getWhitespaceElements():{},Mc=$t||(ae?ae.getNonEmptyElements():null);let Ou=Io;do{if(Jn(Ou)){const WE=Ou.getAttribute("data-mce-bogus");if(WE){Ou=br.next(WE==="all");continue}const UE=Ou.nodeName.toLowerCase();if(Mc&&Mc[UE]){if(UE==="br"){xn++,Ou=br.next();continue}return!1}if(k1(Ou))return!1}if(ih(Ou)||Sn(Ou)&&!Km(Ou.data)&&(!($n!=null&&$n.includeZwsp)||!qg(Ou.data))||Sn(Ou)&&Ou.parentNode&&ha[Ou.parentNode.nodeName]&&Km(Ou.data))return!1;Ou=br.next()}while(Ou)}return xn<=1},Pw=()=>n.createRange(),bv=(Rt,$t,$n)=>{let xn=Pw(),Io,br;if(Rt&&$t&&Rt.parentNode&&$t.parentNode){const ha=Rt.parentNode;return xn.setStart(ha,nb(Rt)),xn.setEnd($t.parentNode,nb($t)),Io=xn.extractContents(),xn=Pw(),xn.setStart($t.parentNode,nb($t)+1),xn.setEnd(ha,nb(Rt)+1),br=xn.extractContents(),ha.insertBefore(rg(x1,Io),Rt),$n?ha.insertBefore($n,Rt):ha.insertBefore($t,Rt),ha.insertBefore(rg(x1,br),Rt),co(Rt),$n||$t}else return},QE=(Rt,$t,$n,xn)=>{if(ne(Rt)){let Io=Rt.length;const br=[];for(;Io--;)br[Io]=QE(Rt[Io],$t,$n,xn);return br}else return i.collect&&(Rt===n||Rt===m)&&q.push([Rt,$t,$n,xn]),be.bind(Rt,$t,$n,xn||x1)},ZE=(Rt,$t,$n)=>{if(ne(Rt)){let xn=Rt.length;const Io=[];for(;xn--;)Io[xn]=ZE(Rt[xn],$t,$n);return Io}else{if(q.length>0&&(Rt===n||Rt===m)){let xn=q.length;for(;xn--;){const[Io,br,ha]=q[xn];Rt===Io&&(!$t||$t===br)&&(!$n||$n===ha)&&be.unbind(Io,br,ha)}}return be.unbind(Rt,$t,$n)}},$b=(Rt,$t,$n)=>be.dispatch(Rt,$t,$n),vv=(Rt,$t,$n)=>be.dispatch(Rt,$t,$n),zE=Rt=>{if(Rt&&Jn(Rt)){const $t=Rt.getAttribute("data-mce-contenteditable");return $t&&$t!=="inherit"?$t:Rt.contentEditable!=="inherit"?Rt.contentEditable:null}else return null},x1={doc:n,settings:i,win:m,files:p,stdMode:x,boxModel:M,styleSheetLoader:L,boundEvents:q,styles:fe,schema:ae,events:be,isBlock:Ye,root:null,clone:Mt,getRoot:dn,getViewPort:zn,getRect:Po,getSize:go,getParent:Ir,getParents:Ws,get:Pe,getNext:ul,getPrev:Il,select:Mn,is:Cs,add:ko,create:Rn,createHTML:Ks,createFragment:Kr,remove:co,setStyle:Lt,getStyle:yn,setStyles:Zt,removeAllAttribs:Us,setAttrib:_t,setAttribs:Cr,getAttrib:dt,getPos:Nn,parseStyle:ci,serializeStyle:Ka,addStyle:Ei,loadCSS:Pc,addClass:Yd,removeClass:Tm,hasClass:jO,toggleClass:Ih,show:Dw,hide:qO,isHidden:GO,uniqueId:B4,setHTML:Is,getOuterHTML:L4,setOuterHTML:F4,decode:Tn,encode:jo,insertAfter:BE,replace:LE,rename:FE,findCommonAncestor:lC,run:eo,getAttribs:bt,isEmpty:cC,createRng:Pw,nodeIndex:nb,split:bv,bind:QE,unbind:ZE,fire:vv,dispatch:$b,getContentEditable:zE,getContentEditableParent:Rt=>{const $t=dn();let $n=null;for(let xn=Rt;xn&&xn!==$t&&($n=zE(xn),$n===null);xn=xn.parentNode);return $n},isEditable:Rt=>{if(Oe(Rt)){const $t=Jn(Rt)?Rt:Rt.parentElement;return Oe($t)&&_n(Ge.fromDom($t))}else return!1},destroy:()=>{if(q.length>0){let Rt=q.length;for(;Rt--;){const[$t,$n,xn]=q[Rt];be.unbind($t,$n,xn)}}ln(p,(Rt,$t)=>{L.unload($t),delete p[$t]})},isChildOf:(Rt,$t)=>Rt===$t||$t.contains(Rt),dumpRng:Rt=>"startContainer: "+Rt.startContainer.nodeName+", startOffset: "+Rt.startOffset+", endContainer: "+Rt.endContainer.nodeName+", endOffset: "+Rt.endOffset},Mw=YC(fe,i,We(x1));return x1};Qr.DOM=Qr(document),Qr.nodeIndex=nb;const Zv=Qr.DOM,Fy=0,Qy=1,v0=2,XC=3;class lm{constructor(i={}){this.states={},this.queue=[],this.scriptLoadedCallbacks={},this.queueLoadedCallbacks=[],this.loading=!1,this.settings=i}_setReferrerPolicy(i){this.settings.referrerPolicy=i}loadScript(i){return new Promise((c,m)=>{const p=Zv;let y;const x=()=>{p.remove(q),y&&(y.onerror=y.onload=y=null)},M=()=>{x(),c()},L=()=>{x(),m("Failed to load script: "+i)},q=p.uniqueId();y=document.createElement("script"),y.id=q,y.type="text/javascript",y.src=hn._addCacheSuffix(i),this.settings.referrerPolicy&&p.setAttrib(y,"referrerpolicy",this.settings.referrerPolicy),y.onload=M,y.onerror=L,(document.getElementsByTagName("head")[0]||document.body).appendChild(y)})}isDone(i){return this.states[i]===v0}markDone(i){this.states[i]=v0}add(i){const c=this;return c.queue.push(i),c.states[i]===void 0&&(c.states[i]=Fy),new Promise((p,y)=>{c.scriptLoadedCallbacks[i]||(c.scriptLoadedCallbacks[i]=[]),c.scriptLoadedCallbacks[i].push({resolve:p,reject:y})})}load(i){return this.add(i)}remove(i){delete this.states[i],delete this.scriptLoadedCallbacks[i]}loadQueue(){const i=this.queue;return this.queue=[],this.loadScripts(i)}loadScripts(i){const c=this,m=(L,q)=>{Oo(c.scriptLoadedCallbacks,q).each(ae=>{Ie(ae,fe=>fe[L](q))}),delete c.scriptLoadedCallbacks[q]},p=L=>{const q=Dt(L,ae=>ae.status==="rejected");return q.length>0?Promise.reject(Rs(q,({reason:ae})=>ne(ae)?ae:[ae])):Promise.resolve()},y=L=>Promise.allSettled(mt(L,q=>c.states[q]===v0?(m("resolve",q),Promise.resolve()):c.states[q]===XC?(m("reject",q),Promise.reject(q)):(c.states[q]=Qy,c.loadScript(q).then(()=>{c.states[q]=v0,m("resolve",q);const ae=c.queue;return ae.length>0?(c.queue=[],y(ae).then(p)):Promise.resolve()},()=>(c.states[q]=XC,m("reject",q),Promise.reject(q)))))),x=L=>(c.loading=!0,y(L).then(q=>{c.loading=!1;const ae=c.queueLoadedCallbacks.shift();return he.from(ae).each(An),p(q)})),M=fs(i);return c.loading?new Promise((L,q)=>{c.queueLoadedCallbacks.push(()=>{x(M).then(L,q)})}):x(M)}}lm.ScriptLoader=new lm;const qa=n=>{let i=n;return{get:()=>i,set:p=>{i=p}}},O0=(n,i)=>{const c=n.indexOf(i);return c!==-1&&n.indexOf(i,c+1)>c},ob=n=>te(n)&&un(n,"raw"),r_=n=>ne(n)&&n.length>1,y0={},Zy=qa("en"),Na=()=>Oo(y0,Zy.get()),nd={getData:()=>vs(y0,n=>({...n})),setCode:n=>{n&&Zy.set(n)},getCode:()=>Zy.get(),add:(n,i)=>{let c=y0[n];c||(y0[n]=c={});const m=mt(bs(i),p=>p.toLowerCase());ln(i,(p,y)=>{const x=y.toLowerCase();x!==y&&O0(m,x)?(un(i,x)||(c[x]=p),c[y]=p):c[x]=p})},translate:n=>{const i=Na().getOr({}),c=x=>ue(x)?Object.prototype.toString.call(x):m(x)?"":""+x,m=x=>x===""||x===null||x===void 0,p=x=>{const M=c(x);return un(i,M)?c(i[M]):Oo(i,M.toLowerCase()).map(c).getOr(M)},y=x=>x.replace(/{context:\w+}$/,"");if(m(n))return"";if(ob(n))return c(n.raw);if(r_(n)){const x=n.slice(1),M=p(n[0]).replace(/\{([0-9]+)\}/g,(L,q)=>un(x,q)?c(x[q]):L);return y(M)}return y(p(n))},isRtl:()=>Na().bind(n=>Oo(n,"_dir")).exists(n=>n==="rtl"),hasCode:n=>un(y0,n)},Ia=()=>{const n=[],i={},c={},m=[],p=(Pe,He)=>{const dt=Dt(m,bt=>bt.name===Pe&&bt.state===He);Ie(dt,bt=>bt.resolve())},y=Pe=>un(i,Pe),x=Pe=>un(c,Pe),M=Pe=>{if(c[Pe])return c[Pe].instance},L=(Pe,He)=>{const dt=nd.getCode(),bt=","+(He||"")+",";!dt||He&&bt.indexOf(","+dt+",")===-1||lm.ScriptLoader.add(i[Pe]+"/langs/"+dt+".js")},q=(Pe,He)=>{Ia.languageLoad!==!1&&(y(Pe)?L(Pe,He):Ye(Pe,"loaded").then(()=>L(Pe,He)))},ae=(Pe,He)=>(n.push(He),c[Pe]={instance:He},p(Pe,"added"),He),fe=Pe=>{delete i[Pe],delete c[Pe]},be=(Pe,He)=>I(He)?I(Pe)?{prefix:"",resource:He,suffix:""}:{prefix:Pe.prefix,resource:He,suffix:Pe.suffix}:He,Le=(Pe,He)=>{if(i[Pe])return Promise.resolve();let dt=I(He)?He:He.prefix+He.resource+He.suffix;dt.indexOf("/")!==0&&dt.indexOf("://")===-1&&(dt=Ia.baseURL+"/"+dt),i[Pe]=dt.substring(0,dt.lastIndexOf("/"));const bt=()=>(p(Pe,"loaded"),Promise.resolve());return c[Pe]?bt():lm.ScriptLoader.add(dt).then(bt)},Ye=(Pe,He="added")=>He==="added"&&x(Pe)||He==="loaded"&&y(Pe)?Promise.resolve():new Promise(dt=>{m.push({name:Pe,state:He,resolve:dt})});return{items:n,urls:i,lookup:c,get:M,requireLangPack:q,add:ae,remove:fe,createUrl:be,load:Le,waitFor:Ye}};Ia.languageLoad=!0,Ia.baseURL="",Ia.PluginManager=Ia(),Ia.ThemeManager=Ia(),Ia.ModelManager=Ia();const Ea=n=>{const i=qa(he.none()),c=()=>i.get().each(n);return{clear:()=>{c(),i.set(he.none())},isSet:()=>i.get().isSome(),get:()=>i.get(),set:M=>{c(),i.set(he.some(M))}}},qC=n=>{const i=qa(he.none()),c=()=>i.get().each(M=>clearInterval(M));return{clear:()=>{c(),i.set(he.none())},isSet:()=>i.get().isSome(),get:()=>i.get(),set:M=>{c(),i.set(he.some(setInterval(M,n)))}}},Oh=()=>{const n=Ea(St);return{...n,on:c=>n.get().each(c)}},w0=(n,i)=>{let c=null;return{cancel:()=>{G(c)||(clearTimeout(c),c=null)},throttle:(...y)=>{G(c)&&(c=setTimeout(()=>{c=null,n.apply(null,y)},i))}}},zv=(n,i)=>{let c=null;const m=()=>{G(c)||(clearTimeout(c),c=null)};return{cancel:m,throttle:(...y)=>{m(),c=setTimeout(()=>{c=null,n.apply(null,y)},i)}}},od=We("mce-annotation"),af=We("data-mce-annotation"),qp=We("data-mce-annotation-uid"),sb=We("data-mce-annotation-active"),_0=We("data-mce-annotation-classes"),S0=We("data-mce-annotation-attrs"),i_=n=>i=>pt(i,n),Hy=(n,i)=>{const c=n.selection.getRng(),m=Ge.fromDom(c.startContainer),p=Ge.fromDom(n.getBody()),y=i.fold(()=>"."+od(),L=>`[${af()}="${L}"]`),x=Gu(m,c.startOffset).getOr(m);return it(x,y,i_(p)).bind(L=>Ha(L,`${qp()}`).bind(q=>Ha(L,`${af()}`).map(ae=>{const fe=l_(n,q);return{uid:q,name:ae,elements:fe}})))},GC=n=>kl(n)&&Ef(n,od()),a_=(n,i)=>qi(n,"data-mce-bogus")||xy(n,'[data-mce-bogus="all"]',i_(i)),l_=(n,i)=>{const c=Ge.fromDom(n.getBody()),m=pl(c,`[${qp()}="${i}"]`);return Dt(m,p=>!a_(p,c))},Vy=(n,i)=>{const c=Ge.fromDom(n.getBody()),m=pl(c,`[${af()}="${i}"]`),p={};return Ie(m,y=>{if(!a_(y,c)){const x=Ll(y,qp()),M=Oo(p,x).getOr([]);p[x]=M.concat([y])}}),p},c_=(n,i)=>{const c=qa({}),m=()=>({listeners:[],previous:Oh()}),p=(fe,be)=>{y(fe,Le=>(be(Le),Le))},y=(fe,be)=>{const Le=c.get(),Ye=Oo(Le,fe).getOrThunk(m),Pe=be(Ye);Le[fe]=Pe,c.set(Le)},x=(fe,be,Le)=>{p(fe,Ye=>{Ie(Ye.listeners,Pe=>Pe(!0,fe,{uid:be,nodes:mt(Le,He=>He.dom)}))})},M=fe=>{p(fe,be=>{Ie(be.listeners,Le=>Le(!1,fe))})},L=(fe,be)=>{Ie(l_(n,fe),Le=>{be?Pr(Le,sb(),"true"):Vi(Le,sb())})},q=zv(()=>{const fe=$s(i.getNames());Ie(fe,be=>{y(be,Le=>{const Ye=Le.previous.get();return Hy(n,he.some(be)).fold(()=>{Ye.each(Pe=>{M(be),Le.previous.clear(),L(Pe,!1)})},({uid:Pe,name:He,elements:dt})=>{qr(Ye,Pe)||(Ye.each(bt=>L(bt,!1)),x(He,Pe,dt),Le.previous.set(Pe),L(Pe,!0))}),{previous:Le.previous,listeners:Le.listeners}})})},30);return n.on("remove",()=>{q.cancel()}),n.on("NodeChange",()=>{q.throttle()}),{addListener:(fe,be)=>{y(fe,Le=>({previous:Le.previous,listeners:Le.listeners.concat([be])}))}}},CT=(n,i)=>{const c=af(),m=y=>he.from(y.attr(c)).bind(i.lookup),p=y=>{var x,M;y.attr(qp(),null),y.attr(af(),null),y.attr(sb(),null);const L=he.from(y.attr(S0())).map(be=>be.split(",")).getOr([]),q=he.from(y.attr(_0())).map(be=>be.split(",")).getOr([]);Ie(L,be=>y.attr(be,null));const ae=(M=(x=y.attr("class"))===null||x===void 0?void 0:x.split(" "))!==null&&M!==void 0?M:[],fe=wa(ae,[od()].concat(q));y.attr("class",fe.length>0?fe.join(" "):null),y.attr(_0(),null),y.attr(S0(),null)};n.serializer.addTempAttr(sb()),n.serializer.addAttributeFilter(c,y=>{for(const x of y)m(x).each(M=>{M.persistent===!1&&(x.name==="span"?x.unwrap():p(x))})})},Hv=()=>{const n={};return{register:(p,y)=>{n[p]={name:p,settings:y}},lookup:p=>Oo(n,p).map(y=>y.settings),getNames:()=>bs(n)}};let u_=0;const Li=n=>{const c=new Date().getTime(),m=Math.floor(Math.random()*1e9);return u_++,n+"_"+m+u_+String(c)},Vv=(n,i)=>{Ie(i,c=>{qu(n,c)})},Wy=(n,i)=>{Ie(i,c=>{Qc(n,c)})},f_=(n,i)=>Ge.fromDom(n.dom.cloneNode(i)),lg=n=>f_(n,!1),mc=n=>f_(n,!0),du=(n,i)=>{const c=Ge.fromTag(i),m=Xf(n);return ju(c,m),c},d_=(n,i)=>{const c=du(n,i);ou(n,c);const m=Da(n);return ti(c,m),wr(n),c},Uy=(n,i,c=Xe)=>{const m=new wi(n,i),p=y=>{let x;do x=m[y]();while(x&&!Sn(x)&&!c(x));return he.from(x).filter(Sn)};return{current:()=>he.from(m.current()).filter(Sn),next:()=>p("next"),prev:()=>p("prev"),prev2:()=>p("prev2")}},lp=(n,i)=>{const c=i||(x=>n.isBlock(x)||mi(x)||Ts(x)),m=(x,M,L,q)=>{if(Sn(x)){const ae=q(x,M,x.data);if(ae!==-1)return he.some({container:x,offset:ae})}return L().bind(ae=>m(ae.container,ae.offset,L,q))};return{backwards:(x,M,L,q)=>{const ae=Uy(x,q!=null?q:n.getRoot(),c);return m(x,M,()=>ae.prev().map(fe=>({container:fe,offset:fe.length})),L).getOrNull()},forwards:(x,M,L,q)=>{const ae=Uy(x,q!=null?q:n.getRoot(),c);return m(x,M,()=>ae.next().map(fe=>({container:fe,offset:0})),L).getOrNull()}}},cp=Math.round,Gp=n=>n?{left:cp(n.left),top:cp(n.top),bottom:cp(n.bottom),right:cp(n.right),width:cp(n.width),height:cp(n.height)}:{left:0,top:0,bottom:0,right:0,width:0,height:0},Kp=(n,i)=>(n=Gp(n),i||(n.left=n.left+n.width),n.right=n.left,n.width=0,n),cg=(n,i)=>n.left===i.left&&n.top===i.top&&n.bottom===i.bottom&&n.right===i.right,Wv=(n,i,c)=>n>=0&&n<=Math.min(i.height,c.height)/2,sa=(n,i)=>{const c=Math.min(i.height/2,n.height/2);return n.bottom-ci.bottom?!1:Wv(i.top-n.bottom,n,i)},lf=(n,i)=>n.top>i.bottom?!0:n.bottomi>=n.left&&i<=n.right&&c>=n.top&&c<=n.bottom,KC=n=>Hn(n,(i,c)=>i.fold(()=>he.some(c),m=>{const p=Math.min(c.left,m.left),y=Math.min(c.top,m.top),x=Math.max(c.right,m.right),M=Math.max(c.bottom,m.bottom);return he.some({top:y,right:x,bottom:M,left:p,width:x-p,height:M-y})}),he.none()),Yy=(n,i,c)=>{const m=Math.max(Math.min(i,n.left+n.width),n.left),p=Math.max(Math.min(c,n.top+n.height),n.top);return Math.sqrt((i-m)*(i-m)+(c-p)*(c-p))},JC=(n,i)=>Math.max(0,Math.min(n.bottom,i.bottom)-Math.max(n.top,i.top)),Jp=(n,i,c)=>Math.min(Math.max(n,i),c),ib=n=>{const i=n.startContainer,c=n.startOffset;return i===n.endContainer&&i.hasChildNodes()&&n.endOffset===c+1?i.childNodes[c]:null},sd=(n,i)=>{if(Jn(n)&&n.hasChildNodes()){const c=n.childNodes,m=Jp(i,0,c.length-1);return c[m]}else return n},Xy=(n,i)=>{if(!(i<0&&Jn(n)&&n.hasChildNodes()))return sd(n,i)},h_=new RegExp("[\u0300-\u036F\u0483-\u0487\u0488-\u0489\u0591-\u05BD\u05BF\u05C1-\u05C2\u05C4-\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7-\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962-\u0963\u0981\u09BC\u09BE\u09C1-\u09C4\u09CD\u09D7\u09E2-\u09E3\u0A01-\u0A02\u0A3C\u0A41-\u0A42\u0A47-\u0A48\u0A4B-\u0A4D\u0A51\u0A70-\u0A71\u0A75\u0A81-\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7-\u0AC8\u0ACD\u0AE2-\u0AE3\u0B01\u0B3C\u0B3E\u0B3F\u0B41-\u0B44\u0B4D\u0B56\u0B57\u0B62-\u0B63\u0B82\u0BBE\u0BC0\u0BCD\u0BD7\u0C00\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55-\u0C56\u0C62-\u0C63\u0C81\u0CBC\u0CBF\u0CC2\u0CC6\u0CCC-\u0CCD\u0CD5-\u0CD6\u0CE2-\u0CE3\u0D01\u0D3E\u0D41-\u0D44\u0D4D\u0D57\u0D62-\u0D63\u0DCA\u0DCF\u0DD2-\u0DD4\u0DD6\u0DDF\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB-\u0EBC\u0EC8-\u0ECD\u0F18-\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86-\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039-\u103A\u103D-\u103E\u1058-\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085-\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752-\u1753\u1772-\u1773\u17B4-\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u18A9\u1920-\u1922\u1927-\u1928\u1932\u1939-\u193B\u1A17-\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ABD\u1ABE\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80-\u1B81\u1BA2-\u1BA5\u1BA8-\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8-\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8-\u1CF9\u1DC0-\u1DF5\u1DFC-\u1DFF\u200C-\u200D\u20D0-\u20DC\u20DD-\u20E0\u20E1\u20E2-\u20E4\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u302E-\u302F\u3099-\u309A\uA66F\uA670-\uA672\uA674-\uA67D\uA69E-\uA69F\uA6F0-\uA6F1\uA802\uA806\uA80B\uA825-\uA826\uA8C4\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9E5\uAA29-\uAA2E\uAA31-\uAA32\uAA35-\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7-\uAAB8\uAABE-\uAABF\uAAC1\uAAEC-\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFF9E-\uFF9F]"),m_=n=>I(n)&&n.charCodeAt(0)>=768&&h_.test(n),ek=(...n)=>i=>{for(let c=0;ci=>{for(let c=0;cn?n.createRange():Qr.DOM.createRng(),qs=n=>I(n)&&/[\r\n\t ]/.test(n),hu=n=>!!n.setStart&&!!n.setEnd,fg=n=>{const i=n.startContainer,c=n.startOffset;if(qs(n.toString())&&b_(i.parentNode)&&Sn(i)){const m=i.data;if(qs(m[c-1])||qs(m[c+1]))return!0}return!1},qy=n=>{const i=n.ownerDocument,c=ab(i),m=i.createTextNode(Gr),p=n.parentNode;p.insertBefore(m,n),c.setStart(m,0),c.setEnd(m,1);const y=Gp(c.getBoundingClientRect());return p.removeChild(m),y},Yi=n=>{const i=n.startContainer,c=n.endContainer,m=n.startOffset,p=n.endOffset;if(i===c&&Sn(c)&&m===0&&p===1){const y=n.cloneRange();return y.setEndAfter(c),dg(y)}else return null},Gy=n=>n.left===0&&n.right===0&&n.top===0&&n.bottom===0,dg=n=>{var i;let c;const m=n.getClientRects();return m.length>0?c=Gp(m[0]):c=Gp(n.getBoundingClientRect()),!hu(n)&&ug(n)&&Gy(c)?qy(n):Gy(c)&&hu(n)&&(i=Yi(n))!==null&&i!==void 0?i:c},Oa=(n,i)=>{const c=Kp(n,i);return c.width=1,c.right=c.left+1,c},cm=n=>{const i=[],c=x=>{x.height!==0&&(i.length>0&&cg(x,i[i.length-1])||i.push(x))},m=(x,M)=>{const L=ab(x.ownerDocument);if(M0&&(L.setStart(x,M-1),L.setEnd(x,M),fg(L)||c(Oa(dg(L),!1))),M{const m=()=>(t1(n),i===0),p=()=>t1(n)?i>=n.data.length:i>=n.childNodes.length,y=()=>{const ae=ab(n.ownerDocument);return ae.setStart(n,i),ae.setEnd(n,i),ae},x=()=>(c||(c=cm(Ht(n,i))),c),M=()=>x().length>0,L=ae=>ae&&n===ae.container()&&i===ae.offset(),q=ae=>cf(n,ae?i-1:i);return{container:We(n),offset:We(i),toRange:y,getClientRects:x,isVisible:M,isAtStart:m,isAtEnd:p,isEqual:L,getNode:q}};Ht.fromRangeStart=n=>Ht(n.startContainer,n.startOffset),Ht.fromRangeEnd=n=>Ht(n.endContainer,n.endOffset),Ht.after=n=>Ht(n.parentNode,Uv(n)+1),Ht.before=n=>Ht(n.parentNode,Uv(n)),Ht.isAbove=(n,i)=>ri($o(i.getClientRects()),Mo(n.getClientRects()),sa).getOr(!1),Ht.isBelow=(n,i)=>ri(Mo(i.getClientRects()),$o(n.getClientRects()),lf).getOr(!1),Ht.isAtStart=n=>n?n.isAtStart():!1,Ht.isAtEnd=n=>n?n.isAtEnd():!1,Ht.isTextPosition=n=>n?Sn(n.container()):!1,Ht.isElementPosition=n=>!Ht.isTextPosition(n);const x0=(n,i)=>{Sn(i)&&i.data.length===0&&n.remove(i)},Ky=(n,i,c)=>{i.insertNode(c),x0(n,c.previousSibling),x0(n,c.nextSibling)},E0=(n,i,c)=>{const m=he.from(c.firstChild),p=he.from(c.lastChild);i.insertNode(c),m.each(y=>x0(n,y.previousSibling)),p.each(y=>x0(n,y.nextSibling))},yh=(n,i,c)=>{q1(c)?E0(n,i,c):Ky(n,i,c)},uf=Sn,lb=Td,Yv=Qr.nodeIndex,Jy=n=>{const i=n.parentNode;return lb(i)?Jy(i):i},Xv=n=>n?qe(n.childNodes,(i,c)=>(lb(c)&&c.nodeName!=="BR"?i=i.concat(Xv(c)):i.push(c),i),[]):[],T0=(n,i)=>{let c=n;for(;(c=c.previousSibling)&&uf(c);)i+=c.data.length;return i},wh=n=>i=>n===i,rd=n=>{let i,c;i=Xv(Jy(n)),c=je(i,wh(n),n),i=i.slice(0,c+1);const m=qe(i,(p,y,x)=>(uf(y)&&uf(i[x-1])&&p++,p),0);return i=Fa(i,Df([n.nodeName])),c=je(i,wh(n),n),c-m},Nu=n=>(uf(n)?"text()":n.nodeName.toLowerCase())+"["+rd(n)+"]",zl=(n,i,c)=>{const m=[];for(let p=i.parentNode;p&&p!==n&&!(c&&c(p));p=p.parentNode)m.push(p);return m},e2=(n,i)=>{let c=[],m=i.container(),p=i.offset(),y;if(uf(m))y=T0(m,p);else{const M=m.childNodes;p>=M.length?(y="after",p=M.length-1):y="before",m=M[p]}c.push(Nu(m));let x=zl(n,m);return x=Fa(x,Je(Td)),c=c.concat(Zi(x,M=>Nu(M))),c.reverse().join("/")+","+y},up=(n,i,c)=>{let m=Xv(n);return m=Fa(m,(p,y)=>!uf(p)||!uf(m[y-1])),m=Fa(m,Df([i])),m[c]},v_=(n,i)=>{let c=n,m=0;for(;uf(c);){const p=c.data.length;if(i>=m&&i<=m+p){n=c,i=i-m;break}if(!uf(c.nextSibling)){n=c,i=p;break}m+=p,c=c.nextSibling}return uf(n)&&i>n.data.length&&(i=n.data.length),Ht(n,i)},A0=(n,i)=>{if(!i)return null;const c=i.split(","),m=c[0].split("/"),p=c.length>1?c[1]:"before",y=qe(m,(x,M)=>{const L=/([\w\-\(\)]+)\[([0-9]+)\]/.exec(M);return L?(L[1]==="text()"&&(L[1]="#text"),up(x,L[1],parseInt(L[2],10))):null},n);if(!y)return null;if(!uf(y)&&y.parentNode){let x;return p==="after"?x=Yv(y)+1:x=Yv(y),Ht(y.parentNode,x)}return v_(y,parseInt(p,10))},n1=Ts,t2=(n,i,c)=>{let m=n(i.data.slice(0,c)).length;for(let p=i.previousSibling;p&&Sn(p);p=p.previousSibling)m+=n(p.data).length;return m},jv=(n,i,c,m,p)=>{const y=p?m.startContainer:m.endContainer;let x=p?m.startOffset:m.endOffset;const M=[],L=n.getRoot();if(Sn(y))M.push(c?t2(i,y,x):x);else{let q=0;const ae=y.childNodes;x>=ae.length&&ae.length&&(q=1,x=Math.max(0,ae.length-1)),M.push(n.nodeIndex(ae[x],c)+q)}for(let q=y;q&&q!==L;q=q.parentNode)M.push(n.nodeIndex(q,c));return M},O_=(n,i,c,m)=>{const p=i.dom,y=jv(p,n,c,m,!0),x=i.isForward(),M=oa(m)?{isFakeCaret:!0}:{};if(i.isCollapsed())return{start:y,forward:x,...M};{const L=jv(p,n,c,m,!1);return{start:y,end:L,forward:x,...M}}},qv=(n,i,c)=>{let m=0;return hn.each(n.select(i),p=>{if(p.getAttribute("data-mce-bogus")!=="all"){if(p===c)return!1;m++;return}}),m},n2=(n,i)=>{let c=i?n.startContainer:n.endContainer,m=i?n.startOffset:n.endOffset;if(Jn(c)&&c.nodeName==="TR"){const p=c.childNodes;c=p[Math.min(i?m:m-1,p.length-1)],c&&(m=i?0:c.childNodes.length,i?n.setStart(c,m):n.setEnd(c,m))}},vl=n=>(n2(n,!0),n2(n,!1),n),Jl=(n,i)=>{if(Jn(n)&&(n=sd(n,i),n1(n)))return n;if(_r(n)){Sn(n)&&_i(n)&&(n=n.parentNode);let c=n.previousSibling;if(n1(c)||(c=n.nextSibling,n1(c)))return c}},Iu=n=>Jl(n.startContainer,n.startOffset)||Jl(n.endContainer,n.endOffset),Zr=(n,i,c)=>{const m=c.getNode(),p=c.getRng();if(m.nodeName==="IMG"||n1(m)){const x=m.nodeName;return{name:x,index:qv(c.dom,x,m)}}const y=Iu(p);if(y){const x=y.tagName;return{name:x,index:qv(c.dom,x,y)}}return O_(n,c,i,p)},ec=n=>{const i=n.getRng();return{start:e2(n.dom.getRoot(),Ht.fromRangeStart(i)),end:e2(n.dom.getRoot(),Ht.fromRangeEnd(i)),forward:n.isForward()}},Hl=n=>({rng:n.getRng(),forward:n.isForward()}),um=(n,i,c)=>{const m={"data-mce-type":"bookmark",id:i,style:"overflow:hidden;line-height:0px"};return c?n.create("span",m,""):n.create("span",m)},Sr=(n,i)=>{const c=n.dom;let m=n.getRng();const p=c.uniqueId(),y=n.isCollapsed(),x=n.getNode(),M=x.nodeName,L=n.isForward();if(M==="IMG")return{name:M,index:qv(c,M,x)};const q=vl(m.cloneRange());if(!y){q.collapse(!1);const fe=um(c,p+"_end",i);yh(c,q,fe)}m=vl(m),m.collapse(!0);const ae=um(c,p+"_start",i);return yh(c,m,ae),n.moveToBookmark({id:p,keep:!0,forward:L}),{id:p,forward:L}},y_=(n,i,c=!1)=>i===2?Zr(Bn,c,n):i===3?ec(n):i?Hl(n):Sr(n,!1),mu=$e(Zr,Ct,!0),Dl=n=>{const i=y=>y(n),c=We(n),m=()=>p,p={tag:!0,inner:n,fold:(y,x)=>x(n),isValue:wt,isError:Xe,map:y=>gc.value(y(n)),mapError:m,bind:i,exists:i,forall:i,getOr:c,or:m,getOrThunk:c,orThunk:m,getOrDie:c,each:y=>{y(n)},toOptional:()=>he.some(n)};return p},o2=n=>{const i=()=>c,c={tag:!1,inner:n,fold:(m,p)=>m(n),isValue:Xe,isError:wt,map:i,mapError:m=>gc.error(m(n)),bind:i,exists:Xe,forall:wt,getOr:Ct,or:Ct,getOrThunk:Tt,orThunk:Tt,getOrDie:an(String(n)),each:St,toOptional:he.none};return c},gc={value:Dl,error:o2,fromOption:(n,i)=>n.fold(()=>o2(i),Dl)},mg={generate:n=>{if(!ne(n))throw new Error("cases must be an array");if(n.length===0)throw new Error("there must be at least one case");const i=[],c={};return Ie(n,(m,p)=>{const y=bs(m);if(y.length!==1)throw new Error("one and only one name per case");const x=y[0],M=m[x];if(c[x]!==void 0)throw new Error("duplicate key detected:"+x);if(x==="cata")throw new Error("cannot have a case named cata (sorry)");if(!ne(M))throw new Error("case arguments must be an array");i.push(x),c[x]=(...L)=>{const q=L.length;if(q!==M.length)throw new Error("Wrong number of arguments to case "+x+". Expected "+M.length+" ("+M+"), got "+q);return{fold:(...fe)=>{if(fe.length!==n.length)throw new Error("Wrong number of arguments to fold. Expected "+n.length+", got "+fe.length);return fe[p].apply(null,L)},match:fe=>{const be=bs(fe);if(i.length!==be.length)throw new Error("Wrong number of arguments to match. Expected: "+i.join(",")+` Actual: `+be.join(","));if(!er(i,Ye=>yt(be,Ye)))throw new Error("Not all branches were specified when using match. Specified: "+be.join(", ")+` Required: `+i.join(", "));return fe[x].apply(null,L)},log:fe=>{console.log(fe,{constructors:i,constructor:x,params:L})}}}}),c}};mg.generate([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);const tk=n=>{const i=[],c=[];return Ie(n,m=>{m.fold(p=>{i.push(p)},p=>{c.push(p)})}),{errors:i,values:c}},nk=n=>n.type==="inline-command"||n.type==="inline-format",s2=n=>n.type==="block-command"||n.type==="block-format",r2=n=>{const i=m=>gc.error({message:m,pattern:n}),c=(m,p,y)=>{if(n.format!==void 0){let x;if(ne(n.format)){if(!er(n.format,I))return i(m+" pattern has non-string items in the `format` array");x=n.format}else if(I(n.format))x=[n.format];else return i(m+" pattern has non-string `format` parameter");return gc.value(p(x))}else return n.cmd!==void 0?I(n.cmd)?gc.value(y(n.cmd,n.value)):i(m+" pattern has non-string `cmd` parameter"):i(m+" pattern is missing both `format` and `cmd` parameters")};if(!te(n))return i("Raw pattern is not an object");if(!I(n.start))return i("Raw pattern is missing `start` parameter");if(n.end!==void 0){if(!I(n.end))return i("Inline pattern has non-string `end` parameter");if(n.start.length===0&&n.end.length===0)return i("Inline pattern has empty `start` and `end` parameters");let m=n.start,p=n.end;return p.length===0&&(p=m,m=""),c("Inline",y=>({type:"inline-format",start:m,end:p,format:y}),(y,x)=>({type:"inline-command",start:m,end:p,cmd:y,value:x}))}else return n.replacement!==void 0?I(n.replacement)?n.start.length===0?i("Replacement pattern has empty `start` parameter"):gc.value({type:"inline-command",start:"",end:n.start,cmd:"mceInsertContent",value:n.replacement}):i("Replacement pattern has non-string `replacement` parameter"):n.start.length===0?i("Block pattern has empty `start` parameter"):c("Block",m=>({type:"block-format",start:n.start,format:m[0]}),(m,p)=>({type:"block-command",start:n.start,cmd:m,value:p}))},fm=n=>Dt(n,s2),i2=n=>Dt(n,nk),o1=(n,i)=>({inlinePatterns:i2(n),blockPatterns:fm(n),dynamicPatternsLookup:i}),Ol=n=>{const i=tk(mt(n,r2));return Ie(i.errors,c=>console.error(c.message,c.pattern)),i.values},Pl=n=>i=>{const c=n(i);return Ol(c)},En=ys().deviceType,ok=En.isTouch(),tc=Qr.DOM,sk=n=>{const i=n.indexOf("=")>0?n.split(/[;,](?![^=;,]*(?:[;,]|$))/):n.split(",");return Hn(i,(c,m)=>{const p=m.split("="),y=p[0],x=p.length>1?p[1]:y;return c[_c(y)]=_c(x),c},{})},a2=n=>ee(n,RegExp),no=n=>i=>i.options.get(n),Tc=n=>I(n)||te(n),l2=(n,i="")=>c=>{const m=I(c);if(m)if(c.indexOf("=")!==-1){const p=sk(c);return{value:Oo(p,n.id).getOr(i),valid:m}}else return{value:c,valid:m};else return{valid:!1,message:"Must be a string."}},cb=n=>{const i=n.options.register;i("id",{processor:"string",default:n.id}),i("selector",{processor:"string"}),i("target",{processor:"object"}),i("suffix",{processor:"string"}),i("cache_suffix",{processor:"string"}),i("base_url",{processor:"string"}),i("referrer_policy",{processor:"string",default:""}),i("language_load",{processor:"boolean",default:!0}),i("inline",{processor:"boolean",default:!1}),i("iframe_attrs",{processor:"object",default:{}}),i("doctype",{processor:"string",default:""}),i("document_base_url",{processor:"string",default:n.documentBaseUrl}),i("body_id",{processor:l2(n,"tinymce"),default:"tinymce"}),i("body_class",{processor:l2(n),default:""}),i("content_security_policy",{processor:"string",default:""}),i("br_in_pre",{processor:"boolean",default:!0}),i("forced_root_block",{processor:c=>{const m=I(c)&&yr(c);return m?{value:c,valid:m}:{valid:!1,message:"Must be a non-empty string."}},default:"p"}),i("forced_root_block_attrs",{processor:"object",default:{}}),i("newline_behavior",{processor:c=>{const m=yt(["block","linebreak","invert","default"],c);return m?{value:c,valid:m}:{valid:!1,message:"Must be one of: block, linebreak, invert or default."}},default:"default"}),i("br_newline_selector",{processor:"string",default:".mce-toc h2,figcaption,caption"}),i("no_newline_selector",{processor:"string",default:""}),i("keep_styles",{processor:"boolean",default:!0}),i("end_container_on_empty_block",{processor:c=>ye(c)?{valid:!0,value:c}:I(c)?{valid:!0,value:c}:{valid:!1,message:"Must be boolean or a string"},default:"blockquote"}),i("font_size_style_values",{processor:"string",default:"xx-small,x-small,small,medium,large,x-large,xx-large"}),i("font_size_legacy_values",{processor:"string",default:"xx-small,small,medium,large,x-large,xx-large,300%"}),i("font_size_classes",{processor:"string",default:""}),i("automatic_uploads",{processor:"boolean",default:!0}),i("images_reuse_filename",{processor:"boolean",default:!1}),i("images_replace_blob_uris",{processor:"boolean",default:!0}),i("icons",{processor:"string",default:""}),i("icons_url",{processor:"string",default:""}),i("images_upload_url",{processor:"string",default:""}),i("images_upload_base_path",{processor:"string",default:""}),i("images_upload_credentials",{processor:"boolean",default:!1}),i("images_upload_handler",{processor:"function"}),i("language",{processor:"string",default:"en"}),i("language_url",{processor:"string",default:""}),i("entity_encoding",{processor:"string",default:"named"}),i("indent",{processor:"boolean",default:!0}),i("indent_before",{processor:"string",default:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,details,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist"}),i("indent_after",{processor:"string",default:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,details,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist"}),i("indent_use_margin",{processor:"boolean",default:!1}),i("indentation",{processor:"string",default:"40px"}),i("content_css",{processor:c=>{const m=c===!1||I(c)||nt(c,I);return m?I(c)?{value:mt(c.split(","),_c),valid:m}:ne(c)?{value:c,valid:m}:c===!1?{value:[],valid:m}:{value:c,valid:m}:{valid:!1,message:"Must be false, a string or an array of strings."}},default:P_(n)?[]:["default"]}),i("content_style",{processor:"string"}),i("content_css_cors",{processor:"boolean",default:!1}),i("font_css",{processor:c=>{const m=I(c)||nt(c,I);return m?{value:ne(c)?c:mt(c.split(","),_c),valid:m}:{valid:!1,message:"Must be a string or an array of strings."}},default:[]}),i("inline_boundaries",{processor:"boolean",default:!0}),i("inline_boundaries_selector",{processor:"string",default:"a[href],code,span.mce-annotation"}),i("object_resizing",{processor:c=>{const m=ye(c)||I(c);return m?c===!1||En.isiPhone()||En.isiPad()?{value:"",valid:m}:{value:c===!0?"table,img,figure.image,div,video,iframe":c,valid:m}:{valid:!1,message:"Must be boolean or a string"}},default:!ok}),i("resize_img_proportional",{processor:"boolean",default:!0}),i("event_root",{processor:"object"}),i("service_message",{processor:"string"}),i("theme",{processor:c=>c===!1||I(c)||ue(c),default:"silver"}),i("theme_url",{processor:"string"}),i("formats",{processor:"object"}),i("format_empty_lines",{processor:"boolean",default:!1}),i("format_noneditable_selector",{processor:"string",default:""}),i("preview_styles",{processor:c=>{const m=c===!1||I(c);return m?{value:c===!1?"":c,valid:m}:{valid:!1,message:"Must be false or a string"}},default:"font-family font-size font-weight font-style text-decoration text-transform color background-color border border-radius outline text-shadow"}),i("custom_ui_selector",{processor:"string",default:""}),i("hidden_input",{processor:"boolean",default:!0}),i("submit_patch",{processor:"boolean",default:!0}),i("encoding",{processor:"string"}),i("add_form_submit_trigger",{processor:"boolean",default:!0}),i("add_unload_trigger",{processor:"boolean",default:!0}),i("custom_undo_redo_levels",{processor:"number",default:0}),i("disable_nodechange",{processor:"boolean",default:!1}),i("readonly",{processor:"boolean",default:!1}),i("editable_root",{processor:"boolean",default:!0}),i("plugins",{processor:"string[]",default:[]}),i("external_plugins",{processor:"object"}),i("forced_plugins",{processor:"string[]"}),i("model",{processor:"string",default:n.hasPlugin("rtc")?"plugin":"dom"}),i("model_url",{processor:"string"}),i("block_unsupported_drop",{processor:"boolean",default:!0}),i("visual",{processor:"boolean",default:!0}),i("visual_table_class",{processor:"string",default:"mce-item-table"}),i("visual_anchor_class",{processor:"string",default:"mce-item-anchor"}),i("iframe_aria_text",{processor:"string",default:"Rich Text Area. Press ALT-0 for help."}),i("setup",{processor:"function"}),i("init_instance_callback",{processor:"function"}),i("url_converter",{processor:"function",default:n.convertURL}),i("url_converter_scope",{processor:"object",default:n}),i("urlconverter_callback",{processor:"function"}),i("allow_conditional_comments",{processor:"boolean",default:!1}),i("allow_html_data_urls",{processor:"boolean",default:!1}),i("allow_svg_data_urls",{processor:"boolean"}),i("allow_html_in_named_anchor",{processor:"boolean",default:!1}),i("allow_script_urls",{processor:"boolean",default:!1}),i("allow_unsafe_link_target",{processor:"boolean",default:!1}),i("convert_fonts_to_spans",{processor:"boolean",default:!0,deprecated:!0}),i("fix_list_elements",{processor:"boolean",default:!1}),i("preserve_cdata",{processor:"boolean",default:!1}),i("remove_trailing_brs",{processor:"boolean",default:!0}),i("pad_empty_with_br",{processor:"boolean",default:!1}),i("inline_styles",{processor:"boolean",default:!0,deprecated:!0}),i("element_format",{processor:"string",default:"html"}),i("entities",{processor:"string"}),i("schema",{processor:"string",default:"html5"}),i("convert_urls",{processor:"boolean",default:!0}),i("relative_urls",{processor:"boolean",default:!0}),i("remove_script_host",{processor:"boolean",default:!0}),i("custom_elements",{processor:"string"}),i("extended_valid_elements",{processor:"string"}),i("invalid_elements",{processor:"string"}),i("invalid_styles",{processor:Tc}),i("valid_children",{processor:"string"}),i("valid_classes",{processor:Tc}),i("valid_elements",{processor:"string"}),i("valid_styles",{processor:Tc}),i("verify_html",{processor:"boolean",default:!0}),i("auto_focus",{processor:c=>I(c)||c===!0}),i("browser_spellcheck",{processor:"boolean",default:!1}),i("protect",{processor:"array"}),i("images_file_types",{processor:"string",default:"jpeg,jpg,jpe,jfi,jif,jfif,png,gif,bmp,webp"}),i("deprecation_warnings",{processor:"boolean",default:!0}),i("a11y_advanced_options",{processor:"boolean",default:!1}),i("api_key",{processor:"string"}),i("paste_block_drop",{processor:"boolean",default:!1}),i("paste_data_images",{processor:"boolean",default:!0}),i("paste_preprocess",{processor:"function"}),i("paste_postprocess",{processor:"function"}),i("paste_webkit_styles",{processor:"string",default:"none"}),i("paste_remove_styles_if_webkit",{processor:"boolean",default:!0}),i("paste_merge_formats",{processor:"boolean",default:!0}),i("smart_paste",{processor:"boolean",default:!0}),i("paste_as_text",{processor:"boolean",default:!1}),i("paste_tab_spaces",{processor:"number",default:4}),i("text_patterns",{processor:c=>nt(c,te)||c===!1?{value:Ol(c===!1?[]:c),valid:!0}:{valid:!1,message:"Must be an array of objects or false."},default:[{start:"*",end:"*",format:"italic"},{start:"**",end:"**",format:"bold"},{start:"#",format:"h1"},{start:"##",format:"h2"},{start:"###",format:"h3"},{start:"####",format:"h4"},{start:"#####",format:"h5"},{start:"######",format:"h6"},{start:"1. ",cmd:"InsertOrderedList"},{start:"* ",cmd:"InsertUnorderedList"},{start:"- ",cmd:"InsertUnorderedList"}]}),i("text_patterns_lookup",{processor:c=>ue(c)?{value:Pl(c),valid:!0}:{valid:!1,message:"Must be a single function"},default:c=>[]}),i("noneditable_class",{processor:"string",default:"mceNonEditable"}),i("editable_class",{processor:"string",default:"mceEditable"}),i("noneditable_regexp",{processor:c=>nt(c,a2)?{value:c,valid:!0}:a2(c)?{value:[c],valid:!0}:{valid:!1,message:"Must be a RegExp or an array of RegExp."},default:[]}),i("table_tab_navigation",{processor:"boolean",default:!0}),i("highlight_on_focus",{processor:"boolean",default:!1}),i("xss_sanitization",{processor:"boolean",default:!0}),i("details_initial_state",{processor:c=>{const m=yt(["inherited","collapsed","expanded"],c);return m?{value:c,valid:m}:{valid:!1,message:"Must be one of: inherited, collapsed, or expanded."}},default:"inherited"}),i("details_serialized_state",{processor:c=>{const m=yt(["inherited","collapsed","expanded"],c);return m?{value:c,valid:m}:{valid:!1,message:"Must be one of: inherited, collapsed, or expanded."}},default:"inherited"}),i("init_content_sync",{processor:"boolean",default:!1}),i("newdocument_content",{processor:"string",default:""}),n.on("ScriptsLoaded",()=>{i("directionality",{processor:"string",default:nd.isRtl()?"rtl":void 0}),i("placeholder",{processor:"string",default:tc.getAttrib(n.getElement(),"placeholder")})})},ff=no("iframe_attrs"),Gv=no("doctype"),s1=no("document_base_url"),If=no("body_id"),il=no("body_class"),Bd=no("content_security_policy"),Ld=no("br_in_pre"),Uc=no("forced_root_block"),ub=no("forced_root_block_attrs"),c2=no("newline_behavior"),w_=no("br_newline_selector"),u2=no("no_newline_selector"),_h=no("keep_styles"),Xr=no("end_container_on_empty_block"),Kv=no("automatic_uploads"),id=no("images_reuse_filename"),__=no("images_replace_blob_uris"),S_=no("icons"),fa=no("icons_url"),rk=no("images_upload_url"),Jv=no("images_upload_base_path"),eO=no("images_upload_credentials"),C_=no("images_upload_handler"),ik=no("content_css_cors"),fb=no("referrer_policy"),k_=no("language"),ak=no("language_url"),x_=no("indent_use_margin"),lk=no("indentation"),E_=no("content_css"),tO=no("content_style"),fp=no("font_css"),db=no("directionality"),Xi=no("inline_boundaries_selector"),f2=no("object_resizing"),Ac=no("resize_img_proportional"),hb=no("placeholder"),al=no("event_root"),T_=no("service_message"),dm=no("theme"),ck=no("theme_url"),nc=no("model"),df=no("model_url"),D0=no("inline_boundaries"),uk=no("formats"),fk=no("preview_styles"),A_=no("format_empty_lines"),P0=no("format_noneditable_selector"),D_=no("custom_ui_selector"),P_=no("inline"),dp=no("hidden_input"),dk=no("submit_patch"),hk=no("add_form_submit_trigger"),mk=no("add_unload_trigger"),d2=no("custom_undo_redo_levels"),nO=no("disable_nodechange"),gg=no("readonly"),M_=no("editable_root"),R_=no("content_css_cors"),oO=no("plugins"),mb=no("external_plugins"),pg=no("block_unsupported_drop"),sO=no("visual"),rO=no("visual_table_class"),M0=no("visual_anchor_class"),$_=no("iframe_aria_text"),Sh=no("setup"),R0=no("init_instance_callback"),N_=no("urlconverter_callback"),Ch=no("auto_focus"),hp=no("browser_spellcheck"),h2=no("protect"),I_=no("paste_block_drop"),iO=no("paste_data_images"),gk=no("paste_preprocess"),B_=no("paste_postprocess"),pk=no("newdocument_content"),bk=no("paste_webkit_styles"),L_=no("paste_remove_styles_if_webkit"),F_=no("paste_merge_formats"),Q_=no("smart_paste"),vk=no("paste_as_text"),Ok=no("paste_tab_spaces"),yk=no("allow_html_data_urls"),Z_=no("text_patterns"),m2=no("text_patterns_lookup"),g2=no("noneditable_class"),wk=no("editable_class"),_k=no("noneditable_regexp"),aO=no("preserve_cdata"),z_=no("highlight_on_focus"),lO=no("xss_sanitization"),$0=no("init_content_sync"),gb=n=>n.options.isSet("text_patterns_lookup"),cO=n=>hn.explode(n.options.get("font_size_style_values")),p2=n=>hn.explode(n.options.get("font_size_classes")),H_=n=>n.options.get("encoding")==="xml",b2=n=>hn.explode(n.options.get("images_file_types")),Sk=no("table_tab_navigation"),uO=no("details_initial_state"),N0=no("details_serialized_state"),Ck=Jn,fO=Sn,hf=n=>{const i=n.parentNode;i&&i.removeChild(n)},dO=n=>{const i=Bn(n);return{count:n.length-i.length,text:i}},V_=n=>{let i;for(;(i=n.data.lastIndexOf(Ft))!==-1;)n.deleteData(i,1)},hO=(n,i)=>(yl(n),i),kk=(n,i)=>{const c=dO(n.data.substr(0,i.offset())),m=dO(n.data.substr(i.offset()));return(c.text+m.text).length>0?(V_(n),Ht(n,i.offset()-c.count)):i},I0=(n,i)=>{const c=i.container(),m=zo(Rr(c.childNodes),n).map(p=>pfO(n)&&i.container()===n?kk(n,i):hO(n,i),xk=(n,i)=>i.container()===n.parentNode?I0(n,i):hO(n,i),mO=(n,i)=>Ht.isTextPosition(i)?v2(n,i):xk(n,i),yl=n=>{Ck(n)&&_r(n)&&(Hc(n)?n.removeAttribute("data-mce-caret"):hf(n)),fO(n)&&(V_(n),n.data.length===0&&hf(n))},Ek=Ts,pb=ef,Tk=Dd,bb="*[contentEditable=false],video,audio,embed,object",O2=(n,i,c)=>{const m=Kp(i.getBoundingClientRect(),c);let p,y;if(n.tagName==="BODY"){const M=n.ownerDocument.documentElement;p=n.scrollLeft||M.scrollLeft,y=n.scrollTop||M.scrollTop}else{const M=n.getBoundingClientRect();p=n.scrollLeft-M.left,y=n.scrollTop-M.top}m.left+=p,m.right+=p,m.top+=y,m.bottom+=y,m.width=1;let x=i.offsetWidth-i.clientWidth;return x>0&&(c&&(x*=-1),m.left+=x,m.right+=x),m},Ak=n=>{var i,c;const m=pl(Ge.fromDom(n),bb);for(let p=0;p{const p=Oh();let y,x;const M=Uc(n),L=n.dom,q=(Pe,He)=>{let dt;if(ae(),Tk(He))return null;if(c(He)){const bt=lh(M,He,Pe),_t=O2(i,He,Pe);L.setStyle(bt,"top",_t.top),x=bt;const Mt=L.create("div",{class:"mce-visual-caret","data-mce-bogus":"all"});L.setStyles(Mt,{..._t}),L.add(i,Mt),p.set({caret:Mt,element:He,before:Pe}),Pe&&L.addClass(Mt,"mce-visual-caret-before"),fe(),dt=He.ownerDocument.createRange(),dt.setStart(bt,0),dt.setEnd(bt,0)}else return x=iu(He,Pe),dt=He.ownerDocument.createRange(),hm(x.nextSibling)?(dt.setStart(x,0),dt.setEnd(x,0)):(dt.setStart(x,1),dt.setEnd(x,1)),dt;return dt},ae=()=>{Ak(i),x&&(yl(x),x=null),p.on(Pe=>{L.remove(Pe.caret),p.clear()}),y&&(clearInterval(y),y=void 0)},fe=()=>{y=setInterval(()=>{p.on(Pe=>{m()?L.toggleClass(Pe.caret,"mce-visual-caret-hidden"):L.addClass(Pe.caret,"mce-visual-caret-hidden")})},500)};return{show:q,hide:ae,getCss:()=>".mce-visual-caret {position: absolute;background-color: black;background-color: currentcolor;}.mce-visual-caret-hidden {display: none;}*[data-mce-caret] {position: absolute;left: -1000px;right: auto;top: 0;margin: 0;padding: 0;}",reposition:()=>{p.on(Pe=>{const He=O2(i,Pe.element,Pe.before);L.setStyles(Pe.caret,{...He})})},destroy:()=>clearInterval(y)}},B0=()=>Gn.browser.isFirefox(),hm=n=>Ek(n)||pb(n),vb=n=>(hm(n)||Mu(n)&&B0())&&yi(Ge.fromDom(n)).exists(_n),gu=ba,r1=Ts,W_=ef,U_=rh("display","block table table-cell table-caption list-item"),y2=_r,w2=_i,_2=Jn,Pk=Sn,L0=El,gO=n=>n>0,mp=n=>n<0,F0=(n,i)=>{let c;for(;c=n(i);)if(!w2(c))return c;return null},kh=(n,i,c,m,p)=>{const y=new wi(n,m),x=r1(n)||w2(n);let M;if(mp(i)){if(x&&(M=F0(y.prev.bind(y),!0),c(M)))return M;for(;M=F0(y.prev.bind(y),p);)if(c(M))return M}if(gO(i)){if(x&&(M=F0(y.next.bind(y),!0),c(M)))return M;for(;M=F0(y.next.bind(y),p);)if(c(M))return M}return null},Mk=(n,i)=>{const c=p=>gu(p.dom),m=p=>p.dom===i;return di(Ge.fromDom(n),c,m).map(p=>p.dom).getOr(i)},mm=(n,i)=>{for(;n&&n!==i;){if(U_(n))return n;n=n.parentNode}return null},Fd=(n,i,c)=>mm(n.container(),c)===mm(i.container(),c),Ob=(n,i)=>{if(!i)return he.none();const c=i.container(),m=i.offset();return _2(c)?he.from(c.childNodes[m+n]):he.none()},S2=(n,i)=>{var c;const p=((c=i.ownerDocument)!==null&&c!==void 0?c:document).createRange();return n?(p.setStartBefore(i),p.setEndBefore(i)):(p.setStartAfter(i),p.setEndAfter(i)),p},yb=(n,i,c)=>mm(i,n)===mm(c,n),bg=(n,i,c)=>{const m=n?"previousSibling":"nextSibling";let p=c;for(;p&&p!==i;){let y=p[m];if(y&&y2(y)&&(y=y[m]),r1(y)||W_(y)){if(yb(i,y,p))return y;break}if(L0(y))break;p=p.parentNode}return null},S=$e(S2,!0),A=$e(S2,!1),Z=(n,i,c)=>{let m;const p=$e(bg,!0,i),y=$e(bg,!1,i),x=c.startContainer,M=c.startOffset;if(_i(x)){const L=Pk(x)?x.parentNode:x,q=L.getAttribute("data-mce-caret");if(q==="before"&&(m=L.nextSibling,vb(m)))return S(m);if(q==="after"&&(m=L.previousSibling,vb(m)))return A(m)}if(!c.collapsed)return c;if(Sn(x)){if(y2(x)){if(n===1){if(m=y(x),m)return S(m);if(m=p(x),m)return A(m)}if(n===-1){if(m=p(x),m)return A(m);if(m=y(x),m)return S(m)}return c}if(fr(x)&&M>=x.data.length-1)return n===1&&(m=y(x),m)?S(m):c;if(ch(x)&&M<=1)return n===-1&&(m=p(x),m)?A(m):c;if(M===x.data.length)return m=y(x),m?S(m):c;if(M===0)return m=p(x),m?A(m):c}return c},le=(n,i)=>Ob(n?0:-1,i).filter(r1),Ce=(n,i,c)=>{const m=Z(n,i,c);return n===-1?Ht.fromRangeStart(m):Ht.fromRangeEnd(m)},Ve=n=>he.from(n.getNode()).map(Ge.fromDom),ft=n=>he.from(n.getNode(!0)).map(Ge.fromDom),xt=(n,i)=>{let c=i;for(;c=n(c);)if(c.isVisible())return c;return c},zt=(n,i)=>{const c=Fd(n,i);return!c&&mi(n.getNode())?!0:c};var bn;(function(n){n[n.Backwards=-1]="Backwards",n[n.Forwards=1]="Forwards"})(bn||(bn={}));const Zn=Ts,Vn=Sn,Fo=Jn,ms=mi,Ns=El,zr=tm,Zs=jg,gi=(n,i)=>{const c=[];let m=n;for(;m&&m!==i;)c.push(m),m=m.parentNode;return c},Ci=(n,i)=>n.hasChildNodes()&&i{if(gO(n)){if(Ns(i.previousSibling)&&!Vn(i.previousSibling))return Ht.before(i);if(Vn(i))return Ht(i,0)}if(mp(n)){if(Ns(i.nextSibling)&&!Vn(i.nextSibling))return Ht.after(i);if(Vn(i))return Ht(i,i.data.length)}return mp(n)?ms(i)?Ht.before(i):Ht.after(i):Ht.before(i)},Bu=(n,i)=>{const c=i.nextSibling;return c&&Ns(c)?Vn(c)?Ht(c,0):Ht.before(c):Bf(bn.Forwards,Ht.after(i),n)},Bf=(n,i,c)=>{let m,p,y,x;if(!Fo(c)||!i)return null;if(i.isEqual(Ht.after(c))&&c.lastChild){if(x=Ht.after(c.lastChild),mp(n)&&Ns(c.lastChild)&&Fo(c.lastChild))return ms(c.lastChild)?Ht.before(c.lastChild):x}else x=i;const M=x.container();let L=x.offset();if(Vn(M)){if(mp(n)&&L>0)return Ht(M,--L);if(gO(n)&&L0&&(p=Ci(M,L-1),Ns(p)))return!zr(p)&&(y=kh(p,n,Zs,p),y)?Vn(y)?Ht(y,y.data.length):Ht.after(y):Vn(p)?Ht(p,p.data.length):Ht.before(p);if(gO(n)&&L({next:i=>Bf(bn.Forwards,i,n),prev:i=>Bf(bn.Backwards,i,n)}),gm=(n,i,c)=>{const m=n?Ht.before(c):Ht.after(c);return Qd(n,i,m)},ad=n=>mi(n)?Ht.before(n):Ht.after(n),C2=n=>Ht.isTextPosition(n)?n.offset()===0:El(n.getNode()),bu=n=>{if(Ht.isTextPosition(n)){const i=n.container();return n.offset()===i.data.length}else return El(n.getNode(!0))},Y_=(n,i)=>!Ht.isTextPosition(n)&&!Ht.isTextPosition(i)&&n.getNode()===i.getNode(!0),Q0=n=>!Ht.isTextPosition(n)&&mi(n.getNode()),Z0=(n,i,c)=>n?!Y_(i,c)&&!Q0(i)&&bu(i)&&C2(c):!Y_(c,i)&&C2(i)&&bu(c),Qd=(n,i,c)=>{const m=Ta(i);return he.from(n?m.next(c):m.prev(c))},wb=(n,i,c)=>Qd(n,i,c).bind(m=>Fd(c,m,i)&&Z0(n,c,m)?Qd(n,i,m):he.some(m)),Rk=(n,i,c,m)=>wb(n,i,c).bind(p=>m(p)?Rk(n,i,p,m):he.some(p)),pO=(n,i)=>{const c=n?i.firstChild:i.lastChild;return Sn(c)?he.some(Ht(c,n?0:c.data.length)):c?El(c)?he.some(n?Ht.before(c):ad(c)):gm(n,i,c):he.none()},Lf=$e(Qd,!0),Lu=$e(Qd,!1),ll=$e(pO,!0),Zd=$e(pO,!1),X_="_mce_caret",Yc=n=>Jn(n)&&n.id===X_,_b=(n,i)=>{let c=i;for(;c&&c!==n;){if(Yc(c))return c;c=c.parentNode}return null},bO=n=>I(n.start),k2=n=>un(n,"rng"),$k=n=>un(n,"id"),Nk=n=>un(n,"name"),i1=n=>hn.isArray(n.start),x2=n=>!Nk(n)&&ye(n.forward)?n.forward:!0,vg=(n,i)=>(Jn(i)&&n.isBlock(i)&&!i.innerHTML&&(i.innerHTML='
'),i),KD=(n,i)=>{const c=he.from(A0(n.getRoot(),i.start)),m=he.from(A0(n.getRoot(),i.end));return ri(c,m,(p,y)=>{const x=n.createRng();return x.setStart(p.container(),p.offset()),x.setEnd(y.container(),y.offset()),{range:x,forward:x2(i)}})},Ik=(n,i)=>{var c;const p=((c=n.ownerDocument)!==null&&c!==void 0?c:document).createTextNode(Ft);n.appendChild(p),i.setStart(p,0),i.setEnd(p,0)},xT=n=>!n.hasChildNodes(),fI=(n,i)=>Zd(n).fold(Xe,c=>(i.setStart(c.container(),c.offset()),i.setEnd(c.container(),c.offset()),!0)),ET=(n,i,c)=>xT(i)&&_b(n,i)?(Ik(i,c),!0):!1,TT=(n,i,c,m)=>{const p=c[i?"start":"end"],y=n.getRoot();if(p){let x=y,M=p[0];for(let L=p.length-1;x&&L>=1;L--){const q=x.childNodes;if(ET(y,x,m))return!0;if(p[L]>q.length-1)return ET(y,x,m)?!0:fI(x,m);x=q[p[L]]}Sn(x)&&(M=Math.min(p[0],x.data.length)),Jn(x)&&(M=Math.min(p[0],x.childNodes.length)),i?m.setStart(x,M):m.setEnd(x,M)}return!0},Bk=n=>Sn(n)&&n.data.length>0,Lk=(n,i,c)=>{const m=n.get(c.id+"_"+i),p=m==null?void 0:m.parentNode,y=c.keep;if(m&&p){let x,M;if(i==="start"?y?m.hasChildNodes()?(x=m.firstChild,M=1):Bk(m.nextSibling)?(x=m.nextSibling,M=0):Bk(m.previousSibling)?(x=m.previousSibling,M=m.previousSibling.data.length):(x=p,M=n.nodeIndex(m)+1):(x=p,M=n.nodeIndex(m)):y?m.hasChildNodes()?(x=m.firstChild,M=1):Bk(m.previousSibling)?(x=m.previousSibling,M=m.previousSibling.data.length):(x=p,M=n.nodeIndex(m)):(x=p,M=n.nodeIndex(m)),!y){const L=m.previousSibling,q=m.nextSibling;hn.each(hn.grep(m.childNodes),fe=>{Sn(fe)&&(fe.data=fe.data.replace(/\uFEFF/g,""))});let ae;for(;ae=n.get(c.id+"_"+i);)n.remove(ae,!0);if(Sn(q)&&Sn(L)&&!Gn.browser.isOpera()){const fe=L.data.length;L.appendData(q.data),n.remove(q),x=L,M=fe}}return he.some(Ht(x,M))}else return he.none()},Fk=(n,i)=>{const c=n.createRng();return TT(n,!0,i,c)&&TT(n,!1,i,c)?he.some({range:c,forward:x2(i)}):he.none()},AT=(n,i)=>{const c=Lk(n,"start",i),m=Lk(n,"end",i);return ri(c,m.or(c),(p,y)=>{const x=n.createRng();return x.setStart(vg(n,p.container()),p.offset()),x.setEnd(vg(n,y.container()),y.offset()),{range:x,forward:x2(i)}})},DT=(n,i)=>he.from(n.select(i.name)[i.index]).map(c=>{const m=n.createRng();return m.selectNode(c),{range:m,forward:!0}}),PT=(n,i)=>{const c=n.dom;if(i){if(i1(i))return Fk(c,i);if(bO(i))return KD(c,i);if($k(i))return AT(c,i);if(Nk(i))return DT(c,i);if(k2(i))return he.some({range:i.rng,forward:x2(i)})}return he.none()},JD=(n,i,c)=>y_(n,i,c),eP=(n,i)=>{PT(n,i).each(({range:c,forward:m})=>{n.setRng(c,m)})},zd=n=>Jn(n)&&n.tagName==="SPAN"&&n.getAttribute("data-mce-type")==="bookmark",Gs=(n=>i=>n===i)(Gr),xh=n=>n!==""&&` \f \r \v`.indexOf(n)!==-1,Sb=n=>!xh(n)&&!Gs(n)&&!i0(n),Qk=n=>({value:MT(n)}),MT=n=>ga(n,"#").toUpperCase(),vO=n=>{const i=n.toString(16);return(i.length===1?"0"+i:i).toUpperCase()},nP=n=>{const i=vO(n.red)+vO(n.green)+vO(n.blue);return Qk(i)},Zk=/^\s*rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)\s*$/i,j_=/^\s*rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?(?:\.\d+)?)\s*\)\s*$/i,E2=(n,i,c,m)=>({red:n,green:i,blue:c,alpha:m}),oP=(n,i,c,m)=>{const p=parseInt(n,10),y=parseInt(i,10),x=parseInt(c,10),M=parseFloat(m);return E2(p,y,x,M)},zk=n=>{if(n==="transparent")return he.some(E2(0,0,0,0));const i=Zk.exec(n);if(i!==null)return he.some(oP(i[1],i[2],i[3],"1"));const c=j_.exec(n);return c!==null?he.some(oP(c[1],c[2],c[3],c[4])):he.none()},q_=n=>zk(n).map(nP).map(i=>"#"+i.value).getOr(n),Hk=n=>{const i=[];if(n)for(let c=0;cRs(n,i=>{const c=ib(i);return c?[Ge.fromDom(c)]:[]}),RT=n=>Hk(n).length>1,Vk=n=>Dt(dI(n),Xm),OO=n=>pl(n,"td[data-mce-selected],th[data-mce-selected]"),T2=(n,i)=>{const c=OO(i);return c.length>0?c:Vk(n)},Cb=n=>T2(Hk(n.selection.getSel()),Ge.fromDom(n.getBody())),gp=(n,i)=>_e(n,"table",i),$T=n=>{const i=n.startContainer,c=n.startOffset;return Sn(i)?c===0?he.some(Ge.fromDom(i)):he.none():he.from(i.childNodes[c]).map(Ge.fromDom)},sP=n=>{const i=n.endContainer,c=n.endOffset;return Sn(i)?c===i.data.length?he.some(Ge.fromDom(i)):he.none():he.from(i.childNodes[c-1]).map(Ge.fromDom)},NT=n=>ii(n).fold(We([n]),i=>[n].concat(NT(i))),Wk=n=>Tu(n).fold(We([n]),i=>ei(i)==="br"?Sa(i).map(c=>[n].concat(Wk(c))).getOr([]):[n].concat(Wk(i))),yO=(n,i)=>ri($T(i),sP(i),(c,m)=>{const p=oo(NT(n),$e(pt,c)),y=oo(Wk(n),$e(pt,m));return p.isSome()&&y.isSome()}).getOr(!1),Uk=(n,i,c,m)=>{const p=c,y=new wi(c,p),x=Vt(n.schema.getMoveCaretBeforeOnEnterElements(),(L,q)=>!yt(["td","th","table"],q.toLowerCase()));let M=c;do{if(Sn(M)&&hn.trim(M.data).length!==0){m?i.setStart(M,0):i.setEnd(M,M.data.length);return}if(x[M.nodeName]){m?i.setStartBefore(M):M.nodeName==="BR"?i.setEndBefore(M):i.setEndAfter(M);return}}while(M=m?y.next():y.prev());p.nodeName==="BODY"&&(m?i.setStart(p,0):i.setEnd(p,p.childNodes.length))},G_=n=>{const i=n.selection.getSel();return Oe(i)&&i.rangeCount>0},Yk=(n,i)=>{const c=Cb(n);c.length>0?Ie(c,m=>{const p=m.dom,y=n.dom.createRng();y.setStartBefore(p),y.setEndAfter(p),i(y,!0)}):i(n.selection.getRng(),!1)},IT=(n,i,c)=>{const m=Sr(n,i);c(m),n.moveToBookmark(m)},A2=n=>rt(n==null?void 0:n.nodeType),Xk=n=>Jn(n)&&!zd(n)&&!Yc(n)&&!Td(n),rP=(n,i)=>{if(Xk(i)&&!/^(TD|TH)$/.test(i.nodeName)){const c=n.getAttrib(i,"data-mce-selected"),m=parseInt(c,10);return!isNaN(m)&&m>0}else return!1},pm=n=>n.isContentEditable===!0,BT=(n,i,c)=>{const{selection:m,dom:p}=n,y=m.getNode(),x=Ts(y);IT(m,!0,()=>{i()}),x&&Ts(y)&&p.isChildOf(y,n.getBody())?n.selection.select(y):c(m.getStart())&&iP(p,m)},iP=(n,i)=>{var c,m;const p=i.getRng(),{startContainer:y,startOffset:x}=p,M=i.getNode();if(!rP(n,M)&&Jn(y)){const L=y.childNodes,q=n.getRoot();let ae;if(x{if(n){const m=i?"nextSibling":"previousSibling";for(n=c?n:n[m];n;n=n[m])if(Jn(n)||!oc(n))return n}},Vl=(n,i)=>!!n.getTextBlockElements()[i.nodeName.toLowerCase()]||sg(n,i),bm=(n,i,c)=>n.schema.isValidChild(i,c),oc=(n,i=!1)=>{if(Oe(n)&&Sn(n)){const c=i?n.data.replace(/ /g,"\xA0"):n.data;return Km(c)}else return!1},vm=n=>Oe(n)&&Sn(n)&&n.length===0,LT=(n,i)=>{const c="[data-mce-cef-wrappable]",m=P0(n),p=nl(m)?c:`${c},${m}`;return Eu(Ge.fromDom(i),p)},D2=(n,i)=>{const c=n.dom;return Xk(i)&&c.getContentEditable(i)==="false"&<(n,i)&&c.select('[contenteditable="true"]',i).length===0},Eh=(n,i)=>ue(n)?n(i):(Oe(i)&&(n=n.replace(/%(\w+)/g,(c,m)=>i[m]||c)),n),K_=(n,i)=>(n=n||"",i=i||"",n=""+(n.nodeName||n),i=""+(i.nodeName||i),n.toLowerCase()===i.toLowerCase()),P2=(n,i)=>{if(Ae(n))return null;{let c=String(n);return(i==="color"||i==="backgroundColor")&&(c=q_(c)),i==="fontWeight"&&n===700&&(c="bold"),i==="fontFamily"&&(c=c.replace(/[\'\"]/g,"").replace(/,\s+/g,",")),c}},M2=(n,i,c)=>{const m=n.getStyle(i,c);return P2(m,c)},jk=(n,i)=>{let c;return n.getParent(i,m=>Jn(m)?(c=n.getStyle(m,"text-decoration"),!!c&&c!=="none"):!1),c},R2=(n,i,c)=>n.getParents(i,c,n.getRoot()),J_=(n,i,c)=>{const m=n.formatter.get(i);return Oe(m)&&Wt(m,c)},qk=(n,i)=>J_(n,i,m=>{const p=y=>ue(y)||y.length>1&&y.charAt(0)==="%";return Wt(["styles","attributes"],y=>Oo(m,y).exists(x=>{const M=ne(x)?x:uo(x);return Wt(M,p)}))}),aP=(n,i,c)=>{const m=["inline","block","selector","attributes","styles","classes"],p=y=>Vt(y,(x,M)=>Wt(m,L=>L===M));return J_(n,i,y=>{const x=p(y);return J_(n,c,M=>{const L=p(M);return Eo(x,L)})})},Om=n=>os(n,"block"),eS=n=>Om(n)&&n.wrapper===!0,$2=n=>Om(n)&&n.wrapper!==!0,ld=n=>os(n,"selector"),Ml=n=>os(n,"inline"),Gk=n=>ld(n)&&Ml(n)&&qr(Oo(n,"mixed"),!0),N2=n=>ld(n)&&n.expand!==!1&&!Ml(n),Hd=zd,I2=R2,Kk=oc,Jk=Vl,lP=n=>mi(n)&&n.getAttribute("data-mce-bogus")&&!n.nextSibling,FT=(n,i)=>{let c=i;for(;c;){if(Jn(c)&&n.getContentEditable(c))return n.getContentEditable(c)==="false"?c:i;c=c.parentNode}return i},B2=(n,i,c,m)=>{const p=i.data;if(n){for(let y=c;y>0;y--)if(m(p.charAt(y-1)))return y}else for(let y=c;yB2(n,i,c,m=>Gs(m)||xh(m)),cP=(n,i,c)=>B2(n,i,c,Sb),kb=(n,i,c,m,p,y)=>{let x;const M=n.getParent(c,n.isBlock)||i,L=(ae,fe,be)=>{const Le=lp(n),Ye=p?Le.backwards:Le.forwards;return he.from(Ye(ae,fe,(Pe,He)=>Hd(Pe.parentNode)?-1:(x=Pe,be(p,Pe,He)),M))};return L(c,m,QT).bind(ae=>y?L(ae.container,ae.offset+(p?-1:0),cP):he.some(ae)).orThunk(()=>x?he.some({container:x,offset:p?0:x.length}):he.none())},Xc=(n,i,c,m,p)=>{const y=m[p];Sn(m)&&nl(m.data)&&y&&(m=y);const x=I2(n,m);for(let M=0;M{var p;let y=c;const x=n.getRoot(),M=i[0];if(Om(M)&&(y=M.wrapper?null:n.getParent(c,M.block,x)),!y){const L=(p=n.getParent(c,"LI,TD,TH"))!==null&&p!==void 0?p:x;y=n.getParent(Sn(c)?c.parentNode:c,q=>q!==x&&Jk(n.schema,q),L)}if(y&&Om(M)&&M.wrapper&&(y=I2(n,y,"ul,ol").reverse()[0]||y),!y)for(y=c;y&&y[m]&&!n.isBlock(y[m])&&(y=y[m],!K_(y,"br")););return y||c},Vd=(n,i,c,m)=>{const p=c.parentNode;return Oe(c[m])?!1:p===i||Ae(p)||n.isBlock(p)?!0:Vd(n,i,p,m)},cd=(n,i,c,m,p)=>{let y=c;const x=p?"previousSibling":"nextSibling",M=n.getRoot();if(Sn(c)&&!Kk(c)&&(p?m>0:mHd(n.parentNode)||Hd(n),z0=(n,i,c,m=!1)=>{let{startContainer:p,startOffset:y,endContainer:x,endOffset:M}=i;const L=c[0];return Jn(p)&&p.hasChildNodes()&&(p=sd(p,y),Sn(p)&&(y=0)),Jn(x)&&x.hasChildNodes()&&(x=sd(x,i.collapsed?M:M-1),Sn(x)&&(M=x.data.length)),p=FT(n,p),x=FT(n,x),tS(p)&&(p=Hd(p)?p:p.parentNode,i.collapsed?p=p.previousSibling||p:p=p.nextSibling||p,Sn(p)&&(y=i.collapsed?p.length:0)),tS(x)&&(x=Hd(x)?x:x.parentNode,i.collapsed?x=x.nextSibling||x:x=x.previousSibling||x,Sn(x)&&(M=i.collapsed?0:x.length)),i.collapsed&&(kb(n,n.getRoot(),p,y,!0,m).each(({container:fe,offset:be})=>{p=fe,y=be}),kb(n,n.getRoot(),x,M,!1,m).each(({container:fe,offset:be})=>{x=fe,M=be})),(Ml(L)||L.block_expand)&&((!Ml(L)||!Sn(p)||y===0)&&(p=cd(n,c,p,y,!0)),(!Ml(L)||!Sn(x)||M===x.data.length)&&(x=cd(n,c,x,M,!1))),N2(L)&&(p=Xc(n,c,i,p,"previousSibling"),x=Xc(n,c,i,x,"nextSibling")),(Om(L)||ld(L))&&(p=Th(n,c,p,"previousSibling"),x=Th(n,c,x,"nextSibling"),Om(L)&&(n.isBlock(p)||(p=cd(n,c,p,y,!0)),n.isBlock(x)||(x=cd(n,c,x,M,!1)))),Jn(p)&&p.parentNode&&(y=n.nodeIndex(p),p=p.parentNode),Jn(x)&&x.parentNode&&(M=n.nodeIndex(x)+1,x=x.parentNode),{startContainer:p,startOffset:y,endContainer:x,endOffset:M}},a1=(n,i,c)=>{var m;const p=i.startOffset,y=sd(i.startContainer,p),x=i.endOffset,M=sd(i.endContainer,x-1),L=He=>{const dt=He[0];Sn(dt)&&dt===y&&p>=dt.data.length&&He.splice(0,1);const bt=He[He.length-1];return x===0&&He.length>0&&bt===M&&Sn(bt)&&He.splice(He.length-1,1),He},q=(He,dt,bt)=>{const _t=[];for(;He&&He!==bt;He=He[dt])_t.push(He);return _t},ae=(He,dt)=>n.getParent(He,bt=>bt.parentNode===dt,dt),fe=(He,dt,bt)=>{const _t=bt?"nextSibling":"previousSibling";for(let Mt=He,dn=Mt.parentNode;Mt&&Mt!==dt;Mt=dn){dn=Mt.parentNode;const zn=q(Mt===He?Mt:Mt[_t],_t);zn.length&&(bt||zn.reverse(),c(L(zn)))}};if(y===M)return c(L([y]));const be=(m=n.findCommonAncestor(y,M))!==null&&m!==void 0?m:n.getRoot();if(n.isChildOf(y,M))return fe(y,be,!0);if(n.isChildOf(M,y))return fe(M,be);const Le=ae(y,be)||y,Ye=ae(M,be)||M;fe(y,Le,!0);const Pe=q(Le===y?Le:Le.nextSibling,"nextSibling",Ye===M?Ye.nextSibling:Ye);Pe.length&&c(L(Pe)),fe(M,Ye)},uP=['pre[class*=language-][contenteditable="false"]',"figure.image","div[data-ephox-embed-iri]","div.tiny-pageembed","div.mce-toc","div[data-mce-toc]"],ex=n=>ol(n)&&zc(n)===Ft,fP=(n,i,c,m)=>fi(i).fold(()=>"skipping",p=>m==="br"||ex(i)?"valid":GC(i)?"existing":Yc(i.dom)?"caret":Wt(uP,y=>Eu(i,y))?"valid-block":!bm(n,c,m)||!bm(n,ei(p),c)?"invalid-child":"valid"),ZT=(n,i)=>{const c=z0(n.dom,i,[{inline:"span"}]);i.setStart(c.startContainer,c.startOffset),i.setEnd(c.endContainer,c.endOffset),n.selection.setRng(i)},zT=(n,i,c,m,p,y)=>{const{uid:x=i,...M}=c;qu(n,od()),Pr(n,`${qp()}`,x),Pr(n,`${af()}`,m);const{attributes:L={},classes:q=[]}=p(x,M);if(ju(n,L),Vv(n,q),y){q.length>0&&Pr(n,`${_0()}`,q.join(","));const ae=bs(L);ae.length>0&&Pr(n,`${S0()}`,ae.join(","))}},HT=n=>{Qc(n,od()),Vi(n,`${qp()}`),Vi(n,`${af()}`),Vi(n,`${sb()}`);const i=Ha(n,`${S0()}`).map(m=>m.split(",")).getOr([]),c=Ha(n,`${_0()}`).map(m=>m.split(",")).getOr([]);Ie(i,m=>Vi(n,m)),Wy(n,c),Vi(n,`${_0()}`),Vi(n,`${S0()}`)},nS=(n,i,c,m,p)=>{const y=Ge.fromTag("span",n);return zT(y,i,c,m,p,!1),y},tx=(n,i,c,m,p,y)=>{const x=[],M=nS(n.getDoc(),c,y,m,p),L=Oh(),q=()=>{L.clear()},ae=()=>L.get().getOrThunk(()=>{const Ye=lg(M);return x.push(Ye),L.set(Ye),Ye}),fe=Ye=>{Ie(Ye,be)},be=Ye=>{switch(fP(n,Ye,"span",ei(Ye))){case"invalid-child":{q();const He=Da(Ye);fe(He),q();break}case"valid-block":{q(),zT(Ye,c,y,m,p,!0);break}case"valid":{const He=ae();Jb(Ye,He);break}}},Le=Ye=>{const Pe=mt(Ye,Ge.fromDom);fe(Pe)};return a1(n.dom,i,Ye=>{q(),Le(Ye)}),x},Mi=(n,i,c,m)=>{n.undoManager.transact(()=>{const p=n.selection,y=p.getRng(),x=Cb(n).length>0,M=Li("mce-annotation");if(y.collapsed&&!x&&ZT(n,y),p.getRng().collapsed&&!x){const L=nS(n.getDoc(),M,m,i,c.decorate);Tf(L,Gr),p.getRng().insertNode(L.dom),p.select(L.dom)}else IT(p,!1,()=>{Yk(n,L=>{tx(n,L,M,i,c.decorate,m)})})})},l1=n=>{const i=Hv();CT(n,i);const c=c_(n,i),m=kc("span"),p=y=>{Ie(y,x=>{m(x)?Gl(x):HT(x)})};return{register:(y,x)=>{i.register(y,x)},annotate:(y,x)=>{i.lookup(y).each(M=>{Mi(n,y,M,x)})},annotationChanged:(y,x)=>{c.addListener(y,x)},remove:y=>{Hy(n,he.some(y)).each(({elements:x})=>{const M=n.selection.getBookmark();p(x),n.selection.moveToBookmark(M)})},removeAll:y=>{const x=n.selection.getBookmark();ln(Vy(n,y),(M,L)=>{p(M)}),n.selection.moveToBookmark(x)},getAll:y=>{const x=Vy(n,y);return vs(x,M=>mt(M,L=>L.dom))}}},wO=n=>({getBookmark:$e(JD,n),moveToBookmark:$e(eP,n)});wO.isBookmarkNode=zd;const nx=(n,i,c)=>c.collapsed?!1:Wt(c.getClientRects(),m=>rb(m,n,i)),VT=(n,i)=>n.dispatch("PreProcess",i),ox=(n,i)=>n.dispatch("PostProcess",i),WT=n=>{n.dispatch("remove")},oS=n=>{n.dispatch("detach")},dP=(n,i)=>{n.dispatch("SwitchMode",{mode:i})},hP=(n,i,c,m,p)=>{n.dispatch("ObjectResizeStart",{target:i,width:c,height:m,origin:p})},UT=(n,i,c,m,p)=>{n.dispatch("ObjectResized",{target:i,width:c,height:m,origin:p})},mP=n=>{n.dispatch("PreInit")},sx=n=>{n.dispatch("PostRender")},_O=n=>{n.dispatch("Init")},SO=(n,i)=>{n.dispatch("PlaceholderToggle",{state:i})},sS=(n,i,c)=>{n.dispatch(i,c)},YT=(n,i,c,m)=>{n.dispatch("FormatApply",{format:i,node:c,vars:m})},Ah=(n,i,c,m)=>{n.dispatch("FormatRemove",{format:i,node:c,vars:m})},jc=(n,i)=>n.dispatch("BeforeSetContent",i),vu=(n,i)=>n.dispatch("SetContent",i),pp=(n,i)=>n.dispatch("BeforeGetContent",i),gP=(n,i)=>n.dispatch("GetContent",i),pP=(n,i)=>{n.dispatch("AutocompleterStart",i)},bP=(n,i)=>{n.dispatch("AutocompleterUpdate",i)},ir=n=>{n.dispatch("AutocompleterEnd")},vP=(n,i,c)=>n.dispatch("PastePreProcess",{content:i,internal:c}),XT=(n,i,c)=>n.dispatch("PastePostProcess",{node:i,internal:c}),rS=(n,i)=>n.dispatch("PastePlainTextToggle",{state:i}),OP=(n,i)=>n.dispatch("EditableRootStateChange",{state:i}),to={BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,ESC:27,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,modifierPressed:n=>n.shiftKey||n.ctrlKey||n.altKey||to.metaKeyPressed(n),metaKeyPressed:n=>Gn.os.isMacOS()||Gn.os.isiOS()?n.metaKey:n.ctrlKey&&!n.altKey},H0="data-mce-selected",yP="table,img,figure.image,hr,video,span.mce-preview-object,details",jT=Math.abs,iS=Math.round,L2={nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]},rx=n=>n.type==="longpress"||n.type.indexOf("touch")===0,ix=(n,i)=>{const c=i.dom,m=i.getDoc(),p=document,y=i.getBody();let x,M,L,q,ae,fe,be,Le,Ye,Pe,He,dt,bt,_t,Mt,dn,zn;const Nn=Tn=>Oe(Tn)&&(Ui(Tn)||c.is(Tn,"figure.image")),Lt=Tn=>ef(Tn)||c.hasClass(Tn,"mce-preview-object"),Zt=(Tn,jo)=>{if(rx(Tn)){const Ks=Tn.touches[0];return Nn(Tn.target)&&!nx(Ks.clientX,Ks.clientY,jo)}else return Nn(Tn.target)&&!nx(Tn.clientX,Tn.clientY,jo)},yn=Tn=>{const jo=Tn.target;Zt(Tn,i.selection.getRng())&&!Tn.isDefaultPrevented()&&i.selection.select(jo)},go=Tn=>c.hasClass(Tn,"mce-preview-object")&&Oe(Tn.firstElementChild)?[Tn,Tn.firstElementChild]:c.is(Tn,"figure.image")?[Tn.querySelector("img")]:[Tn],Po=Tn=>{const jo=f2(i);return!jo||Tn.getAttribute("data-mce-resize")==="false"||Tn===i.getBody()?!1:c.hasClass(Tn,"mce-preview-object")&&Oe(Tn.firstElementChild)?Eu(Ge.fromDom(Tn.firstElementChild),jo):Eu(Ge.fromDom(Tn),jo)},Cs=Tn=>Lt(Tn)?c.create("img",{src:Gn.transparentSrc}):Tn.cloneNode(!0),Ws=(Tn,jo,Ks)=>{if(Oe(Ks)){const Kr=go(Tn);Ie(Kr,co=>{co.style[jo]||!i.schema.isValid(co.nodeName.toLowerCase(),jo)?c.setStyle(co,jo,Ks):c.setAttrib(co,jo,""+Ks)})}},Ir=(Tn,jo,Ks)=>{Ws(Tn,"width",jo),Ws(Tn,"height",Ks)},pi=Tn=>{let jo,Ks,Kr,co,Us;jo=Tn.screenX-fe,Ks=Tn.screenY-be,_t=jo*q[2]+Pe,Mt=Ks*q[3]+He,_t=_t<5?5:_t,Mt=Mt<5?5:Mt,(Nn(x)||Lt(x))&&Ac(i)!==!1?Kr=!to.modifierPressed(Tn):Kr=to.modifierPressed(Tn),Kr&&(jT(jo)>jT(Ks)?(Mt=iS(_t*dt),_t=iS(Mt/dt)):(_t=iS(Mt/dt),Mt=iS(_t*dt))),Ir(M,_t,Mt),co=q.startPos.x+jo,Us=q.startPos.y+Ks,co=co>0?co:0,Us=Us>0?Us:0,c.setStyles(L,{left:co,top:Us,display:"block"}),L.innerHTML=_t+" × "+Mt,q[2]<0&&M.clientWidth<=_t&&c.setStyle(M,"left",Le+(Pe-_t)),q[3]<0&&M.clientHeight<=Mt&&c.setStyle(M,"top",Ye+(He-Mt)),jo=y.scrollWidth-dn,Ks=y.scrollHeight-zn,jo+Ks!==0&&c.setStyles(L,{left:co-jo,top:Us-Ks}),bt||(hP(i,x,Pe,He,"corner-"+q.name),bt=!0)},ul=()=>{const Tn=bt;bt=!1,Tn&&(Ws(x,"width",_t),Ws(x,"height",Mt)),c.unbind(m,"mousemove",pi),c.unbind(m,"mouseup",ul),p!==m&&(c.unbind(p,"mousemove",pi),c.unbind(p,"mouseup",ul)),c.remove(M),c.remove(L),c.remove(ae),Il(x),Tn&&(UT(i,x,_t,Mt,"corner-"+q.name),c.setAttrib(x,"style",c.getAttrib(x,"style"))),i.nodeChanged()},Il=Tn=>{Is();const jo=c.getPos(Tn,y),Ks=jo.x,Kr=jo.y,co=Tn.getBoundingClientRect(),Us=co.width||co.right-co.left,ci=co.height||co.bottom-co.top;x!==Tn&&(Mn(),x=Tn,_t=Mt=0);const Ka=i.dispatch("ObjectSelected",{target:Tn});Po(Tn)&&!Ka.isDefaultPrevented()?ln(L2,(Ei,Pc)=>{const Ih=Tm=>{const jO=go(x)[0];fe=Tm.screenX,be=Tm.screenY,Pe=jO.clientWidth,He=jO.clientHeight,dt=He/Pe,q=Ei,q.name=Pc,q.startPos={x:Us*Ei[0]+Ks,y:ci*Ei[1]+Kr},dn=y.scrollWidth,zn=y.scrollHeight,ae=c.add(y,"div",{class:"mce-resize-backdrop","data-mce-bogus":"all"}),c.setStyles(ae,{position:"fixed",left:"0",top:"0",width:"100%",height:"100%"}),M=Cs(x),c.addClass(M,"mce-clonedresizable"),c.setAttrib(M,"data-mce-bogus","all"),M.contentEditable="false",c.setStyles(M,{left:Ks,top:Kr,margin:0}),Ir(M,Us,ci),M.removeAttribute(H0),y.appendChild(M),c.bind(m,"mousemove",pi),c.bind(m,"mouseup",ul),p!==m&&(c.bind(p,"mousemove",pi),c.bind(p,"mouseup",ul)),L=c.add(y,"div",{class:"mce-resize-helper","data-mce-bogus":"all"},Pe+" × "+He)};let Yd=c.get("mceResizeHandle"+Pc);Yd&&c.remove(Yd),Yd=c.add(y,"div",{id:"mceResizeHandle"+Pc,"data-mce-bogus":"all",class:"mce-resizehandle",unselectable:!0,style:"cursor:"+Pc+"-resize; margin:0; padding:0"}),c.bind(Yd,"mousedown",Tm=>{Tm.stopImmediatePropagation(),Tm.preventDefault(),Ih(Tm)}),Ei.elm=Yd,c.setStyles(Yd,{left:Us*Ei[0]+Ks-Yd.offsetWidth/2,top:ci*Ei[1]+Kr-Yd.offsetHeight/2})}):Mn(!1)},bc=w0(Il,0),Mn=(Tn=!0)=>{bc.cancel(),Is(),x&&Tn&&x.removeAttribute(H0),ln(L2,(jo,Ks)=>{const Kr=c.get("mceResizeHandle"+Ks);Kr&&(c.unbind(Kr),c.remove(Kr))})},eo=(Tn,jo)=>c.isChildOf(Tn,jo),Cr=Tn=>{if(bt||i.removed||i.composing)return;const jo=Tn.type==="mousedown"?Tn.target:n.getNode(),Ks=it(Ge.fromDom(jo),yP).map(co=>co.dom).filter(co=>c.isEditable(co.parentElement)).getOrUndefined(),Kr=Oe(Ks)?c.getAttrib(Ks,H0,"1"):"1";if(Ie(c.select(`img[${H0}],hr[${H0}]`),co=>{co.removeAttribute(H0)}),Oe(Ks)&&eo(Ks,y)&&i.hasFocus()){ko();const co=n.getStart(!0);if(eo(co,Ks)&&eo(n.getEnd(!0),Ks)){c.setAttrib(Ks,H0,Kr),bc.throttle(Ks);return}}Mn()},Is=()=>{ln(L2,Tn=>{Tn.elm&&(c.unbind(Tn.elm),delete Tn.elm)})},ko=()=>{try{i.getDoc().execCommand("enableObjectResizing",!1,"false")}catch{}};return i.on("init",()=>{ko(),i.on("NodeChange ResizeEditor ResizeWindow ResizeContent drop",Cr),i.on("keyup compositionend",Tn=>{x&&x.nodeName==="TABLE"&&Cr(Tn)}),i.on("hide blur",Mn),i.on("contextmenu longpress",yn,!0)}),i.on("remove",Is),{isResizable:Po,showResizeRect:Il,hideResizeRect:Mn,updateResizeRect:Cr,destroy:()=>{bc.cancel(),x=M=ae=null}}},wP=(n,i)=>{i.fold(c=>{n.setStartBefore(c.dom)},(c,m)=>{n.setStart(c.dom,m)},c=>{n.setStartAfter(c.dom)})},hI=(n,i)=>{i.fold(c=>{n.setEndBefore(c.dom)},(c,m)=>{n.setEnd(c.dom,m)},c=>{n.setEndAfter(c.dom)})},qT=(n,i,c)=>{const m=n.document.createRange();return wP(m,i),hI(m,c),m},GT=(n,i,c,m,p)=>{const y=n.document.createRange();return y.setStart(i.dom,c),y.setEnd(m.dom,p),y},aS=mg.generate([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),_P=(n,i,c)=>i(Ge.fromDom(c.startContainer),c.startOffset,Ge.fromDom(c.endContainer),c.endOffset),Jo=(n,i)=>i.match({domRange:c=>({ltr:We(c),rtl:he.none}),relative:(c,m)=>({ltr:Ut(()=>qT(n,c,m)),rtl:Ut(()=>he.some(qT(n,m,c)))}),exact:(c,m,p,y)=>({ltr:Ut(()=>GT(n,c,m,p,y)),rtl:Ut(()=>he.some(GT(n,p,y,c,m)))})}),SP=(n,i)=>{const c=i.ltr();return c.collapsed?i.rtl().filter(p=>p.collapsed===!1).map(p=>aS.rtl(Ge.fromDom(p.endContainer),p.endOffset,Ge.fromDom(p.startContainer),p.startOffset)).getOrThunk(()=>_P(n,aS.ltr,c)):_P(n,aS.ltr,c)},CP=(n,i)=>{const c=Jo(n,i);return SP(n,c)};aS.ltr,aS.rtl;const F2={create:(n,i,c,m)=>({start:n,soffset:i,finish:c,foffset:m})},lS=(n,i,c)=>{var m,p;return he.from((p=(m=n.dom).caretPositionFromPoint)===null||p===void 0?void 0:p.call(m,i,c)).bind(y=>{if(y.offsetNode===null)return he.none();const x=n.dom.createRange();return x.setStart(y.offsetNode,y.offset),x.collapse(),he.some(x)})},kP=(n,i,c)=>{var m,p;return he.from((p=(m=n.dom).caretRangeFromPoint)===null||p===void 0?void 0:p.call(m,i,c))},xP=(()=>document.caretPositionFromPoint?lS:document.caretRangeFromPoint?kP:he.none)(),EP=(n,i,c)=>{const m=Ge.fromDom(n.document);return xP(m,i,c).map(p=>F2.create(Ge.fromDom(p.startContainer),p.startOffset,Ge.fromDom(p.endContainer),p.endOffset))},Q2=mg.generate([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),ax=(n,i,c,m)=>n.fold(i,c,m),KT=n=>n.fold(Ct,Ct,Ct),lx=Q2.before,cx=Q2.on,JT=Q2.after,c1={before:lx,on:cx,after:JT,cata:ax,getStart:KT},CO=mg.generate([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),ux=n=>CO.exact(n.start,n.soffset,n.finish,n.foffset),TP=n=>n.match({domRange:i=>Ge.fromDom(i.startContainer),relative:(i,c)=>c1.getStart(i),exact:(i,c,m,p)=>i}),AP=CO.domRange,Nr=CO.relative,fx=CO.exact,bp=n=>{const i=TP(n);return Yr(i)},vp=F2.create,u1={domRange:AP,relative:Nr,exact:fx,exactFromRange:ux,getWin:bp,range:vp},Fu=(n,i)=>{const c=ei(n);return c==="input"?c1.after(n):yt(["br","img"],c)?i===0?c1.before(n):c1.after(n):c1.on(n,i)},cS=(n,i)=>{const c=n.fold(c1.before,Fu,c1.after),m=i.fold(c1.before,Fu,c1.after);return u1.relative(c,m)},kO=(n,i,c,m)=>{const p=Fu(n,i),y=Fu(c,m);return u1.relative(p,y)},uS=n=>n.match({domRange:i=>{const c=Ge.fromDom(i.startContainer),m=Ge.fromDom(i.endContainer);return kO(c,i.startOffset,m,i.endOffset)},relative:cS,exact:kO}),V0=(n,i)=>{const m=(i||document).createDocumentFragment();return Ie(n,p=>{m.appendChild(p.dom)}),Ge.fromDom(m)},DP=n=>{const i=u1.getWin(n).dom,c=(p,y,x,M)=>GT(i,p,y,x,M),m=uS(n);return CP(i,m).match({ltr:c,rtl:c})},gI=(n,i,c)=>EP(n,i,c),PP=(n,i,c)=>{const m=Yr(Ge.fromDom(c));return gI(m.dom,n,i).map(p=>{const y=c.createRange();return y.setStart(p.start.dom,p.soffset),y.setEnd(p.finish.dom,p.foffset),y}).getOrUndefined()},eA=(n,i)=>Oe(n)&&Oe(i)&&n.startContainer===i.startContainer&&n.startOffset===i.startOffset&&n.endContainer===i.endContainer&&n.endOffset===i.endOffset,ar=(n,i,c)=>{let m=n;for(;m&&m!==i;){if(c(m))return m;m=m.parentNode}return null},ym=(n,i,c)=>ar(n,i,c)!==null,xO=(n,i,c)=>ym(n,i,m=>m.nodeName===c),MP=(n,i)=>_r(n)&&!ym(n,i,Yc),W0=(n,i,c)=>{const m=i.parentNode;if(m){const p=new wi(i,n.getParent(m,n.isBlock)||n.getRoot());let y;for(;y=p[c?"prev":"next"]();)if(mi(y))return!0}return!1},dr=(n,i)=>{var c;return((c=n.previousSibling)===null||c===void 0?void 0:c.nodeName)===i},RP=(n,i)=>{let c=i;for(;c&&c!==n;){if(Ts(c))return!0;c=c.parentNode}return!1},fS=(n,i,c,m,p)=>{const y=n.getRoot(),x=n.schema.getNonEmptyElements(),M=p.parentNode;let L,q;if(!M)return he.none();const ae=n.getParent(M,n.isBlock)||y;if(m&&mi(p)&&i&&n.isEmpty(ae))return he.some(Ht(M,n.nodeIndex(p)));const fe=new wi(p,ae);for(;q=fe[m?"prev":"next"]();){if(n.getContentEditableParent(q)==="false"||MP(q,y))return he.none();if(Sn(q)&&q.data.length>0)return xO(q,y,"A")?he.none():he.some(Ht(q,m?q.data.length:0));if(n.isBlock(q)||x[q.nodeName.toLowerCase()])return he.none();L=q}return ih(L)?he.none():c&&L?he.some(Ht(L,0)):he.none()},dS=(n,i,c,m)=>{const p=n.getRoot();let y,x=!1,M=c?m.startContainer:m.endContainer,L=c?m.startOffset:m.endOffset;const q=Jn(M)&&L===M.childNodes.length,ae=n.schema.getNonEmptyElements();let fe=c;if(_r(M))return he.none();if(Jn(M)&&L>M.childNodes.length-1&&(fe=!1),Ju(M)&&(M=p,L=0),M===p){if(fe&&(y=M.childNodes[L>0?L-1:0],y&&(_r(y)||ae[y.nodeName]||Mu(y))))return he.none();if(M.hasChildNodes()){if(L=Math.min(!fe&&L>0?L-1:L,M.childNodes.length-1),M=M.childNodes[L],L=Sn(M)&&q?M.data.length:0,!i&&M===p.lastChild&&Mu(M)||RP(p,M)||_r(M))return he.none();if(M.hasChildNodes()&&!Mu(M)){y=M;const be=new wi(M,p);do{if(Ts(y)||_r(y)){x=!1;break}if(Sn(y)&&y.data.length>0){L=fe?0:y.data.length,M=y,x=!0;break}if(ae[y.nodeName.toLowerCase()]&&!xl(y)){L=n.nodeIndex(y),M=y.parentNode,fe||L++,x=!0;break}}while(y=fe?be.next():be.prev())}}}return i&&(Sn(M)&&L===0&&fS(n,q,i,!0,M).each(be=>{M=be.container(),L=be.offset(),x=!0}),Jn(M)&&(y=M.childNodes[L],y||(y=M.childNodes[L-1]),y&&mi(y)&&!dr(y,"A")&&!W0(n,y,!1)&&!W0(n,y,!0)&&fS(n,q,i,!0,y).each(be=>{M=be.container(),L=be.offset(),x=!0}))),fe&&!i&&Sn(M)&&L===M.data.length&&fS(n,q,i,!1,M).each(be=>{M=be.container(),L=be.offset(),x=!0}),x&&M?he.some(Ht(M,L)):he.none()},hS=(n,i)=>{const c=i.collapsed,m=i.cloneRange(),p=Ht.fromRangeStart(i);return dS(n,c,!0,m).each(y=>{(!c||!Ht.isAbove(p,y))&&m.setStart(y.container(),y.offset())}),c||dS(n,c,!1,m).each(y=>{m.setEnd(y.container(),y.offset())}),c&&m.collapse(!0),eA(i,m)?he.none():he.some(m)},f1=(n,i)=>n.splitText(i),Op=n=>{let i=n.startContainer,c=n.startOffset,m=n.endContainer,p=n.endOffset;if(i===m&&Sn(i)){if(c>0&&cc){p=p-c;const y=f1(m,p).previousSibling;i=m=y,p=y.data.length,c=0}else p=0}else if(Sn(i)&&c>0&&c0&&p({walk:(y,x)=>a1(n,y,x),split:Op,expand:(y,x={type:"word"})=>{if(x.type==="word"){const M=z0(n,y,[{inline:"span"}]),L=n.createRng();return L.setStart(M.startContainer,M.startOffset),L.setEnd(M.endContainer,M.endOffset),L}return y},normalize:y=>hS(n,y).fold(Xe,x=>(y.setStart(x.startContainer,x.startOffset),y.setEnd(x.endContainer,x.endOffset),!0))});O.compareRanges=eA,O.getCaretRangeFromPoint=PP,O.getSelectedNode=ib,O.getNode=sd;const D=((n,i)=>{const c=(M,L)=>{if(!rt(L)&&!L.match(/^[0-9]+$/))throw new Error(n+".set accepts only positive integer values. Value was "+L);const q=M.dom;ss(q)&&(q.style[n]=L+"px")},m=M=>{const L=i(M);if(L<=0||L===null){const q=Bi(M,n);return parseFloat(q)||0}return L},p=m,y=(M,L)=>Hn(L,(q,ae)=>{const fe=Bi(M,ae),be=fe===void 0?0:parseInt(fe,10);return isNaN(be)?q:q+be},0);return{set:c,get:m,getOuter:p,aggregate:y,max:(M,L,q)=>{const ae=y(M,q);return L>ae?L-ae:0}}})("height",n=>{const i=n.dom;return kd(n)?i.getBoundingClientRect().height:i.offsetHeight}),N=n=>D.get(n),Y=()=>Ge.fromDom(document),se=(n,i)=>n.view(i).fold(We([]),m=>{const p=n.owner(m),y=se(n,p);return[m].concat(y)}),pe=(n,i)=>{const c=i.owner(n);return se(i,c)};var ot=Object.freeze({__proto__:null,view:n=>{var i;return(n.dom===document?he.none():he.from((i=n.dom.defaultView)===null||i===void 0?void 0:i.frameElement)).map(Ge.fromDom)},owner:n=>Ao(n)});const kt=n=>{const i=Y(),c=Ku(i),m=pe(n,ot),p=Pu(n),y=Dn(m,(x,M)=>{const L=Pu(M);return{left:x.left+L.left,top:x.top+L.top}},{left:0,top:0});return Ug(y.left+p.left+c.left,y.top+p.top+c.top)},fn=n=>ei(n)==="textarea",jn=(n,i)=>n.dispatch("ScrollIntoView",i).isDefaultPrevented(),Un=(n,i)=>{n.dispatch("AfterScrollIntoView",i)},sn=(n,i)=>{const c=Da(n);if(c.length===0||fn(n))return{element:n,offset:i};if(i{const c=ky(n),m=N(n);return{element:n,bottom:c.top+m,height:m,pos:c,cleanup:i}},en=(n,i)=>{const c=sn(n,i),m=Ge.fromHtml(''+Ft+"");return Ca(c.element,m),Yn(m,()=>wr(m))},mo=n=>Yn(Ge.fromDom(n),St),ls=(n,i,c,m)=>{wl(n,(p,y)=>da(n,i,c,m),c)},Ds=(n,i,c,m,p)=>{const y={elm:m.element.dom,alignToTop:p};if(jn(n,y))return;const x=Ku(i).top;c(n,i,x,m,p),Un(n,y)},da=(n,i,c,m)=>{const p=Ge.fromDom(n.getBody()),y=Ge.fromDom(n.getDoc());Wi(p);const x=en(Ge.fromDom(c.startContainer),c.startOffset);Ds(n,y,i,x,m),x.cleanup()},Rl=(n,i,c,m)=>{const p=Ge.fromDom(n.getDoc());Ds(n,p,c,mo(i),m)},wl=(n,i,c)=>{const m=c.startContainer,p=c.startOffset,y=c.endContainer,x=c.endOffset;i(Ge.fromDom(m),Ge.fromDom(y));const M=n.dom.createRng();M.setStart(m,p),M.setEnd(y,x),n.selection.setRng(c)},Qu=(n,i,c,m,p)=>{const y=i.pos;if(m)t0(y.left,y.top,p);else{const x=y.top-c+i.height;t0(-n.getBody().getBoundingClientRect().left,x,p)}},U0=(n,i,c,m,p,y)=>{const x=m+c,M=p.pos.top,L=p.bottom,q=L-M>=m;Mx?Qu(n,p,m,q?y!==!1:y===!0,i):L>x&&!q&&Qu(n,p,m,y===!0,i)},Z2=(n,i,c,m,p)=>{const y=Yr(i).dom.innerHeight;U0(n,i,c,y,m,p)},mS=(n,i,c,m,p)=>{const y=Yr(i).dom.innerHeight;U0(n,i,c,y,m,p);const x=kt(m.element),M=Kf(window);x.topM.bottom&&n0(m.element,p===!0)},gS=(n,i,c)=>ls(n,Z2,i,c),ki=(n,i,c)=>Rl(n,i,Z2,c),Zu=(n,i,c)=>ls(n,mS,i,c),mf=(n,i,c)=>Rl(n,i,mS,c),wm=(n,i,c)=>{(n.inline?ki:mf)(n,i,c)},gf=(n,i,c)=>{(n.inline?gS:Zu)(n,i,c)},Y0=n=>n.dom.focus(),zu=n=>{const i=jl(n).dom;return n.dom===i.activeElement},z2=(n=Y())=>he.from(n.dom.activeElement).map(Ge.fromDom),H2=n=>z2(jl(n)).filter(i=>n.dom.contains(i.dom)),Og=(n,i)=>{const c=ol(i)?zc(i).length:Da(i).length+1;return n>c?c:n<0?0:n},pc=n=>u1.range(n.start,Og(n.soffset,n.start),n.finish,Og(n.foffset,n.finish)),dx=(n,i)=>!Ed(i.dom)&&(cn(n,i)||pt(n,i)),tA=n=>i=>dx(n,i.start)&&dx(n,i.finish),nA=n=>n.inline||Gn.browser.isFirefox(),oA=n=>u1.range(Ge.fromDom(n.startContainer),n.startOffset,Ge.fromDom(n.endContainer),n.endOffset),$P=n=>{const i=n.getSelection();return(!i||i.rangeCount===0?he.none():he.from(i.getRangeAt(0))).map(oA)},hx=n=>{const i=Yr(n);return $P(i.dom).filter(tA(n))},NP=(n,i)=>he.from(i).filter(tA(n)).map(pc),V2=n=>{const i=document.createRange();try{return i.setStart(n.start.dom,n.soffset),i.setEnd(n.finish.dom,n.foffset),he.some(i)}catch{return he.none()}},IP=n=>{const i=nA(n)?hx(Ge.fromDom(n.getBody())):he.none();n.bookmark=i.isSome()?i:n.bookmark},sA=n=>(n.bookmark?n.bookmark:he.none()).bind(c=>NP(Ge.fromDom(n.getBody()),c)).bind(V2),pI=n=>{sA(n).each(i=>n.selection.setRng(i))},bI={isEditorUIElement:n=>{const i=n.className.toString();return i.indexOf("tox-")!==-1||i.indexOf("mce-")!==-1}},dV=(n,i)=>(rt(i)||(i=0),setTimeout(n,i)),LP=(n,i)=>(rt(i)||(i=0),setInterval(n,i)),yg={setEditorTimeout:(n,i,c)=>dV(()=>{n.removed||i()},c),setEditorInterval:(n,i,c)=>{const m=LP(()=>{n.removed?clearInterval(m):i()},c);return m}},vI=n=>n.type==="nodechange"&&n.selectionChange,OI=(n,i)=>{const c=()=>{i.throttle()};Qr.DOM.bind(document,"mouseup",c),n.on("remove",()=>{Qr.DOM.unbind(document,"mouseup",c)})},yI=(n,i)=>{n.on("mouseup touchend",c=>{i.throttle()})},hV=(n,i)=>{yI(n,i),n.on("keyup NodeChange AfterSetSelectionRange",c=>{vI(c)||IP(n)})},mV=n=>{const i=w0(()=>{IP(n)},0);n.on("init",()=>{n.inline&&OI(n,i),hV(n,i)}),n.on("remove",()=>{i.cancel()})};let pS;const FP=Qr.DOM,rA=n=>Jn(n)&&bI.isEditorUIElement(n),iA=n=>{const i=n.classList;return i!==void 0?i.contains("tox-edit-area")||i.contains("tox-edit-area__iframe")||i.contains("mce-content-body"):!1},mx=(n,i)=>{const c=D_(n);return FP.getParent(i,p=>rA(p)||(c?n.dom.is(p,c):!1))!==null},aA=n=>{try{const i=jl(Ge.fromDom(n.getElement()));return z2(i).fold(()=>document.body,c=>c.dom)}catch{return document.body}},wI=(n,i)=>{const c=i.editor;mV(c);const m=(p,y)=>{if(z_(p)&&p.inline!==!0){const x=Ge.fromDom(p.getContainer());y(x,"tox-edit-focus")}};c.on("focusin",()=>{const p=n.focusedEditor;iA(aA(c))&&m(c,qu),p!==c&&(p&&p.dispatch("blur",{focusedEditor:c}),n.setActive(c),n.focusedEditor=c,c.dispatch("focus",{blurredEditor:p}),c.focus(!0))}),c.on("focusout",()=>{yg.setEditorTimeout(c,()=>{const p=n.focusedEditor;(!iA(aA(c))||p!==c)&&m(c,Qc),!mx(c,aA(c))&&p===c&&(c.dispatch("blur",{focusedEditor:null}),n.focusedEditor=null)})}),pS||(pS=p=>{const y=n.activeEditor;y&&Jh(p).each(x=>{const M=x;M.ownerDocument===document&&M!==document.body&&!mx(y,M)&&n.focusedEditor===y&&(y.dispatch("blur",{focusedEditor:null}),n.focusedEditor=null)})},FP.bind(document,"focusin",pS))},gV=(n,i)=>{n.focusedEditor===i.editor&&(n.focusedEditor=null),!n.activeEditor&&pS&&(FP.unbind(document,"focusin",pS),pS=null)},pV=n=>{n.on("AddEditor",$e(wI,n)),n.on("RemoveEditor",$e(gV,n))},bV=(n,i)=>n.dom.getParent(i,c=>n.dom.getContentEditable(c)==="true"),vV=n=>n.collapsed?he.from(sd(n.startContainer,n.startOffset)).map(Ge.fromDom):he.none(),OV=(n,i)=>vV(i).bind(c=>ja(c)?he.some(c):cn(n,c)?he.none():he.some(n)),_I=(n,i)=>{OV(Ge.fromDom(n.getBody()),i).bind(c=>ll(c.dom)).fold(()=>{n.selection.normalize()},c=>n.selection.setRng(c.toRange()))},QP=n=>{if(n.setActive)try{n.setActive()}catch{n.focus()}else n.focus()},yV=n=>zu(n)||H2(n).isSome(),wV=n=>Oe(n.iframeElement)&&zu(Ge.fromDom(n.iframeElement)),_V=n=>{const i=n.getBody();return i&&yV(Ge.fromDom(i))},SV=n=>{const i=jl(Ge.fromDom(n.getElement()));return z2(i).filter(c=>!iA(c.dom)&&mx(n,c.dom)).isSome()},W2=n=>n.inline?_V(n):wV(n),lA=n=>W2(n)||SV(n),SI=n=>{const i=n.selection,c=n.getBody();let m=i.getRng();n.quirks.refreshContentEditable(),Oe(n.bookmark)&&!W2(n)&&sA(n).each(y=>{n.selection.setRng(y),m=y});const p=bV(n,i.getNode());if(p&&n.dom.isChildOf(p,c)){QP(p),_I(n,m),cA(n);return}n.inline||(Gn.browser.isOpera()||QP(c),n.getWin().focus()),(Gn.browser.isFirefox()||n.inline)&&(QP(c),_I(n,m)),cA(n)},cA=n=>n.editorManager.setActive(n),CV=(n,i)=>{n.removed||(i?cA(n):SI(n))},CI=(n,i,c,m,p)=>{const y=c?i.startContainer:i.endContainer,x=c?i.startOffset:i.endOffset;return he.from(y).map(Ge.fromDom).map(M=>!m||!i.collapsed?Gu(M,p(M,x)).getOr(M):M).bind(M=>kl(M)?he.some(M):fi(M).filter(kl)).map(M=>M.dom).getOr(n)},kI=(n,i,c=!1)=>CI(n,i,!0,c,(m,p)=>Math.min(uc(m),p)),xI=(n,i,c=!1)=>CI(n,i,!1,c,(m,p)=>p>0?p-1:p),EI=(n,i)=>{const c=n;for(;n&&Sn(n)&&n.length===0;)n=i?n.nextSibling:n.previousSibling;return n||c},kV=(n,i)=>{if(!i)return n;let c=i.startContainer,m=i.endContainer;const p=i.startOffset,y=i.endOffset;let x=i.commonAncestorContainer;i.collapsed||(c===m&&y-p<2&&c.hasChildNodes()&&(x=c.childNodes[p]),Sn(c)&&Sn(m)&&(c.length===p?c=EI(c.nextSibling,!0):c=c.parentNode,y===0?m=EI(m.previousSibling,!1):m=m.parentNode,c&&c===m&&(x=c)));const M=Sn(x)?x.parentNode:x;return Jn(M)?M:n},TI=(n,i,c,m)=>{const p=[],y=n.getRoot(),x=n.getParent(c||kI(y,i,i.collapsed),n.isBlock),M=n.getParent(m||xI(y,i,i.collapsed),n.isBlock);if(x&&x!==y&&p.push(x),x&&M&&x!==M){let L;const q=new wi(x,y);for(;(L=q.next())&&L!==M;)n.isBlock(L)&&p.push(L)}return M&&x!==M&&M!==y&&p.push(M),p},xV=(n,i,c)=>he.from(i).bind(m=>he.from(m.parentNode).map(p=>{const y=n.nodeIndex(m),x=n.createRng();return x.setStart(p,y),x.setEnd(p,y+1),c&&(Uk(n,x,m,!0),Uk(n,x,m,!1)),x})),uA=(n,i)=>mt(i,c=>{const m=n.dispatch("GetSelectionRange",{range:c});return m.range!==c?m.range:c}),AI=n=>ei(n)==="img"?1:Jf(n).fold(()=>Da(n).length,i=>i.length),EV=n=>Jf(n).filter(i=>i.trim().length!==0||i.indexOf(Gr)>-1).isSome(),TV=n=>Pi(n)&&Ll(n,"contenteditable")==="false",AV=["img","br"],DI=n=>EV(n)||yt(AV,ei(n))||TV(n),DV=n=>ce(n,DI),PV=n=>MV(n,DI),MV=(n,i)=>{const c=m=>{const p=Da(m);for(let y=p.length-1;y>=0;y--){const x=p[y];if(i(x))return he.some(x);const M=c(x);if(M.isSome())return M}return he.none()};return c(n)},PI="[data-mce-autocompleter]",RV=(n,i)=>{if(MI(Ge.fromDom(n.getBody())).isNone()){const c=Ge.fromHtml('',n.getDoc());na(c,Ge.fromDom(i.extractContents())),i.insertNode(c.dom),fi(c).each(m=>m.dom.normalize()),PV(c).map(m=>{n.selection.setCursorLocation(m.dom,AI(m))})}},$V=n=>it(n,PI),MI=n=>Ke(n,PI),NV=(n,i)=>MI(i).each(c=>{const m=n.selection.getBookmark();Gl(c),n.selection.moveToBookmark(m)}),IV={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11},fA=(n,i,c)=>{const m=c?"lastChild":"firstChild",p=c?"prev":"next";if(n[m])return n[m];if(n!==i){let y=n[p];if(y)return y;for(let x=n.parent;x&&x!==i;x=x.parent)if(y=x[p],y)return y}},BV=n=>{var i;const c=(i=n.value)!==null&&i!==void 0?i:"";if(!Km(c))return!1;const m=n.parent;return!(m&&(m.name!=="span"||m.attr("style"))&&/^[ ]+$/.test(c))},RI=n=>{const i=n.name==="a"&&!n.attr("href")&&n.attr("id");return n.attr("name")||n.attr("id")&&!n.firstChild||n.attr("data-mce-bookmark")||i};class Wd{static create(i,c){const m=new Wd(i,IV[i]||1);return c&&ln(c,(p,y)=>{m.attr(y,p)}),m}constructor(i,c){this.name=i,this.type=c,c===1&&(this.attributes=[],this.attributes.map={})}replace(i){const c=this;return i.parent&&i.remove(),c.insert(i,c),c.remove(),c}attr(i,c){const m=this;if(!I(i))return Oe(i)&&ln(i,(y,x)=>{m.attr(x,y)}),m;const p=m.attributes;if(p){if(c!==void 0){if(c===null){if(i in p.map){delete p.map[i];let y=p.length;for(;y--;)if(p[y].name===i)return p.splice(y,1),m}return m}if(i in p.map){let y=p.length;for(;y--;)if(p[y].name===i){p[y].value=c;break}}else p.push({name:i,value:c});return p.map[i]=c,m}return p.map[i]}}clone(){const i=this,c=new Wd(i.name,i.type),m=i.attributes;if(m){const p=[];p.map={};for(let y=0,x=m.length;y/^\s*\[if [\w\W]+\]>.*/.test(n.substr(i)),$I=(n,i,c=0)=>{const m=n.toLowerCase();if(m.indexOf("[if ",c)!==-1&&LV(m,c)){const p=m.indexOf("[endif]",c);return m.indexOf(">",p)}else if(i){const p=m.indexOf(">",c);return p!==-1?p:m.length}else{const p=/--!?>/g;p.lastIndex=c;const y=p.exec(n);return y?y.index+y[0].length:m.length}},No=(n,i,c)=>{const m=/<([!?\/])?([A-Za-z0-9\-_:.]+)/g,p=/(?:\s(?:[^'">]+(?:"[^"]*"|'[^']*'))*[^"'>]*(?:"[^">]*|'[^'>]*)?|\s*|\/)>/g,y=n.getVoidElements();let x=1,M=c;for(;x!==0;)for(m.lastIndex=M;;){const L=m.exec(i);if(L===null)return M;if(L[1]==="!"){Ar(L[2],"--")?M=$I(i,!1,L.index+3):M=$I(i,!0,L.index+1);break}else{p.lastIndex=m.lastIndex;const q=p.exec(i);if(G(q)||q.index!==m.lastIndex)continue;L[1]==="/"?x-=1:un(y,L[2])||(x+=1),M=m.lastIndex+q[0].length;break}}return M},NI=(n,i)=>{const c=new RegExp(["\\s?("+n.join("|")+')="[^"]+"'].join("|"),"gi");return i.replace(c,"")},ZP=(n,i)=>{const c=/<(\w+) [^>]*data-mce-bogus="all"[^>]*>/g,m=n.schema;let p=NI(n.getTempAttrs(),i);const y=m.getVoidElements();let x;for(;x=c.exec(p);){const M=c.lastIndex,L=x[0].length;let q;y[x[1]]?q=M:q=No(m,p,M),p=p.substring(0,M-L)+p.substring(q),c.lastIndex=M-L}return Bn(p)},FV=ZP,dA=n=>{const i=pl(n,"[data-mce-bogus]");Ie(i,c=>{Ll(c,"data-mce-bogus")==="all"?wr(c):su(c)?(Ca(c,Ge.fromText(nn)),wr(c)):Gl(c)})},II=n=>{const i=pl(n,"input");Ie(i,c=>{Vi(c,"name")})},QV=(n,i)=>{const c=Uc(n),m=new RegExp(`^(<${c}[^>]*>( | |\\s|\xA0|
|)<\\/${c}>[\r ]*|
[\r ]*)$`);return i.replace(m,"")},ZV=(n,i)=>{const c=n.getDoc(),m=jl(Ge.fromDom(n.getBody())),p=Ge.fromTag("div",c);Pr(p,"data-mce-bogus","all"),ua(p,{position:"fixed",left:"-9999999px",top:"0"}),Tf(p,i.innerHTML),dA(p),II(p);const y=U1(m);na(y,p);const x=Bn(p.dom.innerText);return wr(p),x},zV=(n,i,c)=>{let m;return i.format==="raw"?m=hn.trim(FV(n.serializer,c.innerHTML)):i.format==="text"?m=ZV(n,c):i.format==="tree"?m=n.serializer.serialize(c,i):m=QV(n,n.serializer.serialize(c,i)),i.format!=="text"&&!ru(Ge.fromDom(c))&&I(m)?hn.trim(m):m},HV=(n,i)=>he.from(n.getBody()).fold(We(i.format==="tree"?new Wd("body",11):""),c=>zV(n,i,c)),gx=hn.makeMap,zP=n=>{const i=[];n=n||{};const c=n.indent,m=gx(n.indent_before||""),p=gx(n.indent_after||""),y=tp.getEncodeFunc(n.entity_encoding||"raw",n.entities),x=n.element_format!=="xhtml";return{start:(M,L,q)=>{if(c&&m[M]&&i.length>0){const ae=i[i.length-1];ae.length>0&&ae!==` `&&i.push(` `)}if(i.push("<",M),L)for(let ae=0,fe=L.length;ae0){const ae=i[i.length-1];ae.length>0&&ae!==` `&&i.push(` `)}},end:M=>{let L;i.push(""),c&&p[M]&&i.length>0&&(L=i[i.length-1],L.length>0&&L!==` `&&i.push(` `))},text:(M,L)=>{M.length>0&&(i[i.length]=L?M:y(M))},cdata:M=>{i.push("")},comment:M=>{i.push("")},pi:(M,L)=>{L?i.push(""):i.push(""),c&&i.push(` `)},doctype:M=>{i.push("",c?` `:"")},reset:()=>{i.length=0},getContent:()=>i.join("").replace(/\n$/,"")}},U2=(n={},i=bh())=>{const c=zP(n);return n.validate="validate"in n?n.validate:!0,{serialize:p=>{const y=n.validate,x={3:L=>{var q;c.text((q=L.value)!==null&&q!==void 0?q:"",L.raw)},8:L=>{var q;c.comment((q=L.value)!==null&&q!==void 0?q:"")},7:L=>{c.pi(L.name,L.value)},10:L=>{var q;c.doctype((q=L.value)!==null&&q!==void 0?q:"")},4:L=>{var q;c.cdata((q=L.value)!==null&&q!==void 0?q:"")},11:L=>{let q=L;if(q=q.firstChild)do M(q);while(q=q.next)}};c.reset();const M=L=>{var q;const ae=x[L.type];if(ae)ae(L);else{const fe=L.name,be=fe in i.getVoidElements();let Le=L.attributes;if(y&&Le&&Le.length>1){const Ye=[];Ye.map={};const Pe=i.getElementRule(L.name);if(Pe){for(let He=0,dt=Pe.attributesOrder.length;He{BI.add(i)});const gs=["font","text-decoration","text-emphasis"],HP=(n,i)=>bs(n.parseStyle(n.getAttrib(i,"style"))),xs=n=>BI.has(n),LI=(n,i)=>er(HP(n,i),c=>!xs(c)),iie=n=>Dt(n,i=>Wt(gs,c=>Ar(i,c))),aie=(n,i,c)=>{const m=HP(n,i),p=HP(n,c),y=x=>{var M,L;const q=(M=n.getStyle(i,x))!==null&&M!==void 0?M:"",ae=(L=n.getStyle(c,x))!==null&&L!==void 0?L:"";return yr(q)&&yr(ae)&&q!==ae};return Wt(m,x=>{const M=L=>Wt(L,q=>q===x);if(!M(p)&&M(gs)){const L=iie(p);return Wt(L,y)}else return y(x)})},FI=(n,i,c)=>he.from(c.container()).filter(Sn).exists(m=>{const p=n?0:-1;return i(m.data.charAt(c.offset()+p))}),QI=$e(FI,!0,xh),ZI=$e(FI,!1,xh),VV=n=>{const i=n.container();return Sn(i)&&(i.data.length===0||Cn(i.data)&&wO.isBookmarkNode(i.parentNode))},EO=(n,i)=>c=>Ob(n?0:-1,c).filter(i).isSome(),ns=n=>Ui(n)&&Bi(Ge.fromDom(n),"display")==="block",zI=n=>Ts(n)&&!bl(n),WV=EO(!0,ns),UV=EO(!1,ns),X0=EO(!0,ef),bS=EO(!1,ef),HI=EO(!0,Mu),VI=EO(!1,Mu),TO=EO(!0,zI),j0=EO(!1,zI),YV=n=>n.slice(0,-1),lie=(n,i,c)=>cn(i,n)?YV(Jd(n,m=>c(m)||pt(m,i))):[],XV=(n,i)=>lie(n,i,Xe),q0=(n,i)=>[n].concat(XV(n,i)),VP=(n,i,c)=>Rk(n,i,c,VV),WI=(n,i)=>oo(q0(Ge.fromDom(i.container()),n),fc),UI=(n,i,c)=>VP(n,i.dom,c).forall(m=>WI(i,c).fold(()=>!Fd(m,c,i.dom),p=>!Fd(m,c,i.dom)&&cn(p,Ge.fromDom(m.container())))),WP=(n,i,c)=>WI(i,c).fold(()=>VP(n,i.dom,c).forall(m=>!Fd(m,c,i.dom)),m=>VP(n,m.dom,c).isNone()),UP=$e(WP,!1),Ms=$e(WP,!0),YI=$e(UI,!1),hA=$e(UI,!0),XI=n=>Ve(n).exists(su),px=(n,i,c)=>{const m=Dt(q0(Ge.fromDom(c.container()),i),fc),p=$o(m).getOr(i);return Qd(n,p.dom,c).filter(XI)},mA=(n,i)=>Ve(i).exists(su)||px(!0,n,i).isSome(),gA=(n,i)=>ft(i).exists(su)||px(!1,n,i).isSome(),jI=$e(px,!1),jV=$e(px,!0),YP=n=>Ht.isTextPosition(n)&&!n.isAtStart()&&!n.isAtEnd(),qI=(n,i)=>{const c=Dt(q0(Ge.fromDom(i.container()),n),fc);return $o(c).getOr(n)},GI=(n,i)=>YP(i)?ZI(i):ZI(i)||Lu(qI(n,i).dom,i).exists(ZI),KI=(n,i)=>YP(i)?QI(i):QI(i)||Lf(qI(n,i).dom,i).exists(QI),qV=n=>yt(["pre","pre-wrap"],n),XP=n=>Ve(n).bind(i=>Ql(i,kl)).exists(i=>qV(Bi(i,"white-space"))),GV=(n,i)=>Lu(n.dom,i).isNone(),KV=(n,i)=>Lf(n.dom,i).isNone(),JV=(n,i)=>GV(n,i)||KV(n,i)||UP(n,i)||Ms(n,i)||gA(n,i)||mA(n,i),jP=n=>Oe(n)&&Ts(n)&&U_(n),pA=(n,i)=>c=>jP(new wi(c,n)[i]()),eW=(n,i)=>{const c=Lf(n.dom,i).getOr(i),m=pA(n.dom,"next");return i.isAtEnd()&&(m(i.container())||m(c.container()))},tW=(n,i)=>{const c=Lu(n.dom,i).getOr(i),m=pA(n.dom,"prev");return i.isAtStart()&&(m(i.container())||m(c.container()))},JI=(n,i)=>XP(i)?!1:JV(n,i)||GI(n,i)||KI(n,i),bx=(n,i)=>XP(i)?!1:UP(n,i)||YI(n,i)||gA(n,i)||GI(n,i)||tW(n,i),nW=n=>{const i=n.container(),c=n.offset();return Sn(i)&&cXP(i)?!1:Ms(n,i)||hA(n,i)||mA(n,i)||KI(n,i)||eW(n,i),qP=(n,i)=>bx(n,i)||vx(n,nW(i)),eB=(n,i)=>Gs(n.charAt(i)),GP=(n,i)=>xh(n.charAt(i)),oW=n=>{const i=n.container();return Sn(i)&&tr(i.data,Gr)},sW=n=>{const i=n.split("");return mt(i,(c,m)=>Gs(c)&&m>0&&m{const m=i.data,p=Ht(i,0);return!c&&eB(m,0)&&!qP(n,p)?(i.data=" "+m.slice(1),!0):c&&GP(m,0)&&bx(n,p)?(i.data=Gr+m.slice(1),!0):!1},rW=n=>{const i=n.data,c=sW(i);return c!==i?(n.data=c,!0):!1},KP=(n,i,c)=>{const m=i.data,p=Ht(i,m.length-1);return!c&&eB(m,m.length-1)&&!qP(n,p)?(i.data=m.slice(0,-1)+" ",!0):c&&GP(m,m.length-1)&&vx(n,p)?(i.data=m.slice(0,-1)+Gr,!0):!1},iW=(n,i)=>{const c=i.container();if(!Sn(c))return he.none();if(oW(i)){const m=AO(n,c,!1)||rW(c)||KP(n,c,!1);return ks(m,i)}else if(qP(n,i)){const m=AO(n,c,!0)||KP(n,c,!0);return ks(m,i)}else return he.none()},aW=n=>{const i=Ge.fromDom(n.getBody());n.selection.isCollapsed()&&iW(i,Ht.fromRangeStart(n.selection.getRng())).each(c=>{n.selection.setRng(c.toRange())})},JP=(n,i,c)=>{if(c===0)return;const m=Ge.fromDom(n),p=di(m,fc).getOr(m),y=n.data.slice(i,i+c),x=i+c>=n.data.length&&vx(p,Ht(n,n.data.length)),M=i===0&&bx(p,Ht(n,0));n.replaceData(i,c,uh(y,4,M,x))},Ox=(n,i)=>{const c=n.data.slice(i),m=c.length-Jc(c).length;JP(n,i,m)},bA=(n,i)=>{const c=n.data.slice(0,i),m=c.length-_u(c).length;JP(n,i-m,m)},vA=(n,i,c,m=!0)=>{const p=_u(n.data).length,y=m?n:i,x=m?i:n;return m?y.appendData(x.data):y.insertData(0,x.data),wr(Ge.fromDom(x)),c&&Ox(y,p),y},ud=(n,i)=>{const c=n.container(),m=n.offset();return!Ht.isTextPosition(n)&&c===i.parentNode&&m>Ht.before(i).offset()},lW=(n,i)=>ud(i,n)?Ht(i.container(),i.offset()-1):i,cW=n=>Sn(n)?Ht(n,0):Ht.before(n),uW=n=>Sn(n)?Ht(n,n.data.length):Ht.after(n),tB=n=>El(n.previousSibling)?he.some(uW(n.previousSibling)):n.previousSibling?Zd(n.previousSibling):he.none(),nB=n=>El(n.nextSibling)?he.some(cW(n.nextSibling)):n.nextSibling?ll(n.nextSibling):he.none(),Y2=(n,i)=>he.from(i.previousSibling?i.previousSibling:i.parentNode).bind(c=>Lu(n,Ht.before(c))).orThunk(()=>Lf(n,Ht.after(i))),fW=(n,i)=>Lf(n,Ht.after(i)).orThunk(()=>Lu(n,Ht.before(i))),dW=(n,i)=>tB(i).orThunk(()=>nB(i)).orThunk(()=>Y2(n,i)),Ba=(n,i)=>nB(i).orThunk(()=>tB(i)).orThunk(()=>fW(n,i)),OA=(n,i,c)=>n?Ba(i,c):dW(i,c),cie=(n,i,c)=>OA(n,i,c).map($e(lW,c)),qc=(n,i,c)=>{c.fold(()=>{n.focus()},m=>{n.selection.setRng(m.toRange(),i)})},ni=n=>i=>i.dom===n,_m=(n,i)=>i&&un(n.schema.getBlockElements(),ei(i)),hW=n=>{if($a(n)){const i=Ge.fromHtml('
');return xd(n),na(n,i),he.some(Ht.before(i.dom))}else return he.none()},oB=(n,i,c)=>{const m=Sa(n).filter(ol),p=Cd(n).filter(ol);return wr(n),Cf(m,p,i,(y,x,M)=>{const L=y.dom,q=x.dom,ae=L.data.length;return vA(L,q,c),M.container()===q?Ht(L,ae):M}).orThunk(()=>(c&&(m.each(y=>bA(y.dom,y.dom.length)),p.each(y=>Ox(y.dom,0))),i))},e5=(n,i)=>un(n.schema.getTextInlineElements(),ei(i)),G0=(n,i,c,m=!0)=>{const p=cie(i,n.getBody(),c.dom),y=di(c,$e(_m,n),ni(n.getBody())),x=oB(c,p,e5(n,c));n.dom.isEmpty(n.getBody())?(n.setContent(""),n.selection.setCursorLocation()):y.bind(hW).fold(()=>{m&&qc(n,i,x)},M=>{m&&qc(n,i,he.some(M))})},sB=/[\u0591-\u07FF\uFB1D-\uFDFF\uFE70-\uFEFC]/,rB=n=>sB.test(n),X2=(n,i)=>Eu(Ge.fromDom(i),Xi(n))&&!sg(n.schema,i)&&n.dom.isEditable(i),iB=n=>{var i;return Qr.DOM.getStyle(n,"direction",!0)==="rtl"||rB((i=n.textContent)!==null&&i!==void 0?i:"")},t5=(n,i,c)=>Dt(Qr.DOM.getParents(c.container(),"*",i),n),K0=(n,i,c)=>{const m=t5(n,i,c);return he.from(m[m.length-1])},yp=(n,i,c)=>{const m=mm(i,n),p=mm(c,n);return Oe(m)&&m===p},mW=n=>tf(n)||Pf(n),wg=(n,i)=>{const c=i.container(),m=i.offset();return n?or(c)?Sn(c.nextSibling)?Ht(c.nextSibling,0):Ht.after(c):tf(i)?Ht(c,m+1):i:or(c)?Sn(c.previousSibling)?Ht(c.previousSibling,c.previousSibling.data.length):Ht.before(c):Pf(i)?Ht(c,m-1):i},gW=$e(wg,!0),yA=$e(wg,!1),aB=(n,i)=>{const c=m=>m.stopImmediatePropagation();n.on("beforeinput input",c,!0),n.getDoc().execCommand(i),n.off("beforeinput input",c)},yx=n=>{n.execCommand("delete")},n5=n=>aB(n,"Delete"),vS=n=>aB(n,"ForwardDelete"),_g=n=>i=>qr(fi(i),n,pt),wx=n=>dc(n)||Xa(n),xi=(n,i)=>cn(n,i)?Ql(i,wx,_g(n)):he.none(),j2=(n,i=!0)=>{n.dom.isEmpty(n.getBody())&&n.setContent("",{no_selection:!i})},o5=(n,i,c)=>ri(ll(c),Zd(c),(m,p)=>{const y=wg(!0,m),x=wg(!1,p),M=wg(!1,i);return n?Lf(c,M).exists(L=>L.isEqual(x)&&i.isEqual(y)):Lu(c,M).exists(L=>L.isEqual(y)&&i.isEqual(x))}).getOr(!0),s5=n=>(Gb(n)?Sa(n):Tu(n)).bind(s5).orThunk(()=>he.some(n)),wA=(n,i,c,m=!0)=>{var p;i.deleteContents();const y=s5(c).getOr(c),x=Ge.fromDom((p=n.dom.getParent(y.dom,n.dom.isBlock))!==null&&p!==void 0?p:c.dom);if(x.dom===n.getBody()?j2(n,m):$a(x)&&(De(x),m&&n.selection.setCursorLocation(x.dom,0)),!pt(c,x)){const M=qr(fi(x),c)?[]:Kb(x);Ie(M.concat(Da(c)),L=>{!pt(L,x)&&!cn(L,x)&&$a(L)&&wr(L)})}},r5=n=>i=>pt(n,i),_x=n=>pl(n,"td,th"),i5=(n,i)=>{const c=q=>gp(Ge.fromDom(q),i),m=c(n.startContainer),p=c(n.endContainer),y=m.isSome(),x=p.isSome(),M=ri(m,p,pt).getOr(!1);return{startTable:m,endTable:p,isStartInTable:y,isEndInTable:x,isSameTable:M,isMultiTable:!M&&y&&x}},OS=(n,i)=>({start:n,end:i}),a5=(n,i,c)=>({rng:n,table:i,cells:c}),yS=mg.generate([{singleCellTable:["rng","cell"]},{fullTable:["table"]},{partialTable:["cells","outsideDetails"]},{multiTable:["startTableCells","endTableCells","betweenRng"]}]),Sx=(n,i)=>it(Ge.fromDom(n),"td,th",i),l5=n=>!pt(n.start,n.end),c5=(n,i)=>gp(n.start,i).bind(c=>gp(n.end,i).bind(m=>ks(pt(c,m),c))),lB=(n,i)=>!l5(n)&&c5(n,i).exists(c=>{const m=c.dom.rows;return m.length===1&&m[0].cells.length===1}),wS=(n,i)=>{const c=Sx(n.startContainer,i),m=Sx(n.endContainer,i);return ri(c,m,OS)},cB=n=>i=>gp(i,n).bind(c=>Mo(_x(c)).map(m=>OS(i,m))),u5=n=>i=>gp(i,n).bind(c=>$o(_x(c)).map(m=>OS(m,i))),f5=n=>i=>c5(i,n).map(c=>a5(i,c,_x(c))),uB=(n,i,c,m)=>{if(c.collapsed||!n.forall(l5))return he.none();if(i.isSameTable){const p=n.bind(f5(m));return he.some({start:p,end:p})}else{const p=Sx(c.startContainer,m),y=Sx(c.endContainer,m),x=p.bind(cB(m)).bind(f5(m)),M=y.bind(u5(m)).bind(f5(m));return he.some({start:x,end:M})}},d5=(n,i)=>Ss(n,c=>pt(c,i)),_A=n=>ri(d5(n.cells,n.rng.start),d5(n.cells,n.rng.end),(i,c)=>n.cells.slice(i,c+1)),fB=(n,i,c)=>n.exists(m=>lB(m,c)&&yO(m.start,i)),Cx=(n,i)=>{const{startTable:c,endTable:m}=i,p=n.cloneRange();return c.each(y=>p.setStartAfter(y.dom)),m.each(y=>p.setEndBefore(y.dom)),p},dB=(n,i,c,m)=>uB(n,i,c,m).bind(({start:p,end:y})=>p.or(y)).bind(p=>{const{isSameTable:y}=i,x=_A(p).getOr([]);if(y&&p.cells.length===x.length)return he.some(yS.fullTable(p.table));if(x.length>0){if(y)return he.some(yS.partialTable(x,he.none()));{const M=Cx(c,i);return he.some(yS.partialTable(x,he.some({...i,rng:M})))}}else return he.none()}),hB=(n,i,c,m)=>uB(n,i,c,m).bind(({start:p,end:y})=>{const x=p.bind(_A).getOr([]),M=y.bind(_A).getOr([]);if(x.length>0&&M.length>0){const L=Cx(c,i);return he.some(yS.multiTable(x,M,L))}else return he.none()}),mB=(n,i)=>{const c=r5(n),m=wS(i,c),p=i5(i,c);return fB(m,i,c)?m.map(y=>yS.singleCellTable(i,y.start)):p.isMultiTable?hB(m,p,i,c):dB(m,p,i,c)},h5=n=>Ie(n,i=>{Vi(i,"contenteditable"),De(i)}),gB=(n,i)=>he.from(n.dom.getParent(i,n.dom.isBlock)).map(Ge.fromDom),pB=(n,i,c)=>{c.each(m=>{i?wr(m):(De(m),n.selection.setCursorLocation(m.dom,0))})},SA=(n,i,c,m)=>{const p=c.cloneRange();m?(p.setStart(c.startContainer,c.startOffset),p.setEndAfter(i.dom.lastChild)):(p.setStartBefore(i.dom.firstChild),p.setEnd(c.endContainer,c.endOffset)),kx(n,p,i,!1).each(y=>y())},m5=n=>{const i=Cb(n),c=Ge.fromDom(n.selection.getNode());Dd(c.dom)&&$a(c)?n.selection.setCursorLocation(c.dom,0):n.selection.collapse(!0),i.length>1&&Wt(i,m=>pt(m,c))&&Pr(c,"data-mce-selected","1")},g5=(n,i,c)=>he.some(()=>{const m=n.selection.getRng(),p=c.bind(({rng:y,isStartInTable:x})=>{const M=gB(n,x?y.endContainer:y.startContainer);y.deleteContents(),pB(n,x,M.filter($a));const L=x?i[0]:i[i.length-1];return SA(n,L,m,x),$a(L)?he.none():he.some(x?i.slice(1):i.slice(0,-1))}).getOr(i);h5(p),m5(n)}),bB=(n,i,c,m)=>he.some(()=>{const p=n.selection.getRng(),y=i[0],x=c[c.length-1];SA(n,y,p,!0),SA(n,x,p,!1);const M=$a(y)?i:i.slice(1),L=$a(x)?c:c.slice(0,-1);h5(M.concat(L)),m.deleteContents(),m5(n)}),kx=(n,i,c,m=!0)=>he.some(()=>{wA(n,i,c,m)}),vB=(n,i)=>he.some(()=>G0(n,!1,i)),OB=(n,i,c)=>mB(i,c).bind(m=>m.fold($e(kx,n),$e(vB,n),$e(g5,n),$e(bB,n))),yB=(n,i)=>xx(n,i),wB=(n,i,c,m)=>_S(i,m).fold(()=>OB(n,i,c),p=>yB(n,p)),_B=(n,i,c)=>{const m=Ge.fromDom(n.getBody()),p=n.selection.getRng();return c.length!==0?g5(n,c,he.none()):wB(n,m,p,i)},CA=(n,i)=>oo(q0(i,n),Xm),_S=(n,i)=>oo(q0(i,n),kc("caption")),SB=(n,i,c,m,p)=>wb(c,n.getBody(),p).bind(y=>CA(i,Ge.fromDom(y.getNode())).bind(x=>pt(x,m)?he.none():he.some(St))),xx=(n,i)=>he.some(()=>{De(i),n.selection.setCursorLocation(i.dom,0)}),kA=(n,i,c,m)=>ll(n.dom).bind(p=>Zd(n.dom).map(y=>i?c.isEqual(p)&&m.isEqual(y):c.isEqual(y)&&m.isEqual(p))).getOr(!0),p5=(n,i)=>xx(n,i),Ex=(n,i,c)=>_S(n,Ge.fromDom(c.getNode())).fold(()=>he.some(St),m=>ks(!pt(m,i),St)),b5=(n,i,c,m,p)=>wb(c,n.getBody(),p).fold(()=>he.some(St),y=>kA(m,c,p,y)?p5(n,m):Ex(i,m,y)),CB=(n,i,c,m)=>{const p=Ht.fromRangeStart(n.selection.getRng());return CA(c,m).bind(y=>$a(y)?xx(n,y):SB(n,c,i,y,p))},SS=(n,i,c,m)=>{const p=Ht.fromRangeStart(n.selection.getRng());return $a(m)?xx(n,m):b5(n,c,i,m,p)},xA=(n,i)=>n?HI(i):VI(i),v5=(n,i)=>{const c=Ht.fromRangeStart(n.selection.getRng());return xA(i,c)||Qd(i,n.getBody(),c).exists(m=>xA(i,m))},Tx=(n,i,c)=>{const m=Ge.fromDom(n.getBody());return _S(m,c).fold(()=>CB(n,i,m,c).orThunk(()=>ks(v5(n,i),St)),p=>SS(n,i,m,p))},xb=(n,i)=>{const c=Ge.fromDom(n.selection.getStart(!0)),m=Cb(n);return n.selection.isCollapsed()&&m.length===0?Tx(n,i,c):_B(n,c,m)},DO=(n,i)=>{let c=i;for(;c&&c!==n;){if(ba(c)||Ts(c))return c;c=c.parentNode}return null},pW=["data-ephox-","data-mce-","data-alloy-","data-snooker-","_"],kB=hn.each,EA=n=>{const i=n.dom,c=new Set(n.serializer.getTempAttrs()),m=(y,x)=>{if(y.nodeName!==x.nodeName||y.nodeType!==x.nodeType)return!1;const M=q=>{const ae={};return kB(i.getAttribs(q),fe=>{const be=fe.nodeName.toLowerCase();be!=="style"&&!p(be)&&(ae[be]=i.getAttrib(q,be))}),ae},L=(q,ae)=>{for(const fe in q)if(un(q,fe)){const be=ae[fe];if(Se(be)||q[fe]!==be)return!1;delete ae[fe]}for(const fe in ae)if(un(ae,fe))return!1;return!0};return Jn(y)&&Jn(x)&&(!L(M(y),M(x))||!L(i.parseStyle(i.getAttrib(y,"style")),i.parseStyle(i.getAttrib(x,"style"))))?!1:!zd(y)&&!zd(x)},p=y=>Wt(pW,x=>Ar(y,x))||c.has(y);return{compare:m,isAttributeInternal:p}},bW=(n,i)=>{let c=n;for(;c=c.walk();)i(c)},vW=(n,i,c,m)=>{const p=c.name;for(let y=0,x=n.length;y{const m={nodes:{},attributes:{}};return c.firstChild&&bW(c,p=>{vW(n,i,p,m)}),m},TA=(n,i)=>{const c=(m,p)=>{ln(m,y=>{const x=Rr(y.nodes);Ie(y.filter.callbacks,M=>{for(let L=x.length-1;L>=0;L--){const q=x[L];(!(p?q.attr(y.filter.name)!==void 0:q.name===y.filter.name)||Ae(q.parent))&&x.splice(L,1)}x.length>0&&M(x,y.filter.name,i)})})};c(n.nodes,!1),c(n.attributes,!0)},wp=(n,i,c,m={})=>{const p=OW(n,i,c);TA(p,m)},Ax=(n,i,c,m)=>{if((n.pad_empty_with_br||i.insert)&&c(m)){const y=new Wd("br",1);i.insert&&y.attr("data-mce-bogus","1"),m.empty().append(y)}else m.empty().append(new Wd("#text",3)).value=Gr},AA=n=>{var i;return DA(n,"#text")&&((i=n==null?void 0:n.firstChild)===null||i===void 0?void 0:i.value)===Gr},DA=(n,i)=>{const c=n==null?void 0:n.firstChild;return Oe(c)&&c===n.lastChild&&c.name===i},yW=(n,i)=>{const c=n.getElementRule(i.name);return(c==null?void 0:c.paddEmpty)===!0},CS=(n,i,c,m)=>m.isEmpty(i,c,p=>yW(n,p)),wW=(n,i)=>Oe(n)&&(i(n)||n.name==="br"),xB=n=>{let i;for(let c=n;c;c=c.parent){const m=c.attr("contenteditable");if(m==="false")break;m==="true"&&(i=c)}return he.from(i)},Dx=(n,i,c=n.parent)=>{if(i.getSpecialElements()[n.name])n.empty().remove();else{const m=n.children();for(const p of m)c&&!i.isValidChild(c.name,p.name)&&Dx(p,i,c);n.unwrap()}},O5=(n,i,c,m=St)=>{const p=i.getTextBlockElements(),y=i.getNonEmptyElements(),x=i.getWhitespaceElements(),M=hn.makeMap("tr,td,th,tbody,thead,tfoot,table,summary"),L=new Set,q=ae=>ae!==c&&!M[ae.name];for(let ae=0;ae1)if(i.isValidChild(be.name,fe.name)){Pe.reverse(),Le=Pe[0].clone(),m(Le);let He=Le;for(let dt=0;dt0?(Ye=Pe[dt].clone(),m(Ye),He.append(Ye)):Ye=He;for(let bt=Pe[dt].firstChild;bt&&bt!==Pe[dt+1];){const _t=bt.next;Ye.append(bt),bt=_t}He=Ye}CS(i,y,x,Le)?be.insert(fe,Pe[0],!0):(be.insert(Le,Pe[0],!0),be.insert(fe,Le)),be=Pe[0],(CS(i,y,x,be)||DA(be,"br"))&&be.empty().remove()}else Dx(fe,i);else if(fe.parent){if(fe.name==="li"){let He=fe.prev;if(He&&(He.name==="ul"||He.name==="ol")){He.append(fe);continue}if(He=fe.next,He&&(He.name==="ul"||He.name==="ol")&&He.firstChild){He.insert(fe,He.firstChild,!0);continue}const dt=new Wd("ul",1);m(dt),fe.wrap(dt);continue}if(i.isValidChild(fe.parent.name,"div")&&i.isValidChild("div",fe.name)){const He=new Wd("div",1);m(He),fe.wrap(He)}else Dx(fe,i)}}},EB=(n,i)=>{let c=n;for(;c;){if(c.name===i)return!0;c=c.parent}return!1},TB=(n,i,c=i.parent)=>c&&n.children[i.name]&&!n.isValidChild(c.name,i.name)?!0:!!(c&&i.name==="a"&&EB(c,"a")),Px=(n,i,c,m)=>{const p=document.createRange();return p.setStart(n,i),p.setEnd(c,m),p},AB=n=>{const i=Ht.fromRangeStart(n),c=Ht.fromRangeEnd(n),m=n.commonAncestorContainer;return Qd(!1,m,c).map(p=>!Fd(i,c,m)&&Fd(i,p,m)?Px(i.container(),i.offset(),p.container(),p.offset()):n).getOr(n)},y5=n=>n.collapsed?n:AB(n),DB=n=>Oe(n.firstChild)&&n.firstChild===n.lastChild,_W=n=>n.name==="br"||n.value===Gr,SW=(n,i)=>n.getBlockElements()[i.name]&&DB(i)&&_W(i.firstChild),CW=(n,i)=>{const c=n.getNonEmptyElements();return Oe(i)&&(i.isEmpty(c)||SW(n,i))},kW=(n,i)=>{let c=i.firstChild,m=i.lastChild;return c&&c.name==="meta"&&(c=c.next),m&&m.attr("id")==="mce_marker"&&(m=m.prev),CW(n,m)&&(m=m==null?void 0:m.prev),!c||c!==m?!1:c.name==="ul"||c.name==="ol"},xW=n=>{var i,c;const m=n.firstChild,p=n.lastChild;return m&&m.nodeName==="META"&&((i=m.parentNode)===null||i===void 0||i.removeChild(m)),p&&p.id==="mce_marker"&&((c=p.parentNode)===null||c===void 0||c.removeChild(p)),n},PB=(n,i,c)=>{const m=i.serialize(c),p=n.createFragment(m);return xW(p)},EW=n=>{var i;return Dt((i=n==null?void 0:n.childNodes)!==null&&i!==void 0?i:[],c=>c.nodeName==="LI")},w5=n=>n.data===Gr||mi(n),q2=n=>Oe(n==null?void 0:n.firstChild)&&n.firstChild===n.lastChild&&w5(n.firstChild),TW=n=>!n.firstChild||q2(n),AW=n=>n.length>0&&TW(n[n.length-1])?n.slice(0,-1):n,kS=(n,i)=>{const c=n.getParent(i,n.isBlock);return c&&c.nodeName==="LI"?c:null},MB=(n,i)=>!!kS(n,i),RB=(n,i)=>{const c=i.cloneRange(),m=i.cloneRange();return c.setStartBefore(n),m.setEndAfter(n),[c.cloneContents(),m.cloneContents()]},DW=(n,i)=>{const c=Ht.before(n),p=Ta(i).next(c);return p?p.toRange():null},_5=(n,i)=>{const c=Ht.after(n),p=Ta(i).prev(c);return p?p.toRange():null},PW=(n,i,c,m)=>{const p=RB(n,m),y=n.parentNode;return y&&(y.insertBefore(p[0],n),hn.each(i,x=>{y.insertBefore(x,n)}),y.insertBefore(p[1],n),y.removeChild(n)),_5(i[i.length-1],c)},G2=(n,i,c)=>{const m=n.parentNode;return m&&hn.each(i,p=>{m.insertBefore(p,n)}),DW(n,c)},$B=(n,i,c,m)=>(m.insertAfter(i.reverse(),n),_5(i[0],c)),NB=(n,i,c,m)=>{const p=PB(i,n,m),y=kS(i,c.startContainer),x=AW(EW(p.firstChild)),M=1,L=2,q=i.getRoot(),ae=fe=>{const be=Ht.fromRangeStart(c),Le=Ta(i.getRoot()),Ye=fe===M?Le.prev(be):Le.next(be),Pe=Ye==null?void 0:Ye.getNode();return Pe?kS(i,Pe)!==y:!0};return y?ae(M)?G2(y,x,q):ae(L)?$B(y,x,q,i):PW(y,x,q,c):null},IB=["pre"],PA=(n,i,c,m)=>{var p;const y=i.firstChild,x=i.lastChild,M=x.attr("data-mce-type")==="bookmark"?x.prev:x,L=y===M,q=yt(IB,y.name);if(L&&q){const ae=y.attr("contenteditable")!=="false",fe=((p=n.getParent(c,n.isBlock))===null||p===void 0?void 0:p.nodeName.toLowerCase())===y.name,be=he.from(DO(m,c)).forall(ba);return ae&&fe&&be}else return!1},MA=Dd,MW=(n,i,c)=>{if(Oe(c)){const m=n.getParent(i.endContainer,MA);return c===m&&yO(Ge.fromDom(c),i)}else return!1},BB=(n,i,c)=>{var m;if(c.getAttribute("data-mce-bogus")==="all")(m=c.parentNode)===null||m===void 0||m.insertBefore(n.dom.createFragment(i),c);else{const p=c.firstChild,y=c.lastChild;!p||p===y&&p.nodeName==="BR"?n.dom.setHTML(c,i):n.selection.setContent(i,{no_events:!0})}},RW=(n,i)=>{he.from(n.getParent(i,"td,th")).map(Ge.fromDom).each(lt)},$W=(n,i)=>{const c=n.schema.getTextInlineElements(),m=n.dom;if(i){const p=n.getBody(),y=EA(n);hn.each(m.select("*[data-mce-fragment]"),x=>{if(Oe(c[x.nodeName.toLowerCase()])&&LI(m,x)){for(let L=x.parentElement;Oe(L)&&L!==p&&!aie(m,x,L);L=L.parentElement)if(y.compare(L,x)){m.remove(x,!0);break}}})}},RA=n=>{let i=n;for(;i=i.walk();)i.type===1&&i.attr("data-mce-fragment","1")},LB=n=>{hn.each(n.getElementsByTagName("*"),i=>{i.removeAttribute("data-mce-fragment")})},S5=n=>!!n.getAttribute("data-mce-fragment"),NW=(n,i)=>Oe(i)&&!n.schema.getVoidElements()[i.nodeName],IW=(n,i)=>{var c,m,p;let y;const x=n.dom,M=n.selection;if(!i)return;M.scrollIntoView(i);const L=DO(n.getBody(),i);if(L&&x.getContentEditable(L)==="false"){x.remove(i),M.select(L);return}let q=x.createRng();const ae=i.previousSibling;if(Sn(ae)){q.setStart(ae,(m=(c=ae.nodeValue)===null||c===void 0?void 0:c.length)!==null&&m!==void 0?m:0);const Le=i.nextSibling;Sn(Le)&&(ae.appendData(Le.data),(p=Le.parentNode)===null||p===void 0||p.removeChild(Le))}else q.setStartBefore(i),q.setEndBefore(i);const fe=Le=>{let Ye=Ht.fromRangeStart(Le);return Ye=Ta(n.getBody()).next(Ye),Ye==null?void 0:Ye.toRange()},be=x.getParent(i,x.isBlock);if(x.remove(i),be&&x.isEmpty(be)){const Le=MA(be);xd(Ge.fromDom(be)),q.setStart(be,0),q.setEnd(be,0),!Le&&!S5(be)&&(y=fe(q))?(q=y,x.remove(be)):x.add(be,x.create("br",Le?{}:{"data-mce-bogus":"1"}))}M.setRng(q)},FB=n=>{const i=n.dom,c=y5(n.selection.getRng());n.selection.setRng(c);const m=i.getParent(c.startContainer,MA);MW(i,c,m)?kx(n,c,Ge.fromDom(m)):c.startContainer===c.endContainer&&c.endOffset-c.startOffset===1&&Sn(c.startContainer.childNodes[c.startOffset])?c.deleteContents():n.getDoc().execCommand("Delete",!1)},C5=n=>{for(let i=n;i;i=i.walk())if(i.attr("id")==="mce_marker")return he.some(i);return he.none()},QB=(n,i,c)=>{var m,p;const y=n.selection,x=n.dom,M=n.parser,L=c.merge,q=U2({validate:!0},n.schema),ae='';i.indexOf("{$caret}")===-1&&(i+="{$caret}"),i=i.replace(/\{\$caret\}/,ae);let fe=y.getRng();const be=fe.startContainer,Le=n.getBody();be===Le&&y.isCollapsed()&&x.isBlock(Le.firstChild)&&NW(n,Le.firstChild)&&x.isEmpty(Le.firstChild)&&(fe=x.createRng(),fe.setStart(Le.firstChild,0),fe.setEnd(Le.firstChild,0),y.setRng(fe)),y.isCollapsed()||FB(n);const Ye=y.getNode(),Pe={context:Ye.nodeName.toLowerCase(),data:c.data,insert:!0},He=M.parse(i,Pe);if(c.paste===!0&&kW(n.schema,He)&&MB(x,Ye))return fe=NB(q,x,y.getRng(),He),fe&&y.setRng(fe),i;c.paste===!0&&PA(x,He,Ye,n.getBody())&&((m=He.firstChild)===null||m===void 0||m.unwrap()),RA(He);let dt=He.lastChild;if(dt&&dt.attr("id")==="mce_marker"){const bt=dt;for(dt=dt.prev;dt;dt=dt.walk(!0))if(dt.type===3||!x.isBlock(dt.name)){dt.parent&&n.schema.isValidChild(dt.parent.name,"span")&&dt.parent.insert(bt,dt,dt.name==="br");break}}if(n._selectionOverrides.showBlockCaretContainer(Ye),!Pe.invalid)i=q.serialize(He),BB(n,i,Ye);else{n.selection.setContent(ae);let bt=y.getNode(),_t;const Mt=n.getBody();for(Ju(bt)?bt=_t=Mt:_t=bt;_t&&_t!==Mt;)bt=_t,_t=_t.parentNode;i=bt===Mt?Mt.innerHTML:x.getOuterHTML(bt);const dn=M.parse(i),zn=C5(dn),Nn=zn.bind(xB).getOr(dn);zn.each(go=>go.replace(He));const Lt=He.children(),Zt=(p=He.parent)!==null&&p!==void 0?p:dn;He.unwrap();const yn=Dt(Lt,go=>TB(n.schema,go,Zt));O5(yn,n.schema,Nn),wp(M.getNodeFilters(),M.getAttributeFilters(),dn),i=q.serialize(dn),bt===Mt?x.setHTML(Mt,i):x.setOuterHTML(bt,i)}return $W(n,L),IW(n,x.get("mce_marker")),LB(n.getBody()),RW(x,y.getStart()),Rv(n.schema,n.getBody(),y.getStart()),i},$A=n=>n instanceof Wd,BW=n=>{W2(n)&&ll(n.getBody()).each(i=>{const c=i.getNode(),m=Mu(c)?ll(c).getOr(i):i;n.selection.setRng(m.toRange())})},k5=(n,i,c)=>{n.dom.setHTML(n.getBody(),i),c!==!0&&BW(n)},NA=(n,i,c,m)=>{if(c.length===0||/^\s+$/.test(c)){const p='
';i.nodeName==="TABLE"?c=""+p+"":/^(UL|OL)$/.test(i.nodeName)&&(c="
  • "+p+"
  • ");const y=Uc(n);return n.schema.isValidChild(i.nodeName.toLowerCase(),y.toLowerCase())?(c=p,c=n.dom.createHTML(y,ub(n),c)):c||(c=p),k5(n,c,m.no_selection),{content:c,html:c}}else{m.format!=="raw"&&(c=U2({validate:!1},n.schema).serialize(n.parser.parse(c,{isRootContent:!0,insert:!0})));const p=ru(Ge.fromDom(i))?c:hn.trim(c);return k5(n,p,m.no_selection),{content:p,html:p}}},J0=(n,i,c,m)=>{wp(n.parser.getNodeFilters(),n.parser.getAttributeFilters(),c);const p=U2({validate:!1},n.schema).serialize(c),y=ru(Ge.fromDom(i))?p:hn.trim(p);return k5(n,y,m.no_selection),{content:c,html:y}},LW=(n,i,c)=>he.from(n.getBody()).map(m=>$A(i)?J0(n,m,i,c):NA(n,m,i,c)).getOr({content:i,html:$A(c.content)?"":c.content}),x5=(n,i,c)=>di(n,i,c).isSome(),$l=(n,i)=>zp(n,i).isSome(),IA=n=>ue(n)?n:Xe,E5=(n,i,c)=>{let m=n.dom;const p=IA(c);for(;m.parentNode;){m=m.parentNode;const y=Ge.fromDom(m),x=i(y);if(x.isSome())return x;if(p(y))break}return he.none()},d1=(n,i,c)=>{const m=i(n),p=IA(c);return m.orThunk(()=>p(n)?he.none():E5(n,i,p))},BA=K_,T5=(n,i,c)=>{const m=n.formatter.get(c);if(m)for(let p=0;p{const y=n.dom.getRoot();if(i===y)return!1;const x=n.dom.getParent(i,M=>T5(n,M,c)?!0:M.parentNode===y||!!Dh(n,M,c,m,!0));return!!Dh(n,x,c,m,p)},LA=(n,i,c)=>Ml(c)&&BA(i,c.inline)||Om(c)&&BA(i,c.block)?!0:ld(c)?Jn(i)&&n.is(i,c.selector):!1,ZB=(n,i,c,m,p,y)=>{const x=c[m],M=m==="attributes";if(ue(c.onmatch))return c.onmatch(i,c,m);if(x){if(kr(x)){for(let L=0;L{const y=n.formatter.get(c),x=n.dom;if(y&&Jn(i))for(let M=0;M{if(m)return K2(n,m,i,c,p);if(m=n.selection.getNode(),K2(n,m,i,c,p))return!0;const y=n.selection.getStart();return!!(y!==m&&K2(n,y,i,c,p))},J2=(n,i,c)=>{const m=[],p={},y=n.selection.getStart();return n.dom.getParent(y,x=>{for(let M=0;M{const c=p=>pt(p,Ge.fromDom(n.getBody())),m=(p,y)=>Dh(n,p.dom,y)?he.some(y):he.none();return he.from(n.selection.getStart(!0)).bind(p=>d1(Ge.fromDom(p),y=>Ls(i,x=>m(y,x)),c)).getOrNull()},PO=(n,i)=>{const c=n.formatter.get(i),m=n.dom;if(c&&n.selection.isEditable()){const p=n.selection.getStart(),y=R2(m,p);for(let x=c.length-1;x>=0;x--){const M=c[x];if(!ld(M))return!0;for(let L=y.length-1;L>=0;L--)if(m.is(y[L],M.selector))return!0}}return!1},Sg=(n,i,c)=>Hn(c,(m,p)=>{const y=qk(n,p);return n.formatter.matchNode(i,p,{},y)?m.concat([p]):m},[]),ev=Ft,D5=(n,i)=>n.importNode(i,!0),QW=n=>{const i=[];let c=n;for(;c;){if(Sn(c)&&c.data!==ev||c.childNodes.length>1)return[];Jn(c)&&i.push(c),c=c.firstChild}return i},zB=n=>QW(n).length>0,Mx=n=>{if(n){const i=new wi(n,n);for(let c=i.current();c;c=i.next())if(Sn(c))return c}return null},P5=n=>{const i=Ge.fromTag("span");return ju(i,{id:X_,"data-mce-bogus":"1","data-mce-type":"format-caret"}),n&&na(i,Ge.fromText(ev)),i},_p=n=>{const i=Mx(n);return i&&i.data.charAt(0)===ev&&i.deleteData(0,1),i},xS=(n,i,c=!0)=>{const m=n.dom,p=n.selection;if(zB(i))G0(n,!1,Ge.fromDom(i),c);else{const y=p.getRng(),x=m.getParent(i,m.isBlock),M=y.startContainer,L=y.startOffset,q=y.endContainer,ae=y.endOffset,fe=_p(i);m.remove(i,!0),M===fe&&L>0&&y.setStart(fe,L-1),q===fe&&ae>0&&y.setEnd(fe,ae-1),x&&m.isEmpty(x)&&De(Ge.fromDom(x)),p.setRng(y)}},FA=(n,i,c=!0)=>{const m=n.dom,p=n.selection;if(i)xS(n,i,c);else if(i=_b(n.getBody(),p.getStart()),!i)for(;i=m.get(X_);)xS(n,i,c)},M5=(n,i,c)=>{var m,p;const y=n.dom,x=y.getParent(c,$e(Vl,n.schema));x&&y.isEmpty(x)?(m=c.parentNode)===null||m===void 0||m.replaceChild(i,c):(j(Ge.fromDom(c)),y.isEmpty(c)?(p=c.parentNode)===null||p===void 0||p.replaceChild(i,c):y.insertAfter(i,c))},QA=(n,i)=>(n.appendChild(i),i),MO=(n,i)=>{var c;const m=Dn(n,(y,x)=>QA(y,x.cloneNode(!1)),i),p=(c=m.ownerDocument)!==null&&c!==void 0?c:document;return QA(m,p.createTextNode(ev))},R5=(n,i,c,m,p,y)=>{const x=n.formatter,M=n.dom,L=Dt(bs(x.get()),fe=>fe!==m&&!tr(fe,"removeformat")),q=Sg(n,c,L);if(Dt(q,fe=>!aP(n,fe,m)).length>0){const fe=c.cloneNode(!1);return M.add(i,fe),x.remove(m,p,fe,y),M.remove(fe),he.some(fe)}else return he.none()},ZW=(n,i,c)=>{let m;const p=n.selection,y=n.formatter.get(i);if(!y)return;const x=p.getRng();let M=x.startOffset;const q=x.startContainer.nodeValue;m=_b(n.getBody(),p.getStart());const ae=/[^\s\u00a0\u00ad\u200b\ufeff]/;if(q&&M>0&&M{const p=n.dom,y=n.selection;let x=!1;const M=n.formatter.get(i);if(!M)return;const L=y.getRng(),q=L.startContainer,ae=L.startOffset;let fe=q;Sn(q)&&(ae!==q.data.length&&(x=!0),fe=fe.parentNode);const be=[];let Le;for(;fe;){if(Dh(n,fe,i,c,m)){Le=fe;break}fe.nextSibling&&(x=!0),be.push(fe),fe=fe.parentNode}if(!!Le)if(x){const Ye=y.getBookmark();L.collapse(!0);let Pe=z0(p,L,M,!0);Pe=Op(Pe),n.formatter.remove(i,c,Pe,m),y.moveToBookmark(Ye)}else{const Ye=_b(n.getBody(),Le),Pe=P5(!1).dom;M5(n,Pe,Ye!=null?Ye:Le);const He=R5(n,Pe,Le,i,c,m),dt=MO(be.concat(He.toArray()),Pe);Ye&&xS(n,Ye,!1),y.setCursorLocation(dt,1),p.isEmpty(Le)&&p.remove(Le)}},zW=(n,i,c)=>{const m=n.selection,p=n.getBody();FA(n,null,c),(i===8||i===46)&&m.isCollapsed()&&m.getStart().innerHTML===ev&&FA(n,_b(p,m.getStart())),(i===37||i===39)&&FA(n,_b(p,m.getStart()))},HW=n=>Sn(n)&&Ki(n.data,Gr),VW=n=>{n.on("mouseup keydown",i=>{zW(n,i.keyCode,HW(n.selection.getRng().endContainer))})},VB=n=>{const i=P5(!1),c=MO(n,i.dom);return{caretContainer:i,caretPosition:Ht(c,0)}},ES=(n,i)=>{const{caretContainer:c,caretPosition:m}=VB(i);return Ca(Ge.fromDom(n),c),wr(Ge.fromDom(n)),m},WW=(n,i)=>{const{caretContainer:c,caretPosition:m}=VB(i);return n.insertNode(c.dom),m},$5=(n,i)=>{const c=n.schema.getTextInlineElements();return un(c,ei(i))&&!Yc(i.dom)&&!Td(i.dom)},ZA=n=>Yc(n.dom)&&zB(n.dom),Rx={},N5=Df(["pre"]),WB=(n,i)=>{Rx[n]||(Rx[n]=[]),Rx[n].push(i)},UW=(n,i)=>{un(Rx,n)&&Ie(Rx[n],c=>{c(i)})};WB("pre",n=>{const i=n.selection.getRng(),c=p=>y=>{const x=y.previousSibling;return N5(x)&&yt(p,x)},m=(p,y)=>{const x=Ge.fromDom(y),M=Ao(x).dom;wr(x),ti(Ge.fromDom(p),[Ge.fromTag("br",M),Ge.fromTag("br",M),...Da(x)])};if(!i.collapsed){const p=n.selection.getSelectedBlocks(),y=Dt(Dt(p,N5),c(p));Ie(y,x=>{m(x.previousSibling,x)})}});const UB=["fontWeight","fontStyle","color","fontSize","fontFamily"],YW=n=>te(n.styles)&&Wt(bs(n.styles),i=>yt(UB,i)),XW=n=>oo(n,i=>Ml(i)&&i.inline==="span"&&YW(i)),YB=(n,i)=>{const c=n.get(i);return ne(c)?XW(c):he.none()},XB=(n,i)=>Lu(i,Ht.fromRangeStart(n)).isNone(),jB=(n,i)=>Lf(i,Ht.fromRangeEnd(n)).exists(c=>!mi(c.getNode())||Lf(i,c).isSome())===!1,qB=n=>i=>Va(i)&&n.isEditable(i),jW=n=>{const i=n.getSelectedBlocks(),c=n.getRng();if(n.isCollapsed())return[];if(i.length===1)return XB(c,i[0])&&jB(c,i[0])?i:[];{const m=$o(i).filter(x=>XB(c,x)).toArray(),p=Mo(i).filter(x=>jB(c,x)).toArray(),y=i.slice(1,-1);return m.concat(y).concat(p)}},qW=n=>Dt(jW(n),qB(n.dom)),GB=n=>Dt(n.getSelectedBlocks(),qB(n.dom)),I5=hn.each,B5=n=>Jn(n)&&!zd(n)&&!Yc(n)&&!Td(n),L5=(n,i)=>{for(let c=n;c;c=c[i]){if(Sn(c)&&yr(c.data))return n;if(Jn(c)&&!zd(c))return c}return n},KB=(n,i,c)=>{const m=EA(n),p=Jn(i)&&pm(i),y=Jn(c)&&pm(c);if(p&&y){const x=L5(i,"previousSibling"),M=L5(c,"nextSibling");if(m.compare(x,M)){for(let L=x.nextSibling;L&&L!==M;){const q=L;L=L.nextSibling,x.appendChild(q)}return n.dom.remove(M),hn.each(hn.grep(M.childNodes),L=>{x.appendChild(L)}),x}}return c},ew=(n,i,c,m)=>{var p;if(m&&i.merge_siblings!==!1){const y=(p=KB(n,Kn(m),m))!==null&&p!==void 0?p:m;KB(n,y,Kn(y,!0))}},GW=(n,i,c)=>{if(i.clear_child_styles){const m=i.links?"*:not(a)":"*";I5(n.select(m,c),p=>{B5(p)&&pm(p)&&I5(i.styles,(y,x)=>{n.setStyle(p,x,"")})})}},F5=(n,i,c)=>{I5(n.childNodes,m=>{B5(m)&&(i(m)&&c(m),m.hasChildNodes()&&F5(m,i,c))})},KW=(n,i)=>{i.nodeName==="SPAN"&&n.getAttribs(i).length===0&&n.remove(i,!0)},JB=(n,i)=>c=>!!(c&&M2(n,c,i)),Q5=(n,i,c)=>m=>{n.setStyle(m,i,c),m.getAttribute("style")===""&&m.removeAttribute("style"),KW(n,m)},tw=mg.generate([{keep:[]},{rename:["name"]},{removed:[]}]),JW=/^(src|href|style)$/,Z5=hn.each,zA=K_,eU=n=>/^(TR|TH|TD)$/.test(n.nodeName),e8=(n,i,c)=>n.isChildOf(i,c)&&i!==c&&!n.isBlock(c),t8=(n,i,c)=>{let m=i[c?"startContainer":"endContainer"],p=i[c?"startOffset":"endOffset"];if(Jn(m)){const y=m.childNodes.length-1;!c&&p&&p--,m=m.childNodes[p>y?y:p]}return Sn(m)&&c&&p>=m.data.length&&(m=new wi(m,n.getBody()).next()||m),Sn(m)&&!c&&p===0&&(m=new wi(m,n.getBody()).prev()||m),m},n8=(n,i)=>{const c=i?"firstChild":"lastChild",m=n[c];return eU(n)&&m?n.nodeName==="TR"&&m[c]||m:n},z5=(n,i,c,m)=>{var p;const y=n.create(c,m);return(p=i.parentNode)===null||p===void 0||p.insertBefore(y,i),y.appendChild(i),y},o8=(n,i,c,m,p)=>{const y=Ge.fromDom(i),x=Ge.fromDom(n.create(m,p)),M=c?rl(y):zg(y);return ti(x,M),c?(Ca(y,x),oh(x,y)):(ou(y,x),na(x,y)),x.dom},H5=(n,i)=>i.links&&n.nodeName==="A",V5=(n,i,c)=>{const m=i.parentNode;let p;const y=n.dom,x=Uc(n);Om(c)&&m===y.getRoot()&&(!c.list_block||!zA(i,c.list_block))&&Ie(Rr(i.childNodes),M=>{bm(n,x,M.nodeName.toLowerCase())?p?p.appendChild(M):(p=z5(y,M,x),y.setAttribs(p,ub(n))):p=null}),!(Gk(c)&&!zA(c.inline,i))&&y.remove(i,!0)},tU=(n,i,c)=>rt(n)?{name:i,value:null}:{name:n,value:Eh(i,c)},TS=(n,i)=>{n.getAttrib(i,"style")===""&&(i.removeAttribute("style"),i.removeAttribute("data-mce-style"))},W5=(n,i,c,m,p)=>{let y=!1;Z5(c.styles,(x,M)=>{const{name:L,value:q}=tU(M,x,m),ae=P2(q,L);(c.remove_similar||G(q)||!Jn(p)||zA(M2(n,p,L),ae))&&n.setStyle(i,L,""),y=!0}),y&&TS(n,i)},$x=(n,i,c)=>{i==="removeformat"?Ie(GB(n.selection),m=>{Ie(UB,p=>n.dom.setStyle(m,p,"")),TS(n.dom,m)}):YB(n.formatter,i).each(m=>{Ie(GB(n.selection),p=>W5(n.dom,p,m,c,null))})},AS=(n,i,c,m,p)=>{const y=n.dom,x=EA(n),M=n.schema;if(Ml(i)&&Kg(M,i.inline)&&sg(M,m)&&m.parentElement===n.getBody())return V5(n,m,i),tw.removed();if(!i.ceFalseOverride&&m&&y.getContentEditableParent(m)==="false"||m&&!LA(y,m,i)&&!H5(m,i))return tw.keep();const L=m,q=i.preserve_attributes;if(Ml(i)&&i.remove==="all"&&ne(q)){const ae=Dt(y.getAttribs(L),fe=>yt(q,fe.name.toLowerCase()));if(y.removeAllAttribs(L),Ie(ae,fe=>y.setAttrib(L,fe.name,fe.value)),ae.length>0)return tw.rename("span")}if(i.remove!=="all"){W5(y,L,i,c,p),Z5(i.attributes,(fe,be)=>{const{name:Le,value:Ye}=tU(be,fe,c);if(i.remove_similar||G(Ye)||!Jn(p)||zA(y.getAttrib(p,Le),Ye)){if(Le==="class"){const Pe=y.getAttrib(L,Le);if(Pe){let He="";if(Ie(Pe.split(/\s+/),dt=>{/mce\-\w+/.test(dt)&&(He+=(He?" ":"")+dt)}),He){y.setAttrib(L,Le,He);return}}}if(JW.test(Le)&&L.removeAttribute("data-mce-"+Le),Le==="style"&&Df(["li"])(L)&&y.getStyle(L,"list-style-type")==="none"){L.removeAttribute(Le),y.setStyle(L,"list-style-type","none");return}Le==="class"&&L.removeAttribute("className"),L.removeAttribute(Le)}}),Z5(i.classes,fe=>{fe=Eh(fe,c),(!Jn(p)||y.hasClass(p,fe))&&y.removeClass(L,fe)});const ae=y.getAttribs(L);for(let fe=0;fe{let y;return i.parentNode&&Ie(R2(n.dom,i.parentNode).reverse(),x=>{if(!y&&Jn(x)&&x.id!=="_start"&&x.id!=="_end"){const M=Dh(n,x,c,m,p);M&&M.split!==!1&&(y=x)}}),y},uie=(n,i,c,m)=>AS(n,i,c,m,m).fold(We(m),p=>(n.dom.createFragment().appendChild(m),n.dom.rename(m,p)),We(null)),nU=(n,i,c,m,p,y,x,M)=>{var L,q;let ae,fe;const be=n.dom;if(c){const Le=c.parentNode;for(let Ye=m.parentNode;Ye&&Ye!==Le;Ye=Ye.parentNode){let Pe=be.clone(Ye,!1);for(let He=0;He{const y=n.formatter.get(i),x=y[0],M=n.dom,L=n.selection,q=Pe=>{const He=s8(n,Pe,i,c,p);return nU(n,y,He,Pe,Pe,!0,x,c)},ae=Pe=>zd(Pe)&&Jn(Pe)&&(Pe.id==="_start"||Pe.id==="_end"),fe=Pe=>Wt(y,He=>Nx(n,He,c,Pe,Pe)),be=Pe=>{const He=Rr(Pe.childNodes),bt=fe(Pe)||Wt(y,dn=>LA(M,Pe,dn)),_t=Pe.parentNode;if(!bt&&Oe(_t)&&N2(x)&&fe(_t),x.deep&&He.length)for(let dn=0;dn{Jn(Pe)&&n.dom.getStyle(Pe,"text-decoration")===dn&&Pe.parentNode&&jk(M,Pe.parentNode)===dn&&Nx(n,{deep:!1,exact:!0,inline:"span",styles:{textDecoration:dn}},void 0,Pe)})},Le=Pe=>{const He=M.get(Pe?"_start":"_end");if(He){let dt=He[Pe?"firstChild":"lastChild"];return ae(dt)&&(dt=dt[Pe?"firstChild":"lastChild"]),Sn(dt)&&dt.data.length===0&&(dt=Pe?He.previousSibling||He.nextSibling:He.nextSibling||He.previousSibling),M.remove(He,!0),dt}else return null},Ye=Pe=>{let He,dt,bt=z0(M,Pe,y,Pe.collapsed);if(x.split){if(bt=Op(bt),He=t8(n,bt,!0),dt=t8(n,bt),He!==dt){if(He=n8(He,!0),dt=n8(dt,!1),e8(M,He,dt)){const Mt=he.from(He.firstChild).getOr(He);q(o8(M,Mt,!0,"span",{id:"_start","data-mce-type":"bookmark"})),Le(!0);return}if(e8(M,dt,He)){const Mt=he.from(dt.lastChild).getOr(dt);q(o8(M,Mt,!1,"span",{id:"_end","data-mce-type":"bookmark"})),Le(!1);return}He=z5(M,He,"span",{id:"_start","data-mce-type":"bookmark"}),dt=z5(M,dt,"span",{id:"_end","data-mce-type":"bookmark"});const _t=M.createRng();_t.setStartAfter(He),_t.setEndBefore(dt),a1(M,_t,Mt=>{Ie(Mt,dn=>{!zd(dn)&&!zd(dn.parentNode)&&q(dn)})}),q(He),q(dt),He=Le(!0),dt=Le()}else He=dt=q(He);bt.startContainer=He.parentNode?He.parentNode:He,bt.startOffset=M.nodeIndex(He),bt.endContainer=dt.parentNode?dt.parentNode:dt,bt.endOffset=M.nodeIndex(dt)+1}a1(M,bt,_t=>{Ie(_t,be)})};if(m){if(A2(m)){const Pe=M.createRng();Pe.setStartBefore(m),Pe.setEndAfter(m),Ye(Pe)}else Ye(m);Ah(n,i,m,c);return}!L.isCollapsed()||!Ml(x)||Cb(n).length?(BT(n,()=>Yk(n,Ye),Pe=>Ml(x)&&A5(n,i,c,Pe)),n.nodeChanged()):HB(n,i,c,p),$x(n,i,c),Ah(n,i,m,c)},r8=(n,i,c,m,p)=>{(m||n.selection.isEditable())&&fie(n,i,c,m,p)},Nx=(n,i,c,m,p)=>AS(n,i,c,m,p).fold(Xe,y=>(n.dom.rename(m,y),!0),wt),oU=hn.each,sU=(n,i,c,m)=>{const p=y=>{if(Jn(y)&&Jn(y.parentNode)&&pm(y)){const x=jk(n,y.parentNode);n.getStyle(y,"color")&&x?n.setStyle(y,"text-decoration",x):n.getStyle(y,"text-decoration")===x&&n.setStyle(y,"text-decoration",null)}};i.styles&&(i.styles.color||i.styles.textDecoration)&&(hn.walk(m,p,"childNodes"),p(m))},i8=(n,i,c,m)=>{if(i.styles&&i.styles.backgroundColor){const p=JB(n,"fontSize");F5(m,y=>p(y)&&pm(y),Q5(n,"backgroundColor",Eh(i.styles.backgroundColor,c)))}},rU=(n,i,c,m)=>{if(Ml(i)&&(i.inline==="sub"||i.inline==="sup")){const p=JB(n,"fontSize");F5(m,x=>p(x)&&pm(x),Q5(n,"fontSize",""));const y=Dt(n.select(i.inline==="sup"?"sub":"sup",m),pm);n.remove(y,!0)}},a8=(n,i,c,m)=>{oU(i,p=>{Ml(p)&&oU(n.dom.select(p.inline,m),y=>{B5(y)&&Nx(n,p,c,y,p.exact?y:null)}),GW(n.dom,p,m)})},iU=(n,i,c,m,p)=>{const y=p.parentNode;Dh(n,y,c,m)&&Nx(n,i,m,p)||i.merge_with_parents&&y&&n.dom.getParent(y,x=>Dh(n,x,c,m)?(Nx(n,i,m,p),!0):!1)},nw=hn.each,l8=(n,i,c,m)=>{if(A_(n)&&Ml(i)&&c.parentNode){const p=td(n.schema),y=$l(Ge.fromDom(c),x=>Yc(x.dom));return os(p,m)&&$a(Ge.fromDom(c.parentNode),!1)&&!y}else return!1},sc=(n,i,c,m)=>{if(nw(c.styles,(p,y)=>{n.setStyle(i,y,Eh(p,m))}),c.styles){const p=n.getAttrib(i,"style");p&&n.setAttrib(i,"data-mce-style",p)}},die=(n,i,c,m)=>{const p=n.formatter.get(i),y=p[0],x=!m&&n.selection.isCollapsed(),M=n.dom,L=n.selection,q=(Ye,Pe=y)=>{ue(Pe.onformat)&&Pe.onformat(Ye,Pe,c,m),sc(M,Ye,Pe,c),nw(Pe.attributes,(He,dt)=>{M.setAttrib(Ye,dt,Eh(He,c))}),nw(Pe.classes,He=>{const dt=Eh(He,c);M.hasClass(Ye,dt)||M.addClass(Ye,dt)})},ae=(Ye,Pe)=>{let He=!1;return nw(Ye,dt=>ld(dt)?M.getContentEditable(Pe)==="false"&&!dt.ceFalseOverride||Oe(dt.collapsed)&&dt.collapsed!==x?!0:M.is(Pe,dt.selector)&&!Yc(Pe)?(q(Pe,dt),He=!0,!1):!0:!1),He},fe=Ye=>{if(I(Ye)){const Pe=M.create(Ye);return q(Pe),Pe}else return null},be=(Ye,Pe,He)=>{const dt=[];let bt=!0;const _t=y.inline||y.block,Mt=fe(_t),dn=Lt=>eS(y)&&Dh(n,Lt,i,c),zn=(Lt,Zt,yn)=>{const go=$2(y)&&Vl(n.schema,Lt)&&bm(n,Zt,_t);return yn&&go},Nn=(Lt,Zt,yn,go)=>{const Po=Lt.nodeName.toLowerCase(),Cs=bm(n,_t,Po)&&bm(n,Zt,_t),Ws=!He&&Sn(Lt)&&Cn(Lt.data),Ir=Yc(Lt),pi=!Ml(y)||!Ye.isBlock(Lt);return(yn||go)&&Cs&&!Ws&&!Ir&&pi};a1(Ye,Pe,Lt=>{let Zt;const yn=go=>{let Po=!1,Cs=bt,Ws=!1;const Ir=go.parentNode,pi=Ir.nodeName.toLowerCase(),ul=Ye.getContentEditable(go);Oe(ul)&&(Cs=bt,bt=ul==="true",Po=!0,Ws=D2(n,go));const Il=bt&&!Po;if(mi(go)&&!l8(n,y,go,pi)){Zt=null,Om(y)&&Ye.remove(go);return}if(dn(go)){Zt=null;return}if(zn(go,pi,Il)){const bc=Ye.rename(go,_t);q(bc),dt.push(bc),Zt=null;return}if(ld(y)){let bc=ae(p,go);if(!bc&&Oe(Ir)&&N2(y)&&(bc=ae(p,Ir)),!Ml(y)||bc){Zt=null;return}}Oe(Mt)&&Nn(go,pi,Il,Ws)?(Zt||(Zt=Ye.clone(Mt,!1),Ir.insertBefore(Zt,go),dt.push(Zt)),Ws&&Po&&(bt=Cs),Zt.appendChild(go)):(Zt=null,Ie(Rr(go.childNodes),yn),Po&&(bt=Cs),Zt=null)};Ie(Lt,yn)}),y.links===!0&&Ie(dt,Lt=>{const Zt=yn=>{yn.nodeName==="A"&&q(yn,y),Ie(Rr(yn.childNodes),Zt)};Zt(Lt)}),Ie(dt,Lt=>{const Zt=Po=>{let Cs=0;return Ie(Po.childNodes,Ws=>{!vm(Ws)&&!zd(Ws)&&Cs++}),Cs},yn=Po=>oo(Po.childNodes,Xk).filter(Ws=>Ye.getContentEditable(Ws)!=="false"&&LA(Ye,Ws,y)).map(Ws=>{const Ir=Ye.clone(Ws,!1);return q(Ir),Ye.replace(Ir,Po,!0),Ye.remove(Ws,!0),Ir}).getOr(Po),go=Zt(Lt);if((dt.length>1||!Ye.isBlock(Lt))&&go===0){Ye.remove(Lt,!0);return}(Ml(y)||Om(y)&&y.wrapper)&&(!y.exact&&go===1&&(Lt=yn(Lt)),a8(n,p,c,Lt),iU(n,y,i,c,Lt),i8(Ye,y,c,Lt),sU(Ye,y,c,Lt),rU(Ye,y,c,Lt),ew(n,y,c,Lt))})},Le=A2(m)?m:L.getNode();if(M.getContentEditable(Le)==="false"&&!D2(n,Le)){m=Le,ae(p,m),YT(n,i,m,c);return}if(y){if(m)if(A2(m)){if(!ae(p,m)){const Ye=M.createRng();Ye.setStartBefore(m),Ye.setEndAfter(m),be(M,z0(M,Ye,p),!0)}}else be(M,m,!0);else!x||!Ml(y)||Cb(n).length?(L.setRng(y5(L.getRng())),BT(n,()=>{Yk(n,(Ye,Pe)=>{const He=Pe?Ye:z0(M,Ye,p);be(M,He,!1)})},wt),n.nodeChanged()):ZW(n,i,c),YB(n.formatter,i).each(Ye=>{Ie(qW(n.selection),Pe=>sc(M,Pe,Ye,c))});UW(i,n)}YT(n,i,m,c)},aU=(n,i,c,m)=>{(m||n.selection.isEditable())&&die(n,i,c,m)},lU=n=>un(n,"vars"),hie=(n,i)=>{n.set({}),i.on("NodeChange",c=>{nv(i,c.element,n.get())}),i.on("FormatApply FormatRemove",c=>{const m=he.from(c.node).map(p=>A2(p)?p:p.startContainer).bind(p=>Jn(p)?he.some(p):he.from(p.parentElement)).getOrThunk(()=>Cg(i));nv(i,m,n.get())})},Cg=n=>n.selection.getStart(),Ix=(n,i,c,m,p)=>ps(i,M=>{const L=n.formatter.matchNode(M,c,p!=null?p:{},m);return!Se(L)},M=>T5(n,M,c)?!0:m?!1:Oe(n.formatter.matchNode(M,c,p,!0))),tv=(n,i)=>{const c=i!=null?i:Cg(n);return Dt(R2(n.dom,c),m=>Jn(m)&&!Td(m))},nv=(n,i,c)=>{const m=tv(n,i);ln(c,(p,y)=>{const x=M=>{const L=Ix(n,m,y,M.similar,lU(M)?M.vars:void 0),q=L.isSome();if(M.state.get()!==q){M.state.set(q);const ae=L.getOr(i);lU(M)?M.callback(q,{node:ae,format:y,parents:m}):Ie(M.callbacks,fe=>fe(q,{node:ae,format:y,parents:m}))}};Ie([p.withSimilar,p.withoutSimilar],x),Ie(p.withVars,x)})},cU=(n,i,c,m,p,y)=>{const x=i.get();Ie(c.split(","),M=>{const L=Oo(x,M).getOrThunk(()=>{const ae={withSimilar:{state:qa(!1),similar:!0,callbacks:[]},withoutSimilar:{state:qa(!1),similar:!1,callbacks:[]},withVars:[]};return x[M]=ae,ae}),q=()=>{const ae=tv(n);return Ix(n,ae,M,p,y).isSome()};if(Se(y)){const ae=p?L.withSimilar:L.withoutSimilar;ae.callbacks.push(m),ae.callbacks.length===1&&ae.state.set(q())}else L.withVars.push({state:qa(q()),similar:p,vars:y,callback:m})}),i.set(x)},uU=(n,i,c)=>{const m=n.get();Ie(i.split(","),p=>Oo(m,p).each(y=>{m[p]={withSimilar:{...y.withSimilar,callbacks:Dt(y.withSimilar.callbacks,x=>x!==c)},withoutSimilar:{...y.withoutSimilar,callbacks:Dt(y.withoutSimilar.callbacks,x=>x!==c)},withVars:Dt(y.withVars,x=>x.callback!==c)}})),n.set(m)},DS=(n,i,c,m,p,y)=>(cU(n,i,c,m,p,y),{unbind:()=>uU(i,c,m)}),PS=(n,i,c,m)=>{const p=n.formatter.get(i);p&&(A5(n,i,c,m)&&(!("toggle"in p[0])||p[0].toggle)?r8(n,i,c,m):aU(n,i,c,m))},ow=hn.explode,U5=()=>{const n={};return{addFilter:(p,y)=>{Ie(ow(p),x=>{un(n,x)||(n[x]={name:x,callbacks:[]}),n[x].callbacks.push(y)})},getFilters:()=>uo(n),removeFilter:(p,y)=>{Ie(ow(p),x=>{if(un(n,x))if(Oe(y)){const M=n[x],L=Dt(M.callbacks,q=>q!==y);L.length>0?M.callbacks=L:delete n[x]}else delete n[x]})}}},Y5=(n,i)=>{Ie(i,c=>{n.attr(c,null)})},c8=(n,i,c)=>{n.addNodeFilter("font",m=>{Ie(m,p=>{const y=i.parse(p.attr("style")),x=p.attr("color"),M=p.attr("face"),L=p.attr("size");x&&(y.color=x),M&&(y["font-family"]=M),L&&eu(L).each(q=>{y["font-size"]=c[q-1]}),p.name="span",p.attr("style",i.serialize(y)),Y5(p,["color","face","size"])})})},u8=(n,i,c)=>{n.addNodeFilter("strike",m=>{const p=i.type!=="html4";Ie(m,y=>{if(p)y.name="s";else{const x=c.parse(y.attr("style"));x["text-decoration"]="line-through",y.name="span",y.attr("style",c.serialize(x))}})})},fU=(n,i,c)=>{var m;const p=Fv();i.convert_fonts_to_spans&&c8(n,p,hn.explode((m=i.font_size_legacy_values)!==null&&m!==void 0?m:"")),u8(n,c,p)},dU=(n,i,c)=>{i.inline_styles&&fU(n,i,c)},X5=(n,i,c)=>{i.addNodeFilter("br",(m,p,y)=>{const x=hn.extend({},c.getBlockElements()),M=c.getNonEmptyElements(),L=c.getWhitespaceElements();x.body=1;const q=ae=>ae.name in x||sr(c,ae);for(let ae=0,fe=m.length;aefetch(n).then(i=>i.ok?i.blob():Promise.reject()).catch(()=>Promise.reject({message:`Cannot convert ${n} to Blob. Resource might not exist or is inaccessible.`,uriType:"blob"})),mU=n=>{const i=/([a-z0-9+\/=\s]+)/i.exec(n);return i?i[1]:""},j5=n=>{const[i,...c]=n.split(","),m=c.join(","),p=/data:([^/]+\/[^;]+)(;.+)?/.exec(i);if(p){const y=p[2]===";base64",x=y?mU(m):decodeURIComponent(m);return he.some({type:p[1],data:x,base64Encoded:y})}else return he.none()},f8=(n,i,c=!0)=>{let m=i;if(c)try{m=atob(i)}catch{return he.none()}const p=new Uint8Array(m.length);for(let y=0;ynew Promise((i,c)=>{j5(n).bind(({type:m,data:p,base64Encoded:y})=>f8(m,p,y)).fold(()=>c("Invalid data URI"),i)}),d8=n=>Ar(n,"blob:")?hU(n):Ar(n,"data:")?gU(n):Promise.reject("Unknown URI format"),h8=n=>new Promise((i,c)=>{const m=new FileReader;m.onloadend=()=>{i(m.result)},m.onerror=()=>{var p;c((p=m.error)===null||p===void 0?void 0:p.message)},m.readAsDataURL(n)});let Bx=0;const m8=n=>(n||"blobid")+Bx++,g8=(n,i,c)=>j5(n).bind(({data:m,type:p,base64Encoded:y})=>{if(i&&!y)return he.none();{const x=y?m:btoa(m);return c(x,p)}}),q5=(n,i,c)=>{const m=n.create(m8(),i,c);return n.add(m),m},p8=(n,i,c=!1)=>g8(i,c,(m,p)=>he.from(n.getByData(m,p)).orThunk(()=>f8(p,m).map(y=>q5(n,y,m)))),b8=(n,i)=>{const c=()=>Promise.reject("Invalid data URI");if(Ar(i,"blob:")){const m=n.getByUri(i);return Oe(m)?Promise.resolve(m):d8(i).then(p=>h8(p).then(y=>g8(y,!1,x=>he.some(q5(n,p,x))).getOrThunk(c)))}else return Ar(i,"data:")?p8(n,i).fold(c,m=>Promise.resolve(m)):Promise.reject("Unknown image data format")},pU=n=>Oe(n.attr("data-mce-bogus")),bU=n=>n.attr("src")===Gn.transparentSrc||Oe(n.attr("data-mce-placeholder")),v8=(n,i)=>{const{blob_cache:c}=i;if(c){const m=p=>{const y=p.attr("src");bU(p)||pU(p)||Ae(y)||p8(c,y,!0).each(x=>{p.attr("src",x.blobUri())})};n.addAttributeFilter("src",p=>Ie(p,m))}},O8=(n,i)=>{const c=n.schema;i.remove_trailing_brs&&X5(i,n,c),n.addAttributeFilter("href",p=>{let y=p.length;const x=L=>L.split(" ").filter(ae=>ae.length>0).concat(["noopener"]).sort().join(" "),M=L=>{const q=L?hn.trim(L):"";return/\b(noopener)\b/g.test(q)?q:x(q)};if(!i.allow_unsafe_link_target)for(;y--;){const L=p[y];L.name==="a"&&L.attr("target")==="_blank"&&L.attr("rel",M(L.attr("rel")))}}),i.allow_html_in_named_anchor||n.addAttributeFilter("id,name",p=>{let y=p.length,x,M,L,q;for(;y--;)if(q=p[y],q.name==="a"&&q.firstChild&&!q.attr("href"))for(L=q.parent,x=q.lastChild;x&&L;)M=x.prev,L.insert(x,q),x=M}),i.fix_list_elements&&n.addNodeFilter("ul,ol",p=>{let y=p.length,x,M;for(;y--;)if(x=p[y],M=x.parent,M&&(M.name==="ul"||M.name==="ol"))if(x.prev&&x.prev.name==="li")x.prev.append(x);else{const L=new Wd("li",1);L.attr("style","list-style-type: none"),x.wrap(L)}});const m=c.getValidClasses();i.validate&&m&&n.addAttributeFilter("class",p=>{var y;let x=p.length;for(;x--;){const M=p[x],L=(y=M.attr("class"))!==null&&y!==void 0?y:"",q=hn.explode(L," ");let ae="";for(let fe=0;fe"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Lx(n,i,c){return y8()?Lx=Reflect.construct:Lx=function(p,y,x){var M=[null];M.push.apply(M,y);var L=Function.bind.apply(p,M),q=new L;return x&&HA(q,x.prototype),q},Lx.apply(null,arguments)}function h1(n){return vU(n)||OU(n)||G5(n)||w8()}function vU(n){if(Array.isArray(n))return sw(n)}function OU(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function G5(n,i){if(!!n){if(typeof n=="string")return sw(n,i);var c=Object.prototype.toString.call(n).slice(8,-1);if(c==="Object"&&n.constructor&&(c=n.constructor.name),c==="Map"||c==="Set")return Array.from(n);if(c==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c))return sw(n,i)}}function sw(n,i){(i==null||i>n.length)&&(i=n.length);for(var c=0,m=new Array(i);c1?c-1:0),p=1;p/gm),sM=m1(/^data-[\-\w.\u00B7-\uFFFF]/),rM=m1(/^aria-[\-\w]+$/),kU=m1(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),xU=m1(/^(?:\w+script|data):/i),Ab=m1(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),iM=m1(/^html$/i),EU=function(){return typeof window>"u"?null:window},aM=function(i,c){if(RO(i)!=="object"||typeof i.createPolicy!="function")return null;var m=null,p="data-tt-policy-suffix";c.currentScript&&c.currentScript.hasAttribute(p)&&(m=c.currentScript.getAttribute(p));var y="dompurify"+(m?"#"+m:"");try{return i.createPolicy(y,{createHTML:function(M){return M}})}catch{return console.warn("TrustedTypes policy "+y+" could not be created."),null}};function XA(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:EU(),i=function(jt){return XA(jt)};if(i.version="2.3.8",i.removed=[],!n||!n.document||n.document.nodeType!==9)return i.isSupported=!1,i;var c=n.document,m=n.document,p=n.DocumentFragment,y=n.HTMLTemplateElement,x=n.Node,M=n.Element,L=n.NodeFilter,q=n.NamedNodeMap,ae=q===void 0?n.NamedNodeMap||n.MozNamedAttrMap:q,fe=n.HTMLFormElement,be=n.DOMParser,Le=n.trustedTypes,Ye=M.prototype,Pe=Tb(Ye,"cloneNode"),He=Tb(Ye,"nextSibling"),dt=Tb(Ye,"childNodes"),bt=Tb(Ye,"parentNode");if(typeof y=="function"){var _t=m.createElement("template");_t.content&&_t.content.ownerDocument&&(m=_t.content.ownerDocument)}var Mt=aM(Le,c),dn=Mt?Mt.createHTML(""):"",zn=m,Nn=zn.implementation,Lt=zn.createNodeIterator,Zt=zn.createDocumentFragment,yn=zn.getElementsByTagName,go=c.importNode,Po={};try{Po=Eb(m).documentMode?m.documentMode:{}}catch{}var Cs={};i.isSupported=typeof bt=="function"&&Nn&&typeof Nn.createHTMLDocument<"u"&&Po!==9;var Ws=T8,Ir=CU,pi=sM,ul=rM,Il=xU,bc=Ab,Mn=kU,eo=null,Cr=Fi({},[].concat(h1(tM),h1(dd),h1(ov),h1(nM),h1(E8))),Is=null,ko=Fi({},[].concat(h1(oM),h1(rw),h1(UA),h1(YA))),Rn=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Tn=null,jo=null,Ks=!0,Kr=!0,co=!1,Us=!1,ci=!1,Ka=!1,Ei=!1,Pc=!1,Ih=!1,Yd=!1,Tm=!0,jO=!0,Dw=!1,qO={},GO=null,B4=Fi({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),L4=null,F4=Fi({},["audio","video","img","source","image","track"]),BE=null,LE=Fi({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),FE="http://www.w3.org/1998/Math/MathML",lC="http://www.w3.org/2000/svg",k1="http://www.w3.org/1999/xhtml",cC=k1,Pw=!1,bv,QE=["application/xhtml+xml","text/html"],ZE="text/html",$b,vv=null,zE=m.createElement("form"),HE=function(jt){return jt instanceof RegExp||jt instanceof Function},VE=function(jt){vv&&vv===jt||((!jt||RO(jt)!=="object")&&(jt={}),jt=Eb(jt),eo="ALLOWED_TAGS"in jt?Fi({},jt.ALLOWED_TAGS):Cr,Is="ALLOWED_ATTR"in jt?Fi({},jt.ALLOWED_ATTR):ko,BE="ADD_URI_SAFE_ATTR"in jt?Fi(Eb(LE),jt.ADD_URI_SAFE_ATTR):LE,L4="ADD_DATA_URI_TAGS"in jt?Fi(Eb(F4),jt.ADD_DATA_URI_TAGS):F4,GO="FORBID_CONTENTS"in jt?Fi({},jt.FORBID_CONTENTS):B4,Tn="FORBID_TAGS"in jt?Fi({},jt.FORBID_TAGS):{},jo="FORBID_ATTR"in jt?Fi({},jt.FORBID_ATTR):{},qO="USE_PROFILES"in jt?jt.USE_PROFILES:!1,Ks=jt.ALLOW_ARIA_ATTR!==!1,Kr=jt.ALLOW_DATA_ATTR!==!1,co=jt.ALLOW_UNKNOWN_PROTOCOLS||!1,Us=jt.SAFE_FOR_TEMPLATES||!1,ci=jt.WHOLE_DOCUMENT||!1,Pc=jt.RETURN_DOM||!1,Ih=jt.RETURN_DOM_FRAGMENT||!1,Yd=jt.RETURN_TRUSTED_TYPE||!1,Ei=jt.FORCE_BODY||!1,Tm=jt.SANITIZE_DOM!==!1,jO=jt.KEEP_CONTENT!==!1,Dw=jt.IN_PLACE||!1,Mn=jt.ALLOWED_URI_REGEXP||Mn,cC=jt.NAMESPACE||k1,jt.CUSTOM_ELEMENT_HANDLING&&HE(jt.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Rn.tagNameCheck=jt.CUSTOM_ELEMENT_HANDLING.tagNameCheck),jt.CUSTOM_ELEMENT_HANDLING&&HE(jt.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Rn.attributeNameCheck=jt.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),jt.CUSTOM_ELEMENT_HANDLING&&typeof jt.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(Rn.allowCustomizedBuiltInElements=jt.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),bv=QE.indexOf(jt.PARSER_MEDIA_TYPE)===-1?bv=ZE:bv=jt.PARSER_MEDIA_TYPE,$b=bv==="application/xhtml+xml"?function(So){return So}:WA,Us&&(Kr=!1),Ih&&(Pc=!0),qO&&(eo=Fi({},h1(E8)),Is=[],qO.html===!0&&(Fi(eo,tM),Fi(Is,oM)),qO.svg===!0&&(Fi(eo,dd),Fi(Is,rw),Fi(Is,YA)),qO.svgFilters===!0&&(Fi(eo,ov),Fi(Is,rw),Fi(Is,YA)),qO.mathMl===!0&&(Fi(eo,nM),Fi(Is,UA),Fi(Is,YA))),jt.ADD_TAGS&&(eo===Cr&&(eo=Eb(eo)),Fi(eo,jt.ADD_TAGS)),jt.ADD_ATTR&&(Is===ko&&(Is=Eb(Is)),Fi(Is,jt.ADD_ATTR)),jt.ADD_URI_SAFE_ATTR&&Fi(BE,jt.ADD_URI_SAFE_ATTR),jt.FORBID_CONTENTS&&(GO===B4&&(GO=Eb(GO)),Fi(GO,jt.FORBID_CONTENTS)),jO&&(eo["#text"]=!0),ci&&Fi(eo,["html","head","body"]),eo.table&&(Fi(eo,["tbody"]),delete Tn.tbody),fd&&fd(jt),vv=jt)},Q4=Fi({},["mi","mo","mn","ms","mtext"]),Z4=Fi({},["foreignobject","desc","title","annotation-xml"]),OZ=Fi({},["title","style","font","a","script"]),x1=Fi({},dd);Fi(x1,ov),Fi(x1,k8);var Mw=Fi({},nM);Fi(Mw,x8);var Rt=function(jt){var So=bt(jt);(!So||!So.tagName)&&(So={namespaceURI:k1,tagName:"template"});var ws=WA(jt.tagName),Sl=WA(So.tagName);return jt.namespaceURI===lC?So.namespaceURI===k1?ws==="svg":So.namespaceURI===FE?ws==="svg"&&(Sl==="annotation-xml"||Q4[Sl]):Boolean(x1[ws]):jt.namespaceURI===FE?So.namespaceURI===k1?ws==="math":So.namespaceURI===lC?ws==="math"&&Z4[Sl]:Boolean(Mw[ws]):jt.namespaceURI===k1?So.namespaceURI===lC&&!Z4[Sl]||So.namespaceURI===FE&&!Q4[Sl]?!1:!Mw[ws]&&(OZ[ws]||!x1[ws]):!1},$t=function(jt){Zx(i.removed,{element:jt});try{jt.parentNode.removeChild(jt)}catch{try{jt.outerHTML=dn}catch{jt.remove()}}},$n=function(jt,So){try{Zx(i.removed,{attribute:So.getAttributeNode(jt),from:So})}catch{Zx(i.removed,{attribute:null,from:So})}if(So.removeAttribute(jt),jt==="is"&&!Is[jt])if(Pc||Ih)try{$t(So)}catch{}else try{So.setAttribute(jt,"")}catch{}},xn=function(jt){var So,ws;if(Ei)jt=""+jt;else{var Sl=J5(jt,/^[\r\n\t ]+/);ws=Sl&&Sl[0]}bv==="application/xhtml+xml"&&(jt=''+jt+"");var Am=Mt?Mt.createHTML(jt):jt;if(cC===k1)try{So=new be().parseFromString(Am,bv)}catch{}if(!So||!So.documentElement){So=Nn.createDocument(cC,"template",null);try{So.documentElement.innerHTML=Pw?"":Am}catch{}}var Xd=So.body||So.documentElement;return jt&&ws&&Xd.insertBefore(m.createTextNode(ws),Xd.childNodes[0]||null),cC===k1?yn.call(So,ci?"html":"body")[0]:ci?So.documentElement:Xd},Io=function(jt){return Lt.call(jt.ownerDocument||jt,jt,L.SHOW_ELEMENT|L.SHOW_COMMENT|L.SHOW_TEXT,null,!1)},br=function(jt){return jt instanceof fe&&(typeof jt.nodeName!="string"||typeof jt.textContent!="string"||typeof jt.removeChild!="function"||!(jt.attributes instanceof ae)||typeof jt.removeAttribute!="function"||typeof jt.setAttribute!="function"||typeof jt.namespaceURI!="string"||typeof jt.insertBefore!="function")},ha=function(jt){return RO(x)==="object"?jt instanceof x:jt&&RO(jt)==="object"&&typeof jt.nodeType=="number"&&typeof jt.nodeName=="string"},Mc=function(jt,So,ws){!Cs[jt]||S8(Cs[jt],function(Sl){Sl.call(i,So,ws,vv)})},Ou=function(jt){var So;if(Mc("beforeSanitizeElements",jt,null),br(jt)||Ph(/[\u0080-\uFFFF]/,jt.nodeName))return $t(jt),!0;var ws=$b(jt.nodeName);if(Mc("uponSanitizeElement",jt,{tagName:ws,allowedTags:eo}),jt.hasChildNodes()&&!ha(jt.firstElementChild)&&(!ha(jt.content)||!ha(jt.content.firstElementChild))&&Ph(/<[/\w]/g,jt.innerHTML)&&Ph(/<[/\w]/g,jt.textContent)||ws==="select"&&Ph(/