BookStack/public/dist/app.js

54 lines
302 KiB
JavaScript
Raw Normal View History

var Nu=Object.create;var Se=Object.defineProperty;var zu=Object.getOwnPropertyDescriptor;var Hu=Object.getOwnPropertyNames;var Uu=Object.getPrototypeOf,ju=Object.prototype.hasOwnProperty;var Vu=(i,t,e)=>t in i?Se(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var Wu=(i,t)=>()=>(i&&(t=i(i=0)),t);var _=(i,t)=>()=>(t||i((t={exports:{}}).exports,t),t.exports),Ae=(i,t)=>{for(var e in t)Se(i,e,{get:t[e],enumerable:!0})},Ko=(i,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Hu(t))!ju.call(i,r)&&r!==e&&Se(i,r,{get:()=>t[r],enumerable:!(n=zu(t,r))||n.enumerable});return i};var Zo=(i,t,e)=>(e=i!=null?Nu(Uu(i)):{},Ko(t||!i||!i.__esModule?Se(e,"default",{value:i,enumerable:!0}):e,i)),Gu=i=>Ko(Se({},"__esModule",{value:!0}),i);var at=(i,t,e)=>(Vu(i,typeof t!="symbol"?t+"":t,e),e),Ku=(i,t,e)=>{if(!t.has(i))throw TypeError("Cannot "+e)};var ot=(i,t,e)=>{if(t.has(i))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(i):t.set(i,e)};var L=(i,t,e)=>(Ku(i,t,"access private method"),e);var Bs=_((Ob,Vh)=>{Vh.exports={Aacute:"\xC1",aacute:"\xE1",Abreve:"\u0102",abreve:"\u0103",ac:"\u223E",acd:"\u223F",acE:"\u223E\u0333",Acirc:"\xC2",acirc:"\xE2",acute:"\xB4",Acy:"\u0410",acy:"\u0430",AElig:"\xC6",aelig:"\xE6",af:"\u2061",Afr:"\u{1D504}",afr:"\u{1D51E}",Agrave:"\xC0",agrave:"\xE0",alefsym:"\u2135",aleph:"\u2135",Alpha:"\u0391",alpha:"\u03B1",Amacr:"\u0100",amacr:"\u0101",amalg:"\u2A3F",amp:"&",AMP:"&",andand:"\u2A55",And:"\u2A53",and:"\u2227",andd:"\u2A5C",andslope:"\u2A58",andv:"\u2A5A",ang:"\u2220",ange:"\u29A4",angle:"\u2220",angmsdaa:"\u29A8",angmsdab:"\u29A9",angmsdac:"\u29AA",angmsdad:"\u29AB",angmsdae:"\u29AC",angmsdaf:"\u29AD",angmsdag:"\u29AE",angmsdah:"\u29AF",angmsd:"\u2221",angrt:"\u221F",angrtvb:"\u22BE",angrtvbd:"\u299D",angsph:"\u2222",angst:"\xC5",angzarr:"\u237C",Aogon:"\u0104",aogon:"\u0105",Aopf:"\u{1D538}",aopf:"\u{1D552}",apacir:"\u2A6F",ap:"\u2248",apE:"\u2A70",ape:"\u224A",apid:"\u224B",apos:"'",ApplyFunction:"\u2061",approx:"\u2248",approxeq:"\u224A",Aring:"\xC5",aring:"\xE5",Ascr:"\u{1D49C}",ascr:"\u{1D4B6}",Assign:"\u2254",ast:"*",asymp:"\u2248",asympeq:"\u224D",Atilde:"\xC3",atilde:"\xE3",Auml:"\xC4",auml:"\xE4",awconint:"\u2233",awint:"\u2A11",backcong:"\u224C",backepsilon:"\u03F6",backprime:"\u2035",backsim:"\u223D",backsimeq:"\u22CD",Backslash:"\u2216",Barv:"\u2AE7",barvee:"\u22BD",barwed:"\u2305",Barwed:"\u2306",barwedge:"\u2305",bbrk:"\u23B5",bbrktbrk:"\u23B6",bcong:"\u224C",Bcy:"\u0411",bcy:"\u0431",bdquo:"\u201E",becaus:"\u2235",because:"\u2235",Because:"\u2235",bemptyv:"\u29B0",bepsi:"\u03F6",bernou:"\u212C",Bernoullis:"\u212C",Beta:"\u0392",beta:"\u03B2",beth:"\u2136",between:"\u226C",Bfr:"\u{1D505}",bfr:"\u{1D51F}",bigcap:"\u22C2",bigcirc:"\u25EF",bigcup:"\u22C3",bigodot:"\u2A00",bigoplus:"\u2A01",bigotimes:"\u2A02",bigsqcup:"\u2A06",bigstar:"\u2605",bigtriangledown:"\u25BD",bigtriangleup:"\u25B3",biguplus:"\u2A04",bigvee:"\u22C1",bigwedge:"\u22C0",bkarow:"\u290D",blacklozenge:"\u29EB",blacksquare:"\u25AA",blacktriangle:"\u25B4",blacktriangledown:"\u25BE",blacktriangleleft:"\u25C2",blacktriangleright:"\u25B8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20E5",bnequiv:"\u2261\u20E5",bNot:"\u2AED",bnot:"\u2310",Bopf:"\u{1D539}",bopf:"\u{1D553}",bot:"\u22A5",bottom:"\u22A5",bowtie:"\u22C8",boxbox:"\u29C9",boxdl:"\u2510",boxdL:"\u2555",boxDl:"\u2556",boxDL:"\u2557",boxdr:"\u250C",boxdR:"\u2552",boxDr:"\u2553",boxDR:"\u2554",boxh:"\u2500",boxH:"\u2550",boxhd:"\u252C",boxHd:"\u2564",boxhD:"\u2565",boxHD:"\u2566",boxhu:"\u2534",boxHu:"\u2567",boxhU:"\u2568",boxHU:"\u2569",boxminus:"\u229F",boxplus:"\u229E",boxtimes:"\u22A0",boxul:"\u2518",boxuL:"\u255B",boxUl:"\u255C",boxUL:"\u255D",boxur:"\u2514",boxuR:"\u2558",boxUr:"\u2559",boxUR:"\u255A",boxv:"\u2502",boxV:"\u2551",boxvh:"\u253C",boxvH:"\u256A",boxVh:"\u256B",boxVH:"\u256C",boxvl:"\u2524",boxvL:"\u2561",boxVl:"\u2562",boxVL:"\u2563",boxvr:"\u251C",boxvR:"\u255E",boxVr:"\u255F",boxVR:"\u2560",bprime:"\u2035",breve:"\u02D8",Breve:"\u02D8",brvb
`,nexist:"\u2204",nexists:"\u2204",Nfr:"\u{1D511}",nfr:"\u{1D52B}",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",nGg:"\u22D9\u0338",ngsim:"\u2275",nGt:"\u226B\u20D2",ngt:"\u226F",ngtr:"\u226F",nGtv:"\u226B\u0338",nharr:"\u21AE",nhArr:"\u21CE",nhpar:"\u2AF2",ni:"\u220B",nis:"\u22FC",nisd:"\u22FA",niv:"\u220B",NJcy:"\u040A",njcy:"\u045A",nlarr:"\u219A",nlArr:"\u21CD",nldr:"\u2025",nlE:"\u2266\u0338",nle:"\u2270",nleftarrow:"\u219A",nLeftarrow:"\u21CD",nleftrightarrow:"\u21AE",nLeftrightarrow:"\u21CE",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",nless:"\u226E",nLl:"\u22D8\u0338",nlsim:"\u2274",nLt:"\u226A\u20D2",nlt:"\u226E",nltri:"\u22EA",nltrie:"\u22EC",nLtv:"\u226A\u0338",nmid:"\u2224",NoBreak:"\u2060",NonBreakingSpace:"\xA0",nopf:"\u{1D55F}",Nopf:"\u2115",Not:"\u2AEC",not:"\xAC",NotCongruent:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226F",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",notin:"\u2209",notindot:"\u22F5\u0338",notinE:"\u22F9\u0338",notinva:"\u2209",notinvb:"\u22F7",notinvc:"\u22F6",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangle:"\u22EA",NotLeftTriangleEqual:"\u22EC",NotLess:"\u226E",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",notni:"\u220C",notniva:"\u220C",notnivb:"\u22FE",notnivc:"\u22FD",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",NotReverseElement:"\u220C",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangle:"\u22EB",NotRightTriangleEqual:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",NotSubset:"\u2282\u20D2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",nparallel:"\u2226",npar:"\u2226",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",npr:"\u2280",nprcue:"\u22E0",nprec:"\u2280",npreceq:"\u2AAF\u0338",npre:"\u2AAF\u0338",nrarrc:"\u2933\u0338",nrarr:"\u219B",nrArr:"\u21CF",nrarrw:"\u219D\u0338",nrightarrow:"\u219B",nRightarrow:"\u21CF",nrtri:"\u22EB",nrtrie:"\u22ED",nsc:"\u2281",nsccue:"\u22E1",nsce:"\u2AB0\u0338",Nscr:"\u{1D4A9}",nscr:"\u{1D4C3}",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22E2",nsqsupe:"\u22E3",nsub:"\u2284",nsubE:"\u2AC5\u0338",nsube:"\u2288",nsubset:"\u2282\u20D2",nsubseteq:"\u2288",nsubseteqq:"\u2AC5\u0338",nsucc:"\u2281",nsucceq:"\u2AB0\u0338",nsup:"\u2285",nsupE:"\u2AC6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20D2",nsupseteq:"\u2289",nsupseteqq:"\u2AC6\u0338",ntgl:"\u2279",Ntilde:"\xD1",ntilde:"\xF1",ntlg:"\u2278",ntriangleleft:"\u22EA",ntrianglelefteq:"\u22EC",ntriangleright:"\u22EB",ntrianglerighteq:"\u22ED",Nu:"\u039D",nu:"\u03BD",num:"#",numero:"\u2116",numsp:"\u2007",nvap:"\u224D\u20D2",nvdash:"\u22AC",nvDash:"\u22AD",nVdash:"\u22AE",nVDash:"\u22AF",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvHarr:"\u2904",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwarhk:"\u2923",nwarr:"\u2196",nwArr:"\u21D6",nwarrow:"\u2196",nwnear:"\u2927",Oacute:"\xD3",oacute:"\xF3",oast:"\u229B",Ocirc:"\xD4",ocirc:"\xF4",ocir:"\u229A",Ocy:"\u041E",ocy:"\u043E",odash:"\u229D",Odblac:"\u0150",odblac:"\u0151",odiv:"\u2A38",odot:"\u2299",odsold:"\u29BC",OElig:"\u0152",oelig:"\u01
`," "],Jh=["{","}","|","\\","^","`"].concat(Yh),Qh=["'"].concat(Jh),Gs=["%","/","?",";","#"].concat(Qh),Ks=["/","?","#"],td=255,Zs=/^[+a-z0-9A-Z_-]{0,63}$/,ed=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Xs={javascript:!0,"javascript:":!0},Ys={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function id(i,t){if(i&&i instanceof cn)return i;var e=new cn;return e.parse(i,t),e}cn.prototype.parse=function(i,t){var e,n,r,o,s,a=i;if(a=a.trim(),!t&&i.split("#").length===1){var l=Xh.exec(a);if(l)return this.pathname=l[1],l[2]&&(this.search=l[2]),this}var c=Kh.exec(a);if(c&&(c=c[0],r=c.toLowerCase(),this.protocol=c,a=a.substr(c.length)),(t||c||a.match(/^\/\/[^@\/]+@[^@\/]+/))&&(s=a.substr(0,2)==="//",s&&!(c&&Xs[c])&&(a=a.substr(2),this.slashes=!0)),!Xs[c]&&(s||c&&!Ys[c])){var u=-1;for(e=0;e<Ks.length;e++)o=a.indexOf(Ks[e]),o!==-1&&(u===-1||o<u)&&(u=o);var h,d;for(u===-1?d=a.lastIndexOf("@"):d=a.lastIndexOf("@",u),d!==-1&&(h=a.slice(0,d),a=a.slice(d+1),this.auth=h),u=-1,e=0;e<Gs.length;e++)o=a.indexOf(Gs[e]),o!==-1&&(u===-1||o<u)&&(u=o);u===-1&&(u=a.length),a[u-1]===":"&&u--;var f=a.slice(0,u);a=a.slice(u),this.parseHost(f),this.hostname=this.hostname||"";var p=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!p){var m=this.hostname.split(/\./);for(e=0,n=m.length;e<n;e++){var w=m[e];if(w&&!w.match(Zs)){for(var v="",b=0,k=w.length;b<k;b++)w.charCodeAt(b)>127?v+="x":v+=w[b];if(!v.match(Zs)){var x=m.slice(0,e),E=m.slice(e+1),y=w.match(ed);y&&(x.push(y[1]),E.unshift(y[2])),E.length&&(a=E.join(".")+a),this.hostname=x.join(".");break}}}}this.hostname.length>td&&(this.hostname=""),p&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}var S=a.indexOf("#");S!==-1&&(this.hash=a.substr(S),a=a.slice(0,S));var D=a.indexOf("?");return D!==-1&&(this.search=a.substr(D),a=a.slice(0,D)),a&&(this.pathname=a),Ys[r]&&this.hostname&&!this.pathname&&(this.pathname=""),this};cn.prototype.parseHost=function(i){var t=Zh.exec(i);t&&(t=t[0],t!==":"&&(this.port=t.substr(1)),i=i.substr(0,i.length-t.length)),i&&(this.hostname=i)};Js.exports=id});var Xr=_((Vb,Ze)=>{"use strict";Ze.exports.encode=zs();Ze.exports.decode=js();Ze.exports.format=Ws();Ze.exports.parse=Qs()});var Yr=_((Wb,ta)=>{ta.exports=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/});var Jr=_((Gb,ea)=>{ea.exports=/[\0-\x1F\x7F-\x9F]/});var na=_((Kb,ia)=>{ia.exports=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/});var Qr=_((Zb,ra)=>{ra.exports=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/});var oa=_(ge=>{"use strict";ge.Any=Yr();ge.Cc=Jr();ge.Cf=na();ge.P=sn();ge.Z=Qr()});var N=_(Q=>{"use strict";function nd(i){return Object.prototype.toString.call(i)}function rd(i){return nd(i)==="[object String]"}var od=Object.prototype.hasOwnProperty;function aa(i,t){return od.call(i,t)}function sd(i){var t=Array.prototype.slice.call(arguments,1);return t.forEach(function(e){if(e){if(typeof e!="object")throw new TypeError(e+"must be object");Object.keys(e).forEach(function(n){i[n]=e[n]})}}),i}function ad(i,t,e){return[].concat(i.slice(0,t),e,i.slice(t+1))}function la(i){return!(i>=55296&&i<=57343||i>=64976&&i<=65007||(i&65535)===65535||(i&65535)===65534||i>=0&&i<=8||i===11||i>=14&&i<=31||i>=127&&i<=159||i>1114111)}function ca(i){if(i>65535){i-=65536;var t=55296+(i>>10),e=56320+(i&1023);return String.fromCharCode(t,e)}return String.fromCharCode(i)}var ua=/\\([!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~])/g,ld=/&([a-z#][a-z0-9]{1,31});/gi,cd=new RegExp(ua.source+"|"+ld.source,"gi"),ud=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i,sa=Zr();function hd(i,t){var e;return aa(sa,t)?sa[t]:t.charCodeAt(0)===35&&ud.test(t)&&(e=t[1].toLowerCase()==="x"?parseInt(t.slice(2),16):parseInt(t.slice(1),10),la(e))?ca(e):i}function dd(i){return i.indexOf("\\")<0?i:i.replace(ua,"$1")}function pd(i){return i.indexOf("\\"
`};Dt.fence=function(i,t,e,n,r){var o=i[t],s=o.info?Ld(o.info).trim():"",a="",l="",c,u,h,d,f;return s&&(h=s.split(/(\s+)/g),a=h[0],l=h.slice(2).join("")),e.highlight?c=e.highlight(o.content,a,l)||Jt(o.content):c=Jt(o.content),c.indexOf("<pre")===0?c+`
`:s?(u=o.attrIndex("class"),d=o.attrs?o.attrs.slice():[],u<0?d.push(["class",e.langPrefix+a]):(d[u]=d[u].slice(),d[u][1]+=" "+e.langPrefix+a),f={attrs:d},"<pre><code"+r.renderAttrs(f)+">"+c+`</code></pre>
`):"<pre><code"+r.renderAttrs(o)+">"+c+`</code></pre>
`};Dt.image=function(i,t,e,n,r){var o=i[t];return o.attrs[o.attrIndex("alt")][1]=r.renderInlineAsText(o.children,e,n),r.renderToken(i,t,e)};Dt.hardbreak=function(i,t,e){return e.xhtmlOut?`<br />
`:`<br>
`};Dt.softbreak=function(i,t,e){return e.breaks?e.xhtmlOut?`<br />
`:`<br>
`:`
`};Dt.text=function(i,t){return Jt(i[t].content)};Dt.html_block=function(i,t){return i[t].content};Dt.html_inline=function(i,t){return i[t].content};function be(){this.rules=Dd({},Dt)}be.prototype.renderAttrs=function(t){var e,n,r;if(!t.attrs)return"";for(r="",e=0,n=t.attrs.length;e<n;e++)r+=" "+Jt(t.attrs[e][0])+'="'+Jt(t.attrs[e][1])+'"';return r};be.prototype.renderToken=function(t,e,n){var r,o="",s=!1,a=t[e];return a.hidden?"":(a.block&&a.nesting!==-1&&e&&t[e-1].hidden&&(o+=`
`),o+=(a.nesting===-1?"</":"<")+a.tag,o+=this.renderAttrs(a),a.nesting===0&&n.xhtmlOut&&(o+=" /"),a.block&&(s=!0,a.nesting===1&&e+1<t.length&&(r=t[e+1],(r.type==="inline"||r.hidden||r.nesting===-1&&r.tag===a.tag)&&(s=!1))),o+=s?`>
`:">",o)};be.prototype.renderInline=function(i,t,e){for(var n,r="",o=this.rules,s=0,a=i.length;s<a;s++)n=i[s].type,typeof o[n]<"u"?r+=o[n](i,s,t,e,this):r+=this.renderToken(i,s,t);return r};be.prototype.renderInlineAsText=function(i,t,e){for(var n="",r=0,o=i.length;r<o;r++)i[r].type==="text"?n+=i[r].content:i[r].type==="image"?n+=this.renderInlineAsText(i[r].children,t,e):i[r].type==="softbreak"&&(n+=`
`);return n};be.prototype.render=function(i,t,e){var n,r,o,s="",a=this.rules;for(n=0,r=i.length;n<r;n++)o=i[n].type,o==="inline"?s+=this.renderInline(i[n].children,t,e):typeof a[o]<"u"?s+=a[o](i,n,t,e,this):s+=this.renderToken(i,n,t,e);return s};wa.exports=be});var hn=_((nv,xa)=>{"use strict";function Ct(){this.__rules__=[],this.__cache__=null}Ct.prototype.__find__=function(i){for(var t=0;t<this.__rules__.length;t++)if(this.__rules__[t].name===i)return t;return-1};Ct.prototype.__compile__=function(){var i=this,t=[""];i.__rules__.forEach(function(e){e.enabled&&e.alt.forEach(function(n){t.indexOf(n)<0&&t.push(n)})}),i.__cache__={},t.forEach(function(e){i.__cache__[e]=[],i.__rules__.forEach(function(n){n.enabled&&(e&&n.alt.indexOf(e)<0||i.__cache__[e].push(n.fn))})})};Ct.prototype.at=function(i,t,e){var n=this.__find__(i),r=e||{};if(n===-1)throw new Error("Parser rule not found: "+i);this.__rules__[n].fn=t,this.__rules__[n].alt=r.alt||[],this.__cache__=null};Ct.prototype.before=function(i,t,e,n){var r=this.__find__(i),o=n||{};if(r===-1)throw new Error("Parser rule not found: "+i);this.__rules__.splice(r,0,{name:t,enabled:!0,fn:e,alt:o.alt||[]}),this.__cache__=null};Ct.prototype.after=function(i,t,e,n){var r=this.__find__(i),o=n||{};if(r===-1)throw new Error("Parser rule not found: "+i);this.__rules__.splice(r+1,0,{name:t,enabled:!0,fn:e,alt:o.alt||[]}),this.__cache__=null};Ct.prototype.push=function(i,t,e){var n=e||{};this.__rules__.push({name:i,enabled:!0,fn:t,alt:n.alt||[]}),this.__cache__=null};Ct.prototype.enable=function(i,t){Array.isArray(i)||(i=[i]);var e=[];return i.forEach(function(n){var r=this.__find__(n);if(r<0){if(t)return;throw new Error("Rules manager: invalid rule name "+n)}this.__rules__[r].enabled=!0,e.push(n)},this),this.__cache__=null,e};Ct.prototype.enableOnly=function(i,t){Array.isArray(i)||(i=[i]),this.__rules__.forEach(function(e){e.enabled=!1}),this.enable(i,t)};Ct.prototype.disable=function(i,t){Array.isArray(i)||(i=[i]);var e=[];return i.forEach(function(n){var r=this.__find__(n);if(r<0){if(t)return;throw new Error("Rules manager: invalid rule name "+n)}this.__rules__[r].enabled=!1,e.push(n)},this),this.__cache__=null,e};Ct.prototype.getRules=function(i){return this.__cache__===null&&this.__compile__(),this.__cache__[i]||[]};xa.exports=Ct});var Ca=_((rv,ka)=>{"use strict";var Td=/\r\n?|\n/g,$d=/\0/g;ka.exports=function(t){var e;e=t.src.replace(Td,`
`),e=e.replace($d,"\uFFFD"),t.src=e}});var _a=_((ov,Ea)=>{"use strict";Ea.exports=function(t){var e;t.inlineMode?(e=new t.Token("inline","",0),e.content=t.src,e.map=[0,1],e.children=[],t.tokens.push(e)):t.md.block.parse(t.src,t.md,t.env,t.tokens)}});var Aa=_((sv,Sa)=>{"use strict";Sa.exports=function(t){var e=t.tokens,n,r,o;for(r=0,o=e.length;r<o;r++)n=e[r],n.type==="inline"&&t.md.inline.parse(n.content,t.md,t.env,n.children)}});var La=_((av,Da)=>{"use strict";var Id=N().arrayReplaceAt;function Md(i){return/^<a[>\s]/i.test(i)}function Fd(i){return/^<\/a\s*>/i.test(i)}Da.exports=function(t){var e,n,r,o,s,a,l,c,u,h,d,f,p,m,w,v,b=t.tokens,k;if(t.md.options.linkify){for(n=0,r=b.length;n<r;n++)if(!(b[n].type!=="inline"||!t.md.linkify.pretest(b[n].content)))for(o=b[n].children,p=0,e=o.length-1;e>=0;e--){if(a=o[e],a.type==="link_close"){for(e--;o[e].level!==a.level&&o[e].type!=="link_open";)e--;continue}if(a.type==="html_inline"&&(Md(a.content)&&p>0&&p--,Fd(a.content)&&p++),!(p>0)&&a.type==="text"&&t.md.linkify.test(a.content)){for(u=a.content,k=t.md.linkify.match(u),l=[],f=a.level,d=0,k.length>0&&k[0].index===0&&e>0&&o[e-1].type==="text_special"&&(k=k.slice(1)),c=0;c<k.length;c++)m=k[c].url,w=t.md.normalizeLink(m),t.md.validateLink(w)&&(v=k[c].text,k[c].schema?k[c].schema==="mailto:"&&!/^mailto:/i.test(v)?v=t.md.normalizeLinkText("mailto:"+v).replace(/^mailto:/,""):v=t.md.normalizeLinkText(v):v=t.md.normalizeLinkText("http://"+v).replace(/^http:\/\//,""),h=k[c].index,h>d&&(s=new t.Token("text","",0),s.content=u.slice(d,h),s.level=f,l.push(s)),s=new t.Token("link_open","a",1),s.attrs=[["href",w]],s.level=f++,s.markup="linkify",s.info="auto",l.push(s),s=new t.Token("text","",0),s.content=v,s.level=f,l.push(s),s=new t.Token("link_close","a",-1),s.level=--f,s.markup="linkify",s.info="auto",l.push(s),d=k[c].lastIndex);d<u.length&&(s=new t.Token("text","",0),s.content=u.slice(d),s.level=f,l.push(s)),b[n].children=o=Id(o,e,l)}}}}});var Ia=_((lv,$a)=>{"use strict";var Ta=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,qd=/\((c|tm|r)\)/i,Bd=/\((c|tm|r)\)/ig,Pd={c:"\xA9",r:"\xAE",tm:"\u2122"};function Od(i,t){return Pd[t.toLowerCase()]}function Rd(i){var t,e,n=0;for(t=i.length-1;t>=0;t--)e=i[t],e.type==="text"&&!n&&(e.content=e.content.replace(Bd,Od)),e.type==="link_open"&&e.info==="auto"&&n--,e.type==="link_close"&&e.info==="auto"&&n++}function Nd(i){var t,e,n=0;for(t=i.length-1;t>=0;t--)e=i[t],e.type==="text"&&!n&&Ta.test(e.content)&&(e.content=e.content.replace(/\+-/g,"\xB1").replace(/\.{2,}/g,"\u2026").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/mg,"$1\u2014").replace(/(^|\s)--(?=\s|$)/mg,"$1\u2013").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg,"$1\u2013")),e.type==="link_open"&&e.info==="auto"&&n--,e.type==="link_close"&&e.info==="auto"&&n++}$a.exports=function(t){var e;if(t.md.options.typographer)for(e=t.tokens.length-1;e>=0;e--)t.tokens[e].type==="inline"&&(qd.test(t.tokens[e].content)&&Rd(t.tokens[e].children),Ta.test(t.tokens[e].content)&&Nd(t.tokens[e].children))}});var Ra=_((cv,Oa)=>{"use strict";var Ma=N().isWhiteSpace,Fa=N().isPunctChar,qa=N().isMdAsciiPunct,zd=/['"]/,Ba=/['"]/g,Pa="\u2019";function dn(i,t,e){return i.slice(0,t)+e+i.slice(t+1)}function Hd(i,t){var e,n,r,o,s,a,l,c,u,h,d,f,p,m,w,v,b,k,x,E,y;for(x=[],e=0;e<i.length;e++){for(n=i[e],l=i[e].level,b=x.length-1;b>=0&&!(x[b].level<=l);b--);if(x.length=b+1,n.type==="text"){r=n.content,s=0,a=r.length;t:for(;s<a&&(Ba.lastIndex=s,o=Ba.exec(r),!!o);){if(w=v=!0,s=o.index+1,k=o[0]==="'",u=32,o.index-1>=0)u=r.charCodeAt(o.index-1);else for(b=e-1;b>=0&&!(i[b].type==="softbreak"||i[b].type==="hardbreak");b--)if(i[b].content){u=i[b].content.charCodeAt(i[b].content.length-1);break}if(h=32,s<a)h=r.charCodeAt(s);else for(b=e+1;b<i.length&&!(i[b].type==="softbreak"||i[b].type==="hardbreak");b++)if(i[b].content){h=i[b].content.charCodeAt(0);break}if(d=qa(u)||Fa(String.fromCharCode(u)),f=qa(h)||Fa(String.fromCharCode(h)),p=Ma(u),m=Ma(h),m?w=!1:f&&(p||d||(w=!1)),p?v=!1:d&&(m||f||(v=!1)),h===34&&o[0]==='"'&&u>=48&&u<=57&&(v=w=!1),w&&v&&(w=
`,s.map=[e,t.line],!0}});var tl=_((gv,Qa)=>{"use strict";Qa.exports=function(t,e,n,r){var o,s,a,l,c,u,h,d=!1,f=t.bMarks[e]+t.tShift[e],p=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4||f+3>p||(o=t.src.charCodeAt(f),o!==126&&o!==96)||(c=f,f=t.skipChars(f,o),s=f-c,s<3)||(h=t.src.slice(c,f),a=t.src.slice(f,p),o===96&&a.indexOf(String.fromCharCode(o))>=0))return!1;if(r)return!0;for(l=e;l++,!(l>=n||(f=c=t.bMarks[l]+t.tShift[l],p=t.eMarks[l],f<p&&t.sCount[l]<t.blkIndent));)if(t.src.charCodeAt(f)===o&&!(t.sCount[l]-t.blkIndent>=4)&&(f=t.skipChars(f,o),!(f-c<s)&&(f=t.skipSpaces(f),!(f<p)))){d=!0;break}return s=t.sCount[e],t.line=l+(d?1:0),u=t.push("fence","code",0),u.info=a,u.content=t.getLines(e+1,l,s,!0),u.markup=h,u.map=[e,t.line],!0}});var il=_((bv,el)=>{"use strict";var Vd=N().isSpace;el.exports=function(t,e,n,r){var o,s,a,l,c,u,h,d,f,p,m,w,v,b,k,x,E,y,S,D,M=t.lineMax,T=t.bMarks[e]+t.tShift[e],P=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4||t.src.charCodeAt(T)!==62)return!1;if(r)return!0;for(p=[],m=[],b=[],k=[],y=t.md.block.ruler.getRules("blockquote"),v=t.parentType,t.parentType="blockquote",d=e;d<n&&(D=t.sCount[d]<t.blkIndent,T=t.bMarks[d]+t.tShift[d],P=t.eMarks[d],!(T>=P));d++){if(t.src.charCodeAt(T++)===62&&!D){for(l=t.sCount[d]+1,t.src.charCodeAt(T)===32?(T++,l++,o=!1,x=!0):t.src.charCodeAt(T)===9?(x=!0,(t.bsCount[d]+l)%4===3?(T++,l++,o=!1):o=!0):x=!1,f=l,p.push(t.bMarks[d]),t.bMarks[d]=T;T<P&&(s=t.src.charCodeAt(T),Vd(s));){s===9?f+=4-(f+t.bsCount[d]+(o?1:0))%4:f++;T++}u=T>=P,m.push(t.bsCount[d]),t.bsCount[d]=t.sCount[d]+1+(x?1:0),b.push(t.sCount[d]),t.sCount[d]=f-l,k.push(t.tShift[d]),t.tShift[d]=T-t.bMarks[d];continue}if(u)break;for(E=!1,a=0,c=y.length;a<c;a++)if(y[a](t,d,n,!0)){E=!0;break}if(E){t.lineMax=d,t.blkIndent!==0&&(p.push(t.bMarks[d]),m.push(t.bsCount[d]),k.push(t.tShift[d]),b.push(t.sCount[d]),t.sCount[d]-=t.blkIndent);break}p.push(t.bMarks[d]),m.push(t.bsCount[d]),k.push(t.tShift[d]),b.push(t.sCount[d]),t.sCount[d]=-1}for(w=t.blkIndent,t.blkIndent=0,S=t.push("blockquote_open","blockquote",1),S.markup=">",S.map=h=[e,0],t.md.block.tokenize(t,e,d),S=t.push("blockquote_close","blockquote",-1),S.markup=">",t.lineMax=M,t.parentType=v,h[1]=t.line,a=0;a<k.length;a++)t.bMarks[a+e]=p[a],t.tShift[a+e]=k[a],t.sCount[a+e]=b[a],t.bsCount[a+e]=m[a];return t.blkIndent=w,!0}});var rl=_((vv,nl)=>{"use strict";var Wd=N().isSpace;nl.exports=function(t,e,n,r){var o,s,a,l,c=t.bMarks[e]+t.tShift[e],u=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4||(o=t.src.charCodeAt(c++),o!==42&&o!==45&&o!==95))return!1;for(s=1;c<u;){if(a=t.src.charCodeAt(c++),a!==o&&!Wd(a))return!1;a===o&&s++}return s<3?!1:(r||(t.line=e+1,l=t.push("hr","hr",0),l.map=[e,t.line],l.markup=Array(s+1).join(String.fromCharCode(o))),!0)}});var cl=_((wv,ll)=>{"use strict";var al=N().isSpace;function ol(i,t){var e,n,r,o;return n=i.bMarks[t]+i.tShift[t],r=i.eMarks[t],e=i.src.charCodeAt(n++),e!==42&&e!==45&&e!==43||n<r&&(o=i.src.charCodeAt(n),!al(o))?-1:n}function sl(i,t){var e,n=i.bMarks[t]+i.tShift[t],r=n,o=i.eMarks[t];if(r+1>=o||(e=i.src.charCodeAt(r++),e<48||e>57))return-1;for(;;){if(r>=o)return-1;if(e=i.src.charCodeAt(r++),e>=48&&e<=57){if(r-n>=10)return-1;continue}if(e===41||e===46)break;return-1}return r<o&&(e=i.src.charCodeAt(r),!al(e))?-1:r}function Gd(i,t){var e,n,r=i.level+2;for(e=t+2,n=i.tokens.length-2;e<n;e++)i.tokens[e].level===r&&i.tokens[e].type==="paragraph_open"&&(i.tokens[e+2].hidden=!0,i.tokens[e].hidden=!0,e+=2)}ll.exports=function(t,e,n,r){var o,s,a,l,c,u,h,d,f,p,m,w,v,b,k,x,E,y,S,D,M,T,P,H,U,et,W,$=e,Ot=!1,Rt=!0;if(t.sCount[$]-t.blkIndent>=4||t.listIndent>=0&&t.sCount[$]-t.listIndent>=4&&t.sCount[$]<t.blkIndent)return!1;if(r&&t.parentType==="paragraph"&&t.sCount[$]>=t.blkIndent&&(Ot=!0),(T=sl(t,$))>=0){if(h=!0,H=t.bMarks[$]+t.tShift[$],v=Number(t.src.slice(H,T-1)),Ot&&v!==1)return!1}else if((T=ol(t,$))>=0)h=!1;else return!1;if(Ot&&t.skipSpaces(T)>=t.eMarks[$])return!1;if(r)return!0;for(w=t.src.charCodeAt(T-1),m=t.tokens.length,h?(W=t.push("ordered_list_open","ol",1),v!==1&&(W.attrs=[["start",v]])):W=t.push("bullet_list_open","ul",1),W.map=p=[$,0],W.markup=S
`);fr(t)}}function th(i){i.status&&i.status>=400&&i.data&&i.data.message&&fr(i.data.message)}var gr={};Ae(gr,{HttpError:()=>si,createXMLHttpRequest:()=>ih,delete:()=>ah,get:()=>nh,patch:()=>sh,post:()=>rh,put:()=>oh});async function eh(i){if(i.status===204)return null;let e=(i.headers.get("Content-Type")||"").split(";")[0].split("/").pop();return e==="javascript"||e==="json"?i.json():i.text()}var si=class extends Error{constructor(t,e){super(t.statusText),this.data=e,this.headers=t.headers,this.redirected=t.redirected,this.status=t.status,this.statusText=t.statusText,this.url=t.url,this.original=t}};function ih(i,t,e={}){let n=document.querySelector("meta[name=token]").getAttribute("content"),r=new XMLHttpRequest;for(let[o,s]of Object.entries(e))r.addEventListener(o,s.bind(r));return r.open(i,t),r.withCredentials=!0,r.setRequestHeader("X-CSRF-TOKEN",n),r}async function Xo(i,t={}){let e=i;if(e.startsWith("http")||(e=window.baseUrl(e)),t.params){let l=new URL(e);for(let c of Object.keys(t.params)){let u=t.params[c];typeof u<"u"&&u!==null&&l.searchParams.set(c,u)}e=l.toString()}let n=document.querySelector("meta[name=token]").getAttribute("content"),r={...t,credentials:"same-origin"};r.headers={...r.headers||{},baseURL:window.baseUrl(""),"X-CSRF-TOKEN":n};let o=await fetch(e,r),s=await eh(o),a={data:s,headers:o.headers,redirected:o.redirected,status:o.status,statusText:o.statusText,url:o.url,original:o};if(!o.ok)throw new si(o,s);return a}async function ai(i,t,e=null){let n={method:i,body:e};return typeof e=="object"&&!(e instanceof FormData)&&(n.headers={"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"},n.body=JSON.stringify(e)),e instanceof FormData&&i!=="post"&&(e.append("_method",i),n.method="post"),Xo(t,n)}async function nh(i,t={}){return Xo(i,{method:"GET",params:t})}async function rh(i,t=null){return ai("POST",i,t)}async function oh(i,t=null){return ai("PUT",i,t)}async function sh(i,t=null){return ai("PATCH",i,t)}async function ah(i,t=null){return ai("DELETE",i,t)}var br=class{constructor(){this.store=new Map,this.parseTranslations()}parseTranslations(){let t=document.querySelectorAll('meta[name="translation"]');for(let e of t){let n=e.getAttribute("key"),r=e.getAttribute("value");this.store.set(n,r)}}get(t,e){let n=this.getTransText(t);return this.performReplacements(n,e)}getPlural(t,e,n){let r=this.getTransText(t);return this.parsePlural(r,e,n)}parsePlural(t,e,n){let r=t.split("|"),o=/^{([0-9]+)}/,s=/^\[([0-9]+),([0-9*]+)]/,a=null;for(let l of r){let c=l.match(o);if(c!==null&&Number(c[1])===e){a=l.replace(o,"").trim();break}let u=l.match(s);if(u!==null&&Number(u[1])<=e&&(u[2]==="*"||Number(u[2])>=e)){a=l.replace(s,"").trim();break}}return a===null&&r.length>1&&(a=e===1?r[0]:r[1]),a===null&&(a=r[0]),this.performReplacements(a,n)}getTransText(t){let e=this.store.get(t);return e===void 0&&console.warn(`Translation with key "${t}" does not exist`),e}performReplacements(t,e){if(!e)return t;let n=t.match(/:(\S+)/g);if(n===null)return t;let r=t;return n.forEach(o=>{let s=o.substring(1);typeof e[s]>"u"||(r=r.replace(o,e[s]))}),r}},Yo=br;var kr={};Ae(kr,{first:()=>hh,firstOnElement:()=>ph,get:()=>dh,init:()=>yr,register:()=>xr});function vr(i){let t=n=>n.slice(0,1).toUpperCase()+n.slice(1),e=i.split("-");return e[0]+e.slice(1).map(t).join("")}function Jo(i){return i.replace(/[A-Z]/g,(t,e)=>(e>0?"-":"")+t.toLowerCase())}var De={},Qo={},wr=new WeakMap;function lh(i,t){let e={},n={},r=`${i}@`,o=`[refs*="${r}"]`,s=[...t.querySelectorAll(o)];t.matches(o)&&s.push(t);for(let a of s){let l=a.getAttribute("refs").split(" ").filter(c=>c.startsWith(r)).map(c=>c.replace(r,"")).map(vr);for(let c of l)e[c]=a,typeof n[c]>"u"&&(n[c]=[]),n[c].push(a)}return{refs:e,manyRefs:n}}function ch(i,t){let e={},n=`option:${i}:`;for(let{name:r,value:o}of t.attributes)if(r.startsWith(n)){let s=r.replace(n,"");e[vr(s)]=o||""}return e}function uh(i,t){let e=Qo[i];if(e===void 0)return;let n;try{n=new e,n.$name=i,n.$el=t;let o=lh(i,t);n.$refs=o.refs,n.$manyRefs=o.manyRefs,n.$opts=ch(i,t),n.setup()}catch(o){console.error("Failed to cre
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var kh="1.15.2";function It(i){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(i)}var Mt=It(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Ve=It(/Edge/i),as=It(/firefox/i),Ne=It(/safari/i)&&!It(/chrome/i)&&!It(/android/i),bs=It(/iP(ad|od|hone)/i),vs=It(/chrome/i)&&It(/android/i),ws={capture:!1,passive:!1};function O(i,t,e){i.addEventListener(t,e,!Mt&&ws)}function B(i,t,e){i.removeEventListener(t,e,!Mt&&ws)}function Di(i,t){if(t){if(t[0]===">"&&(t=t.substring(1)),i)try{if(i.matches)return i.matches(t);if(i.msMatchesSelector)return i.msMatchesSelector(t);if(i.webkitMatchesSelector)return i.webkitMatchesSelector(t)}catch{return!1}return!1}}function Ch(i){return i.host&&i!==document&&i.host.nodeType?i.host:i.parentNode}function bt(i,t,e,n){if(i){e=e||document;do{if(t!=null&&(t[0]===">"?i.parentNode===e&&Di(i,t):Di(i,t))||n&&i===e)return i;if(i===e)break}while(i=Ch(i))}return null}var ls=/\s+/g;function Y(i,t,e){if(i&&t)if(i.classList)i.classList[e?"add":"remove"](t);else{var n=(" "+i.className+" ").replace(ls," ").replace(" "+t+" "," ");i.className=(n+(e?" "+t:"")).replace(ls," ")}}function A(i,t,e){var n=i&&i.style;if(n){if(e===void 0)return document.defaultView&&document.defaultView.getComputedStyle?e=document.defaultView.getComputedStyle(i,""):i.currentStyle&&(e=i.currentStyle),t===void 0?e:e[t];!(t in n)&&t.indexOf("webkit")===-1&&(t="-webkit-"+t),n[t]=e+(typeof e=="string"?"":"px")}}function Xt(i,t){var e="";if(typeof i=="string")e=i;else do{var n=A(i,"transform");n&&n!=="none"&&(e=n+" "+e)}while(!t&&(i=i.parentNode));var r=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return r&&new r(e)}function ys(i,t,e){if(i){var n=i.getElementsByTagName(t),r=0,o=n.length;if(e)for(;r<o;r++)e(n[r],r);return n}return[]}function St(){var i=document.scrollingElement;return i||document.documentElement}function j(i,t,e,n,r){if(!(!i.getBoundingClientRect&&i!==window)){var o,s,a,l,c,u,h;if(i!==window&&i.parentNode&&i!==St()?(o=i.getBoundingClientRect(),s=o.top,a=o.left,l=o.bottom,c=o.right,u=o.height,h=o.width):(s=0,a=0,l=window.innerHeight,c=window.innerWidth,u=window.innerHeight,h=window.innerWidth),(t||e)&&i!==window&&(r=r||i.parentNode,!Mt))do if(r&&r.getBoundingClientRect&&(A(r,"transform")!=="none"||e&&A(r,"position")!=="static")){var d=r.getBoundingClientRect();s-=d.top+parseInt(A(r,"border-top-width")),a-=d.left+parseInt(A(r,"border-left-width")),l=s+o.height,c=a+o.width;break}while(r=r.parentNode);if(n&&i!==window){var f=Xt(r||i),p=f&&f.a,m=f&&f.d;f&&(s/=m,a/=p,h/=p,u/=m,l=s+u,c=a+h)}return{top:s,left:a,bottom:l,right:c,width:h,height:u}}}function cs(i,t,e){for(var n=jt(i,!0),r=j(i)[t];n;){var o=j(n)[e],s=void 0;if(e==="top"||e==="left"?s=r>=o:s=r<=o,!s)return n;if(n===St())break;n=jt(n,!1)}return!1}function pe(i,t,e,n){for(var r=0,o=0,s=i.children;o<s.length;){if(s[o].style.display!=="none"&&s[o]!==I.ghost&&(n||s[o]!==I.dragged)&&bt(s[o],e.draggable,i,!1)){if(r===t)return s[o];r++}o++}return null}function jr(i,t){for(var e=i.lastElementChild;e&&(e===I.ghost||A(e,"display")==="none"||t&&!Di(e,t));)e=e.previousElementSibling;return e||null}function J(i,t){var e=0;if(!i||!i.parentNode)return-1;for(;i=i.previousElementSibling;)i.nodeName.toUpperCase()!=="TEMPLATE"&&i!==I.clone&&(!t||Di(i,t))&&e++;return e}function us(i){var t=0,e=0,n=St();if(i)do{var r=Xt(i),o=r.a,s=r.d;t+=i.scrollLeft*o,e+=i.scrollTop*s}while(i!==n&&(i=i.parentNode));return[t,e]}function Eh(i,t){for(var e in i)if(i.hasOwnProperty(e)){for(var n in t)if(t.hasOwnProperty(n)&&t[n]===i[e][n])return Number(e)}return-1}function jt(i,t){if(!i||!i.getBoundingClientRect)return St();var e=i,n=!1;do if(e.clientWidth<e.scrollWidth||e.clientHeight<e.scrollHeight){var r=A(e);if(e.clientWidth<e.scrollWidth&&(r.overflowX=="auto"||r.overflowX=="scroll")||e.clientHeight<e.scrollHeight&&(r.overflowY=="auto"||r.overflowY=="scroll")){if(!e.getBoundingClientRect||e===document.body)return St();if(n||t)return e;n=!0}}while(e=e.parentNode);re
`).map(u=>u.indexOf(`drawio-diagram="${r}"`)!==-1?l:u).join(`
`);L(this,ke,Ln).call(this,c,n),ee()}catch(a){throw this.handleDrawingUploadError(a),new Error(`Failed to save image with error: ${a}`)}})}handleDrawingUploadError(t){t.status===413?window.$events.emit("error",this.editor.config.text.serverUploadLimit):window.$events.emit("error",this.editor.config.text.imageUploadError),console.error(t)}fullScreen(){let{container:t}=this.editor.config,e=t.classList.contains("fullscreen");t.classList.toggle("fullscreen",!e),document.body.classList.toggle("markdown-fullscreen",!e)}scrollToText(t){if(!t)return;let e=this.editor.cm.state.doc,n=1,r=-1;for(let s of e.iterLines()){if(s.includes(t)){r=n;break}n+=1}if(r===-1)return;let o=e.line(r);L(this,In,eu).call(this,o.from,o.to,!0),this.focus()}focus(){this.editor.cm.hasFocus||this.editor.cm.focus()}insertContent(t){L(this,Pt,ie).call(this,t,t.length)}prependContent(t){t=L(this,ni,Ho).call(this,t);let n=L(this,rt,ht).call(this).from+t.length+1;L(this,dt,wt).call(this,0,0,`${t}
`,n),this.focus()}appendContent(t){t=L(this,ni,Ho).call(this,t),L(this,dt,wt).call(this,this.editor.cm.state.doc.length,`
${t}`),this.focus()}replaceContent(t){L(this,ke,Ln).call(this,t)}replaceLineStart(t){let e=L(this,rt,ht).call(this),n=this.editor.cm.state.doc.lineAt(e.from),r=n.text,o=r.split(" ")[0];if(o===t){let c=r.replace(`${t} `,""),u=e.from+(c.length-r.length);L(this,dt,wt).call(this,n.from,n.to,c,u);return}let s=r;/^[#>`]/.test(o)?s=r.replace(o,t).trim():t!==""&&(s=`${t} ${r}`);let l=e.from+(s.length-r.length);L(this,dt,wt).call(this,n.from,n.to,s,l)}wrapSelection(t,e){let n=L(this,rt,ht).call(this),r=L(this,Wt,ye).call(this,n);if(!r){L(this,Ce,Tn).call(this,t,e);return}let o=r,s;r.startsWith(t)&&r.endsWith(e)?(o=r.slice(t.length,r.length-e.length),s=n.extend(n.from,n.to-(t.length+e.length))):(o=`${t}${r}${e}`,s=n.extend(n.from,n.to+(t.length+e.length))),L(this,dt,wt).call(this,n.from,n.to,o,s.anchor,s.head)}replaceLineStartForOrderedList(){let t=L(this,rt,ht).call(this),e=this.editor.cm.state.doc.lineAt(t.from),r=this.editor.cm.state.doc.line(e.number-1).text.match(/^(\s*)(\d)([).])\s/)||[],o=(Number(r[2])||0)+1,s=r[1]||"",a=r[3]||".",l=`${s}${o}${a}`;return this.replaceLineStart(l)}cycleCalloutTypeAtSelection(){let t=L(this,rt,ht).call(this),e=this.editor.cm.state.doc.lineAt(t.from),n=["info","success","warning","danger"],r=n.join("|"),s=new RegExp(`class="((${r})\\s+callout|callout\\s+(${r}))"`,"i").exec(e.text),a=(s?s[2]||s[3]:"").toLowerCase();if(a===n[n.length-1])L(this,Ce,Tn).call(this,`<p class="callout ${n[n.length-1]}">`,"</p>");else if(a==="")L(this,Ce,Tn).call(this,'<p class="callout info">',"</p>");else{let l=n.indexOf(a)+1,c=n[l],u=e.text.replace(s[0],s[0].replace(a,c)),h=u.length-e.text.length;L(this,dt,wt).call(this,e.from,e.to,u,t.anchor+h,t.head+h)}}syncDisplayPosition(t){let e=t.target;if(Math.abs(e.scrollHeight-e.clientHeight-e.scrollTop)<1){this.editor.display.scrollToIndex(-1);return}let r=this.editor.cm.lineBlockAtHeight(e.scrollTop),o=this.editor.cm.state.sliceDoc(0,r.from),l=new DOMParser().parseFromString(this.editor.markdown.render(o),"text/html").documentElement.querySelectorAll("body > *");this.editor.display.scrollToIndex(l.length)}async insertTemplate(t,e,n){let r=this.editor.cm.posAtCoords({x:e,y:n},!1),{data:o}=await window.$http.get(`/templates/${t}`),s=o.markdown||o.html;L(this,dt,wt).call(this,r,r,s,r)}insertClipboardImages(t,e,n){let r=this.editor.cm.posAtCoords({x:e,y:n},!1);for(let o of t)this.uploadImage(o,r)}async uploadImage(t,e=null){if(t===null||t.type.indexOf("image")!==0)return;let n="png";if(e===null&&(e=L(this,rt,ht).call(this).from),t.name){let c=t.name.match(/\.(.+)$/);c.length>1&&(n=c[1])}let r=`image-${Math.random().toString(16).slice(2)}`,s=`![](${window.baseUrl(`/loading.gif#upload${r}`)})`;L(this,dt,wt).call(this,e,e,s,e);let a=`image-${Date.now()}.${n}`,l=new FormData;l.append("file",t,a),l.append("uploaded_to",this.editor.config.pageId);try{let{data:c}=await window.$http.post("/images/gallery",l),u=`[![](${c.thumbs.display})](${c.url})`;L(this,ri,Uo).call(this,s,u)}catch(c){window.$events.error(c?.data?.message||this.editor.config.text.imageUploadError),L(this,ri,Uo).call(this,s,""),console.error(c)}}};ii=new WeakSet,zo=function(t,e){let n=`<div drawio-diagram="${t.id}"><img src="${t.url}"></div>`;L(this,Pt,ie).call(this,n,n.length,e)},xe=new WeakSet,Dn=function(){return this.editor.cm.state.doc.toString()},ke=new WeakSet,Ln=function(t,e=null){e=e||L(this,rt,ht).call(this);let n=this.editor.cm.state.toText(t),r=Math.min(e.from,n.length);L(this,dt,wt).call(this,0,this.editor.cm.state.doc.length,t,r),this.focus()},Pt=new WeakSet,ie=function(t,e=0,n=null){n=n||this.editor.cm.state.selection.main;let r=n.from+e;L(this,dt,wt).call(this,n.from,n.to,t,r),this.focus()},Wt=new WeakSet,ye=function(t=null){return t=t||L(this,rt,ht).call(this),this.editor.cm.state.sliceDoc(t.from,t.to)},rt=new WeakSet,ht=function(){return this.editor.cm.state.selection.main},ni=new WeakSet,Ho=function(t){return t.replace(/\r\n|\r/g,`
`)},ri=new WeakSet,Uo=function(t,e){let n=L(this,xe,Dn).call(this).replace(t,e);L(this,ke,Ln).call(this,n)},Ce=new WeakSet,Tn=function(t,e){let n=L(this,rt,ht).call(this),r=this.editor.cm.state.doc.lineAt(n.from),o=r.text,s,a=0;o.startsWith(t)&&o.endsWith(e)?(s=o.slice(t.length,o.length-e.length),a=-t.length):(s=`${t}${o}${e}`,a=t.length),L(this,dt,wt).call(this,r.from,r.to,s,n.from+a)},dt=new WeakSet,wt=function(t,e=null,n=null,r=null,o=null){let s={changes:{from:t,to:e,insert:n}};r&&(s.selection={anchor:r},o&&(s.selection.head=o)),this.editor.cm.dispatch(s)},In=new WeakSet,eu=function(t,e,n=!1){this.editor.cm.dispatch({selection:{anchor:t,head:e},scrollIntoView:n})};var Mn=class{constructor(t){this.settingMap={scrollSync:!0,showPreview:!0,editorWidth:50},this.changeListeners={},this.loadFromLocalStorage(),this.applyToInputs(t),this.listenToInputChanges(t)}applyToInputs(t){for(let e of t){let n=e.getAttribute("name").replace("md-","");e.checked=this.settingMap[n]}}listenToInputChanges(t){for(let e of t)e.addEventListener("change",()=>{let n=e.getAttribute("name").replace("md-","");this.set(n,e.checked)})}loadFromLocalStorage(){let t=window.localStorage.getItem("md-editor-settings");if(!t)return;let e=JSON.parse(t);for(let[n,r]of Object.entries(e))r!==null&&this.settingMap[n]!==void 0&&(this.settingMap[n]=r)}set(t,e){this.settingMap[t]=e,window.localStorage.setItem("md-editor-settings",JSON.stringify(this.settingMap));for(let n of this.changeListeners[t]||[])n(e)}get(t){return this.settingMap[t]||null}onChange(t,e){let n=this.changeListeners[t]||[];n.push(e),this.changeListeners[t]=n}};function Fn({html:i,markdown:t}){return t||i}function iu(i){window.$events.listen("editor::replace",t=>{let e=Fn(t);i.actions.replaceContent(e)}),window.$events.listen("editor::append",t=>{let e=Fn(t);i.actions.appendContent(e)}),window.$events.listen("editor::prepend",t=>{let e=Fn(t);i.actions.prependContent(e)}),window.$events.listen("editor::insert",t=>{let e=Fn(t);i.actions.insertContent(e)}),window.$events.listen("editor::focus",()=>{i.actions.focus()})}function Gf(i){let t={};return t["Shift-Mod-i"]=()=>i.actions.insertImage(),t["Mod-s"]=()=>window.$events.emit("editor-save-draft"),t["Mod-Enter"]=()=>window.$events.emit("editor-save-page"),t["Shift-Mod-k"]=()=>i.actions.showLinkSelector(),t["Mod-k"]=()=>i.actions.insertLink(),t["Mod-1"]=()=>i.actions.replaceLineStart("##"),t["Mod-2"]=()=>i.actions.replaceLineStart("###"),t["Mod-3"]=()=>i.actions.replaceLineStart("####"),t["Mod-4"]=()=>i.actions.replaceLineStart("#####"),t["Mod-5"]=()=>i.actions.replaceLineStart(""),t["Mod-d"]=()=>i.actions.replaceLineStart(""),t["Mod-6"]=()=>i.actions.replaceLineStart(">"),t["Mod-q"]=()=>i.actions.replaceLineStart(">"),t["Mod-7"]=()=>i.actions.wrapSelection("\n```\n","\n```"),t["Mod-8"]=()=>i.actions.wrapSelection("`","`"),t["Shift-Mod-e"]=()=>i.actions.wrapSelection("`","`"),t["Mod-9"]=()=>i.actions.cycleCalloutTypeAtSelection(),t["Mod-p"]=()=>i.actions.replaceLineStart("-"),t["Mod-o"]=()=>i.actions.replaceLineStartForOrderedList(),t}function nu(i){let t=Gf(i),e=[],n=r=>()=>(r(),!0);for(let[r,o]of Object.entries(t))e.push({key:r,run:n(o),preventDefault:!0});return e}async function ru(i){let t=await window.importVersioned("code");function e(a){a.docChanged&&i.actions.updateAndRender()}let n=Nt(i.actions.syncDisplayPosition.bind(i.actions),100,!1),r=i.settings.get("scrollSync");i.settings.onChange("scrollSync",a=>{r=a});let o={scroll:a=>r&&n(a),drop:a=>{let l=a.dataTransfer.getData("bookstack/template");l&&(a.preventDefault(),i.actions.insertTemplate(l,a.pageX,a.pageY));let u=new Ft(a.dataTransfer).getImages();u.length>0&&(a.stopPropagation(),a.preventDefault(),i.actions.insertClipboardImages(u,a.pageX,a.pageY))},paste:a=>{let l=new Ft(a.clipboardData||a.dataTransfer);if(!l.hasItems()||l.containsTabularData())return;let c=l.getImages();for(let u of c)i.actions.uploadImage(u)}},s=t.markdownEditor(i.config.inputEl,e,o,nu(i));return window.mdEditorView=s,s}async function ou(i){let t={config:i,markdown:new yn,settings:new Mn(i.settingInputs)};return t.ac
`,e.replace(n)}})}function rm(i){i.parser.addNodeFilter("div",t=>{for(let e of t){let n=e.attr("id")||"",r=e.attr("class")||"";(n==="pointer"||r.includes("pointer"))&&e.remove()}})}function fu(i){nm(i),rm(i)}function mu(i){return i.tagName.toLowerCase()==="code-block"}function bu(i,t,e,n){let r=window.$components.first("code-editor"),o=i.selection.getBookmark();r.open(t,e,(s,a)=>{n(s,a),i.focus(),i.selection.moveToBookmark(o)},()=>{i.focus(),i.selection.moveToBookmark(o)})}function gu(i,t){bu(i,t.getContent(),t.getLanguage(),(e,n)=>{t.setContent(e,n)})}function om(i){let t=i.getDoc(),e=t.defaultView;class n extends e.HTMLElement{constructor(){super();at(this,"editor",null);this.attachShadow({mode:"open"});let s=document.head.querySelectorAll('link[rel="stylesheet"]:not([media="print"]),style'),a=Array.from(s).map(c=>c.cloneNode(!0)),l=document.createElement("div");l.style.pointerEvents="none",l.contentEditable="false",l.classList.add("CodeMirrorContainer"),l.classList.toggle("dark-mode",document.documentElement.classList.contains("dark-mode")),this.shadowRoot.append(...a,l)}getLanguage(){let s=c=>(c.split(" ").filter(h=>h.startsWith("language-"))[0]||"").replace("language-",""),a=this.querySelector("code"),l=this.querySelector("pre");return s(l.className)||a&&s(a.className)||""}setContent(s,a){this.editor&&(this.editor.setContent(s),this.editor.setMode(a,s));let l=this.querySelector("pre");l||(l=t.createElement("pre"),this.append(l)),l.innerHTML="";let c=t.createElement("code");l.append(c),c.innerText=s,c.className=`language-${a}`}getContent(){let s=this.querySelector("code")||this.querySelector("pre"),a=document.createElement("pre");a.innerHTML=s.innerHTML.replace(/\ufeff/g,"");let l=a.querySelectorAll("br");for(let c of l)c.replaceWith(`
`);return a.textContent}connectedCallback(){let s=Date.now();if(this.editor)return;this.cleanChildContent();let a=this.getContent(),c=a.split(`
`).length*19.2+18+24;this.style.height=`${c}px`;let u=this.shadowRoot.querySelector(".CodeMirrorContainer"),h=d=>{this.editor=d.wysiwygView(u,this.shadowRoot,a,this.getLanguage()),setTimeout(()=>{this.style.height=null},12)};window.importVersioned("code").then(d=>{let f=Date.now()-s<20?20:0;setTimeout(()=>h(d),f)})}cleanChildContent(){let s=this.querySelector("pre");if(s)for(let a of s.childNodes)a.nodeName==="#text"&&a.textContent==="\uFEFF"&&a.remove()}}e.customElements.define("code-block",n)}function sm(i){i.ui.registry.addIcon("codeblock",'<svg width="24" height="24"><path d="M4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 0 1-1-1V4c0-.6.4-1 1-1Zm1 2v14h14V5Z"/><path d="M11.103 15.423c.277.277.277.738 0 .922a.692.692 0 0 1-1.106 0l-4.057-3.78a.738.738 0 0 1 0-1.107l4.057-3.872c.276-.277.83-.277 1.106 0a.724.724 0 0 1 0 1.014L7.6 12.012ZM12.897 8.577c-.245-.312-.2-.675.08-.955.28-.281.727-.27 1.027.033l4.057 3.78a.738.738 0 0 1 0 1.107l-4.057 3.872c-.277.277-.83.277-1.107 0a.724.724 0 0 1 0-1.014l3.504-3.412z"/></svg>'),i.ui.registry.addButton("codeeditor",{tooltip:"Insert code block",icon:"codeblock",onAction(){i.execCommand("codeeditor")}}),i.ui.registry.addButton("editcodeeditor",{tooltip:"Edit code block",icon:"edit-block",onAction(){i.execCommand("codeeditor")}}),i.addCommand("codeeditor",()=>{let t=i.selection.getNode(),e=t.ownerDocument;if(mu(t))gu(i,t);else{let n=i.selection.getContent({format:"text"});bu(i,n,"",(r,o)=>{let s=e.createElement("pre"),a=e.createElement("code");a.classList.add(`language-${o}`),a.innerText=r,s.append(a),i.insertContent(s.outerHTML)})}}),i.on("dblclick",()=>{let t=i.selection.getNode();mu(t)&&gu(i,t)}),i.on("PreInit",()=>{i.parser.addNodeFilter("pre",t=>{for(let e of t){let n=window.tinymce.html.Node.create("code-block",{contenteditable:"false"}),r=e.attr("dir");r&&n.attr("dir",r);let o=e.getAll("span");for(let s of o)s.unwrap();e.attr("style",null),e.wrap(n)}}),i.parser.addNodeFilter("code-block",t=>{for(let e of t)e.attr("contenteditable","false")}),i.serializer.addNodeFilter("code-block",t=>{for(let e of t){let n=e.attr("dir");n&&e.firstChild?e.firstChild.attr("dir",n):e.firstChild&&e.firstChild.attr("dir",null),e.unwrap()}})}),i.ui.registry.addContextToolbar("codeeditor",{predicate(t){return t.nodeName.toLowerCase()==="code-block"},items:"editcodeeditor",position:"node",scope:"node"}),i.on("PreInit",()=>{om(i)})}function vu(){return sm}var pt=null,oe=null,re={};function jo(i){return i.hasAttribute("drawio-diagram")}function am(i,t=null){pt=i,oe=t,window.$components.first("image-manager").show(n=>{if(t){let r=t.querySelector("img");pt.undoManager.transact(()=>{pt.dom.setAttrib(r,"src",n.url),pt.dom.setAttrib(t,"drawio-diagram",n.id)})}else{let r=`<div drawio-diagram="${n.id}" contenteditable="false"><img src="${n.url}"></div>`;pt.insertContent(r)}},"drawio")}async function lm(i){let t=window.baseUrl("/loading.gif"),e=o=>{o.status===413?window.$events.emit("error",re.translations.serverUploadLimitText):window.$events.emit("error",re.translations.imageUploadErrorText),console.error(o)};if(oe){ee();let o=oe.querySelector("img");try{let s=await No(i,re.pageId);pt.undoManager.transact(()=>{pt.dom.setAttrib(o,"src",s.url),pt.dom.setAttrib(oe,"drawio-diagram",s.id)})}catch(s){throw e(s),new Error(`Failed to save image with error: ${s}`)}return}await os(5);let n=`drawing-${Math.random().toString(16).slice(2)}`,r=`drawing-wrap-${Math.random().toString(16).slice(2)}`;pt.insertContent(`<div drawio-diagram contenteditable="false" id="${r}"><img src="${t}" id="${n}"></div>`),ee();try{let o=await No(i,re.pageId);pt.undoManager.transact(()=>{pt.dom.setAttrib(n,"src",o.url),pt.dom.setAttrib(r,"drawio-diagram",o.id)})}catch(o){throw pt.dom.remove(r),e(o),new Error(`Failed to save image with error: ${o}`)}}function cm(){if(!oe)return Promise.resolve("");let i=oe.getAttribute("drawio-diagram");return An(i)}function wu(i,t=null){pt=i,oe=t,ei(re.drawioUrl,cm,lm)}function um(i){i.addCommand("drawio",()=>{let t=i.selection.getNode();wu(i,jo(t)?t:null)}),i.ui.registry.addIcon("diagram",`<svg width="24"
`),e=t.findIndex(s=>s.trim()==="<!-- Start: custom user content -->"),n=t.findIndex(s=>s.trim()==="<!-- End: custom user content -->");if(e===-1||n===-1)return;let r=t.slice(e+1,n).join(`
`),o=i.createElement("div");o.innerHTML=r,i.head.append(...o.children)}function $m(i){return function(e){function n(){i.darkMode&&e.contentDocument.documentElement.classList.add("dark-mode"),window.$events.emit("editor-html-change","")}e.on("ExecCommand change input NodeChange ObjectResized",n),au(e),uu(e,i),e.on("init",()=>{n(),lu(e),window.editor=e,su(e)}),e.on("PreInit",()=>{fu(e)}),Lu(e),$u(e),Iu(e),window.$events.emitPublic(i.containerElement,"editor-tinymce::setup",{editor:e}),e.ui.registry.addButton("inlinecode",{tooltip:"Inline code",icon:"sourcecode",onAction(){e.execCommand("mceToggleFormat",!1,"code")}})}}function qu(i){return`
html, body, html.dark-mode {
background: ${i.darkMode?"#222":"#fff"};
}
body {
padding-left: 15px !important;
padding-right: 15px !important;
height: initial !important;
margin:0!important;
margin-left: auto! important;
margin-right: auto !important;
overflow-y: hidden !important;
}`.trim().replace(`
`,"")}function Bu(i){return window.tinymce.addI18n(i.language,i.translationMap),{width:"100%",height:"100%",selector:"#html-editor",cache_suffix:`?version=${document.querySelector('script[src*="/dist/app.js"]').getAttribute("src").split("?version=")[1]}`,content_css:[window.baseUrl("/dist/styles.css")],branding:!1,skin:i.darkMode?"tinymce-5-dark":"tinymce-5",body_class:"page-content",browser_spellcheck:!0,relative_urls:!1,language:i.language,directionality:i.textDirection,remove_script_host:!1,document_base_url:window.baseUrl("/"),end_container_on_empty_block:!0,remove_trailing_brs:!1,statusbar:!1,menubar:!1,paste_data_images:!1,extended_valid_elements:"pre[*],svg[*],div[drawio-diagram],details[*],summary[*],div[*],li[class|checked|style]",automatic_uploads:!1,custom_elements:"doc-root,code-block",valid_children:["-div[p|h1|h2|h3|h4|h5|h6|blockquote|code-block]","+div[pre|img]","-doc-root[doc-root|#text]","-li[details]","+code-block[pre]","+doc-root[p|h1|h2|h3|h4|h5|h6|blockquote|code-block|div|hr]"].join(","),plugins:Tm(i),contextmenu:!1,toolbar:hu(i),content_style:qu(i),style_formats:Am,style_formats_merge:!1,media_alt_source:!1,media_poster:!1,formats:Dm,table_style_by_css:!0,table_use_colgroups:!0,file_picker_types:"file image",color_map:Lm,file_picker_callback:Mu,paste_preprocess(e,n){let{content:r}=n;r.indexOf('<img src="file://')!==-1&&(n.content="")},init_instance_callback(e){Fu(e.getDoc())},setup(e){pu(e),du(e),$m(i)(e)}}}function Ee(i){window.tinymce.addI18n(i.language,i.translationMap);let t=document.querySelector('script[src*="/dist/app.js"]').getAttribute("src").split("?version=")[1];return{width:"100%",height:"185px",target:i.containerElement,cache_suffix:`?version=${t}`,content_css:[window.baseUrl("/dist/styles.css")],branding:!1,skin:i.darkMode?"tinymce-5-dark":"tinymce-5",body_class:"wysiwyg-input",browser_spellcheck:!0,relative_urls:!1,language:i.language,directionality:i.textDirection,remove_script_host:!1,document_base_url:window.baseUrl("/"),end_container_on_empty_block:!0,remove_trailing_brs:!1,statusbar:!1,menubar:!1,plugins:"link autolink lists",contextmenu:!1,toolbar:"bold italic link bullist numlist",content_style:qu(i),file_picker_types:"file",valid_elements:"p,a[href|title|target],ol,ul,li,strong,em,br",file_picker_callback:Mu,init_instance_callback(e){Fu(e.getDoc()),e.contentDocument.documentElement.classList.toggle("dark-mode",i.darkMode)}}}var zn=class extends g{setup(){this.commentId=this.$opts.commentId,this.commentLocalId=this.$opts.commentLocalId,this.commentParentId=this.$opts.commentParentId,this.deletedText=this.$opts.deletedText,this.updatedText=this.$opts.updatedText,this.wysiwygEditor=null,this.wysiwygLanguage=this.$opts.wysiwygLanguage,this.wysiwygTextDirection=this.$opts.wysiwygTextDirection,this.container=this.$el,this.contentContainer=this.$refs.contentContainer,this.form=this.$refs.form,this.formCancel=this.$refs.formCancel,this.editButton=this.$refs.editButton,this.deleteButton=this.$refs.deleteButton,this.replyButton=this.$refs.replyButton,this.input=this.$refs.input,this.setupListeners()}setupListeners(){this.replyButton&&this.replyButton.addEventListener("click",()=>this.$emit("reply",{id:this.commentLocalId,element:this.container})),this.editButton&&(this.editButton.addEventListener("click",this.startEdit.bind(this)),this.form.addEventListener("submit",this.update.bind(this)),this.formCancel.addEventListener("click",()=>this.toggleEditMode(!1))),this.deleteButton&&this.deleteButton.addEventListener("click",this.delete.bind(this))}toggleEditMode(t){this.contentContainer.toggleAttribute("hidden",t),this.form.toggleAttribute("hidden",!t)}startEdit(){if(this.toggleEditMode(!0),this.wysiwygEditor){this.wysiwygEditor.focus();return}let t=Ee({language:this.wysiwygLanguage,containerElement:this.input,darkMode:document.documentElement.classList.contains("dark-mode"),textDirection:this.wysiwygTextDirection,translations:{},translationMap:window.editor_translations});window.tinymce.init(t).then(e=>{this.wysiwygEditor=e[0],setTimeout(()=>this.wysiwygEditor.focus(),50)})}async update
/*! Bundled license information:
sortablejs/modular/sortable.esm.js:
(**!
* Sortable 1.15.2
* @author RubaXa <trash@rubaxa.org>
* @author owenm <owen23355@gmail.com>
* @license MIT
*)
*/
//# sourceMappingURL=app.js.map