diff --git a/front/dist/assets/main.28b0c00f.js b/front/dist/assets/main.28b0c00f.js deleted file mode 100644 index 333ca1a..0000000 --- a/front/dist/assets/main.28b0c00f.js +++ /dev/null @@ -1,188 +0,0 @@ -var RN=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Gye(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}var Lc={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,y="__lodash_placeholder__",k=1,E=2,R=4,$=1,Q=2,F=1,U=2,J=4,L=8,te=16,ne=32,oe=64,X=128,ye=256,Se=512,Ne=30,pe="...",ce=800,Xe=16,tt=1,yt=2,V=3,ut=1/0,He=9007199254740991,_t=17976931348623157e292,wt=0/0,Be=4294967295,nt=Be-1,rn=Be>>>1,At=[["ary",X],["bind",F],["bindKey",U],["curry",L],["curryRight",te],["flip",Se],["partial",ne],["partialRight",oe],["rearg",ye]],Cn="[object Arguments]",je="[object Array]",ht="[object AsyncFunction]",he="[object Boolean]",Qo="[object Date]",Kn="[object DOMException]",so="[object Error]",Uo="[object Function]",as="[object GeneratorFunction]",xt="[object Map]",jt="[object Number]",gt="[object Null]",$e="[object Object]",Gt="[object Promise]",gn="[object Proxy]",Dt="[object RegExp]",An="[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]",Ro="[object Uint8Array]",Po="[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,Et=/<%([\s\S]+?)%>/g,Vt=/<%=([\s\S]+?)%>/g,Yn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,uo=/^\w*$/,wo=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,un=/[\\^$.*+?()[\]{}|]/g,ns=RegExp(un.source),xo=/^\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]/,Qa=/\\(\\)?/g,vi=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ge=/\w*$/,qe=/^[-+]0x[0-9a-f]+$/i,It=/^0b[01]+$/i,Wt=/^\[object .+?Constructor\]$/,fo=/^0o[0-7]+$/i,Bo=/^(?:0|[1-9]\d*)$/,qo=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Jr=/($^)/,at=/['\n\r\u2028\u2029\\]/g,Yo="\\ud800-\\udfff",Ni="\\u0300-\\u036f",la="\\ufe20-\\ufe2f",ma="\\u20d0-\\u20ff",gr=Ni+la+ma,Fc="\\u2700-\\u27bf",Cc="a-z\\xdf-\\xf6\\xf8-\\xff",nl="\\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",kc=nl+ga+tr+Ar,nu="['\u2019]",ku="["+Yo+"]",yr="["+kc+"]",ol="["+gr+"]",xu="\\d+",ou="["+Fc+"]",Yl="["+Cc+"]",Aa="[^"+Yo+kc+xu+Fc+Cc+Ki+"]",Dr="\\ud83c[\\udffb-\\udfff]",Qm="(?:"+ol+"|"+Dr+")",kf="[^"+Yo+"]",xr="(?:\\ud83c[\\udde6-\\uddff]){2}",Za="[\\ud800-\\udbff][\\udc00-\\udfff]",ca="["+Ki+"]",Ji="\\u200d",Tu="(?:"+Yl+"|"+Aa+")",Qc="(?:"+ca+"|"+Aa+")",Ha="(?:"+nu+"(?:d|ll|m|re|s|t|ve))?",Zc="(?:"+nu+"(?:D|LL|M|RE|S|T|VE))?",xc=Qm+"?",Cd="["+gl+"]?",Uf="(?:"+Ji+"(?:"+[kf,xr,Za].join("|")+")"+Cd+xc+")*",Eu="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Xl="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Hc=Cd+xc+Uf,xf="(?:"+[ou,xr,Za].join("|")+")"+Hc,su="(?:"+[kf+ol+"?",ol,xr,Za,ku].join("|")+")",kd=RegExp(nu,"g"),Ee=RegExp(ol,"g"),ot=RegExp(Dr+"(?="+Dr+")|"+su+Hc,"g"),pt=RegExp([ca+"?"+Yl+"+"+Ha+"(?="+[yr,ca,"$"].join("|")+")",Qc+"+"+Zc+"(?="+[yr,ca+Tu,"$"].join("|")+")",ca+"?"+Tu+"+"+Ha,ca+"+"+Zc,Xl,Eu,xu,xf].join("|"),"g"),Nt=RegExp("["+Ji+Yo+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 ]/,Mo=["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[Ro]=ys[Po]=ys[Rr]=ys[Ls]=!0,ys[Cn]=ys[je]=ys[Rs]=ys[he]=ys[er]=ys[Qo]=ys[so]=ys[Uo]=ys[xt]=ys[jt]=ys[$e]=ys[Dt]=ys[An]=ys[Hn]=ys[Ss]=!1;var ls={};ls[Cn]=ls[je]=ls[Rs]=ls[er]=ls[he]=ls[Qo]=ls[Xs]=ls[wa]=ls[ur]=ls[$s]=ls[jr]=ls[xt]=ls[jt]=ls[$e]=ls[Dt]=ls[An]=ls[Hn]=ls[ps]=ls[Ro]=ls[Po]=ls[Rr]=ls[Ls]=!0,ls[so]=ls[Uo]=ls[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={"&":"&","<":"<",">":">",'"':""","'":"'"},Hi={"&":"&","<":"<",">":">",""":'"',"'":"'"},Au={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},xd=parseFloat,qn=parseInt,Zm=typeof RN=="object"&&RN&&RN.Object===Object&&RN,zi=typeof self=="object"&&self&&self.Object===Object&&self,me=Zm||zi||Function("return this")(),Re=e&&!e.nodeType&&e,Ue=Re&&!0&&o&&!o.nodeType&&o,Bt=Ue&&Ue.exports===Re,Bn=Bt&&Zm.process,Jo=function(){try{var bt=Ue&&Ue.require&&Ue.require("util").types;return bt||Bn&&Bn.binding&&Bn.binding("util")}catch{}}(),ro=Jo&&Jo.isArrayBuffer,Oi=Jo&&Jo.isDate,hn=Jo&&Jo.isMap,qr=Jo&&Jo.isRegExp,Ll=Jo&&Jo.isSet,ea=Jo&&Jo.isTypedArray;function ri(bt,cn,an){switch(an.length){case 0:return bt.call(cn);case 1:return bt.call(cn,an[0]);case 2:return bt.call(cn,an[0],an[1]);case 3:return bt.call(cn,an[0],an[1],an[2])}return bt.apply(cn,an)}function Tf(bt,cn,an,Eo){for(var nr=-1,Yr=bt==null?0:bt.length;++nr-1}function Yf(bt,cn,an){for(var Eo=-1,nr=bt==null?0:bt.length;++Eo-1;);return an}function Gf(bt,cn){for(var an=bt.length;an--&&za(cn,bt[an],0)>-1;);return an}function eh(bt,cn){for(var an=bt.length,Eo=0;an--;)bt[an]===cn&&++Eo;return Eo}var Zg=Qg(Ai),Hm=Qg(js);function Ql(bt){return"\\"+Au[bt]}function zm(bt,cn){return bt==null?t:bt[cn]}function rl(bt){return Nt.test(bt)}function Af(bt){return On.test(bt)}function jh(bt){for(var cn,an=[];!(cn=bt.next()).done;)an.push(cn.value);return an}function Ju(bt){var cn=-1,an=Array(bt.size);return bt.forEach(function(Eo,nr){an[++cn]=[nr,Eo]}),an}function qh(bt,cn){return function(an){return bt(cn(an))}}function zc(bt,cn){for(var an=-1,Eo=bt.length,nr=0,Yr=[];++an-1}function q1(S,A){var Z=this.__data__,le=Md(Z,S);return le<0?(++this.size,Z.push([S,A])):Z[le][1]=A,this}$u.prototype.clear=tf,$u.prototype.delete=n0,$u.prototype.get=o0,$u.prototype.has=s0,$u.prototype.set=q1;function td(S){var A=-1,Z=S==null?0:S.length;for(this.clear();++A=A?S:A)),S}function Es(S,A,Z,le,Ce,We){var dt,kt=A&k,Ht=A&E,vn=A&R;if(Z&&(dt=Ce?Z(S,le,Ce,We):Z(S)),dt!==t)return dt;if(!Ol(S))return S;var Qn=Sr(S);if(Qn){if(dt=Dy(S),!kt)return du(S,dt)}else{var zn=El(S),Lo=zn==Uo||zn==as;if(gg(S))return tg(S,kt);if(zn==$e||zn==Cn||Lo&&!Ce){if(dt=Ht||Lo?{}:io(S),!kt)return Ht?mh(S,K1(dt,S)):sg(S,nf(dt,S))}else{if(!ls[zn])return Ce?S:{};dt=Py(S,zn,kt)}}We||(We=new Ac);var ms=We.get(S);if(ms)return ms;We.set(S,dt),i1(S)?S.forEach(function(Zs){dt.add(Es(Zs,A,Z,Zs,S,We))}):Tn(S)&&S.forEach(function(Zs,gi){dt.set(gi,Es(Zs,A,Z,gi,S,We))});var Ns=vn?Ht?Si:lg:Ht?gf:oc,Hr=Qn?t:Ns(S);return ks(Hr||S,function(Zs,gi){Hr&&(gi=Zs,Zs=S[gi]),Xm(dt,gi,Es(Zs,A,Z,gi,S,We))}),dt}function Rd(S){var A=oc(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],We=A[Ce],dt=S[Ce];if(dt===t&&!(Ce in S)||!We(dt))return!1}return!0}function of(S,A,Z){if(typeof S!="function")throw new Sa(f);return ap(function(){S.apply(t,Z)},A)}function Wa(S,A,Z,le){var Ce=-1,We=Ii,dt=!0,kt=S.length,Ht=[],vn=A.length;if(!kt)return Ht;Z&&(A=pa(A,Va(Z))),le?(We=Yf,dt=!1):A.length>=a&&(We=Vi,dt=!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:Jv(le);Z0&&Z(kt)?A>1?Ua(kt,A-1,Z,le,Ce):Xf(Ce,kt):le||(Ce[Ce.length]=kt)}return Ce}var qg=d0(),Wc=d0(!0);function nd(S,A){return S&&qg(S,A,oc)}function od(S,A){return S&&Wc(S,A,oc)}function Yp(S,A){return uc(A,function(Z){return hm(S[Z])})}function Hl(S,A){A=rm(A,S);for(var Z=0,le=A.length;S!=null&&ZA}function Jl(S,A){return S!=null&&ii.call(S,A)}function l0(S,A){return S!=null&&A in yi(S)}function jm(S,A,Z){return S>=Tr(A,Z)&&S=120&&Qn.length>=120)?new lo(dt&&Qn):t}Qn=S[0];var zn=-1,Lo=kt[0];e:for(;++zn-1;)kt!==S&&rh.call(kt,Ht,1),rh.call(S,Ht,1);return S}function sf(S,A){for(var Z=S?A.length:0,le=Z-1;Z--;){var Ce=A[Z];if(Z==le||Ce!==We){var We=Ce;lm(Ce)?rh.call(S,Ce,1):Nf(S,Ce)}}return S}function $f(S,A){return S+Je(Bi()*(A-S+1))}function fh(S,A,Z,le){for(var Ce=-1,We=ho(_e((A-S)/(Z||1)),0),dt=an(We);We--;)dt[le?We:++Ce]=S,S+=Z;return dt}function dh(S,A){var Z="";if(!S||A<1||A>He)return Z;do A%2&&(Z+=S),A=Je(A/2),A&&(S+=S);while(A);return Z}function fr(S,A){return Iy(n_(S,A,pf),S+"")}function Gm(S){return Nu(pb(S))}function Km(S,A){var Z=pb(S);return Yc(Z,ba(A,0,Z.length))}function oa(S,A,Z,le){if(!Ol(S))return S;A=rm(A,S);for(var Ce=-1,We=A.length,dt=We-1,kt=S;kt!=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 We=an(Ce);++le>>1,dt=S[We];dt!==null&&!al(dt)&&(Z?dt<=A:dt=a){var vn=A?null:Ey(S);if(vn)return Gh(vn);dt=!1,Ce=Vi,Ht=new lo}else Ht=A?[]:kt;e:for(;++le=le?S:Ps(S,A,Z)}var $d=Vp||function(S){return me.clearTimeout(S)};function tg(S,A){if(A)return S.slice();var Z=S.length,le=X1?X1(Z):new S.constructor(Z);return S.copy(le),le}function ng(S){var A=new S.constructor(S.byteLength);return new em(A).set(new em(S)),A}function im(S,A){var Z=A?ng(S.buffer):S.buffer;return new S.constructor(Z,S.byteOffset,S.byteLength)}function rf(S){var A=new S.constructor(S.source,Ge.exec(S));return A.lastIndex=S.lastIndex,A}function f0(S){return Jf?yi(Jf.call(S)):{}}function tb(S,A){var Z=A?ng(S.buffer):S.buffer;return new S.constructor(Z,S.byteOffset,S.length)}function e_(S,A){if(S!==A){var Z=S!==t,le=S===null,Ce=S===S,We=al(S),dt=A!==t,kt=A===null,Ht=A===A,vn=al(A);if(!kt&&!vn&&!We&&S>A||We&&dt&&Ht&&!kt&&!vn||le&&dt&&Ht||!Z&&Ht||!Ce)return 1;if(!le&&!We&&!vn&&S=kt)return Ht;var vn=Z[le];return Ht*(vn=="desc"?-1:1)}}return S.index-A.index}function Jg(S,A,Z,le){for(var Ce=-1,We=S.length,dt=Z.length,kt=-1,Ht=A.length,vn=ho(We-dt,0),Qn=an(Ht+vn),zn=!le;++kt1?Z[Ce-1]:t,dt=Ce>2?Z[2]:t;for(We=S.length>3&&typeof We=="function"?(Ce--,We):t,dt&&af(Z[0],Z[1],dt)&&(We=Ce<3?t:We,Ce=1),A=yi(A);++le-1?Ce[We?A[dt]:dt]:t}}function Iv(S){return Bd(function(A){var Z=A.length,le=Z,Ce=Ru.prototype.thru;for(S&&A.reverse();le--;){var We=A[le];if(typeof We!="function")throw new Sa(f);if(Ce&&!dt&&Fd(We)=="wrapper")var dt=new Ru([],!0)}for(le=dt?le:Z;++le1&&Ci.reverse(),Qn&&Htkt))return!1;var vn=We.get(S),Qn=We.get(A);if(vn&&Qn)return vn==A&&Qn==S;var zn=-1,Lo=!0,ms=Z&Q?new lo:t;for(We.set(S,A),We.set(A,S);++zn1?"& ":"")+A[le],A=A.join(Z>2?", ":" "),S.replace(kr,`{ -/* [wrapped with `+A+`] */ -`)}function My(S){return Sr(S)||dm(S)||!!(Ed&&S&&S[Ed])}function lm(S,A){var Z=typeof S;return A=A==null?He:A,!!A&&(Z=="number"||Z!="symbol"&&Bo.test(S))&&S>-1&&S%1==0&&S0){if(++A>=ce)return arguments[0]}else A=0;return S.apply(t,arguments)}}function Yc(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,Wv(S,Z)});function fp(S){var A=Te(S);return A.__chain__=!0,A}function Jp(S,A){return A(S),S}function e1(S,A){return A(S)}var fg=Bd(function(S){var A=S.length,Z=A?S[0]:0,le=this.__wrapped__,Ce=function(We){return Ui(We,S)};return A>1||this.__actions__.length||!(le instanceof hi)||!lm(Z)?this.thru(Ce):(le=le.slice(Z,+Z+(A?1:0)),le.__actions__.push({func:e1,args:[Ce],thisArg:t}),new Ru(le,this.__chain__).thru(function(We){return A&&!We.length&&We.push(t),We}))});function Uv(){return fp(this)}function sa(){return new Ru(this.value(),this.__chain__)}function ff(){this.__values__===t&&(this.__values__=f2(this.value()));var S=this.__index__>=this.__values__.length,A=S?t:this.__values__[this.__index__++];return{done:S,value:A}}function ab(){return this}function ek(S){for(var A,Z=this;Z instanceof Yg;){var le=Zv(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 Xy(){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:e1,args:[Ta],thisArg:t}),new Ru(A,this.__chain__)}return this.thru(Ta)}function tk(){return Gg(this.__wrapped__,this.__actions__)}var t1=Bu(function(S,A,Z){ii.call(S,Z)?++S[Z]:mi(S,Z,1)});function lb(S,A,Z){var le=Sr(S)?Di:nn;return Z&&af(S,A,Z)&&(A=t),le(S,Qs(A,3))}function ad(S,A){var Z=Sr(S)?uc:xa;return Z(S,Qs(A,3))}var jy=ig(Hv),m_=ig(Qy);function g_(S,A){return Ua(o1(S,A),1)}function nk(S,A){return Ua(o1(S,A),ut)}function p_(S,A,Z){return Z=Z===t?1:Xr(Z),Ua(o1(S,A),Z)}function k0(S,A){var Z=Sr(S)?ks:ka;return Z(S,Qs(A,3))}function x0(S,A){var Z=Sr(S)?ru:Up;return Z(S,Qs(A,3))}var b_=Bu(function(S,A,Z){ii.call(S,Z)?S[Z].push(A):mi(S,Z,[A])});function qy(S,A,Z,le){S=bu(S)?S:pb(S),Z=Z&&!le?Xr(Z):0;var Ce=S.length;return Z<0&&(Z=ho(Ce+Z,0)),Ff(S)?Z<=Ce&&S.indexOf(A,Z)>-1:!!Ce&&za(S,A,Z)>-1}var n1=fr(function(S,A,Z){var le=-1,Ce=typeof A=="function",We=bu(S)?an(S.length):[];return ka(S,function(dt){We[++le]=Ce?ri(A,dt,Z):hc(dt,A,Z)}),We}),v_=Bu(function(S,A,Z){mi(S,Z,A)});function o1(S,A){var Z=Sr(S)?pa:lt;return Z(S,Qs(A,3))}function dg(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 Yv=Bu(function(S,A,Z){S[Z?0:1].push(A)},function(){return[[],[]]});function df(S,A,Z){var le=Sr(S)?pr:qf,Ce=arguments.length<3;return le(S,Qs(A,4),Z,Ce,ka)}function cb(S,A,Z){var le=Sr(S)?qu:qf,Ce=arguments.length<3;return le(S,Qs(A,4),Z,Ce,Up)}function qs(S,A){var Z=Sr(S)?uc:xa;return Z(S,Ch(Qs(A,3)))}function pu(S){var A=Sr(S)?Nu:Gm;return A(S)}function hg(S,A,Z){(Z?af(S,A,Z):A===t)?A=1:A=Xr(A);var le=Sr(S)?Wp:Km;return le(S,A)}function Gy(S){var A=Sr(S)?G1:Jm;return A(S)}function Yi(S){if(S==null)return 0;if(bu(S))return Ff(S)?Kf(S):S.length;var A=El(S);return A==xt||A==An?S.size:q(S).length}function Ky(S,A,Z){var le=Sr(S)?Gu:Fr;return Z&&af(S,A,Z)&&(A=t),le(S,Qs(A,3))}var mg=fr(function(S,A){if(S==null)return[];var Z=A.length;return Z>1&&af(S,A[0],A[1])?A=[]:Z>2&&af(A[0],A[1],A[2])&&(A=[A[0]]),_i(S,Ua(A,1),[])}),Oa=ee||function(){return me.Date.now()};function fm(S,A){if(typeof A!="function")throw new Sa(f);return S=Xr(S),function(){if(--S<1)return A.apply(this,arguments)}}function zt(S,A,Z){return A=Z?t:A,A=S&&A==null?S.length:A,Id(S,X,t,t,t,t,A)}function T0(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 Jy=fr(function(S,A,Z){var le=F;if(Z.length){var Ce=zc(Z,hu(Jy));le|=ne}return Id(S,le,A,Z,Ce)}),E0=fr(function(S,A,Z){var le=F|U;if(Z.length){var Ce=zc(Z,hu(E0));le|=ne}return Id(A,le,S,Z,Ce)});function Sh(S,A,Z){A=Z?t:A;var le=Id(S,L,t,t,t,t,t,A);return le.placeholder=Sh.placeholder,le}function hf(S,A,Z){A=Z?t:A;var le=Id(S,te,t,t,t,t,t,A);return le.placeholder=hf.placeholder,le}function ub(S,A,Z){var le,Ce,We,dt,kt,Ht,vn=0,Qn=!1,zn=!1,Lo=!0;if(typeof S!="function")throw new Sa(f);A=cd(A)||0,Ol(Z)&&(Qn=!!Z.leading,zn="maxWait"in Z,We=zn?ho(cd(Z.maxWait)||0,A):We,Lo="trailing"in Z?!!Z.trailing:Lo);function ms(Ea){var bm=le,ud=Ce;return le=Ce=t,vn=Ea,dt=S.apply(ud,bm),dt}function Ns(Ea){return vn=Ea,kt=ap(gi,A),Qn?ms(Ea):dt}function Hr(Ea){var bm=Ea-Ht,ud=Ea-vn,k2=A-bm;return zn?Tr(k2,We-ud):k2}function Zs(Ea){var bm=Ea-Ht,ud=Ea-vn;return Ht===t||bm>=A||bm<0||zn&&ud>=We}function gi(){var Ea=Oa();if(Zs(Ea))return Ci(Ea);kt=ap(gi,Hr(Ea))}function Ci(Ea){return kt=t,Lo&&le?ms(Ea):(le=Ce=t,dt)}function Ou(){kt!==t&&$d(kt),vn=0,le=Ht=Ce=kt=t}function Qu(){return kt===t?dt:Ci(Oa())}function Qf(){var Ea=Oa(),bm=Zs(Ea);if(le=arguments,Ce=this,Ht=Ea,bm){if(kt===t)return Ns(Ht);if(zn)return $d(kt),kt=ap(gi,A),ms(Ht)}return kt===t&&(kt=ap(gi,A)),dt}return Qf.cancel=Ou,Qf.flush=Qu,Qf}var Xv=fr(function(S,A){return of(S,1,A)}),e2=fr(function(S,A,Z){return of(S,cd(A)||0,Z)});function jv(S){return Id(S,Se)}function A0(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],We=Z.cache;if(We.has(Ce))return We.get(Ce);var dt=S.apply(this,le);return Z.cache=We.set(Ce,dt)||We,dt};return Z.cache=new(A0.Cache||td),Z}A0.Cache=td;function Ch(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 ld(S){return T0(2,S)}var Lu=Ra(function(S,A){A=A.length==1&&Sr(A[0])?pa(A[0],Va(Qs())):pa(Ua(A,1),Va(Qs()));var Z=A.length;return fr(function(le){for(var Ce=-1,We=Tr(le.length,Z);++Ce=A}),dm=Tt(function(){return arguments}())?Tt:function(S){return Pl(S)&&ii.call(S,"callee")&&!tm.call(S,"callee")},Sr=an.isArray,w_=ro?Va(ro):Dc;function bu(S){return S!=null&&r1(S.length)&&!hm(S)}function Dl(S){return Pl(S)&&bu(S)}function s2(S){return S===!0||S===!1||Pl(S)&&Ya(S)==he}var gg=Dn||gm,bc=Oi?Va(Oi):au;function AE(S){return Pl(S)&&S.nodeType===1&&!fb(S)}function pg(S){if(S==null)return!0;if(bu(S)&&(Sr(S)||typeof S=="string"||typeof S.splice=="function"||gg(S)||Qd(S)||dm(S)))return!S.length;var A=El(S);if(A==xt||A==An)return!S.size;if(rp(S))return!q(S).length;for(var Z in S)if(ii.call(S,Z))return!1;return!0}function ok(S,A){return mc(S,A)}function sk(S,A,Z){Z=typeof Z=="function"?Z:t;var le=Z?Z(S,A):t;return le===t?mc(S,A,t,Z):!!le}function r2(S){if(!Pl(S))return!1;var A=Ya(S);return A==so||A==Kn||typeof S.message=="string"&&typeof S.name=="string"&&!fb(S)}function i2(S){return typeof S=="number"&&wn(S)}function hm(S){if(!Ol(S))return!1;var A=Ya(S);return A==Uo||A==as||A==ht||A==gn}function a2(S){return typeof S=="number"&&S==Xr(S)}function r1(S){return typeof S=="number"&&S>-1&&S%1==0&&S<=He}function Ol(S){var A=typeof S;return S!=null&&(A=="object"||A=="function")}function Pl(S){return S!=null&&typeof S=="object"}var Tn=hn?Va(hn):ja;function rk(S,A){return S===A||qa(S,A,bh(A))}function nc(S,A,Z){return Z=typeof Z=="function"?Z:t,qa(S,A,bh(A),Z)}function ik(S){return c2(S)&&S!=+S}function l2(S){if(Bf(S))throw new nr(l);return qm(S)}function no(S){return S===null}function Pc(S){return S==null}function c2(S){return typeof S=="number"||Pl(S)&&Ya(S)==jt}function fb(S){if(!Pl(S)||Ya(S)!=$e)return!1;var A=Wm(S);if(A===null)return!0;var Z=ii.call(A,"constructor")&&A.constructor;return typeof Z=="function"&&Z instanceof Z&&ef.call(Z)==Y1}var mf=qr?Va(qr):lu;function Kv(S){return a2(S)&&S>=-He&&S<=He}var i1=Ll?Va(Ll):c0;function Ff(S){return typeof S=="string"||!Sr(S)&&Pl(S)&&Ya(S)==Hn}function al(S){return typeof S=="symbol"||Pl(S)&&Ya(S)==ps}var Qd=ea?Va(ea):Zo;function Zd(S){return S===t}function jc(S){return Pl(S)&&El(S)==Ss}function db(S){return Pl(S)&&Ya(S)==Mr}var u2=li(Ae),__=li(function(S,A){return S<=A});function f2(S){if(!S)return[];if(bu(S))return Ff(S)?jl(S):du(S);if(ai&&S[ai])return jh(S[ai]());var A=El(S),Z=A==xt?Ju:A==An?Gh:pb;return Z(S)}function kh(S){if(!S)return S===0?S:0;if(S=cd(S),S===ut||S===-ut){var A=S<0?-1:1;return A*_t}return S===S?S:0}function Xr(S){var A=kh(S),Z=A%1;return A===A?Z?A-Z:A:0}function Jv(S){return S?ba(Xr(S),0,Be):0}function cd(S){if(typeof S=="number")return S;if(al(S))return wt;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=Fl(S);var Z=It.test(S);return Z||fo.test(S)?qn(S.slice(2),Z?2:8):qe.test(S)?wt:+S}function S_(S){return If(S,gf(S))}function C_(S){return S?ba(Xr(S),-He,He):S===0?S:0}function fa(S){return S==null?"":Gi(S)}var ak=Nd(function(S,A){if(rp(A)||bu(A)){If(A,oc(A),S);return}for(var Z in A)ii.call(A,Z)&&Xm(S,Z,A[Z])}),eO=Nd(function(S,A){If(A,gf(A),S)}),tO=Nd(function(S,A,Z,le){If(A,gf(A),S,le)}),k_=Nd(function(S,A,Z,le){If(A,oc(A),S,le)}),lk=Bd(Ui);function hb(S,A){var Z=Pf(S);return A==null?Z:nf(Z,A)}var x_=fr(function(S,A){S=yi(S);var Z=-1,le=A.length,Ce=le>2?A[2]:t;for(Ce&&af(A[0],A[1],Ce)&&(le=1);++Z1),We}),If(S,Si(S),Z),le&&(Z=Es(Z,k|E|R,UC));for(var Ce=A.length;Ce--;)Nf(Z,A[Ce]);return Z});function P_(S,A){return mp(S,Ch(Qs(A)))}var M_=Bd(function(S,A){return S==null?{}:or(S,A)});function mp(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 mk(S,A,Z){A=rm(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 Tr(S+Ce*(A-S+xd("1e-"+((Ce+"").length-1))),A)}return $f(S,A)}var N_=gh(function(S,A,Z){return A=A.toLowerCase(),S+(Z?xh(A):A)});function xh(S){return bb(fa(S).toLowerCase())}function $0(S){return S=fa(S),S&&S.replace(qo,Zg).replace(Ee,"")}function I_(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 Th(S){return S=fa(S),S&&ze.test(S)?S.replace(vs,Hm):S}function gp(S){return S=fa(S),S&&ns.test(S)?S.replace(un,"\\$&"):S}var m2=gh(function(S,A,Z){return S+(Z?"-":"")+A.toLowerCase()}),B_=gh(function(S,A,Z){return S+(Z?" ":"")+A.toLowerCase()}),aO=$v("toLowerCase");function bk(S,A,Z){S=fa(S),A=Xr(A);var le=A?Kf(S):0;if(!A||le>=A)return S;var Ce=(A-le)/2;return tp(Je(Ce),Z)+S+tp(_e(Ce),Z)}function L_(S,A,Z){S=fa(S),A=Xr(A);var le=A?Kf(S):0;return A&&le>>0,Z?(S=fa(S),S&&(typeof A=="string"||A!=null&&!mf(A))&&(A=Gi(A),!A&&rl(S))?hh(jl(S),0,Z):S.split(A,Z)):[]}var wk=gh(function(S,A,Z){return S+(Z?" ":"")+bb(A)});function _k(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 H_(S,A,Z){var le=Te.templateSettings;Z&&af(S,A,Z)&&(A=t),S=fa(S),A=tO({},A,le,t_);var Ce=tO({},A.imports,le.imports,t_),We=oc(Ce),dt=qi(Ce,We),kt,Ht,vn=0,Qn=A.interpolate||Jr,zn="__p += '",Lo=nh((A.escape||Jr).source+"|"+Qn.source+"|"+(Qn===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(Lo,function(Zs,gi,Ci,Ou,Qu,Qf){return Ci||(Ci=Ou),zn+=S.slice(vn,Qf).replace(at,Ql),gi&&(kt=!0,zn+=`' + -__e(`+gi+`) + -'`),Qu&&(Ht=!0,zn+=`'; -`+Qu+`; -__p += '`),Ci&&(zn+=`' + -((__t = (`+Ci+`)) == null ? '' : __t) + -'`),vn=Qf+Zs.length,Zs}),zn+=`'; -`;var Ns=ii.call(A,"variable")&&A.variable;if(!Ns)zn=`with (obj) { -`+zn+` -} -`;else if(Zi.test(Ns))throw new nr(d);zn=(Ht?zn.replace(aa,""):zn).replace(bs,"$1").replace(_a,"$1;"),zn="function("+(Ns||"obj")+`) { -`+(Ns?"":`obj || (obj = {}); -`)+"var __t, __p = ''"+(kt?", __e = _.escape":"")+(Ht?`, __j = Array.prototype.join; -function print() { __p += __j.call(arguments, '') } -`:`; -`)+zn+`return __p -}`;var Hr=b2(function(){return Yr(We,ms+"return "+zn).apply(t,dt)});if(Hr.source=zn,r2(Hr))throw Hr;return Hr}function g2(S){return fa(S).toLowerCase()}function p2(S){return fa(S).toUpperCase()}function Sk(S,A,Z){if(S=fa(S),S&&(Z||A===t))return Fl(S);if(!S||!(A=Gi(A)))return S;var le=jl(S),Ce=jl(A),We=fc(le,Ce),dt=Gf(le,Ce)+1;return hh(le,We,dt).join("")}function Ck(S,A,Z){if(S=fa(S),S&&(Z||A===t))return S.slice(0,Hg(S)+1);if(!S||!(A=Gi(A)))return S;var le=jl(S),Ce=Gf(le,jl(A))+1;return hh(le,0,Ce).join("")}function lO(S,A,Z){if(S=fa(S),S&&(Z||A===t))return S.replace(xo,"");if(!S||!(A=Gi(A)))return S;var le=jl(S),Ce=fc(le,jl(A));return hh(le,Ce).join("")}function z_(S,A){var Z=Ne,le=pe;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 We=S.length;if(rl(S)){var dt=jl(S);We=dt.length}if(Z>=We)return S;var kt=Z-Kf(le);if(kt<1)return le;var Ht=dt?hh(dt,0,kt).join(""):S.slice(0,kt);if(Ce===t)return Ht+le;if(dt&&(kt+=Ht.length-kt),mf(Ce)){if(S.slice(kt).search(Ce)){var vn,Qn=Ht;for(Ce.global||(Ce=nh(Ce.source,fa(Ge.exec(Ce))+"g")),Ce.lastIndex=0;vn=Ce.exec(Qn);)var zn=vn.index;Ht=Ht.slice(0,zn===t?kt:zn)}}else if(S.indexOf(Gi(Ce),kt)!=kt){var Lo=Ht.lastIndexOf(Ce);Lo>-1&&(Ht=Ht.slice(0,Lo))}return Ht+le}function cO(S){return S=fa(S),S&&Qi.test(S)?S.replace(ln,Ke):S}var N0=gh(function(S,A,Z){return S+(Z?" ":"")+A.toUpperCase()}),bb=$v("toUpperCase");function uO(S,A,Z){return S=fa(S),A=Z?t:A,A===t?Af(S)?zg(S):Jd(S):S.match(A)||[]}var b2=fr(function(S,A){try{return ri(S,t,A)}catch(Z){return r2(Z)?Z:new nr(Z)}}),V_=Bd(function(S,A){return ks(A,function(Z){Z=lf(Z),mi(S,Z,Jy(S[Z],S))}),S});function v2(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;++CeHe)return[];var Z=Be,le=Tr(S,Be);A=Qs(A),S-=Be;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(Be)},nd(hi.prototype,function(S,A){var Z=/^(?:filter|find|map|reject)|While$/.test(A),le=/^(?:head|last)$/.test(A),Ce=Te[le?"take"+(A=="last"?"Right":""):A],We=le||/^find/.test(A);!Ce||(Te.prototype[A]=function(){var dt=this.__wrapped__,kt=le?[1]:arguments,Ht=dt instanceof hi,vn=kt[0],Qn=Ht||Sr(dt),zn=function(gi){var Ci=Ce.apply(Te,Xf([gi],kt));return le&&Lo?Ci[0]:Ci};Qn&&Z&&typeof vn=="function"&&vn.length!=1&&(Ht=Qn=!1);var Lo=this.__chain__,ms=!!this.__actions__.length,Ns=We&&!Lo,Hr=Ht&&!ms;if(!We&&Qn){dt=Hr?dt:new hi(this);var Zs=S.apply(dt,kt);return Zs.__actions__.push({func:e1,args:[zn],thisArg:t}),new Ru(Zs,Lo)}return Ns&&Hr?S.apply(this,kt):(Zs=this.thru(zn),Ns?le?Zs.value()[0]:Zs.value():Zs)})}),ks(["pop","push","shift","sort","splice","unshift"],function(S){var A=Td[S],Z=/^(?:push|sort|unshift)$/.test(S)?"tap":"thru",le=/^(?:pop|shift)$/.test(S);Te.prototype[S]=function(){var Ce=arguments;if(le&&!this.__chain__){var We=this.value();return A.apply(Sr(We)?We:[],Ce)}return this[Z](function(dt){return A.apply(Sr(dt)?dt:[],Ce)})}}),nd(hi.prototype,function(S,A){var Z=Te[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=Pv,hi.prototype.reverse=j1,hi.prototype.value=t0,Te.prototype.at=fg,Te.prototype.chain=Uv,Te.prototype.commit=sa,Te.prototype.next=ff,Te.prototype.plant=ek,Te.prototype.reverse=Xy,Te.prototype.toJSON=Te.prototype.valueOf=Te.prototype.value=tk,Te.prototype.first=Te.prototype.head,ai&&(Te.prototype[ai]=ab),Te},Kh=U1();Ue?((Ue.exports=Kh)._=Kh,Re._=Kh):me._=Kh}).call(RN)})(Lc,Lc.exports);const Kye=Lc.exports;var Uge={exports:{}},Yse={exports:{}},Yge=function(e,t){return function(){for(var a=new Array(arguments.length),l=0;l"u"}function e2e(o){return o!==null&&!xoe(o)&&o.constructor!==null&&!xoe(o.constructor)&&typeof o.constructor.isBuffer=="function"&&o.constructor.isBuffer(o)}function Xge(o){return FC.call(o)==="[object ArrayBuffer]"}function t2e(o){return FC.call(o)==="[object FormData]"}function n2e(o){var e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(o):e=o&&o.buffer&&Xge(o.buffer),e}function o2e(o){return typeof o=="string"}function s2e(o){return typeof o=="number"}function jge(o){return o!==null&&typeof o=="object"}function wH(o){if(FC.call(o)!=="[object Object]")return!1;var e=Object.getPrototypeOf(o);return e===null||e===Object.prototype}function r2e(o){return FC.call(o)==="[object Date]"}function i2e(o){return FC.call(o)==="[object File]"}function a2e(o){return FC.call(o)==="[object Blob]"}function qge(o){return FC.call(o)==="[object Function]"}function l2e(o){return jge(o)&&qge(o.pipe)}function c2e(o){return FC.call(o)==="[object URLSearchParams]"}function u2e(o){return o.trim?o.trim():o.replace(/^\s+|\s+$/g,"")}function f2e(){return typeof navigator<"u"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")?!1:typeof window<"u"&&typeof document<"u"}function jse(o,e){if(!(o===null||typeof o>"u"))if(typeof o!="object"&&(o=[o]),Xse(o))for(var t=0,s=o.length;t"u"||(q4.isArray(h)?b=b+"[]":h=[h],q4.forEach(h,function(k){q4.isDate(k)?k=k.toISOString():q4.isObject(k)&&(k=JSON.stringify(k)),l.push(Hae(b)+"="+Hae(k))}))}),a=l.join("&")}if(a){var f=e.indexOf("#");f!==-1&&(e=e.slice(0,f)),e+=(e.indexOf("?")===-1?"?":"&")+a}return e},m2e=Zp;function zz(){this.handlers=[]}zz.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};zz.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)};zz.prototype.forEach=function(e){m2e.forEach(this.handlers,function(s){s!==null&&e(s)})};var g2e=zz,p2e=Zp,b2e=function(e,t){p2e.forEach(e,function(a,l){l!==t&&l.toUpperCase()===t.toUpperCase()&&(e[t]=a,delete e[l])})},Kge=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},Wte,zae;function Jge(){if(zae)return Wte;zae=1;var o=Kge;return Wte=function(t,s,a,l,f){var d=new Error(t);return o(d,s,a,l,f)},Wte}var Ute,Vae;function v2e(){if(Vae)return Ute;Vae=1;var o=Jge();return Ute=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))},Ute}var Yte,Wae;function O2e(){if(Wae)return Yte;Wae=1;var o=Zp;return Yte=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(){}}}(),Yte}var Xte,Uae;function y2e(){return Uae||(Uae=1,Xte=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}),Xte}var jte,Yae;function w2e(){return Yae||(Yae=1,jte=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}),jte}var qte,Xae;function _2e(){if(Xae)return qte;Xae=1;var o=y2e(),e=w2e();return qte=function(s,a){return s&&!o(a)?e(s,a):a},qte}var Gte,jae;function S2e(){if(jae)return Gte;jae=1;var o=Zp,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 Gte=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},Gte}var Kte,qae;function C2e(){if(qae)return Kte;qae=1;var o=Zp;return Kte=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}}(),Kte}var Jte,Gae;function Vz(){if(Gae)return Jte;Gae=1;function o(e){this.message=e}return o.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},o.prototype.__CANCEL__=!0,Jte=o,Jte}var ene,Kae;function Jae(){if(Kae)return ene;Kae=1;var o=Zp,e=v2e(),t=O2e(),s=Gge,a=_2e(),l=S2e(),f=C2e(),d=Jge(),h=Wz(),b=Vz();return ene=function(k){return new Promise(function(R,$){var Q=k.data,F=k.headers,U=k.responseType,J;function L(){k.cancelToken&&k.cancelToken.unsubscribe(J),k.signal&&k.signal.removeEventListener("abort",J)}o.isFormData(Q)&&delete F["Content-Type"];var te=new XMLHttpRequest;if(k.auth){var ne=k.auth.username||"",oe=k.auth.password?unescape(encodeURIComponent(k.auth.password)):"";F.Authorization="Basic "+btoa(ne+":"+oe)}var X=a(k.baseURL,k.url);te.open(k.method.toUpperCase(),s(X,k.params,k.paramsSerializer),!0),te.timeout=k.timeout;function ye(){if(!!te){var Ne="getAllResponseHeaders"in te?l(te.getAllResponseHeaders()):null,pe=!U||U==="text"||U==="json"?te.responseText:te.response,ce={data:pe,status:te.status,statusText:te.statusText,headers:Ne,config:k,request:te};e(function(tt){R(tt),L()},function(tt){$(tt),L()},ce),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 pe=k.timeout?"timeout of "+k.timeout+"ms exceeded":"timeout exceeded",ce=k.transitional||h.transitional;k.timeoutErrorMessage&&(pe=k.timeoutErrorMessage),$(d(pe,k,ce.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",te)),te=null},o.isStandardBrowserEnv()){var Se=(k.withCredentials||f(X))&&k.xsrfCookieName?t.read(k.xsrfCookieName):void 0;Se&&(F[k.xsrfHeaderName]=Se)}"setRequestHeader"in te&&o.forEach(F,function(pe,ce){typeof Q>"u"&&ce.toLowerCase()==="content-type"?delete F[ce]:te.setRequestHeader(ce,pe)}),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)&&(J=function(Ne){!te||($(!Ne||Ne&&Ne.type?new b("canceled"):Ne),te.abort(),te=null)},k.cancelToken&&k.cancelToken.subscribe(J),k.signal&&(k.signal.aborted?J():k.signal.addEventListener("abort",J))),Q||(Q=null),te.send(Q)})},ene}var tne,ele;function Wz(){if(ele)return tne;ele=1;var o=Zp,e=b2e,t=Kge,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=Jae()),h}function f(h,b,y){if(o.isString(h))try{return(b||JSON.parse)(h),o.trim(h)}catch(k){if(k.name!=="SyntaxError")throw k}return(y||JSON.stringify)(h)}var d={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:l(),transformRequest:[function(b,y){return e(y,"Accept"),e(y,"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(y,"application/x-www-form-urlencoded;charset=utf-8"),b.toString()):o.isObject(b)||y&&y["Content-Type"]==="application/json"?(a(y,"application/json"),f(b)):b}],transformResponse:[function(b){var y=this.transitional||d.transitional,k=y&&y.silentJSONParsing,E=y&&y.forcedJSONParsing,R=!k&&this.responseType==="json";if(R||E&&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)}),tne=d,tne}var k2e=Zp,x2e=Wz(),T2e=function(e,t,s){var a=this||x2e;return k2e.forEach(s,function(f){e=f.call(a,e,t)}),e},nne,tle;function epe(){return tle||(tle=1,nne=function(e){return!!(e&&e.__CANCEL__)}),nne}var nle=Zp,one=T2e,E2e=epe(),A2e=Wz(),D2e=Vz();function sne(o){if(o.cancelToken&&o.cancelToken.throwIfRequested(),o.signal&&o.signal.aborted)throw new D2e("canceled")}var P2e=function(e){sne(e),e.headers=e.headers||{},e.data=one.call(e,e.data,e.headers,e.transformRequest),e.headers=nle.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),nle.forEach(["delete","get","head","post","put","patch","common"],function(a){delete e.headers[a]});var t=e.adapter||A2e.adapter;return t(e).then(function(a){return sne(e),a.data=one.call(e,a.data,a.headers,e.transformResponse),a},function(a){return E2e(a)||(sne(e),a&&a.response&&(a.response.data=one.call(e,a.response.data,a.response.headers,e.transformResponse))),Promise.reject(a)})},A1=Zp,tpe=function(e,t){t=t||{};var s={};function a(y,k){return A1.isPlainObject(y)&&A1.isPlainObject(k)?A1.merge(y,k):A1.isPlainObject(k)?A1.merge({},k):A1.isArray(k)?k.slice():k}function l(y){if(A1.isUndefined(t[y])){if(!A1.isUndefined(e[y]))return a(void 0,e[y])}else return a(e[y],t[y])}function f(y){if(!A1.isUndefined(t[y]))return a(void 0,t[y])}function d(y){if(A1.isUndefined(t[y])){if(!A1.isUndefined(e[y]))return a(void 0,e[y])}else return a(void 0,t[y])}function h(y){if(y in t)return a(e[y],t[y]);if(y in e)return a(void 0,e[y])}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 A1.forEach(Object.keys(e).concat(Object.keys(t)),function(k){var E=b[k]||l,R=E(k);A1.isUndefined(R)&&E!==h||(s[k]=R)}),s},rne,ole;function npe(){return ole||(ole=1,rne={version:"0.25.0"}),rne}var M2e=npe().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 sle={};qse.transitional=function(e,t,s){function a(l,f){return"[Axios v"+M2e+"] 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&&!sle[f]&&(sle[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 R2e(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 $2e={assertOptions:R2e,validators:qse},ope=Zp,N2e=Gge,rle=g2e,ile=P2e,Uz=tpe,spe=$2e,G4=spe.validators;function W6(o){this.defaults=o,this.interceptors={request:new rle,response:new rle}}W6.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=Uz(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&&spe.assertOptions(s,{silentJSONParsing:G4.transitional(G4.boolean),forcedJSONParsing:G4.transitional(G4.boolean),clarifyTimeoutError:G4.transitional(G4.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=[ile,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 y=a.shift(),k=a.shift();try{b=y(b)}catch(E){k(E);break}}try{d=ile(b)}catch(E){return Promise.reject(E)}for(;f.length;)d=d.then(f.shift(),f.shift());return d};W6.prototype.getUri=function(e){if(!e.url)throw new Error("Provided config url is not valid");return e=Uz(this.defaults,e),N2e(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")};ope.forEach(["delete","get","head","options"],function(e){W6.prototype[e]=function(t,s){return this.request(Uz(s||{},{method:e,url:t,data:(s||{}).data}))}});ope.forEach(["post","put","patch"],function(e){W6.prototype[e]=function(t,s,a){return this.request(Uz(a||{},{method:e,url:t,data:s}))}});var I2e=W6,ine,ale;function B2e(){if(ale)return ine;ale=1;var o=Vz();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 U6(o,e){for(const t in e)o[t]=e[t];return o}function ape(o){return o()}function fle(){return Object.create(null)}function $i(o){o.forEach(ape)}function Ub(o){return typeof o=="function"}function vo(o,e){return o!=o?e==e:o!==e||o&&typeof o=="object"||typeof o=="function"}let $Z;function dle(o,e){return $Z||($Z=document.createElement("a")),$Z.href=e,o===$Z.href}function V2e(o){return Object.keys(o).length===0}function lpe(o,e,t,s){if(o){const a=cpe(o,e,t,s);return o[0](a)}}function cpe(o,e,t,s){return o[1]&&s?U6(t.ctx.slice(),o[1](s(e))):t.ctx}function upe(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(),Gse=hpe?o=>requestAnimationFrame(o):bn;const pD=new Set;function gpe(o){pD.forEach(e=>{e.c(o)||(pD.delete(e),e.f())}),pD.size!==0&&Gse(gpe)}function ppe(o){let e;return pD.size===0&&Gse(gpe),{promise:new Promise(t=>{pD.add(e={c:o,f:t})}),abort(){pD.delete(e)}}}const W2e=typeof window<"u"?window:typeof globalThis<"u"?globalThis:global;function j(o,e){o.appendChild(e)}function bpe(o){if(!o)return document;const e=o.getRootNode?o.getRootNode():o.ownerDocument;return e&&e.host?e:o.ownerDocument}function U2e(o){const e=re("style");return Y2e(bpe(o),e),e.sheet}function Y2e(o,e){return j(o.head||o,e),e.sheet}function Me(o,e,t){o.insertBefore(e,t||null)}function De(o){o.parentNode&&o.parentNode.removeChild(o)}function ia(o,e){for(let t=0;to.removeEventListener(e,t,s)}function ju(o){return function(e){return e.preventDefault(),o.call(this,e)}}function z(o,e,t){t==null?o.removeAttribute(e):o.getAttribute(e)!==t&&o.setAttribute(e,t)}function Kse(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 YH(o){return o===""?null:+o}function X2e(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 ss(o,e,t,s){t==null?o.style.removeProperty(e):o.style.setProperty(e,t,s?"important":"")}function NZ(o,e,t){for(let s=0;s>>0}function G2e(o,e){const t={stylesheet:U2e(e),rules:{}};return XH.set(o,t),t}function Eoe(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 y=b+`100% {${f(t,1-t)}} -}`,k=`__svelte_${q2e(y)}_${d}`,E=bpe(o),{stylesheet:R,rules:$}=XH.get(E)||G2e(E,o);$[k]||($[k]=!0,R.insertRule(`@keyframes ${k} ${y}`,R.cssRules.length));const Q=o.style.animation||"";return o.style.animation=`${Q?`${Q}, `:""}${k} ${s}ms linear ${a}ms 1 both`,jH+=1,k}function ype(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(", "),jH-=a,jH||K2e())}function K2e(){Gse(()=>{jH||(XH.forEach(o=>{const{ownerNode:e}=o.stylesheet;e&&De(e)}),XH.clear())})}function wpe(o,e,t,s){if(!e)return bn;const a=o.getBoundingClientRect();if(e.left===a.left&&e.right===a.right&&e.top===a.top&&e.bottom===a.bottom)return bn;const{delay:l=0,duration:f=300,easing:d=ipe,start:h=mpe()+l,end:b=h+f,tick:y=bn,css:k}=t(o,{from:e,to:a},s);let E=!0,R=!1,$;function Q(){k&&($=Eoe(o,0,1,f,l,d,k)),l||(R=!0)}function F(){k&&ype(o,$),E=!1}return ppe(U=>{if(!R&&U>=h&&(R=!0),R&&U>=b&&(y(1,0),F()),!E)return!1;if(R){const J=U-h,L=0+1*d(J/f);y(L,1-L)}return!0}),Q(),y(0,1),F}function _pe(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,J2e(o,a)}}function J2e(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 O6;function o6(o){O6=o}function UD(){if(!O6)throw new Error("Function called outside component initialization");return O6}function W1(o){UD().$$.on_mount.push(o)}function Spe(o){UD().$$.after_update.push(o)}function Jse(o){UD().$$.on_destroy.push(o)}function Hp(){const o=UD();return(e,t,{cancelable:s=!1}={})=>{const a=o.$$.callbacks[e];if(a){const l=Ope(e,t,{cancelable:s});return a.slice().forEach(f=>{f.call(o,l)}),!l.defaultPrevented}return!0}}function s6(o,e){return UD().$$.context.set(o,e),e}function si(o){return UD().$$.context.get(o)}function SH(o,e){const t=o.$$.callbacks[e.type];t&&t.slice().forEach(s=>s.call(this,e))}const rD=[],Vo=[];let bD=[];const Aoe=[],ewe=Promise.resolve();let Doe=!1;function twe(){Doe||(Doe=!0,ewe.then(Cpe))}function AC(o){bD.push(o)}function mr(o){Aoe.push(o)}const cne=new Set;let K4=0;function Cpe(){if(K4!==0)return;const o=O6;do{try{for(;K4o.indexOf(s)===-1?e.push(s):t.push(s)),t.forEach(s=>s()),bD=e}let $N;function swe(){return $N||($N=Promise.resolve(),$N.then(()=>{$N=null})),$N}function une(o,e,t){o.dispatchEvent(Ope(`${e?"intro":"outro"}${t}`))}const CH=new Set;let Lw;function go(){Lw={r:0,c:[],p:Lw}}function po(){Lw.r||$i(Lw.c),Lw=Lw.p}function ke(o,e){o&&o.i&&(CH.delete(o),o.i(e))}function Fe(o,e,t,s){if(o&&o.o){if(CH.has(o))return;CH.add(o),Lw.c.push(()=>{CH.delete(o),s&&(t&&o.d(1),s())}),o.o(e)}else s&&s()}const rwe={duration:0};function qH(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 y(){b&&ype(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 E(R){const{delay:$=0,duration:Q=300,easing:F=ipe,tick:U=bn,css:J}=l||rwe,L={start:mpe()+$,b:R};R||(L.group=Lw,Lw.r+=1),d||h?h=L:(J&&(y(),b=Eoe(o,f,R,Q,$,F,J)),R&&U(0,1),d=k(L,Q),AC(()=>une(o,R,"start")),ppe(te=>{if(h&&te>h.start&&(d=k(h,Q),h=null,une(o,d.b,"start"),J&&(y(),b=Eoe(o,f,d.b,d.duration,0,F,l.css))),d){if(te>=d.end)U(f=d.b,1-f),une(o,d.b,"end"),h||(d.b?y():--d.group.r||$i(d.group.c)),d=null;else if(te>=d.start){const ne=te-d.start;f=d.a+d.d*F(ne/d.duration),U(f,1-f)}}return!!(d||h)}))}return{run(R){Ub(l)?swe().then(()=>{l=l(a),E(R)}):E(R)},end(){y(),d=h=null}}}function Y6(o,e){o.d(1),e.delete(o.key)}function xv(o,e){Fe(o,1,1,()=>{e.delete(o.key)})}function kpe(o,e){o.f(),xv(o,e)}function Xh(o,e,t,s,a,l,f,d,h,b,y,k){let E=o.length,R=l.length,$=E;const Q={};for(;$--;)Q[o[$].key]=$;const F=[],U=new Map,J=new Map,L=[];for($=R;$--;){const X=k(a,l,$),ye=t(X);let Se=f.get(ye);Se?s&&L.push(()=>Se.p(X,e)):(Se=b(ye,X),Se.c()),U.set(ye,F[$]=Se),ye in Q&&J.set(ye,Math.abs($-Q[ye]))}const te=new Set,ne=new Set;function oe(X){ke(X,1),X.m(d,y),f.set(X.key,X),y=X.first,R--}for(;E&&R;){const X=F[R-1],ye=o[E-1],Se=X.key,Ne=ye.key;X===ye?(y=X.first,E--,R--):U.has(Ne)?!f.has(Se)||te.has(Se)?oe(X):ne.has(Ne)?E--:J.get(Se)>J.get(Ne)?(ne.add(Se),oe(X)):(te.add(Ne),E--):(h(ye,f),E--)}for(;E--;){const X=o[E];U.has(X.key)||h(X,f)}for(;R;)oe(F[R-1]);return $i(L),F}function Yz(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 Xz(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 en(o){o&&o.c()}function Kt(o,e,t,s){const{fragment:a,after_update:l}=o.$$;a&&a.m(e,t),s||AC(()=>{const f=o.$$.on_mount.map(ape).filter(Ub);o.$$.on_destroy?o.$$.on_destroy.push(...f):$i(f),o.$$.on_mount=[]}),l.forEach(AC)}function Jt(o,e){const t=o.$$;t.fragment!==null&&(owe(t.after_update),$i(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function iwe(o,e){o.$$.dirty[0]===-1&&(rD.push(o),twe(),o.$$.dirty.fill(0)),o.$$.dirty[e/31|0]|=1<{const $=R.length?R[0]:E;return b.ctx&&a(b.ctx[k],b.ctx[k]=$)&&(!b.skip_bound&&b.bound[k]&&b.bound[k]($),y&&iwe(o,k)),E}):[],b.update(),y=!0,$i(b.before_update),b.fragment=s?s(b.ctx):!1,e.target){if(e.hydrate){const k=X2e(e.target);b.fragment&&b.fragment.l(k),k.forEach(De)}else b.fragment&&b.fragment.c();e.intro&&ke(o.$$.fragment),Kt(o,e.target,e.anchor,e.customElement),Cpe()}o6(h)}class yo{$destroy(){Jt(this,1),this.$destroy=bn}$on(e,t){if(!Ub(t))return bn;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&&!V2e(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}function gle(o){let e,t;return{c(){e=re("div"),t=Xt(o[0]),z(e,"class","alert alert-danger"),z(e,"role","alert")},m(s,a){Me(s,e,a),j(e,t)},p(s,a){a&1&&Wn(t,s[0])},d(s){s&&De(e)}}}function awe(o){let e,t=o[0]&&gle(o);return{c(){t&&t.c(),e=Bs()},m(s,a){t&&t.m(s,a),Me(s,e,a)},p(s,[a]){s[0]?t?t.p(s,a):(t=gle(s),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},i:bn,o:bn,d(s){t&&t.d(s),s&&De(e)}}}function lwe(o,e,t){let{message:s=""}=e;return o.$$set=a=>{"message"in a&&t(0,s=a.message)},[s]}class X6 extends yo{constructor(e){super(),Oo(this,e,lwe,awe,vo,{message:0})}}function cwe(o){let e,t,s,a;return{c(){e=re("button"),t=re("span"),s=Ze(),a=Xt(o[0]),z(t,"class","spinner-border spinner-border-sm"),z(t,"role","status"),z(t,"aria-hidden","true"),z(e,"type","submit"),z(e,"class","btn btn-primary btn-spinner"),e.disabled=o[1]},m(l,f){Me(l,e,f),j(e,t),j(e,s),j(e,a)},p(l,[f]){f&1&&Wn(a,l[0]),f&2&&(e.disabled=l[1])},i:bn,o:bn,d(l){l&&De(e)}}}function uwe(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 ED extends yo{constructor(e){super(),Oo(this,e,uwe,cwe,vo,{label:0,disabled:1})}}function fwe(o){let e,t,s,a,l,f,d,h,b,y,k,E,R,$,Q,F,U,J,L;return t=new X6({props:{message:o[2]}}),F=new ED({props:{label:"Register"}}),{c(){e=re("div"),en(t.$$.fragment),s=Ze(),a=re("form"),l=re("div"),f=re("label"),f.textContent="Name",d=Ze(),h=re("input"),b=Ze(),y=re("div"),k=re("label"),k.textContent="Email address",E=Ze(),R=re("input"),$=Ze(),Q=re("div"),en(F.$$.fragment),z(f,"for","name"),z(f,"class","form-label"),z(h,"type","text"),z(h,"class","form-control"),z(h,"id","name"),z(l,"class","mb-3"),z(k,"for","email"),z(k,"class","form-label"),z(R,"type","email"),z(R,"class","form-control"),z(R,"id","email"),z(y,"class","mb-3"),z(Q,"class","text-center mt-5 d-block"),z(e,"class","wrapper-tiny")},m(te,ne){Me(te,e,ne),Kt(t,e,null),j(e,s),j(e,a),j(a,l),j(l,f),j(l,d),j(l,h),hr(h,o[1]),j(a,b),j(a,y),j(y,k),j(y,E),j(y,R),hr(R,o[0]),j(a,$),j(a,Q),Kt(F,Q,null),U=!0,J||(L=[pn(h,"input",o[4]),pn(R,"input",o[5]),pn(a,"submit",o[3])],J=!0)},p(te,[ne]){const oe={};ne&4&&(oe.message=te[2]),t.$set(oe),ne&2&&h.value!==te[1]&&hr(h,te[1]),ne&1&&R.value!==te[0]&&hr(R,te[0])},i(te){U||(ke(t.$$.fragment,te),ke(F.$$.fragment,te),U=!0)},o(te){Fe(t.$$.fragment,te),Fe(F.$$.fragment,te),U=!1},d(te){te&&De(e),Jt(t),Jt(F),J=!1,$i(L)}}}function dwe(o,e,t){const s=si("channel");let a="",{email:l=""}=e,f="";function d(y){y.preventDefault(),t(2,f=""),axios.post(s.lucentUrl+"/register",{name:a,email:l}).then(()=>{window.location=s.lucentUrl+"/login"}).catch(k=>{var E;t(2,f=(E=k.response)==null?void 0:E.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=y=>{"email"in y&&t(0,l=y.email)},[l,a,f,d,h,b]}class hwe extends yo{constructor(e){super(),Oo(this,e,dwe,fwe,vo,{email:0})}}function mwe(o){let e,t,s,a,l,f,d,h,b,y,k;return h=new ED({props:{label:"Login"}}),{c(){e=re("form"),t=re("div"),s=re("label"),s.textContent="Email address",a=Ze(),l=re("input"),f=Ze(),d=re("div"),en(h.$$.fragment),z(s,"for","emailaddress"),z(s,"class","form-label"),z(l,"type","email"),z(l,"class","form-control"),z(l,"id","emailaddress"),l.required=!0,z(t,"class","mb-3"),z(d,"class","text-center mt-5 d-block")},m(E,R){Me(E,e,R),j(e,t),j(t,s),j(t,a),j(t,l),hr(l,o[0]),j(e,f),j(e,d),Kt(h,d,null),b=!0,y||(k=[pn(l,"input",o[3]),pn(e,"submit",o[2])],y=!0)},p(E,R){R&1&&l.value!==E[0]&&hr(l,E[0])},i(E){b||(ke(h.$$.fragment,E),b=!0)},o(E){Fe(h.$$.fragment,E),b=!1},d(E){E&&De(e),Jt(h),y=!1,$i(k)}}}function gwe(o){let e,t;return{c(){e=re("div"),t=Xt(o[1]),z(e,"class","alert alert-info"),z(e,"role","alert")},m(s,a){Me(s,e,a),j(e,t)},p(s,a){a&2&&Wn(t,s[1])},i:bn,o:bn,d(s){s&&De(e)}}}function pwe(o){let e,t,s,a;const l=[gwe,mwe],f=[];function d(h,b){return h[1]?0:1}return t=d(o),s=f[t]=l[t](o),{c(){e=re("div"),s.c(),z(e,"class","wrapper-tiny")},m(h,b){Me(h,e,b),f[t].m(e,null),a=!0},p(h,[b]){let y=t;t=d(h),t===y?f[t].p(h,b):(go(),Fe(f[y],1,1,()=>{f[y]=null}),po(),s=f[t],s?s.p(h,b):(s=f[t]=l[t](h),s.c()),ke(s,1),s.m(e,null))},i(h){a||(ke(s),a=!0)},o(h){Fe(s),a=!1},d(h){h&&De(e),f[t].d()}}}function bwe(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 vwe extends yo{constructor(e){super(),Oo(this,e,bwe,pwe,vo,{})}}function xpe(o){const e=o-1;return e*e*e+1}function Tpe(o){return--o*o*o*o*o+1}function GH(o,{delay:e=0,duration:t=400,easing:s=xpe,x:a=0,y:l=0,opacity:f=0}={}){const d=getComputedStyle(o),h=+d.opacity,b=d.transform==="none"?"":d.transform,y=h*(1-f),[k,E]=hle(a),[R,$]=hle(l);return{delay:e,duration:t,easing:s,css:(Q,F)=>` - transform: ${b} translate(${(1-Q)*k}${E}, ${(1-Q)*R}${$}); - opacity: ${h-y*F}`}}function ple(o){let e,t,s,a;return{c(){e=re("div"),t=Xt(o[1]),z(e,"class","lx-alert text-white bg-success border-1 border rounded px-3 py-0 text-center svelte-190ow44"),z(e,"role","alert")},m(l,f){Me(l,e,f),j(e,t),a=!0},p(l,f){(!a||f&2)&&Wn(t,l[1])},i(l){a||(AC(()=>{!a||(s||(s=qH(e,GH,{duration:500},!0)),s.run(1))}),a=!0)},o(l){s||(s=qH(e,GH,{duration:500},!1)),s.run(0),a=!1},d(l){l&&De(e),l&&s&&s.end()}}}function Owe(o){let e,t,s=o[0]&&ple(o);return{c(){s&&s.c(),e=Bs()},m(a,l){s&&s.m(a,l),Me(a,e,l),t=!0},p(a,[l]){a[0]?s?(s.p(a,l),l&1&&ke(s,1)):(s=ple(a),s.c(),ke(s,1),s.m(e.parentNode,e)):s&&(go(),Fe(s,1,1,()=>{s=null}),po())},i(a){t||(ke(s),t=!0)},o(a){Fe(s),t=!1},d(a){s&&s.d(a),a&&De(e)}}}function ywe(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 ere extends yo{constructor(e){super(),Oo(this,e,ywe,Owe,vo,{show:2})}get show(){return this.$$.ctx[2]}}function wwe(o){let e,t,s,a,l,f,d,h,b,y,k,E,R,$,Q={};return e=new ere({props:Q}),o[4](e),k=new ED({props:{label:"Enter"}}),{c(){en(e.$$.fragment),t=Ze(),s=re("div"),a=re("form"),l=re("div"),f=re("h3"),d=Xt("Login as "),h=Xt(o[0]),b=Ze(),y=re("div"),en(k.$$.fragment),z(l,"class","mb-3 text-center"),z(y,"class","text-center mt-5 d-block"),z(s,"class","wrapper-tiny")},m(F,U){Kt(e,F,U),Me(F,t,U),Me(F,s,U),j(s,a),j(a,l),j(l,f),j(f,d),j(f,h),j(a,b),j(a,y),Kt(k,y,null),E=!0,R||($=pn(a,"submit",o[2]),R=!0)},p(F,[U]){const J={};e.$set(J),(!E||U&1)&&Wn(h,F[0])},i(F){E||(ke(e.$$.fragment,F),ke(k.$$.fragment,F),E=!0)},o(F){Fe(e.$$.fragment,F),Fe(k.$$.fragment,F),E=!1},d(F){o[4](null),Jt(e,F),F&&De(t),F&&De(s),Jt(k),R=!1,$()}}}function _we(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(y=>{window.location=s.lucentUrl}).catch(y=>{})}function h(b){Vo[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 Swe extends yo{constructor(e){super(),Oo(this,e,_we,wwe,vo,{email:0,token:3})}}function Cwe(o){let e,t,s;return{c(){e=re("div"),t=re("div"),s=Xt(o[2]),z(t,"class","avatar__letters"),z(e,"class","avatar"),z(e,"title",o[0]),ss(e,"background-color",o[3][o[4]]),ss(e,"height",o[1]+"px"),ss(e,"width",o[1]+"px"),ss(e,"font-size",o[1]/2+"px")},m(a,l){Me(a,e,l),j(e,t),j(t,s)},p(a,[l]){l&4&&Wn(s,a[2]),l&1&&z(e,"title",a[0]),l&2&&ss(e,"height",a[1]+"px"),l&2&&ss(e,"width",a[1]+"px"),l&2&&ss(e,"font-size",a[1]/2+"px")},i:bn,o:bn,d(a){a&&De(e)}}}function kwe(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 vy extends yo{constructor(e){super(),Oo(this,e,kwe,Cwe,vo,{name:0,side:1})}}function xwe(o){let e,t,s,a,l,f,d,h,b,y,k,E,R,$,Q,F,U,J,L,te,ne,oe,X,ye,Se,Ne;t=new X6({props:{message:o[2]}});let pe={};return a=new ere({props:pe}),o[8](a),d=new vy({props:{name:o[4].name}}),R=new ED({props:{label:"Update"}}),L=new ED({props:{label:"Update"}}),{c(){e=re("div"),en(t.$$.fragment),s=Ze(),en(a.$$.fragment),l=Ze(),f=re("h3"),en(d.$$.fragment),h=Ze(),b=re("form"),y=re("div"),k=re("input"),E=Ze(),en(R.$$.fragment),$=Ze(),Q=re("form"),F=re("div"),U=re("input"),J=Ze(),en(L.$$.fragment),te=Ze(),ne=re("div"),oe=re("a"),X=Xt(`Logout from this - device`),z(f,"class","header-small mb-5"),z(k,"type","text"),z(k,"class","form-control"),z(k,"placeholder","Name"),k.required=!0,z(y,"class","input-group mb-3"),z(U,"type","email"),z(U,"class","form-control"),z(U,"placeholder","Email"),U.required=!0,z(F,"class","input-group mb-3"),z(oe,"class","list-group-item list-group-item-action"),z(oe,"href",o[5].lucentUrl+"/logout"),z(ne,"class","list-group"),z(e,"class","wrapper-tiny")},m(ce,Xe){Me(ce,e,Xe),Kt(t,e,null),j(e,s),Kt(a,e,null),j(e,l),j(e,f),Kt(d,f,null),j(e,h),j(e,b),j(b,y),j(y,k),hr(k,o[0]),j(y,E),Kt(R,y,null),j(e,$),j(e,Q),j(Q,F),j(F,U),hr(U,o[1]),j(F,J),Kt(L,F,null),j(e,te),j(e,ne),j(ne,oe),j(oe,X),ye=!0,Se||(Ne=[pn(k,"input",o[9]),pn(b,"submit",o[6]),pn(U,"input",o[10]),pn(Q,"submit",o[7])],Se=!0)},p(ce,[Xe]){const tt={};Xe&4&&(tt.message=ce[2]),t.$set(tt);const yt={};a.$set(yt),Xe&1&&k.value!==ce[0]&&hr(k,ce[0]),Xe&2&&U.value!==ce[1]&&hr(U,ce[1])},i(ce){ye||(ke(t.$$.fragment,ce),ke(a.$$.fragment,ce),ke(d.$$.fragment,ce),ke(R.$$.fragment,ce),ke(L.$$.fragment,ce),ye=!0)},o(ce){Fe(t.$$.fragment,ce),Fe(a.$$.fragment,ce),Fe(d.$$.fragment,ce),Fe(R.$$.fragment,ce),Fe(L.$$.fragment,ce),ye=!1},d(ce){ce&&De(e),Jt(t),o[8](null),Jt(a),Jt(d),Jt(R),Jt(L),Se=!1,$i(Ne)}}}function Twe(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 y($){$.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($){Vo[$?"unshift":"push"](()=>{h=$,t(3,h)})}function E(){l=this.value,t(0,l)}function R(){f=this.value,t(1,f)}return[l,f,d,h,s,a,b,y,k,E,R]}class Ewe extends yo{constructor(e){super(),Oo(this,e,Twe,xwe,vo,{})}}function Awe(o){let e,t,s,a=o[3].name+"",l,f,d,h,b,y;const k=[{title:o[0]},o[2]];var E=o[4][o[1]];function R($){let Q={};for(let F=0;F{Jt(U,1)}),po()}E?(b=EC(E,R()),en(b.$$.fragment),ke(b.$$.fragment,1),Kt(b,h,null)):b=null}else E&&b.$set(F)},i($){y||(b&&ke(b.$$.fragment,$),y=!0)},o($){b&&Fe(b.$$.fragment,$),y=!1},d($){$&&De(e),$&&De(d),$&&De(h),b&&Jt(b)}}}function Dwe(o,e,t){const s={register:hwe,login:vwe,verify:Swe,profile:Ewe};let{title:a}=e,{view:l}=e,{user:f}=e,{data:d}=e,{channel:h}=e;return s6("channel",h),s6("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 Pwe extends yo{constructor(e){super(),Oo(this,e,Dwe,Awe,vo,{title:0,view:1,user:5,data:2,channel:3})}}function ble(o){let e,t;return{c(){e=re("span"),t=Xt(o[4]),z(e,"class","text-muted")},m(s,a){Me(s,e,a),j(e,t)},p(s,a){a&16&&Wn(t,s[4])},d(s){s&&De(e)}}}function Mwe(o){let e,t,s=!1,a,l,f,d,h,b,y,k=o[4]&&ble(o);return h=Kse(o[7][0]),{c(){e=re("div"),t=re("input"),a=Ze(),l=re("label"),f=Xt(o[1]),d=Ze(),k&&k.c(),z(t,"class","form-check-input"),z(t,"type","radio"),t.__value=o[3],t.value=t.__value,z(t,"name",o[2]),z(t,"id",o[5]),z(l,"class","form-check-label"),z(l,"for",o[5]),z(e,"class","form-check"),h.p(t)},m(E,R){Me(E,e,R),j(e,t),t.checked=t.__value===o[0],j(e,a),j(e,l),j(l,f),j(e,d),k&&k.m(e,null),b||(y=pn(t,"change",o[6]),b=!0)},p(E,[R]){R&8&&(t.__value=E[3],t.value=t.__value,s=!0),R&4&&z(t,"name",E[2]),(s||R&1)&&(t.checked=t.__value===E[0]),R&2&&Wn(f,E[1]),E[4]?k?k.p(E,R):(k=ble(E),k.c(),k.m(e,null)):k&&(k.d(1),k=null)},i:bn,o:bn,d(E){E&&De(e),k&&k.d(),h.r(),b=!1,y()}}}function Rwe(o,e,t){let{label:s}=e,{name:a}=e,{group:l}=e,{value:f}=e,{help:d}=e,h=Lc.exports.uniqueId();const b=[[]];function y(){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,y,b]}class $we extends yo{constructor(e){super(),Oo(this,e,Rwe,Mwe,vo,{label:1,name:2,group:0,value:3,help:4})}}function vle(o,e,t){const s=o.slice();return s[7]=e[t],s}function Ole(o,e,t){const s=o.slice();return s[7]=e[t],s}function yle(o){let e,t=o[7]+"",s,a,l;function f(...d){return o[4](o[7],...d)}return{c(){e=re("button"),s=Xt(t),z(e,"class","dropdown-item text-capitalize")},m(d,h){Me(d,e,h),j(e,s),a||(l=pn(e,"click",f),a=!0)},p(d,h){o=d,h&2&&t!==(t=o[7]+"")&&Wn(s,t)},d(d){d&&De(e),a=!1,l()}}}function wle(o){let e=o[0].roles.includes(o[7]),t,s=e&&yle(o);return{c(){s&&s.c(),t=Bs()},m(a,l){s&&s.m(a,l),Me(a,t,l)},p(a,l){l&3&&(e=a[0].roles.includes(a[7])),e?s?s.p(a,l):(s=yle(a),s.c(),s.m(t.parentNode,t)):s&&(s.d(1),s=null)},d(a){s&&s.d(a),a&&De(t)}}}function _le(o){let e,t=o[7]+"",s,a,l,f;function d(...h){return o[5](o[7],...h)}return{c(){e=re("button"),s=Xt(t),a=Ze(),z(e,"class","dropdown-item text-capitalize")},m(h,b){Me(h,e,b),j(e,s),j(e,a),l||(f=pn(e,"click",d),l=!0)},p(h,b){o=h,b&2&&t!==(t=o[7]+"")&&Wn(s,t)},d(h){h&&De(e),l=!1,f()}}}function Sle(o){let e=!o[0].roles.includes(o[7]),t,s=e&&_le(o);return{c(){s&&s.c(),t=Bs()},m(a,l){s&&s.m(a,l),Me(a,t,l)},p(a,l){l&3&&(e=!a[0].roles.includes(a[7])),e?s?s.p(a,l):(s=_le(a),s.c(),s.m(t.parentNode,t)):s&&(s.d(1),s=null)},d(a){s&&s.d(a),a&&De(t)}}}function Nwe(o){var ut;let e,t,s,a,l,f,d,h=o[0].name+"",b,y,k=o[0].email+"",E,R,$,Q,F,U,J,L,te,ne,oe,X,ye,Se,Ne,pe,ce;s=new vy({props:{name:(ut=o[0].name)!=null?ut:"",side:32}});let Xe=o[1],tt=[];for(let He=0;He',ye=Ze(),Se=re("h6"),Se.textContent="Add role",Ne=Ze();for(let He=0;He{!ce||(pe||(pe=qH(e,GH,{duration:200},!0)),pe.run(1))}),ce=!0)},o(He){Fe(s.$$.fragment,He),pe||(pe=qH(e,GH,{duration:200},!1)),pe.run(0),ce=!1},d(He){He&&De(e),Jt(s),ia(tt,He),ia(V,He),He&&pe&&pe.end()}}}function Iwe(o,e,t){const s=Hp();let{member:a}=e,{roles:l}=e;function f(y,k){y.preventDefault();let E=a.roles.filter(R=>R!==k);s("update",{user:a.id,roles:E})}function d(y,k){y.preventDefault();let E=[...a.roles,k];console.log(a.roles),console.log(k),console.log(E),s("update",{user:a.id,roles:E})}const h=(y,k)=>f(k,y),b=(y,k)=>d(k,y);return o.$$set=y=>{"member"in y&&t(0,a=y.member),"roles"in y&&t(1,l=y.roles)},[a,l,f,d,h,b]}class Bwe extends yo{constructor(e){super(),Oo(this,e,Iwe,Nwe,vo,{member:0,roles:1})}}function Cle(o,e,t){const s=o.slice();return s[15]=e[t],s}function kle(o,e,t){const s=o.slice();return s[18]=e[t],s}function xle(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 $we({props:l}),Vo.push(()=>cr(e,"group",a)),{c(){en(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||(ke(e.$$.fragment,f),s=!0)},o(f){Fe(e.$$.fragment,f),s=!1},d(f){Jt(e,f)}}}function Tle(o){let e,t;return e=new Bwe({props:{member:o[15],roles:o[6].roles}}),e.$on("update",o[9]),e.$on("reinvite",o[14]),{c(){en(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||(ke(e.$$.fragment,s),t=!0)},o(s){Fe(e.$$.fragment,s),t=!1},d(s){Jt(e,s)}}}function Lwe(o){let e,t,s,a,l,f,d,h,b,y,k,E,R,$,Q,F,U,J,L,te,ne,oe,X,ye,Se,Ne,pe,ce,Xe,tt;l=new X6({props:{message:o[4]}});let yt={};d=new ere({props:yt}),o[10](d);let V=o[6].roles.filter(Ele),ut=[];for(let nt=0;ntFe(ut[nt],1,1,()=>{ut[nt]=null});X=new ED({props:{label:"Invite"}});let _t=o[0],wt=[];for(let nt=0;nt<_t.length;nt+=1)wt[nt]=Tle(Cle(o,_t,nt));const Be=nt=>Fe(wt[nt],1,1,()=>{wt[nt]=null});return{c(){e=re("div"),t=re("div"),s=re("h3"),s.textContent="Invite people",a=Ze(),en(l.$$.fragment),f=Ze(),en(d.$$.fragment),h=Ze(),b=re("form"),y=re("div"),k=re("label"),k.textContent="Invitee Name",E=Ze(),R=re("input"),$=Ze(),Q=re("div"),F=re("label"),F.textContent="Invitee Email Address",U=Ze(),J=re("input"),L=Ze(),te=re("div");for(let nt=0;nto!=="removed";function Fwe(o,e,t){const s=si("channel");let{users:a}=e,l,f,d,h="",b;function y(J){J.preventDefault(),k(l,f,d)}function k(J,L,te){t(4,h=""),axios.post(s.lucentUrl+"/members/invite",{name:J,email:L,roles:[te]}).then(ne=>{b.show("User was invited"),t(0,a=[...a,ne.data.user]),t(1,l=null),t(2,f=null),t(3,d=null)}).catch(ne=>{var oe,X,ye;t(4,h=(ye=(X=(oe=ne.response)==null?void 0:oe.data)==null?void 0:X.error)!=null?ye:"")})}function E(J){J.preventDefault(),t(4,h=""),axios.post(s.lucentUrl+"/members/update",{id:J.detail.user,roles:J.detail.roles}).then(L=>{b.show("Users updated"),t(0,a=L.data.users)}).catch(L=>{var te,ne,oe;t(4,h=(oe=(ne=(te=L.response)==null?void 0:te.data)==null?void 0:ne.error)!=null?oe:"")})}function R(J){Vo[J?"unshift":"push"](()=>{b=J,t(5,b)})}function $(){l=this.value,t(1,l)}function Q(){f=this.value,t(2,f)}function F(J){d=J,t(3,d)}const U=J=>k(J.detail.email,J.detail.role);return o.$$set=J=>{"users"in J&&t(0,a=J.users)},[a,l,f,d,h,b,s,y,k,E,R,$,Q,F,U]}class Qwe extends yo{constructor(e){super(),Oo(this,e,Fwe,Lwe,vo,{users:0})}}function Zwe(o){let e,t,s;return{c(){e=re("div"),t=re("div"),s=Xt(o[0]),z(t,"class","header-normal"),z(e,"class","wrapper-normal ")},m(a,l){Me(a,e,l),j(e,t),j(t,s)},p(a,[l]){l&1&&Wn(s,a[0])},i:bn,o:bn,d(a){a&&De(e)}}}function Hwe(o,e,t){let{title:s}=e;return o.$$set=a=>{"title"in a&&t(0,s=a.title)},[s]}class zwe extends yo{constructor(e){super(),Oo(this,e,Hwe,Zwe,vo,{title:0})}}function Vwe(o){let e,t=o[5].path+"";return{c(){e=vpe("svg"),z(e,"class","bi svelte-1coky4l"),z(e,"xmlns","http://www.w3.org/2000/svg"),z(e,"width",o[0]),z(e,"height",o[1]),z(e,"viewBox",o[5].viewBox),z(e,"aria-labelledby",o[2]),z(e,"role","presentation"),z(e,"stroke",o[4]),z(e,"fill",o[3])},m(s,a){Me(s,e,a),e.innerHTML=t},p(s,[a]){a&1&&z(e,"width",s[0]),a&2&&z(e,"height",s[1]),a&4&&z(e,"aria-labelledby",s[2]),a&16&&z(e,"stroke",s[4]),a&8&&z(e,"fill",s[3])},i:bn,o:bn,d(s){s&&De(e)}}}function Wwe(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=y=>{"width"in y&&t(0,a=y.width),"height"in y&&t(1,l=y.height),"icon"in y&&t(2,f=y.icon),"fill"in y&&t(3,d=y.fill),"stroke"in y&&t(4,h=y.stroke)},[a,l,f,d,h,b]}class Fa extends yo{constructor(e){super(),Oo(this,e,Wwe,Vwe,vo,{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 Uwe=Object.prototype.toString,YD=Array.isArray||function(e){return Uwe.call(e)==="[object Array]"};function tre(o){return typeof o=="function"}function Ywe(o){return YD(o)?"array":typeof o}function fne(o){return o.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Ale(o,e){return o!=null&&typeof o=="object"&&e in o}function Xwe(o,e){return o!=null&&typeof o!="object"&&o.hasOwnProperty&&o.hasOwnProperty(e)}var jwe=RegExp.prototype.test;function qwe(o,e){return jwe.call(o,e)}var Gwe=/\S/;function Kwe(o){return!qwe(Gwe,o)}var Jwe={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};function e_e(o){return String(o).replace(/[&<>"'`=\/]/g,function(t){return Jwe[t]})}var t_e=/\s*/,n_e=/\s+/,Dle=/\s*=/,o_e=/\s*\}/,s_e=/#|\^|\/|>|\{|&|=|!/;function r_e(o,e){if(!o)return[];var t=!1,s=[],a=[],l=[],f=!1,d=!1,h="",b=0;function y(){if(f&&!d)for(;l.length;)delete a[l.pop()];else l=[];f=!1,d=!1}var k,E,R;function $(ye){if(typeof ye=="string"&&(ye=ye.split(n_e,2)),!YD(ye)||ye.length!==2)throw new Error("Invalid tags: "+ye);k=new RegExp(fne(ye[0])+"\\s*"),E=new RegExp("\\s*"+fne(ye[1])),R=new RegExp("\\s*"+fne("}"+ye[1]))}$(e||Qp.tags);for(var Q=new j6(o),F,U,J,L,te,ne;!Q.eos();){if(F=Q.pos,J=Q.scanUntil(k),J)for(var oe=0,X=J.length;oe"?te=[U,J,F,Q.pos,h,b,t]:te=[U,J,F,Q.pos],b++,a.push(te),U==="#"||U==="^")s.push(te);else if(U==="/"){if(ne=s.pop(),!ne)throw new Error('Unopened section "'+J+'" at '+F);if(ne[1]!==J)throw new Error('Unclosed section "'+ne[1]+'" at '+F)}else U==="name"||U==="{"||U==="&"?d=!0:U==="="&&$(J)}if(y(),ne=s.pop(),ne)throw new Error('Unclosed section "'+ne[1]+'" at '+Q.pos);return a_e(i_e(a))}function i_e(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 j6(o){this.string=o,this.tail=o,this.pos=0}j6.prototype.eos=function(){return this.tail===""};j6.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};j6.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 AD(o,e){this.view=o,this.cache={".":this.view},this.parent=e}AD.prototype.push=function(e){return new AD(e,this)};AD.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};Fg.prototype.renderSection=function(e,t,s,a,l){var f=this,d="",h=t.lookup(e[1]);function b(E){return f.render(E,t,s,l)}if(!!h){if(YD(h))for(var y=0,k=h.length;y0||!s)&&(l[f]=a+l[f]);return l.join(` -`)};Fg.prototype.renderPartial=function(e,t,s,a){if(!!s){var l=this.getConfigTags(a),f=tre(s)?s(e[1]):s[e[1]];if(f!=null){var d=e[6],h=e[5],b=e[4],y=f;h==0&&b&&(y=this.indentPartial(f,b,d));var k=this.parse(y,l);return this.renderTokens(k,t,s,y,a)}}};Fg.prototype.unescapedValue=function(e,t){var s=t.lookup(e[1]);if(s!=null)return s};Fg.prototype.escapedValue=function(e,t,s){var a=this.getConfigEscape(s)||Qp.escape,l=t.lookup(e[1]);if(l!=null)return typeof l=="number"&&a===Qp.escape?String(l):a(l)};Fg.prototype.rawValue=function(e){return e[1]};Fg.prototype.getConfigTags=function(e){return YD(e)?e:e&&typeof e=="object"?e.tags:void 0};Fg.prototype.getConfigEscape=function(e){if(e&&typeof e=="object"&&!YD(e))return e.escape};var Qp={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){y6.templateCache=o},get templateCache(){return y6.templateCache}},y6=new Fg;Qp.clearCache=function(){return y6.clearCache()};Qp.parse=function(e,t){return y6.parse(e,t)};Qp.render=function(e,t,s,a){if(typeof e!="string")throw new TypeError('Invalid template! Template should be a "string" but "'+Ywe(e)+'" was given as the first argument for mustache#render(template, view, partials)');return y6.render(e,t,s,a)};Qp.escape=e_e;Qp.Scanner=j6;Qp.Context=AD;Qp.Writer=Fg;function KH(o){return KH=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},KH(o)}function hE(o){if(o===null||o===!0||o===!1)return NaN;var e=Number(o);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}function Sc(o,e){if(e.length1?"s":"")+" required, but only "+e.length+" present")}function cc(o){Sc(1,arguments);var e=Object.prototype.toString.call(o);return o instanceof Date||KH(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))}function l_e(o,e){Sc(2,arguments);var t=cc(o).getTime(),s=hE(e);return new Date(t+s)}var c_e={};function q6(){return c_e}function Poe(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 kH(o,e){Sc(2,arguments);var t=cc(o),s=cc(e),a=t.getTime()-s.getTime();return a<0?-1:a>0?1:a}function u_e(o){return Sc(1,arguments),o instanceof Date||KH(o)==="object"&&Object.prototype.toString.call(o)==="[object Date]"}function f_e(o){if(Sc(1,arguments),!u_e(o)&&typeof o!="number")return!1;var e=cc(o);return!isNaN(Number(e))}function d_e(o,e){Sc(2,arguments);var t=cc(o),s=cc(e),a=t.getFullYear()-s.getFullYear(),l=t.getMonth()-s.getMonth();return a*12+l}function h_e(o,e){return Sc(2,arguments),cc(o).getTime()-cc(e).getTime()}var Ple={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(e){return e<0?Math.ceil(e):Math.floor(e)}},m_e="trunc";function g_e(o){return o?Ple[o]:Ple[m_e]}function p_e(o){Sc(1,arguments);var e=cc(o);return e.setHours(23,59,59,999),e}function b_e(o){Sc(1,arguments);var e=cc(o),t=e.getMonth();return e.setFullYear(e.getFullYear(),t+1,0),e.setHours(23,59,59,999),e}function v_e(o){Sc(1,arguments);var e=cc(o);return p_e(e).getTime()===b_e(e).getTime()}function O_e(o,e){Sc(2,arguments);var t=cc(o),s=cc(e),a=kH(t,s),l=Math.abs(d_e(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=kH(t,s)===-a;v_e(cc(o))&&l===1&&kH(o,s)===1&&(d=!1),f=a*(l-Number(d))}return f===0?0:f}function y_e(o,e,t){Sc(2,arguments);var s=h_e(o,e)/1e3;return g_e(t==null?void 0:t.roundingMethod)(s)}function w_e(o,e){Sc(2,arguments);var t=hE(e);return l_e(o,-t)}var __e=864e5;function S_e(o){Sc(1,arguments);var e=cc(o),t=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var s=e.getTime(),a=t-s;return Math.floor(a/__e)+1}function JH(o){Sc(1,arguments);var e=1,t=cc(o),s=t.getUTCDay(),a=(s=a.getTime()?t+1:e.getTime()>=f.getTime()?t:t-1}function C_e(o){Sc(1,arguments);var e=Epe(o),t=new Date(0);t.setUTCFullYear(e,0,4),t.setUTCHours(0,0,0,0);var s=JH(t);return s}var k_e=6048e5;function x_e(o){Sc(1,arguments);var e=cc(o),t=JH(e).getTime()-C_e(e).getTime();return Math.round(t/k_e)+1}function ez(o,e){var t,s,a,l,f,d,h,b;Sc(1,arguments);var y=q6(),k=hE((t=(s=(a=(l=e==null?void 0:e.weekStartsOn)!==null&&l!==void 0?l:e==null||(f=e.locale)===null||f===void 0||(d=f.options)===null||d===void 0?void 0:d.weekStartsOn)!==null&&a!==void 0?a:y.weekStartsOn)!==null&&s!==void 0?s:(h=y.locale)===null||h===void 0||(b=h.options)===null||b===void 0?void 0:b.weekStartsOn)!==null&&t!==void 0?t:0);if(!(k>=0&&k<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var E=cc(o),R=E.getUTCDay(),$=(R=1&&R<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var $=new Date(0);$.setUTCFullYear(k+1,0,R),$.setUTCHours(0,0,0,0);var Q=ez($,e),F=new Date(0);F.setUTCFullYear(k,0,R),F.setUTCHours(0,0,0,0);var U=ez(F,e);return y.getTime()>=Q.getTime()?k+1:y.getTime()>=U.getTime()?k:k-1}function T_e(o,e){var t,s,a,l,f,d,h,b;Sc(1,arguments);var y=q6(),k=hE((t=(s=(a=(l=e==null?void 0:e.firstWeekContainsDate)!==null&&l!==void 0?l:e==null||(f=e.locale)===null||f===void 0||(d=f.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&a!==void 0?a:y.firstWeekContainsDate)!==null&&s!==void 0?s:(h=y.locale)===null||h===void 0||(b=h.options)===null||b===void 0?void 0:b.firstWeekContainsDate)!==null&&t!==void 0?t:1),E=Ape(o,e),R=new Date(0);R.setUTCFullYear(E,0,k),R.setUTCHours(0,0,0,0);var $=ez(R,e);return $}var E_e=6048e5;function A_e(o,e){Sc(1,arguments);var t=cc(o),s=ez(t,e).getTime()-T_e(t,e).getTime();return Math.round(s/E_e)+1}function Bl(o,e){for(var t=o<0?"-":"",s=Math.abs(o).toString();s.length0?s:1-s;return Bl(t==="yy"?a%100:a,t.length)},M:function(e,t){var s=e.getUTCMonth();return t==="M"?String(s+1):Bl(s+1,2)},d:function(e,t){return Bl(e.getUTCDate(),t.length)},a:function(e,t){var s=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return s.toUpperCase();case"aaa":return s;case"aaaaa":return s[0];case"aaaa":default:return s==="am"?"a.m.":"p.m."}},h:function(e,t){return Bl(e.getUTCHours()%12||12,t.length)},H:function(e,t){return Bl(e.getUTCHours(),t.length)},m:function(e,t){return Bl(e.getUTCMinutes(),t.length)},s:function(e,t){return Bl(e.getUTCSeconds(),t.length)},S:function(e,t){var s=t.length,a=e.getUTCMilliseconds(),l=Math.floor(a*Math.pow(10,s-3));return Bl(l,t.length)}};const mC=D_e;var J4={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},P_e={G:function(e,t,s){var a=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return s.era(a,{width:"abbreviated"});case"GGGGG":return s.era(a,{width:"narrow"});case"GGGG":default:return s.era(a,{width:"wide"})}},y:function(e,t,s){if(t==="yo"){var a=e.getUTCFullYear(),l=a>0?a:1-a;return s.ordinalNumber(l,{unit:"year"})}return mC.y(e,t)},Y:function(e,t,s,a){var l=Ape(e,a),f=l>0?l:1-l;if(t==="YY"){var d=f%100;return Bl(d,2)}return t==="Yo"?s.ordinalNumber(f,{unit:"year"}):Bl(f,t.length)},R:function(e,t){var s=Epe(e);return Bl(s,t.length)},u:function(e,t){var s=e.getUTCFullYear();return Bl(s,t.length)},Q:function(e,t,s){var a=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(a);case"QQ":return Bl(a,2);case"Qo":return s.ordinalNumber(a,{unit:"quarter"});case"QQQ":return s.quarter(a,{width:"abbreviated",context:"formatting"});case"QQQQQ":return s.quarter(a,{width:"narrow",context:"formatting"});case"QQQQ":default:return s.quarter(a,{width:"wide",context:"formatting"})}},q:function(e,t,s){var a=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(a);case"qq":return Bl(a,2);case"qo":return s.ordinalNumber(a,{unit:"quarter"});case"qqq":return s.quarter(a,{width:"abbreviated",context:"standalone"});case"qqqqq":return s.quarter(a,{width:"narrow",context:"standalone"});case"qqqq":default:return s.quarter(a,{width:"wide",context:"standalone"})}},M:function(e,t,s){var a=e.getUTCMonth();switch(t){case"M":case"MM":return mC.M(e,t);case"Mo":return s.ordinalNumber(a+1,{unit:"month"});case"MMM":return s.month(a,{width:"abbreviated",context:"formatting"});case"MMMMM":return s.month(a,{width:"narrow",context:"formatting"});case"MMMM":default:return s.month(a,{width:"wide",context:"formatting"})}},L:function(e,t,s){var a=e.getUTCMonth();switch(t){case"L":return String(a+1);case"LL":return Bl(a+1,2);case"Lo":return s.ordinalNumber(a+1,{unit:"month"});case"LLL":return s.month(a,{width:"abbreviated",context:"standalone"});case"LLLLL":return s.month(a,{width:"narrow",context:"standalone"});case"LLLL":default:return s.month(a,{width:"wide",context:"standalone"})}},w:function(e,t,s,a){var l=A_e(e,a);return t==="wo"?s.ordinalNumber(l,{unit:"week"}):Bl(l,t.length)},I:function(e,t,s){var a=x_e(e);return t==="Io"?s.ordinalNumber(a,{unit:"week"}):Bl(a,t.length)},d:function(e,t,s){return t==="do"?s.ordinalNumber(e.getUTCDate(),{unit:"date"}):mC.d(e,t)},D:function(e,t,s){var a=S_e(e);return t==="Do"?s.ordinalNumber(a,{unit:"dayOfYear"}):Bl(a,t.length)},E:function(e,t,s){var a=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return s.day(a,{width:"abbreviated",context:"formatting"});case"EEEEE":return s.day(a,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(a,{width:"short",context:"formatting"});case"EEEE":default:return s.day(a,{width:"wide",context:"formatting"})}},e:function(e,t,s,a){var l=e.getUTCDay(),f=(l-a.weekStartsOn+8)%7||7;switch(t){case"e":return String(f);case"ee":return Bl(f,2);case"eo":return s.ordinalNumber(f,{unit:"day"});case"eee":return s.day(l,{width:"abbreviated",context:"formatting"});case"eeeee":return s.day(l,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(l,{width:"short",context:"formatting"});case"eeee":default:return s.day(l,{width:"wide",context:"formatting"})}},c:function(e,t,s,a){var l=e.getUTCDay(),f=(l-a.weekStartsOn+8)%7||7;switch(t){case"c":return String(f);case"cc":return Bl(f,t.length);case"co":return s.ordinalNumber(f,{unit:"day"});case"ccc":return s.day(l,{width:"abbreviated",context:"standalone"});case"ccccc":return s.day(l,{width:"narrow",context:"standalone"});case"cccccc":return s.day(l,{width:"short",context:"standalone"});case"cccc":default:return s.day(l,{width:"wide",context:"standalone"})}},i:function(e,t,s){var a=e.getUTCDay(),l=a===0?7:a;switch(t){case"i":return String(l);case"ii":return Bl(l,t.length);case"io":return s.ordinalNumber(l,{unit:"day"});case"iii":return s.day(a,{width:"abbreviated",context:"formatting"});case"iiiii":return s.day(a,{width:"narrow",context:"formatting"});case"iiiiii":return s.day(a,{width:"short",context:"formatting"});case"iiii":default:return s.day(a,{width:"wide",context:"formatting"})}},a:function(e,t,s){var a=e.getUTCHours(),l=a/12>=1?"pm":"am";switch(t){case"a":case"aa":return s.dayPeriod(l,{width:"abbreviated",context:"formatting"});case"aaa":return s.dayPeriod(l,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return s.dayPeriod(l,{width:"narrow",context:"formatting"});case"aaaa":default:return s.dayPeriod(l,{width:"wide",context:"formatting"})}},b:function(e,t,s){var a=e.getUTCHours(),l;switch(a===12?l=J4.noon:a===0?l=J4.midnight:l=a/12>=1?"pm":"am",t){case"b":case"bb":return s.dayPeriod(l,{width:"abbreviated",context:"formatting"});case"bbb":return s.dayPeriod(l,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return s.dayPeriod(l,{width:"narrow",context:"formatting"});case"bbbb":default:return s.dayPeriod(l,{width:"wide",context:"formatting"})}},B:function(e,t,s){var a=e.getUTCHours(),l;switch(a>=17?l=J4.evening:a>=12?l=J4.afternoon:a>=4?l=J4.morning:l=J4.night,t){case"B":case"BB":case"BBB":return s.dayPeriod(l,{width:"abbreviated",context:"formatting"});case"BBBBB":return s.dayPeriod(l,{width:"narrow",context:"formatting"});case"BBBB":default:return s.dayPeriod(l,{width:"wide",context:"formatting"})}},h:function(e,t,s){if(t==="ho"){var a=e.getUTCHours()%12;return a===0&&(a=12),s.ordinalNumber(a,{unit:"hour"})}return mC.h(e,t)},H:function(e,t,s){return t==="Ho"?s.ordinalNumber(e.getUTCHours(),{unit:"hour"}):mC.H(e,t)},K:function(e,t,s){var a=e.getUTCHours()%12;return t==="Ko"?s.ordinalNumber(a,{unit:"hour"}):Bl(a,t.length)},k:function(e,t,s){var a=e.getUTCHours();return a===0&&(a=24),t==="ko"?s.ordinalNumber(a,{unit:"hour"}):Bl(a,t.length)},m:function(e,t,s){return t==="mo"?s.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):mC.m(e,t)},s:function(e,t,s){return t==="so"?s.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):mC.s(e,t)},S:function(e,t){return mC.S(e,t)},X:function(e,t,s,a){var l=a._originalDate||e,f=l.getTimezoneOffset();if(f===0)return"Z";switch(t){case"X":return Rle(f);case"XXXX":case"XX":return eE(f);case"XXXXX":case"XXX":default:return eE(f,":")}},x:function(e,t,s,a){var l=a._originalDate||e,f=l.getTimezoneOffset();switch(t){case"x":return Rle(f);case"xxxx":case"xx":return eE(f);case"xxxxx":case"xxx":default:return eE(f,":")}},O:function(e,t,s,a){var l=a._originalDate||e,f=l.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Mle(f,":");case"OOOO":default:return"GMT"+eE(f,":")}},z:function(e,t,s,a){var l=a._originalDate||e,f=l.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Mle(f,":");case"zzzz":default:return"GMT"+eE(f,":")}},t:function(e,t,s,a){var l=a._originalDate||e,f=Math.floor(l.getTime()/1e3);return Bl(f,t.length)},T:function(e,t,s,a){var l=a._originalDate||e,f=l.getTime();return Bl(f,t.length)}};function Mle(o,e){var t=o>0?"-":"+",s=Math.abs(o),a=Math.floor(s/60),l=s%60;if(l===0)return t+String(a);var f=e||"";return t+String(a)+f+Bl(l,2)}function Rle(o,e){if(o%60===0){var t=o>0?"-":"+";return t+Bl(Math.abs(o)/60,2)}return eE(o,e)}function eE(o,e){var t=e||"",s=o>0?"-":"+",a=Math.abs(o),l=Bl(Math.floor(a/60),2),f=Bl(a%60,2);return s+l+t+f}const M_e=P_e;var $le=function(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Dpe=function(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},R_e=function(e,t){var s=e.match(/(P+)(p+)?/)||[],a=s[1],l=s[2];if(!l)return $le(e,t);var f;switch(a){case"P":f=t.dateTime({width:"short"});break;case"PP":f=t.dateTime({width:"medium"});break;case"PPP":f=t.dateTime({width:"long"});break;case"PPPP":default:f=t.dateTime({width:"full"});break}return f.replace("{{date}}",$le(a,t)).replace("{{time}}",Dpe(l,t))},$_e={p:Dpe,P:R_e};const N_e=$_e;var I_e=["D","DD"],B_e=["YY","YYYY"];function L_e(o){return I_e.indexOf(o)!==-1}function F_e(o){return B_e.indexOf(o)!==-1}function Nle(o,e,t){if(o==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e,"`) for formatting years to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(o==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(e,"`) for formatting years to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(o==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(e,"`) for formatting days of the month to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(o==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(e,"`) for formatting days of the month to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var Q_e={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"}},Z_e=function(e,t,s){var a,l=Q_e[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 H_e=Z_e;function dne(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 z_e={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},V_e={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},W_e={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},U_e={date:dne({formats:z_e,defaultWidth:"full"}),time:dne({formats:V_e,defaultWidth:"full"}),dateTime:dne({formats:W_e,defaultWidth:"full"})};const Y_e=U_e;var X_e={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},j_e=function(e,t,s,a){return X_e[e]};const q_e=j_e;function NN(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 G_e={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},K_e={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},J_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"]},eSe={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"]},tSe={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"}},nSe={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"}},oSe=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"},sSe={ordinalNumber:oSe,era:NN({values:G_e,defaultWidth:"wide"}),quarter:NN({values:K_e,defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:NN({values:J_e,defaultWidth:"wide"}),day:NN({values:eSe,defaultWidth:"wide"}),dayPeriod:NN({values:tSe,defaultWidth:"wide",formattingValues:nSe,defaultFormattingWidth:"wide"})};const rSe=sSe;function IN(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)?aSe(d,function(k){return k.test(f)}):iSe(d,function(k){return k.test(f)}),b;b=o.valueCallback?o.valueCallback(h):h,b=t.valueCallback?t.valueCallback(b):b;var y=e.slice(f.length);return{value:b,rest:y}}}function iSe(o,e){for(var t in o)if(o.hasOwnProperty(t)&&e(o[t]))return t}function aSe(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 cSe=/^(\d+)(th|st|nd|rd)?/i,uSe=/\d+/i,fSe={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},dSe={any:[/^b/i,/^(a|c)/i]},hSe={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},mSe={any:[/1/i,/2/i,/3/i,/4/i]},gSe={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},pSe={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]},bSe={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},vSe={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]},OSe={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},ySe={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}},wSe={ordinalNumber:lSe({matchPattern:cSe,parsePattern:uSe,valueCallback:function(e){return parseInt(e,10)}}),era:IN({matchPatterns:fSe,defaultMatchWidth:"wide",parsePatterns:dSe,defaultParseWidth:"any"}),quarter:IN({matchPatterns:hSe,defaultMatchWidth:"wide",parsePatterns:mSe,defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:IN({matchPatterns:gSe,defaultMatchWidth:"wide",parsePatterns:pSe,defaultParseWidth:"any"}),day:IN({matchPatterns:bSe,defaultMatchWidth:"wide",parsePatterns:vSe,defaultParseWidth:"any"}),dayPeriod:IN({matchPatterns:OSe,defaultMatchWidth:"any",parsePatterns:ySe,defaultParseWidth:"any"})};const _Se=wSe;var SSe={code:"en-US",formatDistance:H_e,formatLong:Y_e,formatRelative:q_e,localize:rSe,match:_Se,options:{weekStartsOn:0,firstWeekContainsDate:1}};const Ppe=SSe;var CSe=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,kSe=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,xSe=/^'([^]*?)'?$/,TSe=/''/g,ESe=/[a-zA-Z]/;function Mpe(o,e,t){var s,a,l,f,d,h,b,y,k,E,R,$,Q,F,U,J,L,te;Sc(2,arguments);var ne=String(e),oe=q6(),X=(s=(a=t==null?void 0:t.locale)!==null&&a!==void 0?a:oe.locale)!==null&&s!==void 0?s:Ppe,ye=hE((l=(f=(d=(h=t==null?void 0:t.firstWeekContainsDate)!==null&&h!==void 0?h:t==null||(b=t.locale)===null||b===void 0||(y=b.options)===null||y===void 0?void 0:y.firstWeekContainsDate)!==null&&d!==void 0?d:oe.firstWeekContainsDate)!==null&&f!==void 0?f:(k=oe.locale)===null||k===void 0||(E=k.options)===null||E===void 0?void 0:E.firstWeekContainsDate)!==null&&l!==void 0?l:1);if(!(ye>=1&&ye<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var Se=hE((R=($=(Q=(F=t==null?void 0:t.weekStartsOn)!==null&&F!==void 0?F:t==null||(U=t.locale)===null||U===void 0||(J=U.options)===null||J===void 0?void 0:J.weekStartsOn)!==null&&Q!==void 0?Q:oe.weekStartsOn)!==null&&$!==void 0?$:(L=oe.locale)===null||L===void 0||(te=L.options)===null||te===void 0?void 0:te.weekStartsOn)!==null&&R!==void 0?R:0);if(!(Se>=0&&Se<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!X.localize)throw new RangeError("locale must contain localize property");if(!X.formatLong)throw new RangeError("locale must contain formatLong property");var Ne=cc(o);if(!f_e(Ne))throw new RangeError("Invalid time value");var pe=Poe(Ne),ce=w_e(Ne,pe),Xe={firstWeekContainsDate:ye,weekStartsOn:Se,locale:X,_originalDate:Ne},tt=ne.match(kSe).map(function(yt){var V=yt[0];if(V==="p"||V==="P"){var ut=N_e[V];return ut(yt,X.formatLong)}return yt}).join("").match(CSe).map(function(yt){if(yt==="''")return"'";var V=yt[0];if(V==="'")return ASe(yt);var ut=M_e[V];if(ut)return!(t!=null&&t.useAdditionalWeekYearTokens)&&F_e(yt)&&Nle(yt,e,String(o)),!(t!=null&&t.useAdditionalDayOfYearTokens)&&L_e(yt)&&Nle(yt,e,String(o)),ut(ce,yt,X.localize,Xe);if(V.match(ESe))throw new RangeError("Format string contains an unescaped latin alphabet character `"+V+"`");return yt}).join("");return tt}function ASe(o){var e=o.match(xSe);return e?e[1].replace(TSe,"'"):o}function Rpe(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 DSe(o){return Rpe({},o)}var Ile=1440,PSe=2520,hne=43200,MSe=86400;function RSe(o,e,t){var s,a;Sc(2,arguments);var l=q6(),f=(s=(a=t==null?void 0:t.locale)!==null&&a!==void 0?a:l.locale)!==null&&s!==void 0?s:Ppe;if(!f.formatDistance)throw new RangeError("locale must contain formatDistance property");var d=kH(o,e);if(isNaN(d))throw new RangeError("Invalid time value");var h=Rpe(DSe(t),{addSuffix:Boolean(t==null?void 0:t.addSuffix),comparison:d}),b,y;d>0?(b=cc(e),y=cc(o)):(b=cc(o),y=cc(e));var k=y_e(y,b),E=(Poe(y)-Poe(b))/1e3,R=Math.round((k-E)/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 Qle(s,e);let a=e.data,f=Qp.parse(s.titleTemplate).filter(h=>h[0]==="name").map(h=>h[1]).filter(h=>{let b=s.fields.find(y=>y.name===h);return(b==null?void 0:b.info.name)==="reference"}).reduce((h,b)=>{let y=t.edges.find(E=>E.source===e.id&&E.field===b),k=t.records.find(E=>E.id===(y==null?void 0:y.target));return h[b]=wd(o,k,t),h},{});a={...a,...f};let d=Qp.render(s.titleTemplate,a);return!d||d===""?Qle(s,e):Npe(d.slice(0,300))}function Qle(o,e){var s;if((o==null?void 0:o.type)==="files")return e._file.path;let t=Npe(e==null?void 0:e.data[(s=o.fields.filter(a=>a.info.name==="text")[0])==null?void 0:s.name]).slice(0,300);return t==""?"Untitled":t}function Zle(o){let e,t,s;return{c(){e=re("a"),t=Xt(o[1]),z(e,"href",s=o[3].lucentUrl+"/records/"+o[0].id),z(e,"class","text-decoration-none rounded py-1 px-2 d-inline-block svelte-nbbgyi"),z(e,"title",o[1]),ss(e,"border","2px solid "+(o[2].color?o[2].color:"#999"),1),ss(e,"white-space","nowrap")},m(a,l){Me(a,e,l),j(e,t)},p(a,l){l&2&&Wn(t,a[1]),l&1&&s!==(s=a[3].lucentUrl+"/records/"+a[0].id)&&z(e,"href",s),l&2&&z(e,"title",a[1]),l&4&&ss(e,"border","2px solid "+(a[2].color?a[2].color:"#999"),1)},d(a){a&&De(e)}}}function $Se(o){var s;let e,t=((s=o[0])==null?void 0:s.data)&&Zle(o);return{c(){t&&t.c(),e=Bs()},m(a,l){t&&t.m(a,l),Me(a,e,l)},p(a,[l]){var f;(f=a[0])!=null&&f.data?t?t.p(a,l):(t=Zle(a),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},i:bn,o:bn,d(a){t&&t.d(a),a&&De(e)}}}function NSe(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=wd(l.schemas,f,d))},[f,a,s,l,d]}class G6 extends yo{constructor(e){super(),Oo(this,e,NSe,$Se,vo,{record:0,graph:4})}}function Hle(o,e,t){const s=o.slice();return s[2]=e[t],s[4]=t,s}function zle(o){let e,t,s=o[0].reverse(),a=[];for(let f=0;fFe(a[f],1,1,()=>{a[f]=null});return{c(){e=re("div");for(let f=0;f0&&zle(o);return{c(){s&&s.c(),e=Bs()},m(a,l){s&&s.m(a,l),Me(a,e,l),t=!0},p(a,[l]){a[0].length>0?s?(s.p(a,l),l&1&&ke(s,1)):(s=zle(a),s.c(),ke(s,1),s.m(e.parentNode,e)):s&&(go(),Fe(s,1,1,()=>{s=null}),po())},i(a){t||(ke(s),t=!0)},o(a){Fe(s),t=!1},d(a){s&&s.d(a),a&&De(e)}}}function LSe(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 FSe extends yo{constructor(e){super(),Oo(this,e,LSe,BSe,vo,{managerRecords:0,graph:1})}}function QSe(o){let e;return{c(){e=Xt("New Record")},m(t,s){Me(t,e,s)},p:bn,d(t){t&&De(e)}}}function ZSe(o){let e=wd(o[5].schemas,o[3],o[2])+"",t;return{c(){t=Xt(e)},m(s,a){Me(s,t,a)},p(s,a){a&12&&e!==(e=wd(s[5].schemas,s[3],s[2])+"")&&Wn(t,e)},d(s){s&&De(t)}}}function Wle(o){let e,t,s,a,l,f,d,h,b,y,k,E,R,$,Q,F,U;s=new Fa({props:{icon:"ellipsis"}});let J=!o[4]&&Ule(o);return{c(){e=re("div"),t=re("button"),en(s.$$.fragment),a=Ze(),l=re("div"),f=re("h6"),f.textContent="Record Actions",d=Ze(),h=re("a"),b=Xt("Create new"),k=Ze(),J&&J.c(),E=Ze(),R=re("a"),$=Xt("Revisions"),z(t,"class","btn btn-link btn-sm"),z(t,"type","button"),z(t,"data-bs-toggle","dropdown"),z(t,"aria-expanded","false"),z(f,"class","dropdown-header"),z(h,"class","dropdown-item"),z(h,"href",y=o[5].lucentUrl+"/records/new?schema="+o[1].name),z(R,"class","dropdown-item"),z(R,"href",o[5].lucentUrl),z(l,"class","dropdown-menu"),z(e,"class","dropdown d-inline-block")},m(L,te){Me(L,e,te),j(e,t),Kt(s,t,null),j(e,a),j(e,l),j(l,f),j(l,d),j(l,h),j(h,b),j(l,k),J&&J.m(l,null),j(l,E),j(l,R),j(R,$),Q=!0,F||(U=pn(R,"click",ju(o[7])),F=!0)},p(L,te){(!Q||te&2&&y!==(y=L[5].lucentUrl+"/records/new?schema="+L[1].name))&&z(h,"href",y),L[4]?J&&(J.d(1),J=null):J?J.p(L,te):(J=Ule(L),J.c(),J.m(l,E))},i(L){Q||(ke(s.$$.fragment,L),Q=!0)},o(L){Fe(s.$$.fragment,L),Q=!1},d(L){L&&De(e),Jt(s),J&&J.d(),F=!1,U()}}}function Ule(o){let e,t,s,a;return{c(){e=re("a"),t=Xt("Clone"),z(e,"class","dropdown-item"),z(e,"href",o[5].lucentUrl)},m(l,f){Me(l,e,f),j(e,t),s||(a=pn(e,"click",o[6]),s=!0)},p:bn,d(l){l&&De(e),s=!1,a()}}}function HSe(o){let e,t,s=o[1].label.toUpperCase()+"",a,l,f,d,h,b;function y($,Q){return $[4]?QSe:ZSe}let k=y(o),E=k(o),R=!o[4]&&Wle(o);return{c(){e=re("h3"),t=re("a"),a=Xt(s),f=Ze(),d=re("span"),E.c(),h=Ze(),R&&R.c(),z(t,"class","text-muted d-block text-decoration-none fs-6 mb-1"),z(t,"href",l=o[5].lucentUrl+"/content/"+o[1].name),z(d,"class","text-dark d-block"),z(e,"class","header-normal mt-5 mb-0")},m($,Q){Me($,e,Q),j(e,t),j(t,a),j(e,f),j(e,d),E.m(d,null),j(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))&&z(t,"href",l),k===(k=y($))&&E?E.p($,Q):(E.d(1),E=k($),E&&(E.c(),E.m(d,null))),$[4]?R&&(go(),Fe(R,1,1,()=>{R=null}),po()):R?(R.p($,Q),Q&16&&ke(R,1)):(R=Wle($),R.c(),ke(R,1),R.m(e,null))},i($){b||(ke(R),b=!0)},o($){Fe(R),b=!1},d($){$&&De(e),E.d(),R&&R.d()}}}function zSe(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(E=>{window.location=s.lucentUrl+"/records/"+E.data.id}).catch(E=>{})}const y=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,y]}class VSe extends yo{constructor(e){super(),Oo(this,e,zSe,HSe,vo,{schema:1,graph:2,record:3,isCreateMode:4,activeContentTab:0})}}function Ipe(o){return Bpe()[o]}function Bpe(){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 Yle(o,e,t){const s=o.slice();return s[10]=e[t],s}function Xle(o){let e,t=o[10].text+"",s,a,l,f;function d(...h){return o[9](o[10],...h)}return{c(){e=re("button"),s=Xt(t),a=Ze(),z(e,"type","button"),z(e,"class","dropdown-item my-2 rounded w-100 bg-"+o[10].bg+" text-"+o[10].color)},m(h,b){Me(h,e,b),j(e,s),j(e,a),l||(f=pn(e,"click",d),l=!0)},p(h,b){o=h},d(h){h&&De(e),l=!1,f()}}}function jle(o){let e,t=o[10].value!==o[0]&&Xle(o);return{c(){t&&t.c(),e=Bs()},m(s,a){t&&t.m(s,a),Me(s,e,a)},p(s,a){s[10].value!==s[0]?t?t.p(s,a):(t=Xle(s),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(s){t&&t.d(s),s&&De(e)}}}function WSe(o){let e,t,s;return{c(){e=re("a"),t=Xt("Preview"),z(e,"href",s=o[5].previewTargetUrl+"?schema="+o[2].name+"&id="+o[1].id),z(e,"target","_blank"),z(e,"class","btn btn-info ms-3")},m(a,l){Me(a,e,l),j(e,t)},p(a,l){l&6&&s!==(s=a[5].previewTargetUrl+"?schema="+a[2].name+"&id="+a[1].id)&&z(e,"href",s)},d(a){a&&De(e)}}}function USe(o){let e,t,s,a=o[4].text+"",l,f,d,h,b,y,k,E,R,$,Q,F=o[6],U=[];for(let L=0;L{h=R,t(3,h)})}const E=(R,$)=>y($,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=Ipe(l))},[l,f,d,h,s,a,b,y,k,E]}class Lpe extends yo{constructor(e){super(),Oo(this,e,YSe,USe,vo,{status:0,record:1,schema:2})}}function qle(o){return o._file.mime==="image/svg+xml"?Moe(o):si("channel").filesUrl+`/thumbs/${o._file.path}`}function Moe(o){return si("channel").filesUrl+`/${o._file.path}`}function Gle(o){let e,t,s,a,l;const f=[jSe,XSe],d=[];function h(b,y){return y&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,y){d[t].m(b,y),Me(b,a,y),l=!0},p(b,y){let k=t;t=h(b,y),t===k?d[t].p(b,y):(go(),Fe(d[k],1,1,()=>{d[k]=null}),po(),s=d[t],s?s.p(b,y):(s=d[t]=f[t](b),s.c()),ke(s,1),s.m(a.parentNode,a))},i(b){l||(ke(s),l=!0)},o(b){Fe(s),l=!1},d(b){d[t].d(b),b&&De(a)}}}function XSe(o){let e,t,s,a,l,f=o[0]._file.path.split(".").pop()+"",d,h,b,y;return t=new Fa({props:{icon:"file",width:o[3],height:o[3]}}),{c(){e=re("a"),en(t.$$.fragment),s=Ze(),a=re("span"),l=Xt("."),d=Xt(f),z(a,"class","ms-2"),ss(a,"font-size",o[4]+"px"),z(e,"href",h=o[5].lucentUrl+"/records/"+o[0].id),z(e,"title",b=o[0]._file.path),z(e,"class","btn btn-outline-primary btn-sm d-flex align-items-center justify-content-center"),ss(e,"width",o[2]+"px"),ss(e,"height",o[2]+"px")},m(k,E){Me(k,e,E),Kt(t,e,null),j(e,s),j(e,a),j(a,l),j(a,d),y=!0},p(k,E){const R={};E&8&&(R.width=k[3]),E&8&&(R.height=k[3]),t.$set(R),(!y||E&1)&&f!==(f=k[0]._file.path.split(".").pop()+"")&&Wn(d,f),(!y||E&16)&&ss(a,"font-size",k[4]+"px"),(!y||E&1&&h!==(h=k[5].lucentUrl+"/records/"+k[0].id))&&z(e,"href",h),(!y||E&1&&b!==(b=k[0]._file.path))&&z(e,"title",b),(!y||E&4)&&ss(e,"width",k[2]+"px"),(!y||E&4)&&ss(e,"height",k[2]+"px")},i(k){y||(ke(t.$$.fragment,k),y=!0)},o(k){Fe(t.$$.fragment,k),y=!1},d(k){k&&De(e),Jt(t)}}}function jSe(o){let e,t,s,a,l,f;return{c(){e=re("a"),t=re("img"),z(t,"class","rounded w-100"),dle(t.src,s=qle(o[0]))||z(t,"src",s),z(t,"alt",a=o[0]._file.path),z(e,"href",l=o[5].lucentUrl+"/records/"+o[0].id),z(e,"title",f=o[0]._file.path),z(e,"class","d-flex align-items-center justify-content-center "),ss(e,"width",o[2]+"px"),ss(e,"height",o[2]+"px")},m(d,h){Me(d,e,h),j(e,t)},p(d,h){h&1&&!dle(t.src,s=qle(d[0]))&&z(t,"src",s),h&1&&a!==(a=d[0]._file.path)&&z(t,"alt",a),h&1&&l!==(l=d[5].lucentUrl+"/records/"+d[0].id)&&z(e,"href",l),h&1&&f!==(f=d[0]._file.path)&&z(e,"title",f),h&4&&ss(e,"width",d[2]+"px"),h&4&&ss(e,"height",d[2]+"px")},i:bn,o:bn,d(d){d&&De(e)}}}function Kle(o){let e,t=o[0]._file.path+"",s,a,l;return{c(){e=re("a"),s=Xt(t),z(e,"href",a=o[5].lucentUrl+"/records/"+o[0].id),z(e,"title",l=o[0]._file.path),z(e,"class","preview-file-filename lx-small-text text-decoration-none")},m(f,d){Me(f,e,d),j(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)&&z(e,"href",a),d&1&&l!==(l=f[0]._file.path)&&z(e,"title",l)},d(f){f&&De(e)}}}function qSe(o){let e,t,s,a=o[0]&&Gle(o),l=o[1]&&Kle(o);return{c(){a&&a.c(),e=Ze(),l&&l.c(),t=Bs()},m(f,d){a&&a.m(f,d),Me(f,e,d),l&&l.m(f,d),Me(f,t,d),s=!0},p(f,[d]){f[0]?a?(a.p(f,d),d&1&&ke(a,1)):(a=Gle(f),a.c(),ke(a,1),a.m(e.parentNode,e)):a&&(go(),Fe(a,1,1,()=>{a=null}),po()),f[1]?l?l.p(f,d):(l=Kle(f),l.c(),l.m(t.parentNode,t)):l&&(l.d(1),l=null)},i(f){s||(ke(a),s=!0)},o(f){Fe(a),s=!1},d(f){a&&a.d(f),f&&De(e),l&&l.d(f),f&&De(t)}}}function GSe(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=y=>{"record"in y&&t(0,s=y.record),"size"in y&&t(6,l=y.size),"showFilename"in y&&t(1,f=y.showFilename)},[s,f,d,h,b,a,l]}class Xw extends yo{constructor(e){super(),Oo(this,e,GSe,qSe,vo,{record:0,size:6,showFilename:1})}}function Jle(o){let e,t,s,a,l,f,d,h,b,y,k=o[0]._file.path+"",E,R,$,Q,F,U,J=o[0]._file.originalName+"",L,te,ne,oe,X,ye,Se=o[0]._file.mime+"",Ne,pe,ce,Xe,tt,yt,V,ut=(o[0]._file.size/1024).toFixed(1)+"",He,_t,wt,Be,nt,rn,At,Cn=o[0]._file.checksum+"",je,ht,he,Qo,Kn,so,Uo=o[0]._file.path+"",as,xt,jt;s=new Xw({props:{record:o[0],size:"large"}});let gt=o[0]._file.width&&ece(o);return{c(){e=re("div"),t=re("div"),en(s.$$.fragment),a=Ze(),l=re("div"),f=re("ul"),d=re("li"),h=re("span"),h.textContent="Filename",b=Ze(),y=re("span"),E=Xt(k),R=Ze(),$=re("li"),Q=re("span"),Q.textContent="Original name",F=Ze(),U=re("span"),L=Xt(J),te=Ze(),ne=re("li"),oe=re("span"),oe.textContent="Mime type",X=Ze(),ye=re("span"),Ne=Xt(Se),pe=Ze(),gt&>.c(),ce=Ze(),Xe=re("li"),tt=re("span"),tt.textContent="File size",yt=Ze(),V=re("span"),He=Xt(ut),_t=Xt("kB"),wt=Ze(),Be=re("li"),nt=re("span"),nt.textContent="Checksum",rn=Ze(),At=re("span"),je=Xt(Cn),ht=Ze(),he=re("li"),Qo=re("span"),Qo.textContent="Download",Kn=Ze(),so=re("a"),as=Xt(Uo),z(t,"class","col"),ss(t,"max-width","276px"),z(h,"class","text-muted"),z(d,"class","list-group-item border-primary"),z(Q,"class","text-muted"),z($,"class","list-group-item border-primary"),z(oe,"class","text-muted"),z(ne,"class","list-group-item border-primary"),z(tt,"class","text-muted"),z(Xe,"class","list-group-item border-primary"),z(nt,"class","text-muted"),z(Be,"class","list-group-item border-primary"),z(Qo,"class","text-muted"),z(so,"href",xt=Moe(o[0])),z(he,"class","list-group-item border-primary"),z(f,"class","list-group svelte-1qb90xc"),z(l,"class","col"),z(e,"class","row mb-4")},m($e,Gt){Me($e,e,Gt),j(e,t),Kt(s,t,null),j(e,a),j(e,l),j(l,f),j(f,d),j(d,h),j(d,b),j(d,y),j(y,E),j(f,R),j(f,$),j($,Q),j($,F),j($,U),j(U,L),j(f,te),j(f,ne),j(ne,oe),j(ne,X),j(ne,ye),j(ye,Ne),j(f,pe),gt&>.m(f,null),j(f,ce),j(f,Xe),j(Xe,tt),j(Xe,yt),j(Xe,V),j(V,He),j(V,_t),j(f,wt),j(f,Be),j(Be,nt),j(Be,rn),j(Be,At),j(At,je),j(f,ht),j(f,he),j(he,Qo),j(he,Kn),j(he,so),j(so,as),jt=!0},p($e,Gt){const gn={};Gt&1&&(gn.record=$e[0]),s.$set(gn),(!jt||Gt&1)&&k!==(k=$e[0]._file.path+"")&&Wn(E,k),(!jt||Gt&1)&&J!==(J=$e[0]._file.originalName+"")&&Wn(L,J),(!jt||Gt&1)&&Se!==(Se=$e[0]._file.mime+"")&&Wn(Ne,Se),$e[0]._file.width?gt?gt.p($e,Gt):(gt=ece($e),gt.c(),gt.m(f,ce)):gt&&(gt.d(1),gt=null),(!jt||Gt&1)&&ut!==(ut=($e[0]._file.size/1024).toFixed(1)+"")&&Wn(He,ut),(!jt||Gt&1)&&Cn!==(Cn=$e[0]._file.checksum+"")&&Wn(je,Cn),(!jt||Gt&1)&&Uo!==(Uo=$e[0]._file.path+"")&&Wn(as,Uo),(!jt||Gt&1&&xt!==(xt=Moe($e[0])))&&z(so,"href",xt)},i($e){jt||(ke(s.$$.fragment,$e),jt=!0)},o($e){Fe(s.$$.fragment,$e),jt=!1},d($e){$e&&De(e),Jt(s),gt&>.d()}}}function ece(o){let e,t,s,a,l=o[0]._file.width+"",f,d,h=o[0]._file.height+"",b;return{c(){e=re("li"),t=re("span"),t.textContent="Dimensions",s=Ze(),a=re("span"),f=Xt(l),d=Xt("x"),b=Xt(h),z(t,"class","text-muted"),z(e,"class","list-group-item border-primary")},m(y,k){Me(y,e,k),j(e,t),j(e,s),j(e,a),j(a,f),j(a,d),j(a,b)},p(y,k){k&1&&l!==(l=y[0]._file.width+"")&&Wn(f,l),k&1&&h!==(h=y[0]._file.height+"")&&Wn(b,h)},d(y){y&&De(e)}}}function KSe(o){let e,t,s=o[1].type==="files"&&Jle(o);return{c(){s&&s.c(),e=Bs()},m(a,l){s&&s.m(a,l),Me(a,e,l),t=!0},p(a,[l]){a[1].type==="files"?s?(s.p(a,l),l&2&&ke(s,1)):(s=Jle(a),s.c(),ke(s,1),s.m(e.parentNode,e)):s&&(go(),Fe(s,1,1,()=>{s=null}),po())},i(a){t||(ke(s),t=!0)},o(a){Fe(s),t=!1},d(a){s&&s.d(a),a&&De(e)}}}function JSe(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 Fpe extends yo{constructor(e){super(),Oo(this,e,JSe,KSe,vo,{record:0,schema:1})}}function tce(o,e,t){const s=o.slice();return s[9]=e[t],s}function nce(o){let e,t=o[1],s=[];for(let a=0;a1&&nce(o);return{c(){t&&t.c(),e=Bs()},m(s,a){t&&t.m(s,a),Me(s,e,a)},p(s,[a]){s[1].length>1?t?t.p(s,a):(t=nce(s),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},i:bn,o:bn,d(s){t&&t.d(s),s&&De(e)}}}function tCe(o,e,t){var E,R;let{schema:s}=e,{isCreateMode:a}=e,{active:l=""}=e,f=(R=(E=s.groups)==null?void 0:E.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 y($,Q){$.preventDefault(),Q=="_graph"?b($):t(0,l=Q)}const k=($,Q)=>y(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,y,s,a,k]}class Qpe extends yo{constructor(e){super(),Oo(this,e,tCe,eCe,vo,{schema:3,isCreateMode:4,active:0})}}function sce(o,e,t){const s=o.slice();return s[11]=e[t],s}function rce(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 y=($,Q)=>b(Q,$),k=($,Q)=>b(Q,$),E=$=>{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,y,k,E,R]}class qz extends yo{constructor(e){super(),Oo(this,e,rCe,sCe,vo,{field:2,value:0,search:1,update:6})}get update(){return this.$$.ctx[6]}}function lce(o,e,t){const s=o.slice();return s[11]=e[t][0],s[12]=e[t][1],s}function cce(o,e,t){const s=o.slice();return s[8]=e[t],s}function uce(o){let e,t;function s(f,d){return d&1&&(e=null),e==null&&(e=!!Array.isArray(f[0].selectOptions)),e?aCe:iCe}let a=s(o,-1),l=a(o);return{c(){l.c(),t=Bs()},m(f,d){l.m(f,d),Me(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&&De(t)}}}function iCe(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(E,k),h=(k,E)=>f(E,k),b=(k,E)=>f(E,k),y=(k,E)=>f(E,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,y]}class uCe extends yo{constructor(e){super(),Oo(this,e,cCe,lCe,vo,{field:0,value:2,search:3})}}function Lm(o,e){return o&&o[e]?o[e].message:null}function fCe(o){let e,t,s,a;return{c(){e=re("input"),z(e,"type","text"),z(e,"id",o[3]),z(e,"class","form-control"),z(e,"autocomplete","off"),e.readOnly=t=o[1].readonly&&!o[2],is(e,"is-invalid",o[7])},m(l,f){Me(l,e,f),hr(e,o[0]),s||(a=pn(e,"input",o[18]),s=!0)},p(l,f){f&8&&z(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:bn,o:bn,d(l){l&&De(e),s=!1,a()}}}function dCe(o){let e,t,s,a,l,f,d,h,b,y,k,E,R;function $(J){o[15](J)}function Q(J){o[16](J)}let F={field:o[1]};o[0]!==void 0&&(F.value=o[0]),o[6]!==void 0&&(F.search=o[6]),f=new uCe({props:F}),Vo.push(()=>cr(f,"value",$)),Vo.push(()=>cr(f,"search",Q));let U=o[0]&&hce(o);return{c(){e=re("div"),t=re("input"),a=Ze(),l=re("div"),en(f.$$.fragment),b=Ze(),U&&U.c(),y=Bs(),z(t,"type","search"),z(t,"id",o[3]),z(t,"class","form-control dropdown-toggle"),z(t,"placeholder","Search for options"),z(t,"data-bs-toggle","dropdown"),z(t,"autocomplete","off"),t.readOnly=s=o[1].readonly&&!o[2],is(t,"is-invalid",o[7]),z(l,"class","dropdown-menu w-100"),z(e,"class","dropdown")},m(J,L){Me(J,e,L),j(e,t),hr(t,o[6]),j(e,a),j(e,l),Kt(f,l,null),Me(J,b,L),U&&U.m(J,L),Me(J,y,L),k=!0,E||(R=pn(t,"input",o[14]),E=!0)},p(J,L){(!k||L&8)&&z(t,"id",J[3]),(!k||L&6&&s!==(s=J[1].readonly&&!J[2]))&&(t.readOnly=s),L&64&&t.value!==J[6]&&hr(t,J[6]),(!k||L&128)&&is(t,"is-invalid",J[7]);const te={};L&2&&(te.field=J[1]),!d&&L&1&&(d=!0,te.value=J[0],mr(()=>d=!1)),!h&&L&64&&(h=!0,te.search=J[6],mr(()=>h=!1)),f.$set(te),J[0]?U?U.p(J,L):(U=hce(J),U.c(),U.m(y.parentNode,y)):U&&(U.d(1),U=null)},i(J){k||(ke(f.$$.fragment,J),k=!0)},o(J){Fe(f.$$.fragment,J),k=!1},d(J){J&&De(e),Jt(f),J&&De(b),U&&U.d(J),J&&De(y),E=!1,R()}}}function hCe(o){let e,t,s,a,l,f,d,h,b,y,k=o[1].optionsFrom&&mce(o),E=o[0]&&gce(o);return{c(){e=re("div"),t=re("input"),a=Ze(),l=re("div"),k&&k.c(),f=Ze(),E&&E.c(),d=Bs(),z(t,"type","search"),z(t,"id",o[3]),z(t,"class","form-control dropdown-toggle"),z(t,"placeholder","Search for options"),z(t,"data-bs-toggle","dropdown"),z(t,"autocomplete","off"),t.readOnly=s=o[1].readonly&&!o[2],is(t,"is-invalid",o[7]),z(l,"class","dropdown-menu w-100"),z(e,"class","dropdown")},m(R,$){Me(R,e,$),j(e,t),hr(t,o[6]),j(e,a),j(e,l),k&&k.m(l,null),Me(R,f,$),E&&E.m(R,$),Me(R,d,$),h=!0,b||(y=[pn(t,"keyup",function(){Ub(o[4].update)&&o[4].update.apply(this,arguments)}),pn(t,"focus",function(){Ub(o[4].update)&&o[4].update.apply(this,arguments)}),pn(t,"input",o[9])],b=!0)},p(R,$){o=R,(!h||$&8)&&z(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&&ke(k,1)):(k=mce(o),k.c(),ke(k,1),k.m(l,null)):k&&(go(),Fe(k,1,1,()=>{k=null}),po()),o[0]?E?E.p(o,$):(E=gce(o),E.c(),E.m(d.parentNode,d)):E&&(E.d(1),E=null)},i(R){h||(ke(k),h=!0)},o(R){Fe(k),h=!1},d(R){R&&De(e),k&&k.d(),R&&De(f),E&&E.d(R),R&&De(d),b=!1,$i(y)}}}function hce(o){let e,t,s,a,l,f,d;function h(k,E){return E&2&&(s=null),s==null&&(s=!!Array.isArray(k[1].selectOptions)),s?gCe:mCe}let b=h(o,-1),y=b(o);return{c(){e=re("span"),t=re("div"),y.c(),a=Ze(),l=re("button"),z(l,"type","button"),z(l,"class","btn-close btn-sm ms-1"),ss(l,"font-size","10px"),z(l,"aria-label","Close"),z(t,"class","d-flex align-items-center "),z(e,"class","badge rounded-pill bg-light text-dark fs-6 mt-3")},m(k,E){Me(k,e,E),j(e,t),y.m(t,null),j(t,a),j(t,l),f||(d=pn(l,"click",ju(o[17])),f=!0)},p(k,E){b===(b=h(k,E))&&y?y.p(k,E):(y.d(1),y=b(k),y&&(y.c(),y.m(t,a)))},d(k){k&&De(e),y.d(),f=!1,d()}}}function mCe(o){let e=o[1].selectOptions[o[0]]+"",t;return{c(){t=Xt(e)},m(s,a){Me(s,t,a)},p(s,a){a&3&&e!==(e=s[1].selectOptions[s[0]]+"")&&Wn(t,e)},d(s){s&&De(t)}}}function gCe(o){let e;return{c(){e=Xt(o[0])},m(t,s){Me(t,e,s)},p(t,s){s&1&&Wn(e,t[0])},d(t){t&&De(e)}}}function mce(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 qz({props:d}),o[10](e),Vo.push(()=>cr(e,"value",l)),Vo.push(()=>cr(e,"search",f)),{c(){en(e.$$.fragment)},m(h,b){Kt(e,h,b),a=!0},p(h,b){const y={};b&2&&(y.field=h[1]),!t&&b&1&&(t=!0,y.value=h[0],mr(()=>t=!1)),!s&&b&64&&(s=!0,y.search=h[6],mr(()=>s=!1)),e.$set(y)},i(h){a||(ke(e.$$.fragment,h),a=!0)},o(h){Fe(e.$$.fragment,h),a=!1},d(h){o[10](null),Jt(e,h)}}}function gce(o){let e,t,s,a,l,f,d;return{c(){e=re("span"),t=re("div"),s=Xt(o[0]),a=Ze(),l=re("button"),z(l,"type","button"),z(l,"class","btn-close btn-sm ms-1"),ss(l,"font-size","10px"),z(l,"aria-label","Close"),z(t,"class","d-flex align-items-center "),z(e,"class","badge rounded-pill bg-light text-dark fs-6 mt-3")},m(h,b){Me(h,e,b),j(e,t),j(t,s),j(t,a),j(t,l),f||(d=pn(l,"click",ju(o[13])),f=!0)},p(h,b){b&1&&Wn(s,h[0])},d(h){h&&De(e),f=!1,d()}}}function pce(o){let e,t;return{c(){e=re("div"),t=Xt(o[7]),z(e,"class","invalid-feedback d-block")},m(s,a){Me(s,e,a),j(e,t)},p(s,a){a&128&&Wn(t,s[7])},d(s){s&&De(e)}}}function pCe(o){let e,t,s,a,l;const f=[hCe,dCe,fCe],d=[];function h(y,k){return y[5]?0:y[1].selectOptions?1:2}t=h(o),s=d[t]=f[t](o);let b=o[7]&&pce(o);return{c(){e=re("div"),s.c(),a=Ze(),b&&b.c(),z(e,"class","mb-0")},m(y,k){Me(y,e,k),d[t].m(e,null),j(e,a),b&&b.m(e,null),l=!0},p(y,[k]){let E=t;t=h(y),t===E?d[t].p(y,k):(go(),Fe(d[E],1,1,()=>{d[E]=null}),po(),s=d[t],s?s.p(y,k):(s=d[t]=f[t](y),s.c()),ke(s,1),s.m(e,a)),y[7]?b?b.p(y,k):(b=pce(y),b.c(),b.m(e,null)):b&&(b.d(1),b=null)},i(y){l||(ke(s),l=!0)},o(y){Fe(s),l=!1},d(y){y&&De(e),d[t].d(),b&&b.d()}}}function bCe(o,e,t){let s,a,l,{field:f}=e,{value:d}=e,{isCreateMode:h}=e,{validationErrors:b}=e,{id:y}=e,k;function E(){a=this.value,t(6,a)}function R(oe){Vo[oe?"unshift":"push"](()=>{k=oe,t(4,k)})}function $(oe){d=oe,t(0,d)}function Q(oe){a=oe,t(6,a)}const F=oe=>t(0,d="");function U(){a=this.value,t(6,a)}function J(oe){d=oe,t(0,d)}function L(oe){a=oe,t(6,a)}const te=oe=>t(0,d="");function ne(){d=this.value,t(0,d)}return o.$$set=oe=>{"field"in oe&&t(1,f=oe.field),"value"in oe&&t(0,d=oe.value),"isCreateMode"in oe&&t(2,h=oe.isCreateMode),"validationErrors"in oe&&t(8,b=oe.validationErrors),"id"in oe&&t(3,y=oe.id)},o.$$.update=()=>{o.$$.dirty&258&&t(7,s=Lm(b,f.name)),o.$$.dirty&6&&t(5,l=f.optionsFrom&&!(f.readonly&&!h))},t(6,a=""),[d,f,h,y,k,l,a,s,b,E,R,$,Q,F,U,J,L,te,ne]}class Zpe extends yo{constructor(e){super(),Oo(this,e,bCe,pCe,vo,{field:1,value:0,isCreateMode:2,validationErrors:8,id:3})}}function bce(o){let e,t;return{c(){e=re("div"),t=Xt(o[4]),z(e,"class","invalid-feedback d-block")},m(s,a){Me(s,e,a),j(e,t)},p(s,a){a&16&&Wn(t,s[4])},d(s){s&&De(e)}}}function vCe(o){let e,t,s,a,l,f,d=o[4]&&bce(o);return{c(){e=re("div"),t=re("input"),a=Ze(),d&&d.c(),z(t,"type","text"),z(t,"id",o[3]),z(t,"class","form-control"),z(t,"autocomplete","off"),t.readOnly=s=o[1].readonly&&!o[2],is(t,"is-invalid",o[4]),z(e,"class","mb-0")},m(h,b){Me(h,e,b),j(e,t),hr(t,o[0]),j(e,a),d&&d.m(e,null),l||(f=pn(t,"input",o[6]),l=!0)},p(h,[b]){b&8&&z(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=bce(h),d.c(),d.m(e,null)):d&&(d.d(1),d=null)},i:bn,o:bn,d(h){h&&De(e),d&&d.d(),l=!1,f()}}}function OCe(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=y=>{"field"in y&&t(1,a=y.field),"value"in y&&t(0,l=y.value),"isCreateMode"in y&&t(2,f=y.isCreateMode),"validationErrors"in y&&t(5,d=y.validationErrors),"id"in y&&t(3,h=y.id)},o.$$.update=()=>{o.$$.dirty&34&&t(4,s=Lm(d,a.name))},[l,a,f,h,s,d,b]}class Hpe extends yo{constructor(e){super(),Oo(this,e,OCe,vCe,vo,{field:1,value:0,isCreateMode:2,validationErrors:5,id:3})}}function K6(o,e,t,s,a=""){let l=t.map(d=>({target:d.id,source:e.id,sourceSchema:e.schema,targetSchema:d.schema,field:s,depth:1,rank:""})),f=o.edges;return a==="replace"&&(f=f.filter(d=>d.field!==field.name)),o.records=Lc.exports.uniqBy([...o.records,...t],d=>d.id),o.edges=Lc.exports.uniqBy([...f,...l],d=>d.source+d.target+d.field+d.depth),o}function yCe(o){let e,t=o[0].text+"",s;return{c(){e=re("span"),s=Xt(t),z(e,"class","badge text-bg-"+o[0].bg),ss(e,"max-width","84px")},m(a,l){Me(a,e,l),j(e,s)},p:bn,i:bn,o:bn,d(a){a&&De(e)}}}function wCe(o,e,t){let{status:s}=e,a=Ipe(s);return o.$$set=l=>{"status"in l&&t(1,s=l.status)},[a,s]}class nre extends yo{constructor(e){super(),Oo(this,e,wCe,yCe,vo,{status:1})}}function _Ce(o){let e,t,s;return t=new Xw({props:{record:o[0],size:"small"}}),{c(){e=re("div"),en(t.$$.fragment),ss(e,"max-width","94px"),ss(e,"margin-right","15px")},m(a,l){Me(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||(ke(t.$$.fragment,a),s=!0)},o(a){Fe(t.$$.fragment,a),s=!1},d(a){a&&De(e),Jt(t)}}}function vce(o){let e,t;return e=new nre({props:{status:o[0].status}}),{c(){en(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||(ke(e.$$.fragment,s),t=!0)},o(s){Fe(e.$$.fragment,s),t=!1},d(s){Jt(e,s)}}}function Oce(o){let e,t,s,a,l,f;return s=new Fa({props:{icon:"trash-can"}}),{c(){e=re("div"),t=re("button"),en(s.$$.fragment),z(t,"class","trash-button text-dark btn btn-sm btn-link svelte-dof9cm"),z(e,"class","position-absolute end-0"),ss(e,"top","5px")},m(d,h){Me(d,e,h),j(e,t),Kt(s,t,null),a=!0,l||(f=pn(t,"click",o[6]),l=!0)},p:bn,i(d){a||(ke(s.$$.fragment,d),a=!0)},o(d){Fe(s.$$.fragment,d),a=!1},d(d){d&&De(e),Jt(s),l=!1,f()}}}function SCe(o){let e,t,s,a,l,f,d,h,b,y,k,E,R,$,Q=o[4].type==="files"&&_Ce(o),F=o[0].status==="draft"&&vce(o),U=o[2]&&Oce(o);return{c(){var J;e=re("div"),t=re("div"),Q&&Q.c(),s=Ze(),a=re("div"),l=re("a"),f=Xt(o[5]),h=Ze(),b=re("small"),b.textContent=`${o[4].label}`,y=Ze(),k=re("small"),F&&F.c(),E=Ze(),U&&U.c(),z(l,"class","title-link m-0 fs-5 text-decoration-none text-dark d-block svelte-dof9cm"),z(l,"href",d=o[3].lucentUrl+"/records/"+o[0].id),z(l,"title",o[5]),z(b,"class","text-muted"),z(k,"class","text-muted"),z(a,"class","overflow-hidden"),z(t,"class","card-body d-flex"),z(e,"class",R="card mb-2 bg-light "+o[1]+" svelte-dof9cm"),ss(e,"border-color",(J=o[4].color)!=null?J:"#ccc"),ss(e,"border-width","1px")},m(J,L){Me(J,e,L),j(e,t),Q&&Q.m(t,null),j(t,s),j(t,a),j(a,l),j(l,f),j(a,h),j(a,b),j(a,y),j(a,k),F&&F.m(k,null),j(e,E),U&&U.m(e,null),$=!0},p(J,[L]){J[4].type==="files"&&Q.p(J,L),(!$||L&1&&d!==(d=J[3].lucentUrl+"/records/"+J[0].id))&&z(l,"href",d),J[0].status==="draft"?F?(F.p(J,L),L&1&&ke(F,1)):(F=vce(J),F.c(),ke(F,1),F.m(k,null)):F&&(go(),Fe(F,1,1,()=>{F=null}),po()),J[2]?U?(U.p(J,L),L&4&&ke(U,1)):(U=Oce(J),U.c(),ke(U,1),U.m(e,null)):U&&(go(),Fe(U,1,1,()=>{U=null}),po()),(!$||L&2&&R!==(R="card mb-2 bg-light "+J[1]+" svelte-dof9cm"))&&z(e,"class",R)},i(J){$||(ke(Q),ke(F),ke(U),$=!0)},o(J){Fe(Q),Fe(F),Fe(U),$=!1},d(J){J&&De(e),Q&&Q.d(),F&&F.d(),U&&U.d()}}}function CCe(o,e,t){const s=Hp(),a=si("channel");let{graph:l}=e,{record:f}=e,{classes:d=""}=e,{hasDelete:h=!1}=e,b=a.schemas.find(E=>E.name===f.schema),y=wd(a.schemas,f,l);function k(E){E.preventDefault(),s("remove",f.id)}return o.$$set=E=>{"graph"in E&&t(7,l=E.graph),"record"in E&&t(0,f=E.record),"classes"in E&&t(1,d=E.classes),"hasDelete"in E&&t(2,h=E.hasDelete)},[f,d,h,a,b,y,k,l]}class J6 extends yo{constructor(e){super(),Oo(this,e,CCe,SCe,vo,{graph:7,record:0,classes:1,hasDelete:2})}}function XD(o,e,t,s){var f,d;if(o===e)return t;let a=(f=t==null?void 0:t.filter(h=>h.field===s&&h.depth===1))!=null?f:[],l=(d=t==null?void 0:t.filter(h=>!(h.field===s&&h.depth===1)))!=null?d:[];return a=kCe(a,o,e),[...l,...a]}function kCe(o,e,t){if(t>=o.length)for(var s=t-o.length+1;s--;)o.push(void 0);return o.splice(t,0,o.splice(e,1)[0]),o}function yce(o,e,t){const s=o.slice();return s[23]=e[t],s}function wce(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 MOe({props:d}),Vo.push(()=>cr(e,"data",l)),Vo.push(()=>cr(e,"graph",f)),{c(){en(e.$$.fragment)},m(h,b){Kt(e,h,b),a=!0},p(h,b){const y={};b&4&&(y.schema=h[2]),b&1&&(y.record=h[0]),b&16&&(y.validationErrors=h[4]),b&8&&(y.isCreateMode=h[3]),!t&&b&1&&(t=!0,y.data=h[0].data,mr(()=>t=!1)),!s&&b&2&&(s=!0,y.graph=h[1],mr(()=>s=!1)),e.$set(y)},i(h){a||(ke(e.$$.fragment,h),a=!0)},o(h){Fe(e.$$.fragment,h),a=!1},d(h){Jt(e,h)}}}function _ce(o,e){let t,s,a,l=e[5]===e[23].group&&wce(e);return{key:o,first:null,c(){t=Bs(),l&&l.c(),s=Bs(),this.first=t},m(f,d){Me(f,t,d),l&&l.m(f,d),Me(f,s,d),a=!0},p(f,d){e=f,e[5]===e[23].group?l?(l.p(e,d),d&32&&ke(l,1)):(l=wce(e),l.c(),ke(l,1),l.m(s.parentNode,s)):l&&(go(),Fe(l,1,1,()=>{l=null}),po())},i(f){a||(ke(l),a=!0)},o(f){Fe(l),a=!1},d(f){f&&De(t),l&&l.d(f),f&&De(s)}}}function Sce(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 Lpe({props:l}),Vo.push(()=>cr(e,"status",a)),{c(){en(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||(ke(e.$$.fragment,f),s=!0)},o(f){Fe(e.$$.fragment,f),s=!1},d(f){Jt(e,f)}}}function xCe(o){let e,t,s,a,l,f;return{c(){e=re("button"),t=re("span"),s=Xt(` - Save`),z(t,"class","spinner-border spinner-border-sm"),z(t,"role","status"),z(t,"aria-hidden","true"),e.disabled=a=!o[6],z(e,"class","ms-2 btn btn-primary btn-spinner")},m(d,h){Me(d,e,h),j(e,t),j(e,s),l||(f=pn(e,"click",o[11]),l=!0)},p(d,h){h&64&&a!==(a=!d[6])&&(e.disabled=a)},d(d){d&&De(e),l=!1,f()}}}function TCe(o){let e,t,s;return{c(){e=re("button"),e.innerHTML=` - Add`,z(e,"class","ms-2 btn btn-primary btn-spinner")},m(a,l){Me(a,e,l),t||(s=pn(e,"click",o[11]),t=!0)},p:bn,d(a){a&&De(e),t=!1,s()}}}function ECe(o){let e,t,s,a,l,f,d,h,b,y=[],k=new Map,E,R,$,Q,F,U,J,L,te;t=new X6({props:{message:o[7]}});function ne(Xe){o[12](Xe)}let oe={schema:o[2],isCreateMode:o[3],record:o[0]};o[5]!==void 0&&(oe.active=o[5]),l=new Qpe({props:oe}),Vo.push(()=>cr(l,"active",ne)),h=new Fpe({props:{record:o[0],schema:o[2]}});let X=o[8];const ye=Xe=>Xe[23].name;for(let Xe=0;Xef=!1)),l.$set(V);const ut={};tt&1&&(ut.record=Xe[0]),tt&4&&(ut.schema=Xe[2]),h.$set(ut),tt&319&&(X=Xe[8],go(),y=Xh(y,tt,ye,1,Xe,X,k,a,xv,_ce,null,yce),po()),Xe[2].hasDrafts?Se?(Se.p(Xe,tt),tt&4&&ke(Se,1)):(Se=Sce(Xe),Se.c(),ke(Se,1),Se.m($,Q)):Se&&(go(),Fe(Se,1,1,()=>{Se=null}),po()),pe===(pe=Ne(Xe))&&ce?ce.p(Xe,tt):(ce.d(1),ce=pe(Xe),ce&&(ce.c(),ce.m($,F)))},i(Xe){if(!J){ke(t.$$.fragment,Xe),ke(l.$$.fragment,Xe),ke(h.$$.fragment,Xe);for(let tt=0;ttSe.name!=="id"),Q="_default";d.fields.reduce((Se,Ne)=>{var pe;return Ne.ui==="tab"?(Q=Ne.name,Se):(Se[Q]=[...(pe=Se[Q])!=null?pe:[],Ne.name],Se)},[]),W1(()=>{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))}}Spe(()=>{t(6,R=J())});function U(Se){return R?Se.returnValue="You have unsaved changes. Are you sure you want to exit?":(delete Se.returnValue,"...")}function J(){return y?!1:!Lc.exports.isEqual(k,{data:h.data,schema:h.schema,status:h.status,_sys:h._sys,_file:h._file,edges:b.edges})}function L(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(Ne,pe){var ce,Xe;if(!R&&!y){Ne(null);return}if(!h){Ne(null);return}t(1,b.edges=(Xe=(ce=b.edges)==null?void 0:ce.filter(tt=>!tt._isTrashed&&tt.source===h.id))!=null?Xe:[],b),axios.post(l.lucentUrl+"/records",{record:h,edges:b.edges,isCreateMode:y}).then(function(tt){console.log("SAVE: SAVED INLINE"),t(0,h=tt.data.records[0]),t(1,b=tt.data),y||F(),f("inlinesaved",{records:[h]}),Ne(null)}).catch(function(tt){tt.response&&(typeof tt.response.data.error=="string"?t(7,a=tt.response.data.error):t(4,s=tt.response.data.error)),Ne(null)})})}function ne(Se){E=Se,t(5,E)}function oe(Se){o.$$.not_equal(h.data,Se)&&(h.data=Se,t(0,h))}function X(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,y=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,y,s,E,R,a,$,U,L,te,ne,oe,X,ye]}class zpe extends yo{constructor(e){super(),Oo(this,e,ACe,ECe,vo,{schema:2,record:0,graph:1,isCreateMode:3})}}function Cce(o,e,t){const s=o.slice();return s[19]=e[t],s}function kce(o,e,t){const s=o.slice();return s[22]=e[t],s}function xce(o){let e,t=o[22].label+"",s;return{c(){e=re("option"),s=Xt(t),e.__value=o[22],e.value=e.__value},m(a,l){Me(a,e,l),j(e,s)},p:bn,d(a){a&&De(e)}}}function Tce(o){let e,t=o[19].label+"",s,a;return{c(){e=re("option"),s=Xt(t),e.__value=a=o[19],e.value=e.__value},m(l,f){Me(l,e,f),j(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&&De(e)}}}function DCe(o){let e,t,s,a,l,f,d,h,b,y,k,E,R,$,Q,F,U,J,L,te,ne,oe,X,ye,Se,Ne,pe,ce,Xe,tt;a=new Fa({props:{icon:"filter"}});let yt=o[5],V=[];for(let _t=0;_tAdvanced filters',ye=Ze(),Se=re("form"),Ne=re("div"),pe=re("input"),z(f,"class","ms-1"),z(s,"class","btn btn-sm btn-outline-primary dropdown-toggle d-flex align-items-center"),z(s,"type","button"),z(s,"data-bs-toggle","dropdown"),z(s,"data-bs-auto-close","outside"),z(s,"aria-expanded","false"),z(y,"class","form-select"),o[0]===void 0&&AC(()=>o[13].call(y)),z(b,"class","px-3 py-1 d-flex align-items-center"),z(R,"class","form-select"),o[4]===void 0&&AC(()=>o[14].call(R)),z(E,"class","px-3 py-1 d-flex align-items-center"),z(F,"type","text"),z(F,"class","form-control"),z(Q,"class","px-3 py-1 d-flex align-items-center"),z(L,"class","btn btn-outline-primary"),z(L,"type","button"),z(J,"class","px-3 py-1 d-flex align-items-center"),z(pe,"type","search"),z(pe,"class","form-control"),z(pe,"placeholder","Advanced filters"),pe.required=!0,z(Ne,"class","px-3 py-1 d-flex align-items-center"),z(h,"class","dropdown-menu"),ss(h,"width","300px"),z(t,"class","btn-group"),z(e,"class","mx-2 d-flex align-items-center")},m(_t,wt){Me(_t,e,wt),j(e,t),j(t,s),Kt(a,s,null),j(s,l),j(s,f),j(t,d),j(t,h),j(h,b),j(b,y);for(let Be=0;Beoe.files===!1));let R=[...f.fields,...E].filter(oe=>!["file","json","tab"].includes(oe.ui)),$,Q="";function F(oe){oe.preventDefault();let X="";f.fields.find(Ne=>Ne.name===$.name)&&(X="data.");let ye=`filter[${X+$.name}_${a.name}]`;const Se=new URL(y!=null?y:window.location.href);Se.searchParams.set("skip","0"),Se.searchParams.set(ye,Q),b?l("refresh",Se):window.location=Se}function U(oe){var pe,ce;oe.preventDefault();let X=(pe=k.split("=")[0])!=null?pe:"";if(!X)return;let ye=`filter[${X}]`,Se=(ce=k.split("=")[1])!=null?ce:"";if(!Se)return;const Ne=new URL(y!=null?y:window.location.href);Ne.searchParams.set("skip","0"),Ne.searchParams.set(ye,Se),b?l("refresh",Ne):window.location=Ne}function J(){$=mle(this),t(0,$),t(5,R)}function L(){a=mle(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 ne(){k=this.value,t(2,k)}return o.$$set=oe=>{"schema"in oe&&t(8,f=oe.schema),"systemFields"in oe&&t(9,d=oe.systemFields),"operators"in oe&&t(10,h=oe.operators),"inModal"in oe&&t(11,b=oe.inModal),"modalUrl"in oe&&t(12,y=oe.modalUrl)},o.$$.update=()=>{o.$$.dirty&1025&&t(1,s=h.filter(oe=>oe.uis.includes($==null?void 0:$.ui)||oe.uis[0]=="*")),o.$$.dirty&2&&t(4,a=s[0])},[$,s,k,Q,a,R,F,U,f,d,h,b,y,J,L,te,ne]}class MCe extends yo{constructor(e){super(),Oo(this,e,PCe,DCe,vo,{schema:8,systemFields:9,operators:10,inModal:11,modalUrl:12})}}function RCe(o){let e,t,s,a,l,f,d,h;return{c(){e=re("fieldset"),t=re("label"),s=Xt(`Upload file - `),a=re("span"),a.innerHTML='Loading...',l=Ze(),f=re("input"),z(a,"class","spinner-border spinner-border-sm"),z(a,"role","status"),z(a,"aria-hidden","true"),z(f,"class","form-control"),z(f,"type","file"),z(f,"id","formFile"),f.multiple=!0,z(f,"accept",$Ce),f.disabled=o[0],f.hidden=!0,z(t,"class","btn btn-primary btn-sm btn-spinner "),e.disabled=o[0]},m(b,y){Me(b,e,y),j(e,t),j(t,s),j(t,a),j(t,l),j(t,f),d||(h=pn(f,"input",o[1]),d=!0)},p(b,[y]){y&1&&(f.disabled=b[0]),y&1&&(e.disabled=b[0])},i:bn,o:bn,d(b){b&&De(e),d=!1,h()}}}let $Ce="";function NCe(o,e,t){const s=Hp(),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 y=new FormData;y.append("schema",l.name),Array.from(f).forEach(function(k){y.append("files[]",k)}),s("beforeUpload",f),axios.post(a.lucentUrl+"/files/upload",y,{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 ICe extends yo{constructor(e){super(),Oo(this,e,NCe,RCe,vo,{schema:2})}}function Ece(o,e,t){const s=o.slice();return s[18]=e[t],s}function Ace(o,e,t){const s=o.slice();return s[18]=e[t],s}function BCe(o){let e,t;return e=new Fa({props:{icon:"arrow-up-short-wide"}}),{c(){en(e.$$.fragment)},m(s,a){Kt(e,s,a),t=!0},i(s){t||(ke(e.$$.fragment,s),t=!0)},o(s){Fe(e.$$.fragment,s),t=!1},d(s){Jt(e,s)}}}function LCe(o){let e,t;return e=new Fa({props:{icon:"arrow-down-wide-short"}}),{c(){en(e.$$.fragment)},m(s,a){Kt(e,s,a),t=!0},i(s){t||(ke(e.$$.fragment,s),t=!0)},o(s){Fe(e.$$.fragment,s),t=!1},d(s){Jt(e,s)}}}function Dce(o){let e,t,s,a,l,f,d,h,b,y,k,E=o[18].label+"",R,$,Q,F,U;a=new Fa({props:{icon:"arrow-up-short-wide"}});function J(...ne){return o[10](o[18],...ne)}h=new Fa({props:{icon:"arrow-down-wide-short"}});function L(...ne){return o[11](o[18],...ne)}function te(...ne){return o[12](o[18],...ne)}return{c(){e=re("div"),t=re("div"),s=re("button"),en(a.$$.fragment),f=Ze(),d=re("button"),en(h.$$.fragment),y=Ze(),k=re("button"),R=Xt(E),$=Ze(),z(s,"title","Sort Ascending"),z(s,"class",l="btn btn-sm "+(o[18].name==o[1].name&&!o[0].startsWith("-")?"btn-primary":"btn-outline-primary")),z(d,"title","Sort Descending"),z(d,"class",b="btn btn-sm "+(o[18].name==o[1].name&&o[0].startsWith("-")?"btn-primary":"btn-outline-primary")),z(k,"title","Sort Ascending"),z(k,"class","btn btn-sm btn-outline-primary w-100 text-nowrap"),ss(k,"overflow","hidden"),z(t,"class","btn-group w-100"),z(e,"class","col-4 px-3 py-1 d-flex align-items-center")},m(ne,oe){Me(ne,e,oe),j(e,t),j(t,s),Kt(a,s,null),j(t,f),j(t,d),Kt(h,d,null),j(t,y),j(t,k),j(k,R),j(e,$),Q=!0,F||(U=[pn(s,"click",J),pn(d,"click",L),pn(k,"click",te)],F=!0)},p(ne,oe){o=ne,(!Q||oe&11&&l!==(l="btn btn-sm "+(o[18].name==o[1].name&&!o[0].startsWith("-")?"btn-primary":"btn-outline-primary")))&&z(s,"class",l),(!Q||oe&11&&b!==(b="btn btn-sm "+(o[18].name==o[1].name&&o[0].startsWith("-")?"btn-primary":"btn-outline-primary")))&&z(d,"class",b),(!Q||oe&8)&&E!==(E=o[18].label+"")&&Wn(R,E)},i(ne){Q||(ke(a.$$.fragment,ne),ke(h.$$.fragment,ne),Q=!0)},o(ne){Fe(a.$$.fragment,ne),Fe(h.$$.fragment,ne),Q=!1},d(ne){ne&&De(e),Jt(a),Jt(h),F=!1,$i(U)}}}function Pce(o){let e,t,s,a,l,f,d,h,b,y,k,E=o[18].label+"",R,$,Q,F,U;a=new Fa({props:{icon:"arrow-up-short-wide"}});function J(...ne){return o[13](o[18],...ne)}h=new Fa({props:{icon:"arrow-down-wide-short"}});function L(...ne){return o[14](o[18],...ne)}function te(...ne){return o[15](o[18],...ne)}return{c(){e=re("div"),t=re("div"),s=re("button"),en(a.$$.fragment),f=Ze(),d=re("button"),en(h.$$.fragment),y=Ze(),k=re("button"),R=Xt(E),$=Ze(),z(s,"title","Sort Ascending"),z(s,"class",l="btn btn-sm "+(o[18].name==o[0]?"btn-primary":"btn-outline-primary")),z(d,"title","Sort Descending"),z(d,"class",b="btn btn-sm "+("-"+o[18].name==o[0]?"btn-primary":"btn-outline-primary")),z(k,"title","Sort Ascending"),z(k,"class","btn btn-sm btn-outline-primary w-100 text-nowrap"),ss(k,"overflow","hidden"),z(t,"class","btn-group w-100"),z(e,"class","col-4 px-3 py-1 d-flex align-items-center")},m(ne,oe){Me(ne,e,oe),j(e,t),j(t,s),Kt(a,s,null),j(t,f),j(t,d),Kt(h,d,null),j(t,y),j(t,k),j(k,R),j(e,$),Q=!0,F||(U=[pn(s,"click",J),pn(d,"click",L),pn(k,"click",te)],F=!0)},p(ne,oe){o=ne,(!Q||oe&5&&l!==(l="btn btn-sm "+(o[18].name==o[0]?"btn-primary":"btn-outline-primary")))&&z(s,"class",l),(!Q||oe&5&&b!==(b="btn btn-sm "+("-"+o[18].name==o[0]?"btn-primary":"btn-outline-primary")))&&z(d,"class",b),(!Q||oe&4)&&E!==(E=o[18].label+"")&&Wn(R,E)},i(ne){Q||(ke(a.$$.fragment,ne),ke(h.$$.fragment,ne),Q=!0)},o(ne){Fe(a.$$.fragment,ne),Fe(h.$$.fragment,ne),Q=!1},d(ne){ne&&De(e),Jt(a),Jt(h),F=!1,$i(U)}}}function FCe(o){let e,t,s,a,l,f,d,h=o[1].label+"",b,y,k,E,R,$,Q,F,U;const J=[LCe,BCe],L=[];function te(pe,ce){return ce&1&&(s=null),s==null&&(s=!!pe[0].startsWith("-")),s?0:1}a=te(o,-1),l=L[a]=J[a](o);let ne=o[3],oe=[];for(let pe=0;peFe(oe[pe],1,1,()=>{oe[pe]=null});let ye=o[2],Se=[];for(let pe=0;peFe(Se[pe],1,1,()=>{Se[pe]=null});return{c(){e=re("div"),t=re("button"),l.c(),f=Ze(),d=re("span"),b=Xt(h),y=Ze(),k=re("div"),E=re("div");for(let pe=0;pe{L[Xe]=null}),po(),l=L[a],l||(l=L[a]=J[a](pe),l.c()),ke(l,1),l.m(t,f)),(!U||ce&2)&&h!==(h=pe[1].label+"")&&Wn(b,h),ce&59){ne=pe[3];let tt;for(tt=0;ttye.name).includes(oe.name)?"":"data.";return E(X+oe.name)}function $(ne,oe){ne.preventDefault();let X=k.map(ye=>ye.name).includes(oe.name)?"":"data.";return E("-"+X+oe.name)}const Q=(ne,oe)=>R(oe,ne),F=(ne,oe)=>$(oe,ne),U=(ne,oe)=>R(oe,ne),J=(ne,oe)=>R(oe,ne),L=(ne,oe)=>$(oe,ne),te=(ne,oe)=>R(oe,ne);return o.$$set=ne=>{"schema"in ne&&t(6,f=ne.schema),"sortParam"in ne&&t(0,d=ne.sortParam),"sortField"in ne&&t(1,h=ne.sortField),"inModal"in ne&&t(7,b=ne.inModal),"modalUrl"in ne&&t(8,y=ne.modalUrl),"systemFields"in ne&&t(9,k=ne.systemFields)},o.$$.update=()=>{o.$$.dirty&64&&t(3,s=f.fields.filter(ne=>!["reference","file","json","id","rich","markdown","block"].includes(ne.info.name))),o.$$.dirty&512&&t(2,a=k),o.$$.dirty&576&&f.type==="collection"&&t(2,a=k.filter(ne=>ne.files===!1))},[d,h,a,s,R,$,f,b,y,k,Q,F,U,J,L,te]}class ZCe extends yo{constructor(e){super(),Oo(this,e,QCe,FCe,vo,{schema:6,sortParam:0,sortField:1,inModal:7,modalUrl:8,systemFields:9})}}function HCe(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,y,k,E;return{c(){e=re("span"),t=re("div"),s=Xt(o[4]),a=Ze(),f=Xt(l),d=Ze(),h=Xt(o[2]),b=Ze(),y=re("button"),z(y,"type","button"),z(y,"class","btn-close btn-close ms-1"),z(y,"aria-label","Close"),z(t,"class","d-flex align-items-center justify-content-center"),z(e,"class","applied-filter d-inline-block border border-primary rounded lx-small-text me-1 px-2 py-1 svelte-6qi3g8"),ss(e,"line-height","22px ")},m(Q,F){Me(Q,e,F),j(e,t),j(t,s),j(t,a),j(t,f),j(t,d),j(t,h),j(t,b),j(t,y),k||(E=pn(y,"click",o[10]),k=!0)},p(Q,[F]){var U,J;F&1&&l!==(l=((J=(U=Q[0].find(Q[9]))==null?void 0:U.symbol)!=null?J:"")+"")&&Wn(f,l),F&4&&Wn(h,Q[2])},i:bn,o:bn,d(Q){Q&&De(e),k=!1,E()}}}function zCe(o,e,t){var J,L;const s=Hp();let{schema:a}=e,{operators:l}=e,{key:f}=e,{value:d}=e,{inModal:h}=e,{modalUrl:b}=e,y=f.split("_"),k=(J=y[y.length-1])!=null?J:"eq",E=f.replace("_"+k,""),R=a.fields.find(te=>te.name===E),$=(L=R==null?void 0:R.label)!=null?L:E;function Q(te,ne){te.preventDefault();let oe=`filter[${ne}]`;const X=new URL(b!=null?b:window.location.href);X.searchParams.set("skip","0"),X.searchParams.delete(oe),h?s("refresh",X):window.location=X}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 VCe extends yo{constructor(e){super(),Oo(this,e,zCe,HCe,vo,{schema:6,operators:0,key:1,value:2,inModal:7,modalUrl:8})}}function Mce(o,e,t){const s=o.slice();return s[20]=e[t][0],s[21]=e[t][1],s}function WCe(o){let e,t,s;return t=new ICe({props:{schema:o[0]}}),t.$on("uploadComplete",o[12]),{c(){e=re("div"),en(t.$$.fragment),z(e,"class","d-inline-block ms-1")},m(a,l){Me(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||(ke(t.$$.fragment,a),s=!0)},o(a){Fe(t.$$.fragment,a),s=!1},d(a){a&&De(e),Jt(t)}}}function UCe(o){let e,t=!o[5]&&o[7]&&Rce(o);return{c(){t&&t.c(),e=Bs()},m(s,a){t&&t.m(s,a),Me(s,e,a)},p(s,a){!s[5]&&s[7]?t?t.p(s,a):(t=Rce(s),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},i:bn,o:bn,d(s){t&&t.d(s),s&&De(e)}}}function Rce(o){let e,t,s;return{c(){e=re("a"),t=Xt("New Record"),z(e,"href",s=o[9].lucentUrl+"/records/new?schema="+o[0].name),z(e,"class","btn btn-sm btn-primary")},m(a,l){Me(a,e,l),j(e,t)},p(a,l){l&1&&s!==(s=a[9].lucentUrl+"/records/new?schema="+a[0].name)&&z(e,"href",s)},d(a){a&&De(e)}}}function $ce(o){let e,t,s,a,l,f;s=new Fa({props:{icon:"ellipsis-vertical"}});function d(y,k){return y[4].status_in==="trashed"?XCe:YCe}let h=d(o),b=h(o);return{c(){e=re("div"),t=re("button"),en(s.$$.fragment),a=Ze(),l=re("ul"),b.c(),z(t,"class","btn btn-link btn-sm"),z(t,"type","button"),z(t,"data-bs-toggle","dropdown"),z(t,"aria-expanded","false"),z(l,"class","dropdown-menu"),z(e,"class","dropdown d-inline-block")},m(y,k){Me(y,e,k),j(e,t),Kt(s,t,null),j(e,a),j(e,l),b.m(l,null),f=!0},p(y,k){h===(h=d(y))&&b?b.p(y,k):(b.d(1),b=h(y),b&&(b.c(),b.m(l,null)))},i(y){f||(ke(s.$$.fragment,y),f=!0)},o(y){Fe(s.$$.fragment,y),f=!1},d(y){y&&De(e),Jt(s),b.d()}}}function YCe(o){let e,t,s,a,l,f,d,h;return{c(){e=re("li"),t=re("a"),s=Xt("Export to CSV"),a=Ze(),l=re("li"),f=re("a"),d=Xt("View trashed records"),z(t,"class","dropdown-item"),z(t,"href",o[10]),z(f,"class","dropdown-item"),z(f,"href",h=o[9].lucentUrl+"/content/"+o[0].name+"?filter[status_in]=trashed")},m(b,y){Me(b,e,y),j(e,t),j(t,s),Me(b,a,y),Me(b,l,y),j(l,f),j(f,d)},p(b,y){y&1&&h!==(h=b[9].lucentUrl+"/content/"+b[0].name+"?filter[status_in]=trashed")&&z(f,"href",h)},d(b){b&&De(e),b&&De(a),b&&De(l)}}}function XCe(o){let e,t=o[7]&&Nce(o);return{c(){t&&t.c(),e=Bs()},m(s,a){t&&t.m(s,a),Me(s,e,a)},p(s,a){s[7]?t?t.p(s,a):(t=Nce(s),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(s){t&&t.d(s),s&&De(e)}}}function Nce(o){let e,t,s,a;return{c(){e=re("li"),t=re("a"),s=Xt("Empty trash"),z(t,"class","dropdown-item"),z(t,"href",a=o[9].lucentUrl+"/content/"+o[0].name+"/emptyTrash")},m(l,f){Me(l,e,f),j(e,t),j(t,s)},p(l,f){f&1&&a!==(a=l[9].lucentUrl+"/content/"+l[0].name+"/emptyTrash")&&z(t,"href",a)},d(l){l&&De(e)}}}function Ice(o){let e,t,s=Object.entries(o[4]),a=[];for(let f=0;fFe(a[f],1,1,()=>{a[f]=null});return{c(){e=re("div");for(let f=0;f0,F,U,J,L;s=new ZCe({props:{schema:o[0],sortParam:o[1],sortField:o[2],systemFields:o[8],inModal:o[5],modalUrl:o[6]}}),s.$on("refresh",o[14]);function te(pe){o[15](pe)}let ne={systemFields:o[8],operators:o[3],filter:o[4],inModal:o[5],modalUrl:o[6]};o[0]!==void 0&&(ne.schema=o[0]),l=new MCe({props:ne}),Vo.push(()=>cr(l,"schema",te)),l.$on("refresh",o[16]);const oe=[UCe,WCe],X=[];function ye(pe,ce){return pe[0].type==="collection"?0:1}k=ye(o),E=X[k]=oe[k](o);let Se=!o[5]&&$ce(o),Ne=Q&&Ice(o);return{c(){e=re("div"),t=re("div"),en(s.$$.fragment),a=Ze(),en(l.$$.fragment),d=Ze(),h=re("form"),h.innerHTML='',b=Ze(),y=re("div"),E.c(),R=Ze(),Se&&Se.c(),$=Ze(),Ne&&Ne.c(),F=Bs(),z(h,"method","GET"),z(t,"class","d-flex align-items-center"),z(y,"class","d-flex align-items-center "),z(e,"class","mb-3 d-flex align-items-center justify-content-between")},m(pe,ce){Me(pe,e,ce),j(e,t),Kt(s,t,null),j(t,a),Kt(l,t,null),j(t,d),j(t,h),j(e,b),j(e,y),X[k].m(y,null),j(y,R),Se&&Se.m(y,null),Me(pe,$,ce),Ne&&Ne.m(pe,ce),Me(pe,F,ce),U=!0,J||(L=pn(h,"submit",o[11]),J=!0)},p(pe,[ce]){const Xe={};ce&1&&(Xe.schema=pe[0]),ce&2&&(Xe.sortParam=pe[1]),ce&4&&(Xe.sortField=pe[2]),ce&256&&(Xe.systemFields=pe[8]),ce&32&&(Xe.inModal=pe[5]),ce&64&&(Xe.modalUrl=pe[6]),s.$set(Xe);const tt={};ce&256&&(tt.systemFields=pe[8]),ce&8&&(tt.operators=pe[3]),ce&16&&(tt.filter=pe[4]),ce&32&&(tt.inModal=pe[5]),ce&64&&(tt.modalUrl=pe[6]),!f&&ce&1&&(f=!0,tt.schema=pe[0],mr(()=>f=!1)),l.$set(tt);let yt=k;k=ye(pe),k===yt?X[k].p(pe,ce):(go(),Fe(X[yt],1,1,()=>{X[yt]=null}),po(),E=X[k],E?E.p(pe,ce):(E=X[k]=oe[k](pe),E.c()),ke(E,1),E.m(y,R)),pe[5]?Se&&(go(),Fe(Se,1,1,()=>{Se=null}),po()):Se?(Se.p(pe,ce),ce&32&&ke(Se,1)):(Se=$ce(pe),Se.c(),ke(Se,1),Se.m(y,null)),ce&16&&(Q=Object.entries(pe[4]).length>0),Q?Ne?(Ne.p(pe,ce),ce&16&&ke(Ne,1)):(Ne=Ice(pe),Ne.c(),ke(Ne,1),Ne.m(F.parentNode,F)):Ne&&(go(),Fe(Ne,1,1,()=>{Ne=null}),po())},i(pe){U||(ke(s.$$.fragment,pe),ke(l.$$.fragment,pe),ke(E),ke(Se),ke(Ne),U=!0)},o(pe){Fe(s.$$.fragment,pe),Fe(l.$$.fragment,pe),Fe(E),Fe(Se),Fe(Ne),U=!1},d(pe){pe&&De(e),Jt(s),Jt(l),X[k].d(),Se&&Se.d(),pe&&De($),Ne&&Ne.d(pe),pe&&De(F),J=!1,L()}}}function qCe(o,e,t){const s=si("channel"),a=Hp();let{sortParam:l}=e,{sortField:f}=e,{schema:d}=e,{operators:h}=e,{filter:b}=e,{inModal:y}=e,{modalUrl:k}=e,{isWritable:E}=e,{records:R}=e,{systemFields:$=[]}=e,Q=new URL(window.location.href),F=Q.pathname+"/csv?"+Q.searchParams.toString();function U(X){X.preventDefault();const ye=new FormData(X.target);let Se=ye.keys().next().value,Ne=ye.values().next().value;const pe=new URL(k!=null?k:window.location.href);pe.searchParams.set("skip","0"),pe.searchParams.set(Se,Ne),y?a("refresh",pe):window.location=pe}function J(X){t(13,R=X.detail)}function L(X){SH.call(this,o,X)}function te(X){d=X,t(0,d)}function ne(X){SH.call(this,o,X)}function oe(X){SH.call(this,o,X)}return o.$$set=X=>{"sortParam"in X&&t(1,l=X.sortParam),"sortField"in X&&t(2,f=X.sortField),"schema"in X&&t(0,d=X.schema),"operators"in X&&t(3,h=X.operators),"filter"in X&&t(4,b=X.filter),"inModal"in X&&t(5,y=X.inModal),"modalUrl"in X&&t(6,k=X.modalUrl),"isWritable"in X&&t(7,E=X.isWritable),"records"in X&&t(13,R=X.records),"systemFields"in X&&t(8,$=X.systemFields)},[d,l,f,h,b,y,k,E,$,s,F,U,J,R,L,te,ne,oe]}class GCe extends yo{constructor(e){super(),Oo(this,e,qCe,jCe,vo,{sortParam:1,sortField:2,schema:0,operators:3,filter:4,inModal:5,modalUrl:6,isWritable:7,records:13,systemFields:8})}}function Lce(o,e,t){const s=o.slice();return s[9]=e[t],s}function KCe(o){let e,t=o[9]+"",s,a,l,f;function d(...h){return o[7](o[9],...h)}return{c(){e=re("a"),s=Xt(t),z(e,"class","page-link"),z(e,"href",a=o[2](o[9]))},m(h,b){Me(h,e,b),j(e,s),l||(f=pn(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]))&&z(e,"href",a)},d(h){h&&De(e),l=!1,f()}}}function JCe(o){let e,t=o[9]+"",s;return{c(){e=re("span"),s=Xt(t),z(e,"class","page-link active")},m(a,l){Me(a,e,l),j(e,s)},p(a,l){l&1&&t!==(t=a[9]+"")&&Wn(s,t)},d(a){a&&De(e)}}}function Fce(o){let e,t;function s(f,d){return f[1]==f[9]?JCe:KCe}let a=s(o),l=a(o);return{c(){e=re("li"),l.c(),t=Ze(),z(e,"class","page-item")},m(f,d){Me(f,e,d),l.m(e,null),j(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&&De(e),l.d()}}}function eke(o){let e,t=o[0],s=[];for(let a=0;ay(R,E);return o.$$set=E=>{"pages"in E&&t(0,a=E.pages),"limit"in E&&t(4,l=E.limit),"currentPage"in E&&t(1,f=E.currentPage),"inModal"in E&&t(5,d=E.inModal),"modalUrl"in E&&t(6,h=E.modalUrl)},[a,f,b,y,l,d,h,k]}class nke extends yo{constructor(e){super(),Oo(this,e,tke,eke,vo,{pages:0,limit:4,currentPage:1,inModal:5,modalUrl:6})}}function Qce(o){let e,t,s,a,l,f,d,h,b,y;return a=new nke({props:{pages:o[7],currentPage:o[6],limit:o[2],inModal:o[0],modalUrl:o[1]}}),a.$on("refresh",o[10]),{c(){e=re("li"),t=re("a"),t.textContent="First",s=Ze(),en(a.$$.fragment),l=Ze(),f=re("li"),d=re("a"),d.textContent="Last",z(t,"href","/"),z(t,"class","page-link"),z(e,"class","page-item disabled"),is(e,"disabled",o[6]===1),z(d,"class","page-link"),z(d,"href","/"),is(d,"disabled",o[6]===o[5]),z(f,"class","page-item")},m(k,E){Me(k,e,E),j(e,t),Me(k,s,E),Kt(a,k,E),Me(k,l,E),Me(k,f,E),j(f,d),h=!0,b||(y=[pn(t,"click",o[9]),pn(d,"click",o[8])],b=!0)},p(k,E){(!h||E&64)&&is(e,"disabled",k[6]===1);const R={};E&128&&(R.pages=k[7]),E&64&&(R.currentPage=k[6]),E&4&&(R.limit=k[2]),E&1&&(R.inModal=k[0]),E&2&&(R.modalUrl=k[1]),a.$set(R),(!h||E&96)&&is(d,"disabled",k[6]===k[5])},i(k){h||(ke(a.$$.fragment,k),h=!0)},o(k){Fe(a.$$.fragment,k),h=!1},d(k){k&&De(e),k&&De(s),Jt(a,k),k&&De(l),k&&De(f),b=!1,$i(y)}}}function oke(o){let e,t,s,a,l,f,d=+o[3]+1+"",h,b,y,k=(+o[3]+o[2]>o[4]?o[4]:+o[3]+o[2])+"",E,R,$,Q,F,U,J=o[5]>1&&Qce(o);return{c(){e=re("nav"),t=re("ul"),J&&J.c(),s=Ze(),a=re("p"),l=Xt(`Showing - `),f=re("span"),h=Xt(d),b=Xt(` - to - `),y=re("span"),E=Xt(k),R=Xt(` - of - `),$=re("span"),Q=Xt(o[4]),F=Xt(` - total`),z(t,"class","pagination justify-content-center"),z(f,"class","font-medium"),z(y,"class","font-medium"),z($,"class","font-medium"),z(a,"class","text-muted text-center")},m(L,te){Me(L,e,te),j(e,t),J&&J.m(t,null),Me(L,s,te),Me(L,a,te),j(a,l),j(a,f),j(f,h),j(a,b),j(a,y),j(y,E),j(a,R),j(a,$),j($,Q),j(a,F),U=!0},p(L,[te]){L[5]>1?J?(J.p(L,te),te&32&&ke(J,1)):(J=Qce(L),J.c(),ke(J,1),J.m(t,null)):J&&(go(),Fe(J,1,1,()=>{J=null}),po()),(!U||te&8)&&d!==(d=+L[3]+1+"")&&Wn(h,d),(!U||te&28)&&k!==(k=(+L[3]+L[2]>L[4]?L[4]:+L[3]+L[2])+"")&&Wn(E,k),(!U||te&16)&&Wn(Q,L[4])},i(L){U||(ke(J),U=!0)},o(L){Fe(J),U=!1},d(L){L&&De(e),J&&J.d(),L&&De(s),L&&De(a)}}}function ske(o,e,t){let s,a,l;const f=Hp();let{inModal:d}=e,{modalUrl:h}=e,{limit:b}=e,{skip:y}=e,{total:k}=e;function E(F){F.preventDefault(),$(s)}function R(F){F.preventDefault(),$(1)}function $(F){const U=new URL(h!=null?h:window.location.href);let J=F*b-b;U.searchParams.set("skip",J),d?f("refresh",U):window.location=U}function Q(F){SH.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,y=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((y-1)/b)+1),o.$$.dirty&96&&t(7,l=Lc.exports.range(a-3,a+4).filter(F=>F>0&&F<=s))},[d,h,b,y,k,s,a,l,E,R,Q]}class rke extends yo{constructor(e){super(),Oo(this,e,ske,oke,vo,{inModal:0,modalUrl:1,limit:2,skip:3,total:4})}}function ike(o){let e,t,s;return{c(){e=re("button"),e.textContent="Move to trash",z(e,"type","button"),z(e,"class","btn btn-sm btn-outline-primary")},m(a,l){Me(a,e,l),t||(s=pn(e,"click",ju(o[9])),t=!0)},p:bn,d(a){a&&De(e),t=!1,s()}}}function ake(o){let e,t,s,a,l,f,d=o[1].hasDrafts&&Zce(o);return{c(){e=re("button"),e.textContent="Publish",t=Ze(),d&&d.c(),s=Ze(),a=re("button"),a.textContent="Delete forever",z(e,"type","button"),z(e,"class","btn btn-sm btn-outline-primary"),z(a,"type","button"),z(a,"class","btn btn-sm btn-outline-primary")},m(h,b){Me(h,e,b),Me(h,t,b),d&&d.m(h,b),Me(h,s,b),Me(h,a,b),l||(f=[pn(e,"click",ju(o[7])),pn(a,"click",ju(o[3]))],l=!0)},p(h,b){h[1].hasDrafts?d?d.p(h,b):(d=Zce(h),d.c(),d.m(s.parentNode,s)):d&&(d.d(1),d=null)},d(h){h&&De(e),h&&De(t),d&&d.d(h),h&&De(s),h&&De(a),l=!1,$i(f)}}}function Zce(o){let e,t,s;return{c(){e=re("button"),e.textContent="Make Draft",z(e,"type","button"),z(e,"class","btn btn-sm btn-outline-primary")},m(a,l){Me(a,e,l),t||(s=pn(e,"click",ju(o[8])),t=!0)},p:bn,d(a){a&&De(e),t=!1,s()}}}function lke(o){let e,t,s=o[0].length+"",a,l,f,d,h,b,y,k,E,R;function $(U,J){return U[2].status_in==="trashed"?ake:ike}let Q=$(o),F=Q(o);return{c(){e=re("div"),t=re("span"),a=Xt(s),l=Xt(" records selected"),f=Ze(),d=re("div"),h=re("button"),h.textContent="Publish",b=Ze(),y=re("button"),y.textContent="Make Draft",k=Ze(),F.c(),z(t,"class","me-2"),z(h,"type","button"),z(h,"class","btn btn-sm btn-outline-primary"),z(y,"type","button"),z(y,"class","btn btn-sm btn-outline-primary"),z(d,"class","btn-group "),z(d,"role","group"),z(d,"aria-label","Basic example"),z(e,"class","d-flex align-items-center mb-3")},m(U,J){Me(U,e,J),j(e,t),j(t,a),j(t,l),j(e,f),j(e,d),j(d,h),j(d,b),j(d,y),j(d,k),F.m(d,null),E||(R=[pn(h,"click",ju(o[5])),pn(y,"click",ju(o[6]))],E=!0)},p(U,[J]){J&1&&s!==(s=U[0].length+"")&&Wn(a,s),Q===(Q=$(U))&&F?F.p(U,J):(F.d(1),F=Q(U),F&&(F.c(),F.m(d,null)))},i:bn,o:bn,d(U){U&&De(e),F.d(),E=!1,$i(R)}}}function cke(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"),y=$=>h($,"draft"),k=$=>h($,"published"),E=$=>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,y,k,E,R]}class uke extends yo{constructor(e){super(),Oo(this,e,cke,lke,vo,{selected:0,schema:1,filter:2})}}function fke(o){let e;return{c(){e=Xt(o[0])},m(t,s){Me(t,e,s)},p(t,[s]){s&1&&Wn(e,t[0])},i:bn,o:bn,d(t){t&&De(e)}}}function dke(o,e,t){let{value:s}=e;return o.$$set=a=>{"value"in a&&t(0,s=a.value)},[s]}class hke extends yo{constructor(e){super(),Oo(this,e,dke,fke,vo,{value:0})}}function Hce(o){let e,t,s,a;return{c(){e=re("div"),t=re("span"),s=Ze(),a=Xt(o[0]),z(t,"class","color border border-2 svelte-78o2k4"),ss(t,"background",o[0]),z(e,"class","d-inline-flex")},m(l,f){Me(l,e,f),j(e,t),j(e,s),j(e,a)},p(l,f){f&1&&ss(t,"background",l[0]),f&1&&Wn(a,l[0])},d(l){l&&De(e)}}}function mke(o){let e,t=o[0]&&Hce(o);return{c(){t&&t.c(),e=Bs()},m(s,a){t&&t.m(s,a),Me(s,e,a)},p(s,[a]){s[0]?t?t.p(s,a):(t=Hce(s),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},i:bn,o:bn,d(s){t&&t.d(s),s&&De(e)}}}function gke(o,e,t){let{value:s}=e;return o.$$set=a=>{"value"in a&&t(0,s=a.value)},[s]}class pke extends yo{constructor(e){super(),Oo(this,e,gke,mke,vo,{value:0})}}function zce(o,e,t){const s=o.slice();return s[5]=e[t],s}function Vce(o){let e,t,s,a;return t=new G6({props:{schemas:o[0],graph:o[1],record:o[5]}}),{c(){e=re("span"),en(t.$$.fragment),s=Ze(),z(e,"class","mr-3")},m(l,f){Me(l,e,f),Kt(t,e,null),j(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||(ke(t.$$.fragment,l),a=!0)},o(l){Fe(t.$$.fragment,l),a=!1},d(l){l&&De(e),Jt(t)}}}function bke(o){let e,t,s=o[2],a=[];for(let f=0;fFe(a[f],1,1,()=>{a[f]=null});return{c(){e=re("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(y=>y.field===l.name&&y.source===a.id).map(y=>d.records.find(k=>k.id===y.target)).filter(y=>!!y))!=null?b:[])},[f,d,s,a,l]}class Vpe extends yo{constructor(e){super(),Oo(this,e,vke,bke,vo,{record:3,field:4,schemas:0,graph:1})}}function Oke(o){let e;return{c(){e=Xt(o[0])},m(t,s){Me(t,e,s)},p(t,[s]){s&1&&Wn(e,t[0])},i:bn,o:bn,d(t){t&&De(e)}}}function yke(o,e,t){let{value:s}=e;return o.$$set=a=>{"value"in a&&t(0,s=a.value)},[s]}class wke extends yo{constructor(e){super(),Oo(this,e,yke,Oke,vo,{value:0})}}function _ke(o){let e,t;return{c(){e=re("div"),t=Xt(o[0]),z(e,"title",o[0]),z(e,"data-bs-toggle","tooltip"),z(e,"data-bs-placement","top"),z(e,"class","svelte-1ft053t")},m(s,a){Me(s,e,a),j(e,t)},p(s,[a]){a&1&&Wn(t,s[0]),a&1&&z(e,"title",s[0])},i:bn,o:bn,d(s){s&&De(e)}}}function Ske(o,e,t){let{value:s}=e;return o.$$set=a=>{"value"in a&&t(0,s=a.value)},[s]}class mne extends yo{constructor(e){super(),Oo(this,e,Ske,_ke,vo,{value:0})}}function Cke(o){let e,t;return{c(){e=re("a"),t=Xt(o[0]),z(e,"href",o[0]),z(e,"target","_blank")},m(s,a){Me(s,e,a),j(e,t)},p(s,[a]){a&1&&Wn(t,s[0]),a&1&&z(e,"href",s[0])},i:bn,o:bn,d(s){s&&De(e)}}}function kke(o,e,t){let{value:s}=e;return o.$$set=a=>{"value"in a&&t(0,s=a.value)},[s]}class xke extends yo{constructor(e){super(),Oo(this,e,kke,Cke,vo,{value:0})}}function Tke(o){let e,t=Ble(o[0])+"",s,a;return{c(){e=re("div"),s=Xt(t),z(e,"title",a=Lle(o[0])),z(e,"data-bs-toggle","tooltip"),z(e,"data-bs-placement","top")},m(l,f){Me(l,e,f),j(e,s)},p(l,[f]){f&1&&t!==(t=Ble(l[0])+"")&&Wn(s,t),f&1&&a!==(a=Lle(l[0]))&&z(e,"title",a)},i:bn,o:bn,d(l){l&&De(e)}}}function Eke(o,e,t){let{value:s}=e;return o.$$set=a=>{"value"in a&&t(0,s=a.value)},[s]}class Wce extends yo{constructor(e){super(),Oo(this,e,Eke,Tke,vo,{value:0})}}function Uce(o,e,t){const s=o.slice();return s[4]=e[t],s}function Yce(o){let e,t,s,a;return t=new Xw({props:{record:o[4],size:"tiny"}}),{c(){e=re("div"),en(t.$$.fragment),s=Ze(),z(e,"class","me-1")},m(l,f){Me(l,e,f),Kt(t,e,null),j(e,s),a=!0},p:bn,i(l){a||(ke(t.$$.fragment,l),a=!0)},o(l){Fe(t.$$.fragment,l),a=!1},d(l){l&&De(e),Jt(t)}}}function Ake(o){let e,t,s=o[0],a=[];for(let f=0;fFe(a[f],1,1,()=>{a[f]=null});return{c(){e=re("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 Wpe extends yo{constructor(e){super(),Oo(this,e,Dke,Ake,vo,{record:1,field:2,graph:3})}}function Pke(o){let e,t;return{c(){e=re("span"),t=Xt(o[0]),z(e,"class","badge rounded-pill bg-primary bg-opacity-75"),ss(e,"max-width","64px"),ss(e,"overflow","hidden"),ss(e,"white-space","nowrap"),ss(e,"text-overflow","ellipsis"),z(e,"title",o[0]),z(e,"data-bs-toggle","tooltip")},m(s,a){Me(s,e,a),j(e,t)},p(s,[a]){a&1&&Wn(t,s[0]),a&1&&z(e,"title",s[0])},i:bn,o:bn,d(s){s&&De(e)}}}function Mke(o,e,t){let{value:s}=e;return o.$$set=a=>{"value"in a&&t(0,s=a.value)},[s]}class Rke extends yo{constructor(e){super(),Oo(this,e,Mke,Pke,vo,{value:0})}}function $ke(o){let e,t;return{c(){e=re("div"),t=Xt(o[0]),z(e,"class","svelte-1ft053t")},m(s,a){Me(s,e,a),j(e,t)},p(s,[a]){a&1&&Wn(t,s[0])},i:bn,o:bn,d(s){s&&De(e)}}}function Nke(o,e,t){let{value:s}=e;return o.$$set=a=>{"value"in a&&t(0,s=a.value)},[s]}class Ike extends yo{constructor(e){super(),Oo(this,e,Nke,$ke,vo,{value:0})}}function Bke(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=EC(a,l(o))),{c(){e&&en(e.$$.fragment),t=Bs()},m(f,d){e&&Kt(e,f,d),Me(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){go();const b=e;Fe(b.$$.fragment,1,0,()=>{Jt(b,1)}),po()}a?(e=EC(a,l(f)),en(e.$$.fragment),ke(e.$$.fragment,1),Kt(e,t.parentNode,t)):e=null}else a&&e.$set(h)},i(f){s||(e&&ke(e.$$.fragment,f),s=!0)},o(f){e&&Fe(e.$$.fragment,f),s=!1},d(f){f&&De(t),e&&Jt(e,f)}}}function Lke(o,e,t){const s={text:mne,slug:mne,rich:Ike,textarea:mne,color:pke,checkbox:hke,reference:Vpe,number:wke,url:xke,date:Wce,datetime:Wce,uuid:Rke,file:Wpe};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 Upe extends yo{constructor(e){super(),Oo(this,e,Lke,Bke,vo,{field:0,schema:1,record:2,graph:3})}}function Bp(o,e){var t,s;return o&&(s=(t=o.find(a=>a.id===e))==null?void 0:t.name)!=null?s:e}function Xce(o,e,t){const s=o.slice();return s[7]=e[t],s[9]=t,s}function jce(o){let e,t,s,a;return t=new Upe({props:{record:o[3],schema:o[0],graph:o[2],field:o[7]}}),{c(){e=re("td"),en(t.$$.fragment),z(e,"class",s="field-ui-"+o[7].info.name),is(e,"is-sort",o[7].name===o[5].name)},m(l,f){Me(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&64&&(d.field=l[7]),t.$set(d),(!a||f&64&&s!==(s="field-ui-"+l[7].info.name))&&z(e,"class",s),(!a||f&96)&&is(e,"is-sort",l[7].name===l[5].name)},i(l){a||(ke(t.$$.fragment,l),a=!0)},o(l){Fe(t.$$.fragment,l),a=!1},d(l){l&&De(e),Jt(t)}}}function qce(o){let e,t,s;return t=new nre({props:{status:o[3].status}}),{c(){e=re("td"),en(t.$$.fragment),z(e,"class","text-center"),is(e,"is-sort",o[4]=="-status"||o[4]=="status")},m(a,l){Me(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||(ke(t.$$.fragment,a),s=!0)},o(a){Fe(t.$$.fragment,a),s=!1},d(a){a&&De(e),Jt(t)}}}function Gce(o){let e,t,s;return t=new vy({props:{name:Bp(o[1],o[3]._sys.createdBy),side:24}}),{c(){e=re("td"),en(t.$$.fragment),z(e,"class","text-center"),is(e,"is-sort",o[4]=="-_sys.createdBy"||o[4]=="_sys.createdBy")},m(a,l){Me(a,e,l),Kt(t,e,null),s=!0},p(a,l){const f={};l&10&&(f.name=Bp(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||(ke(t.$$.fragment,a),s=!0)},o(a){Fe(t.$$.fragment,a),s=!1},d(a){a&&De(e),Jt(t)}}}function Kce(o){let e,t,s;return t=new vy({props:{name:Bp(o[1],o[3]._sys.updatedBy),side:24}}),{c(){e=re("td"),en(t.$$.fragment),z(e,"class","text-center"),is(e,"is-sort",o[4]=="-_sys.updatedBy"||o[4]=="_sys.updatedBy")},m(a,l){Me(a,e,l),Kt(t,e,null),s=!0},p(a,l){const f={};l&10&&(f.name=Bp(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||(ke(t.$$.fragment,a),s=!0)},o(a){Fe(t.$$.fragment,a),s=!1},d(a){a&&De(e),Jt(t)}}}function Jce(o){let e,t=cy(o[3]._sys.createdAt)+"",s;return{c(){e=re("td"),s=Xt(t),is(e,"is-sort",o[4]=="-_sys.createdAt"||o[4]=="_sys.createdAt")},m(a,l){Me(a,e,l),j(e,s)},p(a,l){l&8&&t!==(t=cy(a[3]._sys.createdAt)+"")&&Wn(s,t),l&16&&is(e,"is-sort",a[4]=="-_sys.createdAt"||a[4]=="_sys.createdAt")},d(a){a&&De(e)}}}function eue(o){let e,t=cy(o[3]._sys.updatedAt)+"",s;return{c(){e=re("td"),s=Xt(t),is(e,"is-sort",o[4]=="-_sys.updatedAt"||o[4]=="_sys.updatedAt")},m(a,l){Me(a,e,l),j(e,s)},p(a,l){l&8&&t!==(t=cy(a[3]._sys.updatedAt)+"")&&Wn(s,t),l&16&&is(e,"is-sort",a[4]=="-_sys.updatedAt"||a[4]=="_sys.updatedAt")},d(a){a&&De(e)}}}function Fke(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,y=o[0].visible.includes("_sys.updatedAt"),k,E,R=o[6],$=[];for(let ne=0;neFe($[ne],1,1,()=>{$[ne]=null});let F=t&&qce(o),U=a&&Gce(o),J=f&&Kce(o),L=h&&Jce(o),te=y&&eue(o);return{c(){for(let ne=0;ne<$.length;ne+=1)$[ne].c();e=Ze(),F&&F.c(),s=Ze(),U&&U.c(),l=Ze(),J&&J.c(),d=Ze(),L&&L.c(),b=Ze(),te&&te.c(),k=Bs()},m(ne,oe){for(let X=0;X<$.length;X+=1)$[X]&&$[X].m(ne,oe);Me(ne,e,oe),F&&F.m(ne,oe),Me(ne,s,oe),U&&U.m(ne,oe),Me(ne,l,oe),J&&J.m(ne,oe),Me(ne,d,oe),L&&L.m(ne,oe),Me(ne,b,oe),te&&te.m(ne,oe),Me(ne,k,oe),E=!0},p(ne,[oe]){if(oe&109){R=ne[6];let X;for(X=0;X{F=null}),po()),oe&1&&(a=ne[0].visible.includes("_sys.createdBy")),a?U?(U.p(ne,oe),oe&1&&ke(U,1)):(U=Gce(ne),U.c(),ke(U,1),U.m(l.parentNode,l)):U&&(go(),Fe(U,1,1,()=>{U=null}),po()),oe&1&&(f=ne[0].visible.includes("_sys.updatedBy")),f?J?(J.p(ne,oe),oe&1&&ke(J,1)):(J=Kce(ne),J.c(),ke(J,1),J.m(d.parentNode,d)):J&&(go(),Fe(J,1,1,()=>{J=null}),po()),oe&1&&(h=ne[0].visible.includes("_sys.createdAt")),h?L?L.p(ne,oe):(L=Jce(ne),L.c(),L.m(b.parentNode,b)):L&&(L.d(1),L=null),oe&1&&(y=ne[0].visible.includes("_sys.updatedAt")),y?te?te.p(ne,oe):(te=eue(ne),te.c(),te.m(k.parentNode,k)):te&&(te.d(1),te=null)},i(ne){if(!E){for(let oe=0;oe{"schema"in y&&t(0,s=y.schema),"users"in y&&t(1,a=y.users),"graph"in y&&t(2,l=y.graph),"record"in y&&t(3,f=y.record),"sortParam"in y&&t(4,d=y.sortParam),"sortField"in y&&t(5,h=y.sortField),"visibleColumns"in y&&t(6,b=y.visibleColumns)},[s,a,l,f,d,h,b]}class Zke extends yo{constructor(e){super(),Oo(this,e,Qke,Fke,vo,{schema:0,users:1,graph:2,record:3,sortParam:4,sortField:5,visibleColumns:6})}}function tue(o,e,t){const s=o.slice();return s[17]=e[t],s}function nue(o,e,t){const s=o.slice();return s[20]=e[t],s}function oue(o,e,t){const s=o.slice();return s[23]=e[t],s}function sue(o){let e,t,s,a,l,f;return{c(){e=re("th"),t=re("input"),t.indeterminate=s=o[0].length>0&&o[0].length0&&d[0].lengthL[17].id;for(let L=0;L0}function F(te,ne){$.find(X=>X.id==ne.id)?t(0,$=$.filter(X=>X.id!==ne.id)):t(0,$=[...$,ne])}const U=te=>l.visible.includes(te.name),J=(te,ne)=>ne.id===te.id,L=(te,ne)=>F(ne,te);return o.$$set=te=>{"schema"in te&&t(1,l=te.schema),"users"in te&&t(2,f=te.users),"records"in te&&t(3,d=te.records),"graph"in te&&t(4,h=te.graph),"systemFields"in te&&t(5,b=te.systemFields),"sortParam"in te&&t(6,y=te.sortParam),"sortField"in te&&t(7,k=te.sortField),"inModal"in te&&t(8,E=te.inModal),"isWritable"in te&&t(9,R=te.isWritable),"selected"in te&&t(0,$=te.selected)},o.$$.update=()=>{o.$$.dirty&2&&t(10,s=l.fields.filter(te=>l.visible.includes(te.name)))},[$,l,f,d,h,b,y,k,E,R,s,a,Q,F,U,J,L]}class Vke extends yo{constructor(e){super(),Oo(this,e,zke,Hke,vo,{schema:1,users:2,records:3,graph:4,systemFields:5,sortParam:6,sortField:7,inModal:8,isWritable:9,selected:0})}}function cue(o,e,t){const s=o.slice();return s[24]=e[t],s}function Wke(o){let e,t,s,a;function l(h){o[19](h)}function f(h){o[20](h)}let d={systemFields:o[13],sortParam:o[2],sortField:o[3],operators:o[4],filter:o[5],inModal:o[14],modalUrl:o[9],isWritable:o[15]};return o[0]!==void 0&&(d.schema=o[0]),o[1]!==void 0&&(d.records=o[1]),e=new GCe({props:d}),Vo.push(()=>cr(e,"schema",l)),Vo.push(()=>cr(e,"records",f)),e.$on("refresh",o[18]),{c(){en(e.$$.fragment)},m(h,b){Kt(e,h,b),a=!0},p(h,b){const y={};b&8192&&(y.systemFields=h[13]),b&4&&(y.sortParam=h[2]),b&8&&(y.sortField=h[3]),b&16&&(y.operators=h[4]),b&32&&(y.filter=h[5]),b&16384&&(y.inModal=h[14]),b&512&&(y.modalUrl=h[9]),b&32768&&(y.isWritable=h[15]),!t&&b&1&&(t=!0,y.schema=h[0],mr(()=>t=!1)),!s&&b&2&&(s=!0,y.records=h[1],mr(()=>s=!1)),e.$set(y)},i(h){a||(ke(e.$$.fragment,h),a=!0)},o(h){Fe(e.$$.fragment,h),a=!1},d(h){Jt(e,h)}}}function Uke(o){let e,t;return e=new uke({props:{schema:o[0],selected:o[10],inModal:o[14],filter:o[5]}}),{c(){en(e.$$.fragment)},m(s,a){Kt(e,s,a),t=!0},p(s,a){const l={};a&1&&(l.schema=s[0]),a&1024&&(l.selected=s[10]),a&16384&&(l.inModal=s[14]),a&32&&(l.filter=s[5]),e.$set(l)},i(s){t||(ke(e.$$.fragment,s),t=!0)},o(s){Fe(e.$$.fragment,s),t=!1},d(s){Jt(e,s)}}}function Yke(o){let e,t=[],s=new Map,a,l=o[1];const f=d=>d[24].id;for(let d=0;dcr(e,"selected",a)),{c(){en(e.$$.fragment)},m(f,d){Kt(e,f,d),s=!0},p(f,d){const h={};d&2&&(h.records=f[1]),d&4096&&(h.graph=f[12]),d&1&&(h.schema=f[0]),d&4&&(h.sortParam=f[2]),d&8&&(h.sortField=f[3]),d&8192&&(h.systemFields=f[13]),d&16384&&(h.inModal=f[14]),d&2048&&(h.users=f[11]),d&32768&&(h.isWritable=f[15]),!t&&d&1024&&(t=!0,h.selected=f[10],mr(()=>t=!1)),e.$set(h)},i(f){s||(ke(e.$$.fragment,f),s=!0)},o(f){Fe(e.$$.fragment,f),s=!1},d(f){Jt(e,f)}}}function uue(o){let e,t,s,a,l,f;function d(...b){return o[22](o[24],...b)}function h(...b){return o[23](o[24],...b)}return{c(){e=re("div"),t=re("input"),z(t,"class","form-check-input "),z(t,"type","checkbox"),t.checked=s=o[10].find(d),t.value=a=o[24],z(e,"class","form-check svelte-1xyvs2b")},m(b,y){Me(b,e,y),j(e,t),l||(f=pn(t,"change",h),l=!0)},p(b,y){o=b,y&1026&&s!==(s=o[10].find(d))&&(t.checked=s),y&2&&a!==(a=o[24])&&(t.value=a)},d(b){b&&De(e),l=!1,f()}}}function fue(o,e){let t,s,a,l,f,d,h,b=e[24]._file.path+"",y,k,E,R,$,Q=e[24]._file.mime+"",F,U,J,L=e[15]&&uue(e);return f=new Xw({props:{record:e[24],size:"medium"}}),{key:o,first:null,c(){t=re("div"),s=re("div"),L&&L.c(),a=Ze(),l=re("div"),en(f.$$.fragment),d=Ze(),h=re("a"),y=Xt(b),R=Ze(),$=re("span"),F=Xt(Q),U=Ze(),z(l,"class","d-flex justify-content-center"),z(h,"href",k=e[16].lucentUrl+"/records/"+e[24].id),z(h,"title",E=e[24]._file.path),z(h,"class","d-block text-center overflow-hidden text-nowrap my-2 "),ss(h,"text-overflow","ellipsis"),ss(h,"font-size","13px"),ss(h,"color","#333"),z($,"class","lx-small-text text-muted d-block text-center"),z(s,"class","file-wrapper rounded p-2 mb-4 bg-light"),is(s,"selected",e[10].includes(e[24])),z(t,"class","col-6 col-md-4"),this.first=t},m(te,ne){Me(te,t,ne),j(t,s),L&&L.m(s,null),j(s,a),j(s,l),Kt(f,l,null),j(s,d),j(s,h),j(h,y),j(s,R),j(s,$),j($,F),j(t,U),J=!0},p(te,ne){e=te,e[15]?L?L.p(e,ne):(L=uue(e),L.c(),L.m(s,a)):L&&(L.d(1),L=null);const oe={};ne&2&&(oe.record=e[24]),f.$set(oe),(!J||ne&2)&&b!==(b=e[24]._file.path+"")&&Wn(y,b),(!J||ne&2&&k!==(k=e[16].lucentUrl+"/records/"+e[24].id))&&z(h,"href",k),(!J||ne&2&&E!==(E=e[24]._file.path))&&z(h,"title",E),(!J||ne&2)&&Q!==(Q=e[24]._file.mime+"")&&Wn(F,Q),(!J||ne&1026)&&is(s,"selected",e[10].includes(e[24]))},i(te){J||(ke(f.$$.fragment,te),J=!0)},o(te){Fe(f.$$.fragment,te),J=!1},d(te){te&&De(t),L&&L.d(),Jt(f)}}}function jke(o){let e,t,s,a=o[0].label+"",l,f,d,h,b,y,k,E,R,$,Q;const F=[Uke,Wke],U=[];function J(oe,X){return oe[10].length>0&&!oe[14]&&oe[15]?0:1}d=J(o),h=U[d]=F[d](o);const L=[Xke,Yke],te=[];function ne(oe,X){return oe[0].type==="collection"?0:1}return y=ne(o),k=te[y]=L[y](o),$=new rke({props:{limit:o[6],skip:o[7],total:o[8],inModal:o[14],modalUrl:o[9]}}),$.$on("refresh",o[18]),{c(){e=re("div"),t=re("div"),s=re("h3"),l=Xt(a),f=Ze(),h.c(),b=Ze(),k.c(),R=Ze(),en($.$$.fragment),z(s,"class","header-normal mb-5 "),z(t,"class",E="lx-card mb-4 "+(o[14]?"mt-0":"mt-5")),z(e,"class","wrapper-large transparent ")},m(oe,X){Me(oe,e,X),j(e,t),j(t,s),j(s,l),j(t,f),U[d].m(t,null),j(t,b),te[y].m(t,null),j(e,R),Kt($,e,null),Q=!0},p(oe,[X]){(!Q||X&1)&&a!==(a=oe[0].label+"")&&Wn(l,a);let ye=d;d=J(oe),d===ye?U[d].p(oe,X):(go(),Fe(U[ye],1,1,()=>{U[ye]=null}),po(),h=U[d],h?h.p(oe,X):(h=U[d]=F[d](oe),h.c()),ke(h,1),h.m(t,b));let Se=y;y=ne(oe),y===Se?te[y].p(oe,X):(go(),Fe(te[Se],1,1,()=>{te[Se]=null}),po(),k=te[y],k?k.p(oe,X):(k=te[y]=L[y](oe),k.c()),ke(k,1),k.m(t,null)),(!Q||X&16384&&E!==(E="lx-card mb-4 "+(oe[14]?"mt-0":"mt-5")))&&z(t,"class",E);const Ne={};X&64&&(Ne.limit=oe[6]),X&128&&(Ne.skip=oe[7]),X&256&&(Ne.total=oe[8]),X&16384&&(Ne.inModal=oe[14]),X&512&&(Ne.modalUrl=oe[9]),$.$set(Ne)},i(oe){Q||(ke(h),ke(k),ke($.$$.fragment,oe),Q=!0)},o(oe){Fe(h),Fe(k),Fe($.$$.fragment,oe),Q=!1},d(oe){oe&&De(e),U[d].d(),te[y].d(),Jt($)}}}function qke(o,e,t){const s=si("channel");let{schema:a}=e,{users:l}=e,{records:f}=e,{graph:d}=e,{systemFields:h}=e,{sortParam:b}=e,{sortField:y}=e,{operators:k}=e,{filter:E}=e,{limit:R}=e,{skip:$}=e,{total:Q}=e,{inModal:F}=e,{modalUrl:U}=e,{selected:J=[]}=e,{isWritable:L=!1}=e;function te(pe,ce){J.find(tt=>tt.id===ce.id)?t(10,J=J.filter(tt=>tt.id!==ce.id)):t(10,J=[...J,ce])}function ne(pe){const ce=pe.detail;axios.get(ce).then(Xe=>{t(1,f=Xe.data.records),t(2,b=Xe.data.sortParam),t(3,y=Xe.data.sortField),t(4,k=Xe.data.operators),t(5,E=Xe.data.filter),t(7,$=Xe.data.skip),t(6,R=Xe.data.limit),t(8,Q=Xe.data.total),t(9,U=Xe.data.modalUrl)}).catch(Xe=>{console.log(Xe)})}function oe(pe){a=pe,t(0,a)}function X(pe){f=pe,t(1,f)}function ye(pe){J=pe,t(10,J)}const Se=(pe,ce)=>ce.id===pe.id,Ne=(pe,ce)=>te(ce,pe);return o.$$set=pe=>{"schema"in pe&&t(0,a=pe.schema),"users"in pe&&t(11,l=pe.users),"records"in pe&&t(1,f=pe.records),"graph"in pe&&t(12,d=pe.graph),"systemFields"in pe&&t(13,h=pe.systemFields),"sortParam"in pe&&t(2,b=pe.sortParam),"sortField"in pe&&t(3,y=pe.sortField),"operators"in pe&&t(4,k=pe.operators),"filter"in pe&&t(5,E=pe.filter),"limit"in pe&&t(6,R=pe.limit),"skip"in pe&&t(7,$=pe.skip),"total"in pe&&t(8,Q=pe.total),"inModal"in pe&&t(14,F=pe.inModal),"modalUrl"in pe&&t(9,U=pe.modalUrl),"selected"in pe&&t(10,J=pe.selected),"isWritable"in pe&&t(15,L=pe.isWritable)},[a,f,b,y,k,E,R,$,Q,U,J,l,d,h,F,L,s,te,ne,oe,X,ye,Se,Ne]}class Ype extends yo{constructor(e){super(),Oo(this,e,qke,jke,vo,{schema:0,users:11,records:1,graph:12,systemFields:13,sortParam:2,sortField:3,operators:4,filter:5,limit:6,skip:7,total:8,inModal:14,modalUrl:9,selected:10,isWritable:15})}}function due(o){let e,t,s,a,l,f,d,h,b,y,k,E,R,$,Q,F,U,J,L,te,ne,oe,X=o[1].length>0&&hue(o);const ye=[o[2]];function Se(pe){o[8](pe)}let Ne={};for(let pe=0;pecr(J,"selected",Se)),{c(){e=re("div"),t=re("div"),s=re("div"),a=re("div"),l=re("div"),f=re("button"),d=Xt("Insert"),b=Ze(),y=re("button"),k=Xt("Replace"),R=Ze(),X&&X.c(),$=Ze(),Q=re("button"),F=Ze(),U=re("div"),en(J.$$.fragment),z(f,"type","button"),z(f,"class","btn btn-primary me-1"),f.disabled=h=o[1].length===0,z(y,"type","button"),z(y,"class","btn btn-outline-primary me-3"),y.disabled=E=o[1].length===0,z(l,"class","d-flex align-items-center"),z(Q,"type","button"),z(Q,"class","btn-close"),z(Q,"data-bs-dismiss","modal"),z(Q,"aria-label","Close"),z(a,"class","modal-header"),z(U,"class","modal-body"),z(s,"class","modal-content svelte-1mf5922"),z(t,"class","modal-dialog modal-dialog-centered modal-dialog-scrollable svelte-1mf5922"),z(e,"class","modal fade show"),z(e,"tabindex","-1"),z(e,"aria-modal","true"),z(e,"role","dialog"),ss(e,"background","rgba(100,100,100,.6)"),is(e,"d-block",o[0])},m(pe,ce){Me(pe,e,ce),j(e,t),j(t,s),j(s,a),j(a,l),j(l,f),j(f,d),j(l,b),j(l,y),j(y,k),j(l,R),X&&X.m(l,null),j(a,$),j(a,Q),j(s,F),j(s,U),Kt(J,U,null),te=!0,ne||(oe=[pn(f,"click",o[3]),pn(y,"click",o[4]),pn(Q,"click",ju(o[7]))],ne=!0)},p(pe,ce){(!te||ce&2&&h!==(h=pe[1].length===0))&&(f.disabled=h),(!te||ce&2&&E!==(E=pe[1].length===0))&&(y.disabled=E),pe[1].length>0?X?X.p(pe,ce):(X=hue(pe),X.c(),X.m(l,null)):X&&(X.d(1),X=null);const Xe=ce&4?Yz(ye,[Xz(pe[2])]):{};!L&&ce&2&&(L=!0,Xe.selected=pe[1],mr(()=>L=!1)),J.$set(Xe),(!te||ce&1)&&is(e,"d-block",pe[0])},i(pe){te||(ke(J.$$.fragment,pe),te=!0)},o(pe){Fe(J.$$.fragment,pe),te=!1},d(pe){pe&&De(e),X&&X.d(),Jt(J),ne=!1,$i(oe)}}}function hue(o){let e,t=o[1].length+"",s,a;return{c(){e=re("span"),s=Xt(t),a=Xt(" records selected"),z(e,"class","")},m(l,f){Me(l,e,f),j(e,s),j(e,a)},p(l,f){f&2&&t!==(t=l[1].length+"")&&Wn(s,t)},d(l){l&&De(e)}}}function Gke(o){let e,t,s=o[2].schema&&due(o);return{c(){s&&s.c(),e=Bs()},m(a,l){s&&s.m(a,l),Me(a,e,l),t=!0},p(a,[l]){a[2].schema?s?(s.p(a,l),l&4&&ke(s,1)):(s=due(a),s.c(),ke(s,1),s.m(e.parentNode,e)):s&&(go(),Fe(s,1,1,()=>{s=null}),po())},i(a){t||(ke(s),t=!0)},o(a){Fe(s),t=!1},d(a){s&&s.d(a),a&&De(e)}}}function Kke(o,e,t){let s;const a=Hp(),l=si("channel");let f=!1,d=[];function h(Q){t(0,f=!0),y(Q)}function b(){t(0,f=!1),t(1,d=[])}function y(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 E(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,E,h,b,R,$]}class ore extends yo{constructor(e){super(),Oo(this,e,Kke,Gke,vo,{open:5,close:6})}get open(){return this.$$.ctx[5]}get close(){return this.$$.ctx[6]}}function mue(o,e,t){const s=o.slice();return s[18]=e[t],s}function Jke(o){let e,t,s,a,l,f,d,h,b;return f=new Fa({props:{icon:"magnifying-glass"}}),{c(){e=re("div"),t=re("div"),s=re("button"),s.textContent="New",a=Ze(),l=re("button"),en(f.$$.fragment),z(s,"class","btn btn-sm btn-primary"),z(l,"class","btn btn-sm btn-outline-primary"),z(t,"class","mb-2"),z(e,"class","pb-2 text-start")},m(y,k){Me(y,e,k),j(e,t),j(t,s),j(t,a),j(t,l),Kt(f,l,null),d=!0,h||(b=[pn(s,"click",o[12]),pn(l,"click",o[13])],h=!0)},p:bn,i(y){d||(ke(f.$$.fragment,y),d=!0)},o(y){Fe(f.$$.fragment,y),d=!1},d(y){y&&De(e),Jt(f),h=!1,$i(b)}}}function exe(o){let e,t,s,a,l,f,d;t=new Fa({props:{width:24,height:24,icon:"circle-plus"}});let h=o[4]&&gue(o);return{c(){e=re("button"),en(t.$$.fragment),s=Ze(),h&&h.c(),a=Bs(),z(e,"type","button"),z(e,"class","btn btn-lg btn-link text-decoration-none inline-card-button svelte-1lp73xk"),is(e,"is-first",!o[1])},m(b,y){Me(b,e,y),Kt(t,e,null),Me(b,s,y),h&&h.m(b,y),Me(b,a,y),l=!0,f||(d=pn(e,"click",ju(o[9])),f=!0)},p(b,y){(!l||y&2)&&is(e,"is-first",!b[1]),b[4]?h?(h.p(b,y),y&16&&ke(h,1)):(h=gue(b),h.c(),ke(h,1),h.m(a.parentNode,a)):h&&(go(),Fe(h,1,1,()=>{h=null}),po())},i(b){l||(ke(t.$$.fragment,b),ke(h),l=!0)},o(b){Fe(t.$$.fragment,b),Fe(h),l=!1},d(b){b&&De(e),Jt(t),b&&De(s),h&&h.d(b),b&&De(a),f=!1,d()}}}function gue(o){let e,t,s=o[0],a=[];for(let f=0;fFe(a[f],1,1,()=>{a[f]=null});return{c(){e=re("div");for(let f=0;f1?0:1}e=b(o),t=h[e]=d[e](o);let y=o[3]&&bue(o),k={};return l=new ore({props:k}),o[15](l),l.$on("insert",o[7]),{c(){t.c(),s=Ze(),y&&y.c(),a=Ze(),en(l.$$.fragment)},m(E,R){h[e].m(E,R),Me(E,s,R),y&&y.m(E,R),Me(E,a,R),Kt(l,E,R),f=!0},p(E,[R]){let $=e;e=b(E),e===$?h[e].p(E,R):(go(),Fe(h[$],1,1,()=>{h[$]=null}),po(),t=h[e],t?t.p(E,R):(t=h[e]=d[e](E),t.c()),ke(t,1),t.m(s.parentNode,s)),E[3]?y?(y.p(E,R),R&8&&ke(y,1)):(y=bue(E),y.c(),ke(y,1),y.m(a.parentNode,a)):y&&(go(),Fe(y,1,1,()=>{y=null}),po());const Q={};l.$set(Q)},i(E){f||(ke(t),ke(y),ke(l.$$.fragment,E),f=!0)},o(E){Fe(t),Fe(y),Fe(l.$$.fragment,E),f=!1},d(E){h[e].d(E),E&&De(s),y&&y.d(E),E&&De(a),o[15](null),Jt(l,E)}}}function nxe(o,e,t){let s;const a=Hp(),l=si("channel");let{schemas:f}=e,{recordId:d}=e,h,b;function y(ne,oe){ne.preventDefault(),h.open(oe)}function k(ne){ne.preventDefault(),console.log("Save inline"),t(3,b=null),a("save",{records:ne.detail.records,after:d})}function E(ne){ne.preventDefault(),h.close(),t(4,s=!1),a("insert",{records:ne.detail.records,after:d})}function R(ne,oe){ne.preventDefault(),axios.get(l.lucentUrl+"/records/newInline?schema="+oe).then(X=>{t(3,b=X.data),t(4,s=!1)}).catch(X=>{console.log(X)})}const $=ne=>t(4,s=!s),Q=(ne,oe)=>R(oe,ne.name),F=(ne,oe)=>y(oe,ne.name),U=ne=>R(ne,f[0].name),J=ne=>y(ne,f[0].name),L=ne=>t(3,b=null);function te(ne){Vo[ne?"unshift":"push"](()=>{h=ne,t(2,h)})}return o.$$set=ne=>{"schemas"in ne&&t(0,f=ne.schemas),"recordId"in ne&&t(1,d=ne.recordId)},t(4,s=!1),[f,d,h,b,s,y,k,E,R,$,Q,F,U,J,L,te]}class eI extends yo{constructor(e){super(),Oo(this,e,nxe,txe,vo,{schemas:0,recordId:1})}}/**! - * Sortable 1.15.0 - * @author RubaXa - * @author owenm - * @license MIT - */function vue(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 Oy(o){for(var e=1;e=0)&&(t[a]=o[a]);return t}function rxe(o,e){if(o==null)return{};var t=sxe(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 ixe="1.15.0";function Fw(o){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(o)}var jw=Fw(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),tI=Fw(/Edge/i),Oue=Fw(/firefox/i),r6=Fw(/safari/i)&&!Fw(/chrome/i)&&!Fw(/android/i),Xpe=Fw(/iP(ad|od|hone)/i),jpe=Fw(/chrome/i)&&Fw(/android/i),qpe={capture:!1,passive:!1};function hl(o,e,t){o.addEventListener(e,t,!jw&&qpe)}function La(o,e,t){o.removeEventListener(e,t,!jw&&qpe)}function tz(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 axe(o){return o.host&&o!==document&&o.host.nodeType?o.host:o.parentNode}function iy(o,e,t,s){if(o){t=t||document;do{if(e!=null&&(e[0]===">"?o.parentNode===t&&tz(o,e):tz(o,e))||s&&o===t)return o;if(o===t)break}while(o=axe(o))}return null}var yue=/\s+/g;function $1(o,e,t){if(o&&e)if(o.classList)o.classList[t?"add":"remove"](e);else{var s=(" "+o.className+" ").replace(yue," ").replace(" "+e+" "," ");o.className=(s+(t?" "+e:"")).replace(yue," ")}}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 vD(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 Gpe(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===hy())break;s=_C(s,!1)}return!1}function DD(o,e,t,s){for(var a=0,l=0,f=o.children;l2&&arguments[2]!==void 0?arguments[2]:{},a=s.evt,l=rxe(s,gxe);nI.pluginEvent.bind(Wr)(e,t,Oy({dragEl:Ho,parentEl:Xu,ghostEl:Ei,rootEl:eu,nextEl:tE,lastDownEl:TH,cloneEl:Su,cloneHidden:yC,dragStarted:XN,putSortable:zh,activeSortable:Wr.active,originalEvent:a,oldIndex:dD,oldDraggableIndex:a6,newIndex:I1,newDraggableIndex:bC,hideGhostForTarget:s1e,unhideGhostForTarget:r1e,cloneNowHidden:function(){yC=!0},cloneNowShown:function(){yC=!1},dispatchSortableEvent:function(d){Rg({sortable:t,name:d,originalEvent:a})}},l))};function Rg(o){mxe(Oy({putSortable:zh,cloneEl:Su,targetEl:Ho,rootEl:eu,oldIndex:dD,oldDraggableIndex:a6,newIndex:I1,newDraggableIndex:bC},o))}var Ho,Xu,Ei,eu,tE,TH,Su,yC,dD,I1,a6,bC,IZ,zh,iD=!1,nz=!1,oz=[],qT,wv,bne,vne,Sue,Cue,XN,tD,l6,c6=!1,BZ=!1,EH,Rm,One=[],Roe=!1,sz=[],Gz=typeof document<"u",LZ=Xpe,kue=tI||jw?"cssFloat":"float",pxe=Gz&&!jpe&&!Xpe&&"draggable"in document.createElement("div"),t1e=function(){if(!!Gz){if(jw)return!1;var o=document.createElement("x");return o.style.cssText="pointer-events:auto",o.style.pointerEvents==="auto"}}(),n1e=function(e,t){var s=Vr(e),a=parseInt(s.width)-parseInt(s.paddingLeft)-parseInt(s.paddingRight)-parseInt(s.borderLeftWidth)-parseInt(s.borderRightWidth),l=DD(e,0,t),f=DD(e,1,t),d=l&&Vr(l),h=f&&Vr(f),b=d&&parseInt(d.marginLeft)+parseInt(d.marginRight)+Od(l).width,y=h&&parseInt(h.marginLeft)+parseInt(h.marginRight)+Od(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[kue]==="none"||f&&s[kue]==="none"&&b+y>a)?"vertical":"horizontal"},bxe=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},vxe=function(e,t){var s;return oz.some(function(a){var l=a[F1].options.emptyInsertThreshold;if(!(!l||sre(a))){var f=Od(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},o1e=function(e){function t(l,f){return function(d,h,b,y){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,y),f)(d,h,b,y);var E=(f?d:h).options.group.name;return l===!0||typeof l=="string"&&l===E||l.join&&l.indexOf(E)>-1}}var s={},a=e.group;(!a||xH(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},s1e=function(){!t1e&&Ei&&Vr(Ei,"display","none")},r1e=function(){!t1e&&Ei&&Vr(Ei,"display","")};Gz&&!jpe&&document.addEventListener("click",function(o){if(nz)return o.preventDefault(),o.stopPropagation&&o.stopPropagation(),o.stopImmediatePropagation&&o.stopImmediatePropagation(),nz=!1,!1},!0);var GT=function(e){if(Ho){e=e.touches?e.touches[0]:e;var t=vxe(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[F1]._onDragOver(s)}}},Oxe=function(e){Ho&&Ho.parentNode[F1]._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[F1]=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 n1e(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&&!r6,emptyInsertThreshold:5};nI.initializePlugins(this,o,t);for(var s in t)!(s in e)&&(e[s]=t[s]);o1e(e);for(var a in this)a.charAt(0)==="_"&&typeof this[a]=="function"&&(this[a]=this[a].bind(this));this.nativeDraggable=e.forceFallback?!1:pxe,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?hl(o,"pointerdown",this._onTapStart):(hl(o,"mousedown",this._onTapStart),hl(o,"touchstart",this._onTapStart)),this.nativeDraggable&&(hl(o,"dragover",this),hl(o,"dragenter",this)),oz.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),zw(this,fxe())}Wr.prototype={constructor:Wr,_isOutsideThisEl:function(e){!this.el.contains(e)&&e!==this.el&&(tD=null)},_getDirection:function(e,t){return typeof this.options.direction=="function"?this.options.direction.call(this,e,t,Ho):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,y=a.filter;if(Txe(s),!Ho&&!(/mousedown|pointerdown/.test(f)&&e.button!==0||a.disabled)&&!b.isContentEditable&&!(!this.nativeDraggable&&r6&&h&&h.tagName.toUpperCase()==="SELECT")&&(h=iy(h,a.draggable,s,!1),!(h&&h.animated)&&TH!==h)){if(dD=Lb(h),a6=Lb(h,a.draggable),typeof y=="function"){if(y.call(this,e,h,this)){Rg({sortable:t,rootEl:b,name:"filter",targetEl:h,toEl:s,fromEl:s}),Mp("filter",t,{evt:e}),l&&e.cancelable&&e.preventDefault();return}}else if(y&&(y=y.split(",").some(function(k){if(k=iy(b,k.trim(),s,!1),k)return Rg({sortable:t,rootEl:k,name:"filter",targetEl:h,fromEl:s,toEl:s}),Mp("filter",t,{evt:e}),!0}),y)){l&&e.cancelable&&e.preventDefault();return}a.handle&&!iy(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&&!Ho&&s.parentNode===l){var b=Od(s);if(eu=l,Ho=s,Xu=Ho.parentNode,tE=Ho.nextSibling,TH=s,IZ=f.group,Wr.dragged=Ho,qT={target:Ho,clientX:(t||e).clientX,clientY:(t||e).clientY},Sue=qT.clientX-b.left,Cue=qT.clientY-b.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,Ho.style["will-change"]="all",h=function(){if(Mp("delayEnded",a,{evt:e}),Wr.eventCanceled){a._onDrop();return}a._disableDelayedDragEvents(),!Oue&&a.nativeDraggable&&(Ho.draggable=!0),a._triggerDragStart(e,t),Rg({sortable:a,name:"choose",originalEvent:e}),$1(Ho,f.chosenClass,!0)},f.ignore.split(",").forEach(function(y){Gpe(Ho,y.trim(),yne)}),hl(d,"dragover",GT),hl(d,"mousemove",GT),hl(d,"touchmove",GT),hl(d,"mouseup",a._onDrop),hl(d,"touchend",a._onDrop),hl(d,"touchcancel",a._onDrop),Oue&&this.nativeDraggable&&(this.options.touchStartThreshold=4,Ho.draggable=!0),Mp("delayStart",this,{evt:e}),f.delay&&(!f.delayOnTouchOnly||t)&&(!this.nativeDraggable||!(tI||jw))){if(Wr.eventCanceled){this._onDrop();return}hl(d,"mouseup",a._disableDelayedDrag),hl(d,"touchend",a._disableDelayedDrag),hl(d,"touchcancel",a._disableDelayedDrag),hl(d,"mousemove",a._delayedDragTouchMoveHandler),hl(d,"touchmove",a._delayedDragTouchMoveHandler),f.supportPointer&&hl(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(){Ho&&yne(Ho),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?hl(document,"pointermove",this._onTouchMove):t?hl(document,"touchmove",this._onTouchMove):hl(document,"mousemove",this._onTouchMove):(hl(Ho,"dragend",this),hl(eu,"dragstart",this._onDragStart));try{document.selection?AH(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(e,t){if(iD=!1,eu&&Ho){Mp("dragStarted",this,{evt:t}),this.nativeDraggable&&hl(document,"dragover",Oxe);var s=this.options;!e&&$1(Ho,s.dragClass,!1),$1(Ho,s.ghostClass,!0),Wr.active=this,e&&this._appendGhost(),Rg({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(wv){this._lastX=wv.clientX,this._lastY=wv.clientY,s1e();for(var e=document.elementFromPoint(wv.clientX,wv.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(wv.clientX,wv.clientY),e!==t);)t=e;if(Ho.parentNode[F1]._isOutsideThisEl(e),t)do{if(t[F1]){var s=void 0;if(s=t[F1]._onDragOver({clientX:wv.clientX,clientY:wv.clientY,target:e,rootEl:t}),s&&!this.options.dragoverBubble)break}e=t}while(t=t.parentNode);r1e()}},_onTouchMove:function(e){if(qT){var t=this.options,s=t.fallbackTolerance,a=t.fallbackOffset,l=e.touches?e.touches[0]:e,f=Ei&&vD(Ei,!0),d=Ei&&f&&f.a,h=Ei&&f&&f.d,b=LZ&&Rm&&_ue(Rm),y=(l.clientX-qT.clientX+a.x)/(d||1)+(b?b[0]-One[0]:0)/(d||1),k=(l.clientY-qT.clientY+a.y)/(h||1)+(b?b[1]-One[1]:0)/(h||1);if(!Wr.active&&!iD){if(s&&Math.max(Math.abs(l.clientX-this._lastX),Math.abs(l.clientY-this._lastY))=0&&(Rg({rootEl:Xu,name:"add",toEl:Xu,fromEl:eu,originalEvent:e}),Rg({sortable:this,name:"remove",toEl:Xu,originalEvent:e}),Rg({rootEl:Xu,name:"sort",toEl:Xu,fromEl:eu,originalEvent:e}),Rg({sortable:this,name:"sort",toEl:Xu,originalEvent:e})),zh&&zh.save()):I1!==dD&&I1>=0&&(Rg({sortable:this,name:"update",toEl:Xu,originalEvent:e}),Rg({sortable:this,name:"sort",toEl:Xu,originalEvent:e})),Wr.active&&((I1==null||I1===-1)&&(I1=dD,bC=a6),Rg({sortable:this,name:"end",toEl:Xu,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){Mp("nulling",this),eu=Ho=Xu=Ei=tE=Su=TH=yC=qT=wv=XN=I1=bC=dD=a6=tD=l6=zh=IZ=Wr.dragged=Wr.ghost=Wr.clone=Wr.active=null,sz.forEach(function(e){e.checked=!0}),sz.length=bne=vne=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":Ho&&(this._onDragOver(e),yxe(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 Cxe(o,e,t,s,a,l,f,d){var h=s?o.clientY:o.clientX,b=s?t.height:t.width,y=s?t.top:t.left,k=s?t.bottom:t.right,E=!1;if(!f){if(d&&EHy+b*l/2:hk-EH)return-l6}else if(h>y+b*(1-a)/2&&hk-b*l/2)?h>y+b/2?1:-1:0}function kxe(o){return Lb(Ho){f[y]=null}),po(),t=f[e],t?t.p(h,b):(t=f[e]=l[e](h),t.c()),ke(t,1),t.m(s.parentNode,s))},i(h){a||(ke(t),a=!0)},o(h){Fe(t),a=!1},d(h){f[e].d(h),h&&De(s)}}}function Mxe(o,e,t){let{$$slots:s={},$$scope:a}=e,{sortableClass:l=""}=e,{isTable:f=!1}=e,{sortableInstance:d}=e;const h=Hp();let b;W1(()=>{let E={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,E))});function y(E){Vo[E?"unshift":"push"](()=>{b=E,t(2,b)})}function k(E){Vo[E?"unshift":"push"](()=>{b=E,t(2,b)})}return o.$$set=E=>{"sortableClass"in E&&t(0,l=E.sortableClass),"isTable"in E&&t(1,f=E.isTable),"sortableInstance"in E&&t(3,d=E.sortableInstance),"$$scope"in E&&t(4,a=E.$$scope)},[l,f,b,d,a,s,y,k]}class oI extends yo{constructor(e){super(),Oo(this,e,Mxe,Pxe,vo,{sortableClass:0,isTable:1,sortableInstance:3})}}function Tue(o,e,t){const s=o.slice();return s[11]=e[t],s}function Eue(o){let e,t;return{c(){e=re("div"),t=Xt(o[1]),z(e,"class","invalid-feedback d-block mb-3")},m(s,a){Me(s,e,a),j(e,t)},p(s,a){a&2&&Wn(t,s[1])},d(s){s&&De(e)}}}function Aue(o){let e,t;return e=new oI({props:{sortableClass:"row row-cols-3 mt-3",$$slots:{default:[Rxe]},$$scope:{ctx:o}}}),e.$on("update",o[4]),{c(){en(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||(ke(e.$$.fragment,s),t=!0)},o(s){Fe(e.$$.fragment,s),t=!1},d(s){Jt(e,s)}}}function Due(o,e){let t,s,a,l;return s=new J6({props:{classes:"h-100",record:e[11],hasDelete:!0}}),s.$on("remove",e[3]),{key:o,first:null,c(){t=re("div"),en(s.$$.fragment),a=Ze(),z(t,"class","col mb-3"),this.first=t},m(f,d){Me(f,t,d),Kt(s,t,null),j(t,a),l=!0},p(f,d){e=f;const h={};d&1&&(h.record=e[11]),s.$set(h)},i(f){l||(ke(s.$$.fragment,f),l=!0)},o(f){Fe(s.$$.fragment,f),l=!1},d(f){f&&De(t),Jt(s)}}}function Rxe(o){let e=[],t=new Map,s,a,l=o[0];const f=d=>d[11].id;for(let d=0;d0&&Aue(o);return{c(){d&&d.c(),e=Ze(),t=re("div"),en(s.$$.fragment),a=Ze(),h&&h.c(),l=Bs(),z(t,"class","inline-card-wrapper")},m(b,y){d&&d.m(b,y),Me(b,e,y),Me(b,t,y),Kt(s,t,null),Me(b,a,y),h&&h.m(b,y),Me(b,l,y),f=!0},p(b,[y]){b[1]?d?d.p(b,y):(d=Eue(b),d.c(),d.m(e.parentNode,e)):d&&(d.d(1),d=null),b[0].length>0?h?(h.p(b,y),y&1&&ke(h,1)):(h=Aue(b),h.c(),ke(h,1),h.m(l.parentNode,l)):h&&(go(),Fe(h,1,1,()=>{h=null}),po())},i(b){f||(ke(s.$$.fragment,b),ke(h),f=!0)},o(b){Fe(s.$$.fragment,b),Fe(h),f=!1},d(b){d&&d.d(b),b&&De(e),b&&De(t),Jt(s),b&&De(a),h&&h.d(b),b&&De(l)}}}function Nxe(o,e,t){let s,a;const l=si("channel");let{record:f}=e,{field:d}=e,{graph:h}=e,{validationErrors:b}=e,y=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 E($){t(6,h.edges=XD($.detail.source,$.detail.target,h.edges,d.name),h)}function R($){$.preventDefault(),t(6,h=K6(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=Lm(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,y,k,E,R,h,f,d,b]}class Ixe extends yo{constructor(e){super(),Oo(this,e,Nxe,$xe,vo,{record:7,field:8,graph:6,validationErrors:9})}}function Pue(o,e,t){const s=o.slice();return s[21]=e[t],s}function Bxe(o){let e,t,s,a,l,f,d,h,b,y,k,E,R,$,Q,F,U,J,L,te,ne,oe,X,ye,Se,Ne,pe,ce,Xe,tt;f=new Fa({props:{icon:"pencil",width:12,height:12}});const yt=[Zxe,Qxe],V=[];function ut(At,Cn){return At[7]?0:1}b=ut(o),y=V[b]=yt[b](o),$=new Fa({props:{icon:"ellipsis"}});let He=!o[1]&&Mue(o),_t=!o[2]&&Rue(o),wt=o[8].type==="files"&&Hxe(o),Be=o[8].fields.filter(Nue),nt=[];for(let At=0;AtFe(nt[At],1,1,()=>{nt[At]=null});return{c(){e=re("div"),t=re("div"),s=re("small"),s.textContent=`${o[8].label}`,a=Ze(),l=re("button"),en(f.$$.fragment),d=Ze(),h=re("button"),y.c(),k=Ze(),E=re("div"),R=re("button"),en($.$$.fragment),Q=Ze(),F=re("div"),U=re("a"),J=Xt("Edit in new tab"),te=Ze(),ne=re("button"),ne.textContent="Remove",oe=Ze(),X=re("div"),He&&He.c(),ye=Ze(),_t&&_t.c(),Se=Ze(),Ne=re("div"),wt&&wt.c(),pe=Ze();for(let At=0;At{V[je]=null}),po(),y=V[b],y||(y=V[b]=yt[b](At),y.c()),ke(y,1),y.m(h,null)),(!ce||Cn&1&&L!==(L="/records/"+At[0].id))&&z(U,"href",L),At[1]?He&&(go(),Fe(He,1,1,()=>{He=null}),po()):He?(He.p(At,Cn),Cn&2&&ke(He,1)):(He=Mue(At),He.c(),ke(He,1),He.m(X,ye)),At[2]?_t&&(go(),Fe(_t,1,1,()=>{_t=null}),po()):_t?(_t.p(At,Cn),Cn&4&&ke(_t,1)):(_t=Rue(At),_t.c(),ke(_t,1),_t.m(X,null)),At[8].type==="files"&&wt.p(At,Cn),Cn&257){Be=At[8].fields.filter(Nue);let ht;for(ht=0;ht{f[y]=null}),po(),s=f[t],s?s.p(h,b):(s=f[t]=l[t](h),s.c()),ke(s,1),s.m(e,null))},i(h){a||(ke(s),a=!0)},o(h){Fe(s),a=!1},d(h){h&&De(e),f[t].d()}}}const Nue=o=>!(o.trashed||["tab"].includes(o.ui)||["id"].includes(o.name));function Yxe(o,e,t){let s,a;const l=si("channel"),f=Hp();let{isFirst:d}=e,{isLast:h}=e,{toDelete:b=!1}=e,{record:y}=e,k,E,R=l.schemas.find(ye=>ye.name===y.schema);function $(ye){ye.preventDefault(),axios.get(l.lucentUrl+"/records/editInline/"+y.id).then(Se=>{t(0,y=Se.data),t(4,k=Se.data.record),t(5,E=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 J(ye){ye.preventDefault(),f("remove",y.id)}function L(ye){ye.preventDefault(),f("trash",y.id)}function te(ye){ye.preventDefault(),f("undoremove",y.id)}function ne(ye){ye.preventDefault(),t(6,s=!1)}W1(()=>{t(6,s=!1)});function oe(ye){ye.preventDefault(),axios.post(l.lucentUrl+"/records/status/trashed",[y]).then(Se=>{f("remove",y.id)}).catch(Se=>{console.log(Se)})}const X=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,y=ye.record)},t(6,s=!1),t(7,a=!1),[y,d,h,b,k,E,s,a,R,$,Q,F,U,J,L,te,ne,oe,X]}class Xxe extends yo{constructor(e){super(),Oo(this,e,Yxe,Uxe,vo,{isFirst:1,isLast:2,toDelete:3,record:0})}}function a1e(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:y=0,duration:k=R=>Math.sqrt(R)*120,easing:E=xpe}=s;return{delay:y,duration:Ub(k)?k(Math.sqrt(h*h+b*b)):k,easing:E,css:(R,$)=>{const Q=$*h,F=$*b,U=R+$*e.width/t.width,J=R+$*e.height/t.height;return`transform: ${l} translate(${Q}px, ${F}px) scale(${U}, ${J});`}}}function Iue(o,e,t){const s=o.slice();return s[18]=e[t],s[19]=e,s[20]=t,s}function Bue(o){let e,t;return{c(){e=re("div"),t=Xt(o[3]),z(e,"class","invalid-feedback d-block mb-3")},m(s,a){Me(s,e,a),j(e,t)},p(s,a){a&8&&Wn(t,s[3])},d(s){s&&De(e)}}}function Lue(o){let e=[],t=new Map,s,a,l=o[2];const f=d=>d[18].id;for(let d=0;dcr(s,"record",E)),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 eI({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=re("div"),en(s.$$.fragment),l=Ze(),en(f.$$.fragment),d=Ze(),z(t,"class","inline-card-wrapper"),this.first=t},m(F,U){Me(F,t,U),Kt(s,t,null),j(t,l),Kt(f,t,null),j(t,d),y=!0},p(F,U){e=F;const J={};U&4&&(J.isFirst=e[20]===0),U&4&&(J.isLast=e[20]+1===e[2].length),U&7&&(J.toDelete=e[0].edges.find(k)._isTrashed),!a&&U&4&&(a=!0,J.record=e[18],mr(()=>a=!1)),s.$set(J);const L={};U&2&&(L.field=e[1]),U&4&&(L.recordId=e[18].id),f.$set(L)},r(){h=t.getBoundingClientRect()},f(){_pe(t),b()},a(){b(),b=wpe(t,h,a1e,{delay:250,duration:250,easing:Tpe})},i(F){y||(ke(s.$$.fragment,F),ke(f.$$.fragment,F),y=!0)},o(F){Fe(s.$$.fragment,F),Fe(f.$$.fragment,F),y=!1},d(F){F&&De(t),Jt(s),Jt(f)}}}function jxe(o){let e,t,s,a,l,f,d=o[3]&&Bue(o);s=new eI({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&&Lue(o);return{c(){d&&d.c(),e=Ze(),t=re("div"),en(s.$$.fragment),a=Ze(),h&&h.c(),l=Bs(),z(t,"class","inline-card-wrapper")},m(b,y){d&&d.m(b,y),Me(b,e,y),Me(b,t,y),Kt(s,t,null),Me(b,a,y),h&&h.m(b,y),Me(b,l,y),f=!0},p(b,[y]){b[3]?d?d.p(b,y):(d=Bue(b),d.c(),d.m(e.parentNode,e)):d&&(d.d(1),d=null);const k={};y&2&&(k.field=b[1]),s.$set(k),b[2].length>0?h?(h.p(b,y),y&4&&ke(h,1)):(h=Lue(b),h.c(),ke(h,1),h.m(l.parentNode,l)):h&&(go(),Fe(h,1,1,()=>{h=null}),po())},i(b){f||(ke(s.$$.fragment,b),ke(h),f=!0)},o(b){Fe(s.$$.fragment,b),Fe(h),f=!1},d(b){d&&d.d(b),b&&De(e),b&&De(t),Jt(s),b&&De(a),h&&h.d(b),b&&De(l)}}}function qxe(o,e,t){let s,a;const l=si("channel");let{field:f}=e,{record:d}=e,{graph:h}=e,{validationErrors:b}=e,y=l.schemas.filter(ne=>f.collections.includes(ne.name));function k(ne){const oe=ne.detail.records[0];t(0,h.edges=h.edges.map(X=>X.source===oe.id?oe:X),h)}function E(ne){ne.preventDefault(),t(0,h.edges=h.edges.filter(oe=>!(oe.target===ne.detail&&oe.field===f.name)),h)}function R(ne){ne.preventDefault(),t(0,h.edges=h.edges.map(oe=>(oe.target===ne.detail&&oe.field===f.name&&(oe._isTrashed=!0),oe)),h)}function $(ne){ne.preventDefault(),t(0,h.edges=h.edges.map(oe=>(oe.target===ne.detail&&oe.field===f.name&&delete oe._isTrashed,oe)),h)}function Q(ne){var pe;ne.preventDefault();const oe=ne.detail.records,X=(pe=ne.detail.after)!=null?pe:null,ye=ne.detail.action;let Se=oe.map(ce=>({target:ce.id,source:d.id,sourceSchema:d.schema,targetSchema:ce.schema,field:f.name,rank:""})),Ne=h.edges;if(ye==="replace"&&(Ne=Ne.filter(ce=>ce.field!==f.name)),t(0,h.records=Lc.exports.uniqBy([...h.records,...oe],ce=>ce.id),h),t(0,h.edges=Lc.exports.uniqBy([...Ne,...Se],ce=>ce.target+ce.field),h),!X)t(0,h.edges=Lc.exports.uniqBy([...Se,...Ne],ce=>ce.target+ce.field),h);else{let ce=!1,Xe=Ne.reduce((tt,yt)=>(ce?tt.after.push(yt):tt.before.push(yt),ce===!1&&yt.target===X&&(ce=!0),tt),{before:[],after:[]});t(0,h.edges=Lc.exports.uniqBy([...Xe.before,...Se,...Xe.after],tt=>tt.target+tt.field),h)}}function F(ne,oe,X){t(0,h.edges=XD(oe,X,h.edges,f.name),h)}const U=(ne,oe)=>oe.field===f.name&&oe.target===ne.id;function J(ne,oe,X,ye){X[ye]=ne,t(2,a),t(0,h),t(1,f),t(11,d)}const L=(ne,oe)=>F(oe,ne,ne-1),te=(ne,oe)=>F(oe,ne,ne+1);return o.$$set=ne=>{"field"in ne&&t(1,f=ne.field),"record"in ne&&t(11,d=ne.record),"graph"in ne&&t(0,h=ne.graph),"validationErrors"in ne&&t(12,b=ne.validationErrors)},o.$$.update=()=>{var ne;o.$$.dirty&4098&&t(3,s=Lm(b,f.name)),o.$$.dirty&2051&&t(2,a=(ne=h.edges.filter(oe=>oe.field===f.name).map(oe=>h.records.find(X=>X.id==oe.target&&d.id==oe.source)).filter(oe=>!!(oe!=null&&oe.id)))!=null?ne:[])},[h,f,a,s,y,k,E,R,$,Q,F,d,b,U,J,L,te]}class Gxe extends yo{constructor(e){super(),Oo(this,e,qxe,jxe,vo,{field:1,record:11,graph:0,validationErrors:12})}}function l1e(o,e,t=null){return t?o.reduce((s,a)=>(s.push(a),a.id===t&&s.push({meta:e,id:Fle(),value:null}),s),[]):[{meta:e,id:Fle(),value:null},...o]}function Que(o,e,t){const s=o.slice();return s[7]=e[t],s}function Zue(o){let e,t=o[1].fields,s=[];for(let a=0;at(2,s=!s),b=(y,k)=>d(k,y);return o.$$set=y=>{"blockId"in y&&t(0,a=y.blockId),"blockData"in y&&t(4,l=y.blockData),"blockSchema"in y&&t(1,f=y.blockSchema)},t(2,s=!1),[a,f,s,d,l,h,b]}class eTe extends yo{constructor(e){super(),Oo(this,e,Jxe,Kxe,vo,{blockId:0,blockData:4,blockSchema:1})}}function tTe(o){let e,t,s,a,l;return{c(){e=re("div"),t=re("input"),z(t,"type","text"),z(t,"id",s=o[0].id),z(t,"class","form-control"),z(t,"autocomplete","off"),z(e,"class","mb-0")},m(f,d){Me(f,e,d),j(e,t),hr(t,o[0].value),a||(l=pn(t,"input",o[1]),a=!0)},p(f,[d]){d&1&&s!==(s=f[0].id)&&z(t,"id",s),d&1&&t.value!==f[0].value&&hr(t,f[0].value)},i:bn,o:bn,d(f){f&&De(e),a=!1,l()}}}function nTe(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 oTe extends yo{constructor(e){super(),Oo(this,e,nTe,tTe,vo,{block:0})}}function sTe(o){let e,t,s,a,l;return{c(){e=re("div"),t=re("textarea"),z(t,"id",s=o[0].id),z(t,"class","form-control svelte-1er4ovm"),z(t,"autocomplete","off"),z(e,"class","mb-0")},m(f,d){Me(f,e,d),j(e,t),hr(t,o[0].value),o[3](t),a||(l=[pn(t,"input",o[2]),pn(t,"input",c1e)],a=!0)},p(f,[d]){d&1&&s!==(s=f[0].id)&&z(t,"id",s),d&1&&hr(t,f[0].value)},i:bn,o:bn,d(f){f&&De(e),o[3](null),a=!1,$i(l)}}}function c1e(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 rTe(o,e,t){let{block:s}=e,a;W1(()=>{c1e(a)});function l(){s.value=this.value,t(0,s)}function f(d){Vo[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 iTe extends yo{constructor(e){super(),Oo(this,e,rTe,sTe,vo,{block:0})}}var u1e={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,J=(n,i)=>te(n)&&R(n,i,(c,m)=>E(c)===m),L=Q("string"),te=Q("object"),ne=n=>J(n,Object),oe=Q("array"),X=U(null),ye=F("boolean"),Se=U(void 0),Ne=n=>n==null,pe=n=>!Ne(n),ce=F("function"),Xe=F("number"),tt=(n,i)=>{if(oe(n)){for(let c=0,m=n.length;c{},V=(n,i)=>(...c)=>n(i.apply(null,c)),ut=(n,i)=>c=>n(i(c)),He=n=>()=>n,_t=n=>n,wt=(n,i)=>n===i;function Be(n,...i){return(...c)=>{const m=i.concat(c);return n.apply(null,m)}}const nt=n=>i=>!n(i),rn=n=>()=>{throw new Error(n)},At=n=>n(),Cn=n=>{n()},je=He(!1),ht=He(!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 pe(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 Qo=Array.prototype.slice,Kn=Array.prototype.indexOf,so=Array.prototype.push,Uo=(n,i)=>Kn.call(n,i),as=(n,i)=>{const c=Uo(n,i);return c===-1?he.none():he.some(c)},xt=(n,i)=>Uo(n,i)>-1,jt=(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,w=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)=>($e(n,(m,p)=>{c=i(c,m,p)}),c),ps=(n,i,c)=>{for(let m=0,p=n.length;mps(n,i,je),Ss=(n,i)=>{for(let c=0,m=n.length;c{const i=[];for(let c=0,m=n.length;cMr(gt(n,i)),er=(n,i)=>{for(let c=0,m=n.length;c{const i=Qo.call(n,0);return i.reverse(),i},wa=(n,i)=>Dt(n,c=>!xt(i,c)),ur=(n,i)=>{const c={};for(let m=0,p=n.length;m{const c=Qo.call(n,0);return c.sort(i),c},jr=(n,i)=>i>=0&&ijr(n,0),Po=n=>jr(n,n.length-1),Rr=ce(Array.from)?Array.from:n=>Qo.call(n),Ls=(n,i)=>{for(let c=0;c{const c=[],m=ce(i)?p=>jt(c,w=>i(w,p)):p=>xt(c,p);for(let p=0,w=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 w=i(m,p);c[w.k]=w.v}),c},ze=n=>(i,c)=>{n[c]=i},et=(n,i,c,m)=>{ln(n,(p,w)=>{(i(p,w)?c:m)(p,w)})},Et=(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),yt),c},Yn=(n,i)=>{const c=[];return ln(n,(m,p)=>{c.push(i(m,p))}),c},uo=n=>Yn(n,_t),wo=(n,i)=>un(n,i)?he.from(n[i]):he.none(),un=(n,i)=>_a.call(n,i),ns=(n,i)=>un(n,i)&&n[i]!==void 0&&n[i]!==null,xo=(n,i,c=k)=>y(c).eq(n,i),fs=n=>{const i={};return $e(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},Qa=(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 w=0;w{for(let m=0,p=n.length;mn[n.length-1],Wt=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,w=n.isiOS()&&!p,x=n.isiOS()||n.isAndroid(),M=x||m("(pointer:coarse)"),B=p||!w&&x&&m("(min-device-width:768px)"),G=w||x&&!B,ae=i.isSafari()&&n.isiOS()&&/safari/i.test(c)===!1,fe=!G&&!B&&!ae;return{isiPad:He(p),isiPhone:He(w),isTablet:He(B),isPhone:He(G),isTouch:He(M),isAndroid:n.isAndroid,isiOS:n.isiOS,isWebView:He(ae),isDesktop:He(fe)}},Bo=(n,i)=>{for(let c=0;c{const c=Bo(n,i);if(!c)return{major:0,minor:0};const m=p=>Number(i.replace(c,"$"+p));return Yo(m(1),m(2))},Jr=(n,i)=>{const c=String(i).toLowerCase();return n.length===0?at():qo(n,c)},at=()=>Yo(0,0),Yo=(n,i)=>({major:n,minor:i}),Ni={nu:Yo,detect:Jr,unknown:at},la=(n,i)=>Ls(i.brands,c=>{const m=c.brand.toLowerCase();return oo(n,p=>{var w;return m===((w=p.brand)===null||w===void 0?void 0:w.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}}),Fc=(n,i)=>ma(n,i).map(c=>{const m=Ni.detect(c.versionRegexes,i);return{current:c.name,version:m}}),Cc=(n,i)=>n.substring(i),nl=(n,i,c)=>i===""||n.length>=i.length&&n.substr(c,c+i.length)===i,ga=(n,i)=>Ar(n,i)?Cc(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)=>nl(n,i,0),Ki=(n,i)=>nl(n,i,n.length-i.length),gl=n=>i=>i.replace(n,""),kc=gl(/^\s+|\s+$/g),nu=gl(/^\s+/g),ku=gl(/\s+$/g),yr=n=>n.length>0,ol=n=>!yr(n),xu=(n,i)=>i<=0?"":new Array(i+1).join(n),ou=(n,i=10)=>{const c=parseInt(n,i);return isNaN(c)?he.none():he.some(c)},Yl=/.*?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]+).*/,Yl],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:[Yl,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Aa("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Aa("firefox")},{name:"Safari",versionRegexes:[Yl,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:n=>(tr(n,"safari")||tr(n,"mobile/"))&&tr(n,"applewebkit")}],Qm=[{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]+).*/]}],kf={browsers:He(Dr),oses:He(Qm)},xr="Edge",Za="Chromium",ca="IE",Ji="Opera",Tu="Firefox",Qc="Safari",Ha=()=>Zc({current:void 0,version:Ni.unknown()}),Zc=n=>{const i=n.current,c=n.version,m=p=>()=>i===p;return{current:i,version:c,isEdge:m(xr),isChromium:m(Za),isIE:m(ca),isOpera:m(Ji),isFirefox:m(Tu),isSafari:m(Qc)}},xc={unknown:Ha,nu:Zc,edge:He(xr),chromium:He(Za),ie:He(ca),opera:He(Ji),firefox:He(Tu),safari:He(Qc)},Cd="Windows",Uf="iOS",Eu="Android",Xl="Linux",Hc="macOS",xf="Solaris",su="FreeBSD",kd="ChromeOS",Ee=()=>ot({current:void 0,version:Ni.unknown()}),ot=n=>{const i=n.current,c=n.version,m=p=>()=>i===p;return{current:i,version:c,isWindows:m(Cd),isiOS:m(Uf),isAndroid:m(Eu),isMacOS:m(Hc),isLinux:m(Xl),isSolaris:m(xf),isFreeBSD:m(su),isChromeOS:m(kd)}},pt={unknown:Ee,nu:ot,windows:He(Cd),ios:He(Uf),android:He(Eu),linux:He(Xl),macos:He(Hc),solaris:He(xf),freebsd:He(su),chromeos:He(kd)},On={detect:(n,i,c)=>{const m=kf.browsers(),p=kf.oses(),w=i.bind(B=>la(m,B)).orThunk(()=>gr(m,n)).fold(xc.unknown,xc.nu),x=Fc(p,n).fold(pt.unknown,pt.nu),M=fo(x,w,n,c);return{browser:w,os:x,deviceType:M}}},Mo=n=>window.matchMedia(n).matches;let $r=Wt(()=>On.detect(navigator.userAgent,he.from(navigator.userAgentData),Mo));const ys=()=>$r(),ls=navigator.userAgent,Ai=ys(),js=Ai.browser,Hi=Ai.os,Au=Ai.deviceType,xd=ls.indexOf("Windows Phone")!==-1,qn={transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",documentMode:js.isIE()?document.documentMode||7:10,cacheSuffix:null,container:null,canHaveCSP:!js.isIE(),windowsPhone:xd,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:Hi.current,version:Hi.version,isAndroid:Hi.isAndroid,isChromeOS:Hi.isChromeOS,isFreeBSD:Hi.isFreeBSD,isiOS:Hi.isiOS,isLinux:Hi.isLinux,isMacOS:Hi.isMacOS,isSolaris:Hi.isSolaris,isWindows:Hi.isWindows},deviceType:{isDesktop:Au.isDesktop,isiPad:Au.isiPad,isiPhone:Au.isiPhone,isPhone:Au.isPhone,isTablet:Au.isTablet,isTouch:Au.isTouch,isWebView:Au.isWebView}},Zm=/^\s*|\s*$/g,zi=n=>Ne(n)?"":(""+n).replace(Zm,""),me=(n,i)=>i?i==="array"&&Lr(n)?!0:typeof n===i:n!==void 0,Re=(n,i,c={})=>{const m=L(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,w,c)===!1?!1:(Bn(p,i,c,m),!0)))},hn={trim:zi,isArray:Lr,is:me,toArray:Vs,makeMap:Re,each:Ur,map:Zi,grep:Qa,inArray:vi,hasOwn:Ue,extend:Bt,walk:Bn,resolve:(n,i=window)=>{const c=n.split(".");for(let m=0,p=c.length;moe(n)?n:n===""?[]:Zi(n.split(i||","),zi),_addCacheSuffix:n=>{const i=qn.cacheSuffix;return i&&(n+=(n.indexOf("?")===-1?"?":"&")+i),n}},qr=(n,i,c=wt)=>n.exists(m=>c(m,i)),Ll=(n,i,c=wt)=>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(),Tf=(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(),ru=typeof window<"u"?window:Function("return this;")(),Di=(n,i)=>{let c=i!=null?i:ru;for(let m=0;m{const c=n.split(".");return Di(c,i)},Ii=(n,i)=>uc(n,i),Yf=(n,i)=>{const c=Ii(n,i);if(c==null)throw new Error(n+" not available on this browser");return c},pa=Object.getPrototypeOf,Xf=n=>Yf("HTMLElement",n),pr=n=>{const i=uc("ownerDocument.defaultView",n);return te(n)&&(Xf(i).prototype.isPrototypeOf(n)||/^HTML\w*Element$/.test(pa(n).constructor.name))},qu=8,Gu=9,Tc=11,jf=1,Jd=3,ei=n=>n.dom.nodeName.toLowerCase(),ta=n=>n.dom.nodeType,za=n=>i=>ta(i)===n,Kb=n=>ta(n)===qu||ei(n)==="#comment",Pi=n=>kl(n)&&pr(n.dom),kl=za(jf),sl=za(Jd),Qg=za(Gu),qf=za(Tc),Ec=n=>i=>kl(i)&&ei(i)===n,Ef=(n,i,c)=>{if(L(c)||ye(c)||Xe(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)=>{Ef(n.dom,i,c)},Ku=(n,i)=>{const c=n.dom;ln(i,(m,p)=>{Ef(c,p,m)})},Fl=(n,i)=>{const c=n.dom.getAttribute(i);return c===null?void 0:c},Va=(n,i)=>he.from(Fl(n,i)),qi=(n,i)=>{const c=n.dom;return c&&c.hasAttribute?c.hasAttribute(i):!1},Vi=(n,i)=>{n.dom.removeAttribute(i)},fc=n=>{const i=n.dom.attributes;return i==null||i.length===0},Gf=n=>Hn(n.dom.attributes,(i,c)=>(i[c.name]=c.value,i),{}),eh=(n,i)=>{const c=Fl(n,i);return c===void 0||c===""?[]:c.split(" ")},Zg=(n,i,c)=>{const p=eh(n,i).concat([c]);return Pr(n,i,p.join(" ")),!0},Hm=(n,i,c)=>{const m=Dt(eh(n,i),p=>p!==c);return m.length>0?Pr(n,i,m.join(" ")):Vi(n,i),!1},Ql=n=>n.dom.classList!==void 0,zm=n=>eh(n,"class"),rl=(n,i)=>Zg(n,"class",i),Af=(n,i)=>Hm(n,"class",i),jh=(n,i)=>xt(zm(n),i)?Af(n,i):rl(n,i),Ju=(n,i)=>{Ql(n)?n.dom.classList.add(i):rl(n,i)},qh=n=>{(Ql(n)?n.dom.classList:zm(n)).length===0&&Vi(n,"class")},zc=(n,i)=>{Ql(n)?n.dom.classList.remove(i):Af(n,i),qh(n)},Gh=(n,i)=>{const c=Ql(n)?n.dom.classList.toggle(i):jh(n,i);return qh(n),c},Df=(n,i)=>Ql(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 jl(m.childNodes[0])},Vm=(n,i)=>{const m=(i||document).createElement(n);return jl(m)},Kf=(n,i)=>{const m=(i||document).createTextNode(n);return jl(m)},jl=n=>{if(n==null)throw new Error("Node cannot be null or undefined");return{dom:n}},Ke={fromHtml:zp,fromTag:Vm,fromText:Kf,fromDom:jl,fromPoint:(n,i,c)=>he.from(n.dom.elementFromPoint(i,c)).map(jl)},th=(n,i)=>{const c=[],m=w=>(c.push(w),i(w));let p=i(n);do p=p.bind(m);while(p.isSome());return c},Du=(n,i)=>{const c=n.dom;if(c.nodeType!==jf)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!==jf&&n.nodeType!==Gu&&n.nodeType!==Tc||n.childElementCount===0,U1=(n,i)=>{const c=i===void 0?document:i.dom;return zg(c)?[]:gt(c.querySelectorAll(n),Ke.fromDom)},Kh=(n,i)=>{const c=i===void 0?document:i.dom;return zg(c)?he.none():he.from(c.querySelector(n)).map(Ke.fromDom)},bt=(n,i)=>n.dom===i.dom,cn=(n,i)=>{const c=n.dom,m=i.dom;return c===m?!1:c.contains(m)},an=n=>Ke.fromDom(n.dom.ownerDocument),Eo=n=>Qg(n)?n:an(n),nr=n=>Ke.fromDom(Eo(n).dom.documentElement),Yr=n=>Ke.fromDom(Eo(n).dom.defaultView),fi=n=>he.from(n.dom.parentNode).map(Ke.fromDom),yi=n=>he.from(n.dom.parentElement).map(Ke.fromDom),nh=(n,i)=>{const c=ce(i)?i:je;let m=n.dom;const p=[];for(;m.parentNode!==null&&m.parentNode!==void 0;){const w=m.parentNode,x=Ke.fromDom(w);if(p.push(x),c(x)===!0)break;m=w}return p},Jb=n=>{const i=c=>Dt(c,m=>!bt(n,m));return fi(n).map(Da).map(i).getOr([])},Sa=n=>he.from(n.dom.previousSibling).map(Ke.fromDom),Td=n=>he.from(n.dom.nextSibling).map(Ke.fromDom),Vg=n=>Xs(th(n,Sa)),il=n=>th(n,Td),Da=n=>gt(n.dom.childNodes,Ke.fromDom),ef=(n,i)=>{const c=n.dom.childNodes;return he.from(c[i]).map(Ke.fromDom)},ii=n=>ef(n,0),Pu=n=>ef(n,n.dom.childNodes.length-1),dc=n=>n.dom.childNodes.length,Jh=n=>n.dom.hasChildNodes(),Y1=n=>{const i=n.dom.head;if(i==null)throw new Error("Head is not available yet");return Ke.fromDom(i)},oh=n=>qf(n)&&pe(n.dom.host),Wg=ce(Element.prototype.attachShadow)&&ce(Node.prototype.getRootNode),sh=He(Wg),ql=Wg?n=>Ke.fromDom(n.dom.getRootNode()):Eo,em=n=>oh(n)?n:Y1(Eo(n)),X1=n=>oh(n)?n:Ke.fromDom(Eo(n).dom.body),Wm=n=>{const i=ql(n);return oh(i)?he.some(i):he.none()},Ug=n=>Ke.fromDom(n.dom.host),tm=n=>{if(sh()&&pe(n.target)){const i=Ke.fromDom(n.target);if(kl(i)&&rh(i)&&n.composed&&n.composedPath){const c=n.composedPath();if(c)return Ro(c)}}return he.from(n.target)},rh=n=>pe(n.dom.shadowRoot),Ed=n=>{const i=sl(n)?n.dom.parentNode:n.dom;if(i==null||i.ownerDocument===null)return!1;const c=i.ownerDocument;return Wm(Ke.fromDom(i)).fold(()=>c.body.contains(i),ut(Ed,Ug))};var ai=(n,i,c,m,p)=>n(c,m)?he.some(c):ce(p)&&p(c)?he.none():i(c,m,p);const di=(n,i,c)=>{let m=n.dom;const p=ce(c)?c:je;for(;m.parentNode;){m=m.parentNode;const w=Ke.fromDom(m);if(i(w))return he.some(w);if(p(w))break}return he.none()},Zl=(n,i,c)=>ai((p,w)=>w(p),di,n,i,c),Vp=(n,i)=>{const c=n.dom;return c.parentNode?ee(Ke.fromDom(c.parentNode),m=>!bt(n,m)&&i(m)):he.none()},ee=(n,i)=>{const c=p=>i(Ke.fromDom(p));return oo(n.dom.childNodes,c).map(Ke.fromDom)},ue=(n,i)=>{const c=m=>{for(let p=0;pdi(n,m=>Du(m,i),c),Je=(n,i)=>Kh(i,n),it=(n,i,c)=>ai((p,w)=>Du(p,w),_e,n,i,c),Dn=n=>it(n,"[contenteditable]"),wn=(n,i=!1)=>Ed(n)?n.dom.isContentEditable:Dn(n).fold(He(i),c=>Go(c)==="true"),Go=n=>n.dom.contentEditable,os=n=>n.style!==void 0&&ce(n.style.getPropertyValue),ho=(n,i,c)=>{if(!L(c))throw console.error("Invalid call to CSS.set. Property ",i,":: Value ",c,":: Element ",n),new Error("CSS value must be a string: "+c);os(n)&&n.style.setProperty(i,c)},Tr=(n,i)=>{os(n)&&n.style.removeProperty(i)},Gl=(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===""&&!Ed(n)?Mu(c,i):p},Mu=(n,i)=>os(n)?n.style.getPropertyValue(i):"",Pa=(n,i)=>{const c=n.dom,m=Mu(c,i);return he.from(m).filter(p=>p.length>0)},nm=n=>{const i={},c=n.dom;if(os(c))for(let m=0;m{const c=n.dom;Tr(c,i),qr(Va(n,"style").map(kc),"")&&Vi(n,"style")},Wi=n=>n.dom.offsetWidth,Ca=(n,i)=>{fi(n).each(m=>{m.dom.insertBefore(i.dom,n.dom)})},iu=(n,i)=>{Td(n).fold(()=>{fi(n).each(p=>{na(p,i)})},m=>{Ca(m,i)})},ih=(n,i)=>{ii(n).fold(()=>{na(n,i)},m=>{n.dom.insertBefore(i.dom,m.dom)})},na=(n,i)=>{n.dom.appendChild(i.dom)},e0=(n,i)=>{Ca(n,i),na(i,n)},Dv=(n,i)=>{$e(i,(c,m)=>{const p=m===0?n:i[m-1];iu(p,c)})},ti=(n,i)=>{$e(i,c=>{na(n,c)})},Ad=n=>{n.dom.textContent="",$e(Da(n),i=>{wr(i)})},wr=n=>{const i=n.dom;i.parentNode!==null&&i.parentNode.removeChild(i)},Kl=n=>{const i=Da(n);i.length>0&&Dv(n,i),wr(n)},Jf=(n,i)=>{const m=(i||document).createElement("div");return m.innerHTML=n,Da(Ke.fromDom(m))},ah=n=>gt(n,Ke.fromDom),Te=n=>n.dom.innerHTML,Pf=(n,i)=>{const m=an(n).dom,p=Ke.fromDom(m.createDocumentFragment()),w=Jf(i,m);ti(p,w),Ad(n),na(n,p)},Yg=n=>{const i=Ke.fromTag("div"),c=Ke.fromDom(n.dom.cloneNode(!0));return na(i,c),Te(i)},Ru=(n,i,c,m,p,w,x)=>({target:n,x:i,y:c,stop:m,prevent:p,kill:w,raw:x}),hi=n=>{const i=Ke.fromDom(tm(n).getOr(n.target)),c=()=>n.stopPropagation(),m=()=>n.preventDefault(),p=V(m,c);return Ru(i,n.clientX,n.clientY,c,m,p,n)},Pv=(n,i)=>c=>{n(c)&&i(hi(c))},j1=(n,i,c,m,p)=>{const w=Pv(c,m);return n.dom.addEventListener(i,w,p),{unbind:Be(ed,n,i,w,p)}},t0=(n,i,c,m)=>j1(n,i,c,m,!1),ed=(n,i,c,m)=>{n.dom.removeEventListener(i,c,m)},Ym=(n,i)=>({left:n,top:i,translate:(m,p)=>Ym(n+m,i+p)}),Xg=Ym,Mv=n=>{const i=n.getBoundingClientRect();return Xg(i.left,i.top)},Mf=(n,i)=>n!==void 0?n:i!==void 0?i:0,xy=n=>{const i=n.dom.ownerDocument,c=i.body,m=i.defaultView,p=i.documentElement;if(c===n.dom)return Xg(c.offsetLeft,c.offsetTop);const w=Mf(m==null?void 0:m.pageYOffset,p.scrollTop),x=Mf(m==null?void 0:m.pageXOffset,p.scrollLeft),M=Mf(p.clientTop,c.clientTop),B=Mf(p.clientLeft,c.clientLeft);return $u(n).translate(x-B,w-M)},$u=n=>{const i=n.dom,m=i.ownerDocument.body;return m===i?Xg(m.offsetLeft,m.offsetTop):Ed(n)?Mv(i):Xg(0,0)},tf=n=>{const i=n!==void 0?n.dom:document,c=i.body.scrollLeft||i.documentElement.scrollLeft,m=i.body.scrollTop||i.documentElement.scrollTop;return Xg(c,m)},n0=(n,i,c)=>{const p=(c!==void 0?c.dom:document).defaultView;p&&p.scrollTo(n,i)},o0=(n,i)=>{ys().browser.isSafari()&&ce(n.dom.scrollIntoViewIfNeeded)?n.dom.scrollIntoViewIfNeeded(!1):n.dom.scrollIntoView(i)},s0=n=>{const i=n===void 0?window:n;return ys().browser.isFirefox()?he.none():he.from(i.visualViewport)},q1=(n,i,c,m)=>({x:n,y:i,width:c,height:m,right:n+c,bottom:i+m}),td=n=>{const i=n===void 0?window:n,c=i.document,m=tf(Ke.fromDom(c));return s0(i).fold(()=>{const p=i.document.documentElement,w=p.clientWidth,x=p.clientHeight;return q1(m.left,m.top,w,x)},p=>q1(Math.max(p.pageLeft,m.left),Math.max(p.pageTop,m.top),p.width,p.height))},r0=(n,i)=>Dt(Da(n),i),i0=(n,i)=>{let c=[];return $e(Da(n),m=>{i(m)&&(c=c.concat([m])),c=c.concat(i0(m,i))}),c},pl=(n,i)=>U1(i,n),Ty=(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 w=i[m];if(w)return w;for(let x=i.parentNode;x&&x!==this.rootNode;x=x.parentNode)if(w=x[m],w)return w}}}findPreviousNode(i,c){if(i){const m=i.previousSibling;if(this.rootNode&&m===this.rootNode)return;if(m){if(!c){for(let w=m.lastChild;w;w=w.lastChild)if(!w.lastChild)return w}return m}const p=i.parentNode;if(p&&p!==this.rootNode)return p}}}const lo=n=>i=>!!i&&i.nodeType===n,Dd=n=>!!n&&!Object.getPrototypeOf(n),Jn=lo(1),Ac=n=>{const i=n.toLowerCase();return c=>pe(c)&&c.nodeName.toLowerCase()===i},Rf=n=>{const i=n.map(c=>c.toLowerCase());return c=>{if(c&&c.nodeName){const m=c.nodeName.toLowerCase();return xt(i,m)}return!1}},lh=(n,i)=>{const c=i.toLowerCase().split(" ");return m=>{if(Jn(m)){const p=m.ownerDocument.defaultView;if(p)for(let w=0;wi=>Jn(i)&&i.hasAttribute(n),jg=(n,i)=>c=>Jn(c)&&c.getAttribute(n)===i,Pd=n=>Jn(n)&&n.hasAttribute("data-mce-bogus"),bl=n=>Jn(n)&&n.getAttribute("data-mce-bogus")==="all",Nu=n=>Jn(n)&&n.tagName==="TABLE",Wp=n=>i=>!!(Jn(i)&&(i.contentEditable===n||i.getAttribute("data-mce-contenteditable")===n)),G1=Rf(["textarea","input"]),_n=lo(3),Xm=lo(4),Md=lo(7),ch=lo(8),nf=lo(9),K1=lo(11),mi=Ac("br"),Ui=Ac("img"),ba=Wp("true"),Es=Wp("false"),Rd=Rf(["td","th"]),xl=Rf(["td","th","caption"]),of=Rf(["video","audio","object","embed"]),Wa=Ac("li"),ka=Ac("details"),Up=Ac("summary"),nn="\uFEFF",Gr="\xA0",a0=n=>n===nn,xa=n=>n.replace(/\uFEFF/g,""),qg=((n,i)=>{const c=w=>{if(!n(w))throw new Error("Can only get "+i+" value of a "+i+" node");return m(w).getOr("")},m=w=>n(w)?he.from(w.dom.nodeValue):he.none();return{get:c,getOption:m,set:(w,x)=>{if(!n(w))throw new Error("Can only set raw "+i+" value of a "+i+" node");w.dom.nodeValue=x}}})(sl,"text"),Wc=n=>qg.get(n),nd=n=>qg.getOption(n),od=(n,i)=>qg.set(n,i),Yp=["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"],Hl=["td","th"],Er=["thead","tbody","tfoot"],Ya=["h1","h2","h3","h4","h5","h6","p","div","address","pre","form","blockquote","center","dir","fieldset","header","footer","article","section","hgroup","aside","nav","figure"],uh=["h1","h2","h3","h4","h5","h6"],Jl=["li","dd","dt"],l0=["ul","ol","dl"],jm=["pre","script","textarea","style"],J1=["pre"].concat(uh),Xa=n=>{let i;return c=>(i=i||ur(n,ht),un(i,ei(c)))},hc=Xa(Yp),Tt=n=>ei(n)==="table",Dc=n=>kl(n)&&!hc(n),au=n=>kl(n)&&ei(n)==="br",mc=Xa(Ya),Iu=Xa(l0),ja=Xa(Jl),qa=Xa(Er),qm=Xa(Hl),lu=Xa(jm),c0=Xa(J1),Zo=n=>c0(n)||Dc(n),H=n=>{const i=[];let c=n.dom;for(;c;)i.push(Ke.fromDom(c)),c=c.lastChild;return i},q=n=>{const i=pl(n,"br"),c=Dt(H(n).slice(-1),au);i.length===c.length&&$e(c,wr)},Oe=()=>{const n=Ke.fromTag("br");return Pr(n,"data-mce-bogus","1"),n},Ae=n=>{Ad(n),na(n,Oe())},lt=n=>{Pu(n).each(i=>{Sa(i).each(c=>{hc(n)&&au(i)&&hc(c)&&wr(i)})})},Ft=nn,Sn=a0,In=xa,Wo=Jn,es=_n,_i=n=>(es(n)&&(n=n.parentNode),Wo(n)&&n.hasAttribute("data-mce-caret")),or=n=>es(n)&&Sn(n.data),_r=n=>_i(n)||or(n),Uc=n=>n.firstChild!==n.lastChild||!mi(n.firstChild),cu=(n,i)=>{var c;const p=((c=n.ownerDocument)!==null&&c!==void 0?c:document).createTextNode(Ft),w=n.parentNode;if(i){const x=n.previousSibling;if(es(x)){if(_r(x))return x;if(fr(x))return x.splitText(x.data.length-1)}w==null||w.insertBefore(p,n)}else{const x=n.nextSibling;if(es(x)){if(_r(x))return x;if(dh(x))return x.splitText(1),x}n.nextSibling?w==null||w.insertBefore(p,n.nextSibling):w==null||w.appendChild(p)}return p},sf=n=>{const i=n.container();return _n(i)?i.data.charAt(n.offset())===Ft||n.isAtStart()&&or(i.previousSibling):!1},$f=n=>{const i=n.container();return _n(i)?i.data.charAt(n.offset()-1)===Ft||n.isAtEnd()&&or(i.nextSibling):!1},fh=(n,i,c)=>{var m;const w=((m=i.ownerDocument)!==null&&m!==void 0?m:document).createElement(n);w.setAttribute("data-mce-caret",c?"before":"after"),w.setAttribute("data-mce-bogus","all"),w.appendChild(Oe().dom);const x=i.parentNode;return c?x==null||x.insertBefore(w,i):i.nextSibling?x==null||x.insertBefore(w,i.nextSibling):x==null||x.appendChild(w),w},dh=n=>es(n)&&n.data[0]===Ft,fr=n=>es(n)&&n.data[n.data.length-1]===Ft,Gm=n=>{var i;const c=n.getElementsByTagName("br"),m=c[c.length-1];Pd(m)&&((i=m.parentNode)===null||i===void 0||i.removeChild(m))},Km=n=>n&&n.hasAttribute("data-mce-caret")?(Gm(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),uu=ba,Xp=Es,Jm=mi,Ps=_n,Fr=Rf(["script","style","textarea"]),Ma=Rf(["img","input","textarea","hr","iframe","video","audio","object","embed"]),gc=Rf(["table"]),eb=_r,Tl=n=>eb(n)?!1:Ps(n)?!Fr(n.parentNode):Ma(n)||Jm(n)||gc(n)||fu(n),Gi=n=>Jn(n)&&n.getAttribute("unselectable")==="true",fu=n=>!Gi(n)&&Xp(n),Nf=(n,i)=>{for(let c=n.parentNode;c&&c!==i;c=c.parentNode){if(fu(c))return!1;if(uu(c))return!0}return!0},Jw=n=>fu(n)?!Hn(Rr(n.getElementsByTagName("*")),(i,c)=>i||uu(c),!1):!1,om=n=>Ma(n)||Jw(n),Gg=(n,i)=>Tl(n)&&Nf(n,i),sm=/^[ \t\r\n]*$/,eg=n=>sm.test(n),Kg=n=>{for(const i of n)if(!a0(i))return!1;return!0},u0=n=>" \f \v".indexOf(n)!==-1,rm=n=>n===` -`||n==="\r",Ra=(n,i)=>i=0?rm(n[i]):!1,hh=(n,i=4,c=!0,m=!0)=>{const p=xu(" ",i),w=n.replace(/\t/g,p);return Hn(w,(M,B)=>u0(B)||B===Gr?M.pcIsSpace||M.str===""&&c||M.str.length===w.length-1&&m||Ra(w,M.str.length+1)?{pcIsSpace:!1,str:M.str+Gr}:{pcIsSpace:!0,str:M.str+" "}:{pcIsSpace:rm(B),str:M.str+B},{pcIsSpace:!1,str:""}).str},$d=(n,i)=>{const c=Ke.fromDom(i),m=Ke.fromDom(n);return Ty(m,"pre,code",Be(bt,c))},tg=(n,i)=>_n(n)&&eg(n.data)&&!$d(n,i),ng=n=>Jn(n)&&n.nodeName==="A"&&!n.hasAttribute("href")&&(n.hasAttribute("name")||n.hasAttribute("id")),im=(n,i)=>Tl(n)&&!tg(n,i)||ng(n)||rf(n),rf=Vc("data-mce-bookmark"),f0=Vc("data-mce-bogus"),tb=jg("data-mce-bogus","all"),e_=(n,i)=>{let c=0;if(im(n,n))return!1;{let m=n.firstChild;if(!m)return!0;const p=new wi(m,n);do{if(i){if(tb(m)){m=p.next(!0);continue}if(f0(m)){m=p.next();continue}}if(mi(m)){c++,m=p.next();continue}if(im(m,n))return!1;m=p.next()}while(m);return c<=1}},$a=(n,i=!0)=>e_(n.dom,i),Jg="data-mce-block",og=n=>Dt(bs(n),i=>!/[A-Z]/.test(i)),du=n=>og(n).join(","),If=(n,i)=>pe(i.querySelector(n))?(i.setAttribute(Jg,"true"),i.getAttribute("data-mce-selected")==="inline-boundary"&&i.removeAttribute("data-mce-selected"),!0):(i.removeAttribute(Jg),!1),sg=(n,i)=>{const c=du(n.getTransparentElements()),m=du(n.getBlockElements());return Dt(i.querySelectorAll(c),p=>If(m,p))},mh=(n,i)=>{var c;const m=i?"lastChild":"firstChild";for(let p=n[m];p;p=p[m])if($a(Ke.fromDom(p))){(c=p.parentNode)===null||c===void 0||c.removeChild(p);return}},Bu=(n,i)=>{const c=document.createRange(),m=n.parentNode;if(m){c.setStartBefore(n),c.setEndBefore(i);const p=c.extractContents();mh(p,!0),c.setStartAfter(i),c.setEndAfter(n);const w=c.extractContents();mh(w,!1),$a(Ke.fromDom(p))||m.insertBefore(p,n),$a(Ke.fromDom(i))||m.insertBefore(i,n),$a(Ke.fromDom(w))||m.insertBefore(w,n),m.removeChild(n)}},Nd=(n,i,c)=>{const m=n.getBlockElements(),p=Ke.fromDom(i),w=M=>ei(M)in m,x=M=>bt(M,p);$e(ah(c),M=>{di(M,w,x).each(B=>{const G=r0(M,ae=>w(ae)&&!n.isValidChild(ei(B),ei(ae)));if(G.length>0){const ae=yi(B);$e(G,fe=>{di(fe,w,x).each(ve=>{Bu(ve.dom,fe.dom)})}),ae.each(fe=>sg(n,fe.dom))}})})},rg=(n,i,c)=>{$e([...c,...ig(n,i)?[i]:[]],m=>$e(pl(Ke.fromDom(m),m.nodeName.toLowerCase()),p=>{Iv(n,p.dom)&&Kl(p)}))},d0=(n,i)=>{const c=sg(n,i);Nd(n,i,c),rg(n,i,c)},Rv=(n,i)=>{if(Nv(n,i)){const c=du(n.getBlockElements());If(c,i)}},$v=(n,i,c)=>{const m=w=>bt(w,Ke.fromDom(i)),p=nh(Ke.fromDom(c),m);jr(p,p.length-2).filter(kl).fold(()=>d0(n,i),w=>d0(n,w.dom))},gh=n=>n.hasAttribute(Jg),ep=(n,i)=>un(n.getTransparentElements(),i),Nv=(n,i)=>Jn(i)&&ep(n,i.nodeName),ig=(n,i)=>Nv(n,i)&&gh(i),Iv=(n,i)=>Nv(n,i)&&!gh(i),sr=(n,i)=>i.type===1&&ep(n,i.name)&&L(i.attr(Jg)),Ao=ys().browser,ph=n=>oo(n,kl),nb=n=>Ao.isFirefox()&&ei(n)==="table"?ph(Da(n)).filter(i=>ei(i)==="caption").bind(i=>ph(il(i)).map(c=>{const m=c.dom.offsetTop,p=i.dom.offsetTop,w=i.dom.offsetHeight;return m<=p?-w:0})).getOr(0):0,tp=(n,i)=>n.children&&xt(n.children,i),WC=(n,i,c)=>{let m=0,p=0;const w=n.ownerDocument;if(c=c||n,i){if(c===n&&i.getBoundingClientRect&&Bi(Ke.fromDom(n),"position")==="static"){const M=i.getBoundingClientRect();return m=M.left+(w.documentElement.scrollLeft||n.scrollLeft)-w.documentElement.clientLeft,p=M.top+(w.documentElement.scrollTop||n.scrollTop)-w.documentElement.clientTop,{x:m,y:p}}let x=i;for(;x&&x!==c&&x.nodeType&&!tp(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&&!tp(x,c);)m-=x.scrollLeft||0,p-=x.scrollTop||0,x=x.parentNode;p+=nb(Ke.fromDom(i))}return{x:m,y:p}},Bv=(n,i={})=>{let c=0;const m={},p=Ke.fromDom(n),w=Eo(p),x=Pe=>{i.referrerPolicy=Pe},M=Pe=>{i.contentCssCors=Pe},B=Pe=>{na(em(p),Pe)},G=Pe=>{const Ve=em(p);Je(Ve,"#"+Pe).each(wr)},ae=Pe=>wo(m,Pe).getOrThunk(()=>({id:"mce-u"+c++,passed:[],failed:[],count:0})),fe=Pe=>new Promise((Ve,mt)=>{let vt;const St=hn._addCacheSuffix(Pe),Mt=ae(St);m[St]=Mt,Mt.count++;const dn=(Zt,yn)=>{$e(Zt,Cn),Mt.status=yn,Mt.passed=[],Mt.failed=[],vt&&(vt.onload=null,vt.onerror=null,vt=null)},Zn=()=>dn(Mt.passed,2),$n=()=>dn(Mt.failed,3);if(Ve&&Mt.passed.push(Ve),mt&&Mt.failed.push(mt),Mt.status===1)return;if(Mt.status===2){Zn();return}if(Mt.status===3){$n();return}Mt.status=1;const Lt=Ke.fromTag("link",w.dom);Ku(Lt,{rel:"stylesheet",type:"text/css",id:Mt.id}),i.contentCssCors&&Pr(Lt,"crossOrigin","anonymous"),i.referrerPolicy&&Pr(Lt,"referrerpolicy",i.referrerPolicy),vt=Lt.dom,vt.onload=Zn,vt.onerror=$n,B(Lt),Pr(Lt,"href",St)}),ve=Pe=>Promise.allSettled(gt(Pe,mt=>fe(mt).then(He(mt)))).then(mt=>{const vt=gn(mt,St=>St.status==="fulfilled");return vt.fail.length>0?Promise.reject(gt(vt.fail,St=>St.reason)):gt(vt.pass,St=>St.value)}),Le=Pe=>{const Ve=hn._addCacheSuffix(Pe);wo(m,Ve).each(mt=>{--mt.count===0&&(delete m[Ve],G(mt.id))})};return{load:fe,loadAll:ve,unload:Le,unloadAll:Pe=>{$e(Pe,Ve=>{Le(Ve)})},_setReferrerPolicy:x,_setContentCssCors:M}},Lv=(()=>{const n=new WeakMap;return{forElement:(c,m)=>{const w=ql(c).dom;return he.from(n.get(w)).getOrThunk(()=>{const x=Bv(w,m);return n.set(w,x),x})}}})(),ob=n=>n.nodeName.toLowerCase()==="span",Ey=(n,i)=>pe(n)&&(im(n,i)||Dc(Ke.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),w=Se(m)||Ey(m,i);return p&&w},Id=n=>ob(n)&&n.getAttribute("data-mce-type")==="bookmark",t_=(n,i)=>_n(n)&&n.data.length>0&&on(n,i),h0=n=>Jn(n)?n.childNodes.length>0:!1,UC=n=>K1(n)||nf(n),ag=(n,i,c)=>{var m;const p=c||i;if(Jn(i)&&Id(i))return i;const w=i.childNodes;for(let x=w.length-1;x>=0;x--)ag(n,w[x],p);if(Jn(i)){const x=i.childNodes;x.length===1&&Id(x[0])&&((m=i.parentNode)===null||m===void 0||m.insertBefore(x[0],i))}return!UC(i)&&!im(i,p)&&!h0(i)&&!t_(i,p)&&n.remove(i),i},Ay=hn.makeMap,am=/[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Bd=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,lg=/[<>&\"\']/g,Si=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,Ld={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"},Fd={'"':""","'":"'","<":"<",">":">","&":"&","`":"`"},hu={"<":"<",">":">","&":"&",""":'"',"'":"'"},Qs=n=>{const i=Ke.fromTag("div").dom;return i.innerHTML=n,i.textContent||i.innerText||n},jp=(n,i)=>{const c={};if(n){const m=n.split(",");i=i||10;for(let p=0;pn.replace(i?am:Bd,c=>Fd[c]||c),YC=n=>(""+n).replace(lg,i=>Fd[i]||i),m0=(n,i)=>n.replace(i?am:Bd,c=>c.length>1?"&#"+((c.charCodeAt(0)-55296)*1024+(c.charCodeAt(1)-56320)+65536)+";":Fd[c]||"&#"+c.charCodeAt(0)+";"),Fv=(n,i,c)=>{const m=c||bh;return n.replace(i?am:Bd,p=>Fd[p]||m[p]||p)},op={encodeRaw:np,encodeAllRaw:YC,encodeNumeric:m0,encodeNamed:Fv,getEncodeFunc:(n,i)=>{const c=jp(i)||bh,m=(x,M)=>x.replace(M?am:Bd,B=>Fd[B]!==void 0?Fd[B]:c[B]!==void 0?c[B]:B.length>1?"&#"+((B.charCodeAt(0)-55296)*1024+(B.charCodeAt(1)-56320)+65536)+";":"&#"+B.charCodeAt(0)+";"),p=(x,M)=>Fv(x,M,c),w=Ay(n.replace(/\+/g,","));return w.named&&w.numeric?m:w.named?i?p:Fv:w.numeric?m0:np},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))):Ld[c]||String.fromCharCode(c)):hu[i]||bh[i]||Qs(i))},Al=(n,i)=>(n=hn.trim(n),n?n.split(i||" "):[]),Dy=n=>new RegExp("^"+n.replace(/([?+*])/g,".$1")+"$"),io=n=>{const i=/^(~)?(.+)$/;return Rs(Al(n,","),c=>{const m=i.exec(c);if(m){const p=m[1]==="~",w=p?"span":"div",x=m[2];return[{inline:p,cloneName:w,name:x}]}else return[]})},Py=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 w="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 "+w,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}},XC=n=>{const{globalAttributes:i,phrasingContent:c,flowContent:m}=Py(n),p={},w=(M,B="",G="")=>{const ae=Al(G),fe=Al(M);let ve=fe.length;for(;ve--;){const Le=Al([i,B].join(" "));p[fe[ve]]={attributes:ur(Le,He({})),attributesOrder:Le,children:ur(ae,He({}))}}},x=(M,B)=>{const G=Al(M),ae=Al(B);let fe=G.length;for(;fe--;){const ve=p[G[fe]];for(let Le=0,Ye=ae.length;Le{w(G,"",c)}),$e(Al("center dir isindex noframes"),G=>{w(G,"",m)})),w("html","manifest","head body"),w("head","","base command link meta noscript script style title"),w("title hr noscript br"),w("base","href target"),w("link","href rel media hreflang type sizes hreflang"),w("meta","name http-equiv content charset"),w("style","media type scoped"),w("script","src async defer type charset"),w("body","onafterprint onbeforeprint onbeforeunload onblur onerror onfocus onhashchange onload onmessage onoffline ononline onpagehide onpageshow onpopstate onresize onscroll onstorage onunload",m),w("dd div","",m),w("address dt caption","",n==="html4"?c:m),w("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),w("blockquote","cite",m),w("ol","reversed start type","li"),w("ul","","li"),w("li","value",m),w("dl","","dt dd"),w("a","href target rel media hreflang type",n==="html4"?c:m),w("q","cite",c),w("ins del","cite datetime",m),w("img","src sizes srcset alt usemap ismap width height"),w("iframe","src name width height",m),w("embed","src type width height"),w("object","data type typemustmatch name usemap form width height",[m,"param"].join(" ")),w("param","name value"),w("map","name",[m,"area"].join(" ")),w("area","alt coords shape href target rel media hreflang type"),w("table","border","caption colgroup thead tfoot tbody tr"+(n==="html4"?" col":"")),w("colgroup","span","col"),w("col","span"),w("tbody thead tfoot","","tr"),w("tr","","td th"),w("td","colspan rowspan headers",m),w("th","colspan rowspan headers scope abbr",m),w("form","accept-charset action autocomplete enctype method name novalidate target",m),w("fieldset","disabled form name",[m,"legend"].join(" ")),w("label","form for",c),w("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"),w("button","disabled form formaction formenctype formmethod formnovalidate formtarget name type value",n==="html4"?m:c),w("select","disabled form multiple name required size","option optgroup"),w("optgroup","disabled label","option"),w("option","disabled label selected value"),w("textarea","cols dirname disabled form maxlength name readonly required rows wrap"),w("menu","type label",[m,"li"].join(" ")),w("noscript","",m),n!=="html4"&&(w("wbr"),w("ruby","",[c,"rt rp"].join(" ")),w("figcaption","",m),w("mark rt rp summary bdi","",c),w("canvas","width height",m),w("video","src crossorigin poster preload autoplay mediagroup loop muted controls width height buffered",[m,"track source"].join(" ")),w("audio","src crossorigin preload autoplay mediagroup loop muted controls buffered volume",[m,"track source"].join(" ")),w("picture","","img source"),w("source","src srcset type media sizes"),w("track","kind src srclang label default"),w("datalist","",[c,"option"].join(" ")),w("article section nav aside main header footer","",m),w("hgroup","","h1 h2 h3 h4 h5 h6"),w("figure","",[m,"figcaption"].join(" ")),w("time","datetime",c),w("dialog","open",m),w("command","type label icon disabled checked radiogroup command"),w("output","for form name",c),w("progress","value max",c),w("meter","value min max low high optimum",c),w("details","open",[m,"summary"].join(" ")),w("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"&&$e([p.video,p.audio],M=>{delete M.children.audio,delete M.children.video}),$e(Al("a form meter progress dfn"),M=>{p[M]&&delete p[M].children[M]}),delete p.caption.children.table,delete p.script,p},My=n=>n==="-"?"remove":"add",lm=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],w=p?My(p):"replace",x=m[2],M=Al(m[3],"|");return[{operation:w,name:x,validChildren:M}]}else return[]})},af=(n,i)=>{const c=/^([!\-])?(\w+[\\:]:\w+|[^=~<]+)?(?:([=~<])(.*))?$/,m=/[*?+]/,{attributes:p,attributesOrder:w}=i;return $e(Al(n,"|"),x=>{const M=c.exec(x);if(M){const B={},G=M[1],ae=M[2].replace(/[\\:]:/g,":"),fe=M[3],ve=M[4];if(G==="!"&&(i.attributesRequired=i.attributesRequired||[],i.attributesRequired.push(ae),B.required=!0),G==="-"){delete p[ae],w.splice(hn.inArray(w,ae),1);return}if(fe&&(fe==="="?(i.attributesDefault=i.attributesDefault||[],i.attributesDefault.push({name:ae,value:ve}),B.defaultValue=ve):fe==="~"?(i.attributesForced=i.attributesForced||[],i.attributesForced.push({name:ae,value:ve}),B.forcedValue=ve):fe==="<"&&(B.validValues=hn.makeMap(ve,"?"))),m.test(ae)){const Le=B;i.attributePatterns=i.attributePatterns||[],Le.pattern=Dy(ae),i.attributePatterns.push(Le)}else p[ae]||w.push(ae),p[ae]=B}})},vh=(n,i)=>{ln(n.attributes,(c,m)=>{i.attributes[m]=c}),i.attributesOrder.push(...n.attributesOrder)},sp=(n,i)=>{const c=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)])?$/;return Rs(Al(i,","),m=>{const p=c.exec(m);if(p){const w=p[1],x=p[2],M=p[3],B=p[4],G=p[5],ae={attributes:{},attributesOrder:[]};if(n.each(fe=>vh(fe,ae)),w==="#"?ae.paddEmpty=!0:w==="-"&&(ae.removeEmpty=!0),B==="!"&&(ae.removeEmptyAttrs=!0),G&&af(G,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[]})},Oh={},g0=hn.makeMap,Bf=hn.each,rp=hn.extend,Ry=hn.explode,qp=(n,i={})=>{const c=g0(n," ",g0(n.toUpperCase()," "));return rp(c,i)},sd=n=>qp("td th li dt dd figcaption caption details summary",n.getTextBlockElements()),$y=(n,i)=>{if(n){const c={};return L(n)&&(n={"*":n}),Bf(n,(m,p)=>{c[p]=c[p.toUpperCase()]=i==="map"?g0(m,/[, ]/):Ry(m,/[, ]/)}),c}else return},yh=(n={})=>{var i;const c={},m={};let p=[];const w={},x={},M=(co,Us,ci)=>{const Ja=n[co];if(Ja)return g0(Ja,/[, ]/,g0(Ja.toUpperCase(),/[, ]/));{let Ti=Oh[co];return Ti||(Ti=qp(Us,ci),Oh[co]=Ti),Ti}},B=(i=n.schema)!==null&&i!==void 0?i:"html5",G=XC(B);n.verify_html===!1&&(n.valid_elements="*[*]");const ae=$y(n.valid_styles),fe=$y(n.invalid_styles,"map"),ve=$y(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"),Ve=M("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls allowfullscreen"),mt="td th iframe video audio object script code",vt=M("non_empty_elements",mt+" pre",Pe),St=M("move_caret_before_on_enter_elements",mt+" 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"),$n=M("transparent_elements","a ins del canvas map");Bf("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=/[*?+]/;$e(sp(Us,co!=null?co:""),({name:Ja,element:Ti,aliasName:$c})=>{if($c&&(c[$c]=Ti),ci.test(Ja)){const Fh=Ti;Fh.pattern=Dy(Ja),p.push(Fh)}else c[Ja]=Ti})},Zt=co=>{p=[],$e(bs(c),Us=>{delete c[Us]}),Lt(co)},yn=co=>{delete Oh.text_block_elements,delete Oh.block_elements,$e(io(co!=null?co:""),({inline:Us,name:ci,cloneName:Ja})=>{if(m[ci]=m[Ja],w[ci]=Ja,vt[ci.toUpperCase()]={},vt[ci]={},Us||(dn[ci.toUpperCase()]={},dn[ci]={}),!c[ci]){let Ti=c[Ja];Ti=rp({},Ti),delete Ti.removeEmptyAttrs,delete Ti.removeEmpty,c[ci]=Ti}ln(m,(Ti,$c)=>{Ti[Ja]&&(m[$c]=Ti=rp({},m[$c]),Ti[ci]=Ti[Ja])})})},bo=co=>{$e(lm(co!=null?co:""),({operation:Us,name:ci,validChildren:Ja})=>{const Ti=Us==="replace"?{"#comment":{}}:m[ci];$e(Ja,$c=>{Us==="remove"?delete Ti[$c]:Ti[$c]={}}),m[ci]=Ti})},Do=co=>{const Us=c[co];if(Us)return Us;let ci=p.length;for(;ci--;){const Ja=p[ci];if(Ja.pattern.test(co))return Ja}};n.valid_elements?(Zt(n.valid_elements),Bf(G,(co,Us)=>{m[Us]=co.children})):(Bf(G,(co,Us)=>{c[Us]={attributes:co.attributes,attributesOrder:co.attributesOrder},m[Us]=co.children}),Bf(Al("strong/b em/i"),co=>{const Us=Al(co,"/");c[Us[1]].outputName=Us[0]}),Bf(Zn,(co,Us)=>{c[Us]&&(n.padd_empty_block_inline_children&&(c[Us].paddInEmptyBlock=!0),c[Us].removeEmpty=!0)}),Bf(Al("ol ul blockquote a table tbody"),co=>{c[co]&&(c[co].removeEmpty=!0)}),Bf(Al("p h1 h2 h3 h4 h5 h6 th td pre div address caption li summary"),co=>{c[co]&&(c[co].paddEmpty=!0)}),Bf(Al("span"),co=>{c[co].removeEmptyAttrs=!0})),yn(n.custom_elements),bo(n.valid_children),Lt(n.extended_valid_elements),bo("+ol[ul|ol],+ul[ul|ol]"),Bf({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&&Bf(Ry(n.invalid_elements),co=>{c[co]&&delete c[co]}),Do("span")||Lt("span[!data-mce-type|*]");const Cs=He(ae),Ws=He(fe),Ir=He(ve),pi=He(Ve),fl=He(dn),Il=He(Mt),Oc=He(Zn),Pn=He(Object.seal(Pe)),eo=He(Ye),Cr=He(vt),Is=He(St),Co=He(Le),Mn=He($n),En=He(Object.seal(x)),Xo=(co,Us)=>{const ci=m[co.toLowerCase()];return!!(ci&&ci[Us.toLowerCase()])},Ks=(co,Us)=>{const ci=Do(co);if(ci)if(Us){if(ci.attributes[Us])return!0;const Ja=ci.attributePatterns;if(Ja){let Ti=Ja.length;for(;Ti--;)if(Ja[Ti].pattern.test(Us))return!0}}else return!0;return!1},Kr=He(w);return{type:B,children:m,elements:c,getValidStyles:Cs,getValidClasses:Ir,getBlockElements:fl,getInvalidStyles:Ws,getVoidElements:Pn,getTextBlockElements:Il,getTextInlineElements:Oc,getBoolAttrs:pi,getElementRule:Do,getSelfClosingElements:eo,getNonEmptyElements:Cr,getMoveCaretBeforeOnEnterElements:Is,getWhitespaceElements:Co,getTransparentElements:Mn,getSpecialElements:En,isValidChild:Xo,isValid:Ks,getCustomElements:Kr,addValidElements:Lt,setValidElements:Zt,addCustomElements:yn,addValidChildren:bo}},Qv=(n={},i)=>{const c=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,m=/\s*([^:]+):\s*([^;]+);?/g,p=/\s+$/,w={};let x,M;const B=nn;i&&(x=i.getValidStyles(),M=i.getInvalidStyles());const G=(`\\" \\' \\; \\: ; : `+B).split(" ");for(let fe=0;fe{const ve={};let Le=!1;const Ye=n.url_converter,Pe=n.url_converter_scope||ae,Ve=(Lt,Zt,yn)=>{const bo=ve[Lt+"-top"+Zt];if(!bo)return;const Do=ve[Lt+"-right"+Zt];if(!Do)return;const Cs=ve[Lt+"-bottom"+Zt];if(!Cs)return;const Ws=ve[Lt+"-left"+Zt];if(!Ws)return;const Ir=[bo,Do,Cs,Ws];let pi=Ir.length-1;for(;pi--&&Ir[pi]===Ir[pi+1];);pi>-1&&yn||(ve[Lt+Zt]=pi===-1?Ir[0]:Ir.join(" "),delete ve[Lt+"-top"+Zt],delete ve[Lt+"-right"+Zt],delete ve[Lt+"-bottom"+Zt],delete ve[Lt+"-left"+Zt])},mt=Lt=>{const Zt=ve[Lt];if(!Zt)return;const yn=Zt.indexOf(",")>-1?[Zt]:Zt.split(" ");let bo=yn.length;for(;bo--;)if(yn[bo]!==yn[0])return!1;return ve[Lt]=yn[0],!0},vt=(Lt,Zt,yn,bo)=>{!mt(Zt)||!mt(yn)||!mt(bo)||(ve[Lt]=ve[Zt]+" "+ve[yn]+" "+ve[bo],delete ve[Zt],delete ve[yn],delete ve[bo])},St=Lt=>(Le=!0,w[Lt]),Mt=(Lt,Zt)=>(Le&&(Lt=Lt.replace(/\uFEFF[0-9]/g,yn=>w[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),$n=(Lt,Zt,yn,bo,Do,Cs)=>{if(Do=Do||Cs,Do)return Do=Mt(Do),"'"+Do.replace(/\'/g,"\\'")+"'";if(Zt=Mt(Zt||yn||bo||""),!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,St).replace(/\"[^\"]+\"|\'[^\']+\'/g,Zt=>Zt.replace(/[;:]/g,St));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(B)!==-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,$n),ve[Zt]=Le?Mt(yn,!0):yn}}Ve("border","",!0),Ve("border","-width"),Ve("border","-color"),Ve("border","-style"),Ve("padding",""),Ve("margin",""),vt("border","border-width","border-style","border-color"),ve.border==="medium none"&&delete ve.border,ve["border-image"]==="none"&&delete ve["border-image"]}return ve},serialize:(fe,ve)=>{let Le="";const Ye=(Ve,mt)=>{const vt=mt[Ve];if(vt)for(let St=0,Mt=vt.length;St0?" ":"")+dn+": "+Zn+";")}},Pe=(Ve,mt)=>{if(!M||!mt)return!0;let vt=M["*"];return vt&&vt[Ve]?!1:(vt=M[mt],!(vt&&vt[Ve]))};return ve&&x?(Ye("*",x),Ye(ve,x)):ln(fe,(Ve,mt)=>{Ve&&Pe(mt,ve)&&(Le+=(Le.length>0?" ":"")+mt+": "+Ve+";")}),Le}};return ae},n_={keyLocation:!0,layerX:!0,layerY:!0,returnValue:!0,webkitMovementX:!0,webkitMovementY:!0,keyIdentifier:!0,mozPressure:!0},Ny=n=>n instanceof Event||ce(n.initEvent),ip=n=>n.isDefaultPrevented===ht||n.isDefaultPrevented===je,Lf=n=>Ne(n.preventDefault)||Ny(n),mu=(n,i)=>{const c=i!=null?i:{};for(const m in n)un(n_,m)||(c[m]=n[m]);return pe(n.composedPath)&&(c.composedPath=()=>n.composedPath()),c},ap=(n,i,c,m)=>{var p;const w=mu(i,m);return w.type=n,Ne(w.target)&&(w.target=(p=w.srcElement)!==null&&p!==void 0?p:c),Lf(i)&&(w.preventDefault=()=>{w.defaultPrevented=!0,w.isDefaultPrevented=ht,ce(i.preventDefault)&&i.preventDefault()},w.stopPropagation=()=>{w.cancelBubble=!0,w.isPropagationStopped=ht,ce(i.stopPropagation)&&i.stopPropagation()},w.stopImmediatePropagation=()=>{w.isImmediatePropagationStopped=ht,w.stopPropagation()},ip(w)||(w.isDefaultPrevented=w.defaultPrevented===!0?ht:je,w.isPropagationStopped=w.cancelBubble===!0?ht:je,w.isImmediatePropagationStopped=je)),w},Iy="mce-data-",o_=/^(?:mouse|contextmenu)|click/,p0=(n,i,c,m)=>{n.addEventListener(i,c,m||!1)},Yc=(n,i,c,m)=>{n.removeEventListener(i,c,m||!1)},b0=n=>pe(n)&&o_.test(n.type),lf=(n,i)=>{const c=ap(n.type,n,document,i);if(b0(n)&&Se(n.pageX)&&!Se(n.clientX)){const m=c.target.ownerDocument||document,p=m.documentElement,w=m.body,x=c;x.pageX=n.clientX+(p&&p.scrollLeft||w&&w.scrollLeft||0)-(p&&p.clientLeft||w&&w.clientLeft||0),x.pageY=n.clientY+(p&&p.scrollTop||w&&w.scrollTop||0)-(p&&p.clientTop||w&&w.clientTop||0)}return c},lp=(n,i,c)=>{const m=n.document,p={type:"ready"};if(c.domLoaded){i(p);return}const w=()=>m.readyState==="complete"||m.readyState==="interactive"&&m.body,x=()=>{Yc(n,"DOMContentLoaded",x),Yc(n,"load",x),c.domLoaded||(c.domLoaded=!0,i(p)),n=null};w()?x():p0(n,"DOMContentLoaded",x),c.domLoaded||p0(n,"load",x)};class cm{constructor(){this.domLoaded=!1,this.events={},this.count=1,this.expando=Iy+(+new Date).toString(32),this.hasFocusIn="onfocusin"in document.documentElement,this.count=1}bind(i,c,m,p){const w=this;let x;const M=window,B=ve=>{w.executeHandlers(lf(ve||M.event),G)};if(!i||_n(i)||ch(i))return m;let G;i[w.expando]?G=i[w.expando]:(G=w.count++,i[w.expando]=G,w.events[G]={}),p=p||i;const ae=c.split(" ");let fe=ae.length;for(;fe--;){let ve=ae[fe],Le=B,Ye=!1,Pe=!1;if(ve==="DOMContentLoaded"&&(ve="ready"),w.domLoaded&&ve==="ready"&&i.readyState==="complete"){m.call(p,lf({type:ve}));continue}!w.hasFocusIn&&(ve==="focusin"||ve==="focusout")&&(Ye=!0,Pe=ve==="focusin"?"focus":"blur",Le=Ve=>{const mt=lf(Ve||M.event);mt.type=mt.type==="focus"?"focusin":"focusout",w.executeHandlers(mt,G)}),x=w.events[G][ve],x?ve==="ready"&&w.domLoaded?m(lf({type:ve})):x.push({func:m,scope:p}):(w.events[G][ve]=x=[{func:m,scope:p}],x.fakeName=Pe,x.capture=Ye,x.nativeHandler=Le,ve==="ready"?lp(i,Le,w):p0(i,Pe||ve,Le,Ye))}return i=x=null,m}unbind(i,c,m){if(!i||_n(i)||ch(i))return this;const p=i[this.expando];if(p){let w=this.events[p];if(c){const x=c.split(" ");let M=x.length;for(;M--;){const B=x[M],G=w[B];if(G){if(m){let ae=G.length;for(;ae--;)if(G[ae].func===m){const fe=G.nativeHandler,ve=G.fakeName,Le=G.capture,Ye=G.slice(0,ae).concat(G.slice(ae+1));Ye.nativeHandler=fe,Ye.fakeName=ve,Ye.capture=Le,w[B]=Ye}}(!m||G.length===0)&&(delete w[B],Yc(i,G.fakeName||B,G.nativeHandler,G.capture))}}}else ln(w,(x,M)=>{Yc(i,x.fakeName||M,x.nativeHandler,x.capture)}),w={};for(const x in w)if(un(w,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||_n(i)||ch(i))return this;const p=lf({type:c,target:i},m);do{const w=i[this.expando];w&&this.executeHandlers(p,w),i=i.parentNode||i.ownerDocument||i.defaultView||i.parentWindow}while(i&&!p.isPropagationStopped());return this}clean(i){if(!i||_n(i)||ch(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 w=0,x=p.length;w{Ne(c)||c===""?Vi(n,i):Pr(n,i,c)},v0=n=>n.replace(/[A-Z]/g,i=>"-"+i.toLowerCase()),sb=(n,i)=>{let c=0;if(n)for(let m=n.nodeType,p=n.previousSibling;p;p=p.previousSibling){const w=p.nodeType;i&&_n(p)&&(w===m||!p.data.length)||(c++,m=w)}return c},Ly=(n,i)=>{const c=Fl(i,"style"),m=n.serialize(n.parse(c),ei(i));cp(i,Gp,m)},Fy=(n,i)=>Xe(n)?un(By,i)?n+"":n+"px":n,r_=(n,i,c)=>{const m=v0(i);Ne(c)||c===""?Um(n,m):Gl(n,m,Fy(c,m))},jC=(n,i,c)=>{const m=i.keep_values,p={set:(x,M,B)=>{const G=Ke.fromDom(x);ce(i.url_converter)&&pe(M)&&(M=i.url_converter.call(i.url_converter_scope||c(),String(M),B,x));const ae="data-mce-"+B;cp(G,ae,M),cp(G,B,M)},get:(x,M)=>{const B=Ke.fromDom(x);return Fl(B,"data-mce-"+M)||Fl(B,M)}},w={style:{set:(x,M)=>{const B=Ke.fromDom(x);m&&cp(B,Gp,M),Vi(B,"style"),L(M)&&ua(B,n.parse(M))},get:x=>{const M=Ke.fromDom(x),B=Fl(M,Gp)||Fl(M,"style");return n.serialize(n.parse(B),ei(M))}}};return m&&(w.href=w.src=p),w},Qr=(n,i={})=>{const c={},m=window,p={};let w=0;const x=!0,M=!0,B=Lv.forElement(Ke.fromDom(n),{contentCssCors:i.contentCssCors,referrerPolicy:i.referrerPolicy}),G=[],ae=i.schema?i.schema:yh({}),fe=Qv({url_converter:i.url_converter,url_converter_scope:i.url_converter_scope},i.schema),ve=i.ownEvents?new cm:cm.Event,Le=ae.getBlockElements(),Ye=Rt=>L(Rt)?un(Le,Rt):Jn(Rt)&&(un(Le,Rt.nodeName)||ig(ae,Rt)),Pe=Rt=>Rt&&n&&L(Rt)?n.getElementById(Rt):Rt,Ve=Rt=>{const $t=Pe(Rt);return pe($t)?Ke.fromDom($t):null},mt=(Rt,$t,Rn="")=>{let xn;const No=Ve(Rt);if(pe(No)&&kl(No)){const br=Rw[$t];br&&br.get?xn=br.get(No.dom,$t):xn=Fl(No,$t)}return pe(xn)?xn:Rn},vt=Rt=>{const $t=Pe(Rt);return Ne($t)?[]:$t.attributes},St=(Rt,$t,Rn)=>{eo(Rt,xn=>{if(Jn(xn)){const No=Ke.fromDom(xn),br=Rn===""?null:Rn,ha=Fl(No,$t),Nc=Rw[$t];Nc&&Nc.set?Nc.set(No.dom,br,$t):cp(No,$t,br),ha!==br&&i.onSetAttrib&&i.onSetAttrib({attrElm:No.dom,attrName:$t,attrValue:br})}})},Mt=(Rt,$t)=>Rt.cloneNode($t),dn=()=>i.root_element||n.body,Zn=Rt=>{const $t=td(Rt);return{x:$t.x,y:$t.y,w:$t.width,h:$t.height}},$n=(Rt,$t)=>WC(n.body,Pe(Rt),$t),Lt=(Rt,$t,Rn)=>{eo(Rt,xn=>{const No=Ke.fromDom(xn);r_(No,$t,Rn),i.update_styles&&Ly(fe,No)})},Zt=(Rt,$t)=>{eo(Rt,Rn=>{const xn=Ke.fromDom(Rn);ln($t,(No,br)=>{r_(xn,br,No)}),i.update_styles&&Ly(fe,xn)})},yn=(Rt,$t,Rn)=>{const xn=Pe(Rt);if(!(Ne(xn)||!Jn(xn)))return Rn?Bi(Ke.fromDom(xn),v0($t)):($t=$t.replace(/-(\D)/g,(No,br)=>br.toUpperCase()),$t==="float"&&($t="cssFloat"),xn.style?xn.style[$t]:void 0)},bo=Rt=>{const $t=Pe(Rt);if(!$t)return{w:0,h:0};let Rn=yn($t,"width"),xn=yn($t,"height");return(!Rn||Rn.indexOf("px")===-1)&&(Rn="0"),(!xn||xn.indexOf("px")===-1)&&(xn="0"),{w:parseInt(Rn,10)||$t.offsetWidth||$t.clientWidth,h:parseInt(xn,10)||$t.offsetHeight||$t.clientHeight}},Do=Rt=>{const $t=Pe(Rt),Rn=$n($t),xn=bo($t);return{x:Rn.x,y:Rn.y,w:xn.w,h:xn.h}},Cs=(Rt,$t)=>{if(!Rt)return!1;const Rn=oe(Rt)?Rt:[Rt];return jt(Rn,xn=>Du(Ke.fromDom(xn),$t))},Ws=(Rt,$t,Rn,xn)=>{const No=[];let br=Pe(Rt);xn=xn===void 0;const ha=Rn||(dn().nodeName!=="BODY"?dn().parentNode:null);if(L($t))if($t==="*")$t=Jn;else{const Nc=$t;$t=_u=>Cs(_u,Nc)}for(;br&&!(br===ha||Ne(br.nodeType)||nf(br)||K1(br));){if(!$t||$t(br))if(xn)No.push(br);else return[br];br=br.parentNode}return xn?No:null},Ir=(Rt,$t,Rn)=>{const xn=Ws(Rt,$t,Rn,!1);return xn&&xn.length>0?xn[0]:null},pi=(Rt,$t,Rn)=>{let xn=$t;if(Rt){L($t)&&(xn=No=>Cs(No,$t));for(let No=Rt[Rn];No;No=No[Rn])if(ce(xn)&&xn(No))return No}return null},fl=(Rt,$t)=>pi(Rt,$t,"nextSibling"),Il=(Rt,$t)=>pi(Rt,$t,"previousSibling"),Oc=Rt=>ce(Rt.querySelectorAll),Pn=(Rt,$t)=>{var Rn,xn;const No=(xn=(Rn=Pe($t))!==null&&Rn!==void 0?Rn:i.root_element)!==null&&xn!==void 0?xn:n;return Oc(No)?Rr(No.querySelectorAll(Rt)):[]},eo=function(Rt,$t,Rn){const xn=Rn!=null?Rn:this;if(oe(Rt)){const No=[];return Zv(Rt,(br,ha)=>{const Nc=Pe(br);Nc&&No.push($t.call(xn,Nc,ha))}),No}else{const No=Pe(Rt);return No?$t.call(xn,No):!1}},Cr=(Rt,$t)=>{eo(Rt,Rn=>{ln($t,(xn,No)=>{St(Rn,No,xn)})})},Is=(Rt,$t)=>{eo(Rt,Rn=>{const xn=Ke.fromDom(Rn);Pf(xn,$t)})},Co=(Rt,$t,Rn,xn,No)=>eo(Rt,br=>{const ha=L($t)?n.createElement($t):$t;return pe(Rn)&&Cr(ha,Rn),xn&&(!L(xn)&&xn.nodeType?ha.appendChild(xn):L(xn)&&Is(ha,xn)),No?ha:br.appendChild(ha)}),Mn=(Rt,$t,Rn)=>Co(n.createElement(Rt),Rt,$t,Rn,!0),En=op.decode,Xo=op.encodeAllRaw,Ks=(Rt,$t,Rn="")=>{let xn="<"+Rt;for(const No in $t)ns($t,No)&&(xn+=" "+No+'="'+Xo($t[No])+'"');return ol(Rn)&&un(ae.getVoidElements(),Rt)?xn+" />":xn+">"+Rn+""},Kr=Rt=>{const $t=n.createElement("div"),Rn=n.createDocumentFragment();Rn.appendChild($t),Rt&&($t.innerHTML=Rt);let xn;for(;xn=$t.firstChild;)Rn.appendChild(xn);return Rn.removeChild($t),Rn},co=(Rt,$t)=>eo(Rt,Rn=>{const xn=Ke.fromDom(Rn);return $t&&$e(Da(xn),No=>{sl(No)&&No.dom.length===0?wr(No):Ca(xn,No)}),wr(xn),xn.dom}),Us=Rt=>eo(Rt,$t=>{const Rn=$t.attributes;for(let xn=Rn.length-1;xn>=0;xn--)$t.removeAttributeNode(Rn.item(xn))}),ci=Rt=>fe.parse(Rt),Ja=(Rt,$t)=>fe.serialize(Rt,$t),Ti=Rt=>{if(E1!==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 Rn=n.head;Rn.firstChild?Rn.insertBefore($t,Rn.firstChild):Rn.appendChild($t)}$t.styleSheet?$t.styleSheet.cssText+=Rt:$t.appendChild(n.createTextNode(Rt))},$c=Rt=>{Rt||(Rt=""),$e(Rt.split(","),$t=>{p[$t]=!0,B.load($t).catch(yt)})},Fh=(Rt,$t,Rn)=>{eo(Rt,xn=>{if(Jn(xn)){const No=Ke.fromDom(xn),br=$t.split(" ");$e(br,ha=>{pe(Rn)?(Rn?Ju:zc)(No,ha):Gh(No,ha)})}})},qd=(Rt,$t)=>{Fh(Rt,$t,!0)},Dm=(Rt,$t)=>{Fh(Rt,$t,!1)},qO=(Rt,$t)=>{const Rn=Ve(Rt),xn=$t.split(" ");return pe(Rn)&&er(xn,No=>Df(Rn,No))},Pw=Rt=>{eo(Rt,$t=>Um(Ke.fromDom($t),"display"))},GO=Rt=>{eo(Rt,$t=>Gl(Ke.fromDom($t),"display","none"))},KO=Rt=>{const $t=Ve(Rt);return pe($t)&&qr(Pa($t,"display"),"none")},Z4=Rt=>(Rt||"mce_")+w++,H4=Rt=>{const $t=Ve(Rt);return pe($t)?Jn($t.dom)?$t.dom.outerHTML:Yg($t):""},z4=(Rt,$t)=>{eo(Rt,Rn=>{Jn(Rn)&&(Rn.outerHTML=$t)})},FT=(Rt,$t)=>{const Rn=Pe($t);return eo(Rt,xn=>{const No=Rn==null?void 0:Rn.parentNode,br=Rn==null?void 0:Rn.nextSibling;return No&&(br?No.insertBefore(xn,br):No.appendChild(xn)),xn})},QT=(Rt,$t,Rn)=>eo($t,xn=>{var No;const br=oe($t)?Rt.cloneNode(!0):Rt;return Rn&&Zv(s_(xn.childNodes),ha=>{br.appendChild(ha)}),(No=xn.parentNode)===null||No===void 0||No.replaceChild(br,xn),xn}),ZT=(Rt,$t)=>{if(Rt.nodeName!==$t.toUpperCase()){const Rn=Mn($t);return Zv(vt(Rt),xn=>{St(Rn,xn.nodeName,mt(Rt,xn.nodeName))}),QT(Rn,Rt,!0),Rn}else return Rt},cC=(Rt,$t)=>{let Rn=Rt;for(;Rn;){let xn=$t;for(;xn&&Rn!==xn;)xn=xn.parentNode;if(Rn===xn)break;Rn=Rn.parentNode}return!Rn&&Rt.ownerDocument?Rt.ownerDocument.documentElement:Rn},T1=Rt=>{if(Jn(Rt)){const $t=Rt.nodeName.toLowerCase()==="a"&&!mt(Rt,"href")&&mt(Rt,"id");if(mt(Rt,"name")||mt(Rt,"data-mce-bookmark")||$t)return!0}return!1},uC=(Rt,$t,Rn)=>{let xn=0;if(T1(Rt))return!1;const No=Rt.firstChild;if(No){const br=new wi(No,Rt),ha=ae?ae.getWhitespaceElements():{},Nc=$t||(ae?ae.getNonEmptyElements():null);let _u=No;do{if(Jn(_u)){const YT=_u.getAttribute("data-mce-bogus");if(YT){_u=br.next(YT==="all");continue}const XT=_u.nodeName.toLowerCase();if(Nc&&Nc[XT]){if(XT==="br"){xn++,_u=br.next();continue}return!1}if(T1(_u))return!1}if(ch(_u)||_n(_u)&&!eg(_u.data)&&(!(Rn!=null&&Rn.includeZwsp)||!Kg(_u.data))||_n(_u)&&_u.parentNode&&ha[_u.parentNode.nodeName]&&eg(_u.data))return!1;_u=br.next()}while(_u)}return xn<=1},Mw=()=>n.createRange(),vv=(Rt,$t,Rn)=>{let xn=Mw(),No,br;if(Rt&&$t&&Rt.parentNode&&$t.parentNode){const ha=Rt.parentNode;return xn.setStart(ha,sb(Rt)),xn.setEnd($t.parentNode,sb($t)),No=xn.extractContents(),xn=Mw(),xn.setStart($t.parentNode,sb($t)+1),xn.setEnd(ha,sb(Rt)+1),br=xn.extractContents(),ha.insertBefore(ag(E1,No),Rt),Rn?ha.insertBefore(Rn,Rt):ha.insertBefore($t,Rt),ha.insertBefore(ag(E1,br),Rt),co(Rt),Rn||$t}else return},HT=(Rt,$t,Rn,xn)=>{if(oe(Rt)){let No=Rt.length;const br=[];for(;No--;)br[No]=HT(Rt[No],$t,Rn,xn);return br}else return i.collect&&(Rt===n||Rt===m)&&G.push([Rt,$t,Rn,xn]),ve.bind(Rt,$t,Rn,xn||E1)},zT=(Rt,$t,Rn)=>{if(oe(Rt)){let xn=Rt.length;const No=[];for(;xn--;)No[xn]=zT(Rt[xn],$t,Rn);return No}else{if(G.length>0&&(Rt===n||Rt===m)){let xn=G.length;for(;xn--;){const[No,br,ha]=G[xn];Rt===No&&(!$t||$t===br)&&(!Rn||Rn===ha)&&ve.unbind(No,br,ha)}}return ve.unbind(Rt,$t,Rn)}},Ib=(Rt,$t,Rn)=>ve.dispatch(Rt,$t,Rn),Ov=(Rt,$t,Rn)=>ve.dispatch(Rt,$t,Rn),VT=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},E1={doc:n,settings:i,win:m,files:p,stdMode:x,boxModel:M,styleSheetLoader:B,boundEvents:G,styles:fe,schema:ae,events:ve,isBlock:Ye,root:null,clone:Mt,getRoot:dn,getViewPort:Zn,getRect:Do,getSize:bo,getParent:Ir,getParents:Ws,get:Pe,getNext:fl,getPrev:Il,select:Pn,is:Cs,add:Co,create:Mn,createHTML:Ks,createFragment:Kr,remove:co,setStyle:Lt,getStyle:yn,setStyles:Zt,removeAllAttribs:Us,setAttrib:St,setAttribs:Cr,getAttrib:mt,getPos:$n,parseStyle:ci,serializeStyle:Ja,addStyle:Ti,loadCSS:$c,addClass:qd,removeClass:Dm,hasClass:qO,toggleClass:Fh,show:Pw,hide:GO,isHidden:KO,uniqueId:Z4,setHTML:Is,getOuterHTML:H4,setOuterHTML:z4,decode:En,encode:Xo,insertAfter:FT,replace:QT,rename:ZT,findCommonAncestor:cC,run:eo,getAttribs:vt,isEmpty:uC,createRng:Mw,nodeIndex:sb,split:vv,bind:HT,unbind:zT,fire:Ov,dispatch:Ib,getContentEditable:VT,getContentEditableParent:Rt=>{const $t=dn();let Rn=null;for(let xn=Rt;xn&&xn!==$t&&(Rn=VT(xn),Rn===null);xn=xn.parentNode);return Rn},isEditable:Rt=>{if(pe(Rt)){const $t=Jn(Rt)?Rt:Rt.parentElement;return pe($t)&&wn(Ke.fromDom($t))}else return!1},destroy:()=>{if(G.length>0){let Rt=G.length;for(;Rt--;){const[$t,Rn,xn]=G[Rt];ve.unbind($t,Rn,xn)}}ln(p,(Rt,$t)=>{B.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},Rw=jC(fe,i,He(E1));return E1};Qr.DOM=Qr(document),Qr.nodeIndex=sb;const Hv=Qr.DOM,Qy=0,Zy=1,O0=2,qC=3;class um{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=Hv;let w;const x=()=>{p.remove(G),w&&(w.onerror=w.onload=w=null)},M=()=>{x(),c()},B=()=>{x(),m("Failed to load script: "+i)},G=p.uniqueId();w=document.createElement("script"),w.id=G,w.type="text/javascript",w.src=hn._addCacheSuffix(i),this.settings.referrerPolicy&&p.setAttrib(w,"referrerpolicy",this.settings.referrerPolicy),w.onload=M,w.onerror=B,(document.getElementsByTagName("head")[0]||document.body).appendChild(w)})}isDone(i){return this.states[i]===O0}markDone(i){this.states[i]=O0}add(i){const c=this;return c.queue.push(i),c.states[i]===void 0&&(c.states[i]=Qy),new Promise((p,w)=>{c.scriptLoadedCallbacks[i]||(c.scriptLoadedCallbacks[i]=[]),c.scriptLoadedCallbacks[i].push({resolve:p,reject:w})})}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=(B,G)=>{wo(c.scriptLoadedCallbacks,G).each(ae=>{$e(ae,fe=>fe[B](G))}),delete c.scriptLoadedCallbacks[G]},p=B=>{const G=Dt(B,ae=>ae.status==="rejected");return G.length>0?Promise.reject(Rs(G,({reason:ae})=>oe(ae)?ae:[ae])):Promise.resolve()},w=B=>Promise.allSettled(gt(B,G=>c.states[G]===O0?(m("resolve",G),Promise.resolve()):c.states[G]===qC?(m("reject",G),Promise.reject(G)):(c.states[G]=Zy,c.loadScript(G).then(()=>{c.states[G]=O0,m("resolve",G);const ae=c.queue;return ae.length>0?(c.queue=[],w(ae).then(p)):Promise.resolve()},()=>(c.states[G]=qC,m("reject",G),Promise.reject(G)))))),x=B=>(c.loading=!0,w(B).then(G=>{c.loading=!1;const ae=c.queueLoadedCallbacks.shift();return he.from(ae).each(Cn),p(G)})),M=fs(i);return c.loading?new Promise((B,G)=>{c.queueLoadedCallbacks.push(()=>{x(M).then(B,G)})}):x(M)}}um.ScriptLoader=new um;const Ga=n=>{let i=n;return{get:()=>i,set:p=>{i=p}}},y0=(n,i)=>{const c=n.indexOf(i);return c!==-1&&n.indexOf(i,c+1)>c},rb=n=>te(n)&&un(n,"raw"),i_=n=>oe(n)&&n.length>1,w0={},Hy=Ga("en"),Na=()=>wo(w0,Hy.get()),rd={getData:()=>vs(w0,n=>({...n})),setCode:n=>{n&&Hy.set(n)},getCode:()=>Hy.get(),add:(n,i)=>{let c=w0[n];c||(w0[n]=c={});const m=gt(bs(i),p=>p.toLowerCase());ln(i,(p,w)=>{const x=w.toLowerCase();x!==w&&y0(m,x)?(un(i,x)||(c[x]=p),c[w]=p):c[x]=p})},translate:n=>{const i=Na().getOr({}),c=x=>ce(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]):wo(i,M.toLowerCase()).map(c).getOr(M)},w=x=>x.replace(/{context:\w+}$/,"");if(m(n))return"";if(rb(n))return c(n.raw);if(i_(n)){const x=n.slice(1),M=p(n[0]).replace(/\{([0-9]+)\}/g,(B,G)=>un(x,G)?c(x[G]):B);return w(M)}return w(p(n))},isRtl:()=>Na().bind(n=>wo(n,"_dir")).exists(n=>n==="rtl"),hasCode:n=>un(w0,n)},Ia=()=>{const n=[],i={},c={},m=[],p=(Pe,Ve)=>{const mt=Dt(m,vt=>vt.name===Pe&&vt.state===Ve);$e(mt,vt=>vt.resolve())},w=Pe=>un(i,Pe),x=Pe=>un(c,Pe),M=Pe=>{if(c[Pe])return c[Pe].instance},B=(Pe,Ve)=>{const mt=rd.getCode(),vt=","+(Ve||"")+",";!mt||Ve&&vt.indexOf(","+mt+",")===-1||um.ScriptLoader.add(i[Pe]+"/langs/"+mt+".js")},G=(Pe,Ve)=>{Ia.languageLoad!==!1&&(w(Pe)?B(Pe,Ve):Ye(Pe,"loaded").then(()=>B(Pe,Ve)))},ae=(Pe,Ve)=>(n.push(Ve),c[Pe]={instance:Ve},p(Pe,"added"),Ve),fe=Pe=>{delete i[Pe],delete c[Pe]},ve=(Pe,Ve)=>L(Ve)?L(Pe)?{prefix:"",resource:Ve,suffix:""}:{prefix:Pe.prefix,resource:Ve,suffix:Pe.suffix}:Ve,Le=(Pe,Ve)=>{if(i[Pe])return Promise.resolve();let mt=L(Ve)?Ve:Ve.prefix+Ve.resource+Ve.suffix;mt.indexOf("/")!==0&&mt.indexOf("://")===-1&&(mt=Ia.baseURL+"/"+mt),i[Pe]=mt.substring(0,mt.lastIndexOf("/"));const vt=()=>(p(Pe,"loaded"),Promise.resolve());return c[Pe]?vt():um.ScriptLoader.add(mt).then(vt)},Ye=(Pe,Ve="added")=>Ve==="added"&&x(Pe)||Ve==="loaded"&&w(Pe)?Promise.resolve():new Promise(mt=>{m.push({name:Pe,state:Ve,resolve:mt})});return{items:n,urls:i,lookup:c,get:M,requireLangPack:G,add:ae,remove:fe,createUrl:ve,load:Le,waitFor:Ye}};Ia.languageLoad=!0,Ia.baseURL="",Ia.PluginManager=Ia(),Ia.ThemeManager=Ia(),Ia.ModelManager=Ia();const Ta=n=>{const i=Ga(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))}}},KC=n=>{const i=Ga(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)))}}},_h=()=>{const n=Ta(yt);return{...n,on:c=>n.get().each(c)}},_0=(n,i)=>{let c=null;return{cancel:()=>{X(c)||(clearTimeout(c),c=null)},throttle:(...w)=>{X(c)&&(c=setTimeout(()=>{c=null,n.apply(null,w)},i))}}},zv=(n,i)=>{let c=null;const m=()=>{X(c)||(clearTimeout(c),c=null)};return{cancel:m,throttle:(...w)=>{m(),c=setTimeout(()=>{c=null,n.apply(null,w)},i)}}},id=He("mce-annotation"),uf=He("data-mce-annotation"),Kp=He("data-mce-annotation-uid"),ib=He("data-mce-annotation-active"),S0=He("data-mce-annotation-classes"),C0=He("data-mce-annotation-attrs"),a_=n=>i=>bt(i,n),Vy=(n,i)=>{const c=n.selection.getRng(),m=Ke.fromDom(c.startContainer),p=Ke.fromDom(n.getBody()),w=i.fold(()=>"."+id(),B=>`[${uf()}="${B}"]`),x=ef(m,c.startOffset).getOr(m);return it(x,w,a_(p)).bind(B=>Va(B,`${Kp()}`).bind(G=>Va(B,`${uf()}`).map(ae=>{const fe=c_(n,G);return{uid:G,name:ae,elements:fe}})))},JC=n=>kl(n)&&Df(n,id()),l_=(n,i)=>qi(n,"data-mce-bogus")||Ty(n,'[data-mce-bogus="all"]',a_(i)),c_=(n,i)=>{const c=Ke.fromDom(n.getBody()),m=pl(c,`[${Kp()}="${i}"]`);return Dt(m,p=>!l_(p,c))},Wy=(n,i)=>{const c=Ke.fromDom(n.getBody()),m=pl(c,`[${uf()}="${i}"]`),p={};return $e(m,w=>{if(!l_(w,c)){const x=Fl(w,Kp()),M=wo(p,x).getOr([]);p[x]=M.concat([w])}}),p},u_=(n,i)=>{const c=Ga({}),m=()=>({listeners:[],previous:_h()}),p=(fe,ve)=>{w(fe,Le=>(ve(Le),Le))},w=(fe,ve)=>{const Le=c.get(),Ye=wo(Le,fe).getOrThunk(m),Pe=ve(Ye);Le[fe]=Pe,c.set(Le)},x=(fe,ve,Le)=>{p(fe,Ye=>{$e(Ye.listeners,Pe=>Pe(!0,fe,{uid:ve,nodes:gt(Le,Ve=>Ve.dom)}))})},M=fe=>{p(fe,ve=>{$e(ve.listeners,Le=>Le(!1,fe))})},B=(fe,ve)=>{$e(c_(n,fe),Le=>{ve?Pr(Le,ib(),"true"):Vi(Le,ib())})},G=zv(()=>{const fe=$s(i.getNames());$e(fe,ve=>{w(ve,Le=>{const Ye=Le.previous.get();return Vy(n,he.some(ve)).fold(()=>{Ye.each(Pe=>{M(ve),Le.previous.clear(),B(Pe,!1)})},({uid:Pe,name:Ve,elements:mt})=>{qr(Ye,Pe)||(Ye.each(vt=>B(vt,!1)),x(Ve,Pe,mt),Le.previous.set(Pe),B(Pe,!0))}),{previous:Le.previous,listeners:Le.listeners}})})},30);return n.on("remove",()=>{G.cancel()}),n.on("NodeChange",()=>{G.throttle()}),{addListener:(fe,ve)=>{w(fe,Le=>({previous:Le.previous,listeners:Le.listeners.concat([ve])}))}}},EE=(n,i)=>{const c=uf(),m=w=>he.from(w.attr(c)).bind(i.lookup),p=w=>{var x,M;w.attr(Kp(),null),w.attr(uf(),null),w.attr(ib(),null);const B=he.from(w.attr(C0())).map(ve=>ve.split(",")).getOr([]),G=he.from(w.attr(S0())).map(ve=>ve.split(",")).getOr([]);$e(B,ve=>w.attr(ve,null));const ae=(M=(x=w.attr("class"))===null||x===void 0?void 0:x.split(" "))!==null&&M!==void 0?M:[],fe=wa(ae,[id()].concat(G));w.attr("class",fe.length>0?fe.join(" "):null),w.attr(S0(),null),w.attr(C0(),null)};n.serializer.addTempAttr(ib()),n.serializer.addAttributeFilter(c,w=>{for(const x of w)m(x).each(M=>{M.persistent===!1&&(x.name==="span"?x.unwrap():p(x))})})},Vv=()=>{const n={};return{register:(p,w)=>{n[p]={name:p,settings:w}},lookup:p=>wo(n,p).map(w=>w.settings),getNames:()=>bs(n)}};let f_=0;const Li=n=>{const c=new Date().getTime(),m=Math.floor(Math.random()*1e9);return f_++,n+"_"+m+f_+String(c)},Wv=(n,i)=>{$e(i,c=>{Ju(n,c)})},Uy=(n,i)=>{$e(i,c=>{zc(n,c)})},d_=(n,i)=>Ke.fromDom(n.dom.cloneNode(i)),ug=n=>d_(n,!1),pc=n=>d_(n,!0),gu=(n,i)=>{const c=Ke.fromTag(i),m=Gf(n);return Ku(c,m),c},h_=(n,i)=>{const c=gu(n,i);iu(n,c);const m=Da(n);return ti(c,m),wr(n),c},Yy=(n,i,c=je)=>{const m=new wi(n,i),p=w=>{let x;do x=m[w]();while(x&&!_n(x)&&!c(x));return he.from(x).filter(_n)};return{current:()=>he.from(m.current()).filter(_n),next:()=>p("next"),prev:()=>p("prev"),prev2:()=>p("prev2")}},up=(n,i)=>{const c=i||(x=>n.isBlock(x)||mi(x)||Es(x)),m=(x,M,B,G)=>{if(_n(x)){const ae=G(x,M,x.data);if(ae!==-1)return he.some({container:x,offset:ae})}return B().bind(ae=>m(ae.container,ae.offset,B,G))};return{backwards:(x,M,B,G)=>{const ae=Yy(x,G!=null?G:n.getRoot(),c);return m(x,M,()=>ae.prev().map(fe=>({container:fe,offset:fe.length})),B).getOrNull()},forwards:(x,M,B,G)=>{const ae=Yy(x,G!=null?G:n.getRoot(),c);return m(x,M,()=>ae.next().map(fe=>({container:fe,offset:0})),B).getOrNull()}}},fp=Math.round,Jp=n=>n?{left:fp(n.left),top:fp(n.top),bottom:fp(n.bottom),right:fp(n.right),width:fp(n.width),height:fp(n.height)}:{left:0,top:0,bottom:0,right:0,width:0,height:0},e1=(n,i)=>(n=Jp(n),i||(n.left=n.left+n.width),n.right=n.left,n.width=0,n),fg=(n,i)=>n.left===i.left&&n.top===i.top&&n.bottom===i.bottom&&n.right===i.right,Uv=(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:Uv(i.top-n.bottom,n,i)},ff=(n,i)=>n.top>i.bottom?!0:n.bottomi>=n.left&&i<=n.right&&c>=n.top&&c<=n.bottom,ek=n=>Hn(n,(i,c)=>i.fold(()=>he.some(c),m=>{const p=Math.min(c.left,m.left),w=Math.min(c.top,m.top),x=Math.max(c.right,m.right),M=Math.max(c.bottom,m.bottom);return he.some({top:w,right:x,bottom:M,left:p,width:x-p,height:M-w})}),he.none()),Xy=(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))},tk=(n,i)=>Math.max(0,Math.min(n.bottom,i.bottom)-Math.max(n.top,i.top)),t1=(n,i,c)=>Math.min(Math.max(n,i),c),lb=n=>{const i=n.startContainer,c=n.startOffset;return i===n.endContainer&&i.hasChildNodes()&&n.endOffset===c+1?i.childNodes[c]:null},ad=(n,i)=>{if(Jn(n)&&n.hasChildNodes()){const c=n.childNodes,m=t1(i,0,c.length-1);return c[m]}else return n},jy=(n,i)=>{if(!(i<0&&Jn(n)&&n.hasChildNodes()))return ad(n,i)},m_=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]"),g_=n=>L(n)&&n.charCodeAt(0)>=768&&m_.test(n),nk=(...n)=>i=>{for(let c=0;ci=>{for(let c=0;cn?n.createRange():Qr.DOM.createRng(),qs=n=>L(n)&&/[\r\n\t ]/.test(n),pu=n=>!!n.setStart&&!!n.setEnd,hg=n=>{const i=n.startContainer,c=n.startOffset;if(qs(n.toString())&&v_(i.parentNode)&&_n(i)){const m=i.data;if(qs(m[c-1])||qs(m[c+1]))return!0}return!1},Gy=n=>{const i=n.ownerDocument,c=cb(i),m=i.createTextNode(Gr),p=n.parentNode;p.insertBefore(m,n),c.setStart(m,0),c.setEnd(m,1);const w=Jp(c.getBoundingClientRect());return p.removeChild(m),w},Yi=n=>{const i=n.startContainer,c=n.endContainer,m=n.startOffset,p=n.endOffset;if(i===c&&_n(c)&&m===0&&p===1){const w=n.cloneRange();return w.setEndAfter(c),mg(w)}else return null},Ky=n=>n.left===0&&n.right===0&&n.top===0&&n.bottom===0,mg=n=>{var i;let c;const m=n.getClientRects();return m.length>0?c=Jp(m[0]):c=Jp(n.getBoundingClientRect()),!pu(n)&&dg(n)&&Ky(c)?Gy(n):Ky(c)&&pu(n)&&(i=Yi(n))!==null&&i!==void 0?i:c},Oa=(n,i)=>{const c=e1(n,i);return c.width=1,c.right=c.left+1,c},fm=n=>{const i=[],c=x=>{x.height!==0&&(i.length>0&&fg(x,i[i.length-1])||i.push(x))},m=(x,M)=>{const B=cb(x.ownerDocument);if(M0&&(B.setStart(x,M-1),B.setEnd(x,M),hg(B)||c(Oa(mg(B),!1))),M{const m=()=>(o1(n),i===0),p=()=>o1(n)?i>=n.data.length:i>=n.childNodes.length,w=()=>{const ae=cb(n.ownerDocument);return ae.setStart(n,i),ae.setEnd(n,i),ae},x=()=>(c||(c=fm(zt(n,i))),c),M=()=>x().length>0,B=ae=>ae&&n===ae.container()&&i===ae.offset(),G=ae=>df(n,ae?i-1:i);return{container:He(n),offset:He(i),toRange:w,getClientRects:x,isVisible:M,isAtStart:m,isAtEnd:p,isEqual:B,getNode:G}};zt.fromRangeStart=n=>zt(n.startContainer,n.startOffset),zt.fromRangeEnd=n=>zt(n.endContainer,n.endOffset),zt.after=n=>zt(n.parentNode,Yv(n)+1),zt.before=n=>zt(n.parentNode,Yv(n)),zt.isAbove=(n,i)=>ri(Ro(i.getClientRects()),Po(n.getClientRects()),sa).getOr(!1),zt.isBelow=(n,i)=>ri(Po(i.getClientRects()),Ro(n.getClientRects()),ff).getOr(!1),zt.isAtStart=n=>n?n.isAtStart():!1,zt.isAtEnd=n=>n?n.isAtEnd():!1,zt.isTextPosition=n=>n?_n(n.container()):!1,zt.isElementPosition=n=>!zt.isTextPosition(n);const T0=(n,i)=>{_n(i)&&i.data.length===0&&n.remove(i)},Jy=(n,i,c)=>{i.insertNode(c),T0(n,c.previousSibling),T0(n,c.nextSibling)},E0=(n,i,c)=>{const m=he.from(c.firstChild),p=he.from(c.lastChild);i.insertNode(c),m.each(w=>T0(n,w.previousSibling)),p.each(w=>T0(n,w.nextSibling))},Sh=(n,i,c)=>{K1(c)?E0(n,i,c):Jy(n,i,c)},hf=_n,ub=Pd,Xv=Qr.nodeIndex,e2=n=>{const i=n.parentNode;return ub(i)?e2(i):i},jv=n=>n?Ge(n.childNodes,(i,c)=>(ub(c)&&c.nodeName!=="BR"?i=i.concat(jv(c)):i.push(c),i),[]):[],A0=(n,i)=>{let c=n;for(;(c=c.previousSibling)&&hf(c);)i+=c.data.length;return i},Ch=n=>i=>n===i,ld=n=>{let i,c;i=jv(e2(n)),c=qe(i,Ch(n),n),i=i.slice(0,c+1);const m=Ge(i,(p,w,x)=>(hf(w)&&hf(i[x-1])&&p++,p),0);return i=Qa(i,Rf([n.nodeName])),c=qe(i,Ch(n),n),c-m},Lu=n=>(hf(n)?"text()":n.nodeName.toLowerCase())+"["+ld(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},t2=(n,i)=>{let c=[],m=i.container(),p=i.offset(),w;if(hf(m))w=A0(m,p);else{const M=m.childNodes;p>=M.length?(w="after",p=M.length-1):w="before",m=M[p]}c.push(Lu(m));let x=zl(n,m);return x=Qa(x,nt(Pd)),c=c.concat(Zi(x,M=>Lu(M))),c.reverse().join("/")+","+w},dp=(n,i,c)=>{let m=jv(n);return m=Qa(m,(p,w)=>!hf(p)||!hf(m[w-1])),m=Qa(m,Rf([i])),m[c]},O_=(n,i)=>{let c=n,m=0;for(;hf(c);){const p=c.data.length;if(i>=m&&i<=m+p){n=c,i=i-m;break}if(!hf(c.nextSibling)){n=c,i=p;break}m+=p,c=c.nextSibling}return hf(n)&&i>n.data.length&&(i=n.data.length),zt(n,i)},D0=(n,i)=>{if(!i)return null;const c=i.split(","),m=c[0].split("/"),p=c.length>1?c[1]:"before",w=Ge(m,(x,M)=>{const B=/([\w\-\(\)]+)\[([0-9]+)\]/.exec(M);return B?(B[1]==="text()"&&(B[1]="#text"),dp(x,B[1],parseInt(B[2],10))):null},n);if(!w)return null;if(!hf(w)&&w.parentNode){let x;return p==="after"?x=Xv(w)+1:x=Xv(w),zt(w.parentNode,x)}return O_(w,parseInt(p,10))},s1=Es,n2=(n,i,c)=>{let m=n(i.data.slice(0,c)).length;for(let p=i.previousSibling;p&&_n(p);p=p.previousSibling)m+=n(p.data).length;return m},qv=(n,i,c,m,p)=>{const w=p?m.startContainer:m.endContainer;let x=p?m.startOffset:m.endOffset;const M=[],B=n.getRoot();if(_n(w))M.push(c?n2(i,w,x):x);else{let G=0;const ae=w.childNodes;x>=ae.length&&ae.length&&(G=1,x=Math.max(0,ae.length-1)),M.push(n.nodeIndex(ae[x],c)+G)}for(let G=w;G&&G!==B;G=G.parentNode)M.push(n.nodeIndex(G,c));return M},y_=(n,i,c,m)=>{const p=i.dom,w=qv(p,n,c,m,!0),x=i.isForward(),M=oa(m)?{isFakeCaret:!0}:{};if(i.isCollapsed())return{start:w,forward:x,...M};{const B=qv(p,n,c,m,!1);return{start:w,end:B,forward:x,...M}}},Gv=(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},o2=(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=>(o2(n,!0),o2(n,!1),n),ec=(n,i)=>{if(Jn(n)&&(n=ad(n,i),s1(n)))return n;if(_r(n)){_n(n)&&_i(n)&&(n=n.parentNode);let c=n.previousSibling;if(s1(c)||(c=n.nextSibling,s1(c)))return c}},Fu=n=>ec(n.startContainer,n.startOffset)||ec(n.endContainer,n.endOffset),Zr=(n,i,c)=>{const m=c.getNode(),p=c.getRng();if(m.nodeName==="IMG"||s1(m)){const x=m.nodeName;return{name:x,index:Gv(c.dom,x,m)}}const w=Fu(p);if(w){const x=w.tagName;return{name:x,index:Gv(c.dom,x,w)}}return y_(n,c,i,p)},tc=n=>{const i=n.getRng();return{start:t2(n.dom.getRoot(),zt.fromRangeStart(i)),end:t2(n.dom.getRoot(),zt.fromRangeEnd(i)),forward:n.isForward()}},Vl=n=>({rng:n.getRng(),forward:n.isForward()}),dm=(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(),w=n.isCollapsed(),x=n.getNode(),M=x.nodeName,B=n.isForward();if(M==="IMG")return{name:M,index:Gv(c,M,x)};const G=vl(m.cloneRange());if(!w){G.collapse(!1);const fe=dm(c,p+"_end",i);Sh(c,G,fe)}m=vl(m),m.collapse(!0);const ae=dm(c,p+"_start",i);return Sh(c,m,ae),n.moveToBookmark({id:p,keep:!0,forward:B}),{id:p,forward:B}},w_=(n,i,c=!1)=>i===2?Zr(In,c,n):i===3?tc(n):i?Vl(n):Sr(n,!1),bu=Be(Zr,_t,!0),Dl=n=>{const i=w=>w(n),c=He(n),m=()=>p,p={tag:!0,inner:n,fold:(w,x)=>x(n),isValue:ht,isError:je,map:w=>bc.value(w(n)),mapError:m,bind:i,exists:i,forall:i,getOr:c,or:m,getOrThunk:c,orThunk:m,getOrDie:c,each:w=>{w(n)},toOptional:()=>he.some(n)};return p},s2=n=>{const i=()=>c,c={tag:!1,inner:n,fold:(m,p)=>m(n),isValue:je,isError:ht,map:i,mapError:m=>bc.error(m(n)),bind:i,exists:je,forall:ht,getOr:_t,or:_t,getOrThunk:At,orThunk:At,getOrDie:rn(String(n)),each:yt,toOptional:he.none};return c},bc={value:Dl,error:s2,fromOption:(n,i)=>n.fold(()=>s2(i),Dl)},pg={generate:n=>{if(!oe(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 $e(n,(m,p)=>{const w=bs(m);if(w.length!==1)throw new Error("one and only one name per case");const x=w[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(!oe(M))throw new Error("case arguments must be an array");i.push(x),c[x]=(...B)=>{const G=B.length;if(G!==M.length)throw new Error("Wrong number of arguments to case "+x+". Expected "+M.length+" ("+M+"), got "+G);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,B)},match:fe=>{const ve=bs(fe);if(i.length!==ve.length)throw new Error("Wrong number of arguments to match. Expected: "+i.join(",")+` -Actual: `+ve.join(","));if(!er(i,Ye=>xt(ve,Ye)))throw new Error("Not all branches were specified when using match. Specified: "+ve.join(", ")+` -Required: `+i.join(", "));return fe[x].apply(null,B)},log:fe=>{console.log(fe,{constructors:i,constructor:x,params:B})}}}}),c}};pg.generate([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);const ok=n=>{const i=[],c=[];return $e(n,m=>{m.fold(p=>{i.push(p)},p=>{c.push(p)})}),{errors:i,values:c}},sk=n=>n.type==="inline-command"||n.type==="inline-format",r2=n=>n.type==="block-command"||n.type==="block-format",i2=n=>{const i=m=>bc.error({message:m,pattern:n}),c=(m,p,w)=>{if(n.format!==void 0){let x;if(oe(n.format)){if(!er(n.format,L))return i(m+" pattern has non-string items in the `format` array");x=n.format}else if(L(n.format))x=[n.format];else return i(m+" pattern has non-string `format` parameter");return bc.value(p(x))}else return n.cmd!==void 0?L(n.cmd)?bc.value(w(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(!L(n.start))return i("Raw pattern is missing `start` parameter");if(n.end!==void 0){if(!L(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",w=>({type:"inline-format",start:m,end:p,format:w}),(w,x)=>({type:"inline-command",start:m,end:p,cmd:w,value:x}))}else return n.replacement!==void 0?L(n.replacement)?n.start.length===0?i("Replacement pattern has empty `start` parameter"):bc.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}))},hm=n=>Dt(n,r2),a2=n=>Dt(n,sk),r1=(n,i)=>({inlinePatterns:a2(n),blockPatterns:hm(n),dynamicPatternsLookup:i}),Ol=n=>{const i=ok(gt(n,i2));return $e(i.errors,c=>console.error(c.message,c.pattern)),i.values},Pl=n=>i=>{const c=n(i);return Ol(c)},Tn=ys().deviceType,rk=Tn.isTouch(),nc=Qr.DOM,ik=n=>{const i=n.indexOf("=")>0?n.split(/[;,](?![^=;,]*(?:[;,]|$))/):n.split(",");return Hn(i,(c,m)=>{const p=m.split("="),w=p[0],x=p.length>1?p[1]:w;return c[kc(w)]=kc(x),c},{})},l2=n=>J(n,RegExp),no=n=>i=>i.options.get(n),Pc=n=>L(n)||te(n),c2=(n,i="")=>c=>{const m=L(c);if(m)if(c.indexOf("=")!==-1){const p=ik(c);return{value:wo(p,n.id).getOr(i),valid:m}}else return{value:c,valid:m};else return{valid:!1,message:"Must be a string."}},fb=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:c2(n,"tinymce"),default:"tinymce"}),i("body_class",{processor:c2(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=L(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=xt(["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}:L(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||L(c)||tt(c,L);return m?L(c)?{value:gt(c.split(","),kc),valid:m}:oe(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:M_(n)?[]:["default"]}),i("content_style",{processor:"string"}),i("content_css_cors",{processor:"boolean",default:!1}),i("font_css",{processor:c=>{const m=L(c)||tt(c,L);return m?{value:oe(c)?c:gt(c.split(","),kc),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)||L(c);return m?c===!1||Tn.isiPhone()||Tn.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:!rk}),i("resize_img_proportional",{processor:"boolean",default:!0}),i("event_root",{processor:"object"}),i("service_message",{processor:"string"}),i("theme",{processor:c=>c===!1||L(c)||ce(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||L(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:Pc}),i("valid_children",{processor:"string"}),i("valid_classes",{processor:Pc}),i("valid_elements",{processor:"string"}),i("valid_styles",{processor:Pc}),i("verify_html",{processor:"boolean",default:!0}),i("auto_focus",{processor:c=>L(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=>tt(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=>ce(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=>tt(c,l2)?{value:c,valid:!0}:l2(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=xt(["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=xt(["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:rd.isRtl()?"rtl":void 0}),i("placeholder",{processor:"string",default:nc.getAttrib(n.getElement(),"placeholder")})})},mf=no("iframe_attrs"),Kv=no("doctype"),i1=no("document_base_url"),Ff=no("body_id"),al=no("body_class"),Qd=no("content_security_policy"),Zd=no("br_in_pre"),jc=no("forced_root_block"),db=no("forced_root_block_attrs"),u2=no("newline_behavior"),__=no("br_newline_selector"),f2=no("no_newline_selector"),kh=no("keep_styles"),Xr=no("end_container_on_empty_block"),Jv=no("automatic_uploads"),cd=no("images_reuse_filename"),S_=no("images_replace_blob_uris"),C_=no("icons"),fa=no("icons_url"),ak=no("images_upload_url"),eO=no("images_upload_base_path"),tO=no("images_upload_credentials"),k_=no("images_upload_handler"),lk=no("content_css_cors"),hb=no("referrer_policy"),x_=no("language"),ck=no("language_url"),T_=no("indent_use_margin"),uk=no("indentation"),E_=no("content_css"),nO=no("content_style"),hp=no("font_css"),mb=no("directionality"),Xi=no("inline_boundaries_selector"),d2=no("object_resizing"),Mc=no("resize_img_proportional"),gb=no("placeholder"),ll=no("event_root"),A_=no("service_message"),mm=no("theme"),fk=no("theme_url"),oc=no("model"),gf=no("model_url"),P0=no("inline_boundaries"),dk=no("formats"),hk=no("preview_styles"),D_=no("format_empty_lines"),M0=no("format_noneditable_selector"),P_=no("custom_ui_selector"),M_=no("inline"),mp=no("hidden_input"),mk=no("submit_patch"),gk=no("add_form_submit_trigger"),pk=no("add_unload_trigger"),h2=no("custom_undo_redo_levels"),oO=no("disable_nodechange"),bg=no("readonly"),R_=no("editable_root"),$_=no("content_css_cors"),sO=no("plugins"),pb=no("external_plugins"),vg=no("block_unsupported_drop"),rO=no("visual"),iO=no("visual_table_class"),R0=no("visual_anchor_class"),N_=no("iframe_aria_text"),xh=no("setup"),$0=no("init_instance_callback"),I_=no("urlconverter_callback"),Th=no("auto_focus"),gp=no("browser_spellcheck"),m2=no("protect"),B_=no("paste_block_drop"),aO=no("paste_data_images"),bk=no("paste_preprocess"),L_=no("paste_postprocess"),vk=no("newdocument_content"),Ok=no("paste_webkit_styles"),F_=no("paste_remove_styles_if_webkit"),Q_=no("paste_merge_formats"),Z_=no("smart_paste"),yk=no("paste_as_text"),wk=no("paste_tab_spaces"),_k=no("allow_html_data_urls"),H_=no("text_patterns"),g2=no("text_patterns_lookup"),p2=no("noneditable_class"),Sk=no("editable_class"),Ck=no("noneditable_regexp"),lO=no("preserve_cdata"),z_=no("highlight_on_focus"),cO=no("xss_sanitization"),N0=no("init_content_sync"),bb=n=>n.options.isSet("text_patterns_lookup"),uO=n=>hn.explode(n.options.get("font_size_style_values")),b2=n=>hn.explode(n.options.get("font_size_classes")),V_=n=>n.options.get("encoding")==="xml",v2=n=>hn.explode(n.options.get("images_file_types")),kk=no("table_tab_navigation"),fO=no("details_initial_state"),I0=no("details_serialized_state"),xk=Jn,dO=_n,pf=n=>{const i=n.parentNode;i&&i.removeChild(n)},hO=n=>{const i=In(n);return{count:n.length-i.length,text:i}},W_=n=>{let i;for(;(i=n.data.lastIndexOf(Ft))!==-1;)n.deleteData(i,1)},mO=(n,i)=>(yl(n),i),Tk=(n,i)=>{const c=hO(n.data.substr(0,i.offset())),m=hO(n.data.substr(i.offset()));return(c.text+m.text).length>0?(W_(n),zt(n,i.offset()-c.count)):i},B0=(n,i)=>{const c=i.container(),m=as(Rr(c.childNodes),n).map(p=>pdO(n)&&i.container()===n?Tk(n,i):mO(n,i),Ek=(n,i)=>i.container()===n.parentNode?B0(n,i):mO(n,i),gO=(n,i)=>zt.isTextPosition(i)?O2(n,i):Ek(n,i),yl=n=>{xk(n)&&_r(n)&&(Uc(n)?n.removeAttribute("data-mce-caret"):pf(n)),dO(n)&&(W_(n),n.data.length===0&&pf(n))},Ak=Es,vb=of,Dk=Rd,Ob="*[contentEditable=false],video,audio,embed,object",y2=(n,i,c)=>{const m=e1(i.getBoundingClientRect(),c);let p,w;if(n.tagName==="BODY"){const M=n.ownerDocument.documentElement;p=n.scrollLeft||M.scrollLeft,w=n.scrollTop||M.scrollTop}else{const M=n.getBoundingClientRect();p=n.scrollLeft-M.left,w=n.scrollTop-M.top}m.left+=p,m.right+=p,m.top+=w,m.bottom+=w,m.width=1;let x=i.offsetWidth-i.clientWidth;return x>0&&(c&&(x*=-1),m.left+=x,m.right+=x),m},Pk=n=>{var i,c;const m=pl(Ke.fromDom(n),Ob);for(let p=0;p{const p=_h();let w,x;const M=jc(n),B=n.dom,G=(Pe,Ve)=>{let mt;if(ae(),Dk(Ve))return null;if(c(Ve)){const vt=fh(M,Ve,Pe),St=y2(i,Ve,Pe);B.setStyle(vt,"top",St.top),x=vt;const Mt=B.create("div",{class:"mce-visual-caret","data-mce-bogus":"all"});B.setStyles(Mt,{...St}),B.add(i,Mt),p.set({caret:Mt,element:Ve,before:Pe}),Pe&&B.addClass(Mt,"mce-visual-caret-before"),fe(),mt=Ve.ownerDocument.createRange(),mt.setStart(vt,0),mt.setEnd(vt,0)}else return x=cu(Ve,Pe),mt=Ve.ownerDocument.createRange(),gm(x.nextSibling)?(mt.setStart(x,0),mt.setEnd(x,0)):(mt.setStart(x,1),mt.setEnd(x,1)),mt;return mt},ae=()=>{Pk(i),x&&(yl(x),x=null),p.on(Pe=>{B.remove(Pe.caret),p.clear()}),w&&(clearInterval(w),w=void 0)},fe=()=>{w=setInterval(()=>{p.on(Pe=>{m()?B.toggleClass(Pe.caret,"mce-visual-caret-hidden"):B.addClass(Pe.caret,"mce-visual-caret-hidden")})},500)};return{show:G,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 Ve=y2(i,Pe.element,Pe.before);B.setStyles(Pe.caret,{...Ve})})},destroy:()=>clearInterval(w)}},L0=()=>qn.browser.isFirefox(),gm=n=>Ak(n)||vb(n),yb=n=>(gm(n)||Nu(n)&&L0())&&yi(Ke.fromDom(n)).exists(wn),vu=ba,a1=Es,U_=of,Y_=lh("display","block table table-cell table-caption list-item"),w2=_r,_2=_i,S2=Jn,Rk=_n,F0=Tl,pO=n=>n>0,pp=n=>n<0,Q0=(n,i)=>{let c;for(;c=n(i);)if(!_2(c))return c;return null},Eh=(n,i,c,m,p)=>{const w=new wi(n,m),x=a1(n)||_2(n);let M;if(pp(i)){if(x&&(M=Q0(w.prev.bind(w),!0),c(M)))return M;for(;M=Q0(w.prev.bind(w),p);)if(c(M))return M}if(pO(i)){if(x&&(M=Q0(w.next.bind(w),!0),c(M)))return M;for(;M=Q0(w.next.bind(w),p);)if(c(M))return M}return null},$k=(n,i)=>{const c=p=>vu(p.dom),m=p=>p.dom===i;return di(Ke.fromDom(n),c,m).map(p=>p.dom).getOr(i)},pm=(n,i)=>{for(;n&&n!==i;){if(Y_(n))return n;n=n.parentNode}return null},Hd=(n,i,c)=>pm(n.container(),c)===pm(i.container(),c),wb=(n,i)=>{if(!i)return he.none();const c=i.container(),m=i.offset();return S2(c)?he.from(c.childNodes[m+n]):he.none()},C2=(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},_b=(n,i,c)=>pm(i,n)===pm(c,n),Og=(n,i,c)=>{const m=n?"previousSibling":"nextSibling";let p=c;for(;p&&p!==i;){let w=p[m];if(w&&w2(w)&&(w=w[m]),a1(w)||U_(w)){if(_b(i,w,p))return w;break}if(F0(w))break;p=p.parentNode}return null},S=Be(C2,!0),A=Be(C2,!1),Z=(n,i,c)=>{let m;const p=Be(Og,!0,i),w=Be(Og,!1,i),x=c.startContainer,M=c.startOffset;if(_i(x)){const B=Rk(x)?x.parentNode:x,G=B.getAttribute("data-mce-caret");if(G==="before"&&(m=B.nextSibling,yb(m)))return S(m);if(G==="after"&&(m=B.previousSibling,yb(m)))return A(m)}if(!c.collapsed)return c;if(_n(x)){if(w2(x)){if(n===1){if(m=w(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=w(x),m)return S(m)}return c}if(fr(x)&&M>=x.data.length-1)return n===1&&(m=w(x),m)?S(m):c;if(dh(x)&&M<=1)return n===-1&&(m=p(x),m)?A(m):c;if(M===x.data.length)return m=w(x),m?S(m):c;if(M===0)return m=p(x),m?A(m):c}return c},le=(n,i)=>wb(n?0:-1,i).filter(a1),Ce=(n,i,c)=>{const m=Z(n,i,c);return n===-1?zt.fromRangeStart(m):zt.fromRangeEnd(m)},We=n=>he.from(n.getNode()).map(Ke.fromDom),dt=n=>he.from(n.getNode(!0)).map(Ke.fromDom),kt=(n,i)=>{let c=i;for(;c=n(c);)if(c.isVisible())return c;return c},Ht=(n,i)=>{const c=Hd(n,i);return!c&&mi(n.getNode())?!0:c};var vn;(function(n){n[n.Backwards=-1]="Backwards",n[n.Forwards=1]="Forwards"})(vn||(vn={}));const Qn=Es,zn=_n,Lo=Jn,ms=mi,Ns=Tl,Hr=om,Zs=Gg,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(pO(n)){if(Ns(i.previousSibling)&&!zn(i.previousSibling))return zt.before(i);if(zn(i))return zt(i,0)}if(pp(n)){if(Ns(i.nextSibling)&&!zn(i.nextSibling))return zt.after(i);if(zn(i))return zt(i,i.data.length)}return pp(n)?ms(i)?zt.before(i):zt.after(i):zt.before(i)},Qu=(n,i)=>{const c=i.nextSibling;return c&&Ns(c)?zn(c)?zt(c,0):zt.before(c):Qf(vn.Forwards,zt.after(i),n)},Qf=(n,i,c)=>{let m,p,w,x;if(!Lo(c)||!i)return null;if(i.isEqual(zt.after(c))&&c.lastChild){if(x=zt.after(c.lastChild),pp(n)&&Ns(c.lastChild)&&Lo(c.lastChild))return ms(c.lastChild)?zt.before(c.lastChild):x}else x=i;const M=x.container();let B=x.offset();if(zn(M)){if(pp(n)&&B>0)return zt(M,--B);if(pO(n)&&B0&&(p=Ci(M,B-1),Ns(p)))return!Hr(p)&&(w=Eh(p,n,Zs,p),w)?zn(w)?zt(w,w.data.length):zt.after(w):zn(p)?zt(p,p.data.length):zt.before(p);if(pO(n)&&B({next:i=>Qf(vn.Forwards,i,n),prev:i=>Qf(vn.Backwards,i,n)}),bm=(n,i,c)=>{const m=n?zt.before(c):zt.after(c);return zd(n,i,m)},ud=n=>mi(n)?zt.before(n):zt.after(n),k2=n=>zt.isTextPosition(n)?n.offset()===0:Tl(n.getNode()),yu=n=>{if(zt.isTextPosition(n)){const i=n.container();return n.offset()===i.data.length}else return Tl(n.getNode(!0))},X_=(n,i)=>!zt.isTextPosition(n)&&!zt.isTextPosition(i)&&n.getNode()===i.getNode(!0),Z0=n=>!zt.isTextPosition(n)&&mi(n.getNode()),H0=(n,i,c)=>n?!X_(i,c)&&!Z0(i)&&yu(i)&&k2(c):!X_(c,i)&&k2(i)&&yu(c),zd=(n,i,c)=>{const m=Ea(i);return he.from(n?m.next(c):m.prev(c))},Sb=(n,i,c)=>zd(n,i,c).bind(m=>Hd(c,m,i)&&H0(n,c,m)?zd(n,i,m):he.some(m)),Nk=(n,i,c,m)=>Sb(n,i,c).bind(p=>m(p)?Nk(n,i,p,m):he.some(p)),bO=(n,i)=>{const c=n?i.firstChild:i.lastChild;return _n(c)?he.some(zt(c,n?0:c.data.length)):c?Tl(c)?he.some(n?zt.before(c):ud(c)):bm(n,i,c):he.none()},Zf=Be(zd,!0),Zu=Be(zd,!1),cl=Be(bO,!0),Vd=Be(bO,!1),j_="_mce_caret",qc=n=>Jn(n)&&n.id===j_,Cb=(n,i)=>{let c=i;for(;c&&c!==n;){if(qc(c))return c;c=c.parentNode}return null},vO=n=>L(n.start),x2=n=>un(n,"rng"),Ik=n=>un(n,"id"),Bk=n=>un(n,"name"),l1=n=>hn.isArray(n.start),T2=n=>!Bk(n)&&ye(n.forward)?n.forward:!0,yg=(n,i)=>(Jn(i)&&n.isBlock(i)&&!i.innerHTML&&(i.innerHTML='
'),i),oP=(n,i)=>{const c=he.from(D0(n.getRoot(),i.start)),m=he.from(D0(n.getRoot(),i.end));return ri(c,m,(p,w)=>{const x=n.createRng();return x.setStart(p.container(),p.offset()),x.setEnd(w.container(),w.offset()),{range:x,forward:T2(i)}})},Lk=(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)},DE=n=>!n.hasChildNodes(),bI=(n,i)=>Vd(n).fold(je,c=>(i.setStart(c.container(),c.offset()),i.setEnd(c.container(),c.offset()),!0)),PE=(n,i,c)=>DE(i)&&Cb(n,i)?(Lk(i,c),!0):!1,ME=(n,i,c,m)=>{const p=c[i?"start":"end"],w=n.getRoot();if(p){let x=w,M=p[0];for(let B=p.length-1;x&&B>=1;B--){const G=x.childNodes;if(PE(w,x,m))return!0;if(p[B]>G.length-1)return PE(w,x,m)?!0:bI(x,m);x=G[p[B]]}_n(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},Fk=n=>_n(n)&&n.data.length>0,Qk=(n,i,c)=>{const m=n.get(c.id+"_"+i),p=m==null?void 0:m.parentNode,w=c.keep;if(m&&p){let x,M;if(i==="start"?w?m.hasChildNodes()?(x=m.firstChild,M=1):Fk(m.nextSibling)?(x=m.nextSibling,M=0):Fk(m.previousSibling)?(x=m.previousSibling,M=m.previousSibling.data.length):(x=p,M=n.nodeIndex(m)+1):(x=p,M=n.nodeIndex(m)):w?m.hasChildNodes()?(x=m.firstChild,M=1):Fk(m.previousSibling)?(x=m.previousSibling,M=m.previousSibling.data.length):(x=p,M=n.nodeIndex(m)):(x=p,M=n.nodeIndex(m)),!w){const B=m.previousSibling,G=m.nextSibling;hn.each(hn.grep(m.childNodes),fe=>{_n(fe)&&(fe.data=fe.data.replace(/\uFEFF/g,""))});let ae;for(;ae=n.get(c.id+"_"+i);)n.remove(ae,!0);if(_n(G)&&_n(B)&&!qn.browser.isOpera()){const fe=B.data.length;B.appendData(G.data),n.remove(G),x=B,M=fe}}return he.some(zt(x,M))}else return he.none()},Zk=(n,i)=>{const c=n.createRng();return ME(n,!0,i,c)&&ME(n,!1,i,c)?he.some({range:c,forward:T2(i)}):he.none()},RE=(n,i)=>{const c=Qk(n,"start",i),m=Qk(n,"end",i);return ri(c,m.or(c),(p,w)=>{const x=n.createRng();return x.setStart(yg(n,p.container()),p.offset()),x.setEnd(yg(n,w.container()),w.offset()),{range:x,forward:T2(i)}})},$E=(n,i)=>he.from(n.select(i.name)[i.index]).map(c=>{const m=n.createRng();return m.selectNode(c),{range:m,forward:!0}}),NE=(n,i)=>{const c=n.dom;if(i){if(l1(i))return Zk(c,i);if(vO(i))return oP(c,i);if(Ik(i))return RE(c,i);if(Bk(i))return $E(c,i);if(x2(i))return he.some({range:i.rng,forward:T2(i)})}return he.none()},sP=(n,i,c)=>w_(n,i,c),rP=(n,i)=>{NE(n,i).each(({range:c,forward:m})=>{n.setRng(c,m)})},Wd=n=>Jn(n)&&n.tagName==="SPAN"&&n.getAttribute("data-mce-type")==="bookmark",Gs=(n=>i=>n===i)(Gr),Ah=n=>n!==""&&` \f -\r \v`.indexOf(n)!==-1,kb=n=>!Ah(n)&&!Gs(n)&&!a0(n),Hk=n=>({value:IE(n)}),IE=n=>ga(n,"#").toUpperCase(),OO=n=>{const i=n.toString(16);return(i.length===1?"0"+i:i).toUpperCase()},aP=n=>{const i=OO(n.red)+OO(n.green)+OO(n.blue);return Hk(i)},zk=/^\s*rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)\s*$/i,q_=/^\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}),lP=(n,i,c,m)=>{const p=parseInt(n,10),w=parseInt(i,10),x=parseInt(c,10),M=parseFloat(m);return E2(p,w,x,M)},Vk=n=>{if(n==="transparent")return he.some(E2(0,0,0,0));const i=zk.exec(n);if(i!==null)return he.some(lP(i[1],i[2],i[3],"1"));const c=q_.exec(n);return c!==null?he.some(lP(c[1],c[2],c[3],c[4])):he.none()},G_=n=>Vk(n).map(aP).map(i=>"#"+i.value).getOr(n),Wk=n=>{const i=[];if(n)for(let c=0;cRs(n,i=>{const c=lb(i);return c?[Ke.fromDom(c)]:[]}),BE=n=>Wk(n).length>1,Uk=n=>Dt(vI(n),qm),yO=n=>pl(n,"td[data-mce-selected],th[data-mce-selected]"),A2=(n,i)=>{const c=yO(i);return c.length>0?c:Uk(n)},xb=n=>A2(Wk(n.selection.getSel()),Ke.fromDom(n.getBody())),bp=(n,i)=>_e(n,"table",i),LE=n=>{const i=n.startContainer,c=n.startOffset;return _n(i)?c===0?he.some(Ke.fromDom(i)):he.none():he.from(i.childNodes[c]).map(Ke.fromDom)},cP=n=>{const i=n.endContainer,c=n.endOffset;return _n(i)?c===i.data.length?he.some(Ke.fromDom(i)):he.none():he.from(i.childNodes[c-1]).map(Ke.fromDom)},FE=n=>ii(n).fold(He([n]),i=>[n].concat(FE(i))),Yk=n=>Pu(n).fold(He([n]),i=>ei(i)==="br"?Sa(i).map(c=>[n].concat(Yk(c))).getOr([]):[n].concat(Yk(i))),wO=(n,i)=>ri(LE(i),cP(i),(c,m)=>{const p=oo(FE(n),Be(bt,c)),w=oo(Yk(n),Be(bt,m));return p.isSome()&&w.isSome()}).getOr(!1),Xk=(n,i,c,m)=>{const p=c,w=new wi(c,p),x=Vt(n.schema.getMoveCaretBeforeOnEnterElements(),(B,G)=>!xt(["td","th","table"],G.toLowerCase()));let M=c;do{if(_n(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?w.next():w.prev());p.nodeName==="BODY"&&(m?i.setStart(p,0):i.setEnd(p,p.childNodes.length))},K_=n=>{const i=n.selection.getSel();return pe(i)&&i.rangeCount>0},jk=(n,i)=>{const c=xb(n);c.length>0?$e(c,m=>{const p=m.dom,w=n.dom.createRng();w.setStartBefore(p),w.setEndAfter(p),i(w,!0)}):i(n.selection.getRng(),!1)},QE=(n,i,c)=>{const m=Sr(n,i);c(m),n.moveToBookmark(m)},D2=n=>Xe(n==null?void 0:n.nodeType),qk=n=>Jn(n)&&!Wd(n)&&!qc(n)&&!Pd(n),uP=(n,i)=>{if(qk(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},vm=n=>n.isContentEditable===!0,ZE=(n,i,c)=>{const{selection:m,dom:p}=n,w=m.getNode(),x=Es(w);QE(m,!0,()=>{i()}),x&&Es(w)&&p.isChildOf(w,n.getBody())?n.selection.select(w):c(m.getStart())&&fP(p,m)},fP=(n,i)=>{var c,m;const p=i.getRng(),{startContainer:w,startOffset:x}=p,M=i.getNode();if(!uP(n,M)&&Jn(w)){const B=w.childNodes,G=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)||!sc(n))return n}},Wl=(n,i)=>!!n.getTextBlockElements()[i.nodeName.toLowerCase()]||ig(n,i),Om=(n,i,c)=>n.schema.isValidChild(i,c),sc=(n,i=!1)=>{if(pe(n)&&_n(n)){const c=i?n.data.replace(/ /g,"\xA0"):n.data;return eg(c)}else return!1},ym=n=>pe(n)&&_n(n)&&n.length===0,HE=(n,i)=>{const c="[data-mce-cef-wrappable]",m=M0(n),p=ol(m)?c:`${c},${m}`;return Du(Ke.fromDom(i),p)},P2=(n,i)=>{const c=n.dom;return qk(i)&&c.getContentEditable(i)==="false"&&HE(n,i)&&c.select('[contenteditable="true"]',i).length===0},Dh=(n,i)=>ce(n)?n(i):(pe(i)&&(n=n.replace(/%(\w+)/g,(c,m)=>i[m]||c)),n),J_=(n,i)=>(n=n||"",i=i||"",n=""+(n.nodeName||n),i=""+(i.nodeName||i),n.toLowerCase()===i.toLowerCase()),M2=(n,i)=>{if(Ne(n))return null;{let c=String(n);return(i==="color"||i==="backgroundColor")&&(c=G_(c)),i==="fontWeight"&&n===700&&(c="bold"),i==="fontFamily"&&(c=c.replace(/[\'\"]/g,"").replace(/,\s+/g,",")),c}},R2=(n,i,c)=>{const m=n.getStyle(i,c);return M2(m,c)},Gk=(n,i)=>{let c;return n.getParent(i,m=>Jn(m)?(c=n.getStyle(m,"text-decoration"),!!c&&c!=="none"):!1),c},$2=(n,i,c)=>n.getParents(i,c,n.getRoot()),eS=(n,i,c)=>{const m=n.formatter.get(i);return pe(m)&&jt(m,c)},Kk=(n,i)=>eS(n,i,m=>{const p=w=>ce(w)||w.length>1&&w.charAt(0)==="%";return jt(["styles","attributes"],w=>wo(m,w).exists(x=>{const M=oe(x)?x:uo(x);return jt(M,p)}))}),dP=(n,i,c)=>{const m=["inline","block","selector","attributes","styles","classes"],p=w=>Vt(w,(x,M)=>jt(m,B=>B===M));return eS(n,i,w=>{const x=p(w);return eS(n,c,M=>{const B=p(M);return xo(x,B)})})},wm=n=>ns(n,"block"),tS=n=>wm(n)&&n.wrapper===!0,N2=n=>wm(n)&&n.wrapper!==!0,fd=n=>ns(n,"selector"),Ml=n=>ns(n,"inline"),Jk=n=>fd(n)&&Ml(n)&&qr(wo(n,"mixed"),!0),I2=n=>fd(n)&&n.expand!==!1&&!Ml(n),Ud=Wd,B2=$2,ex=sc,tx=Wl,hP=n=>mi(n)&&n.getAttribute("data-mce-bogus")&&!n.nextSibling,zE=(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},L2=(n,i,c,m)=>{const p=i.data;if(n){for(let w=c;w>0;w--)if(m(p.charAt(w-1)))return w}else for(let w=c;wL2(n,i,c,m=>Gs(m)||Ah(m)),mP=(n,i,c)=>L2(n,i,c,kb),Tb=(n,i,c,m,p,w)=>{let x;const M=n.getParent(c,n.isBlock)||i,B=(ae,fe,ve)=>{const Le=up(n),Ye=p?Le.backwards:Le.forwards;return he.from(Ye(ae,fe,(Pe,Ve)=>Ud(Pe.parentNode)?-1:(x=Pe,ve(p,Pe,Ve)),M))};return B(c,m,VE).bind(ae=>w?B(ae.container,ae.offset+(p?-1:0),mP):he.some(ae)).orThunk(()=>x?he.some({container:x,offset:p?0:x.length}):he.none())},Gc=(n,i,c,m,p)=>{const w=m[p];_n(m)&&ol(m.data)&&w&&(m=w);const x=B2(n,m);for(let M=0;M{var p;let w=c;const x=n.getRoot(),M=i[0];if(wm(M)&&(w=M.wrapper?null:n.getParent(c,M.block,x)),!w){const B=(p=n.getParent(c,"LI,TD,TH"))!==null&&p!==void 0?p:x;w=n.getParent(_n(c)?c.parentNode:c,G=>G!==x&&tx(n.schema,G),B)}if(w&&wm(M)&&M.wrapper&&(w=B2(n,w,"ul,ol").reverse()[0]||w),!w)for(w=c;w&&w[m]&&!n.isBlock(w[m])&&(w=w[m],!J_(w,"br")););return w||c},Yd=(n,i,c,m)=>{const p=c.parentNode;return pe(c[m])?!1:p===i||Ne(p)||n.isBlock(p)?!0:Yd(n,i,p,m)},dd=(n,i,c,m,p)=>{let w=c;const x=p?"previousSibling":"nextSibling",M=n.getRoot();if(_n(c)&&!ex(c)&&(p?m>0:mUd(n.parentNode)||Ud(n),z0=(n,i,c,m=!1)=>{let{startContainer:p,startOffset:w,endContainer:x,endOffset:M}=i;const B=c[0];return Jn(p)&&p.hasChildNodes()&&(p=ad(p,w),_n(p)&&(w=0)),Jn(x)&&x.hasChildNodes()&&(x=ad(x,i.collapsed?M:M-1),_n(x)&&(M=x.data.length)),p=zE(n,p),x=zE(n,x),nS(p)&&(p=Ud(p)?p:p.parentNode,i.collapsed?p=p.previousSibling||p:p=p.nextSibling||p,_n(p)&&(w=i.collapsed?p.length:0)),nS(x)&&(x=Ud(x)?x:x.parentNode,i.collapsed?x=x.nextSibling||x:x=x.previousSibling||x,_n(x)&&(M=i.collapsed?0:x.length)),i.collapsed&&(Tb(n,n.getRoot(),p,w,!0,m).each(({container:fe,offset:ve})=>{p=fe,w=ve}),Tb(n,n.getRoot(),x,M,!1,m).each(({container:fe,offset:ve})=>{x=fe,M=ve})),(Ml(B)||B.block_expand)&&((!Ml(B)||!_n(p)||w===0)&&(p=dd(n,c,p,w,!0)),(!Ml(B)||!_n(x)||M===x.data.length)&&(x=dd(n,c,x,M,!1))),I2(B)&&(p=Gc(n,c,i,p,"previousSibling"),x=Gc(n,c,i,x,"nextSibling")),(wm(B)||fd(B))&&(p=Ph(n,c,p,"previousSibling"),x=Ph(n,c,x,"nextSibling"),wm(B)&&(n.isBlock(p)||(p=dd(n,c,p,w,!0)),n.isBlock(x)||(x=dd(n,c,x,M,!1)))),Jn(p)&&p.parentNode&&(w=n.nodeIndex(p),p=p.parentNode),Jn(x)&&x.parentNode&&(M=n.nodeIndex(x)+1,x=x.parentNode),{startContainer:p,startOffset:w,endContainer:x,endOffset:M}},c1=(n,i,c)=>{var m;const p=i.startOffset,w=ad(i.startContainer,p),x=i.endOffset,M=ad(i.endContainer,x-1),B=Ve=>{const mt=Ve[0];_n(mt)&&mt===w&&p>=mt.data.length&&Ve.splice(0,1);const vt=Ve[Ve.length-1];return x===0&&Ve.length>0&&vt===M&&_n(vt)&&Ve.splice(Ve.length-1,1),Ve},G=(Ve,mt,vt)=>{const St=[];for(;Ve&&Ve!==vt;Ve=Ve[mt])St.push(Ve);return St},ae=(Ve,mt)=>n.getParent(Ve,vt=>vt.parentNode===mt,mt),fe=(Ve,mt,vt)=>{const St=vt?"nextSibling":"previousSibling";for(let Mt=Ve,dn=Mt.parentNode;Mt&&Mt!==mt;Mt=dn){dn=Mt.parentNode;const Zn=G(Mt===Ve?Mt:Mt[St],St);Zn.length&&(vt||Zn.reverse(),c(B(Zn)))}};if(w===M)return c(B([w]));const ve=(m=n.findCommonAncestor(w,M))!==null&&m!==void 0?m:n.getRoot();if(n.isChildOf(w,M))return fe(w,ve,!0);if(n.isChildOf(M,w))return fe(M,ve);const Le=ae(w,ve)||w,Ye=ae(M,ve)||M;fe(w,Le,!0);const Pe=G(Le===w?Le:Le.nextSibling,"nextSibling",Ye===M?Ye.nextSibling:Ye);Pe.length&&c(B(Pe)),fe(M,Ye)},gP=['pre[class*=language-][contenteditable="false"]',"figure.image","div[data-ephox-embed-iri]","div.tiny-pageembed","div.mce-toc","div[data-mce-toc]"],nx=n=>sl(n)&&Wc(n)===Ft,pP=(n,i,c,m)=>fi(i).fold(()=>"skipping",p=>m==="br"||nx(i)?"valid":JC(i)?"existing":qc(i.dom)?"caret":jt(gP,w=>Du(i,w))?"valid-block":!Om(n,c,m)||!Om(n,ei(p),c)?"invalid-child":"valid"),WE=(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)},UE=(n,i,c,m,p,w)=>{const{uid:x=i,...M}=c;Ju(n,id()),Pr(n,`${Kp()}`,x),Pr(n,`${uf()}`,m);const{attributes:B={},classes:G=[]}=p(x,M);if(Ku(n,B),Wv(n,G),w){G.length>0&&Pr(n,`${S0()}`,G.join(","));const ae=bs(B);ae.length>0&&Pr(n,`${C0()}`,ae.join(","))}},YE=n=>{zc(n,id()),Vi(n,`${Kp()}`),Vi(n,`${uf()}`),Vi(n,`${ib()}`);const i=Va(n,`${C0()}`).map(m=>m.split(",")).getOr([]),c=Va(n,`${S0()}`).map(m=>m.split(",")).getOr([]);$e(i,m=>Vi(n,m)),Uy(n,c),Vi(n,`${S0()}`),Vi(n,`${C0()}`)},oS=(n,i,c,m,p)=>{const w=Ke.fromTag("span",n);return UE(w,i,c,m,p,!1),w},ox=(n,i,c,m,p,w)=>{const x=[],M=oS(n.getDoc(),c,w,m,p),B=_h(),G=()=>{B.clear()},ae=()=>B.get().getOrThunk(()=>{const Ye=ug(M);return x.push(Ye),B.set(Ye),Ye}),fe=Ye=>{$e(Ye,ve)},ve=Ye=>{switch(pP(n,Ye,"span",ei(Ye))){case"invalid-child":{G();const Ve=Da(Ye);fe(Ve),G();break}case"valid-block":{G(),UE(Ye,c,w,m,p,!0);break}case"valid":{const Ve=ae();e0(Ye,Ve);break}}},Le=Ye=>{const Pe=gt(Ye,Ke.fromDom);fe(Pe)};return c1(n.dom,i,Ye=>{G(),Le(Ye)}),x},Mi=(n,i,c,m)=>{n.undoManager.transact(()=>{const p=n.selection,w=p.getRng(),x=xb(n).length>0,M=Li("mce-annotation");if(w.collapsed&&!x&&WE(n,w),p.getRng().collapsed&&!x){const B=oS(n.getDoc(),M,m,i,c.decorate);Pf(B,Gr),p.getRng().insertNode(B.dom),p.select(B.dom)}else QE(p,!1,()=>{jk(n,B=>{ox(n,B,M,i,c.decorate,m)})})})},u1=n=>{const i=Vv();EE(n,i);const c=u_(n,i),m=Ec("span"),p=w=>{$e(w,x=>{m(x)?Kl(x):YE(x)})};return{register:(w,x)=>{i.register(w,x)},annotate:(w,x)=>{i.lookup(w).each(M=>{Mi(n,w,M,x)})},annotationChanged:(w,x)=>{c.addListener(w,x)},remove:w=>{Vy(n,he.some(w)).each(({elements:x})=>{const M=n.selection.getBookmark();p(x),n.selection.moveToBookmark(M)})},removeAll:w=>{const x=n.selection.getBookmark();ln(Wy(n,w),(M,B)=>{p(M)}),n.selection.moveToBookmark(x)},getAll:w=>{const x=Wy(n,w);return vs(x,M=>gt(M,B=>B.dom))}}},_O=n=>({getBookmark:Be(sP,n),moveToBookmark:Be(rP,n)});_O.isBookmarkNode=Wd;const sx=(n,i,c)=>c.collapsed?!1:jt(c.getClientRects(),m=>ab(m,n,i)),XE=(n,i)=>n.dispatch("PreProcess",i),rx=(n,i)=>n.dispatch("PostProcess",i),jE=n=>{n.dispatch("remove")},sS=n=>{n.dispatch("detach")},bP=(n,i)=>{n.dispatch("SwitchMode",{mode:i})},vP=(n,i,c,m,p)=>{n.dispatch("ObjectResizeStart",{target:i,width:c,height:m,origin:p})},qE=(n,i,c,m,p)=>{n.dispatch("ObjectResized",{target:i,width:c,height:m,origin:p})},OP=n=>{n.dispatch("PreInit")},ix=n=>{n.dispatch("PostRender")},SO=n=>{n.dispatch("Init")},CO=(n,i)=>{n.dispatch("PlaceholderToggle",{state:i})},rS=(n,i,c)=>{n.dispatch(i,c)},GE=(n,i,c,m)=>{n.dispatch("FormatApply",{format:i,node:c,vars:m})},Mh=(n,i,c,m)=>{n.dispatch("FormatRemove",{format:i,node:c,vars:m})},Kc=(n,i)=>n.dispatch("BeforeSetContent",i),wu=(n,i)=>n.dispatch("SetContent",i),vp=(n,i)=>n.dispatch("BeforeGetContent",i),yP=(n,i)=>n.dispatch("GetContent",i),wP=(n,i)=>{n.dispatch("AutocompleterStart",i)},_P=(n,i)=>{n.dispatch("AutocompleterUpdate",i)},ir=n=>{n.dispatch("AutocompleterEnd")},SP=(n,i,c)=>n.dispatch("PastePreProcess",{content:i,internal:c}),KE=(n,i,c)=>n.dispatch("PastePostProcess",{node:i,internal:c}),iS=(n,i)=>n.dispatch("PastePlainTextToggle",{state:i}),CP=(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=>qn.os.isMacOS()||qn.os.isiOS()?n.metaKey:n.ctrlKey&&!n.altKey},V0="data-mce-selected",kP="table,img,figure.image,hr,video,span.mce-preview-object,details",JE=Math.abs,aS=Math.round,F2={nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]},ax=n=>n.type==="longpress"||n.type.indexOf("touch")===0,lx=(n,i)=>{const c=i.dom,m=i.getDoc(),p=document,w=i.getBody();let x,M,B,G,ae,fe,ve,Le,Ye,Pe,Ve,mt,vt,St,Mt,dn,Zn;const $n=En=>pe(En)&&(Ui(En)||c.is(En,"figure.image")),Lt=En=>of(En)||c.hasClass(En,"mce-preview-object"),Zt=(En,Xo)=>{if(ax(En)){const Ks=En.touches[0];return $n(En.target)&&!sx(Ks.clientX,Ks.clientY,Xo)}else return $n(En.target)&&!sx(En.clientX,En.clientY,Xo)},yn=En=>{const Xo=En.target;Zt(En,i.selection.getRng())&&!En.isDefaultPrevented()&&i.selection.select(Xo)},bo=En=>c.hasClass(En,"mce-preview-object")&&pe(En.firstElementChild)?[En,En.firstElementChild]:c.is(En,"figure.image")?[En.querySelector("img")]:[En],Do=En=>{const Xo=d2(i);return!Xo||En.getAttribute("data-mce-resize")==="false"||En===i.getBody()?!1:c.hasClass(En,"mce-preview-object")&&pe(En.firstElementChild)?Du(Ke.fromDom(En.firstElementChild),Xo):Du(Ke.fromDom(En),Xo)},Cs=En=>Lt(En)?c.create("img",{src:qn.transparentSrc}):En.cloneNode(!0),Ws=(En,Xo,Ks)=>{if(pe(Ks)){const Kr=bo(En);$e(Kr,co=>{co.style[Xo]||!i.schema.isValid(co.nodeName.toLowerCase(),Xo)?c.setStyle(co,Xo,Ks):c.setAttrib(co,Xo,""+Ks)})}},Ir=(En,Xo,Ks)=>{Ws(En,"width",Xo),Ws(En,"height",Ks)},pi=En=>{let Xo,Ks,Kr,co,Us;Xo=En.screenX-fe,Ks=En.screenY-ve,St=Xo*G[2]+Pe,Mt=Ks*G[3]+Ve,St=St<5?5:St,Mt=Mt<5?5:Mt,($n(x)||Lt(x))&&Mc(i)!==!1?Kr=!to.modifierPressed(En):Kr=to.modifierPressed(En),Kr&&(JE(Xo)>JE(Ks)?(Mt=aS(St*mt),St=aS(Mt/mt)):(St=aS(Mt/mt),Mt=aS(St*mt))),Ir(M,St,Mt),co=G.startPos.x+Xo,Us=G.startPos.y+Ks,co=co>0?co:0,Us=Us>0?Us:0,c.setStyles(B,{left:co,top:Us,display:"block"}),B.innerHTML=St+" × "+Mt,G[2]<0&&M.clientWidth<=St&&c.setStyle(M,"left",Le+(Pe-St)),G[3]<0&&M.clientHeight<=Mt&&c.setStyle(M,"top",Ye+(Ve-Mt)),Xo=w.scrollWidth-dn,Ks=w.scrollHeight-Zn,Xo+Ks!==0&&c.setStyles(B,{left:co-Xo,top:Us-Ks}),vt||(vP(i,x,Pe,Ve,"corner-"+G.name),vt=!0)},fl=()=>{const En=vt;vt=!1,En&&(Ws(x,"width",St),Ws(x,"height",Mt)),c.unbind(m,"mousemove",pi),c.unbind(m,"mouseup",fl),p!==m&&(c.unbind(p,"mousemove",pi),c.unbind(p,"mouseup",fl)),c.remove(M),c.remove(B),c.remove(ae),Il(x),En&&(qE(i,x,St,Mt,"corner-"+G.name),c.setAttrib(x,"style",c.getAttrib(x,"style"))),i.nodeChanged()},Il=En=>{Is();const Xo=c.getPos(En,w),Ks=Xo.x,Kr=Xo.y,co=En.getBoundingClientRect(),Us=co.width||co.right-co.left,ci=co.height||co.bottom-co.top;x!==En&&(Pn(),x=En,St=Mt=0);const Ja=i.dispatch("ObjectSelected",{target:En});Do(En)&&!Ja.isDefaultPrevented()?ln(F2,(Ti,$c)=>{const Fh=Dm=>{const qO=bo(x)[0];fe=Dm.screenX,ve=Dm.screenY,Pe=qO.clientWidth,Ve=qO.clientHeight,mt=Ve/Pe,G=Ti,G.name=$c,G.startPos={x:Us*Ti[0]+Ks,y:ci*Ti[1]+Kr},dn=w.scrollWidth,Zn=w.scrollHeight,ae=c.add(w,"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(V0),w.appendChild(M),c.bind(m,"mousemove",pi),c.bind(m,"mouseup",fl),p!==m&&(c.bind(p,"mousemove",pi),c.bind(p,"mouseup",fl)),B=c.add(w,"div",{class:"mce-resize-helper","data-mce-bogus":"all"},Pe+" × "+Ve)};let qd=c.get("mceResizeHandle"+$c);qd&&c.remove(qd),qd=c.add(w,"div",{id:"mceResizeHandle"+$c,"data-mce-bogus":"all",class:"mce-resizehandle",unselectable:!0,style:"cursor:"+$c+"-resize; margin:0; padding:0"}),c.bind(qd,"mousedown",Dm=>{Dm.stopImmediatePropagation(),Dm.preventDefault(),Fh(Dm)}),Ti.elm=qd,c.setStyles(qd,{left:Us*Ti[0]+Ks-qd.offsetWidth/2,top:ci*Ti[1]+Kr-qd.offsetHeight/2})}):Pn(!1)},Oc=_0(Il,0),Pn=(En=!0)=>{Oc.cancel(),Is(),x&&En&&x.removeAttribute(V0),ln(F2,(Xo,Ks)=>{const Kr=c.get("mceResizeHandle"+Ks);Kr&&(c.unbind(Kr),c.remove(Kr))})},eo=(En,Xo)=>c.isChildOf(En,Xo),Cr=En=>{if(vt||i.removed||i.composing)return;const Xo=En.type==="mousedown"?En.target:n.getNode(),Ks=it(Ke.fromDom(Xo),kP).map(co=>co.dom).filter(co=>c.isEditable(co.parentElement)).getOrUndefined(),Kr=pe(Ks)?c.getAttrib(Ks,V0,"1"):"1";if($e(c.select(`img[${V0}],hr[${V0}]`),co=>{co.removeAttribute(V0)}),pe(Ks)&&eo(Ks,w)&&i.hasFocus()){Co();const co=n.getStart(!0);if(eo(co,Ks)&&eo(n.getEnd(!0),Ks)){c.setAttrib(Ks,V0,Kr),Oc.throttle(Ks);return}}Pn()},Is=()=>{ln(F2,En=>{En.elm&&(c.unbind(En.elm),delete En.elm)})},Co=()=>{try{i.getDoc().execCommand("enableObjectResizing",!1,"false")}catch{}};return i.on("init",()=>{Co(),i.on("NodeChange ResizeEditor ResizeWindow ResizeContent drop",Cr),i.on("keyup compositionend",En=>{x&&x.nodeName==="TABLE"&&Cr(En)}),i.on("hide blur",Pn),i.on("contextmenu longpress",yn,!0)}),i.on("remove",Is),{isResizable:Do,showResizeRect:Il,hideResizeRect:Pn,updateResizeRect:Cr,destroy:()=>{Oc.cancel(),x=M=ae=null}}},xP=(n,i)=>{i.fold(c=>{n.setStartBefore(c.dom)},(c,m)=>{n.setStart(c.dom,m)},c=>{n.setStartAfter(c.dom)})},OI=(n,i)=>{i.fold(c=>{n.setEndBefore(c.dom)},(c,m)=>{n.setEnd(c.dom,m)},c=>{n.setEndAfter(c.dom)})},e3=(n,i,c)=>{const m=n.document.createRange();return xP(m,i),OI(m,c),m},t3=(n,i,c,m,p)=>{const w=n.document.createRange();return w.setStart(i.dom,c),w.setEnd(m.dom,p),w},lS=pg.generate([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),TP=(n,i,c)=>i(Ke.fromDom(c.startContainer),c.startOffset,Ke.fromDom(c.endContainer),c.endOffset),Ko=(n,i)=>i.match({domRange:c=>({ltr:He(c),rtl:he.none}),relative:(c,m)=>({ltr:Wt(()=>e3(n,c,m)),rtl:Wt(()=>he.some(e3(n,m,c)))}),exact:(c,m,p,w)=>({ltr:Wt(()=>t3(n,c,m,p,w)),rtl:Wt(()=>he.some(t3(n,p,w,c,m)))})}),EP=(n,i)=>{const c=i.ltr();return c.collapsed?i.rtl().filter(p=>p.collapsed===!1).map(p=>lS.rtl(Ke.fromDom(p.endContainer),p.endOffset,Ke.fromDom(p.startContainer),p.startOffset)).getOrThunk(()=>TP(n,lS.ltr,c)):TP(n,lS.ltr,c)},AP=(n,i)=>{const c=Ko(n,i);return EP(n,c)};lS.ltr,lS.rtl;const Q2={create:(n,i,c,m)=>({start:n,soffset:i,finish:c,foffset:m})},cS=(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(w=>{if(w.offsetNode===null)return he.none();const x=n.dom.createRange();return x.setStart(w.offsetNode,w.offset),x.collapse(),he.some(x)})},DP=(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))},PP=(()=>document.caretPositionFromPoint?cS:document.caretRangeFromPoint?DP:he.none)(),MP=(n,i,c)=>{const m=Ke.fromDom(n.document);return PP(m,i,c).map(p=>Q2.create(Ke.fromDom(p.startContainer),p.startOffset,Ke.fromDom(p.endContainer),p.endOffset))},Z2=pg.generate([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),cx=(n,i,c,m)=>n.fold(i,c,m),n3=n=>n.fold(_t,_t,_t),ux=Z2.before,fx=Z2.on,o3=Z2.after,f1={before:ux,on:fx,after:o3,cata:cx,getStart:n3},kO=pg.generate([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),dx=n=>kO.exact(n.start,n.soffset,n.finish,n.foffset),RP=n=>n.match({domRange:i=>Ke.fromDom(i.startContainer),relative:(i,c)=>f1.getStart(i),exact:(i,c,m,p)=>i}),$P=kO.domRange,Nr=kO.relative,hx=kO.exact,Op=n=>{const i=RP(n);return Yr(i)},yp=Q2.create,d1={domRange:$P,relative:Nr,exact:hx,exactFromRange:dx,getWin:Op,range:yp},Hu=(n,i)=>{const c=ei(n);return c==="input"?f1.after(n):xt(["br","img"],c)?i===0?f1.before(n):f1.after(n):f1.on(n,i)},uS=(n,i)=>{const c=n.fold(f1.before,Hu,f1.after),m=i.fold(f1.before,Hu,f1.after);return d1.relative(c,m)},xO=(n,i,c,m)=>{const p=Hu(n,i),w=Hu(c,m);return d1.relative(p,w)},fS=n=>n.match({domRange:i=>{const c=Ke.fromDom(i.startContainer),m=Ke.fromDom(i.endContainer);return xO(c,i.startOffset,m,i.endOffset)},relative:uS,exact:xO}),W0=(n,i)=>{const m=(i||document).createDocumentFragment();return $e(n,p=>{m.appendChild(p.dom)}),Ke.fromDom(m)},NP=n=>{const i=d1.getWin(n).dom,c=(p,w,x,M)=>t3(i,p,w,x,M),m=fS(n);return AP(i,m).match({ltr:c,rtl:c})},wI=(n,i,c)=>MP(n,i,c),IP=(n,i,c)=>{const m=Yr(Ke.fromDom(c));return wI(m.dom,n,i).map(p=>{const w=c.createRange();return w.setStart(p.start.dom,p.soffset),w.setEnd(p.finish.dom,p.foffset),w}).getOrUndefined()},s3=(n,i)=>pe(n)&&pe(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},_m=(n,i,c)=>ar(n,i,c)!==null,TO=(n,i,c)=>_m(n,i,m=>m.nodeName===c),BP=(n,i)=>_r(n)&&!_m(n,i,qc),U0=(n,i,c)=>{const m=i.parentNode;if(m){const p=new wi(i,n.getParent(m,n.isBlock)||n.getRoot());let w;for(;w=p[c?"prev":"next"]();)if(mi(w))return!0}return!1},dr=(n,i)=>{var c;return((c=n.previousSibling)===null||c===void 0?void 0:c.nodeName)===i},LP=(n,i)=>{let c=i;for(;c&&c!==n;){if(Es(c))return!0;c=c.parentNode}return!1},dS=(n,i,c,m,p)=>{const w=n.getRoot(),x=n.schema.getNonEmptyElements(),M=p.parentNode;let B,G;if(!M)return he.none();const ae=n.getParent(M,n.isBlock)||w;if(m&&mi(p)&&i&&n.isEmpty(ae))return he.some(zt(M,n.nodeIndex(p)));const fe=new wi(p,ae);for(;G=fe[m?"prev":"next"]();){if(n.getContentEditableParent(G)==="false"||BP(G,w))return he.none();if(_n(G)&&G.data.length>0)return TO(G,w,"A")?he.none():he.some(zt(G,m?G.data.length:0));if(n.isBlock(G)||x[G.nodeName.toLowerCase()])return he.none();B=G}return ch(B)?he.none():c&&B?he.some(zt(B,0)):he.none()},hS=(n,i,c,m)=>{const p=n.getRoot();let w,x=!1,M=c?m.startContainer:m.endContainer,B=c?m.startOffset:m.endOffset;const G=Jn(M)&&B===M.childNodes.length,ae=n.schema.getNonEmptyElements();let fe=c;if(_r(M))return he.none();if(Jn(M)&&B>M.childNodes.length-1&&(fe=!1),nf(M)&&(M=p,B=0),M===p){if(fe&&(w=M.childNodes[B>0?B-1:0],w&&(_r(w)||ae[w.nodeName]||Nu(w))))return he.none();if(M.hasChildNodes()){if(B=Math.min(!fe&&B>0?B-1:B,M.childNodes.length-1),M=M.childNodes[B],B=_n(M)&&G?M.data.length:0,!i&&M===p.lastChild&&Nu(M)||LP(p,M)||_r(M))return he.none();if(M.hasChildNodes()&&!Nu(M)){w=M;const ve=new wi(M,p);do{if(Es(w)||_r(w)){x=!1;break}if(_n(w)&&w.data.length>0){B=fe?0:w.data.length,M=w,x=!0;break}if(ae[w.nodeName.toLowerCase()]&&!xl(w)){B=n.nodeIndex(w),M=w.parentNode,fe||B++,x=!0;break}}while(w=fe?ve.next():ve.prev())}}}return i&&(_n(M)&&B===0&&dS(n,G,i,!0,M).each(ve=>{M=ve.container(),B=ve.offset(),x=!0}),Jn(M)&&(w=M.childNodes[B],w||(w=M.childNodes[B-1]),w&&mi(w)&&!dr(w,"A")&&!U0(n,w,!1)&&!U0(n,w,!0)&&dS(n,G,i,!0,w).each(ve=>{M=ve.container(),B=ve.offset(),x=!0}))),fe&&!i&&_n(M)&&B===M.data.length&&dS(n,G,i,!1,M).each(ve=>{M=ve.container(),B=ve.offset(),x=!0}),x&&M?he.some(zt(M,B)):he.none()},mS=(n,i)=>{const c=i.collapsed,m=i.cloneRange(),p=zt.fromRangeStart(i);return hS(n,c,!0,m).each(w=>{(!c||!zt.isAbove(p,w))&&m.setStart(w.container(),w.offset())}),c||hS(n,c,!1,m).each(w=>{m.setEnd(w.container(),w.offset())}),c&&m.collapse(!0),s3(i,m)?he.none():he.some(m)},h1=(n,i)=>n.splitText(i),wp=n=>{let i=n.startContainer,c=n.startOffset,m=n.endContainer,p=n.endOffset;if(i===m&&_n(i)){if(c>0&&cc){p=p-c;const w=h1(m,p).previousSibling;i=m=w,p=w.data.length,c=0}else p=0}else if(_n(i)&&c>0&&c0&&p({walk:(w,x)=>c1(n,w,x),split:wp,expand:(w,x={type:"word"})=>{if(x.type==="word"){const M=z0(n,w,[{inline:"span"}]),B=n.createRng();return B.setStart(M.startContainer,M.startOffset),B.setEnd(M.endContainer,M.endOffset),B}return w},normalize:w=>mS(n,w).fold(je,x=>(w.setStart(x.startContainer,x.startOffset),w.setEnd(x.endContainer,x.endOffset),!0))});O.compareRanges=s3,O.getCaretRangeFromPoint=IP,O.getSelectedNode=lb,O.getNode=ad;const D=((n,i)=>{const c=(M,B)=>{if(!Xe(B)&&!B.match(/^[0-9]+$/))throw new Error(n+".set accepts only positive integer values. Value was "+B);const G=M.dom;os(G)&&(G.style[n]=B+"px")},m=M=>{const B=i(M);if(B<=0||B===null){const G=Bi(M,n);return parseFloat(G)||0}return B},p=m,w=(M,B)=>Hn(B,(G,ae)=>{const fe=Bi(M,ae),ve=fe===void 0?0:parseInt(fe,10);return isNaN(ve)?G:G+ve},0);return{set:c,get:m,getOuter:p,aggregate:w,max:(M,B,G)=>{const ae=w(M,G);return B>ae?B-ae:0}}})("height",n=>{const i=n.dom;return Ed(n)?i.getBoundingClientRect().height:i.offsetHeight}),N=n=>D.get(n),Y=()=>Ke.fromDom(document),se=(n,i)=>n.view(i).fold(He([]),m=>{const p=n.owner(m),w=se(n,p);return[m].concat(w)}),be=(n,i)=>{const c=i.owner(n);return se(i,c)};var st=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(Ke.fromDom)},owner:n=>Eo(n)});const Ct=n=>{const i=Y(),c=tf(i),m=be(n,st),p=$u(n),w=An(m,(x,M)=>{const B=$u(M);return{left:x.left+B.left,top:x.top+B.top}},{left:0,top:0});return Xg(w.left+p.left+c.left,w.top+p.top+c.top)},fn=n=>ei(n)==="textarea",Xn=(n,i)=>n.dispatch("ScrollIntoView",i).isDefaultPrevented(),Vn=(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=xy(n),m=N(n);return{element:n,bottom:c.top+m,height:m,pos:c,cleanup:i}},tn=(n,i)=>{const c=sn(n,i),m=Ke.fromHtml(''+Ft+"");return Ca(c.element,m),Un(m,()=>wr(m))},mo=n=>Un(Ke.fromDom(n),yt),cs=(n,i,c,m)=>{wl(n,(p,w)=>da(n,i,c,m),c)},Ds=(n,i,c,m,p)=>{const w={elm:m.element.dom,alignToTop:p};if(Xn(n,w))return;const x=tf(i).top;c(n,i,x,m,p),Vn(n,w)},da=(n,i,c,m)=>{const p=Ke.fromDom(n.getBody()),w=Ke.fromDom(n.getDoc());Wi(p);const x=tn(Ke.fromDom(c.startContainer),c.startOffset);Ds(n,w,i,x,m),x.cleanup()},Rl=(n,i,c,m)=>{const p=Ke.fromDom(n.getDoc());Ds(n,p,c,mo(i),m)},wl=(n,i,c)=>{const m=c.startContainer,p=c.startOffset,w=c.endContainer,x=c.endOffset;i(Ke.fromDom(m),Ke.fromDom(w));const M=n.dom.createRng();M.setStart(m,p),M.setEnd(w,x),n.selection.setRng(c)},zu=(n,i,c,m,p)=>{const w=i.pos;if(m)n0(w.left,w.top,p);else{const x=w.top-c+i.height;n0(-n.getBody().getBoundingClientRect().left,x,p)}},Y0=(n,i,c,m,p,w)=>{const x=m+c,M=p.pos.top,B=p.bottom,G=B-M>=m;Mx?zu(n,p,m,G?w!==!1:w===!0,i):B>x&&!G&&zu(n,p,m,w===!0,i)},H2=(n,i,c,m,p)=>{const w=Yr(i).dom.innerHeight;Y0(n,i,c,w,m,p)},gS=(n,i,c,m,p)=>{const w=Yr(i).dom.innerHeight;Y0(n,i,c,w,m,p);const x=Ct(m.element),M=td(window);x.topM.bottom&&o0(m.element,p===!0)},pS=(n,i,c)=>cs(n,H2,i,c),ki=(n,i,c)=>Rl(n,i,H2,c),Vu=(n,i,c)=>cs(n,gS,i,c),bf=(n,i,c)=>Rl(n,i,gS,c),Sm=(n,i,c)=>{(n.inline?ki:bf)(n,i,c)},vf=(n,i,c)=>{(n.inline?pS:Vu)(n,i,c)},X0=n=>n.dom.focus(),Wu=n=>{const i=ql(n).dom;return n.dom===i.activeElement},z2=(n=Y())=>he.from(n.dom.activeElement).map(Ke.fromDom),V2=n=>z2(ql(n)).filter(i=>n.dom.contains(i.dom)),wg=(n,i)=>{const c=sl(i)?Wc(i).length:Da(i).length+1;return n>c?c:n<0?0:n},vc=n=>d1.range(n.start,wg(n.soffset,n.start),n.finish,wg(n.foffset,n.finish)),mx=(n,i)=>!Dd(i.dom)&&(cn(n,i)||bt(n,i)),r3=n=>i=>mx(n,i.start)&&mx(n,i.finish),i3=n=>n.inline||qn.browser.isFirefox(),a3=n=>d1.range(Ke.fromDom(n.startContainer),n.startOffset,Ke.fromDom(n.endContainer),n.endOffset),FP=n=>{const i=n.getSelection();return(!i||i.rangeCount===0?he.none():he.from(i.getRangeAt(0))).map(a3)},gx=n=>{const i=Yr(n);return FP(i.dom).filter(r3(n))},QP=(n,i)=>he.from(i).filter(r3(n)).map(vc),W2=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()}},ZP=n=>{const i=i3(n)?gx(Ke.fromDom(n.getBody())):he.none();n.bookmark=i.isSome()?i:n.bookmark},l3=n=>(n.bookmark?n.bookmark:he.none()).bind(c=>QP(Ke.fromDom(n.getBody()),c)).bind(W2),_I=n=>{l3(n).each(i=>n.selection.setRng(i))},SI={isEditorUIElement:n=>{const i=n.className.toString();return i.indexOf("tox-")!==-1||i.indexOf("mce-")!==-1}},_V=(n,i)=>(Xe(i)||(i=0),setTimeout(n,i)),zP=(n,i)=>(Xe(i)||(i=0),setInterval(n,i)),_g={setEditorTimeout:(n,i,c)=>_V(()=>{n.removed||i()},c),setEditorInterval:(n,i,c)=>{const m=zP(()=>{n.removed?clearInterval(m):i()},c);return m}},CI=n=>n.type==="nodechange"&&n.selectionChange,kI=(n,i)=>{const c=()=>{i.throttle()};Qr.DOM.bind(document,"mouseup",c),n.on("remove",()=>{Qr.DOM.unbind(document,"mouseup",c)})},xI=(n,i)=>{n.on("mouseup touchend",c=>{i.throttle()})},SV=(n,i)=>{xI(n,i),n.on("keyup NodeChange AfterSetSelectionRange",c=>{CI(c)||ZP(n)})},CV=n=>{const i=_0(()=>{ZP(n)},0);n.on("init",()=>{n.inline&&kI(n,i),SV(n,i)}),n.on("remove",()=>{i.cancel()})};let bS;const VP=Qr.DOM,c3=n=>Jn(n)&&SI.isEditorUIElement(n),u3=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},px=(n,i)=>{const c=P_(n);return VP.getParent(i,p=>c3(p)||(c?n.dom.is(p,c):!1))!==null},f3=n=>{try{const i=ql(Ke.fromDom(n.getElement()));return z2(i).fold(()=>document.body,c=>c.dom)}catch{return document.body}},TI=(n,i)=>{const c=i.editor;CV(c);const m=(p,w)=>{if(z_(p)&&p.inline!==!0){const x=Ke.fromDom(p.getContainer());w(x,"tox-edit-focus")}};c.on("focusin",()=>{const p=n.focusedEditor;u3(f3(c))&&m(c,Ju),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",()=>{_g.setEditorTimeout(c,()=>{const p=n.focusedEditor;(!u3(f3(c))||p!==c)&&m(c,zc),!px(c,f3(c))&&p===c&&(c.dispatch("blur",{focusedEditor:null}),n.focusedEditor=null)})}),bS||(bS=p=>{const w=n.activeEditor;w&&tm(p).each(x=>{const M=x;M.ownerDocument===document&&M!==document.body&&!px(w,M)&&n.focusedEditor===w&&(w.dispatch("blur",{focusedEditor:null}),n.focusedEditor=null)})},VP.bind(document,"focusin",bS))},kV=(n,i)=>{n.focusedEditor===i.editor&&(n.focusedEditor=null),!n.activeEditor&&bS&&(VP.unbind(document,"focusin",bS),bS=null)},xV=n=>{n.on("AddEditor",Be(TI,n)),n.on("RemoveEditor",Be(kV,n))},TV=(n,i)=>n.dom.getParent(i,c=>n.dom.getContentEditable(c)==="true"),EV=n=>n.collapsed?he.from(ad(n.startContainer,n.startOffset)).map(Ke.fromDom):he.none(),AV=(n,i)=>EV(i).bind(c=>qa(c)?he.some(c):cn(n,c)?he.none():he.some(n)),EI=(n,i)=>{AV(Ke.fromDom(n.getBody()),i).bind(c=>cl(c.dom)).fold(()=>{n.selection.normalize()},c=>n.selection.setRng(c.toRange()))},WP=n=>{if(n.setActive)try{n.setActive()}catch{n.focus()}else n.focus()},DV=n=>Wu(n)||V2(n).isSome(),PV=n=>pe(n.iframeElement)&&Wu(Ke.fromDom(n.iframeElement)),MV=n=>{const i=n.getBody();return i&&DV(Ke.fromDom(i))},RV=n=>{const i=ql(Ke.fromDom(n.getElement()));return z2(i).filter(c=>!u3(c.dom)&&px(n,c.dom)).isSome()},U2=n=>n.inline?MV(n):PV(n),d3=n=>U2(n)||RV(n),AI=n=>{const i=n.selection,c=n.getBody();let m=i.getRng();n.quirks.refreshContentEditable(),pe(n.bookmark)&&!U2(n)&&l3(n).each(w=>{n.selection.setRng(w),m=w});const p=TV(n,i.getNode());if(p&&n.dom.isChildOf(p,c)){WP(p),EI(n,m),h3(n);return}n.inline||(qn.browser.isOpera()||WP(c),n.getWin().focus()),(qn.browser.isFirefox()||n.inline)&&(WP(c),EI(n,m)),h3(n)},h3=n=>n.editorManager.setActive(n),$V=(n,i)=>{n.removed||(i?h3(n):AI(n))},DI=(n,i,c,m,p)=>{const w=c?i.startContainer:i.endContainer,x=c?i.startOffset:i.endOffset;return he.from(w).map(Ke.fromDom).map(M=>!m||!i.collapsed?ef(M,p(M,x)).getOr(M):M).bind(M=>kl(M)?he.some(M):fi(M).filter(kl)).map(M=>M.dom).getOr(n)},PI=(n,i,c=!1)=>DI(n,i,!0,c,(m,p)=>Math.min(dc(m),p)),MI=(n,i,c=!1)=>DI(n,i,!1,c,(m,p)=>p>0?p-1:p),RI=(n,i)=>{const c=n;for(;n&&_n(n)&&n.length===0;)n=i?n.nextSibling:n.previousSibling;return n||c},NV=(n,i)=>{if(!i)return n;let c=i.startContainer,m=i.endContainer;const p=i.startOffset,w=i.endOffset;let x=i.commonAncestorContainer;i.collapsed||(c===m&&w-p<2&&c.hasChildNodes()&&(x=c.childNodes[p]),_n(c)&&_n(m)&&(c.length===p?c=RI(c.nextSibling,!0):c=c.parentNode,w===0?m=RI(m.previousSibling,!1):m=m.parentNode,c&&c===m&&(x=c)));const M=_n(x)?x.parentNode:x;return Jn(M)?M:n},$I=(n,i,c,m)=>{const p=[],w=n.getRoot(),x=n.getParent(c||PI(w,i,i.collapsed),n.isBlock),M=n.getParent(m||MI(w,i,i.collapsed),n.isBlock);if(x&&x!==w&&p.push(x),x&&M&&x!==M){let B;const G=new wi(x,w);for(;(B=G.next())&&B!==M;)n.isBlock(B)&&p.push(B)}return M&&x!==M&&M!==w&&p.push(M),p},IV=(n,i,c)=>he.from(i).bind(m=>he.from(m.parentNode).map(p=>{const w=n.nodeIndex(m),x=n.createRng();return x.setStart(p,w),x.setEnd(p,w+1),c&&(Xk(n,x,m,!0),Xk(n,x,m,!1)),x})),m3=(n,i)=>gt(i,c=>{const m=n.dispatch("GetSelectionRange",{range:c});return m.range!==c?m.range:c}),NI=n=>ei(n)==="img"?1:nd(n).fold(()=>Da(n).length,i=>i.length),BV=n=>nd(n).filter(i=>i.trim().length!==0||i.indexOf(Gr)>-1).isSome(),LV=n=>Pi(n)&&Fl(n,"contenteditable")==="false",FV=["img","br"],II=n=>BV(n)||xt(FV,ei(n))||LV(n),QV=n=>ue(n,II),ZV=n=>HV(n,II),HV=(n,i)=>{const c=m=>{const p=Da(m);for(let w=p.length-1;w>=0;w--){const x=p[w];if(i(x))return he.some(x);const M=c(x);if(M.isSome())return M}return he.none()};return c(n)},BI="[data-mce-autocompleter]",zV=(n,i)=>{if(LI(Ke.fromDom(n.getBody())).isNone()){const c=Ke.fromHtml('',n.getDoc());na(c,Ke.fromDom(i.extractContents())),i.insertNode(c.dom),fi(c).each(m=>m.dom.normalize()),ZV(c).map(m=>{n.selection.setCursorLocation(m.dom,NI(m))})}},VV=n=>it(n,BI),LI=n=>Je(n,BI),WV=(n,i)=>LI(i).each(c=>{const m=n.selection.getBookmark();Kl(c),n.selection.moveToBookmark(m)}),UV={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11},g3=(n,i,c)=>{const m=c?"lastChild":"firstChild",p=c?"prev":"next";if(n[m])return n[m];if(n!==i){let w=n[p];if(w)return w;for(let x=n.parent;x&&x!==i;x=x.parent)if(w=x[p],w)return w}},YV=n=>{var i;const c=(i=n.value)!==null&&i!==void 0?i:"";if(!eg(c))return!1;const m=n.parent;return!(m&&(m.name!=="span"||m.attr("style"))&&/^[ ]+$/.test(c))},FI=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 Xd{static create(i,c){const m=new Xd(i,UV[i]||1);return c&&ln(c,(p,w)=>{m.attr(w,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(!L(i))return pe(i)&&ln(i,(w,x)=>{m.attr(x,w)}),m;const p=m.attributes;if(p){if(c!==void 0){if(c===null){if(i in p.map){delete p.map[i];let w=p.length;for(;w--;)if(p[w].name===i)return p.splice(w,1),m}return m}if(i in p.map){let w=p.length;for(;w--;)if(p[w].name===i){p[w].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 Xd(i.name,i.type),m=i.attributes;if(m){const p=[];p.map={};for(let w=0,x=m.length;w/^\s*\[if [\w\W]+\]>.*/.test(n.substr(i)),QI=(n,i,c=0)=>{const m=n.toLowerCase();if(m.indexOf("[if ",c)!==-1&&XV(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 w=p.exec(n);return w?w.index+w[0].length:m.length}},$o=(n,i,c)=>{const m=/<([!?\/])?([A-Za-z0-9\-_:.]+)/g,p=/(?:\s(?:[^'">]+(?:"[^"]*"|'[^']*'))*[^"'>]*(?:"[^">]*|'[^'>]*)?|\s*|\/)>/g,w=n.getVoidElements();let x=1,M=c;for(;x!==0;)for(m.lastIndex=M;;){const B=m.exec(i);if(B===null)return M;if(B[1]==="!"){Ar(B[2],"--")?M=QI(i,!1,B.index+3):M=QI(i,!0,B.index+1);break}else{p.lastIndex=m.lastIndex;const G=p.exec(i);if(X(G)||G.index!==m.lastIndex)continue;B[1]==="/"?x-=1:un(w,B[2])||(x+=1),M=m.lastIndex+G[0].length;break}}return M},ZI=(n,i)=>{const c=new RegExp(["\\s?("+n.join("|")+')="[^"]+"'].join("|"),"gi");return i.replace(c,"")},UP=(n,i)=>{const c=/<(\w+) [^>]*data-mce-bogus="all"[^>]*>/g,m=n.schema;let p=ZI(n.getTempAttrs(),i);const w=m.getVoidElements();let x;for(;x=c.exec(p);){const M=c.lastIndex,B=x[0].length;let G;w[x[1]]?G=M:G=$o(m,p,M),p=p.substring(0,M-B)+p.substring(G),c.lastIndex=M-B}return In(p)},jV=UP,p3=n=>{const i=pl(n,"[data-mce-bogus]");$e(i,c=>{Fl(c,"data-mce-bogus")==="all"?wr(c):au(c)?(Ca(c,Ke.fromText(nn)),wr(c)):Kl(c)})},HI=n=>{const i=pl(n,"input");$e(i,c=>{Vi(c,"name")})},qV=(n,i)=>{const c=jc(n),m=new RegExp(`^(<${c}[^>]*>( | |\\s|\xA0|
|)<\\/${c}>[\r -]*|
[\r -]*)$`);return i.replace(m,"")},GV=(n,i)=>{const c=n.getDoc(),m=ql(Ke.fromDom(n.getBody())),p=Ke.fromTag("div",c);Pr(p,"data-mce-bogus","all"),ua(p,{position:"fixed",left:"-9999999px",top:"0"}),Pf(p,i.innerHTML),p3(p),HI(p);const w=X1(m);na(w,p);const x=In(p.dom.innerText);return wr(p),x},KV=(n,i,c)=>{let m;return i.format==="raw"?m=hn.trim(jV(n.serializer,c.innerHTML)):i.format==="text"?m=GV(n,c):i.format==="tree"?m=n.serializer.serialize(c,i):m=qV(n,n.serializer.serialize(c,i)),i.format!=="text"&&!lu(Ke.fromDom(c))&&L(m)?hn.trim(m):m},JV=(n,i)=>he.from(n.getBody()).fold(He(i.format==="tree"?new Xd("body",11):""),c=>KV(n,i,c)),bx=hn.makeMap,YP=n=>{const i=[];n=n||{};const c=n.indent,m=bx(n.indent_before||""),p=bx(n.indent_after||""),w=op.getEncodeFunc(n.entity_encoding||"raw",n.entities),x=n.element_format!=="xhtml";return{start:(M,B,G)=>{if(c&&m[M]&&i.length>0){const ae=i[i.length-1];ae.length>0&&ae!==` -`&&i.push(` -`)}if(i.push("<",M),B)for(let ae=0,fe=B.length;ae0){const ae=i[i.length-1];ae.length>0&&ae!==` -`&&i.push(` -`)}},end:M=>{let B;i.push(""),c&&p[M]&&i.length>0&&(B=i[i.length-1],B.length>0&&B!==` -`&&i.push(` -`))},text:(M,B)=>{M.length>0&&(i[i.length]=B?M:w(M))},cdata:M=>{i.push("")},comment:M=>{i.push("")},pi:(M,B)=>{B?i.push(""):i.push(""),c&&i.push(` -`)},doctype:M=>{i.push("",c?` -`:"")},reset:()=>{i.length=0},getContent:()=>i.join("").replace(/\n$/,"")}},Y2=(n={},i=yh())=>{const c=YP(n);return n.validate="validate"in n?n.validate:!0,{serialize:p=>{const w=n.validate,x={3:B=>{var G;c.text((G=B.value)!==null&&G!==void 0?G:"",B.raw)},8:B=>{var G;c.comment((G=B.value)!==null&&G!==void 0?G:"")},7:B=>{c.pi(B.name,B.value)},10:B=>{var G;c.doctype((G=B.value)!==null&&G!==void 0?G:"")},4:B=>{var G;c.cdata((G=B.value)!==null&&G!==void 0?G:"")},11:B=>{let G=B;if(G=G.firstChild)do M(G);while(G=G.next)}};c.reset();const M=B=>{var G;const ae=x[B.type];if(ae)ae(B);else{const fe=B.name,ve=fe in i.getVoidElements();let Le=B.attributes;if(w&&Le&&Le.length>1){const Ye=[];Ye.map={};const Pe=i.getElementRule(B.name);if(Pe){for(let Ve=0,mt=Pe.attributesOrder.length;Ve{zI.add(i)});const gs=["font","text-decoration","text-emphasis"],XP=(n,i)=>bs(n.parseStyle(n.getAttrib(i,"style"))),xs=n=>zI.has(n),VI=(n,i)=>er(XP(n,i),c=>!xs(c)),pie=n=>Dt(n,i=>jt(gs,c=>Ar(i,c))),bie=(n,i,c)=>{const m=XP(n,i),p=XP(n,c),w=x=>{var M,B;const G=(M=n.getStyle(i,x))!==null&&M!==void 0?M:"",ae=(B=n.getStyle(c,x))!==null&&B!==void 0?B:"";return yr(G)&&yr(ae)&&G!==ae};return jt(m,x=>{const M=B=>jt(B,G=>G===x);if(!M(p)&&M(gs)){const B=pie(p);return jt(B,w)}else return w(x)})},WI=(n,i,c)=>he.from(c.container()).filter(_n).exists(m=>{const p=n?0:-1;return i(m.data.charAt(c.offset()+p))}),UI=Be(WI,!0,Ah),YI=Be(WI,!1,Ah),eW=n=>{const i=n.container();return _n(i)&&(i.data.length===0||Sn(i.data)&&_O.isBookmarkNode(i.parentNode))},EO=(n,i)=>c=>wb(n?0:-1,c).filter(i).isSome(),ts=n=>Ui(n)&&Bi(Ke.fromDom(n),"display")==="block",XI=n=>Es(n)&&!bl(n),tW=EO(!0,ts),nW=EO(!1,ts),j0=EO(!0,of),vS=EO(!1,of),jI=EO(!0,Nu),qI=EO(!1,Nu),AO=EO(!0,XI),q0=EO(!1,XI),oW=n=>n.slice(0,-1),vie=(n,i,c)=>cn(i,n)?oW(nh(n,m=>c(m)||bt(m,i))):[],sW=(n,i)=>vie(n,i,je),G0=(n,i)=>[n].concat(sW(n,i)),jP=(n,i,c)=>Nk(n,i,c,eW),GI=(n,i)=>oo(G0(Ke.fromDom(i.container()),n),hc),KI=(n,i,c)=>jP(n,i.dom,c).forall(m=>GI(i,c).fold(()=>!Hd(m,c,i.dom),p=>!Hd(m,c,i.dom)&&cn(p,Ke.fromDom(m.container())))),qP=(n,i,c)=>GI(i,c).fold(()=>jP(n,i.dom,c).forall(m=>!Hd(m,c,i.dom)),m=>jP(n,m.dom,c).isNone()),GP=Be(qP,!1),Ms=Be(qP,!0),JI=Be(KI,!1),b3=Be(KI,!0),eB=n=>We(n).exists(au),vx=(n,i,c)=>{const m=Dt(G0(Ke.fromDom(c.container()),i),hc),p=Ro(m).getOr(i);return zd(n,p.dom,c).filter(eB)},v3=(n,i)=>We(i).exists(au)||vx(!0,n,i).isSome(),O3=(n,i)=>dt(i).exists(au)||vx(!1,n,i).isSome(),tB=Be(vx,!1),rW=Be(vx,!0),KP=n=>zt.isTextPosition(n)&&!n.isAtStart()&&!n.isAtEnd(),nB=(n,i)=>{const c=Dt(G0(Ke.fromDom(i.container()),n),hc);return Ro(c).getOr(n)},oB=(n,i)=>KP(i)?YI(i):YI(i)||Zu(nB(n,i).dom,i).exists(YI),sB=(n,i)=>KP(i)?UI(i):UI(i)||Zf(nB(n,i).dom,i).exists(UI),iW=n=>xt(["pre","pre-wrap"],n),JP=n=>We(n).bind(i=>Zl(i,kl)).exists(i=>iW(Bi(i,"white-space"))),aW=(n,i)=>Zu(n.dom,i).isNone(),lW=(n,i)=>Zf(n.dom,i).isNone(),cW=(n,i)=>aW(n,i)||lW(n,i)||GP(n,i)||Ms(n,i)||O3(n,i)||v3(n,i),e5=n=>pe(n)&&Es(n)&&Y_(n),y3=(n,i)=>c=>e5(new wi(c,n)[i]()),uW=(n,i)=>{const c=Zf(n.dom,i).getOr(i),m=y3(n.dom,"next");return i.isAtEnd()&&(m(i.container())||m(c.container()))},fW=(n,i)=>{const c=Zu(n.dom,i).getOr(i),m=y3(n.dom,"prev");return i.isAtStart()&&(m(i.container())||m(c.container()))},rB=(n,i)=>JP(i)?!1:cW(n,i)||oB(n,i)||sB(n,i),Ox=(n,i)=>JP(i)?!1:GP(n,i)||JI(n,i)||O3(n,i)||oB(n,i)||fW(n,i),dW=n=>{const i=n.container(),c=n.offset();return _n(i)&&cJP(i)?!1:Ms(n,i)||b3(n,i)||v3(n,i)||sB(n,i)||uW(n,i),t5=(n,i)=>Ox(n,i)||yx(n,dW(i)),iB=(n,i)=>Gs(n.charAt(i)),n5=(n,i)=>Ah(n.charAt(i)),hW=n=>{const i=n.container();return _n(i)&&tr(i.data,Gr)},mW=n=>{const i=n.split("");return gt(i,(c,m)=>Gs(c)&&m>0&&m{const m=i.data,p=zt(i,0);return!c&&iB(m,0)&&!t5(n,p)?(i.data=" "+m.slice(1),!0):c&&n5(m,0)&&Ox(n,p)?(i.data=Gr+m.slice(1),!0):!1},gW=n=>{const i=n.data,c=mW(i);return c!==i?(n.data=c,!0):!1},o5=(n,i,c)=>{const m=i.data,p=zt(i,m.length-1);return!c&&iB(m,m.length-1)&&!t5(n,p)?(i.data=m.slice(0,-1)+" ",!0):c&&n5(m,m.length-1)&&yx(n,p)?(i.data=m.slice(0,-1)+Gr,!0):!1},pW=(n,i)=>{const c=i.container();if(!_n(c))return he.none();if(hW(i)){const m=DO(n,c,!1)||gW(c)||o5(n,c,!1);return ks(m,i)}else if(t5(n,i)){const m=DO(n,c,!0)||o5(n,c,!0);return ks(m,i)}else return he.none()},bW=n=>{const i=Ke.fromDom(n.getBody());n.selection.isCollapsed()&&pW(i,zt.fromRangeStart(n.selection.getRng())).each(c=>{n.selection.setRng(c.toRange())})},s5=(n,i,c)=>{if(c===0)return;const m=Ke.fromDom(n),p=di(m,hc).getOr(m),w=n.data.slice(i,i+c),x=i+c>=n.data.length&&yx(p,zt(n,n.data.length)),M=i===0&&Ox(p,zt(n,0));n.replaceData(i,c,hh(w,4,M,x))},wx=(n,i)=>{const c=n.data.slice(i),m=c.length-nu(c).length;s5(n,i,m)},w3=(n,i)=>{const c=n.data.slice(0,i),m=c.length-ku(c).length;s5(n,i-m,m)},_3=(n,i,c,m=!0)=>{const p=ku(n.data).length,w=m?n:i,x=m?i:n;return m?w.appendData(x.data):w.insertData(0,x.data),wr(Ke.fromDom(x)),c&&wx(w,p),w},hd=(n,i)=>{const c=n.container(),m=n.offset();return!zt.isTextPosition(n)&&c===i.parentNode&&m>zt.before(i).offset()},vW=(n,i)=>hd(i,n)?zt(i.container(),i.offset()-1):i,OW=n=>_n(n)?zt(n,0):zt.before(n),yW=n=>_n(n)?zt(n,n.data.length):zt.after(n),aB=n=>Tl(n.previousSibling)?he.some(yW(n.previousSibling)):n.previousSibling?Vd(n.previousSibling):he.none(),lB=n=>Tl(n.nextSibling)?he.some(OW(n.nextSibling)):n.nextSibling?cl(n.nextSibling):he.none(),X2=(n,i)=>he.from(i.previousSibling?i.previousSibling:i.parentNode).bind(c=>Zu(n,zt.before(c))).orThunk(()=>Zf(n,zt.after(i))),wW=(n,i)=>Zf(n,zt.after(i)).orThunk(()=>Zu(n,zt.before(i))),_W=(n,i)=>aB(i).orThunk(()=>lB(i)).orThunk(()=>X2(n,i)),Ba=(n,i)=>lB(i).orThunk(()=>aB(i)).orThunk(()=>wW(n,i)),S3=(n,i,c)=>n?Ba(i,c):_W(i,c),Oie=(n,i,c)=>S3(n,i,c).map(Be(vW,c)),Jc=(n,i,c)=>{c.fold(()=>{n.focus()},m=>{n.selection.setRng(m.toRange(),i)})},ni=n=>i=>i.dom===n,Cm=(n,i)=>i&&un(n.schema.getBlockElements(),ei(i)),SW=n=>{if($a(n)){const i=Ke.fromHtml('
');return Ad(n),na(n,i),he.some(zt.before(i.dom))}else return he.none()},cB=(n,i,c)=>{const m=Sa(n).filter(sl),p=Td(n).filter(sl);return wr(n),Tf(m,p,i,(w,x,M)=>{const B=w.dom,G=x.dom,ae=B.data.length;return _3(B,G,c),M.container()===G?zt(B,ae):M}).orThunk(()=>(c&&(m.each(w=>w3(w.dom,w.dom.length)),p.each(w=>wx(w.dom,0))),i))},r5=(n,i)=>un(n.schema.getTextInlineElements(),ei(i)),K0=(n,i,c,m=!0)=>{const p=Oie(i,n.getBody(),c.dom),w=di(c,Be(Cm,n),ni(n.getBody())),x=cB(c,p,r5(n,c));n.dom.isEmpty(n.getBody())?(n.setContent(""),n.selection.setCursorLocation()):w.bind(SW).fold(()=>{m&&Jc(n,i,x)},M=>{m&&Jc(n,i,he.some(M))})},uB=/[\u0591-\u07FF\uFB1D-\uFDFF\uFE70-\uFEFC]/,fB=n=>uB.test(n),j2=(n,i)=>Du(Ke.fromDom(i),Xi(n))&&!ig(n.schema,i)&&n.dom.isEditable(i),dB=n=>{var i;return Qr.DOM.getStyle(n,"direction",!0)==="rtl"||fB((i=n.textContent)!==null&&i!==void 0?i:"")},i5=(n,i,c)=>Dt(Qr.DOM.getParents(c.container(),"*",i),n),J0=(n,i,c)=>{const m=i5(n,i,c);return he.from(m[m.length-1])},_p=(n,i,c)=>{const m=pm(i,n),p=pm(c,n);return pe(m)&&m===p},CW=n=>sf(n)||$f(n),Sg=(n,i)=>{const c=i.container(),m=i.offset();return n?or(c)?_n(c.nextSibling)?zt(c.nextSibling,0):zt.after(c):sf(i)?zt(c,m+1):i:or(c)?_n(c.previousSibling)?zt(c.previousSibling,c.previousSibling.data.length):zt.before(c):$f(i)?zt(c,m-1):i},kW=Be(Sg,!0),C3=Be(Sg,!1),hB=(n,i)=>{const c=m=>m.stopImmediatePropagation();n.on("beforeinput input",c,!0),n.getDoc().execCommand(i),n.off("beforeinput input",c)},_x=n=>{n.execCommand("delete")},a5=n=>hB(n,"Delete"),OS=n=>hB(n,"ForwardDelete"),Cg=n=>i=>qr(fi(i),n,bt),Sx=n=>mc(n)||ja(n),xi=(n,i)=>cn(n,i)?Zl(i,Sx,Cg(n)):he.none(),q2=(n,i=!0)=>{n.dom.isEmpty(n.getBody())&&n.setContent("",{no_selection:!i})},l5=(n,i,c)=>ri(cl(c),Vd(c),(m,p)=>{const w=Sg(!0,m),x=Sg(!1,p),M=Sg(!1,i);return n?Zf(c,M).exists(B=>B.isEqual(x)&&i.isEqual(w)):Zu(c,M).exists(B=>B.isEqual(w)&&i.isEqual(x))}).getOr(!0),c5=n=>(Kb(n)?Sa(n):Pu(n)).bind(c5).orThunk(()=>he.some(n)),k3=(n,i,c,m=!0)=>{var p;i.deleteContents();const w=c5(c).getOr(c),x=Ke.fromDom((p=n.dom.getParent(w.dom,n.dom.isBlock))!==null&&p!==void 0?p:c.dom);if(x.dom===n.getBody()?q2(n,m):$a(x)&&(Ae(x),m&&n.selection.setCursorLocation(x.dom,0)),!bt(c,x)){const M=qr(fi(x),c)?[]:Jb(x);$e(M.concat(Da(c)),B=>{!bt(B,x)&&!cn(B,x)&&$a(B)&&wr(B)})}},u5=n=>i=>bt(n,i),Cx=n=>pl(n,"td,th"),f5=(n,i)=>{const c=G=>bp(Ke.fromDom(G),i),m=c(n.startContainer),p=c(n.endContainer),w=m.isSome(),x=p.isSome(),M=ri(m,p,bt).getOr(!1);return{startTable:m,endTable:p,isStartInTable:w,isEndInTable:x,isSameTable:M,isMultiTable:!M&&w&&x}},yS=(n,i)=>({start:n,end:i}),d5=(n,i,c)=>({rng:n,table:i,cells:c}),wS=pg.generate([{singleCellTable:["rng","cell"]},{fullTable:["table"]},{partialTable:["cells","outsideDetails"]},{multiTable:["startTableCells","endTableCells","betweenRng"]}]),kx=(n,i)=>it(Ke.fromDom(n),"td,th",i),h5=n=>!bt(n.start,n.end),m5=(n,i)=>bp(n.start,i).bind(c=>bp(n.end,i).bind(m=>ks(bt(c,m),c))),mB=(n,i)=>!h5(n)&&m5(n,i).exists(c=>{const m=c.dom.rows;return m.length===1&&m[0].cells.length===1}),_S=(n,i)=>{const c=kx(n.startContainer,i),m=kx(n.endContainer,i);return ri(c,m,yS)},gB=n=>i=>bp(i,n).bind(c=>Po(Cx(c)).map(m=>yS(i,m))),g5=n=>i=>bp(i,n).bind(c=>Ro(Cx(c)).map(m=>yS(m,i))),p5=n=>i=>m5(i,n).map(c=>d5(i,c,Cx(c))),pB=(n,i,c,m)=>{if(c.collapsed||!n.forall(h5))return he.none();if(i.isSameTable){const p=n.bind(p5(m));return he.some({start:p,end:p})}else{const p=kx(c.startContainer,m),w=kx(c.endContainer,m),x=p.bind(gB(m)).bind(p5(m)),M=w.bind(g5(m)).bind(p5(m));return he.some({start:x,end:M})}},b5=(n,i)=>Ss(n,c=>bt(c,i)),x3=n=>ri(b5(n.cells,n.rng.start),b5(n.cells,n.rng.end),(i,c)=>n.cells.slice(i,c+1)),bB=(n,i,c)=>n.exists(m=>mB(m,c)&&wO(m.start,i)),xx=(n,i)=>{const{startTable:c,endTable:m}=i,p=n.cloneRange();return c.each(w=>p.setStartAfter(w.dom)),m.each(w=>p.setEndBefore(w.dom)),p},vB=(n,i,c,m)=>pB(n,i,c,m).bind(({start:p,end:w})=>p.or(w)).bind(p=>{const{isSameTable:w}=i,x=x3(p).getOr([]);if(w&&p.cells.length===x.length)return he.some(wS.fullTable(p.table));if(x.length>0){if(w)return he.some(wS.partialTable(x,he.none()));{const M=xx(c,i);return he.some(wS.partialTable(x,he.some({...i,rng:M})))}}else return he.none()}),OB=(n,i,c,m)=>pB(n,i,c,m).bind(({start:p,end:w})=>{const x=p.bind(x3).getOr([]),M=w.bind(x3).getOr([]);if(x.length>0&&M.length>0){const B=xx(c,i);return he.some(wS.multiTable(x,M,B))}else return he.none()}),yB=(n,i)=>{const c=u5(n),m=_S(i,c),p=f5(i,c);return bB(m,i,c)?m.map(w=>wS.singleCellTable(i,w.start)):p.isMultiTable?OB(m,p,i,c):vB(m,p,i,c)},v5=n=>$e(n,i=>{Vi(i,"contenteditable"),Ae(i)}),wB=(n,i)=>he.from(n.dom.getParent(i,n.dom.isBlock)).map(Ke.fromDom),_B=(n,i,c)=>{c.each(m=>{i?wr(m):(Ae(m),n.selection.setCursorLocation(m.dom,0))})},T3=(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)),Tx(n,p,i,!1).each(w=>w())},O5=n=>{const i=xb(n),c=Ke.fromDom(n.selection.getNode());Rd(c.dom)&&$a(c)?n.selection.setCursorLocation(c.dom,0):n.selection.collapse(!0),i.length>1&&jt(i,m=>bt(m,c))&&Pr(c,"data-mce-selected","1")},y5=(n,i,c)=>he.some(()=>{const m=n.selection.getRng(),p=c.bind(({rng:w,isStartInTable:x})=>{const M=wB(n,x?w.endContainer:w.startContainer);w.deleteContents(),_B(n,x,M.filter($a));const B=x?i[0]:i[i.length-1];return T3(n,B,m,x),$a(B)?he.none():he.some(x?i.slice(1):i.slice(0,-1))}).getOr(i);v5(p),O5(n)}),SB=(n,i,c,m)=>he.some(()=>{const p=n.selection.getRng(),w=i[0],x=c[c.length-1];T3(n,w,p,!0),T3(n,x,p,!1);const M=$a(w)?i:i.slice(1),B=$a(x)?c:c.slice(0,-1);v5(M.concat(B)),m.deleteContents(),O5(n)}),Tx=(n,i,c,m=!0)=>he.some(()=>{k3(n,i,c,m)}),CB=(n,i)=>he.some(()=>K0(n,!1,i)),kB=(n,i,c)=>yB(i,c).bind(m=>m.fold(Be(Tx,n),Be(CB,n),Be(y5,n),Be(SB,n))),xB=(n,i)=>Ex(n,i),TB=(n,i,c,m)=>SS(i,m).fold(()=>kB(n,i,c),p=>xB(n,p)),EB=(n,i,c)=>{const m=Ke.fromDom(n.getBody()),p=n.selection.getRng();return c.length!==0?y5(n,c,he.none()):TB(n,m,p,i)},E3=(n,i)=>oo(G0(i,n),qm),SS=(n,i)=>oo(G0(i,n),Ec("caption")),AB=(n,i,c,m,p)=>Sb(c,n.getBody(),p).bind(w=>E3(i,Ke.fromDom(w.getNode())).bind(x=>bt(x,m)?he.none():he.some(yt))),Ex=(n,i)=>he.some(()=>{Ae(i),n.selection.setCursorLocation(i.dom,0)}),A3=(n,i,c,m)=>cl(n.dom).bind(p=>Vd(n.dom).map(w=>i?c.isEqual(p)&&m.isEqual(w):c.isEqual(w)&&m.isEqual(p))).getOr(!0),w5=(n,i)=>Ex(n,i),Ax=(n,i,c)=>SS(n,Ke.fromDom(c.getNode())).fold(()=>he.some(yt),m=>ks(!bt(m,i),yt)),_5=(n,i,c,m,p)=>Sb(c,n.getBody(),p).fold(()=>he.some(yt),w=>A3(m,c,p,w)?w5(n,m):Ax(i,m,w)),DB=(n,i,c,m)=>{const p=zt.fromRangeStart(n.selection.getRng());return E3(c,m).bind(w=>$a(w)?Ex(n,w):AB(n,c,i,w,p))},CS=(n,i,c,m)=>{const p=zt.fromRangeStart(n.selection.getRng());return $a(m)?Ex(n,m):_5(n,c,i,m,p)},D3=(n,i)=>n?jI(i):qI(i),S5=(n,i)=>{const c=zt.fromRangeStart(n.selection.getRng());return D3(i,c)||zd(i,n.getBody(),c).exists(m=>D3(i,m))},Dx=(n,i,c)=>{const m=Ke.fromDom(n.getBody());return SS(m,c).fold(()=>DB(n,i,m,c).orThunk(()=>ks(S5(n,i),yt)),p=>CS(n,i,m,p))},Eb=(n,i)=>{const c=Ke.fromDom(n.selection.getStart(!0)),m=xb(n);return n.selection.isCollapsed()&&m.length===0?Dx(n,i,c):EB(n,c,m)},PO=(n,i)=>{let c=i;for(;c&&c!==n;){if(ba(c)||Es(c))return c;c=c.parentNode}return null},xW=["data-ephox-","data-mce-","data-alloy-","data-snooker-","_"],PB=hn.each,P3=n=>{const i=n.dom,c=new Set(n.serializer.getTempAttrs()),m=(w,x)=>{if(w.nodeName!==x.nodeName||w.nodeType!==x.nodeType)return!1;const M=G=>{const ae={};return PB(i.getAttribs(G),fe=>{const ve=fe.nodeName.toLowerCase();ve!=="style"&&!p(ve)&&(ae[ve]=i.getAttrib(G,ve))}),ae},B=(G,ae)=>{for(const fe in G)if(un(G,fe)){const ve=ae[fe];if(Se(ve)||G[fe]!==ve)return!1;delete ae[fe]}for(const fe in ae)if(un(ae,fe))return!1;return!0};return Jn(w)&&Jn(x)&&(!B(M(w),M(x))||!B(i.parseStyle(i.getAttrib(w,"style")),i.parseStyle(i.getAttrib(x,"style"))))?!1:!Wd(w)&&!Wd(x)},p=w=>jt(xW,x=>Ar(w,x))||c.has(w);return{compare:m,isAttributeInternal:p}},TW=(n,i)=>{let c=n;for(;c=c.walk();)i(c)},EW=(n,i,c,m)=>{const p=c.name;for(let w=0,x=n.length;w{const m={nodes:{},attributes:{}};return c.firstChild&&TW(c,p=>{EW(n,i,p,m)}),m},M3=(n,i)=>{const c=(m,p)=>{ln(m,w=>{const x=Rr(w.nodes);$e(w.filter.callbacks,M=>{for(let B=x.length-1;B>=0;B--){const G=x[B];(!(p?G.attr(w.filter.name)!==void 0:G.name===w.filter.name)||Ne(G.parent))&&x.splice(B,1)}x.length>0&&M(x,w.filter.name,i)})})};c(n.nodes,!1),c(n.attributes,!0)},Sp=(n,i,c,m={})=>{const p=AW(n,i,c);M3(p,m)},Px=(n,i,c,m)=>{if((n.pad_empty_with_br||i.insert)&&c(m)){const w=new Xd("br",1);i.insert&&w.attr("data-mce-bogus","1"),m.empty().append(w)}else m.empty().append(new Xd("#text",3)).value=Gr},R3=n=>{var i;return $3(n,"#text")&&((i=n==null?void 0:n.firstChild)===null||i===void 0?void 0:i.value)===Gr},$3=(n,i)=>{const c=n==null?void 0:n.firstChild;return pe(c)&&c===n.lastChild&&c.name===i},DW=(n,i)=>{const c=n.getElementRule(i.name);return(c==null?void 0:c.paddEmpty)===!0},kS=(n,i,c,m)=>m.isEmpty(i,c,p=>DW(n,p)),PW=(n,i)=>pe(n)&&(i(n)||n.name==="br"),MB=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)},Mx=(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)&&Mx(p,i,c);n.unwrap()}},C5=(n,i,c,m=yt)=>{const p=i.getTextBlockElements(),w=i.getNonEmptyElements(),x=i.getWhitespaceElements(),M=hn.makeMap("tr,td,th,tbody,thead,tfoot,table,summary"),B=new Set,G=ae=>ae!==c&&!M[ae.name];for(let ae=0;ae1)if(i.isValidChild(ve.name,fe.name)){Pe.reverse(),Le=Pe[0].clone(),m(Le);let Ve=Le;for(let mt=0;mt0?(Ye=Pe[mt].clone(),m(Ye),Ve.append(Ye)):Ye=Ve;for(let vt=Pe[mt].firstChild;vt&&vt!==Pe[mt+1];){const St=vt.next;Ye.append(vt),vt=St}Ve=Ye}kS(i,w,x,Le)?ve.insert(fe,Pe[0],!0):(ve.insert(Le,Pe[0],!0),ve.insert(fe,Le)),ve=Pe[0],(kS(i,w,x,ve)||$3(ve,"br"))&&ve.empty().remove()}else Mx(fe,i);else if(fe.parent){if(fe.name==="li"){let Ve=fe.prev;if(Ve&&(Ve.name==="ul"||Ve.name==="ol")){Ve.append(fe);continue}if(Ve=fe.next,Ve&&(Ve.name==="ul"||Ve.name==="ol")&&Ve.firstChild){Ve.insert(fe,Ve.firstChild,!0);continue}const mt=new Xd("ul",1);m(mt),fe.wrap(mt);continue}if(i.isValidChild(fe.parent.name,"div")&&i.isValidChild("div",fe.name)){const Ve=new Xd("div",1);m(Ve),fe.wrap(Ve)}else Mx(fe,i)}}},RB=(n,i)=>{let c=n;for(;c;){if(c.name===i)return!0;c=c.parent}return!1},$B=(n,i,c=i.parent)=>c&&n.children[i.name]&&!n.isValidChild(c.name,i.name)?!0:!!(c&&i.name==="a"&&RB(c,"a")),Rx=(n,i,c,m)=>{const p=document.createRange();return p.setStart(n,i),p.setEnd(c,m),p},NB=n=>{const i=zt.fromRangeStart(n),c=zt.fromRangeEnd(n),m=n.commonAncestorContainer;return zd(!1,m,c).map(p=>!Hd(i,c,m)&&Hd(i,p,m)?Rx(i.container(),i.offset(),p.container(),p.offset()):n).getOr(n)},k5=n=>n.collapsed?n:NB(n),IB=n=>pe(n.firstChild)&&n.firstChild===n.lastChild,MW=n=>n.name==="br"||n.value===Gr,RW=(n,i)=>n.getBlockElements()[i.name]&&IB(i)&&MW(i.firstChild),$W=(n,i)=>{const c=n.getNonEmptyElements();return pe(i)&&(i.isEmpty(c)||RW(n,i))},NW=(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),$W(n,m)&&(m=m==null?void 0:m.prev),!c||c!==m?!1:c.name==="ul"||c.name==="ol"},IW=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},BB=(n,i,c)=>{const m=i.serialize(c),p=n.createFragment(m);return IW(p)},BW=n=>{var i;return Dt((i=n==null?void 0:n.childNodes)!==null&&i!==void 0?i:[],c=>c.nodeName==="LI")},x5=n=>n.data===Gr||mi(n),G2=n=>pe(n==null?void 0:n.firstChild)&&n.firstChild===n.lastChild&&x5(n.firstChild),LW=n=>!n.firstChild||G2(n),FW=n=>n.length>0&&LW(n[n.length-1])?n.slice(0,-1):n,xS=(n,i)=>{const c=n.getParent(i,n.isBlock);return c&&c.nodeName==="LI"?c:null},LB=(n,i)=>!!xS(n,i),FB=(n,i)=>{const c=i.cloneRange(),m=i.cloneRange();return c.setStartBefore(n),m.setEndAfter(n),[c.cloneContents(),m.cloneContents()]},QW=(n,i)=>{const c=zt.before(n),p=Ea(i).next(c);return p?p.toRange():null},T5=(n,i)=>{const c=zt.after(n),p=Ea(i).prev(c);return p?p.toRange():null},ZW=(n,i,c,m)=>{const p=FB(n,m),w=n.parentNode;return w&&(w.insertBefore(p[0],n),hn.each(i,x=>{w.insertBefore(x,n)}),w.insertBefore(p[1],n),w.removeChild(n)),T5(i[i.length-1],c)},K2=(n,i,c)=>{const m=n.parentNode;return m&&hn.each(i,p=>{m.insertBefore(p,n)}),QW(n,c)},QB=(n,i,c,m)=>(m.insertAfter(i.reverse(),n),T5(i[0],c)),ZB=(n,i,c,m)=>{const p=BB(i,n,m),w=xS(i,c.startContainer),x=FW(BW(p.firstChild)),M=1,B=2,G=i.getRoot(),ae=fe=>{const ve=zt.fromRangeStart(c),Le=Ea(i.getRoot()),Ye=fe===M?Le.prev(ve):Le.next(ve),Pe=Ye==null?void 0:Ye.getNode();return Pe?xS(i,Pe)!==w:!0};return w?ae(M)?K2(w,x,G):ae(B)?QB(w,x,G,i):ZW(w,x,G,c):null},HB=["pre"],N3=(n,i,c,m)=>{var p;const w=i.firstChild,x=i.lastChild,M=x.attr("data-mce-type")==="bookmark"?x.prev:x,B=w===M,G=xt(HB,w.name);if(B&&G){const ae=w.attr("contenteditable")!=="false",fe=((p=n.getParent(c,n.isBlock))===null||p===void 0?void 0:p.nodeName.toLowerCase())===w.name,ve=he.from(PO(m,c)).forall(ba);return ae&&fe&&ve}else return!1},I3=Rd,HW=(n,i,c)=>{if(pe(c)){const m=n.getParent(i.endContainer,I3);return c===m&&wO(Ke.fromDom(c),i)}else return!1},zB=(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,w=c.lastChild;!p||p===w&&p.nodeName==="BR"?n.dom.setHTML(c,i):n.selection.setContent(i,{no_events:!0})}},zW=(n,i)=>{he.from(n.getParent(i,"td,th")).map(Ke.fromDom).each(lt)},VW=(n,i)=>{const c=n.schema.getTextInlineElements(),m=n.dom;if(i){const p=n.getBody(),w=P3(n);hn.each(m.select("*[data-mce-fragment]"),x=>{if(pe(c[x.nodeName.toLowerCase()])&&VI(m,x)){for(let B=x.parentElement;pe(B)&&B!==p&&!bie(m,x,B);B=B.parentElement)if(w.compare(B,x)){m.remove(x,!0);break}}})}},B3=n=>{let i=n;for(;i=i.walk();)i.type===1&&i.attr("data-mce-fragment","1")},VB=n=>{hn.each(n.getElementsByTagName("*"),i=>{i.removeAttribute("data-mce-fragment")})},E5=n=>!!n.getAttribute("data-mce-fragment"),WW=(n,i)=>pe(i)&&!n.schema.getVoidElements()[i.nodeName],UW=(n,i)=>{var c,m,p;let w;const x=n.dom,M=n.selection;if(!i)return;M.scrollIntoView(i);const B=PO(n.getBody(),i);if(B&&x.getContentEditable(B)==="false"){x.remove(i),M.select(B);return}let G=x.createRng();const ae=i.previousSibling;if(_n(ae)){G.setStart(ae,(m=(c=ae.nodeValue)===null||c===void 0?void 0:c.length)!==null&&m!==void 0?m:0);const Le=i.nextSibling;_n(Le)&&(ae.appendData(Le.data),(p=Le.parentNode)===null||p===void 0||p.removeChild(Le))}else G.setStartBefore(i),G.setEndBefore(i);const fe=Le=>{let Ye=zt.fromRangeStart(Le);return Ye=Ea(n.getBody()).next(Ye),Ye==null?void 0:Ye.toRange()},ve=x.getParent(i,x.isBlock);if(x.remove(i),ve&&x.isEmpty(ve)){const Le=I3(ve);Ad(Ke.fromDom(ve)),G.setStart(ve,0),G.setEnd(ve,0),!Le&&!E5(ve)&&(w=fe(G))?(G=w,x.remove(ve)):x.add(ve,x.create("br",Le?{}:{"data-mce-bogus":"1"}))}M.setRng(G)},WB=n=>{const i=n.dom,c=k5(n.selection.getRng());n.selection.setRng(c);const m=i.getParent(c.startContainer,I3);HW(i,c,m)?Tx(n,c,Ke.fromDom(m)):c.startContainer===c.endContainer&&c.endOffset-c.startOffset===1&&_n(c.startContainer.childNodes[c.startOffset])?c.deleteContents():n.getDoc().execCommand("Delete",!1)},A5=n=>{for(let i=n;i;i=i.walk())if(i.attr("id")==="mce_marker")return he.some(i);return he.none()},UB=(n,i,c)=>{var m,p;const w=n.selection,x=n.dom,M=n.parser,B=c.merge,G=Y2({validate:!0},n.schema),ae='';i.indexOf("{$caret}")===-1&&(i+="{$caret}"),i=i.replace(/\{\$caret\}/,ae);let fe=w.getRng();const ve=fe.startContainer,Le=n.getBody();ve===Le&&w.isCollapsed()&&x.isBlock(Le.firstChild)&&WW(n,Le.firstChild)&&x.isEmpty(Le.firstChild)&&(fe=x.createRng(),fe.setStart(Le.firstChild,0),fe.setEnd(Le.firstChild,0),w.setRng(fe)),w.isCollapsed()||WB(n);const Ye=w.getNode(),Pe={context:Ye.nodeName.toLowerCase(),data:c.data,insert:!0},Ve=M.parse(i,Pe);if(c.paste===!0&&NW(n.schema,Ve)&&LB(x,Ye))return fe=ZB(G,x,w.getRng(),Ve),fe&&w.setRng(fe),i;c.paste===!0&&N3(x,Ve,Ye,n.getBody())&&((m=Ve.firstChild)===null||m===void 0||m.unwrap()),B3(Ve);let mt=Ve.lastChild;if(mt&&mt.attr("id")==="mce_marker"){const vt=mt;for(mt=mt.prev;mt;mt=mt.walk(!0))if(mt.type===3||!x.isBlock(mt.name)){mt.parent&&n.schema.isValidChild(mt.parent.name,"span")&&mt.parent.insert(vt,mt,mt.name==="br");break}}if(n._selectionOverrides.showBlockCaretContainer(Ye),!Pe.invalid)i=G.serialize(Ve),zB(n,i,Ye);else{n.selection.setContent(ae);let vt=w.getNode(),St;const Mt=n.getBody();for(nf(vt)?vt=St=Mt:St=vt;St&&St!==Mt;)vt=St,St=St.parentNode;i=vt===Mt?Mt.innerHTML:x.getOuterHTML(vt);const dn=M.parse(i),Zn=A5(dn),$n=Zn.bind(MB).getOr(dn);Zn.each(bo=>bo.replace(Ve));const Lt=Ve.children(),Zt=(p=Ve.parent)!==null&&p!==void 0?p:dn;Ve.unwrap();const yn=Dt(Lt,bo=>$B(n.schema,bo,Zt));C5(yn,n.schema,$n),Sp(M.getNodeFilters(),M.getAttributeFilters(),dn),i=G.serialize(dn),vt===Mt?x.setHTML(Mt,i):x.setOuterHTML(vt,i)}return VW(n,B),UW(n,x.get("mce_marker")),VB(n.getBody()),zW(x,w.getStart()),$v(n.schema,n.getBody(),w.getStart()),i},L3=n=>n instanceof Xd,YW=n=>{U2(n)&&cl(n.getBody()).each(i=>{const c=i.getNode(),m=Nu(c)?cl(c).getOr(i):i;n.selection.setRng(m.toRange())})},D5=(n,i,c)=>{n.dom.setHTML(n.getBody(),i),c!==!0&&YW(n)},F3=(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 w=jc(n);return n.schema.isValidChild(i.nodeName.toLowerCase(),w.toLowerCase())?(c=p,c=n.dom.createHTML(w,db(n),c)):c||(c=p),D5(n,c,m.no_selection),{content:c,html:c}}else{m.format!=="raw"&&(c=Y2({validate:!1},n.schema).serialize(n.parser.parse(c,{isRootContent:!0,insert:!0})));const p=lu(Ke.fromDom(i))?c:hn.trim(c);return D5(n,p,m.no_selection),{content:p,html:p}}},ev=(n,i,c,m)=>{Sp(n.parser.getNodeFilters(),n.parser.getAttributeFilters(),c);const p=Y2({validate:!1},n.schema).serialize(c),w=lu(Ke.fromDom(i))?p:hn.trim(p);return D5(n,w,m.no_selection),{content:c,html:w}},XW=(n,i,c)=>he.from(n.getBody()).map(m=>L3(i)?ev(n,m,i,c):F3(n,m,i,c)).getOr({content:i,html:L3(c.content)?"":c.content}),P5=(n,i,c)=>di(n,i,c).isSome(),$l=(n,i)=>Vp(n,i).isSome(),Q3=n=>ce(n)?n:je,M5=(n,i,c)=>{let m=n.dom;const p=Q3(c);for(;m.parentNode;){m=m.parentNode;const w=Ke.fromDom(m),x=i(w);if(x.isSome())return x;if(p(w))break}return he.none()},m1=(n,i,c)=>{const m=i(n),p=Q3(c);return m.orThunk(()=>p(n)?he.none():M5(n,i,p))},Z3=J_,R5=(n,i,c)=>{const m=n.formatter.get(c);if(m)for(let p=0;p{const w=n.dom.getRoot();if(i===w)return!1;const x=n.dom.getParent(i,M=>R5(n,M,c)?!0:M.parentNode===w||!!Rh(n,M,c,m,!0));return!!Rh(n,x,c,m,p)},H3=(n,i,c)=>Ml(c)&&Z3(i,c.inline)||wm(c)&&Z3(i,c.block)?!0:fd(c)?Jn(i)&&n.is(i,c.selector):!1,YB=(n,i,c,m,p,w)=>{const x=c[m],M=m==="attributes";if(ce(c.onmatch))return c.onmatch(i,c,m);if(x){if(kr(x)){for(let B=0;B{const w=n.formatter.get(c),x=n.dom;if(w&&Jn(i))for(let M=0;M{if(m)return J2(n,m,i,c,p);if(m=n.selection.getNode(),J2(n,m,i,c,p))return!0;const w=n.selection.getStart();return!!(w!==m&&J2(n,w,i,c,p))},ew=(n,i,c)=>{const m=[],p={},w=n.selection.getStart();return n.dom.getParent(w,x=>{for(let M=0;M{const c=p=>bt(p,Ke.fromDom(n.getBody())),m=(p,w)=>Rh(n,p.dom,w)?he.some(w):he.none();return he.from(n.selection.getStart(!0)).bind(p=>m1(Ke.fromDom(p),w=>Ls(i,x=>m(w,x)),c)).getOrNull()},MO=(n,i)=>{const c=n.formatter.get(i),m=n.dom;if(c&&n.selection.isEditable()){const p=n.selection.getStart(),w=$2(m,p);for(let x=c.length-1;x>=0;x--){const M=c[x];if(!fd(M))return!0;for(let B=w.length-1;B>=0;B--)if(m.is(w[B],M.selector))return!0}}return!1},kg=(n,i,c)=>Hn(c,(m,p)=>{const w=Kk(n,p);return n.formatter.matchNode(i,p,{},w)?m.concat([p]):m},[]),tv=Ft,N5=(n,i)=>n.importNode(i,!0),qW=n=>{const i=[];let c=n;for(;c;){if(_n(c)&&c.data!==tv||c.childNodes.length>1)return[];Jn(c)&&i.push(c),c=c.firstChild}return i},XB=n=>qW(n).length>0,$x=n=>{if(n){const i=new wi(n,n);for(let c=i.current();c;c=i.next())if(_n(c))return c}return null},I5=n=>{const i=Ke.fromTag("span");return Ku(i,{id:j_,"data-mce-bogus":"1","data-mce-type":"format-caret"}),n&&na(i,Ke.fromText(tv)),i},Cp=n=>{const i=$x(n);return i&&i.data.charAt(0)===tv&&i.deleteData(0,1),i},TS=(n,i,c=!0)=>{const m=n.dom,p=n.selection;if(XB(i))K0(n,!1,Ke.fromDom(i),c);else{const w=p.getRng(),x=m.getParent(i,m.isBlock),M=w.startContainer,B=w.startOffset,G=w.endContainer,ae=w.endOffset,fe=Cp(i);m.remove(i,!0),M===fe&&B>0&&w.setStart(fe,B-1),G===fe&&ae>0&&w.setEnd(fe,ae-1),x&&m.isEmpty(x)&&Ae(Ke.fromDom(x)),p.setRng(w)}},z3=(n,i,c=!0)=>{const m=n.dom,p=n.selection;if(i)TS(n,i,c);else if(i=Cb(n.getBody(),p.getStart()),!i)for(;i=m.get(j_);)TS(n,i,c)},B5=(n,i,c)=>{var m,p;const w=n.dom,x=w.getParent(c,Be(Wl,n.schema));x&&w.isEmpty(x)?(m=c.parentNode)===null||m===void 0||m.replaceChild(i,c):(q(Ke.fromDom(c)),w.isEmpty(c)?(p=c.parentNode)===null||p===void 0||p.replaceChild(i,c):w.insertAfter(i,c))},V3=(n,i)=>(n.appendChild(i),i),RO=(n,i)=>{var c;const m=An(n,(w,x)=>V3(w,x.cloneNode(!1)),i),p=(c=m.ownerDocument)!==null&&c!==void 0?c:document;return V3(m,p.createTextNode(tv))},L5=(n,i,c,m,p,w)=>{const x=n.formatter,M=n.dom,B=Dt(bs(x.get()),fe=>fe!==m&&!tr(fe,"removeformat")),G=kg(n,c,B);if(Dt(G,fe=>!dP(n,fe,m)).length>0){const fe=c.cloneNode(!1);return M.add(i,fe),x.remove(m,p,fe,w),M.remove(fe),he.some(fe)}else return he.none()},GW=(n,i,c)=>{let m;const p=n.selection,w=n.formatter.get(i);if(!w)return;const x=p.getRng();let M=x.startOffset;const G=x.startContainer.nodeValue;m=Cb(n.getBody(),p.getStart());const ae=/[^\s\u00a0\u00ad\u200b\ufeff]/;if(G&&M>0&&M{const p=n.dom,w=n.selection;let x=!1;const M=n.formatter.get(i);if(!M)return;const B=w.getRng(),G=B.startContainer,ae=B.startOffset;let fe=G;_n(G)&&(ae!==G.data.length&&(x=!0),fe=fe.parentNode);const ve=[];let Le;for(;fe;){if(Rh(n,fe,i,c,m)){Le=fe;break}fe.nextSibling&&(x=!0),ve.push(fe),fe=fe.parentNode}if(!!Le)if(x){const Ye=w.getBookmark();B.collapse(!0);let Pe=z0(p,B,M,!0);Pe=wp(Pe),n.formatter.remove(i,c,Pe,m),w.moveToBookmark(Ye)}else{const Ye=Cb(n.getBody(),Le),Pe=I5(!1).dom;B5(n,Pe,Ye!=null?Ye:Le);const Ve=L5(n,Pe,Le,i,c,m),mt=RO(ve.concat(Ve.toArray()),Pe);Ye&&TS(n,Ye,!1),w.setCursorLocation(mt,1),p.isEmpty(Le)&&p.remove(Le)}},KW=(n,i,c)=>{const m=n.selection,p=n.getBody();z3(n,null,c),(i===8||i===46)&&m.isCollapsed()&&m.getStart().innerHTML===tv&&z3(n,Cb(p,m.getStart())),(i===37||i===39)&&z3(n,Cb(p,m.getStart()))},JW=n=>_n(n)&&Ki(n.data,Gr),eU=n=>{n.on("mouseup keydown",i=>{KW(n,i.keyCode,JW(n.selection.getRng().endContainer))})},qB=n=>{const i=I5(!1),c=RO(n,i.dom);return{caretContainer:i,caretPosition:zt(c,0)}},ES=(n,i)=>{const{caretContainer:c,caretPosition:m}=qB(i);return Ca(Ke.fromDom(n),c),wr(Ke.fromDom(n)),m},tU=(n,i)=>{const{caretContainer:c,caretPosition:m}=qB(i);return n.insertNode(c.dom),m},F5=(n,i)=>{const c=n.schema.getTextInlineElements();return un(c,ei(i))&&!qc(i.dom)&&!Pd(i.dom)},W3=n=>qc(n.dom)&&XB(n.dom),Nx={},Q5=Rf(["pre"]),GB=(n,i)=>{Nx[n]||(Nx[n]=[]),Nx[n].push(i)},nU=(n,i)=>{un(Nx,n)&&$e(Nx[n],c=>{c(i)})};GB("pre",n=>{const i=n.selection.getRng(),c=p=>w=>{const x=w.previousSibling;return Q5(x)&&xt(p,x)},m=(p,w)=>{const x=Ke.fromDom(w),M=Eo(x).dom;wr(x),ti(Ke.fromDom(p),[Ke.fromTag("br",M),Ke.fromTag("br",M),...Da(x)])};if(!i.collapsed){const p=n.selection.getSelectedBlocks(),w=Dt(Dt(p,Q5),c(p));$e(w,x=>{m(x.previousSibling,x)})}});const KB=["fontWeight","fontStyle","color","fontSize","fontFamily"],oU=n=>te(n.styles)&&jt(bs(n.styles),i=>xt(KB,i)),sU=n=>oo(n,i=>Ml(i)&&i.inline==="span"&&oU(i)),JB=(n,i)=>{const c=n.get(i);return oe(c)?sU(c):he.none()},e8=(n,i)=>Zu(i,zt.fromRangeStart(n)).isNone(),t8=(n,i)=>Zf(i,zt.fromRangeEnd(n)).exists(c=>!mi(c.getNode())||Zf(i,c).isSome())===!1,n8=n=>i=>Wa(i)&&n.isEditable(i),rU=n=>{const i=n.getSelectedBlocks(),c=n.getRng();if(n.isCollapsed())return[];if(i.length===1)return e8(c,i[0])&&t8(c,i[0])?i:[];{const m=Ro(i).filter(x=>e8(c,x)).toArray(),p=Po(i).filter(x=>t8(c,x)).toArray(),w=i.slice(1,-1);return m.concat(w).concat(p)}},iU=n=>Dt(rU(n),n8(n.dom)),o8=n=>Dt(n.getSelectedBlocks(),n8(n.dom)),Z5=hn.each,H5=n=>Jn(n)&&!Wd(n)&&!qc(n)&&!Pd(n),z5=(n,i)=>{for(let c=n;c;c=c[i]){if(_n(c)&&yr(c.data))return n;if(Jn(c)&&!Wd(c))return c}return n},s8=(n,i,c)=>{const m=P3(n),p=Jn(i)&&vm(i),w=Jn(c)&&vm(c);if(p&&w){const x=z5(i,"previousSibling"),M=z5(c,"nextSibling");if(m.compare(x,M)){for(let B=x.nextSibling;B&&B!==M;){const G=B;B=B.nextSibling,x.appendChild(G)}return n.dom.remove(M),hn.each(hn.grep(M.childNodes),B=>{x.appendChild(B)}),x}}return c},tw=(n,i,c,m)=>{var p;if(m&&i.merge_siblings!==!1){const w=(p=s8(n,Gn(m),m))!==null&&p!==void 0?p:m;s8(n,w,Gn(w,!0))}},aU=(n,i,c)=>{if(i.clear_child_styles){const m=i.links?"*:not(a)":"*";Z5(n.select(m,c),p=>{H5(p)&&vm(p)&&Z5(i.styles,(w,x)=>{n.setStyle(p,x,"")})})}},V5=(n,i,c)=>{Z5(n.childNodes,m=>{H5(m)&&(i(m)&&c(m),m.hasChildNodes()&&V5(m,i,c))})},lU=(n,i)=>{i.nodeName==="SPAN"&&n.getAttribs(i).length===0&&n.remove(i,!0)},r8=(n,i)=>c=>!!(c&&R2(n,c,i)),W5=(n,i,c)=>m=>{n.setStyle(m,i,c),m.getAttribute("style")===""&&m.removeAttribute("style"),lU(n,m)},nw=pg.generate([{keep:[]},{rename:["name"]},{removed:[]}]),cU=/^(src|href|style)$/,U5=hn.each,U3=J_,uU=n=>/^(TR|TH|TD)$/.test(n.nodeName),i8=(n,i,c)=>n.isChildOf(i,c)&&i!==c&&!n.isBlock(c),a8=(n,i,c)=>{let m=i[c?"startContainer":"endContainer"],p=i[c?"startOffset":"endOffset"];if(Jn(m)){const w=m.childNodes.length-1;!c&&p&&p--,m=m.childNodes[p>w?w:p]}return _n(m)&&c&&p>=m.data.length&&(m=new wi(m,n.getBody()).next()||m),_n(m)&&!c&&p===0&&(m=new wi(m,n.getBody()).prev()||m),m},l8=(n,i)=>{const c=i?"firstChild":"lastChild",m=n[c];return uU(n)&&m?n.nodeName==="TR"&&m[c]||m:n},Y5=(n,i,c,m)=>{var p;const w=n.create(c,m);return(p=i.parentNode)===null||p===void 0||p.insertBefore(w,i),w.appendChild(i),w},c8=(n,i,c,m,p)=>{const w=Ke.fromDom(i),x=Ke.fromDom(n.create(m,p)),M=c?il(w):Vg(w);return ti(x,M),c?(Ca(w,x),ih(x,w)):(iu(w,x),na(x,w)),x.dom},X5=(n,i)=>i.links&&n.nodeName==="A",j5=(n,i,c)=>{const m=i.parentNode;let p;const w=n.dom,x=jc(n);wm(c)&&m===w.getRoot()&&(!c.list_block||!U3(i,c.list_block))&&$e(Rr(i.childNodes),M=>{Om(n,x,M.nodeName.toLowerCase())?p?p.appendChild(M):(p=Y5(w,M,x),w.setAttribs(p,db(n))):p=null}),!(Jk(c)&&!U3(c.inline,i))&&w.remove(i,!0)},fU=(n,i,c)=>Xe(n)?{name:i,value:null}:{name:n,value:Dh(i,c)},AS=(n,i)=>{n.getAttrib(i,"style")===""&&(i.removeAttribute("style"),i.removeAttribute("data-mce-style"))},q5=(n,i,c,m,p)=>{let w=!1;U5(c.styles,(x,M)=>{const{name:B,value:G}=fU(M,x,m),ae=M2(G,B);(c.remove_similar||X(G)||!Jn(p)||U3(R2(n,p,B),ae))&&n.setStyle(i,B,""),w=!0}),w&&AS(n,i)},Ix=(n,i,c)=>{i==="removeformat"?$e(o8(n.selection),m=>{$e(KB,p=>n.dom.setStyle(m,p,"")),AS(n.dom,m)}):JB(n.formatter,i).each(m=>{$e(o8(n.selection),p=>q5(n.dom,p,m,c,null))})},DS=(n,i,c,m,p)=>{const w=n.dom,x=P3(n),M=n.schema;if(Ml(i)&&ep(M,i.inline)&&ig(M,m)&&m.parentElement===n.getBody())return j5(n,m,i),nw.removed();if(!i.ceFalseOverride&&m&&w.getContentEditableParent(m)==="false"||m&&!H3(w,m,i)&&!X5(m,i))return nw.keep();const B=m,G=i.preserve_attributes;if(Ml(i)&&i.remove==="all"&&oe(G)){const ae=Dt(w.getAttribs(B),fe=>xt(G,fe.name.toLowerCase()));if(w.removeAllAttribs(B),$e(ae,fe=>w.setAttrib(B,fe.name,fe.value)),ae.length>0)return nw.rename("span")}if(i.remove!=="all"){q5(w,B,i,c,p),U5(i.attributes,(fe,ve)=>{const{name:Le,value:Ye}=fU(ve,fe,c);if(i.remove_similar||X(Ye)||!Jn(p)||U3(w.getAttrib(p,Le),Ye)){if(Le==="class"){const Pe=w.getAttrib(B,Le);if(Pe){let Ve="";if($e(Pe.split(/\s+/),mt=>{/mce\-\w+/.test(mt)&&(Ve+=(Ve?" ":"")+mt)}),Ve){w.setAttrib(B,Le,Ve);return}}}if(cU.test(Le)&&B.removeAttribute("data-mce-"+Le),Le==="style"&&Rf(["li"])(B)&&w.getStyle(B,"list-style-type")==="none"){B.removeAttribute(Le),w.setStyle(B,"list-style-type","none");return}Le==="class"&&B.removeAttribute("className"),B.removeAttribute(Le)}}),U5(i.classes,fe=>{fe=Dh(fe,c),(!Jn(p)||w.hasClass(p,fe))&&w.removeClass(B,fe)});const ae=w.getAttribs(B);for(let fe=0;fe{let w;return i.parentNode&&$e($2(n.dom,i.parentNode).reverse(),x=>{if(!w&&Jn(x)&&x.id!=="_start"&&x.id!=="_end"){const M=Rh(n,x,c,m,p);M&&M.split!==!1&&(w=x)}}),w},yie=(n,i,c,m)=>DS(n,i,c,m,m).fold(He(m),p=>(n.dom.createFragment().appendChild(m),n.dom.rename(m,p)),He(null)),dU=(n,i,c,m,p,w,x,M)=>{var B,G;let ae,fe;const ve=n.dom;if(c){const Le=c.parentNode;for(let Ye=m.parentNode;Ye&&Ye!==Le;Ye=Ye.parentNode){let Pe=ve.clone(Ye,!1);for(let Ve=0;Ve{const w=n.formatter.get(i),x=w[0],M=n.dom,B=n.selection,G=Pe=>{const Ve=u8(n,Pe,i,c,p);return dU(n,w,Ve,Pe,Pe,!0,x,c)},ae=Pe=>Wd(Pe)&&Jn(Pe)&&(Pe.id==="_start"||Pe.id==="_end"),fe=Pe=>jt(w,Ve=>Bx(n,Ve,c,Pe,Pe)),ve=Pe=>{const Ve=Rr(Pe.childNodes),vt=fe(Pe)||jt(w,dn=>H3(M,Pe,dn)),St=Pe.parentNode;if(!vt&&pe(St)&&I2(x)&&fe(St),x.deep&&Ve.length)for(let dn=0;dn{Jn(Pe)&&n.dom.getStyle(Pe,"text-decoration")===dn&&Pe.parentNode&&Gk(M,Pe.parentNode)===dn&&Bx(n,{deep:!1,exact:!0,inline:"span",styles:{textDecoration:dn}},void 0,Pe)})},Le=Pe=>{const Ve=M.get(Pe?"_start":"_end");if(Ve){let mt=Ve[Pe?"firstChild":"lastChild"];return ae(mt)&&(mt=mt[Pe?"firstChild":"lastChild"]),_n(mt)&&mt.data.length===0&&(mt=Pe?Ve.previousSibling||Ve.nextSibling:Ve.nextSibling||Ve.previousSibling),M.remove(Ve,!0),mt}else return null},Ye=Pe=>{let Ve,mt,vt=z0(M,Pe,w,Pe.collapsed);if(x.split){if(vt=wp(vt),Ve=a8(n,vt,!0),mt=a8(n,vt),Ve!==mt){if(Ve=l8(Ve,!0),mt=l8(mt,!1),i8(M,Ve,mt)){const Mt=he.from(Ve.firstChild).getOr(Ve);G(c8(M,Mt,!0,"span",{id:"_start","data-mce-type":"bookmark"})),Le(!0);return}if(i8(M,mt,Ve)){const Mt=he.from(mt.lastChild).getOr(mt);G(c8(M,Mt,!1,"span",{id:"_end","data-mce-type":"bookmark"})),Le(!1);return}Ve=Y5(M,Ve,"span",{id:"_start","data-mce-type":"bookmark"}),mt=Y5(M,mt,"span",{id:"_end","data-mce-type":"bookmark"});const St=M.createRng();St.setStartAfter(Ve),St.setEndBefore(mt),c1(M,St,Mt=>{$e(Mt,dn=>{!Wd(dn)&&!Wd(dn.parentNode)&&G(dn)})}),G(Ve),G(mt),Ve=Le(!0),mt=Le()}else Ve=mt=G(Ve);vt.startContainer=Ve.parentNode?Ve.parentNode:Ve,vt.startOffset=M.nodeIndex(Ve),vt.endContainer=mt.parentNode?mt.parentNode:mt,vt.endOffset=M.nodeIndex(mt)+1}c1(M,vt,St=>{$e(St,ve)})};if(m){if(D2(m)){const Pe=M.createRng();Pe.setStartBefore(m),Pe.setEndAfter(m),Ye(Pe)}else Ye(m);Mh(n,i,m,c);return}!B.isCollapsed()||!Ml(x)||xb(n).length?(ZE(n,()=>jk(n,Ye),Pe=>Ml(x)&&$5(n,i,c,Pe)),n.nodeChanged()):jB(n,i,c,p),Ix(n,i,c),Mh(n,i,m,c)},f8=(n,i,c,m,p)=>{(m||n.selection.isEditable())&&wie(n,i,c,m,p)},Bx=(n,i,c,m,p)=>DS(n,i,c,m,p).fold(je,w=>(n.dom.rename(m,w),!0),ht),hU=hn.each,mU=(n,i,c,m)=>{const p=w=>{if(Jn(w)&&Jn(w.parentNode)&&vm(w)){const x=Gk(n,w.parentNode);n.getStyle(w,"color")&&x?n.setStyle(w,"text-decoration",x):n.getStyle(w,"text-decoration")===x&&n.setStyle(w,"text-decoration",null)}};i.styles&&(i.styles.color||i.styles.textDecoration)&&(hn.walk(m,p,"childNodes"),p(m))},d8=(n,i,c,m)=>{if(i.styles&&i.styles.backgroundColor){const p=r8(n,"fontSize");V5(m,w=>p(w)&&vm(w),W5(n,"backgroundColor",Dh(i.styles.backgroundColor,c)))}},gU=(n,i,c,m)=>{if(Ml(i)&&(i.inline==="sub"||i.inline==="sup")){const p=r8(n,"fontSize");V5(m,x=>p(x)&&vm(x),W5(n,"fontSize",""));const w=Dt(n.select(i.inline==="sup"?"sub":"sup",m),vm);n.remove(w,!0)}},h8=(n,i,c,m)=>{hU(i,p=>{Ml(p)&&hU(n.dom.select(p.inline,m),w=>{H5(w)&&Bx(n,p,c,w,p.exact?w:null)}),aU(n.dom,p,m)})},pU=(n,i,c,m,p)=>{const w=p.parentNode;Rh(n,w,c,m)&&Bx(n,i,m,p)||i.merge_with_parents&&w&&n.dom.getParent(w,x=>Rh(n,x,c,m)?(Bx(n,i,m,p),!0):!1)},ow=hn.each,m8=(n,i,c,m)=>{if(D_(n)&&Ml(i)&&c.parentNode){const p=sd(n.schema),w=$l(Ke.fromDom(c),x=>qc(x.dom));return ns(p,m)&&$a(Ke.fromDom(c.parentNode),!1)&&!w}else return!1},rc=(n,i,c,m)=>{if(ow(c.styles,(p,w)=>{n.setStyle(i,w,Dh(p,m))}),c.styles){const p=n.getAttrib(i,"style");p&&n.setAttrib(i,"data-mce-style",p)}},_ie=(n,i,c,m)=>{const p=n.formatter.get(i),w=p[0],x=!m&&n.selection.isCollapsed(),M=n.dom,B=n.selection,G=(Ye,Pe=w)=>{ce(Pe.onformat)&&Pe.onformat(Ye,Pe,c,m),rc(M,Ye,Pe,c),ow(Pe.attributes,(Ve,mt)=>{M.setAttrib(Ye,mt,Dh(Ve,c))}),ow(Pe.classes,Ve=>{const mt=Dh(Ve,c);M.hasClass(Ye,mt)||M.addClass(Ye,mt)})},ae=(Ye,Pe)=>{let Ve=!1;return ow(Ye,mt=>fd(mt)?M.getContentEditable(Pe)==="false"&&!mt.ceFalseOverride||pe(mt.collapsed)&&mt.collapsed!==x?!0:M.is(Pe,mt.selector)&&!qc(Pe)?(G(Pe,mt),Ve=!0,!1):!0:!1),Ve},fe=Ye=>{if(L(Ye)){const Pe=M.create(Ye);return G(Pe),Pe}else return null},ve=(Ye,Pe,Ve)=>{const mt=[];let vt=!0;const St=w.inline||w.block,Mt=fe(St),dn=Lt=>tS(w)&&Rh(n,Lt,i,c),Zn=(Lt,Zt,yn)=>{const bo=N2(w)&&Wl(n.schema,Lt)&&Om(n,Zt,St);return yn&&bo},$n=(Lt,Zt,yn,bo)=>{const Do=Lt.nodeName.toLowerCase(),Cs=Om(n,St,Do)&&Om(n,Zt,St),Ws=!Ve&&_n(Lt)&&Sn(Lt.data),Ir=qc(Lt),pi=!Ml(w)||!Ye.isBlock(Lt);return(yn||bo)&&Cs&&!Ws&&!Ir&&pi};c1(Ye,Pe,Lt=>{let Zt;const yn=bo=>{let Do=!1,Cs=vt,Ws=!1;const Ir=bo.parentNode,pi=Ir.nodeName.toLowerCase(),fl=Ye.getContentEditable(bo);pe(fl)&&(Cs=vt,vt=fl==="true",Do=!0,Ws=P2(n,bo));const Il=vt&&!Do;if(mi(bo)&&!m8(n,w,bo,pi)){Zt=null,wm(w)&&Ye.remove(bo);return}if(dn(bo)){Zt=null;return}if(Zn(bo,pi,Il)){const Oc=Ye.rename(bo,St);G(Oc),mt.push(Oc),Zt=null;return}if(fd(w)){let Oc=ae(p,bo);if(!Oc&&pe(Ir)&&I2(w)&&(Oc=ae(p,Ir)),!Ml(w)||Oc){Zt=null;return}}pe(Mt)&&$n(bo,pi,Il,Ws)?(Zt||(Zt=Ye.clone(Mt,!1),Ir.insertBefore(Zt,bo),mt.push(Zt)),Ws&&Do&&(vt=Cs),Zt.appendChild(bo)):(Zt=null,$e(Rr(bo.childNodes),yn),Do&&(vt=Cs),Zt=null)};$e(Lt,yn)}),w.links===!0&&$e(mt,Lt=>{const Zt=yn=>{yn.nodeName==="A"&&G(yn,w),$e(Rr(yn.childNodes),Zt)};Zt(Lt)}),$e(mt,Lt=>{const Zt=Do=>{let Cs=0;return $e(Do.childNodes,Ws=>{!ym(Ws)&&!Wd(Ws)&&Cs++}),Cs},yn=Do=>oo(Do.childNodes,qk).filter(Ws=>Ye.getContentEditable(Ws)!=="false"&&H3(Ye,Ws,w)).map(Ws=>{const Ir=Ye.clone(Ws,!1);return G(Ir),Ye.replace(Ir,Do,!0),Ye.remove(Ws,!0),Ir}).getOr(Do),bo=Zt(Lt);if((mt.length>1||!Ye.isBlock(Lt))&&bo===0){Ye.remove(Lt,!0);return}(Ml(w)||wm(w)&&w.wrapper)&&(!w.exact&&bo===1&&(Lt=yn(Lt)),h8(n,p,c,Lt),pU(n,w,i,c,Lt),d8(Ye,w,c,Lt),mU(Ye,w,c,Lt),gU(Ye,w,c,Lt),tw(n,w,c,Lt))})},Le=D2(m)?m:B.getNode();if(M.getContentEditable(Le)==="false"&&!P2(n,Le)){m=Le,ae(p,m),GE(n,i,m,c);return}if(w){if(m)if(D2(m)){if(!ae(p,m)){const Ye=M.createRng();Ye.setStartBefore(m),Ye.setEndAfter(m),ve(M,z0(M,Ye,p),!0)}}else ve(M,m,!0);else!x||!Ml(w)||xb(n).length?(B.setRng(k5(B.getRng())),ZE(n,()=>{jk(n,(Ye,Pe)=>{const Ve=Pe?Ye:z0(M,Ye,p);ve(M,Ve,!1)})},ht),n.nodeChanged()):GW(n,i,c),JB(n.formatter,i).each(Ye=>{$e(iU(n.selection),Pe=>rc(M,Pe,Ye,c))});nU(i,n)}GE(n,i,m,c)},bU=(n,i,c,m)=>{(m||n.selection.isEditable())&&_ie(n,i,c,m)},vU=n=>un(n,"vars"),Sie=(n,i)=>{n.set({}),i.on("NodeChange",c=>{ov(i,c.element,n.get())}),i.on("FormatApply FormatRemove",c=>{const m=he.from(c.node).map(p=>D2(p)?p:p.startContainer).bind(p=>Jn(p)?he.some(p):he.from(p.parentElement)).getOrThunk(()=>xg(i));ov(i,m,n.get())})},xg=n=>n.selection.getStart(),Lx=(n,i,c,m,p)=>ps(i,M=>{const B=n.formatter.matchNode(M,c,p!=null?p:{},m);return!Se(B)},M=>R5(n,M,c)?!0:m?!1:pe(n.formatter.matchNode(M,c,p,!0))),nv=(n,i)=>{const c=i!=null?i:xg(n);return Dt($2(n.dom,c),m=>Jn(m)&&!Pd(m))},ov=(n,i,c)=>{const m=nv(n,i);ln(c,(p,w)=>{const x=M=>{const B=Lx(n,m,w,M.similar,vU(M)?M.vars:void 0),G=B.isSome();if(M.state.get()!==G){M.state.set(G);const ae=B.getOr(i);vU(M)?M.callback(G,{node:ae,format:w,parents:m}):$e(M.callbacks,fe=>fe(G,{node:ae,format:w,parents:m}))}};$e([p.withSimilar,p.withoutSimilar],x),$e(p.withVars,x)})},OU=(n,i,c,m,p,w)=>{const x=i.get();$e(c.split(","),M=>{const B=wo(x,M).getOrThunk(()=>{const ae={withSimilar:{state:Ga(!1),similar:!0,callbacks:[]},withoutSimilar:{state:Ga(!1),similar:!1,callbacks:[]},withVars:[]};return x[M]=ae,ae}),G=()=>{const ae=nv(n);return Lx(n,ae,M,p,w).isSome()};if(Se(w)){const ae=p?B.withSimilar:B.withoutSimilar;ae.callbacks.push(m),ae.callbacks.length===1&&ae.state.set(G())}else B.withVars.push({state:Ga(G()),similar:p,vars:w,callback:m})}),i.set(x)},yU=(n,i,c)=>{const m=n.get();$e(i.split(","),p=>wo(m,p).each(w=>{m[p]={withSimilar:{...w.withSimilar,callbacks:Dt(w.withSimilar.callbacks,x=>x!==c)},withoutSimilar:{...w.withoutSimilar,callbacks:Dt(w.withoutSimilar.callbacks,x=>x!==c)},withVars:Dt(w.withVars,x=>x.callback!==c)}})),n.set(m)},PS=(n,i,c,m,p,w)=>(OU(n,i,c,m,p,w),{unbind:()=>yU(i,c,m)}),MS=(n,i,c,m)=>{const p=n.formatter.get(i);p&&($5(n,i,c,m)&&(!("toggle"in p[0])||p[0].toggle)?f8(n,i,c,m):bU(n,i,c,m))},sw=hn.explode,G5=()=>{const n={};return{addFilter:(p,w)=>{$e(sw(p),x=>{un(n,x)||(n[x]={name:x,callbacks:[]}),n[x].callbacks.push(w)})},getFilters:()=>uo(n),removeFilter:(p,w)=>{$e(sw(p),x=>{if(un(n,x))if(pe(w)){const M=n[x],B=Dt(M.callbacks,G=>G!==w);B.length>0?M.callbacks=B:delete n[x]}else delete n[x]})}}},K5=(n,i)=>{$e(i,c=>{n.attr(c,null)})},g8=(n,i,c)=>{n.addNodeFilter("font",m=>{$e(m,p=>{const w=i.parse(p.attr("style")),x=p.attr("color"),M=p.attr("face"),B=p.attr("size");x&&(w.color=x),M&&(w["font-family"]=M),B&&ou(B).each(G=>{w["font-size"]=c[G-1]}),p.name="span",p.attr("style",i.serialize(w)),K5(p,["color","face","size"])})})},p8=(n,i,c)=>{n.addNodeFilter("strike",m=>{const p=i.type!=="html4";$e(m,w=>{if(p)w.name="s";else{const x=c.parse(w.attr("style"));x["text-decoration"]="line-through",w.name="span",w.attr("style",c.serialize(x))}})})},wU=(n,i,c)=>{var m;const p=Qv();i.convert_fonts_to_spans&&g8(n,p,hn.explode((m=i.font_size_legacy_values)!==null&&m!==void 0?m:"")),p8(n,c,p)},_U=(n,i,c)=>{i.inline_styles&&wU(n,i,c)},J5=(n,i,c)=>{i.addNodeFilter("br",(m,p,w)=>{const x=hn.extend({},c.getBlockElements()),M=c.getNonEmptyElements(),B=c.getWhitespaceElements();x.body=1;const G=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"})),CU=n=>{const i=/([a-z0-9+\/=\s]+)/i.exec(n);return i?i[1]:""},eM=n=>{const[i,...c]=n.split(","),m=c.join(","),p=/data:([^/]+\/[^;]+)(;.+)?/.exec(i);if(p){const w=p[2]===";base64",x=w?CU(m):decodeURIComponent(m);return he.some({type:p[1],data:x,base64Encoded:w})}else return he.none()},b8=(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 w=0;wnew Promise((i,c)=>{eM(n).bind(({type:m,data:p,base64Encoded:w})=>b8(m,p,w)).fold(()=>c("Invalid data URI"),i)}),v8=n=>Ar(n,"blob:")?SU(n):Ar(n,"data:")?kU(n):Promise.reject("Unknown URI format"),O8=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 Fx=0;const y8=n=>(n||"blobid")+Fx++,w8=(n,i,c)=>eM(n).bind(({data:m,type:p,base64Encoded:w})=>{if(i&&!w)return he.none();{const x=w?m:btoa(m);return c(x,p)}}),tM=(n,i,c)=>{const m=n.create(y8(),i,c);return n.add(m),m},_8=(n,i,c=!1)=>w8(i,c,(m,p)=>he.from(n.getByData(m,p)).orThunk(()=>b8(p,m).map(w=>tM(n,w,m)))),S8=(n,i)=>{const c=()=>Promise.reject("Invalid data URI");if(Ar(i,"blob:")){const m=n.getByUri(i);return pe(m)?Promise.resolve(m):v8(i).then(p=>O8(p).then(w=>w8(w,!1,x=>he.some(tM(n,p,x))).getOrThunk(c)))}else return Ar(i,"data:")?_8(n,i).fold(c,m=>Promise.resolve(m)):Promise.reject("Unknown image data format")},xU=n=>pe(n.attr("data-mce-bogus")),TU=n=>n.attr("src")===qn.transparentSrc||pe(n.attr("data-mce-placeholder")),C8=(n,i)=>{const{blob_cache:c}=i;if(c){const m=p=>{const w=p.attr("src");TU(p)||xU(p)||Ne(w)||_8(c,w,!0).each(x=>{p.attr("src",x.blobUri())})};n.addAttributeFilter("src",p=>$e(p,m))}},k8=(n,i)=>{const c=n.schema;i.remove_trailing_brs&&J5(i,n,c),n.addAttributeFilter("href",p=>{let w=p.length;const x=B=>B.split(" ").filter(ae=>ae.length>0).concat(["noopener"]).sort().join(" "),M=B=>{const G=B?hn.trim(B):"";return/\b(noopener)\b/g.test(G)?G:x(G)};if(!i.allow_unsafe_link_target)for(;w--;){const B=p[w];B.name==="a"&&B.attr("target")==="_blank"&&B.attr("rel",M(B.attr("rel")))}}),i.allow_html_in_named_anchor||n.addAttributeFilter("id,name",p=>{let w=p.length,x,M,B,G;for(;w--;)if(G=p[w],G.name==="a"&&G.firstChild&&!G.attr("href"))for(B=G.parent,x=G.lastChild;x&&B;)M=x.prev,B.insert(x,G),x=M}),i.fix_list_elements&&n.addNodeFilter("ul,ol",p=>{let w=p.length,x,M;for(;w--;)if(x=p[w],M=x.parent,M&&(M.name==="ul"||M.name==="ol"))if(x.prev&&x.prev.name==="li")x.prev.append(x);else{const B=new Xd("li",1);B.attr("style","list-style-type: none"),x.wrap(B)}});const m=c.getValidClasses();i.validate&&m&&n.addAttributeFilter("class",p=>{var w;let x=p.length;for(;x--;){const M=p[x],B=(w=M.attr("class"))!==null&&w!==void 0?w:"",G=hn.explode(B," ");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 Qx(n,i,c){return x8()?Qx=Reflect.construct:Qx=function(p,w,x){var M=[null];M.push.apply(M,w);var B=Function.bind.apply(p,M),G=new B;return x&&Y3(G,x.prototype),G},Qx.apply(null,arguments)}function g1(n){return EU(n)||AU(n)||nM(n)||T8()}function EU(n){if(Array.isArray(n))return rw(n)}function AU(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function nM(n,i){if(!!n){if(typeof n=="string")return rw(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 rw(n,i)}}function rw(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),cM=p1(/^data-[\-\w.\u00B7-\uFFFF]/),uM=p1(/^aria-[\-\w]+$/),NU=p1(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),IU=p1(/^(?:\w+script|data):/i),Pb=p1(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),fM=p1(/^html$/i),BU=function(){return typeof window>"u"?null:window},dM=function(i,c){if($O(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 w="dompurify"+(m?"#"+m:"");try{return i.createPolicy(w,{createHTML:function(M){return M}})}catch{return console.warn("TrustedTypes policy "+w+" could not be created."),null}};function K3(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:BU(),i=function(Yt){return K3(Yt)};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,w=n.HTMLTemplateElement,x=n.Node,M=n.Element,B=n.NodeFilter,G=n.NamedNodeMap,ae=G===void 0?n.NamedNodeMap||n.MozNamedAttrMap:G,fe=n.HTMLFormElement,ve=n.DOMParser,Le=n.trustedTypes,Ye=M.prototype,Pe=Db(Ye,"cloneNode"),Ve=Db(Ye,"nextSibling"),mt=Db(Ye,"childNodes"),vt=Db(Ye,"parentNode");if(typeof w=="function"){var St=m.createElement("template");St.content&&St.content.ownerDocument&&(m=St.content.ownerDocument)}var Mt=dM(Le,c),dn=Mt?Mt.createHTML(""):"",Zn=m,$n=Zn.implementation,Lt=Zn.createNodeIterator,Zt=Zn.createDocumentFragment,yn=Zn.getElementsByTagName,bo=c.importNode,Do={};try{Do=Ab(m).documentMode?m.documentMode:{}}catch{}var Cs={};i.isSupported=typeof vt=="function"&&$n&&typeof $n.createHTMLDocument<"u"&&Do!==9;var Ws=$8,Ir=$U,pi=cM,fl=uM,Il=IU,Oc=Pb,Pn=NU,eo=null,Cr=Fi({},[].concat(g1(iM),g1(gd),g1(sv),g1(aM),g1(R8))),Is=null,Co=Fi({},[].concat(g1(lM),g1(iw),g1(q3),g1(G3))),Mn=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}})),En=null,Xo=null,Ks=!0,Kr=!0,co=!1,Us=!1,ci=!1,Ja=!1,Ti=!1,$c=!1,Fh=!1,qd=!1,Dm=!0,qO=!0,Pw=!1,GO={},KO=null,Z4=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"]),H4=null,z4=Fi({},["audio","video","img","source","image","track"]),FT=null,QT=Fi({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ZT="http://www.w3.org/1998/Math/MathML",cC="http://www.w3.org/2000/svg",T1="http://www.w3.org/1999/xhtml",uC=T1,Mw=!1,vv,HT=["application/xhtml+xml","text/html"],zT="text/html",Ib,Ov=null,VT=m.createElement("form"),WT=function(Yt){return Yt instanceof RegExp||Yt instanceof Function},UT=function(Yt){Ov&&Ov===Yt||((!Yt||$O(Yt)!=="object")&&(Yt={}),Yt=Ab(Yt),eo="ALLOWED_TAGS"in Yt?Fi({},Yt.ALLOWED_TAGS):Cr,Is="ALLOWED_ATTR"in Yt?Fi({},Yt.ALLOWED_ATTR):Co,FT="ADD_URI_SAFE_ATTR"in Yt?Fi(Ab(QT),Yt.ADD_URI_SAFE_ATTR):QT,H4="ADD_DATA_URI_TAGS"in Yt?Fi(Ab(z4),Yt.ADD_DATA_URI_TAGS):z4,KO="FORBID_CONTENTS"in Yt?Fi({},Yt.FORBID_CONTENTS):Z4,En="FORBID_TAGS"in Yt?Fi({},Yt.FORBID_TAGS):{},Xo="FORBID_ATTR"in Yt?Fi({},Yt.FORBID_ATTR):{},GO="USE_PROFILES"in Yt?Yt.USE_PROFILES:!1,Ks=Yt.ALLOW_ARIA_ATTR!==!1,Kr=Yt.ALLOW_DATA_ATTR!==!1,co=Yt.ALLOW_UNKNOWN_PROTOCOLS||!1,Us=Yt.SAFE_FOR_TEMPLATES||!1,ci=Yt.WHOLE_DOCUMENT||!1,$c=Yt.RETURN_DOM||!1,Fh=Yt.RETURN_DOM_FRAGMENT||!1,qd=Yt.RETURN_TRUSTED_TYPE||!1,Ti=Yt.FORCE_BODY||!1,Dm=Yt.SANITIZE_DOM!==!1,qO=Yt.KEEP_CONTENT!==!1,Pw=Yt.IN_PLACE||!1,Pn=Yt.ALLOWED_URI_REGEXP||Pn,uC=Yt.NAMESPACE||T1,Yt.CUSTOM_ELEMENT_HANDLING&&WT(Yt.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Mn.tagNameCheck=Yt.CUSTOM_ELEMENT_HANDLING.tagNameCheck),Yt.CUSTOM_ELEMENT_HANDLING&&WT(Yt.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Mn.attributeNameCheck=Yt.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),Yt.CUSTOM_ELEMENT_HANDLING&&typeof Yt.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(Mn.allowCustomizedBuiltInElements=Yt.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),vv=HT.indexOf(Yt.PARSER_MEDIA_TYPE)===-1?vv=zT:vv=Yt.PARSER_MEDIA_TYPE,Ib=vv==="application/xhtml+xml"?function(So){return So}:j3,Us&&(Kr=!1),Fh&&($c=!0),GO&&(eo=Fi({},g1(R8)),Is=[],GO.html===!0&&(Fi(eo,iM),Fi(Is,lM)),GO.svg===!0&&(Fi(eo,gd),Fi(Is,iw),Fi(Is,G3)),GO.svgFilters===!0&&(Fi(eo,sv),Fi(Is,iw),Fi(Is,G3)),GO.mathMl===!0&&(Fi(eo,aM),Fi(Is,q3),Fi(Is,G3))),Yt.ADD_TAGS&&(eo===Cr&&(eo=Ab(eo)),Fi(eo,Yt.ADD_TAGS)),Yt.ADD_ATTR&&(Is===Co&&(Is=Ab(Is)),Fi(Is,Yt.ADD_ATTR)),Yt.ADD_URI_SAFE_ATTR&&Fi(FT,Yt.ADD_URI_SAFE_ATTR),Yt.FORBID_CONTENTS&&(KO===Z4&&(KO=Ab(KO)),Fi(KO,Yt.FORBID_CONTENTS)),qO&&(eo["#text"]=!0),ci&&Fi(eo,["html","head","body"]),eo.table&&(Fi(eo,["tbody"]),delete En.tbody),md&&md(Yt),Ov=Yt)},V4=Fi({},["mi","mo","mn","ms","mtext"]),W4=Fi({},["foreignobject","desc","title","annotation-xml"]),kZ=Fi({},["title","style","font","a","script"]),E1=Fi({},gd);Fi(E1,sv),Fi(E1,P8);var Rw=Fi({},aM);Fi(Rw,M8);var Rt=function(Yt){var So=vt(Yt);(!So||!So.tagName)&&(So={namespaceURI:T1,tagName:"template"});var ws=j3(Yt.tagName),Sl=j3(So.tagName);return Yt.namespaceURI===cC?So.namespaceURI===T1?ws==="svg":So.namespaceURI===ZT?ws==="svg"&&(Sl==="annotation-xml"||V4[Sl]):Boolean(E1[ws]):Yt.namespaceURI===ZT?So.namespaceURI===T1?ws==="math":So.namespaceURI===cC?ws==="math"&&W4[Sl]:Boolean(Rw[ws]):Yt.namespaceURI===T1?So.namespaceURI===cC&&!W4[Sl]||So.namespaceURI===ZT&&!V4[Sl]?!1:!Rw[ws]&&(kZ[ws]||!E1[ws]):!1},$t=function(Yt){zx(i.removed,{element:Yt});try{Yt.parentNode.removeChild(Yt)}catch{try{Yt.outerHTML=dn}catch{Yt.remove()}}},Rn=function(Yt,So){try{zx(i.removed,{attribute:So.getAttributeNode(Yt),from:So})}catch{zx(i.removed,{attribute:null,from:So})}if(So.removeAttribute(Yt),Yt==="is"&&!Is[Yt])if($c||Fh)try{$t(So)}catch{}else try{So.setAttribute(Yt,"")}catch{}},xn=function(Yt){var So,ws;if(Ti)Yt=""+Yt;else{var Sl=sM(Yt,/^[\r\n\t ]+/);ws=Sl&&Sl[0]}vv==="application/xhtml+xml"&&(Yt=''+Yt+"");var Pm=Mt?Mt.createHTML(Yt):Yt;if(uC===T1)try{So=new ve().parseFromString(Pm,vv)}catch{}if(!So||!So.documentElement){So=$n.createDocument(uC,"template",null);try{So.documentElement.innerHTML=Mw?"":Pm}catch{}}var Gd=So.body||So.documentElement;return Yt&&ws&&Gd.insertBefore(m.createTextNode(ws),Gd.childNodes[0]||null),uC===T1?yn.call(So,ci?"html":"body")[0]:ci?So.documentElement:Gd},No=function(Yt){return Lt.call(Yt.ownerDocument||Yt,Yt,B.SHOW_ELEMENT|B.SHOW_COMMENT|B.SHOW_TEXT,null,!1)},br=function(Yt){return Yt instanceof fe&&(typeof Yt.nodeName!="string"||typeof Yt.textContent!="string"||typeof Yt.removeChild!="function"||!(Yt.attributes instanceof ae)||typeof Yt.removeAttribute!="function"||typeof Yt.setAttribute!="function"||typeof Yt.namespaceURI!="string"||typeof Yt.insertBefore!="function")},ha=function(Yt){return $O(x)==="object"?Yt instanceof x:Yt&&$O(Yt)==="object"&&typeof Yt.nodeType=="number"&&typeof Yt.nodeName=="string"},Nc=function(Yt,So,ws){!Cs[Yt]||A8(Cs[Yt],function(Sl){Sl.call(i,So,ws,Ov)})},_u=function(Yt){var So;if(Nc("beforeSanitizeElements",Yt,null),br(Yt)||$h(/[\u0080-\uFFFF]/,Yt.nodeName))return $t(Yt),!0;var ws=Ib(Yt.nodeName);if(Nc("uponSanitizeElement",Yt,{tagName:ws,allowedTags:eo}),Yt.hasChildNodes()&&!ha(Yt.firstElementChild)&&(!ha(Yt.content)||!ha(Yt.content.firstElementChild))&&$h(/<[/\w]/g,Yt.innerHTML)&&$h(/<[/\w]/g,Yt.textContent)||ws==="select"&&$h(/