diff --git a/resources/dist/filament-tiptap-editor.js b/resources/dist/filament-tiptap-editor.js index 966831a3..c7c1bbf5 100644 --- a/resources/dist/filament-tiptap-editor.js +++ b/resources/dist/filament-tiptap-editor.js @@ -116,19 +116,19 @@ img.ProseMirror-separator { `)),s.setMeta("paste",!0),t.dispatch(s),!0}}})]}});var _h={exports:{}};function Sh(t){return t instanceof Map?t.clear=t.delete=t.set=function(){throw new Error("map is read-only")}:t instanceof Set&&(t.add=t.clear=t.delete=function(){throw new Error("set is read-only")}),Object.freeze(t),Object.getOwnPropertyNames(t).forEach(function(e){var n=t[e];typeof n=="object"&&!Object.isFrozen(n)&&Sh(n)}),t}_h.exports=Sh;_h.exports.default=Sh;var jc=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function Ew(t){return t.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function xi(t,...e){let n=Object.create(null);for(let r in t)n[r]=t[r];return e.forEach(function(r){for(let i in r)n[i]=r[i]}),n}var BP="",dw=t=>!!t.scope||t.sublanguage&&t.language,FP=(t,{prefix:e})=>{if(t.includes(".")){let n=t.split(".");return[`${e}${n.shift()}`,...n.map((r,i)=>`${r}${"_".repeat(i+1)}`)].join(" ")}return`${e}${t}`},Eh=class{constructor(e,n){this.buffer="",this.classPrefix=n.classPrefix,e.walk(this)}addText(e){this.buffer+=Ew(e)}openNode(e){if(!dw(e))return;let n="";e.sublanguage?n=`language-${e.language}`:n=FP(e.scope,{prefix:this.classPrefix}),this.span(n)}closeNode(e){dw(e)&&(this.buffer+=BP)}value(){return this.buffer}span(e){this.buffer+=``}},fw=(t={})=>{let e={children:[]};return Object.assign(e,t),e},vh=class t{constructor(){this.rootNode=fw(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){let n=fw({scope:e});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,n){return typeof n=="string"?e.addText(n):n.children&&(e.openNode(n),n.children.forEach(r=>this._walk(e,r)),e.closeNode(n)),e}static _collapse(e){typeof e!="string"&&e.children&&(e.children.every(n=>typeof n=="string")?e.children=[e.children.join("")]:e.children.forEach(n=>{t._collapse(n)}))}},wh=class extends vh{constructor(e){super(),this.options=e}addKeyword(e,n){e!==""&&(this.openNode(n),this.addText(e),this.closeNode())}addText(e){e!==""&&this.add(e)}addSublanguage(e,n){let r=e.root;r.sublanguage=!0,r.language=n,this.add(r)}toHTML(){return new Eh(this,this.options).value()}finalize(){return!0}};function oa(t){return t?typeof t=="string"?t:t.source:null}function vw(t){return so("(?=",t,")")}function HP(t){return so("(?:",t,")*")}function zP(t){return so("(?:",t,")?")}function so(...t){return t.map(n=>oa(n)).join("")}function UP(t){let e=t[t.length-1];return typeof e=="object"&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}function Th(...t){return"("+(UP(t).capture?"":"?:")+t.map(r=>oa(r)).join("|")+")"}function ww(t){return new RegExp(t.toString()+"|").exec("").length-1}function $P(t,e){let n=t&&t.exec(e);return n&&n.index===0}var WP=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Mh(t,{joinWith:e}){let n=0;return t.map(r=>{n+=1;let i=n,o=oa(r),s="";for(;o.length>0;){let l=WP.exec(o);if(!l){s+=o;break}s+=o.substring(0,l.index),o=o.substring(l.index+l[0].length),l[0][0]==="\\"&&l[1]?s+="\\"+String(Number(l[1])+i):(s+=l[0],l[0]==="("&&n++)}return s}).map(r=>`(${r})`).join(e)}var KP=/\b\B/,xw="[a-zA-Z]\\w*",Ch="[a-zA-Z_]\\w*",_w="\\b\\d+(\\.\\d+)?",Sw="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Tw="\\b(0b[01]+)",VP="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",GP=(t={})=>{let e=/^#![ ]*\//;return t.binary&&(t.begin=so(e,/.*\b/,t.binary,/\b.*/)),xi({scope:"meta",begin:e,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},t)},sa={begin:"\\\\[\\s\\S]",relevance:0},qP={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[sa]},YP={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[sa]},JP={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},eu=function(t,e,n={}){let r=xi({scope:"comment",begin:t,end:e,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let i=Th("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:so(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},XP=eu("//","$"),ZP=eu("/\\*","\\*/"),jP=eu("#","$"),QP={scope:"number",begin:_w,relevance:0},eB={scope:"number",begin:Sw,relevance:0},tB={scope:"number",begin:Tw,relevance:0},nB={begin:/(?=\/[^/\n]*\/)/,contains:[{scope:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[sa,{begin:/\[/,end:/\]/,relevance:0,contains:[sa]}]}]},rB={scope:"title",begin:xw,relevance:0},iB={scope:"title",begin:Ch,relevance:0},oB={begin:"\\.\\s*"+Ch,relevance:0},sB=function(t){return Object.assign(t,{"on:begin":(e,n)=>{n.data._beginMatch=e[1]},"on:end":(e,n)=>{n.data._beginMatch!==e[1]&&n.ignoreMatch()}})},Zc=Object.freeze({__proto__:null,MATCH_NOTHING_RE:KP,IDENT_RE:xw,UNDERSCORE_IDENT_RE:Ch,NUMBER_RE:_w,C_NUMBER_RE:Sw,BINARY_NUMBER_RE:Tw,RE_STARTERS_RE:VP,SHEBANG:GP,BACKSLASH_ESCAPE:sa,APOS_STRING_MODE:qP,QUOTE_STRING_MODE:YP,PHRASAL_WORDS_MODE:JP,COMMENT:eu,C_LINE_COMMENT_MODE:XP,C_BLOCK_COMMENT_MODE:ZP,HASH_COMMENT_MODE:jP,NUMBER_MODE:QP,C_NUMBER_MODE:eB,BINARY_NUMBER_MODE:tB,REGEXP_MODE:nB,TITLE_MODE:rB,UNDERSCORE_TITLE_MODE:iB,METHOD_GUARD:oB,END_SAME_AS_BEGIN:sB});function aB(t,e){t.input[t.index-1]==="."&&e.ignoreMatch()}function lB(t,e){t.className!==void 0&&(t.scope=t.className,delete t.className)}function cB(t,e){e&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=aB,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0))}function uB(t,e){Array.isArray(t.illegal)&&(t.illegal=Th(...t.illegal))}function dB(t,e){if(t.match){if(t.begin||t.end)throw new Error("begin & end are not supported with match");t.begin=t.match,delete t.match}}function fB(t,e){t.relevance===void 0&&(t.relevance=1)}var pB=(t,e)=>{if(!t.beforeMatch)return;if(t.starts)throw new Error("beforeMatch cannot be used with starts");let n=Object.assign({},t);Object.keys(t).forEach(r=>{delete t[r]}),t.keywords=n.keywords,t.begin=so(n.beforeMatch,vw(n.begin)),t.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},t.relevance=0,delete n.beforeMatch},hB=["of","and","for","in","not","or","if","then","parent","list","value"],mB="keyword";function Mw(t,e,n=mB){let r=Object.create(null);return typeof t=="string"?i(n,t.split(" ")):Array.isArray(t)?i(n,t):Object.keys(t).forEach(function(o){Object.assign(r,Mw(t[o],e,o))}),r;function i(o,s){e&&(s=s.map(l=>l.toLowerCase())),s.forEach(function(l){let u=l.split("|");r[u[0]]=[o,gB(u[0],u[1])]})}}function gB(t,e){return e?Number(e):bB(t)?0:1}function bB(t){return hB.includes(t.toLowerCase())}var pw={},oo=t=>{console.error(t)},hw=(t,...e)=>{console.log(`WARN: ${t}`,...e)},jo=(t,e)=>{pw[`${t}/${e}`]||(console.log(`Deprecated as of ${t}. ${e}`),pw[`${t}/${e}`]=!0)},Qc=new Error;function Cw(t,e,{key:n}){let r=0,i=t[n],o={},s={};for(let l=1;l<=e.length;l++)s[l+r]=i[l],o[l+r]=!0,r+=ww(e[l-1]);t[n]=s,t[n]._emit=o,t[n]._multi=!0}function yB(t){if(Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw oo("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Qc;if(typeof t.beginScope!="object"||t.beginScope===null)throw oo("beginScope must be object"),Qc;Cw(t,t.begin,{key:"beginScope"}),t.begin=Mh(t.begin,{joinWith:""})}}function EB(t){if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw oo("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Qc;if(typeof t.endScope!="object"||t.endScope===null)throw oo("endScope must be object"),Qc;Cw(t,t.end,{key:"endScope"}),t.end=Mh(t.end,{joinWith:""})}}function vB(t){t.scope&&typeof t.scope=="object"&&t.scope!==null&&(t.beginScope=t.scope,delete t.scope)}function wB(t){vB(t),typeof t.beginScope=="string"&&(t.beginScope={_wrap:t.beginScope}),typeof t.endScope=="string"&&(t.endScope={_wrap:t.endScope}),yB(t),EB(t)}function xB(t){function e(s,l){return new RegExp(oa(s),"m"+(t.case_insensitive?"i":"")+(t.unicodeRegex?"u":"")+(l?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(l,u){u.position=this.position++,this.matchIndexes[this.matchAt]=u,this.regexes.push([u,l]),this.matchAt+=ww(l)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let l=this.regexes.map(u=>u[1]);this.matcherRe=e(Mh(l,{joinWith:"|"}),!0),this.lastIndex=0}exec(l){this.matcherRe.lastIndex=this.lastIndex;let u=this.matcherRe.exec(l);if(!u)return null;let d=u.findIndex((h,m)=>m>0&&h!==void 0),f=this.matchIndexes[d];return u.splice(0,d),Object.assign(u,f)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(l){if(this.multiRegexes[l])return this.multiRegexes[l];let u=new n;return this.rules.slice(l).forEach(([d,f])=>u.addRule(d,f)),u.compile(),this.multiRegexes[l]=u,u}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(l,u){this.rules.push([l,u]),u.type==="begin"&&this.count++}exec(l){let u=this.getMatcher(this.regexIndex);u.lastIndex=this.lastIndex;let d=u.exec(l);if(this.resumingScanAtSamePosition()&&!(d&&d.index===this.lastIndex)){let f=this.getMatcher(0);f.lastIndex=this.lastIndex+1,d=f.exec(l)}return d&&(this.regexIndex+=d.position+1,this.regexIndex===this.count&&this.considerAll()),d}}function i(s){let l=new r;return s.contains.forEach(u=>l.addRule(u.begin,{rule:u,type:"begin"})),s.terminatorEnd&&l.addRule(s.terminatorEnd,{type:"end"}),s.illegal&&l.addRule(s.illegal,{type:"illegal"}),l}function o(s,l){let u=s;if(s.isCompiled)return u;[lB,dB,wB,pB].forEach(f=>f(s,l)),t.compilerExtensions.forEach(f=>f(s,l)),s.__beforeBegin=null,[cB,uB,fB].forEach(f=>f(s,l)),s.isCompiled=!0;let d=null;return typeof s.keywords=="object"&&s.keywords.$pattern&&(s.keywords=Object.assign({},s.keywords),d=s.keywords.$pattern,delete s.keywords.$pattern),d=d||/\w+/,s.keywords&&(s.keywords=Mw(s.keywords,t.case_insensitive)),u.keywordPatternRe=e(d,!0),l&&(s.begin||(s.begin=/\B|\b/),u.beginRe=e(u.begin),!s.end&&!s.endsWithParent&&(s.end=/\B|\b/),s.end&&(u.endRe=e(u.end)),u.terminatorEnd=oa(u.end)||"",s.endsWithParent&&l.terminatorEnd&&(u.terminatorEnd+=(s.end?"|":"")+l.terminatorEnd)),s.illegal&&(u.illegalRe=e(s.illegal)),s.contains||(s.contains=[]),s.contains=[].concat(...s.contains.map(function(f){return _B(f==="self"?s:f)})),s.contains.forEach(function(f){o(f,u)}),s.starts&&o(s.starts,l),u.matcher=i(u),u}if(t.compilerExtensions||(t.compilerExtensions=[]),t.contains&&t.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return t.classNameAliases=xi(t.classNameAliases||{}),o(t)}function Aw(t){return t?t.endsWithParent||Aw(t.starts):!1}function _B(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(e){return xi(t,{variants:null},e)})),t.cachedVariants?t.cachedVariants:Aw(t)?xi(t,{starts:t.starts?xi(t.starts):null}):Object.isFrozen(t)?xi(t):t}var SB="11.6.0",xh=class extends Error{constructor(e,n){super(e),this.name="HTMLInjectionError",this.html=n}},yh=Ew,mw=xi,gw=Symbol("nomatch"),TB=7,MB=function(t){let e=Object.create(null),n=Object.create(null),r=[],i=!0,o="Could not find the language '{}', did you forget to load/include a language module?",s={disableAutodetect:!0,name:"Plain text",contains:[]},l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:wh};function u(P){return l.noHighlightRe.test(P)}function d(P){let N=P.className+" ";N+=P.parentNode?P.parentNode.className:"";let R=l.languageDetectRe.exec(N);if(R){let K=W(R[1]);return K||(hw(o.replace("{}",R[1])),hw("Falling back to no-highlight mode for this block.",P)),K?R[1]:"no-highlight"}return N.split(/\s+/).find(K=>u(K)||W(K))}function f(P,N,R){let K="",te="";typeof N=="object"?(K=P,R=N.ignoreIllegals,te=N.language):(jo("10.7.0","highlight(lang, code, ...args) has been deprecated."),jo("10.7.0",`Please use highlight(code, options) instead. https://github.com/highlightjs/highlight.js/issues/2277`),te=P,K=N),R===void 0&&(R=!0);let pe={code:K,language:te};we("before:highlight",pe);let Ce=pe.result?pe.result:h(pe.language,pe.code,R);return Ce.code=pe.code,we("after:highlight",Ce),Ce}function h(P,N,R,K){let te=Object.create(null);function pe(X,re){return X.keywords[re]}function Ce(){if(!me.keywords){ee.addText(Ae);return}let X=0;me.keywordPatternRe.lastIndex=0;let re=me.keywordPatternRe.exec(Ae),H="";for(;re;){H+=Ae.substring(X,re.index);let Y=St.case_insensitive?re[0].toLowerCase():re[0],le=pe(me,Y);if(le){let[Me,ct]=le;if(ee.addText(H),H="",te[Y]=(te[Y]||0)+1,te[Y]<=TB&&(We+=ct),Me.startsWith("_"))H+=re[0];else{let Vt=St.classNameAliases[Me]||Me;ee.addKeyword(re[0],Vt)}}else H+=re[0];X=me.keywordPatternRe.lastIndex,re=me.keywordPatternRe.exec(Ae)}H+=Ae.substring(X),ee.addText(H)}function Ue(){if(Ae==="")return;let X=null;if(typeof me.subLanguage=="string"){if(!e[me.subLanguage]){ee.addText(Ae);return}X=h(me.subLanguage,Ae,!0,Kt[me.subLanguage]),Kt[me.subLanguage]=X._top}else X=b(Ae,me.subLanguage.length?me.subLanguage:null);me.relevance>0&&(We+=X.relevance),ee.addSublanguage(X._emitter,X.language)}function $e(){me.subLanguage!=null?Ue():Ce(),Ae=""}function He(X,re){let H=1,Y=re.length-1;for(;H<=Y;){if(!X._emit[H]){H++;continue}let le=St.classNameAliases[X[H]]||X[H],Me=re[H];le?ee.addKeyword(Me,le):(Ae=Me,Ce(),Ae=""),H++}}function Je(X,re){return X.scope&&typeof X.scope=="string"&&ee.openNode(St.classNameAliases[X.scope]||X.scope),X.beginScope&&(X.beginScope._wrap?(ee.addKeyword(Ae,St.classNameAliases[X.beginScope._wrap]||X.beginScope._wrap),Ae=""):X.beginScope._multi&&(He(X.beginScope,re),Ae="")),me=Object.create(X,{parent:{value:me}}),me}function xt(X,re,H){let Y=$P(X.endRe,H);if(Y){if(X["on:end"]){let le=new jc(X);X["on:end"](re,le),le.isMatchIgnored&&(Y=!1)}if(Y){for(;X.endsParent&&X.parent;)X=X.parent;return X}}if(X.endsWithParent)return xt(X.parent,re,H)}function Pt(X){return me.matcher.regexIndex===0?(Ae+=X[0],1):(Ot=!0,0)}function De(X){let re=X[0],H=X.rule,Y=new jc(H),le=[H.__beforeBegin,H["on:begin"]];for(let Me of le)if(Me&&(Me(X,Y),Y.isMatchIgnored))return Pt(re);return H.skip?Ae+=re:(H.excludeBegin&&(Ae+=re),$e(),!H.returnBegin&&!H.excludeBegin&&(Ae=re)),Je(H,X),H.returnBegin?0:re.length}function _t(X){let re=X[0],H=N.substring(X.index),Y=xt(me,X,H);if(!Y)return gw;let le=me;me.endScope&&me.endScope._wrap?($e(),ee.addKeyword(re,me.endScope._wrap)):me.endScope&&me.endScope._multi?($e(),He(me.endScope,X)):le.skip?Ae+=re:(le.returnEnd||le.excludeEnd||(Ae+=re),$e(),le.excludeEnd&&(Ae=re));do me.scope&&ee.closeNode(),!me.skip&&!me.subLanguage&&(We+=me.relevance),me=me.parent;while(me!==Y.parent);return Y.starts&&Je(Y.starts,X),le.returnEnd?0:re.length}function Xt(){let X=[];for(let re=me;re!==St;re=re.parent)re.scope&&X.unshift(re.scope);X.forEach(re=>ee.openNode(re))}let st={};function Zt(X,re){let H=re&&re[0];if(Ae+=X,H==null)return $e(),0;if(st.type==="begin"&&re.type==="end"&&st.index===re.index&&H===""){if(Ae+=N.slice(re.index,re.index+1),!i){let Y=new Error(`0 width match regex (${P})`);throw Y.languageName=P,Y.badRule=st.rule,Y}return 1}if(st=re,re.type==="begin")return De(re);if(re.type==="illegal"&&!R){let Y=new Error('Illegal lexeme "'+H+'" for mode "'+(me.scope||"")+'"');throw Y.mode=me,Y}else if(re.type==="end"){let Y=_t(re);if(Y!==gw)return Y}if(re.type==="illegal"&&H==="")return 1;if(mt>1e5&&mt>re.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Ae+=H,H.length}let St=W(P);if(!St)throw oo(o.replace("{}",P)),new Error('Unknown language: "'+P+'"');let Nt=xB(St),ft="",me=K||Nt,Kt={},ee=new l.__emitter(l);Xt();let Ae="",We=0,Oe=0,mt=0,Ot=!1;try{for(me.matcher.considerAll();;){mt++,Ot?Ot=!1:me.matcher.considerAll(),me.matcher.lastIndex=Oe;let X=me.matcher.exec(N);if(!X)break;let re=N.substring(Oe,X.index),H=Zt(re,X);Oe=X.index+H}return Zt(N.substring(Oe)),ee.closeAllNodes(),ee.finalize(),ft=ee.toHTML(),{language:P,value:ft,relevance:We,illegal:!1,_emitter:ee,_top:me}}catch(X){if(X.message&&X.message.includes("Illegal"))return{language:P,value:yh(N),illegal:!0,relevance:0,_illegalBy:{message:X.message,index:Oe,context:N.slice(Oe-100,Oe+100),mode:X.mode,resultSoFar:ft},_emitter:ee};if(i)return{language:P,value:yh(N),illegal:!1,relevance:0,errorRaised:X,_emitter:ee,_top:me};throw X}}function m(P){let N={value:yh(P),illegal:!1,relevance:0,_top:s,_emitter:new l.__emitter(l)};return N._emitter.addText(P),N}function b(P,N){N=N||l.languages||Object.keys(e);let R=m(P),K=N.filter(W).filter(ye).map($e=>h($e,P,!1));K.unshift(R);let te=K.sort(($e,He)=>{if($e.relevance!==He.relevance)return He.relevance-$e.relevance;if($e.language&&He.language){if(W($e.language).supersetOf===He.language)return 1;if(W(He.language).supersetOf===$e.language)return-1}return 0}),[pe,Ce]=te,Ue=pe;return Ue.secondBest=Ce,Ue}function y(P,N,R){let K=N&&n[N]||R;P.classList.add("hljs"),P.classList.add(`language-${K}`)}function w(P){let N=null,R=d(P);if(u(R))return;if(we("before:highlightElement",{el:P,language:R}),P.children.length>0&&(l.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(P)),l.throwUnescapedHTML))throw new xh("One of your code blocks includes unescaped HTML.",P.innerHTML);N=P;let K=N.textContent,te=R?f(K,{language:R,ignoreIllegals:!0}):b(K);P.innerHTML=te.value,y(P,R,te.language),P.result={language:te.language,re:te.relevance,relevance:te.relevance},te.secondBest&&(P.secondBest={language:te.secondBest.language,relevance:te.secondBest.relevance}),we("after:highlightElement",{el:P,result:te,text:K})}function x(P){l=mw(l,P)}let M=()=>{S(),jo("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function L(){S(),jo("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let D=!1;function S(){if(document.readyState==="loading"){D=!0;return}document.querySelectorAll(l.cssSelector).forEach(w)}function z(){D&&S()}typeof window<"u"&&window.addEventListener&&window.addEventListener("DOMContentLoaded",z,!1);function O(P,N){let R=null;try{R=N(t)}catch(K){if(oo("Language definition for '{}' could not be registered.".replace("{}",P)),i)oo(K);else throw K;R=s}R.name||(R.name=P),e[P]=R,R.rawDefinition=N.bind(null,t),R.aliases&&ue(R.aliases,{languageName:P})}function q(P){delete e[P];for(let N of Object.keys(n))n[N]===P&&delete n[N]}function J(){return Object.keys(e)}function W(P){return P=(P||"").toLowerCase(),e[P]||e[n[P]]}function ue(P,{languageName:N}){typeof P=="string"&&(P=[P]),P.forEach(R=>{n[R.toLowerCase()]=N})}function ye(P){let N=W(P);return N&&!N.disableAutodetect}function Te(P){P["before:highlightBlock"]&&!P["before:highlightElement"]&&(P["before:highlightElement"]=N=>{P["before:highlightBlock"](Object.assign({block:N.el},N))}),P["after:highlightBlock"]&&!P["after:highlightElement"]&&(P["after:highlightElement"]=N=>{P["after:highlightBlock"](Object.assign({block:N.el},N))})}function ge(P){Te(P),r.push(P)}function we(P,N){let R=P;r.forEach(function(K){K[R]&&K[R](N)})}function xe(P){return jo("10.7.0","highlightBlock will be removed entirely in v12.0"),jo("10.7.0","Please use highlightElement now."),w(P)}Object.assign(t,{highlight:f,highlightAuto:b,highlightAll:S,highlightElement:w,highlightBlock:xe,configure:x,initHighlighting:M,initHighlightingOnLoad:L,registerLanguage:O,unregisterLanguage:q,listLanguages:J,getLanguage:W,registerAliases:ue,autoDetection:ye,inherit:mw,addPlugin:ge}),t.debugMode=function(){i=!1},t.safeMode=function(){i=!0},t.versionString=SB,t.regex={concat:so,lookahead:vw,either:Th,optional:zP,anyNumberOfTimes:HP};for(let P in Zc)typeof Zc[P]=="object"&&_h.exports(Zc[P]);return Object.assign(t,Zc),t},aa=MB({}),CB=aa;aa.HighlightJS=aa;aa.default=aa;var AB=CB;function kw(t,e=[]){return t.map(n=>{let r=[...e,...n.properties?n.properties.className:[]];return n.children?kw(n.children,r):{text:n.value,classes:r}}).flat()}function bw(t){return t.value||t.children||[]}function kB(t){return!!AB.getLanguage(t)}function yw({doc:t,name:e,lowlight:n,defaultLanguage:r}){let i=[];return eo(t,o=>o.type.name===e).forEach(o=>{let s=o.pos+1,l=o.node.attrs.language||r,u=n.listLanguages(),d=l&&(u.includes(l)||kB(l))?bw(n.highlight(l,o.node.textContent)):bw(n.highlightAuto(o.node.textContent));kw(d).forEach(f=>{let h=s+f.text.length;if(f.classes.length){let m=Mt.inline(s,h,{class:f.classes.join(" ")});i.push(m)}s=h})}),lt.create(t,i)}function NB(t){return typeof t=="function"}function OB({name:t,lowlight:e,defaultLanguage:n}){if(!["highlight","highlightAuto","listLanguages"].every(i=>NB(e[i])))throw Error("You should provide an instance of lowlight to use the code-block-lowlight extension");let r=new Pe({key:new qe("lowlight"),state:{init:(i,{doc:o})=>yw({doc:o,name:t,lowlight:e,defaultLanguage:n}),apply:(i,o,s,l)=>{let u=s.selection.$head.parent.type.name,d=l.selection.$head.parent.type.name,f=eo(s.doc,m=>m.type.name===t),h=eo(l.doc,m=>m.type.name===t);return i.docChanged&&([u,d].includes(t)||h.length!==f.length||i.steps.some(m=>m.from!==void 0&&m.to!==void 0&&f.some(b=>b.pos>=m.from&&b.pos+b.node.nodeSize<=m.to)))?yw({doc:i.doc,name:t,lowlight:e,defaultLanguage:n}):o.map(i.mapping,i.doc)}},props:{decorations(i){return r.getState(i)}}});return r}var Nw=uw.extend({addOptions(){var t;return{...(t=this.parent)===null||t===void 0?void 0:t.call(this),lowlight:{},defaultLanguage:null}},addProseMirrorPlugins(){var t;return[...((t=this.parent)===null||t===void 0?void 0:t.call(this))||[],OB({name:this.name,lowlight:this.options.lowlight,defaultLanguage:this.options.defaultLanguage})]}});var Ah=Nw.extend({addKeyboardShortcuts(){return{...this.parent?.(),ArrowDown:()=>{let t=this.editor.state,{from:e,to:n}=t.selection;if(e>1&&e===n){let r=!1;t.doc.nodesBetween(e-1,n-1,o=>{o.type.name==="codeBlock"&&(r=!0)});let i=!0;if(t.doc.nodesBetween(e+1,n+1,o=>{o&&(i=!1)}),r&&i)return this.editor.commands.setHardBreak()}return!1}}}});var kh=se.create({name:"hurdle",group:"block",content:"block+",addOptions(){return{colors:["gray_light","gray","gray_dark","primary","secondary","tertiary","accent"],HTMLAttributes:{class:"filament-tiptap-hurdle"}}},addAttributes(){return{color:{default:"gray",parseHTML:t=>t.getAttribute("data-color"),renderHTML:t=>({"data-color":t.color})}}},parseHTML(){return[{tag:"div",getAttrs:t=>t.classList.contains("filament-tiptap-hurdle")}]},renderHTML({node:t,HTMLAttributes:e}){return["div",j(this.options.HTMLAttributes,e),0]},addCommands(){return{setHurdle:t=>({commands:e})=>this.options.colors.includes(t.color)?e.toggleWrap(this.name,t):!1}}});var Nh=Qe.create({name:"textAlign",addOptions(){return{types:[],alignments:["start","center","end","justify"],defaultAlignment:"start"}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:t=>t.style.textAlign||this.options.defaultAlignment,renderHTML:t=>t.textAlign===this.options.defaultAlignment?{}:{style:`text-align: ${t.textAlign}`}}}}]},addCommands(){return{setTextAlign:t=>({commands:e})=>this.options.alignments.includes(t)?this.options.types.every(n=>e.updateAttributes(n,{textAlign:t})):!1,unsetTextAlign:()=>({commands:t})=>this.options.types.every(e=>t.resetAttributes(e,"textAlign"))}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("start"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("end"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}});var yt="top",Dt="bottom",At="right",wt="left",tu="auto",_i=[yt,Dt,At,wt],Wr="start",ao="end",Ow="clippingParents",nu="viewport",Qo="popper",Rw="reference",Oh=_i.reduce(function(t,e){return t.concat([e+"-"+Wr,e+"-"+ao])},[]),ru=[].concat(_i,[tu]).reduce(function(t,e){return t.concat([e,e+"-"+Wr,e+"-"+ao])},[]),RB="beforeRead",IB="read",DB="afterRead",LB="beforeMain",PB="main",BB="afterMain",FB="beforeWrite",HB="write",zB="afterWrite",Iw=[RB,IB,DB,LB,PB,BB,FB,HB,zB];function $t(t){return t?(t.nodeName||"").toLowerCase():null}function dt(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function qn(t){var e=dt(t).Element;return t instanceof e||t instanceof Element}function Lt(t){var e=dt(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function es(t){if(typeof ShadowRoot>"u")return!1;var e=dt(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function UB(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var r=e.styles[n]||{},i=e.attributes[n]||{},o=e.elements[n];!Lt(o)||!$t(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(s){var l=i[s];l===!1?o.removeAttribute(s):o.setAttribute(s,l===!0?"":l)}))})}function $B(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(r){var i=e.elements[r],o=e.attributes[r]||{},s=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),l=s.reduce(function(u,d){return u[d]="",u},{});!Lt(i)||!$t(i)||(Object.assign(i.style,l),Object.keys(o).forEach(function(u){i.removeAttribute(u)}))})}}var la={name:"applyStyles",enabled:!0,phase:"write",fn:UB,effect:$B,requires:["computeStyles"]};function Wt(t){return t.split("-")[0]}var sr=Math.max,lo=Math.min,Kr=Math.round;function ts(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function ca(){return!/^((?!chrome|android).)*safari/i.test(ts())}function Yn(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),i=1,o=1;e&&Lt(t)&&(i=t.offsetWidth>0&&Kr(r.width)/t.offsetWidth||1,o=t.offsetHeight>0&&Kr(r.height)/t.offsetHeight||1);var s=qn(t)?dt(t):window,l=s.visualViewport,u=!ca()&&n,d=(r.left+(u&&l?l.offsetLeft:0))/i,f=(r.top+(u&&l?l.offsetTop:0))/o,h=r.width/i,m=r.height/o;return{width:h,height:m,top:f,right:d+h,bottom:f+m,left:d,x:d,y:f}}function co(t){var e=Yn(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function ua(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&es(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function gn(t){return dt(t).getComputedStyle(t)}function Rh(t){return["table","td","th"].indexOf($t(t))>=0}function Jt(t){return((qn(t)?t.ownerDocument:t.document)||window.document).documentElement}function Vr(t){return $t(t)==="html"?t:t.assignedSlot||t.parentNode||(es(t)?t.host:null)||Jt(t)}function Dw(t){return!Lt(t)||gn(t).position==="fixed"?null:t.offsetParent}function WB(t){var e=/firefox/i.test(ts()),n=/Trident/i.test(ts());if(n&&Lt(t)){var r=gn(t);if(r.position==="fixed")return null}var i=Vr(t);for(es(i)&&(i=i.host);Lt(i)&&["html","body"].indexOf($t(i))<0;){var o=gn(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||e&&o.willChange==="filter"||e&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function ar(t){for(var e=dt(t),n=Dw(t);n&&Rh(n)&&gn(n).position==="static";)n=Dw(n);return n&&($t(n)==="html"||$t(n)==="body"&&gn(n).position==="static")?e:n||WB(t)||e}function uo(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function fo(t,e,n){return sr(t,lo(e,n))}function Lw(t,e,n){var r=fo(t,e,n);return r>n?n:r}function da(){return{top:0,right:0,bottom:0,left:0}}function fa(t){return Object.assign({},da(),t)}function pa(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var KB=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,fa(typeof e!="number"?e:pa(e,_i))};function VB(t){var e,n=t.state,r=t.name,i=t.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,l=Wt(n.placement),u=uo(l),d=[wt,At].indexOf(l)>=0,f=d?"height":"width";if(!(!o||!s)){var h=KB(i.padding,n),m=co(o),b=u==="y"?yt:wt,y=u==="y"?Dt:At,w=n.rects.reference[f]+n.rects.reference[u]-s[u]-n.rects.popper[f],x=s[u]-n.rects.reference[u],M=ar(o),L=M?u==="y"?M.clientHeight||0:M.clientWidth||0:0,D=w/2-x/2,S=h[b],z=L-m[f]-h[y],O=L/2-m[f]/2+D,q=fo(S,O,z),J=u;n.modifiersData[r]=(e={},e[J]=q,e.centerOffset=q-O,e)}}function GB(t){var e=t.state,n=t.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=e.elements.popper.querySelector(i),!i)||ua(e.elements.popper,i)&&(e.elements.arrow=i))}var Pw={name:"arrow",enabled:!0,phase:"main",fn:VB,effect:GB,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Jn(t){return t.split("-")[1]}var qB={top:"auto",right:"auto",bottom:"auto",left:"auto"};function YB(t,e){var n=t.x,r=t.y,i=e.devicePixelRatio||1;return{x:Kr(n*i)/i||0,y:Kr(r*i)/i||0}}function Bw(t){var e,n=t.popper,r=t.popperRect,i=t.placement,o=t.variation,s=t.offsets,l=t.position,u=t.gpuAcceleration,d=t.adaptive,f=t.roundOffsets,h=t.isFixed,m=s.x,b=m===void 0?0:m,y=s.y,w=y===void 0?0:y,x=typeof f=="function"?f({x:b,y:w}):{x:b,y:w};b=x.x,w=x.y;var M=s.hasOwnProperty("x"),L=s.hasOwnProperty("y"),D=wt,S=yt,z=window;if(d){var O=ar(n),q="clientHeight",J="clientWidth";if(O===dt(n)&&(O=Jt(n),gn(O).position!=="static"&&l==="absolute"&&(q="scrollHeight",J="scrollWidth")),O=O,i===yt||(i===wt||i===At)&&o===ao){S=Dt;var W=h&&O===z&&z.visualViewport?z.visualViewport.height:O[q];w-=W-r.height,w*=u?1:-1}if(i===wt||(i===yt||i===Dt)&&o===ao){D=At;var ue=h&&O===z&&z.visualViewport?z.visualViewport.width:O[J];b-=ue-r.width,b*=u?1:-1}}var ye=Object.assign({position:l},d&&qB),Te=f===!0?YB({x:b,y:w},dt(n)):{x:b,y:w};if(b=Te.x,w=Te.y,u){var ge;return Object.assign({},ye,(ge={},ge[S]=L?"0":"",ge[D]=M?"0":"",ge.transform=(z.devicePixelRatio||1)<=1?"translate("+b+"px, "+w+"px)":"translate3d("+b+"px, "+w+"px, 0)",ge))}return Object.assign({},ye,(e={},e[S]=L?w+"px":"",e[D]=M?b+"px":"",e.transform="",e))}function JB(t){var e=t.state,n=t.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,s=o===void 0?!0:o,l=n.roundOffsets,u=l===void 0?!0:l,d={placement:Wt(e.placement),variation:Jn(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,Bw(Object.assign({},d,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:u})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,Bw(Object.assign({},d,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}var Fw={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:JB,data:{}};var iu={passive:!0};function XB(t){var e=t.state,n=t.instance,r=t.options,i=r.scroll,o=i===void 0?!0:i,s=r.resize,l=s===void 0?!0:s,u=dt(e.elements.popper),d=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&d.forEach(function(f){f.addEventListener("scroll",n.update,iu)}),l&&u.addEventListener("resize",n.update,iu),function(){o&&d.forEach(function(f){f.removeEventListener("scroll",n.update,iu)}),l&&u.removeEventListener("resize",n.update,iu)}}var Hw={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:XB,data:{}};var ZB={left:"right",right:"left",bottom:"top",top:"bottom"};function ns(t){return t.replace(/left|right|bottom|top/g,function(e){return ZB[e]})}var jB={start:"end",end:"start"};function ou(t){return t.replace(/start|end/g,function(e){return jB[e]})}function po(t){var e=dt(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function ho(t){return Yn(Jt(t)).left+po(t).scrollLeft}function Ih(t,e){var n=dt(t),r=Jt(t),i=n.visualViewport,o=r.clientWidth,s=r.clientHeight,l=0,u=0;if(i){o=i.width,s=i.height;var d=ca();(d||!d&&e==="fixed")&&(l=i.offsetLeft,u=i.offsetTop)}return{width:o,height:s,x:l+ho(t),y:u}}function Dh(t){var e,n=Jt(t),r=po(t),i=(e=t.ownerDocument)==null?void 0:e.body,o=sr(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=sr(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),l=-r.scrollLeft+ho(t),u=-r.scrollTop;return gn(i||n).direction==="rtl"&&(l+=sr(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:l,y:u}}function mo(t){var e=gn(t),n=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function su(t){return["html","body","#document"].indexOf($t(t))>=0?t.ownerDocument.body:Lt(t)&&mo(t)?t:su(Vr(t))}function Si(t,e){var n;e===void 0&&(e=[]);var r=su(t),i=r===((n=t.ownerDocument)==null?void 0:n.body),o=dt(r),s=i?[o].concat(o.visualViewport||[],mo(r)?r:[]):r,l=e.concat(s);return i?l:l.concat(Si(Vr(s)))}function rs(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function QB(t,e){var n=Yn(t,!1,e==="fixed");return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}function zw(t,e,n){return e===nu?rs(Ih(t,n)):qn(e)?QB(e,n):rs(Dh(Jt(t)))}function e2(t){var e=Si(Vr(t)),n=["absolute","fixed"].indexOf(gn(t).position)>=0,r=n&&Lt(t)?ar(t):t;return qn(r)?e.filter(function(i){return qn(i)&&ua(i,r)&&$t(i)!=="body"}):[]}function Lh(t,e,n,r){var i=e==="clippingParents"?e2(t):[].concat(e),o=[].concat(i,[n]),s=o[0],l=o.reduce(function(u,d){var f=zw(t,d,r);return u.top=sr(f.top,u.top),u.right=lo(f.right,u.right),u.bottom=lo(f.bottom,u.bottom),u.left=sr(f.left,u.left),u},zw(t,s,r));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function ha(t){var e=t.reference,n=t.element,r=t.placement,i=r?Wt(r):null,o=r?Jn(r):null,s=e.x+e.width/2-n.width/2,l=e.y+e.height/2-n.height/2,u;switch(i){case yt:u={x:s,y:e.y-n.height};break;case Dt:u={x:s,y:e.y+e.height};break;case At:u={x:e.x+e.width,y:l};break;case wt:u={x:e.x-n.width,y:l};break;default:u={x:e.x,y:e.y}}var d=i?uo(i):null;if(d!=null){var f=d==="y"?"height":"width";switch(o){case Wr:u[d]=u[d]-(e[f]/2-n[f]/2);break;case ao:u[d]=u[d]+(e[f]/2-n[f]/2);break;default:}}return u}function lr(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=r===void 0?t.placement:r,o=n.strategy,s=o===void 0?t.strategy:o,l=n.boundary,u=l===void 0?Ow:l,d=n.rootBoundary,f=d===void 0?nu:d,h=n.elementContext,m=h===void 0?Qo:h,b=n.altBoundary,y=b===void 0?!1:b,w=n.padding,x=w===void 0?0:w,M=fa(typeof x!="number"?x:pa(x,_i)),L=m===Qo?Rw:Qo,D=t.rects.popper,S=t.elements[y?L:m],z=Lh(qn(S)?S:S.contextElement||Jt(t.elements.popper),u,f,s),O=Yn(t.elements.reference),q=ha({reference:O,element:D,strategy:"absolute",placement:i}),J=rs(Object.assign({},D,q)),W=m===Qo?J:O,ue={top:z.top-W.top+M.top,bottom:W.bottom-z.bottom+M.bottom,left:z.left-W.left+M.left,right:W.right-z.right+M.right},ye=t.modifiersData.offset;if(m===Qo&&ye){var Te=ye[i];Object.keys(ue).forEach(function(ge){var we=[At,Dt].indexOf(ge)>=0?1:-1,xe=[yt,Dt].indexOf(ge)>=0?"y":"x";ue[ge]+=Te[xe]*we})}return ue}function Ph(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=n.boundary,o=n.rootBoundary,s=n.padding,l=n.flipVariations,u=n.allowedAutoPlacements,d=u===void 0?ru:u,f=Jn(r),h=f?l?Oh:Oh.filter(function(y){return Jn(y)===f}):_i,m=h.filter(function(y){return d.indexOf(y)>=0});m.length===0&&(m=h);var b=m.reduce(function(y,w){return y[w]=lr(t,{placement:w,boundary:i,rootBoundary:o,padding:s})[Wt(w)],y},{});return Object.keys(b).sort(function(y,w){return b[y]-b[w]})}function t2(t){if(Wt(t)===tu)return[];var e=ns(t);return[ou(t),e,ou(e)]}function n2(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,l=s===void 0?!0:s,u=n.fallbackPlacements,d=n.padding,f=n.boundary,h=n.rootBoundary,m=n.altBoundary,b=n.flipVariations,y=b===void 0?!0:b,w=n.allowedAutoPlacements,x=e.options.placement,M=Wt(x),L=M===x,D=u||(L||!y?[ns(x)]:t2(x)),S=[x].concat(D).reduce(function($e,He){return $e.concat(Wt(He)===tu?Ph(e,{placement:He,boundary:f,rootBoundary:h,padding:d,flipVariations:y,allowedAutoPlacements:w}):He)},[]),z=e.rects.reference,O=e.rects.popper,q=new Map,J=!0,W=S[0],ue=0;ue=0,xe=we?"width":"height",P=lr(e,{placement:ye,boundary:f,rootBoundary:h,altBoundary:m,padding:d}),N=we?ge?At:wt:ge?Dt:yt;z[xe]>O[xe]&&(N=ns(N));var R=ns(N),K=[];if(o&&K.push(P[Te]<=0),l&&K.push(P[N]<=0,P[R]<=0),K.every(function($e){return $e})){W=ye,J=!1;break}q.set(ye,K)}if(J)for(var te=y?3:1,pe=function(He){var Je=S.find(function(xt){var Pt=q.get(xt);if(Pt)return Pt.slice(0,He).every(function(De){return De})});if(Je)return W=Je,"break"},Ce=te;Ce>0;Ce--){var Ue=pe(Ce);if(Ue==="break")break}e.placement!==W&&(e.modifiersData[r]._skip=!0,e.placement=W,e.reset=!0)}}var Uw={name:"flip",enabled:!0,phase:"main",fn:n2,requiresIfExists:["offset"],data:{_skip:!1}};function $w(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function Ww(t){return[yt,At,Dt,wt].some(function(e){return t[e]>=0})}function r2(t){var e=t.state,n=t.name,r=e.rects.reference,i=e.rects.popper,o=e.modifiersData.preventOverflow,s=lr(e,{elementContext:"reference"}),l=lr(e,{altBoundary:!0}),u=$w(s,r),d=$w(l,i,o),f=Ww(u),h=Ww(d);e.modifiersData[n]={referenceClippingOffsets:u,popperEscapeOffsets:d,isReferenceHidden:f,hasPopperEscaped:h},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":f,"data-popper-escaped":h})}var Kw={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:r2};function i2(t,e,n){var r=Wt(t),i=[wt,yt].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,s=o[0],l=o[1];return s=s||0,l=(l||0)*i,[wt,At].indexOf(r)>=0?{x:l,y:s}:{x:s,y:l}}function o2(t){var e=t.state,n=t.options,r=t.name,i=n.offset,o=i===void 0?[0,0]:i,s=ru.reduce(function(f,h){return f[h]=i2(h,e.rects,o),f},{}),l=s[e.placement],u=l.x,d=l.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=u,e.modifiersData.popperOffsets.y+=d),e.modifiersData[r]=s}var Vw={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:o2};function s2(t){var e=t.state,n=t.name;e.modifiersData[n]=ha({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}var Gw={name:"popperOffsets",enabled:!0,phase:"read",fn:s2,data:{}};function Bh(t){return t==="x"?"y":"x"}function a2(t){var e=t.state,n=t.options,r=t.name,i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,l=s===void 0?!1:s,u=n.boundary,d=n.rootBoundary,f=n.altBoundary,h=n.padding,m=n.tether,b=m===void 0?!0:m,y=n.tetherOffset,w=y===void 0?0:y,x=lr(e,{boundary:u,rootBoundary:d,padding:h,altBoundary:f}),M=Wt(e.placement),L=Jn(e.placement),D=!L,S=uo(M),z=Bh(S),O=e.modifiersData.popperOffsets,q=e.rects.reference,J=e.rects.popper,W=typeof w=="function"?w(Object.assign({},e.rects,{placement:e.placement})):w,ue=typeof W=="number"?{mainAxis:W,altAxis:W}:Object.assign({mainAxis:0,altAxis:0},W),ye=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,Te={x:0,y:0};if(O){if(o){var ge,we=S==="y"?yt:wt,xe=S==="y"?Dt:At,P=S==="y"?"height":"width",N=O[S],R=N+x[we],K=N-x[xe],te=b?-J[P]/2:0,pe=L===Wr?q[P]:J[P],Ce=L===Wr?-J[P]:-q[P],Ue=e.elements.arrow,$e=b&&Ue?co(Ue):{width:0,height:0},He=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:da(),Je=He[we],xt=He[xe],Pt=fo(0,q[P],$e[P]),De=D?q[P]/2-te-Pt-Je-ue.mainAxis:pe-Pt-Je-ue.mainAxis,_t=D?-q[P]/2+te+Pt+xt+ue.mainAxis:Ce+Pt+xt+ue.mainAxis,Xt=e.elements.arrow&&ar(e.elements.arrow),st=Xt?S==="y"?Xt.clientTop||0:Xt.clientLeft||0:0,Zt=(ge=ye?.[S])!=null?ge:0,St=N+De-Zt-st,Nt=N+_t-Zt,ft=fo(b?lo(R,St):R,N,b?sr(K,Nt):K);O[S]=ft,Te[S]=ft-N}if(l){var me,Kt=S==="x"?yt:wt,ee=S==="x"?Dt:At,Ae=O[z],We=z==="y"?"height":"width",Oe=Ae+x[Kt],mt=Ae-x[ee],Ot=[yt,wt].indexOf(M)!==-1,X=(me=ye?.[z])!=null?me:0,re=Ot?Oe:Ae-q[We]-J[We]-X+ue.altAxis,H=Ot?Ae+q[We]+J[We]-X-ue.altAxis:mt,Y=b&&Ot?Lw(re,Ae,H):fo(b?re:Oe,Ae,b?H:mt);O[z]=Y,Te[z]=Y-Ae}e.modifiersData[r]=Te}}var qw={name:"preventOverflow",enabled:!0,phase:"main",fn:a2,requiresIfExists:["offset"]};function Fh(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function Hh(t){return t===dt(t)||!Lt(t)?po(t):Fh(t)}function l2(t){var e=t.getBoundingClientRect(),n=Kr(e.width)/t.offsetWidth||1,r=Kr(e.height)/t.offsetHeight||1;return n!==1||r!==1}function zh(t,e,n){n===void 0&&(n=!1);var r=Lt(e),i=Lt(e)&&l2(e),o=Jt(e),s=Yn(t,i,n),l={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(r||!r&&!n)&&(($t(e)!=="body"||mo(o))&&(l=Hh(e)),Lt(e)?(u=Yn(e,!0),u.x+=e.clientLeft,u.y+=e.clientTop):o&&(u.x=ho(o))),{x:s.left+l.scrollLeft-u.x,y:s.top+l.scrollTop-u.y,width:s.width,height:s.height}}function c2(t){var e=new Map,n=new Set,r=[];t.forEach(function(o){e.set(o.name,o)});function i(o){n.add(o.name);var s=[].concat(o.requires||[],o.requiresIfExists||[]);s.forEach(function(l){if(!n.has(l)){var u=e.get(l);u&&i(u)}}),r.push(o)}return t.forEach(function(o){n.has(o.name)||i(o)}),r}function Uh(t){var e=c2(t);return Iw.reduce(function(n,r){return n.concat(e.filter(function(i){return i.phase===r}))},[])}function $h(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function Wh(t){var e=t.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(e).map(function(n){return e[n]})}var Yw={placement:"bottom",modifiers:[],strategy:"absolute"};function Jw(){for(var t=arguments.length,e=new Array(t),n=0;n-1}function ux(t,e){return typeof t=="function"?t.apply(void 0,e):t}function Zw(t,e){if(e===0)return t;var n;return function(r){clearTimeout(n),n=setTimeout(function(){t(r)},e)}}function p2(t){return t.split(/\s+/).filter(Boolean)}function is(t){return[].concat(t)}function jw(t,e){t.indexOf(e)===-1&&t.push(e)}function h2(t){return t.filter(function(e,n){return t.indexOf(e)===n})}function m2(t){return t.split("-")[0]}function lu(t){return[].slice.call(t)}function Qw(t){return Object.keys(t).reduce(function(e,n){return t[n]!==void 0&&(e[n]=t[n]),e},{})}function ma(){return document.createElement("div")}function cu(t){return["Element","Fragment"].some(function(e){return Zh(t,e)})}function g2(t){return Zh(t,"NodeList")}function b2(t){return Zh(t,"MouseEvent")}function y2(t){return!!(t&&t._tippy&&t._tippy.reference===t)}function E2(t){return cu(t)?[t]:g2(t)?lu(t):Array.isArray(t)?t:lu(document.querySelectorAll(t))}function Gh(t,e){t.forEach(function(n){n&&(n.style.transitionDuration=e+"ms")})}function ex(t,e){t.forEach(function(n){n&&n.setAttribute("data-state",e)})}function v2(t){var e,n=is(t),r=n[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function w2(t,e){var n=e.clientX,r=e.clientY;return t.every(function(i){var o=i.popperRect,s=i.popperState,l=i.props,u=l.interactiveBorder,d=m2(s.placement),f=s.modifiersData.offset;if(!f)return!0;var h=d==="bottom"?f.top.y:0,m=d==="top"?f.bottom.y:0,b=d==="right"?f.left.x:0,y=d==="left"?f.right.x:0,w=o.top-r+h>u,x=r-o.bottom-m>u,M=o.left-n+b>u,L=n-o.right-y>u;return w||x||M||L})}function qh(t,e,n){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){t[r](i,n)})}function tx(t,e){for(var n=e;n;){var r;if(t.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var xr={isTouch:!1},nx=0;function x2(){xr.isTouch||(xr.isTouch=!0,window.performance&&document.addEventListener("mousemove",dx))}function dx(){var t=performance.now();t-nx<20&&(xr.isTouch=!1,document.removeEventListener("mousemove",dx)),nx=t}function _2(){var t=document.activeElement;if(y2(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function S2(){document.addEventListener("touchstart",x2,go),window.addEventListener("blur",_2)}var T2=typeof window<"u"&&typeof document<"u",M2=T2?!!window.msCrypto:!1;var C2={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},A2={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},cr=Object.assign({appendTo:cx,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},C2,A2),k2=Object.keys(cr),N2=function(e){var n=Object.keys(e);n.forEach(function(r){cr[r]=e[r]})};function fx(t){var e=t.plugins||[],n=e.reduce(function(r,i){var o=i.name,s=i.defaultValue;if(o){var l;r[o]=t[o]!==void 0?t[o]:(l=cr[o])!=null?l:s}return r},{});return Object.assign({},t,n)}function O2(t,e){var n=e?Object.keys(fx(Object.assign({},cr,{plugins:e}))):k2,r=n.reduce(function(i,o){var s=(t.getAttribute("data-tippy-"+o)||"").trim();if(!s)return i;if(o==="content")i[o]=s;else try{i[o]=JSON.parse(s)}catch{i[o]=s}return i},{});return r}function rx(t,e){var n=Object.assign({},e,{content:ux(e.content,[t])},e.ignoreAttributes?{}:O2(t,e.plugins));return n.aria=Object.assign({},cr.aria,n.aria),n.aria={expanded:n.aria.expanded==="auto"?e.interactive:n.aria.expanded,content:n.aria.content==="auto"?e.interactive?null:"describedby":n.aria.content},n}var R2=function(){return"innerHTML"};function Jh(t,e){t[R2()]=e}function ix(t){var e=ma();return t===!0?e.className=ax:(e.className=lx,cu(t)?e.appendChild(t):Jh(e,t)),e}function ox(t,e){cu(e.content)?(Jh(t,""),t.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?Jh(t,e.content):t.textContent=e.content)}function Xh(t){var e=t.firstElementChild,n=lu(e.children);return{box:e,content:n.find(function(r){return r.classList.contains(sx)}),arrow:n.find(function(r){return r.classList.contains(ax)||r.classList.contains(lx)}),backdrop:n.find(function(r){return r.classList.contains(f2)})}}function px(t){var e=ma(),n=ma();n.className=d2,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=ma();r.className=sx,r.setAttribute("data-state","hidden"),ox(r,t.props),e.appendChild(n),n.appendChild(r),i(t.props,t.props);function i(o,s){var l=Xh(e),u=l.box,d=l.content,f=l.arrow;s.theme?u.setAttribute("data-theme",s.theme):u.removeAttribute("data-theme"),typeof s.animation=="string"?u.setAttribute("data-animation",s.animation):u.removeAttribute("data-animation"),s.inertia?u.setAttribute("data-inertia",""):u.removeAttribute("data-inertia"),u.style.maxWidth=typeof s.maxWidth=="number"?s.maxWidth+"px":s.maxWidth,s.role?u.setAttribute("role",s.role):u.removeAttribute("role"),(o.content!==s.content||o.allowHTML!==s.allowHTML)&&ox(d,t.props),s.arrow?f?o.arrow!==s.arrow&&(u.removeChild(f),u.appendChild(ix(s.arrow))):u.appendChild(ix(s.arrow)):f&&u.removeChild(f)}return{popper:e,onUpdate:i}}px.$$tippy=!0;var I2=1,au=[],Yh=[];function D2(t,e){var n=rx(t,Object.assign({},cr,fx(Qw(e)))),r,i,o,s=!1,l=!1,u=!1,d=!1,f,h,m,b=[],y=Zw(St,n.interactiveDebounce),w,x=I2++,M=null,L=h2(n.plugins),D={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},S={id:x,reference:t,popper:ma(),popperInstance:M,props:n,state:D,plugins:L,clearDelayTimeouts:re,setProps:H,setContent:Y,show:le,hide:Me,hideWithInteractivity:ct,enable:Ot,disable:X,unmount:Vt,destroy:Ci};if(!n.render)return S;var z=n.render(S),O=z.popper,q=z.onUpdate;O.setAttribute("data-tippy-root",""),O.id="tippy-"+S.id,S.popper=O,t._tippy=S,O._tippy=S;var J=L.map(function(B){return B.fn(S)}),W=t.hasAttribute("aria-expanded");return Xt(),te(),N(),R("onCreate",[S]),n.showOnCreate&&Oe(),O.addEventListener("mouseenter",function(){S.props.interactive&&S.state.isVisible&&S.clearDelayTimeouts()}),O.addEventListener("mouseleave",function(){S.props.interactive&&S.props.trigger.indexOf("mouseenter")>=0&&we().addEventListener("mousemove",y)}),S;function ue(){var B=S.props.touch;return Array.isArray(B)?B:[B,0]}function ye(){return ue()[0]==="hold"}function Te(){var B;return!!((B=S.props.render)!=null&&B.$$tippy)}function ge(){return w||t}function we(){var B=ge().parentNode;return B?v2(B):document}function xe(){return Xh(O)}function P(B){return S.state.isMounted&&!S.state.isVisible||xr.isTouch||f&&f.type==="focus"?0:Vh(S.props.delay,B?0:1,cr.delay)}function N(B){B===void 0&&(B=!1),O.style.pointerEvents=S.props.interactive&&!B?"":"none",O.style.zIndex=""+S.props.zIndex}function R(B,ae,_e){if(_e===void 0&&(_e=!0),J.forEach(function(Ve){Ve[B]&&Ve[B].apply(Ve,ae)}),_e){var Xe;(Xe=S.props)[B].apply(Xe,ae)}}function K(){var B=S.props.aria;if(B.content){var ae="aria-"+B.content,_e=O.id,Xe=is(S.props.triggerTarget||t);Xe.forEach(function(Ve){var Bt=Ve.getAttribute(ae);if(S.state.isVisible)Ve.setAttribute(ae,Bt?Bt+" "+_e:_e);else{var sn=Bt&&Bt.replace(_e,"").trim();sn?Ve.setAttribute(ae,sn):Ve.removeAttribute(ae)}})}}function te(){if(!(W||!S.props.aria.expanded)){var B=is(S.props.triggerTarget||t);B.forEach(function(ae){S.props.interactive?ae.setAttribute("aria-expanded",S.state.isVisible&&ae===ge()?"true":"false"):ae.removeAttribute("aria-expanded")})}}function pe(){we().removeEventListener("mousemove",y),au=au.filter(function(B){return B!==y})}function Ce(B){if(!(xr.isTouch&&(u||B.type==="mousedown"))){var ae=B.composedPath&&B.composedPath()[0]||B.target;if(!(S.props.interactive&&tx(O,ae))){if(is(S.props.triggerTarget||t).some(function(_e){return tx(_e,ae)})){if(xr.isTouch||S.state.isVisible&&S.props.trigger.indexOf("click")>=0)return}else R("onClickOutside",[S,B]);S.props.hideOnClick===!0&&(S.clearDelayTimeouts(),S.hide(),l=!0,setTimeout(function(){l=!1}),S.state.isMounted||Je())}}}function Ue(){u=!0}function $e(){u=!1}function He(){var B=we();B.addEventListener("mousedown",Ce,!0),B.addEventListener("touchend",Ce,go),B.addEventListener("touchstart",$e,go),B.addEventListener("touchmove",Ue,go)}function Je(){var B=we();B.removeEventListener("mousedown",Ce,!0),B.removeEventListener("touchend",Ce,go),B.removeEventListener("touchstart",$e,go),B.removeEventListener("touchmove",Ue,go)}function xt(B,ae){De(B,function(){!S.state.isVisible&&O.parentNode&&O.parentNode.contains(O)&&ae()})}function Pt(B,ae){De(B,ae)}function De(B,ae){var _e=xe().box;function Xe(Ve){Ve.target===_e&&(qh(_e,"remove",Xe),ae())}if(B===0)return ae();qh(_e,"remove",h),qh(_e,"add",Xe),h=Xe}function _t(B,ae,_e){_e===void 0&&(_e=!1);var Xe=is(S.props.triggerTarget||t);Xe.forEach(function(Ve){Ve.addEventListener(B,ae,_e),b.push({node:Ve,eventType:B,handler:ae,options:_e})})}function Xt(){ye()&&(_t("touchstart",Zt,{passive:!0}),_t("touchend",Nt,{passive:!0})),p2(S.props.trigger).forEach(function(B){if(B!=="manual")switch(_t(B,Zt),B){case"mouseenter":_t("mouseleave",Nt);break;case"focus":_t(M2?"focusout":"blur",ft);break;case"focusin":_t("focusout",ft);break}})}function st(){b.forEach(function(B){var ae=B.node,_e=B.eventType,Xe=B.handler,Ve=B.options;ae.removeEventListener(_e,Xe,Ve)}),b=[]}function Zt(B){var ae,_e=!1;if(!(!S.state.isEnabled||me(B)||l)){var Xe=((ae=f)==null?void 0:ae.type)==="focus";f=B,w=B.currentTarget,te(),!S.state.isVisible&&b2(B)&&au.forEach(function(Ve){return Ve(B)}),B.type==="click"&&(S.props.trigger.indexOf("mouseenter")<0||s)&&S.props.hideOnClick!==!1&&S.state.isVisible?_e=!0:Oe(B),B.type==="click"&&(s=!_e),_e&&!Xe&&mt(B)}}function St(B){var ae=B.target,_e=ge().contains(ae)||O.contains(ae);if(!(B.type==="mousemove"&&_e)){var Xe=We().concat(O).map(function(Ve){var Bt,sn=Ve._tippy,qr=(Bt=sn.popperInstance)==null?void 0:Bt.state;return qr?{popperRect:Ve.getBoundingClientRect(),popperState:qr,props:n}:null}).filter(Boolean);w2(Xe,B)&&(pe(),mt(B))}}function Nt(B){var ae=me(B)||S.props.trigger.indexOf("click")>=0&&s;if(!ae){if(S.props.interactive){S.hideWithInteractivity(B);return}mt(B)}}function ft(B){S.props.trigger.indexOf("focusin")<0&&B.target!==ge()||S.props.interactive&&B.relatedTarget&&O.contains(B.relatedTarget)||mt(B)}function me(B){return xr.isTouch?ye()!==B.type.indexOf("touch")>=0:!1}function Kt(){ee();var B=S.props,ae=B.popperOptions,_e=B.placement,Xe=B.offset,Ve=B.getReferenceClientRect,Bt=B.moveTransition,sn=Te()?Xh(O).arrow:null,qr=Ve?{getBoundingClientRect:Ve,contextElement:Ve.contextElement||ge()}:t,_a={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(Ai){var Yr=Ai.state;if(Te()){var Ou=xe(),ms=Ou.box;["placement","reference-hidden","escaped"].forEach(function(Jr){Jr==="placement"?ms.setAttribute("data-placement",Yr.placement):Yr.attributes.popper["data-popper-"+Jr]?ms.setAttribute("data-"+Jr,""):ms.removeAttribute("data-"+Jr)}),Yr.attributes.popper={}}}},_r=[{name:"offset",options:{offset:Xe}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!Bt}},_a];Te()&&sn&&_r.push({name:"arrow",options:{element:sn,padding:3}}),_r.push.apply(_r,ae?.modifiers||[]),S.popperInstance=Kh(qr,O,Object.assign({},ae,{placement:_e,onFirstUpdate:m,modifiers:_r}))}function ee(){S.popperInstance&&(S.popperInstance.destroy(),S.popperInstance=null)}function Ae(){var B=S.props.appendTo,ae,_e=ge();S.props.interactive&&B===cx||B==="parent"?ae=_e.parentNode:ae=ux(B,[_e]),ae.contains(O)||ae.appendChild(O),S.state.isMounted=!0,Kt()}function We(){return lu(O.querySelectorAll("[data-tippy-root]"))}function Oe(B){S.clearDelayTimeouts(),B&&R("onTrigger",[S,B]),He();var ae=P(!0),_e=ue(),Xe=_e[0],Ve=_e[1];xr.isTouch&&Xe==="hold"&&Ve&&(ae=Ve),ae?r=setTimeout(function(){S.show()},ae):S.show()}function mt(B){if(S.clearDelayTimeouts(),R("onUntrigger",[S,B]),!S.state.isVisible){Je();return}if(!(S.props.trigger.indexOf("mouseenter")>=0&&S.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(B.type)>=0&&s)){var ae=P(!1);ae?i=setTimeout(function(){S.state.isVisible&&S.hide()},ae):o=requestAnimationFrame(function(){S.hide()})}}function Ot(){S.state.isEnabled=!0}function X(){S.hide(),S.state.isEnabled=!1}function re(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(o)}function H(B){if(!S.state.isDestroyed){R("onBeforeUpdate",[S,B]),st();var ae=S.props,_e=rx(t,Object.assign({},ae,Qw(B),{ignoreAttributes:!0}));S.props=_e,Xt(),ae.interactiveDebounce!==_e.interactiveDebounce&&(pe(),y=Zw(St,_e.interactiveDebounce)),ae.triggerTarget&&!_e.triggerTarget?is(ae.triggerTarget).forEach(function(Xe){Xe.removeAttribute("aria-expanded")}):_e.triggerTarget&&t.removeAttribute("aria-expanded"),te(),N(),q&&q(ae,_e),S.popperInstance&&(Kt(),We().forEach(function(Xe){requestAnimationFrame(Xe._tippy.popperInstance.forceUpdate)})),R("onAfterUpdate",[S,B])}}function Y(B){S.setProps({content:B})}function le(){var B=S.state.isVisible,ae=S.state.isDestroyed,_e=!S.state.isEnabled,Xe=xr.isTouch&&!S.props.touch,Ve=Vh(S.props.duration,0,cr.duration);if(!(B||ae||_e||Xe)&&!ge().hasAttribute("disabled")&&(R("onShow",[S],!1),S.props.onShow(S)!==!1)){if(S.state.isVisible=!0,Te()&&(O.style.visibility="visible"),N(),He(),S.state.isMounted||(O.style.transition="none"),Te()){var Bt=xe(),sn=Bt.box,qr=Bt.content;Gh([sn,qr],0)}m=function(){var _r;if(!(!S.state.isVisible||d)){if(d=!0,O.offsetHeight,O.style.transition=S.props.moveTransition,Te()&&S.props.animation){var hs=xe(),Ai=hs.box,Yr=hs.content;Gh([Ai,Yr],Ve),ex([Ai,Yr],"visible")}K(),te(),jw(Yh,S),(_r=S.popperInstance)==null||_r.forceUpdate(),R("onMount",[S]),S.props.animation&&Te()&&Pt(Ve,function(){S.state.isShown=!0,R("onShown",[S])})}},Ae()}}function Me(){var B=!S.state.isVisible,ae=S.state.isDestroyed,_e=!S.state.isEnabled,Xe=Vh(S.props.duration,1,cr.duration);if(!(B||ae||_e)&&(R("onHide",[S],!1),S.props.onHide(S)!==!1)){if(S.state.isVisible=!1,S.state.isShown=!1,d=!1,s=!1,Te()&&(O.style.visibility="hidden"),pe(),Je(),N(!0),Te()){var Ve=xe(),Bt=Ve.box,sn=Ve.content;S.props.animation&&(Gh([Bt,sn],Xe),ex([Bt,sn],"hidden"))}K(),te(),S.props.animation?Te()&&xt(Xe,S.unmount):S.unmount()}}function ct(B){we().addEventListener("mousemove",y),jw(au,y),y(B)}function Vt(){S.state.isVisible&&S.hide(),S.state.isMounted&&(ee(),We().forEach(function(B){B._tippy.unmount()}),O.parentNode&&O.parentNode.removeChild(O),Yh=Yh.filter(function(B){return B!==S}),S.state.isMounted=!1,R("onHidden",[S]))}function Ci(){S.state.isDestroyed||(S.clearDelayTimeouts(),S.unmount(),st(),delete t._tippy,S.state.isDestroyed=!0,R("onDestroy",[S]))}}function ga(t,e){e===void 0&&(e={});var n=cr.plugins.concat(e.plugins||[]);S2();var r=Object.assign({},e,{plugins:n}),i=E2(t);if(0)var o,s;var l=i.reduce(function(u,d){var f=d&&D2(d,r);return f&&u.push(f),u},[]);return cu(t)?l[0]:l}ga.defaultProps=cr;ga.setDefaultProps=N2;ga.currentInput=xr;var TV=Object.assign({},la,{effect:function(e){var n=e.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow)}});ga.setDefaultProps({render:px});var ss=ga;var jh=class{constructor({editor:e,element:n,view:r,tippyOptions:i={},updateDelay:o=250,shouldShow:s}){un(this,"shouldShow",({view:e,state:n,from:r,to:i})=>{let{doc:o,selection:s}=n,{empty:l}=s,u=!o.textBetween(r,i).length&&Zl(n.selection),d=this.element.contains(document.activeElement);return!(!(e.hasFocus()||d)||l||u||!this.editor.isEditable)});un(this,"mousedownHandler",()=>{this.preventHide=!0});un(this,"dragstartHandler",()=>{this.hide()});un(this,"focusHandler",()=>{setTimeout(()=>this.update(this.editor.view))});un(this,"blurHandler",({event:e})=>{if(this.preventHide){this.preventHide=!1;return}e?.relatedTarget&&this.element.parentNode?.contains(e.relatedTarget)||this.hide()});un(this,"tippyBlurHandler",e=>{this.blurHandler({event:e})});un(this,"handleDebouncedUpdate",(e,n)=>{let r=!n?.selection.eq(e.state.selection),i=!n?.doc.eq(e.state.doc);!r&&!i||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(e,r,i,n)},this.updateDelay))});un(this,"updateHandler",(e,n,r,i)=>{let{state:o,composing:s}=e,{selection:l}=o;if(s||!n&&!r)return;this.createTooltip();let{ranges:d}=l,f=Math.min(...d.map(b=>b.$from.pos)),h=Math.max(...d.map(b=>b.$to.pos));if(!this.shouldShow?.({editor:this.editor,view:e,state:o,oldState:i,from:f,to:h})){this.hide();return}o.selection.$anchor.pos!==i?.selection.$anchor.pos&&this.update(e,o),this.tippy?.setProps({getReferenceClientRect:this.tippyOptions?.getReferenceClientRect||(()=>{if(ME(o.selection)){let b=e.nodeDOM(f),y=b.dataset.nodeViewWrapper?b:b.querySelector("[data-node-view-wrapper]");if(y&&(b=y.firstChild),b)return b.getBoundingClientRect()}return tc(e,f,h)})}),this.show()});this.editor=e,this.element=n,this.view=r,this.updateDelay=o,s&&(this.shouldShow=s),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.style.visibility="hidden",this.element.style.position="absolute"}createTooltip(){let{element:e}=this.editor.options,n=!!e.parentElement;this.tippy||!n||(this.tippy=ss(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,n){let{state:r}=e,i=r.selection.$from.pos!==r.selection.$to.pos;if(this.updateDelay>0&&i){this.handleDebouncedUpdate(e,n);return}let o=!n?.selection.eq(e.state.selection),s=!n?.doc.eq(e.state.doc);this.updateHandler(e,o,s,n)}show(){this.element.style.position="relative",this.element.style.visibility="visible",this.tippy?.show()}hide(){this.element.style.position="absolute",this.element.style.visibility="hidden",this.tippy?.hide()}destroy(){this.tippy?.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),this.tippy?.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}},hx=t=>new Pe({key:typeof t.pluginKey=="string"?new qe(t.pluginKey):t.pluginKey,view:e=>new jh({view:e,...t})});var Qh=Qe.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[hx({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});var em=class{constructor({editor:e,element:n,view:r,tippyOptions:i={},shouldShow:o}){un(this,"shouldShow",({view:e,state:n})=>{let{selection:r}=n,{$anchor:i,empty:o}=r,s=i.depth===1,l=i.parent.isTextblock&&!i.parent.type.spec.code&&!i.parent.textContent;return!(!e.hasFocus()||!o||!s||!l||!this.editor.isEditable)});un(this,"mousedownHandler",()=>{this.preventHide=!0});un(this,"focusHandler",()=>{setTimeout(()=>this.update(this.editor.view))});un(this,"blurHandler",({event:e})=>{if(this.preventHide){this.preventHide=!1;return}e?.relatedTarget&&this.element.parentNode?.contains(e.relatedTarget)||this.hide()});un(this,"tippyBlurHandler",e=>{this.blurHandler({event:e})});this.editor=e,this.element=n,this.view=r,o&&(this.shouldShow=o),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.style.visibility="hidden",this.element.style.position="absolute"}createTooltip(){let{element:e}=this.editor.options,n=!!e.parentElement;this.tippy||!n||(this.tippy=ss(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"right",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,n){let{state:r}=e,{doc:i,selection:o}=r,{from:s,to:l}=o;if(n&&n.doc.eq(i)&&n.selection.eq(o))return;if(this.createTooltip(),!this.shouldShow?.({editor:this.editor,view:e,state:r,oldState:n})){this.hide();return}this.tippy?.setProps({getReferenceClientRect:this.tippyOptions?.getReferenceClientRect||(()=>tc(e,s,l))}),this.show()}show(){this.element.style.position="relative",this.element.style.visibility="visible",this.tippy?.show()}hide(){this.tippy?.hide()}destroy(){this.tippy?.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),this.tippy?.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}},mx=t=>new Pe({key:typeof t.pluginKey=="string"?new qe(t.pluginKey):t.pluginKey,view:e=>new em({view:e,...t})});var tm=Qe.create({name:"floatingMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"floatingMenu",shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[mx({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}});function uu(t,e,n=null){return n?t.createChecked({"data-col-span":e},n):t.createAndFill({"data-col-span":e})}function gx(t){if(t.cached.gridBuilderNodeTypes)return t.cached.gridBuilderNodeTypes;let e={};return Object.keys(t.nodes).forEach(n=>{let r=t.nodes[n];r.spec.gridBuilderRole&&(e[r.spec.gridBuilderRole]=r)}),t.cached.gridBuilderNodeTypes=e,e}function bx(t,e,n,r,i,o,s){let l=gx(t),u=[];if(n==="asymmetric")u.push(uu(l.builderColumn,i,s)),u.push(uu(l.builderColumn,o,s));else for(let d=0;dt.getAttribute("data-type")},"data-cols":{default:2,parseHTML:t=>t.getAttribute("data-cols")},"data-stack-at":{default:"md",parseHTML:t=>t.getAttribute("data-stack-at")},style:{default:null,parseHTML:t=>t.getAttribute("style"),renderHTML:t=>({style:`grid-template-columns: repeat(${t["data-cols"]}, 1fr);`})}}},parseHTML(){return[{tag:"div",getAttrs:t=>t.classList.contains("filament-tiptap-grid-builder")&&null}]},renderHTML({HTMLAttributes:t}){return["div",j(this.options.HTMLAttributes,t),0]},addCommands(){return{insertGridBuilder:({cols:t=3,type:e="responsive",stackAt:n,asymmetricLeft:r=null,asymmetricRight:i=null}={})=>({tr:o,dispatch:s,editor:l})=>{let u=bx(l.schema,t,e,n,r,i);if(s){let d=o.selection.anchor+1;o.replaceSelectionWith(u).scrollIntoView().setSelection(ce.near(o.doc.resolve(d)))}return!0}}},addKeyboardShortcuts(){return{"Mod-Alt-G":()=>this.editor.commands.insertGridBuilder()}},extendNodeSchema(t){let e={name:t.name,options:t.options,storage:t.storage};return{gridBuilderRole:Se(ie(t,"gridBuilderRole",e))}}});var rm=se.create({name:"gridBuilderColumn",content:"block+",gridBuilderRole:"builderColumn",isolating:!0,addOptions(){return{HTMLAttributes:{class:"filament-tiptap-grid-builder__column"}}},addAttributes(){return{"data-col-span":{default:1,parseHTML:t=>t.getAttribute("data-col-span")},style:{default:null,parseHTML:t=>t.getAttribute("style"),renderHTML:t=>({style:`grid-column: span ${t["data-col-span"]};`})}}},parseHTML(){return[{tag:"div",getAttrs:t=>t.classList.contains("filament-tiptap-grid-builder__column")&&null}]},renderHTML({HTMLAttributes:t}){return["div",j(this.options.HTMLAttributes,t),0]}});var im=Qe.create({name:"dragAndDrop",addProseMirrorPlugins(t){return[new Pe({props:{handleDrop(e,n){if(!n)return!1;n.preventDefault();let r=e.posAtCoords({left:n.clientX,top:n.clientY});return n.dataTransfer.getData("block")?(n.target.dispatchEvent(new CustomEvent("dragged-block",{detail:{type:n.dataTransfer.getData("block"),coordinates:r},bubbles:!0})),!1):(n.dataTransfer.getData("mergeTag")&&n.target.dispatchEvent(new CustomEvent("dragged-merge-tag",{detail:{tag:n.dataTransfer.getData("mergeTag"),coordinates:r},bubbles:!0})),!1)}}})]}});var om=se.create({name:"tiptapBlock",group:"block",atom:!0,defining:!0,draggable:!0,selectable:!0,isolating:!0,allowGapCursor:!0,inline:!1,addAttributes(){return{preview:{default:null,parseHTML:t=>t.getAttribute("data-preview"),renderHTML:t=>t.preview?{"data-preview":t.preview}:null},statePath:{default:null,parseHTML:t=>t.getAttribute("data-state-path"),renderHTML:t=>t.statePath?{"data-state-path":t.statePath}:null},type:{default:null,parseHTML:t=>t.getAttribute("data-type"),renderHTML:t=>t.type?{"data-type":t.type}:null},label:{default:null,parseHTML:t=>t.getAttribute("data-label"),renderHTML:t=>t.label?{"data-label":t.label}:null},data:{default:null,parseHTML:t=>t.getAttribute("data-data"),renderHTML:t=>t.data?{"data-data":JSON.stringify(t.data)}:null}}},parseHTML(){return[{tag:"tiptap-block"}]},renderHTML({HTMLAttributes:t}){return["tiptap-block",j(t)]},addNodeView(){return({node:t})=>{let e=document.createElement("div");e.contentEditable="false",e.classList.add("tiptap-block-wrapper");let n=typeof t.attrs.data=="object"?JSON.stringify(t.attrs.data):t.attrs.data;return e.innerHTML=`
diff --git a/resources/js/extensions/TiptapBlock.js b/resources/js/extensions/TiptapBlock.js index bb245a16..8669881a 100644 --- a/resources/js/extensions/TiptapBlock.js +++ b/resources/js/extensions/TiptapBlock.js @@ -105,25 +105,25 @@ export const TiptapBlock = Node.create({ dom.contentEditable = 'false' dom.classList.add('tiptap-block-wrapper') - const data = typeof node.attrs.data === 'object' + let data = typeof node.attrs.data === 'object' ? JSON.stringify(node.attrs.data) : node.attrs.data dom.innerHTML = `
diff --git a/src/TiptapEditor.php b/src/TiptapEditor.php index 779f39f9..a0ba053c 100644 --- a/src/TiptapEditor.php +++ b/src/TiptapEditor.php @@ -16,6 +16,7 @@ use FilamentTiptapEditor\Concerns\InteractsWithMedia; use FilamentTiptapEditor\Concerns\InteractsWithMenus; use Illuminate\Support\Arr; +use Illuminate\Support\Js; use Illuminate\Support\Str; use Livewire\Component; @@ -268,7 +269,7 @@ public function getInsertBlockAction(): Action event: 'insert-block', statePath: $component->getStatePath(), type: $arguments['type'], - data: $data, + data: Js::from($data)->toHtml(), preview: $block->getPreview($data), label: $block->getLabel(), coordinates: $arguments['coordinates'] ?? [], @@ -307,7 +308,7 @@ public function getUpdateBlockAction(): Action event: 'update-block', statePath: $component->getStatePath(), type: $arguments['type'], - data: $data, + data: Js::from($data)->toHtml(), preview: $block->getPreview($data), label: $block->getLabel(), );