@moontra/moonui-pro 2.0.2 → 2.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +117 -49
- package/dist/index.mjs +88 -33
- package/package.json +22 -6
- package/dist/index.css +0 -1
package/dist/index.js
CHANGED
|
@@ -1,17 +1,39 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
3
|
+
var ee = require('react');
|
|
4
|
+
var classVarianceAuthority = require('class-variance-authority');
|
|
5
|
+
var framerMotion = require('framer-motion');
|
|
6
|
+
var clsx = require('clsx');
|
|
7
|
+
var tailwindMerge = require('tailwind-merge');
|
|
7
8
|
var jsxRuntime = require('react/jsx-runtime');
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
var lucideReact = require('lucide-react');
|
|
10
|
+
var Dg = require('react-dom');
|
|
11
|
+
var Nn = require('@radix-ui/react-avatar');
|
|
12
|
+
var Ir = require('@radix-ui/react-tooltip');
|
|
13
|
+
var dnd = require('@hello-pangea/dnd');
|
|
14
|
+
|
|
15
|
+
function _interopNamespace(e) {
|
|
16
|
+
if (e && e.__esModule) return e;
|
|
17
|
+
var n = Object.create(null);
|
|
18
|
+
if (e) {
|
|
19
|
+
Object.keys(e).forEach(function (k) {
|
|
20
|
+
if (k !== 'default') {
|
|
21
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
22
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
23
|
+
enumerable: true,
|
|
24
|
+
get: function () { return e[k]; }
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
n.default = e;
|
|
30
|
+
return Object.freeze(n);
|
|
31
|
+
}
|
|
12
32
|
|
|
13
|
-
var
|
|
14
|
-
var
|
|
33
|
+
var ee__namespace = /*#__PURE__*/_interopNamespace(ee);
|
|
34
|
+
var Dg__namespace = /*#__PURE__*/_interopNamespace(Dg);
|
|
35
|
+
var Nn__namespace = /*#__PURE__*/_interopNamespace(Nn);
|
|
36
|
+
var Ir__namespace = /*#__PURE__*/_interopNamespace(Ir);
|
|
15
37
|
|
|
16
38
|
/**
|
|
17
39
|
* @moontra/moonui-pro v1.0.0
|
|
@@ -19,22 +41,69 @@ var cC__default = /*#__PURE__*/_interopDefault(cC);
|
|
|
19
41
|
* (c) 2025 MoonUI. All rights reserved.
|
|
20
42
|
* @license Commercial - https://moonui.dev/license
|
|
21
43
|
*/
|
|
22
|
-
var ny=Object.create;var Ad=Object.defineProperty;var ry=Object.getOwnPropertyDescriptor;var iy=Object.getOwnPropertyNames;var oy=Object.getPrototypeOf,sy=Object.prototype.hasOwnProperty;var lo=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,n)=>(typeof require<"u"?require:e)[n]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+t+'" is not supported')});var _n=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var ay=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of iy(e))!sy.call(t,i)&&i!==n&&Ad(t,i,{get:()=>e[i],enumerable:!(r=ry(e,i))||r.enumerable});return t};var ai=(t,e,n)=>(n=t!=null?ny(oy(t)):{},ay(e||!t||!t.__esModule?Ad(n,"default",{value:t,enumerable:!0}):n,t));var eu=_n(Qd=>{var _r=lo("react");function OE(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var RE=typeof Object.is=="function"?Object.is:OE,DE=_r.useState,IE=_r.useEffect,LE=_r.useLayoutEffect,PE=_r.useDebugValue;function BE(t,e){var n=e(),r=DE({inst:{value:n,getSnapshot:e}}),i=r[0].inst,o=r[1];return LE(function(){i.value=n,i.getSnapshot=e,Oa(i)&&o({inst:i});},[t,n,e]),IE(function(){return Oa(i)&&o({inst:i}),t(function(){Oa(i)&&o({inst:i});})},[t]),PE(n),n}function Oa(t){var e=t.getSnapshot;t=t.value;try{var n=e();return !RE(t,n)}catch{return !0}}function zE(t,e){return e()}var FE=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?zE:BE;Qd.useSyncExternalStore=_r.useSyncExternalStore!==void 0?_r.useSyncExternalStore:FE;});var nu=_n(tu=>{process.env.NODE_ENV!=="production"&&function(){function t(p,h){return p===h&&(p!==0||1/p===1/h)||p!==p&&h!==h}function e(p,h){d||i.startTransition===void 0||(d=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var m=h();if(!u){var g=h();o(m,g)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),u=!0);}g=s({inst:{value:m,getSnapshot:h}});var b=g[0].inst,v=g[1];return l(function(){b.value=m,b.getSnapshot=h,n(b)&&v({inst:b});},[p,m,h]),a(function(){return n(b)&&v({inst:b}),p(function(){n(b)&&v({inst:b});})},[p]),c(m),m}function n(p){var h=p.getSnapshot;p=p.value;try{var m=h();return !o(p,m)}catch{return !0}}function r(p,h){return h()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var i=lo("react"),o=typeof Object.is=="function"?Object.is:t,s=i.useState,a=i.useEffect,l=i.useLayoutEffect,c=i.useDebugValue,d=!1,u=!1,f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:e;tu.useSyncExternalStore=i.useSyncExternalStore!==void 0?i.useSyncExternalStore:f,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());}();});var fi=_n((Z1,Ra)=>{process.env.NODE_ENV==="production"?Ra.exports=eu():Ra.exports=nu();});var uh=_n((tD,dh)=>{dh.exports=function t(e,n){if(e===n)return !0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return !1;var r,i,o;if(Array.isArray(e)){if(r=e.length,r!=n.length)return !1;for(i=r;i--!==0;)if(!t(e[i],n[i]))return !1;return !0}if(e instanceof Map&&n instanceof Map){if(e.size!==n.size)return !1;for(i of e.entries())if(!n.has(i[0]))return !1;for(i of e.entries())if(!t(i[1],n.get(i[0])))return !1;return !0}if(e instanceof Set&&n instanceof Set){if(e.size!==n.size)return !1;for(i of e.entries())if(!n.has(i[0]))return !1;return !0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(n)){if(r=e.length,r!=n.length)return !1;for(i=r;i--!==0;)if(e[i]!==n[i])return !1;return !0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(o=Object.keys(e),r=o.length,r!==Object.keys(n).length)return !1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,o[i]))return !1;for(i=r;i--!==0;){var s=o[i];if(!(s==="_owner"&&e.$$typeof)&&!t(e[s],n[s]))return !1}return !0}return e!==e&&n!==n};});var ph=_n(fh=>{var es=lo("react"),QS=fi();function eC(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var tC=typeof Object.is=="function"?Object.is:eC,nC=QS.useSyncExternalStore,rC=es.useRef,iC=es.useEffect,oC=es.useMemo,sC=es.useDebugValue;fh.useSyncExternalStoreWithSelector=function(t,e,n,r,i){var o=rC(null);if(o.current===null){var s={hasValue:!1,value:null};o.current=s;}else s=o.current;o=oC(function(){function l(p){if(!c){if(c=!0,d=p,p=r(p),i!==void 0&&s.hasValue){var h=s.value;if(i(h,p))return u=h}return u=p}if(h=u,tC(d,p))return h;var m=r(p);return i!==void 0&&i(h,m)?(d=p,h):(d=p,u=m)}var c=!1,d,u,f=n===void 0?null:n;return [function(){return l(e())},f===null?void 0:function(){return l(f())}]},[e,n,r,i]);var a=nC(t,o[0],o[1]);return iC(function(){s.hasValue=!0,s.value=a;},[a]),sC(a),a};});var mh=_n(hh=>{process.env.NODE_ENV!=="production"&&function(){function t(c,d){return c===d&&(c!==0||1/c===1/d)||c!==c&&d!==d}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var e=lo("react"),n=fi(),r=typeof Object.is=="function"?Object.is:t,i=n.useSyncExternalStore,o=e.useRef,s=e.useEffect,a=e.useMemo,l=e.useDebugValue;hh.useSyncExternalStoreWithSelector=function(c,d,u,f,p){var h=o(null);if(h.current===null){var m={hasValue:!1,value:null};h.current=m;}else m=h.current;h=a(function(){function b(I){if(!v){if(v=!0,S=I,I=f(I),p!==void 0&&m.hasValue){var k=m.value;if(p(k,I))return T=k}return T=I}if(k=T,r(S,I))return k;var y=f(I);return p!==void 0&&p(k,y)?(S=I,k):(S=I,T=y)}var v=!1,S,T,_=u===void 0?null:u;return [function(){return b(d())},_===null?void 0:function(){return b(_())}]},[d,u,f,p]);var g=i(c,h[0],h[1]);return s(function(){m.hasValue=!0,m.value=g;},[g]),l(g),g},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());}();});var gh=_n((iD,sc)=>{process.env.NODE_ENV==="production"?sc.exports=ph():sc.exports=mh();});var _g=_n((wB,Tg)=>{function mg(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(e=>{let n=t[e],r=typeof n;(r==="object"||r==="function")&&!Object.isFrozen(n)&&mg(n);}),t}var Qs=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1;}ignoreMatch(){this.isMatchIgnored=!0;}};function gg(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Vn(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 hT="</span>",cg=t=>!!t.scope,mT=(t,{prefix:e})=>{if(t.startsWith("language:"))return t.replace("language:","language-");if(t.includes(".")){let n=t.split(".");return [`${e}${n.shift()}`,...n.map((r,i)=>`${r}${"_".repeat(i+1)}`)].join(" ")}return `${e}${t}`},ud=class{constructor(e,n){this.buffer="",this.classPrefix=n.classPrefix,e.walk(this);}addText(e){this.buffer+=gg(e);}openNode(e){if(!cg(e))return;let n=mT(e.scope,{prefix:this.classPrefix});this.span(n);}closeNode(e){cg(e)&&(this.buffer+=hT);}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`;}},dg=(t={})=>{let e={children:[]};return Object.assign(e,t),e},Xi=class{constructor(){this.rootNode=dg(),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=dg({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=>{Xi._collapse(n);}));}},fd=class extends Xi{constructor(e){super(),this.options=e;}addText(e){e!==""&&this.add(e);}startScope(e){this.openNode(e);}endScope(){this.closeNode();}__addSublanguage(e,n){let r=e.root;n&&(r.scope=`language:${n}`),this.add(r);}toHTML(){return new ud(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function Qi(t){return t?typeof t=="string"?t:t.source:null}function bg(t){return Er("(?=",t,")")}function gT(t){return Er("(?:",t,")*")}function bT(t){return Er("(?:",t,")?")}function Er(...t){return t.map(n=>Qi(n)).join("")}function yT(t){let e=t[t.length-1];return typeof e=="object"&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}function hd(...t){return "("+(yT(t).capture?"":"?:")+t.map(r=>Qi(r)).join("|")+")"}function yg(t){return new RegExp(t.toString()+"|").exec("").length-1}function ET(t,e){let n=t&&t.exec(e);return n&&n.index===0}var vT=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function md(t,{joinWith:e}){let n=0;return t.map(r=>{n+=1;let i=n,o=Qi(r),s="";for(;o.length>0;){let a=vT.exec(o);if(!a){s+=o;break}s+=o.substring(0,a.index),o=o.substring(a.index+a[0].length),a[0][0]==="\\"&&a[1]?s+="\\"+String(Number(a[1])+i):(s+=a[0],a[0]==="("&&n++);}return s}).map(r=>`(${r})`).join(e)}var wT=/\b\B/,Eg="[a-zA-Z]\\w*",gd="[a-zA-Z_]\\w*",vg="\\b\\d+(\\.\\d+)?",wg="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",xg="\\b(0b[01]+)",xT="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",ST=(t={})=>{let e=/^#![ ]*\//;return t.binary&&(t.begin=Er(e,/.*\b/,t.binary,/\b.*/)),Vn({scope:"meta",begin:e,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch();}},t)},eo={begin:"\\\\[\\s\\S]",relevance:0},CT={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[eo]},kT={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[eo]},NT={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/},ta=function(t,e,n={}){let r=Vn({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=hd("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:Er(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},TT=ta("//","$"),_T=ta("/\\*","\\*/"),MT=ta("#","$"),AT={scope:"number",begin:vg,relevance:0},OT={scope:"number",begin:wg,relevance:0},RT={scope:"number",begin:xg,relevance:0},DT={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[eo,{begin:/\[/,end:/\]/,relevance:0,contains:[eo]}]},IT={scope:"title",begin:Eg,relevance:0},LT={scope:"title",begin:gd,relevance:0},PT={begin:"\\.\\s*"+gd,relevance:0},BT=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();}})},Xs=Object.freeze({__proto__:null,APOS_STRING_MODE:CT,BACKSLASH_ESCAPE:eo,BINARY_NUMBER_MODE:RT,BINARY_NUMBER_RE:xg,COMMENT:ta,C_BLOCK_COMMENT_MODE:_T,C_LINE_COMMENT_MODE:TT,C_NUMBER_MODE:OT,C_NUMBER_RE:wg,END_SAME_AS_BEGIN:BT,HASH_COMMENT_MODE:MT,IDENT_RE:Eg,MATCH_NOTHING_RE:wT,METHOD_GUARD:PT,NUMBER_MODE:AT,NUMBER_RE:vg,PHRASAL_WORDS_MODE:NT,QUOTE_STRING_MODE:kT,REGEXP_MODE:DT,RE_STARTERS_RE:xT,SHEBANG:ST,TITLE_MODE:IT,UNDERSCORE_IDENT_RE:gd,UNDERSCORE_TITLE_MODE:LT});function zT(t,e){t.input[t.index-1]==="."&&e.ignoreMatch();}function FT(t,e){t.className!==void 0&&(t.scope=t.className,delete t.className);}function UT(t,e){e&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=zT,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0));}function HT(t,e){Array.isArray(t.illegal)&&(t.illegal=hd(...t.illegal));}function $T(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 KT(t,e){t.relevance===void 0&&(t.relevance=1);}var VT=(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=Er(n.beforeMatch,bg(n.begin)),t.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},t.relevance=0,delete n.beforeMatch;},WT=["of","and","for","in","not","or","if","then","parent","list","value"],GT="keyword";function Sg(t,e,n=GT){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,Sg(t[o],e,o));}),r;function i(o,s){e&&(s=s.map(a=>a.toLowerCase())),s.forEach(function(a){let l=a.split("|");r[l[0]]=[o,qT(l[0],l[1])];});}}function qT(t,e){return e?Number(e):jT(t)?0:1}function jT(t){return WT.includes(t.toLowerCase())}var ug={},yr=t=>{console.error(t);},fg=(t,...e)=>{console.log(`WARN: ${t}`,...e);},Qr=(t,e)=>{ug[`${t}/${e}`]||(console.log(`Deprecated as of ${t}. ${e}`),ug[`${t}/${e}`]=!0);},ea=new Error;function Cg(t,e,{key:n}){let r=0,i=t[n],o={},s={};for(let a=1;a<=e.length;a++)s[a+r]=i[a],o[a+r]=!0,r+=yg(e[a-1]);t[n]=s,t[n]._emit=o,t[n]._multi=!0;}function JT(t){if(Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw yr("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),ea;if(typeof t.beginScope!="object"||t.beginScope===null)throw yr("beginScope must be object"),ea;Cg(t,t.begin,{key:"beginScope"}),t.begin=md(t.begin,{joinWith:""});}}function YT(t){if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw yr("skip, excludeEnd, returnEnd not compatible with endScope: {}"),ea;if(typeof t.endScope!="object"||t.endScope===null)throw yr("endScope must be object"),ea;Cg(t,t.end,{key:"endScope"}),t.end=md(t.end,{joinWith:""});}}function ZT(t){t.scope&&typeof t.scope=="object"&&t.scope!==null&&(t.beginScope=t.scope,delete t.scope);}function XT(t){ZT(t),typeof t.beginScope=="string"&&(t.beginScope={_wrap:t.beginScope}),typeof t.endScope=="string"&&(t.endScope={_wrap:t.endScope}),JT(t),YT(t);}function QT(t){function e(s,a){return new RegExp(Qi(s),"m"+(t.case_insensitive?"i":"")+(t.unicodeRegex?"u":"")+(a?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0;}addRule(a,l){l.position=this.position++,this.matchIndexes[this.matchAt]=l,this.regexes.push([l,a]),this.matchAt+=yg(a)+1;}compile(){this.regexes.length===0&&(this.exec=()=>null);let a=this.regexes.map(l=>l[1]);this.matcherRe=e(md(a,{joinWith:"|"}),!0),this.lastIndex=0;}exec(a){this.matcherRe.lastIndex=this.lastIndex;let l=this.matcherRe.exec(a);if(!l)return null;let c=l.findIndex((u,f)=>f>0&&u!==void 0),d=this.matchIndexes[c];return l.splice(0,c),Object.assign(l,d)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0;}getMatcher(a){if(this.multiRegexes[a])return this.multiRegexes[a];let l=new n;return this.rules.slice(a).forEach(([c,d])=>l.addRule(c,d)),l.compile(),this.multiRegexes[a]=l,l}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0;}addRule(a,l){this.rules.push([a,l]),l.type==="begin"&&this.count++;}exec(a){let l=this.getMatcher(this.regexIndex);l.lastIndex=this.lastIndex;let c=l.exec(a);if(this.resumingScanAtSamePosition()&&!(c&&c.index===this.lastIndex)){let d=this.getMatcher(0);d.lastIndex=this.lastIndex+1,c=d.exec(a);}return c&&(this.regexIndex+=c.position+1,this.regexIndex===this.count&&this.considerAll()),c}}function i(s){let a=new r;return s.contains.forEach(l=>a.addRule(l.begin,{rule:l,type:"begin"})),s.terminatorEnd&&a.addRule(s.terminatorEnd,{type:"end"}),s.illegal&&a.addRule(s.illegal,{type:"illegal"}),a}function o(s,a){let l=s;if(s.isCompiled)return l;[FT,$T,XT,VT].forEach(d=>d(s,a)),t.compilerExtensions.forEach(d=>d(s,a)),s.__beforeBegin=null,[UT,HT,KT].forEach(d=>d(s,a)),s.isCompiled=!0;let c=null;return typeof s.keywords=="object"&&s.keywords.$pattern&&(s.keywords=Object.assign({},s.keywords),c=s.keywords.$pattern,delete s.keywords.$pattern),c=c||/\w+/,s.keywords&&(s.keywords=Sg(s.keywords,t.case_insensitive)),l.keywordPatternRe=e(c,!0),a&&(s.begin||(s.begin=/\B|\b/),l.beginRe=e(l.begin),!s.end&&!s.endsWithParent&&(s.end=/\B|\b/),s.end&&(l.endRe=e(l.end)),l.terminatorEnd=Qi(l.end)||"",s.endsWithParent&&a.terminatorEnd&&(l.terminatorEnd+=(s.end?"|":"")+a.terminatorEnd)),s.illegal&&(l.illegalRe=e(s.illegal)),s.contains||(s.contains=[]),s.contains=[].concat(...s.contains.map(function(d){return e_(d==="self"?s:d)})),s.contains.forEach(function(d){o(d,l);}),s.starts&&o(s.starts,a),l.matcher=i(l),l}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=Vn(t.classNameAliases||{}),o(t)}function kg(t){return t?t.endsWithParent||kg(t.starts):!1}function e_(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(e){return Vn(t,{variants:null},e)})),t.cachedVariants?t.cachedVariants:kg(t)?Vn(t,{starts:t.starts?Vn(t.starts):null}):Object.isFrozen(t)?Vn(t):t}var t_="11.11.1",pd=class extends Error{constructor(e,n){super(e),this.name="HTMLInjectionError",this.html=n;}},dd=gg,pg=Vn,hg=Symbol("nomatch"),n_=7,Ng=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:[]},a={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:fd};function l(x){return a.noHighlightRe.test(x)}function c(x){let C=x.className+" ";C+=x.parentNode?x.parentNode.className:"";let M=a.languageDetectRe.exec(C);if(M){let U=y(M[1]);return U||(fg(o.replace("{}",M[1])),fg("Falling back to no-highlight mode for this block.",x)),U?M[1]:"no-highlight"}return C.split(/\s+/).find(U=>l(U)||y(U))}function d(x,C,M){let U="",z="";typeof C=="object"?(U=x,M=C.ignoreIllegals,z=C.language):(Qr("10.7.0","highlight(lang, code, ...args) has been deprecated."),Qr("10.7.0",`Please use highlight(code, options) instead.
|
|
23
|
-
https://github.com/highlightjs/highlight.js/issues/2277`),
|
|
24
|
-
`,1;if(si>1e5&&si>K.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Y+=ue,ue.length}let ot=y(x);if(!ot)throw yr(o.replace("{}",x)),new Error('Unknown language: "'+x+'"');let ve=QT(ot),Nt="",A=U||ve,ee={},de=new a.__emitter(a);jn();let Y="",st=0,Tt=0,si=0,F=!1;try{if(ot.__emitTokens)ot.__emitTokens(C,de);else {for(A.matcher.considerAll();;){si++,F?F=!1:A.matcher.considerAll(),A.matcher.lastIndex=Tt;let D=A.matcher.exec(C);if(!D)break;let K=C.substring(Tt,D.index),ue=cn(K,D);Tt=D.index+ue;}cn(C.substring(Tt));}return de.finalize(),Nt=de.toHTML(),{language:x,value:Nt,relevance:st,illegal:!1,_emitter:de,_top:A}}catch(D){if(D.message&&D.message.includes("Illegal"))return {language:x,value:dd(C),illegal:!0,relevance:0,_illegalBy:{message:D.message,index:Tt,context:C.slice(Tt-100,Tt+100),mode:D.mode,resultSoFar:Nt},_emitter:de};if(i)return {language:x,value:dd(C),illegal:!1,relevance:0,errorRaised:D,_emitter:de,_top:A};throw D}}function f(x){let C={value:dd(x),illegal:!1,relevance:0,_top:s,_emitter:new a.__emitter(a)};return C._emitter.addText(x),C}function p(x,C){C=C||a.languages||Object.keys(e);let M=f(x),U=C.filter(y).filter(O).map(ae=>u(ae,x,!1));U.unshift(M);let z=U.sort((ae,_e)=>{if(ae.relevance!==_e.relevance)return _e.relevance-ae.relevance;if(ae.language&&_e.language){if(y(ae.language).supersetOf===_e.language)return 1;if(y(_e.language).supersetOf===ae.language)return -1}return 0}),[J,ie]=z,$=J;return $.secondBest=ie,$}function h(x,C,M){let U=C&&n[C]||M;x.classList.add("hljs"),x.classList.add(`language-${U}`);}function m(x){let C=null,M=c(x);if(l(M))return;if(Q("before:highlightElement",{el:x,language:M}),x.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",x);return}if(x.children.length>0&&(a.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(x)),a.throwUnescapedHTML))throw new pd("One of your code blocks includes unescaped HTML.",x.innerHTML);C=x;let U=C.textContent,z=M?d(U,{language:M,ignoreIllegals:!0}):p(U);x.innerHTML=z.value,x.dataset.highlighted="yes",h(x,M,z.language),x.result={language:z.language,re:z.relevance,relevance:z.relevance},z.secondBest&&(x.secondBest={language:z.secondBest.language,relevance:z.secondBest.relevance}),Q("after:highlightElement",{el:x,result:z,text:U});}function g(x){a=pg(a,x);}let b=()=>{T(),Qr("10.6.0","initHighlighting() deprecated. Use highlightAll() now.");};function v(){T(),Qr("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.");}let S=!1;function T(){function x(){T();}if(document.readyState==="loading"){S||window.addEventListener("DOMContentLoaded",x,!1),S=!0;return}document.querySelectorAll(a.cssSelector).forEach(m);}function _(x,C){let M=null;try{M=C(t);}catch(U){if(yr("Language definition for '{}' could not be registered.".replace("{}",x)),i)yr(U);else throw U;M=s;}M.name||(M.name=x),e[x]=M,M.rawDefinition=C.bind(null,t),M.aliases&&w(M.aliases,{languageName:x});}function I(x){delete e[x];for(let C of Object.keys(n))n[C]===x&&delete n[C];}function k(){return Object.keys(e)}function y(x){return x=(x||"").toLowerCase(),e[x]||e[n[x]]}function w(x,{languageName:C}){typeof x=="string"&&(x=[x]),x.forEach(M=>{n[M.toLowerCase()]=C;});}function O(x){let C=y(x);return C&&!C.disableAutodetect}function X(x){x["before:highlightBlock"]&&!x["before:highlightElement"]&&(x["before:highlightElement"]=C=>{x["before:highlightBlock"](Object.assign({block:C.el},C));}),x["after:highlightBlock"]&&!x["after:highlightElement"]&&(x["after:highlightElement"]=C=>{x["after:highlightBlock"](Object.assign({block:C.el},C));});}function R(x){X(x),r.push(x);}function ce(x){let C=r.indexOf(x);C!==-1&&r.splice(C,1);}function Q(x,C){let M=x;r.forEach(function(U){U[M]&&U[M](C);});}function G(x){return Qr("10.7.0","highlightBlock will be removed entirely in v12.0"),Qr("10.7.0","Please use highlightElement now."),m(x)}Object.assign(t,{highlight:d,highlightAuto:p,highlightAll:T,highlightElement:m,highlightBlock:G,configure:g,initHighlighting:b,initHighlightingOnLoad:v,registerLanguage:_,unregisterLanguage:I,listLanguages:k,getLanguage:y,registerAliases:w,autoDetection:O,inherit:pg,addPlugin:R,removePlugin:ce}),t.debugMode=function(){i=!1;},t.safeMode=function(){i=!0;},t.versionString=t_,t.regex={concat:Er,lookahead:bg,either:hd,optional:bT,anyNumberOfTimes:gT};for(let x in Xs)typeof Xs[x]=="object"&&mg(Xs[x]);return Object.assign(t,Xs),t},ei=Ng({});ei.newInstance=()=>Ng({});Tg.exports=ei;ei.HighlightJS=ei;ei.default=ei;});function lt(){return {isLoading:!1,isAuthenticated:!0,isAdmin:!1,hasProAccess:!0,subscriptionPlan:"pro",subscription:{status:"active",plan:"pro"}}}var Oy=["#3b82f6","#ef4444","#10b981","#f59e0b","#8b5cf6","#06b6d4","#f97316","#84cc16","#ec4899","#6366f1"];function pA({data:t,type:e,series:n,title:r,subtitle:i,height:o=400,width:s="100%",xAxisKey:a="name",yAxisKey:l,showGrid:c=!0,showTooltip:d=!0,showLegend:u=!0,showBrush:f=!1,showReference:p=!1,referenceLines:h=[],referenceAreas:m=[],colors:g=Oy,className:b,onDataPointClick:v,onExport:S,onRefresh:T,customTooltip:_,customLegend:I,loading:k=!1,error:y=null,animated:w=!0,responsive:O=!0}){let {hasProAccess:R,isLoading:ce}=lt();if(!ce&&!R)return jsxRuntime.jsx(moonui.Card,{className:moonui.cn("w-full",b),children:jsxRuntime.jsx(moonui.CardContent,{className:"py-12 text-center",children:jsxRuntime.jsxs("div",{className:"max-w-md mx-auto space-y-4",children:[jsxRuntime.jsx("div",{className:"rounded-full bg-purple-100 dark:bg-purple-900/30 p-3 w-fit mx-auto",children:jsxRuntime.jsx(lucideReact.Lock,{className:"h-6 w-6 text-purple-600 dark:text-purple-400"})}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"font-semibold text-lg mb-2",children:"Pro Feature"}),jsxRuntime.jsx("p",{className:"text-muted-foreground text-sm mb-4",children:"Advanced Chart is available exclusively to MoonUI Pro subscribers."}),jsxRuntime.jsx("div",{className:"flex gap-3 justify-center",children:jsxRuntime.jsx("a",{href:"/pricing",children:jsxRuntime.jsxs(moonui.Button,{size:"sm",children:[jsxRuntime.jsx(lucideReact.Sparkles,{className:"mr-2 h-4 w-4"}),"Upgrade to Pro"]})})})]})]})})});let[G,x]=Mn__default.default.useState(!1),C=Mn__default.default.useRef(null),M=Mn__default.default.useMemo(()=>{if(!t.length||!n.length)return null;let J=n[0],ie=t.map($e=>Number($e[J.dataKey])).filter($e=>!isNaN($e));if(ie.length<2)return null;let $=ie[0],_e=(ie[ie.length-1]-$)/$*100;return {direction:_e>0?"up":_e<0?"down":"neutral",percentage:Math.abs(_e).toFixed(1)}},[t,n]),U=J=>{S&&S(J);},z=()=>{let J={data:t,width:typeof s=="string"?void 0:s,height:o,margin:{top:20,right:30,left:20,bottom:20}},ie=n.filter($=>!$.hide);switch(e){case"line":return jsxRuntime.jsxs(recharts.LineChart,{...J,children:[c&&jsxRuntime.jsx(recharts.CartesianGrid,{strokeDasharray:"3 3"}),jsxRuntime.jsx(recharts.XAxis,{dataKey:a}),jsxRuntime.jsx(recharts.YAxis,{}),d&&jsxRuntime.jsx(recharts.Tooltip,{}),u&&jsxRuntime.jsx(recharts.Legend,{}),ie.map(($,ae)=>jsxRuntime.jsx(recharts.Line,{type:$.type||"monotone",dataKey:$.dataKey,stroke:$.color||g[ae%g.length],strokeWidth:$.strokeWidth||2,name:$.name,animationDuration:w?1e3:0},$.dataKey)),p&&h.map(($,ae)=>jsxRuntime.jsx(recharts.ReferenceLine,{y:$.value,stroke:$.color||"#666",strokeDasharray:"5 5",label:$.label},ae)),p&&m.map(($,ae)=>jsxRuntime.jsx(recharts.ReferenceArea,{x1:$.x1,x2:$.x2,fill:$.color||"#f0f0f0",fillOpacity:.3,label:$.label},ae)),f&&jsxRuntime.jsx(recharts.Brush,{})]});case"bar":return jsxRuntime.jsxs(recharts.BarChart,{...J,children:[c&&jsxRuntime.jsx(recharts.CartesianGrid,{strokeDasharray:"3 3"}),jsxRuntime.jsx(recharts.XAxis,{dataKey:a}),jsxRuntime.jsx(recharts.YAxis,{}),d&&jsxRuntime.jsx(recharts.Tooltip,{}),u&&jsxRuntime.jsx(recharts.Legend,{}),ie.map(($,ae)=>jsxRuntime.jsx(recharts.Bar,{dataKey:$.dataKey,fill:$.color||g[ae%g.length],name:$.name,animationDuration:w?1e3:0},$.dataKey)),p&&h.map(($,ae)=>jsxRuntime.jsx(recharts.ReferenceLine,{y:$.value,stroke:$.color||"#666",strokeDasharray:"5 5",label:$.label},ae)),f&&jsxRuntime.jsx(recharts.Brush,{})]});case"area":return jsxRuntime.jsxs(recharts.AreaChart,{...J,children:[c&&jsxRuntime.jsx(recharts.CartesianGrid,{strokeDasharray:"3 3"}),jsxRuntime.jsx(recharts.XAxis,{dataKey:a}),jsxRuntime.jsx(recharts.YAxis,{}),d&&jsxRuntime.jsx(recharts.Tooltip,{}),u&&jsxRuntime.jsx(recharts.Legend,{}),ie.map(($,ae)=>jsxRuntime.jsx(recharts.Area,{type:$.type||"monotone",dataKey:$.dataKey,stroke:$.color||g[ae%g.length],fill:$.color||g[ae%g.length],fillOpacity:$.fillOpacity||.3,name:$.name,animationDuration:w?1e3:0},$.dataKey)),p&&h.map(($,ae)=>jsxRuntime.jsx(recharts.ReferenceLine,{y:$.value,stroke:$.color||"#666",strokeDasharray:"5 5",label:$.label},ae)),f&&jsxRuntime.jsx(recharts.Brush,{})]});case"pie":return jsxRuntime.jsxs(recharts.PieChart,{...J,children:[d&&jsxRuntime.jsx(recharts.Tooltip,{}),u&&jsxRuntime.jsx(recharts.Legend,{}),jsxRuntime.jsx(recharts.Pie,{data:t,dataKey:n[0]?.dataKey||"value",nameKey:a,cx:"50%",cy:"50%",outerRadius:Math.min(o,typeof s=="number"?s:400)/3,animationDuration:w?1e3:0,children:t.map(($,ae)=>jsxRuntime.jsx(recharts.Cell,{fill:g[ae%g.length]},`cell-${ae}`))})]});case"scatter":return jsxRuntime.jsxs(recharts.ScatterChart,{...J,children:[c&&jsxRuntime.jsx(recharts.CartesianGrid,{strokeDasharray:"3 3"}),jsxRuntime.jsx(recharts.XAxis,{dataKey:a}),jsxRuntime.jsx(recharts.YAxis,{dataKey:l}),d&&jsxRuntime.jsx(recharts.Tooltip,{}),u&&jsxRuntime.jsx(recharts.Legend,{}),ie.map(($,ae)=>jsxRuntime.jsx(recharts.Scatter,{dataKey:$.dataKey,fill:$.color||g[ae%g.length],name:$.name,animationDuration:w?1e3:0},$.dataKey))]});default:return jsxRuntime.jsx("div",{children:"Unsupported chart type"})}};return k?jsxRuntime.jsx(moonui.Card,{className:moonui.cn("w-full",b),children:jsxRuntime.jsx(moonui.CardContent,{className:"flex items-center justify-center",style:{height:o},children:jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx(lucideReact.RefreshCw,{className:"h-4 w-4 animate-spin"}),jsxRuntime.jsx("span",{children:"Loading chart..."})]})})}):y?jsxRuntime.jsx(moonui.Card,{className:moonui.cn("w-full",b),children:jsxRuntime.jsx(moonui.CardContent,{className:"flex items-center justify-center",style:{height:o},children:jsxRuntime.jsxs("div",{className:"text-center",children:[jsxRuntime.jsx("p",{className:"text-destructive mb-2",children:y}),T&&jsxRuntime.jsxs(moonui.Button,{variant:"outline",onClick:T,children:[jsxRuntime.jsx(lucideReact.RefreshCw,{className:"mr-2 h-4 w-4"}),"Retry"]})]})})}):jsxRuntime.jsxs(moonui.Card,{className:moonui.cn("w-full",b),ref:C,children:[jsxRuntime.jsxs(moonui.CardHeader,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[jsxRuntime.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsxs(moonui.CardTitle,{className:"text-base font-medium",children:[r,M&&jsxRuntime.jsxs("span",{className:"ml-2 inline-flex items-center",children:[M.direction==="up"&&jsxRuntime.jsx(lucideReact.TrendingUp,{className:"h-4 w-4 text-green-500"}),M.direction==="down"&&jsxRuntime.jsx(lucideReact.TrendingDown,{className:"h-4 w-4 text-red-500"}),M.direction==="neutral"&&jsxRuntime.jsx(lucideReact.Minus,{className:"h-4 w-4 text-gray-500"}),jsxRuntime.jsxs("span",{className:moonui.cn("ml-1 text-sm",M.direction==="up"&&"text-green-500",M.direction==="down"&&"text-red-500",M.direction==="neutral"&&"text-gray-500"),children:[M.percentage,"%"]})]})]}),i&&jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:i})]}),jsxRuntime.jsxs("div",{className:"flex items-center space-x-1",children:[T&&jsxRuntime.jsx(moonui.Button,{variant:"ghost",size:"sm",onClick:T,children:jsxRuntime.jsx(lucideReact.RefreshCw,{className:"h-4 w-4"})}),jsxRuntime.jsx(moonui.Button,{variant:"ghost",size:"sm",children:jsxRuntime.jsx(lucideReact.Settings,{className:"h-4 w-4"})}),S&&jsxRuntime.jsx(moonui.Button,{variant:"ghost",size:"sm",onClick:()=>U("png"),children:jsxRuntime.jsx(lucideReact.Download,{className:"h-4 w-4"})}),jsxRuntime.jsx(moonui.Button,{variant:"ghost",size:"sm",onClick:()=>x(!G),children:jsxRuntime.jsx(lucideReact.Maximize2,{className:"h-4 w-4"})})]})]}),jsxRuntime.jsx(moonui.CardContent,{children:O?jsxRuntime.jsx(recharts.ResponsiveContainer,{width:"100%",height:o,children:z()}):jsxRuntime.jsx("div",{style:{width:"100%",height:`${o}px`},children:z()})})]})}var Od=[{value:"meeting",label:"Meeting",color:"#3b82f6"},{value:"task",label:"Task",color:"#10b981"},{value:"reminder",label:"Reminder",color:"#f59e0b"},{value:"event",label:"Event",color:"#8b5cf6"}],Yy=["#3b82f6","#10b981","#f59e0b","#8b5cf6","#ef4444","#06b6d4","#84cc16","#f97316","#ec4899","#6366f1","#14b8a6","#eab308","#f43f5e","#a855f7","#22c55e"];function Rd({open:t,onOpenChange:e,event:n,selectedDate:r,onSave:i,onDelete:o,mode:s="create"}){let[a,l]=Mn.useState({title:"",description:"",date:"",startTime:"",endTime:"",location:"",type:"meeting",color:"#3b82f6",attendees:""}),[c,d]=Mn.useState({}),[u,f]=Mn.useState(!1);Mn.useEffect(()=>{if(s==="edit"&&n)l({title:n.title||"",description:n.description||"",date:n.date.toISOString().split("T")[0],startTime:n.startTime||"",endTime:n.endTime||"",location:n.location||"",type:n.type||"meeting",color:n.color||"#3b82f6",attendees:n.attendees?.join(", ")||""});else if(s==="create"){let b=r?r.toISOString().split("T")[0]:new Date().toISOString().split("T")[0];l({title:"",description:"",date:b,startTime:"",endTime:"",location:"",type:"meeting",color:"#3b82f6",attendees:""});}d({});},[n,r,s,t]);let p=()=>{let b={};return a.title.trim()||(b.title="Title is required"),a.date||(b.date="Date is required"),a.startTime&&a.endTime&&a.startTime>=a.endTime&&(b.endTime="End time must be after start time"),d(b),Object.keys(b).length===0},h=async b=>{if(b.preventDefault(),!!p()){f(!0);try{let v={...s==="edit"&&n?{id:n.id}:{},title:a.title.trim(),description:a.description.trim(),date:new Date(a.date+"T00:00:00"),startTime:a.startTime||void 0,endTime:a.endTime||void 0,location:a.location.trim()||void 0,type:a.type,color:a.color,attendees:a.attendees?a.attendees.split(",").map(S=>S.trim()).filter(Boolean):void 0};await i(v),e(!1);}catch(v){console.error("Error saving event:",v);}finally{f(!1);}}},m=()=>{n&&o&&(o(n.id),e(!1));},g=b=>{let v=Od.find(S=>S.value===b);l(S=>({...S,type:b,color:v?.color||S.color}));};return jsxRuntime.jsx(moonui.Dialog,{open:t,onOpenChange:e,children:jsxRuntime.jsxs(moonui.DialogContent,{className:"sm:max-w-[500px]",children:[jsxRuntime.jsxs(moonui.DialogHeader,{children:[jsxRuntime.jsxs(moonui.DialogTitle,{className:"flex items-center gap-2",children:[jsxRuntime.jsx(lucideReact.Calendar,{className:"w-5 h-5"}),s==="create"?"Create Event":"Edit Event"]}),jsxRuntime.jsx(moonui.DialogDescription,{children:s==="create"?"Add a new event to your calendar.":"Edit the event details."})]}),jsxRuntime.jsxs("form",{onSubmit:h,className:"space-y-4",children:[jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(moonui.Label,{htmlFor:"title",children:"Title *"}),jsxRuntime.jsx(moonui.Input,{id:"title",value:a.title,onChange:b=>l(v=>({...v,title:b.target.value})),placeholder:"Event title",className:moonui.cn(c.title&&"border-red-500")}),c.title&&jsxRuntime.jsx("p",{className:"text-sm text-red-500",children:c.title})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(moonui.Label,{htmlFor:"description",children:"Description"}),jsxRuntime.jsx(moonui.Textarea,{id:"description",value:a.description,onChange:b=>l(v=>({...v,description:b.target.value})),placeholder:"Event description (optional)",rows:3})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(moonui.Label,{htmlFor:"date",children:"Date *"}),jsxRuntime.jsx(moonui.Input,{id:"date",type:"date",value:a.date,onChange:b=>l(v=>({...v,date:b.target.value})),className:moonui.cn(c.date&&"border-red-500")}),c.date&&jsxRuntime.jsx("p",{className:"text-sm text-red-500",children:c.date})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(moonui.Label,{htmlFor:"startTime",children:"Start Time"}),jsxRuntime.jsx(moonui.Input,{id:"startTime",type:"time",value:a.startTime,onChange:b=>l(v=>({...v,startTime:b.target.value})),placeholder:"09:00"})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(moonui.Label,{htmlFor:"endTime",children:"End Time"}),jsxRuntime.jsx(moonui.Input,{id:"endTime",type:"time",value:a.endTime,onChange:b=>l(v=>({...v,endTime:b.target.value})),placeholder:"10:00",className:moonui.cn(c.endTime&&"border-red-500")}),c.endTime&&jsxRuntime.jsx("p",{className:"text-sm text-red-500",children:c.endTime})]})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsxs(moonui.Label,{htmlFor:"location",className:"flex items-center gap-2",children:[jsxRuntime.jsx(lucideReact.MapPin,{className:"w-4 h-4"}),"Location"]}),jsxRuntime.jsx(moonui.Input,{id:"location",value:a.location,onChange:b=>l(v=>({...v,location:b.target.value})),placeholder:"Meeting room, address, or link"})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsxs(moonui.Label,{className:"flex items-center gap-2",children:[jsxRuntime.jsx(lucideReact.Type,{className:"w-4 h-4"}),"Type"]}),jsxRuntime.jsxs(moonui.Select,{value:a.type,onValueChange:g,children:[jsxRuntime.jsx(moonui.SelectTrigger,{children:jsxRuntime.jsx(moonui.SelectValue,{})}),jsxRuntime.jsx(moonui.SelectContent,{children:Od.map(b=>jsxRuntime.jsx(moonui.SelectItem,{value:b.value,children:jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:b.color}}),b.label]})},b.value))})]})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsxs(moonui.Label,{className:"flex items-center gap-2",children:[jsxRuntime.jsx(lucideReact.Palette,{className:"w-4 h-4"}),"Color"]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(moonui.ColorPicker,{value:a.color,onChange:b=>l(v=>({...v,color:b})),presets:Yy,showInput:!1,size:"sm"}),jsxRuntime.jsx("div",{className:"w-6 h-6 rounded border",style:{backgroundColor:a.color}})]})]})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(moonui.Label,{htmlFor:"attendees",children:"Attendees"}),jsxRuntime.jsx(moonui.Input,{id:"attendees",value:a.attendees,onChange:b=>l(v=>({...v,attendees:b.target.value})),placeholder:"John Doe, Jane Smith (comma-separated)"})]}),jsxRuntime.jsxs(moonui.DialogFooter,{className:"gap-2",children:[s==="edit"&&o&&jsxRuntime.jsx(moonui.Button,{type:"button",variant:"destructive",onClick:m,className:"mr-auto",children:"Delete Event"}),jsxRuntime.jsx(moonui.Button,{type:"button",variant:"outline",onClick:()=>e(!1),disabled:u,children:"Cancel"}),jsxRuntime.jsx(moonui.Button,{type:"submit",disabled:u,children:u?s==="create"?"Creating...":"Saving...":s==="create"?"Create Event":"Save Changes"})]})]})]})})}var zd=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],c0=["January","February","March","April","May","June","July","August","September","October","November","December"],Fd={meeting:"bg-blue-500",task:"bg-green-500",reminder:"bg-yellow-500",event:"bg-purple-500"};function FA({events:t=[],onEventClick:e,onEventAdd:n,onEventEdit:r,onEventDelete:i,className:o,showWeekends:s=!0,showEventDetails:a=!0,disabled:l=!1,minDate:c,maxDate:d,highlightToday:u=!0,height:f}){let {hasProAccess:h,isLoading:m}=lt();if(!m&&!h)return jsxRuntime.jsx(moonui.Card,{className:moonui.cn("w-full",o),children:jsxRuntime.jsx(moonui.CardContent,{className:"py-12 text-center",children:jsxRuntime.jsxs("div",{className:"max-w-md mx-auto space-y-4",children:[jsxRuntime.jsx("div",{className:"rounded-full bg-purple-100 dark:bg-purple-900/30 p-3 w-fit mx-auto",children:jsxRuntime.jsx(lucideReact.Lock,{className:"h-6 w-6 text-purple-600 dark:text-purple-400"})}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"font-semibold text-lg mb-2",children:"Pro Feature"}),jsxRuntime.jsx("p",{className:"text-muted-foreground text-sm mb-4",children:"Calendar is available exclusively to MoonUI Pro subscribers."}),jsxRuntime.jsx("div",{className:"flex gap-3 justify-center",children:jsxRuntime.jsx("a",{href:"/pricing",children:jsxRuntime.jsxs(moonui.Button,{size:"sm",children:[jsxRuntime.jsx(lucideReact.Sparkles,{className:"mr-2 h-4 w-4"}),"Upgrade to Pro"]})})})]})]})})});let [b,v]=Mn__default.default.useState(new Date),[S,T]=Mn__default.default.useState(null);Mn__default.default.useState("month");let [k,y]=Mn__default.default.useState(!1),[w,O]=Mn__default.default.useState("create"),[X,R]=Mn__default.default.useState(null),[ce,Q]=Mn__default.default.useState(null),[G,x]=Mn__default.default.useState(null),C=new Date,M=b.getMonth(),U=b.getFullYear(),z=new Date(U,M,1),J=new Date(U,M+1,0),ie=new Date(z);ie.setDate(ie.getDate()-ie.getDay());let $=new Date(J);$.setDate($.getDate()+(6-$.getDay()));let ae=[],_e=new Date(ie);for(;_e<=$;)ae.push(new Date(_e)),_e.setDate(_e.getDate()+1);let $e=F=>t.filter(D=>new Date(D.date).toDateString()===F.toDateString()),it=F=>F.toDateString()===C.toDateString(),ln=F=>F.getMonth()===M,ht=F=>S&&F.toDateString()===S.toDateString(),Wt=F=>!!(l||c&&F<c||d&&F>d),mt=F=>{let D=new Date(b);F==="prev"?D.setMonth(M-1):D.setMonth(M+1),v(D);},jn=F=>{if(Wt(F))return;T(F);let D=$e(F);D.length===0?(O("create"),R(null),y(!0)):D.length===1&&e?.(D[0]);},Ut=(F,D)=>{D.stopPropagation(),e?.(F);},cn=(F,D)=>{Q(F),D.dataTransfer.effectAllowed="move",D.dataTransfer.setData("text/plain",F.id);let K=D.target;K.style.opacity="0.5";},ot=F=>{Q(null),x(null);let D=F.target;D.style.opacity="1";},ve=(F,D)=>{Wt(F)||!ce||(D.preventDefault(),D.dataTransfer.dropEffect="move",x(F));},Nt=(F,D)=>{if(D.preventDefault(),!(!ce||Wt(F))){if(ce.date.toDateString()!==F.toDateString()){let K={...ce,date:F};r?.(K);}Q(null),x(null);}},A=(F,D)=>{D.stopPropagation(),O("edit"),R(F),y(!0);},ee=(F,D)=>{D.stopPropagation(),i?.(F.id);},de=F=>{w==="create"?n?.(F):w==="edit"&&F.id&&r?.(F);},Y=F=>{i?.(F);},st=()=>{v(new Date),T(new Date);},Tt=s?ae:ae.filter(F=>{let D=F.getDay();return D!==0&&D!==6}),si=s?zd:zd.slice(1,6);return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(moonui.Card,{className:moonui.cn("w-full max-w-full overflow-hidden",o),style:{height:f?`${f}px`:void 0},children:[jsxRuntime.jsx(moonui.CardHeader,{children:jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs(moonui.CardTitle,{className:"flex items-center gap-2",children:[jsxRuntime.jsx(lucideReact.Calendar,{className:"h-5 w-5"}),"Calendar"]}),jsxRuntime.jsxs(moonui.CardDescription,{children:[c0[M]," ",U]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(moonui.Button,{variant:"outline",size:"sm",onClick:st,children:"Today"}),jsxRuntime.jsx(moonui.Button,{variant:"outline",size:"sm",onClick:()=>mt("prev"),disabled:l,children:jsxRuntime.jsx(lucideReact.ChevronLeft,{className:"h-4 w-4"})}),jsxRuntime.jsx(moonui.Button,{variant:"outline",size:"sm",onClick:()=>mt("next"),disabled:l,children:jsxRuntime.jsx(lucideReact.ChevronRight,{className:"h-4 w-4"})})]})]})}),jsxRuntime.jsx(moonui.CardContent,{className:"overflow-x-auto",children:jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsxs("div",{className:"grid grid-cols-7 gap-1 w-full",style:{minWidth:"500px"},children:[si.map(F=>jsxRuntime.jsx("div",{className:"p-1 text-center text-xs font-medium text-muted-foreground min-w-[70px]",children:F},F)),Tt.map((F,D)=>{let K=$e(F),ue=ln(F),we=it(F),Je=ht(F),Ht=Wt(F);return jsxRuntime.jsxs("div",{className:moonui.cn("min-h-[80px] min-w-[70px] p-1 border border-border/50 cursor-pointer hover:bg-muted/50 transition-colors text-xs flex flex-col",!ue&&"text-muted-foreground bg-muted/20",we&&u&&"bg-primary/10 border-primary/50",Je&&"bg-primary/20 border-primary",Ht&&"cursor-not-allowed opacity-50",G&&G.toDateString()===F.toDateString()&&"bg-primary/30 border-primary"),onClick:()=>jn(F),onDragOver:Qe=>ve(F,Qe),onDrop:Qe=>Nt(F,Qe),children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-1",children:[jsxRuntime.jsx("span",{className:moonui.cn("text-sm font-medium",we&&"text-primary font-bold"),children:F.getDate()}),K.length>0&&jsxRuntime.jsx(moonui.Badge,{variant:"secondary",className:"text-xs px-1",children:K.length})]}),jsxRuntime.jsxs("div",{className:"flex-1 space-y-1 overflow-hidden",children:[K.slice(0,3).map(Qe=>jsxRuntime.jsxs("div",{className:moonui.cn("text-xs p-1 mb-1 rounded text-white cursor-move group relative select-none block w-full truncate",Qe.color||Fd[Qe.type||"event"]),draggable:!l,onClick:dn=>Ut(Qe,dn),onDragStart:dn=>cn(Qe,dn),onDragEnd:ot,style:{backgroundColor:Qe.color||void 0},children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("span",{className:"truncate flex-1",children:Qe.title}),a&&jsxRuntime.jsxs("div",{className:"hidden group-hover:flex items-center gap-1 ml-1",children:[jsxRuntime.jsx(moonui.Button,{variant:"ghost",size:"sm",className:"h-4 w-4 p-0 text-white/80 hover:text-white",onClick:dn=>A(Qe,dn),children:jsxRuntime.jsx(lucideReact.Edit,{className:"h-3 w-3"})}),jsxRuntime.jsx(moonui.Button,{variant:"ghost",size:"sm",className:"h-4 w-4 p-0 text-white/80 hover:text-white",onClick:dn=>ee(Qe,dn),children:jsxRuntime.jsx(lucideReact.Trash2,{className:"h-3 w-3"})})]})]}),Qe.startTime&&jsxRuntime.jsxs("div",{className:"flex items-center gap-1 mt-1",children:[jsxRuntime.jsx(lucideReact.Clock,{className:"h-3 w-3"}),jsxRuntime.jsx("span",{children:Qe.startTime})]})]},Qe.id)),K.length>3&&jsxRuntime.jsxs("div",{className:"text-xs text-muted-foreground text-center",children:["+",K.length-3," more"]})]})]},D)})]}),S&&jsxRuntime.jsxs("div",{className:"border rounded-lg p-4 bg-muted/50",children:[jsxRuntime.jsx("h4",{className:"font-medium mb-2",children:S.toLocaleDateString("en-US",{weekday:"long",year:"numeric",month:"long",day:"numeric"})}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[$e(S).map(F=>jsxRuntime.jsxs("div",{className:"flex items-start gap-3 p-2 border rounded",children:[jsxRuntime.jsx("div",{className:moonui.cn("w-3 h-3 rounded-full mt-1 flex-shrink-0",F.color||Fd[F.type||"event"])}),jsxRuntime.jsxs("div",{className:"flex-1",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("h5",{className:"font-medium",children:F.title}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx(moonui.Button,{variant:"ghost",size:"sm",onClick:D=>A(F,D),children:jsxRuntime.jsx(lucideReact.Edit,{className:"h-4 w-4"})}),jsxRuntime.jsx(moonui.Button,{variant:"ghost",size:"sm",onClick:D=>ee(F,D),children:jsxRuntime.jsx(lucideReact.Trash2,{className:"h-4 w-4"})})]})]}),F.description&&jsxRuntime.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:F.description}),jsxRuntime.jsxs("div",{className:"flex items-center gap-4 text-xs text-muted-foreground mt-2",children:[F.startTime&&jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx(lucideReact.Clock,{className:"h-3 w-3"}),jsxRuntime.jsxs("span",{children:[F.startTime," - ",F.endTime]})]}),F.location&&jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx(lucideReact.MapPin,{className:"h-3 w-3"}),jsxRuntime.jsx("span",{children:F.location})]}),F.attendees&&F.attendees.length>0&&jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx(lucideReact.User,{className:"h-3 w-3"}),jsxRuntime.jsxs("span",{children:[F.attendees.length," attendees"]})]})]})]})]},F.id)),$e(S).length===0&&jsxRuntime.jsxs("div",{className:"text-center py-4",children:[jsxRuntime.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:"No events scheduled for this date"}),jsxRuntime.jsxs(moonui.Button,{variant:"outline",size:"sm",onClick:()=>{O("create"),R(null),y(!0);},children:[jsxRuntime.jsx(lucideReact.Plus,{className:"h-4 w-4 mr-1"}),"Add Event"]})]})]})]})]})})]}),jsxRuntime.jsx(Rd,{open:k,onOpenChange:y,event:X,selectedDate:S,onSave:de,onDelete:Y,mode:w})]})}var k0={primary:"text-blue-600",success:"text-green-600",warning:"text-yellow-600",danger:"text-red-600",info:"text-purple-600"},N0={sm:"col-span-1",md:"col-span-2",lg:"col-span-3",xl:"col-span-4"};function XA({metrics:t=[],widgets:e=[],onMetricClick:n,onWidgetAction:r,className:i,showHeader:o=!0,title:s="Dashboard",description:a="Overview of your key metrics and performance",refreshable:l=!0,onRefresh:c,loading:d=!1}){let {hasProAccess:f,isLoading:p}=lt();if(!p&&!f)return jsxRuntime.jsx(moonui.Card,{className:moonui.cn("w-full",i),children:jsxRuntime.jsx(moonui.CardContent,{className:"py-12 text-center",children:jsxRuntime.jsxs("div",{className:"max-w-md mx-auto space-y-4",children:[jsxRuntime.jsx("div",{className:"rounded-full bg-purple-100 dark:bg-purple-900/30 p-3 w-fit mx-auto",children:jsxRuntime.jsx(lucideReact.Lock,{className:"h-6 w-6 text-purple-600 dark:text-purple-400"})}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"font-semibold text-lg mb-2",children:"Pro Feature"}),jsxRuntime.jsx("p",{className:"text-muted-foreground text-sm mb-4",children:"Dashboard is available exclusively to MoonUI Pro subscribers."}),jsxRuntime.jsx("div",{className:"flex gap-3 justify-center",children:jsxRuntime.jsx("a",{href:"/pricing",children:jsxRuntime.jsxs(moonui.Button,{size:"sm",children:[jsxRuntime.jsx(lucideReact.Sparkles,{className:"mr-2 h-4 w-4"}),"Upgrade to Pro"]})})})]})]})})});let[m,g]=Mn__default.default.useState(!1),b=async()=>{if(c){g(!0);try{await c();}finally{g(!1);}}},v=w=>typeof w=="number"?w>=1e6?(w/1e6).toFixed(1)+"M":w>=1e3?(w/1e3).toFixed(1)+"K":w.toLocaleString():w.toString(),S=w=>{switch(w){case"increase":return jsxRuntime.jsx(lucideReact.ArrowUpRight,{className:"h-4 w-4"});case"decrease":return jsxRuntime.jsx(lucideReact.ArrowDownRight,{className:"h-4 w-4"});case"neutral":return jsxRuntime.jsx(lucideReact.Minus,{className:"h-4 w-4"})}},T=w=>{switch(w){case"increase":return "text-green-600";case"decrease":return "text-red-600";case"neutral":return "text-gray-600"}},_=w=>{let O=w.color?k0[w.color]:"text-foreground";return jsxRuntime.jsxs(moonui.Card,{className:moonui.cn("cursor-pointer hover:shadow-md transition-shadow",n&&"hover:bg-muted/50"),onClick:()=>n?.(w),children:[jsxRuntime.jsxs(moonui.CardHeader,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[jsxRuntime.jsx(moonui.CardTitle,{className:"text-sm font-medium",children:w.title}),jsxRuntime.jsx("div",{className:moonui.cn("h-4 w-4",O),children:w.icon})]}),jsxRuntime.jsxs(moonui.CardContent,{children:[jsxRuntime.jsx("div",{className:"text-2xl font-bold",children:v(w.value)}),w.change&&jsxRuntime.jsxs("div",{className:moonui.cn("flex items-center text-xs mt-1",T(w.change.type)),children:[S(w.change.type),jsxRuntime.jsxs("span",{className:"ml-1",children:[Math.abs(w.change.value),"% from ",w.change.period]})]}),w.description&&jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:w.description})]})]},w.id)},I=w=>{let O=N0[w.size||"md"];return jsxRuntime.jsxs(moonui.Card,{className:moonui.cn("h-fit",O),children:[jsxRuntime.jsx(moonui.CardHeader,{children:jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(moonui.CardTitle,{className:"text-base",children:w.title}),w.description&&jsxRuntime.jsx(moonui.CardDescription,{className:"mt-1",children:w.description})]}),jsxRuntime.jsx(moonui.Button,{variant:"ghost",size:"sm",onClick:()=>r?.(w.id,"menu"),children:jsxRuntime.jsx(lucideReact.BarChart3,{className:"h-4 w-4"})})]})}),jsxRuntime.jsx(moonui.CardContent,{children:w.loading?jsxRuntime.jsx("div",{className:"flex items-center justify-center h-32",children:jsxRuntime.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"})}):w.error?jsxRuntime.jsx("div",{className:"flex items-center justify-center h-32 text-destructive",children:jsxRuntime.jsx("p",{className:"text-sm",children:w.error})}):w.content})]},w.id)},k=[{id:"total-users",title:"Total Users",value:2543,change:{value:12,type:"increase",period:"last month"},icon:jsxRuntime.jsx(lucideReact.Users,{className:"h-4 w-4"}),color:"primary"},{id:"revenue",title:"Revenue",value:"$12,345",change:{value:8,type:"increase",period:"last month"},icon:jsxRuntime.jsx(lucideReact.DollarSign,{className:"h-4 w-4"}),color:"success"},{id:"active-sessions",title:"Active Sessions",value:1234,change:{value:2,type:"decrease",period:"last hour"},icon:jsxRuntime.jsx(lucideReact.Activity,{className:"h-4 w-4"}),color:"warning"},{id:"conversion-rate",title:"Conversion Rate",value:"3.2%",change:{value:.3,type:"increase",period:"last week"},icon:jsxRuntime.jsx(lucideReact.TrendingUp,{className:"h-4 w-4"}),color:"info"}],y=t.length>0?t:k;return d?jsxRuntime.jsx("div",{className:moonui.cn("w-full",i),children:jsxRuntime.jsxs("div",{className:"animate-pulse space-y-4",children:[jsxRuntime.jsx("div",{className:"h-8 bg-muted rounded w-1/4"}),jsxRuntime.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-4",children:[...Array(4)].map((w,O)=>jsxRuntime.jsx("div",{className:"h-32 bg-muted rounded"},O))})]})}):jsxRuntime.jsxs("div",{className:moonui.cn("w-full space-y-6",i),children:[o&&jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:s}),jsxRuntime.jsx("p",{className:"text-muted-foreground",children:a})]}),l&&jsxRuntime.jsxs(moonui.Button,{variant:"outline",onClick:b,disabled:m,children:[m?jsxRuntime.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-primary mr-2"}):jsxRuntime.jsx(lucideReact.Activity,{className:"h-4 w-4 mr-2"}),"Refresh"]})]}),jsxRuntime.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-4",children:y.map(_)}),e.length>0&&jsxRuntime.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-4",children:e.map(I)}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2 pt-4 border-t",children:[jsxRuntime.jsxs(moonui.Button,{variant:"outline",size:"sm",children:[jsxRuntime.jsx(lucideReact.Download,{className:"h-4 w-4 mr-2"}),"Export Data"]}),jsxRuntime.jsxs(moonui.Button,{variant:"outline",size:"sm",children:[jsxRuntime.jsx(lucideReact.Calendar,{className:"h-4 w-4 mr-2"}),"Schedule Report"]}),jsxRuntime.jsxs(moonui.Button,{variant:"outline",size:"sm",children:[jsxRuntime.jsx(lucideReact.Star,{className:"h-4 w-4 mr-2"}),"Save View"]})]})]})}function h1({columns:t,data:e,searchable:n=!0,filterable:r=!0,exportable:i=!0,selectable:o=!1,pagination:s=!0,pageSize:a=10,className:l,onRowSelect:c,onExport:d,features:u={},theme:f={},texts:p={}}){let {hasProAccess:m,isLoading:g}=lt();if(!g&&!m)return jsxRuntime.jsx(moonui.Card,{className:moonui.cn("w-full",l),children:jsxRuntime.jsx(moonui.CardContent,{className:"py-12 text-center",children:jsxRuntime.jsxs("div",{className:"max-w-md mx-auto space-y-4",children:[jsxRuntime.jsx("div",{className:"rounded-full bg-purple-100 dark:bg-purple-900/30 p-3 w-fit mx-auto",children:jsxRuntime.jsx(lucideReact.Lock,{className:"h-6 w-6 text-purple-600 dark:text-purple-400"})}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"font-semibold text-lg mb-2",children:"Pro Feature"}),jsxRuntime.jsx("p",{className:"text-muted-foreground text-sm mb-4",children:"Data Table is available exclusively to MoonUI Pro subscribers."}),jsxRuntime.jsx("div",{className:"flex gap-3 justify-center",children:jsxRuntime.jsx("a",{href:"/pricing",children:jsxRuntime.jsxs(moonui.Button,{size:"sm",children:[jsxRuntime.jsx(lucideReact.Sparkles,{className:"mr-2 h-4 w-4"}),"Upgrade to Pro"]})})})]})]})})});let[v,S]=Mn__default.default.useState([]),[T,_]=Mn__default.default.useState([]),[I,k]=Mn__default.default.useState({}),[y,w]=Mn__default.default.useState({}),[O,X]=Mn__default.default.useState(""),R=reactTable.useReactTable({data:e,columns:t,onSortingChange:S,onColumnFiltersChange:_,getCoreRowModel:reactTable.getCoreRowModel(),getPaginationRowModel:reactTable.getPaginationRowModel(),getSortedRowModel:reactTable.getSortedRowModel(),getFilteredRowModel:reactTable.getFilteredRowModel(),onColumnVisibilityChange:k,onRowSelectionChange:w,onGlobalFilterChange:X,globalFilterFn:"includesString",state:{sorting:v,columnFilters:T,columnVisibility:I,rowSelection:y,globalFilter:O},initialState:{pagination:{pageSize:a}}});Mn__default.default.useEffect(()=>{if(c&&o){let G=R.getFilteredSelectedRowModel().rows.map(x=>x.original);c(G);}},[y,c,o,R]);({sorting:u.sorting!==!1,filtering:u.filtering!==!1||r,pagination:u.pagination!==!1||s,search:u.search!==!1||n,columnVisibility:u.columnVisibility!==!1,rowSelection:u.rowSelection!==!1||o,export:u.export!==!1||i});let Q=()=>{if(d){let G=R.getFilteredSelectedRowModel().rows,x=G.length>0?G.map(C=>C.original):R.getFilteredRowModel().rows.map(C=>C.original);d(x);}};return jsxRuntime.jsxs("div",{className:moonui.cn("space-y-4",l),children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[n&&jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx(lucideReact.Search,{className:"absolute left-2 top-2.5 h-4 w-4 text-muted-foreground"}),jsxRuntime.jsx(moonui.Input,{placeholder:"Search all columns...",value:O,onChange:G=>X(G.target.value),className:"pl-8 w-64"})]}),r&&jsxRuntime.jsxs(moonui.Button,{variant:"outline",size:"sm",children:[jsxRuntime.jsx(lucideReact.Filter,{className:"mr-2 h-4 w-4"}),"Filters"]})]}),jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[i&&jsxRuntime.jsxs(moonui.Button,{variant:"outline",size:"sm",onClick:Q,children:[jsxRuntime.jsx(lucideReact.Download,{className:"mr-2 h-4 w-4"}),"Export"]}),jsxRuntime.jsxs(moonui.Button,{variant:"outline",size:"sm",children:[jsxRuntime.jsx(lucideReact.Settings,{className:"mr-2 h-4 w-4"}),"Columns"]})]})]}),jsxRuntime.jsx("div",{className:"rounded-md border",children:jsxRuntime.jsxs("table",{className:"w-full",children:[jsxRuntime.jsx("thead",{children:R.getHeaderGroups().map(G=>jsxRuntime.jsx("tr",{className:"border-b",children:G.headers.map(x=>jsxRuntime.jsx("th",{className:"h-12 px-4 text-left align-middle font-medium text-muted-foreground",children:x.isPlaceholder?null:jsxRuntime.jsxs("div",{className:moonui.cn("flex items-center space-x-2",x.column.getCanSort()&&"cursor-pointer select-none"),onClick:x.column.getToggleSortingHandler(),children:[reactTable.flexRender(x.column.columnDef.header,x.getContext()),x.column.getCanSort()&&jsxRuntime.jsx("div",{className:"ml-2",children:x.column.getIsSorted()==="asc"?jsxRuntime.jsx(lucideReact.ArrowUp,{className:"h-4 w-4"}):x.column.getIsSorted()==="desc"?jsxRuntime.jsx(lucideReact.ArrowDown,{className:"h-4 w-4"}):jsxRuntime.jsx(lucideReact.ArrowUpDown,{className:"h-4 w-4"})})]})},x.id))},G.id))}),jsxRuntime.jsx("tbody",{children:R.getRowModel().rows?.length?R.getRowModel().rows.map(G=>jsxRuntime.jsx("tr",{className:moonui.cn("border-b transition-colors hover:bg-muted/50",G.getIsSelected()&&"bg-muted"),children:G.getVisibleCells().map(x=>jsxRuntime.jsx("td",{className:"p-4 align-middle",children:reactTable.flexRender(x.column.columnDef.cell,x.getContext())},x.id))},G.id)):jsxRuntime.jsx("tr",{children:jsxRuntime.jsx("td",{colSpan:t.length,className:"h-24 text-center",children:"No results found."})})})]})}),s&&jsxRuntime.jsxs("div",{className:"flex items-center justify-between px-2",children:[jsxRuntime.jsx("div",{className:"flex-1 text-sm text-muted-foreground",children:o&&R.getFilteredSelectedRowModel().rows.length>0&&jsxRuntime.jsxs("span",{children:[R.getFilteredSelectedRowModel().rows.length," of"," ",R.getFilteredRowModel().rows.length," row(s) selected."]})}),jsxRuntime.jsxs("div",{className:"flex items-center space-x-6 lg:space-x-8",children:[jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium",children:"Rows per page"}),jsxRuntime.jsx("select",{value:R.getState().pagination.pageSize,onChange:G=>R.setPageSize(Number(G.target.value)),className:"h-8 w-[70px] rounded border border-input bg-background px-3 py-1 text-sm",children:[10,20,30,40,50].map(G=>jsxRuntime.jsx("option",{value:G,children:G},G))})]}),jsxRuntime.jsxs("div",{className:"flex w-[100px] items-center justify-center text-sm font-medium",children:["Page ",R.getState().pagination.pageIndex+1," of"," ",R.getPageCount()]}),jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx(moonui.Button,{variant:"outline",className:"hidden h-8 w-8 p-0 lg:flex",onClick:()=>R.setPageIndex(0),disabled:!R.getCanPreviousPage(),children:jsxRuntime.jsx(lucideReact.ChevronsLeft,{className:"h-4 w-4"})}),jsxRuntime.jsx(moonui.Button,{variant:"outline",className:"h-8 w-8 p-0",onClick:()=>R.previousPage(),disabled:!R.getCanPreviousPage(),children:jsxRuntime.jsx(lucideReact.ChevronLeft,{className:"h-4 w-4"})}),jsxRuntime.jsx(moonui.Button,{variant:"outline",className:"h-8 w-8 p-0",onClick:()=>R.nextPage(),disabled:!R.getCanNextPage(),children:jsxRuntime.jsx(lucideReact.ChevronRight,{className:"h-4 w-4"})}),jsxRuntime.jsx(moonui.Button,{variant:"outline",className:"hidden h-8 w-8 p-0 lg:flex",onClick:()=>R.setPageIndex(R.getPageCount()-1),disabled:!R.getCanNextPage(),children:jsxRuntime.jsx(lucideReact.ChevronsRight,{className:"h-4 w-4"})})]})]})]})]})}var uE=t=>t.startsWith("image/")?jsxRuntime.jsx(lucideReact.Image,{className:"h-4 w-4"}):t.startsWith("video/")?jsxRuntime.jsx(lucideReact.Video,{className:"h-4 w-4"}):t.startsWith("audio/")?jsxRuntime.jsx(lucideReact.Music,{className:"h-4 w-4"}):t.includes("pdf")?jsxRuntime.jsx(lucideReact.FileText,{className:"h-4 w-4"}):t.includes("zip")||t.includes("rar")?jsxRuntime.jsx(lucideReact.Archive,{className:"h-4 w-4"}):jsxRuntime.jsx(lucideReact.File,{className:"h-4 w-4"}),fE=t=>{if(t===0)return "0 Bytes";let e=1024,n=["Bytes","KB","MB","GB"],r=Math.floor(Math.log(t)/Math.log(e));return parseFloat((t/Math.pow(e,r)).toFixed(2))+" "+n[r]};function N1({accept:t="*",multiple:e=!1,maxSize:n=10,maxFiles:r=5,onUpload:i,onRemove:o,className:s,disabled:a=!1,showPreview:l=!0,allowedTypes:c=[]}){let {hasProAccess:u,isLoading:f}=lt();if(!f&&!u)return jsxRuntime.jsx(moonui.Card,{className:moonui.cn("w-full",s),children:jsxRuntime.jsx(moonui.CardContent,{className:"py-12 text-center",children:jsxRuntime.jsxs("div",{className:"max-w-md mx-auto space-y-4",children:[jsxRuntime.jsx("div",{className:"rounded-full bg-purple-100 dark:bg-purple-900/30 p-3 w-fit mx-auto",children:jsxRuntime.jsx(lucideReact.Lock,{className:"h-6 w-6 text-purple-600 dark:text-purple-400"})}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"font-semibold text-lg mb-2",children:"Pro Feature"}),jsxRuntime.jsx("p",{className:"text-muted-foreground text-sm mb-4",children:"File Upload is available exclusively to MoonUI Pro subscribers."}),jsxRuntime.jsx("div",{className:"flex gap-3 justify-center",children:jsxRuntime.jsx("a",{href:"/pricing",children:jsxRuntime.jsxs(moonui.Button,{size:"sm",children:[jsxRuntime.jsx(lucideReact.Sparkles,{className:"mr-2 h-4 w-4"}),"Upgrade to Pro"]})})})]})]})})});let[h,m]=Mn__default.default.useState([]),[g,b]=Mn__default.default.useState(!1),[v,S]=Mn__default.default.useState(!1),T=Mn__default.default.useRef(null),_=R=>R.size>n*1024*1024?`File size must be less than ${n}MB`:c.length>0&&!c.includes(R.type)?`File type ${R.type} is not allowed`:null,I=async R=>{if(!R||a)return;let ce=Array.from(R);if(h.length+ce.length>r){alert(`Maximum ${r} files allowed`);return}let Q=[],G=[];if(ce.forEach(x=>{let C=_(x);C?G.push(`${x.name}: ${C}`):Q.push({file:x,id:Math.random().toString(36).substr(2,9),status:"uploading",progress:0});}),G.length>0&&alert(G.join(`
|
|
25
|
-
`)),Q.length!==0){if(m(x=>[...x,...Q]),S(!0),i)try{await i(Q.map(x=>x.file)),m(x=>x.map(C=>Q.find(M=>M.id===C.id)?{...C,status:"success",progress:100}:C));}catch{m(C=>C.map(M=>Q.find(U=>U.id===M.id)?{...M,status:"error",error:"Upload failed"}:M));}else for(let x of Q){let C=setInterval(()=>{m(M=>M.map(U=>U.id===x.id&&U.progress<100?{...U,progress:U.progress+10}:U));},100);setTimeout(()=>{clearInterval(C),m(M=>M.map(U=>U.id===x.id?{...U,status:"success",progress:100}:U));},1e3);}S(!1);}},k=R=>{m(ce=>ce.filter(Q=>Q.id!==R.id)),o&&o(R.file);},y=R=>{R.preventDefault(),b(!1),I(R.dataTransfer.files);},w=R=>{R.preventDefault(),b(!0);},O=R=>{R.preventDefault(),b(!1);},X=()=>{a||T.current?.click();};return jsxRuntime.jsxs(moonui.Card,{className:moonui.cn("w-full",s),children:[jsxRuntime.jsxs(moonui.CardHeader,{children:[jsxRuntime.jsxs(moonui.CardTitle,{className:"flex items-center gap-2",children:[jsxRuntime.jsx(lucideReact.Upload,{className:"h-5 w-5"}),"File Upload"]}),jsxRuntime.jsxs(moonui.CardDescription,{children:[e?`Upload up to ${r} files`:"Upload a file"," (max ",n,"MB each)"]})]}),jsxRuntime.jsxs(moonui.CardContent,{className:"space-y-4",children:[jsxRuntime.jsxs("div",{className:moonui.cn("border-2 border-dashed rounded-lg p-8 text-center cursor-pointer transition-colors",g?"border-primary bg-primary/5":"border-muted-foreground/25",a&&"cursor-not-allowed opacity-50"),onDrop:y,onDragOver:w,onDragLeave:O,onClick:X,children:[jsxRuntime.jsx(lucideReact.Upload,{className:"h-10 w-10 mx-auto mb-4 text-muted-foreground"}),jsxRuntime.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:"Drag and drop files here, or click to select"}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:t==="*"?"Any file type":`Accepted types: ${t}`})]}),jsxRuntime.jsx("input",{ref:T,type:"file",accept:t,multiple:e,onChange:R=>I(R.target.files),className:"hidden",disabled:a}),h.length>0&&jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsxs("h4",{className:"text-sm font-medium",children:["Uploaded Files (",h.length,")"]}),h.map(R=>jsxRuntime.jsxs("div",{className:"flex items-center gap-3 p-3 border rounded-lg",children:[jsxRuntime.jsx("div",{className:"flex-shrink-0",children:uE(R.file.type)}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium truncate",children:R.file.name}),jsxRuntime.jsxs(moonui.Badge,{variant:R.status==="success"?"success":R.status==="error"?"destructive":"secondary",children:[R.status==="uploading"&&jsxRuntime.jsx(lucideReact.Loader2,{className:"h-3 w-3 mr-1 animate-spin"}),R.status==="success"&&jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"h-3 w-3 mr-1"}),R.status==="error"&&jsxRuntime.jsx(lucideReact.AlertCircle,{className:"h-3 w-3 mr-1"}),R.status]})]}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between mt-1",children:[jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:fE(R.file.size)}),R.status==="uploading"&&jsxRuntime.jsxs("span",{className:"text-xs text-muted-foreground",children:[R.progress,"%"]})]}),R.status==="uploading"&&jsxRuntime.jsx(moonui.Progress,{value:R.progress,className:"mt-2"}),R.error&&jsxRuntime.jsx("p",{className:"text-xs text-destructive mt-1",children:R.error})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[R.status==="success"&&l&&R.file.type.startsWith("image/")&&jsxRuntime.jsx(moonui.Button,{variant:"ghost",size:"sm",children:jsxRuntime.jsx(lucideReact.Download,{className:"h-4 w-4"})}),jsxRuntime.jsx(moonui.Button,{variant:"ghost",size:"sm",onClick:()=>k(R),disabled:R.status==="uploading",children:jsxRuntime.jsx(lucideReact.X,{className:"h-4 w-4"})})]})]},R.id))]}),v&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[jsxRuntime.jsx(lucideReact.Loader2,{className:"h-4 w-4 animate-spin"}),"Uploading files..."]})]})]})}var _E={low:"bg-green-500",medium:"bg-yellow-500",high:"bg-orange-500",urgent:"bg-red-500"};function F1({columns:t,onCardMove:e,onCardClick:n,onCardEdit:r,onCardDelete:i,onAddCard:o,onAddColumn:s,className:a,showAddColumn:l=!0,showCardDetails:c=!0,disabled:d=!1}){let {hasProAccess:f,isLoading:p}=lt();if(!p&&!f)return jsxRuntime.jsx(moonui.Card,{className:moonui.cn("w-full",a),children:jsxRuntime.jsx(moonui.CardContent,{className:"py-12 text-center",children:jsxRuntime.jsxs("div",{className:"max-w-md mx-auto space-y-4",children:[jsxRuntime.jsx("div",{className:"rounded-full bg-purple-100 dark:bg-purple-900/30 p-3 w-fit mx-auto",children:jsxRuntime.jsx(lucideReact.Lock,{className:"h-6 w-6 text-purple-600 dark:text-purple-400"})}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"font-semibold text-lg mb-2",children:"Pro Feature"}),jsxRuntime.jsx("p",{className:"text-muted-foreground text-sm mb-4",children:"Kanban Board is available exclusively to MoonUI Pro subscribers."}),jsxRuntime.jsx("div",{className:"flex gap-3 justify-center",children:jsxRuntime.jsx("a",{href:"/pricing",children:jsxRuntime.jsxs(moonui.Button,{size:"sm",children:[jsxRuntime.jsx(lucideReact.Sparkles,{className:"mr-2 h-4 w-4"}),"Upgrade to Pro"]})})})]})]})})});let[m,g]=Mn__default.default.useState(null),[b,v]=Mn__default.default.useState(null),[S,T]=Mn__default.default.useState(null),_=(C,M)=>{if(d)return;let U=t.find(z=>z.cards.some(J=>J.id===M));g(M),T(U?.id||null),C.dataTransfer.effectAllowed="move",C.dataTransfer.setData("text/plain",M),C.currentTarget.classList.add("opacity-50");},I=C=>{d||(g(null),v(null),T(null),C.currentTarget.classList.remove("opacity-50"));},k=(C,M)=>{d||(C.preventDefault(),C.dataTransfer.dropEffect="move",v(M));},y=(C,M)=>{d||(C.preventDefault(),v(M));},w=(C,M)=>{if(d)return;C.preventDefault();let U=C.currentTarget.getBoundingClientRect();(C.clientX<U.left||C.clientX>U.right||C.clientY<U.top||C.clientY>U.bottom)&&v(null);},O=(C,M)=>{if(d)return;C.preventDefault();let U=C.dataTransfer.getData("text/plain")||m;if(U&&e&&S&&S!==M){let J=t.find(ie=>ie.id===M)?.cards.length||0;e(U,S,M,J);}g(null),v(null),T(null);},X=C=>{d||n?.(C);},R=(C,M)=>{d||(M.stopPropagation(),r?.(C));},ce=(C,M)=>{d||(M.stopPropagation(),i?.(C));},Q=C=>C.toLocaleDateString("en-US",{month:"short",day:"numeric"}),G=C=>C<new Date,x=C=>C.split(" ").map(M=>M[0]).join("").toUpperCase();return jsxRuntime.jsx("div",{className:moonui.cn("w-full",a),children:jsxRuntime.jsxs("div",{className:"flex gap-6 overflow-x-auto pb-4",children:[t.map(C=>{let M=C.limit&&C.cards.length>C.limit,U=b===C.id;return jsxRuntime.jsx("div",{className:moonui.cn("flex-shrink-0 w-80 transition-colors duration-200",U&&"bg-primary/5 rounded-lg border-2 border-primary/20"),onDragOver:z=>k(z,C.id),onDragEnter:z=>y(z,C.id),onDragLeave:z=>w(z,C.id),onDrop:z=>O(z,C.id),children:jsxRuntime.jsxs(moonui.Card,{className:"h-full",children:[jsxRuntime.jsxs(moonui.CardHeader,{className:"pb-3",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[C.color&&jsxRuntime.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:C.color}}),jsxRuntime.jsx(moonui.CardTitle,{className:"text-sm font-medium",children:C.title}),jsxRuntime.jsx(moonui.Badge,{variant:"secondary",className:"text-xs",children:C.cards.length})]}),jsxRuntime.jsx(moonui.Button,{variant:"ghost",size:"sm",children:jsxRuntime.jsx(lucideReact.MoreHorizontal,{className:"h-4 w-4"})})]}),C.limit&&jsxRuntime.jsx(moonui.CardDescription,{className:moonui.cn("text-xs",M&&"text-destructive"),children:M?"Over limit":`${C.cards.length}/${C.limit} cards`})]}),jsxRuntime.jsxs(moonui.CardContent,{className:"space-y-3",children:[C.cards.map(z=>jsxRuntime.jsxs("div",{draggable:!d,onDragStart:J=>_(J,z.id),onDragEnd:I,onClick:()=>X(z),className:moonui.cn("p-3 bg-background border rounded-lg cursor-pointer hover:shadow-md transition-all duration-200","group relative select-none",m===z.id&&"opacity-50 scale-95",d&&"cursor-not-allowed"),children:[jsxRuntime.jsxs("div",{className:"flex items-start justify-between gap-2",children:[jsxRuntime.jsxs("div",{className:"flex-1",children:[jsxRuntime.jsx("h4",{className:"font-medium text-sm mb-1",children:z.title}),z.description&&jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground mb-2 line-clamp-2",children:z.description})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[jsxRuntime.jsx(moonui.Button,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:J=>R(z,J),children:jsxRuntime.jsx(lucideReact.Edit,{className:"h-3 w-3"})}),jsxRuntime.jsx(moonui.Button,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:J=>ce(z,J),children:jsxRuntime.jsx(lucideReact.Trash2,{className:"h-3 w-3"})}),jsxRuntime.jsx("div",{className:"cursor-move",children:jsxRuntime.jsx(lucideReact.GripVertical,{className:"h-3 w-3 text-muted-foreground"})})]})]}),z.tags&&z.tags.length>0&&jsxRuntime.jsx("div",{className:"flex flex-wrap gap-1 mb-2",children:z.tags.map((J,ie)=>jsxRuntime.jsx(moonui.Badge,{variant:"outline",className:"text-xs px-1 py-0",children:J},ie))}),c&&jsxRuntime.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[z.priority&&jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("div",{className:moonui.cn("w-2 h-2 rounded-full",_E[z.priority])}),jsxRuntime.jsx("span",{className:"capitalize",children:z.priority})]}),z.dueDate&&jsxRuntime.jsxs("div",{className:moonui.cn("flex items-center gap-1",G(z.dueDate)&&"text-destructive"),children:[jsxRuntime.jsx(lucideReact.Calendar,{className:"h-3 w-3"}),jsxRuntime.jsx("span",{children:Q(z.dueDate)})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[z.comments&&z.comments>0&&jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx(lucideReact.MessageCircle,{className:"h-3 w-3"}),jsxRuntime.jsx("span",{children:z.comments})]}),z.attachments&&z.attachments>0&&jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx(lucideReact.Paperclip,{className:"h-3 w-3"}),jsxRuntime.jsx("span",{children:z.attachments})]}),z.assignee&&jsxRuntime.jsxs(moonui.Avatar,{className:"h-5 w-5",children:[jsxRuntime.jsx(moonui.AvatarImage,{src:z.assignee.avatar}),jsxRuntime.jsx(moonui.AvatarFallback,{className:"text-xs",children:x(z.assignee.name)})]})]})]})]},z.id)),o&&jsxRuntime.jsxs(moonui.Button,{variant:"ghost",size:"sm",onClick:()=>o(C.id),className:"w-full justify-start text-muted-foreground hover:text-foreground",disabled:d,children:[jsxRuntime.jsx(lucideReact.Plus,{className:"h-4 w-4 mr-2"}),"Add card"]})]})]})},C.id)}),l&&s&&jsxRuntime.jsx("div",{className:"flex-shrink-0 w-80",children:jsxRuntime.jsxs(moonui.Button,{variant:"outline",onClick:s,className:"w-full h-full min-h-[200px] border-dashed justify-center items-center",disabled:d,children:[jsxRuntime.jsx(lucideReact.Plus,{className:"h-6 w-6 mr-2"}),"Add column"]})})]})})}var Aa=class{constructor(e,n="lru"){this.cache=new Map;this.maxSize=e,this.strategy=n;}set(e,n,r=!1){this.cache.size>=this.maxSize&&this.evict(),this.cache.set(e,{data:n,timestamp:Date.now(),accessCount:0,compressed:r});}get(e){let n=this.cache.get(e);return n?(n.accessCount++,n.timestamp=Date.now(),n.data):null}evict(){if(this.cache.size===0)return;let e=null;switch(this.strategy){case"lru":let n=1/0;for(let[i,o]of this.cache)o.timestamp<n&&(n=o.timestamp,e=i);break;case"lfu":let r=1/0;for(let[i,o]of this.cache)o.accessCount<r&&(r=o.accessCount,e=i);break;case"fifo":e=this.cache.keys().next().value;break}e&&this.cache.delete(e);}clear(){this.cache.clear();}getStats(){return {size:this.cache.size,hitRate:.95}}};function V1({data:t,config:e={},renderItem:n,height:r=400,onMemoryUpdate:i,className:o}){let{chunkSize:s=1e3,maxMemoryItems:a=1e4,cacheStrategy:l="lru",compression:c=!1,autoCleanup:d=!0,cleanupThreshold:u=.8,streamingMode:f=!1,enableAnalytics:p=!1,analyticsCallback:h}=e,[m,g]=Mn.useState({start:0,end:Math.min(s,t.length)}),[b,v]=Mn.useState({memoryUsage:0,itemCount:0,cacheHitRate:.95}),S=Mn.useRef(null),T=Mn.useRef(new Aa(Math.floor(a/s),l)),_=Mn.useRef(),I=Mn.useMemo(()=>{let y=m.start,w=Math.min(m.end,t.length),O=`${y}-${w}`,X=T.current.get(O);if(X&&X.length===w-y)return X;let R=t.slice(y,w);return T.current.set(O,R,c),R},[t,m,c]),k=Mn.useCallback(y=>{let w=y.currentTarget.scrollTop,O=y.currentTarget.clientHeight,X=60,R=Math.floor(w/X),ce=Math.ceil(O/X),Q=Math.floor(ce*.5),G=Math.max(0,R-Q),x=Math.min(t.length,R+ce+Q);_.current&&clearTimeout(_.current),_.current=setTimeout(()=>{g({start:G,end:x});},16);},[t.length]);return Mn.useEffect(()=>{let y=T.current.getStats(),w={memoryUsage:I.length*1024,itemCount:I.length,cacheHitRate:y.hitRate,compressionRatio:c?.7:1,lastCleanup:Date.now()};v(w),p&&h&&h(w),i&&i(w);},[I,p,h,i,c]),Mn.useEffect(()=>{if(!d)return;let y=setInterval(()=>{I.length/a>u&&T.current.clear();},5e3);return ()=>clearInterval(y)},[d,u,a,I.length]),jsxRuntime.jsx("div",{ref:S,className:moonui.cn("overflow-auto border rounded-lg bg-background",o),style:{height:r},onScroll:k,children:jsxRuntime.jsx("div",{style:{height:t.length*60,position:"relative"},children:jsxRuntime.jsx("div",{style:{transform:`translateY(${m.start*60}px)`,position:"absolute",width:"100%"},children:I.map((y,w)=>jsxRuntime.jsx(Mn__default.default.Fragment,{children:n(y,m.start+w)},m.start+w))})})})}function W1({onStatsUpdate:t,showRealTime:e=!1,className:n}){let[r,i]=Mn.useState({memoryUsage:0,itemCount:0,cacheHitRate:.95});return Mn.useEffect(()=>{if(!e)return;let o=setInterval(()=>{let s={memoryUsage:Math.random()*50*1024*1024,itemCount:Math.floor(Math.random()*5e4),cacheHitRate:.9+Math.random()*.1,lastCleanup:Date.now()};i(s),t&&t(s);},1e3);return ()=>clearInterval(o)},[e,t]),e?jsxRuntime.jsx("div",{className:moonui.cn("text-xs text-muted-foreground",n),children:"Memory Analytics Active - Updates every second"}):null}function G1(t=[],e){let[n,r]=Mn.useState(t),{interval:i=1e3,maxItems:o=1e4}=e||{},s=Mn.useCallback(l=>{r(c=>{let d=[...c,l];return d.length>o?d.slice(-o):d});},[o]),a=Mn.useCallback(()=>{r([]);},[]);return {data:n,addItem:s,clearData:a}}var yh=ai(fi(),1);function ct(t){this.content=t;}ct.prototype={constructor:ct,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return -1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,i=r.find(t),o=r.content.slice();return i==-1?o.push(n||t,e):(o[i+1]=e,n&&(o[i]=n)),new ct(o)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new ct(n)},addToStart:function(t,e){return new ct([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new ct(n)},addBefore:function(t,e,n){var r=this.remove(e),i=r.content.slice(),o=r.find(t);return i.splice(o==-1?i.length:o,0,e,n),new ct(i)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1]);},prepend:function(t){return t=ct.from(t),t.size?new ct(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=ct.from(t),t.size?new ct(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=ct.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n;}),t},get size(){return this.content.length>>1}};ct.from=function(t){if(t instanceof ct)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new ct(e)};var Da=ct;function fu(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),o=e.child(r);if(i==o){n+=i.nodeSize;continue}if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let s=0;i.text[s]==o.text[s];s++)n++;return n}if(i.content.size||o.content.size){let s=fu(i.content,o.content,n+1);if(s!=null)return s}n+=i.nodeSize;}}function pu(t,e,n,r){for(let i=t.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:n,b:r};let s=t.child(--i),a=e.child(--o),l=s.nodeSize;if(s==a){n-=l,r-=l;continue}if(!s.sameMarkup(a))return {a:n,b:r};if(s.isText&&s.text!=a.text){let c=0,d=Math.min(s.text.length,a.text.length);for(;c<d&&s.text[s.text.length-c-1]==a.text[a.text.length-c-1];)c++,n--,r--;return {a:n,b:r}}if(s.content.size||a.content.size){let c=pu(s.content,a.content,n-1,r-1);if(c)return c}n-=l,r-=l;}}var N=class{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize;}nodesBetween(e,n,r,i=0,o){for(let s=0,a=0;a<n;s++){let l=this.content[s],c=a+l.nodeSize;if(c>e&&r(l,i+a,o||null,s)!==!1&&l.content.size){let d=a+1;l.nodesBetween(Math.max(0,e-d),Math.min(l.content.size,n-d),r,i+d);}a=c;}}descendants(e){this.nodesBetween(0,this.size,e);}textBetween(e,n,r,i){let o="",s=!0;return this.nodesBetween(e,n,(a,l)=>{let c=a.isText?a.text.slice(Math.max(e,l)-l,n-l):a.isLeaf?i?typeof i=="function"?i(a):i:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&c||a.isTextblock)&&r&&(s?s=!1:o+=r),o+=c;},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),o=1);o<e.content.length;o++)i.push(e.content[o]);return new N(i,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],i=0;if(n>e)for(let o=0,s=0;s<n;o++){let a=this.content[o],l=s+a.nodeSize;l>e&&((s<e||l>n)&&(a.isText?a=a.cut(Math.max(0,e-s),Math.min(a.text.length,n-s)):a=a.cut(Math.max(0,e-s-1),Math.min(a.content.size,n-s-1))),r.push(a),i+=a.nodeSize),s=l;}return new N(r,i)}cutByIndex(e,n){return e==n?N.empty:e==0&&n==this.content.length?this:new N(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new N(i,o)}addToStart(e){return new N([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new N(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return !1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return !1;return !0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let i=this.content[n];e(i,r,n),r+=i.nodeSize;}}findDiffStart(e,n=0){return fu(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return pu(this,e,n,r)}findIndex(e){if(e==0)return yo(0,e);if(e==this.size)return yo(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=this.child(n),o=r+i.nodeSize;if(o>=e)return o==e?yo(n+1,o):yo(n,r);r=o;}}toString(){return "<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return N.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new N(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return N.empty;let n,r=0;for(let i=0;i<e.length;i++){let o=e[i];r+=o.nodeSize,i&&o.isText&&e[i-1].sameMarkup(o)?(n||(n=e.slice(0,i)),n[n.length-1]=o.withText(n[n.length-1].text+o.text)):n&&n.push(o);}return new N(n||e,r)}static from(e){if(!e)return N.empty;if(e instanceof N)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new N([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}};N.empty=new N([],0);var Ia={index:0,offset:0};function yo(t,e){return Ia.index=t,Ia.offset=e,Ia}function vo(t,e){if(t===e)return !0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return !1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return !1;if(n){if(t.length!=e.length)return !1;for(let r=0;r<t.length;r++)if(!vo(t[r],e[r]))return !1}else {for(let r in t)if(!(r in e)||!vo(t[r],e[r]))return !1;for(let r in e)if(!(r in t))return !1}return !0}var be=class{constructor(e,n){this.type=e,this.attrs=n;}addToSet(e){let n,r=!1;for(let i=0;i<e.length;i++){let o=e[i];if(this.eq(o))return e;if(this.type.excludes(o.type))n||(n=e.slice(0,i));else {if(o.type.excludes(this.type))return e;!r&&o.type.rank>this.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(o);}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return !0;return !1}eq(e){return this==e||this.type==e.type&&vo(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let i=r.create(n.attrs);return r.checkAttrs(i.attrs),i}static sameSet(e,n){if(e==n)return !0;if(e.length!=n.length)return !1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return !1;return !0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return be.none;if(e instanceof be)return [e];let n=e.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};be.none=[];var Qn=class extends Error{},B=class{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r;}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=mu(this.content,e+this.openStart,n);return r&&new B(r,this.openStart,this.openEnd)}removeBetween(e,n){return new B(hu(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return B.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new B(N.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)i++;return new B(e,r,i)}};B.empty=new B(N.empty,0,0);function hu(t,e,n){let{index:r,offset:i}=t.findIndex(e),o=t.maybeChild(r),{index:s,offset:a}=t.findIndex(n);if(i==e||o.isText){if(a!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,o.copy(hu(o.content,e-i-1,n-i-1)))}function mu(t,e,n,r){let{index:i,offset:o}=t.findIndex(e),s=t.maybeChild(i);if(o==e||s.isText)return r&&!r.canReplace(i,i,n)?null:t.cut(0,e).append(n).append(t.cut(e));let a=mu(s.content,e-o-1,n);return a&&t.replaceChild(i,s.copy(a))}function UE(t,e,n){if(n.openStart>t.depth)throw new Qn("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Qn("Inconsistent open depths");return gu(t,e,n,0)}function gu(t,e,n,r){let i=t.index(r),o=t.node(r);if(i==e.index(r)&&r<t.depth-n.openStart){let s=gu(t,e,n,r+1);return o.copy(o.content.replaceChild(i,s))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let s=t.parent,a=s.content;return Xn(s,a.cut(0,t.parentOffset).append(n.content).append(a.cut(e.parentOffset)))}else {let{start:s,end:a}=HE(n,t);return Xn(o,yu(t,s,a,e,r))}else return Xn(o,wo(t,e,r))}function bu(t,e){if(!e.type.compatibleContent(t.type))throw new Qn("Cannot join "+e.type.name+" onto "+t.type.name)}function Pa(t,e,n){let r=t.node(n);return bu(r,e.node(n)),r}function Zn(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t);}function pi(t,e,n,r){let i=(e||t).node(n),o=0,s=e?e.index(n):i.childCount;t&&(o=t.index(n),t.depth>n?o++:t.textOffset&&(Zn(t.nodeAfter,r),o++));for(let a=o;a<s;a++)Zn(i.child(a),r);e&&e.depth==n&&e.textOffset&&Zn(e.nodeBefore,r);}function Xn(t,e){return t.type.checkContent(e),t.copy(e)}function yu(t,e,n,r,i){let o=t.depth>i&&Pa(t,e,i+1),s=r.depth>i&&Pa(n,r,i+1),a=[];return pi(null,t,i,a),o&&s&&e.index(i)==n.index(i)?(bu(o,s),Zn(Xn(o,yu(t,e,n,r,i+1)),a)):(o&&Zn(Xn(o,wo(t,e,i+1)),a),pi(e,n,i,a),s&&Zn(Xn(s,wo(n,r,i+1)),a)),pi(r,null,i,a),new N(a)}function wo(t,e,n){let r=[];if(pi(null,t,n,r),t.depth>n){let i=Pa(t,e,n+1);Zn(Xn(i,wo(t,e,n+1)),r);}return pi(e,null,n,r),new N(r)}function HE(t,e){let n=e.depth-t.openStart,i=e.node(n).copy(t.content);for(let o=n-1;o>=0;o--)i=e.node(o).copy(N.from(i));return {start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}var er=class{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1;}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(n);return r?e.child(n).cut(r):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let o=0;o<e;o++)i+=r.child(o).nodeSize;return i}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return be.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),i=e.maybeChild(n);if(!r){let a=r;r=i,i=a;}let o=r.marks;for(var s=0;s<o.length;s++)o[s].type.spec.inclusive===!1&&(!i||!o[s].isInSet(i.marks))&&(o=o[s--].removeFromSet(o));return o}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=e.parent.maybeChild(e.index());for(var o=0;o<r.length;o++)r[o].type.spec.inclusive===!1&&(!i||!r[o].isInSet(i.marks))&&(r=r[o--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new tr(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,o=n;for(let s=e;;){let{index:a,offset:l}=s.content.findIndex(o),c=o-l;if(r.push(s,a,i+l),!c||(s=s.child(a),s.isText))break;o=c-1,i+=l+1;}return new er(n,r,o)}static resolveCached(e,n){let r=ru.get(e);if(r)for(let o=0;o<r.elts.length;o++){let s=r.elts[o];if(s.pos==n)return s}else ru.set(e,r=new Ba);let i=r.elts[r.i]=er.resolve(e,n);return r.i=(r.i+1)%$E,i}},Ba=class{constructor(){this.elts=[],this.i=0;}},$E=12,ru=new WeakMap,tr=class{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r;}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}},KE=Object.create(null),et=class{constructor(e,n,r,i=be.none){this.type=e,this.attrs=n,this.marks=i,this.content=r||N.empty;}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e);}nodesBetween(e,n,r,i=0){this.content.nodesBetween(e,n,r,i,this);}descendants(e){this.nodesBetween(0,this.content.size,e);}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,i){return this.content.textBetween(e,n,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&vo(this.attrs,n||e.defaultAttrs||KE)&&be.sameSet(this.marks,r||be.none)}copy(e=null){return e==this.content?this:new et(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new et(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return B.empty;let i=this.resolve(e),o=this.resolve(n),s=r?0:i.sharedDepth(n),a=i.start(s),c=i.node(s).content.cut(i.pos-a,o.pos-a);return new B(c,i.depth-s,o.depth-s)}replace(e,n,r){return UE(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(i==e||n.isText)return n;e-=i+1;}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return {node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return {node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return {node:this.content.child(n),index:n,offset:r};let i=this.content.child(n-1);return {node:i,index:n-1,offset:r-i.nodeSize}}resolve(e){return er.resolveCached(this,e)}resolveNoCache(e){return er.resolve(this,e)}rangeHasMark(e,n,r){let i=!1;return n>e&&this.nodesBetween(e,n,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Eu(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=N.empty,i=0,o=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,i,o),a=s&&s.matchFragment(this.content,n);if(!a||!a.validEnd)return !1;for(let l=i;l<o;l++)if(!this.type.allowsMarks(r.child(l).marks))return !1;return !0}canReplaceWith(e,n,r,i){if(i&&!this.type.allowsMarks(i))return !1;let o=this.contentMatchAt(e).matchType(r),s=o&&o.matchFragment(this.content,n);return s?s.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=be.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e);}if(!be.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check());}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON);}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let i=N.fromJSON(e,n.content),o=e.nodeType(n.type).create(n.attrs,i,r);return o.type.checkAttrs(o.attrs),o}};et.prototype.text=void 0;var Ar=class extends et{constructor(e,n,r,i){if(super(e,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r;}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Eu(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Ar(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Ar(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function Eu(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}var pn=class{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[];}static parse(e,n){let r=new za(e,n);if(r.next==null)return pn.empty;let i=vu(r);r.next&&r.err("Unexpected trailing text");let o=YE(JE(i));return ZE(o,r),o}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let i=this;for(let o=n;i&&o<r;o++)i=i.matchType(e.child(o).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return !0;return !1}fillBefore(e,n=!1,r=0){let i=[this];function o(s,a){let l=s.matchFragment(e,r);if(l&&(!n||l.validEnd))return N.from(a.map(c=>c.createAndFill()));for(let c=0;c<s.next.length;c++){let{type:d,next:u}=s.next[c];if(!(d.isText||d.hasRequiredAttrs())&&i.indexOf(u)==-1){i.push(u);let f=o(u,a.concat(d));if(f)return f}}return null}return o(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),o=i.match;if(o.matchType(e)){let s=[];for(let a=i;a.type;a=a.via)s.push(a.type);return s.reverse()}for(let s=0;s<o.next.length;s++){let{type:a,next:l}=o.next[s];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in n)&&(!i.type||l.validEnd)&&(r.push({match:a.contentMatch,type:a,via:i}),n[a.name]=!0);}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&n(r.next[i].next);}return n(this),e.map((r,i)=>{let o=i+(r.validEnd?"*":" ")+" ";for(let s=0;s<r.next.length;s++)o+=(s?", ":"")+r.next[s].type.name+"->"+e.indexOf(r.next[s].next);return o}).join(`
|
|
26
|
-
`)}};pn.empty=new pn(!0);var za=class{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift();}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}};function vu(t){let e=[];do e.push(VE(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function VE(t){let e=[];do e.push(WE(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function WE(t){let e=jE(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=GE(t,e);else break;return e}function iu(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function GE(t,e){let n=iu(t),r=n;return t.eat(",")&&(t.next!="}"?r=iu(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function qE(t,e){let n=t.nodeTypes,r=n[e];if(r)return [r];let i=[];for(let o in n){let s=n[o];s.isInGroup(e)&&i.push(s);}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}function jE(t){if(t.eat("(")){let e=vu(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else {let e=qE(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function JE(t){let e=[[]];return i(o(t,0),n()),e;function n(){return e.push([])-1}function r(s,a,l){let c={term:l,to:a};return e[s].push(c),c}function i(s,a){s.forEach(l=>l.to=a);}function o(s,a){if(s.type=="choice")return s.exprs.reduce((l,c)=>l.concat(o(c,a)),[]);if(s.type=="seq")for(let l=0;;l++){let c=o(s.exprs[l],a);if(l==s.exprs.length-1)return c;i(c,a=n());}else if(s.type=="star"){let l=n();return r(a,l),i(o(s.expr,l),l),[r(l)]}else if(s.type=="plus"){let l=n();return i(o(s.expr,a),l),i(o(s.expr,l),l),[r(l)]}else {if(s.type=="opt")return [r(a)].concat(o(s.expr,a));if(s.type=="range"){let l=a;for(let c=0;c<s.min;c++){let d=n();i(o(s.expr,l),d),l=d;}if(s.max==-1)i(o(s.expr,l),l);else for(let c=s.min;c<s.max;c++){let d=n();r(l,d),i(o(s.expr,l),d),l=d;}return [r(l)]}else {if(s.type=="name")return [r(a,void 0,s.value)];throw new Error("Unknown expr type")}}}}function wu(t,e){return e-t}function ou(t,e){let n=[];return r(e),n.sort(wu);function r(i){let o=t[i];if(o.length==1&&!o[0].term)return r(o[0].to);n.push(i);for(let s=0;s<o.length;s++){let{term:a,to:l}=o[s];!a&&n.indexOf(l)==-1&&r(l);}}}function YE(t){let e=Object.create(null);return n(ou(t,0));function n(r){let i=[];r.forEach(s=>{t[s].forEach(({term:a,to:l})=>{if(!a)return;let c;for(let d=0;d<i.length;d++)i[d][0]==a&&(c=i[d][1]);ou(t,l).forEach(d=>{c||i.push([a,c=[]]),c.indexOf(d)==-1&&c.push(d);});});});let o=e[r.join(",")]=new pn(r.indexOf(t.length-1)>-1);for(let s=0;s<i.length;s++){let a=i[s][1].sort(wu);o.next.push({type:i[s][0],next:e[a.join(",")]||n(a)});}return o}}function ZE(t,e){for(let n=0,r=[t];n<r.length;n++){let i=r[n],o=!i.validEnd,s=[];for(let a=0;a<i.next.length;a++){let{type:l,next:c}=i.next[a];s.push(l.name),o&&!(l.isText||l.hasRequiredAttrs())&&(o=!1),r.indexOf(c)==-1&&r.push(c);}o&&e.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)");}}function xu(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default;}return e}function Su(t,e){let n=Object.create(null);for(let r in t){let i=e&&e[r];if(i===void 0){let o=t[r];if(o.hasDefault)i=o.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=i;}return n}function Cu(t,e,n,r){for(let i in e)if(!(i in t))throw new RangeError(`Unsupported attribute ${i} for ${n} of type ${i}`);for(let i in t){let o=t[i];o.validate&&o.validate(e[i]);}}function ku(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new Fa(t,r,e[r]);return n}var Or=class{constructor(e,n,r){this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=ku(e,r.attrs),this.defaultAttrs=xu(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text";}get isInline(){return !this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==pn.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return !0;return !1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return !e&&this.defaultAttrs?this.defaultAttrs:Su(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new et(this,this.computeAttrs(e),N.from(n),be.setFrom(r))}createChecked(e=null,n,r){return n=N.from(n),this.checkContent(n),new et(this,this.computeAttrs(e),n,be.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=N.from(n),n.size){let s=this.contentMatch.fillBefore(n);if(!s)return null;n=s.append(n);}let i=this.contentMatch.matchFragment(n),o=i&&i.fillBefore(N.empty,!0);return o?new et(this,e,n.append(o),be.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return !1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return !1;return !0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){Cu(this.attrs,e,"node",this.name);}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return !0;for(let n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return !1;return !0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?n&&n.push(e[r]):n||(n=e.slice(0,r));return n?n.length?n:be.none:e}static compile(e,n){let r=Object.create(null);e.forEach((o,s)=>r[o]=new Or(o,n,s));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function XE(t,e,n){let r=n.split("|");return i=>{let o=i===null?"null":typeof i;if(r.indexOf(o)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${o}`)}}var Fa=class{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?XE(e,n,r.validate):r.validate;}get isRequired(){return !this.hasDefault}},nr=class{constructor(e,n,r,i){this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=ku(e,i.attrs),this.excluded=null;let o=xu(this.attrs);this.instance=o?new be(this,o):null;}create(e=null){return !e&&this.instance?this.instance:new be(this,Su(this.attrs,e))}static compile(e,n){let r=Object.create(null),i=0;return e.forEach((o,s)=>r[o]=new nr(o,i++,n,s)),r}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}checkAttrs(e){Cu(this.attrs,e,"mark",this.name);}excludes(e){return this.excluded.indexOf(e)>-1}},Rr=class{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let i in e)n[i]=e[i];n.nodes=Da.from(e.nodes),n.marks=Da.from(e.marks||{}),this.nodes=Or.compile(this.spec.nodes,this),this.marks=nr.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let o=this.nodes[i],s=o.spec.content||"",a=o.spec.marks;if(o.contentMatch=r[s]||(r[s]=pn.parse(s,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!o.isInline||!o.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=o;}o.markSet=a=="_"?null:a?su(this,a.split(" ")):a==""||!o.inlineContent?[]:null;}for(let i in this.marks){let o=this.marks[i],s=o.spec.excludes;o.excluded=s==null?[o]:s==""?[]:su(this,s.split(" "));}this.nodeFromJSON=i=>et.fromJSON(this,i),this.markFromJSON=i=>be.fromJSON(this,i),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null);}node(e,n=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof Or){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,i)}text(e,n){let r=this.nodes.text;return new Ar(r,r.defaultAttrs,e,be.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}};function su(t,e){let n=[];for(let r=0;r<e.length;r++){let i=e[r],o=t.marks[i],s=o;if(o)n.push(o);else for(let a in t.marks){let l=t.marks[a];(i=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(i)>-1)&&n.push(s=l);}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function QE(t){return t.tag!=null}function ev(t){return t.style!=null}var _t=class{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(QE(i))this.tags.push(i);else if(ev(i)){let o=/[^=]*/.exec(i.style)[0];r.indexOf(o)<0&&r.push(o),this.styles.push(i);}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return !1;let o=e.nodes[i.node];return o.contentMatch.matchType(o)});}parse(e,n={}){let r=new xo(this,n,!1);return r.addAll(e,be.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new xo(this,n,!0);return r.addAll(e,be.none,n.from,n.to),B.maxOpen(r.finish())}matchTag(e,n,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let o=this.tags[i];if(rv(e,o.tag)&&(o.namespace===void 0||e.namespaceURI==o.namespace)&&(!o.context||n.matchesContext(o.context))){if(o.getAttrs){let s=o.getAttrs(e);if(s===!1)continue;o.attrs=s||void 0;}return o}}}matchStyle(e,n,r,i){for(let o=i?this.styles.indexOf(i)+1:0;o<this.styles.length;o++){let s=this.styles[o],a=s.style;if(!(a.indexOf(e)!=0||s.context&&!r.matchesContext(s.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=n))){if(s.getAttrs){let l=s.getAttrs(n);if(l===!1)continue;s.attrs=l||void 0;}return s}}}static schemaRules(e){let n=[];function r(i){let o=i.priority==null?50:i.priority,s=0;for(;s<n.length;s++){let a=n[s];if((a.priority==null?50:a.priority)<o)break}n.splice(s,0,i);}for(let i in e.marks){let o=e.marks[i].spec.parseDOM;o&&o.forEach(s=>{r(s=lu(s)),s.mark||s.ignore||s.clearMark||(s.mark=i);});}for(let i in e.nodes){let o=e.nodes[i].spec.parseDOM;o&&o.forEach(s=>{r(s=lu(s)),s.node||s.ignore||s.mark||(s.node=i);});}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new _t(e,_t.schemaRules(e)))}},Nu={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},tv={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Tu={ol:!0,ul:!0},mi=1,Ua=2,hi=4;function au(t,e,n){return e!=null?(e?mi:0)|(e==="full"?Ua:0):t&&t.whitespace=="pre"?mi|Ua:n&~hi}var Mr=class{constructor(e,n,r,i,o,s){this.type=e,this.attrs=n,this.marks=r,this.solid=i,this.options=s,this.content=[],this.activeMarks=be.none,this.match=o||(s&hi?null:e.contentMatch);}findWrapping(e){if(!this.match){if(!this.type)return [];let n=this.type.contentMatch.fillBefore(N.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else {let r=this.type.contentMatch,i;return (i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&mi)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length));}}let n=N.from(this.content);return !e&&this.match&&(n=n.append(this.match.fillBefore(N.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Nu.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}},xo=class{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let i=n.topNode,o,s=au(null,n.preserveWhitespace,0)|(r?hi:0);i?o=new Mr(i.type,i.attrs,be.none,!0,n.topMatch||i.type.contentMatch,s):r?o=new Mr(null,null,be.none,!0,null,s):o=new Mr(e.schema.topNodeType,null,be.none,!0,null,s),this.nodes=[o],this.find=n.findPositions,this.needsBlock=!1;}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n);}addTextNode(e,n){let r=e.nodeValue,i=this.top,o=i.options&Ua?"full":this.localPreserveWS||(i.options&mi)>0;if(o==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(o)o!=="full"?r=r.replace(/\r?\n|\r/g," "):r=r.replace(/\r\n?/g,`
|
|
27
|
-
|
|
28
|
-
`),n);}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0);}readStyles(e,n){let r=e.style;if(r&&r.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let o=this.parser.matchedStyles[i],s=r.getPropertyValue(o);if(s)for(let a=void 0;;){let l=this.parser.matchStyle(o,s,this,a);if(!l)break;if(l.ignore)return null;if(l.clearMark?n=n.filter(c=>!l.clearMark(c)):n=n.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)a=l;else break}}return n}addElementByRule(e,n,r,i){let o,s;if(n.node)if(s=this.parser.schema.nodes[n.node],s.isLeaf)this.insertNode(s.create(n.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else {let l=this.enter(s,n.attrs||null,r,n.preserveWhitespace);l&&(o=!0,r=l);}else {let l=this.parser.schema.marks[n.mark];r=r.concat(l.create(n.attrs));}let a=this.top;if(s&&s.isLeaf)this.findInside(e);else if(i)this.addElement(e,r,i);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l,r,!1));else {let l=e;typeof n.contentElement=="string"?l=e.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(e):n.contentElement&&(l=n.contentElement),this.findAround(e,l,!0),this.addAll(l,r),this.findAround(e,l,!1);}o&&this.sync(a)&&this.open--;}addAll(e,n,r,i){let o=r||0;for(let s=r?e.childNodes[r]:e.firstChild,a=i==null?null:e.childNodes[i];s!=a;s=s.nextSibling,++o)this.findAtPoint(e,o),this.addDOM(s,n);this.findAtPoint(e,o);}findPlace(e,n,r){let i,o;for(let s=this.open,a=0;s>=0;s--){let l=this.nodes[s],c=l.findWrapping(e);if(c&&(!i||i.length>c.length+a)&&(i=c,o=l,!c.length))break;if(l.solid){if(r)break;a+=2;}}if(!i)return null;this.sync(o);for(let s=0;s<i.length;s++)n=this.enterInner(i[s],null,n,!1);return n}insertNode(e,n,r){if(e.isInline&&this.needsBlock&&!this.top.type){let o=this.textblockFromContext();o&&(n=this.enterInner(o,null,n));}let i=this.findPlace(e,n,r);if(i){this.closeExtra();let o=this.top;o.match&&(o.match=o.match.matchType(e.type));let s=be.none;for(let a of i.concat(e.marks))(o.type?o.type.allowsMarkType(a.type):cu(a.type,e.type))&&(s=a.addToSet(s));return o.content.push(e.mark(s)),!0}return !1}enter(e,n,r,i){let o=this.findPlace(e.create(n),r,!1);return o&&(o=this.enterInner(e,n,r,!0,i)),o}enterInner(e,n,r,i=!1,o){this.closeExtra();let s=this.top;s.match=s.match&&s.match.matchType(e);let a=au(e,o,s.options);s.options&hi&&s.content.length==0&&(a|=hi);let l=be.none;return r=r.filter(c=>(s.type?s.type.allowsMarkType(c.type):cu(c.type,e))?(l=c.addToSet(l),!1):!0),this.nodes.push(new Mr(e,n,l,i,null,a)),this.open++,r}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1;}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let n=this.open;n>=0;n--){if(this.nodes[n]==e)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=mi);}return !1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;n&&e++;}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos);}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos);}findAround(e,n,r){if(e!=n&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&n.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos);}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset));}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),s=(a,l)=>{for(;a>=0;a--){let c=n[a];if(c==""){if(a==n.length-1||a==0)continue;for(;l>=o;l--)if(s(a-1,l))return !0;return !1}else {let d=l>0||l==0&&i?this.nodes[l].type:r&&l>=o?r.node(l-o).type:null;if(!d||d.name!=c&&!d.isInGroup(c))return !1;l--;}}return !0};return s(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}};function nv(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Tu.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null);}}function rv(t,e){return (t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function lu(t){let e={};for(let n in t)e[n]=t[n];return e}function cu(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let o=[],s=a=>{o.push(a);for(let l=0;l<a.edgeCount;l++){let{type:c,next:d}=a.edge(l);if(c==e||o.indexOf(d)<0&&s(d))return !0}};if(s(i.contentMatch))return !0}}var $t=class{constructor(e,n){this.nodes=e,this.marks=n;}serializeFragment(e,n={},r){r||(r=La(n).createDocumentFragment());let i=r,o=[];return e.forEach(s=>{if(o.length||s.marks.length){let a=0,l=0;for(;a<o.length&&l<s.marks.length;){let c=s.marks[l];if(!this.marks[c.type.name]){l++;continue}if(!c.eq(o[a][0])||c.type.spec.spanning===!1)break;a++,l++;}for(;a<o.length;)i=o.pop()[1];for(;l<s.marks.length;){let c=s.marks[l++],d=this.serializeMark(c,s.isInline,n);d&&(o.push([c,i]),i.appendChild(d.dom),i=d.contentDOM||d.dom);}}i.appendChild(this.serializeNodeInner(s,n));}),r}serializeNodeInner(e,n){let{dom:r,contentDOM:i}=Eo(La(n),this.nodes[e.type.name](e),null,e.attrs);if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,i);}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let i=e.marks.length-1;i>=0;i--){let o=this.serializeMark(e.marks[i],e.isInline,n);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom);}return r}serializeMark(e,n,r={}){let i=this.marks[e.type.name];return i&&Eo(La(r),i(e,n),null,e.attrs)}static renderSpec(e,n,r=null,i){return Eo(e,n,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new $t(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=du(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return du(e.marks)}};function du(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r);}return e}function La(t){return t.document||window.document}var uu=new WeakMap;function iv(t){let e=uu.get(t);return e===void 0&&uu.set(t,e=ov(t)),e}function ov(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let i=0;i<r.length;i++)n(r[i]);else for(let i in r)n(r[i]);}return n(t),e}function Eo(t,e,n,r){if(typeof e=="string")return {dom:t.createTextNode(e)};if(e.nodeType!=null)return {dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let i=e[0],o;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(o=iv(r))&&o.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let s=i.indexOf(" ");s>0&&(n=i.slice(0,s),i=i.slice(s+1));let a,l=n?t.createElementNS(n,i):t.createElement(i),c=e[1],d=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){d=2;for(let u in c)if(c[u]!=null){let f=u.indexOf(" ");f>0?l.setAttributeNS(u.slice(0,f),u.slice(f+1),c[u]):u=="style"&&l.style?l.style.cssText=c[u]:l.setAttribute(u,c[u]);}}for(let u=d;u<e.length;u++){let f=e[u];if(f===0){if(u<e.length-1||u>d)throw new RangeError("Content hole must be the only child of its parent node");return {dom:l,contentDOM:l}}else {let{dom:p,contentDOM:h}=Eo(t,f,n,r);if(l.appendChild(p),h){if(a)throw new RangeError("Multiple content holes");a=h;}}}return {dom:l,contentDOM:a}}var Au=65535,Ou=Math.pow(2,16);function sv(t,e){return t+e*Ou}function _u(t){return t&Au}function av(t){return (t-(t&Au))/Ou}var Ru=1,Du=2,So=4,Iu=8,yi=class{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r;}get deleted(){return (this.delInfo&Iu)>0}get deletedBefore(){return (this.delInfo&(Ru|So))>0}get deletedAfter(){return (this.delInfo&(Du|So))>0}get deletedAcross(){return (this.delInfo&So)>0}},gt=class{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&>.empty)return gt.empty}recover(e){let n=0,r=_u(e);if(!this.inverted)for(let i=0;i<r;i++)n+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+n+av(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,r){let i=0,o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?i:0);if(l>e)break;let c=this.ranges[a+o],d=this.ranges[a+s],u=l+c;if(e<=u){let f=c?e==l?-1:e==u?1:n:n,p=l+i+(f<0?0:d);if(r)return p;let h=e==(n<0?l:u)?null:sv(a/3,e-l),m=e==l?Du:e==u?Ru:So;return (n<0?e!=l:e!=u)&&(m|=Iu),new yi(p,m,h)}i+=d-c;}return r?e+i:new yi(e+i,0,null)}touches(e,n){let r=0,i=_u(n),o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?r:0);if(l>e)break;let c=this.ranges[a+o],d=l+c;if(e<=d&&a==i*3)return !0;r+=this.ranges[a+s]-c;}return !1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let s=this.ranges[i],a=s-(this.inverted?o:0),l=s+(this.inverted?0:o),c=this.ranges[i+n],d=this.ranges[i+r];e(a,a+c,l,l+d),o+=d-c;}}invert(){return new gt(this.ranges,!this.inverted)}toString(){return (this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?gt.empty:new gt(e<0?[0,-e,0]:[0,0,e])}};gt.empty=new gt([]);var Rn=class{constructor(e,n,r=0,i=e?e.length:0){this.mirror=n,this.from=r,this.to=i,this._maps=e||[],this.ownData=!(e||n);}get maps(){return this._maps}slice(e=0,n=this.maps.length){return new Rn(this._maps,this.mirror,e,n)}appendMap(e,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),n!=null&&this.setMirror(this._maps.length-1,n);}appendMapping(e){for(let n=0,r=this._maps.length;n<e._maps.length;n++){let i=e.getMirror(n);this.appendMap(e._maps[n],i!=null&&i<n?r+i:void 0);}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n);}appendMappingInverted(e){for(let n=e.maps.length-1,r=this._maps.length+e._maps.length;n>=0;n--){let i=e.getMirror(n);this.appendMap(e._maps[n].invert(),i!=null&&i>n?r-i-1:void 0);}}invert(){let e=new Rn;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this._maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let i=0;for(let o=this.from;o<this.to;o++){let s=this._maps[o],a=s.mapResult(e,n);if(a.recover!=null){let l=this.getMirror(o);if(l!=null&&l>o&&l<this.to){o=l,e=this._maps[l].recover(a.recover);continue}}i|=a.delInfo,e=a.pos;}return r?e:new yi(e,i,null)}},Ha=Object.create(null),Ze=class{getMap(){return gt.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=Ha[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in Ha)throw new RangeError("Duplicate use of step JSON ID "+e);return Ha[e]=n,n.prototype.jsonID=e,n}},Be=class{constructor(e,n){this.doc=e,this.failed=n;}static ok(e){return new Be(e,null)}static fail(e){return new Be(null,e)}static fromReplace(e,n,r,i){try{return Be.ok(e.replace(n,r,i))}catch(o){if(o instanceof Qn)return Be.fail(o.message);throw o}}};function Ga(t,e,n){let r=[];for(let i=0;i<t.childCount;i++){let o=t.child(i);o.content.size&&(o=o.copy(Ga(o.content,e,o))),o.isInline&&(o=e(o,n,i)),r.push(o);}return N.fromArray(r)}var Gt=class extends Ze{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r;}apply(e){let n=e.slice(this.from,this.to),r=e.resolve(this.from),i=r.node(r.sharedDepth(this.to)),o=new B(Ga(n.content,(s,a)=>!s.isAtom||!a.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),i),n.openStart,n.openEnd);return Be.fromReplace(e,this.from,this.to,o)}invert(){return new wt(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Gt(n.pos,r.pos,this.mark)}merge(e){return e instanceof Gt&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Gt(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return {stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Gt(n.from,n.to,e.markFromJSON(n.mark))}};Ze.jsonID("addMark",Gt);var wt=class extends Ze{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r;}apply(e){let n=e.slice(this.from,this.to),r=new B(Ga(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return Be.fromReplace(e,this.from,this.to,r)}invert(){return new Gt(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new wt(n.pos,r.pos,this.mark)}merge(e){return e instanceof wt&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new wt(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return {stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new wt(n.from,n.to,e.markFromJSON(n.mark))}};Ze.jsonID("removeMark",wt);var qt=class extends Ze{constructor(e,n){super(),this.pos=e,this.mark=n;}apply(e){let n=e.nodeAt(this.pos);if(!n)return Be.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Be.fromReplace(e,this.pos,this.pos+1,new B(N.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;i<n.marks.length;i++)if(!n.marks[i].isInSet(r))return new qt(this.pos,n.marks[i]);return new qt(this.pos,this.mark)}}return new hn(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new qt(n.pos,this.mark)}toJSON(){return {stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new qt(n.pos,e.markFromJSON(n.mark))}};Ze.jsonID("addNodeMark",qt);var hn=class extends Ze{constructor(e,n){super(),this.pos=e,this.mark=n;}apply(e){let n=e.nodeAt(this.pos);if(!n)return Be.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Be.fromReplace(e,this.pos,this.pos+1,new B(N.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return !n||!this.mark.isInSet(n.marks)?this:new qt(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new hn(n.pos,this.mark)}toJSON(){return {stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new hn(n.pos,e.markFromJSON(n.mark))}};Ze.jsonID("removeNodeMark",hn);var De=class extends Ze{constructor(e,n,r,i=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=i;}apply(e){return this.structure&&Va(e,this.from,this.to)?Be.fail("Structure replace would overwrite content"):Be.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new gt([this.from,this.to-this.from,this.slice.size])}invert(e){return new De(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new De(n.pos,Math.max(n.pos,r.pos),this.slice,this.structure)}merge(e){if(!(e instanceof De)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let n=this.slice.size+e.slice.size==0?B.empty:new B(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new De(this.from,this.to+(e.to-e.from),n,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let n=this.slice.size+e.slice.size==0?B.empty:new B(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new De(e.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new De(n.from,n.to,B.fromJSON(e,n.slice),!!n.structure)}};Ze.jsonID("replace",De);var Me=class extends Ze{constructor(e,n,r,i,o,s,a=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=s,this.structure=a;}apply(e){if(this.structure&&(Va(e,this.from,this.gapFrom)||Va(e,this.gapTo,this.to)))return Be.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Be.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?Be.fromReplace(e,this.from,this.to,r):Be.fail("Content does not fit in gap")}getMap(){return new gt([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let n=this.gapTo-this.gapFrom;return new Me(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),o=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||o>r.pos?null:new Me(n.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Me(n.from,n.to,n.gapFrom,n.gapTo,B.fromJSON(e,n.slice),n.insert,!!n.structure)}};Ze.jsonID("replaceAround",Me);function Va(t,e,n){let r=t.resolve(e),i=n-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let s=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!s||s.isLeaf)return !0;s=s.firstChild,i--;}}return !1}function lv(t,e,n,r){let i=[],o=[],s,a;t.doc.nodesBetween(e,n,(l,c,d)=>{if(!l.isInline)return;let u=l.marks;if(!r.isInSet(u)&&d.type.allowsMarkType(r.type)){let f=Math.max(c,e),p=Math.min(c+l.nodeSize,n),h=r.addToSet(u);for(let m=0;m<u.length;m++)u[m].isInSet(h)||(s&&s.to==f&&s.mark.eq(u[m])?s.to=p:i.push(s=new wt(f,p,u[m])));a&&a.to==f?a.to=p:o.push(a=new Gt(f,p,r));}}),i.forEach(l=>t.step(l)),o.forEach(l=>t.step(l));}function cv(t,e,n,r){let i=[],o=0;t.doc.nodesBetween(e,n,(s,a)=>{if(!s.isInline)return;o++;let l=null;if(r instanceof nr){let c=s.marks,d;for(;d=r.isInSet(c);)(l||(l=[])).push(d),c=d.removeFromSet(c);}else r?r.isInSet(s.marks)&&(l=[r]):l=s.marks;if(l&&l.length){let c=Math.min(a+s.nodeSize,n);for(let d=0;d<l.length;d++){let u=l[d],f;for(let p=0;p<i.length;p++){let h=i[p];h.step==o-1&&u.eq(i[p].style)&&(f=h);}f?(f.to=c,f.step=o):i.push({style:u,from:Math.max(a,e),to:c,step:o});}}}),i.forEach(s=>t.step(new wt(s.from,s.to,s.style)));}function qa(t,e,n,r=n.contentMatch,i=!0){let o=t.doc.nodeAt(e),s=[],a=e+1;for(let l=0;l<o.childCount;l++){let c=o.child(l),d=a+c.nodeSize,u=r.matchType(c.type);if(!u)s.push(new De(a,d,B.empty));else {r=u;for(let f=0;f<c.marks.length;f++)n.allowsMarkType(c.marks[f].type)||t.step(new wt(a,d,c.marks[f]));if(i&&c.isText&&n.whitespace!="pre"){let f,p=/\r?\n|\r/g,h;for(;f=p.exec(c.text);)h||(h=new B(N.from(n.schema.text(" ",n.allowedMarks(c.marks))),0,0)),s.push(new De(a+f.index,a+f.index+f[0].length,h));}}a=d;}if(!r.validEnd){let l=r.fillBefore(N.empty,!0);t.replace(a,a,new B(l,0,0));}for(let l=s.length-1;l>=0;l--)t.step(s[l]);}function dv(t,e,n){return (e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function mn(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth;;--r){let i=t.$from.node(r),o=t.$from.index(r),s=t.$to.indexAfter(r);if(r<t.depth&&i.canReplace(o,s,n))return r;if(r==0||i.type.spec.isolating||!dv(i,o,s))break}return null}function uv(t,e,n){let{$from:r,$to:i,depth:o}=e,s=r.before(o+1),a=i.after(o+1),l=s,c=a,d=N.empty,u=0;for(let h=o,m=!1;h>n;h--)m||r.index(h)>0?(m=!0,d=N.from(r.node(h).copy(d)),u++):l--;let f=N.empty,p=0;for(let h=o,m=!1;h>n;h--)m||i.after(h+1)<i.end(h)?(m=!0,f=N.from(i.node(h).copy(f)),p++):c++;t.step(new Me(l,c,s,a,new B(d.append(f),u,p),d.size-u,!0));}function Ir(t,e,n=null,r=t){let i=fv(t,e),o=i&&pv(r,e);return o?i.map(Mu).concat({type:e,attrs:n}).concat(o.map(Mu)):null}function Mu(t){return {type:t,attrs:null}}function fv(t,e){let{parent:n,startIndex:r,endIndex:i}=t,o=n.contentMatchAt(r).findWrapping(e);if(!o)return null;let s=o.length?o[0]:e;return n.canReplaceWith(r,i,s)?o:null}function pv(t,e){let{parent:n,startIndex:r,endIndex:i}=t,o=n.child(r),s=e.contentMatch.findWrapping(o.type);if(!s)return null;let l=(s.length?s[s.length-1]:e).contentMatch;for(let c=r;l&&c<i;c++)l=l.matchType(n.child(c).type);return !l||!l.validEnd?null:s}function hv(t,e,n){let r=N.empty;for(let s=n.length-1;s>=0;s--){if(r.size){let a=n[s].type.contentMatch.matchFragment(r);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=N.from(n[s].type.create(n[s].attrs,r));}let i=e.start,o=e.end;t.step(new Me(i,o,i,o,new B(r,0,0),n.length,!0));}function mv(t,e,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=t.steps.length;t.doc.nodesBetween(e,n,(s,a)=>{let l=typeof i=="function"?i(s):i;if(s.isTextblock&&!s.hasMarkup(r,l)&&gv(t.doc,t.mapping.slice(o).map(a),r)){let c=null;if(r.schema.linebreakReplacement){let p=r.whitespace=="pre",h=!!r.contentMatch.matchType(r.schema.linebreakReplacement);p&&!h?c=!1:!p&&h&&(c=!0);}c===!1&&Pu(t,s,a,o),qa(t,t.mapping.slice(o).map(a,1),r,void 0,c===null);let d=t.mapping.slice(o),u=d.map(a,1),f=d.map(a+s.nodeSize,1);return t.step(new Me(u,f,u+1,f-1,new B(N.from(r.create(l,null,s.marks)),0,0),1,!0)),c===!0&&Lu(t,s,a,o),!1}});}function Lu(t,e,n,r){e.forEach((i,o)=>{if(i.isText){let s,a=/\r?\n|\r/g;for(;s=a.exec(i.text);){let l=t.mapping.slice(r).map(n+1+o+s.index);t.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create());}}});}function Pu(t,e,n,r){e.forEach((i,o)=>{if(i.type==i.type.schema.linebreakReplacement){let s=t.mapping.slice(r).map(n+1+o);t.replaceWith(s,s+1,e.type.schema.text(`
|
|
29
|
-
`));}});}function gv(t,e,n){let r=t.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function bv(t,e,n,r,i){let o=t.doc.nodeAt(e);if(!o)throw new RangeError("No node at given position");n||(n=o.type);let s=n.create(r,null,i||o.marks);if(o.isLeaf)return t.replaceWith(e,e+o.nodeSize,s);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new Me(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new B(N.from(s),0,0),1,!0));}function Mt(t,e,n=1,r){let i=t.resolve(e),o=i.depth-n,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return !1;for(let c=i.depth-1,d=n-2;c>o;c--,d--){let u=i.node(c),f=i.index(c);if(u.type.spec.isolating)return !1;let p=u.content.cutByIndex(f,u.childCount),h=r&&r[d+1];h&&(p=p.replaceChild(0,h.type.create(h.attrs)));let m=r&&r[d]||u;if(!u.canReplace(f+1,u.childCount)||!m.type.validContent(p))return !1}let a=i.indexAfter(o),l=r&&r[0];return i.node(o).canReplaceWith(a,a,l?l.type:i.node(o+1).type)}function yv(t,e,n=1,r){let i=t.doc.resolve(e),o=N.empty,s=N.empty;for(let a=i.depth,l=i.depth-n,c=n-1;a>l;a--,c--){o=N.from(i.node(a).copy(o));let d=r&&r[c];s=N.from(d?d.type.create(d.attrs,s):i.node(a).copy(s));}t.step(new De(e,e,new B(o.append(s),n,n),!0));}function Rt(t,e){let n=t.resolve(e),r=n.index();return Bu(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function Ev(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let i=0;i<e.childCount;i++){let o=e.child(i),s=o.type==r?t.type.schema.nodes.text:o.type;if(n=n.matchType(s),!n||!t.type.allowsMarks(o.marks))return !1}return n.validEnd}function Bu(t,e){return !!(t&&e&&!t.isLeaf&&Ev(t,e))}function ir(t,e,n=-1){let r=t.resolve(e);for(let i=r.depth;;i--){let o,s,a=r.index(i);if(i==r.depth?(o=r.nodeBefore,s=r.nodeAfter):n>0?(o=r.node(i+1),a++,s=r.node(i).maybeChild(a)):(o=r.node(i).maybeChild(a-1),s=r.node(i+1)),o&&!o.isTextblock&&Bu(o,s)&&r.node(i).canReplace(a,a+1))return e;if(i==0)break;e=n<0?r.before(i):r.after(i);}}function vv(t,e,n){let r=null,{linebreakReplacement:i}=t.doc.type.schema,o=t.doc.resolve(e-n),s=o.node().type;if(i&&s.inlineContent){let d=s.whitespace=="pre",u=!!s.contentMatch.matchType(i);d&&!u?r=!1:!d&&u&&(r=!0);}let a=t.steps.length;if(r===!1){let d=t.doc.resolve(e+n);Pu(t,d.node(),d.before(),a);}s.inlineContent&&qa(t,e+n-1,s,o.node().contentMatchAt(o.index()),r==null);let l=t.mapping.slice(a),c=l.map(e-n);if(t.step(new De(c,l.map(e+n,-1),B.empty,!0)),r===!0){let d=t.doc.resolve(c);Lu(t,d.node(),d.before(),t.steps.length);}return t}function wv(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let o=r.index(i);if(r.node(i).canReplaceWith(o,o,n))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let o=r.indexAfter(i);if(r.node(i).canReplaceWith(o,o,n))return r.after(i+1);if(o<r.node(i).childCount)return null}return null}function Co(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let i=n.content;for(let o=0;o<n.openStart;o++)i=i.firstChild.content;for(let o=1;o<=(n.openStart==0&&n.size?2:1);o++)for(let s=r.depth;s>=0;s--){let a=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,l=r.index(s)+(a>0?1:0),c=r.node(s),d=!1;if(o==1)d=c.canReplace(l,l,i);else {let u=c.contentMatchAt(l).findWrapping(i.firstChild.type);d=u&&c.canReplaceWith(l,l,u[0]);}if(d)return a==0?r.pos:a<0?r.before(s+1):r.after(s+1)}return null}function Ei(t,e,n=e,r=B.empty){if(e==n&&!r.size)return null;let i=t.resolve(e),o=t.resolve(n);return zu(i,o,r)?new De(e,n,r):new Wa(i,o,r).fit()}function zu(t,e,n){return !n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}var Wa=class{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=N.empty;for(let i=0;i<=e.depth;i++){let o=e.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(e.indexAfter(i))});}for(let i=e.depth;i>0;i--)this.placed=N.from(e.node(i).copy(this.placed));}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode();}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let o=this.placed,s=r.depth,a=i.depth;for(;s&&a&&o.childCount==1;)o=o.firstChild.content,s--,a--;let l=new B(o,s,a);return e>-1?new Me(r.pos,e,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new De(r.pos,i.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<e;r++){let o=n.firstChild;if(n.childCount>1&&(i=0),o.type.spec.isolating&&i<=r){e=r;break}n=o.content;}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let i,o=null;r?(o=$a(this.unplaced.content,r-1).firstChild,i=o.content):i=this.unplaced.content;let s=i.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:c}=this.frontier[a],d,u=null;if(n==1&&(s?c.matchType(s.type)||(u=c.fillBefore(N.from(s),!1)):o&&l.compatibleContent(o.type)))return {sliceDepth:r,frontierDepth:a,parent:o,inject:u};if(n==2&&s&&(d=c.findWrapping(s.type)))return {sliceDepth:r,frontierDepth:a,parent:o,wrap:d};if(o&&c.matchType(o.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=$a(e,n);return !i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new B(e,n+1,Math.max(r,i.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=$a(e,n);if(i.childCount<=1&&n>0){let o=e.size-n<=n+i.size;this.unplaced=new B(gi(e,n-1,1),n-1,o?n-1:r);}else this.unplaced=new B(gi(e,n,1),n,r);}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:i,wrap:o}){for(;this.depth>n;)this.closeFrontierNode();if(o)for(let m=0;m<o.length;m++)this.openFrontierNode(o[m]);let s=this.unplaced,a=r?r.content:s.content,l=s.openStart-e,c=0,d=[],{match:u,type:f}=this.frontier[n];if(i){for(let m=0;m<i.childCount;m++)d.push(i.child(m));u=u.matchFragment(i);}let p=a.size+e-(s.content.size-s.openEnd);for(;c<a.childCount;){let m=a.child(c),g=u.matchType(m.type);if(!g)break;c++,(c>1||l==0||m.content.size)&&(u=g,d.push(Fu(m.mark(f.allowedMarks(m.marks)),c==1?l:0,c==a.childCount?p:-1)));}let h=c==a.childCount;h||(p=-1),this.placed=bi(this.placed,n,N.from(d)),this.frontier[n].match=u,h&&p<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let m=0,g=a;m<p;m++){let b=g.lastChild;this.frontier.push({type:b.type,match:b.contentMatchAt(b.childCount)}),g=b.content;}this.unplaced=h?e==0?B.empty:new B(gi(s.content,e-1,1),e-1,p<0?s.openEnd:e-1):new B(gi(s.content,e,c),s.openStart,s.openEnd);}mustMoveInline(){if(!this.$to.parent.isTextblock)return -1;let e=this.frontier[this.depth],n;if(!e.type.isTextblock||!Ka(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return -1;let{depth:r}=this.$to,i=this.$to.after(r);for(;r>1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:i}=this.frontier[n],o=n<e.depth&&e.end(n+1)==e.pos+(e.depth-(n+1)),s=Ka(e,n,i,r,o);if(s){for(let a=n-1;a>=0;a--){let{match:l,type:c}=this.frontier[a],d=Ka(e,a,c,l,!0);if(!d||d.childCount)continue e}return {depth:n,fit:s,move:o?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=bi(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let i=e.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,o);}return e}openFrontierNode(e,n=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=bi(this.placed,this.depth,N.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch});}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(N.empty,!0);n.childCount&&(this.placed=bi(this.placed,this.frontier.length,n));}};function gi(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(gi(t.firstChild.content,e-1,n)))}function bi(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(bi(t.lastChild.content,e-1,n)))}function $a(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function Fu(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,Fu(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(N.empty,!0)))),t.copy(r)}function Ka(t,e,n,r,i){let o=t.node(e),s=i?t.indexAfter(e):t.index(e);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let a=r.fillBefore(o.content,!0,s);return a&&!xv(n,o.content,s)?a:null}function xv(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return !0;return !1}function Sv(t){return t.spec.defining||t.spec.definingForContent}function Cv(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let i=t.doc.resolve(e),o=t.doc.resolve(n);if(zu(i,o,r))return t.step(new De(e,n,r));let s=Hu(i,t.doc.resolve(n));s[s.length-1]==0&&s.pop();let a=-(i.depth+1);s.unshift(a);for(let f=i.depth,p=i.pos-1;f>0;f--,p--){let h=i.node(f).type.spec;if(h.defining||h.definingAsContext||h.isolating)break;s.indexOf(f)>-1?a=f:i.before(f)==p&&s.splice(1,0,-f);}let l=s.indexOf(a),c=[],d=r.openStart;for(let f=r.content,p=0;;p++){let h=f.firstChild;if(c.push(h),p==r.openStart)break;f=h.content;}for(let f=d-1;f>=0;f--){let p=c[f],h=Sv(p.type);if(h&&!p.sameMarkup(i.node(Math.abs(a)-1)))d=f;else if(h||!p.type.isTextblock)break}for(let f=r.openStart;f>=0;f--){let p=(f+d+1)%(r.openStart+1),h=c[p];if(h)for(let m=0;m<s.length;m++){let g=s[(m+l)%s.length],b=!0;g<0&&(b=!1,g=-g);let v=i.node(g-1),S=i.index(g-1);if(v.canReplaceWith(S,S,h.type,h.marks))return t.replace(i.before(g),b?o.after(g):n,new B(Uu(r.content,0,r.openStart,p),p,r.openEnd))}}let u=t.steps.length;for(let f=s.length-1;f>=0&&(t.replace(e,n,r),!(t.steps.length>u));f--){let p=s[f];p<0||(e=i.before(p),n=o.after(p));}}function Uu(t,e,n,r,i){if(e<n){let o=t.firstChild;t=t.replaceChild(0,o.copy(Uu(o.content,e+1,n,r,o)));}if(e>r){let o=i.contentMatchAt(0),s=o.fillBefore(t).append(t);t=s.append(o.matchFragment(s).fillBefore(N.empty,!0));}return t}function kv(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let i=wv(t.doc,e,r.type);i!=null&&(e=n=i);}t.replaceRange(e,n,new B(N.from(r),0,0));}function Nv(t,e,n){let r=t.doc.resolve(e),i=t.doc.resolve(n),o=Hu(r,i);for(let s=0;s<o.length;s++){let a=o[s],l=s==o.length-1;if(l&&a==0||r.node(a).type.contentMatch.validEnd)return t.delete(r.start(a),i.end(a));if(a>0&&(l||r.node(a-1).canReplace(r.index(a-1),i.indexAfter(a-1))))return t.delete(r.before(a),i.after(a))}for(let s=1;s<=r.depth&&s<=i.depth;s++)if(e-r.start(s)==r.depth-s&&n>r.end(s)&&i.end(s)-n!=i.depth-s&&r.start(s-1)==i.start(s-1)&&r.node(s-1).canReplace(r.index(s-1),i.index(s-1)))return t.delete(r.before(s),n);t.delete(e,n);}function Hu(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let i=r;i>=0;i--){let o=t.start(i);if(o<t.pos-(t.depth-i)||e.end(i)>e.pos+(e.depth-i)||t.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(o==e.start(i)||i==t.depth&&i==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==o-1)&&n.push(i);}return n}var On=class extends Ze{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r;}apply(e){let n=e.nodeAt(this.pos);if(!n)return Be.fail("No node at attribute step's position");let r=Object.create(null);for(let o in n.attrs)r[o]=n.attrs[o];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return Be.fromReplace(e,this.pos,this.pos+1,new B(N.from(i),0,n.isLeaf?0:1))}getMap(){return gt.empty}invert(e){return new On(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new On(n.pos,this.attr,this.value)}toJSON(){return {stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new On(n.pos,n.attr,n.value)}};Ze.jsonID("attr",On);var rr=class extends Ze{constructor(e,n){super(),this.attr=e,this.value=n;}apply(e){let n=Object.create(null);for(let i in e.attrs)n[i]=e.attrs[i];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return Be.ok(r)}getMap(){return gt.empty}invert(e){return new rr(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return {stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new rr(n.attr,n.value)}};Ze.jsonID("docAttr",rr);var Dr=class extends Error{};Dr=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};Dr.prototype=Object.create(Error.prototype);Dr.prototype.constructor=Dr;Dr.prototype.name="TransformError";var Dn=class{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Rn;}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new Dr(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n;}replace(e,n=e,r=B.empty){let i=Ei(this.doc,e,n,r);return i&&this.step(i),this}replaceWith(e,n,r){return this.replace(e,n,new B(N.from(r),0,0))}delete(e,n){return this.replace(e,n,B.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return Cv(this,e,n,r),this}replaceRangeWith(e,n,r){return kv(this,e,n,r),this}deleteRange(e,n){return Nv(this,e,n),this}lift(e,n){return uv(this,e,n),this}join(e,n=1){return vv(this,e,n),this}wrap(e,n){return hv(this,e,n),this}setBlockType(e,n=e,r,i=null){return mv(this,e,n,r,i),this}setNodeMarkup(e,n,r=null,i){return bv(this,e,n,r,i),this}setNodeAttribute(e,n,r){return this.step(new On(e,n,r)),this}setDocAttribute(e,n){return this.step(new rr(e,n)),this}addNodeMark(e,n){return this.step(new qt(e,n)),this}removeNodeMark(e,n){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n instanceof be)n.isInSet(r.marks)&&this.step(new hn(e,n));else {let i=r.marks,o,s=[];for(;o=n.isInSet(i);)s.push(new hn(e,o)),i=o.removeFromSet(i);for(let a=s.length-1;a>=0;a--)this.step(s[a]);}return this}split(e,n=1,r){return yv(this,e,n,r),this}addMark(e,n,r){return lv(this,e,n,r),this}removeMark(e,n,r){return cv(this,e,n,r),this}clearIncompatible(e,n,r){return qa(this,e,n,r),this}};var ja=Object.create(null),q=class{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new Pr(e.min(n),e.max(n))];}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let n=0;n<e.length;n++)if(e[n].$from.pos!=e[n].$to.pos)return !1;return !0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,n=B.empty){let r=n.content.lastChild,i=null;for(let a=0;a<n.openEnd;a++)i=r,r=r.lastChild;let o=e.steps.length,s=this.ranges;for(let a=0;a<s.length;a++){let{$from:l,$to:c}=s[a],d=e.mapping.slice(o);e.replaceRange(d.map(l.pos),d.map(c.pos),a?B.empty:n),a==0&&Vu(e,o,(r?r.isInline:i&&i.isTextblock)?-1:1);}}replaceWith(e,n){let r=e.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){let{$from:s,$to:a}=i[o],l=e.mapping.slice(r),c=l.map(s.pos),d=l.map(a.pos);o?e.deleteRange(c,d):(e.replaceRangeWith(c,d,n),Vu(e,r,n.isInline?-1:1));}}static findFrom(e,n,r=!1){let i=e.parent.inlineContent?new H(e):Lr(e.node(0),e.parent,e.pos,e.index(),n,r);if(i)return i;for(let o=e.depth-1;o>=0;o--){let s=n<0?Lr(e.node(0),e.node(o),e.before(o+1),e.index(o),n,r):Lr(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,n,r);if(s)return s}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new je(e.node(0))}static atStart(e){return Lr(e,e,0,0,1)||new je(e)}static atEnd(e){return Lr(e,e,e.content.size,e.childCount,-1)||new je(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=ja[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in ja)throw new RangeError("Duplicate use of selection JSON ID "+e);return ja[e]=n,n.prototype.jsonID=e,n}getBookmark(){return H.between(this.$anchor,this.$head).getBookmark()}};q.prototype.visible=!0;var Pr=class{constructor(e,n){this.$from=e,this.$to=n;}},$u=!1;function Ku(t){!$u&&!t.parent.inlineContent&&($u=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"));}var H=class extends q{constructor(e,n=e){Ku(e),Ku(n),super(e,n);}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return q.near(r);let i=e.resolve(n.map(this.anchor));return new H(i.parent.inlineContent?i:r,r)}replace(e,n=B.empty){if(super.replace(e,n),n==B.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r);}}eq(e){return e instanceof H&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Br(this.anchor,this.head)}toJSON(){return {type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new H(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let i=e.resolve(n);return new this(i,r==n?i:e.resolve(r))}static between(e,n,r){let i=e.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let o=q.findFrom(n,r,!0)||q.findFrom(n,-r,!0);if(o)n=o.$head;else return q.near(n,r)}return e.parent.inlineContent||(i==0?e=n:(e=(q.findFrom(e,-r,!0)||q.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=i<0&&(e=n))),new H(e,n)}};q.jsonID("text",H);var Br=class{constructor(e,n){this.anchor=e,this.head=n;}map(e){return new Br(e.map(this.anchor),e.map(this.head))}resolve(e){return H.between(e.resolve(this.anchor),e.resolve(this.head))}},W=class extends q{constructor(e){let n=e.nodeAfter,r=e.node(0).resolve(e.pos+n.nodeSize);super(e,r),this.node=n;}map(e,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),o=e.resolve(i);return r?q.near(o):new W(o)}content(){return new B(N.from(this.node),0,0)}eq(e){return e instanceof W&&e.anchor==this.anchor}toJSON(){return {type:"node",anchor:this.anchor}}getBookmark(){return new wi(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new W(e.resolve(n.anchor))}static create(e,n){return new W(e.resolve(n))}static isSelectable(e){return !e.isText&&e.type.spec.selectable!==!1}};W.prototype.visible=!1;q.jsonID("node",W);var wi=class{constructor(e){this.anchor=e;}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new Br(r,r):new wi(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&W.isSelectable(r)?new W(n):q.near(n)}},je=class extends q{constructor(e){super(e.resolve(0),e.resolve(e.content.size));}replace(e,n=B.empty){if(n==B.empty){e.delete(0,e.doc.content.size);let r=q.atStart(e.doc);r.eq(e.selection)||e.setSelection(r);}else super.replace(e,n);}toJSON(){return {type:"all"}}static fromJSON(e){return new je(e)}map(e){return new je(e)}eq(e){return e instanceof je}getBookmark(){return Tv}};q.jsonID("all",je);var Tv={map(){return this},resolve(t){return new je(t)}};function Lr(t,e,n,r,i,o=!1){if(e.inlineContent)return H.create(t,n);for(let s=r-(i>0?0:1);i>0?s<e.childCount:s>=0;s+=i){let a=e.child(s);if(a.isAtom){if(!o&&W.isSelectable(a))return W.create(t,n-(i<0?a.nodeSize:0))}else {let l=Lr(t,a,n+i,i<0?a.childCount:0,i,o);if(l)return l}n+=a.nodeSize*i;}return null}function Vu(t,e,n){let r=t.steps.length-1;if(r<e)return;let i=t.steps[r];if(!(i instanceof De||i instanceof Me))return;let o=t.mapping.maps[r],s;o.forEach((a,l,c,d)=>{s==null&&(s=d);}),t.setSelection(q.near(t.doc.resolve(s),n));}var Wu=1,ko=2,Gu=4,Ya=class extends Dn{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks;}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|Wu)&~ko,this.storedMarks=null,this}get selectionSet(){return (this.updated&Wu)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=ko,this}ensureMarks(e){return be.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return (this.updated&ko)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~ko,this.storedMarks=null;}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||be.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let i=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),r=r??n,!e)return this.deleteRange(n,r);let o=this.storedMarks;if(!o){let s=this.doc.resolve(n);o=r==n?s.marks():s.marksAcross(this.doc.resolve(r));}return this.replaceRangeWith(n,r,i.text(e,o)),this.selection.empty||this.setSelection(q.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return !1;return !0}scrollIntoView(){return this.updated|=Gu,this}get scrolledIntoView(){return (this.updated&Gu)>0}};function qu(t,e){return !e||!t?t:t.bind(e)}var or=class{constructor(e,n,r){this.name=e,this.init=qu(n.init,r),this.apply=qu(n.apply,r);}},_v=[new or("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new or("selection",{init(t,e){return t.selection||q.atStart(e.doc)},apply(t){return t.selection}}),new or("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new or("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})],vi=class{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=_v.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new or(r.key,r.spec.state,r));});}},gn=class{constructor(e){this.config=e;}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let i=this.config.plugins[r];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,e,this))return !1}return !0}applyTransaction(e){if(!this.filterTransaction(e))return {state:this,transactions:[]};let n=[e],r=this.applyInner(e),i=null;for(;;){let o=!1;for(let s=0;s<this.config.plugins.length;s++){let a=this.config.plugins[s];if(a.spec.appendTransaction){let l=i?i[s].n:0,c=i?i[s].state:this,d=l<n.length&&a.spec.appendTransaction.call(a,l?n.slice(l):n,c,r);if(d&&r.filterTransaction(d,s)){if(d.setMeta("appendedTransaction",e),!i){i=[];for(let u=0;u<this.config.plugins.length;u++)i.push(u<s?{state:r,n:n.length}:{state:this,n:0});}n.push(d),r=r.applyInner(d),o=!0;}i&&(i[s]={state:r,n:n.length});}}if(!o)return {state:r,transactions:n}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new gn(this.config),r=this.config.fields;for(let i=0;i<r.length;i++){let o=r[i];n[o.name]=o.apply(e,this[o.name],this,n);}return n}get tr(){return new Ya(this)}static create(e){let n=new vi(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new gn(n);for(let i=0;i<n.fields.length;i++)r[n.fields[i].name]=n.fields[i].init(e,r);return r}reconfigure(e){let n=new vi(this.schema,e.plugins),r=n.fields,i=new gn(n);for(let o=0;o<r.length;o++){let s=r[o].name;i[s]=this.hasOwnProperty(s)?this[s]:r[o].init(e,i);}return i}toJSON(e){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[r],o=i.spec.state;o&&o.toJSON&&(n[r]=o.toJSON.call(i,this[i.key]));}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new vi(e.schema,e.plugins),o=new gn(i);return i.fields.forEach(s=>{if(s.name=="doc")o.doc=et.fromJSON(e.schema,n.doc);else if(s.name=="selection")o.selection=q.fromJSON(o.doc,n.selection);else if(s.name=="storedMarks")n.storedMarks&&(o.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else {if(r)for(let a in r){let l=r[a],c=l.spec.state;if(l.key==s.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(n,a)){o[s.name]=c.fromJSON.call(l,e,n[a],o);return}}o[s.name]=s.init(e,o);}}),o}};function ju(t,e,n){for(let r in t){let i=t[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=ju(i,e,{})),n[r]=i;}return n}var Z=class{constructor(e){this.spec=e,this.props={},e.props&&ju(e.props,this,this.props),this.key=e.key?e.key.key:Ju("plugin");}getState(e){return e[this.key]}},Ja=Object.create(null);function Ju(t){return t in Ja?t+"$"+ ++Ja[t]:(Ja[t]=0,t+"$")}var re=class{constructor(e="key"){this.key=Ju(e);}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}};var tt=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},$r=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e},nl=null,yn=function(t,e,n){let r=nl||(nl=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},Mv=function(){nl=null;},ur=function(t,e,n,r){return n&&(Yu(t,e,n,r,-1)||Yu(t,e,n,r,1))},Av=/^(img|br|input|textarea|hr)$/i;function Yu(t,e,n,r,i){for(var o;;){if(t==n&&e==r)return !0;if(e==(i<0?0:It(t))){let s=t.parentNode;if(!s||s.nodeType!=1||Ai(t)||Av.test(t.nodeName)||t.contentEditable=="false")return !1;e=tt(t)+(i<0?0:1),t=s;}else if(t.nodeType==1){let s=t.childNodes[e+(i<0?-1:0)];if(s.nodeType==1&&s.contentEditable=="false")if(!((o=s.pmViewDesc)===null||o===void 0)&&o.ignoreForSelection)e+=i;else return !1;else t=s,e=i<0?It(t):0;}else return !1}}function It(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Ov(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=It(t);}else if(t.parentNode&&!Ai(t))e=tt(t),t=t.parentNode;else return null}}function Rv(t,e){for(;;){if(t.nodeType==3&&e<t.nodeValue.length)return t;if(t.nodeType==1&&e<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[e],e=0;}else if(t.parentNode&&!Ai(t))e=tt(t)+1,t=t.parentNode;else return null}}function Dv(t,e,n){for(let r=e==0,i=e==It(t);r||i;){if(t==n)return !0;let o=tt(t);if(t=t.parentNode,!t)return !1;r=r&&o==0,i=i&&o==It(t);}}function Ai(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}var Do=function(t){return t.focusNode&&ur(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function sr(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function Iv(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function Lv(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return {node:r.offsetNode,offset:Math.min(It(r.offsetNode),r.offset)}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return {node:r.startContainer,offset:Math.min(It(r.startContainer),r.startOffset)}}}var Zt=typeof navigator<"u"?navigator:null,Zu=typeof document<"u"?document:null,zn=Zt&&Zt.userAgent||"",rl=/Edge\/(\d+)/.exec(zn),Af=/MSIE \d/.exec(zn),il=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(zn),xt=!!(Af||il||rl),Bn=Af?document.documentMode:il?+il[1]:rl?+rl[1]:0,Kt=!xt&&/gecko\/(\d+)/i.test(zn);Kt&&+(/Firefox\/(\d+)/.exec(zn)||[0,0])[1];var ol=!xt&&/Chrome\/(\d+)/.exec(zn),ut=!!ol,Of=ol?+ol[1]:0,bt=!xt&&!!Zt&&/Apple Computer/.test(Zt.vendor),Kr=bt&&(/Mobile\/\w+/.test(zn)||!!Zt&&Zt.maxTouchPoints>2),Dt=Kr||(Zt?/Mac/.test(Zt.platform):!1),Pv=Zt?/Win/.test(Zt.platform):!1,En=/Android \d/.test(zn),Oi=!!Zu&&"webkitFontSmoothing"in Zu.documentElement.style,Bv=Oi?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function zv(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function bn(t,e){return typeof t=="number"?t:t[e]}function Fv(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return {left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function Xu(t,e,n){let r=t.someProp("scrollThreshold")||0,i=t.someProp("scrollMargin")||5,o=t.dom.ownerDocument;for(let s=n||t.dom;s;){if(s.nodeType!=1){s=$r(s);continue}let a=s,l=a==o.body,c=l?zv(o):Fv(a),d=0,u=0;if(e.top<c.top+bn(r,"top")?u=-(c.top-e.top+bn(i,"top")):e.bottom>c.bottom-bn(r,"bottom")&&(u=e.bottom-e.top>c.bottom-c.top?e.top+bn(i,"top")-c.top:e.bottom-c.bottom+bn(i,"bottom")),e.left<c.left+bn(r,"left")?d=-(c.left-e.left+bn(i,"left")):e.right>c.right-bn(r,"right")&&(d=e.right-c.right+bn(i,"right")),d||u)if(l)o.defaultView.scrollBy(d,u);else {let p=a.scrollLeft,h=a.scrollTop;u&&(a.scrollTop+=u),d&&(a.scrollLeft+=d);let m=a.scrollLeft-p,g=a.scrollTop-h;e={left:e.left-m,top:e.top-g,right:e.right-m,bottom:e.bottom-g};}let f=l?"fixed":getComputedStyle(s).position;if(/^(fixed|sticky)$/.test(f))break;s=f=="absolute"?s.offsetParent:$r(s);}}function Uv(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,i;for(let o=(e.left+e.right)/2,s=n+1;s<Math.min(innerHeight,e.bottom);s+=5){let a=t.root.elementFromPoint(o,s);if(!a||a==t.dom||!t.dom.contains(a))continue;let l=a.getBoundingClientRect();if(l.top>=n-20){r=a,i=l.top;break}}return {refDOM:r,refTop:i,stack:Rf(t.dom)}}function Rf(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=$r(r));return e}function Hv({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;Df(n,r==0?0:r-e);}function Df(t,e){for(let n=0;n<t.length;n++){let{dom:r,top:i,left:o}=t[n];r.scrollTop!=i+e&&(r.scrollTop=i+e),r.scrollLeft!=o&&(r.scrollLeft=o);}}var zr=null;function $v(t){if(t.setActive)return t.setActive();if(zr)return t.focus(zr);let e=Rf(t);t.focus(zr==null?{get preventScroll(){return zr={preventScroll:!0},!0}}:void 0),zr||(zr=!1,Df(e,0));}function If(t,e){let n,r=2e8,i,o=0,s=e.top,a=e.top,l,c;for(let d=t.firstChild,u=0;d;d=d.nextSibling,u++){let f;if(d.nodeType==1)f=d.getClientRects();else if(d.nodeType==3)f=yn(d).getClientRects();else continue;for(let p=0;p<f.length;p++){let h=f[p];if(h.top<=s&&h.bottom>=a){s=Math.max(h.bottom,s),a=Math.min(h.top,a);let m=h.left>e.left?h.left-e.left:h.right<e.left?e.left-h.right:0;if(m<r){n=d,r=m,i=m&&n.nodeType==3?{left:h.right<e.left?h.right:h.left,top:e.top}:e,d.nodeType==1&&m&&(o=u+(e.left>=(h.left+h.right)/2?1:0));continue}}else h.top>e.top&&!l&&h.left<=e.left&&h.right>=e.left&&(l=d,c={left:Math.max(h.left,Math.min(h.right,e.left)),top:h.top});!n&&(e.left>=h.right&&e.top>=h.top||e.left>=h.left&&e.top>=h.bottom)&&(o=u+1);}}return !n&&l&&(n=l,i=c,r=0),n&&n.nodeType==3?Kv(n,i):!n||r&&n.nodeType==1?{node:t,offset:o}:If(n,i)}function Kv(t,e){let n=t.nodeValue.length,r=document.createRange();for(let i=0;i<n;i++){r.setEnd(t,i+1),r.setStart(t,i);let o=In(r,1);if(o.top!=o.bottom&&El(e,o))return {node:t,offset:i+(e.left>=(o.left+o.right)/2?1:0)}}return {node:t,offset:0}}function El(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function Vv(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function Wv(t,e,n){let{node:r,offset:i}=If(e,n),o=-1;if(r.nodeType==1&&!r.firstChild){let s=r.getBoundingClientRect();o=s.left!=s.right&&n.left>(s.left+s.right)/2?1:-1;}return t.docView.posFromDOM(r,i,o)}function Gv(t,e,n,r){let i=-1;for(let o=e,s=!1;o!=t.dom;){let a=t.docView.nearestDesc(o,!0),l;if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent||!a.contentDOM)&&((l=a.dom.getBoundingClientRect()).width||l.height)&&(a.node.isBlock&&a.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(a.dom.nodeName)&&(!s&&l.left>r.left||l.top>r.top?i=a.posBefore:(!s&&l.right<r.left||l.bottom<r.top)&&(i=a.posAfter),s=!0),!a.contentDOM&&i<0&&!a.node.isText))return (a.node.isBlock?r.top<(l.top+l.bottom)/2:r.left<(l.left+l.right)/2)?a.posBefore:a.posAfter;o=a.dom.parentNode;}return i>-1?i:t.docView.posFromDOM(e,n,-1)}function Lf(t,e,n){let r=t.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-n.top)/(n.bottom-n.top))-2)),o=i;;){let s=t.childNodes[o];if(s.nodeType==1){let a=s.getClientRects();for(let l=0;l<a.length;l++){let c=a[l];if(El(e,c))return Lf(s,e,c)}}if((o=(o+1)%r)==i)break}return t}function qv(t,e){let n=t.dom.ownerDocument,r,i=0,o=Lv(n,e.left,e.top);o&&({node:r,offset:i}=o);let s=(t.root.elementFromPoint?t.root:n).elementFromPoint(e.left,e.top),a;if(!s||!t.dom.contains(s.nodeType!=1?s.parentNode:s)){let c=t.dom.getBoundingClientRect();if(!El(e,c)||(s=Lf(t.dom,e,c),!s))return null}if(bt)for(let c=s;r&&c;c=$r(c))c.draggable&&(r=void 0);if(s=Vv(s,e),r){if(Kt&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let d=r.childNodes[i],u;d.nodeName=="IMG"&&(u=d.getBoundingClientRect()).right<=e.left&&u.bottom>e.top&&i++;}let c;Oi&&i&&r.nodeType==1&&(c=r.childNodes[i-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=e.top&&i--,r==t.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?a=t.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(a=Gv(t,r,i,e));}a==null&&(a=Wv(t,s,e));let l=t.docView.nearestDesc(s,!0);return {pos:a,inside:l?l.posAtStart-l.border:-1}}function Qu(t){return t.top<t.bottom||t.left<t.right}function In(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(Qu(r))return r}return Array.prototype.find.call(n,Qu)||t.getBoundingClientRect()}var jv=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Pf(t,e,n){let{node:r,offset:i,atom:o}=t.docView.domFromPos(e,n<0?-1:1),s=Oi||Kt;if(r.nodeType==3)if(s&&(jv.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let l=In(yn(r,i,i),n);if(Kt&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let c=In(yn(r,i-1,i-1),-1);if(c.top==l.top){let d=In(yn(r,i,i+1),-1);if(d.top!=l.top)return xi(d,d.left<c.left)}}return l}else {let l=i,c=i,d=n<0?1:-1;return n<0&&!i?(c++,d=-1):n>=0&&i==r.nodeValue.length?(l--,d=1):n<0?l--:c++,xi(In(yn(r,l,c),d),d<0)}if(!t.state.doc.resolve(e-(o||0)).parent.inlineContent){if(o==null&&i&&(n<0||i==It(r))){let l=r.childNodes[i-1];if(l.nodeType==1)return Za(l.getBoundingClientRect(),!1)}if(o==null&&i<It(r)){let l=r.childNodes[i];if(l.nodeType==1)return Za(l.getBoundingClientRect(),!0)}return Za(r.getBoundingClientRect(),n>=0)}if(o==null&&i&&(n<0||i==It(r))){let l=r.childNodes[i-1],c=l.nodeType==3?yn(l,It(l)-(s?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(c)return xi(In(c,1),!1)}if(o==null&&i<It(r)){let l=r.childNodes[i];for(;l.pmViewDesc&&l.pmViewDesc.ignoreForCoords;)l=l.nextSibling;let c=l?l.nodeType==3?yn(l,0,s?0:1):l.nodeType==1?l:null:null;if(c)return xi(In(c,-1),!0)}return xi(In(r.nodeType==3?yn(r):r,-n),n>=0)}function xi(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return {top:t.top,bottom:t.bottom,left:n,right:n}}function Za(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return {top:n,bottom:n,left:t.left,right:t.right}}function Bf(t,e,n){let r=t.state,i=t.root.activeElement;r!=e&&t.updateState(e),i!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),i!=t.dom&&i&&i.focus();}}function Jv(t,e,n){let r=e.selection,i=n=="up"?r.$from:r.$to;return Bf(t,e,()=>{let{node:o}=t.docView.domFromPos(i.pos,n=="up"?-1:1);for(;;){let a=t.docView.nearestDesc(o,!0);if(!a)break;if(a.node.isBlock){o=a.contentDOM||a.dom;break}o=a.dom.parentNode;}let s=Pf(t,i.pos,1);for(let a=o.firstChild;a;a=a.nextSibling){let l;if(a.nodeType==1)l=a.getClientRects();else if(a.nodeType==3)l=yn(a,0,a.nodeValue.length).getClientRects();else continue;for(let c=0;c<l.length;c++){let d=l[c];if(d.bottom>d.top+1&&(n=="up"?s.top-d.top>(d.bottom-s.top)*2:d.bottom-s.bottom>(s.bottom-d.top)*2))return !1}}return !0})}var Yv=/[\u0590-\u08ac]/;function Zv(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return !1;let i=r.parentOffset,o=!i,s=i==r.parent.content.size,a=t.domSelection();return a?!Yv.test(r.parent.textContent)||!a.modify?n=="left"||n=="backward"?o:s:Bf(t,e,()=>{let{focusNode:l,focusOffset:c,anchorNode:d,anchorOffset:u}=t.domSelectionRange(),f=a.caretBidiLevel;a.modify("move",n,"character");let p=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:h,focusOffset:m}=t.domSelectionRange(),g=h&&!p.contains(h.nodeType==1?h:h.parentNode)||l==h&&c==m;try{a.collapse(d,u),l&&(l!=d||c!=u)&&a.extend&&a.extend(l,c);}catch{}return f!=null&&(a.caretBidiLevel=f),g}):r.pos==r.start()||r.pos==r.end()}var ef=null,tf=null,nf=!1;function Xv(t,e,n){return ef==e&&tf==n?nf:(ef=e,tf=n,nf=n=="up"||n=="down"?Jv(t,e,n):Zv(t,e,n))}var Lt=0,rf=1,ar=2,Xt=3,fr=class{constructor(e,n,r,i){this.parent=e,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=Lt,r.pmViewDesc=this;}matchesWidget(e){return !1}matchesMark(e){return !1}matchesNode(e,n,r){return !1}matchesHack(e){return !1}parseRule(){return null}stopEvent(e){return !1}get size(){let e=0;for(let n=0;n<this.children.length;n++)e+=this.children[n].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy();}posBeforeChild(e){for(let n=0,r=this.posAtStart;;n++){let i=this.children[n];if(i==e)return r;r+=i.size;}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,n,r){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(r<0){let o,s;if(e==this.contentDOM)o=e.childNodes[n-1];else {for(;e.parentNode!=this.contentDOM;)e=e.parentNode;o=e.previousSibling;}for(;o&&!((s=o.pmViewDesc)&&s.parent==this);)o=o.previousSibling;return o?this.posBeforeChild(s)+s.size:this.posAtStart}else {let o,s;if(e==this.contentDOM)o=e.childNodes[n];else {for(;e.parentNode!=this.contentDOM;)e=e.parentNode;o=e.nextSibling;}for(;o&&!((s=o.pmViewDesc)&&s.parent==this);)o=o.nextSibling;return o?this.posBeforeChild(s):this.posAtEnd}let i;if(e==this.dom&&this.contentDOM)i=n>tt(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!1;break}if(o.previousSibling)break}if(i==null&&n==e.childNodes.length)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!0;break}if(o.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,i=e;i;i=i.parentNode){let o=this.getDesc(i),s;if(o&&(!n||o.node))if(r&&(s=o.nodeDOM)&&!(s.nodeType==1?s.contains(e.nodeType==1?e:e.parentNode):s==e))r=!1;else return o}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let i=e;i;i=i.parentNode){let o=this.getDesc(i);if(o)return o.localPosFromDOM(e,n,r)}return -1}descAt(e){for(let n=0,r=0;n<this.children.length;n++){let i=this.children[n],o=r+i.size;if(r==e&&o!=r){for(;!i.border&&i.children.length;)for(let s=0;s<i.children.length;s++){let a=i.children[s];if(a.size){i=a;break}}return i}if(e<o)return i.descAt(e-r-i.border);r=o;}}domFromPos(e,n){if(!this.contentDOM)return {node:this.dom,offset:0,atom:e+1};let r=0,i=0;for(let o=0;r<this.children.length;r++){let s=this.children[r],a=o+s.size;if(a>e||s instanceof To){i=e-o;break}o=a;}if(i)return this.children[r].domFromPos(i-this.children[r].border,n);for(let o;r&&!(o=this.children[r-1]).size&&o instanceof No&&o.side>=0;r--);if(n<=0){let o,s=!0;for(;o=r?this.children[r-1]:null,!(!o||o.dom.parentNode==this.contentDOM);r--,s=!1);return o&&n&&s&&!o.border&&!o.domAtom?o.domFromPos(o.size,n):{node:this.contentDOM,offset:o?tt(o.dom)+1:0}}else {let o,s=!0;for(;o=r<this.children.length?this.children[r]:null,!(!o||o.dom.parentNode==this.contentDOM);r++,s=!1);return o&&s&&!o.border&&!o.domAtom?o.domFromPos(0,n):{node:this.contentDOM,offset:o?tt(o.dom):this.contentDOM.childNodes.length}}}parseRange(e,n,r=0){if(this.children.length==0)return {node:this.contentDOM,from:e,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,o=-1;for(let s=r,a=0;;a++){let l=this.children[a],c=s+l.size;if(i==-1&&e<=c){let d=s+l.border;if(e>=d&&n<=c-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,n,d);e=s;for(let u=a;u>0;u--){let f=this.children[u-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){i=tt(f.dom)+1;break}e-=f.size;}i==-1&&(i=0);}if(i>-1&&(c>n||a==this.children.length-1)){n=c;for(let d=a+1;d<this.children.length;d++){let u=this.children[d];if(u.size&&u.dom.parentNode==this.contentDOM&&!u.emptyChildAt(-1)){o=tt(u.dom);break}n+=u.size;}o==-1&&(o=this.contentDOM.childNodes.length);break}s=c;}return {node:this.contentDOM,from:e,to:n,fromOffset:i,toOffset:o}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return !1;let n=this.children[e<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(e)}domAfterPos(e){let{node:n,offset:r}=this.domFromPos(e,0);if(n.nodeType!=1||r==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[r]}setSelection(e,n,r,i=!1){let o=Math.min(e,n),s=Math.max(e,n);for(let p=0,h=0;p<this.children.length;p++){let m=this.children[p],g=h+m.size;if(o>h&&s<g)return m.setSelection(e-h-m.border,n-h-m.border,r,i);h=g;}let a=this.domFromPos(e,e?-1:1),l=n==e?a:this.domFromPos(n,n?-1:1),c=r.root.getSelection(),d=r.domSelectionRange(),u=!1;if((Kt||bt)&&e==n){let{node:p,offset:h}=a;if(p.nodeType==3){if(u=!!(h&&p.nodeValue[h-1]==`
|
|
30
|
-
`),u&&h==p.nodeValue.length)for(let m=p,g;m;m=m.parentNode){if(g=m.nextSibling){g.nodeName=="BR"&&(a=l={node:g.parentNode,offset:tt(g)+1});break}let b=m.pmViewDesc;if(b&&b.node&&b.node.isBlock)break}}else {let m=p.childNodes[h-1];u=m&&(m.nodeName=="BR"||m.contentEditable=="false");}}if(Kt&&d.focusNode&&d.focusNode!=l.node&&d.focusNode.nodeType==1){let p=d.focusNode.childNodes[d.focusOffset];p&&p.contentEditable=="false"&&(i=!0);}if(!(i||u&&bt)&&ur(a.node,a.offset,d.anchorNode,d.anchorOffset)&&ur(l.node,l.offset,d.focusNode,d.focusOffset))return;let f=!1;if((c.extend||e==n)&&!u){c.collapse(a.node,a.offset);try{e!=n&&c.extend(l.node,l.offset),f=!0;}catch{}}if(!f){if(e>n){let h=a;a=l,l=h;}let p=document.createRange();p.setEnd(l.node,l.offset),p.setStart(a.node,a.offset),c.removeAllRanges(),c.addRange(p);}}ignoreMutation(e){return !this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,i=0;i<this.children.length;i++){let o=this.children[i],s=r+o.size;if(r==s?e<=s&&n>=r:e<s&&n>r){let a=r+o.border,l=s-o.border;if(e>=a&&n<=l){this.dirty=e==r||n==s?ar:rf,e==a&&n==l&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=Xt:o.markDirty(e-a,n-a);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?ar:Xt;}r=s;}this.dirty=ar;}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?ar:rf;n.dirty<r&&(n.dirty=r);}}get domAtom(){return !1}get ignoreForCoords(){return !1}get ignoreForSelection(){return !1}isText(e){return !1}},No=class extends fr{constructor(e,n,r,i){let o,s=n.type.toDOM;if(typeof s=="function"&&(s=s(r,()=>{if(!o)return i;if(o.parent)return o.parent.posBeforeChild(o)})),!n.type.spec.raw){if(s.nodeType!=1){let a=document.createElement("span");a.appendChild(s),s=a;}s.contentEditable="false",s.classList.add("ProseMirror-widget");}super(e,[],s,null),this.widget=n,this.widget=n,o=this;}matchesWidget(e){return this.dirty==Lt&&e.type.eq(this.widget.type)}parseRule(){return {ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy();}get domAtom(){return !0}get ignoreForSelection(){return !!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}},sl=class extends fr{constructor(e,n,r,i){super(e,[],n,null),this.textDOM=r,this.text=i;}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return {node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}},wn=class extends fr{constructor(e,n,r,i,o){super(e,[],r,i),this.mark=n,this.spec=o;}static create(e,n,r,i){let o=i.nodeViews[n.type.name],s=o&&o(n,i,r);return (!s||!s.dom)&&(s=$t.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new wn(e,n,s.dom,s.contentDOM||s.dom,s)}parseRule(){return this.dirty&Xt||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Xt&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=Lt){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=Lt;}}slice(e,n,r){let i=wn.create(this.parent,this.mark,!0,r),o=this.children,s=this.size;n<s&&(o=dl(o,n,s,r)),e>0&&(o=dl(o,0,e,r));for(let a=0;a<o.length;a++)o[a].parent=i;return i.children=o,i}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy();}},Jt=class extends fr{constructor(e,n,r,i,o,s,a,l,c){super(e,[],o,s),this.node=n,this.outerDeco=r,this.innerDeco=i,this.nodeDOM=a;}static create(e,n,r,i,o,s){let a=o.nodeViews[n.type.name],l,c=a&&a(n,o,()=>{if(!l)return s;if(l.parent)return l.parent.posBeforeChild(l)},r,i),d=c&&c.dom,u=c&&c.contentDOM;if(n.isText){if(!d)d=document.createTextNode(n.text);else if(d.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else d||({dom:d,contentDOM:u}=$t.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!u&&!n.isText&&d.nodeName!="BR"&&(d.hasAttribute("contenteditable")||(d.contentEditable="false"),n.type.spec.draggable&&(d.draggable=!0));let f=d;return d=Uf(d,r,n),c?l=new al(e,n,r,i,d,u||null,f,c,o,s+1):n.isText?new Vr(e,n,r,i,d,f,o):new Jt(e,n,r,i,d,u||null,f,o,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else {for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>N.empty);}return e}matchesNode(e,n,r){return this.dirty==Lt&&e.eq(this.node)&&_o(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,i=n,o=e.composing?this.localCompositionInfo(e,n):null,s=o&&o.pos>-1?o:null,a=o&&o.pos<0,l=new cl(this,s&&s.node,e);nw(this.node,this.innerDeco,(c,d,u)=>{c.spec.marks?l.syncToMarks(c.spec.marks,r,e):c.type.side>=0&&!u&&l.syncToMarks(d==this.node.childCount?be.none:this.node.child(d).marks,r,e),l.placeWidget(c,e,i);},(c,d,u,f)=>{l.syncToMarks(c.marks,r,e);let p;l.findNodeMatch(c,d,u,f)||a&&e.state.selection.from>i&&e.state.selection.to<i+c.nodeSize&&(p=l.findIndexWithChild(o.node))>-1&&l.updateNodeAt(c,d,u,p,e)||l.updateNextNode(c,d,u,e,f,i)||l.addNode(c,d,u,e,i),i+=c.nodeSize;}),l.syncToMarks([],r,e),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==ar)&&(s&&this.protectLocalComposition(e,s),zf(this.contentDOM,this.children,e),Kr&&rw(this.dom));}localCompositionInfo(e,n){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof H)||r<n||i>n+this.node.content.size)return null;let o=e.input.compositionNode;if(!o||!this.dom.contains(o.parentNode))return null;if(this.node.inlineContent){let s=o.nodeValue,a=iw(this.node.content,s,r-n,i-n);return a<0?null:{node:o,pos:a,text:s}}else return {node:o,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:i}){if(this.getDesc(n))return;let o=n;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0);}let s=new sl(this,o,n,i);e.input.compositionNodes.push(s),this.children=dl(this.children,r,r+i.length,e,s);}update(e,n,r,i){return this.dirty==Xt||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,i),!0)}updateInner(e,n,r,i){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=Lt;}updateOuterDeco(e){if(_o(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=Ff(this.dom,this.nodeDOM,ll(this.outerDeco,this.node,n),ll(e,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e;}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0);}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable"));}get domAtom(){return this.node.isAtom}};function of(t,e,n,r,i){Uf(r,e,t);let o=new Jt(void 0,t,e,n,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}var Vr=class extends Jt{constructor(e,n,r,i,o,s,a){super(e,n,r,i,o,null,s,a,0);}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return {skip:e||!0}}update(e,n,r,i){return this.dirty==Xt||this.dirty!=Lt&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=Lt||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=Lt,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return !0;return !1}domFromPos(e){return {node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let i=this.node.cut(e,n),o=document.createTextNode(i.text);return new Vr(this.parent,i,this.outerDeco,this.innerDeco,o,o,r)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=Xt);}get domAtom(){return !1}isText(e){return this.node.text==e}},To=class extends fr{parseRule(){return {ignore:!0}}matchesHack(e){return this.dirty==Lt&&this.dom.nodeName==e}get domAtom(){return !0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}},al=class extends Jt{constructor(e,n,r,i,o,s,a,l,c,d){super(e,n,r,i,o,s,a,c,d),this.spec=l;}update(e,n,r,i){if(this.dirty==Xt)return !1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let o=this.spec.update(e,n,r);return o&&this.updateInner(e,n,r,i),o}else return !this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode();}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode();}setSelection(e,n,r,i){this.spec.setSelection?this.spec.setSelection(e,n,r.root):super.setSelection(e,n,r,i);}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy();}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}};function zf(t,e,n){let r=t.firstChild,i=!1;for(let o=0;o<e.length;o++){let s=e[o],a=s.dom;if(a.parentNode==t){for(;a!=r;)r=sf(r),i=!0;r=r.nextSibling;}else i=!0,t.insertBefore(a,r);if(s instanceof wn){let l=r?r.previousSibling:t.lastChild;zf(s.contentDOM,s.children,n),r=l?l.nextSibling:t.firstChild;}}for(;r;)r=sf(r),i=!0;i&&n.trackWrites==t&&(n.trackWrites=null);}var Si=function(t){t&&(this.nodeName=t);};Si.prototype=Object.create(null);var lr=[new Si];function ll(t,e,n){if(t.length==0)return lr;let r=n?lr[0]:new Si,i=[r];for(let o=0;o<t.length;o++){let s=t[o].type.attrs;if(s){s.nodeName&&i.push(r=new Si(s.nodeName));for(let a in s){let l=s[a];l!=null&&(n&&i.length==1&&i.push(r=new Si(e.isInline?"span":"div")),a=="class"?r.class=(r.class?r.class+" ":"")+l:a=="style"?r.style=(r.style?r.style+";":"")+l:a!="nodeName"&&(r[a]=l));}}}return i}function Ff(t,e,n,r){if(n==lr&&r==lr)return e;let i=e;for(let o=0;o<r.length;o++){let s=r[o],a=n[o];if(o){let l;a&&a.nodeName==s.nodeName&&i!=t&&(l=i.parentNode)&&l.nodeName.toLowerCase()==s.nodeName||(l=document.createElement(s.nodeName),l.pmIsDeco=!0,l.appendChild(i),a=lr[0]),i=l;}Qv(i,a||lr[0],s);}return i}function Qv(t,e,n){for(let r in e)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&t.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=e[r]&&t.setAttribute(r,n[r]);if(e.class!=n.class){let r=e.class?e.class.split(" ").filter(Boolean):[],i=n.class?n.class.split(" ").filter(Boolean):[];for(let o=0;o<r.length;o++)i.indexOf(r[o])==-1&&t.classList.remove(r[o]);for(let o=0;o<i.length;o++)r.indexOf(i[o])==-1&&t.classList.add(i[o]);t.classList.length==0&&t.removeAttribute("class");}if(e.style!=n.style){if(e.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,i;for(;i=r.exec(e.style);)t.style.removeProperty(i[1]);}n.style&&(t.style.cssText+=n.style);}}function Uf(t,e,n){return Ff(t,t,lr,ll(e,n,t.nodeType!=1))}function _o(t,e){if(t.length!=e.length)return !1;for(let n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return !1;return !0}function sf(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}var cl=class{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=ew(e.node.content,e);}destroyBetween(e,n){if(e!=n){for(let r=e;r<n;r++)this.top.children[r].destroy();this.top.children.splice(e,n-e),this.changed=!0;}}destroyRest(){this.destroyBetween(this.index,this.top.children.length);}syncToMarks(e,n,r){let i=0,o=this.stack.length>>1,s=Math.min(o,e.length);for(;i<s&&(i==o-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&e[i].type.spec.spanning!==!1;)i++;for(;i<o;)this.destroyRest(),this.top.dirty=Lt,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);let a=-1;for(let l=this.index;l<Math.min(this.index+3,this.top.children.length);l++){let c=this.top.children[l];if(c.matchesMark(e[o])&&!this.isLocked(c.dom)){a=l;break}}if(a>-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else {let l=wn.create(this.top,e[o],n,r);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0;}this.index=0,o++;}}findNodeMatch(e,n,r,i){let o=-1,s;if(i>=this.preMatch.index&&(s=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&s.matchesNode(e,n,r))o=this.top.children.indexOf(s,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a<l;a++){let c=this.top.children[a];if(c.matchesNode(e,n,r)&&!this.preMatch.matched.has(c)){o=a;break}}return o<0?!1:(this.destroyBetween(this.index,o),this.index++,!0)}updateNodeAt(e,n,r,i,o){let s=this.top.children[i];return s.dirty==Xt&&s.dom==s.contentDOM&&(s.dirty=ar),s.update(e,n,r,o)?(this.destroyBetween(this.index,i),this.index++,!0):!1}findIndexWithChild(e){for(;;){let n=e.parentNode;if(!n)return -1;if(n==this.top.contentDOM){let r=e.pmViewDesc;if(r){for(let i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==r)return i}return -1}e=n;}}updateNextNode(e,n,r,i,o,s){for(let a=this.index;a<this.top.children.length;a++){let l=this.top.children[a];if(l instanceof Jt){let c=this.preMatch.matched.get(l);if(c!=null&&c!=o)return !1;let d=l.dom,u,f=this.isLocked(d)&&!(e.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==e.text&&l.dirty!=Xt&&_o(n,l.outerDeco));if(!f&&l.update(e,n,r,i))return this.destroyBetween(this.index,a),l.dom!=d&&(this.changed=!0),this.index++,!0;if(!f&&(u=this.recreateWrapper(l,e,n,r,i,s)))return this.destroyBetween(this.index,a),this.top.children[this.index]=u,u.contentDOM&&(u.dirty=ar,u.updateChildren(i,s+1),u.dirty=Lt),this.changed=!0,this.index++,!0;break}}return !1}recreateWrapper(e,n,r,i,o,s){if(e.dirty||n.isAtom||!e.children.length||!e.node.content.eq(n.content)||!_o(r,e.outerDeco)||!i.eq(e.innerDeco))return null;let a=Jt.create(this.top,n,r,i,o,s);if(a.contentDOM){a.children=e.children,e.children=[];for(let l of a.children)l.parent=a;}return e.destroy(),a}addNode(e,n,r,i,o){let s=Jt.create(this.top,e,n,r,i,o);s.contentDOM&&s.updateChildren(i,o+1),this.top.children.splice(this.index++,0,s),this.changed=!0;}placeWidget(e,n,r){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(i&&i.matchesWidget(e)&&(e==i.widget||!i.widget.type.toDOM.parentNode))this.index++;else {let o=new No(this.top,e,n,r);this.top.children.splice(this.index++,0,o),this.changed=!0;}}addTextblockHacks(){let e=this.top.children[this.index-1],n=this.top;for(;e instanceof wn;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof Vr)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((bt||ut)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top));}addHackNode(e,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(e))this.index++;else {let r=document.createElement(e);e=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),e=="BR"&&(r.className="ProseMirror-trailingBreak");let i=new To(this.top,[],r,null);n!=this.top?n.children.push(i):n.children.splice(this.index++,0,i),this.changed=!0;}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}};function ew(t,e){let n=e,r=n.children.length,i=t.childCount,o=new Map,s=[];e:for(;i>0;){let a;for(;;)if(r){let c=n.children[r-1];if(c instanceof wn)n=c,r=c.children.length;else {a=c,r--;break}}else {if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent;}let l=a.node;if(l){if(l!=t.child(i-1))break;--i,o.set(a,i),s.push(a);}}return {index:i,matched:o,matches:s.reverse()}}function tw(t,e){return t.type.side-e.type.side}function nw(t,e,n,r){let i=e.locals(t),o=0;if(i.length==0){for(let c=0;c<t.childCount;c++){let d=t.child(c);r(d,i,e.forChild(o,d),c),o+=d.nodeSize;}return}let s=0,a=[],l=null;for(let c=0;;){let d,u;for(;s<i.length&&i[s].to==o;){let g=i[s++];g.widget&&(d?(u||(u=[d])).push(g):d=g);}if(d)if(u){u.sort(tw);for(let g=0;g<u.length;g++)n(u[g],c,!!l);}else n(d,c,!!l);let f,p;if(l)p=-1,f=l,l=null;else if(c<t.childCount)p=c,f=t.child(c++);else break;for(let g=0;g<a.length;g++)a[g].to<=o&&a.splice(g--,1);for(;s<i.length&&i[s].from<=o&&i[s].to>o;)a.push(i[s++]);let h=o+f.nodeSize;if(f.isText){let g=h;s<i.length&&i[s].from<g&&(g=i[s].from);for(let b=0;b<a.length;b++)a[b].to<g&&(g=a[b].to);g<h&&(l=f.cut(g-o),f=f.cut(0,g-o),h=g,p=-1);}else for(;s<i.length&&i[s].to<h;)s++;let m=f.isInline&&!f.isLeaf?a.filter(g=>!g.inline):a.slice();r(f,m,e.forChild(o,f),p),o=h;}}function rw(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e;}}function iw(t,e,n,r){for(let i=0,o=0;i<t.childCount&&o<=r;){let s=t.child(i++),a=o;if(o+=s.nodeSize,!s.isText)continue;let l=s.text;for(;i<t.childCount;){let c=t.child(i++);if(o+=c.nodeSize,!c.isText)break;l+=c.text;}if(o>=n){if(o>=r&&l.slice(r-e.length-a,r-a)==e)return r-e.length;let c=a<r?l.lastIndexOf(e,r-a-1):-1;if(c>=0&&c+e.length+a>=n)return a+c;if(n==r&&l.length>=r+e.length-a&&l.slice(r-a,r-a+e.length)==e)return r}}return -1}function dl(t,e,n,r,i){let o=[];for(let s=0,a=0;s<t.length;s++){let l=t[s],c=a,d=a+=l.size;c>=n||d<=e?o.push(l):(c<e&&o.push(l.slice(0,e-c,r)),i&&(o.push(i),i=void 0),d>n&&o.push(l.slice(n-c,l.size,r)));}return o}function vl(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let i=t.docView.nearestDesc(n.focusNode),o=i&&i.size==0,s=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a=r.resolve(s),l,c;if(Do(n)){for(l=s;i&&!i.node;)i=i.parent;let u=i.node;if(i&&u.isAtom&&W.isSelectable(u)&&i.parent&&!(u.isInline&&Dv(n.focusNode,n.focusOffset,i.dom))){let f=i.posBefore;c=new W(s==f?a:r.resolve(f));}}else {if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let u=s,f=s;for(let p=0;p<n.rangeCount;p++){let h=n.getRangeAt(p);u=Math.min(u,t.docView.posFromDOM(h.startContainer,h.startOffset,1)),f=Math.max(f,t.docView.posFromDOM(h.endContainer,h.endOffset,-1));}if(u<0)return null;[l,s]=f==t.state.selection.anchor?[f,u]:[u,f],a=r.resolve(s);}else l=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(l<0)return null}let d=r.resolve(l);if(!c){let u=e=="pointer"||t.state.selection.head<a.pos&&!o?1:-1;c=wl(t,d,a,u);}return c}function Hf(t){return t.editable?t.hasFocus():Kf(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function vn(t,e=!1){let n=t.state.selection;if($f(t,n),!!Hf(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&ut){let r=t.domSelectionRange(),i=t.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&ur(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)sw(t);else {let{anchor:r,head:i}=n,o,s;af&&!(n instanceof H)&&(n.$from.parent.inlineContent||(o=lf(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(s=lf(t,n.to))),t.docView.setSelection(r,i,t,e),af&&(o&&cf(o),s&&cf(s)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&ow(t));}t.domObserver.setCurSelection(),t.domObserver.connectSelection();}}var af=bt||ut&&Of<63;function lf(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),i=r<n.childNodes.length?n.childNodes[r]:null,o=r?n.childNodes[r-1]:null;if(bt&&i&&i.contentEditable=="false")return Xa(i);if((!i||i.contentEditable=="false")&&(!o||o.contentEditable=="false")){if(i)return Xa(i);if(o)return Xa(o)}}function Xa(t){return t.contentEditable="true",bt&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function cf(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null);}function ow(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let n=t.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=i)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!Hf(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection");},20));});}function sw(t){let e=t.domSelection(),n=document.createRange();if(!e)return;let r=t.cursorWrapper.dom,i=r.nodeName=="IMG";i?n.setStart(r.parentNode,tt(r)+1):n.setStart(r,0),n.collapse(!0),e.removeAllRanges(),e.addRange(n),!i&&!t.state.selection.visible&&xt&&Bn<=11&&(r.disabled=!0,r.disabled=!1);}function $f(t,e){if(e instanceof W){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(df(t),n&&n.selectNode(),t.lastSelectedViewDesc=n);}else df(t);}function df(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0);}function wl(t,e,n,r){return t.someProp("createSelectionBetween",i=>i(t,e,n))||H.between(e,n,r)}function uf(t){return t.editable&&!t.hasFocus()?!1:Kf(t)}function Kf(t){let e=t.domSelectionRange();if(!e.anchorNode)return !1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return !1}}function aw(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return ur(e.node,e.offset,n.anchorNode,n.anchorOffset)}function ul(t,e){let{$anchor:n,$head:r}=t.selection,i=e>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?t.doc.resolve(e>0?i.after():i.before()):null:i;return o&&q.findFrom(o,e)}function Ln(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function ff(t,e,n){let r=t.state.selection;if(r instanceof H)if(n.indexOf("s")>-1){let{$head:i}=r,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText||!o.isLeaf)return !1;let s=t.state.doc.resolve(i.pos+o.nodeSize*(e<0?-1:1));return Ln(t,new H(r.$anchor,s))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let i=ul(t.state,e);return i&&i instanceof W?Ln(t,i):!1}else if(!(Dt&&n.indexOf("m")>-1)){let i=r.$head,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,s;if(!o||o.isText)return !1;let a=e<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(s=t.docView.descAt(a))&&!s.contentDOM?W.isSelectable(o)?Ln(t,new W(e<0?t.state.doc.resolve(i.pos-o.nodeSize):i)):Oi?Ln(t,new H(t.state.doc.resolve(e<0?a:a+o.nodeSize))):!1:!1}}else return !1;else {if(r instanceof W&&r.node.isInline)return Ln(t,new H(e>0?r.$to:r.$from));{let i=ul(t.state,e);return i?Ln(t,i):!1}}}function Mo(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Ci(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function Fr(t,e){return e<0?lw(t):cw(t)}function lw(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i,o,s=!1;for(Kt&&n.nodeType==1&&r<Mo(n)&&Ci(n.childNodes[r],-1)&&(s=!0);;)if(r>0){if(n.nodeType!=1)break;{let a=n.childNodes[r-1];if(Ci(a,-1))i=n,o=--r;else if(a.nodeType==3)n=a,r=n.nodeValue.length;else break}}else {if(Vf(n))break;{let a=n.previousSibling;for(;a&&Ci(a,-1);)i=n.parentNode,o=tt(a),a=a.previousSibling;if(a)n=a,r=Mo(n);else {if(n=n.parentNode,n==t.dom)break;r=0;}}}s?fl(t,n,r):i&&fl(t,i,o);}function cw(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i=Mo(n),o,s;for(;;)if(r<i){if(n.nodeType!=1)break;let a=n.childNodes[r];if(Ci(a,1))o=n,s=++r;else break}else {if(Vf(n))break;{let a=n.nextSibling;for(;a&&Ci(a,1);)o=a.parentNode,s=tt(a)+1,a=a.nextSibling;if(a)n=a,r=0,i=Mo(n);else {if(n=n.parentNode,n==t.dom)break;r=i=0;}}}o&&fl(t,o,s);}function Vf(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function dw(t,e){for(;t&&e==t.childNodes.length&&!Ai(t);)e=tt(t)+1,t=t.parentNode;for(;t&&e<t.childNodes.length;){let n=t.childNodes[e];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=0;}}function uw(t,e){for(;t&&!e&&!Ai(t);)e=tt(t),t=t.parentNode;for(;t&&e;){let n=t.childNodes[e-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=t.childNodes.length;}}function fl(t,e,n){if(e.nodeType!=3){let o,s;(s=dw(e,n))?(e=s,n=0):(o=uw(e,n))&&(e=o,n=o.nodeValue.length);}let r=t.domSelection();if(!r)return;if(Do(r)){let o=document.createRange();o.setEnd(e,n),o.setStart(e,n),r.removeAllRanges(),r.addRange(o);}else r.extend&&r.extend(e,n);t.domObserver.setCurSelection();let{state:i}=t;setTimeout(()=>{t.state==i&&vn(t);},50);}function pf(t,e){let n=t.state.doc.resolve(e);if(!(ut||Pv)&&n.parent.inlineContent){let i=t.coordsAtPos(e);if(e>n.start()){let o=t.coordsAtPos(e-1),s=(o.top+o.bottom)/2;if(s>i.top&&s<i.bottom&&Math.abs(o.left-i.left)>1)return o.left<i.left?"ltr":"rtl"}if(e<n.end()){let o=t.coordsAtPos(e+1),s=(o.top+o.bottom)/2;if(s>i.top&&s<i.bottom&&Math.abs(o.left-i.left)>1)return o.left>i.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function hf(t,e,n){let r=t.state.selection;if(r instanceof H&&!r.empty||n.indexOf("s")>-1||Dt&&n.indexOf("m")>-1)return !1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let s=ul(t.state,e);if(s&&s instanceof W)return Ln(t,s)}if(!i.parent.inlineContent){let s=e<0?i:o,a=r instanceof je?q.near(s,e):q.findFrom(s,e);return a?Ln(t,a):!1}return !1}function mf(t,e){if(!(t.state.selection instanceof H))return !0;let{$head:n,$anchor:r,empty:i}=t.state.selection;if(!n.sameParent(r))return !0;if(!i)return !1;if(t.endOfTextblock(e>0?"forward":"backward"))return !0;let o=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let s=t.state.tr;return e<0?s.delete(n.pos-o.nodeSize,n.pos):s.delete(n.pos,n.pos+o.nodeSize),t.dispatch(s),!0}return !1}function gf(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start();}function fw(t){if(!bt||t.state.selection.$head.parentOffset>0)return !1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&e.nodeType==1&&n==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;gf(t,r,"true"),setTimeout(()=>gf(t,r,"false"),20);}return !1}function pw(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function hw(t,e){let n=e.keyCode,r=pw(e);if(n==8||Dt&&n==72&&r=="c")return mf(t,-1)||Fr(t,-1);if(n==46&&!e.shiftKey||Dt&&n==68&&r=="c")return mf(t,1)||Fr(t,1);if(n==13||n==27)return !0;if(n==37||Dt&&n==66&&r=="c"){let i=n==37?pf(t,t.state.selection.from)=="ltr"?-1:1:-1;return ff(t,i,r)||Fr(t,i)}else if(n==39||Dt&&n==70&&r=="c"){let i=n==39?pf(t,t.state.selection.from)=="ltr"?1:-1:1;return ff(t,i,r)||Fr(t,i)}else {if(n==38||Dt&&n==80&&r=="c")return hf(t,-1,r)||Fr(t,-1);if(n==40||Dt&&n==78&&r=="c")return fw(t)||hf(t,1,r)||Fr(t,1);if(r==(Dt?"m":"c")&&(n==66||n==73||n==89||n==90))return !0}return !1}function xl(t,e){t.someProp("transformCopied",p=>{e=p(e,t);});let n=[],{content:r,openStart:i,openEnd:o}=e;for(;i>1&&o>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,o--;let p=r.firstChild;n.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),r=p.content;}let s=t.someProp("clipboardSerializer")||$t.fromSchema(t.state.schema),a=Yf(),l=a.createElement("div");l.appendChild(s.serializeFragment(r,{document:a}));let c=l.firstChild,d,u=0;for(;c&&c.nodeType==1&&(d=Jf[c.nodeName.toLowerCase()]);){for(let p=d.length-1;p>=0;p--){let h=a.createElement(d[p]);for(;l.firstChild;)h.appendChild(l.firstChild);l.appendChild(h),u++;}c=l.firstChild;}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${i} ${o}${u?` -${u}`:""} ${JSON.stringify(n)}`);let f=t.someProp("clipboardTextSerializer",p=>p(e,t))||e.content.textBetween(0,e.content.size,`
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
`))),0,0):B.empty;let u=t.someProp("clipboardTextParser",f=>f(e,i,r,t));if(u)a=u;else {let f=i.marks(),{schema:p}=t.state,h=$t.fromSchema(p);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(m=>{let g=s.appendChild(document.createElement("p"));m&&g.appendChild(h.serializeNode(p.text(m,f)));});}}else t.someProp("transformPastedHTML",u=>{n=u(n,t);}),s=yw(n),Oi&&Ew(s);let c=s&&s.querySelector("[data-pm-slice]"),d=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(d&&d[3])for(let u=+d[3];u>0;u--){let f=s.firstChild;for(;f&&f.nodeType!=1;)f=f.nextSibling;if(!f)break;s=f;}if(a||(a=(t.someProp("clipboardParser")||t.someProp("domParser")||_t.fromSchema(t.state.schema)).parseSlice(s,{preserveWhitespace:!!(l||d),context:i,ruleFromNode(f){return f.nodeName=="BR"&&!f.nextSibling&&f.parentNode&&!mw.test(f.parentNode.nodeName)?{ignore:!0}:null}})),d)a=vw(bf(a,+d[1],+d[2]),d[4]);else if(a=B.maxOpen(gw(a.content,i),!0),a.openStart||a.openEnd){let u=0,f=0;for(let p=a.content.firstChild;u<a.openStart&&!p.type.spec.isolating;u++,p=p.firstChild);for(let p=a.content.lastChild;f<a.openEnd&&!p.type.spec.isolating;f++,p=p.lastChild);a=bf(a,u,f);}return t.someProp("transformPasted",u=>{a=u(a,t);}),a}var mw=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function gw(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let i=e.node(n).contentMatchAt(e.index(n)),o,s=[];if(t.forEach(a=>{if(!s)return;let l=i.findWrapping(a.type),c;if(!l)return s=null;if(c=s.length&&o.length&&qf(l,o,a,s[s.length-1],0))s[s.length-1]=c;else {s.length&&(s[s.length-1]=jf(s[s.length-1],o.length));let d=Gf(a,l);s.push(d),i=i.matchType(d.type),o=l;}}),s)return N.from(s)}return t}function Gf(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,N.from(t));return t}function qf(t,e,n,r,i){if(i<t.length&&i<e.length&&t[i]==e[i]){let o=qf(t,e,n,r.lastChild,i+1);if(o)return r.copy(r.content.replaceChild(r.childCount-1,o));if(r.contentMatchAt(r.childCount).matchType(i==t.length-1?n.type:t[i+1]))return r.copy(r.content.append(N.from(Gf(n,t,i+1))))}}function jf(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,jf(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(N.empty,!0);return t.copy(n.append(r))}function pl(t,e,n,r,i,o){let s=e<0?t.firstChild:t.lastChild,a=s.content;return t.childCount>1&&(o=0),i<r-1&&(a=pl(a,e,n,r,i+1,o)),i>=n&&(a=e<0?s.contentMatchAt(0).fillBefore(a,o<=i).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(N.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(a))}function bf(t,e,n){return e<t.openStart&&(t=new B(pl(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new B(pl(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}var Jf={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]},yf=null;function Yf(){return yf||(yf=document.implementation.createHTMLDocument("title"))}var Qa=null;function bw(t){let e=window.trustedTypes;return e?(Qa||(Qa=e.defaultPolicy||e.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),Qa.createHTML(t)):t}function yw(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=Yf().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),i;if((i=r&&Jf[r[1].toLowerCase()])&&(t=i.map(o=>"<"+o+">").join("")+t+i.map(o=>"</"+o+">").reverse().join("")),n.innerHTML=bw(t),i)for(let o=0;o<i.length;o++)n=n.querySelector(i[o])||n;return n}function Ew(t){let e=t.querySelectorAll(ut?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<e.length;n++){let r=e[n];r.childNodes.length==1&&r.textContent=="\xA0"&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),r);}}function vw(t,e){if(!t.size)return t;let n=t.content.firstChild.type.schema,r;try{r=JSON.parse(e);}catch{return t}let{content:i,openStart:o,openEnd:s}=t;for(let a=r.length-2;a>=0;a-=2){let l=n.nodes[r[a]];if(!l||l.hasRequiredAttrs())break;i=N.from(l.create(r[a+1],i)),o++,s++;}return new B(i,o,s)}var yt={},Et={},ww={touchstart:!0,touchmove:!0},hl=class{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null;}};function xw(t){for(let e in yt){let n=yt[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{Cw(t,r)&&!Sl(t,r)&&(t.editable||!(r.type in Et))&&n(t,r);},ww[e]?{passive:!0}:void 0);}bt&&t.dom.addEventListener("input",()=>null),ml(t);}function Pn(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now();}function Sw(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout);}function ml(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>Sl(t,r));});}function Sl(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function Cw(t,e){if(!e.bubbles)return !0;if(e.defaultPrevented)return !1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return !1;return !0}function kw(t,e){!Sl(t,e)&&yt[e.type]&&(t.editable||!(e.type in Et))&&yt[e.type](t,e);}Et.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!Xf(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(En&&ut&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),Kr&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",i=>i(t,sr(13,"Enter"))),t.input.lastIOSEnter=0);},200);}else t.someProp("handleKeyDown",r=>r(t,n))||hw(t,n)?n.preventDefault():Pn(t,"key");};Et.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1);};Et.keypress=(t,e)=>{let n=e;if(Xf(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||Dt&&n.metaKey)return;if(t.someProp("handleKeyPress",i=>i(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof H)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode),o=()=>t.state.tr.insertText(i).scrollIntoView();!/[\r\n]/.test(i)&&!t.someProp("handleTextInput",s=>s(t,r.$from.pos,r.$to.pos,i,o))&&t.dispatch(o()),n.preventDefault();}};function Io(t){return {left:t.clientX,top:t.clientY}}function Nw(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function Cl(t,e,n,r,i){if(r==-1)return !1;let o=t.state.doc.resolve(r);for(let s=o.depth+1;s>0;s--)if(t.someProp(e,a=>s>o.depth?a(t,n,o.nodeAfter,o.before(s),i,!0):a(t,n,o.node(s),o.before(s),i,!1)))return !0;return !1}function Hr(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let r=t.state.tr.setSelection(e);n=="pointer"&&r.setMeta("pointer",!0),t.dispatch(r);}function Tw(t,e){if(e==-1)return !1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&W.isSelectable(r)?(Hr(t,new W(n),"pointer"),!0):!1}function _w(t,e){if(e==-1)return !1;let n=t.state.selection,r,i;n instanceof W&&(r=n.node);let o=t.state.doc.resolve(e);for(let s=o.depth+1;s>0;s--){let a=s>o.depth?o.nodeAfter:o.node(s);if(W.isSelectable(a)){r&&n.$from.depth>0&&s>=n.$from.depth&&o.before(n.$from.depth+1)==n.$from.pos?i=o.before(n.$from.depth):i=o.before(s);break}}return i!=null?(Hr(t,W.create(t.state.doc,i),"pointer"),!0):!1}function Mw(t,e,n,r,i){return Cl(t,"handleClickOn",e,n,r)||t.someProp("handleClick",o=>o(t,e,r))||(i?_w(t,n):Tw(t,n))}function Aw(t,e,n,r){return Cl(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",i=>i(t,e,r))}function Ow(t,e,n,r){return Cl(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",i=>i(t,e,r))||Rw(t,n,r)}function Rw(t,e,n){if(n.button!=0)return !1;let r=t.state.doc;if(e==-1)return r.inlineContent?(Hr(t,H.create(r,0,r.content.size),"pointer"),!0):!1;let i=r.resolve(e);for(let o=i.depth+1;o>0;o--){let s=o>i.depth?i.nodeAfter:i.node(o),a=i.before(o);if(s.inlineContent)Hr(t,H.create(r,a+1,a+1+s.content.size),"pointer");else if(W.isSelectable(s))Hr(t,W.create(r,a),"pointer");else continue;return !0}}function kl(t){return Ao(t)}var Zf=Dt?"metaKey":"ctrlKey";yt.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=kl(t),i=Date.now(),o="singleClick";i-t.input.lastClick.time<500&&Nw(n,t.input.lastClick)&&!n[Zf]&&t.input.lastClick.button==n.button&&(t.input.lastClick.type=="singleClick"?o="doubleClick":t.input.lastClick.type=="doubleClick"&&(o="tripleClick")),t.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o,button:n.button};let s=t.posAtCoords(Io(n));s&&(o=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new gl(t,s,n,!!r)):(o=="doubleClick"?Aw:Ow)(t,s.pos,s.inside,n)?n.preventDefault():Pn(t,"pointer"));};var gl=class{constructor(e,n,r,i){this.view=e,this.pos=n,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[Zf],this.allowDefault=r.shiftKey;let o,s;if(n.inside>-1)o=e.state.doc.nodeAt(n.inside),s=n.inside;else {let d=e.state.doc.resolve(n.pos);o=d.parent,s=d.depth?d.before():0;}let a=i?null:r.target,l=a?e.docView.nearestDesc(a,!0):null;this.target=l&&l.dom.nodeType==1?l.dom:null;let{selection:c}=e.state;(r.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||c instanceof W&&c.from<=s&&c.to>s)&&(this.mightDrag={node:o,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Kt&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false");},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),Pn(e,"pointer");}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>vn(this.view)),this.view.input.mouseDown=null;}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(Io(e))),this.updateAllowDefault(e),this.allowDefault||!n?Pn(this.view,"pointer"):Mw(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||bt&&this.mightDrag&&!this.mightDrag.node.isAtom||ut&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(Hr(this.view,q.near(this.view.state.doc.resolve(n.pos)),"pointer"),e.preventDefault()):Pn(this.view,"pointer");}move(e){this.updateAllowDefault(e),Pn(this.view,"pointer"),e.buttons==0&&this.done();}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0);}};yt.touchstart=t=>{t.input.lastTouch=Date.now(),kl(t),Pn(t,"pointer");};yt.touchmove=t=>{t.input.lastTouch=Date.now(),Pn(t,"pointer");};yt.contextmenu=t=>kl(t);function Xf(t,e){return t.composing?!0:bt&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}var Dw=En?5e3:-1;Et.compositionstart=Et.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof H&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),Ao(t,!0),t.markCursor=null;else if(Ao(t,!e.selection.empty),Kt&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let i=r.focusNode,o=r.focusOffset;i&&i.nodeType==1&&o!=0;){let s=o<0?i.lastChild:i.childNodes[o-1];if(!s)break;if(s.nodeType==3){let a=t.domSelection();a&&a.collapse(s,s.nodeValue.length);break}else i=s,o=-1;}}t.input.composing=!0;}Qf(t,Dw);};Et.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,Qf(t,20));};function Qf(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>Ao(t),e));}function ep(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=Lw());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty();}function Iw(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=Ov(e.focusNode,e.focusOffset),r=Rv(e.focusNode,e.focusOffset);if(n&&r&&n!=r){let i=r.pmViewDesc,o=t.domObserver.lastChangedTextNode;if(n==o||r==o)return o;if(!i||!i.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let s=n.pmViewDesc;if(!(!s||!s.isText(n.nodeValue)))return r}}return n||r}function Lw(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function Ao(t,e=!1){if(!(En&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),ep(t),e||t.docView&&t.docView.dirty){let n=vl(t),r=t.state.selection;return n&&!n.eq(r)?t.dispatch(t.state.tr.setSelection(n)):(t.markCursor||e)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return !1}}function Pw(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus();},50);}var ki=xt&&Bn<15||Kr&&Bv<604;yt.copy=Et.cut=(t,e)=>{let n=e,r=t.state.selection,i=n.type=="cut";if(r.empty)return;let o=ki?null:n.clipboardData,s=r.content(),{dom:a,text:l}=xl(t,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",a.innerHTML),o.setData("text/plain",l)):Pw(t,a),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"));};function Bw(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function zw(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Ni(t,r.value,null,i,e):Ni(t,r.textContent,r.innerHTML,i,e);},50);}function Ni(t,e,n,r,i){let o=Wf(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",l=>l(t,i,o||B.empty)))return !0;if(!o)return !1;let s=Bw(o),a=s?t.state.tr.replaceSelectionWith(s,r):t.state.tr.replaceSelection(o);return t.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function tp(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}Et.paste=(t,e)=>{let n=e;if(t.composing&&!En)return;let r=ki?null:n.clipboardData,i=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&Ni(t,tp(r),r.getData("text/html"),i,n)?n.preventDefault():zw(t,n);};var Oo=class{constructor(e,n,r){this.slice=e,this.move=n,this.node=r;}},Fw=Dt?"altKey":"ctrlKey";function np(t,e){let n=t.someProp("dragCopies",r=>!r(e));return n??!e[Fw]}yt.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=t.state.selection,o=i.empty?null:t.posAtCoords(Io(n)),s;if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof W?i.to-1:i.to))){if(r&&r.mightDrag)s=W.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let u=t.docView.nearestDesc(n.target,!0);u&&u.node.type.spec.draggable&&u!=t.docView&&(s=W.create(t.state.doc,u.posBefore));}}let a=(s||t.state.selection).content(),{dom:l,text:c,slice:d}=xl(t,a);(!n.dataTransfer.files.length||!ut||Of>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(ki?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",ki||n.dataTransfer.setData("text/plain",c),t.dragging=new Oo(d,np(t,n),s);};yt.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null);},50);};Et.dragover=Et.dragenter=(t,e)=>e.preventDefault();Et.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let i=t.posAtCoords(Io(n));if(!i)return;let o=t.state.doc.resolve(i.pos),s=r&&r.slice;s?t.someProp("transformPasted",h=>{s=h(s,t);}):s=Wf(t,tp(n.dataTransfer),ki?null:n.dataTransfer.getData("text/html"),!1,o);let a=!!(r&&np(t,n));if(t.someProp("handleDrop",h=>h(t,n,s||B.empty,a))){n.preventDefault();return}if(!s)return;n.preventDefault();let l=s?Co(t.state.doc,o.pos,s):o.pos;l==null&&(l=o.pos);let c=t.state.tr;if(a){let{node:h}=r;h?h.replace(c):c.deleteSelection();}let d=c.mapping.map(l),u=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,f=c.doc;if(u?c.replaceRangeWith(d,d,s.content.firstChild):c.replaceRange(d,d,s),c.doc.eq(f))return;let p=c.doc.resolve(d);if(u&&W.isSelectable(s.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new W(p));else {let h=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach((m,g,b,v)=>h=v),c.setSelection(wl(t,p,c.doc.resolve(h)));}t.focus(),t.dispatch(c.setMeta("uiEvent","drop"));};yt.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&vn(t);},20));};yt.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1);};yt.beforeinput=(t,e)=>{if(ut&&En&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",o=>o(t,sr(8,"Backspace")))))return;let{$cursor:i}=t.state.selection;i&&i.pos>0&&t.dispatch(t.state.tr.delete(i.pos-1,i.pos).scrollIntoView());},50);}};for(let t in Et)yt[t]=Et[t];function Ti(t,e){if(t==e)return !0;for(let n in t)if(t[n]!==e[n])return !1;for(let n in e)if(!(n in t))return !1;return !0}var Wr=class{constructor(e,n){this.toDOM=e,this.spec=n||cr,this.side=this.spec.side||0;}map(e,n,r,i){let{pos:o,deleted:s}=e.mapResult(n.from+i,this.side<0?-1:1);return s?null:new Ce(o-r,o-r,this)}valid(){return !0}eq(e){return this==e||e instanceof Wr&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Ti(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e);}},Yt=class{constructor(e,n){this.attrs=e,this.spec=n||cr;}map(e,n,r,i){let o=e.map(n.from+i,this.spec.inclusiveStart?-1:1)-r,s=e.map(n.to+i,this.spec.inclusiveEnd?1:-1)-r;return o>=s?null:new Ce(o,s,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof Yt&&Ti(this.attrs,e.attrs)&&Ti(this.spec,e.spec)}static is(e){return e.type instanceof Yt}destroy(){}},_i=class{constructor(e,n){this.attrs=e,this.spec=n||cr;}map(e,n,r,i){let o=e.mapResult(n.from+i,1);if(o.deleted)return null;let s=e.mapResult(n.to+i,-1);return s.deleted||s.pos<=o.pos?null:new Ce(o.pos-r,s.pos-r,this)}valid(e,n){let{index:r,offset:i}=e.content.findIndex(n.from),o;return i==n.from&&!(o=e.child(r)).isText&&i+o.nodeSize==n.to}eq(e){return this==e||e instanceof _i&&Ti(this.attrs,e.attrs)&&Ti(this.spec,e.spec)}destroy(){}},Ce=class{constructor(e,n,r){this.from=e,this.to=n,this.type=r;}copy(e,n){return new Ce(e,n,this.type)}eq(e,n=0){return this.type.eq(e.type)&&this.from+n==e.from&&this.to+n==e.to}map(e,n,r){return this.type.map(e,this,n,r)}static widget(e,n,r){return new Ce(e,e,new Wr(n,r))}static inline(e,n,r,i){return new Ce(e,n,new Yt(r,i))}static node(e,n,r,i){return new Ce(e,n,new _i(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof Yt}get widget(){return this.type instanceof Wr}},Ur=[],cr={},me=class{constructor(e,n){this.local=e.length?e:Ur,this.children=n.length?n:Ur;}static create(e,n){return n.length?Ro(n,e,0,cr):dt}find(e,n,r){let i=[];return this.findInner(e??0,n??1e9,i,0,r),i}findInner(e,n,r,i,o){for(let s=0;s<this.local.length;s++){let a=this.local[s];a.from<=n&&a.to>=e&&(!o||o(a.spec))&&r.push(a.copy(a.from+i,a.to+i));}for(let s=0;s<this.children.length;s+=3)if(this.children[s]<n&&this.children[s+1]>e){let a=this.children[s]+1;this.children[s+2].findInner(e-a,n-a,r,i+a,o);}}map(e,n,r){return this==dt||e.maps.length==0?this:this.mapInner(e,n,0,0,r||cr)}mapInner(e,n,r,i,o){let s;for(let a=0;a<this.local.length;a++){let l=this.local[a].map(e,r,i);l&&l.type.valid(n,l)?(s||(s=[])).push(l):o.onRemove&&o.onRemove(this.local[a].spec);}return this.children.length?Uw(this.children,s||[],e,n,r,i,o):s?new me(s.sort(dr),Ur):dt}add(e,n){return n.length?this==dt?me.create(e,n):this.addInner(e,n,0):this}addInner(e,n,r){let i,o=0;e.forEach((a,l)=>{let c=l+r,d;if(d=ip(n,a,c)){for(i||(i=this.children.slice());o<i.length&&i[o]<l;)o+=3;i[o]==l?i[o+2]=i[o+2].addInner(a,d,c+1):i.splice(o,0,l,l+a.nodeSize,Ro(d,a,c+1,cr)),o+=3;}});let s=rp(o?op(n):n,-r);for(let a=0;a<s.length;a++)s[a].type.valid(e,s[a])||s.splice(a--,1);return new me(s.length?this.local.concat(s).sort(dr):this.local,i||this.children)}remove(e){return e.length==0||this==dt?this:this.removeInner(e,0)}removeInner(e,n){let r=this.children,i=this.local;for(let o=0;o<r.length;o+=3){let s,a=r[o]+n,l=r[o+1]+n;for(let d=0,u;d<e.length;d++)(u=e[d])&&u.from>a&&u.to<l&&(e[d]=null,(s||(s=[])).push(u));if(!s)continue;r==this.children&&(r=this.children.slice());let c=r[o+2].removeInner(s,a+1);c!=dt?r[o+2]=c:(r.splice(o,3),o-=3);}if(i.length){for(let o=0,s;o<e.length;o++)if(s=e[o])for(let a=0;a<i.length;a++)i[a].eq(s,n)&&(i==this.local&&(i=this.local.slice()),i.splice(a--,1));}return r==this.children&&i==this.local?this:i.length||r.length?new me(i,r):dt}forChild(e,n){if(this==dt)return this;if(n.isLeaf)return me.empty;let r,i;for(let a=0;a<this.children.length;a+=3)if(this.children[a]>=e){this.children[a]==e&&(r=this.children[a+2]);break}let o=e+1,s=o+n.content.size;for(let a=0;a<this.local.length;a++){let l=this.local[a];if(l.from<s&&l.to>o&&l.type instanceof Yt){let c=Math.max(o,l.from)-o,d=Math.min(s,l.to)-o;c<d&&(i||(i=[])).push(l.copy(c,d));}}if(i){let a=new me(i.sort(dr),Ur);return r?new jt([a,r]):a}return r||dt}eq(e){if(this==e)return !0;if(!(e instanceof me)||this.local.length!=e.local.length||this.children.length!=e.children.length)return !1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(e.local[n]))return !1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=e.children[n]||this.children[n+1]!=e.children[n+1]||!this.children[n+2].eq(e.children[n+2]))return !1;return !0}locals(e){return Nl(this.localsInner(e))}localsInner(e){if(this==dt)return Ur;if(e.inlineContent||!this.local.some(Yt.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof Yt||n.push(this.local[r]);return n}forEachSet(e){e(this);}};me.empty=new me([],[]);me.removeOverlap=Nl;var dt=me.empty,jt=class{constructor(e){this.members=e;}map(e,n){let r=this.members.map(i=>i.map(e,n,cr));return jt.from(r)}forChild(e,n){if(n.isLeaf)return me.empty;let r=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(e,n);o!=dt&&(o instanceof jt?r=r.concat(o.members):r.push(o));}return jt.from(r)}eq(e){if(!(e instanceof jt)||e.members.length!=this.members.length)return !1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(e.members[n]))return !1;return !0}locals(e){let n,r=!0;for(let i=0;i<this.members.length;i++){let o=this.members[i].localsInner(e);if(o.length)if(!n)n=o;else {r&&(n=n.slice(),r=!1);for(let s=0;s<o.length;s++)n.push(o[s]);}}return n?Nl(r?n:n.sort(dr)):Ur}static from(e){switch(e.length){case 0:return dt;case 1:return e[0];default:return new jt(e.every(n=>n instanceof me)?e:e.reduce((n,r)=>n.concat(r instanceof me?r:r.members),[]))}}forEachSet(e){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(e);}};function Uw(t,e,n,r,i,o,s){let a=t.slice();for(let c=0,d=o;c<n.maps.length;c++){let u=0;n.maps[c].forEach((f,p,h,m)=>{let g=m-h-(p-f);for(let b=0;b<a.length;b+=3){let v=a[b+1];if(v<0||f>v+d-u)continue;let S=a[b]+d-u;p>=S?a[b+1]=f<=S?-2:-1:f>=d&&g&&(a[b]+=g,a[b+1]+=g);}u+=g;}),d=n.maps[c].map(d,-1);}let l=!1;for(let c=0;c<a.length;c+=3)if(a[c+1]<0){if(a[c+1]==-2){l=!0,a[c+1]=-1;continue}let d=n.map(t[c]+o),u=d-i;if(u<0||u>=r.content.size){l=!0;continue}let f=n.map(t[c+1]+o,-1),p=f-i,{index:h,offset:m}=r.content.findIndex(u),g=r.maybeChild(h);if(g&&m==u&&m+g.nodeSize==p){let b=a[c+2].mapInner(n,g,d+1,t[c]+o+1,s);b!=dt?(a[c]=u,a[c+1]=p,a[c+2]=b):(a[c+1]=-2,l=!0);}else l=!0;}if(l){let c=Hw(a,t,e,n,i,o,s),d=Ro(c,r,0,s);e=d.local;for(let u=0;u<a.length;u+=3)a[u+1]<0&&(a.splice(u,3),u-=3);for(let u=0,f=0;u<d.children.length;u+=3){let p=d.children[u];for(;f<a.length&&a[f]<p;)f+=3;a.splice(f,0,d.children[u],d.children[u+1],d.children[u+2]);}}return new me(e.sort(dr),a)}function rp(t,e){if(!e||!t.length)return t;let n=[];for(let r=0;r<t.length;r++){let i=t[r];n.push(new Ce(i.from+e,i.to+e,i.type));}return n}function Hw(t,e,n,r,i,o,s){function a(l,c){for(let d=0;d<l.local.length;d++){let u=l.local[d].map(r,i,c);u?n.push(u):s.onRemove&&s.onRemove(l.local[d].spec);}for(let d=0;d<l.children.length;d+=3)a(l.children[d+2],l.children[d]+c+1);}for(let l=0;l<t.length;l+=3)t[l+1]==-1&&a(t[l+2],e[l]+o+1);return n}function ip(t,e,n){if(e.isLeaf)return null;let r=n+e.nodeSize,i=null;for(let o=0,s;o<t.length;o++)(s=t[o])&&s.from>n&&s.to<r&&((i||(i=[])).push(s),t[o]=null);return i}function op(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function Ro(t,e,n,r){let i=[],o=!1;e.forEach((a,l)=>{let c=ip(t,a,l+n);if(c){o=!0;let d=Ro(c,a,n+l+1,r);d!=dt&&i.push(l,l+a.nodeSize,d);}});let s=rp(o?op(t):t,-n).sort(dr);for(let a=0;a<s.length;a++)s[a].type.valid(e,s[a])||(r.onRemove&&r.onRemove(s[a].spec),s.splice(a--,1));return s.length||i.length?new me(s,i):dt}function dr(t,e){return t.from-e.from||t.to-e.to}function Nl(t){let e=t;for(let n=0;n<e.length-1;n++){let r=e[n];if(r.from!=r.to)for(let i=n+1;i<e.length;i++){let o=e[i];if(o.from==r.from){o.to!=r.to&&(e==t&&(e=t.slice()),e[i]=o.copy(o.from,r.to),Ef(e,i+1,o.copy(r.to,o.to)));continue}else {o.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,o.from),Ef(e,i,r.copy(o.from,r.to)));break}}}return e}function Ef(t,e,n){for(;e<t.length&&dr(n,t[e])>0;)e++;t.splice(e,0,n);}function el(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=dt&&e.push(r);}),t.cursorWrapper&&e.push(me.create(t.state.doc,[t.cursorWrapper.deco])),jt.from(e)}var $w={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Kw=xt&&Bn<=11,bl=class{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0;}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset;}clear(){this.anchorNode=this.focusNode=null;}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}},yl=class{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new bl,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;i<r.length;i++)this.queue.push(r[i]);xt&&Bn<=11&&r.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush();}),Kw&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon();}),this.onSelectionChange=this.onSelectionChange.bind(this);}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush();},20));}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush());}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,$w)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection();}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let n=0;n<e.length;n++)this.queue.push(e[n]);window.setTimeout(()=>this.flush(),20);}this.observer.disconnect();}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection();}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange);}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange);}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50);}onSelectionChange(){if(uf(this.view)){if(this.suppressingSelectionUpdates)return vn(this.view);if(xt&&Bn<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&ur(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush();}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange());}ignoreSelectionChange(e){if(!e.focusNode)return !0;let n=new Set,r;for(let o=e.focusNode;o;o=$r(o))n.add(o);for(let o=e.anchorNode;o;o=$r(o))if(n.has(o)){r=o;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&uf(e)&&!this.ignoreSelectionChange(r),o=-1,s=-1,a=!1,l=[];if(e.editable)for(let d=0;d<n.length;d++){let u=this.registerMutation(n[d],l);u&&(o=o<0?u.from:Math.min(u.from,o),s=s<0?u.to:Math.max(u.to,s),u.typeOver&&(a=!0));}if(Kt&&l.length){let d=l.filter(u=>u.nodeName=="BR");if(d.length==2){let[u,f]=d;u.parentNode&&u.parentNode.parentNode==f.parentNode?f.remove():u.remove();}else {let{focusNode:u}=this.currentSelection;for(let f of d){let p=f.parentNode;p&&p.nodeName=="LI"&&(!u||Gw(e,u)!=p)&&f.remove();}}}let c=null;o<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&Do(r)&&(c=vl(e))&&c.eq(q.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,vn(e),this.currentSelection.set(r),e.scrollToSelection()):(o>-1||i)&&(o>-1&&(e.docView.markDirty(o,s),Vw(e)),this.handleDOMChange(o,s,a,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||vn(e),this.currentSelection.set(r));}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let d=0;d<e.addedNodes.length;d++){let u=e.addedNodes[d];n.push(u),u.nodeType==3&&(this.lastChangedTextNode=u);}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return {from:r.posBefore,to:r.posAfter};let i=e.previousSibling,o=e.nextSibling;if(xt&&Bn<=11&&e.addedNodes.length)for(let d=0;d<e.addedNodes.length;d++){let{previousSibling:u,nextSibling:f}=e.addedNodes[d];(!u||Array.prototype.indexOf.call(e.addedNodes,u)<0)&&(i=u),(!f||Array.prototype.indexOf.call(e.addedNodes,f)<0)&&(o=f);}let s=i&&i.parentNode==e.target?tt(i)+1:0,a=r.localPosFromDOM(e.target,s,-1),l=o&&o.parentNode==e.target?tt(o):e.target.childNodes.length,c=r.localPosFromDOM(e.target,l,1);return {from:a,to:c}}else return e.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:(this.lastChangedTextNode=e.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}},vf=new WeakMap,wf=!1;function Vw(t){if(!vf.has(t)&&(vf.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=Kt,wf)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),wf=!0;}}function xf(t,e){let n=e.startContainer,r=e.startOffset,i=e.endContainer,o=e.endOffset,s=t.domAtPos(t.state.selection.anchor);return ur(s.node,s.offset,i,o)&&([n,r,i,o]=[i,o,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}}function Ww(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return xf(t,i)}let n;function r(i){i.preventDefault(),i.stopImmediatePropagation(),n=i.getTargetRanges()[0];}return t.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",r,!0),n?xf(t,n):null}function Gw(t,e){for(let n=e.parentNode;n&&n!=t.dom;n=n.parentNode){let r=t.docView.nearestDesc(n,!0);if(r&&r.node.isBlock)return n}return null}function qw(t,e,n){let{node:r,fromOffset:i,toOffset:o,from:s,to:a}=t.docView.parseRange(e,n),l=t.domSelectionRange(),c,d=l.anchorNode;if(d&&t.dom.contains(d.nodeType==1?d:d.parentNode)&&(c=[{node:d,offset:l.anchorOffset}],Do(l)||c.push({node:l.focusNode,offset:l.focusOffset})),ut&&t.input.lastKeyCode===8)for(let g=o;g>i;g--){let b=r.childNodes[g-1],v=b.pmViewDesc;if(b.nodeName=="BR"&&!v){o=g;break}if(!v||v.size)break}let u=t.state.doc,f=t.someProp("domParser")||_t.fromSchema(t.state.schema),p=u.resolve(s),h=null,m=f.parse(r,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:i,to:o,preserveWhitespace:p.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:jw,context:p});if(c&&c[0].pos!=null){let g=c[0].pos,b=c[1]&&c[1].pos;b==null&&(b=g),h={anchor:g+s,head:b+s};}return {doc:m,sel:h,from:s,to:a}}function jw(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(bt&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(t.parentNode.lastChild==t||bt&&/^(tr|table)$/i.test(t.parentNode.nodeName))return {ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return {ignore:!0};return null}var Jw=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function Yw(t,e,n,r,i){let o=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let y=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,w=vl(t,y);if(w&&!t.state.selection.eq(w)){if(ut&&En&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",X=>X(t,sr(13,"Enter"))))return;let O=t.state.tr.setSelection(w);y=="pointer"?O.setMeta("pointer",!0):y=="key"&&O.scrollIntoView(),o&&O.setMeta("composition",o),t.dispatch(O);}return}let s=t.state.doc.resolve(e),a=s.sharedDepth(n);e=s.before(a+1),n=t.state.doc.resolve(n).after(a+1);let l=t.state.selection,c=qw(t,e,n),d=t.state.doc,u=d.slice(c.from,c.to),f,p;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(f=t.state.selection.to,p="end"):(f=t.state.selection.from,p="start"),t.input.lastKeyCode=null;let h=Qw(u.content,c.doc.content,c.from,f,p);if(h&&t.input.domChangeCount++,(Kr&&t.input.lastIOSEnter>Date.now()-225||En)&&i.some(y=>y.nodeType==1&&!Jw.test(y.nodeName))&&(!h||h.endA>=h.endB)&&t.someProp("handleKeyDown",y=>y(t,sr(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!h)if(r&&l instanceof H&&!l.empty&&l.$head.sameParent(l.$anchor)&&!t.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))h={start:l.from,endA:l.to,endB:l.to};else {if(c.sel){let y=Sf(t,t.state.doc,c.sel);if(y&&!y.eq(t.state.selection)){let w=t.state.tr.setSelection(y);o&&w.setMeta("composition",o),t.dispatch(w);}}return}t.state.selection.from<t.state.selection.to&&h.start==h.endB&&t.state.selection instanceof H&&(h.start>t.state.selection.from&&h.start<=t.state.selection.from+2&&t.state.selection.from>=c.from?h.start=t.state.selection.from:h.endA<t.state.selection.to&&h.endA>=t.state.selection.to-2&&t.state.selection.to<=c.to&&(h.endB+=t.state.selection.to-h.endA,h.endA=t.state.selection.to)),xt&&Bn<=11&&h.endB==h.start+1&&h.endA==h.start&&h.start>c.from&&c.doc.textBetween(h.start-c.from-1,h.start-c.from+1)==" \xA0"&&(h.start--,h.endA--,h.endB--);let m=c.doc.resolveNoCache(h.start-c.from),g=c.doc.resolveNoCache(h.endB-c.from),b=d.resolve(h.start),v=m.sameParent(g)&&m.parent.inlineContent&&b.end()>=h.endA,S;if((Kr&&t.input.lastIOSEnter>Date.now()-225&&(!v||i.some(y=>y.nodeName=="DIV"||y.nodeName=="P"))||!v&&m.pos<c.doc.content.size&&(!m.sameParent(g)||!m.parent.inlineContent)&&!/\S/.test(c.doc.textBetween(m.pos,g.pos,"",""))&&(S=q.findFrom(c.doc.resolve(m.pos+1),1,!0))&&S.head>m.pos)&&t.someProp("handleKeyDown",y=>y(t,sr(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>h.start&&Xw(d,h.start,h.endA,m,g)&&t.someProp("handleKeyDown",y=>y(t,sr(8,"Backspace")))){En&&ut&&t.domObserver.suppressSelectionUpdates();return}ut&&h.endB==h.start&&(t.input.lastChromeDelete=Date.now()),En&&!v&&m.start()!=g.start()&&g.parentOffset==0&&m.depth==g.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==h.endA&&(h.endB-=2,g=c.doc.resolveNoCache(h.endB-c.from),setTimeout(()=>{t.someProp("handleKeyDown",function(y){return y(t,sr(13,"Enter"))});},20));let T=h.start,_=h.endA,I=y=>{let w=y||t.state.tr.replace(T,_,c.doc.slice(h.start-c.from,h.endB-c.from));if(c.sel){let O=Sf(t,w.doc,c.sel);O&&!(ut&&t.composing&&O.empty&&(h.start!=h.endB||t.input.lastChromeDelete<Date.now()-100)&&(O.head==T||O.head==w.mapping.map(_)-1)||xt&&O.empty&&O.head==T)&&w.setSelection(O);}return o&&w.setMeta("composition",o),w.scrollIntoView()},k;if(v){if(m.pos==g.pos){xt&&Bn<=11&&m.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>vn(t),20));let y=I(t.state.tr.delete(T,_)),w=d.resolve(h.start).marksAcross(d.resolve(h.endA));w&&y.ensureMarks(w),t.dispatch(y);}else if(h.endA==h.endB&&(k=Zw(m.parent.content.cut(m.parentOffset,g.parentOffset),b.parent.content.cut(b.parentOffset,h.endA-b.start())))){let y=I(t.state.tr);k.type=="add"?y.addMark(T,_,k.mark):y.removeMark(T,_,k.mark),t.dispatch(y);}else if(m.parent.child(m.index()).isText&&m.index()==g.index()-(g.textOffset?0:1)){let y=m.parent.textBetween(m.parentOffset,g.parentOffset),w=()=>I(t.state.tr.insertText(y,T,_));t.someProp("handleTextInput",O=>O(t,T,_,y,w))||t.dispatch(w());}}else t.dispatch(I());}function Sf(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:wl(t,e.resolve(n.anchor),e.resolve(n.head))}function Zw(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,i=n,o=r,s,a,l;for(let d=0;d<r.length;d++)i=r[d].removeFromSet(i);for(let d=0;d<n.length;d++)o=n[d].removeFromSet(o);if(i.length==1&&o.length==0)a=i[0],s="add",l=d=>d.mark(a.addToSet(d.marks));else if(i.length==0&&o.length==1)a=o[0],s="remove",l=d=>d.mark(a.removeFromSet(d.marks));else return null;let c=[];for(let d=0;d<e.childCount;d++)c.push(l(e.child(d)));if(N.from(c).eq(t))return {mark:a,type:s}}function Xw(t,e,n,r,i){if(n-e<=i.pos-r.pos||tl(r,!0,!1)<i.pos)return !1;let o=t.resolve(e);if(!r.parent.isTextblock){let a=o.nodeAfter;return a!=null&&n==e+a.nodeSize}if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return !1;let s=t.resolve(tl(o,!0,!0));return !s.parent.isTextblock||s.pos>n||tl(s,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(s.parent.content)}function tl(t,e,n){let r=t.depth,i=e?t.end():t.pos;for(;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,i++,e=!1;if(n){let o=t.node(r).maybeChild(t.indexAfter(r));for(;o&&!o.isLeaf;)o=o.firstChild,i++;}return i}function Qw(t,e,n,r,i){let o=t.findDiffStart(e,n);if(o==null)return null;let{a:s,b:a}=t.findDiffEnd(e,n+t.size,n+e.size);if(i=="end"){let l=Math.max(0,o-Math.min(s,a));r-=s+l-o;}if(s<o&&t.size<e.size){let l=r<=o&&r>=s?o-r:0;o-=l,o&&o<e.size&&Cf(e.textBetween(o-1,o+1))&&(o+=l?1:-1),a=o+(a-s),s=o;}else if(a<o){let l=r<=o&&r>=a?o-r:0;o-=l,o&&o<t.size&&Cf(t.textBetween(o-1,o+1))&&(o+=l?1:-1),s=o+(s-a),a=o;}return {start:o,endA:s,endB:a}}function Cf(t){if(t.length!=2)return !1;let e=t.charCodeAt(0),n=t.charCodeAt(1);return e>=56320&&e<=57343&&n>=55296&&n<=56319}var Mi=class{constructor(e,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new hl,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(Mf),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=Tf(this),Nf(this),this.nodeViews=_f(this),this.docView=of(this.state.doc,kf(this),el(this),this.dom,this),this.domObserver=new yl(this,(r,i,o,s)=>Yw(this,r,i,o,s)),this.domObserver.start(),xw(this),this.updatePluginViews();}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let n in e)this._props[n]=e[n];this._props.state=this.state;}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&ml(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Mf),this.directPlugins=e.plugins),this.updateStateInner(e.state,n);}setProps(e){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in e)n[r]=e[r];this.update(n);}updateState(e){this.updateStateInner(e,this._props);}updateStateInner(e,n){var r;let i=this.state,o=!1,s=!1;e.storedMarks&&this.composing&&(ep(this),s=!0),this.state=e;let a=i.plugins!=e.plugins||this._props.plugins!=n.plugins;if(a||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let p=_f(this);tx(p,this.nodeViews)&&(this.nodeViews=p,o=!0);}(a||n.handleDOMEvents!=this._props.handleDOMEvents)&&ml(this),this.editable=Tf(this),Nf(this);let l=el(this),c=kf(this),d=i.plugins!=e.plugins&&!i.doc.eq(e.doc)?"reset":e.scrollToSelection>i.scrollToSelection?"to selection":"preserve",u=o||!this.docView.matchesNode(e.doc,c,l);(u||!e.selection.eq(i.selection))&&(s=!0);let f=d=="preserve"&&s&&this.dom.style.overflowAnchor==null&&Uv(this);if(s){this.domObserver.stop();let p=u&&(xt||ut)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&ex(i.selection,e.selection);if(u){let h=ut?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=Iw(this)),(o||!this.docView.update(e.doc,c,l,this))&&(this.docView.updateOuterDeco(c),this.docView.destroy(),this.docView=of(e.doc,c,l,this.dom,this)),h&&!this.trackWrites&&(p=!0);}p||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&aw(this))?vn(this,p):($f(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start();}this.updatePluginViews(i),!((r=this.dragging)===null||r===void 0)&&r.node&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),d=="reset"?this.dom.scrollTop=0:d=="to selection"?this.scrollToSelection():f&&Hv(f);}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))){if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof W){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&Xu(this,n.getBoundingClientRect(),e);}else Xu(this,this.coordsAtPos(this.state.selection.head,1),e);}}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy();}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this));}for(let n=0;n<this.state.plugins.length;n++){let r=this.state.plugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this));}}else for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,e);}}updateDraggedNode(e,n){let r=e.node,i=-1;if(this.state.doc.nodeAt(r.from)==r.node)i=r.from;else {let o=r.from+(this.state.doc.content.size-n.doc.content.size);(o>0&&this.state.doc.nodeAt(o))==r.node&&(i=o);}this.dragging=new Oo(e.slice,e.move,i<0?void 0:W.create(this.state.doc,i));}someProp(e,n){let r=this._props&&this._props[e],i;if(r!=null&&(i=n?n(r):r))return i;for(let s=0;s<this.directPlugins.length;s++){let a=this.directPlugins[s].props[e];if(a!=null&&(i=n?n(a):a))return i}let o=this.state.plugins;if(o)for(let s=0;s<o.length;s++){let a=o[s].props[e];if(a!=null&&(i=n?n(a):a))return i}}hasFocus(){if(xt){let e=this.root.activeElement;if(e==this.dom)return !0;if(!e||!this.dom.contains(e))return !1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return !1;e=e.parentElement;}return !0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&$v(this.dom),vn(this),this.domObserver.start();}get root(){let e=this._root;if(e==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return e||document}updateRoot(){this._root=null;}posAtCoords(e){return qv(this,e)}coordsAtPos(e,n=1){return Pf(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,r=-1){let i=this.docView.posFromDOM(e,n,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,n){return Xv(this,n||this.state,e)}pasteHTML(e,n){return Ni(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return Ni(this,e,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(e){return xl(this,e)}destroy(){this.docView&&(Sw(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],el(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,Mv());}get isDestroyed(){return this.docView==null}dispatchEvent(e){return kw(this,e)}domSelectionRange(){let e=this.domSelection();return e?bt&&this.root.nodeType===11&&Iv(this.dom.ownerDocument)==this.dom&&Ww(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}};Mi.prototype.dispatch=function(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t));};function kf(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let r in n)r=="class"?e.class+=" "+n[r]:r=="style"?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(n[r]));}),e.translate||(e.translate="no"),[Ce.node(0,t.state.doc.content.size,e)]}function Nf(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:Ce.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})};}else t.cursorWrapper=null;}function Tf(t){return !t.someProp("editable",e=>e(t.state)===!1)}function ex(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function _f(t){let e=Object.create(null);function n(r){for(let i in r)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=r[i]);}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function tx(t,e){let n=0,r=0;for(let i in t){if(t[i]!=e[i])return !0;n++;}for(let i in e)r++;return n!=r}function Mf(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var xn={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Po={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},nx=typeof navigator<"u"&&/Mac/.test(navigator.platform),rx=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(Ve=0;Ve<10;Ve++)xn[48+Ve]=xn[96+Ve]=String(Ve);var Ve;for(Ve=1;Ve<=24;Ve++)xn[Ve+111]="F"+Ve;var Ve;for(Ve=65;Ve<=90;Ve++)xn[Ve]=String.fromCharCode(Ve+32),Po[Ve]=String.fromCharCode(Ve);var Ve;for(Lo in xn)Po.hasOwnProperty(Lo)||(Po[Lo]=xn[Lo]);var Lo;function sp(t){var e=nx&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||rx&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Po:xn)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}var ix=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),ox=typeof navigator<"u"&&/Win/.test(navigator.platform);function sx(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,i,o,s;for(let a=0;a<e.length-1;a++){let l=e[a];if(/^(cmd|meta|m)$/i.test(l))s=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))i=!0;else if(/^s(hift)?$/i.test(l))o=!0;else if(/^mod$/i.test(l))ix?s=!0:i=!0;else throw new Error("Unrecognized modifier name: "+l)}return r&&(n="Alt-"+n),i&&(n="Ctrl-"+n),s&&(n="Meta-"+n),o&&(n="Shift-"+n),n}function ax(t){let e=Object.create(null);for(let n in t)e[sx(n)]=t[n];return e}function Tl(t,e,n=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n&&e.shiftKey&&(t="Shift-"+t),t}function ap(t){return new Z({props:{handleKeyDown:Ri(t)}})}function Ri(t){let e=ax(t);return function(n,r){let i=sp(r),o,s=e[Tl(i,r)];if(s&&s(n.state,n.dispatch,n))return !0;if(i.length==1&&i!=" "){if(r.shiftKey){let a=e[Tl(i,r,!1)];if(a&&a(n.state,n.dispatch,n))return !0}if((r.altKey||r.metaKey||r.ctrlKey)&&!(ox&&r.ctrlKey&&r.altKey)&&(o=xn[r.keyCode])&&o!=i){let a=e[Tl(o,r)];if(a&&a(n.state,n.dispatch,n))return !0}}return !1}}var Bo=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function cp(t,e){let{$cursor:n}=t.selection;return !n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}var Ml=(t,e,n)=>{let r=cp(t,n);if(!r)return !1;let i=Ol(r);if(!i){let s=r.blockRange(),a=s&&mn(s);return a==null?!1:(e&&e(t.tr.lift(s,a).scrollIntoView()),!0)}let o=i.nodeBefore;if(yp(t,i,e,-1))return !0;if(r.parent.content.size==0&&(Gr(o,"end")||W.isSelectable(o)))for(let s=r.depth;;s--){let a=Ei(t.doc,r.before(s),r.after(s),B.empty);if(a&&a.slice.size<a.to-a.from){if(e){let l=t.tr.step(a);l.setSelection(Gr(o,"end")?q.findFrom(l.doc.resolve(l.mapping.map(i.pos,-1)),-1):W.create(l.doc,i.pos-o.nodeSize)),e(l.scrollIntoView());}return !0}if(s==1||r.node(s-1).childCount>1)break}return o.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0):!1},dp=(t,e,n)=>{let r=cp(t,n);if(!r)return !1;let i=Ol(r);return i?fp(t,i,e):!1},up=(t,e,n)=>{let r=pp(t,n);if(!r)return !1;let i=Il(r);return i?fp(t,i,e):!1};function fp(t,e,n){let r=e.nodeBefore,i=r,o=e.pos-1;for(;!i.isTextblock;o--){if(i.type.spec.isolating)return !1;let d=i.lastChild;if(!d)return !1;i=d;}let s=e.nodeAfter,a=s,l=e.pos+1;for(;!a.isTextblock;l++){if(a.type.spec.isolating)return !1;let d=a.firstChild;if(!d)return !1;a=d;}let c=Ei(t.doc,o,l,B.empty);if(!c||c.from!=o||c instanceof De&&c.slice.size>=l-o)return !1;if(n){let d=t.tr.step(c);d.setSelection(H.create(d.doc,o)),n(d.scrollIntoView());}return !0}function Gr(t,e,n=!1){for(let r=t;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return !0;if(n&&r.childCount!=1)return !1}return !1}var Al=(t,e,n)=>{let{$head:r,empty:i}=t.selection,o=r;if(!i)return !1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return !1;o=Ol(r);}let s=o&&o.nodeBefore;return !s||!W.isSelectable(s)?!1:(e&&e(t.tr.setSelection(W.create(t.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)};function Ol(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function pp(t,e){let{$cursor:n}=t.selection;return !n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}var Rl=(t,e,n)=>{let r=pp(t,n);if(!r)return !1;let i=Il(r);if(!i)return !1;let o=i.nodeAfter;if(yp(t,i,e,1))return !0;if(r.parent.content.size==0&&(Gr(o,"start")||W.isSelectable(o))){let s=Ei(t.doc,r.before(),r.after(),B.empty);if(s&&s.slice.size<s.to-s.from){if(e){let a=t.tr.step(s);a.setSelection(Gr(o,"start")?q.findFrom(a.doc.resolve(a.mapping.map(i.pos)),1):W.create(a.doc,a.mapping.map(i.pos))),e(a.scrollIntoView());}return !0}}return o.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),!0):!1},Dl=(t,e,n)=>{let{$head:r,empty:i}=t.selection,o=r;if(!i)return !1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return !1;o=Il(r);}let s=o&&o.nodeAfter;return !s||!W.isSelectable(s)?!1:(e&&e(t.tr.setSelection(W.create(t.doc,o.pos)).scrollIntoView()),!0)};function Il(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}var hp=(t,e)=>{let n=t.selection,r=n instanceof W,i;if(r){if(n.node.isTextblock||!Rt(t.doc,n.from))return !1;i=n.from;}else if(i=ir(t.doc,n.from,-1),i==null)return !1;if(e){let o=t.tr.join(i);r&&o.setSelection(W.create(o.doc,i-t.doc.resolve(i).nodeBefore.nodeSize)),e(o.scrollIntoView());}return !0},mp=(t,e)=>{let n=t.selection,r;if(n instanceof W){if(n.node.isTextblock||!Rt(t.doc,n.to))return !1;r=n.to;}else if(r=ir(t.doc,n.to,1),r==null)return !1;return e&&e(t.tr.join(r).scrollIntoView()),!0},gp=(t,e)=>{let{$from:n,$to:r}=t.selection,i=n.blockRange(r),o=i&&mn(i);return o==null?!1:(e&&e(t.tr.lift(i,o).scrollIntoView()),!0)},Ll=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return !n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(`
|
|
34
|
-
`).scrollIntoView()),!0)};function Pl(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}var Bl=(t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return !1;let i=n.node(-1),o=n.indexAfter(-1),s=Pl(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return !1;if(e){let a=n.after(),l=t.tr.replaceWith(a,a,s.createAndFill());l.setSelection(q.near(l.doc.resolve(a),1)),e(l.scrollIntoView());}return !0},zl=(t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof je||r.parent.inlineContent||i.parent.inlineContent)return !1;let o=Pl(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return !1;if(e){let s=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,a=t.tr.insert(s,o.createAndFill());a.setSelection(H.create(a.doc,s+1)),e(a.scrollIntoView());}return !0},Fl=(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return !1;if(n.depth>1&&n.after()!=n.end(-1)){let o=n.before();if(Mt(t.doc,o))return e&&e(t.tr.split(o).scrollIntoView()),!0}let r=n.blockRange(),i=r&&mn(r);return i==null?!1:(e&&e(t.tr.lift(r,i).scrollIntoView()),!0)};var bp=(t,e)=>{let{$from:n,to:r}=t.selection,i,o=n.sharedDepth(r);return o==0?!1:(i=n.before(o),e&&e(t.tr.setSelection(W.create(t.doc,i))),!0)};function ux(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,o=e.index();return !r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(o-1,o)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(o,o+1)||!(i.isTextblock||Rt(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function yp(t,e,n,r){let i=e.nodeBefore,o=e.nodeAfter,s,a,l=i.type.spec.isolating||o.type.spec.isolating;if(!l&&ux(t,e,n))return !0;let c=!l&&e.parent.canReplace(e.index(),e.index()+1);if(c&&(s=(a=i.contentMatchAt(i.childCount)).findWrapping(o.type))&&a.matchType(s[0]||o.type).validEnd){if(n){let p=e.pos+o.nodeSize,h=N.empty;for(let b=s.length-1;b>=0;b--)h=N.from(s[b].create(null,h));h=N.from(i.copy(h));let m=t.tr.step(new Me(e.pos-1,p,e.pos,p,new B(h,1,0),s.length,!0)),g=m.doc.resolve(p+2*s.length);g.nodeAfter&&g.nodeAfter.type==i.type&&Rt(m.doc,g.pos)&&m.join(g.pos),n(m.scrollIntoView());}return !0}let d=o.type.spec.isolating||r>0&&l?null:q.findFrom(e,1),u=d&&d.$from.blockRange(d.$to),f=u&&mn(u);if(f!=null&&f>=e.depth)return n&&n(t.tr.lift(u,f).scrollIntoView()),!0;if(c&&Gr(o,"start",!0)&&Gr(i,"end")){let p=i,h=[];for(;h.push(p),!p.isTextblock;)p=p.lastChild;let m=o,g=1;for(;!m.isTextblock;m=m.firstChild)g++;if(p.canReplace(p.childCount,p.childCount,m.content)){if(n){let b=N.empty;for(let S=h.length-1;S>=0;S--)b=N.from(h[S].copy(b));let v=t.tr.step(new Me(e.pos-h.length,e.pos+o.nodeSize,e.pos+g,e.pos+o.nodeSize-g,new B(b,h.length,0),0,!0));n(v.scrollIntoView());}return !0}}return !1}function Ep(t){return function(e,n){let r=e.selection,i=t<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return !1;o--;}return i.node(o).isTextblock?(n&&n(e.tr.setSelection(H.create(e.doc,t<0?i.start(o):i.end(o)))),!0):!1}}var Ul=Ep(-1),Hl=Ep(1);function vp(t,e=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),a=s&&Ir(s,t,e);return a?(r&&r(n.tr.wrap(s,a).scrollIntoView()),!0):!1}}function $l(t,e=null){return function(n,r){let i=!1;for(let o=0;o<n.selection.ranges.length&&!i;o++){let{$from:{pos:s},$to:{pos:a}}=n.selection.ranges[o];n.doc.nodesBetween(s,a,(l,c)=>{if(i)return !1;if(!(!l.isTextblock||l.hasMarkup(t,e)))if(l.type==t)i=!0;else {let d=n.doc.resolve(c),u=d.index();i=d.parent.canReplaceWith(u,u+1,t);}});}if(!i)return !1;if(r){let o=n.tr;for(let s=0;s<n.selection.ranges.length;s++){let{$from:{pos:a},$to:{pos:l}}=n.selection.ranges[s];o.setBlockType(a,l,t,e);}r(o.scrollIntoView());}return !0}}typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform?os.platform()=="darwin":!1;function wp(t,e=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o);if(!s)return !1;let a=r?n.tr:null;return px(a,s,t,e)?(r&&r(a.scrollIntoView()),!0):!1}}function px(t,e,n,r=null){let i=!1,o=e,s=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(n)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return !1;let l=s.resolve(e.start-2);o=new tr(l,l,e.depth),e.endIndex<e.parent.childCount&&(e=new tr(e.$from,s.resolve(e.$to.end(e.depth)),e.depth)),i=!0;}let a=Ir(o,n,r,e);return a?(t&&hx(t,e,a,i,n),!0):!1}function hx(t,e,n,r,i){let o=N.empty;for(let d=n.length-1;d>=0;d--)o=N.from(n[d].type.create(n[d].attrs,o));t.step(new Me(e.start-(r?2:0),e.end,e.start,e.end,new B(o,0,0),n.length,!0));let s=0;for(let d=0;d<n.length;d++)n[d].type==i&&(s=d+1);let a=n.length-s,l=e.start+n.length-(r?2:0),c=e.parent;for(let d=e.startIndex,u=e.endIndex,f=!0;d<u;d++,f=!1)!f&&Mt(t.doc,l,a)&&(t.split(l,a),l+=2*a),l+=c.child(d).nodeSize;return t}function xp(t){return function(e,n){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,s=>s.childCount>0&&s.firstChild.type==t);return o?n?r.node(o.depth-1).type==t?mx(e,n,t,o):gx(e,n,o):!0:!1}}function mx(t,e,n,r){let i=t.tr,o=r.end,s=r.$to.end(r.depth);o<s&&(i.step(new Me(o-1,s,o,s,new B(N.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new tr(i.doc.resolve(r.$from.pos),i.doc.resolve(s),r.depth));let a=mn(r);if(a==null)return !1;i.lift(r,a);let l=i.doc.resolve(i.mapping.map(o,-1)-1);return Rt(i.doc,l.pos)&&l.nodeBefore.type==l.nodeAfter.type&&i.join(l.pos),e(i.scrollIntoView()),!0}function gx(t,e,n){let r=t.tr,i=n.parent;for(let p=n.end,h=n.endIndex-1,m=n.startIndex;h>m;h--)p-=i.child(h).nodeSize,r.delete(p-1,p+1);let o=r.doc.resolve(n.start),s=o.nodeAfter;if(r.mapping.map(n.end)!=n.start+o.nodeAfter.nodeSize)return !1;let a=n.startIndex==0,l=n.endIndex==i.childCount,c=o.node(-1),d=o.index(-1);if(!c.canReplace(d+(a?0:1),d+1,s.content.append(l?N.empty:N.from(i))))return !1;let u=o.pos,f=u+s.nodeSize;return r.step(new Me(u-(a?1:0),f+(l?1:0),u+1,f-1,new B((a?N.empty:N.from(i.copy(N.empty))).append(l?N.empty:N.from(i.copy(N.empty))),a?0:1,l?0:1),a?0:1)),e(r.scrollIntoView()),!0}function Sp(t){return function(e,n){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,c=>c.childCount>0&&c.firstChild.type==t);if(!o)return !1;let s=o.startIndex;if(s==0)return !1;let a=o.parent,l=a.child(s-1);if(l.type!=t)return !1;if(n){let c=l.lastChild&&l.lastChild.type==a.type,d=N.from(c?t.create():null),u=new B(N.from(t.create(null,N.from(a.type.create(null,d)))),c?3:1,0),f=o.start,p=o.end;n(e.tr.step(new Me(f-(c?3:1),p,f,p,u,1,!0)).scrollIntoView());}return !0}}var bx=Object.defineProperty,Op=(t,e)=>{for(var n in e)bx(t,n,{get:e[n],enumerable:!0});};function Wo(t){let{state:e,transaction:n}=t,{selection:r}=n,{doc:i}=n,{storedMarks:o}=n;return {...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return o},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,o=n.storedMarks,n}}}var Go=class{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state;}get hasCustomState(){return !!this.customState}get state(){return this.customState||this.editor.state}get commands(){let{rawCommands:t,editor:e,state:n}=this,{view:r}=e,{tr:i}=n,o=this.buildProps(i);return Object.fromEntries(Object.entries(t).map(([s,a])=>[s,(...c)=>{let d=a(...c)(o);return !i.getMeta("preventDispatch")&&!this.hasCustomState&&r.dispatch(i),d}]))}get chain(){return ()=>this.createChain()}get can(){return ()=>this.createCan()}createChain(t,e=!0){let{rawCommands:n,editor:r,state:i}=this,{view:o}=r,s=[],a=!!t,l=t||i.tr,c=()=>(!a&&e&&!l.getMeta("preventDispatch")&&!this.hasCustomState&&o.dispatch(l),s.every(u=>u===!0)),d={...Object.fromEntries(Object.entries(n).map(([u,f])=>[u,(...h)=>{let m=this.buildProps(l,e),g=f(...h)(m);return s.push(g),d}])),run:c};return d}createCan(t){let{rawCommands:e,state:n}=this,r=!1,i=t||n.tr,o=this.buildProps(i,r);return {...Object.fromEntries(Object.entries(e).map(([a,l])=>[a,(...c)=>l(...c)({...o,dispatch:void 0})])),chain:()=>this.createChain(i,r)}}buildProps(t,e=!0){let{rawCommands:n,editor:r,state:i}=this,{view:o}=r,s={tr:t,editor:r,view:o,state:Wo({state:i,transaction:t}),dispatch:e?()=>{}:void 0,chain:()=>this.createChain(t,e),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(n).map(([a,l])=>[a,(...c)=>l(...c)(s)]))}};return s}},yx=class{constructor(){this.callbacks={};}on(t,e){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(e),this}emit(t,...e){let n=this.callbacks[t];return n&&n.forEach(r=>r.apply(this,e)),this}off(t,e){let n=this.callbacks[t];return n&&(e?this.callbacks[t]=n.filter(r=>r!==e):delete this.callbacks[t]),this}once(t,e){let n=(...r)=>{this.off(t,n),e.apply(this,r);};return this.on(t,n)}removeAllListeners(){this.callbacks={};}};function Jl(t,e){let n=new Dn(t);return e.forEach(r=>{r.steps.forEach(i=>{n.step(i);});}),n}var Rp=t=>{let e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){let r=e[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?t.removeChild(r):r.nodeType===1&&Rp(r);}return t};function zo(t){if(typeof window>"u")throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");let e=`<body>${t}</body>`,n=new window.DOMParser().parseFromString(e,"text/html").body;return Rp(n)}function Di(t,e,n){if(t instanceof et||t instanceof N)return t;n={slice:!0,parseOptions:{},...n};let r=typeof t=="object"&&t!==null,i=typeof t=="string";if(r)try{if(Array.isArray(t)&&t.length>0)return N.fromArray(t.map(a=>e.nodeFromJSON(a)));let s=e.nodeFromJSON(t);return n.errorOnInvalidContent&&s.check(),s}catch(o){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:o});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",o),Di("",e,n)}if(i){if(n.errorOnInvalidContent){let s=!1,a="",l=new Rr({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:c=>(s=!0,a=typeof c=="string"?c:c.outerHTML,null)}]}})});if(n.slice?_t.fromSchema(l).parseSlice(zo(t),n.parseOptions):_t.fromSchema(l).parse(zo(t),n.parseOptions),n.errorOnInvalidContent&&s)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${a}`)})}let o=_t.fromSchema(e);return n.slice?o.parseSlice(zo(t),n.parseOptions).content:o.parse(zo(t),n.parseOptions)}return Di("",e,n)}function ql(t,e,n={},r={}){return Di(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}function Ex(t){for(let e=0;e<t.edgeCount;e+=1){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function qo(t,e){let n=[];return t.descendants((r,i)=>{e(r)&&n.push({node:r,pos:i});}),n}function Dp(t,e,n){let r=[];return t.nodesBetween(e.from,e.to,(i,o)=>{n(i)&&r.push({node:i,pos:o});}),r}function Yl(t,e){for(let n=t.depth;n>0;n-=1){let r=t.node(n);if(e(r))return {pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}function jo(t){return e=>Yl(e.$from,t)}function j(t,e,n){return t.config[e]===void 0&&t.parent?j(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?j(t.parent,e,n):null}):t.config[e]}function Zl(t){return t.map(e=>{let n={name:e.name,options:e.options,storage:e.storage},r=j(e,"addExtensions",n);return r?[e,...Zl(r())]:e}).flat(10)}function Xl(t,e){let n=$t.fromSchema(e).serializeFragment(t),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(n),i.innerHTML}function Ip(t){return typeof t=="function"}function Se(t,e=void 0,...n){return Ip(t)?e?t.bind(e)(...n):t(...n):t}function vx(t={}){return Object.keys(t).length===0&&t.constructor===Object}function Ii(t){let e=t.filter(i=>i.type==="extension"),n=t.filter(i=>i.type==="node"),r=t.filter(i=>i.type==="mark");return {baseExtensions:e,nodeExtensions:n,markExtensions:r}}function Lp(t){let e=[],{nodeExtensions:n,markExtensions:r}=Ii(t),i=[...n,...r],o={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(s=>{let a={name:s.name,options:s.options,storage:s.storage,extensions:i},l=j(s,"addGlobalAttributes",a);if(!l)return;l().forEach(d=>{d.types.forEach(u=>{Object.entries(d.attributes).forEach(([f,p])=>{e.push({type:u,name:f,attribute:{...o,...p}});});});});}),i.forEach(s=>{let a={name:s.name,options:s.options,storage:s.storage},l=j(s,"addAttributes",a);if(!l)return;let c=l();Object.entries(c).forEach(([d,u])=>{let f={...o,...u};typeof f?.default=="function"&&(f.default=f.default()),f?.isRequired&&f?.default===void 0&&delete f.default,e.push({type:s.name,name:d,attribute:f});});}),e}function te(...t){return t.filter(e=>!!e).reduce((e,n)=>{let r={...e};return Object.entries(n).forEach(([i,o])=>{if(!r[i]){r[i]=o;return}if(i==="class"){let a=o?String(o).split(" "):[],l=r[i]?r[i].split(" "):[],c=a.filter(d=>!l.includes(d));r[i]=[...l,...c].join(" ");}else if(i==="style"){let a=o?o.split(";").map(d=>d.trim()).filter(Boolean):[],l=r[i]?r[i].split(";").map(d=>d.trim()).filter(Boolean):[],c=new Map;l.forEach(d=>{let[u,f]=d.split(":").map(p=>p.trim());c.set(u,f);}),a.forEach(d=>{let[u,f]=d.split(":").map(p=>p.trim());c.set(u,f);}),r[i]=Array.from(c.entries()).map(([d,u])=>`${d}: ${u}`).join("; ");}else r[i]=o;}),r},{})}function Ko(t,e){return e.filter(n=>n.type===t.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,r)=>te(n,r),{})}function wx(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function Cp(t,e){return "style"in t?t:{...t,getAttrs:n=>{let r=t.getAttrs?t.getAttrs(n):t.attrs;if(r===!1)return !1;let i=e.reduce((o,s)=>{let a=s.attribute.parseHTML?s.attribute.parseHTML(n):wx(n.getAttribute(s.name));return a==null?o:{...o,[s.name]:a}},{});return {...r,...i}}}}function kp(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&vx(n)?!1:n!=null))}function xx(t,e){var n;let r=Lp(t),{nodeExtensions:i,markExtensions:o}=Ii(t),s=(n=i.find(c=>j(c,"topNode")))==null?void 0:n.name,a=Object.fromEntries(i.map(c=>{let d=r.filter(b=>b.type===c.name),u={name:c.name,options:c.options,storage:c.storage,editor:e},f=t.reduce((b,v)=>{let S=j(v,"extendNodeSchema",u);return {...b,...S?S(c):{}}},{}),p=kp({...f,content:Se(j(c,"content",u)),marks:Se(j(c,"marks",u)),group:Se(j(c,"group",u)),inline:Se(j(c,"inline",u)),atom:Se(j(c,"atom",u)),selectable:Se(j(c,"selectable",u)),draggable:Se(j(c,"draggable",u)),code:Se(j(c,"code",u)),whitespace:Se(j(c,"whitespace",u)),linebreakReplacement:Se(j(c,"linebreakReplacement",u)),defining:Se(j(c,"defining",u)),isolating:Se(j(c,"isolating",u)),attrs:Object.fromEntries(d.map(b=>{var v,S;return [b.name,{default:(v=b?.attribute)==null?void 0:v.default,validate:(S=b?.attribute)==null?void 0:S.validate}]}))}),h=Se(j(c,"parseHTML",u));h&&(p.parseDOM=h.map(b=>Cp(b,d)));let m=j(c,"renderHTML",u);m&&(p.toDOM=b=>m({node:b,HTMLAttributes:Ko(b,d)}));let g=j(c,"renderText",u);return g&&(p.toText=g),[c.name,p]})),l=Object.fromEntries(o.map(c=>{let d=r.filter(g=>g.type===c.name),u={name:c.name,options:c.options,storage:c.storage,editor:e},f=t.reduce((g,b)=>{let v=j(b,"extendMarkSchema",u);return {...g,...v?v(c):{}}},{}),p=kp({...f,inclusive:Se(j(c,"inclusive",u)),excludes:Se(j(c,"excludes",u)),group:Se(j(c,"group",u)),spanning:Se(j(c,"spanning",u)),code:Se(j(c,"code",u)),attrs:Object.fromEntries(d.map(g=>{var b,v;return [g.name,{default:(b=g?.attribute)==null?void 0:b.default,validate:(v=g?.attribute)==null?void 0:v.validate}]}))}),h=Se(j(c,"parseHTML",u));h&&(p.parseDOM=h.map(g=>Cp(g,d)));let m=j(c,"renderHTML",u);return m&&(p.toDOM=g=>m({mark:g,HTMLAttributes:Ko(g,d)})),[c.name,p]}));return new Rr({topNode:s,nodes:a,marks:l})}function Sx(t){let e=t.filter((n,r)=>t.indexOf(n)!==r);return Array.from(new Set(e))}function Ql(t){return t.sort((n,r)=>{let i=j(n,"priority")||100,o=j(r,"priority")||100;return i>o?-1:i<o?1:0})}function Pp(t){let e=Ql(Zl(t)),n=Sx(e.map(r=>r.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(r=>`'${r}'`).join(", ")}]. This can lead to issues.`),e}function Bp(t,e,n){let{from:r,to:i}=e,{blockSeparator:o=`
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function Dx(t){return Object.prototype.toString.call(t).slice(8,-1)}function Uo(t){return Dx(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function Gp(t,e){let n={...t};return Uo(t)&&Uo(e)&&Object.keys(e).forEach(r=>{Uo(e[r])&&Uo(t[r])?n[r]=Gp(t[r],e[r]):n[r]=e[r];}),n}var ic=class{constructor(t={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...t},this.name=this.config.name;}get options(){return {...Se(j(this,"addOptions",{name:this.name}))||{}}}get storage(){return {...Se(j(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(t={}){let e=this.extend({...this.config,addOptions:()=>Gp(this.options,t)});return e.name=this.name,e.parent=this.parent,e}extend(t={}){let e=new this.constructor({...this.config,...t});return e.parent=this,this.child=e,e.name="name"in t?t.name:e.parent.name,e}},nt=class qp extends ic{constructor(){super(...arguments),this.type="mark";}static create(e={}){let n=typeof e=="function"?e():e;return new qp(n)}static handleExit({editor:e,mark:n}){let{tr:r}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){let s=i.marks();if(!!!s.find(c=>c?.type.name===n.name))return !1;let l=s.find(c=>c?.type.name===n.name);return l&&r.removeStoredMark(l),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return !1}configure(e){return super.configure(e)}extend(e){let n=typeof e=="function"?e():e;return super.extend(n)}};function Ix(t){return typeof t=="number"}var Lx=class{constructor(t){this.find=t.find,this.handler=t.handler;}},Px=(t,e,n)=>{if(nc(e))return [...t.matchAll(e)];let r=e(t,n);return r?r.map(i=>{let o=[i.text];return o.index=i.index,o.input=t,o.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),o.push(i.replaceWith)),o}):[]};function Bx(t){let{editor:e,state:n,from:r,to:i,rule:o,pasteEvent:s,dropEvent:a}=t,{commands:l,chain:c,can:d}=new Go({editor:e,state:n}),u=[];return n.doc.nodesBetween(r,i,(p,h)=>{if(!p.isTextblock||p.type.spec.code)return;let m=Math.max(r,h),g=Math.min(i,h+p.content.size),b=p.textBetween(m-h,g-h,void 0,"\uFFFC");Px(b,o.find,s).forEach(S=>{if(S.index===void 0)return;let T=m+S.index+1,_=T+S[0].length,I={from:n.tr.mapping.map(T),to:n.tr.mapping.map(_)},k=o.handler({state:n,range:I,match:S,commands:l,chain:c,can:d,pasteEvent:s,dropEvent:a});u.push(k);});}),u.every(p=>p!==null)}var Ho=null,zx=t=>{var e;let n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return (e=n.clipboardData)==null||e.setData("text/html",t),n};function Fx(t){let{editor:e,rules:n}=t,r=null,i=!1,o=!1,s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,a;try{a=typeof DragEvent<"u"?new DragEvent("drop"):null;}catch{a=null;}let l=({state:d,from:u,to:f,rule:p,pasteEvt:h})=>{let m=d.tr,g=Wo({state:d,transaction:m});if(!(!Bx({editor:e,state:g,from:Math.max(u-1,0),to:f.b-1,rule:p,pasteEvent:h,dropEvent:a})||!m.steps.length)){try{a=typeof DragEvent<"u"?new DragEvent("drop"):null;}catch{a=null;}return s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,m}};return n.map(d=>new Z({view(u){let f=h=>{var m;r=(m=u.dom.parentElement)!=null&&m.contains(h.target)?u.dom.parentElement:null,r&&(Ho=e);},p=()=>{Ho&&(Ho=null);};return window.addEventListener("dragstart",f),window.addEventListener("dragend",p),{destroy(){window.removeEventListener("dragstart",f),window.removeEventListener("dragend",p);}}},props:{handleDOMEvents:{drop:(u,f)=>{if(o=r===u.dom.parentElement,a=f,!o){let p=Ho;p?.isEditable&&setTimeout(()=>{let h=p.state.selection;h&&p.commands.deleteRange({from:h.from,to:h.to});},10);}return !1},paste:(u,f)=>{var p;let h=(p=f.clipboardData)==null?void 0:p.getData("text/html");return s=f,i=!!h?.includes("data-pm-slice"),!1}}},appendTransaction:(u,f,p)=>{let h=u[0],m=h.getMeta("uiEvent")==="paste"&&!i,g=h.getMeta("uiEvent")==="drop"&&!o,b=h.getMeta("applyPasteRules"),v=!!b;if(!m&&!g&&!v)return;if(v){let{text:_}=b;typeof _=="string"?_=_:_=Xl(N.from(_),p.schema);let{from:I}=b,k=I+_.length,y=zx(_);return l({rule:d,state:p,from:I,to:{b:k},pasteEvt:y})}let S=f.doc.content.findDiffStart(p.doc.content),T=f.doc.content.findDiffEnd(p.doc.content);if(!(!Ix(S)||!T||S===T.b))return l({rule:d,state:p,from:S,to:T,pasteEvt:s})}}))}var Xo=class{constructor(t,e){this.splittableMarks=[],this.editor=e,this.extensions=Pp(t),this.schema=xx(this.extensions,e),this.setupExtensions();}get commands(){return this.extensions.reduce((t,e)=>{let n={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:Vl(e.name,this.schema)},r=j(e,"addCommands",n);return r?{...t,...r()}:t},{})}get plugins(){let{editor:t}=this,e=Ql([...this.extensions].reverse()),n=[],r=[],i=e.map(o=>{let s={name:o.name,options:o.options,storage:this.editor.extensionStorage[o.name],editor:t,type:Vl(o.name,this.schema)},a=[],l=j(o,"addKeyboardShortcuts",s),c={};if(o.type==="mark"&&j(o,"exitable",s)&&(c.ArrowRight=()=>nt.handleExit({editor:t,mark:o})),l){let h=Object.fromEntries(Object.entries(l()).map(([m,g])=>[m,()=>g({editor:t})]));c={...c,...h};}let d=ap(c);a.push(d);let u=j(o,"addInputRules",s);Tp(o,t.options.enableInputRules)&&u&&n.push(...u());let f=j(o,"addPasteRules",s);Tp(o,t.options.enablePasteRules)&&f&&r.push(...f());let p=j(o,"addProseMirrorPlugins",s);if(p){let h=p();a.push(...h);}return a}).flat();return [Rx({editor:t,rules:n}),...Fx({editor:t,rules:r}),...i]}get attributes(){return Lp(this.extensions)}get nodeViews(){let{editor:t}=this,{nodeExtensions:e}=Ii(this.extensions);return Object.fromEntries(e.filter(n=>!!j(n,"addNodeView")).map(n=>{let r=this.attributes.filter(a=>a.type===n.name),i={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:ze(n.name,this.schema)},o=j(n,"addNodeView",i);if(!o)return [];let s=(a,l,c,d,u)=>{let f=Ko(a,r);return o()({node:a,view:l,getPos:c,decorations:d,innerDecorations:u,editor:t,extension:n,HTMLAttributes:f})};return [n.name,s]}))}get markViews(){let{editor:t}=this,{markExtensions:e}=Ii(this.extensions);return Object.fromEntries(e.filter(n=>!!j(n,"addMarkView")).map(n=>{let r=this.attributes.filter(a=>a.type===n.name),i={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:Sn(n.name,this.schema)},o=j(n,"addMarkView",i);if(!o)return [];let s=(a,l,c)=>{let d=Ko(a,r);return o()({mark:a,view:l,inline:c,editor:t,extension:n,HTMLAttributes:d,updateAttributes:u=>{XS(a,t,u);}})};return [n.name,s]}))}setupExtensions(){let t=this.extensions;this.editor.extensionStorage=Object.fromEntries(t.map(e=>[e.name,e.storage])),t.forEach(e=>{var n;let r={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:Vl(e.name,this.schema)};e.type==="mark"&&((n=Se(j(e,"keepOnSplit",r)))==null||n)&&this.splittableMarks.push(e.name);let i=j(e,"onBeforeCreate",r),o=j(e,"onCreate",r),s=j(e,"onUpdate",r),a=j(e,"onSelectionUpdate",r),l=j(e,"onTransaction",r),c=j(e,"onFocus",r),d=j(e,"onBlur",r),u=j(e,"onDestroy",r);i&&this.editor.on("beforeCreate",i),o&&this.editor.on("create",o),s&&this.editor.on("update",s),a&&this.editor.on("selectionUpdate",a),l&&this.editor.on("transaction",l),c&&this.editor.on("focus",c),d&&this.editor.on("blur",d),u&&this.editor.on("destroy",u);});}};Xo.resolve=Pp;Xo.sort=Ql;Xo.flatten=Zl;var Ux={};Op(Ux,{ClipboardTextSerializer:()=>Jp,Commands:()=>Xp,Delete:()=>Qp,Drop:()=>eh,Editable:()=>th,FocusEvents:()=>rh,Keymap:()=>ih,Paste:()=>oh,Tabindex:()=>sh,focusEventsPluginKey:()=>nh});var ne=class jp extends ic{constructor(){super(...arguments),this.type="extension";}static create(e={}){let n=typeof e=="function"?e():e;return new jp(n)}configure(e){return super.configure(e)}extend(e){let n=typeof e=="function"?e():e;return super.extend(n)}},Jp=ne.create({name:"clipboardTextSerializer",addOptions(){return {blockSeparator:void 0}},addProseMirrorPlugins(){return [new Z({key:new re("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{let{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:i}=e,{ranges:o}=i,s=Math.min(...o.map(d=>d.$from.pos)),a=Math.max(...o.map(d=>d.$to.pos)),l=zp(n);return Bp(r,{from:s,to:a},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}}),Yp={};Op(Yp,{blur:()=>Hx,clearContent:()=>$x,clearNodes:()=>Kx,command:()=>Vx,createParagraphNear:()=>Wx,cut:()=>Gx,deleteCurrentNode:()=>qx,deleteNode:()=>jx,deleteRange:()=>Jx,deleteSelection:()=>Yx,enter:()=>Zx,exitCode:()=>Xx,extendMarkRange:()=>Qx,first:()=>eS,focus:()=>nS,forEach:()=>rS,insertContent:()=>iS,insertContentAt:()=>sS,joinBackward:()=>cS,joinDown:()=>lS,joinForward:()=>dS,joinItemBackward:()=>uS,joinItemForward:()=>fS,joinTextblockBackward:()=>pS,joinTextblockForward:()=>hS,joinUp:()=>aS,keyboardShortcut:()=>gS,lift:()=>bS,liftEmptyBlock:()=>yS,liftListItem:()=>ES,newlineInCode:()=>vS,resetAttributes:()=>wS,scrollIntoView:()=>xS,selectAll:()=>SS,selectNodeBackward:()=>CS,selectNodeForward:()=>kS,selectParentNode:()=>NS,selectTextblockEnd:()=>TS,selectTextblockStart:()=>_S,setContent:()=>MS,setMark:()=>OS,setMeta:()=>RS,setNode:()=>DS,setNodeSelection:()=>IS,setTextSelection:()=>LS,sinkListItem:()=>PS,splitBlock:()=>BS,splitListItem:()=>zS,toggleList:()=>FS,toggleMark:()=>US,toggleNode:()=>HS,toggleWrap:()=>$S,undoInputRule:()=>KS,unsetAllMarks:()=>VS,unsetMark:()=>WS,updateAttributes:()=>GS,wrapIn:()=>qS,wrapInList:()=>jS});var Hx=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window?.getSelection())==null||n.removeAllRanges());}),!0),$x=(t=!0)=>({commands:e})=>e.setContent("",{emitUpdate:t}),Kx=()=>({state:t,tr:e,dispatch:n})=>{let{selection:r}=e,{ranges:i}=r;return n&&i.forEach(({$from:o,$to:s})=>{t.doc.nodesBetween(o.pos,s.pos,(a,l)=>{if(a.type.isText)return;let{doc:c,mapping:d}=e,u=c.resolve(d.map(l)),f=c.resolve(d.map(l+a.nodeSize)),p=u.blockRange(f);if(!p)return;let h=mn(p);if(a.type.isTextblock){let{defaultType:m}=u.parent.contentMatchAt(u.index());e.setNodeMarkup(p.start,m);}(h||h===0)&&e.lift(p,h);});}),!0},Vx=t=>e=>t(e),Wx=()=>({state:t,dispatch:e})=>zl(t,e),Gx=(t,e)=>({editor:n,tr:r})=>{let{state:i}=n,o=i.doc.slice(t.from,t.to);r.deleteRange(t.from,t.to);let s=r.mapping.map(e);return r.insert(s,o.content),r.setSelection(new H(r.doc.resolve(Math.max(s-1,0)))),!0},qx=()=>({tr:t,dispatch:e})=>{let{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return !1;let i=t.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===r.type){if(e){let a=i.before(o),l=i.after(o);t.delete(a,l).scrollIntoView();}return !0}return !1},jx=t=>({tr:e,state:n,dispatch:r})=>{let i=ze(t,n.schema),o=e.selection.$anchor;for(let s=o.depth;s>0;s-=1)if(o.node(s).type===i){if(r){let l=o.before(s),c=o.after(s);e.delete(l,c).scrollIntoView();}return !0}return !1},Jx=t=>({tr:e,dispatch:n})=>{let{from:r,to:i}=t;return n&&e.delete(r,i),!0},Yx=()=>({state:t,dispatch:e})=>Bo(t,e),Zx=()=>({commands:t})=>t.keyboardShortcut("Enter"),Xx=()=>({state:t,dispatch:e})=>Bl(t,e),Qx=(t,e={})=>({tr:n,state:r,dispatch:i})=>{let o=Sn(t,r.schema),{doc:s,selection:a}=n,{$from:l,from:c,to:d}=a;if(i){let u=rc(l,o,e);if(u&&u.from<=c&&u.to>=d){let f=H.create(s,u.from,u.to);n.setSelection(f);}}return !0},eS=t=>e=>{let n=typeof t=="function"?t(e):t;for(let r=0;r<n.length;r+=1)if(n[r](e))return !0;return !1};function tS(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function oc(){return ["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}var nS=(t=null,e={})=>({editor:n,view:r,tr:i,dispatch:o})=>{e={scrollIntoView:!0,...e};let s=()=>{(oc()||tS())&&r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),e?.scrollIntoView&&n.commands.scrollIntoView());});};if(r.hasFocus()&&t===null||t===!1)return !0;if(o&&t===null&&!Vp(n.state.selection))return s(),!0;let a=Wp(i.doc,t)||n.state.selection,l=n.state.selection.eq(a);return o&&(l||i.setSelection(a),l&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0},rS=(t,e)=>n=>t.every((r,i)=>e(r,{...n,index:i})),iS=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),oS=t=>!("type"in t),sS=(t,e,n)=>({tr:r,dispatch:i,editor:o})=>{var s;if(i){n={parseOptions:o.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let a,{selection:l}=o.state,c=b=>{o.emit("contentError",{editor:o,error:b,disableCollaboration:()=>{"collaboration"in o.storage&&typeof o.storage.collaboration=="object"&&o.storage.collaboration&&(o.storage.collaboration.isDisabled=!0);}});},d={preserveWhitespace:"full",...n.parseOptions};if(!n.errorOnInvalidContent&&!o.options.enableContentCheck&&o.options.emitContentError)try{Di(e,o.schema,{parseOptions:d,errorOnInvalidContent:!0});}catch(b){c(b);}try{a=Di(e,o.schema,{parseOptions:d,errorOnInvalidContent:(s=n.errorOnInvalidContent)!=null?s:o.options.enableContentCheck});}catch(b){return c(b),!1}let{from:u,to:f}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},p=!0,h=!0;if((oS(a)?a:[a]).forEach(b=>{b.check(),p=p?b.isText&&b.marks.length===0:!1,h=h?b.isBlock:!1;}),u===f&&h){let{parent:b}=r.doc.resolve(u);b.isTextblock&&!b.type.spec.code&&!b.childCount&&(u-=1,f+=1);}let g;if(p){if(Array.isArray(e))g=e.map(b=>b.text||"").join("");else if(e instanceof N){let b="";e.forEach(v=>{v.text&&(b+=v.text);}),g=b;}else typeof e=="object"&&e&&e.text?g=e.text:g=e;r.insertText(g,u,f);}else {g=a;let b=l.$from.parentOffset===0,v=l.$from.node().isText||l.$from.node().isTextblock,S=l.$from.node().content.size>0;b&&v&&S&&(u=Math.max(0,u-1)),r.replaceWith(u,f,g);}n.updateSelection&&Ax(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:u,text:g}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:u,text:g});}return !0},aS=()=>({state:t,dispatch:e})=>hp(t,e),lS=()=>({state:t,dispatch:e})=>mp(t,e),cS=()=>({state:t,dispatch:e})=>Ml(t,e),dS=()=>({state:t,dispatch:e})=>Rl(t,e),uS=()=>({state:t,dispatch:e,tr:n})=>{try{let r=ir(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return !1}},fS=()=>({state:t,dispatch:e,tr:n})=>{try{let r=ir(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return !1}},pS=()=>({state:t,dispatch:e})=>dp(t,e),hS=()=>({state:t,dispatch:e})=>up(t,e);function Zp(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function mS(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n==="Space"&&(n=" ");let r,i,o,s;for(let a=0;a<e.length-1;a+=1){let l=e[a];if(/^(cmd|meta|m)$/i.test(l))s=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))i=!0;else if(/^s(hift)?$/i.test(l))o=!0;else if(/^mod$/i.test(l))oc()||Zp()?s=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${l}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),s&&(n=`Meta-${n}`),o&&(n=`Shift-${n}`),n}var gS=t=>({editor:e,view:n,tr:r,dispatch:i})=>{let o=mS(t).split(/-(?!$)/),s=o.find(c=>!["Alt","Ctrl","Meta","Shift"].includes(c)),a=new KeyboardEvent("keydown",{key:s==="Space"?" ":s,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),l=e.captureTransaction(()=>{n.someProp("handleKeyDown",c=>c(n,a));});return l?.steps.forEach(c=>{let d=c.map(r.mapping);d&&i&&r.maybeStep(d);}),!0},bS=(t,e={})=>({state:n,dispatch:r})=>{let i=ze(t,n.schema);return Qt(n,i,e)?gp(n,r):!1},yS=()=>({state:t,dispatch:e})=>Fl(t,e),ES=t=>({state:e,dispatch:n})=>{let r=ze(t,e.schema);return xp(r)(e,n)},vS=()=>({state:t,dispatch:e})=>Ll(t,e);function Mp(t,e){let n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,i)=>(n.includes(i)||(r[i]=t[i]),r),{})}var wS=(t,e)=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null,a=Jo(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(o=ze(t,r.schema)),a==="mark"&&(s=Sn(t,r.schema)),i&&n.selection.ranges.forEach(l=>{r.doc.nodesBetween(l.$from.pos,l.$to.pos,(c,d)=>{o&&o===c.type&&n.setNodeMarkup(d,void 0,Mp(c.attrs,e)),s&&c.marks.length&&c.marks.forEach(u=>{s===u.type&&n.addMark(d,d+c.nodeSize,s.create(Mp(u.attrs,e)));});});}),!0):!1},xS=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),SS=()=>({tr:t,dispatch:e})=>{if(e){let n=new je(t.doc);t.setSelection(n);}return !0},CS=()=>({state:t,dispatch:e})=>Al(t,e),kS=()=>({state:t,dispatch:e})=>Dl(t,e),NS=()=>({state:t,dispatch:e})=>bp(t,e),TS=()=>({state:t,dispatch:e})=>Hl(t,e),_S=()=>({state:t,dispatch:e})=>Ul(t,e),MS=(t,{errorOnInvalidContent:e,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:i,tr:o,dispatch:s,commands:a})=>{let{doc:l}=o;if(r.preserveWhitespace!=="full"){let c=ql(t,i.schema,r,{errorOnInvalidContent:e??i.options.enableContentCheck});return s&&o.replaceWith(0,l.content.size,c).setMeta("preventUpdate",!n),!0}return s&&o.setMeta("preventUpdate",!n),a.insertContentAt({from:0,to:l.content.size},t,{parseOptions:r,errorOnInvalidContent:e??i.options.enableContentCheck})};function AS(t,e,n){var r;let{selection:i}=e,o=null;if(Vp(i)&&(o=i.$cursor),o){let a=(r=t.storedMarks)!=null?r:o.marks();return !!n.isInSet(a)||!a.some(l=>l.type.excludes(n))}let{ranges:s}=i;return s.some(({$from:a,$to:l})=>{let c=a.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(a.pos,l.pos,(d,u,f)=>{if(c)return !1;if(d.isInline){let p=!f||f.type.allowsMarkType(n),h=!!n.isInSet(d.marks)||!d.marks.some(m=>m.type.excludes(n));c=p&&h;}return !c}),c})}var OS=(t,e={})=>({tr:n,state:r,dispatch:i})=>{let{selection:o}=n,{empty:s,ranges:a}=o,l=Sn(t,r.schema);if(i)if(s){let c=Fp(r,l);n.addStoredMark(l.create({...c,...e}));}else a.forEach(c=>{let d=c.$from.pos,u=c.$to.pos;r.doc.nodesBetween(d,u,(f,p)=>{let h=Math.max(p,d),m=Math.min(p+f.nodeSize,u);f.marks.find(b=>b.type===l)?f.marks.forEach(b=>{l===b.type&&n.addMark(h,m,l.create({...b.attrs,...e}));}):n.addMark(h,m,l.create(e));});});return AS(r,n,l)},RS=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),DS=(t,e={})=>({state:n,dispatch:r,chain:i})=>{let o=ze(t,n.schema),s;return n.selection.$anchor.sameParent(n.selection.$head)&&(s=n.selection.$anchor.parent.attrs),o.isTextblock?i().command(({commands:a})=>$l(o,{...s,...e})(n)?!0:a.clearNodes()).command(({state:a})=>$l(o,{...s,...e})(a,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},IS=t=>({tr:e,dispatch:n})=>{if(n){let{doc:r}=e,i=pr(t,0,r.content.size),o=W.create(r,i);e.setSelection(o);}return !0},LS=t=>({tr:e,dispatch:n})=>{if(n){let{doc:r}=e,{from:i,to:o}=typeof t=="number"?{from:t,to:t}:t,s=H.atStart(r).from,a=H.atEnd(r).to,l=pr(i,s,a),c=pr(o,s,a),d=H.create(r,l,c);e.setSelection(d);}return !0},PS=t=>({state:e,dispatch:n})=>{let r=ze(t,e.schema);return Sp(r)(e,n)};function Ap(t,e){let n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){let r=n.filter(i=>e?.includes(i.type.name));t.tr.ensureMarks(r);}}var BS=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:i})=>{let{selection:o,doc:s}=e,{$from:a,$to:l}=o,c=i.extensionManager.attributes,d=$o(c,a.node().type.name,a.node().attrs);if(o instanceof W&&o.node.isBlock)return !a.parentOffset||!Mt(s,a.pos)?!1:(r&&(t&&Ap(n,i.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return !1;let u=l.parentOffset===l.parent.content.size,f=a.depth===0?void 0:Ex(a.node(-1).contentMatchAt(a.indexAfter(-1))),p=u&&f?[{type:f,attrs:d}]:void 0,h=Mt(e.doc,e.mapping.map(a.pos),1,p);if(!p&&!h&&Mt(e.doc,e.mapping.map(a.pos),1,f?[{type:f}]:void 0)&&(h=!0,p=f?[{type:f,attrs:d}]:void 0),r){if(h&&(o instanceof H&&e.deleteSelection(),e.split(e.mapping.map(a.pos),1,p),f&&!u&&!a.parentOffset&&a.parent.type!==f)){let m=e.mapping.map(a.before()),g=e.doc.resolve(m);a.node(-1).canReplaceWith(g.index(),g.index()+1,f)&&e.setNodeMarkup(e.mapping.map(a.before()),f);}t&&Ap(n,i.extensionManager.splittableMarks),e.scrollIntoView();}return h},zS=(t,e={})=>({tr:n,state:r,dispatch:i,editor:o})=>{var s;let a=ze(t,r.schema),{$from:l,$to:c}=r.selection,d=r.selection.node;if(d&&d.isBlock||l.depth<2||!l.sameParent(c))return !1;let u=l.node(-1);if(u.type!==a)return !1;let f=o.extensionManager.attributes;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==a||l.index(-2)!==l.node(-2).childCount-1)return !1;if(i){let b=N.empty,v=l.index(-1)?1:l.index(-2)?2:3;for(let y=l.depth-v;y>=l.depth-3;y-=1)b=N.from(l.node(y).copy(b));let S=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3,T={...$o(f,l.node().type.name,l.node().attrs),...e},_=((s=a.contentMatch.defaultType)==null?void 0:s.createAndFill(T))||void 0;b=b.append(N.from(a.createAndFill(null,_)||void 0));let I=l.before(l.depth-(v-1));n.replace(I,l.after(-S),new B(b,4-v,0));let k=-1;n.doc.nodesBetween(I,n.doc.content.size,(y,w)=>{if(k>-1)return !1;y.isTextblock&&y.content.size===0&&(k=w+1);}),k>-1&&n.setSelection(H.near(n.doc.resolve(k))),n.scrollIntoView();}return !0}let p=c.pos===l.end()?u.contentMatchAt(0).defaultType:null,h={...$o(f,u.type.name,u.attrs),...e},m={...$o(f,l.node().type.name,l.node().attrs),...e};n.delete(l.pos,c.pos);let g=p?[{type:a,attrs:h},{type:p,attrs:m}]:[{type:a,attrs:h}];if(!Mt(n.doc,l.pos,2))return !1;if(i){let{selection:b,storedMarks:v}=r,{splittableMarks:S}=o.extensionManager,T=v||b.$to.parentOffset&&b.$from.marks();if(n.split(l.pos,2,g).scrollIntoView(),!T||!i)return !0;let _=T.filter(I=>S.includes(I.type.name));n.ensureMarks(_);}return !0},Wl=(t,e)=>{let n=jo(s=>s.type===e)(t.selection);if(!n)return !0;let r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return !0;let i=t.doc.nodeAt(r);return n.node.type===i?.type&&Rt(t.doc,n.pos)&&t.join(n.pos),!0},Gl=(t,e)=>{let n=jo(s=>s.type===e)(t.selection);if(!n)return !0;let r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return !0;let i=t.doc.nodeAt(r);return n.node.type===i?.type&&Rt(t.doc,r)&&t.join(r),!0},FS=(t,e,n,r={})=>({editor:i,tr:o,state:s,dispatch:a,chain:l,commands:c,can:d})=>{let{extensions:u,splittableMarks:f}=i.extensionManager,p=ze(t,s.schema),h=ze(e,s.schema),{selection:m,storedMarks:g}=s,{$from:b,$to:v}=m,S=b.blockRange(v),T=g||m.$to.parentOffset&&m.$from.marks();if(!S)return !1;let _=jo(I=>_p(I.type.name,u))(m);if(S.depth>=1&&_&&S.depth-_.depth<=1){if(_.node.type===p)return c.liftListItem(h);if(_p(_.node.type.name,u)&&p.validContent(_.node.content)&&a)return l().command(()=>(o.setNodeMarkup(_.pos,p),!0)).command(()=>Wl(o,p)).command(()=>Gl(o,p)).run()}return !n||!T||!a?l().command(()=>d().wrapInList(p,r)?!0:c.clearNodes()).wrapInList(p,r).command(()=>Wl(o,p)).command(()=>Gl(o,p)).run():l().command(()=>{let I=d().wrapInList(p,r),k=T.filter(y=>f.includes(y.type.name));return o.ensureMarks(k),I?!0:c.clearNodes()}).wrapInList(p,r).command(()=>Wl(o,p)).command(()=>Gl(o,p)).run()},US=(t,e={},n={})=>({state:r,commands:i})=>{let{extendEmptyMarkRange:o=!1}=n,s=Sn(t,r.schema);return jl(r,s,e)?i.unsetMark(s,{extendEmptyMarkRange:o}):i.setMark(s,e)},HS=(t,e,n={})=>({state:r,commands:i})=>{let o=ze(t,r.schema),s=ze(e,r.schema),a=Qt(r,o,n),l;return r.selection.$anchor.sameParent(r.selection.$head)&&(l=r.selection.$anchor.parent.attrs),a?i.setNode(s,l):i.setNode(o,{...l,...n})},$S=(t,e={})=>({state:n,commands:r})=>{let i=ze(t,n.schema);return Qt(n,i,e)?r.lift(i):r.wrapIn(i,e)},KS=()=>({state:t,dispatch:e})=>{let n=t.plugins;for(let r=0;r<n.length;r+=1){let i=n[r],o;if(i.spec.isInputRules&&(o=i.getState(t))){if(e){let s=t.tr,a=o.transform;for(let l=a.steps.length-1;l>=0;l-=1)s.step(a.steps[l].invert(a.docs[l]));if(o.text){let l=s.doc.resolve(o.from).marks();s.replaceWith(o.from,o.to,t.schema.text(o.text,l));}else s.delete(o.from,o.to);}return !0}}return !1},VS=()=>({tr:t,dispatch:e})=>{let{selection:n}=t,{empty:r,ranges:i}=n;return r||e&&i.forEach(o=>{t.removeMark(o.$from.pos,o.$to.pos);}),!0},WS=(t,e={})=>({tr:n,state:r,dispatch:i})=>{var o;let{extendEmptyMarkRange:s=!1}=e,{selection:a}=n,l=Sn(t,r.schema),{$from:c,empty:d,ranges:u}=a;if(!i)return !0;if(d&&s){let{from:f,to:p}=a,h=(o=c.marks().find(g=>g.type===l))==null?void 0:o.attrs,m=rc(c,l,h);m&&(f=m.from,p=m.to),n.removeMark(f,p,l);}else u.forEach(f=>{n.removeMark(f.$from.pos,f.$to.pos,l);});return n.removeStoredMark(l),!0},GS=(t,e={})=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null,a=Jo(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(o=ze(t,r.schema)),a==="mark"&&(s=Sn(t,r.schema)),i&&n.selection.ranges.forEach(l=>{let c=l.$from.pos,d=l.$to.pos,u,f,p,h;n.selection.empty?r.doc.nodesBetween(c,d,(m,g)=>{o&&o===m.type&&(p=Math.max(g,c),h=Math.min(g+m.nodeSize,d),u=g,f=m);}):r.doc.nodesBetween(c,d,(m,g)=>{g<c&&o&&o===m.type&&(p=Math.max(g,c),h=Math.min(g+m.nodeSize,d),u=g,f=m),g>=c&&g<=d&&(o&&o===m.type&&n.setNodeMarkup(g,void 0,{...m.attrs,...e}),s&&m.marks.length&&m.marks.forEach(b=>{if(s===b.type){let v=Math.max(g,c),S=Math.min(g+m.nodeSize,d);n.addMark(v,S,s.create({...b.attrs,...e}));}}));}),f&&(u!==void 0&&n.setNodeMarkup(u,void 0,{...f.attrs,...e}),s&&f.marks.length&&f.marks.forEach(m=>{s===m.type&&n.addMark(p,h,s.create({...m.attrs,...e}));}));}),!0):!1},qS=(t,e={})=>({state:n,dispatch:r})=>{let i=ze(t,n.schema);return vp(i,e)(n,r)},jS=(t,e={})=>({state:n,dispatch:r})=>{let i=ze(t,n.schema);return wp(i,e)(n,r)},Xp=ne.create({name:"commands",addCommands(){return {...Yp}}}),Qp=ne.create({name:"delete",onUpdate({transaction:t,appendedTransactions:e}){var n,r,i;let o=()=>{var s,a,l,c;if((c=(l=(a=(s=this.editor.options.coreExtensionOptions)==null?void 0:s.delete)==null?void 0:a.filterTransaction)==null?void 0:l.call(a,t))!=null?c:t.getMeta("y-sync$"))return;let d=Jl(t.before,[t,...e]);tc(d).forEach(p=>{d.mapping.mapResult(p.oldRange.from).deletedAfter&&d.mapping.mapResult(p.oldRange.to).deletedBefore&&d.before.nodesBetween(p.oldRange.from,p.oldRange.to,(h,m)=>{let g=m+h.nodeSize-2,b=p.oldRange.from<=m&&g<=p.oldRange.to;this.editor.emit("delete",{type:"node",node:h,from:m,to:g,newFrom:d.mapping.map(m),newTo:d.mapping.map(g),deletedRange:p.oldRange,newRange:p.newRange,partial:!b,editor:this.editor,transaction:t,combinedTransform:d});});});let f=d.mapping;d.steps.forEach((p,h)=>{var m,g;if(p instanceof wt){let b=f.slice(h).map(p.from,-1),v=f.slice(h).map(p.to),S=f.invert().map(b,-1),T=f.invert().map(v),_=(m=d.doc.nodeAt(b-1))==null?void 0:m.marks.some(k=>k.eq(p.mark)),I=(g=d.doc.nodeAt(v))==null?void 0:g.marks.some(k=>k.eq(p.mark));this.editor.emit("delete",{type:"mark",mark:p.mark,from:p.from,to:p.to,deletedRange:{from:S,to:T},newRange:{from:b,to:v},partial:!!(I||_),editor:this.editor,transaction:t,combinedTransform:d});}});};(i=(r=(n=this.editor.options.coreExtensionOptions)==null?void 0:n.delete)==null?void 0:r.async)==null||i?setTimeout(o,0):o();}}),eh=ne.create({name:"drop",addProseMirrorPlugins(){return [new Z({key:new re("tiptapDrop"),props:{handleDrop:(t,e,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:r});}}})]}}),th=ne.create({name:"editable",addProseMirrorPlugins(){return [new Z({key:new re("editable"),props:{editable:()=>this.editor.options.editable}})]}}),nh=new re("focusEvents"),rh=ne.create({name:"focusEvents",addProseMirrorPlugins(){let{editor:t}=this;return [new Z({key:nh,props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;let r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;let r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),ih=ne.create({name:"keymap",addKeyboardShortcuts(){let t=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:a})=>{let{selection:l,doc:c}=a,{empty:d,$anchor:u}=l,{pos:f,parent:p}=u,h=u.parent.isTextblock&&f>0?a.doc.resolve(f-1):u,m=h.parent.type.spec.isolating,g=u.pos-u.parentOffset,b=m&&h.parent.childCount===1?g===u.pos:q.atStart(c).from===f;return !d||!p.type.isTextblock||p.textContent.length||!b||b&&u.parent.type.name==="paragraph"?!1:s.clearNodes()}),()=>s.deleteSelection(),()=>s.joinBackward(),()=>s.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:s})=>[()=>s.deleteSelection(),()=>s.deleteCurrentNode(),()=>s.joinForward(),()=>s.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:s})=>[()=>s.newlineInCode(),()=>s.createParagraphNear(),()=>s.liftEmptyBlock(),()=>s.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},o={...r,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return oc()||Zp()?o:i},addProseMirrorPlugins(){return [new Z({key:new re("clearDocument"),appendTransaction:(t,e,n)=>{if(t.some(m=>m.getMeta("composition")))return;let r=t.some(m=>m.docChanged)&&!e.doc.eq(n.doc),i=t.some(m=>m.getMeta("preventClearDocument"));if(!r||i)return;let{empty:o,from:s,to:a}=e.selection,l=q.atStart(e.doc).from,c=q.atEnd(e.doc).to;if(o||!(s===l&&a===c)||!Li(n.doc))return;let f=n.tr,p=Wo({state:n,transaction:f}),{commands:h}=new Go({editor:this.editor,state:p});if(h.clearNodes(),!!f.steps.length)return f}})]}}),oh=ne.create({name:"paste",addProseMirrorPlugins(){return [new Z({key:new re("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n});}}})]}}),sh=ne.create({name:"tabindex",addProseMirrorPlugins(){return [new Z({key:new re("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}}),JS=class qr{constructor(e,n,r=!1,i=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=n,this.currentNode=i;}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return (e=this.actualDepth)!=null?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let n=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can\u2019t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}n=this.from+1,r=this.to-1;}this.editor.commands.insertContentAt({from:n,to:r},e);}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return {from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;let e=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(e);return new qr(n,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new qr(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new qr(e,this.editor)}get children(){let e=[];return this.node.content.forEach((n,r)=>{let i=n.isBlock&&!n.isTextblock,o=n.isAtom&&!n.isText,s=this.pos+r+(o?0:1);if(s<0||s>this.resolvedPos.doc.nodeSize-2)return;let a=this.resolvedPos.doc.resolve(s);if(!i&&a.depth<=this.depth)return;let l=new qr(a,this.editor,i,i?n:null);i&&(l.actualDepth=this.depth+1),e.push(new qr(a,this.editor,i,i?n:null));}),e}get firstChild(){return this.children[0]||null}get lastChild(){let e=this.children;return e[e.length-1]||null}closest(e,n={}){let r=null,i=this.parent;for(;i&&!r;){if(i.node.type.name===e)if(Object.keys(n).length>0){let o=i.node.attrs,s=Object.keys(n);for(let a=0;a<s.length;a+=1){let l=s[a];if(o[l]!==n[l])break}}else r=i;i=i.parent;}return r}querySelector(e,n={}){return this.querySelectorAll(e,n,!0)[0]||null}querySelectorAll(e,n={},r=!1){let i=[];if(!this.children||this.children.length===0)return i;let o=Object.keys(n);return this.children.forEach(s=>{r&&i.length>0||(s.node.type.name===e&&o.every(l=>n[l]===s.node.attrs[l])&&i.push(s),!(r&&i.length>0)&&(i=i.concat(s.querySelectorAll(e,n,r))));}),i}setAttribute(e){let{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(n);}},YS=`.ProseMirror {
|
|
44
|
+
var sT=Object.create;var vg=Object.defineProperty;var aT=Object.getOwnPropertyDescriptor;var lT=Object.getOwnPropertyNames;var cT=Object.getPrototypeOf,dT=Object.prototype.hasOwnProperty;var tl=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+t+'" is not supported')});var qn=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var uT=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of lT(e))!dT.call(t,o)&&o!==r&&vg(t,o,{get:()=>e[o],enumerable:!(n=aT(e,o))||n.enumerable});return t};var ks=(t,e,r)=>(r=t!=null?sT(cT(t)):{},uT(e||!t||!t.__esModule?vg(r,"default",{value:t,enumerable:!0}):r,t));var iy=qn(oy=>{var Hi=tl("react");function AO(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var OO=typeof Object.is=="function"?Object.is:AO,DO=Hi.useState,PO=Hi.useEffect,IO=Hi.useLayoutEffect,LO=Hi.useDebugValue;function $O(t,e){var r=e(),n=DO({inst:{value:r,getSnapshot:e}}),o=n[0].inst,i=n[1];return IO(function(){o.value=r,o.getSnapshot=e,kf(o)&&i({inst:o});},[t,r,e]),PO(function(){return kf(o)&&i({inst:o}),t(function(){kf(o)&&i({inst:o});})},[t]),LO(r),r}function kf(t){var e=t.getSnapshot;t=t.value;try{var r=e();return !OO(t,r)}catch{return !0}}function BO(t,e){return e()}var FO=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?BO:$O;oy.useSyncExternalStore=Hi.useSyncExternalStore!==void 0?Hi.useSyncExternalStore:FO;});var ay=qn(sy=>{process.env.NODE_ENV!=="production"&&function(){function t(p,h){return p===h&&(p!==0||1/p===1/h)||p!==p&&h!==h}function e(p,h){d||o.startTransition===void 0||(d=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var m=h();if(!u){var g=h();i(m,g)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),u=!0);}g=s({inst:{value:m,getSnapshot:h}});var b=g[0].inst,v=g[1];return l(function(){b.value=m,b.getSnapshot=h,r(b)&&v({inst:b});},[p,m,h]),a(function(){return r(b)&&v({inst:b}),p(function(){r(b)&&v({inst:b});})},[p]),c(m),m}function r(p){var h=p.getSnapshot;p=p.value;try{var m=h();return !i(p,m)}catch{return !0}}function n(p,h){return h()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var o=tl("react"),i=typeof Object.is=="function"?Object.is:t,s=o.useState,a=o.useEffect,l=o.useLayoutEffect,c=o.useDebugValue,d=!1,u=!1,f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?n:e;sy.useSyncExternalStore=o.useSyncExternalStore!==void 0?o.useSyncExternalStore:f,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());}();});var Ys=qn((yK,Sf)=>{process.env.NODE_ENV==="production"?Sf.exports=iy():Sf.exports=ay();});var mE=qn((kG,hE)=>{hE.exports=function t(e,r){if(e===r)return !0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return !1;var n,o,i;if(Array.isArray(e)){if(n=e.length,n!=r.length)return !1;for(o=n;o--!==0;)if(!t(e[o],r[o]))return !1;return !0}if(e instanceof Map&&r instanceof Map){if(e.size!==r.size)return !1;for(o of e.entries())if(!r.has(o[0]))return !1;for(o of e.entries())if(!t(o[1],r.get(o[0])))return !1;return !0}if(e instanceof Set&&r instanceof Set){if(e.size!==r.size)return !1;for(o of e.entries())if(!r.has(o[0]))return !1;return !0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(r)){if(n=e.length,n!=r.length)return !1;for(o=n;o--!==0;)if(e[o]!==r[o])return !1;return !0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(i=Object.keys(e),n=i.length,n!==Object.keys(r).length)return !1;for(o=n;o--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[o]))return !1;for(o=n;o--!==0;){var s=i[o];if(!(s==="_owner"&&e.$$typeof)&&!t(e[s],r[s]))return !1}return !0}return e!==e&&r!==r};});var bE=qn(gE=>{var _c=tl("react"),QI=Ys();function eL(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var tL=typeof Object.is=="function"?Object.is:eL,rL=QI.useSyncExternalStore,nL=_c.useRef,oL=_c.useEffect,iL=_c.useMemo,sL=_c.useDebugValue;gE.useSyncExternalStoreWithSelector=function(t,e,r,n,o){var i=nL(null);if(i.current===null){var s={hasValue:!1,value:null};i.current=s;}else s=i.current;i=iL(function(){function l(p){if(!c){if(c=!0,d=p,p=n(p),o!==void 0&&s.hasValue){var h=s.value;if(o(h,p))return u=h}return u=p}if(h=u,tL(d,p))return h;var m=n(p);return o!==void 0&&o(h,m)?(d=p,h):(d=p,u=m)}var c=!1,d,u,f=r===void 0?null:r;return [function(){return l(e())},f===null?void 0:function(){return l(f())}]},[e,r,n,o]);var a=rL(t,i[0],i[1]);return oL(function(){s.hasValue=!0,s.value=a;},[a]),sL(a),a};});var yE=qn(vE=>{process.env.NODE_ENV!=="production"&&function(){function t(c,d){return c===d&&(c!==0||1/c===1/d)||c!==c&&d!==d}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var e=tl("react"),r=Ys(),n=typeof Object.is=="function"?Object.is:t,o=r.useSyncExternalStore,i=e.useRef,s=e.useEffect,a=e.useMemo,l=e.useDebugValue;vE.useSyncExternalStoreWithSelector=function(c,d,u,f,p){var h=i(null);if(h.current===null){var m={hasValue:!1,value:null};h.current=m;}else m=h.current;h=a(function(){function b(S){if(!v){if(v=!0,y=S,S=f(S),p!==void 0&&m.hasValue){var R=m.value;if(p(R,S))return x=R}return x=S}if(R=x,n(y,S))return R;var w=f(S);return p!==void 0&&p(R,w)?(y=S,R):(y=S,x=w)}var v=!1,y,x,E=u===void 0?null:u;return [function(){return b(d())},E===null?void 0:function(){return b(E())}]},[d,u,f,p]);var g=o(c,h[0],h[1]);return s(function(){m.hasValue=!0,m.value=g;},[g]),l(g),g},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());}();});var wE=qn((RG,Zp)=>{process.env.NODE_ENV==="production"?Zp.exports=bE():Zp.exports=yE();});var Ok=qn((VX,Ak)=>{function yk(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(e=>{let r=t[e],n=typeof r;(n==="object"||n==="function")&&!Object.isFrozen(r)&&yk(r);}),t}var Td=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1;}ignoreMatch(){this.isMatchIgnored=!0;}};function wk(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function bo(t,...e){let r=Object.create(null);for(let n in t)r[n]=t[n];return e.forEach(function(n){for(let o in n)r[o]=n[o];}),r}var h3="</span>",pk=t=>!!t.scope,m3=(t,{prefix:e})=>{if(t.startsWith("language:"))return t.replace("language:","language-");if(t.includes(".")){let r=t.split(".");return [`${e}${r.shift()}`,...r.map((n,o)=>`${n}${"_".repeat(o+1)}`)].join(" ")}return `${e}${t}`},nm=class{constructor(e,r){this.buffer="",this.classPrefix=r.classPrefix,e.walk(this);}addText(e){this.buffer+=wk(e);}openNode(e){if(!pk(e))return;let r=m3(e.scope,{prefix:this.classPrefix});this.span(r);}closeNode(e){pk(e)&&(this.buffer+=h3);}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`;}},hk=(t={})=>{let e={children:[]};return Object.assign(e,t),e},Ia=class{constructor(){this.rootNode=hk(),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 r=hk({scope:e});this.add(r),this.stack.push(r);}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,r){return typeof r=="string"?e.addText(r):r.children&&(e.openNode(r),r.children.forEach(n=>this._walk(e,n)),e.closeNode(r)),e}static _collapse(e){typeof e!="string"&&e.children&&(e.children.every(r=>typeof r=="string")?e.children=[e.children.join("")]:e.children.forEach(r=>{Ia._collapse(r);}));}},om=class extends Ia{constructor(e){super(),this.options=e;}addText(e){e!==""&&this.add(e);}startScope(e){this.openNode(e);}endScope(){this.closeNode();}__addSublanguage(e,r){let n=e.root;r&&(n.scope=`language:${r}`),this.add(n);}toHTML(){return new nm(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function La(t){return t?typeof t=="string"?t:t.source:null}function xk(t){return hi("(?=",t,")")}function g3(t){return hi("(?:",t,")*")}function b3(t){return hi("(?:",t,")?")}function hi(...t){return t.map(r=>La(r)).join("")}function v3(t){let e=t[t.length-1];return typeof e=="object"&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}function sm(...t){return "("+(v3(t).capture?"":"?:")+t.map(n=>La(n)).join("|")+")"}function Ek(t){return new RegExp(t.toString()+"|").exec("").length-1}function y3(t,e){let r=t&&t.exec(e);return r&&r.index===0}var w3=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function am(t,{joinWith:e}){let r=0;return t.map(n=>{r+=1;let o=r,i=La(n),s="";for(;i.length>0;){let a=w3.exec(i);if(!a){s+=i;break}s+=i.substring(0,a.index),i=i.substring(a.index+a[0].length),a[0][0]==="\\"&&a[1]?s+="\\"+String(Number(a[1])+o):(s+=a[0],a[0]==="("&&r++);}return s}).map(n=>`(${n})`).join(e)}var x3=/\b\B/,kk="[a-zA-Z]\\w*",lm="[a-zA-Z_]\\w*",Sk="\\b\\d+(\\.\\d+)?",Ck="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Rk="\\b(0b[01]+)",E3="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",k3=(t={})=>{let e=/^#![ ]*\//;return t.binary&&(t.begin=hi(e,/.*\b/,t.binary,/\b.*/)),bo({scope:"meta",begin:e,end:/$/,relevance:0,"on:begin":(r,n)=>{r.index!==0&&n.ignoreMatch();}},t)},$a={begin:"\\\\[\\s\\S]",relevance:0},S3={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[$a]},C3={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[$a]},R3={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/},_d=function(t,e,r={}){let n=bo({scope:"comment",begin:t,end:e,contains:[]},r);n.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 o=sm("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 n.contains.push({begin:hi(/[ ]+/,"(",o,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),n},T3=_d("//","$"),N3=_d("/\\*","\\*/"),_3=_d("#","$"),M3={scope:"number",begin:Sk,relevance:0},A3={scope:"number",begin:Ck,relevance:0},O3={scope:"number",begin:Rk,relevance:0},D3={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[$a,{begin:/\[/,end:/\]/,relevance:0,contains:[$a]}]},P3={scope:"title",begin:kk,relevance:0},I3={scope:"title",begin:lm,relevance:0},L3={begin:"\\.\\s*"+lm,relevance:0},$3=function(t){return Object.assign(t,{"on:begin":(e,r)=>{r.data._beginMatch=e[1];},"on:end":(e,r)=>{r.data._beginMatch!==e[1]&&r.ignoreMatch();}})},Rd=Object.freeze({__proto__:null,APOS_STRING_MODE:S3,BACKSLASH_ESCAPE:$a,BINARY_NUMBER_MODE:O3,BINARY_NUMBER_RE:Rk,COMMENT:_d,C_BLOCK_COMMENT_MODE:N3,C_LINE_COMMENT_MODE:T3,C_NUMBER_MODE:A3,C_NUMBER_RE:Ck,END_SAME_AS_BEGIN:$3,HASH_COMMENT_MODE:_3,IDENT_RE:kk,MATCH_NOTHING_RE:x3,METHOD_GUARD:L3,NUMBER_MODE:M3,NUMBER_RE:Sk,PHRASAL_WORDS_MODE:R3,QUOTE_STRING_MODE:C3,REGEXP_MODE:D3,RE_STARTERS_RE:E3,SHEBANG:k3,TITLE_MODE:P3,UNDERSCORE_IDENT_RE:lm,UNDERSCORE_TITLE_MODE:I3});function B3(t,e){t.input[t.index-1]==="."&&e.ignoreMatch();}function F3(t,e){t.className!==void 0&&(t.scope=t.className,delete t.className);}function z3(t,e){e&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=B3,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0));}function H3(t,e){Array.isArray(t.illegal)&&(t.illegal=sm(...t.illegal));}function U3(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 V3(t,e){t.relevance===void 0&&(t.relevance=1);}var K3=(t,e)=>{if(!t.beforeMatch)return;if(t.starts)throw new Error("beforeMatch cannot be used with starts");let r=Object.assign({},t);Object.keys(t).forEach(n=>{delete t[n];}),t.keywords=r.keywords,t.begin=hi(r.beforeMatch,xk(r.begin)),t.starts={relevance:0,contains:[Object.assign(r,{endsParent:!0})]},t.relevance=0,delete r.beforeMatch;},W3=["of","and","for","in","not","or","if","then","parent","list","value"],G3="keyword";function Tk(t,e,r=G3){let n=Object.create(null);return typeof t=="string"?o(r,t.split(" ")):Array.isArray(t)?o(r,t):Object.keys(t).forEach(function(i){Object.assign(n,Tk(t[i],e,i));}),n;function o(i,s){e&&(s=s.map(a=>a.toLowerCase())),s.forEach(function(a){let l=a.split("|");n[l[0]]=[i,q3(l[0],l[1])];});}}function q3(t,e){return e?Number(e):j3(t)?0:1}function j3(t){return W3.includes(t.toLowerCase())}var mk={},pi=t=>{console.error(t);},gk=(t,...e)=>{console.log(`WARN: ${t}`,...e);},ps=(t,e)=>{mk[`${t}/${e}`]||(console.log(`Deprecated as of ${t}. ${e}`),mk[`${t}/${e}`]=!0);},Nd=new Error;function Nk(t,e,{key:r}){let n=0,o=t[r],i={},s={};for(let a=1;a<=e.length;a++)s[a+n]=o[a],i[a+n]=!0,n+=Ek(e[a-1]);t[r]=s,t[r]._emit=i,t[r]._multi=!0;}function Y3(t){if(Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw pi("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Nd;if(typeof t.beginScope!="object"||t.beginScope===null)throw pi("beginScope must be object"),Nd;Nk(t,t.begin,{key:"beginScope"}),t.begin=am(t.begin,{joinWith:""});}}function X3(t){if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw pi("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Nd;if(typeof t.endScope!="object"||t.endScope===null)throw pi("endScope must be object"),Nd;Nk(t,t.end,{key:"endScope"}),t.end=am(t.end,{joinWith:""});}}function J3(t){t.scope&&typeof t.scope=="object"&&t.scope!==null&&(t.beginScope=t.scope,delete t.scope);}function Z3(t){J3(t),typeof t.beginScope=="string"&&(t.beginScope={_wrap:t.beginScope}),typeof t.endScope=="string"&&(t.endScope={_wrap:t.endScope}),Y3(t),X3(t);}function Q3(t){function e(s,a){return new RegExp(La(s),"m"+(t.case_insensitive?"i":"")+(t.unicodeRegex?"u":"")+(a?"g":""))}class r{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0;}addRule(a,l){l.position=this.position++,this.matchIndexes[this.matchAt]=l,this.regexes.push([l,a]),this.matchAt+=Ek(a)+1;}compile(){this.regexes.length===0&&(this.exec=()=>null);let a=this.regexes.map(l=>l[1]);this.matcherRe=e(am(a,{joinWith:"|"}),!0),this.lastIndex=0;}exec(a){this.matcherRe.lastIndex=this.lastIndex;let l=this.matcherRe.exec(a);if(!l)return null;let c=l.findIndex((u,f)=>f>0&&u!==void 0),d=this.matchIndexes[c];return l.splice(0,c),Object.assign(l,d)}}class n{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0;}getMatcher(a){if(this.multiRegexes[a])return this.multiRegexes[a];let l=new r;return this.rules.slice(a).forEach(([c,d])=>l.addRule(c,d)),l.compile(),this.multiRegexes[a]=l,l}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0;}addRule(a,l){this.rules.push([a,l]),l.type==="begin"&&this.count++;}exec(a){let l=this.getMatcher(this.regexIndex);l.lastIndex=this.lastIndex;let c=l.exec(a);if(this.resumingScanAtSamePosition()&&!(c&&c.index===this.lastIndex)){let d=this.getMatcher(0);d.lastIndex=this.lastIndex+1,c=d.exec(a);}return c&&(this.regexIndex+=c.position+1,this.regexIndex===this.count&&this.considerAll()),c}}function o(s){let a=new n;return s.contains.forEach(l=>a.addRule(l.begin,{rule:l,type:"begin"})),s.terminatorEnd&&a.addRule(s.terminatorEnd,{type:"end"}),s.illegal&&a.addRule(s.illegal,{type:"illegal"}),a}function i(s,a){let l=s;if(s.isCompiled)return l;[F3,U3,Z3,K3].forEach(d=>d(s,a)),t.compilerExtensions.forEach(d=>d(s,a)),s.__beforeBegin=null,[z3,H3,V3].forEach(d=>d(s,a)),s.isCompiled=!0;let c=null;return typeof s.keywords=="object"&&s.keywords.$pattern&&(s.keywords=Object.assign({},s.keywords),c=s.keywords.$pattern,delete s.keywords.$pattern),c=c||/\w+/,s.keywords&&(s.keywords=Tk(s.keywords,t.case_insensitive)),l.keywordPatternRe=e(c,!0),a&&(s.begin||(s.begin=/\B|\b/),l.beginRe=e(l.begin),!s.end&&!s.endsWithParent&&(s.end=/\B|\b/),s.end&&(l.endRe=e(l.end)),l.terminatorEnd=La(l.end)||"",s.endsWithParent&&a.terminatorEnd&&(l.terminatorEnd+=(s.end?"|":"")+a.terminatorEnd)),s.illegal&&(l.illegalRe=e(s.illegal)),s.contains||(s.contains=[]),s.contains=[].concat(...s.contains.map(function(d){return e4(d==="self"?s:d)})),s.contains.forEach(function(d){i(d,l);}),s.starts&&i(s.starts,a),l.matcher=o(l),l}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=bo(t.classNameAliases||{}),i(t)}function _k(t){return t?t.endsWithParent||_k(t.starts):!1}function e4(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(e){return bo(t,{variants:null},e)})),t.cachedVariants?t.cachedVariants:_k(t)?bo(t,{starts:t.starts?bo(t.starts):null}):Object.isFrozen(t)?bo(t):t}var t4="11.11.1",im=class extends Error{constructor(e,r){super(e),this.name="HTMLInjectionError",this.html=r;}},rm=wk,bk=bo,vk=Symbol("nomatch"),r4=7,Mk=function(t){let e=Object.create(null),r=Object.create(null),n=[],o=!0,i="Could not find the language '{}', did you forget to load/include a language module?",s={disableAutodetect:!0,name:"Plain text",contains:[]},a={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:om};function l(C){return a.noHighlightRe.test(C)}function c(C){let T=C.className+" ";T+=C.parentNode?C.parentNode.className:"";let _=a.languageDetectRe.exec(T);if(_){let A=w(_[1]);return A||(gk(i.replace("{}",_[1])),gk("Falling back to no-highlight mode for this block.",C)),A?_[1]:"no-highlight"}return T.split(/\s+/).find(A=>l(A)||w(A))}function d(C,T,_){let A="",L="";typeof T=="object"?(A=C,_=T.ignoreIllegals,L=T.language):(ps("10.7.0","highlight(lang, code, ...args) has been deprecated."),ps("10.7.0",`Please use highlight(code, options) instead.
|
|
45
|
+
https://github.com/highlightjs/highlight.js/issues/2277`),L=C,A=T),_===void 0&&(_=!0);let Y={code:A,language:L};P("before:highlight",Y);let te=Y.result?Y.result:u(Y.language,Y.code,_);return te.code=Y.code,P("after:highlight",te),te}function u(C,T,_,A){let L=Object.create(null);function Y($,j){return $.keywords[j]}function te(){if(!D.keywords){ce.addText(ne);return}let $=0;D.keywordPatternRe.lastIndex=0;let j=D.keywordPatternRe.exec(ne),ve="";for(;j;){ve+=ne.substring($,j.index);let De=nt.case_insensitive?j[0].toLowerCase():j[0],Ct=Y(D,De);if(Ct){let[Lr,Mt]=Ct;if(ce.addText(ve),ve="",L[De]=(L[De]||0)+1,L[De]<=r4&&($t+=Mt),Lr.startsWith("_"))ve+=j[0];else {let vn=nt.classNameAliases[Lr]||Lr;Te(j[0],vn);}}else ve+=j[0];$=D.keywordPatternRe.lastIndex,j=D.keywordPatternRe.exec(ne);}ve+=ne.substring($),ce.addText(ve);}function ke(){if(ne==="")return;let $=null;if(typeof D.subLanguage=="string"){if(!e[D.subLanguage]){ce.addText(ne);return}$=u(D.subLanguage,ne,!0,re[D.subLanguage]),re[D.subLanguage]=$._top;}else $=p(ne,D.subLanguage.length?D.subLanguage:null);D.relevance>0&&($t+=$.relevance),ce.__addSublanguage($._emitter,$.language);}function me(){D.subLanguage!=null?ke():te(),ne="";}function Te($,j){$!==""&&(ce.startScope(j),ce.addText($),ce.endScope());}function Ae($,j){let ve=1,De=j.length-1;for(;ve<=De;){if(!$._emit[ve]){ve++;continue}let Ct=nt.classNameAliases[$[ve]]||$[ve],Lr=j[ve];Ct?Te(Lr,Ct):(ne=Lr,te(),ne=""),ve++;}}function W($,j){return $.scope&&typeof $.scope=="string"&&ce.openNode(nt.classNameAliases[$.scope]||$.scope),$.beginScope&&($.beginScope._wrap?(Te(ne,nt.classNameAliases[$.beginScope._wrap]||$.beginScope._wrap),ne=""):$.beginScope._multi&&(Ae($.beginScope,j),ne="")),D=Object.create($,{parent:{value:D}}),D}function ue($,j,ve){let De=y3($.endRe,ve);if(De){if($["on:end"]){let Ct=new Td($);$["on:end"](j,Ct),Ct.isMatchIgnored&&(De=!1);}if(De){for(;$.endsParent&&$.parent;)$=$.parent;return $}}if($.endsWithParent)return ue($.parent,j,ve)}function Oe($){return D.matcher.regexIndex===0?(ne+=$[0],1):(G=!0,0)}function Se($){let j=$[0],ve=$.rule,De=new Td(ve),Ct=[ve.__beforeBegin,ve["on:begin"]];for(let Lr of Ct)if(Lr&&(Lr($,De),De.isMatchIgnored))return Oe(j);return ve.skip?ne+=j:(ve.excludeBegin&&(ne+=j),me(),!ve.returnBegin&&!ve.excludeBegin&&(ne=j)),W(ve,$),ve.returnBegin?0:j.length}function le($){let j=$[0],ve=T.substring($.index),De=ue(D,$,ve);if(!De)return vk;let Ct=D;D.endScope&&D.endScope._wrap?(me(),Te(j,D.endScope._wrap)):D.endScope&&D.endScope._multi?(me(),Ae(D.endScope,$)):Ct.skip?ne+=j:(Ct.returnEnd||Ct.excludeEnd||(ne+=j),me(),Ct.excludeEnd&&(ne=j));do D.scope&&ce.closeNode(),!D.skip&&!D.subLanguage&&($t+=D.relevance),D=D.parent;while(D!==De.parent);return De.starts&&W(De.starts,$),Ct.returnEnd?0:j.length}function Ce(){let $=[];for(let j=D;j!==nt;j=j.parent)j.scope&&$.unshift(j.scope);$.forEach(j=>ce.openNode(j));}let $e={};function Ke($,j){let ve=j&&j[0];if(ne+=$,ve==null)return me(),0;if($e.type==="begin"&&j.type==="end"&&$e.index===j.index&&ve===""){if(ne+=T.slice(j.index,j.index+1),!o){let De=new Error(`0 width match regex (${C})`);throw De.languageName=C,De.badRule=$e.rule,De}return 1}if($e=j,j.type==="begin")return Se(j);if(j.type==="illegal"&&!_){let De=new Error('Illegal lexeme "'+ve+'" for mode "'+(D.scope||"<unnamed>")+'"');throw De.mode=D,De}else if(j.type==="end"){let De=le(j);if(De!==vk)return De}if(j.type==="illegal"&&ve==="")return ne+=`
|
|
46
|
+
`,1;if(Es>1e5&&Es>j.index*3)throw new Error("potential infinite loop, way more iterations than matches");return ne+=ve,ve.length}let nt=w(C);if(!nt)throw pi(i.replace("{}",C)),new Error('Unknown language: "'+C+'"');let Re=Q3(nt),wt="",D=A||Re,re={},ce=new a.__emitter(a);Ce();let ne="",$t=0,pr=0,Es=0,G=!1;try{if(nt.__emitTokens)nt.__emitTokens(T,ce);else {for(D.matcher.considerAll();;){Es++,G?G=!1:D.matcher.considerAll(),D.matcher.lastIndex=pr;let $=D.matcher.exec(T);if(!$)break;let j=T.substring(pr,$.index),ve=Ke(j,$);pr=$.index+ve;}Ke(T.substring(pr));}return ce.finalize(),wt=ce.toHTML(),{language:C,value:wt,relevance:$t,illegal:!1,_emitter:ce,_top:D}}catch($){if($.message&&$.message.includes("Illegal"))return {language:C,value:rm(T),illegal:!0,relevance:0,_illegalBy:{message:$.message,index:pr,context:T.slice(pr-100,pr+100),mode:$.mode,resultSoFar:wt},_emitter:ce};if(o)return {language:C,value:rm(T),illegal:!1,relevance:0,errorRaised:$,_emitter:ce,_top:D};throw $}}function f(C){let T={value:rm(C),illegal:!1,relevance:0,_top:s,_emitter:new a.__emitter(a)};return T._emitter.addText(C),T}function p(C,T){T=T||a.languages||Object.keys(e);let _=f(C),A=T.filter(w).filter(M).map(me=>u(me,C,!1));A.unshift(_);let L=A.sort((me,Te)=>{if(me.relevance!==Te.relevance)return Te.relevance-me.relevance;if(me.language&&Te.language){if(w(me.language).supersetOf===Te.language)return 1;if(w(Te.language).supersetOf===me.language)return -1}return 0}),[Y,te]=L,ke=Y;return ke.secondBest=te,ke}function h(C,T,_){let A=T&&r[T]||_;C.classList.add("hljs"),C.classList.add(`language-${A}`);}function m(C){let T=null,_=c(C);if(l(_))return;if(P("before:highlightElement",{el:C,language:_}),C.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",C);return}if(C.children.length>0&&(a.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(C)),a.throwUnescapedHTML))throw new im("One of your code blocks includes unescaped HTML.",C.innerHTML);T=C;let A=T.textContent,L=_?d(A,{language:_,ignoreIllegals:!0}):p(A);C.innerHTML=L.value,C.dataset.highlighted="yes",h(C,_,L.language),C.result={language:L.language,re:L.relevance,relevance:L.relevance},L.secondBest&&(C.secondBest={language:L.secondBest.language,relevance:L.secondBest.relevance}),P("after:highlightElement",{el:C,result:L,text:A});}function g(C){a=bk(a,C);}let b=()=>{x(),ps("10.6.0","initHighlighting() deprecated. Use highlightAll() now.");};function v(){x(),ps("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.");}let y=!1;function x(){function C(){x();}if(document.readyState==="loading"){y||window.addEventListener("DOMContentLoaded",C,!1),y=!0;return}document.querySelectorAll(a.cssSelector).forEach(m);}function E(C,T){let _=null;try{_=T(t);}catch(A){if(pi("Language definition for '{}' could not be registered.".replace("{}",C)),o)pi(A);else throw A;_=s;}_.name||(_.name=C),e[C]=_,_.rawDefinition=T.bind(null,t),_.aliases&&N(_.aliases,{languageName:C});}function S(C){delete e[C];for(let T of Object.keys(r))r[T]===C&&delete r[T];}function R(){return Object.keys(e)}function w(C){return C=(C||"").toLowerCase(),e[C]||e[r[C]]}function N(C,{languageName:T}){typeof C=="string"&&(C=[C]),C.forEach(_=>{r[_.toLowerCase()]=T;});}function M(C){let T=w(C);return T&&!T.disableAutodetect}function B(C){C["before:highlightBlock"]&&!C["before:highlightElement"]&&(C["before:highlightElement"]=T=>{C["before:highlightBlock"](Object.assign({block:T.el},T));}),C["after:highlightBlock"]&&!C["after:highlightElement"]&&(C["after:highlightElement"]=T=>{C["after:highlightBlock"](Object.assign({block:T.el},T));});}function U(C){B(C),n.push(C);}function K(C){let T=n.indexOf(C);T!==-1&&n.splice(T,1);}function P(C,T){let _=C;n.forEach(function(A){A[_]&&A[_](T);});}function V(C){return ps("10.7.0","highlightBlock will be removed entirely in v12.0"),ps("10.7.0","Please use highlightElement now."),m(C)}Object.assign(t,{highlight:d,highlightAuto:p,highlightAll:x,highlightElement:m,highlightBlock:V,configure:g,initHighlighting:b,initHighlightingOnLoad:v,registerLanguage:E,unregisterLanguage:S,listLanguages:R,getLanguage:w,registerAliases:N,autoDetection:M,inherit:bk,addPlugin:U,removePlugin:K}),t.debugMode=function(){o=!1;},t.safeMode=function(){o=!0;},t.versionString=t4,t.regex={concat:hi,lookahead:xk,either:sm,optional:b3,anyNumberOfTimes:g3};for(let C in Rd)typeof Rd[C]=="object"&&yk(Rd[C]);return Object.assign(t,Rd),t},hs=Mk({});hs.newInstance=()=>Mk({});Ak.exports=hs;hs.HighlightJS=hs;hs.default=hs;});function ko(t,{insertAt:e}={}){if(!t||typeof document>"u")return;let r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",e==="top"&&r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n),n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t));}ko(`*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:var(--font-sans);font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--font-mono);font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type="button"]),input:where([type="reset"]),input:where([type="submit"]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden="until-found"])){display:none}:root{--bg-base: var(--background);--bg-subtle: var(--gray-50);--bg-muted: var(--gray-100);--bg-emphasis: var(--gray-200);--bg-inverse: var(--foreground);--surface-base: var(--background);--surface-overlay: var(--gray-50);--surface-raised: var(--background);--surface-sunken: var(--gray-100);--text-primary: var(--foreground);--text-secondary: var(--gray-600);--text-tertiary: var(--gray-500);--text-disabled: var(--gray-400);--text-inverse: var(--background);--text-link: var(--primary);--text-link-hover: var(--primary-hover);--brand-primary: var(--primary);--brand-primary-hover: var(--primary-hover);--brand-primary-active: var(--primary-active);--brand-secondary: var(--secondary);--state-hover: var(--gray-100);--state-active: var(--gray-200);--state-selected: var(--primary);--state-disabled: var(--gray-300);--state-focus: var(--primary);--feedback-success: var(--success);--feedback-success-light: 142 71% 95%;--feedback-success-dark: 142 71% 35%;--feedback-warning: var(--warning);--feedback-warning-light: 38 92% 95%;--feedback-warning-dark: 38 92% 40%;--feedback-error: var(--error);--feedback-error-light: 0 84% 95%;--feedback-error-dark: 0 84% 50%;--feedback-info: 217 91% 60%;--feedback-info-light: 217 91% 95%;--feedback-info-dark: 217 91% 50%;--border-default: var(--border);--border-subtle: var(--gray-200);--border-strong: var(--gray-400);--border-interactive: var(--primary);--border-error: var(--error);--border-success: var(--success);--border-warning: var(--warning);--shadow-xs: 0 1px 2px 0 rgb(0 0 0 / .05);--shadow-sm: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--shadow-md: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--shadow-lg: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--shadow-xl: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / .25);--shadow-primary: 0 4px 14px 0 hsl(var(--primary) / .3);--shadow-success: 0 4px 14px 0 hsl(var(--success) / .3);--shadow-error: 0 4px 14px 0 hsl(var(--error) / .3);--shadow-warning: 0 4px 14px 0 hsl(var(--warning) / .3);--shadow-inner-xs: inset 0 1px 2px 0 rgb(0 0 0 / .05);--shadow-inner-sm: inset 0 2px 4px 0 rgb(0 0 0 / .05);--shadow-inner-md: inset 0 4px 6px -1px rgb(0 0 0 / .1);--ease-linear: linear;--ease-in: cubic-bezier(.4, 0, 1, 1);--ease-out: cubic-bezier(0, 0, .2, 1);--ease-in-out: cubic-bezier(.4, 0, .2, 1);--ease-bounce: cubic-bezier(.68, -.55, .265, 1.55);--ease-elastic: cubic-bezier(.68, -.55, .265, 1.55);--ease-back-in: cubic-bezier(.6, -.28, .735, .045);--ease-back-out: cubic-bezier(.175, .885, .32, 1.275);--ease-back-in-out: cubic-bezier(.68, -.55, .265, 1.55);--duration-instant: 0ms;--duration-fast: .15s;--duration-normal: .25s;--duration-slow: .35s;--duration-slower: .5s;--duration-slowest: .75s;--space-0: 0;--space-px: 1px;--space-0\\.5: .125rem;--space-1: .25rem;--space-1\\.5: .375rem;--space-2: .5rem;--space-2\\.5: .625rem;--space-3: .75rem;--space-3\\.5: .875rem;--space-4: 1rem;--space-5: 1.25rem;--space-6: 1.5rem;--space-7: 1.75rem;--space-8: 2rem;--space-9: 2.25rem;--space-10: 2.5rem;--space-11: 2.75rem;--space-12: 3rem;--space-14: 3.5rem;--space-16: 4rem;--space-20: 5rem;--space-24: 6rem;--space-28: 7rem;--space-32: 8rem;--space-36: 9rem;--space-40: 10rem;--space-44: 11rem;--space-48: 12rem;--space-52: 13rem;--space-56: 14rem;--space-60: 15rem;--space-64: 16rem;--space-72: 18rem;--space-80: 20rem;--space-96: 24rem;--text-2xs: .625rem;--text-xs: .75rem;--text-sm: .875rem;--text-base: 1rem;--text-lg: 1.125rem;--text-xl: 1.25rem;--text-2xl: 1.5rem;--text-3xl: 1.875rem;--text-4xl: 2.25rem;--text-5xl: 3rem;--text-6xl: 3.75rem;--text-7xl: 4.5rem;--text-8xl: 6rem;--text-9xl: 8rem;--leading-none: 1;--leading-tight: 1.25;--leading-snug: 1.375;--leading-normal: 1.5;--leading-relaxed: 1.625;--leading-loose: 2;--tracking-tighter: -.05em;--tracking-tight: -.025em;--tracking-normal: 0;--tracking-wide: .025em;--tracking-wider: .05em;--tracking-widest: .1em;--font-thin: 100;--font-extralight: 200;--font-light: 300;--font-normal: 400;--font-medium: 500;--font-semibold: 600;--font-bold: 700;--font-extrabold: 800;--font-black: 900;--radius-none: 0;--radius-sm: .125rem;--radius-base: .25rem;--radius-md: .375rem;--radius-lg: .5rem;--radius-xl: .75rem;--radius-2xl: 1rem;--radius-3xl: 1.5rem;--radius-full: 9999px;--z-0: 0;--z-10: 10;--z-20: 20;--z-30: 30;--z-40: 40;--z-50: 50;--z-dropdown: 1000;--z-sticky: 1020;--z-fixed: 1030;--z-modal-backdrop: 1040;--z-modal: 1050;--z-popover: 1060;--z-tooltip: 1070;--z-notification: 1080;--blur-none: 0;--blur-sm: 4px;--blur-base: 8px;--blur-md: 12px;--blur-lg: 16px;--blur-xl: 24px;--blur-2xl: 40px;--blur-3xl: 64px}.dark{--bg-base: var(--background);--bg-subtle: var(--gray-800);--bg-muted: var(--gray-700);--bg-emphasis: var(--gray-600);--surface-overlay: var(--gray-800);--surface-raised: var(--gray-800);--surface-sunken: var(--background);--text-secondary: var(--gray-400);--text-tertiary: var(--gray-500);--text-disabled: var(--gray-600);--state-hover: var(--gray-700);--state-active: var(--gray-600);--shadow-xs: 0 1px 2px 0 rgb(0 0 0 / .3);--shadow-sm: 0 1px 3px 0 rgb(0 0 0 / .4), 0 1px 2px -1px rgb(0 0 0 / .3);--shadow-md: 0 4px 6px -1px rgb(0 0 0 / .4), 0 2px 4px -2px rgb(0 0 0 / .3);--shadow-lg: 0 10px 15px -3px rgb(0 0 0 / .4), 0 4px 6px -4px rgb(0 0 0 / .3);--shadow-xl: 0 20px 25px -5px rgb(0 0 0 / .4), 0 8px 10px -6px rgb(0 0 0 / .3);--shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / .5)}.container{width:100%;margin-right:auto;margin-left:auto;padding-right:1rem;padding-left:1rem}@media (min-width: 640px){.container{max-width:640px;padding-right:2rem;padding-left:2rem}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px;padding-right:4rem;padding-left:4rem}}@media (min-width: 1280px){.container{max-width:1280px;padding-right:5rem;padding-left:5rem}}@media (min-width: 1536px){.container{max-width:1536px;padding-right:6rem;padding-left:6rem}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.visible{visibility:visible}.collapse{visibility:collapse}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{inset:0}.bottom-2{bottom:.5rem}.bottom-\\[5\\%\\]{bottom:5%}.left-2{left:.5rem}.left-3{left:.75rem}.left-4{left:1rem}.left-\\[50\\%\\]{left:50%}.right-1{right:.25rem}.right-2{right:.5rem}.right-3{right:.75rem}.right-4{right:1rem}.top-0{top:0}.top-1{top:.25rem}.top-2{top:.5rem}.top-2\\.5{top:.625rem}.top-4{top:1rem}.top-\\[5\\%\\]{top:5%}.top-\\[50\\%\\]{top:50%}.top-auto{top:auto}.z-0{z-index:0}.z-10{z-index:10}.z-40{z-index:40}.z-50{z-index:50}.z-\\[100\\]{z-index:100}.col-span-1{grid-column:span 1 / span 1}.col-span-2{grid-column:span 2 / span 2}.col-span-3{grid-column:span 3 / span 3}.col-span-4{grid-column:span 4 / span 4}.-m-2{margin:-.5rem}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.-mx-4{margin-left:-1rem;margin-right:-1rem}.mx-1{margin-left:.25rem;margin-right:.25rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:.25rem;margin-bottom:.25rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.-mb-4{margin-bottom:-1rem}.-mr-1{margin-right:-.25rem}.-mt-4{margin-top:-1rem}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-8{margin-bottom:2rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-auto{margin-left:auto}.mr-1{margin-right:.25rem}.mr-2{margin-right:.5rem}.mr-auto{margin-right:auto}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-6{margin-top:1.5rem}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.\\!table{display:table!important}.table{display:table}.grid{display:grid}.hidden{display:none}.aspect-square{aspect-ratio:1 / 1}.h-0{height:0px}.h-1\\.5{height:.375rem}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-12{height:3rem}.h-14{height:3.5rem}.h-16{height:4rem}.h-2{height:.5rem}.h-20{height:5rem}.h-24{height:6rem}.h-3{height:.75rem}.h-3\\.5{height:.875rem}.h-32{height:8rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-96{height:24rem}.h-\\[0\\.5px\\]{height:.5px}.h-\\[1px\\]{height:1px}.h-\\[2px\\]{height:2px}.h-\\[65\\%\\]{height:65%}.h-\\[var\\(--radix-select-trigger-height\\)\\]{height:var(--radix-select-trigger-height)}.h-auto{height:auto}.h-fit{height:-moz-fit-content;height:fit-content}.h-full{height:100%}.h-px{height:1px}.max-h-96{max-height:24rem}.max-h-\\[95vh\\]{max-height:95vh}.max-h-screen{max-height:100vh}.min-h-\\[200px\\]{min-height:200px}.min-h-\\[80px\\]{min-height:80px}.w-0{width:0px}.w-0\\.5{width:.125rem}.w-1\\/4{width:25%}.w-10{width:2.5rem}.w-11{width:2.75rem}.w-12{width:3rem}.w-14{width:3.5rem}.w-16{width:4rem}.w-2{width:.5rem}.w-20{width:5rem}.w-3{width:.75rem}.w-3\\.5{width:.875rem}.w-4{width:1rem}.w-48{width:12rem}.w-5{width:1.25rem}.w-56{width:14rem}.w-6{width:1.5rem}.w-64{width:16rem}.w-72{width:18rem}.w-8{width:2rem}.w-80{width:20rem}.w-96{width:24rem}.w-\\[0\\.5px\\]{width:.5px}.w-\\[100px\\]{width:100px}.w-\\[1px\\]{width:1px}.w-\\[2px\\]{width:2px}.w-\\[65\\%\\]{width:65%}.w-\\[70px\\]{width:70px}.w-auto{width:auto}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.w-px{width:1px}.min-w-0{min-width:0px}.min-w-\\[70px\\]{min-width:70px}.min-w-\\[8rem\\]{min-width:8rem}.min-w-\\[var\\(--radix-select-trigger-width\\)\\]{min-width:var(--radix-select-trigger-width)}.max-w-2xl{max-width:42rem}.max-w-4xl{max-width:56rem}.max-w-\\[95vw\\]{max-width:95vw}.max-w-full{max-width:100%}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.max-w-none{max-width:none}.max-w-sm{max-width:24rem}.max-w-xs{max-width:20rem}.flex-1{flex:1 1 0%}.flex-shrink-0,.shrink-0{flex-shrink:0}.grow{flex-grow:1}.translate-x-\\[-50\\%\\]{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-0{--tw-translate-y: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-\\[-50\\%\\]{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-2{--tw-rotate: 2deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-\\[-15deg\\]{--tw-rotate: -15deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-\\[15deg\\]{--tw-rotate: 15deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-105{--tw-scale-x: 1.05;--tw-scale-y: 1.05;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-95{--tw-scale-x: .95;--tw-scale-y: .95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes pulse{50%{opacity:.5}}.cursor-default{cursor:default}.cursor-grab{cursor:grab}.cursor-help{cursor:help}.cursor-move{cursor:move}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.cursor-text{cursor:text}.cursor-wait{cursor:wait}.touch-none{touch-action:none}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize-none{resize:none}.resize{resize:both}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.grid-cols-7{grid-template-columns:repeat(7,minmax(0,1fr))}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-1\\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.gap-8{gap:2rem}.space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.25rem * var(--tw-space-x-reverse));margin-left:calc(.25rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-6>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1.5rem * var(--tw-space-x-reverse));margin-left:calc(1.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-0>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(0px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0px * var(--tw-space-y-reverse))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-3xl{border-radius:1.5rem}.rounded-\\[inherit\\]{border-radius:inherit}.rounded-\\[var\\(--login-border-radius\\)\\]{border-radius:var(--login-border-radius)}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-none{border-radius:0}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:.75rem}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-l{border-left-width:1px}.border-l-0{border-left-width:0px}.border-l-2{border-left-width:2px}.border-l-4{border-left-width:4px}.border-l-\\[0\\.5px\\]{border-left-width:.5px}.border-r-0{border-right-width:0px}.border-t{border-top-width:1px}.border-t-0{border-top-width:0px}.border-t-2{border-top-width:2px}.border-t-\\[0\\.5px\\]{border-top-width:.5px}.border-dashed{border-style:dashed}.border-dotted{border-style:dotted}.border-none{border-style:none}.border-accent{--tw-border-opacity: 1;border-color:hsl(var(--accent) / var(--tw-border-opacity, 1))}.border-blue-200{--tw-border-opacity: 1;border-color:rgb(191 219 254 / var(--tw-border-opacity, 1))}.border-blue-500{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.border-blue-600{--tw-border-opacity: 1;border-color:rgb(37 99 235 / var(--tw-border-opacity, 1))}.border-border{--tw-border-opacity: 1;border-color:hsl(var(--border) / var(--tw-border-opacity, 1))}.border-border\\/50{border-color:hsl(var(--border) / .5)}.border-destructive{--tw-border-opacity: 1;border-color:hsl(var(--destructive) / var(--tw-border-opacity, 1))}.border-error{--tw-border-opacity: 1;border-color:hsl(var(--error) / var(--tw-border-opacity, 1))}.border-error\\/20{border-color:hsl(var(--error) / .2)}.border-foreground{--tw-border-opacity: 1;border-color:hsl(var(--foreground) / var(--tw-border-opacity, 1))}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.border-gray-400{--tw-border-opacity: 1;border-color:rgb(156 163 175 / var(--tw-border-opacity, 1))}.border-green-200{--tw-border-opacity: 1;border-color:rgb(187 247 208 / var(--tw-border-opacity, 1))}.border-green-500{--tw-border-opacity: 1;border-color:rgb(34 197 94 / var(--tw-border-opacity, 1))}.border-green-600{--tw-border-opacity: 1;border-color:rgb(22 163 74 / var(--tw-border-opacity, 1))}.border-input{--tw-border-opacity: 1;border-color:hsl(var(--input) / var(--tw-border-opacity, 1))}.border-muted{--tw-border-opacity: 1;border-color:hsl(var(--muted) / var(--tw-border-opacity, 1))}.border-muted-foreground\\/25{border-color:hsl(var(--muted-foreground) / .25)}.border-orange-200{--tw-border-opacity: 1;border-color:rgb(254 215 170 / var(--tw-border-opacity, 1))}.border-primary{--tw-border-opacity: 1;border-color:hsl(var(--primary) / var(--tw-border-opacity, 1))}.border-primary\\/20{border-color:hsl(var(--primary) / .2)}.border-primary\\/50{border-color:hsl(var(--primary) / .5)}.border-red-200{--tw-border-opacity: 1;border-color:rgb(254 202 202 / var(--tw-border-opacity, 1))}.border-red-500{--tw-border-opacity: 1;border-color:rgb(239 68 68 / var(--tw-border-opacity, 1))}.border-secondary{--tw-border-opacity: 1;border-color:hsl(var(--secondary) / var(--tw-border-opacity, 1))}.border-success{--tw-border-opacity: 1;border-color:hsl(var(--success) / var(--tw-border-opacity, 1))}.border-success\\/40{border-color:hsl(var(--success) / .4)}.border-transparent{border-color:transparent}.border-warning{--tw-border-opacity: 1;border-color:hsl(var(--warning) / var(--tw-border-opacity, 1))}.border-white\\/20{border-color:#fff3}.border-yellow-200{--tw-border-opacity: 1;border-color:rgb(254 240 138 / var(--tw-border-opacity, 1))}.border-yellow-500{--tw-border-opacity: 1;border-color:rgb(234 179 8 / var(--tw-border-opacity, 1))}.border-yellow-600{--tw-border-opacity: 1;border-color:rgb(202 138 4 / var(--tw-border-opacity, 1))}.border-t-primary{--tw-border-opacity: 1;border-top-color:hsl(var(--primary) / var(--tw-border-opacity, 1))}.bg-\\[var\\(--login-background\\)\\]{background-color:var(--login-background)}.bg-\\[var\\(--login-primary\\)\\]{background-color:var(--login-primary)}.bg-accent{--tw-bg-opacity: 1;background-color:hsl(var(--accent) / var(--tw-bg-opacity, 1))}.bg-accent\\/20{background-color:hsl(var(--accent) / .2)}.bg-background{--tw-bg-opacity: 1;background-color:hsl(var(--background) / var(--tw-bg-opacity, 1))}.bg-background\\/80{background-color:hsl(var(--background) / .8)}.bg-black\\/20{background-color:#0003}.bg-black\\/40{background-color:#0006}.bg-black\\/60{background-color:#0009}.bg-black\\/80{background-color:#000c}.bg-blue-50{--tw-bg-opacity: 1;background-color:rgb(239 246 255 / var(--tw-bg-opacity, 1))}.bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}.bg-border{--tw-bg-opacity: 1;background-color:hsl(var(--border) / var(--tw-bg-opacity, 1))}.bg-card{--tw-bg-opacity: 1;background-color:hsl(var(--card) / var(--tw-bg-opacity, 1))}.bg-destructive{--tw-bg-opacity: 1;background-color:hsl(var(--destructive) / var(--tw-bg-opacity, 1))}.bg-destructive\\/5{background-color:hsl(var(--destructive) / .05)}.bg-error{--tw-bg-opacity: 1;background-color:hsl(var(--error) / var(--tw-bg-opacity, 1))}.bg-error\\/20{background-color:hsl(var(--error) / .2)}.bg-foreground{--tw-bg-opacity: 1;background-color:hsl(var(--foreground) / var(--tw-bg-opacity, 1))}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.bg-gray-400{--tw-bg-opacity: 1;background-color:rgb(156 163 175 / var(--tw-bg-opacity, 1))}.bg-gray-50{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.bg-green-100{--tw-bg-opacity: 1;background-color:rgb(220 252 231 / var(--tw-bg-opacity, 1))}.bg-green-50{--tw-bg-opacity: 1;background-color:rgb(240 253 244 / var(--tw-bg-opacity, 1))}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.bg-muted{--tw-bg-opacity: 1;background-color:hsl(var(--muted) / var(--tw-bg-opacity, 1))}.bg-muted\\/20{background-color:hsl(var(--muted) / .2)}.bg-muted\\/50{background-color:hsl(var(--muted) / .5)}.bg-muted\\/80{background-color:hsl(var(--muted) / .8)}.bg-orange-100{--tw-bg-opacity: 1;background-color:rgb(255 237 213 / var(--tw-bg-opacity, 1))}.bg-orange-50{--tw-bg-opacity: 1;background-color:rgb(255 247 237 / var(--tw-bg-opacity, 1))}.bg-orange-500{--tw-bg-opacity: 1;background-color:rgb(249 115 22 / var(--tw-bg-opacity, 1))}.bg-popover{--tw-bg-opacity: 1;background-color:hsl(var(--popover) / var(--tw-bg-opacity, 1))}.bg-primary{--tw-bg-opacity: 1;background-color:hsl(var(--primary) / var(--tw-bg-opacity, 1))}.bg-primary-foreground{--tw-bg-opacity: 1;background-color:hsl(var(--primary-foreground) / var(--tw-bg-opacity, 1))}.bg-primary\\/10{background-color:hsl(var(--primary) / .1)}.bg-primary\\/20{background-color:hsl(var(--primary) / .2)}.bg-primary\\/30{background-color:hsl(var(--primary) / .3)}.bg-primary\\/5{background-color:hsl(var(--primary) / .05)}.bg-purple-100{--tw-bg-opacity: 1;background-color:rgb(243 232 255 / var(--tw-bg-opacity, 1))}.bg-purple-500{--tw-bg-opacity: 1;background-color:rgb(168 85 247 / var(--tw-bg-opacity, 1))}.bg-red-100{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1))}.bg-secondary{--tw-bg-opacity: 1;background-color:hsl(var(--secondary) / var(--tw-bg-opacity, 1))}.bg-secondary-foreground{--tw-bg-opacity: 1;background-color:hsl(var(--secondary-foreground) / var(--tw-bg-opacity, 1))}.bg-secondary\\/20{background-color:hsl(var(--secondary) / .2)}.bg-success{--tw-bg-opacity: 1;background-color:hsl(var(--success) / var(--tw-bg-opacity, 1))}.bg-success\\/20{background-color:hsl(var(--success) / .2)}.bg-transparent{background-color:transparent}.bg-warning{--tw-bg-opacity: 1;background-color:hsl(var(--warning) / var(--tw-bg-opacity, 1))}.bg-warning\\/20{background-color:hsl(var(--warning) / .2)}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-white\\/10{background-color:#ffffff1a}.bg-yellow-100{--tw-bg-opacity: 1;background-color:rgb(254 249 195 / var(--tw-bg-opacity, 1))}.bg-yellow-500{--tw-bg-opacity: 1;background-color:rgb(234 179 8 / var(--tw-bg-opacity, 1))}.bg-opacity-80{--tw-bg-opacity: .8}.bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.from-blue-600{--tw-gradient-from: #2563eb var(--tw-gradient-from-position);--tw-gradient-to: rgb(37 99 235 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-primary\\/5{--tw-gradient-from: hsl(var(--primary) / .05) var(--tw-gradient-from-position);--tw-gradient-to: hsl(var(--primary) / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-purple-600{--tw-gradient-from: #9333ea var(--tw-gradient-from-position);--tw-gradient-to: rgb(147 51 234 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-transparent{--tw-gradient-from: transparent var(--tw-gradient-from-position);--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-white\\/20{--tw-gradient-from: rgb(255 255 255 / .2) var(--tw-gradient-from-position);--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.via-border{--tw-gradient-to: hsl(var(--border) / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), hsl(var(--border) / 1) var(--tw-gradient-via-position), var(--tw-gradient-to)}.to-pink-600{--tw-gradient-to: #db2777 var(--tw-gradient-to-position)}.to-primary\\/10{--tw-gradient-to: hsl(var(--primary) / .1) var(--tw-gradient-to-position)}.to-purple-600{--tw-gradient-to: #9333ea var(--tw-gradient-to-position)}.to-transparent{--tw-gradient-to: transparent var(--tw-gradient-to-position)}.to-white\\/0{--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position)}.fill-current{fill:currentColor}.p-0{padding:0}.p-1{padding:.25rem}.p-1\\.5{padding:.375rem}.p-10{padding:2.5rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-6{padding:1.5rem}.p-7{padding:1.75rem}.p-8{padding:2rem}.px-0{padding-left:0;padding-right:0}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0{padding-top:0;padding-bottom:0}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\\.5{padding-top:.375rem;padding-bottom:.375rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-2{padding-bottom:.5rem}.pb-3{padding-bottom:.75rem}.pb-4{padding-bottom:1rem}.pb-8{padding-bottom:2rem}.pl-10{padding-left:2.5rem}.pl-2{padding-left:.5rem}.pl-7{padding-left:1.75rem}.pl-8{padding-left:2rem}.pl-9{padding-left:2.25rem}.pr-10{padding-right:2.5rem}.pr-2{padding-right:.5rem}.pr-3{padding-right:.75rem}.pr-8{padding-right:2rem}.pt-0{padding-top:0}.pt-3{padding-top:.75rem}.pt-4{padding-top:1rem}.text-left{text-align:left}.text-center{text-align:center}.align-middle{vertical-align:middle}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:1.5rem;line-height:2rem}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.capitalize{text-transform:capitalize}.italic{font-style:italic}.leading-none{line-height:1}.leading-normal{line-height:1.5}.leading-snug{line-height:1.375}.tracking-tight{letter-spacing:-.025em}.tracking-widest{letter-spacing:.1em}.text-\\[var\\(--login-primary\\)\\]{color:var(--login-primary)}.text-\\[var\\(--login-text\\)\\]{color:var(--login-text)}.text-blue-600{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.text-blue-700{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity, 1))}.text-blue-900{--tw-text-opacity: 1;color:rgb(30 58 138 / var(--tw-text-opacity, 1))}.text-card-foreground{--tw-text-opacity: 1;color:hsl(var(--card-foreground) / var(--tw-text-opacity, 1))}.text-current{color:currentColor}.text-destructive{--tw-text-opacity: 1;color:hsl(var(--destructive) / var(--tw-text-opacity, 1))}.text-destructive-foreground{--tw-text-opacity: 1;color:hsl(var(--destructive-foreground) / var(--tw-text-opacity, 1))}.text-error{--tw-text-opacity: 1;color:hsl(var(--error) / var(--tw-text-opacity, 1))}.text-foreground{--tw-text-opacity: 1;color:hsl(var(--foreground) / var(--tw-text-opacity, 1))}.text-foreground\\/50{color:hsl(var(--foreground) / .5)}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.text-green-500{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity, 1))}.text-green-600{--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity, 1))}.text-green-700{--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.text-green-800{--tw-text-opacity: 1;color:rgb(22 101 52 / var(--tw-text-opacity, 1))}.text-green-900{--tw-text-opacity: 1;color:rgb(20 83 45 / var(--tw-text-opacity, 1))}.text-muted-foreground{--tw-text-opacity: 1;color:hsl(var(--muted-foreground) / var(--tw-text-opacity, 1))}.text-orange-800{--tw-text-opacity: 1;color:rgb(154 52 18 / var(--tw-text-opacity, 1))}.text-orange-900{--tw-text-opacity: 1;color:rgb(124 45 18 / var(--tw-text-opacity, 1))}.text-popover-foreground{--tw-text-opacity: 1;color:hsl(var(--popover-foreground) / var(--tw-text-opacity, 1))}.text-primary{--tw-text-opacity: 1;color:hsl(var(--primary) / var(--tw-text-opacity, 1))}.text-primary-foreground{--tw-text-opacity: 1;color:hsl(var(--primary-foreground) / var(--tw-text-opacity, 1))}.text-purple-600{--tw-text-opacity: 1;color:rgb(147 51 234 / var(--tw-text-opacity, 1))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-red-700{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity, 1))}.text-red-800{--tw-text-opacity: 1;color:rgb(153 27 27 / var(--tw-text-opacity, 1))}.text-secondary-foreground{--tw-text-opacity: 1;color:hsl(var(--secondary-foreground) / var(--tw-text-opacity, 1))}.text-success{--tw-text-opacity: 1;color:hsl(var(--success) / var(--tw-text-opacity, 1))}.text-warning{--tw-text-opacity: 1;color:hsl(var(--warning) / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-white\\/80{color:#fffc}.text-yellow-600{--tw-text-opacity: 1;color:rgb(202 138 4 / var(--tw-text-opacity, 1))}.text-yellow-700{--tw-text-opacity: 1;color:rgb(161 98 7 / var(--tw-text-opacity, 1))}.text-yellow-800{--tw-text-opacity: 1;color:rgb(133 77 14 / var(--tw-text-opacity, 1))}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.opacity-0{opacity:0}.opacity-30{opacity:.3}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-80{opacity:.8}.opacity-90{opacity:.9}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-none{--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-primary\\/50{--tw-shadow-color: hsl(var(--primary) / .5);--tw-shadow: var(--tw-shadow-colored)}.shadow-purple-500\\/25{--tw-shadow-color: rgb(168 85 247 / .25);--tw-shadow: var(--tw-shadow-colored)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-0{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-2{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-gray-300{--tw-ring-opacity: 1;--tw-ring-color: rgb(209 213 219 / var(--tw-ring-opacity, 1))}.ring-offset-2{--tw-ring-offset-width: 2px}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background) / 1)}.blur{--tw-blur: blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-md{--tw-backdrop-blur: blur(12px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-shadow{transition-property:box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-100{transition-duration:.1s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.shadow-sm{box-shadow:var(--shadow-sm)}.shadow-md{box-shadow:var(--shadow-md)}.shadow-lg{box-shadow:var(--shadow-lg)}.shadow-xl{box-shadow:var(--shadow-xl)}.animate-spin{animation:spin 1s linear infinite}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}.transition-all{transition-property:all}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke}.transition-opacity{transition-property:opacity}.transition-shadow{transition-property:box-shadow}.transition-transform{transition-property:transform}.ease-out{transition-timing-function:var(--ease-out)}:root{--primary-50: 240 249 255;--primary-100: 224 242 254;--primary-200: 186 230 253;--primary-300: 125 211 252;--primary-400: 56 189 248;--primary-500: 14 165 233;--primary-600: 2 132 199;--primary-700: 3 105 161;--primary-800: 7 89 133;--primary-900: 12 74 110;--primary-950: 8 47 73;--secondary-50: 248 250 252;--secondary-100: 241 245 249;--secondary-200: 226 232 240;--secondary-300: 203 213 225;--secondary-400: 148 163 184;--secondary-500: 100 116 139;--secondary-600: 71 85 105;--secondary-700: 51 65 85;--secondary-800: 30 41 59;--secondary-900: 15 23 42;--secondary-950: 2 6 23;--success-50: 240 253 244;--success-100: 220 252 231;--success-200: 187 247 208;--success-300: 134 239 172;--success-400: 74 222 128;--success-500: 34 197 94;--success-600: 22 163 74;--success-700: 21 128 61;--success-800: 22 101 52;--success-900: 20 83 45;--success-950: 5 46 22;--warning-50: 254 252 232;--warning-100: 254 249 195;--warning-200: 254 240 138;--warning-300: 253 224 71;--warning-400: 250 204 21;--warning-500: 234 179 8;--warning-600: 202 138 4;--warning-700: 161 98 7;--warning-800: 133 77 14;--warning-900: 113 63 18;--warning-950: 66 32 6;--error-50: 254 242 242;--error-100: 254 226 226;--error-200: 254 202 202;--error-300: 252 165 165;--error-400: 248 113 113;--error-500: 239 68 68;--error-600: 220 38 38;--error-700: 185 28 28;--error-800: 153 27 27;--error-900: 127 29 29;--error-950: 69 10 10;--background: 0 0% 100%;--foreground: 222.2 47.4% 11.2%;--card: 0 0% 100%;--card-foreground: 222.2 47.4% 11.2%;--popover: 0 0% 100%;--popover-foreground: 222.2 47.4% 11.2%;--primary: 222.2 47.4% 11.2%;--primary-foreground: 210 40% 98%;--secondary: 210 40% 96%;--secondary-foreground: 222.2 47.4% 11.2%;--muted: 210 40% 96%;--muted-foreground: 215.4 16.3% 46.9%;--accent: 210 40% 96%;--accent-foreground: 222.2 47.4% 11.2%;--destructive: 0 100% 50%;--destructive-foreground: 210 40% 98%;--border: 214.3 31.8% 91.4%;--input: 214.3 31.8% 91.4%;--ring: 215 20.2% 65.1%;--chart-1: 12 76% 61%;--chart-2: 173 58% 39%;--chart-3: 197 37% 24%;--chart-4: 43 74% 66%;--chart-5: 27 87% 67%;--font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;--font-serif: "Crimson Text", Georgia, "Times New Roman", serif;--font-mono: "JetBrains Mono", "Fira Code", "Consolas", monospace;--text-xs: .75rem;--text-sm: .875rem;--text-base: 1rem;--text-lg: 1.125rem;--text-xl: 1.25rem;--text-2xl: 1.5rem;--text-3xl: 1.875rem;--text-4xl: 2.25rem;--text-5xl: 3rem;--text-6xl: 3.75rem;--text-7xl: 4.5rem;--text-8xl: 6rem;--text-9xl: 8rem;--leading-none: 1;--leading-tight: 1.25;--leading-snug: 1.375;--leading-normal: 1.5;--leading-relaxed: 1.625;--leading-loose: 2;--font-thin: 100;--font-extralight: 200;--font-light: 300;--font-normal: 400;--font-medium: 500;--font-semibold: 600;--font-bold: 700;--font-extrabold: 800;--font-black: 900;--spacing-0: 0;--spacing-px: 1px;--spacing-0-5: .125rem;--spacing-1: .25rem;--spacing-1-5: .375rem;--spacing-2: .5rem;--spacing-2-5: .625rem;--spacing-3: .75rem;--spacing-3-5: .875rem;--spacing-4: 1rem;--spacing-5: 1.25rem;--spacing-6: 1.5rem;--spacing-7: 1.75rem;--spacing-8: 2rem;--spacing-9: 2.25rem;--spacing-10: 2.5rem;--spacing-11: 2.75rem;--spacing-12: 3rem;--spacing-14: 3.5rem;--spacing-16: 4rem;--spacing-20: 5rem;--spacing-24: 6rem;--spacing-28: 7rem;--spacing-32: 8rem;--spacing-36: 9rem;--spacing-40: 10rem;--spacing-44: 11rem;--spacing-48: 12rem;--spacing-52: 13rem;--spacing-56: 14rem;--spacing-60: 15rem;--spacing-64: 16rem;--spacing-72: 18rem;--spacing-80: 20rem;--spacing-96: 24rem;--radius-none: 0;--radius-sm: .125rem;--radius-base: .25rem;--radius-md: .375rem;--radius-lg: .5rem;--radius-xl: .75rem;--radius-2xl: 1rem;--radius-3xl: 1.5rem;--radius-full: 9999px;--shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, .05);--shadow-base: 0 1px 3px 0 rgba(0, 0, 0, .1), 0 1px 2px 0 rgba(0, 0, 0, .06);--shadow-md: 0 4px 6px -1px rgba(0, 0, 0, .1), 0 2px 4px -1px rgba(0, 0, 0, .06);--shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, .1), 0 4px 6px -2px rgba(0, 0, 0, .05);--shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, .1), 0 10px 10px -5px rgba(0, 0, 0, .04);--shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, .25);--shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, .06);--shadow-none: 0 0 #0000;--elevation-0: var(--shadow-none);--elevation-1: var(--shadow-sm);--elevation-2: var(--shadow-base);--elevation-3: var(--shadow-md);--elevation-4: var(--shadow-lg);--elevation-5: var(--shadow-xl);--elevation-6: var(--shadow-2xl);--duration-75: 75ms;--duration-100: .1s;--duration-150: .15s;--duration-200: .2s;--duration-300: .3s;--duration-500: .5s;--duration-700: .7s;--duration-1000: 1s;--ease-linear: linear;--ease-in: cubic-bezier(.4, 0, 1, 1);--ease-out: cubic-bezier(0, 0, .2, 1);--ease-in-out: cubic-bezier(.4, 0, .2, 1);--ease-bounce: cubic-bezier(.68, -.55, .265, 1.55);--ease-spring: cubic-bezier(.175, .885, .32, 1.275);--animate-fade-in: fadeIn var(--duration-300) var(--ease-out);--animate-fade-out: fadeOut var(--duration-300) var(--ease-in);--animate-slide-in-up: slideInUp var(--duration-300) var(--ease-out);--animate-slide-in-down: slideInDown var(--duration-300) var(--ease-out);--animate-slide-in-left: slideInLeft var(--duration-300) var(--ease-out);--animate-slide-in-right: slideInRight var(--duration-300) var(--ease-out);--animate-scale-in: scaleIn var(--duration-200) var(--ease-out);--animate-scale-out: scaleOut var(--duration-200) var(--ease-in);--animate-bounce: bounce var(--duration-500) var(--ease-bounce);--animate-pulse: pulse var(--duration-1000) var(--ease-in-out) infinite;--animate-spin: spin var(--duration-1000) var(--ease-linear) infinite;--breakpoint-sm: 640px;--breakpoint-md: 768px;--breakpoint-lg: 1024px;--breakpoint-xl: 1280px;--breakpoint-2xl: 1536px;--container-sm: 640px;--container-md: 768px;--container-lg: 1024px;--container-xl: 1280px;--container-2xl: 1536px;--z-0: 0;--z-10: 10;--z-20: 20;--z-30: 30;--z-40: 40;--z-50: 50;--z-auto: auto;--z-dropdown: 1000;--z-sticky: 1020;--z-fixed: 1030;--z-modal-backdrop: 1040;--z-modal: 1050;--z-popover: 1060;--z-tooltip: 1070;--z-toast: 1080;--button-height-sm: 2rem;--button-height-md: 2.5rem;--button-height-lg: 3rem;--button-height-xl: 3.5rem;--button-padding-sm: .5rem .75rem;--button-padding-md: .625rem 1rem;--button-padding-lg: .75rem 1.25rem;--button-padding-xl: 1rem 1.5rem;--button-font-size-sm: var(--text-sm);--button-font-size-md: var(--text-base);--button-font-size-lg: var(--text-lg);--button-font-size-xl: var(--text-xl);--input-height-sm: 2rem;--input-height-md: 2.5rem;--input-height-lg: 3rem;--input-height-xl: 3.5rem;--input-padding-sm: .5rem .75rem;--input-padding-md: .625rem 1rem;--input-padding-lg: .75rem 1.25rem;--input-padding-xl: 1rem 1.5rem;--input-border-width: 1px;--input-border-radius: var(--radius-md);--input-focus-ring-width: 2px;--input-focus-ring-offset: 2px;--card-padding-sm: 1rem;--card-padding-md: 1.5rem;--card-padding-lg: 2rem;--card-padding-xl: 2.5rem;--card-border-radius: var(--radius-lg);--card-border-width: 1px;--card-shadow: var(--elevation-1);--card-hover-shadow: var(--elevation-2)}.dark{--background: 224 71% 4%;--foreground: 213 31% 91%;--card: 224 71% 4%;--card-foreground: 213 31% 91%;--popover: 224 71% 4%;--popover-foreground: 213 31% 91%;--primary: 210 40% 98%;--primary-foreground: 222.2 47.4% 1.2%;--secondary: 222.2 84% 4.9%;--secondary-foreground: 210 40% 98%;--muted: 223 47% 11%;--muted-foreground: 215.4 16.3% 56.9%;--accent: 216 34% 17%;--accent-foreground: 210 40% 98%;--destructive: 0 63% 31%;--destructive-foreground: 210 40% 98%;--border: 216 34% 17%;--input: 216 34% 17%;--ring: 216 34% 17%;--chart-1: 220 70% 50%;--chart-2: 160 60% 45%;--chart-3: 30 80% 55%;--chart-4: 280 65% 60%;--chart-5: 340 75% 55%}@keyframes slideInUp{0%{transform:translateY(100%);opacity:0}to{transform:translateY(0);opacity:1}}@keyframes slideInDown{0%{transform:translateY(-100%);opacity:0}to{transform:translateY(0);opacity:1}}@keyframes slideInLeft{0%{transform:translate(-100%);opacity:0}to{transform:translate(0);opacity:1}}@keyframes slideInRight{0%{transform:translate(100%);opacity:0}to{transform:translate(0);opacity:1}}@keyframes scaleOut{0%{transform:scale(1);opacity:1}to{transform:scale(.95);opacity:0}}@keyframes bounce{0%,20%,53%,80%,to{transform:translateZ(0)}40%,43%{transform:translate3d(0,-30px,0)}70%{transform:translate3d(0,-15px,0)}90%{transform:translate3d(0,-4px,0)}}.animate-fade-in{animation:var(--animate-fade-in)}.animate-fade-out{animation:var(--animate-fade-out)}.animate-slide-in-up{animation:var(--animate-slide-in-up)}.animate-slide-in-down{animation:var(--animate-slide-in-down)}.animate-slide-in-left{animation:var(--animate-slide-in-left)}.animate-slide-in-right{animation:var(--animate-slide-in-right)}.animate-scale-in{animation:var(--animate-scale-in)}.animate-scale-out{animation:var(--animate-scale-out)}.animate-bounce{animation:var(--animate-bounce)}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}@media (max-width: 639px){.container{max-width:100%}}@media (min-width: 640px){.container{max-width:var(--container-sm)}}@media (min-width: 768px){.container{max-width:var(--container-md)}}@media (min-width: 1024px){.container{max-width:var(--container-lg)}}@media (min-width: 1280px){.container{max-width:var(--container-xl)}}@media (min-width: 1536px){.container{max-width:var(--container-2xl)}}@keyframes spin{to{transform:rotate(360deg)}}@keyframes ping{75%,to{transform:scale(2);opacity:0}}@keyframes pulse{0%,to{opacity:1}50%{opacity:.5}}@keyframes bounce{0%,to{transform:translateY(-25%);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:translateY(0);animation-timing-function:cubic-bezier(0,0,.2,1)}}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes fadeOut{0%{opacity:1}to{opacity:0}}@keyframes slideIn{0%{transform:translate(-100%)}to{transform:translate(0)}}@keyframes scaleIn{0%{transform:scale(.95);opacity:0}to{transform:scale(1);opacity:1}}.file\\:border-0::file-selector-button{border-width:0px}.file\\:bg-transparent::file-selector-button{background-color:transparent}.file\\:font-medium::file-selector-button{font-weight:500}.placeholder\\:text-muted-foreground::-moz-placeholder{--tw-text-opacity: 1;color:hsl(var(--muted-foreground) / var(--tw-text-opacity, 1))}.placeholder\\:text-muted-foreground::placeholder{--tw-text-opacity: 1;color:hsl(var(--muted-foreground) / var(--tw-text-opacity, 1))}.hover\\:-translate-y-0\\.5:hover{--tw-translate-y: -.125rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\\:scale-105:hover{--tw-scale-x: 1.05;--tw-scale-y: 1.05;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\\:scale-110:hover{--tw-scale-x: 1.1;--tw-scale-y: 1.1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\\:border-error\\/80:hover{border-color:hsl(var(--error) / .8)}.hover\\:border-gray-300:hover{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.hover\\:border-gray-400:hover{--tw-border-opacity: 1;border-color:rgb(156 163 175 / var(--tw-border-opacity, 1))}.hover\\:border-primary\\/20:hover{border-color:hsl(var(--primary) / .2)}.hover\\:border-primary\\/50:hover{border-color:hsl(var(--primary) / .5)}.hover\\:border-success\\/80:hover{border-color:hsl(var(--success) / .8)}.hover\\:border-white\\/30:hover{border-color:#ffffff4d}.hover\\:bg-accent:hover{--tw-bg-opacity: 1;background-color:hsl(var(--accent) / var(--tw-bg-opacity, 1))}.hover\\:bg-black\\/10:hover{background-color:#0000001a}.hover\\:bg-destructive\\/90:hover{background-color:hsl(var(--destructive) / .9)}.hover\\:bg-error\\/90:hover{background-color:hsl(var(--error) / .9)}.hover\\:bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.hover\\:bg-gray-100\\/50:hover{background-color:#f3f4f680}.hover\\:bg-gray-200:hover{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.hover\\:bg-gray-50:hover{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.hover\\:bg-muted:hover{--tw-bg-opacity: 1;background-color:hsl(var(--muted) / var(--tw-bg-opacity, 1))}.hover\\:bg-muted\\/30:hover{background-color:hsl(var(--muted) / .3)}.hover\\:bg-muted\\/50:hover{background-color:hsl(var(--muted) / .5)}.hover\\:bg-muted\\/80:hover{background-color:hsl(var(--muted) / .8)}.hover\\:bg-primary:hover{--tw-bg-opacity: 1;background-color:hsl(var(--primary) / var(--tw-bg-opacity, 1))}.hover\\:bg-primary\\/20:hover{background-color:hsl(var(--primary) / .2)}.hover\\:bg-primary\\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\\:bg-purple-200:hover{--tw-bg-opacity: 1;background-color:rgb(233 213 255 / var(--tw-bg-opacity, 1))}.hover\\:bg-secondary:hover{--tw-bg-opacity: 1;background-color:hsl(var(--secondary) / var(--tw-bg-opacity, 1))}.hover\\:bg-secondary\\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\\:bg-success\\/90:hover{background-color:hsl(var(--success) / .9)}.hover\\:bg-warning\\/90:hover{background-color:hsl(var(--warning) / .9)}.hover\\:bg-white\\/20:hover{background-color:#fff3}.hover\\:from-blue-700:hover{--tw-gradient-from: #1d4ed8 var(--tw-gradient-from-position);--tw-gradient-to: rgb(29 78 216 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.hover\\:from-purple-700:hover{--tw-gradient-from: #7e22ce var(--tw-gradient-from-position);--tw-gradient-to: rgb(126 34 206 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.hover\\:to-pink-700:hover{--tw-gradient-to: #be185d var(--tw-gradient-to-position)}.hover\\:to-purple-700:hover{--tw-gradient-to: #7e22ce var(--tw-gradient-to-position)}.hover\\:text-accent-foreground:hover{--tw-text-opacity: 1;color:hsl(var(--accent-foreground) / var(--tw-text-opacity, 1))}.hover\\:text-foreground:hover{--tw-text-opacity: 1;color:hsl(var(--foreground) / var(--tw-text-opacity, 1))}.hover\\:text-primary-foreground:hover{--tw-text-opacity: 1;color:hsl(var(--primary-foreground) / var(--tw-text-opacity, 1))}.hover\\:text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.hover\\:underline:hover{text-decoration-line:underline}.hover\\:opacity-100:hover{opacity:1}.hover\\:opacity-90:hover{opacity:.9}.hover\\:shadow-\\[0_0_20px_rgba\\(var\\(--primary\\)\\,0\\.5\\)\\]:hover{--tw-shadow: 0 0 20px rgba(var(--primary),.5);--tw-shadow-colored: 0 0 20px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\\:shadow-lg:hover{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\\:shadow-md:hover{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\\:shadow-xl:hover{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\\:shadow-primary\\/20:hover{--tw-shadow-color: hsl(var(--primary) / .2);--tw-shadow: var(--tw-shadow-colored)}.hover\\:shadow-primary\\/60:hover{--tw-shadow-color: hsl(var(--primary) / .6);--tw-shadow: var(--tw-shadow-colored)}.hover\\:brightness-110:hover{--tw-brightness: brightness(1.1);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.hover\\:shadow-md:hover{box-shadow:var(--shadow-md)}.hover\\:shadow-lg:hover{box-shadow:var(--shadow-lg)}.hover\\:shadow-xl:hover{box-shadow:var(--shadow-xl)}.focus\\:bg-accent:focus{--tw-bg-opacity: 1;background-color:hsl(var(--accent) / var(--tw-bg-opacity, 1))}.focus\\:bg-error\\/10:focus{background-color:hsl(var(--error) / .1)}.focus\\:bg-gray-100:focus{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.focus\\:bg-success\\/10:focus{background-color:hsl(var(--success) / .1)}.focus\\:bg-warning\\/10:focus{background-color:hsl(var(--warning) / .1)}.focus\\:text-accent-foreground:focus{--tw-text-opacity: 1;color:hsl(var(--accent-foreground) / var(--tw-text-opacity, 1))}.focus\\:text-error:focus{--tw-text-opacity: 1;color:hsl(var(--error) / var(--tw-text-opacity, 1))}.focus\\:text-foreground:focus{--tw-text-opacity: 1;color:hsl(var(--foreground) / var(--tw-text-opacity, 1))}.focus\\:text-success:focus{--tw-text-opacity: 1;color:hsl(var(--success) / var(--tw-text-opacity, 1))}.focus\\:text-warning:focus{--tw-text-opacity: 1;color:hsl(var(--warning) / var(--tw-text-opacity, 1))}.focus\\:opacity-100:focus{opacity:1}.focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\\:ring-1:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\\:ring-\\[var\\(--login-primary\\)\\]:focus{--tw-ring-color: var(--login-primary)}.focus\\:ring-primary\\/30:focus{--tw-ring-color: hsl(var(--primary) / .3)}.focus\\:ring-ring:focus{--tw-ring-opacity: 1;--tw-ring-color: hsl(var(--ring) / var(--tw-ring-opacity, 1))}.focus\\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\\:border-2:focus-visible{border-width:2px}.focus-visible\\:border-b-2:focus-visible{border-bottom-width:2px}.focus-visible\\:border-error:focus-visible{--tw-border-opacity: 1;border-color:hsl(var(--error) / var(--tw-border-opacity, 1))}.focus-visible\\:border-primary:focus-visible{--tw-border-opacity: 1;border-color:hsl(var(--primary) / var(--tw-border-opacity, 1))}.focus-visible\\:border-success:focus-visible{--tw-border-opacity: 1;border-color:hsl(var(--success) / var(--tw-border-opacity, 1))}.focus-visible\\:bg-transparent:focus-visible{background-color:transparent}.focus-visible\\:shadow-lg:focus-visible{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.focus-visible\\:shadow-primary\\/30:focus-visible{--tw-shadow-color: hsl(var(--primary) / .3);--tw-shadow: var(--tw-shadow-colored)}.focus-visible\\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:ring-0:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\\:ring-error\\/30:focus-visible{--tw-ring-color: hsl(var(--error) / .3)}.focus-visible\\:ring-error\\/50:focus-visible{--tw-ring-color: hsl(var(--error) / .5)}.focus-visible\\:ring-gray-400\\/30:focus-visible{--tw-ring-color: rgb(156 163 175 / .3)}.focus-visible\\:ring-primary\\/30:focus-visible{--tw-ring-color: hsl(var(--primary) / .3)}.focus-visible\\:ring-primary\\/50:focus-visible{--tw-ring-color: hsl(var(--primary) / .5)}.focus-visible\\:ring-purple-400\\/30:focus-visible{--tw-ring-color: rgb(192 132 252 / .3)}.focus-visible\\:ring-purple-500\\/50:focus-visible{--tw-ring-color: rgb(168 85 247 / .5)}.focus-visible\\:ring-ring:focus-visible{--tw-ring-opacity: 1;--tw-ring-color: hsl(var(--ring) / var(--tw-ring-opacity, 1))}.focus-visible\\:ring-success\\/30:focus-visible{--tw-ring-color: hsl(var(--success) / .3)}.focus-visible\\:ring-success\\/50:focus-visible{--tw-ring-color: hsl(var(--success) / .5)}.focus-visible\\:ring-warning\\/30:focus-visible{--tw-ring-color: hsl(var(--warning) / .3)}.focus-visible\\:ring-white\\/50:focus-visible{--tw-ring-color: rgb(255 255 255 / .5)}.focus-visible\\:ring-offset-1:focus-visible{--tw-ring-offset-width: 1px}.focus-visible\\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.focus-visible\\:ring-offset-background:focus-visible{--tw-ring-offset-color: hsl(var(--background) / 1)}.focus-visible\\:shadow-lg:focus-visible{box-shadow:var(--shadow-lg)}.active\\:translate-y-0:active{--tw-translate-y: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.active\\:translate-y-0\\.5:active{--tw-translate-y: .125rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.active\\:scale-95:active{--tw-scale-x: .95;--tw-scale-y: .95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.active\\:cursor-grabbing:active{cursor:grabbing}.active\\:bg-error\\/80:active{background-color:hsl(var(--error) / .8)}.active\\:bg-gray-100:active{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.active\\:bg-gray-200:active{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.active\\:bg-gray-300:active{--tw-bg-opacity: 1;background-color:rgb(209 213 219 / var(--tw-bg-opacity, 1))}.active\\:bg-primary\\/30:active{background-color:hsl(var(--primary) / .3)}.active\\:bg-success\\/80:active{background-color:hsl(var(--success) / .8)}.active\\:bg-white\\/30:active{background-color:#ffffff4d}.active\\:from-blue-800:active{--tw-gradient-from: #1e40af var(--tw-gradient-from-position);--tw-gradient-to: rgb(30 64 175 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.active\\:to-purple-800:active{--tw-gradient-to: #6b21a8 var(--tw-gradient-to-position)}.active\\:shadow-\\[0_0_10px_rgba\\(var\\(--primary\\)\\,0\\.3\\)\\]:active{--tw-shadow: 0 0 10px rgba(var(--primary),.3);--tw-shadow-colored: 0 0 10px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.active\\:shadow-md:active{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.active\\:shadow-sm:active{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.active\\:shadow-primary\\/40:active{--tw-shadow-color: hsl(var(--primary) / .4);--tw-shadow: var(--tw-shadow-colored)}.active\\:brightness-90:active{--tw-brightness: brightness(.9);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.active\\:brightness-95:active{--tw-brightness: brightness(.95);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.active\\:shadow-sm:active{box-shadow:var(--shadow-sm)}.active\\:shadow-md:active{box-shadow:var(--shadow-md)}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:opacity-50:disabled{opacity:.5}.group:hover .group-hover\\:flex{display:flex}.group:hover .group-hover\\:opacity-100{opacity:1}.group.destructive .group-\\[\\.destructive\\]\\:border-muted\\/40{border-color:hsl(var(--muted) / .4)}.group.destructive .group-\\[\\.destructive\\]\\:text-red-300{--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.group.destructive .group-\\[\\.destructive\\]\\:hover\\:border-destructive\\/30:hover{border-color:hsl(var(--destructive) / .3)}.group.destructive .group-\\[\\.destructive\\]\\:hover\\:bg-destructive:hover{--tw-bg-opacity: 1;background-color:hsl(var(--destructive) / var(--tw-bg-opacity, 1))}.group.destructive .group-\\[\\.destructive\\]\\:hover\\:text-destructive-foreground:hover{--tw-text-opacity: 1;color:hsl(var(--destructive-foreground) / var(--tw-text-opacity, 1))}.group.destructive .group-\\[\\.destructive\\]\\:hover\\:text-red-50:hover{--tw-text-opacity: 1;color:rgb(254 242 242 / var(--tw-text-opacity, 1))}.group.destructive .group-\\[\\.destructive\\]\\:focus\\:ring-destructive:focus{--tw-ring-opacity: 1;--tw-ring-color: hsl(var(--destructive) / var(--tw-ring-opacity, 1))}.group.destructive .group-\\[\\.destructive\\]\\:focus\\:ring-red-400:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(248 113 113 / var(--tw-ring-opacity, 1))}.group.destructive .group-\\[\\.destructive\\]\\:focus\\:ring-offset-red-600:focus{--tw-ring-offset-color: #dc2626}.peer:disabled~.peer-disabled\\:cursor-not-allowed{cursor:not-allowed}.peer:disabled~.peer-disabled\\:opacity-70{opacity:.7}.data-\\[disabled\\]\\:pointer-events-none[data-disabled]{pointer-events:none}.data-\\[side\\=bottom\\]\\:translate-y-1[data-side=bottom]{--tw-translate-y: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[side\\=left\\]\\:-translate-x-1[data-side=left]{--tw-translate-x: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[side\\=right\\]\\:translate-x-1[data-side=right]{--tw-translate-x: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[side\\=top\\]\\:-translate-y-1[data-side=top]{--tw-translate-y: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[state\\=checked\\]\\:translate-x-4[data-state=checked]{--tw-translate-x: 1rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[state\\=checked\\]\\:translate-x-5[data-state=checked]{--tw-translate-x: 1.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[state\\=checked\\]\\:translate-x-7[data-state=checked]{--tw-translate-x: 1.75rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[state\\=unchecked\\]\\:translate-x-0[data-state=unchecked],.data-\\[swipe\\=cancel\\]\\:translate-x-0[data-swipe=cancel]{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[swipe\\=end\\]\\:translate-x-\\[var\\(--radix-toast-swipe-end-x\\)\\][data-swipe=end]{--tw-translate-x: var(--radix-toast-swipe-end-x);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[swipe\\=move\\]\\:translate-x-\\[var\\(--radix-toast-swipe-move-x\\)\\][data-swipe=move]{--tw-translate-x: var(--radix-toast-swipe-move-x);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes bounce{0%,to{transform:translateY(-25%);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;animation-timing-function:cubic-bezier(0,0,.2,1)}}.data-\\[state\\=active\\]\\:border-primary[data-state=active],.data-\\[state\\=checked\\]\\:border-primary[data-state=checked]{--tw-border-opacity: 1;border-color:hsl(var(--primary) / var(--tw-border-opacity, 1))}.data-\\[state\\=active\\]\\:bg-background[data-state=active]{--tw-bg-opacity: 1;background-color:hsl(var(--background) / var(--tw-bg-opacity, 1))}.data-\\[state\\=active\\]\\:bg-primary[data-state=active]{--tw-bg-opacity: 1;background-color:hsl(var(--primary) / var(--tw-bg-opacity, 1))}.data-\\[state\\=active\\]\\:bg-transparent[data-state=active]{background-color:transparent}.data-\\[state\\=checked\\]\\:bg-accent[data-state=checked]{--tw-bg-opacity: 1;background-color:hsl(var(--accent) / var(--tw-bg-opacity, 1))}.data-\\[state\\=checked\\]\\:bg-error[data-state=checked]{--tw-bg-opacity: 1;background-color:hsl(var(--error) / var(--tw-bg-opacity, 1))}.data-\\[state\\=checked\\]\\:bg-primary[data-state=checked]{--tw-bg-opacity: 1;background-color:hsl(var(--primary) / var(--tw-bg-opacity, 1))}.data-\\[state\\=checked\\]\\:bg-success[data-state=checked]{--tw-bg-opacity: 1;background-color:hsl(var(--success) / var(--tw-bg-opacity, 1))}.data-\\[state\\=checked\\]\\:bg-warning[data-state=checked]{--tw-bg-opacity: 1;background-color:hsl(var(--warning) / var(--tw-bg-opacity, 1))}.data-\\[state\\=open\\]\\:bg-accent[data-state=open]{--tw-bg-opacity: 1;background-color:hsl(var(--accent) / var(--tw-bg-opacity, 1))}.data-\\[state\\=unchecked\\]\\:bg-input[data-state=unchecked]{--tw-bg-opacity: 1;background-color:hsl(var(--input) / var(--tw-bg-opacity, 1))}.data-\\[state\\=active\\]\\:text-foreground[data-state=active]{--tw-text-opacity: 1;color:hsl(var(--foreground) / var(--tw-text-opacity, 1))}.data-\\[state\\=active\\]\\:text-primary-foreground[data-state=active],.data-\\[state\\=checked\\]\\:text-primary-foreground[data-state=checked]{--tw-text-opacity: 1;color:hsl(var(--primary-foreground) / var(--tw-text-opacity, 1))}.data-\\[state\\=active\\]\\:underline[data-state=active]{text-decoration-line:underline}.data-\\[state\\=active\\]\\:underline-offset-4[data-state=active]{text-underline-offset:4px}.data-\\[disabled\\]\\:opacity-50[data-disabled]{opacity:.5}.data-\\[state\\=inactive\\]\\:opacity-60[data-state=inactive]{opacity:.6}.data-\\[state\\=active\\]\\:shadow-md[data-state=active]{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.data-\\[state\\=active\\]\\:shadow-sm[data-state=active]{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.data-\\[swipe\\=move\\]\\:transition-none[data-swipe=move]{transition-property:none}.data-\\[state\\=open\\]\\:duration-150[data-state=open]{transition-duration:.15s}.data-\\[state\\=active\\]\\:shadow-sm[data-state=active]{box-shadow:var(--shadow-sm)}.data-\\[state\\=active\\]\\:shadow-md[data-state=active]{box-shadow:var(--shadow-md)}.data-\\[state\\=checked\\]\\:animate-bounce[data-state=checked]{animation:bounce 1s infinite}.data-\\[swipe\\=move\\]\\:transition-none[data-swipe=move]{transition:none}.group[data-state=open] .group-data-\\[state\\=open\\]\\:rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.dark\\:border-blue-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(30 64 175 / var(--tw-border-opacity, 1))}.dark\\:border-error\\/20:is(.dark *){border-color:hsl(var(--error) / .2)}.dark\\:border-error\\/30:is(.dark *){border-color:hsl(var(--error) / .3)}.dark\\:border-gray-600:is(.dark *){--tw-border-opacity: 1;border-color:rgb(75 85 99 / var(--tw-border-opacity, 1))}.dark\\:border-gray-700:is(.dark *){--tw-border-opacity: 1;border-color:rgb(55 65 81 / var(--tw-border-opacity, 1))}.dark\\:border-gray-700\\/20:is(.dark *){border-color:#37415133}.dark\\:border-gray-700\\/30:is(.dark *){border-color:#3741514d}.dark\\:border-gray-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(31 41 55 / var(--tw-border-opacity, 1))}.dark\\:border-green-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(22 101 52 / var(--tw-border-opacity, 1))}.dark\\:border-orange-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(154 52 18 / var(--tw-border-opacity, 1))}.dark\\:border-primary\\/30:is(.dark *){border-color:hsl(var(--primary) / .3)}.dark\\:border-success\\/20:is(.dark *){border-color:hsl(var(--success) / .2)}.dark\\:bg-blue-900\\/20:is(.dark *){background-color:#1e3a8a33}.dark\\:bg-error\\/90:is(.dark *){background-color:hsl(var(--error) / .9)}.dark\\:bg-gray-700:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity, 1))}.dark\\:bg-gray-800:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.dark\\:bg-gray-800\\/10:is(.dark *){background-color:#1f29371a}.dark\\:bg-gray-800\\/50:is(.dark *){background-color:#1f293780}.dark\\:bg-gray-800\\/80:is(.dark *){background-color:#1f2937cc}.dark\\:bg-gray-800\\/90:is(.dark *){background-color:#1f2937e6}.dark\\:bg-gray-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity, 1))}.dark\\:bg-gray-900\\/50:is(.dark *){background-color:#11182780}.dark\\:bg-gray-900\\/60:is(.dark *){background-color:#11182799}.dark\\:bg-gray-950:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(3 7 18 / var(--tw-bg-opacity, 1))}.dark\\:bg-green-900\\/20:is(.dark *){background-color:#14532d33}.dark\\:bg-orange-900\\/20:is(.dark *){background-color:#7c2d1233}.dark\\:bg-primary:is(.dark *){--tw-bg-opacity: 1;background-color:hsl(var(--primary) / var(--tw-bg-opacity, 1))}.dark\\:bg-primary\\/20:is(.dark *){background-color:hsl(var(--primary) / .2)}.dark\\:bg-primary\\/90:is(.dark *){background-color:hsl(var(--primary) / .9)}.dark\\:bg-purple-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(88 28 135 / var(--tw-bg-opacity, 1))}.dark\\:bg-purple-900\\/30:is(.dark *){background-color:#581c874d}.dark\\:bg-success\\/90:is(.dark *){background-color:hsl(var(--success) / .9)}.dark\\:bg-transparent:is(.dark *){background-color:transparent}.dark\\:bg-warning\\/90:is(.dark *){background-color:hsl(var(--warning) / .9)}.dark\\:from-primary\\/10:is(.dark *){--tw-gradient-from: hsl(var(--primary) / .1) var(--tw-gradient-from-position);--tw-gradient-to: hsl(var(--primary) / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.dark\\:to-primary\\/20:is(.dark *){--tw-gradient-to: hsl(var(--primary) / .2) var(--tw-gradient-to-position)}.dark\\:text-blue-100:is(.dark *){--tw-text-opacity: 1;color:rgb(219 234 254 / var(--tw-text-opacity, 1))}.dark\\:text-blue-400:is(.dark *){--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity, 1))}.dark\\:text-gray-100:is(.dark *){--tw-text-opacity: 1;color:rgb(243 244 246 / var(--tw-text-opacity, 1))}.dark\\:text-gray-200:is(.dark *){--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}.dark\\:text-gray-300:is(.dark *){--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.dark\\:text-gray-400:is(.dark *){--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.dark\\:text-gray-900:is(.dark *){--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.dark\\:text-green-100:is(.dark *){--tw-text-opacity: 1;color:rgb(220 252 231 / var(--tw-text-opacity, 1))}.dark\\:text-green-400:is(.dark *){--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.dark\\:text-orange-100:is(.dark *){--tw-text-opacity: 1;color:rgb(255 237 213 / var(--tw-text-opacity, 1))}.dark\\:text-primary-foreground:is(.dark *){--tw-text-opacity: 1;color:hsl(var(--primary-foreground) / var(--tw-text-opacity, 1))}.dark\\:text-purple-400:is(.dark *){--tw-text-opacity: 1;color:rgb(192 132 252 / var(--tw-text-opacity, 1))}.dark\\:text-red-400:is(.dark *){--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.dark\\:text-white:is(.dark *){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.dark\\:text-yellow-400:is(.dark *){--tw-text-opacity: 1;color:rgb(250 204 21 / var(--tw-text-opacity, 1))}.dark\\:shadow-inner:is(.dark *){--tw-shadow: inset 0 2px 4px 0 rgb(0 0 0 / .05);--tw-shadow-colored: inset 0 2px 4px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.dark\\:shadow-lg:is(.dark *){--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.dark\\:shadow-md:is(.dark *){--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.dark\\:shadow-sm:is(.dark *){--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.dark\\:shadow-error\\/10:is(.dark *){--tw-shadow-color: hsl(var(--error) / .1);--tw-shadow: var(--tw-shadow-colored)}.dark\\:shadow-gray-900\\/20:is(.dark *){--tw-shadow-color: rgb(17 24 39 / .2);--tw-shadow: var(--tw-shadow-colored)}.dark\\:shadow-gray-900\\/30:is(.dark *){--tw-shadow-color: rgb(17 24 39 / .3);--tw-shadow: var(--tw-shadow-colored)}.dark\\:shadow-gray-950\\/10:is(.dark *){--tw-shadow-color: rgb(3 7 18 / .1);--tw-shadow: var(--tw-shadow-colored)}.dark\\:shadow-primary\\/10:is(.dark *){--tw-shadow-color: hsl(var(--primary) / .1);--tw-shadow: var(--tw-shadow-colored)}.dark\\:shadow-primary\\/20:is(.dark *){--tw-shadow-color: hsl(var(--primary) / .2);--tw-shadow: var(--tw-shadow-colored)}.dark\\:shadow-purple-500\\/10:is(.dark *){--tw-shadow-color: rgb(168 85 247 / .1);--tw-shadow: var(--tw-shadow-colored)}.dark\\:shadow-success\\/10:is(.dark *){--tw-shadow-color: hsl(var(--success) / .1);--tw-shadow: var(--tw-shadow-colored)}.dark\\:shadow-warning\\/10:is(.dark *){--tw-shadow-color: hsl(var(--warning) / .1);--tw-shadow: var(--tw-shadow-colored)}.dark\\:ring-gray-600:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(75 85 99 / var(--tw-ring-opacity, 1))}.dark\\:ring-offset-gray-950:is(.dark *){--tw-ring-offset-color: #030712}.dark\\:backdrop-blur-sm:is(.dark *){--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.dark\\:shadow-sm:is(.dark *){box-shadow:var(--shadow-sm)}.dark\\:shadow-md:is(.dark *){box-shadow:var(--shadow-md)}.dark\\:shadow-lg:is(.dark *){box-shadow:var(--shadow-lg)}.dark\\:placeholder\\:text-gray-500:is(.dark *)::-moz-placeholder{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.dark\\:placeholder\\:text-gray-500:is(.dark *)::placeholder{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.dark\\:hover\\:border-error\\/80:hover:is(.dark *){border-color:hsl(var(--error) / .8)}.dark\\:hover\\:border-gray-500:hover:is(.dark *){--tw-border-opacity: 1;border-color:rgb(107 114 128 / var(--tw-border-opacity, 1))}.dark\\:hover\\:border-gray-600:hover:is(.dark *){--tw-border-opacity: 1;border-color:rgb(75 85 99 / var(--tw-border-opacity, 1))}.dark\\:hover\\:border-gray-700\\/30:hover:is(.dark *){border-color:#3741514d}.dark\\:hover\\:border-primary\\/30:hover:is(.dark *){border-color:hsl(var(--primary) / .3)}.dark\\:hover\\:border-success\\/80:hover:is(.dark *){border-color:hsl(var(--success) / .8)}.dark\\:hover\\:bg-error\\/80:hover:is(.dark *){background-color:hsl(var(--error) / .8)}.dark\\:hover\\:bg-gray-700:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity, 1))}.dark\\:hover\\:bg-gray-700\\/50:hover:is(.dark *){background-color:#37415180}.dark\\:hover\\:bg-gray-700\\/90:hover:is(.dark *){background-color:#374151e6}.dark\\:hover\\:bg-gray-800:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.dark\\:hover\\:bg-gray-800\\/20:hover:is(.dark *){background-color:#1f293733}.dark\\:hover\\:bg-gray-800\\/30:hover:is(.dark *){background-color:#1f29374d}.dark\\:hover\\:bg-gray-800\\/80:hover:is(.dark *){background-color:#1f2937cc}.dark\\:hover\\:bg-gray-800\\/90:hover:is(.dark *){background-color:#1f2937e6}.dark\\:hover\\:bg-primary\\/30:hover:is(.dark *){background-color:hsl(var(--primary) / .3)}.dark\\:hover\\:bg-primary\\/90:hover:is(.dark *){background-color:hsl(var(--primary) / .9)}.dark\\:hover\\:bg-purple-800:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(107 33 168 / var(--tw-bg-opacity, 1))}.dark\\:hover\\:bg-success\\/80:hover:is(.dark *){background-color:hsl(var(--success) / .8)}.dark\\:hover\\:bg-warning\\/80:hover:is(.dark *){background-color:hsl(var(--warning) / .8)}.dark\\:hover\\:bg-white\\/10:hover:is(.dark *){background-color:#ffffff1a}.dark\\:hover\\:text-blue-300:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(147 197 253 / var(--tw-text-opacity, 1))}.dark\\:hover\\:text-white:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.dark\\:focus\\:bg-gray-700:focus:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity, 1))}.dark\\:focus\\:bg-gray-800:focus:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.dark\\:focus\\:bg-green-900\\/20:focus:is(.dark *){background-color:#14532d33}.dark\\:focus\\:bg-red-900\\/20:focus:is(.dark *){background-color:#7f1d1d33}.dark\\:focus\\:bg-yellow-900\\/20:focus:is(.dark *){background-color:#713f1233}.dark\\:focus\\:text-gray-100:focus:is(.dark *){--tw-text-opacity: 1;color:rgb(243 244 246 / var(--tw-text-opacity, 1))}.dark\\:focus\\:text-gray-200:focus:is(.dark *){--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}.dark\\:focus\\:text-green-300:focus:is(.dark *){--tw-text-opacity: 1;color:rgb(134 239 172 / var(--tw-text-opacity, 1))}.dark\\:focus\\:text-red-300:focus:is(.dark *){--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.dark\\:focus\\:text-yellow-300:focus:is(.dark *){--tw-text-opacity: 1;color:rgb(253 224 71 / var(--tw-text-opacity, 1))}.dark\\:focus-visible\\:border-primary:focus-visible:is(.dark *){--tw-border-opacity: 1;border-color:hsl(var(--primary) / var(--tw-border-opacity, 1))}.dark\\:focus-visible\\:border-primary\\/80:focus-visible:is(.dark *){border-color:hsl(var(--primary) / .8)}.dark\\:focus-visible\\:ring-error\\/25:focus-visible:is(.dark *){--tw-ring-color: hsl(var(--error) / .25)}.dark\\:focus-visible\\:ring-error\\/30:focus-visible:is(.dark *){--tw-ring-color: hsl(var(--error) / .3)}.dark\\:focus-visible\\:ring-gray-500\\/40:focus-visible:is(.dark *){--tw-ring-color: rgb(107 114 128 / .4)}.dark\\:focus-visible\\:ring-primary\\/20:focus-visible:is(.dark *){--tw-ring-color: hsl(var(--primary) / .2)}.dark\\:focus-visible\\:ring-primary\\/30:focus-visible:is(.dark *){--tw-ring-color: hsl(var(--primary) / .3)}.dark\\:focus-visible\\:ring-primary\\/40:focus-visible:is(.dark *){--tw-ring-color: hsl(var(--primary) / .4)}.dark\\:focus-visible\\:ring-primary\\/50:focus-visible:is(.dark *){--tw-ring-color: hsl(var(--primary) / .5)}.dark\\:focus-visible\\:ring-purple-500\\/40:focus-visible:is(.dark *){--tw-ring-color: rgb(168 85 247 / .4)}.dark\\:focus-visible\\:ring-success\\/25:focus-visible:is(.dark *){--tw-ring-color: hsl(var(--success) / .25)}.dark\\:focus-visible\\:ring-success\\/30:focus-visible:is(.dark *){--tw-ring-color: hsl(var(--success) / .3)}.dark\\:focus-visible\\:ring-warning\\/25:focus-visible:is(.dark *){--tw-ring-color: hsl(var(--warning) / .25)}.dark\\:focus-visible\\:ring-offset-gray-950:focus-visible:is(.dark *){--tw-ring-offset-color: #030712}.dark\\:active\\:bg-error\\/70:active:is(.dark *){background-color:hsl(var(--error) / .7)}.dark\\:active\\:bg-gray-600\\/90:active:is(.dark *){background-color:#4b5563e6}.dark\\:active\\:bg-gray-700\\/90:active:is(.dark *){background-color:#374151e6}.dark\\:active\\:bg-gray-800\\/90:active:is(.dark *){background-color:#1f2937e6}.dark\\:active\\:bg-primary\\/40:active:is(.dark *){background-color:hsl(var(--primary) / .4)}.dark\\:active\\:bg-primary\\/80:active:is(.dark *){background-color:hsl(var(--primary) / .8)}.dark\\:active\\:bg-success\\/70:active:is(.dark *){background-color:hsl(var(--success) / .7)}.dark\\:active\\:text-blue-500:active:is(.dark *){--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.peer:disabled~.dark\\:peer-disabled\\:opacity-60:is(.dark *){opacity:.6}.dark\\:data-\\[state\\=active\\]\\:border-primary\\/80[data-state=active]:is(.dark *){border-color:hsl(var(--primary) / .8)}.dark\\:data-\\[state\\=active\\]\\:bg-gray-900[data-state=active]:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity, 1))}.dark\\:data-\\[state\\=active\\]\\:bg-primary\\/90[data-state=active]:is(.dark *){background-color:hsl(var(--primary) / .9)}.dark\\:data-\\[state\\=unchecked\\]\\:bg-gray-700\\/70[data-state=unchecked]:is(.dark *){background-color:#374151b3}.dark\\:data-\\[state\\=active\\]\\:text-gray-100[data-state=active]:is(.dark *){--tw-text-opacity: 1;color:rgb(243 244 246 / var(--tw-text-opacity, 1))}.dark\\:data-\\[state\\=active\\]\\:text-gray-200[data-state=active]:is(.dark *){--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}.dark\\:data-\\[state\\=active\\]\\:text-white[data-state=active]:is(.dark *){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.dark\\:data-\\[state\\=active\\]\\:shadow-gray-950\\/10[data-state=active]:is(.dark *){--tw-shadow-color: rgb(3 7 18 / .1);--tw-shadow: var(--tw-shadow-colored)}.dark\\:data-\\[state\\=active\\]\\:shadow-gray-950\\/20[data-state=active]:is(.dark *){--tw-shadow-color: rgb(3 7 18 / .2);--tw-shadow: var(--tw-shadow-colored)}@media (min-width: 640px){.sm\\:bottom-0{bottom:0}.sm\\:right-0{right:0}.sm\\:top-auto{top:auto}.sm\\:max-w-\\[425px\\]{max-width:425px}.sm\\:max-w-\\[500px\\]{max-width:500px}.sm\\:flex-row{flex-direction:row}.sm\\:flex-col{flex-direction:column}.sm\\:justify-end{justify-content:flex-end}.sm\\:space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.sm\\:text-left{text-align:left}}@media (min-width: 768px){.md\\:max-w-\\[420px\\]{max-width:420px}.md\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (min-width: 1024px){.lg\\:flex{display:flex}.lg\\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\\:space-x-8>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(2rem * var(--tw-space-x-reverse));margin-left:calc(2rem * calc(1 - var(--tw-space-x-reverse)))}}.\\[\\&\\+div\\]\\:text-xs+div{font-size:.75rem;line-height:1rem}.\\[\\&\\>span\\]\\:line-clamp-1>span{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.\\[\\&_blockquote\\]\\:border-l-4 blockquote{border-left-width:4px}.\\[\\&_blockquote\\]\\:border-gray-300 blockquote{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.\\[\\&_blockquote\\]\\:pl-4 blockquote{padding-left:1rem}.\\[\\&_blockquote\\]\\:italic blockquote{font-style:italic}.\\[\\&_h1\\]\\:mb-4 h1{margin-bottom:1rem}.\\[\\&_h1\\]\\:text-3xl h1{font-size:1.875rem;line-height:2.25rem}.\\[\\&_h1\\]\\:font-bold h1{font-weight:700}.\\[\\&_h2\\]\\:mb-3 h2{margin-bottom:.75rem}.\\[\\&_h2\\]\\:text-2xl h2{font-size:1.5rem;line-height:2rem}.\\[\\&_h2\\]\\:font-bold h2{font-weight:700}.\\[\\&_h3\\]\\:mb-2 h3{margin-bottom:.5rem}.\\[\\&_h3\\]\\:text-xl h3{font-size:1.25rem;line-height:1.75rem}.\\[\\&_h3\\]\\:font-bold h3{font-weight:700}.\\[\\&_h4\\]\\:mb-2 h4{margin-bottom:.5rem}.\\[\\&_h4\\]\\:text-lg h4{font-size:1.125rem;line-height:1.75rem}.\\[\\&_h4\\]\\:font-bold h4{font-weight:700}.\\[\\&_h5\\]\\:mb-1 h5{margin-bottom:.25rem}.\\[\\&_h5\\]\\:text-base h5{font-size:1rem;line-height:1.5rem}.\\[\\&_h5\\]\\:font-bold h5{font-weight:700}.\\[\\&_h6\\]\\:mb-1 h6{margin-bottom:.25rem}.\\[\\&_h6\\]\\:text-sm h6{font-size:.875rem;line-height:1.25rem}.\\[\\&_h6\\]\\:font-bold h6{font-weight:700}.\\[\\&_li\\]\\:mb-1 li{margin-bottom:.25rem}.\\[\\&_ol\\]\\:mb-4 ol{margin-bottom:1rem}.\\[\\&_ol\\]\\:list-decimal ol{list-style-type:decimal}.\\[\\&_ol\\]\\:pl-6 ol{padding-left:1.5rem}.\\[\\&_pre\\]\\:overflow-x-auto pre{overflow-x:auto}.\\[\\&_pre\\]\\:rounded pre{border-radius:.25rem}.\\[\\&_pre\\]\\:bg-gray-100 pre{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.\\[\\&_pre\\]\\:p-4 pre{padding:1rem}.\\[\\&_pre\\]\\:dark\\:bg-gray-800:is(.dark *) pre{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.\\[\\&_table\\]\\:mb-4 table{margin-bottom:1rem}.\\[\\&_table\\]\\:w-full table{width:100%}.\\[\\&_table_td\\]\\:border table td{border-width:1px}.\\[\\&_table_td\\]\\:border-gray-300 table td{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.\\[\\&_table_td\\]\\:p-2 table td{padding:.5rem}.\\[\\&_table_th\\]\\:border table th{border-width:1px}.\\[\\&_table_th\\]\\:border-gray-300 table th{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.\\[\\&_table_th\\]\\:bg-gray-50 table th{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.\\[\\&_table_th\\]\\:p-2 table th{padding:.5rem}.\\[\\&_table_th\\]\\:font-semibold table th{font-weight:600}.\\[\\&_ul\\]\\:mb-4 ul{margin-bottom:1rem}.\\[\\&_ul\\]\\:list-disc ul{list-style-type:disc}.\\[\\&_ul\\]\\:pl-6 ul{padding-left:1.5rem}
|
|
47
|
+
`);function I(...t){return tailwindMerge.twMerge(clsx.clsx(t))}classVarianceAuthority.cva("",{variants:{hover:{lift:["transition-all duration-200 ease-out","hover:-translate-y-0.5","hover:shadow-md"],glow:["transition-all duration-300 ease-out","hover:shadow-lg","hover:shadow-primary/20"],scale:["transition-transform duration-200 ease-out","hover:scale-105","active:scale-95"],brightness:["transition-all duration-200 ease-out","hover:brightness-110","active:brightness-95"],border:["transition-all duration-200 ease-out","hover:border-primary/50"]},focus:{ring:["focus:outline-none","focus-visible:ring-2","focus-visible:ring-primary/50","focus-visible:ring-offset-2"],glow:["focus:outline-none","focus-visible:shadow-lg","focus-visible:shadow-primary/30"],border:["focus:outline-none","focus-visible:border-primary","focus-visible:border-2"]},active:{scale:["active:scale-95","transition-transform duration-100"],darken:["active:brightness-90","transition-all duration-100"],depress:["active:translate-y-0.5","active:shadow-sm","transition-all duration-100"]},cursor:{pointer:"cursor-pointer",grab:"cursor-grab active:cursor-grabbing",text:"cursor-text",wait:"cursor-wait",help:"cursor-help",notAllowed:"cursor-not-allowed"}},defaultVariants:{hover:"lift",focus:"ring",active:"scale",cursor:"pointer"}});var $r={smooth:{type:"spring",stiffness:260,damping:20},bouncy:{type:"spring",stiffness:300,damping:15},stiff:{type:"spring",stiffness:400,damping:25},gentle:{type:"spring",stiffness:150,damping:15}},rl={lift:{y:-2,transition:$r.smooth},scale:{scale:1.05,transition:$r.smooth},glow:{boxShadow:"0 0 20px rgba(var(--primary), 0.3)",transition:$r.smooth},rotate:{rotate:2,transition:$r.bouncy}},xg={scale:{scale:.95,transition:{duration:.1}},depress:{y:1,transition:{duration:.1}}};var Eg=classVarianceAuthority.cva("rounded-lg border bg-card text-card-foreground shadow-sm dark:shadow-gray-900/20 dark:border-gray-800 dark:bg-gray-900 dark:text-gray-100 transition-all duration-200",{variants:{variant:{default:"",outline:"border border-border shadow-none bg-transparent dark:border-gray-700 dark:bg-transparent dark:text-gray-200",filled:"border-none bg-secondary dark:bg-gray-800 dark:text-gray-100 dark:shadow-inner dark:shadow-gray-950/10",elevated:"border-none shadow-md dark:shadow-lg dark:shadow-gray-900/30 dark:bg-gray-850 dark:text-gray-100",gradient:"border-none bg-gradient-to-br from-primary/5 to-primary/10 dark:from-primary/10 dark:to-primary/20",glass:"border border-white/20 bg-white/10 backdrop-blur-md dark:border-gray-700/30 dark:bg-gray-800/10"},size:{default:"p-6",sm:"p-4",lg:"p-8",xl:"p-10"},radius:{default:"rounded-lg",sm:"rounded-md",lg:"rounded-xl",full:"rounded-3xl",none:"rounded-none"},interactive:{true:"cursor-pointer hover:shadow-lg hover:border-primary/20 dark:hover:border-primary/30 hover:-translate-y-0.5 active:translate-y-0 active:shadow-sm",false:""}},defaultVariants:{variant:"default",size:"default",radius:"default"}}),yn=ee__namespace.forwardRef(({className:t,variant:e,size:r,radius:n,interactive:o,microInteraction:i="lift",...s},a)=>{if(o&&i!=="none"){let l={whileHover:i==="scale"?rl.scale:i==="glow"?rl.glow:rl.lift,whileTap:xg.scale};return jsxRuntime.jsx(framerMotion.motion.div,{ref:a,className:I(Eg({variant:e,size:r,radius:n,interactive:o,className:t})),...l,...s})}return jsxRuntime.jsx("div",{ref:a,className:I(Eg({variant:e,size:r,radius:n,interactive:o,className:t})),...s})});yn.displayName="Card";var Ss=ee__namespace.forwardRef(({className:t,...e},r)=>jsxRuntime.jsx("div",{ref:r,className:I("flex flex-col space-y-1.5",t),...e}));Ss.displayName="CardHeader";var Cs=ee__namespace.forwardRef(({className:t,...e},r)=>jsxRuntime.jsx("h3",{ref:r,className:I("text-lg font-semibold leading-none tracking-tight",t),...e}));Cs.displayName="CardTitle";var Rs=ee__namespace.forwardRef(({className:t,...e},r)=>jsxRuntime.jsx("p",{ref:r,className:I("text-sm text-muted-foreground",t),...e}));Rs.displayName="CardDescription";var wn=ee__namespace.forwardRef(({className:t,...e},r)=>jsxRuntime.jsx("div",{ref:r,className:I("pt-0",t),...e}));wn.displayName="CardContent";var bT=ee__namespace.forwardRef(({className:t,...e},r)=>jsxRuntime.jsx("div",{ref:r,className:I("flex items-center pt-4",t),...e}));bT.displayName="CardFooter";var wT=classVarianceAuthority.cva(["inline-flex items-center justify-center gap-2 whitespace-nowrap","font-medium relative","transition-all duration-200 ease-out","premium-hover","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2","disabled:opacity-50 disabled:cursor-not-allowed disabled:pointer-events-none"],{variants:{variant:{primary:["bg-primary text-primary-foreground","hover:bg-primary-hover dark:hover:bg-primary/90","active:bg-primary-active dark:active:bg-primary/80","shadow-sm dark:shadow-primary/20 dark:shadow-md","focus-visible:ring-primary/50 dark:focus-visible:ring-primary/30","dark:bg-primary dark:text-white","transition-all duration-200"],secondary:["bg-secondary text-secondary-foreground","hover:bg-gray-200 dark:hover:bg-gray-700/90","active:bg-gray-300 dark:active:bg-gray-600/90","border border-transparent dark:border-gray-700","focus-visible:ring-gray-400/30 dark:focus-visible:ring-gray-500/40","dark:bg-gray-800 dark:text-gray-100","dark:shadow-sm dark:shadow-gray-900/20"],outline:["bg-background text-foreground","border border-gray-300 dark:border-gray-700","hover:border-gray-400 dark:hover:border-gray-500","hover:bg-gray-50 dark:hover:bg-gray-800/80","active:bg-gray-100 dark:active:bg-gray-800/90","focus-visible:ring-gray-400/30 dark:focus-visible:ring-gray-500/40","dark:text-gray-200 dark:bg-gray-900/50","dark:shadow-sm dark:shadow-gray-950/10"],ghost:["text-foreground","hover:bg-gray-100 dark:hover:bg-gray-800/90","active:bg-gray-200 dark:active:bg-gray-700/90","focus-visible:ring-gray-400/30 dark:focus-visible:ring-gray-500/40","dark:text-gray-200","transition-colors duration-200"],destructive:["bg-error text-white","hover:bg-error/90 dark:hover:bg-error/80","active:bg-error/80 dark:active:bg-error/70","shadow-sm dark:shadow-error/10 dark:shadow-md","focus-visible:ring-error/50 dark:focus-visible:ring-error/30","dark:text-white dark:border-error/20","transition-colors duration-200"],success:["bg-success text-white","hover:bg-success/90 dark:hover:bg-success/80","active:bg-success/80 dark:active:bg-success/70","shadow-sm dark:shadow-success/10 dark:shadow-md","focus-visible:ring-success/50 dark:focus-visible:ring-success/30","dark:text-white dark:border-success/20","transition-colors duration-200"],link:["text-primary bg-transparent","underline-offset-4 hover:underline","hover:text-primary-hover active:text-primary-active","p-0 h-auto","dark:text-blue-400 dark:hover:text-blue-300","dark:active:text-blue-500","transition-colors duration-200"],gradient:["bg-gradient-to-r from-blue-600 to-purple-600 text-white","hover:from-blue-700 hover:to-purple-700","active:from-blue-800 active:to-purple-800","shadow-lg shadow-purple-500/25","focus-visible:ring-purple-500/50","transition-all duration-300"],glow:["bg-primary text-primary-foreground","shadow-lg shadow-primary/50","hover:shadow-xl hover:shadow-primary/60","active:shadow-md active:shadow-primary/40","focus-visible:ring-primary/50","transition-all duration-300"],soft:["bg-primary/10 text-primary","hover:bg-primary/20","active:bg-primary/30","focus-visible:ring-primary/50","dark:bg-primary/20 dark:text-primary-foreground","dark:hover:bg-primary/30 dark:active:bg-primary/40","transition-colors duration-200"],glass:["bg-white/10 backdrop-blur-md text-foreground","border border-white/20","hover:bg-white/20 hover:border-white/30","active:bg-white/30","shadow-lg","focus-visible:ring-white/50","dark:bg-gray-800/10 dark:border-gray-700/20","dark:hover:bg-gray-800/20 dark:hover:border-gray-700/30","transition-all duration-200"],neon:["bg-transparent text-primary","border-2 border-primary","hover:bg-primary hover:text-primary-foreground","hover:shadow-[0_0_20px_rgba(var(--primary),0.5)]","active:shadow-[0_0_10px_rgba(var(--primary),0.3)]","focus-visible:ring-primary/50","transition-all duration-300"]},size:{xs:"h-7 px-2.5 text-xs rounded",sm:"h-8 px-3 text-sm rounded",md:"h-10 px-4 text-base rounded-md",lg:"h-12 px-6 text-lg rounded-lg",xl:"h-14 px-8 text-xl rounded-lg",icon:"h-10 w-10 p-2 rounded-md","icon-sm":"h-8 w-8 p-1.5 rounded","icon-lg":"h-12 w-12 p-3 rounded-lg"},rounded:{default:"",full:"rounded-full",none:"rounded-none"},fullWidth:{true:"w-full"}},defaultVariants:{variant:"primary",size:"md",rounded:"default",fullWidth:!1}}),xe=ee__namespace.forwardRef(({className:t,variant:e,size:r,rounded:n,fullWidth:o,asChild:i=!1,loading:s=!1,leftIcon:a,rightIcon:l,children:c,disabled:d,...u},f)=>jsxRuntime.jsxs("button",{className:I(wT({variant:e,size:r,rounded:n,fullWidth:o,className:t})),ref:f,disabled:d||s,"data-loading":s?"":void 0,...u,children:[s&&jsxRuntime.jsx(lucideReact.Loader2,{className:"w-4 h-4 animate-spin","aria-hidden":"true"}),!s&&a,c,!s&&l]}));xe.displayName="Button";var ST=classVarianceAuthority.cva(["inline-flex items-center gap-1.5","font-medium transition-colors duration-200","border focus:outline-none","focus-visible:ring-2 focus-visible:ring-offset-1"],{variants:{variant:{primary:["border-transparent bg-primary text-primary-foreground","hover:bg-primary-hover dark:hover:bg-primary/90","focus-visible:ring-primary/30 dark:focus-visible:ring-primary/40","dark:bg-primary/90 dark:text-white dark:shadow-inner dark:shadow-primary/10"],secondary:["border-transparent bg-secondary text-secondary-foreground","hover:bg-gray-200 dark:hover:bg-gray-700/90","focus-visible:ring-gray-400/30 dark:focus-visible:ring-gray-500/40","dark:bg-gray-800 dark:text-gray-100 dark:shadow-inner dark:shadow-gray-950/10"],outline:["border-gray-200 dark:border-gray-700","bg-transparent text-foreground","hover:border-gray-300 dark:hover:border-gray-600","focus-visible:ring-gray-400/30 dark:focus-visible:ring-gray-500/40","dark:text-gray-200 dark:bg-transparent dark:backdrop-blur-sm"],destructive:["border-transparent bg-error text-white","hover:bg-error/90 dark:hover:bg-error/80","focus-visible:ring-error/30 dark:focus-visible:ring-error/25","dark:bg-error/90 dark:text-white dark:shadow-inner dark:shadow-error/10"],success:["border-transparent bg-success text-white","hover:bg-success/90 dark:hover:bg-success/80","focus-visible:ring-success/30 dark:focus-visible:ring-success/25","dark:bg-success/90 dark:text-white dark:shadow-inner dark:shadow-success/10"],warning:["border-transparent bg-warning text-white","hover:bg-warning/90 dark:hover:bg-warning/80","focus-visible:ring-warning/30 dark:focus-visible:ring-warning/25","dark:bg-warning/90 dark:text-gray-900 dark:shadow-inner dark:shadow-warning/10"],ghost:["border-transparent bg-transparent text-foreground","hover:bg-gray-100 dark:hover:bg-gray-800/80","focus-visible:ring-gray-400/30 dark:focus-visible:ring-gray-500/40","dark:text-gray-200 dark:backdrop-blur-sm","transition-colors duration-200"],pro:["border-transparent bg-gradient-to-r from-purple-600 to-pink-600 text-white","hover:from-purple-700 hover:to-pink-700","focus-visible:ring-purple-400/30 dark:focus-visible:ring-purple-500/40","shadow-md dark:shadow-lg dark:shadow-purple-500/10"],admin:["border-transparent bg-gradient-to-r from-purple-600 to-pink-600 text-white","hover:from-purple-700 hover:to-pink-700","focus-visible:ring-purple-400/30 dark:focus-visible:ring-purple-500/40","shadow-md dark:shadow-lg dark:shadow-purple-500/10"]},size:{sm:"h-5 px-2 text-xs",md:"h-6 px-3 text-sm",lg:"h-8 px-4 text-base"},radius:{default:"rounded-full",sm:"rounded-md",lg:"rounded-xl",none:"rounded-none"}},defaultVariants:{variant:"primary",size:"md",radius:"default"}});function Ts({className:t,variant:e,size:r,radius:n,withDot:o,dotColor:i,removable:s,onRemove:a,leftIcon:l,rightIcon:c,children:d,...u}){let f=l,p=d;return e==="pro"&&(f=l||jsxRuntime.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"w-3 h-3",children:[jsxRuntime.jsx("path",{d:"M12 0L13.09 8.26L22 9L13.09 9.74L12 18L10.91 9.74L2 9L10.91 8.26L12 0Z",fill:"currentColor"}),jsxRuntime.jsx("path",{d:"M19 5L19.5 7L21 7.5L19.5 8L19 10L18.5 8L17 7.5L18.5 7L19 5Z",fill:"currentColor"}),jsxRuntime.jsx("path",{d:"M19 15L19.5 17L21 17.5L19.5 18L19 20L18.5 18L17 17.5L18.5 17L19 15Z",fill:"currentColor"})]}),p=d||"Pro"),e==="admin"&&(f=l||jsxRuntime.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"w-3 h-3",children:jsxRuntime.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z",fill:"currentColor"})}),p=d||"Admin Pro"),jsxRuntime.jsxs("div",{className:I(ST({variant:e,size:r,radius:n}),t),"data-removable":s?"":void 0,...u,children:[o&&jsxRuntime.jsx("span",{className:I("h-2 w-2 rounded-full",i||(e==="destructive"||e==="success"||e==="warning"?"bg-white":e==="secondary"?"bg-secondary-foreground":e==="outline"||e==="ghost"?"bg-foreground":e==="pro"||e==="admin"?"bg-white":"bg-primary-foreground")),"aria-hidden":"true"}),f&&jsxRuntime.jsx("span",{className:"inline-flex shrink-0",children:f}),jsxRuntime.jsx("span",{className:"truncate",children:p}),c&&jsxRuntime.jsx("span",{className:"inline-flex shrink-0",children:c}),s&&a&&jsxRuntime.jsx("button",{type:"button",className:"ml-1 -mr-1 h-3.5 w-3.5 rounded-full inline-flex items-center justify-center hover:bg-black/10 dark:hover:bg-white/10",onClick:h=>{h.stopPropagation(),a();},"aria-label":"Remove badge",children:jsxRuntime.jsx("svg",{width:"8",height:"8",viewBox:"0 0 8 8",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"opacity-70","aria-hidden":"true",children:jsxRuntime.jsx("path",{d:"M0.799988 7.19999L7.19999 0.799988M0.799988 0.799988L7.19999 7.19999",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]})}function xi(){return {isLoading:!1,isAuthenticated:!0,isAdmin:!1,hasProAccess:!0,subscriptionPlan:"pro",subscription:{status:"active",plan:"pro"}}}var CT=classVarianceAuthority.cva("group relative flex items-center w-full transition-colors",{variants:{size:{sm:"",md:"",lg:""}},defaultVariants:{size:"md"}}),RT=classVarianceAuthority.cva(["w-full bg-background transition-all duration-200","text-foreground placeholder:text-muted-foreground dark:placeholder:text-gray-500","disabled:cursor-not-allowed disabled:opacity-50","file:border-0 file:bg-transparent file:font-medium","focus-visible:outline-none dark:text-gray-200"],{variants:{variant:{standard:"border border-gray-300 dark:border-gray-700 rounded-md px-3 py-2 hover:border-gray-400 dark:hover:border-gray-600 focus-visible:ring-2 focus-visible:ring-primary/30 dark:focus-visible:ring-primary/20 focus-visible:border-primary dark:focus-visible:border-primary/80 dark:bg-gray-900/60 dark:shadow-inner dark:shadow-gray-950/10",filled:"border border-transparent bg-gray-100 dark:bg-gray-800/90 rounded-md px-3 py-2 hover:bg-gray-200 dark:hover:bg-gray-700/90 focus-visible:ring-2 focus-visible:ring-primary/30 dark:focus-visible:ring-primary/20 dark:shadow-inner dark:shadow-gray-950/10",ghost:"border-none bg-transparent shadow-none px-1 dark:text-gray-300 dark:placeholder:text-gray-500 hover:bg-gray-100/50 dark:hover:bg-gray-800/30 focus-visible:bg-transparent",underline:"border-t-0 border-l-0 border-r-0 border-b border-gray-300 dark:border-gray-600 rounded-none px-0 py-2 hover:border-gray-400 dark:hover:border-gray-500 focus-visible:ring-0 focus-visible:border-b-2 focus-visible:border-primary dark:focus-visible:border-primary/80 dark:text-gray-300"},size:{sm:"h-8 text-xs",md:"h-10 text-sm",lg:"h-12 text-base"},hasLeftIcon:{true:"pl-10",false:""},hasRightIcon:{true:"pr-10",false:""},hasRightButton:{true:"pr-10",false:""},isError:{true:"border-error focus-visible:ring-error/30 focus-visible:border-error hover:border-error/80 dark:hover:border-error/80",false:""},isSuccess:{true:"border-success focus-visible:ring-success/30 focus-visible:border-success hover:border-success/80 dark:hover:border-success/80",false:""},isDisabled:{true:"opacity-50 cursor-not-allowed bg-gray-50 dark:bg-gray-800/50 pointer-events-none",false:""}},defaultVariants:{variant:"standard",size:"md",isError:!1,isSuccess:!1,isDisabled:!1,hasLeftIcon:!1,hasRightIcon:!1,hasRightButton:!1}}),Ft=ee__namespace.forwardRef(({className:t,wrapperClassName:e,messageClassName:r,variant:n,size:o,isError:i,disabled:s,error:a,success:l,loading:c,leftIcon:d,rightIcon:u,rightButton:f,alwaysShowMessage:p=!1,...h},m)=>{let g=p||a||l,b=a?"error":l?"success":"normal";return jsxRuntime.jsxs("div",{className:"space-y-1.5 w-full",children:[jsxRuntime.jsxs("div",{className:I(CT({size:o}),e),children:[d&&jsxRuntime.jsx("div",{className:"absolute left-3 text-gray-500 flex items-center justify-center pointer-events-none",children:c?jsxRuntime.jsx(lucideReact.Loader2,{className:"h-4 w-4 animate-spin"}):d}),jsxRuntime.jsx("input",{className:I(RT({variant:n,size:o,isError:!!a||i,isSuccess:!!l,isDisabled:s||c,hasLeftIcon:!!d||c,hasRightIcon:!!u,hasRightButton:!!f}),t),ref:m,disabled:s||c,"data-loading":c?"":void 0,"data-error":a?"":void 0,"data-success":l?"":void 0,"aria-invalid":!!a||!!i||void 0,"aria-describedby":a?`${h.id||""}-error`:l?`${h.id||""}-success`:void 0,...h}),u&&!c&&jsxRuntime.jsx("div",{className:"absolute right-3 text-gray-500 flex items-center justify-center pointer-events-none",children:u}),f&&jsxRuntime.jsx("div",{className:"absolute right-3",children:f}),c&&!d&&jsxRuntime.jsx("div",{className:"absolute left-3 text-gray-500 flex items-center justify-center pointer-events-none",children:jsxRuntime.jsx(lucideReact.Loader2,{className:"h-4 w-4 animate-spin","aria-hidden":"true"})})]}),g&&jsxRuntime.jsx("p",{className:I("text-xs transition-all",b==="error"&&"text-error",b==="success"&&"text-success",b==="normal"&&"text-muted-foreground",r),id:a?`${h.id||""}-error`:l?`${h.id||""}-success`:void 0,children:a||l||""})]})});Ft.displayName="Input";function _g(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e);}function Ro(...t){return e=>{let r=!1,n=t.map(o=>{let i=_g(o,e);return !r&&typeof i=="function"&&(r=!0),i});if(r)return ()=>{for(let o=0;o<n.length;o++){let i=n[o];typeof i=="function"?i():_g(t[o],null);}}}}function Le(...t){return ee__namespace.useCallback(Ro(...t),t)}function Br(t){let e=TT(t),r=ee__namespace.forwardRef((n,o)=>{let{children:i,...s}=n,a=ee__namespace.Children.toArray(i),l=a.find(_T);if(l){let c=l.props.children,d=a.map(u=>u===l?ee__namespace.Children.count(c)>1?ee__namespace.Children.only(null):ee__namespace.isValidElement(c)?c.props.children:null:u);return jsxRuntime.jsx(e,{...s,ref:o,children:ee__namespace.isValidElement(c)?ee__namespace.cloneElement(c,void 0,d):null})}return jsxRuntime.jsx(e,{...s,ref:o,children:i})});return r.displayName=`${t}.Slot`,r}function TT(t){let e=ee__namespace.forwardRef((r,n)=>{let{children:o,...i}=r;if(ee__namespace.isValidElement(o)){let s=AT(o),a=MT(i,o.props);return o.type!==ee__namespace.Fragment&&(a.ref=n?Ro(n,s):s),ee__namespace.cloneElement(o,a)}return ee__namespace.Children.count(o)>1?ee__namespace.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var NT=Symbol("radix.slottable");function _T(t){return ee__namespace.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===NT}function MT(t,e){let r={...e};for(let n in e){let o=t[n],i=e[n];/^on[A-Z]/.test(n)?o&&i?r[n]=(...a)=>{let l=i(...a);return o(...a),l}:o&&(r[n]=o):n==="style"?r[n]={...o,...i}:n==="className"&&(r[n]=[o,i].filter(Boolean).join(" "));}return {...t,...r}}function AT(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,r=e&&"isReactWarning"in e&&e.isReactWarning;return r?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}var DT=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],fe=DT.reduce((t,e)=>{let r=Br(`Primitive.${e}`),n=ee__namespace.forwardRef((o,i)=>{let{asChild:s,...a}=o,l=s?r:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),jsxRuntime.jsx(l,{...a,ref:i})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function Ei(t,e){t&&Dg__namespace.flushSync(()=>t.dispatchEvent(e));}var IT="Label",Ig=ee__namespace.forwardRef((t,e)=>jsxRuntime.jsx(fe.label,{...t,ref:e,onMouseDown:r=>{r.target.closest("button, input, select, textarea")||(t.onMouseDown?.(r),!r.defaultPrevented&&r.detail>1&&r.preventDefault());}}));Ig.displayName=IT;var cu=Ig;var BT=classVarianceAuthority.cva("text-sm font-medium leading-none text-gray-900 dark:text-gray-200 peer-disabled:cursor-not-allowed peer-disabled:opacity-70 dark:peer-disabled:opacity-60 transition-colors duration-200"),He=ee__namespace.forwardRef(({className:t,...e},r)=>jsxRuntime.jsx(cu,{ref:r,className:I(BT(),t),...e}));He.displayName=cu.displayName;var du=ee__namespace.default.forwardRef(({className:t,...e},r)=>jsxRuntime.jsx("textarea",{className:I("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),ref:r,...e}));du.displayName="Textarea";function pe(){return pe=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n]);}return t},pe.apply(null,arguments)}function uu(t,[e,r]){return Math.min(r,Math.max(e,t))}function mt(t,e,{checkForDefaultPrevented:r=!0}={}){return function(o){if(t?.(o),r===!1||!o.defaultPrevented)return e?.(o)}}function ki(t,e=[]){let r=[];function n(i,s){let a=ee.createContext(s),l=r.length;r=[...r,s];function c(u){let{scope:f,children:p,...h}=u,m=f?.[t][l]||a,g=ee.useMemo(()=>h,Object.values(h));return ee.createElement(m.Provider,{value:g},p)}function d(u,f){let p=f?.[t][l]||a,h=ee.useContext(p);if(h)return h;if(s!==void 0)return s;throw new Error(`\`${u}\` must be used within \`${i}\``)}return c.displayName=i+"Provider",[c,d]}let o=()=>{let i=r.map(s=>ee.createContext(s));return function(a){let l=a?.[t]||i;return ee.useMemo(()=>({[`__scope${t}`]:{...a,[t]:l}}),[a,l])}};return o.scopeName=t,[n,KT(o,...e)]}function KT(...t){let e=t[0];if(t.length===1)return e;let r=()=>{let n=t.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){let s=n.reduce((a,{useScope:l,scopeName:c})=>{let u=l(i)[`__scope${c}`];return {...a,...u}},{});return ee.useMemo(()=>({[`__scope${e.scopeName}`]:s}),[s])}};return r.scopeName=e.scopeName,r}function GT(t,e){typeof t=="function"?t(e):t!=null&&(t.current=e);}function pu(...t){return e=>t.forEach(r=>GT(r,e))}function dt(...t){return ee.useCallback(pu(...t),t)}var Yn=ee.forwardRef((t,e)=>{let{children:r,...n}=t,o=ee.Children.toArray(r),i=o.find(YT);if(i){let s=i.props.children,a=o.map(l=>l===i?ee.Children.count(s)>1?ee.Children.only(null):ee.isValidElement(s)?s.props.children:null:l);return ee.createElement(mu,pe({},n,{ref:e}),ee.isValidElement(s)?ee.cloneElement(s,void 0,a):null)}return ee.createElement(mu,pe({},n,{ref:e}),r)});Yn.displayName="Slot";var mu=ee.forwardRef((t,e)=>{let{children:r,...n}=t;return ee.isValidElement(r)?ee.cloneElement(r,{...XT(n,r.props),ref:e?pu(e,r.ref):r.ref}):ee.Children.count(r)>1?ee.Children.only(null):null});mu.displayName="SlotClone";var jT=({children:t})=>ee.createElement(ee.Fragment,null,t);function YT(t){return ee.isValidElement(t)&&t.type===jT}function XT(t,e){let r={...e};for(let n in e){let o=t[n],i=e[n];/^on[A-Z]/.test(n)?o&&i?r[n]=(...a)=>{i(...a),o(...a);}:o&&(r[n]=o):n==="style"?r[n]={...o,...i}:n==="className"&&(r[n]=[o,i].filter(Boolean).join(" "));}return {...t,...r}}function zg(t){let e=t+"CollectionProvider",[r,n]=ki(e),[o,i]=r(e,{collectionRef:{current:null},itemMap:new Map}),s=p=>{let{scope:h,children:m}=p,g=ee__namespace.default.useRef(null),b=ee__namespace.default.useRef(new Map).current;return ee__namespace.default.createElement(o,{scope:h,itemMap:b,collectionRef:g},m)},a=t+"CollectionSlot",l=ee__namespace.default.forwardRef((p,h)=>{let{scope:m,children:g}=p,b=i(a,m),v=dt(h,b.collectionRef);return ee__namespace.default.createElement(Yn,{ref:v},g)}),c=t+"CollectionItemSlot",d="data-radix-collection-item",u=ee__namespace.default.forwardRef((p,h)=>{let{scope:m,children:g,...b}=p,v=ee__namespace.default.useRef(null),y=dt(h,v),x=i(c,m);return ee__namespace.default.useEffect(()=>(x.itemMap.set(v,{ref:v,...b}),()=>void x.itemMap.delete(v))),ee__namespace.default.createElement(Yn,{[d]:"",ref:y},g)});function f(p){let h=i(t+"CollectionConsumer",p);return ee__namespace.default.useCallback(()=>{let g=h.collectionRef.current;if(!g)return [];let b=Array.from(g.querySelectorAll(`[${d}]`));return Array.from(h.itemMap.values()).sort((x,E)=>b.indexOf(x.ref.current)-b.indexOf(E.ref.current))},[h.collectionRef,h.itemMap])}return [{Provider:s,Slot:l,ItemSlot:u},f,n]}var QT=ee.createContext(void 0);function Hg(t){let e=ee.useContext(QT);return t||e||"ltr"}var oN=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],ut=oN.reduce((t,e)=>{let r=ee.forwardRef((n,o)=>{let{asChild:i,...s}=n,a=i?Yn:e;return ee.useEffect(()=>{window[Symbol.for("radix-ui")]=!0;},[]),ee.createElement(a,pe({},s,{ref:o}))});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function Ug(t,e){t&&Dg.flushSync(()=>t.dispatchEvent(e));}function Yt(t){let e=ee.useRef(t);return ee.useEffect(()=>{e.current=t;}),ee.useMemo(()=>(...r)=>{var n;return (n=e.current)===null||n===void 0?void 0:n.call(e,...r)},[])}function Vg(t,e=globalThis?.document){let r=Yt(t);ee.useEffect(()=>{let n=o=>{o.key==="Escape"&&r(o);};return e.addEventListener("keydown",n),()=>e.removeEventListener("keydown",n)},[r,e]);}var bu="dismissableLayer.update",pN="dismissableLayer.pointerDownOutside",hN="dismissableLayer.focusOutside",Wg,mN=ee.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),qg=ee.forwardRef((t,e)=>{var r;let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:a,onDismiss:l,...c}=t,d=ee.useContext(mN),[u,f]=ee.useState(null),p=(r=u?.ownerDocument)!==null&&r!==void 0?r:globalThis?.document,[,h]=ee.useState({}),m=dt(e,w=>f(w)),g=Array.from(d.layers),[b]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),v=g.indexOf(b),y=u?g.indexOf(u):-1,x=d.layersWithOutsidePointerEventsDisabled.size>0,E=y>=v,S=gN(w=>{let N=w.target,M=[...d.branches].some(B=>B.contains(N));!E||M||(i?.(w),a?.(w),w.defaultPrevented||l?.());},p),R=bN(w=>{let N=w.target;[...d.branches].some(B=>B.contains(N))||(s?.(w),a?.(w),w.defaultPrevented||l?.());},p);return Vg(w=>{y===d.layers.size-1&&(o?.(w),!w.defaultPrevented&&l&&(w.preventDefault(),l()));},p),ee.useEffect(()=>{if(u)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(Wg=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(u)),d.layers.add(u),Gg(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=Wg);}},[u,p,n,d]),ee.useEffect(()=>()=>{u&&(d.layers.delete(u),d.layersWithOutsidePointerEventsDisabled.delete(u),Gg());},[u,d]),ee.useEffect(()=>{let w=()=>h({});return document.addEventListener(bu,w),()=>document.removeEventListener(bu,w)},[]),ee.createElement(ut.div,pe({},c,{ref:m,style:{pointerEvents:x?E?"auto":"none":void 0,...t.style},onFocusCapture:mt(t.onFocusCapture,R.onFocusCapture),onBlurCapture:mt(t.onBlurCapture,R.onBlurCapture),onPointerDownCapture:mt(t.onPointerDownCapture,S.onPointerDownCapture)}))});function gN(t,e=globalThis?.document){let r=Yt(t),n=ee.useRef(!1),o=ee.useRef(()=>{});return ee.useEffect(()=>{let i=a=>{if(a.target&&!n.current){let c=function(){jg(pN,r,l,{discrete:!0});},l={originalEvent:a};a.pointerType==="touch"?(e.removeEventListener("click",o.current),o.current=c,e.addEventListener("click",o.current,{once:!0})):c();}n.current=!1;},s=window.setTimeout(()=>{e.addEventListener("pointerdown",i);},0);return ()=>{window.clearTimeout(s),e.removeEventListener("pointerdown",i),e.removeEventListener("click",o.current);}},[e,r]),{onPointerDownCapture:()=>n.current=!0}}function bN(t,e=globalThis?.document){let r=Yt(t),n=ee.useRef(!1);return ee.useEffect(()=>{let o=i=>{i.target&&!n.current&&jg(hN,r,{originalEvent:i},{discrete:!1});};return e.addEventListener("focusin",o),()=>e.removeEventListener("focusin",o)},[e,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function Gg(){let t=new CustomEvent(bu);document.dispatchEvent(t);}function jg(t,e,r,{discrete:n}){let o=r.originalEvent.target,i=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:r});e&&o.addEventListener(t,e,{once:!0}),n?Ug(o,i):o.dispatchEvent(i);}var vu=0;function Xg(){ee.useEffect(()=>{var t,e;let r=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(t=r[0])!==null&&t!==void 0?t:Yg()),document.body.insertAdjacentElement("beforeend",(e=r[1])!==null&&e!==void 0?e:Yg()),vu++,()=>{vu===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(n=>n.remove()),vu--;}},[]);}function Yg(){let t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",t}var yu="focusScope.autoFocusOnMount",wu="focusScope.autoFocusOnUnmount",Qg={bubbles:!1,cancelable:!0};var nb=ee.forwardRef((t,e)=>{let{loop:r=!1,trapped:n=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=t,[a,l]=ee.useState(null),c=Yt(o),d=Yt(i),u=ee.useRef(null),f=dt(e,m=>l(m)),p=ee.useRef({paused:!1,pause(){this.paused=!0;},resume(){this.paused=!1;}}).current;ee.useEffect(()=>{if(n){let m=function(y){if(p.paused||!a)return;let x=y.target;a.contains(x)?u.current=x:Xn(u.current,{select:!0});},g=function(y){if(p.paused||!a)return;let x=y.relatedTarget;x!==null&&(a.contains(x)||Xn(u.current,{select:!0}));},b=function(y){let x=document.activeElement;for(let E of y)E.removedNodes.length>0&&(a!=null&&a.contains(x)||Xn(a));};document.addEventListener("focusin",m),document.addEventListener("focusout",g);let v=new MutationObserver(b);return a&&v.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",g),v.disconnect();}}},[n,a,p.paused]),ee.useEffect(()=>{if(a){tb.add(p);let m=document.activeElement;if(!a.contains(m)){let b=new CustomEvent(yu,Qg);a.addEventListener(yu,c),a.dispatchEvent(b),b.defaultPrevented||(kN(NN(ob(a)),{select:!0}),document.activeElement===m&&Xn(a));}return ()=>{a.removeEventListener(yu,c),setTimeout(()=>{let b=new CustomEvent(wu,Qg);a.addEventListener(wu,d),a.dispatchEvent(b),b.defaultPrevented||Xn(m??document.body,{select:!0}),a.removeEventListener(wu,d),tb.remove(p);},0);}}},[a,c,d,p]);let h=ee.useCallback(m=>{if(!r&&!n||p.paused)return;let g=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,b=document.activeElement;if(g&&b){let v=m.currentTarget,[y,x]=SN(v);y&&x?!m.shiftKey&&b===x?(m.preventDefault(),r&&Xn(y,{select:!0})):m.shiftKey&&b===y&&(m.preventDefault(),r&&Xn(x,{select:!0})):b===v&&m.preventDefault();}},[r,n,p.paused]);return ee.createElement(ut.div,pe({tabIndex:-1},s,{ref:f,onKeyDown:h}))});function kN(t,{select:e=!1}={}){let r=document.activeElement;for(let n of t)if(Xn(n,{select:e}),document.activeElement!==r)return}function SN(t){let e=ob(t),r=eb(e,t),n=eb(e.reverse(),t);return [r,n]}function ob(t){let e=[],r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{let o=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||o?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)e.push(r.currentNode);return e}function eb(t,e){for(let r of t)if(!CN(r,{upTo:e}))return r}function CN(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return !0;for(;t;){if(e!==void 0&&t===e)return !1;if(getComputedStyle(t).display==="none")return !0;t=t.parentElement;}return !1}function RN(t){return t instanceof HTMLInputElement&&"select"in t}function Xn(t,{select:e=!1}={}){if(t&&t.focus){let r=document.activeElement;t.focus({preventScroll:!0}),t!==r&&RN(t)&&e&&t.select();}}var tb=TN();function TN(){let t=[];return {add(e){let r=t[0];e!==r&&r?.pause(),t=rb(t,e),t.unshift(e);},remove(e){var r;t=rb(t,e),(r=t[0])===null||r===void 0||r.resume();}}}function rb(t,e){let r=[...t],n=r.indexOf(e);return n!==-1&&r.splice(n,1),r}function NN(t){return t.filter(e=>e.tagName!=="A")}var zt=globalThis?.document?ee.useLayoutEffect:()=>{};var MN=ee__namespace["useId".toString()]||(()=>{}),AN=0;function Eu(t){let[e,r]=ee__namespace.useState(MN());return zt(()=>{t||r(n=>n??String(AN++));},[t]),t||(e?`radix-${e}`:"")}var ab=["top","right","bottom","left"];var Yr=Math.min,Xt=Math.max,As=Math.round,Os=Math.floor,Fr=t=>({x:t,y:t}),ON={left:"right",right:"left",bottom:"top",top:"bottom"},DN={start:"end",end:"start"};function il(t,e,r){return Xt(t,Yr(e,r))}function Xr(t,e){return typeof t=="function"?t(e):t}function Jr(t){return t.split("-")[0]}function To(t){return t.split("-")[1]}function sl(t){return t==="x"?"y":"x"}function al(t){return t==="y"?"height":"width"}var PN=new Set(["top","bottom"]);function zr(t){return PN.has(Jr(t))?"y":"x"}function ll(t){return sl(zr(t))}function lb(t,e,r){r===void 0&&(r=!1);let n=To(t),o=ll(t),i=al(o),s=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(s=Ms(s)),[s,Ms(s)]}function cb(t){let e=Ms(t);return [ol(t),e,ol(e)]}function ol(t){return t.replace(/start|end/g,e=>DN[e])}var ib=["left","right"],sb=["right","left"],IN=["top","bottom"],LN=["bottom","top"];function $N(t,e,r){switch(t){case"top":case"bottom":return r?e?sb:ib:e?ib:sb;case"left":case"right":return e?IN:LN;default:return []}}function db(t,e,r,n){let o=To(t),i=$N(Jr(t),r==="start",n);return o&&(i=i.map(s=>s+"-"+o),e&&(i=i.concat(i.map(ol)))),i}function Ms(t){return t.replace(/left|right|bottom|top/g,e=>ON[e])}function BN(t){return {top:0,right:0,bottom:0,left:0,...t}}function ku(t){return typeof t!="number"?BN(t):{top:t,right:t,bottom:t,left:t}}function No(t){let{x:e,y:r,width:n,height:o}=t;return {width:n,height:o,top:r,left:e,right:e+n,bottom:r+o,x:e,y:r}}function ub(t,e,r){let{reference:n,floating:o}=t,i=zr(e),s=ll(e),a=al(s),l=Jr(e),c=i==="y",d=n.x+n.width/2-o.width/2,u=n.y+n.height/2-o.height/2,f=n[a]/2-o[a]/2,p;switch(l){case"top":p={x:d,y:n.y-o.height};break;case"bottom":p={x:d,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:u};break;case"left":p={x:n.x-o.width,y:u};break;default:p={x:n.x,y:n.y};}switch(To(e)){case"start":p[s]-=f*(r&&c?-1:1);break;case"end":p[s]+=f*(r&&c?-1:1);break}return p}var hb=async(t,e,r)=>{let{placement:n="bottom",strategy:o="absolute",middleware:i=[],platform:s}=r,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(e)),c=await s.getElementRects({reference:t,floating:e,strategy:o}),{x:d,y:u}=ub(c,n,l),f=n,p={},h=0;for(let m=0;m<a.length;m++){let{name:g,fn:b}=a[m],{x:v,y,data:x,reset:E}=await b({x:d,y:u,initialPlacement:n,placement:f,strategy:o,middlewareData:p,rects:c,platform:s,elements:{reference:t,floating:e}});d=v??d,u=y??u,p={...p,[g]:{...p[g],...x}},E&&h<=50&&(h++,typeof E=="object"&&(E.placement&&(f=E.placement),E.rects&&(c=E.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:o}):E.rects),{x:d,y:u}=ub(c,f,l)),m=-1);}return {x:d,y:u,placement:f,strategy:o,middlewareData:p}};async function Si(t,e){var r;e===void 0&&(e={});let{x:n,y:o,platform:i,rects:s,elements:a,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:f=!1,padding:p=0}=Xr(e,t),h=ku(p),g=a[f?u==="floating"?"reference":"floating":u],b=No(await i.getClippingRect({element:(r=await(i.isElement==null?void 0:i.isElement(g)))==null||r?g:g.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:d,strategy:l})),v=u==="floating"?{x:n,y:o,width:s.floating.width,height:s.floating.height}:s.reference,y=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),x=await(i.isElement==null?void 0:i.isElement(y))?await(i.getScale==null?void 0:i.getScale(y))||{x:1,y:1}:{x:1,y:1},E=No(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:y,strategy:l}):v);return {top:(b.top-E.top+h.top)/x.y,bottom:(E.bottom-b.bottom+h.bottom)/x.y,left:(b.left-E.left+h.left)/x.x,right:(E.right-b.right+h.right)/x.x}}var mb=t=>({name:"arrow",options:t,async fn(e){let{x:r,y:n,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=e,{element:c,padding:d=0}=Xr(t,e)||{};if(c==null)return {};let u=ku(d),f={x:r,y:n},p=ll(o),h=al(p),m=await s.getDimensions(c),g=p==="y",b=g?"top":"left",v=g?"bottom":"right",y=g?"clientHeight":"clientWidth",x=i.reference[h]+i.reference[p]-f[p]-i.floating[h],E=f[p]-i.reference[p],S=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c)),R=S?S[y]:0;(!R||!await(s.isElement==null?void 0:s.isElement(S)))&&(R=a.floating[y]||i.floating[h]);let w=x/2-E/2,N=R/2-m[h]/2-1,M=Yr(u[b],N),B=Yr(u[v],N),U=M,K=R-m[h]-B,P=R/2-m[h]/2+w,V=il(U,P,K),C=!l.arrow&&To(o)!=null&&P!==V&&i.reference[h]/2-(P<U?M:B)-m[h]/2<0,T=C?P<U?P-U:P-K:0;return {[p]:f[p]+T,data:{[p]:V,centerOffset:P-V-T,...C&&{alignmentOffset:T}},reset:C}}});var gb=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var r,n;let{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=e,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:m=!0,...g}=Xr(t,e);if((r=i.arrow)!=null&&r.alignmentOffset)return {};let b=Jr(o),v=zr(a),y=Jr(a)===a,x=await(l.isRTL==null?void 0:l.isRTL(c.floating)),E=f||(y||!m?[Ms(a)]:cb(a)),S=h!=="none";!f&&S&&E.push(...db(a,m,h,x));let R=[a,...E],w=await Si(e,g),N=[],M=((n=i.flip)==null?void 0:n.overflows)||[];if(d&&N.push(w[b]),u){let P=lb(o,s,x);N.push(w[P[0]],w[P[1]]);}if(M=[...M,{placement:o,overflows:N}],!N.every(P=>P<=0)){var B,U;let P=(((B=i.flip)==null?void 0:B.index)||0)+1,V=R[P];if(V&&(!(u==="alignment"?v!==zr(V):!1)||M.every(_=>_.overflows[0]>0&&zr(_.placement)===v)))return {data:{index:P,overflows:M},reset:{placement:V}};let C=(U=M.filter(T=>T.overflows[0]<=0).sort((T,_)=>T.overflows[1]-_.overflows[1])[0])==null?void 0:U.placement;if(!C)switch(p){case"bestFit":{var K;let T=(K=M.filter(_=>{if(S){let A=zr(_.placement);return A===v||A==="y"}return !0}).map(_=>[_.placement,_.overflows.filter(A=>A>0).reduce((A,L)=>A+L,0)]).sort((_,A)=>_[1]-A[1])[0])==null?void 0:K[0];T&&(C=T);break}case"initialPlacement":C=a;break}if(o!==C)return {reset:{placement:C}}}return {}}}};function fb(t,e){return {top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function pb(t){return ab.some(e=>t[e]>=0)}var bb=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){let{rects:r}=e,{strategy:n="referenceHidden",...o}=Xr(t,e);switch(n){case"referenceHidden":{let i=await Si(e,{...o,elementContext:"reference"}),s=fb(i,r.reference);return {data:{referenceHiddenOffsets:s,referenceHidden:pb(s)}}}case"escaped":{let i=await Si(e,{...o,altBoundary:!0}),s=fb(i,r.floating);return {data:{escapedOffsets:s,escaped:pb(s)}}}default:return {}}}}};var vb=new Set(["left","top"]);async function FN(t,e){let{placement:r,platform:n,elements:o}=t,i=await(n.isRTL==null?void 0:n.isRTL(o.floating)),s=Jr(r),a=To(r),l=zr(r)==="y",c=vb.has(s)?-1:1,d=i&&l?-1:1,u=Xr(e,t),{mainAxis:f,crossAxis:p,alignmentAxis:h}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return a&&typeof h=="number"&&(p=a==="end"?h*-1:h),l?{x:p*d,y:f*c}:{x:f*c,y:p*d}}var yb=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var r,n;let{x:o,y:i,placement:s,middlewareData:a}=e,l=await FN(e,t);return s===((r=a.offset)==null?void 0:r.placement)&&(n=a.arrow)!=null&&n.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},wb=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){let{x:r,y:n,placement:o}=e,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:g=>{let{x:b,y:v}=g;return {x:b,y:v}}},...l}=Xr(t,e),c={x:r,y:n},d=await Si(e,l),u=zr(Jr(o)),f=sl(u),p=c[f],h=c[u];if(i){let g=f==="y"?"top":"left",b=f==="y"?"bottom":"right",v=p+d[g],y=p-d[b];p=il(v,p,y);}if(s){let g=u==="y"?"top":"left",b=u==="y"?"bottom":"right",v=h+d[g],y=h-d[b];h=il(v,h,y);}let m=a.fn({...e,[f]:p,[u]:h});return {...m,data:{x:m.x-r,y:m.y-n,enabled:{[f]:i,[u]:s}}}}}},xb=function(t){return t===void 0&&(t={}),{options:t,fn(e){let{x:r,y:n,placement:o,rects:i,middlewareData:s}=e,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=Xr(t,e),d={x:r,y:n},u=zr(o),f=sl(u),p=d[f],h=d[u],m=Xr(a,e),g=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){let y=f==="y"?"height":"width",x=i.reference[f]-i.floating[y]+g.mainAxis,E=i.reference[f]+i.reference[y]-g.mainAxis;p<x?p=x:p>E&&(p=E);}if(c){var b,v;let y=f==="y"?"width":"height",x=vb.has(Jr(o)),E=i.reference[u]-i.floating[y]+(x&&((b=s.offset)==null?void 0:b[u])||0)+(x?0:g.crossAxis),S=i.reference[u]+i.reference[y]+(x?0:((v=s.offset)==null?void 0:v[u])||0)-(x?g.crossAxis:0);h<E?h=E:h>S&&(h=S);}return {[f]:p,[u]:h}}}},Eb=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var r,n;let{placement:o,rects:i,platform:s,elements:a}=e,{apply:l=()=>{},...c}=Xr(t,e),d=await Si(e,c),u=Jr(o),f=To(o),p=zr(o)==="y",{width:h,height:m}=i.floating,g,b;u==="top"||u==="bottom"?(g=u,b=f===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(b=u,g=f==="end"?"top":"bottom");let v=m-d.top-d.bottom,y=h-d.left-d.right,x=Yr(m-d[g],v),E=Yr(h-d[b],y),S=!e.middlewareData.shift,R=x,w=E;if((r=e.middlewareData.shift)!=null&&r.enabled.x&&(w=y),(n=e.middlewareData.shift)!=null&&n.enabled.y&&(R=v),S&&!f){let M=Xt(d.left,0),B=Xt(d.right,0),U=Xt(d.top,0),K=Xt(d.bottom,0);p?w=h-2*(M!==0||B!==0?M+B:Xt(d.left,d.right)):R=m-2*(U!==0||K!==0?U+K:Xt(d.top,d.bottom));}await l({...e,availableWidth:w,availableHeight:R});let N=await s.getDimensions(a.floating);return h!==N.width||m!==N.height?{reset:{rects:!0}}:{}}}};function cl(){return typeof window<"u"}function Mo(t){return Sb(t)?(t.nodeName||"").toLowerCase():"#document"}function or(t){var e;return (t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Hr(t){var e;return (e=(Sb(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Sb(t){return cl()?t instanceof Node||t instanceof or(t).Node:!1}function xr(t){return cl()?t instanceof Element||t instanceof or(t).Element:!1}function Ur(t){return cl()?t instanceof HTMLElement||t instanceof or(t).HTMLElement:!1}function kb(t){return !cl()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof or(t).ShadowRoot}var zN=new Set(["inline","contents"]);function Ci(t){let{overflow:e,overflowX:r,overflowY:n,display:o}=Er(t);return /auto|scroll|overlay|hidden|clip/.test(e+n+r)&&!zN.has(o)}var HN=new Set(["table","td","th"]);function Cb(t){return HN.has(Mo(t))}var UN=[":popover-open",":modal"];function Ds(t){return UN.some(e=>{try{return t.matches(e)}catch{return !1}})}var VN=["transform","translate","scale","rotate","perspective"],KN=["transform","translate","scale","rotate","perspective","filter"],WN=["paint","layout","strict","content"];function dl(t){let e=ul(),r=xr(t)?Er(t):t;return VN.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!e&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!e&&(r.filter?r.filter!=="none":!1)||KN.some(n=>(r.willChange||"").includes(n))||WN.some(n=>(r.contain||"").includes(n))}function Rb(t){let e=xn(t);for(;Ur(e)&&!Ao(e);){if(dl(e))return e;if(Ds(e))return null;e=xn(e);}return null}function ul(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}var GN=new Set(["html","body","#document"]);function Ao(t){return GN.has(Mo(t))}function Er(t){return or(t).getComputedStyle(t)}function Ps(t){return xr(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function xn(t){if(Mo(t)==="html")return t;let e=t.assignedSlot||t.parentNode||kb(t)&&t.host||Hr(t);return kb(e)?e.host:e}function Tb(t){let e=xn(t);return Ao(e)?t.ownerDocument?t.ownerDocument.body:t.body:Ur(e)&&Ci(e)?e:Tb(e)}function _o(t,e,r){var n;e===void 0&&(e=[]),r===void 0&&(r=!0);let o=Tb(t),i=o===((n=t.ownerDocument)==null?void 0:n.body),s=or(o);if(i){let a=fl(s);return e.concat(s,s.visualViewport||[],Ci(o)?o:[],a&&r?_o(a):[])}return e.concat(o,_o(o,[],r))}function fl(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Mb(t){let e=Er(t),r=parseFloat(e.width)||0,n=parseFloat(e.height)||0,o=Ur(t),i=o?t.offsetWidth:r,s=o?t.offsetHeight:n,a=As(r)!==i||As(n)!==s;return a&&(r=i,n=s),{width:r,height:n,$:a}}function Cu(t){return xr(t)?t:t.contextElement}function Ri(t){let e=Cu(t);if(!Ur(e))return Fr(1);let r=e.getBoundingClientRect(),{width:n,height:o,$:i}=Mb(e),s=(i?As(r.width):r.width)/n,a=(i?As(r.height):r.height)/o;return (!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}var qN=Fr(0);function Ab(t){let e=or(t);return !ul()||!e.visualViewport?qN:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function jN(t,e,r){return e===void 0&&(e=!1),!r||e&&r!==or(t)?!1:e}function Oo(t,e,r,n){e===void 0&&(e=!1),r===void 0&&(r=!1);let o=t.getBoundingClientRect(),i=Cu(t),s=Fr(1);e&&(n?xr(n)&&(s=Ri(n)):s=Ri(t));let a=jN(i,r,n)?Ab(i):Fr(0),l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,d=o.width/s.x,u=o.height/s.y;if(i){let f=or(i),p=n&&xr(n)?or(n):n,h=f,m=fl(h);for(;m&&n&&p!==h;){let g=Ri(m),b=m.getBoundingClientRect(),v=Er(m),y=b.left+(m.clientLeft+parseFloat(v.paddingLeft))*g.x,x=b.top+(m.clientTop+parseFloat(v.paddingTop))*g.y;l*=g.x,c*=g.y,d*=g.x,u*=g.y,l+=y,c+=x,h=or(m),m=fl(h);}}return No({width:d,height:u,x:l,y:c})}function Ru(t,e){let r=Ps(t).scrollLeft;return e?e.left+r:Oo(Hr(t)).left+r}function Ob(t,e,r){r===void 0&&(r=!1);let n=t.getBoundingClientRect(),o=n.left+e.scrollLeft-(r?0:Ru(t,n)),i=n.top+e.scrollTop;return {x:o,y:i}}function YN(t){let{elements:e,rect:r,offsetParent:n,strategy:o}=t,i=o==="fixed",s=Hr(n),a=e?Ds(e.floating):!1;if(n===s||a&&i)return r;let l={scrollLeft:0,scrollTop:0},c=Fr(1),d=Fr(0),u=Ur(n);if((u||!u&&!i)&&((Mo(n)!=="body"||Ci(s))&&(l=Ps(n)),Ur(n))){let p=Oo(n);c=Ri(n),d.x=p.x+n.clientLeft,d.y=p.y+n.clientTop;}let f=s&&!u&&!i?Ob(s,l,!0):Fr(0);return {width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-l.scrollLeft*c.x+d.x+f.x,y:r.y*c.y-l.scrollTop*c.y+d.y+f.y}}function XN(t){return Array.from(t.getClientRects())}function JN(t){let e=Hr(t),r=Ps(t),n=t.ownerDocument.body,o=Xt(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Xt(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),s=-r.scrollLeft+Ru(t),a=-r.scrollTop;return Er(n).direction==="rtl"&&(s+=Xt(e.clientWidth,n.clientWidth)-o),{width:o,height:i,x:s,y:a}}function ZN(t,e){let r=or(t),n=Hr(t),o=r.visualViewport,i=n.clientWidth,s=n.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;let c=ul();(!c||c&&e==="fixed")&&(a=o.offsetLeft,l=o.offsetTop);}return {width:i,height:s,x:a,y:l}}var QN=new Set(["absolute","fixed"]);function e_(t,e){let r=Oo(t,!0,e==="fixed"),n=r.top+t.clientTop,o=r.left+t.clientLeft,i=Ur(t)?Ri(t):Fr(1),s=t.clientWidth*i.x,a=t.clientHeight*i.y,l=o*i.x,c=n*i.y;return {width:s,height:a,x:l,y:c}}function Nb(t,e,r){let n;if(e==="viewport")n=ZN(t,r);else if(e==="document")n=JN(Hr(t));else if(xr(e))n=e_(e,r);else {let o=Ab(t);n={x:e.x-o.x,y:e.y-o.y,width:e.width,height:e.height};}return No(n)}function Db(t,e){let r=xn(t);return r===e||!xr(r)||Ao(r)?!1:Er(r).position==="fixed"||Db(r,e)}function t_(t,e){let r=e.get(t);if(r)return r;let n=_o(t,[],!1).filter(a=>xr(a)&&Mo(a)!=="body"),o=null,i=Er(t).position==="fixed",s=i?xn(t):t;for(;xr(s)&&!Ao(s);){let a=Er(s),l=dl(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&QN.has(o.position)||Ci(s)&&!l&&Db(t,s))?n=n.filter(d=>d!==s):o=a,s=xn(s);}return e.set(t,n),n}function r_(t){let{element:e,boundary:r,rootBoundary:n,strategy:o}=t,s=[...r==="clippingAncestors"?Ds(e)?[]:t_(e,this._c):[].concat(r),n],a=s[0],l=s.reduce((c,d)=>{let u=Nb(e,d,o);return c.top=Xt(u.top,c.top),c.right=Yr(u.right,c.right),c.bottom=Yr(u.bottom,c.bottom),c.left=Xt(u.left,c.left),c},Nb(e,a,o));return {width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function n_(t){let{width:e,height:r}=Mb(t);return {width:e,height:r}}function o_(t,e,r){let n=Ur(e),o=Hr(e),i=r==="fixed",s=Oo(t,!0,i,e),a={scrollLeft:0,scrollTop:0},l=Fr(0);function c(){l.x=Ru(o);}if(n||!n&&!i)if((Mo(e)!=="body"||Ci(o))&&(a=Ps(e)),n){let p=Oo(e,!0,i,e);l.x=p.x+e.clientLeft,l.y=p.y+e.clientTop;}else o&&c();i&&!n&&o&&c();let d=o&&!n&&!i?Ob(o,a):Fr(0),u=s.left+a.scrollLeft-l.x-d.x,f=s.top+a.scrollTop-l.y-d.y;return {x:u,y:f,width:s.width,height:s.height}}function Su(t){return Er(t).position==="static"}function _b(t,e){if(!Ur(t)||Er(t).position==="fixed")return null;if(e)return e(t);let r=t.offsetParent;return Hr(t)===r&&(r=r.ownerDocument.body),r}function Pb(t,e){let r=or(t);if(Ds(t))return r;if(!Ur(t)){let o=xn(t);for(;o&&!Ao(o);){if(xr(o)&&!Su(o))return o;o=xn(o);}return r}let n=_b(t,e);for(;n&&Cb(n)&&Su(n);)n=_b(n,e);return n&&Ao(n)&&Su(n)&&!dl(n)?r:n||Rb(t)||r}var i_=async function(t){let e=this.getOffsetParent||Pb,r=this.getDimensions,n=await r(t.floating);return {reference:o_(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function s_(t){return Er(t).direction==="rtl"}var Ib={convertOffsetParentRelativeRectToViewportRelativeRect:YN,getDocumentElement:Hr,getClippingRect:r_,getOffsetParent:Pb,getElementRects:i_,getClientRects:XN,getDimensions:n_,getScale:Ri,isElement:xr,isRTL:s_};function Lb(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function a_(t,e){let r=null,n,o=Hr(t);function i(){var a;clearTimeout(n),(a=r)==null||a.disconnect(),r=null;}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();let c=t.getBoundingClientRect(),{left:d,top:u,width:f,height:p}=c;if(a||e(),!f||!p)return;let h=Os(u),m=Os(o.clientWidth-(d+f)),g=Os(o.clientHeight-(u+p)),b=Os(d),y={rootMargin:-h+"px "+-m+"px "+-g+"px "+-b+"px",threshold:Xt(0,Yr(1,l))||1},x=!0;function E(S){let R=S[0].intersectionRatio;if(R!==l){if(!x)return s();R?s(!1,R):n=setTimeout(()=>{s(!1,1e-7);},1e3);}R===1&&!Lb(c,t.getBoundingClientRect())&&s(),x=!1;}try{r=new IntersectionObserver(E,{...y,root:o.ownerDocument});}catch{r=new IntersectionObserver(E,y);}r.observe(t);}return s(!0),i}function Is(t,e,r,n){n===void 0&&(n={});let{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,c=Cu(t),d=o||i?[...c?_o(c):[],..._o(e)]:[];d.forEach(b=>{o&&b.addEventListener("scroll",r,{passive:!0}),i&&b.addEventListener("resize",r);});let u=c&&a?a_(c,r):null,f=-1,p=null;s&&(p=new ResizeObserver(b=>{let[v]=b;v&&v.target===c&&p&&(p.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var y;(y=p)==null||y.observe(e);})),r();}),c&&!l&&p.observe(c),p.observe(e));let h,m=l?Oo(t):null;l&&g();function g(){let b=Oo(t);m&&!Lb(m,b)&&r(),m=b,h=requestAnimationFrame(g);}return r(),()=>{var b;d.forEach(v=>{o&&v.removeEventListener("scroll",r),i&&v.removeEventListener("resize",r);}),u?.(),(b=p)==null||b.disconnect(),p=null,l&&cancelAnimationFrame(h);}}var $b=yb;var Bb=wb,Fb=gb,zb=Eb,Hb=bb,Tu=mb;var Ub=xb,Nu=(t,e,r)=>{let n=new Map,o={platform:Ib,...r},i={...o.platform,_c:n};return hb(t,e,{...o,platform:i})};var c_=typeof document<"u",d_=function(){},pl=c_?ee.useLayoutEffect:d_;function hl(t,e){if(t===e)return !0;if(typeof t!=typeof e)return !1;if(typeof t=="function"&&t.toString()===e.toString())return !0;let r,n,o;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(r=t.length,r!==e.length)return !1;for(n=r;n--!==0;)if(!hl(t[n],e[n]))return !1;return !0}if(o=Object.keys(t),r=o.length,r!==Object.keys(e).length)return !1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(e,o[n]))return !1;for(n=r;n--!==0;){let i=o[n];if(!(i==="_owner"&&t.$$typeof)&&!hl(t[i],e[i]))return !1}return !0}return t!==t&&e!==e}function Wb(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Vb(t,e){let r=Wb(t);return Math.round(e*r)/r}function _u(t){let e=ee__namespace.useRef(t);return pl(()=>{e.current=t;}),e}function ml(t){t===void 0&&(t={});let{placement:e="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=t,[d,u]=ee__namespace.useState({x:0,y:0,strategy:r,placement:e,middlewareData:{},isPositioned:!1}),[f,p]=ee__namespace.useState(n);hl(f,n)||p(n);let[h,m]=ee__namespace.useState(null),[g,b]=ee__namespace.useState(null),v=ee__namespace.useCallback(_=>{_!==S.current&&(S.current=_,m(_));},[]),y=ee__namespace.useCallback(_=>{_!==R.current&&(R.current=_,b(_));},[]),x=i||h,E=s||g,S=ee__namespace.useRef(null),R=ee__namespace.useRef(null),w=ee__namespace.useRef(d),N=l!=null,M=_u(l),B=_u(o),U=_u(c),K=ee__namespace.useCallback(()=>{if(!S.current||!R.current)return;let _={placement:e,strategy:r,middleware:f};B.current&&(_.platform=B.current),Nu(S.current,R.current,_).then(A=>{let L={...A,isPositioned:U.current!==!1};P.current&&!hl(w.current,L)&&(w.current=L,Dg__namespace.flushSync(()=>{u(L);}));});},[f,e,r,B,U]);pl(()=>{c===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,u(_=>({..._,isPositioned:!1})));},[c]);let P=ee__namespace.useRef(!1);pl(()=>(P.current=!0,()=>{P.current=!1;}),[]),pl(()=>{if(x&&(S.current=x),E&&(R.current=E),x&&E){if(M.current)return M.current(x,E,K);K();}},[x,E,K,M,N]);let V=ee__namespace.useMemo(()=>({reference:S,floating:R,setReference:v,setFloating:y}),[v,y]),C=ee__namespace.useMemo(()=>({reference:x,floating:E}),[x,E]),T=ee__namespace.useMemo(()=>{let _={position:r,left:0,top:0};if(!C.floating)return _;let A=Vb(C.floating,d.x),L=Vb(C.floating,d.y);return a?{..._,transform:"translate("+A+"px, "+L+"px)",...Wb(C.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:A,top:L}},[r,a,C.floating,d.x,d.y]);return ee__namespace.useMemo(()=>({...d,update:K,refs:V,elements:C,floatingStyles:T}),[d,K,V,C,T])}var u_=t=>{function e(r){return {}.hasOwnProperty.call(r,"current")}return {name:"arrow",options:t,fn(r){let{element:n,padding:o}=typeof t=="function"?t(r):t;return n&&e(n)?n.current!=null?Tu({element:n.current,padding:o}).fn(r):{}:n?Tu({element:n,padding:o}).fn(r):{}}}},gl=(t,e)=>({...$b(t),options:[t,e]}),bl=(t,e)=>({...Bb(t),options:[t,e]}),vl=(t,e)=>({...Ub(t),options:[t,e]}),yl=(t,e)=>({...Fb(t),options:[t,e]}),wl=(t,e)=>({...zb(t),options:[t,e]});var xl=(t,e)=>({...Hb(t),options:[t,e]});var El=(t,e)=>({...u_(t),options:[t,e]});function Gb(t){let[e,r]=ee.useState(void 0);return zt(()=>{if(t){r({width:t.offsetWidth,height:t.offsetHeight});let n=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;let i=o[0],s,a;if("borderBoxSize"in i){let l=i.borderBoxSize,c=Array.isArray(l)?l[0]:l;s=c.inlineSize,a=c.blockSize;}else s=t.offsetWidth,a=t.offsetHeight;r({width:s,height:a});});return n.observe(t,{box:"border-box"}),()=>n.unobserve(t)}else r(void 0);},[t]),e}var jb="Popper",[Yb,Mu]=ki(jb),[m_,Xb]=Yb(jb),g_=t=>{let{__scopePopper:e,children:r}=t,[n,o]=ee.useState(null);return ee.createElement(m_,{scope:e,anchor:n,onAnchorChange:o},r)},b_="PopperAnchor",v_=ee.forwardRef((t,e)=>{let{__scopePopper:r,virtualRef:n,...o}=t,i=Xb(b_,r),s=ee.useRef(null),a=dt(e,s);return ee.useEffect(()=>{i.onAnchorChange(n?.current||s.current);}),n?null:ee.createElement(ut.div,pe({},o,{ref:a}))}),Jb="PopperContent",[y_,BH]=Yb(Jb),w_=ee.forwardRef((t,e)=>{var r,n,o,i,s,a,l,c;let{__scopePopper:d,side:u="bottom",sideOffset:f=0,align:p="center",alignOffset:h=0,arrowPadding:m=0,collisionBoundary:g=[],collisionPadding:b=0,sticky:v="partial",hideWhenDetached:y=!1,avoidCollisions:x=!0,onPlaced:E,...S}=t,R=Xb(Jb,d),[w,N]=ee.useState(null),M=dt(e,Ke=>N(Ke)),[B,U]=ee.useState(null),K=Gb(B),P=(r=K?.width)!==null&&r!==void 0?r:0,V=(n=K?.height)!==null&&n!==void 0?n:0,C=u+(p!=="center"?"-"+p:""),T=typeof b=="number"?b:{top:0,right:0,bottom:0,left:0,...b},_=Array.isArray(g)?g:[g],A=_.length>0,L={padding:T,boundary:_.filter(x_),altBoundary:A},{refs:Y,floatingStyles:te,placement:ke,isPositioned:me,middlewareData:Te}=ml({strategy:"fixed",placement:C,whileElementsMounted:Is,elements:{reference:R.anchor},middleware:[gl({mainAxis:f+V,alignmentAxis:h}),x&&bl({mainAxis:!0,crossAxis:!1,limiter:v==="partial"?vl():void 0,...L}),x&&yl({...L}),wl({...L,apply:({elements:Ke,rects:nt,availableWidth:Re,availableHeight:wt})=>{let{width:D,height:re}=nt.reference,ce=Ke.floating.style;ce.setProperty("--radix-popper-available-width",`${Re}px`),ce.setProperty("--radix-popper-available-height",`${wt}px`),ce.setProperty("--radix-popper-anchor-width",`${D}px`),ce.setProperty("--radix-popper-anchor-height",`${re}px`);}}),B&&El({element:B,padding:m}),E_({arrowWidth:P,arrowHeight:V}),y&&xl({strategy:"referenceHidden"})]}),[Ae,W]=Zb(ke),ue=Yt(E);zt(()=>{me&&ue?.();},[me,ue]);let Oe=(o=Te.arrow)===null||o===void 0?void 0:o.x,Se=(i=Te.arrow)===null||i===void 0?void 0:i.y,le=((s=Te.arrow)===null||s===void 0?void 0:s.centerOffset)!==0,[Ce,$e]=ee.useState();return zt(()=>{w&&$e(window.getComputedStyle(w).zIndex);},[w]),ee.createElement("div",{ref:Y.setFloating,"data-radix-popper-content-wrapper":"",style:{...te,transform:me?te.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Ce,["--radix-popper-transform-origin"]:[(a=Te.transformOrigin)===null||a===void 0?void 0:a.x,(l=Te.transformOrigin)===null||l===void 0?void 0:l.y].join(" ")},dir:t.dir},ee.createElement(y_,{scope:d,placedSide:Ae,onArrowChange:U,arrowX:Oe,arrowY:Se,shouldHideArrow:le},ee.createElement(ut.div,pe({"data-side":Ae,"data-align":W},S,{ref:M,style:{...S.style,animation:me?void 0:"none",opacity:(c=Te.hide)!==null&&c!==void 0&&c.referenceHidden?0:void 0}}))))});function x_(t){return t!==null}var E_=t=>({name:"transformOrigin",options:t,fn(e){var r,n,o,i,s;let{placement:a,rects:l,middlewareData:c}=e,u=((r=c.arrow)===null||r===void 0?void 0:r.centerOffset)!==0,f=u?0:t.arrowWidth,p=u?0:t.arrowHeight,[h,m]=Zb(a),g={start:"0%",center:"50%",end:"100%"}[m],b=((n=(o=c.arrow)===null||o===void 0?void 0:o.x)!==null&&n!==void 0?n:0)+f/2,v=((i=(s=c.arrow)===null||s===void 0?void 0:s.y)!==null&&i!==void 0?i:0)+p/2,y="",x="";return h==="bottom"?(y=u?g:`${b}px`,x=`${-p}px`):h==="top"?(y=u?g:`${b}px`,x=`${l.floating.height+p}px`):h==="right"?(y=`${-p}px`,x=u?g:`${v}px`):h==="left"&&(y=`${l.floating.width+p}px`,x=u?g:`${v}px`),{data:{x:y,y:x}}}});function Zb(t){let[e,r="center"]=t.split("-");return [e,r]}var Qb=g_,ev=v_,tv=w_;var rv=ee.forwardRef((t,e)=>{var r;let{container:n=globalThis==null||(r=globalThis.document)===null||r===void 0?void 0:r.body,...o}=t;return n?Dg__namespace.default.createPortal(ee.createElement(ut.div,pe({},o,{ref:e})),n):null});function Au({prop:t,defaultProp:e,onChange:r=()=>{}}){let[n,o]=M_({defaultProp:e,onChange:r}),i=t!==void 0,s=i?t:n,a=Yt(r),l=ee.useCallback(c=>{if(i){let u=typeof c=="function"?c(t):c;u!==t&&a(u);}else o(c);},[i,t,o,a]);return [s,l]}function M_({defaultProp:t,onChange:e}){let r=ee.useState(t),[n]=r,o=ee.useRef(n),i=Yt(e);return ee.useEffect(()=>{o.current!==n&&(i(n),o.current=n);},[n,o,i]),r}function nv(t){let e=ee.useRef({value:t,previous:t});return ee.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}function D_(t,e){typeof t=="function"?t(e):t!=null&&(t.current=e);}function ov(...t){return e=>t.forEach(r=>D_(r,e))}var Pu=ee.forwardRef((t,e)=>{let{children:r,...n}=t,o=ee.Children.toArray(r),i=o.find(L_);if(i){let s=i.props.children,a=o.map(l=>l===i?ee.Children.count(s)>1?ee.Children.only(null):ee.isValidElement(s)?s.props.children:null:l);return ee.createElement(Du,pe({},n,{ref:e}),ee.isValidElement(s)?ee.cloneElement(s,void 0,a):null)}return ee.createElement(Du,pe({},n,{ref:e}),r)});Pu.displayName="Slot";var Du=ee.forwardRef((t,e)=>{let{children:r,...n}=t;return ee.isValidElement(r)?ee.cloneElement(r,{...$_(n,r.props),ref:e?ov(e,r.ref):r.ref}):ee.Children.count(r)>1?ee.Children.only(null):null});Du.displayName="SlotClone";var I_=({children:t})=>ee.createElement(ee.Fragment,null,t);function L_(t){return ee.isValidElement(t)&&t.type===I_}function $_(t,e){let r={...e};for(let n in e){let o=t[n],i=e[n];/^on[A-Z]/.test(n)?o&&i?r[n]=(...a)=>{i(...a),o(...a);}:o&&(r[n]=o):n==="style"?r[n]={...o,...i}:n==="className"&&(r[n]=[o,i].filter(Boolean).join(" "));}return {...t,...r}}var H_=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],av=H_.reduce((t,e)=>{let r=ee.forwardRef((n,o)=>{let{asChild:i,...s}=n,a=i?Pu:e;return ee.useEffect(()=>{window[Symbol.for("radix-ui")]=!0;},[]),ee.createElement(a,pe({},s,{ref:o}))});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});var lv=ee.forwardRef((t,e)=>ee.createElement(av.span,pe({},t,{ref:e,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...t.style}})));var K_=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},Ti=new WeakMap,Cl=new WeakMap,Rl={},Iu=0,cv=function(t){return t&&(t.host||cv(t.parentNode))},W_=function(t,e){return e.map(function(r){if(t.contains(r))return r;var n=cv(r);return n&&t.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",t,". Doing nothing"),null)}).filter(function(r){return !!r})},G_=function(t,e,r,n){var o=W_(e,Array.isArray(t)?t:[t]);Rl[r]||(Rl[r]=new WeakMap);var i=Rl[r],s=[],a=new Set,l=new Set(o),c=function(u){!u||a.has(u)||(a.add(u),c(u.parentNode));};o.forEach(c);var d=function(u){!u||l.has(u)||Array.prototype.forEach.call(u.children,function(f){if(a.has(f))d(f);else try{var p=f.getAttribute(n),h=p!==null&&p!=="false",m=(Ti.get(f)||0)+1,g=(i.get(f)||0)+1;Ti.set(f,m),i.set(f,g),s.push(f),m===1&&h&&Cl.set(f,!0),g===1&&f.setAttribute(r,"true"),h||f.setAttribute(n,"true");}catch(b){console.error("aria-hidden: cannot operate on ",f,b);}});};return d(e),a.clear(),Iu++,function(){s.forEach(function(u){var f=Ti.get(u)-1,p=i.get(u)-1;Ti.set(u,f),i.set(u,p),f||(Cl.has(u)||u.removeAttribute(n),Cl.delete(u)),p||u.removeAttribute(r);}),Iu--,Iu||(Ti=new WeakMap,Ti=new WeakMap,Cl=new WeakMap,Rl={});}},Jn=function(t,e,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(t)?t:[t]),o=e||K_(t);return o?(n.push.apply(n,Array.from(o.querySelectorAll("[aria-live], script"))),G_(n,o,r,"aria-hidden")):function(){return null}};var ot=function(){return ot=Object.assign||function(e){for(var r,n=1,o=arguments.length;n<o;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i]);}return e},ot.apply(this,arguments)};function Ni(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]]);return r}function Tl(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,i;n<o;n++)(i||!(n in e))&&(i||(i=Array.prototype.slice.call(e,0,n)),i[n]=e[n]);return t.concat(i||Array.prototype.slice.call(e))}var En="right-scroll-bar-position",kn="width-before-scroll-bar",Lu="with-scroll-bars-hidden",$u="--removed-body-scroll-bar-size";function Nl(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function dv(t,e){var r=ee.useState(function(){return {value:t,callback:e,facade:{get current(){return r.value},set current(n){var o=r.value;o!==n&&(r.value=n,r.callback(n,o));}}}})[0];return r.callback=e,r.facade}var j_=typeof window<"u"?ee__namespace.useLayoutEffect:ee__namespace.useEffect,uv=new WeakMap;function Bs(t,e){var r=dv(e||null,function(n){return t.forEach(function(o){return Nl(o,n)})});return j_(function(){var n=uv.get(r);if(n){var o=new Set(n),i=new Set(t),s=r.current;o.forEach(function(a){i.has(a)||Nl(a,null);}),i.forEach(function(a){o.has(a)||Nl(a,s);});}uv.set(r,t);},[t]),r}function Y_(t){return t}function X_(t,e){e===void 0&&(e=Y_);var r=[],n=!1,o={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:t},useMedium:function(i){var s=e(i,n);return r.push(s),function(){r=r.filter(function(a){return a!==s});}},assignSyncMedium:function(i){for(n=!0;r.length;){var s=r;r=[],s.forEach(i);}r={push:function(a){return i(a)},filter:function(){return r}};},assignMedium:function(i){n=!0;var s=[];if(r.length){var a=r;r=[],a.forEach(i),s=r;}var l=function(){var d=s;s=[],d.forEach(i);},c=function(){return Promise.resolve().then(l)};c(),r={push:function(d){s.push(d),c();},filter:function(d){return s=s.filter(d),r}};}};return o}function Fs(t){t===void 0&&(t={});var e=X_(null);return e.options=ot({async:!0,ssr:!1},t),e}var pv=function(t){var e=t.sideCar,r=Ni(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=e.read();if(!n)throw new Error("Sidecar medium not found");return ee__namespace.createElement(n,ot({},r))};pv.isSideCarExport=!0;function zs(t,e){return t.useMedium(e),pv}var Ml=Fs();var Bu=function(){},Hs=ee__namespace.forwardRef(function(t,e){var r=ee__namespace.useRef(null),n=ee__namespace.useState({onScrollCapture:Bu,onWheelCapture:Bu,onTouchMoveCapture:Bu}),o=n[0],i=n[1],s=t.forwardProps,a=t.children,l=t.className,c=t.removeScrollBar,d=t.enabled,u=t.shards,f=t.sideCar,p=t.noIsolation,h=t.inert,m=t.allowPinchZoom,g=t.as,b=g===void 0?"div":g,v=Ni(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),y=f,x=Bs([r,e]),E=ot(ot({},v),o);return ee__namespace.createElement(ee__namespace.Fragment,null,d&&ee__namespace.createElement(y,{sideCar:Ml,removeScrollBar:c,shards:u,noIsolation:p,inert:h,setCallbacks:i,allowPinchZoom:!!m,lockRef:r}),s?ee__namespace.cloneElement(ee__namespace.Children.only(a),ot(ot({},E),{ref:x})):ee__namespace.createElement(b,ot({},E,{className:l,ref:x}),a))});Hs.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Hs.classNames={fullWidth:kn,zeroRight:En};var mv=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function J_(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=mv();return e&&t.setAttribute("nonce",e),t}function Z_(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e));}function Q_(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t);}var Fu=function(){var t=0,e=null;return {add:function(r){t==0&&(e=J_())&&(Z_(e,r),Q_(e)),t++;},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null);}}};var zu=function(){var t=Fu();return function(e,r){ee__namespace.useEffect(function(){return t.add(e),function(){t.remove();}},[e&&r]);}};var Do=function(){var t=zu(),e=function(r){var n=r.styles,o=r.dynamic;return t(n,o),null};return e};var eM={left:0,top:0,right:0,gap:0},Hu=function(t){return parseInt(t||"",10)||0},tM=function(t){var e=window.getComputedStyle(document.body),r=e[t==="padding"?"paddingLeft":"marginLeft"],n=e[t==="padding"?"paddingTop":"marginTop"],o=e[t==="padding"?"paddingRight":"marginRight"];return [Hu(r),Hu(n),Hu(o)]},Uu=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return eM;var e=tM(t),r=document.documentElement.clientWidth,n=window.innerWidth;return {left:e[0],top:e[1],right:e[2],gap:Math.max(0,n-r+e[2]-e[0])}};var rM=Do(),_i="data-scroll-locked",nM=function(t,e,r,n){var o=t.left,i=t.top,s=t.right,a=t.gap;return r===void 0&&(r="margin"),`
|
|
48
|
+
.`.concat(Lu,` {
|
|
49
|
+
overflow: hidden `).concat(n,`;
|
|
50
|
+
padding-right: `).concat(a,"px ").concat(n,`;
|
|
51
|
+
}
|
|
52
|
+
body[`).concat(_i,`] {
|
|
53
|
+
overflow: hidden `).concat(n,`;
|
|
54
|
+
overscroll-behavior: contain;
|
|
55
|
+
`).concat([e&&"position: relative ".concat(n,";"),r==="margin"&&`
|
|
56
|
+
padding-left: `.concat(o,`px;
|
|
57
|
+
padding-top: `).concat(i,`px;
|
|
58
|
+
padding-right: `).concat(s,`px;
|
|
59
|
+
margin-left:0;
|
|
60
|
+
margin-top:0;
|
|
61
|
+
margin-right: `).concat(a,"px ").concat(n,`;
|
|
62
|
+
`),r==="padding"&&"padding-right: ".concat(a,"px ").concat(n,";")].filter(Boolean).join(""),`
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.`).concat(En,` {
|
|
66
|
+
right: `).concat(a,"px ").concat(n,`;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.`).concat(kn,` {
|
|
70
|
+
margin-right: `).concat(a,"px ").concat(n,`;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.`).concat(En," .").concat(En,` {
|
|
74
|
+
right: 0 `).concat(n,`;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.`).concat(kn," .").concat(kn,` {
|
|
78
|
+
margin-right: 0 `).concat(n,`;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
body[`).concat(_i,`] {
|
|
82
|
+
`).concat($u,": ").concat(a,`px;
|
|
83
|
+
}
|
|
84
|
+
`)},bv=function(){var t=parseInt(document.body.getAttribute(_i)||"0",10);return isFinite(t)?t:0},oM=function(){ee__namespace.useEffect(function(){return document.body.setAttribute(_i,(bv()+1).toString()),function(){var t=bv()-1;t<=0?document.body.removeAttribute(_i):document.body.setAttribute(_i,t.toString());}},[]);},Us=function(t){var e=t.noRelative,r=t.noImportant,n=t.gapMode,o=n===void 0?"margin":n;oM();var i=ee__namespace.useMemo(function(){return Uu(o)},[o]);return ee__namespace.createElement(rM,{styles:nM(i,!e,o,r?"":"!important")})};var Vu=!1;if(typeof window<"u")try{Vs=Object.defineProperty({},"passive",{get:function(){return Vu=!0,!0}}),window.addEventListener("test",Vs,Vs),window.removeEventListener("test",Vs,Vs);}catch{Vu=!1;}var Vs,Po=Vu?{passive:!1}:!1;var iM=function(t){return t.tagName==="TEXTAREA"},vv=function(t,e){var r=window.getComputedStyle(t);return r[e]!=="hidden"&&!(r.overflowY===r.overflowX&&!iM(t)&&r[e]==="visible")},sM=function(t){return vv(t,"overflowY")},aM=function(t){return vv(t,"overflowX")},Ku=function(t,e){var r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var n=yv(t,r);if(n){var o=wv(t,r),i=o[1],s=o[2];if(i>s)return !0}r=r.parentNode;}while(r&&r!==document.body);return !1},lM=function(t){var e=t.scrollTop,r=t.scrollHeight,n=t.clientHeight;return [e,r,n]},cM=function(t){var e=t.scrollLeft,r=t.scrollWidth,n=t.clientWidth;return [e,r,n]},yv=function(t,e){return t==="v"?sM(e):aM(e)},wv=function(t,e){return t==="v"?lM(e):cM(e)},dM=function(t,e){return t==="h"&&e==="rtl"?-1:1},xv=function(t,e,r,n,o){var i=dM(t,window.getComputedStyle(e).direction),s=i*n,a=r.target,l=e.contains(a),c=!1,d=s>0,u=0,f=0;do{var p=wv(t,a),h=p[0],m=p[1],g=p[2],b=m-g-i*h;(h||b)&&yv(t,a)&&(u+=b,f+=h),a=a.parentNode;}while(!l&&a!==document.body||l&&(e.contains(a)||e===a));return (d&&(o&&u===0||!o&&s>u)||!d&&(o&&f===0||!o&&-s>f))&&(c=!0),c};var Al=function(t){return "changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},Ev=function(t){return [t.deltaX,t.deltaY]},kv=function(t){return t&&"current"in t?t.current:t},uM=function(t,e){return t[0]===e[0]&&t[1]===e[1]},fM=function(t){return `
|
|
85
|
+
.block-interactivity-`.concat(t,` {pointer-events: none;}
|
|
86
|
+
.allow-interactivity-`).concat(t,` {pointer-events: all;}
|
|
87
|
+
`)},pM=0,Ai=[];function Sv(t){var e=ee__namespace.useRef([]),r=ee__namespace.useRef([0,0]),n=ee__namespace.useRef(),o=ee__namespace.useState(pM++)[0],i=ee__namespace.useState(function(){return Do()})[0],s=ee__namespace.useRef(t);ee__namespace.useEffect(function(){s.current=t;},[t]),ee__namespace.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(o));var m=Tl([t.lockRef.current],(t.shards||[]).map(kv),!0).filter(Boolean);return m.forEach(function(g){return g.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),m.forEach(function(g){return g.classList.remove("allow-interactivity-".concat(o))});}}},[t.inert,t.lockRef.current,t.shards]);var a=ee__namespace.useCallback(function(m,g){if("touches"in m&&m.touches.length===2)return !s.current.allowPinchZoom;var b=Al(m),v=r.current,y="deltaX"in m?m.deltaX:v[0]-b[0],x="deltaY"in m?m.deltaY:v[1]-b[1],E,S=m.target,R=Math.abs(y)>Math.abs(x)?"h":"v";if("touches"in m&&R==="h"&&S.type==="range")return !1;var w=Ku(R,S);if(!w)return !0;if(w?E=R:(E=R==="v"?"h":"v",w=Ku(R,S)),!w)return !1;if(!n.current&&"changedTouches"in m&&(y||x)&&(n.current=E),!E)return !0;var N=n.current||E;return xv(N,g,m,N==="h"?y:x,!0)},[]),l=ee__namespace.useCallback(function(m){var g=m;if(!(!Ai.length||Ai[Ai.length-1]!==i)){var b="deltaY"in g?Ev(g):Al(g),v=e.current.filter(function(E){return E.name===g.type&&E.target===g.target&&uM(E.delta,b)})[0];if(v&&v.should){g.cancelable&&g.preventDefault();return}if(!v){var y=(s.current.shards||[]).map(kv).filter(Boolean).filter(function(E){return E.contains(g.target)}),x=y.length>0?a(g,y[0]):!s.current.noIsolation;x&&g.cancelable&&g.preventDefault();}}},[]),c=ee__namespace.useCallback(function(m,g,b,v){var y={name:m,delta:g,target:b,should:v};e.current.push(y),setTimeout(function(){e.current=e.current.filter(function(x){return x!==y});},1);},[]),d=ee__namespace.useCallback(function(m){r.current=Al(m),n.current=void 0;},[]),u=ee__namespace.useCallback(function(m){c(m.type,Ev(m),m.target,a(m,t.lockRef.current));},[]),f=ee__namespace.useCallback(function(m){c(m.type,Al(m),m.target,a(m,t.lockRef.current));},[]);ee__namespace.useEffect(function(){return Ai.push(i),t.setCallbacks({onScrollCapture:u,onWheelCapture:u,onTouchMoveCapture:f}),document.addEventListener("wheel",l,Po),document.addEventListener("touchmove",l,Po),document.addEventListener("touchstart",d,Po),function(){Ai=Ai.filter(function(m){return m!==i}),document.removeEventListener("wheel",l,Po),document.removeEventListener("touchmove",l,Po),document.removeEventListener("touchstart",d,Po);}},[]);var p=t.removeScrollBar,h=t.inert;return ee__namespace.createElement(ee__namespace.Fragment,null,h?ee__namespace.createElement(i,{styles:fM(o)}):null,p?ee__namespace.createElement(Us,{gapMode:"margin"}):null)}var Cv=zs(Ml,Sv);var Rv=ee__namespace.forwardRef(function(t,e){return ee__namespace.createElement(Hs,ot({},t,{ref:e,sideCar:Cv}))});Rv.classNames=Hs.classNames;var Wu=Rv;var mM=[" ","Enter","ArrowUp","ArrowDown"],gM=[" ","Enter"],Pl="Select",[Il,Ll,bM]=zg(Pl),[Di,j8]=ki(Pl,[bM,Mu]),qu=Mu(),[vM,Lo]=Di(Pl),[yM,wM]=Di(Pl),xM=t=>{let{__scopeSelect:e,children:r,open:n,defaultOpen:o,onOpenChange:i,value:s,defaultValue:a,onValueChange:l,dir:c,name:d,autoComplete:u,disabled:f,required:p}=t,h=qu(e),[m,g]=ee.useState(null),[b,v]=ee.useState(null),[y,x]=ee.useState(!1),E=Hg(c),[S=!1,R]=Au({prop:n,defaultProp:o,onChange:i}),[w,N]=Au({prop:s,defaultProp:a,onChange:l}),M=ee.useRef(null),B=m?!!m.closest("form"):!0,[U,K]=ee.useState(new Set),P=Array.from(U).map(V=>V.props.value).join(";");return ee.createElement(Qb,h,ee.createElement(vM,{required:p,scope:e,trigger:m,onTriggerChange:g,valueNode:b,onValueNodeChange:v,valueNodeHasChildren:y,onValueNodeHasChildrenChange:x,contentId:Eu(),value:w,onValueChange:N,open:S,onOpenChange:R,dir:E,triggerPointerDownPosRef:M,disabled:f},ee.createElement(Il.Provider,{scope:e},ee.createElement(yM,{scope:t.__scopeSelect,onNativeOptionAdd:ee.useCallback(V=>{K(C=>new Set(C).add(V));},[]),onNativeOptionRemove:ee.useCallback(V=>{K(C=>{let T=new Set(C);return T.delete(V),T});},[])},r)),B?ee.createElement(Lv,{key:P,"aria-hidden":!0,required:p,tabIndex:-1,name:d,autoComplete:u,value:w,onChange:V=>N(V.target.value),disabled:f},w===void 0?ee.createElement("option",{value:""}):null,Array.from(U)):null))},EM="SelectTrigger",kM=ee.forwardRef((t,e)=>{let{__scopeSelect:r,disabled:n=!1,...o}=t,i=qu(r),s=Lo(EM,r),a=s.disabled||n,l=dt(e,s.onTriggerChange),c=Ll(r),[d,u,f]=$v(h=>{let m=c().filter(v=>!v.disabled),g=m.find(v=>v.value===s.value),b=Bv(m,h,g);b!==void 0&&s.onValueChange(b.value);}),p=()=>{a||(s.onOpenChange(!0),f());};return ee.createElement(ev,pe({asChild:!0},i),ee.createElement(ut.button,pe({type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":s.value===void 0?"":void 0},o,{ref:l,onClick:mt(o.onClick,h=>{h.currentTarget.focus();}),onPointerDown:mt(o.onPointerDown,h=>{let m=h.target;m.hasPointerCapture(h.pointerId)&&m.releasePointerCapture(h.pointerId),h.button===0&&h.ctrlKey===!1&&(p(),s.triggerPointerDownPosRef.current={x:Math.round(h.pageX),y:Math.round(h.pageY)},h.preventDefault());}),onKeyDown:mt(o.onKeyDown,h=>{let m=d.current!=="";!(h.ctrlKey||h.altKey||h.metaKey)&&h.key.length===1&&u(h.key),!(m&&h.key===" ")&&mM.includes(h.key)&&(p(),h.preventDefault());})})))}),SM="SelectValue",CM=ee.forwardRef((t,e)=>{let{__scopeSelect:r,className:n,style:o,children:i,placeholder:s,...a}=t,l=Lo(SM,r),{onValueNodeHasChildrenChange:c}=l,d=i!==void 0,u=dt(e,l.onValueNodeChange);return zt(()=>{c(d);},[c,d]),ee.createElement(ut.span,pe({},a,{ref:u,style:{pointerEvents:"none"}}),l.value===void 0&&s!==void 0?s:i)});var RM=ee.forwardRef((t,e)=>{let{__scopeSelect:r,children:n,...o}=t;return ee.createElement(ut.span,pe({"aria-hidden":!0},o,{ref:e}),n||"\u25BC")});var TM=t=>ee.createElement(rv,pe({asChild:!0},t)),Oi="SelectContent",NM=ee.forwardRef((t,e)=>{let r=Lo(Oi,t.__scopeSelect),[n,o]=ee.useState();if(zt(()=>{o(new DocumentFragment);},[]),!r.open){let i=n;return i?Dg.createPortal(ee.createElement(Dv,{scope:t.__scopeSelect},ee.createElement(Il.Slot,{scope:t.__scopeSelect},ee.createElement("div",null,t.children))),i):null}return ee.createElement(_M,pe({},t,{ref:e}))}),Sn=10,[Dv,$o]=Di(Oi);var _M=ee.forwardRef((t,e)=>{let{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:s,side:a,sideOffset:l,align:c,alignOffset:d,arrowPadding:u,collisionBoundary:f,collisionPadding:p,sticky:h,hideWhenDetached:m,avoidCollisions:g,...b}=t,v=Lo(Oi,r),[y,x]=ee.useState(null),[E,S]=ee.useState(null),R=dt(e,W=>x(W)),[w,N]=ee.useState(null),[M,B]=ee.useState(null),U=Ll(r),[K,P]=ee.useState(!1),V=ee.useRef(!1);ee.useEffect(()=>{if(y)return Jn(y)},[y]),Xg();let C=ee.useCallback(W=>{let[ue,...Oe]=U().map(Ce=>Ce.ref.current),[Se]=Oe.slice(-1),le=document.activeElement;for(let Ce of W)if(Ce===le||(Ce?.scrollIntoView({block:"nearest"}),Ce===ue&&E&&(E.scrollTop=0),Ce===Se&&E&&(E.scrollTop=E.scrollHeight),Ce?.focus(),document.activeElement!==le))return},[U,E]),T=ee.useCallback(()=>C([w,y]),[C,w,y]);ee.useEffect(()=>{K&&T();},[K,T]);let{onOpenChange:_,triggerPointerDownPosRef:A}=v;ee.useEffect(()=>{if(y){let W={x:0,y:0},ue=Se=>{var le,Ce,$e,Ke;W={x:Math.abs(Math.round(Se.pageX)-((le=(Ce=A.current)===null||Ce===void 0?void 0:Ce.x)!==null&&le!==void 0?le:0)),y:Math.abs(Math.round(Se.pageY)-(($e=(Ke=A.current)===null||Ke===void 0?void 0:Ke.y)!==null&&$e!==void 0?$e:0))};},Oe=Se=>{W.x<=10&&W.y<=10?Se.preventDefault():y.contains(Se.target)||_(!1),document.removeEventListener("pointermove",ue),A.current=null;};return A.current!==null&&(document.addEventListener("pointermove",ue),document.addEventListener("pointerup",Oe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ue),document.removeEventListener("pointerup",Oe,{capture:!0});}}},[y,_,A]),ee.useEffect(()=>{let W=()=>_(!1);return window.addEventListener("blur",W),window.addEventListener("resize",W),()=>{window.removeEventListener("blur",W),window.removeEventListener("resize",W);}},[_]);let[L,Y]=$v(W=>{let ue=U().filter(le=>!le.disabled),Oe=ue.find(le=>le.ref.current===document.activeElement),Se=Bv(ue,W,Oe);Se&&setTimeout(()=>Se.ref.current.focus());}),te=ee.useCallback((W,ue,Oe)=>{let Se=!V.current&&!Oe;(v.value!==void 0&&v.value===ue||Se)&&(N(W),Se&&(V.current=!0));},[v.value]),ke=ee.useCallback(()=>y?.focus(),[y]),me=ee.useCallback((W,ue,Oe)=>{let Se=!V.current&&!Oe;(v.value!==void 0&&v.value===ue||Se)&&B(W);},[v.value]),Te=n==="popper"?Tv:MM,Ae=Te===Tv?{side:a,sideOffset:l,align:c,alignOffset:d,arrowPadding:u,collisionBoundary:f,collisionPadding:p,sticky:h,hideWhenDetached:m,avoidCollisions:g}:{};return ee.createElement(Dv,{scope:r,content:y,viewport:E,onViewportChange:S,itemRefCallback:te,selectedItem:w,onItemLeave:ke,itemTextRefCallback:me,focusSelectedItem:T,selectedItemText:M,position:n,isPositioned:K,searchRef:L},ee.createElement(Wu,{as:Yn,allowPinchZoom:!0},ee.createElement(nb,{asChild:!0,trapped:v.open,onMountAutoFocus:W=>{W.preventDefault();},onUnmountAutoFocus:mt(o,W=>{var ue;(ue=v.trigger)===null||ue===void 0||ue.focus({preventScroll:!0}),W.preventDefault();})},ee.createElement(qg,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:W=>W.preventDefault(),onDismiss:()=>v.onOpenChange(!1)},ee.createElement(Te,pe({role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:W=>W.preventDefault()},b,Ae,{onPlaced:()=>P(!0),ref:R,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:mt(b.onKeyDown,W=>{let ue=W.ctrlKey||W.altKey||W.metaKey;if(W.key==="Tab"&&W.preventDefault(),!ue&&W.key.length===1&&Y(W.key),["ArrowUp","ArrowDown","Home","End"].includes(W.key)){let Se=U().filter(le=>!le.disabled).map(le=>le.ref.current);if(["ArrowUp","End"].includes(W.key)&&(Se=Se.slice().reverse()),["ArrowUp","ArrowDown"].includes(W.key)){let le=W.target,Ce=Se.indexOf(le);Se=Se.slice(Ce+1);}setTimeout(()=>C(Se)),W.preventDefault();}})}))))))});var MM=ee.forwardRef((t,e)=>{let{__scopeSelect:r,onPlaced:n,...o}=t,i=Lo(Oi,r),s=$o(Oi,r),[a,l]=ee.useState(null),[c,d]=ee.useState(null),u=dt(e,R=>d(R)),f=Ll(r),p=ee.useRef(!1),h=ee.useRef(!0),{viewport:m,selectedItem:g,selectedItemText:b,focusSelectedItem:v}=s,y=ee.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&c&&m&&g&&b){let R=i.trigger.getBoundingClientRect(),w=c.getBoundingClientRect(),N=i.valueNode.getBoundingClientRect(),M=b.getBoundingClientRect();if(i.dir!=="rtl"){let le=M.left-w.left,Ce=N.left-le,$e=R.left-Ce,Ke=R.width+$e,nt=Math.max(Ke,w.width),Re=window.innerWidth-Sn,wt=uu(Ce,[Sn,Re-nt]);a.style.minWidth=Ke+"px",a.style.left=wt+"px";}else {let le=w.right-M.right,Ce=window.innerWidth-N.right-le,$e=window.innerWidth-R.right-Ce,Ke=R.width+$e,nt=Math.max(Ke,w.width),Re=window.innerWidth-Sn,wt=uu(Ce,[Sn,Re-nt]);a.style.minWidth=Ke+"px",a.style.right=wt+"px";}let B=f(),U=window.innerHeight-Sn*2,K=m.scrollHeight,P=window.getComputedStyle(c),V=parseInt(P.borderTopWidth,10),C=parseInt(P.paddingTop,10),T=parseInt(P.borderBottomWidth,10),_=parseInt(P.paddingBottom,10),A=V+C+K+_+T,L=Math.min(g.offsetHeight*5,A),Y=window.getComputedStyle(m),te=parseInt(Y.paddingTop,10),ke=parseInt(Y.paddingBottom,10),me=R.top+R.height/2-Sn,Te=U-me,Ae=g.offsetHeight/2,W=g.offsetTop+Ae,ue=V+C+W,Oe=A-ue;if(ue<=me){let le=g===B[B.length-1].ref.current;a.style.bottom="0px";let Ce=c.clientHeight-m.offsetTop-m.offsetHeight,$e=Math.max(Te,Ae+(le?ke:0)+Ce+T),Ke=ue+$e;a.style.height=Ke+"px";}else {let le=g===B[0].ref.current;a.style.top="0px";let $e=Math.max(me,V+m.offsetTop+(le?te:0)+Ae)+Oe;a.style.height=$e+"px",m.scrollTop=ue-me+m.offsetTop;}a.style.margin=`${Sn}px 0`,a.style.minHeight=L+"px",a.style.maxHeight=U+"px",n?.(),requestAnimationFrame(()=>p.current=!0);}},[f,i.trigger,i.valueNode,a,c,m,g,b,i.dir,n]);zt(()=>y(),[y]);let[x,E]=ee.useState();zt(()=>{c&&E(window.getComputedStyle(c).zIndex);},[c]);let S=ee.useCallback(R=>{R&&h.current===!0&&(y(),v?.(),h.current=!1);},[y,v]);return ee.createElement(AM,{scope:r,contentWrapper:a,shouldExpandOnScrollRef:p,onScrollButtonChange:S},ee.createElement("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:x}},ee.createElement(ut.div,pe({},o,{ref:u,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}}))))});var Tv=ee.forwardRef((t,e)=>{let{__scopeSelect:r,align:n="start",collisionPadding:o=Sn,...i}=t,s=qu(r);return ee.createElement(tv,pe({},s,i,{ref:e,align:n,collisionPadding:o,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}}))}),[AM,ju]=Di(Oi,{}),Nv="SelectViewport",OM=ee.forwardRef((t,e)=>{let{__scopeSelect:r,...n}=t,o=$o(Nv,r),i=ju(Nv,r),s=dt(e,o.onViewportChange),a=ee.useRef(0);return ee.createElement(ee.Fragment,null,ee.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"}}),ee.createElement(Il.Slot,{scope:r},ee.createElement(ut.div,pe({"data-radix-select-viewport":"",role:"presentation"},n,{ref:s,style:{position:"relative",flex:1,overflow:"auto",...n.style},onScroll:mt(n.onScroll,l=>{let c=l.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:u}=i;if(u!=null&&u.current&&d){let f=Math.abs(a.current-c.scrollTop);if(f>0){let p=window.innerHeight-Sn*2,h=parseFloat(d.style.minHeight),m=parseFloat(d.style.height),g=Math.max(h,m);if(g<p){let b=g+f,v=Math.min(p,b),y=b-v;d.style.height=v+"px",d.style.bottom==="0px"&&(c.scrollTop=y>0?y:0,d.style.justifyContent="flex-end");}}}a.current=c.scrollTop;})}))))}),DM="SelectGroup",[Y8,PM]=Di(DM);var IM="SelectLabel",LM=ee.forwardRef((t,e)=>{let{__scopeSelect:r,...n}=t,o=PM(IM,r);return ee.createElement(ut.div,pe({id:o.id},n,{ref:e}))}),Gu="SelectItem",[$M,Pv]=Di(Gu),BM=ee.forwardRef((t,e)=>{let{__scopeSelect:r,value:n,disabled:o=!1,textValue:i,...s}=t,a=Lo(Gu,r),l=$o(Gu,r),c=a.value===n,[d,u]=ee.useState(i??""),[f,p]=ee.useState(!1),h=dt(e,b=>{var v;return (v=l.itemRefCallback)===null||v===void 0?void 0:v.call(l,b,n,o)}),m=Eu(),g=()=>{o||(a.onValueChange(n),a.onOpenChange(!1));};return ee.createElement($M,{scope:r,value:n,disabled:o,textId:m,isSelected:c,onItemTextChange:ee.useCallback(b=>{u(v=>{var y;return v||((y=b?.textContent)!==null&&y!==void 0?y:"").trim()});},[])},ee.createElement(Il.ItemSlot,{scope:r,value:n,disabled:o,textValue:d},ee.createElement(ut.div,pe({role:"option","aria-labelledby":m,"data-highlighted":f?"":void 0,"aria-selected":c&&f,"data-state":c?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1},s,{ref:h,onFocus:mt(s.onFocus,()=>p(!0)),onBlur:mt(s.onBlur,()=>p(!1)),onPointerUp:mt(s.onPointerUp,g),onPointerMove:mt(s.onPointerMove,b=>{if(o){var v;(v=l.onItemLeave)===null||v===void 0||v.call(l);}else b.currentTarget.focus({preventScroll:!0});}),onPointerLeave:mt(s.onPointerLeave,b=>{if(b.currentTarget===document.activeElement){var v;(v=l.onItemLeave)===null||v===void 0||v.call(l);}}),onKeyDown:mt(s.onKeyDown,b=>{var v;((v=l.searchRef)===null||v===void 0?void 0:v.current)!==""&&b.key===" "||(gM.includes(b.key)&&g(),b.key===" "&&b.preventDefault());})}))))}),Dl="SelectItemText",FM=ee.forwardRef((t,e)=>{let{__scopeSelect:r,className:n,style:o,...i}=t,s=Lo(Dl,r),a=$o(Dl,r),l=Pv(Dl,r),c=wM(Dl,r),[d,u]=ee.useState(null),f=dt(e,b=>u(b),l.onItemTextChange,b=>{var v;return (v=a.itemTextRefCallback)===null||v===void 0?void 0:v.call(a,b,l.value,l.disabled)}),p=d?.textContent,h=ee.useMemo(()=>ee.createElement("option",{key:l.value,value:l.value,disabled:l.disabled},p),[l.disabled,l.value,p]),{onNativeOptionAdd:m,onNativeOptionRemove:g}=c;return zt(()=>(m(h),()=>g(h)),[m,g,h]),ee.createElement(ee.Fragment,null,ee.createElement(ut.span,pe({id:l.textId},i,{ref:f})),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Dg.createPortal(i.children,s.valueNode):null)}),zM="SelectItemIndicator",HM=ee.forwardRef((t,e)=>{let{__scopeSelect:r,...n}=t;return Pv(zM,r).isSelected?ee.createElement(ut.span,pe({"aria-hidden":!0},n,{ref:e})):null}),_v="SelectScrollUpButton",UM=ee.forwardRef((t,e)=>{let r=$o(_v,t.__scopeSelect),n=ju(_v,t.__scopeSelect),[o,i]=ee.useState(!1),s=dt(e,n.onScrollButtonChange);return zt(()=>{if(r.viewport&&r.isPositioned){let l=function(){let c=a.scrollTop>0;i(c);},a=r.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),o?ee.createElement(Iv,pe({},t,{ref:s,onAutoScroll:()=>{let{viewport:a,selectedItem:l}=r;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight);}})):null}),Mv="SelectScrollDownButton",VM=ee.forwardRef((t,e)=>{let r=$o(Mv,t.__scopeSelect),n=ju(Mv,t.__scopeSelect),[o,i]=ee.useState(!1),s=dt(e,n.onScrollButtonChange);return zt(()=>{if(r.viewport&&r.isPositioned){let l=function(){let c=a.scrollHeight-a.clientHeight,d=Math.ceil(a.scrollTop)<c;i(d);},a=r.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),o?ee.createElement(Iv,pe({},t,{ref:s,onAutoScroll:()=>{let{viewport:a,selectedItem:l}=r;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight);}})):null}),Iv=ee.forwardRef((t,e)=>{let{__scopeSelect:r,onAutoScroll:n,...o}=t,i=$o("SelectScrollButton",r),s=ee.useRef(null),a=Ll(r),l=ee.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null);},[]);return ee.useEffect(()=>()=>l(),[l]),zt(()=>{var c;let d=a().find(u=>u.ref.current===document.activeElement);d==null||(c=d.ref.current)===null||c===void 0||c.scrollIntoView({block:"nearest"});},[a]),ee.createElement(ut.div,pe({"aria-hidden":!0},o,{ref:e,style:{flexShrink:0,...o.style},onPointerDown:mt(o.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(n,50));}),onPointerMove:mt(o.onPointerMove,()=>{var c;(c=i.onItemLeave)===null||c===void 0||c.call(i),s.current===null&&(s.current=window.setInterval(n,50));}),onPointerLeave:mt(o.onPointerLeave,()=>{l();})}))});var KM=ee.forwardRef((t,e)=>{let{__scopeSelect:r,...n}=t;return ee.createElement(ut.div,pe({"aria-hidden":!0},n,{ref:e}))});var Lv=ee.forwardRef((t,e)=>{let{value:r,...n}=t,o=ee.useRef(null),i=dt(e,o),s=nv(r);return ee.useEffect(()=>{let a=o.current,l=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(l,"value").set;if(s!==r&&d){let u=new Event("change",{bubbles:!0});d.call(a,r),a.dispatchEvent(u);}},[s,r]),ee.createElement(lv,{asChild:!0},ee.createElement("select",pe({},n,{ref:i,defaultValue:r})))});Lv.displayName="BubbleSelect";function $v(t){let e=Yt(t),r=ee.useRef(""),n=ee.useRef(0),o=ee.useCallback(s=>{let a=r.current+s;e(a),function l(c){r.current=c,window.clearTimeout(n.current),c!==""&&(n.current=window.setTimeout(()=>l(""),1e3));}(a);},[e]),i=ee.useCallback(()=>{r.current="",window.clearTimeout(n.current);},[]);return ee.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,o,i]}function Bv(t,e,r){let o=e.length>1&&Array.from(e).every(c=>c===e[0])?e[0]:e,i=r?t.indexOf(r):-1,s=WM(t,Math.max(i,0));o.length===1&&(s=s.filter(c=>c!==r));let l=s.find(c=>c.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==r?l:void 0}function WM(t,e){return t.map((r,n)=>t[(e+n)%t.length])}var Fv=xM,Yu=kM,zv=CM,Hv=RM,Uv=TM,Xu=NM,Vv=OM;var Ju=LM,Zu=BM,Kv=FM,Wv=HM,Qu=UM,ef=VM,tf=KM;var Bo=Fv;Bo.displayName="Select";var Pi=zv,Fo=ee__namespace.forwardRef(({className:t,children:e,variant:r="standard",size:n="md",error:o,success:i,loading:s,leftIcon:a,rightIcon:l,...c},d)=>jsxRuntime.jsxs(Yu,{ref:d,className:I("flex w-full items-center justify-between gap-1 rounded-md transition-all duration-200","disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1","focus-visible:outline-none",o&&"border-error focus-visible:ring-error/30 focus-visible:border-error",i&&"border-success focus-visible:ring-success/30 focus-visible:border-success",n==="sm"&&"h-8 text-xs px-2",n==="md"&&"h-10 text-sm px-3",n==="lg"&&"h-12 text-base px-4",r==="standard"&&"border border-gray-300 dark:border-gray-700 bg-background dark:bg-gray-900 hover:border-gray-400 dark:hover:border-gray-600 focus-visible:ring-2 focus-visible:ring-primary/30 dark:focus-visible:ring-primary/50 focus-visible:border-primary dark:focus-visible:border-primary",r==="outline"&&"border border-gray-300 dark:border-gray-700 bg-transparent hover:border-gray-400 dark:hover:border-gray-600 focus-visible:ring-2 focus-visible:ring-primary/30 dark:focus-visible:ring-primary/50 focus-visible:border-primary dark:focus-visible:border-primary",r==="ghost"&&"border-none bg-gray-100 dark:bg-gray-800 hover:bg-gray-200 dark:hover:bg-gray-700 focus-visible:ring-2 focus-visible:ring-primary/30 dark:focus-visible:ring-primary/50",r==="underline"&&"border-t-0 border-l-0 border-r-0 border-b border-gray-300 dark:border-gray-600 rounded-none px-0 hover:border-gray-400 dark:hover:border-gray-500 focus-visible:ring-0 focus-visible:border-b-2 focus-visible:border-primary dark:focus-visible:border-primary",t),...c,disabled:c.disabled||s,"data-error":o?!0:void 0,"data-success":i?!0:void 0,"data-loading":s?!0:void 0,children:[jsxRuntime.jsxs("div",{className:"flex items-center flex-1 gap-2",children:[a&&jsxRuntime.jsx("span",{className:"flex items-center justify-center text-gray-500 dark:text-gray-400",children:a}),s?jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(lucideReact.Loader2,{className:"h-3.5 w-3.5 animate-spin text-muted-foreground dark:text-gray-400"}),jsxRuntime.jsx("span",{className:"text-muted-foreground dark:text-gray-400",children:"Loading..."})]}):e]}),!s&&jsxRuntime.jsx(Hv,{asChild:!0,children:l?jsxRuntime.jsx("span",{className:"opacity-60",children:l}):jsxRuntime.jsx(lucideReact.ChevronDown,{className:"h-4 w-4 opacity-60 transition-transform duration-200 ease-out group-data-[state=open]:rotate-180"})})]}));Fo.displayName=Yu.displayName;var qv=ee__namespace.forwardRef(({className:t,...e},r)=>jsxRuntime.jsx(Qu,{ref:r,className:I("flex cursor-default items-center justify-center py-1 text-muted-foreground hover:text-foreground transition-colors",t),...e,children:jsxRuntime.jsx(lucideReact.ChevronUp,{className:"h-4 w-4"})}));qv.displayName=Qu.displayName;var jv=ee__namespace.forwardRef(({className:t,...e},r)=>jsxRuntime.jsx(ef,{ref:r,className:I("flex cursor-default items-center justify-center py-1 text-muted-foreground hover:text-foreground transition-colors",t),...e,children:jsxRuntime.jsx(lucideReact.ChevronDown,{className:"h-4 w-4"})}));jv.displayName=ef.displayName;var zo=ee__namespace.forwardRef(({className:t,children:e,position:r="item-aligned",...n},o)=>jsxRuntime.jsx(Uv,{children:jsxRuntime.jsxs(Xu,{ref:o,className:I(["relative z-50 max-h-96 min-w-[8rem] overflow-hidden","rounded-md border border-gray-200 dark:border-gray-700","bg-white dark:bg-gray-900 text-foreground","shadow-lg dark:shadow-gray-900/20","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[state=open]:duration-150"],r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:r,...n,children:[jsxRuntime.jsx(qv,{}),jsxRuntime.jsx(Vv,{className:I("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),jsxRuntime.jsx(jv,{})]})}));zo.displayName=Xu.displayName;var XM=ee__namespace.forwardRef(({className:t,...e},r)=>jsxRuntime.jsx(Ju,{ref:r,className:I("py-1.5 pl-8 pr-2 text-sm font-semibold",t),...e}));XM.displayName=Ju.displayName;var Ge=ee__namespace.forwardRef(({className:t,children:e,variant:r="default",size:n="md",rightIcon:o,customIndicator:i,...s},a)=>jsxRuntime.jsxs(Zu,{ref:a,className:I("relative flex w-full cursor-default select-none items-center rounded-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",n==="sm"&&"py-1 pl-7 pr-2 text-xs",n==="md"&&"py-1.5 pl-8 pr-2 text-sm",n==="lg"&&"py-2 pl-9 pr-3 text-base",r==="default"&&"focus:bg-accent focus:text-accent-foreground dark:focus:bg-gray-700 dark:focus:text-gray-100",r==="subtle"&&"focus:bg-gray-100 dark:focus:bg-gray-800 focus:text-foreground dark:focus:text-gray-200",r==="destructive"&&"text-error dark:text-red-400 focus:bg-error/10 dark:focus:bg-red-900/20 focus:text-error dark:focus:text-red-300",r==="success"&&"text-success dark:text-green-400 focus:bg-success/10 dark:focus:bg-green-900/20 focus:text-success dark:focus:text-green-300",r==="warning"&&"text-warning dark:text-yellow-400 focus:bg-warning/10 dark:focus:bg-yellow-900/20 focus:text-warning dark:focus:text-yellow-300",t),...s,children:[jsxRuntime.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:jsxRuntime.jsx(Wv,{children:i||jsxRuntime.jsx(lucideReact.Check,{className:"h-4 w-4"})})}),jsxRuntime.jsx(Kv,{children:e}),o&&jsxRuntime.jsx("span",{className:"ml-auto pl-2 opacity-70",children:o})]}));Ge.displayName=Zu.displayName;var JM=ee__namespace.forwardRef(({className:t,...e},r)=>jsxRuntime.jsx(tf,{ref:r,className:I("-mx-1 my-1 h-px bg-muted dark:bg-gray-700",t),...e}));JM.displayName=tf.displayName;function J(t,e,{checkForDefaultPrevented:r=!0}={}){return function(o){if(t?.(o),r===!1||!o.defaultPrevented)return e?.(o)}}function Xv(t,e){let r=ee__namespace.createContext(e),n=i=>{let{children:s,...a}=i,l=ee__namespace.useMemo(()=>a,Object.values(a));return jsxRuntime.jsx(r.Provider,{value:l,children:s})};n.displayName=t+"Provider";function o(i){let s=ee__namespace.useContext(r);if(s)return s;if(e!==void 0)return e;throw new Error(`\`${i}\` must be used within \`${t}\``)}return [n,o]}function Ut(t,e=[]){let r=[];function n(i,s){let a=ee__namespace.createContext(s),l=r.length;r=[...r,s];let c=u=>{let{scope:f,children:p,...h}=u,m=f?.[t]?.[l]||a,g=ee__namespace.useMemo(()=>h,Object.values(h));return jsxRuntime.jsx(m.Provider,{value:g,children:p})};c.displayName=i+"Provider";function d(u,f){let p=f?.[t]?.[l]||a,h=ee__namespace.useContext(p);if(h)return h;if(s!==void 0)return s;throw new Error(`\`${u}\` must be used within \`${i}\``)}return [c,d]}let o=()=>{let i=r.map(s=>ee__namespace.createContext(s));return function(a){let l=a?.[t]||i;return ee__namespace.useMemo(()=>({[`__scope${t}`]:{...a,[t]:l}}),[a,l])}};return o.scopeName=t,[n,ZM(o,...e)]}function ZM(...t){let e=t[0];if(t.length===1)return e;let r=()=>{let n=t.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){let s=n.reduce((a,{useScope:l,scopeName:c})=>{let u=l(i)[`__scope${c}`];return {...a,...u}},{});return ee__namespace.useMemo(()=>({[`__scope${e.scopeName}`]:s}),[s])}};return r.scopeName=e.scopeName,r}var Vt=globalThis?.document?ee__namespace.useLayoutEffect:()=>{};var QM=ee__namespace[" useId ".trim().toString()]||(()=>{}),eA=0;function ir(t){let[e,r]=ee__namespace.useState(QM());return Vt(()=>{t||r(n=>n??String(eA++));},[t]),t||(e?`radix-${e}`:"")}var tA=ee__namespace[" useInsertionEffect ".trim().toString()]||Vt;function Zr({prop:t,defaultProp:e,onChange:r=()=>{},caller:n}){let[o,i,s]=rA({defaultProp:e,onChange:r}),a=t!==void 0,l=a?t:o;{let d=ee__namespace.useRef(t!==void 0);ee__namespace.useEffect(()=>{let u=d.current;u!==a&&console.warn(`${n} is changing from ${u?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=a;},[a,n]);}let c=ee__namespace.useCallback(d=>{if(a){let u=nA(d)?d(t):d;u!==t&&s.current?.(u);}else i(d);},[a,t,i,s]);return [l,c]}function rA({defaultProp:t,onChange:e}){let[r,n]=ee__namespace.useState(t),o=ee__namespace.useRef(r),i=ee__namespace.useRef(e);return tA(()=>{i.current=e;},[e]),ee__namespace.useEffect(()=>{o.current!==r&&(i.current?.(r),o.current=r);},[r,o]),[r,n,i]}function nA(t){return typeof t=="function"}function pt(t){let e=ee__namespace.useRef(t);return ee__namespace.useEffect(()=>{e.current=t;}),ee__namespace.useMemo(()=>(...r)=>e.current?.(...r),[])}function Qv(t,e=globalThis?.document){let r=pt(t);ee__namespace.useEffect(()=>{let n=o=>{o.key==="Escape"&&r(o);};return e.addEventListener("keydown",n,{capture:!0}),()=>e.removeEventListener("keydown",n,{capture:!0})},[r,e]);}var oA="DismissableLayer",nf="dismissableLayer.update",iA="dismissableLayer.pointerDownOutside",sA="dismissableLayer.focusOutside",e0,n0=ee__namespace.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Qn=ee__namespace.forwardRef((t,e)=>{let{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:a,...l}=t,c=ee__namespace.useContext(n0),[d,u]=ee__namespace.useState(null),f=d?.ownerDocument??globalThis?.document,[,p]=ee__namespace.useState({}),h=Le(e,R=>u(R)),m=Array.from(c.layers),[g]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),b=m.indexOf(g),v=d?m.indexOf(d):-1,y=c.layersWithOutsidePointerEventsDisabled.size>0,x=v>=b,E=lA(R=>{let w=R.target,N=[...c.branches].some(M=>M.contains(w));!x||N||(o?.(R),s?.(R),R.defaultPrevented||a?.());},f),S=cA(R=>{let w=R.target;[...c.branches].some(M=>M.contains(w))||(i?.(R),s?.(R),R.defaultPrevented||a?.());},f);return Qv(R=>{v===c.layers.size-1&&(n?.(R),!R.defaultPrevented&&a&&(R.preventDefault(),a()));},f),ee__namespace.useEffect(()=>{if(d)return r&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(e0=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(d)),c.layers.add(d),t0(),()=>{r&&c.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=e0);}},[d,f,r,c]),ee__namespace.useEffect(()=>()=>{d&&(c.layers.delete(d),c.layersWithOutsidePointerEventsDisabled.delete(d),t0());},[d,c]),ee__namespace.useEffect(()=>{let R=()=>p({});return document.addEventListener(nf,R),()=>document.removeEventListener(nf,R)},[]),jsxRuntime.jsx(fe.div,{...l,ref:h,style:{pointerEvents:y?x?"auto":"none":void 0,...t.style},onFocusCapture:J(t.onFocusCapture,S.onFocusCapture),onBlurCapture:J(t.onBlurCapture,S.onBlurCapture),onPointerDownCapture:J(t.onPointerDownCapture,E.onPointerDownCapture)})});Qn.displayName=oA;var aA="DismissableLayerBranch",o0=ee__namespace.forwardRef((t,e)=>{let r=ee__namespace.useContext(n0),n=ee__namespace.useRef(null),o=Le(e,n);return ee__namespace.useEffect(()=>{let i=n.current;if(i)return r.branches.add(i),()=>{r.branches.delete(i);}},[r.branches]),jsxRuntime.jsx(fe.div,{...t,ref:o})});o0.displayName=aA;function lA(t,e=globalThis?.document){let r=pt(t),n=ee__namespace.useRef(!1),o=ee__namespace.useRef(()=>{});return ee__namespace.useEffect(()=>{let i=a=>{if(a.target&&!n.current){let c=function(){i0(iA,r,d,{discrete:!0});};let d={originalEvent:a};a.pointerType==="touch"?(e.removeEventListener("click",o.current),o.current=c,e.addEventListener("click",o.current,{once:!0})):c();}else e.removeEventListener("click",o.current);n.current=!1;},s=window.setTimeout(()=>{e.addEventListener("pointerdown",i);},0);return ()=>{window.clearTimeout(s),e.removeEventListener("pointerdown",i),e.removeEventListener("click",o.current);}},[e,r]),{onPointerDownCapture:()=>n.current=!0}}function cA(t,e=globalThis?.document){let r=pt(t),n=ee__namespace.useRef(!1);return ee__namespace.useEffect(()=>{let o=i=>{i.target&&!n.current&&i0(sA,r,{originalEvent:i},{discrete:!1});};return e.addEventListener("focusin",o),()=>e.removeEventListener("focusin",o)},[e,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function t0(){let t=new CustomEvent(nf);document.dispatchEvent(t);}function i0(t,e,r,{discrete:n}){let o=r.originalEvent.target,i=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:r});e&&o.addEventListener(t,e,{once:!0}),n?Ei(o,i):o.dispatchEvent(i);}var s0=Qn,a0=o0;var of="focusScope.autoFocusOnMount",sf="focusScope.autoFocusOnUnmount",l0={bubbles:!1,cancelable:!0},fA="FocusScope",Ho=ee__namespace.forwardRef((t,e)=>{let{loop:r=!1,trapped:n=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=t,[a,l]=ee__namespace.useState(null),c=pt(o),d=pt(i),u=ee__namespace.useRef(null),f=Le(e,m=>l(m)),p=ee__namespace.useRef({paused:!1,pause(){this.paused=!0;},resume(){this.paused=!1;}}).current;ee__namespace.useEffect(()=>{if(n){let v=function(S){if(p.paused||!a)return;let R=S.target;a.contains(R)?u.current=R:eo(u.current,{select:!0});},y=function(S){if(p.paused||!a)return;let R=S.relatedTarget;R!==null&&(a.contains(R)||eo(u.current,{select:!0}));},x=function(S){if(document.activeElement===document.body)for(let w of S)w.removedNodes.length>0&&eo(a);};document.addEventListener("focusin",v),document.addEventListener("focusout",y);let E=new MutationObserver(x);return a&&E.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",y),E.disconnect();}}},[n,a,p.paused]),ee__namespace.useEffect(()=>{if(a){d0.add(p);let m=document.activeElement;if(!a.contains(m)){let b=new CustomEvent(of,l0);a.addEventListener(of,c),a.dispatchEvent(b),b.defaultPrevented||(pA(vA(f0(a)),{select:!0}),document.activeElement===m&&eo(a));}return ()=>{a.removeEventListener(of,c),setTimeout(()=>{let b=new CustomEvent(sf,l0);a.addEventListener(sf,d),a.dispatchEvent(b),b.defaultPrevented||eo(m??document.body,{select:!0}),a.removeEventListener(sf,d),d0.remove(p);},0);}}},[a,c,d,p]);let h=ee__namespace.useCallback(m=>{if(!r&&!n||p.paused)return;let g=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,b=document.activeElement;if(g&&b){let v=m.currentTarget,[y,x]=hA(v);y&&x?!m.shiftKey&&b===x?(m.preventDefault(),r&&eo(y,{select:!0})):m.shiftKey&&b===y&&(m.preventDefault(),r&&eo(x,{select:!0})):b===v&&m.preventDefault();}},[r,n,p.paused]);return jsxRuntime.jsx(fe.div,{tabIndex:-1,...s,ref:f,onKeyDown:h})});Ho.displayName=fA;function pA(t,{select:e=!1}={}){let r=document.activeElement;for(let n of t)if(eo(n,{select:e}),document.activeElement!==r)return}function hA(t){let e=f0(t),r=c0(e,t),n=c0(e.reverse(),t);return [r,n]}function f0(t){let e=[],r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{let o=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||o?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)e.push(r.currentNode);return e}function c0(t,e){for(let r of t)if(!mA(r,{upTo:e}))return r}function mA(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return !0;for(;t;){if(e!==void 0&&t===e)return !1;if(getComputedStyle(t).display==="none")return !0;t=t.parentElement;}return !1}function gA(t){return t instanceof HTMLInputElement&&"select"in t}function eo(t,{select:e=!1}={}){if(t&&t.focus){let r=document.activeElement;t.focus({preventScroll:!0}),t!==r&&gA(t)&&e&&t.select();}}var d0=bA();function bA(){let t=[];return {add(e){let r=t[0];e!==r&&r?.pause(),t=u0(t,e),t.unshift(e);},remove(e){t=u0(t,e),t[0]?.resume();}}}function u0(t,e){let r=[...t],n=r.indexOf(e);return n!==-1&&r.splice(n,1),r}function vA(t){return t.filter(e=>e.tagName!=="A")}var xA="Portal",Rn=ee__namespace.forwardRef((t,e)=>{let{container:r,...n}=t,[o,i]=ee__namespace.useState(!1);Vt(()=>i(!0),[]);let s=r||o&&globalThis?.document?.body;return s?Dg__namespace.default.createPortal(jsxRuntime.jsx(fe.div,{...n,ref:e}),s):null});Rn.displayName=xA;function EA(t,e){return ee__namespace.useReducer((r,n)=>e[r][n]??r,t)}var Jt=t=>{let{present:e,children:r}=t,n=kA(e),o=typeof r=="function"?r({present:n.isPresent}):ee__namespace.Children.only(r),i=Le(n.ref,SA(o));return typeof r=="function"||n.isPresent?ee__namespace.cloneElement(o,{ref:i}):null};Jt.displayName="Presence";function kA(t){let[e,r]=ee__namespace.useState(),n=ee__namespace.useRef(null),o=ee__namespace.useRef(t),i=ee__namespace.useRef("none"),s=t?"mounted":"unmounted",[a,l]=EA(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return ee__namespace.useEffect(()=>{let c=Fl(n.current);i.current=a==="mounted"?c:"none";},[a]),Vt(()=>{let c=n.current,d=o.current;if(d!==t){let f=i.current,p=Fl(c);t?l("MOUNT"):p==="none"||c?.display==="none"?l("UNMOUNT"):l(d&&f!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=t;}},[t,l]),Vt(()=>{if(e){let c,d=e.ownerDocument.defaultView??window,u=p=>{let m=Fl(n.current).includes(p.animationName);if(p.target===e&&m&&(l("ANIMATION_END"),!o.current)){let g=e.style.animationFillMode;e.style.animationFillMode="forwards",c=d.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=g);});}},f=p=>{p.target===e&&(i.current=Fl(n.current));};return e.addEventListener("animationstart",f),e.addEventListener("animationcancel",u),e.addEventListener("animationend",u),()=>{d.clearTimeout(c),e.removeEventListener("animationstart",f),e.removeEventListener("animationcancel",u),e.removeEventListener("animationend",u);}}else l("ANIMATION_END");},[e,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:ee__namespace.useCallback(c=>{n.current=c?getComputedStyle(c):null,r(c);},[])}}function Fl(t){return t?.animationName||"none"}function SA(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,r=e&&"isReactWarning"in e&&e.isReactWarning;return r?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}var af=0;function Li(){ee__namespace.useEffect(()=>{let t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??h0()),document.body.insertAdjacentElement("beforeend",t[1]??h0()),af++,()=>{af===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),af--;}},[]);}function h0(){let t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var zl=Fs();var lf=function(){},Ws=ee__namespace.forwardRef(function(t,e){var r=ee__namespace.useRef(null),n=ee__namespace.useState({onScrollCapture:lf,onWheelCapture:lf,onTouchMoveCapture:lf}),o=n[0],i=n[1],s=t.forwardProps,a=t.children,l=t.className,c=t.removeScrollBar,d=t.enabled,u=t.shards,f=t.sideCar,p=t.noRelative,h=t.noIsolation,m=t.inert,g=t.allowPinchZoom,b=t.as,v=b===void 0?"div":b,y=t.gapMode,x=Ni(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=f,S=Bs([r,e]),R=ot(ot({},x),o);return ee__namespace.createElement(ee__namespace.Fragment,null,d&&ee__namespace.createElement(E,{sideCar:zl,removeScrollBar:c,shards:u,noRelative:p,noIsolation:h,inert:m,setCallbacks:i,allowPinchZoom:!!g,lockRef:r,gapMode:y}),s?ee__namespace.cloneElement(ee__namespace.Children.only(a),ot(ot({},R),{ref:S})):ee__namespace.createElement(v,ot({},R,{className:l,ref:S}),a))});Ws.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Ws.classNames={fullWidth:kn,zeroRight:En};var cf=!1;if(typeof window<"u")try{Gs=Object.defineProperty({},"passive",{get:function(){return cf=!0,!0}}),window.addEventListener("test",Gs,Gs),window.removeEventListener("test",Gs,Gs);}catch{cf=!1;}var Gs,Uo=cf?{passive:!1}:!1;var CA=function(t){return t.tagName==="TEXTAREA"},g0=function(t,e){if(!(t instanceof Element))return !1;var r=window.getComputedStyle(t);return r[e]!=="hidden"&&!(r.overflowY===r.overflowX&&!CA(t)&&r[e]==="visible")},RA=function(t){return g0(t,"overflowY")},TA=function(t){return g0(t,"overflowX")},df=function(t,e){var r=e.ownerDocument,n=e;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var o=b0(t,n);if(o){var i=v0(t,n),s=i[1],a=i[2];if(s>a)return !0}n=n.parentNode;}while(n&&n!==r.body);return !1},NA=function(t){var e=t.scrollTop,r=t.scrollHeight,n=t.clientHeight;return [e,r,n]},_A=function(t){var e=t.scrollLeft,r=t.scrollWidth,n=t.clientWidth;return [e,r,n]},b0=function(t,e){return t==="v"?RA(e):TA(e)},v0=function(t,e){return t==="v"?NA(e):_A(e)},MA=function(t,e){return t==="h"&&e==="rtl"?-1:1},y0=function(t,e,r,n,o){var i=MA(t,window.getComputedStyle(e).direction),s=i*n,a=r.target,l=e.contains(a),c=!1,d=s>0,u=0,f=0;do{if(!a)break;var p=v0(t,a),h=p[0],m=p[1],g=p[2],b=m-g-i*h;(h||b)&&b0(t,a)&&(u+=b,f+=h);var v=a.parentNode;a=v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE?v.host:v;}while(!l&&a!==document.body||l&&(e.contains(a)||e===a));return (d&&(o&&Math.abs(u)<1||!o&&s>u)||!d&&(o&&Math.abs(f)<1||!o&&-s>f))&&(c=!0),c};var Hl=function(t){return "changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},w0=function(t){return [t.deltaX,t.deltaY]},x0=function(t){return t&&"current"in t?t.current:t},AA=function(t,e){return t[0]===e[0]&&t[1]===e[1]},OA=function(t){return `
|
|
88
|
+
.block-interactivity-`.concat(t,` {pointer-events: none;}
|
|
89
|
+
.allow-interactivity-`).concat(t,` {pointer-events: all;}
|
|
90
|
+
`)},DA=0,$i=[];function E0(t){var e=ee__namespace.useRef([]),r=ee__namespace.useRef([0,0]),n=ee__namespace.useRef(),o=ee__namespace.useState(DA++)[0],i=ee__namespace.useState(Do)[0],s=ee__namespace.useRef(t);ee__namespace.useEffect(function(){s.current=t;},[t]),ee__namespace.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(o));var m=Tl([t.lockRef.current],(t.shards||[]).map(x0),!0).filter(Boolean);return m.forEach(function(g){return g.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),m.forEach(function(g){return g.classList.remove("allow-interactivity-".concat(o))});}}},[t.inert,t.lockRef.current,t.shards]);var a=ee__namespace.useCallback(function(m,g){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return !s.current.allowPinchZoom;var b=Hl(m),v=r.current,y="deltaX"in m?m.deltaX:v[0]-b[0],x="deltaY"in m?m.deltaY:v[1]-b[1],E,S=m.target,R=Math.abs(y)>Math.abs(x)?"h":"v";if("touches"in m&&R==="h"&&S.type==="range")return !1;var w=df(R,S);if(!w)return !0;if(w?E=R:(E=R==="v"?"h":"v",w=df(R,S)),!w)return !1;if(!n.current&&"changedTouches"in m&&(y||x)&&(n.current=E),!E)return !0;var N=n.current||E;return y0(N,g,m,N==="h"?y:x,!0)},[]),l=ee__namespace.useCallback(function(m){var g=m;if(!(!$i.length||$i[$i.length-1]!==i)){var b="deltaY"in g?w0(g):Hl(g),v=e.current.filter(function(E){return E.name===g.type&&(E.target===g.target||g.target===E.shadowParent)&&AA(E.delta,b)})[0];if(v&&v.should){g.cancelable&&g.preventDefault();return}if(!v){var y=(s.current.shards||[]).map(x0).filter(Boolean).filter(function(E){return E.contains(g.target)}),x=y.length>0?a(g,y[0]):!s.current.noIsolation;x&&g.cancelable&&g.preventDefault();}}},[]),c=ee__namespace.useCallback(function(m,g,b,v){var y={name:m,delta:g,target:b,should:v,shadowParent:PA(b)};e.current.push(y),setTimeout(function(){e.current=e.current.filter(function(x){return x!==y});},1);},[]),d=ee__namespace.useCallback(function(m){r.current=Hl(m),n.current=void 0;},[]),u=ee__namespace.useCallback(function(m){c(m.type,w0(m),m.target,a(m,t.lockRef.current));},[]),f=ee__namespace.useCallback(function(m){c(m.type,Hl(m),m.target,a(m,t.lockRef.current));},[]);ee__namespace.useEffect(function(){return $i.push(i),t.setCallbacks({onScrollCapture:u,onWheelCapture:u,onTouchMoveCapture:f}),document.addEventListener("wheel",l,Uo),document.addEventListener("touchmove",l,Uo),document.addEventListener("touchstart",d,Uo),function(){$i=$i.filter(function(m){return m!==i}),document.removeEventListener("wheel",l,Uo),document.removeEventListener("touchmove",l,Uo),document.removeEventListener("touchstart",d,Uo);}},[]);var p=t.removeScrollBar,h=t.inert;return ee__namespace.createElement(ee__namespace.Fragment,null,h?ee__namespace.createElement(i,{styles:OA(o)}):null,p?ee__namespace.createElement(Us,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function PA(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}var k0=zs(zl,E0);var S0=ee__namespace.forwardRef(function(t,e){return ee__namespace.createElement(Ws,ot({},t,{ref:e,sideCar:k0}))});S0.classNames=Ws.classNames;var Vo=S0;var Kl="Dialog",[T0,yV]=Ut(Kl),[IA,Vr]=T0(Kl),N0=t=>{let{__scopeDialog:e,children:r,open:n,defaultOpen:o,onOpenChange:i,modal:s=!0}=t,a=ee__namespace.useRef(null),l=ee__namespace.useRef(null),[c,d]=Zr({prop:n,defaultProp:o??!1,onChange:i,caller:Kl});return jsxRuntime.jsx(IA,{scope:e,triggerRef:a,contentRef:l,contentId:ir(),titleId:ir(),descriptionId:ir(),open:c,onOpenChange:d,onOpenToggle:ee__namespace.useCallback(()=>d(u=>!u),[d]),modal:s,children:r})};N0.displayName=Kl;var _0="DialogTrigger",M0=ee__namespace.forwardRef((t,e)=>{let{__scopeDialog:r,...n}=t,o=Vr(_0,r),i=Le(e,o.triggerRef);return jsxRuntime.jsx(fe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":pf(o.open),...n,ref:i,onClick:J(t.onClick,o.onOpenToggle)})});M0.displayName=_0;var uf="DialogPortal",[LA,A0]=T0(uf,{forceMount:void 0}),O0=t=>{let{__scopeDialog:e,forceMount:r,children:n,container:o}=t,i=Vr(uf,e);return jsxRuntime.jsx(LA,{scope:e,forceMount:r,children:ee__namespace.Children.map(n,s=>jsxRuntime.jsx(Jt,{present:r||i.open,children:jsxRuntime.jsx(Rn,{asChild:!0,container:o,children:s})}))})};O0.displayName=uf;var Vl="DialogOverlay",D0=ee__namespace.forwardRef((t,e)=>{let r=A0(Vl,t.__scopeDialog),{forceMount:n=r.forceMount,...o}=t,i=Vr(Vl,t.__scopeDialog);return i.modal?jsxRuntime.jsx(Jt,{present:n||i.open,children:jsxRuntime.jsx(BA,{...o,ref:e})}):null});D0.displayName=Vl;var $A=Br("DialogOverlay.RemoveScroll"),BA=ee__namespace.forwardRef((t,e)=>{let{__scopeDialog:r,...n}=t,o=Vr(Vl,r);return jsxRuntime.jsx(Vo,{as:$A,allowPinchZoom:!0,shards:[o.contentRef],children:jsxRuntime.jsx(fe.div,{"data-state":pf(o.open),...n,ref:e,style:{pointerEvents:"auto",...n.style}})})}),Ko="DialogContent",P0=ee__namespace.forwardRef((t,e)=>{let r=A0(Ko,t.__scopeDialog),{forceMount:n=r.forceMount,...o}=t,i=Vr(Ko,t.__scopeDialog);return jsxRuntime.jsx(Jt,{present:n||i.open,children:i.modal?jsxRuntime.jsx(FA,{...o,ref:e}):jsxRuntime.jsx(zA,{...o,ref:e})})});P0.displayName=Ko;var FA=ee__namespace.forwardRef((t,e)=>{let r=Vr(Ko,t.__scopeDialog),n=ee__namespace.useRef(null),o=Le(e,r.contentRef,n);return ee__namespace.useEffect(()=>{let i=n.current;if(i)return Jn(i)},[]),jsxRuntime.jsx(I0,{...t,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:J(t.onCloseAutoFocus,i=>{i.preventDefault(),r.triggerRef.current?.focus();}),onPointerDownOutside:J(t.onPointerDownOutside,i=>{let s=i.detail.originalEvent,a=s.button===0&&s.ctrlKey===!0;(s.button===2||a)&&i.preventDefault();}),onFocusOutside:J(t.onFocusOutside,i=>i.preventDefault())})}),zA=ee__namespace.forwardRef((t,e)=>{let r=Vr(Ko,t.__scopeDialog),n=ee__namespace.useRef(!1),o=ee__namespace.useRef(!1);return jsxRuntime.jsx(I0,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{t.onCloseAutoFocus?.(i),i.defaultPrevented||(n.current||r.triggerRef.current?.focus(),i.preventDefault()),n.current=!1,o.current=!1;},onInteractOutside:i=>{t.onInteractOutside?.(i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));let s=i.target;r.triggerRef.current?.contains(s)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault();}})}),I0=ee__namespace.forwardRef((t,e)=>{let{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:i,...s}=t,a=Vr(Ko,r),l=ee__namespace.useRef(null),c=Le(e,l);return Li(),jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Ho,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:i,children:jsxRuntime.jsx(Qn,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":pf(a.open),...s,ref:c,onDismiss:()=>a.onOpenChange(!1)})}),jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(HA,{titleId:a.titleId}),jsxRuntime.jsx(VA,{contentRef:l,descriptionId:a.descriptionId})]})]})}),ff="DialogTitle",L0=ee__namespace.forwardRef((t,e)=>{let{__scopeDialog:r,...n}=t,o=Vr(ff,r);return jsxRuntime.jsx(fe.h2,{id:o.titleId,...n,ref:e})});L0.displayName=ff;var $0="DialogDescription",B0=ee__namespace.forwardRef((t,e)=>{let{__scopeDialog:r,...n}=t,o=Vr($0,r);return jsxRuntime.jsx(fe.p,{id:o.descriptionId,...n,ref:e})});B0.displayName=$0;var F0="DialogClose",z0=ee__namespace.forwardRef((t,e)=>{let{__scopeDialog:r,...n}=t,o=Vr(F0,r);return jsxRuntime.jsx(fe.button,{type:"button",...n,ref:e,onClick:J(t.onClick,()=>o.onOpenChange(!1))})});z0.displayName=F0;function pf(t){return t?"open":"closed"}var H0="DialogTitleWarning",[wV,U0]=Xv(H0,{contentName:Ko,titleName:ff,docsSlug:"dialog"}),HA=({titleId:t})=>{let e=U0(H0),r=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users.
|
|
91
|
+
|
|
92
|
+
If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
93
|
+
|
|
94
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return ee__namespace.useEffect(()=>{t&&(document.getElementById(t)||console.error(r));},[r,t]),null},UA="DialogDescriptionWarning",VA=({contentRef:t,descriptionId:e})=>{let n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${U0(UA).contentName}}.`;return ee__namespace.useEffect(()=>{let o=t.current?.getAttribute("aria-describedby");e&&o&&(document.getElementById(e)||console.warn(n));},[n,t,e]),null},V0=N0,K0=M0,W0=O0,hf=D0,mf=P0,gf=L0,bf=B0,G0=z0;var to=V0,qs=K0,jA=W0;var YA=classVarianceAuthority.cva("fixed inset-0 z-50 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",{variants:{variant:{default:"bg-black/80",subtle:"bg-black/60",blur:"bg-black/40 backdrop-blur-md",minimal:"bg-black/20 backdrop-blur-sm"},animation:{default:"duration-200",slow:"duration-300",fast:"duration-100"}},defaultVariants:{variant:"default",animation:"default"}}),j0=ee__namespace.forwardRef(({className:t,variant:e,animation:r,...n},o)=>jsxRuntime.jsx(hf,{ref:o,className:I(YA({variant:e,animation:r}),t),...n}));j0.displayName=hf.displayName;var XA=classVarianceAuthority.cva("fixed left-[50%] top-[50%] z-50 grid w-full translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background shadow-lg",{variants:{variant:{default:"border-gray-200 dark:border-gray-700",primary:"border-primary/20 dark:border-primary/30",secondary:"border-gray-300 dark:border-gray-600",ghost:"border-transparent shadow-xl",destructive:"border-error/20 dark:border-error/30"},size:{xs:"max-w-xs p-4",sm:"max-w-sm p-5",default:"max-w-lg p-6",md:"max-w-md p-6",lg:"max-w-2xl p-7",xl:"max-w-4xl p-8",full:"max-w-[95vw] max-h-[95vh] p-6"},radius:{none:"rounded-none",sm:"rounded-md",default:"rounded-lg",lg:"rounded-xl",xl:"rounded-2xl",full:"rounded-3xl"},animation:{default:"duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",fade:"duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",zoom:"duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",slide:"duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",none:""},position:{default:"top-[50%]",top:"top-[5%]",bottom:"bottom-[5%] top-auto translate-y-0"}},defaultVariants:{variant:"default",size:"default",radius:"default",animation:"default",position:"default"}}),Tn=ee__namespace.forwardRef(({className:t,children:e,variant:r,size:n,radius:o,animation:i,position:s,overlayVariant:a="default",overlayAnimation:l="default",hideCloseButton:c=!1,title:d,description:u,icon:f,loading:p=!1,success:h=!1,onClose:m,...g},b)=>{let v=()=>{m&&m();};return jsxRuntime.jsxs(jA,{children:[jsxRuntime.jsx(j0,{variant:a,animation:l,onClick:c?void 0:v}),jsxRuntime.jsxs(mf,{ref:b,onEscapeKeyDown:c?void 0:v,onInteractOutside:c?void 0:v,className:I(XA({variant:r,size:n,radius:o,animation:i,position:s}),"outline-none",p&&"pointer-events-none",h&&"border-success/40",t),...g,children:[(d||u||f)&&jsxRuntime.jsxs(Qr,{className:"flex gap-4",children:[(f||p||h)&&jsxRuntime.jsxs("div",{className:"flex shrink-0 items-center justify-center",children:[p&&jsxRuntime.jsx(lucideReact.Loader2,{className:"h-5 w-5 animate-spin text-primary"}),h&&jsxRuntime.jsx(lucideReact.Check,{className:"h-5 w-5 text-success"}),!p&&!h&&f&&jsxRuntime.jsx("span",{className:"text-primary",children:f})]}),jsxRuntime.jsxs("div",{className:"flex-1",children:[d&&jsxRuntime.jsx(en,{children:d}),u&&jsxRuntime.jsx(tn,{children:u})]})]}),e,!c&&jsxRuntime.jsxs(G0,{onClick:v,className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-primary/30 focus:ring-offset-2 disabled:pointer-events-none dark:text-gray-300 dark:hover:text-white",children:[jsxRuntime.jsx(lucideReact.X,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{className:"sr-only",children:"Close"})]})]})]})});Tn.displayName=mf.displayName;var Qr=({className:t,...e})=>jsxRuntime.jsx("div",{className:I("flex flex-col space-y-2 text-center sm:text-left",t),...e});Qr.displayName="DialogHeader";var vf=({className:t,...e})=>jsxRuntime.jsx("div",{className:I("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end sm:space-x-2 mt-6",t),...e});vf.displayName="DialogFooter";var en=ee__namespace.forwardRef(({className:t,...e},r)=>jsxRuntime.jsx(gf,{ref:r,className:I("text-xl font-semibold leading-snug tracking-tight dark:text-white",t),...e}));en.displayName=gf.displayName;var tn=ee__namespace.forwardRef(({className:t,...e},r)=>jsxRuntime.jsx(bf,{ref:r,className:I("text-sm text-muted-foreground leading-normal dark:text-gray-400",t),...e}));tn.displayName=bf.displayName;var JA=ee__namespace.forwardRef(({className:t,...e},r)=>jsxRuntime.jsx("form",{ref:r,className:I("flex flex-col gap-4",t),...e}));JA.displayName="DialogForm";var eO=["#000000","#374151","#EF4444","#F97316","#F59E0B","#EAB308","#22C55E","#10B981","#06B6D4","#3B82F6","#6366F1","#8B5CF6","#A855F7","#D946EF","#EC4899","#F43F5E"],zi=ee__namespace.default.forwardRef(({value:t="#000000",onChange:e,className:r,showInput:n=!1,showPresets:o=!0,size:i="default",presets:s=eO},a)=>{let[l,c]=ee.useState(t),d=u=>{c(u),e?.(u);};return jsxRuntime.jsxs("div",{ref:a,className:I("space-y-2",r),children:[n&&jsxRuntime.jsx("input",{type:"color",value:l,onChange:u=>d(u.target.value),className:"w-full h-8 rounded border cursor-pointer"}),o&&jsxRuntime.jsx("div",{className:I("grid gap-2 p-2",i==="small"?"grid-cols-6":"grid-cols-4"),children:s.map(u=>jsxRuntime.jsx("button",{className:I("rounded border-2 hover:scale-110 transition-transform",i==="small"?"w-6 h-6":"w-8 h-8",l===u?"border-foreground":"border-muted"),style:{backgroundColor:u},onClick:()=>d(u),title:u},u))})]})});zi.displayName="ColorPicker";var Y0=[{value:"meeting",label:"Meeting",color:"#3b82f6"},{value:"task",label:"Task",color:"#10b981"},{value:"reminder",label:"Reminder",color:"#f59e0b"},{value:"event",label:"Event",color:"#8b5cf6"}],aO=["#3b82f6","#10b981","#f59e0b","#8b5cf6","#ef4444","#06b6d4","#84cc16","#f97316","#ec4899","#6366f1","#14b8a6","#eab308","#f43f5e","#a855f7","#22c55e"];function X0({open:t,onOpenChange:e,event:r,selectedDate:n,onSave:o,onDelete:i,mode:s="create"}){let[a,l]=ee.useState({title:"",description:"",date:"",startTime:"",endTime:"",location:"",type:"meeting",color:"#3b82f6",attendees:""}),[c,d]=ee.useState({}),[u,f]=ee.useState(!1);ee.useEffect(()=>{if(s==="edit"&&r)l({title:r.title||"",description:r.description||"",date:r.date.toISOString().split("T")[0],startTime:r.startTime||"",endTime:r.endTime||"",location:r.location||"",type:r.type||"meeting",color:r.color||"#3b82f6",attendees:r.attendees?.join(", ")||""});else if(s==="create"){let b=n?n.toISOString().split("T")[0]:new Date().toISOString().split("T")[0];l({title:"",description:"",date:b,startTime:"",endTime:"",location:"",type:"meeting",color:"#3b82f6",attendees:""});}d({});},[r,n,s,t]);let p=()=>{let b={};return a.title.trim()||(b.title="Title is required"),a.date||(b.date="Date is required"),a.startTime&&a.endTime&&a.startTime>=a.endTime&&(b.endTime="End time must be after start time"),d(b),Object.keys(b).length===0},h=async b=>{if(b.preventDefault(),!!p()){f(!0);try{let v={...s==="edit"&&r?{id:r.id}:{},title:a.title.trim(),description:a.description.trim(),date:new Date(a.date+"T00:00:00"),startTime:a.startTime||void 0,endTime:a.endTime||void 0,location:a.location.trim()||void 0,type:a.type,color:a.color,attendees:a.attendees?a.attendees.split(",").map(y=>y.trim()).filter(Boolean):void 0};await o(v),e(!1);}catch(v){console.error("Error saving event:",v);}finally{f(!1);}}},m=()=>{r&&i&&(i(r.id),e(!1));},g=b=>{let v=Y0.find(y=>y.value===b);l(y=>({...y,type:b,color:v?.color||y.color}));};return jsxRuntime.jsx(to,{open:t,onOpenChange:e,children:jsxRuntime.jsxs(Tn,{className:"sm:max-w-[500px]",children:[jsxRuntime.jsxs(Qr,{children:[jsxRuntime.jsxs(en,{className:"flex items-center gap-2",children:[jsxRuntime.jsx(lucideReact.Calendar,{className:"w-5 h-5"}),s==="create"?"Create Event":"Edit Event"]}),jsxRuntime.jsx(tn,{children:s==="create"?"Add a new event to your calendar.":"Edit the event details."})]}),jsxRuntime.jsxs("form",{onSubmit:h,className:"space-y-4",children:[jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(He,{htmlFor:"title",children:"Title *"}),jsxRuntime.jsx(Ft,{id:"title",value:a.title,onChange:b=>l(v=>({...v,title:b.target.value})),placeholder:"Event title",className:I(c.title&&"border-red-500")}),c.title&&jsxRuntime.jsx("p",{className:"text-sm text-red-500",children:c.title})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(He,{htmlFor:"description",children:"Description"}),jsxRuntime.jsx(du,{id:"description",value:a.description,onChange:b=>l(v=>({...v,description:b.target.value})),placeholder:"Event description (optional)",rows:3})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(He,{htmlFor:"date",children:"Date *"}),jsxRuntime.jsx(Ft,{id:"date",type:"date",value:a.date,onChange:b=>l(v=>({...v,date:b.target.value})),className:I(c.date&&"border-red-500")}),c.date&&jsxRuntime.jsx("p",{className:"text-sm text-red-500",children:c.date})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(He,{htmlFor:"startTime",children:"Start Time"}),jsxRuntime.jsx(Ft,{id:"startTime",type:"time",value:a.startTime,onChange:b=>l(v=>({...v,startTime:b.target.value})),placeholder:"09:00"})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(He,{htmlFor:"endTime",children:"End Time"}),jsxRuntime.jsx(Ft,{id:"endTime",type:"time",value:a.endTime,onChange:b=>l(v=>({...v,endTime:b.target.value})),placeholder:"10:00",className:I(c.endTime&&"border-red-500")}),c.endTime&&jsxRuntime.jsx("p",{className:"text-sm text-red-500",children:c.endTime})]})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsxs(He,{htmlFor:"location",className:"flex items-center gap-2",children:[jsxRuntime.jsx(lucideReact.MapPin,{className:"w-4 h-4"}),"Location"]}),jsxRuntime.jsx(Ft,{id:"location",value:a.location,onChange:b=>l(v=>({...v,location:b.target.value})),placeholder:"Meeting room, address, or link"})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsxs(He,{className:"flex items-center gap-2",children:[jsxRuntime.jsx(lucideReact.Type,{className:"w-4 h-4"}),"Type"]}),jsxRuntime.jsxs(Bo,{value:a.type,onValueChange:g,children:[jsxRuntime.jsx(Fo,{children:jsxRuntime.jsx(Pi,{})}),jsxRuntime.jsx(zo,{children:Y0.map(b=>jsxRuntime.jsx(Ge,{value:b.value,children:jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:b.color}}),b.label]})},b.value))})]})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsxs(He,{className:"flex items-center gap-2",children:[jsxRuntime.jsx(lucideReact.Palette,{className:"w-4 h-4"}),"Color"]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(zi,{value:a.color,onChange:b=>l(v=>({...v,color:b})),presets:aO,showInput:!1,size:"sm"}),jsxRuntime.jsx("div",{className:"w-6 h-6 rounded border",style:{backgroundColor:a.color}})]})]})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(He,{htmlFor:"attendees",children:"Attendees"}),jsxRuntime.jsx(Ft,{id:"attendees",value:a.attendees,onChange:b=>l(v=>({...v,attendees:b.target.value})),placeholder:"John Doe, Jane Smith (comma-separated)"})]}),jsxRuntime.jsxs(vf,{className:"gap-2",children:[s==="edit"&&i&&jsxRuntime.jsx(xe,{type:"button",variant:"destructive",onClick:m,className:"mr-auto",children:"Delete Event"}),jsxRuntime.jsx(xe,{type:"button",variant:"outline",onClick:()=>e(!1),disabled:u,children:"Cancel"}),jsxRuntime.jsx(xe,{type:"submit",disabled:u,children:u?s==="create"?"Creating...":"Saving...":s==="create"?"Create Event":"Save Changes"})]})]})]})})}var ey=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],gO=["January","February","March","April","May","June","July","August","September","October","November","December"],ty={meeting:"bg-blue-500",task:"bg-green-500",reminder:"bg-yellow-500",event:"bg-purple-500"};function ZV({events:t=[],onEventClick:e,onEventAdd:r,onEventEdit:n,onEventDelete:o,className:i,showWeekends:s=!0,showEventDetails:a=!0,disabled:l=!1,minDate:c,maxDate:d,highlightToday:u=!0,height:f}){let p={hasAccess:!0},{hasProAccess:h,isLoading:m}=xi();if(!p.isDocsMode&&!m&&!h)return jsxRuntime.jsx(yn,{className:I("w-full",i),children:jsxRuntime.jsx(wn,{className:"py-12 text-center",children:jsxRuntime.jsxs("div",{className:"max-w-md mx-auto space-y-4",children:[jsxRuntime.jsx("div",{className:"rounded-full bg-purple-100 dark:bg-purple-900/30 p-3 w-fit mx-auto",children:jsxRuntime.jsx(lucideReact.Lock,{className:"h-6 w-6 text-purple-600 dark:text-purple-400"})}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"font-semibold text-lg mb-2",children:"Pro Feature"}),jsxRuntime.jsx("p",{className:"text-muted-foreground text-sm mb-4",children:"Calendar is available exclusively to MoonUI Pro subscribers."}),jsxRuntime.jsx("div",{className:"flex gap-3 justify-center",children:jsxRuntime.jsx("a",{href:"/pricing",children:jsxRuntime.jsxs(xe,{size:"sm",children:[jsxRuntime.jsx(lucideReact.Sparkles,{className:"mr-2 h-4 w-4"}),"Upgrade to Pro"]})})})]})]})})});let [b,v]=ee__namespace.default.useState(new Date),[y,x]=ee__namespace.default.useState(null);ee__namespace.default.useState("month");let [R,w]=ee__namespace.default.useState(!1),[N,M]=ee__namespace.default.useState("create"),[B,U]=ee__namespace.default.useState(null),[K,P]=ee__namespace.default.useState(null),[V,C]=ee__namespace.default.useState(null),T=new Date,_=b.getMonth(),A=b.getFullYear(),L=new Date(A,_,1),Y=new Date(A,_+1,0),te=new Date(L);te.setDate(te.getDate()-te.getDay());let ke=new Date(Y);ke.setDate(ke.getDate()+(6-ke.getDay()));let me=[],Te=new Date(te);for(;Te<=ke;)me.push(new Date(Te)),Te.setDate(Te.getDate()+1);let Ae=G=>t.filter($=>new Date($.date).toDateString()===G.toDateString()),W=G=>G.toDateString()===T.toDateString(),ue=G=>G.getMonth()===_,Oe=G=>y&&G.toDateString()===y.toDateString(),Se=G=>!!(l||c&&G<c||d&&G>d),le=G=>{let $=new Date(b);G==="prev"?$.setMonth(_-1):$.setMonth(_+1),v($);},Ce=G=>{if(Se(G))return;x(G);let $=Ae(G);$.length===0?(M("create"),U(null),w(!0)):$.length===1&&e?.($[0]);},$e=(G,$)=>{$.stopPropagation(),e?.(G);},Ke=(G,$)=>{P(G),$.dataTransfer.effectAllowed="move",$.dataTransfer.setData("text/plain",G.id);let j=$.target;j.style.opacity="0.5";},nt=G=>{P(null),C(null);let $=G.target;$.style.opacity="1";},Re=(G,$)=>{Se(G)||!K||($.preventDefault(),$.dataTransfer.dropEffect="move",C(G));},wt=(G,$)=>{if($.preventDefault(),!(!K||Se(G))){if(K.date.toDateString()!==G.toDateString()){let j={...K,date:G};n?.(j);}P(null),C(null);}},D=(G,$)=>{$.stopPropagation(),M("edit"),U(G),w(!0);},re=(G,$)=>{$.stopPropagation(),o?.(G.id);},ce=G=>{N==="create"?r?.(G):N==="edit"&&G.id&&n?.(G);},ne=G=>{o?.(G);},$t=()=>{v(new Date),x(new Date);},pr=s?me:me.filter(G=>{let $=G.getDay();return $!==0&&$!==6}),Es=s?ey:ey.slice(1,6);return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(yn,{className:I("w-full max-w-full overflow-hidden",i),style:{height:f?`${f}px`:void 0},children:[jsxRuntime.jsx(Ss,{children:jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs(Cs,{className:"flex items-center gap-2",children:[jsxRuntime.jsx(lucideReact.Calendar,{className:"h-5 w-5"}),"Calendar"]}),jsxRuntime.jsxs(Rs,{children:[gO[_]," ",A]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(xe,{variant:"outline",size:"sm",onClick:$t,children:"Today"}),jsxRuntime.jsx(xe,{variant:"outline",size:"sm",onClick:()=>le("prev"),disabled:l,children:jsxRuntime.jsx(lucideReact.ChevronLeft,{className:"h-4 w-4"})}),jsxRuntime.jsx(xe,{variant:"outline",size:"sm",onClick:()=>le("next"),disabled:l,children:jsxRuntime.jsx(lucideReact.ChevronRight,{className:"h-4 w-4"})})]})]})}),jsxRuntime.jsx(wn,{className:"overflow-x-auto",children:jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsxs("div",{className:"grid grid-cols-7 gap-1 w-full",style:{minWidth:"500px"},children:[Es.map(G=>jsxRuntime.jsx("div",{className:"p-1 text-center text-xs font-medium text-muted-foreground min-w-[70px]",children:G},G)),pr.map((G,$)=>{let j=Ae(G),ve=ue(G),De=W(G),Ct=Oe(G),Lr=Se(G);return jsxRuntime.jsxs("div",{className:I("min-h-[80px] min-w-[70px] p-1 border border-border/50 cursor-pointer hover:bg-muted/50 transition-colors text-xs flex flex-col",!ve&&"text-muted-foreground bg-muted/20",De&&u&&"bg-primary/10 border-primary/50",Ct&&"bg-primary/20 border-primary",Lr&&"cursor-not-allowed opacity-50",V&&V.toDateString()===G.toDateString()&&"bg-primary/30 border-primary"),onClick:()=>Ce(G),onDragOver:Mt=>Re(G,Mt),onDrop:Mt=>wt(G,Mt),children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-1",children:[jsxRuntime.jsx("span",{className:I("text-sm font-medium",De&&"text-primary font-bold"),children:G.getDate()}),j.length>0&&jsxRuntime.jsx(Ts,{variant:"secondary",className:"text-xs px-1",children:j.length})]}),jsxRuntime.jsxs("div",{className:"flex-1 space-y-1 overflow-hidden",children:[j.slice(0,3).map(Mt=>jsxRuntime.jsxs("div",{className:I("text-xs p-1 mb-1 rounded text-white cursor-move group relative select-none block w-full truncate",Mt.color||ty[Mt.type||"event"]),draggable:!l,onClick:vn=>$e(Mt,vn),onDragStart:vn=>Ke(Mt,vn),onDragEnd:nt,style:{backgroundColor:Mt.color||void 0},children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("span",{className:"truncate flex-1",children:Mt.title}),a&&jsxRuntime.jsxs("div",{className:"hidden group-hover:flex items-center gap-1 ml-1",children:[jsxRuntime.jsx(xe,{variant:"ghost",size:"sm",className:"h-4 w-4 p-0 text-white/80 hover:text-white",onClick:vn=>D(Mt,vn),children:jsxRuntime.jsx(lucideReact.Edit,{className:"h-3 w-3"})}),jsxRuntime.jsx(xe,{variant:"ghost",size:"sm",className:"h-4 w-4 p-0 text-white/80 hover:text-white",onClick:vn=>re(Mt,vn),children:jsxRuntime.jsx(lucideReact.Trash2,{className:"h-3 w-3"})})]})]}),Mt.startTime&&jsxRuntime.jsxs("div",{className:"flex items-center gap-1 mt-1",children:[jsxRuntime.jsx(lucideReact.Clock,{className:"h-3 w-3"}),jsxRuntime.jsx("span",{children:Mt.startTime})]})]},Mt.id)),j.length>3&&jsxRuntime.jsxs("div",{className:"text-xs text-muted-foreground text-center",children:["+",j.length-3," more"]})]})]},$)})]}),y&&jsxRuntime.jsxs("div",{className:"border rounded-lg p-4 bg-muted/50",children:[jsxRuntime.jsx("h4",{className:"font-medium mb-2",children:y.toLocaleDateString("en-US",{weekday:"long",year:"numeric",month:"long",day:"numeric"})}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[Ae(y).map(G=>jsxRuntime.jsxs("div",{className:"flex items-start gap-3 p-2 border rounded",children:[jsxRuntime.jsx("div",{className:I("w-3 h-3 rounded-full mt-1 flex-shrink-0",G.color||ty[G.type||"event"])}),jsxRuntime.jsxs("div",{className:"flex-1",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("h5",{className:"font-medium",children:G.title}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx(xe,{variant:"ghost",size:"sm",onClick:$=>D(G,$),children:jsxRuntime.jsx(lucideReact.Edit,{className:"h-4 w-4"})}),jsxRuntime.jsx(xe,{variant:"ghost",size:"sm",onClick:$=>re(G,$),children:jsxRuntime.jsx(lucideReact.Trash2,{className:"h-4 w-4"})})]})]}),G.description&&jsxRuntime.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:G.description}),jsxRuntime.jsxs("div",{className:"flex items-center gap-4 text-xs text-muted-foreground mt-2",children:[G.startTime&&jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx(lucideReact.Clock,{className:"h-3 w-3"}),jsxRuntime.jsxs("span",{children:[G.startTime," - ",G.endTime]})]}),G.location&&jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx(lucideReact.MapPin,{className:"h-3 w-3"}),jsxRuntime.jsx("span",{children:G.location})]}),G.attendees&&G.attendees.length>0&&jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx(lucideReact.User,{className:"h-3 w-3"}),jsxRuntime.jsxs("span",{children:[G.attendees.length," attendees"]})]})]})]})]},G.id)),Ae(y).length===0&&jsxRuntime.jsxs("div",{className:"text-center py-4",children:[jsxRuntime.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:"No events scheduled for this date"}),jsxRuntime.jsxs(xe,{variant:"outline",size:"sm",onClick:()=>{M("create"),U(null),w(!0);},children:[jsxRuntime.jsx(lucideReact.Plus,{className:"h-4 w-4 mr-1"}),"Add Event"]})]})]})]})]})})]}),jsxRuntime.jsx(X0,{open:R,onOpenChange:w,event:B,selectedDate:y,onSave:ce,onDelete:ne,mode:N})]})}var yO=classVarianceAuthority.cva("relative flex shrink-0 overflow-hidden",{variants:{size:{default:"h-10 w-10",xs:"h-6 w-6",sm:"h-8 w-8",md:"h-10 w-10",lg:"h-12 w-12",xl:"h-16 w-16","2xl":"h-20 w-20"},radius:{default:"rounded-full",sm:"rounded-md",lg:"rounded-xl",full:"rounded-full",none:"rounded-none"},variant:{default:"",ring:"ring-2 ring-gray-300 dark:ring-gray-600",ringOffset:"ring-2 ring-gray-300 dark:ring-gray-600 ring-offset-2 ring-offset-background dark:ring-offset-gray-950",border:"border-2 border-gray-200 dark:border-gray-800"}},defaultVariants:{size:"default",radius:"default",variant:"default"}}),Wl=ee__namespace.forwardRef(({className:t,size:e,radius:r,variant:n,...o},i)=>jsxRuntime.jsx(Nn__namespace.Root,{ref:i,className:I(yO({size:e,radius:r,variant:n}),t),...o}));Wl.displayName=Nn__namespace.Root.displayName;var xf=ee__namespace.forwardRef(({className:t,...e},r)=>jsxRuntime.jsx(Nn__namespace.Image,{ref:r,className:I("aspect-square h-full w-full",t),...e}));xf.displayName=Nn__namespace.Image.displayName;var Gl=ee__namespace.forwardRef(({className:t,...e},r)=>jsxRuntime.jsx(Nn__namespace.Fallback,{ref:r,className:I("flex h-full w-full items-center justify-center bg-muted",t),...e}));Gl.displayName=Nn__namespace.Fallback.displayName;var wO=ee__namespace.forwardRef(({className:t,limit:e,avatars:r,overlapOffset:n=-8,...o},i)=>{let s=e?r.slice(0,e):r,a=e?Math.max(0,r.length-e):0;return jsxRuntime.jsx("div",{ref:i,className:I("flex items-center",t),...o,children:jsxRuntime.jsxs("div",{className:"flex",children:[s.map((l,c)=>jsxRuntime.jsx("div",{className:"relative",style:{marginLeft:c===0?0:`${n}px`,zIndex:s.length-c},children:l},c)),a>0&&jsxRuntime.jsx("div",{className:"relative z-0",style:{marginLeft:`${n}px`},children:jsxRuntime.jsx(Wl,{variant:"border",children:jsxRuntime.jsxs(Gl,{children:["+",a]})})})]})})});wO.displayName="AvatarGroup";var MO={low:"bg-green-500",medium:"bg-yellow-500",high:"bg-orange-500",urgent:"bg-red-500"};function hK({columns:t,onCardMove:e,onCardClick:r,onCardEdit:n,onCardDelete:o,onAddCard:i,onAddColumn:s,className:a,showAddColumn:l=!0,showCardDetails:c=!0,disabled:d=!1}){let u={hasAccess:!0},{hasProAccess:f,isLoading:p}=xi();if(!u.isDocsMode&&!p&&!f)return jsxRuntime.jsx(yn,{className:I("w-full",a),children:jsxRuntime.jsx(wn,{className:"py-12 text-center",children:jsxRuntime.jsxs("div",{className:"max-w-md mx-auto space-y-4",children:[jsxRuntime.jsx("div",{className:"rounded-full bg-purple-100 dark:bg-purple-900/30 p-3 w-fit mx-auto",children:jsxRuntime.jsx(lucideReact.Lock,{className:"h-6 w-6 text-purple-600 dark:text-purple-400"})}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"font-semibold text-lg mb-2",children:"Pro Feature"}),jsxRuntime.jsx("p",{className:"text-muted-foreground text-sm mb-4",children:"Kanban Board is available exclusively to MoonUI Pro subscribers."}),jsxRuntime.jsx("div",{className:"flex gap-3 justify-center",children:jsxRuntime.jsx("a",{href:"/pricing",children:jsxRuntime.jsxs(xe,{size:"sm",children:[jsxRuntime.jsx(lucideReact.Sparkles,{className:"mr-2 h-4 w-4"}),"Upgrade to Pro"]})})})]})]})})});let[m,g]=ee__namespace.default.useState(null),[b,v]=ee__namespace.default.useState(null),[y,x]=ee__namespace.default.useState(null),E=(T,_)=>{if(d)return;let A=t.find(L=>L.cards.some(Y=>Y.id===_));g(_),x(A?.id||null),T.dataTransfer.effectAllowed="move",T.dataTransfer.setData("text/plain",_),T.currentTarget.classList.add("opacity-50");},S=T=>{d||(g(null),v(null),x(null),T.currentTarget.classList.remove("opacity-50"));},R=(T,_)=>{d||(T.preventDefault(),T.dataTransfer.dropEffect="move",v(_));},w=(T,_)=>{d||(T.preventDefault(),v(_));},N=(T,_)=>{if(d)return;T.preventDefault();let A=T.currentTarget.getBoundingClientRect();(T.clientX<A.left||T.clientX>A.right||T.clientY<A.top||T.clientY>A.bottom)&&v(null);},M=(T,_)=>{if(d)return;T.preventDefault();let A=T.dataTransfer.getData("text/plain")||m;if(A&&e&&y&&y!==_){let Y=t.find(te=>te.id===_)?.cards.length||0;e(A,y,_,Y);}g(null),v(null),x(null);},B=T=>{d||r?.(T);},U=(T,_)=>{d||(_.stopPropagation(),n?.(T));},K=(T,_)=>{d||(_.stopPropagation(),o?.(T));},P=T=>T.toLocaleDateString("en-US",{month:"short",day:"numeric"}),V=T=>T<new Date,C=T=>T.split(" ").map(_=>_[0]).join("").toUpperCase();return jsxRuntime.jsx("div",{className:I("w-full",a),children:jsxRuntime.jsxs("div",{className:"flex gap-6 overflow-x-auto pb-4",children:[t.map(T=>{let _=T.limit&&T.cards.length>T.limit,A=b===T.id;return jsxRuntime.jsx("div",{className:I("flex-shrink-0 w-80 transition-colors duration-200",A&&"bg-primary/5 rounded-lg border-2 border-primary/20"),onDragOver:L=>R(L,T.id),onDragEnter:L=>w(L,T.id),onDragLeave:L=>N(L,T.id),onDrop:L=>M(L,T.id),children:jsxRuntime.jsxs(yn,{className:"h-full",children:[jsxRuntime.jsxs(Ss,{className:"pb-3",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[T.color&&jsxRuntime.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:T.color}}),jsxRuntime.jsx(Cs,{className:"text-sm font-medium",children:T.title}),jsxRuntime.jsx(Ts,{variant:"secondary",className:"text-xs",children:T.cards.length})]}),jsxRuntime.jsx(xe,{variant:"ghost",size:"sm",children:jsxRuntime.jsx(lucideReact.MoreHorizontal,{className:"h-4 w-4"})})]}),T.limit&&jsxRuntime.jsx(Rs,{className:I("text-xs",_&&"text-destructive"),children:_?"Over limit":`${T.cards.length}/${T.limit} cards`})]}),jsxRuntime.jsxs(wn,{className:"space-y-3",children:[T.cards.map(L=>jsxRuntime.jsxs("div",{draggable:!d,onDragStart:Y=>E(Y,L.id),onDragEnd:S,onClick:()=>B(L),className:I("p-3 bg-background border rounded-lg cursor-pointer hover:shadow-md transition-all duration-200","group relative select-none",m===L.id&&"opacity-50 scale-95",d&&"cursor-not-allowed"),children:[jsxRuntime.jsxs("div",{className:"flex items-start justify-between gap-2",children:[jsxRuntime.jsxs("div",{className:"flex-1",children:[jsxRuntime.jsx("h4",{className:"font-medium text-sm mb-1",children:L.title}),L.description&&jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground mb-2 line-clamp-2",children:L.description})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[jsxRuntime.jsx(xe,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:Y=>U(L,Y),children:jsxRuntime.jsx(lucideReact.Edit,{className:"h-3 w-3"})}),jsxRuntime.jsx(xe,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:Y=>K(L,Y),children:jsxRuntime.jsx(lucideReact.Trash2,{className:"h-3 w-3"})}),jsxRuntime.jsx("div",{className:"cursor-move",children:jsxRuntime.jsx(lucideReact.GripVertical,{className:"h-3 w-3 text-muted-foreground"})})]})]}),L.tags&&L.tags.length>0&&jsxRuntime.jsx("div",{className:"flex flex-wrap gap-1 mb-2",children:L.tags.map((Y,te)=>jsxRuntime.jsx(Ts,{variant:"outline",className:"text-xs px-1 py-0",children:Y},te))}),c&&jsxRuntime.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[L.priority&&jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("div",{className:I("w-2 h-2 rounded-full",MO[L.priority])}),jsxRuntime.jsx("span",{className:"capitalize",children:L.priority})]}),L.dueDate&&jsxRuntime.jsxs("div",{className:I("flex items-center gap-1",V(L.dueDate)&&"text-destructive"),children:[jsxRuntime.jsx(lucideReact.Calendar,{className:"h-3 w-3"}),jsxRuntime.jsx("span",{children:P(L.dueDate)})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[L.comments&&L.comments>0&&jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx(lucideReact.MessageCircle,{className:"h-3 w-3"}),jsxRuntime.jsx("span",{children:L.comments})]}),L.attachments&&L.attachments>0&&jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx(lucideReact.Paperclip,{className:"h-3 w-3"}),jsxRuntime.jsx("span",{children:L.attachments})]}),L.assignee&&jsxRuntime.jsxs(Wl,{className:"h-5 w-5",children:[jsxRuntime.jsx(xf,{src:L.assignee.avatar}),jsxRuntime.jsx(Gl,{className:"text-xs",children:C(L.assignee.name)})]})]})]})]},L.id)),i&&jsxRuntime.jsxs(xe,{variant:"ghost",size:"sm",onClick:()=>i(T.id),className:"w-full justify-start text-muted-foreground hover:text-foreground",disabled:d,children:[jsxRuntime.jsx(lucideReact.Plus,{className:"h-4 w-4 mr-2"}),"Add card"]})]})]})},T.id)}),l&&s&&jsxRuntime.jsx("div",{className:"flex-shrink-0 w-80",children:jsxRuntime.jsxs(xe,{variant:"outline",onClick:s,className:"w-full h-full min-h-[200px] border-dashed justify-center items-center",disabled:d,children:[jsxRuntime.jsx(lucideReact.Plus,{className:"h-6 w-6 mr-2"}),"Add column"]})})]})})}var EE=ks(Ys(),1);function Wt(t){this.content=t;}Wt.prototype={constructor:Wt,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return -1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,r){var n=r&&r!=t?this.remove(r):this,o=n.find(t),i=n.content.slice();return o==-1?i.push(r||t,e):(i[o+1]=e,r&&(i[o]=r)),new Wt(i)},remove:function(t){var e=this.find(t);if(e==-1)return this;var r=this.content.slice();return r.splice(e,2),new Wt(r)},addToStart:function(t,e){return new Wt([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var r=this.remove(t).content.slice();return r.push(t,e),new Wt(r)},addBefore:function(t,e,r){var n=this.remove(e),o=n.content.slice(),i=n.find(t);return o.splice(i==-1?o.length:i,0,e,r),new Wt(o)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1]);},prepend:function(t){return t=Wt.from(t),t.size?new Wt(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=Wt.from(t),t.size?new Wt(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=Wt.from(t);for(var r=0;r<t.content.length;r+=2)e=e.remove(t.content[r]);return e},toObject:function(){var t={};return this.forEach(function(e,r){t[e]=r;}),t},get size(){return this.content.length>>1}};Wt.from=function(t){if(t instanceof Wt)return t;var e=[];if(t)for(var r in t)e.push(r,t[r]);return new Wt(e)};var Cf=Wt;function by(t,e,r){for(let n=0;;n++){if(n==t.childCount||n==e.childCount)return t.childCount==e.childCount?null:r;let o=t.child(n),i=e.child(n);if(o==i){r+=o.nodeSize;continue}if(!o.sameMarkup(i))return r;if(o.isText&&o.text!=i.text){for(let s=0;o.text[s]==i.text[s];s++)r++;return r}if(o.content.size||i.content.size){let s=by(o.content,i.content,r+1);if(s!=null)return s}r+=o.nodeSize;}}function vy(t,e,r,n){for(let o=t.childCount,i=e.childCount;;){if(o==0||i==0)return o==i?null:{a:r,b:n};let s=t.child(--o),a=e.child(--i),l=s.nodeSize;if(s==a){r-=l,n-=l;continue}if(!s.sameMarkup(a))return {a:r,b:n};if(s.isText&&s.text!=a.text){let c=0,d=Math.min(s.text.length,a.text.length);for(;c<d&&s.text[s.text.length-c-1]==a.text[a.text.length-c-1];)c++,r--,n--;return {a:r,b:n}}if(s.content.size||a.content.size){let c=vy(s.content,a.content,r-1,n-1);if(c)return c}r-=l,n-=l;}}var O=class{constructor(e,r){if(this.content=e,this.size=r||0,r==null)for(let n=0;n<e.length;n++)this.size+=e[n].nodeSize;}nodesBetween(e,r,n,o=0,i){for(let s=0,a=0;a<r;s++){let l=this.content[s],c=a+l.nodeSize;if(c>e&&n(l,o+a,i||null,s)!==!1&&l.content.size){let d=a+1;l.nodesBetween(Math.max(0,e-d),Math.min(l.content.size,r-d),n,o+d);}a=c;}}descendants(e){this.nodesBetween(0,this.size,e);}textBetween(e,r,n,o){let i="",s=!0;return this.nodesBetween(e,r,(a,l)=>{let c=a.isText?a.text.slice(Math.max(e,l)-l,r-l):a.isLeaf?o?typeof o=="function"?o(a):o:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&c||a.isTextblock)&&n&&(s?s=!1:i+=n),i+=c;},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let r=this.lastChild,n=e.firstChild,o=this.content.slice(),i=0;for(r.isText&&r.sameMarkup(n)&&(o[o.length-1]=r.withText(r.text+n.text),i=1);i<e.content.length;i++)o.push(e.content[i]);return new O(o,this.size+e.size)}cut(e,r=this.size){if(e==0&&r==this.size)return this;let n=[],o=0;if(r>e)for(let i=0,s=0;s<r;i++){let a=this.content[i],l=s+a.nodeSize;l>e&&((s<e||l>r)&&(a.isText?a=a.cut(Math.max(0,e-s),Math.min(a.text.length,r-s)):a=a.cut(Math.max(0,e-s-1),Math.min(a.content.size,r-s-1))),n.push(a),o+=a.nodeSize),s=l;}return new O(n,o)}cutByIndex(e,r){return e==r?O.empty:e==0&&r==this.content.length?this:new O(this.content.slice(e,r))}replaceChild(e,r){let n=this.content[e];if(n==r)return this;let o=this.content.slice(),i=this.size+r.nodeSize-n.nodeSize;return o[e]=r,new O(o,i)}addToStart(e){return new O([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new O(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return !1;for(let r=0;r<this.content.length;r++)if(!this.content[r].eq(e.content[r]))return !1;return !0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let r=this.content[e];if(!r)throw new RangeError("Index "+e+" out of range for "+this);return r}maybeChild(e){return this.content[e]||null}forEach(e){for(let r=0,n=0;r<this.content.length;r++){let o=this.content[r];e(o,n,r),n+=o.nodeSize;}}findDiffStart(e,r=0){return by(this,e,r)}findDiffEnd(e,r=this.size,n=e.size){return vy(this,e,r,n)}findIndex(e){if(e==0)return ql(0,e);if(e==this.size)return ql(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,n=0;;r++){let o=this.child(r),i=n+o.nodeSize;if(i>=e)return i==e?ql(r+1,i):ql(r,n);n=i;}}toString(){return "<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,r){if(!r)return O.empty;if(!Array.isArray(r))throw new RangeError("Invalid input for Fragment.fromJSON");return new O(r.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return O.empty;let r,n=0;for(let o=0;o<e.length;o++){let i=e[o];n+=i.nodeSize,o&&i.isText&&e[o-1].sameMarkup(i)?(r||(r=e.slice(0,o)),r[r.length-1]=i.withText(r[r.length-1].text+i.text)):r&&r.push(i);}return new O(r||e,n)}static from(e){if(!e)return O.empty;if(e instanceof O)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new O([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}};O.empty=new O([],0);var Rf={index:0,offset:0};function ql(t,e){return Rf.index=t,Rf.offset=e,Rf}function Yl(t,e){if(t===e)return !0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return !1;let r=Array.isArray(t);if(Array.isArray(e)!=r)return !1;if(r){if(t.length!=e.length)return !1;for(let n=0;n<t.length;n++)if(!Yl(t[n],e[n]))return !1}else {for(let n in t)if(!(n in e)||!Yl(t[n],e[n]))return !1;for(let n in e)if(!(n in t))return !1}return !0}var _e=class{constructor(e,r){this.type=e,this.attrs=r;}addToSet(e){let r,n=!1;for(let o=0;o<e.length;o++){let i=e[o];if(this.eq(i))return e;if(this.type.excludes(i.type))r||(r=e.slice(0,o));else {if(i.type.excludes(this.type))return e;!n&&i.type.rank>this.type.rank&&(r||(r=e.slice(0,o)),r.push(this),n=!0),r&&r.push(i);}}return r||(r=e.slice()),n||r.push(this),r}removeFromSet(e){for(let r=0;r<e.length;r++)if(this.eq(e[r]))return e.slice(0,r).concat(e.slice(r+1));return e}isInSet(e){for(let r=0;r<e.length;r++)if(this.eq(e[r]))return !0;return !1}eq(e){return this==e||this.type==e.type&&Yl(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let r in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,r){if(!r)throw new RangeError("Invalid input for Mark.fromJSON");let n=e.marks[r.type];if(!n)throw new RangeError(`There is no mark type ${r.type} in this schema`);let o=n.create(r.attrs);return n.checkAttrs(o.attrs),o}static sameSet(e,r){if(e==r)return !0;if(e.length!=r.length)return !1;for(let n=0;n<e.length;n++)if(!e[n].eq(r[n]))return !1;return !0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return _e.none;if(e instanceof _e)return [e];let r=e.slice();return r.sort((n,o)=>n.type.rank-o.type.rank),r}};_e.none=[];var jo=class extends Error{},H=class{constructor(e,r,n){this.content=e,this.openStart=r,this.openEnd=n;}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,r){let n=wy(this.content,e+this.openStart,r);return n&&new H(n,this.openStart,this.openEnd)}removeBetween(e,r){return new H(yy(this.content,e+this.openStart,r+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,r){if(!r)return H.empty;let n=r.openStart||0,o=r.openEnd||0;if(typeof n!="number"||typeof o!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new H(O.fromJSON(e,r.content),n,o)}static maxOpen(e,r=!0){let n=0,o=0;for(let i=e.firstChild;i&&!i.isLeaf&&(r||!i.type.spec.isolating);i=i.firstChild)n++;for(let i=e.lastChild;i&&!i.isLeaf&&(r||!i.type.spec.isolating);i=i.lastChild)o++;return new H(e,n,o)}};H.empty=new H(O.empty,0,0);function yy(t,e,r){let{index:n,offset:o}=t.findIndex(e),i=t.maybeChild(n),{index:s,offset:a}=t.findIndex(r);if(o==e||i.isText){if(a!=r&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(r))}if(n!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(n,i.copy(yy(i.content,e-o-1,r-o-1)))}function wy(t,e,r,n){let{index:o,offset:i}=t.findIndex(e),s=t.maybeChild(o);if(i==e||s.isText)return n&&!n.canReplace(o,o,r)?null:t.cut(0,e).append(r).append(t.cut(e));let a=wy(s.content,e-i-1,r);return a&&t.replaceChild(o,s.copy(a))}function zO(t,e,r){if(r.openStart>t.depth)throw new jo("Inserted content deeper than insertion position");if(t.depth-r.openStart!=e.depth-r.openEnd)throw new jo("Inconsistent open depths");return xy(t,e,r,0)}function xy(t,e,r,n){let o=t.index(n),i=t.node(n);if(o==e.index(n)&&n<t.depth-r.openStart){let s=xy(t,e,r,n+1);return i.copy(i.content.replaceChild(o,s))}else if(r.content.size)if(!r.openStart&&!r.openEnd&&t.depth==n&&e.depth==n){let s=t.parent,a=s.content;return qo(s,a.cut(0,t.parentOffset).append(r.content).append(a.cut(e.parentOffset)))}else {let{start:s,end:a}=HO(r,t);return qo(i,ky(t,s,a,e,n))}else return qo(i,Xl(t,e,n))}function Ey(t,e){if(!e.type.compatibleContent(t.type))throw new jo("Cannot join "+e.type.name+" onto "+t.type.name)}function Nf(t,e,r){let n=t.node(r);return Ey(n,e.node(r)),n}function Go(t,e){let r=e.length-1;r>=0&&t.isText&&t.sameMarkup(e[r])?e[r]=t.withText(e[r].text+t.text):e.push(t);}function Xs(t,e,r,n){let o=(e||t).node(r),i=0,s=e?e.index(r):o.childCount;t&&(i=t.index(r),t.depth>r?i++:t.textOffset&&(Go(t.nodeAfter,n),i++));for(let a=i;a<s;a++)Go(o.child(a),n);e&&e.depth==r&&e.textOffset&&Go(e.nodeBefore,n);}function qo(t,e){return t.type.checkContent(e),t.copy(e)}function ky(t,e,r,n,o){let i=t.depth>o&&Nf(t,e,o+1),s=n.depth>o&&Nf(r,n,o+1),a=[];return Xs(null,t,o,a),i&&s&&e.index(o)==r.index(o)?(Ey(i,s),Go(qo(i,ky(t,e,r,n,o+1)),a)):(i&&Go(qo(i,Xl(t,e,o+1)),a),Xs(e,r,o,a),s&&Go(qo(s,Xl(r,n,o+1)),a)),Xs(n,null,o,a),new O(a)}function Xl(t,e,r){let n=[];if(Xs(null,t,r,n),t.depth>r){let o=Nf(t,e,r+1);Go(qo(o,Xl(t,e,r+1)),n);}return Xs(e,null,r,n),new O(n)}function HO(t,e){let r=e.depth-t.openStart,o=e.node(r).copy(t.content);for(let i=r-1;i>=0;i--)o=e.node(i).copy(O.from(o));return {start:o.resolveNoCache(t.openStart+r),end:o.resolveNoCache(o.content.size-t.openEnd-r)}}var Yo=class{constructor(e,r,n){this.pos=e,this.path=r,this.parentOffset=n,this.depth=r.length/3-1;}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,r=this.index(this.depth);if(r==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],o=e.child(r);return n?e.child(r).cut(n):o}get nodeBefore(){let e=this.index(this.depth),r=this.pos-this.path[this.path.length-1];return r?this.parent.child(e).cut(0,r):e==0?null:this.parent.child(e-1)}posAtIndex(e,r){r=this.resolveDepth(r);let n=this.path[r*3],o=r==0?0:this.path[r*3-1]+1;for(let i=0;i<e;i++)o+=n.child(i).nodeSize;return o}marks(){let e=this.parent,r=this.index();if(e.content.size==0)return _e.none;if(this.textOffset)return e.child(r).marks;let n=e.maybeChild(r-1),o=e.maybeChild(r);if(!n){let a=n;n=o,o=a;}let i=n.marks;for(var s=0;s<i.length;s++)i[s].type.spec.inclusive===!1&&(!o||!i[s].isInSet(o.marks))&&(i=i[s--].removeFromSet(i));return i}marksAcross(e){let r=this.parent.maybeChild(this.index());if(!r||!r.isInline)return null;let n=r.marks,o=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)n[i].type.spec.inclusive===!1&&(!o||!n[i].isInSet(o.marks))&&(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let r=this.depth;r>0;r--)if(this.start(r)<=e&&this.end(r)>=e)return r;return 0}blockRange(e=this,r){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!r||r(this.node(n))))return new Xo(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let r=1;r<=this.depth;r++)e+=(e?"/":"")+this.node(r).type.name+"_"+this.index(r-1);return e+":"+this.parentOffset}static resolve(e,r){if(!(r>=0&&r<=e.content.size))throw new RangeError("Position "+r+" out of range");let n=[],o=0,i=r;for(let s=e;;){let{index:a,offset:l}=s.content.findIndex(i),c=i-l;if(n.push(s,a,o+l),!c||(s=s.child(a),s.isText))break;i=c-1,o+=l+1;}return new Yo(r,n,i)}static resolveCached(e,r){let n=ly.get(e);if(n)for(let i=0;i<n.elts.length;i++){let s=n.elts[i];if(s.pos==r)return s}else ly.set(e,n=new _f);let o=n.elts[n.i]=Yo.resolve(e,r);return n.i=(n.i+1)%UO,o}},_f=class{constructor(){this.elts=[],this.i=0;}},UO=12,ly=new WeakMap,Xo=class{constructor(e,r,n){this.$from=e,this.$to=r,this.depth=n;}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}},VO=Object.create(null),Ot=class{constructor(e,r,n,o=_e.none){this.type=e,this.attrs=r,this.marks=o,this.content=n||O.empty;}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e);}nodesBetween(e,r,n,o=0){this.content.nodesBetween(e,r,n,o,this);}descendants(e){this.nodesBetween(0,this.content.size,e);}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,r,n,o){return this.content.textBetween(e,r,n,o)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,r,n){return this.type==e&&Yl(this.attrs,r||e.defaultAttrs||VO)&&_e.sameSet(this.marks,n||_e.none)}copy(e=null){return e==this.content?this:new Ot(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Ot(this.type,this.attrs,this.content,e)}cut(e,r=this.content.size){return e==0&&r==this.content.size?this:this.copy(this.content.cut(e,r))}slice(e,r=this.content.size,n=!1){if(e==r)return H.empty;let o=this.resolve(e),i=this.resolve(r),s=n?0:o.sharedDepth(r),a=o.start(s),c=o.node(s).content.cut(o.pos-a,i.pos-a);return new H(c,o.depth-s,i.depth-s)}replace(e,r,n){return zO(this.resolve(e),this.resolve(r),n)}nodeAt(e){for(let r=this;;){let{index:n,offset:o}=r.content.findIndex(e);if(r=r.maybeChild(n),!r)return null;if(o==e||r.isText)return r;e-=o+1;}}childAfter(e){let{index:r,offset:n}=this.content.findIndex(e);return {node:this.content.maybeChild(r),index:r,offset:n}}childBefore(e){if(e==0)return {node:null,index:0,offset:0};let{index:r,offset:n}=this.content.findIndex(e);if(n<e)return {node:this.content.child(r),index:r,offset:n};let o=this.content.child(r-1);return {node:o,index:r-1,offset:n-o.nodeSize}}resolve(e){return Yo.resolveCached(this,e)}resolveNoCache(e){return Yo.resolve(this,e)}rangeHasMark(e,r,n){let o=!1;return r>e&&this.nodesBetween(e,r,i=>(n.isInSet(i.marks)&&(o=!0),!o)),o}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Sy(this.marks,e)}contentMatchAt(e){let r=this.type.contentMatch.matchFragment(this.content,0,e);if(!r)throw new Error("Called contentMatchAt on a node with invalid content");return r}canReplace(e,r,n=O.empty,o=0,i=n.childCount){let s=this.contentMatchAt(e).matchFragment(n,o,i),a=s&&s.matchFragment(this.content,r);if(!a||!a.validEnd)return !1;for(let l=o;l<i;l++)if(!this.type.allowsMarks(n.child(l).marks))return !1;return !0}canReplaceWith(e,r,n,o){if(o&&!this.type.allowsMarks(o))return !1;let i=this.contentMatchAt(e).matchType(n),s=i&&i.matchFragment(this.content,r);return s?s.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=_e.none;for(let r=0;r<this.marks.length;r++){let n=this.marks[r];n.type.checkAttrs(n.attrs),e=n.addToSet(e);}if(!_e.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(r=>r.type.name)}`);this.content.forEach(r=>r.check());}toJSON(){let e={type:this.type.name};for(let r in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(r=>r.toJSON())),e}static fromJSON(e,r){if(!r)throw new RangeError("Invalid input for Node.fromJSON");let n;if(r.marks){if(!Array.isArray(r.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=r.marks.map(e.markFromJSON);}if(r.type=="text"){if(typeof r.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(r.text,n)}let o=O.fromJSON(e,r.content),i=e.nodeType(r.type).create(r.attrs,o,n);return i.type.checkAttrs(i.attrs),i}};Ot.prototype.text=void 0;var Vi=class extends Ot{constructor(e,r,n,o){if(super(e,r,null,o),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n;}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Sy(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,r){return this.text.slice(e,r)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Vi(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Vi(this.type,this.attrs,e,this.marks)}cut(e=0,r=this.text.length){return e==0&&r==this.text.length?this:this.withText(this.text.slice(e,r))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function Sy(t,e){for(let r=t.length-1;r>=0;r--)e=t[r].type.name+"("+e+")";return e}var _n=class{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[];}static parse(e,r){let n=new Mf(e,r);if(n.next==null)return _n.empty;let o=Cy(n);n.next&&n.err("Unexpected trailing text");let i=XO(YO(o));return JO(i,n),i}matchType(e){for(let r=0;r<this.next.length;r++)if(this.next[r].type==e)return this.next[r].next;return null}matchFragment(e,r=0,n=e.childCount){let o=this;for(let i=r;o&&i<n;i++)o=o.matchType(e.child(i).type);return o}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:r}=this.next[e];if(!(r.isText||r.hasRequiredAttrs()))return r}return null}compatible(e){for(let r=0;r<this.next.length;r++)for(let n=0;n<e.next.length;n++)if(this.next[r].type==e.next[n].type)return !0;return !1}fillBefore(e,r=!1,n=0){let o=[this];function i(s,a){let l=s.matchFragment(e,n);if(l&&(!r||l.validEnd))return O.from(a.map(c=>c.createAndFill()));for(let c=0;c<s.next.length;c++){let{type:d,next:u}=s.next[c];if(!(d.isText||d.hasRequiredAttrs())&&o.indexOf(u)==-1){o.push(u);let f=i(u,a.concat(d));if(f)return f}}return null}return i(this,[])}findWrapping(e){for(let n=0;n<this.wrapCache.length;n+=2)if(this.wrapCache[n]==e)return this.wrapCache[n+1];let r=this.computeWrapping(e);return this.wrapCache.push(e,r),r}computeWrapping(e){let r=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let o=n.shift(),i=o.match;if(i.matchType(e)){let s=[];for(let a=o;a.type;a=a.via)s.push(a.type);return s.reverse()}for(let s=0;s<i.next.length;s++){let{type:a,next:l}=i.next[s];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in r)&&(!o.type||l.validEnd)&&(n.push({match:a.contentMatch,type:a,via:o}),r[a.name]=!0);}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function r(n){e.push(n);for(let o=0;o<n.next.length;o++)e.indexOf(n.next[o].next)==-1&&r(n.next[o].next);}return r(this),e.map((n,o)=>{let i=o+(n.validEnd?"*":" ")+" ";for(let s=0;s<n.next.length;s++)i+=(s?", ":"")+n.next[s].type.name+"->"+e.indexOf(n.next[s].next);return i}).join(`
|
|
95
|
+
`)}};_n.empty=new _n(!0);var Mf=class{constructor(e,r){this.string=e,this.nodeTypes=r,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift();}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}};function Cy(t){let e=[];do e.push(KO(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function KO(t){let e=[];do e.push(WO(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function WO(t){let e=jO(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=GO(t,e);else break;return e}function cy(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function GO(t,e){let r=cy(t),n=r;return t.eat(",")&&(t.next!="}"?n=cy(t):n=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:r,max:n,expr:e}}function qO(t,e){let r=t.nodeTypes,n=r[e];if(n)return [n];let o=[];for(let i in r){let s=r[i];s.isInGroup(e)&&o.push(s);}return o.length==0&&t.err("No node type or group '"+e+"' found"),o}function jO(t){if(t.eat("(")){let e=Cy(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else {let e=qO(t,t.next).map(r=>(t.inline==null?t.inline=r.isInline:t.inline!=r.isInline&&t.err("Mixing inline and block content"),{type:"name",value:r}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function YO(t){let e=[[]];return o(i(t,0),r()),e;function r(){return e.push([])-1}function n(s,a,l){let c={term:l,to:a};return e[s].push(c),c}function o(s,a){s.forEach(l=>l.to=a);}function i(s,a){if(s.type=="choice")return s.exprs.reduce((l,c)=>l.concat(i(c,a)),[]);if(s.type=="seq")for(let l=0;;l++){let c=i(s.exprs[l],a);if(l==s.exprs.length-1)return c;o(c,a=r());}else if(s.type=="star"){let l=r();return n(a,l),o(i(s.expr,l),l),[n(l)]}else if(s.type=="plus"){let l=r();return o(i(s.expr,a),l),o(i(s.expr,l),l),[n(l)]}else {if(s.type=="opt")return [n(a)].concat(i(s.expr,a));if(s.type=="range"){let l=a;for(let c=0;c<s.min;c++){let d=r();o(i(s.expr,l),d),l=d;}if(s.max==-1)o(i(s.expr,l),l);else for(let c=s.min;c<s.max;c++){let d=r();n(l,d),o(i(s.expr,l),d),l=d;}return [n(l)]}else {if(s.type=="name")return [n(a,void 0,s.value)];throw new Error("Unknown expr type")}}}}function Ry(t,e){return e-t}function dy(t,e){let r=[];return n(e),r.sort(Ry);function n(o){let i=t[o];if(i.length==1&&!i[0].term)return n(i[0].to);r.push(o);for(let s=0;s<i.length;s++){let{term:a,to:l}=i[s];!a&&r.indexOf(l)==-1&&n(l);}}}function XO(t){let e=Object.create(null);return r(dy(t,0));function r(n){let o=[];n.forEach(s=>{t[s].forEach(({term:a,to:l})=>{if(!a)return;let c;for(let d=0;d<o.length;d++)o[d][0]==a&&(c=o[d][1]);dy(t,l).forEach(d=>{c||o.push([a,c=[]]),c.indexOf(d)==-1&&c.push(d);});});});let i=e[n.join(",")]=new _n(n.indexOf(t.length-1)>-1);for(let s=0;s<o.length;s++){let a=o[s][1].sort(Ry);i.next.push({type:o[s][0],next:e[a.join(",")]||r(a)});}return i}}function JO(t,e){for(let r=0,n=[t];r<n.length;r++){let o=n[r],i=!o.validEnd,s=[];for(let a=0;a<o.next.length;a++){let{type:l,next:c}=o.next[a];s.push(l.name),i&&!(l.isText||l.hasRequiredAttrs())&&(i=!1),n.indexOf(c)==-1&&n.push(c);}i&&e.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)");}}function Ty(t){let e=Object.create(null);for(let r in t){let n=t[r];if(!n.hasDefault)return null;e[r]=n.default;}return e}function Ny(t,e){let r=Object.create(null);for(let n in t){let o=e&&e[n];if(o===void 0){let i=t[n];if(i.hasDefault)o=i.default;else throw new RangeError("No value supplied for attribute "+n)}r[n]=o;}return r}function _y(t,e,r,n){for(let o in e)if(!(o in t))throw new RangeError(`Unsupported attribute ${o} for ${r} of type ${o}`);for(let o in t){let i=t[o];i.validate&&i.validate(e[o]);}}function My(t,e){let r=Object.create(null);if(e)for(let n in e)r[n]=new Af(t,n,e[n]);return r}var Ki=class{constructor(e,r,n){this.name=e,this.schema=r,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=My(e,n.attrs),this.defaultAttrs=Ty(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||e=="text"),this.isText=e=="text";}get isInline(){return !this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==_n.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return !0;return !1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return !e&&this.defaultAttrs?this.defaultAttrs:Ny(this.attrs,e)}create(e=null,r,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Ot(this,this.computeAttrs(e),O.from(r),_e.setFrom(n))}createChecked(e=null,r,n){return r=O.from(r),this.checkContent(r),new Ot(this,this.computeAttrs(e),r,_e.setFrom(n))}createAndFill(e=null,r,n){if(e=this.computeAttrs(e),r=O.from(r),r.size){let s=this.contentMatch.fillBefore(r);if(!s)return null;r=s.append(r);}let o=this.contentMatch.matchFragment(r),i=o&&o.fillBefore(O.empty,!0);return i?new Ot(this,e,r.append(i),_e.setFrom(n)):null}validContent(e){let r=this.contentMatch.matchFragment(e);if(!r||!r.validEnd)return !1;for(let n=0;n<e.childCount;n++)if(!this.allowsMarks(e.child(n).marks))return !1;return !0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){_y(this.attrs,e,"node",this.name);}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return !0;for(let r=0;r<e.length;r++)if(!this.allowsMarkType(e[r].type))return !1;return !0}allowedMarks(e){if(this.markSet==null)return e;let r;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?r&&r.push(e[n]):r||(r=e.slice(0,n));return r?r.length?r:_e.none:e}static compile(e,r){let n=Object.create(null);e.forEach((i,s)=>n[i]=new Ki(i,r,s));let o=r.spec.topNode||"doc";if(!n[o])throw new RangeError("Schema is missing its top node type ('"+o+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let i in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}};function ZO(t,e,r){let n=r.split("|");return o=>{let i=o===null?"null":typeof o;if(n.indexOf(i)<0)throw new RangeError(`Expected value of type ${n} for attribute ${e} on type ${t}, got ${i}`)}}var Af=class{constructor(e,r,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate=typeof n.validate=="string"?ZO(e,r,n.validate):n.validate;}get isRequired(){return !this.hasDefault}},Jo=class{constructor(e,r,n,o){this.name=e,this.rank=r,this.schema=n,this.spec=o,this.attrs=My(e,o.attrs),this.excluded=null;let i=Ty(this.attrs);this.instance=i?new _e(this,i):null;}create(e=null){return !e&&this.instance?this.instance:new _e(this,Ny(this.attrs,e))}static compile(e,r){let n=Object.create(null),o=0;return e.forEach((i,s)=>n[i]=new Jo(i,o++,r,s)),n}removeFromSet(e){for(var r=0;r<e.length;r++)e[r].type==this&&(e=e.slice(0,r).concat(e.slice(r+1)),r--);return e}isInSet(e){for(let r=0;r<e.length;r++)if(e[r].type==this)return e[r]}checkAttrs(e){_y(this.attrs,e,"mark",this.name);}excludes(e){return this.excluded.indexOf(e)>-1}},Wi=class{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let r=this.spec={};for(let o in e)r[o]=e[o];r.nodes=Cf.from(e.nodes),r.marks=Cf.from(e.marks||{}),this.nodes=Ki.compile(this.spec.nodes,this),this.marks=Jo.compile(this.spec.marks,this);let n=Object.create(null);for(let o in this.nodes){if(o in this.marks)throw new RangeError(o+" can not be both a node and a mark");let i=this.nodes[o],s=i.spec.content||"",a=i.spec.marks;if(i.contentMatch=n[s]||(n[s]=_n.parse(s,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!i.isInline||!i.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=i;}i.markSet=a=="_"?null:a?uy(this,a.split(" ")):a==""||!i.inlineContent?[]:null;}for(let o in this.marks){let i=this.marks[o],s=i.spec.excludes;i.excluded=s==null?[i]:s==""?[]:uy(this,s.split(" "));}this.nodeFromJSON=o=>Ot.fromJSON(this,o),this.markFromJSON=o=>_e.fromJSON(this,o),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null);}node(e,r=null,n,o){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof Ki){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(r,n,o)}text(e,r){let n=this.nodes.text;return new Vi(n,n.defaultAttrs,e,_e.setFrom(r))}mark(e,r){return typeof e=="string"&&(e=this.marks[e]),e.create(r)}nodeType(e){let r=this.nodes[e];if(!r)throw new RangeError("Unknown node type: "+e);return r}};function uy(t,e){let r=[];for(let n=0;n<e.length;n++){let o=e[n],i=t.marks[o],s=i;if(i)r.push(i);else for(let a in t.marks){let l=t.marks[a];(o=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(o)>-1)&&r.push(s=l);}if(!s)throw new SyntaxError("Unknown mark type: '"+e[n]+"'")}return r}function QO(t){return t.tag!=null}function eD(t){return t.style!=null}var mr=class{constructor(e,r){this.schema=e,this.rules=r,this.tags=[],this.styles=[];let n=this.matchedStyles=[];r.forEach(o=>{if(QO(o))this.tags.push(o);else if(eD(o)){let i=/[^=]*/.exec(o.style)[0];n.indexOf(i)<0&&n.push(i),this.styles.push(o);}}),this.normalizeLists=!this.tags.some(o=>{if(!/^(ul|ol)\b/.test(o.tag)||!o.node)return !1;let i=e.nodes[o.node];return i.contentMatch.matchType(i)});}parse(e,r={}){let n=new Jl(this,r,!1);return n.addAll(e,_e.none,r.from,r.to),n.finish()}parseSlice(e,r={}){let n=new Jl(this,r,!0);return n.addAll(e,_e.none,r.from,r.to),H.maxOpen(n.finish())}matchTag(e,r,n){for(let o=n?this.tags.indexOf(n)+1:0;o<this.tags.length;o++){let i=this.tags[o];if(nD(e,i.tag)&&(i.namespace===void 0||e.namespaceURI==i.namespace)&&(!i.context||r.matchesContext(i.context))){if(i.getAttrs){let s=i.getAttrs(e);if(s===!1)continue;i.attrs=s||void 0;}return i}}}matchStyle(e,r,n,o){for(let i=o?this.styles.indexOf(o)+1:0;i<this.styles.length;i++){let s=this.styles[i],a=s.style;if(!(a.indexOf(e)!=0||s.context&&!n.matchesContext(s.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=r))){if(s.getAttrs){let l=s.getAttrs(r);if(l===!1)continue;s.attrs=l||void 0;}return s}}}static schemaRules(e){let r=[];function n(o){let i=o.priority==null?50:o.priority,s=0;for(;s<r.length;s++){let a=r[s];if((a.priority==null?50:a.priority)<i)break}r.splice(s,0,o);}for(let o in e.marks){let i=e.marks[o].spec.parseDOM;i&&i.forEach(s=>{n(s=py(s)),s.mark||s.ignore||s.clearMark||(s.mark=o);});}for(let o in e.nodes){let i=e.nodes[o].spec.parseDOM;i&&i.forEach(s=>{n(s=py(s)),s.node||s.ignore||s.mark||(s.node=o);});}return r}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new mr(e,mr.schemaRules(e)))}},Ay={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},tD={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Oy={ol:!0,ul:!0},Zs=1,Of=2,Js=4;function fy(t,e,r){return e!=null?(e?Zs:0)|(e==="full"?Of:0):t&&t.whitespace=="pre"?Zs|Of:r&~Js}var Ui=class{constructor(e,r,n,o,i,s){this.type=e,this.attrs=r,this.marks=n,this.solid=o,this.options=s,this.content=[],this.activeMarks=_e.none,this.match=i||(s&Js?null:e.contentMatch);}findWrapping(e){if(!this.match){if(!this.type)return [];let r=this.type.contentMatch.fillBefore(O.from(e));if(r)this.match=this.type.contentMatch.matchFragment(r);else {let n=this.type.contentMatch,o;return (o=n.findWrapping(e.type))?(this.match=n,o):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Zs)){let n=this.content[this.content.length-1],o;if(n&&n.isText&&(o=/[ \t\r\n\u000c]+$/.exec(n.text))){let i=n;n.text.length==o[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-o[0].length));}}let r=O.from(this.content);return !e&&this.match&&(r=r.append(this.match.fillBefore(O.empty,!0))),this.type?this.type.create(this.attrs,r,this.marks):r}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Ay.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}},Jl=class{constructor(e,r,n){this.parser=e,this.options=r,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let o=r.topNode,i,s=fy(null,r.preserveWhitespace,0)|(n?Js:0);o?i=new Ui(o.type,o.attrs,_e.none,!0,r.topMatch||o.type.contentMatch,s):n?i=new Ui(null,null,_e.none,!0,null,s):i=new Ui(e.schema.topNodeType,null,_e.none,!0,null,s),this.nodes=[i],this.find=r.findPositions,this.needsBlock=!1;}get top(){return this.nodes[this.open]}addDOM(e,r){e.nodeType==3?this.addTextNode(e,r):e.nodeType==1&&this.addElement(e,r);}addTextNode(e,r){let n=e.nodeValue,o=this.top,i=o.options&Of?"full":this.localPreserveWS||(o.options&Zs)>0;if(i==="full"||o.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(i)i!=="full"?n=n.replace(/\r?\n|\r/g," "):n=n.replace(/\r\n?/g,`
|
|
96
|
+
`);else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let s=o.content[o.content.length-1],a=e.previousSibling;(!s||a&&a.nodeName=="BR"||s.isText&&/[ \t\r\n\u000c]$/.test(s.text))&&(n=n.slice(1));}n&&this.insertNode(this.parser.schema.text(n),r,!/\S/.test(n)),this.findInText(e);}else this.findInside(e);}addElement(e,r,n){let o=this.localPreserveWS,i=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let s=e.nodeName.toLowerCase(),a;Oy.hasOwnProperty(s)&&this.parser.normalizeLists&&rD(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(a=this.parser.matchTag(e,this,n));e:if(l?l.ignore:tD.hasOwnProperty(s))this.findInside(e),this.ignoreFallback(e,r);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(e=l.skip);let c,d=this.needsBlock;if(Ay.hasOwnProperty(s))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),c=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,r);break e}let u=l&&l.skip?r:this.readStyles(e,r);u&&this.addAll(e,u),c&&this.sync(i),this.needsBlock=d;}else {let c=this.readStyles(e,r);c&&this.addElementByRule(e,l,c,l.consuming===!1?a:void 0);}this.localPreserveWS=o;}leafFallback(e,r){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
|
97
|
+
`),r);}ignoreFallback(e,r){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),r,!0);}readStyles(e,r){let n=e.style;if(n&&n.length)for(let o=0;o<this.parser.matchedStyles.length;o++){let i=this.parser.matchedStyles[o],s=n.getPropertyValue(i);if(s)for(let a=void 0;;){let l=this.parser.matchStyle(i,s,this,a);if(!l)break;if(l.ignore)return null;if(l.clearMark?r=r.filter(c=>!l.clearMark(c)):r=r.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)a=l;else break}}return r}addElementByRule(e,r,n,o){let i,s;if(r.node)if(s=this.parser.schema.nodes[r.node],s.isLeaf)this.insertNode(s.create(r.attrs),n,e.nodeName=="BR")||this.leafFallback(e,n);else {let l=this.enter(s,r.attrs||null,n,r.preserveWhitespace);l&&(i=!0,n=l);}else {let l=this.parser.schema.marks[r.mark];n=n.concat(l.create(r.attrs));}let a=this.top;if(s&&s.isLeaf)this.findInside(e);else if(o)this.addElement(e,n,o);else if(r.getContent)this.findInside(e),r.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l,n,!1));else {let l=e;typeof r.contentElement=="string"?l=e.querySelector(r.contentElement):typeof r.contentElement=="function"?l=r.contentElement(e):r.contentElement&&(l=r.contentElement),this.findAround(e,l,!0),this.addAll(l,n),this.findAround(e,l,!1);}i&&this.sync(a)&&this.open--;}addAll(e,r,n,o){let i=n||0;for(let s=n?e.childNodes[n]:e.firstChild,a=o==null?null:e.childNodes[o];s!=a;s=s.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(s,r);this.findAtPoint(e,i);}findPlace(e,r,n){let o,i;for(let s=this.open,a=0;s>=0;s--){let l=this.nodes[s],c=l.findWrapping(e);if(c&&(!o||o.length>c.length+a)&&(o=c,i=l,!c.length))break;if(l.solid){if(n)break;a+=2;}}if(!o)return null;this.sync(i);for(let s=0;s<o.length;s++)r=this.enterInner(o[s],null,r,!1);return r}insertNode(e,r,n){if(e.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(r=this.enterInner(i,null,r));}let o=this.findPlace(e,r,n);if(o){this.closeExtra();let i=this.top;i.match&&(i.match=i.match.matchType(e.type));let s=_e.none;for(let a of o.concat(e.marks))(i.type?i.type.allowsMarkType(a.type):hy(a.type,e.type))&&(s=a.addToSet(s));return i.content.push(e.mark(s)),!0}return !1}enter(e,r,n,o){let i=this.findPlace(e.create(r),n,!1);return i&&(i=this.enterInner(e,r,n,!0,o)),i}enterInner(e,r,n,o=!1,i){this.closeExtra();let s=this.top;s.match=s.match&&s.match.matchType(e);let a=fy(e,i,s.options);s.options&Js&&s.content.length==0&&(a|=Js);let l=_e.none;return n=n.filter(c=>(s.type?s.type.allowsMarkType(c.type):hy(c.type,e))?(l=c.addToSet(l),!1):!0),this.nodes.push(new Ui(e,r,l,o,null,a)),this.open++,n}closeExtra(e=!1){let r=this.nodes.length-1;if(r>this.open){for(;r>this.open;r--)this.nodes[r-1].content.push(this.nodes[r].finish(e));this.nodes.length=this.open+1;}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let r=this.open;r>=0;r--){if(this.nodes[r]==e)return this.open=r,!0;this.localPreserveWS&&(this.nodes[r].options|=Zs);}return !1}get currentPos(){this.closeExtra();let e=0;for(let r=this.open;r>=0;r--){let n=this.nodes[r].content;for(let o=n.length-1;o>=0;o--)e+=n[o].nodeSize;r&&e++;}return e}findAtPoint(e,r){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==r&&(this.find[n].pos=this.currentPos);}findInside(e){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].pos==null&&e.nodeType==1&&e.contains(this.find[r].node)&&(this.find[r].pos=this.currentPos);}findAround(e,r,n){if(e!=r&&this.find)for(let o=0;o<this.find.length;o++)this.find[o].pos==null&&e.nodeType==1&&e.contains(this.find[o].node)&&r.compareDocumentPosition(this.find[o].node)&(n?2:4)&&(this.find[o].pos=this.currentPos);}findInText(e){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&(this.find[r].pos=this.currentPos-(e.nodeValue.length-this.find[r].offset));}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let r=e.split("/"),n=this.options.context,o=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+(o?0:1),s=(a,l)=>{for(;a>=0;a--){let c=r[a];if(c==""){if(a==r.length-1||a==0)continue;for(;l>=i;l--)if(s(a-1,l))return !0;return !1}else {let d=l>0||l==0&&o?this.nodes[l].type:n&&l>=i?n.node(l-i).type:null;if(!d||d.name!=c&&!d.isInGroup(c))return !1;l--;}}return !0};return s(r.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let r=e.depth;r>=0;r--){let n=e.node(r).contentMatchAt(e.indexAfter(r)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let r in this.parser.schema.nodes){let n=this.parser.schema.nodes[r];if(n.isTextblock&&n.defaultAttrs)return n}}};function rD(t){for(let e=t.firstChild,r=null;e;e=e.nextSibling){let n=e.nodeType==1?e.nodeName.toLowerCase():null;n&&Oy.hasOwnProperty(n)&&r?(r.appendChild(e),e=r):n=="li"?r=e:n&&(r=null);}}function nD(t,e){return (t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function py(t){let e={};for(let r in t)e[r]=t[r];return e}function hy(t,e){let r=e.schema.nodes;for(let n in r){let o=r[n];if(!o.allowsMarkType(t))continue;let i=[],s=a=>{i.push(a);for(let l=0;l<a.edgeCount;l++){let{type:c,next:d}=a.edge(l);if(c==e||i.indexOf(d)<0&&s(d))return !0}};if(s(o.contentMatch))return !0}}var Kr=class{constructor(e,r){this.nodes=e,this.marks=r;}serializeFragment(e,r={},n){n||(n=Tf(r).createDocumentFragment());let o=n,i=[];return e.forEach(s=>{if(i.length||s.marks.length){let a=0,l=0;for(;a<i.length&&l<s.marks.length;){let c=s.marks[l];if(!this.marks[c.type.name]){l++;continue}if(!c.eq(i[a][0])||c.type.spec.spanning===!1)break;a++,l++;}for(;a<i.length;)o=i.pop()[1];for(;l<s.marks.length;){let c=s.marks[l++],d=this.serializeMark(c,s.isInline,r);d&&(i.push([c,o]),o.appendChild(d.dom),o=d.contentDOM||d.dom);}}o.appendChild(this.serializeNodeInner(s,r));}),n}serializeNodeInner(e,r){let{dom:n,contentDOM:o}=jl(Tf(r),this.nodes[e.type.name](e),null,e.attrs);if(o){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,r,o);}return n}serializeNode(e,r={}){let n=this.serializeNodeInner(e,r);for(let o=e.marks.length-1;o>=0;o--){let i=this.serializeMark(e.marks[o],e.isInline,r);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom);}return n}serializeMark(e,r,n={}){let o=this.marks[e.type.name];return o&&jl(Tf(n),o(e,r),null,e.attrs)}static renderSpec(e,r,n=null,o){return jl(e,r,n,o)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Kr(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let r=my(e.nodes);return r.text||(r.text=n=>n.text),r}static marksFromSchema(e){return my(e.marks)}};function my(t){let e={};for(let r in t){let n=t[r].spec.toDOM;n&&(e[r]=n);}return e}function Tf(t){return t.document||window.document}var gy=new WeakMap;function oD(t){let e=gy.get(t);return e===void 0&&gy.set(t,e=iD(t)),e}function iD(t){let e=null;function r(n){if(n&&typeof n=="object")if(Array.isArray(n))if(typeof n[0]=="string")e||(e=[]),e.push(n);else for(let o=0;o<n.length;o++)r(n[o]);else for(let o in n)r(n[o]);}return r(t),e}function jl(t,e,r,n){if(typeof e=="string")return {dom:t.createTextNode(e)};if(e.nodeType!=null)return {dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let o=e[0],i;if(typeof o!="string")throw new RangeError("Invalid array passed to renderSpec");if(n&&(i=oD(n))&&i.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let s=o.indexOf(" ");s>0&&(r=o.slice(0,s),o=o.slice(s+1));let a,l=r?t.createElementNS(r,o):t.createElement(o),c=e[1],d=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){d=2;for(let u in c)if(c[u]!=null){let f=u.indexOf(" ");f>0?l.setAttributeNS(u.slice(0,f),u.slice(f+1),c[u]):u=="style"&&l.style?l.style.cssText=c[u]:l.setAttribute(u,c[u]);}}for(let u=d;u<e.length;u++){let f=e[u];if(f===0){if(u<e.length-1||u>d)throw new RangeError("Content hole must be the only child of its parent node");return {dom:l,contentDOM:l}}else {let{dom:p,contentDOM:h}=jl(t,f,r,n);if(l.appendChild(p),h){if(a)throw new RangeError("Multiple content holes");a=h;}}}return {dom:l,contentDOM:a}}var Iy=65535,Ly=Math.pow(2,16);function sD(t,e){return t+e*Ly}function Dy(t){return t&Iy}function aD(t){return (t-(t&Iy))/Ly}var $y=1,By=2,Zl=4,Fy=8,ta=class{constructor(e,r,n){this.pos=e,this.delInfo=r,this.recover=n;}get deleted(){return (this.delInfo&Fy)>0}get deletedBefore(){return (this.delInfo&($y|Zl))>0}get deletedAfter(){return (this.delInfo&(By|Zl))>0}get deletedAcross(){return (this.delInfo&Zl)>0}},Zt=class{constructor(e,r=!1){if(this.ranges=e,this.inverted=r,!e.length&&Zt.empty)return Zt.empty}recover(e){let r=0,n=Dy(e);if(!this.inverted)for(let o=0;o<n;o++)r+=this.ranges[o*3+2]-this.ranges[o*3+1];return this.ranges[n*3]+r+aD(e)}mapResult(e,r=1){return this._map(e,r,!1)}map(e,r=1){return this._map(e,r,!0)}_map(e,r,n){let o=0,i=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?o:0);if(l>e)break;let c=this.ranges[a+i],d=this.ranges[a+s],u=l+c;if(e<=u){let f=c?e==l?-1:e==u?1:r:r,p=l+o+(f<0?0:d);if(n)return p;let h=e==(r<0?l:u)?null:sD(a/3,e-l),m=e==l?By:e==u?$y:Zl;return (r<0?e!=l:e!=u)&&(m|=Fy),new ta(p,m,h)}o+=d-c;}return n?e+o:new ta(e+o,0,null)}touches(e,r){let n=0,o=Dy(r),i=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?n:0);if(l>e)break;let c=this.ranges[a+i],d=l+c;if(e<=d&&a==o*3)return !0;n+=this.ranges[a+s]-c;}return !1}forEach(e){let r=this.inverted?2:1,n=this.inverted?1:2;for(let o=0,i=0;o<this.ranges.length;o+=3){let s=this.ranges[o],a=s-(this.inverted?i:0),l=s+(this.inverted?0:i),c=this.ranges[o+r],d=this.ranges[o+n];e(a,a+c,l,l+d),i+=d-c;}}invert(){return new Zt(this.ranges,!this.inverted)}toString(){return (this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Zt.empty:new Zt(e<0?[0,-e,0]:[0,0,e])}};Zt.empty=new Zt([]);var oo=class{constructor(e,r,n=0,o=e?e.length:0){this.mirror=r,this.from=n,this.to=o,this._maps=e||[],this.ownData=!(e||r);}get maps(){return this._maps}slice(e=0,r=this.maps.length){return new oo(this._maps,this.mirror,e,r)}appendMap(e,r){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),r!=null&&this.setMirror(this._maps.length-1,r);}appendMapping(e){for(let r=0,n=this._maps.length;r<e._maps.length;r++){let o=e.getMirror(r);this.appendMap(e._maps[r],o!=null&&o<r?n+o:void 0);}}getMirror(e){if(this.mirror){for(let r=0;r<this.mirror.length;r++)if(this.mirror[r]==e)return this.mirror[r+(r%2?-1:1)]}}setMirror(e,r){this.mirror||(this.mirror=[]),this.mirror.push(e,r);}appendMappingInverted(e){for(let r=e.maps.length-1,n=this._maps.length+e._maps.length;r>=0;r--){let o=e.getMirror(r);this.appendMap(e._maps[r].invert(),o!=null&&o>r?n-o-1:void 0);}}invert(){let e=new oo;return e.appendMappingInverted(this),e}map(e,r=1){if(this.mirror)return this._map(e,r,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,r);return e}mapResult(e,r=1){return this._map(e,r,!1)}_map(e,r,n){let o=0;for(let i=this.from;i<this.to;i++){let s=this._maps[i],a=s.mapResult(e,r);if(a.recover!=null){let l=this.getMirror(i);if(l!=null&&l>i&&l<this.to){i=l,e=this._maps[l].recover(a.recover);continue}}o|=a.delInfo,e=a.pos;}return n?e:new ta(e,o,null)}},Df=Object.create(null),Tt=class{getMap(){return Zt.empty}merge(e){return null}static fromJSON(e,r){if(!r||!r.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=Df[r.stepType];if(!n)throw new RangeError(`No step type ${r.stepType} defined`);return n.fromJSON(e,r)}static jsonID(e,r){if(e in Df)throw new RangeError("Duplicate use of step JSON ID "+e);return Df[e]=r,r.prototype.jsonID=e,r}},st=class{constructor(e,r){this.doc=e,this.failed=r;}static ok(e){return new st(e,null)}static fail(e){return new st(null,e)}static fromReplace(e,r,n,o){try{return st.ok(e.replace(r,n,o))}catch(i){if(i instanceof jo)return st.fail(i.message);throw i}}};function Bf(t,e,r){let n=[];for(let o=0;o<t.childCount;o++){let i=t.child(o);i.content.size&&(i=i.copy(Bf(i.content,e,i))),i.isInline&&(i=e(i,r,o)),n.push(i);}return O.fromArray(n)}var rn=class extends Tt{constructor(e,r,n){super(),this.from=e,this.to=r,this.mark=n;}apply(e){let r=e.slice(this.from,this.to),n=e.resolve(this.from),o=n.node(n.sharedDepth(this.to)),i=new H(Bf(r.content,(s,a)=>!s.isAtom||!a.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),o),r.openStart,r.openEnd);return st.fromReplace(e,this.from,this.to,i)}invert(){return new lr(this.from,this.to,this.mark)}map(e){let r=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return r.deleted&&n.deleted||r.pos>=n.pos?null:new rn(r.pos,n.pos,this.mark)}merge(e){return e instanceof rn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new rn(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return {stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,r){if(typeof r.from!="number"||typeof r.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new rn(r.from,r.to,e.markFromJSON(r.mark))}};Tt.jsonID("addMark",rn);var lr=class extends Tt{constructor(e,r,n){super(),this.from=e,this.to=r,this.mark=n;}apply(e){let r=e.slice(this.from,this.to),n=new H(Bf(r.content,o=>o.mark(this.mark.removeFromSet(o.marks)),e),r.openStart,r.openEnd);return st.fromReplace(e,this.from,this.to,n)}invert(){return new rn(this.from,this.to,this.mark)}map(e){let r=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return r.deleted&&n.deleted||r.pos>=n.pos?null:new lr(r.pos,n.pos,this.mark)}merge(e){return e instanceof lr&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new lr(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return {stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,r){if(typeof r.from!="number"||typeof r.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new lr(r.from,r.to,e.markFromJSON(r.mark))}};Tt.jsonID("removeMark",lr);var nn=class extends Tt{constructor(e,r){super(),this.pos=e,this.mark=r;}apply(e){let r=e.nodeAt(this.pos);if(!r)return st.fail("No node at mark step's position");let n=r.type.create(r.attrs,null,this.mark.addToSet(r.marks));return st.fromReplace(e,this.pos,this.pos+1,new H(O.from(n),0,r.isLeaf?0:1))}invert(e){let r=e.nodeAt(this.pos);if(r){let n=this.mark.addToSet(r.marks);if(n.length==r.marks.length){for(let o=0;o<r.marks.length;o++)if(!r.marks[o].isInSet(n))return new nn(this.pos,r.marks[o]);return new nn(this.pos,this.mark)}}return new Mn(this.pos,this.mark)}map(e){let r=e.mapResult(this.pos,1);return r.deletedAfter?null:new nn(r.pos,this.mark)}toJSON(){return {stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,r){if(typeof r.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new nn(r.pos,e.markFromJSON(r.mark))}};Tt.jsonID("addNodeMark",nn);var Mn=class extends Tt{constructor(e,r){super(),this.pos=e,this.mark=r;}apply(e){let r=e.nodeAt(this.pos);if(!r)return st.fail("No node at mark step's position");let n=r.type.create(r.attrs,null,this.mark.removeFromSet(r.marks));return st.fromReplace(e,this.pos,this.pos+1,new H(O.from(n),0,r.isLeaf?0:1))}invert(e){let r=e.nodeAt(this.pos);return !r||!this.mark.isInSet(r.marks)?this:new nn(this.pos,this.mark)}map(e){let r=e.mapResult(this.pos,1);return r.deletedAfter?null:new Mn(r.pos,this.mark)}toJSON(){return {stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,r){if(typeof r.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Mn(r.pos,e.markFromJSON(r.mark))}};Tt.jsonID("removeNodeMark",Mn);var et=class extends Tt{constructor(e,r,n,o=!1){super(),this.from=e,this.to=r,this.slice=n,this.structure=o;}apply(e){return this.structure&&Lf(e,this.from,this.to)?st.fail("Structure replace would overwrite content"):st.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Zt([this.from,this.to-this.from,this.slice.size])}invert(e){return new et(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let r=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return r.deletedAcross&&n.deletedAcross?null:new et(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(e){if(!(e instanceof et)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let r=this.slice.size+e.slice.size==0?H.empty:new H(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new et(this.from,this.to+(e.to-e.from),r,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let r=this.slice.size+e.slice.size==0?H.empty:new H(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new et(e.from,this.to,r,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,r){if(typeof r.from!="number"||typeof r.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new et(r.from,r.to,H.fromJSON(e,r.slice),!!r.structure)}};Tt.jsonID("replace",et);var Ye=class extends Tt{constructor(e,r,n,o,i,s,a=!1){super(),this.from=e,this.to=r,this.gapFrom=n,this.gapTo=o,this.slice=i,this.insert=s,this.structure=a;}apply(e){if(this.structure&&(Lf(e,this.from,this.gapFrom)||Lf(e,this.gapTo,this.to)))return st.fail("Structure gap-replace would overwrite content");let r=e.slice(this.gapFrom,this.gapTo);if(r.openStart||r.openEnd)return st.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,r.content);return n?st.fromReplace(e,this.from,this.to,n):st.fail("Content does not fit in gap")}getMap(){return new Zt([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let r=this.gapTo-this.gapFrom;return new Ye(this.from,this.from+this.slice.size+r,this.from+this.insert,this.from+this.insert+r,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let r=e.mapResult(this.from,1),n=e.mapResult(this.to,-1),o=this.from==this.gapFrom?r.pos:e.map(this.gapFrom,-1),i=this.to==this.gapTo?n.pos:e.map(this.gapTo,1);return r.deletedAcross&&n.deletedAcross||o<r.pos||i>n.pos?null:new Ye(r.pos,n.pos,o,i,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,r){if(typeof r.from!="number"||typeof r.to!="number"||typeof r.gapFrom!="number"||typeof r.gapTo!="number"||typeof r.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Ye(r.from,r.to,r.gapFrom,r.gapTo,H.fromJSON(e,r.slice),r.insert,!!r.structure)}};Tt.jsonID("replaceAround",Ye);function Lf(t,e,r){let n=t.resolve(e),o=r-e,i=n.depth;for(;o>0&&i>0&&n.indexAfter(i)==n.node(i).childCount;)i--,o--;if(o>0){let s=n.node(i).maybeChild(n.indexAfter(i));for(;o>0;){if(!s||s.isLeaf)return !0;s=s.firstChild,o--;}}return !1}function lD(t,e,r,n){let o=[],i=[],s,a;t.doc.nodesBetween(e,r,(l,c,d)=>{if(!l.isInline)return;let u=l.marks;if(!n.isInSet(u)&&d.type.allowsMarkType(n.type)){let f=Math.max(c,e),p=Math.min(c+l.nodeSize,r),h=n.addToSet(u);for(let m=0;m<u.length;m++)u[m].isInSet(h)||(s&&s.to==f&&s.mark.eq(u[m])?s.to=p:o.push(s=new lr(f,p,u[m])));a&&a.to==f?a.to=p:i.push(a=new rn(f,p,n));}}),o.forEach(l=>t.step(l)),i.forEach(l=>t.step(l));}function cD(t,e,r,n){let o=[],i=0;t.doc.nodesBetween(e,r,(s,a)=>{if(!s.isInline)return;i++;let l=null;if(n instanceof Jo){let c=s.marks,d;for(;d=n.isInSet(c);)(l||(l=[])).push(d),c=d.removeFromSet(c);}else n?n.isInSet(s.marks)&&(l=[n]):l=s.marks;if(l&&l.length){let c=Math.min(a+s.nodeSize,r);for(let d=0;d<l.length;d++){let u=l[d],f;for(let p=0;p<o.length;p++){let h=o[p];h.step==i-1&&u.eq(o[p].style)&&(f=h);}f?(f.to=c,f.step=i):o.push({style:u,from:Math.max(a,e),to:c,step:i});}}}),o.forEach(s=>t.step(new lr(s.from,s.to,s.style)));}function Ff(t,e,r,n=r.contentMatch,o=!0){let i=t.doc.nodeAt(e),s=[],a=e+1;for(let l=0;l<i.childCount;l++){let c=i.child(l),d=a+c.nodeSize,u=n.matchType(c.type);if(!u)s.push(new et(a,d,H.empty));else {n=u;for(let f=0;f<c.marks.length;f++)r.allowsMarkType(c.marks[f].type)||t.step(new lr(a,d,c.marks[f]));if(o&&c.isText&&r.whitespace!="pre"){let f,p=/\r?\n|\r/g,h;for(;f=p.exec(c.text);)h||(h=new H(O.from(r.schema.text(" ",r.allowedMarks(c.marks))),0,0)),s.push(new et(a+f.index,a+f.index+f[0].length,h));}}a=d;}if(!n.validEnd){let l=n.fillBefore(O.empty,!0);t.replace(a,a,new H(l,0,0));}for(let l=s.length-1;l>=0;l--)t.step(s[l]);}function dD(t,e,r){return (e==0||t.canReplace(e,t.childCount))&&(r==t.childCount||t.canReplace(0,r))}function An(t){let r=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let n=t.depth;;--n){let o=t.$from.node(n),i=t.$from.index(n),s=t.$to.indexAfter(n);if(n<t.depth&&o.canReplace(i,s,r))return n;if(n==0||o.type.spec.isolating||!dD(o,i,s))break}return null}function uD(t,e,r){let{$from:n,$to:o,depth:i}=e,s=n.before(i+1),a=o.after(i+1),l=s,c=a,d=O.empty,u=0;for(let h=i,m=!1;h>r;h--)m||n.index(h)>0?(m=!0,d=O.from(n.node(h).copy(d)),u++):l--;let f=O.empty,p=0;for(let h=i,m=!1;h>r;h--)m||o.after(h+1)<o.end(h)?(m=!0,f=O.from(o.node(h).copy(f)),p++):c++;t.step(new Ye(l,c,s,a,new H(d.append(f),u,p),d.size-u,!0));}function qi(t,e,r=null,n=t){let o=fD(t,e),i=o&&pD(n,e);return i?o.map(Py).concat({type:e,attrs:r}).concat(i.map(Py)):null}function Py(t){return {type:t,attrs:null}}function fD(t,e){let{parent:r,startIndex:n,endIndex:o}=t,i=r.contentMatchAt(n).findWrapping(e);if(!i)return null;let s=i.length?i[0]:e;return r.canReplaceWith(n,o,s)?i:null}function pD(t,e){let{parent:r,startIndex:n,endIndex:o}=t,i=r.child(n),s=e.contentMatch.findWrapping(i.type);if(!s)return null;let l=(s.length?s[s.length-1]:e).contentMatch;for(let c=n;l&&c<o;c++)l=l.matchType(r.child(c).type);return !l||!l.validEnd?null:s}function hD(t,e,r){let n=O.empty;for(let s=r.length-1;s>=0;s--){if(n.size){let a=r[s].type.contentMatch.matchFragment(n);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}n=O.from(r[s].type.create(r[s].attrs,n));}let o=e.start,i=e.end;t.step(new Ye(o,i,o,i,new H(n,0,0),r.length,!0));}function mD(t,e,r,n,o){if(!n.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=t.steps.length;t.doc.nodesBetween(e,r,(s,a)=>{let l=typeof o=="function"?o(s):o;if(s.isTextblock&&!s.hasMarkup(n,l)&&gD(t.doc,t.mapping.slice(i).map(a),n)){let c=null;if(n.schema.linebreakReplacement){let p=n.whitespace=="pre",h=!!n.contentMatch.matchType(n.schema.linebreakReplacement);p&&!h?c=!1:!p&&h&&(c=!0);}c===!1&&Hy(t,s,a,i),Ff(t,t.mapping.slice(i).map(a,1),n,void 0,c===null);let d=t.mapping.slice(i),u=d.map(a,1),f=d.map(a+s.nodeSize,1);return t.step(new Ye(u,f,u+1,f-1,new H(O.from(n.create(l,null,s.marks)),0,0),1,!0)),c===!0&&zy(t,s,a,i),!1}});}function zy(t,e,r,n){e.forEach((o,i)=>{if(o.isText){let s,a=/\r?\n|\r/g;for(;s=a.exec(o.text);){let l=t.mapping.slice(n).map(r+1+i+s.index);t.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create());}}});}function Hy(t,e,r,n){e.forEach((o,i)=>{if(o.type==o.type.schema.linebreakReplacement){let s=t.mapping.slice(n).map(r+1+i);t.replaceWith(s,s+1,e.type.schema.text(`
|
|
98
|
+
`));}});}function gD(t,e,r){let n=t.resolve(e),o=n.index();return n.parent.canReplaceWith(o,o+1,r)}function bD(t,e,r,n,o){let i=t.doc.nodeAt(e);if(!i)throw new RangeError("No node at given position");r||(r=i.type);let s=r.create(n,null,o||i.marks);if(i.isLeaf)return t.replaceWith(e,e+i.nodeSize,s);if(!r.validContent(i.content))throw new RangeError("Invalid content for node type "+r.name);t.step(new Ye(e,e+i.nodeSize,e+1,e+i.nodeSize-1,new H(O.from(s),0,0),1,!0));}function gr(t,e,r=1,n){let o=t.resolve(e),i=o.depth-r,s=n&&n[n.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!s.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return !1;for(let c=o.depth-1,d=r-2;c>i;c--,d--){let u=o.node(c),f=o.index(c);if(u.type.spec.isolating)return !1;let p=u.content.cutByIndex(f,u.childCount),h=n&&n[d+1];h&&(p=p.replaceChild(0,h.type.create(h.attrs)));let m=n&&n[d]||u;if(!u.canReplace(f+1,u.childCount)||!m.type.validContent(p))return !1}let a=o.indexAfter(i),l=n&&n[0];return o.node(i).canReplaceWith(a,a,l?l.type:o.node(i+1).type)}function vD(t,e,r=1,n){let o=t.doc.resolve(e),i=O.empty,s=O.empty;for(let a=o.depth,l=o.depth-r,c=r-1;a>l;a--,c--){i=O.from(o.node(a).copy(i));let d=n&&n[c];s=O.from(d?d.type.create(d.attrs,s):o.node(a).copy(s));}t.step(new et(e,e,new H(i.append(s),r,r),!0));}function Rr(t,e){let r=t.resolve(e),n=r.index();return Uy(r.nodeBefore,r.nodeAfter)&&r.parent.canReplace(n,n+1)}function yD(t,e){e.content.size||t.type.compatibleContent(e.type);let r=t.contentMatchAt(t.childCount),{linebreakReplacement:n}=t.type.schema;for(let o=0;o<e.childCount;o++){let i=e.child(o),s=i.type==n?t.type.schema.nodes.text:i.type;if(r=r.matchType(s),!r||!t.type.allowsMarks(i.marks))return !1}return r.validEnd}function Uy(t,e){return !!(t&&e&&!t.isLeaf&&yD(t,e))}function Qo(t,e,r=-1){let n=t.resolve(e);for(let o=n.depth;;o--){let i,s,a=n.index(o);if(o==n.depth?(i=n.nodeBefore,s=n.nodeAfter):r>0?(i=n.node(o+1),a++,s=n.node(o).maybeChild(a)):(i=n.node(o).maybeChild(a-1),s=n.node(o+1)),i&&!i.isTextblock&&Uy(i,s)&&n.node(o).canReplace(a,a+1))return e;if(o==0)break;e=r<0?n.before(o):n.after(o);}}function wD(t,e,r){let n=null,{linebreakReplacement:o}=t.doc.type.schema,i=t.doc.resolve(e-r),s=i.node().type;if(o&&s.inlineContent){let d=s.whitespace=="pre",u=!!s.contentMatch.matchType(o);d&&!u?n=!1:!d&&u&&(n=!0);}let a=t.steps.length;if(n===!1){let d=t.doc.resolve(e+r);Hy(t,d.node(),d.before(),a);}s.inlineContent&&Ff(t,e+r-1,s,i.node().contentMatchAt(i.index()),n==null);let l=t.mapping.slice(a),c=l.map(e-r);if(t.step(new et(c,l.map(e+r,-1),H.empty,!0)),n===!0){let d=t.doc.resolve(c);zy(t,d.node(),d.before(),t.steps.length);}return t}function xD(t,e,r){let n=t.resolve(e);if(n.parent.canReplaceWith(n.index(),n.index(),r))return e;if(n.parentOffset==0)for(let o=n.depth-1;o>=0;o--){let i=n.index(o);if(n.node(o).canReplaceWith(i,i,r))return n.before(o+1);if(i>0)return null}if(n.parentOffset==n.parent.content.size)for(let o=n.depth-1;o>=0;o--){let i=n.indexAfter(o);if(n.node(o).canReplaceWith(i,i,r))return n.after(o+1);if(i<n.node(o).childCount)return null}return null}function Ql(t,e,r){let n=t.resolve(e);if(!r.content.size)return e;let o=r.content;for(let i=0;i<r.openStart;i++)o=o.firstChild.content;for(let i=1;i<=(r.openStart==0&&r.size?2:1);i++)for(let s=n.depth;s>=0;s--){let a=s==n.depth?0:n.pos<=(n.start(s+1)+n.end(s+1))/2?-1:1,l=n.index(s)+(a>0?1:0),c=n.node(s),d=!1;if(i==1)d=c.canReplace(l,l,o);else {let u=c.contentMatchAt(l).findWrapping(o.firstChild.type);d=u&&c.canReplaceWith(l,l,u[0]);}if(d)return a==0?n.pos:a<0?n.before(s+1):n.after(s+1)}return null}function ra(t,e,r=e,n=H.empty){if(e==r&&!n.size)return null;let o=t.resolve(e),i=t.resolve(r);return Vy(o,i,n)?new et(e,r,n):new $f(o,i,n).fit()}function Vy(t,e,r){return !r.openStart&&!r.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),r.content)}var $f=class{constructor(e,r,n){this.$from=e,this.$to=r,this.unplaced=n,this.frontier=[],this.placed=O.empty;for(let o=0;o<=e.depth;o++){let i=e.node(o);this.frontier.push({type:i.type,match:i.contentMatchAt(e.indexAfter(o))});}for(let o=e.depth;o>0;o--)this.placed=O.from(e.node(o).copy(this.placed));}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode();}let e=this.mustMoveInline(),r=this.placed.size-this.depth-this.$from.depth,n=this.$from,o=this.close(e<0?this.$to:n.doc.resolve(e));if(!o)return null;let i=this.placed,s=n.depth,a=o.depth;for(;s&&a&&i.childCount==1;)i=i.firstChild.content,s--,a--;let l=new H(i,s,a);return e>-1?new Ye(n.pos,e,this.$to.pos,this.$to.end(),l,r):l.size||n.pos!=this.$to.pos?new et(n.pos,o.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let r=this.unplaced.content,n=0,o=this.unplaced.openEnd;n<e;n++){let i=r.firstChild;if(r.childCount>1&&(o=0),i.type.spec.isolating&&o<=n){e=n;break}r=i.content;}for(let r=1;r<=2;r++)for(let n=r==1?e:this.unplaced.openStart;n>=0;n--){let o,i=null;n?(i=Pf(this.unplaced.content,n-1).firstChild,o=i.content):o=this.unplaced.content;let s=o.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:c}=this.frontier[a],d,u=null;if(r==1&&(s?c.matchType(s.type)||(u=c.fillBefore(O.from(s),!1)):i&&l.compatibleContent(i.type)))return {sliceDepth:n,frontierDepth:a,parent:i,inject:u};if(r==2&&s&&(d=c.findWrapping(s.type)))return {sliceDepth:n,frontierDepth:a,parent:i,wrap:d};if(i&&c.matchType(i.type))break}}}openMore(){let{content:e,openStart:r,openEnd:n}=this.unplaced,o=Pf(e,r);return !o.childCount||o.firstChild.isLeaf?!1:(this.unplaced=new H(e,r+1,Math.max(n,o.size+r>=e.size-n?r+1:0)),!0)}dropNode(){let{content:e,openStart:r,openEnd:n}=this.unplaced,o=Pf(e,r);if(o.childCount<=1&&r>0){let i=e.size-r<=r+o.size;this.unplaced=new H(Qs(e,r-1,1),r-1,i?r-1:n);}else this.unplaced=new H(Qs(e,r,1),r,n);}placeNodes({sliceDepth:e,frontierDepth:r,parent:n,inject:o,wrap:i}){for(;this.depth>r;)this.closeFrontierNode();if(i)for(let m=0;m<i.length;m++)this.openFrontierNode(i[m]);let s=this.unplaced,a=n?n.content:s.content,l=s.openStart-e,c=0,d=[],{match:u,type:f}=this.frontier[r];if(o){for(let m=0;m<o.childCount;m++)d.push(o.child(m));u=u.matchFragment(o);}let p=a.size+e-(s.content.size-s.openEnd);for(;c<a.childCount;){let m=a.child(c),g=u.matchType(m.type);if(!g)break;c++,(c>1||l==0||m.content.size)&&(u=g,d.push(Ky(m.mark(f.allowedMarks(m.marks)),c==1?l:0,c==a.childCount?p:-1)));}let h=c==a.childCount;h||(p=-1),this.placed=ea(this.placed,r,O.from(d)),this.frontier[r].match=u,h&&p<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let m=0,g=a;m<p;m++){let b=g.lastChild;this.frontier.push({type:b.type,match:b.contentMatchAt(b.childCount)}),g=b.content;}this.unplaced=h?e==0?H.empty:new H(Qs(s.content,e-1,1),e-1,p<0?s.openEnd:e-1):new H(Qs(s.content,e,c),s.openStart,s.openEnd);}mustMoveInline(){if(!this.$to.parent.isTextblock)return -1;let e=this.frontier[this.depth],r;if(!e.type.isTextblock||!If(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(r=this.findCloseLevel(this.$to))&&r.depth==this.depth)return -1;let{depth:n}=this.$to,o=this.$to.after(n);for(;n>1&&o==this.$to.end(--n);)++o;return o}findCloseLevel(e){e:for(let r=Math.min(this.depth,e.depth);r>=0;r--){let{match:n,type:o}=this.frontier[r],i=r<e.depth&&e.end(r+1)==e.pos+(e.depth-(r+1)),s=If(e,r,o,n,i);if(s){for(let a=r-1;a>=0;a--){let{match:l,type:c}=this.frontier[a],d=If(e,a,c,l,!0);if(!d||d.childCount)continue e}return {depth:r,fit:s,move:i?e.doc.resolve(e.after(r+1)):e}}}}close(e){let r=this.findCloseLevel(e);if(!r)return null;for(;this.depth>r.depth;)this.closeFrontierNode();r.fit.childCount&&(this.placed=ea(this.placed,r.depth,r.fit)),e=r.move;for(let n=r.depth+1;n<=e.depth;n++){let o=e.node(n),i=o.type.contentMatch.fillBefore(o.content,!0,e.index(n));this.openFrontierNode(o.type,o.attrs,i);}return e}openFrontierNode(e,r=null,n){let o=this.frontier[this.depth];o.match=o.match.matchType(e),this.placed=ea(this.placed,this.depth,O.from(e.create(r,n))),this.frontier.push({type:e,match:e.contentMatch});}closeFrontierNode(){let r=this.frontier.pop().match.fillBefore(O.empty,!0);r.childCount&&(this.placed=ea(this.placed,this.frontier.length,r));}};function Qs(t,e,r){return e==0?t.cutByIndex(r,t.childCount):t.replaceChild(0,t.firstChild.copy(Qs(t.firstChild.content,e-1,r)))}function ea(t,e,r){return e==0?t.append(r):t.replaceChild(t.childCount-1,t.lastChild.copy(ea(t.lastChild.content,e-1,r)))}function Pf(t,e){for(let r=0;r<e;r++)t=t.firstChild.content;return t}function Ky(t,e,r){if(e<=0)return t;let n=t.content;return e>1&&(n=n.replaceChild(0,Ky(n.firstChild,e-1,n.childCount==1?r-1:0))),e>0&&(n=t.type.contentMatch.fillBefore(n).append(n),r<=0&&(n=n.append(t.type.contentMatch.matchFragment(n).fillBefore(O.empty,!0)))),t.copy(n)}function If(t,e,r,n,o){let i=t.node(e),s=o?t.indexAfter(e):t.index(e);if(s==i.childCount&&!r.compatibleContent(i.type))return null;let a=n.fillBefore(i.content,!0,s);return a&&!ED(r,i.content,s)?a:null}function ED(t,e,r){for(let n=r;n<e.childCount;n++)if(!t.allowsMarks(e.child(n).marks))return !0;return !1}function kD(t){return t.spec.defining||t.spec.definingForContent}function SD(t,e,r,n){if(!n.size)return t.deleteRange(e,r);let o=t.doc.resolve(e),i=t.doc.resolve(r);if(Vy(o,i,n))return t.step(new et(e,r,n));let s=Gy(o,t.doc.resolve(r));s[s.length-1]==0&&s.pop();let a=-(o.depth+1);s.unshift(a);for(let f=o.depth,p=o.pos-1;f>0;f--,p--){let h=o.node(f).type.spec;if(h.defining||h.definingAsContext||h.isolating)break;s.indexOf(f)>-1?a=f:o.before(f)==p&&s.splice(1,0,-f);}let l=s.indexOf(a),c=[],d=n.openStart;for(let f=n.content,p=0;;p++){let h=f.firstChild;if(c.push(h),p==n.openStart)break;f=h.content;}for(let f=d-1;f>=0;f--){let p=c[f],h=kD(p.type);if(h&&!p.sameMarkup(o.node(Math.abs(a)-1)))d=f;else if(h||!p.type.isTextblock)break}for(let f=n.openStart;f>=0;f--){let p=(f+d+1)%(n.openStart+1),h=c[p];if(h)for(let m=0;m<s.length;m++){let g=s[(m+l)%s.length],b=!0;g<0&&(b=!1,g=-g);let v=o.node(g-1),y=o.index(g-1);if(v.canReplaceWith(y,y,h.type,h.marks))return t.replace(o.before(g),b?i.after(g):r,new H(Wy(n.content,0,n.openStart,p),p,n.openEnd))}}let u=t.steps.length;for(let f=s.length-1;f>=0&&(t.replace(e,r,n),!(t.steps.length>u));f--){let p=s[f];p<0||(e=o.before(p),r=i.after(p));}}function Wy(t,e,r,n,o){if(e<r){let i=t.firstChild;t=t.replaceChild(0,i.copy(Wy(i.content,e+1,r,n,i)));}if(e>n){let i=o.contentMatchAt(0),s=i.fillBefore(t).append(t);t=s.append(i.matchFragment(s).fillBefore(O.empty,!0));}return t}function CD(t,e,r,n){if(!n.isInline&&e==r&&t.doc.resolve(e).parent.content.size){let o=xD(t.doc,e,n.type);o!=null&&(e=r=o);}t.replaceRange(e,r,new H(O.from(n),0,0));}function RD(t,e,r){let n=t.doc.resolve(e),o=t.doc.resolve(r),i=Gy(n,o);for(let s=0;s<i.length;s++){let a=i[s],l=s==i.length-1;if(l&&a==0||n.node(a).type.contentMatch.validEnd)return t.delete(n.start(a),o.end(a));if(a>0&&(l||n.node(a-1).canReplace(n.index(a-1),o.indexAfter(a-1))))return t.delete(n.before(a),o.after(a))}for(let s=1;s<=n.depth&&s<=o.depth;s++)if(e-n.start(s)==n.depth-s&&r>n.end(s)&&o.end(s)-r!=o.depth-s&&n.start(s-1)==o.start(s-1)&&n.node(s-1).canReplace(n.index(s-1),o.index(s-1)))return t.delete(n.before(s),r);t.delete(e,r);}function Gy(t,e){let r=[],n=Math.min(t.depth,e.depth);for(let o=n;o>=0;o--){let i=t.start(o);if(i<t.pos-(t.depth-o)||e.end(o)>e.pos+(e.depth-o)||t.node(o).type.spec.isolating||e.node(o).type.spec.isolating)break;(i==e.start(o)||o==t.depth&&o==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&o&&e.start(o-1)==i-1)&&r.push(o);}return r}var no=class extends Tt{constructor(e,r,n){super(),this.pos=e,this.attr=r,this.value=n;}apply(e){let r=e.nodeAt(this.pos);if(!r)return st.fail("No node at attribute step's position");let n=Object.create(null);for(let i in r.attrs)n[i]=r.attrs[i];n[this.attr]=this.value;let o=r.type.create(n,null,r.marks);return st.fromReplace(e,this.pos,this.pos+1,new H(O.from(o),0,r.isLeaf?0:1))}getMap(){return Zt.empty}invert(e){return new no(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let r=e.mapResult(this.pos,1);return r.deletedAfter?null:new no(r.pos,this.attr,this.value)}toJSON(){return {stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,r){if(typeof r.pos!="number"||typeof r.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new no(r.pos,r.attr,r.value)}};Tt.jsonID("attr",no);var Zo=class extends Tt{constructor(e,r){super(),this.attr=e,this.value=r;}apply(e){let r=Object.create(null);for(let o in e.attrs)r[o]=e.attrs[o];r[this.attr]=this.value;let n=e.type.create(r,e.content,e.marks);return st.ok(n)}getMap(){return Zt.empty}invert(e){return new Zo(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return {stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,r){if(typeof r.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Zo(r.attr,r.value)}};Tt.jsonID("docAttr",Zo);var Gi=class extends Error{};Gi=function t(e){let r=Error.call(this,e);return r.__proto__=t.prototype,r};Gi.prototype=Object.create(Error.prototype);Gi.prototype.constructor=Gi;Gi.prototype.name="TransformError";var io=class{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new oo;}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let r=this.maybeStep(e);if(r.failed)throw new Gi(r.failed);return this}maybeStep(e){let r=e.apply(this.doc);return r.failed||this.addStep(e,r.doc),r}get docChanged(){return this.steps.length>0}addStep(e,r){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=r;}replace(e,r=e,n=H.empty){let o=ra(this.doc,e,r,n);return o&&this.step(o),this}replaceWith(e,r,n){return this.replace(e,r,new H(O.from(n),0,0))}delete(e,r){return this.replace(e,r,H.empty)}insert(e,r){return this.replaceWith(e,e,r)}replaceRange(e,r,n){return SD(this,e,r,n),this}replaceRangeWith(e,r,n){return CD(this,e,r,n),this}deleteRange(e,r){return RD(this,e,r),this}lift(e,r){return uD(this,e,r),this}join(e,r=1){return wD(this,e,r),this}wrap(e,r){return hD(this,e,r),this}setBlockType(e,r=e,n,o=null){return mD(this,e,r,n,o),this}setNodeMarkup(e,r,n=null,o){return bD(this,e,r,n,o),this}setNodeAttribute(e,r,n){return this.step(new no(e,r,n)),this}setDocAttribute(e,r){return this.step(new Zo(e,r)),this}addNodeMark(e,r){return this.step(new nn(e,r)),this}removeNodeMark(e,r){let n=this.doc.nodeAt(e);if(!n)throw new RangeError("No node at position "+e);if(r instanceof _e)r.isInSet(n.marks)&&this.step(new Mn(e,r));else {let o=n.marks,i,s=[];for(;i=r.isInSet(o);)s.push(new Mn(e,i)),o=i.removeFromSet(o);for(let a=s.length-1;a>=0;a--)this.step(s[a]);}return this}split(e,r=1,n){return vD(this,e,r,n),this}addMark(e,r,n){return lD(this,e,r,n),this}removeMark(e,r,n){return cD(this,e,r,n),this}clearIncompatible(e,r,n){return Ff(this,e,r,n),this}};var zf=Object.create(null),Z=class{constructor(e,r,n){this.$anchor=e,this.$head=r,this.ranges=n||[new Yi(e.min(r),e.max(r))];}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let r=0;r<e.length;r++)if(e[r].$from.pos!=e[r].$to.pos)return !1;return !0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,r=H.empty){let n=r.content.lastChild,o=null;for(let a=0;a<r.openEnd;a++)o=n,n=n.lastChild;let i=e.steps.length,s=this.ranges;for(let a=0;a<s.length;a++){let{$from:l,$to:c}=s[a],d=e.mapping.slice(i);e.replaceRange(d.map(l.pos),d.map(c.pos),a?H.empty:r),a==0&&Yy(e,i,(n?n.isInline:o&&o.isTextblock)?-1:1);}}replaceWith(e,r){let n=e.steps.length,o=this.ranges;for(let i=0;i<o.length;i++){let{$from:s,$to:a}=o[i],l=e.mapping.slice(n),c=l.map(s.pos),d=l.map(a.pos);i?e.deleteRange(c,d):(e.replaceRangeWith(c,d,r),Yy(e,n,r.isInline?-1:1));}}static findFrom(e,r,n=!1){let o=e.parent.inlineContent?new q(e):ji(e.node(0),e.parent,e.pos,e.index(),r,n);if(o)return o;for(let i=e.depth-1;i>=0;i--){let s=r<0?ji(e.node(0),e.node(i),e.before(i+1),e.index(i),r,n):ji(e.node(0),e.node(i),e.after(i+1),e.index(i)+1,r,n);if(s)return s}return null}static near(e,r=1){return this.findFrom(e,r)||this.findFrom(e,-r)||new Et(e.node(0))}static atStart(e){return ji(e,e,0,0,1)||new Et(e)}static atEnd(e){return ji(e,e,e.content.size,e.childCount,-1)||new Et(e)}static fromJSON(e,r){if(!r||!r.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=zf[r.type];if(!n)throw new RangeError(`No selection type ${r.type} defined`);return n.fromJSON(e,r)}static jsonID(e,r){if(e in zf)throw new RangeError("Duplicate use of selection JSON ID "+e);return zf[e]=r,r.prototype.jsonID=e,r}getBookmark(){return q.between(this.$anchor,this.$head).getBookmark()}};Z.prototype.visible=!0;var Yi=class{constructor(e,r){this.$from=e,this.$to=r;}},qy=!1;function jy(t){!qy&&!t.parent.inlineContent&&(qy=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"));}var q=class extends Z{constructor(e,r=e){jy(e),jy(r),super(e,r);}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,r){let n=e.resolve(r.map(this.head));if(!n.parent.inlineContent)return Z.near(n);let o=e.resolve(r.map(this.anchor));return new q(o.parent.inlineContent?o:n,n)}replace(e,r=H.empty){if(super.replace(e,r),r==H.empty){let n=this.$from.marksAcross(this.$to);n&&e.ensureMarks(n);}}eq(e){return e instanceof q&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Xi(this.anchor,this.head)}toJSON(){return {type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,r){if(typeof r.anchor!="number"||typeof r.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new q(e.resolve(r.anchor),e.resolve(r.head))}static create(e,r,n=r){let o=e.resolve(r);return new this(o,n==r?o:e.resolve(n))}static between(e,r,n){let o=e.pos-r.pos;if((!n||o)&&(n=o>=0?1:-1),!r.parent.inlineContent){let i=Z.findFrom(r,n,!0)||Z.findFrom(r,-n,!0);if(i)r=i.$head;else return Z.near(r,n)}return e.parent.inlineContent||(o==0?e=r:(e=(Z.findFrom(e,-n,!0)||Z.findFrom(e,n,!0)).$anchor,e.pos<r.pos!=o<0&&(e=r))),new q(e,r)}};Z.jsonID("text",q);var Xi=class{constructor(e,r){this.anchor=e,this.head=r;}map(e){return new Xi(e.map(this.anchor),e.map(this.head))}resolve(e){return q.between(e.resolve(this.anchor),e.resolve(this.head))}},X=class extends Z{constructor(e){let r=e.nodeAfter,n=e.node(0).resolve(e.pos+r.nodeSize);super(e,n),this.node=r;}map(e,r){let{deleted:n,pos:o}=r.mapResult(this.anchor),i=e.resolve(o);return n?Z.near(i):new X(i)}content(){return new H(O.from(this.node),0,0)}eq(e){return e instanceof X&&e.anchor==this.anchor}toJSON(){return {type:"node",anchor:this.anchor}}getBookmark(){return new oa(this.anchor)}static fromJSON(e,r){if(typeof r.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new X(e.resolve(r.anchor))}static create(e,r){return new X(e.resolve(r))}static isSelectable(e){return !e.isText&&e.type.spec.selectable!==!1}};X.prototype.visible=!1;Z.jsonID("node",X);var oa=class{constructor(e){this.anchor=e;}map(e){let{deleted:r,pos:n}=e.mapResult(this.anchor);return r?new Xi(n,n):new oa(n)}resolve(e){let r=e.resolve(this.anchor),n=r.nodeAfter;return n&&X.isSelectable(n)?new X(r):Z.near(r)}},Et=class extends Z{constructor(e){super(e.resolve(0),e.resolve(e.content.size));}replace(e,r=H.empty){if(r==H.empty){e.delete(0,e.doc.content.size);let n=Z.atStart(e.doc);n.eq(e.selection)||e.setSelection(n);}else super.replace(e,r);}toJSON(){return {type:"all"}}static fromJSON(e){return new Et(e)}map(e){return new Et(e)}eq(e){return e instanceof Et}getBookmark(){return TD}};Z.jsonID("all",Et);var TD={map(){return this},resolve(t){return new Et(t)}};function ji(t,e,r,n,o,i=!1){if(e.inlineContent)return q.create(t,r);for(let s=n-(o>0?0:1);o>0?s<e.childCount:s>=0;s+=o){let a=e.child(s);if(a.isAtom){if(!i&&X.isSelectable(a))return X.create(t,r-(o<0?a.nodeSize:0))}else {let l=ji(t,a,r+o,o<0?a.childCount:0,o,i);if(l)return l}r+=a.nodeSize*o;}return null}function Yy(t,e,r){let n=t.steps.length-1;if(n<e)return;let o=t.steps[n];if(!(o instanceof et||o instanceof Ye))return;let i=t.mapping.maps[n],s;i.forEach((a,l,c,d)=>{s==null&&(s=d);}),t.setSelection(Z.near(t.doc.resolve(s),r));}var Xy=1,ec=2,Jy=4,Uf=class extends io{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks;}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|Xy)&~ec,this.storedMarks=null,this}get selectionSet(){return (this.updated&Xy)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=ec,this}ensureMarks(e){return _e.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return (this.updated&ec)>0}addStep(e,r){super.addStep(e,r),this.updated=this.updated&~ec,this.storedMarks=null;}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,r=!0){let n=this.selection;return r&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||_e.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,r,n){let o=this.doc.type.schema;if(r==null)return e?this.replaceSelectionWith(o.text(e),!0):this.deleteSelection();{if(n==null&&(n=r),n=n??r,!e)return this.deleteRange(r,n);let i=this.storedMarks;if(!i){let s=this.doc.resolve(r);i=n==r?s.marks():s.marksAcross(this.doc.resolve(n));}return this.replaceRangeWith(r,n,o.text(e,i)),this.selection.empty||this.setSelection(Z.near(this.selection.$to)),this}}setMeta(e,r){return this.meta[typeof e=="string"?e:e.key]=r,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return !1;return !0}scrollIntoView(){return this.updated|=Jy,this}get scrolledIntoView(){return (this.updated&Jy)>0}};function Zy(t,e){return !e||!t?t:t.bind(e)}var ei=class{constructor(e,r,n){this.name=e,this.init=Zy(r.init,n),this.apply=Zy(r.apply,n);}},ND=[new ei("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new ei("selection",{init(t,e){return t.selection||Z.atStart(e.doc)},apply(t){return t.selection}}),new ei("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,r,n){return n.selection.$cursor?t.storedMarks:null}}),new ei("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})],na=class{constructor(e,r){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=ND.slice(),r&&r.forEach(n=>{if(this.pluginsByKey[n.key])throw new RangeError("Adding different instances of a keyed plugin ("+n.key+")");this.plugins.push(n),this.pluginsByKey[n.key]=n,n.spec.state&&this.fields.push(new ei(n.key,n.spec.state,n));});}},On=class{constructor(e){this.config=e;}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,r=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=r){let o=this.config.plugins[n];if(o.spec.filterTransaction&&!o.spec.filterTransaction.call(o,e,this))return !1}return !0}applyTransaction(e){if(!this.filterTransaction(e))return {state:this,transactions:[]};let r=[e],n=this.applyInner(e),o=null;for(;;){let i=!1;for(let s=0;s<this.config.plugins.length;s++){let a=this.config.plugins[s];if(a.spec.appendTransaction){let l=o?o[s].n:0,c=o?o[s].state:this,d=l<r.length&&a.spec.appendTransaction.call(a,l?r.slice(l):r,c,n);if(d&&n.filterTransaction(d,s)){if(d.setMeta("appendedTransaction",e),!o){o=[];for(let u=0;u<this.config.plugins.length;u++)o.push(u<s?{state:n,n:r.length}:{state:this,n:0});}r.push(d),n=n.applyInner(d),i=!0;}o&&(o[s]={state:n,n:r.length});}}if(!i)return {state:n,transactions:r}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let r=new On(this.config),n=this.config.fields;for(let o=0;o<n.length;o++){let i=n[o];r[i.name]=i.apply(e,this[i.name],this,r);}return r}get tr(){return new Uf(this)}static create(e){let r=new na(e.doc?e.doc.type.schema:e.schema,e.plugins),n=new On(r);for(let o=0;o<r.fields.length;o++)n[r.fields[o].name]=r.fields[o].init(e,n);return n}reconfigure(e){let r=new na(this.schema,e.plugins),n=r.fields,o=new On(r);for(let i=0;i<n.length;i++){let s=n[i].name;o[s]=this.hasOwnProperty(s)?this[s]:n[i].init(e,o);}return o}toJSON(e){let r={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(r.storedMarks=this.storedMarks.map(n=>n.toJSON())),e&&typeof e=="object")for(let n in e){if(n=="doc"||n=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let o=e[n],i=o.spec.state;i&&i.toJSON&&(r[n]=i.toJSON.call(o,this[o.key]));}return r}static fromJSON(e,r,n){if(!r)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let o=new na(e.schema,e.plugins),i=new On(o);return o.fields.forEach(s=>{if(s.name=="doc")i.doc=Ot.fromJSON(e.schema,r.doc);else if(s.name=="selection")i.selection=Z.fromJSON(i.doc,r.selection);else if(s.name=="storedMarks")r.storedMarks&&(i.storedMarks=r.storedMarks.map(e.schema.markFromJSON));else {if(n)for(let a in n){let l=n[a],c=l.spec.state;if(l.key==s.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(r,a)){i[s.name]=c.fromJSON.call(l,e,r[a],i);return}}i[s.name]=s.init(e,i);}}),i}};function Qy(t,e,r){for(let n in t){let o=t[n];o instanceof Function?o=o.bind(e):n=="handleDOMEvents"&&(o=Qy(o,e,{})),r[n]=o;}return r}var oe=class{constructor(e){this.spec=e,this.props={},e.props&&Qy(e.props,this,this.props),this.key=e.key?e.key.key:ew("plugin");}getState(e){return e[this.key]}},Hf=Object.create(null);function ew(t){return t in Hf?t+"$"+ ++Hf[t]:(Hf[t]=0,t+"$")}var ae=class{constructor(e="key"){this.key=ew(e);}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}};var Dt=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},ts=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e},jf=null,Pn=function(t,e,r){let n=jf||(jf=document.createRange());return n.setEnd(t,r??t.nodeValue.length),n.setStart(t,e||0),n},_D=function(){jf=null;},si=function(t,e,r,n){return r&&(tw(t,e,r,n,-1)||tw(t,e,r,n,1))},MD=/^(img|br|input|textarea|hr)$/i;function tw(t,e,r,n,o){for(var i;;){if(t==r&&e==n)return !0;if(e==(o<0?0:Nr(t))){let s=t.parentNode;if(!s||s.nodeType!=1||pa(t)||MD.test(t.nodeName)||t.contentEditable=="false")return !1;e=Dt(t)+(o<0?0:1),t=s;}else if(t.nodeType==1){let s=t.childNodes[e+(o<0?-1:0)];if(s.nodeType==1&&s.contentEditable=="false")if(!((i=s.pmViewDesc)===null||i===void 0)&&i.ignoreForSelection)e+=o;else return !1;else t=s,e=o<0?Nr(t):0;}else return !1}}function Nr(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function AD(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=Nr(t);}else if(t.parentNode&&!pa(t))e=Dt(t),t=t.parentNode;else return null}}function OD(t,e){for(;;){if(t.nodeType==3&&e<t.nodeValue.length)return t;if(t.nodeType==1&&e<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[e],e=0;}else if(t.parentNode&&!pa(t))e=Dt(t)+1,t=t.parentNode;else return null}}function DD(t,e,r){for(let n=e==0,o=e==Nr(t);n||o;){if(t==r)return !0;let i=Dt(t);if(t=t.parentNode,!t)return !1;n=n&&i==0,o=o&&i==Nr(t);}}function pa(t){let e;for(let r=t;r&&!(e=r.pmViewDesc);r=r.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}var lc=function(t){return t.focusNode&&si(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function ti(t,e){let r=document.createEvent("Event");return r.initEvent("keydown",!0,!0),r.keyCode=t,r.key=r.code=e,r}function PD(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function ID(t,e,r){if(t.caretPositionFromPoint)try{let n=t.caretPositionFromPoint(e,r);if(n)return {node:n.offsetNode,offset:Math.min(Nr(n.offsetNode),n.offset)}}catch{}if(t.caretRangeFromPoint){let n=t.caretRangeFromPoint(e,r);if(n)return {node:n.startContainer,offset:Math.min(Nr(n.startContainer),n.startOffset)}}}var ln=typeof navigator<"u"?navigator:null,rw=typeof document<"u"?document:null,uo=ln&&ln.userAgent||"",Yf=/Edge\/(\d+)/.exec(uo),Pw=/MSIE \d/.exec(uo),Xf=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(uo),cr=!!(Pw||Xf||Yf),co=Pw?document.documentMode:Xf?+Xf[1]:Yf?+Yf[1]:0,Wr=!cr&&/gecko\/(\d+)/i.test(uo);Wr&&+(/Firefox\/(\d+)/.exec(uo)||[0,0])[1];var Jf=!cr&&/Chrome\/(\d+)/.exec(uo),qt=!!Jf,Iw=Jf?+Jf[1]:0,Qt=!cr&&!!ln&&/Apple Computer/.test(ln.vendor),rs=Qt&&(/Mobile\/\w+/.test(uo)||!!ln&&ln.maxTouchPoints>2),Tr=rs||(ln?/Mac/.test(ln.platform):!1),LD=ln?/Win/.test(ln.platform):!1,In=/Android \d/.test(uo),ha=!!rw&&"webkitFontSmoothing"in rw.documentElement.style,$D=ha?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function BD(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function Dn(t,e){return typeof t=="number"?t:t[e]}function FD(t){let e=t.getBoundingClientRect(),r=e.width/t.offsetWidth||1,n=e.height/t.offsetHeight||1;return {left:e.left,right:e.left+t.clientWidth*r,top:e.top,bottom:e.top+t.clientHeight*n}}function nw(t,e,r){let n=t.someProp("scrollThreshold")||0,o=t.someProp("scrollMargin")||5,i=t.dom.ownerDocument;for(let s=r||t.dom;s;){if(s.nodeType!=1){s=ts(s);continue}let a=s,l=a==i.body,c=l?BD(i):FD(a),d=0,u=0;if(e.top<c.top+Dn(n,"top")?u=-(c.top-e.top+Dn(o,"top")):e.bottom>c.bottom-Dn(n,"bottom")&&(u=e.bottom-e.top>c.bottom-c.top?e.top+Dn(o,"top")-c.top:e.bottom-c.bottom+Dn(o,"bottom")),e.left<c.left+Dn(n,"left")?d=-(c.left-e.left+Dn(o,"left")):e.right>c.right-Dn(n,"right")&&(d=e.right-c.right+Dn(o,"right")),d||u)if(l)i.defaultView.scrollBy(d,u);else {let p=a.scrollLeft,h=a.scrollTop;u&&(a.scrollTop+=u),d&&(a.scrollLeft+=d);let m=a.scrollLeft-p,g=a.scrollTop-h;e={left:e.left-m,top:e.top-g,right:e.right-m,bottom:e.bottom-g};}let f=l?"fixed":getComputedStyle(s).position;if(/^(fixed|sticky)$/.test(f))break;s=f=="absolute"?s.offsetParent:ts(s);}}function zD(t){let e=t.dom.getBoundingClientRect(),r=Math.max(0,e.top),n,o;for(let i=(e.left+e.right)/2,s=r+1;s<Math.min(innerHeight,e.bottom);s+=5){let a=t.root.elementFromPoint(i,s);if(!a||a==t.dom||!t.dom.contains(a))continue;let l=a.getBoundingClientRect();if(l.top>=r-20){n=a,o=l.top;break}}return {refDOM:n,refTop:o,stack:Lw(t.dom)}}function Lw(t){let e=[],r=t.ownerDocument;for(let n=t;n&&(e.push({dom:n,top:n.scrollTop,left:n.scrollLeft}),t!=r);n=ts(n));return e}function HD({refDOM:t,refTop:e,stack:r}){let n=t?t.getBoundingClientRect().top:0;$w(r,n==0?0:n-e);}function $w(t,e){for(let r=0;r<t.length;r++){let{dom:n,top:o,left:i}=t[r];n.scrollTop!=o+e&&(n.scrollTop=o+e),n.scrollLeft!=i&&(n.scrollLeft=i);}}var Ji=null;function UD(t){if(t.setActive)return t.setActive();if(Ji)return t.focus(Ji);let e=Lw(t);t.focus(Ji==null?{get preventScroll(){return Ji={preventScroll:!0},!0}}:void 0),Ji||(Ji=!1,$w(e,0));}function Bw(t,e){let r,n=2e8,o,i=0,s=e.top,a=e.top,l,c;for(let d=t.firstChild,u=0;d;d=d.nextSibling,u++){let f;if(d.nodeType==1)f=d.getClientRects();else if(d.nodeType==3)f=Pn(d).getClientRects();else continue;for(let p=0;p<f.length;p++){let h=f[p];if(h.top<=s&&h.bottom>=a){s=Math.max(h.bottom,s),a=Math.min(h.top,a);let m=h.left>e.left?h.left-e.left:h.right<e.left?e.left-h.right:0;if(m<n){r=d,n=m,o=m&&r.nodeType==3?{left:h.right<e.left?h.right:h.left,top:e.top}:e,d.nodeType==1&&m&&(i=u+(e.left>=(h.left+h.right)/2?1:0));continue}}else h.top>e.top&&!l&&h.left<=e.left&&h.right>=e.left&&(l=d,c={left:Math.max(h.left,Math.min(h.right,e.left)),top:h.top});!r&&(e.left>=h.right&&e.top>=h.top||e.left>=h.left&&e.top>=h.bottom)&&(i=u+1);}}return !r&&l&&(r=l,o=c,n=0),r&&r.nodeType==3?VD(r,o):!r||n&&r.nodeType==1?{node:t,offset:i}:Bw(r,o)}function VD(t,e){let r=t.nodeValue.length,n=document.createRange();for(let o=0;o<r;o++){n.setEnd(t,o+1),n.setStart(t,o);let i=so(n,1);if(i.top!=i.bottom&&up(e,i))return {node:t,offset:o+(e.left>=(i.left+i.right)/2?1:0)}}return {node:t,offset:0}}function up(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function KD(t,e){let r=t.parentNode;return r&&/^li$/i.test(r.nodeName)&&e.left<t.getBoundingClientRect().left?r:t}function WD(t,e,r){let{node:n,offset:o}=Bw(e,r),i=-1;if(n.nodeType==1&&!n.firstChild){let s=n.getBoundingClientRect();i=s.left!=s.right&&r.left>(s.left+s.right)/2?1:-1;}return t.docView.posFromDOM(n,o,i)}function GD(t,e,r,n){let o=-1;for(let i=e,s=!1;i!=t.dom;){let a=t.docView.nearestDesc(i,!0),l;if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent||!a.contentDOM)&&((l=a.dom.getBoundingClientRect()).width||l.height)&&(a.node.isBlock&&a.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(a.dom.nodeName)&&(!s&&l.left>n.left||l.top>n.top?o=a.posBefore:(!s&&l.right<n.left||l.bottom<n.top)&&(o=a.posAfter),s=!0),!a.contentDOM&&o<0&&!a.node.isText))return (a.node.isBlock?n.top<(l.top+l.bottom)/2:n.left<(l.left+l.right)/2)?a.posBefore:a.posAfter;i=a.dom.parentNode;}return o>-1?o:t.docView.posFromDOM(e,r,-1)}function Fw(t,e,r){let n=t.childNodes.length;if(n&&r.top<r.bottom)for(let o=Math.max(0,Math.min(n-1,Math.floor(n*(e.top-r.top)/(r.bottom-r.top))-2)),i=o;;){let s=t.childNodes[i];if(s.nodeType==1){let a=s.getClientRects();for(let l=0;l<a.length;l++){let c=a[l];if(up(e,c))return Fw(s,e,c)}}if((i=(i+1)%n)==o)break}return t}function qD(t,e){let r=t.dom.ownerDocument,n,o=0,i=ID(r,e.left,e.top);i&&({node:n,offset:o}=i);let s=(t.root.elementFromPoint?t.root:r).elementFromPoint(e.left,e.top),a;if(!s||!t.dom.contains(s.nodeType!=1?s.parentNode:s)){let c=t.dom.getBoundingClientRect();if(!up(e,c)||(s=Fw(t.dom,e,c),!s))return null}if(Qt)for(let c=s;n&&c;c=ts(c))c.draggable&&(n=void 0);if(s=KD(s,e),n){if(Wr&&n.nodeType==1&&(o=Math.min(o,n.childNodes.length),o<n.childNodes.length)){let d=n.childNodes[o],u;d.nodeName=="IMG"&&(u=d.getBoundingClientRect()).right<=e.left&&u.bottom>e.top&&o++;}let c;ha&&o&&n.nodeType==1&&(c=n.childNodes[o-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=e.top&&o--,n==t.dom&&o==n.childNodes.length-1&&n.lastChild.nodeType==1&&e.top>n.lastChild.getBoundingClientRect().bottom?a=t.state.doc.content.size:(o==0||n.nodeType!=1||n.childNodes[o-1].nodeName!="BR")&&(a=GD(t,n,o,e));}a==null&&(a=WD(t,s,e));let l=t.docView.nearestDesc(s,!0);return {pos:a,inside:l?l.posAtStart-l.border:-1}}function ow(t){return t.top<t.bottom||t.left<t.right}function so(t,e){let r=t.getClientRects();if(r.length){let n=r[e<0?0:r.length-1];if(ow(n))return n}return Array.prototype.find.call(r,ow)||t.getBoundingClientRect()}var jD=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function zw(t,e,r){let{node:n,offset:o,atom:i}=t.docView.domFromPos(e,r<0?-1:1),s=ha||Wr;if(n.nodeType==3)if(s&&(jD.test(n.nodeValue)||(r<0?!o:o==n.nodeValue.length))){let l=so(Pn(n,o,o),r);if(Wr&&o&&/\s/.test(n.nodeValue[o-1])&&o<n.nodeValue.length){let c=so(Pn(n,o-1,o-1),-1);if(c.top==l.top){let d=so(Pn(n,o,o+1),-1);if(d.top!=l.top)return ia(d,d.left<c.left)}}return l}else {let l=o,c=o,d=r<0?1:-1;return r<0&&!o?(c++,d=-1):r>=0&&o==n.nodeValue.length?(l--,d=1):r<0?l--:c++,ia(so(Pn(n,l,c),d),d<0)}if(!t.state.doc.resolve(e-(i||0)).parent.inlineContent){if(i==null&&o&&(r<0||o==Nr(n))){let l=n.childNodes[o-1];if(l.nodeType==1)return Vf(l.getBoundingClientRect(),!1)}if(i==null&&o<Nr(n)){let l=n.childNodes[o];if(l.nodeType==1)return Vf(l.getBoundingClientRect(),!0)}return Vf(n.getBoundingClientRect(),r>=0)}if(i==null&&o&&(r<0||o==Nr(n))){let l=n.childNodes[o-1],c=l.nodeType==3?Pn(l,Nr(l)-(s?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(c)return ia(so(c,1),!1)}if(i==null&&o<Nr(n)){let l=n.childNodes[o];for(;l.pmViewDesc&&l.pmViewDesc.ignoreForCoords;)l=l.nextSibling;let c=l?l.nodeType==3?Pn(l,0,s?0:1):l.nodeType==1?l:null:null;if(c)return ia(so(c,-1),!0)}return ia(so(n.nodeType==3?Pn(n):n,-r),r>=0)}function ia(t,e){if(t.width==0)return t;let r=e?t.left:t.right;return {top:t.top,bottom:t.bottom,left:r,right:r}}function Vf(t,e){if(t.height==0)return t;let r=e?t.top:t.bottom;return {top:r,bottom:r,left:t.left,right:t.right}}function Hw(t,e,r){let n=t.state,o=t.root.activeElement;n!=e&&t.updateState(e),o!=t.dom&&t.focus();try{return r()}finally{n!=e&&t.updateState(n),o!=t.dom&&o&&o.focus();}}function YD(t,e,r){let n=e.selection,o=r=="up"?n.$from:n.$to;return Hw(t,e,()=>{let{node:i}=t.docView.domFromPos(o.pos,r=="up"?-1:1);for(;;){let a=t.docView.nearestDesc(i,!0);if(!a)break;if(a.node.isBlock){i=a.contentDOM||a.dom;break}i=a.dom.parentNode;}let s=zw(t,o.pos,1);for(let a=i.firstChild;a;a=a.nextSibling){let l;if(a.nodeType==1)l=a.getClientRects();else if(a.nodeType==3)l=Pn(a,0,a.nodeValue.length).getClientRects();else continue;for(let c=0;c<l.length;c++){let d=l[c];if(d.bottom>d.top+1&&(r=="up"?s.top-d.top>(d.bottom-s.top)*2:d.bottom-s.bottom>(s.bottom-d.top)*2))return !1}}return !0})}var XD=/[\u0590-\u08ac]/;function JD(t,e,r){let{$head:n}=e.selection;if(!n.parent.isTextblock)return !1;let o=n.parentOffset,i=!o,s=o==n.parent.content.size,a=t.domSelection();return a?!XD.test(n.parent.textContent)||!a.modify?r=="left"||r=="backward"?i:s:Hw(t,e,()=>{let{focusNode:l,focusOffset:c,anchorNode:d,anchorOffset:u}=t.domSelectionRange(),f=a.caretBidiLevel;a.modify("move",r,"character");let p=n.depth?t.docView.domAfterPos(n.before()):t.dom,{focusNode:h,focusOffset:m}=t.domSelectionRange(),g=h&&!p.contains(h.nodeType==1?h:h.parentNode)||l==h&&c==m;try{a.collapse(d,u),l&&(l!=d||c!=u)&&a.extend&&a.extend(l,c);}catch{}return f!=null&&(a.caretBidiLevel=f),g}):n.pos==n.start()||n.pos==n.end()}var iw=null,sw=null,aw=!1;function ZD(t,e,r){return iw==e&&sw==r?aw:(iw=e,sw=r,aw=r=="up"||r=="down"?YD(t,e,r):JD(t,e,r))}var _r=0,lw=1,ri=2,cn=3,ai=class{constructor(e,r,n,o){this.parent=e,this.children=r,this.dom=n,this.contentDOM=o,this.dirty=_r,n.pmViewDesc=this;}matchesWidget(e){return !1}matchesMark(e){return !1}matchesNode(e,r,n){return !1}matchesHack(e){return !1}parseRule(){return null}stopEvent(e){return !1}get size(){let e=0;for(let r=0;r<this.children.length;r++)e+=this.children[r].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy();}posBeforeChild(e){for(let r=0,n=this.posAtStart;;r++){let o=this.children[r];if(o==e)return n;n+=o.size;}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,r,n){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(n<0){let i,s;if(e==this.contentDOM)i=e.childNodes[r-1];else {for(;e.parentNode!=this.contentDOM;)e=e.parentNode;i=e.previousSibling;}for(;i&&!((s=i.pmViewDesc)&&s.parent==this);)i=i.previousSibling;return i?this.posBeforeChild(s)+s.size:this.posAtStart}else {let i,s;if(e==this.contentDOM)i=e.childNodes[r];else {for(;e.parentNode!=this.contentDOM;)e=e.parentNode;i=e.nextSibling;}for(;i&&!((s=i.pmViewDesc)&&s.parent==this);)i=i.nextSibling;return i?this.posBeforeChild(s):this.posAtEnd}let o;if(e==this.dom&&this.contentDOM)o=r>Dt(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))o=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(r==0)for(let i=e;;i=i.parentNode){if(i==this.dom){o=!1;break}if(i.previousSibling)break}if(o==null&&r==e.childNodes.length)for(let i=e;;i=i.parentNode){if(i==this.dom){o=!0;break}if(i.nextSibling)break}}return o??n>0?this.posAtEnd:this.posAtStart}nearestDesc(e,r=!1){for(let n=!0,o=e;o;o=o.parentNode){let i=this.getDesc(o),s;if(i&&(!r||i.node))if(n&&(s=i.nodeDOM)&&!(s.nodeType==1?s.contains(e.nodeType==1?e:e.parentNode):s==e))n=!1;else return i}}getDesc(e){let r=e.pmViewDesc;for(let n=r;n;n=n.parent)if(n==this)return r}posFromDOM(e,r,n){for(let o=e;o;o=o.parentNode){let i=this.getDesc(o);if(i)return i.localPosFromDOM(e,r,n)}return -1}descAt(e){for(let r=0,n=0;r<this.children.length;r++){let o=this.children[r],i=n+o.size;if(n==e&&i!=n){for(;!o.border&&o.children.length;)for(let s=0;s<o.children.length;s++){let a=o.children[s];if(a.size){o=a;break}}return o}if(e<i)return o.descAt(e-n-o.border);n=i;}}domFromPos(e,r){if(!this.contentDOM)return {node:this.dom,offset:0,atom:e+1};let n=0,o=0;for(let i=0;n<this.children.length;n++){let s=this.children[n],a=i+s.size;if(a>e||s instanceof rc){o=e-i;break}i=a;}if(o)return this.children[n].domFromPos(o-this.children[n].border,r);for(let i;n&&!(i=this.children[n-1]).size&&i instanceof tc&&i.side>=0;n--);if(r<=0){let i,s=!0;for(;i=n?this.children[n-1]:null,!(!i||i.dom.parentNode==this.contentDOM);n--,s=!1);return i&&r&&s&&!i.border&&!i.domAtom?i.domFromPos(i.size,r):{node:this.contentDOM,offset:i?Dt(i.dom)+1:0}}else {let i,s=!0;for(;i=n<this.children.length?this.children[n]:null,!(!i||i.dom.parentNode==this.contentDOM);n++,s=!1);return i&&s&&!i.border&&!i.domAtom?i.domFromPos(0,r):{node:this.contentDOM,offset:i?Dt(i.dom):this.contentDOM.childNodes.length}}}parseRange(e,r,n=0){if(this.children.length==0)return {node:this.contentDOM,from:e,to:r,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let o=-1,i=-1;for(let s=n,a=0;;a++){let l=this.children[a],c=s+l.size;if(o==-1&&e<=c){let d=s+l.border;if(e>=d&&r<=c-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,r,d);e=s;for(let u=a;u>0;u--){let f=this.children[u-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){o=Dt(f.dom)+1;break}e-=f.size;}o==-1&&(o=0);}if(o>-1&&(c>r||a==this.children.length-1)){r=c;for(let d=a+1;d<this.children.length;d++){let u=this.children[d];if(u.size&&u.dom.parentNode==this.contentDOM&&!u.emptyChildAt(-1)){i=Dt(u.dom);break}r+=u.size;}i==-1&&(i=this.contentDOM.childNodes.length);break}s=c;}return {node:this.contentDOM,from:e,to:r,fromOffset:o,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return !1;let r=this.children[e<0?0:this.children.length-1];return r.size==0||r.emptyChildAt(e)}domAfterPos(e){let{node:r,offset:n}=this.domFromPos(e,0);if(r.nodeType!=1||n==r.childNodes.length)throw new RangeError("No node after pos "+e);return r.childNodes[n]}setSelection(e,r,n,o=!1){let i=Math.min(e,r),s=Math.max(e,r);for(let p=0,h=0;p<this.children.length;p++){let m=this.children[p],g=h+m.size;if(i>h&&s<g)return m.setSelection(e-h-m.border,r-h-m.border,n,o);h=g;}let a=this.domFromPos(e,e?-1:1),l=r==e?a:this.domFromPos(r,r?-1:1),c=n.root.getSelection(),d=n.domSelectionRange(),u=!1;if((Wr||Qt)&&e==r){let{node:p,offset:h}=a;if(p.nodeType==3){if(u=!!(h&&p.nodeValue[h-1]==`
|
|
99
|
+
`),u&&h==p.nodeValue.length)for(let m=p,g;m;m=m.parentNode){if(g=m.nextSibling){g.nodeName=="BR"&&(a=l={node:g.parentNode,offset:Dt(g)+1});break}let b=m.pmViewDesc;if(b&&b.node&&b.node.isBlock)break}}else {let m=p.childNodes[h-1];u=m&&(m.nodeName=="BR"||m.contentEditable=="false");}}if(Wr&&d.focusNode&&d.focusNode!=l.node&&d.focusNode.nodeType==1){let p=d.focusNode.childNodes[d.focusOffset];p&&p.contentEditable=="false"&&(o=!0);}if(!(o||u&&Qt)&&si(a.node,a.offset,d.anchorNode,d.anchorOffset)&&si(l.node,l.offset,d.focusNode,d.focusOffset))return;let f=!1;if((c.extend||e==r)&&!u){c.collapse(a.node,a.offset);try{e!=r&&c.extend(l.node,l.offset),f=!0;}catch{}}if(!f){if(e>r){let h=a;a=l,l=h;}let p=document.createRange();p.setEnd(l.node,l.offset),p.setStart(a.node,a.offset),c.removeAllRanges(),c.addRange(p);}}ignoreMutation(e){return !this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,r){for(let n=0,o=0;o<this.children.length;o++){let i=this.children[o],s=n+i.size;if(n==s?e<=s&&r>=n:e<s&&r>n){let a=n+i.border,l=s-i.border;if(e>=a&&r<=l){this.dirty=e==n||r==s?ri:lw,e==a&&r==l&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=cn:i.markDirty(e-a,r-a);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?ri:cn;}n=s;}this.dirty=ri;}markParentsDirty(){let e=1;for(let r=this.parent;r;r=r.parent,e++){let n=e==1?ri:lw;r.dirty<n&&(r.dirty=n);}}get domAtom(){return !1}get ignoreForCoords(){return !1}get ignoreForSelection(){return !1}isText(e){return !1}},tc=class extends ai{constructor(e,r,n,o){let i,s=r.type.toDOM;if(typeof s=="function"&&(s=s(n,()=>{if(!i)return o;if(i.parent)return i.parent.posBeforeChild(i)})),!r.type.spec.raw){if(s.nodeType!=1){let a=document.createElement("span");a.appendChild(s),s=a;}s.contentEditable="false",s.classList.add("ProseMirror-widget");}super(e,[],s,null),this.widget=r,this.widget=r,i=this;}matchesWidget(e){return this.dirty==_r&&e.type.eq(this.widget.type)}parseRule(){return {ignore:!0}}stopEvent(e){let r=this.widget.spec.stopEvent;return r?r(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy();}get domAtom(){return !0}get ignoreForSelection(){return !!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}},Zf=class extends ai{constructor(e,r,n,o){super(e,[],r,null),this.textDOM=n,this.text=o;}get size(){return this.text.length}localPosFromDOM(e,r){return e!=this.textDOM?this.posAtStart+(r?this.size:0):this.posAtStart+r}domFromPos(e){return {node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}},$n=class extends ai{constructor(e,r,n,o,i){super(e,[],n,o),this.mark=r,this.spec=i;}static create(e,r,n,o){let i=o.nodeViews[r.type.name],s=i&&i(r,o,n);return (!s||!s.dom)&&(s=Kr.renderSpec(document,r.type.spec.toDOM(r,n),null,r.attrs)),new $n(e,r,s.dom,s.contentDOM||s.dom,s)}parseRule(){return this.dirty&cn||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=cn&&this.mark.eq(e)}markDirty(e,r){if(super.markDirty(e,r),this.dirty!=_r){let n=this.parent;for(;!n.node;)n=n.parent;n.dirty<this.dirty&&(n.dirty=this.dirty),this.dirty=_r;}}slice(e,r,n){let o=$n.create(this.parent,this.mark,!0,n),i=this.children,s=this.size;r<s&&(i=rp(i,r,s,n)),e>0&&(i=rp(i,0,e,n));for(let a=0;a<i.length;a++)i[a].parent=o;return o.children=i,o}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy();}},sn=class extends ai{constructor(e,r,n,o,i,s,a,l,c){super(e,[],i,s),this.node=r,this.outerDeco=n,this.innerDeco=o,this.nodeDOM=a;}static create(e,r,n,o,i,s){let a=i.nodeViews[r.type.name],l,c=a&&a(r,i,()=>{if(!l)return s;if(l.parent)return l.parent.posBeforeChild(l)},n,o),d=c&&c.dom,u=c&&c.contentDOM;if(r.isText){if(!d)d=document.createTextNode(r.text);else if(d.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else d||({dom:d,contentDOM:u}=Kr.renderSpec(document,r.type.spec.toDOM(r),null,r.attrs));!u&&!r.isText&&d.nodeName!="BR"&&(d.hasAttribute("contenteditable")||(d.contentEditable="false"),r.type.spec.draggable&&(d.draggable=!0));let f=d;return d=Kw(d,n,r),c?l=new Qf(e,r,n,o,d,u||null,f,c,i,s+1):r.isText?new ns(e,r,n,o,d,f,i):new sn(e,r,n,o,d,u||null,f,i,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else {for(let r=this.children.length-1;r>=0;r--){let n=this.children[r];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=()=>O.empty);}return e}matchesNode(e,r,n){return this.dirty==_r&&e.eq(this.node)&&nc(r,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,r){let n=this.node.inlineContent,o=r,i=e.composing?this.localCompositionInfo(e,r):null,s=i&&i.pos>-1?i:null,a=i&&i.pos<0,l=new tp(this,s&&s.node,e);rP(this.node,this.innerDeco,(c,d,u)=>{c.spec.marks?l.syncToMarks(c.spec.marks,n,e):c.type.side>=0&&!u&&l.syncToMarks(d==this.node.childCount?_e.none:this.node.child(d).marks,n,e),l.placeWidget(c,e,o);},(c,d,u,f)=>{l.syncToMarks(c.marks,n,e);let p;l.findNodeMatch(c,d,u,f)||a&&e.state.selection.from>o&&e.state.selection.to<o+c.nodeSize&&(p=l.findIndexWithChild(i.node))>-1&&l.updateNodeAt(c,d,u,p,e)||l.updateNextNode(c,d,u,e,f,o)||l.addNode(c,d,u,e,o),o+=c.nodeSize;}),l.syncToMarks([],n,e),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==ri)&&(s&&this.protectLocalComposition(e,s),Uw(this.contentDOM,this.children,e),rs&&nP(this.dom));}localCompositionInfo(e,r){let{from:n,to:o}=e.state.selection;if(!(e.state.selection instanceof q)||n<r||o>r+this.node.content.size)return null;let i=e.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let s=i.nodeValue,a=oP(this.node.content,s,n-r,o-r);return a<0?null:{node:i,pos:a,text:s}}else return {node:i,pos:-1,text:""}}protectLocalComposition(e,{node:r,pos:n,text:o}){if(this.getDesc(r))return;let i=r;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0);}let s=new Zf(this,i,r,o);e.input.compositionNodes.push(s),this.children=rp(this.children,n,n+o.length,e,s);}update(e,r,n,o){return this.dirty==cn||!e.sameMarkup(this.node)?!1:(this.updateInner(e,r,n,o),!0)}updateInner(e,r,n,o){this.updateOuterDeco(r),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(o,this.posAtStart),this.dirty=_r;}updateOuterDeco(e){if(nc(e,this.outerDeco))return;let r=this.nodeDOM.nodeType!=1,n=this.dom;this.dom=Vw(this.dom,this.nodeDOM,ep(this.outerDeco,this.node,r),ep(e,this.node,r)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e;}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0);}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable"));}get domAtom(){return this.node.isAtom}};function cw(t,e,r,n,o){Kw(n,e,t);let i=new sn(void 0,t,e,r,n,n,n,o,0);return i.contentDOM&&i.updateChildren(o,0),i}var ns=class extends sn{constructor(e,r,n,o,i,s,a){super(e,r,n,o,i,null,s,a,0);}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return {skip:e||!0}}update(e,r,n,o){return this.dirty==cn||this.dirty!=_r&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(r),(this.dirty!=_r||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,o.trackWrites==this.nodeDOM&&(o.trackWrites=null)),this.node=e,this.dirty=_r,!0)}inParent(){let e=this.parent.contentDOM;for(let r=this.nodeDOM;r;r=r.parentNode)if(r==e)return !0;return !1}domFromPos(e){return {node:this.nodeDOM,offset:e}}localPosFromDOM(e,r,n){return e==this.nodeDOM?this.posAtStart+Math.min(r,this.node.text.length):super.localPosFromDOM(e,r,n)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,r,n){let o=this.node.cut(e,r),i=document.createTextNode(o.text);return new ns(this.parent,o,this.outerDeco,this.innerDeco,i,i,n)}markDirty(e,r){super.markDirty(e,r),this.dom!=this.nodeDOM&&(e==0||r==this.nodeDOM.nodeValue.length)&&(this.dirty=cn);}get domAtom(){return !1}isText(e){return this.node.text==e}},rc=class extends ai{parseRule(){return {ignore:!0}}matchesHack(e){return this.dirty==_r&&this.dom.nodeName==e}get domAtom(){return !0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}},Qf=class extends sn{constructor(e,r,n,o,i,s,a,l,c,d){super(e,r,n,o,i,s,a,c,d),this.spec=l;}update(e,r,n,o){if(this.dirty==cn)return !1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let i=this.spec.update(e,r,n);return i&&this.updateInner(e,r,n,o),i}else return !this.contentDOM&&!e.isLeaf?!1:super.update(e,r,n,o)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode();}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode();}setSelection(e,r,n,o){this.spec.setSelection?this.spec.setSelection(e,r,n.root):super.setSelection(e,r,n,o);}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy();}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}};function Uw(t,e,r){let n=t.firstChild,o=!1;for(let i=0;i<e.length;i++){let s=e[i],a=s.dom;if(a.parentNode==t){for(;a!=n;)n=dw(n),o=!0;n=n.nextSibling;}else o=!0,t.insertBefore(a,n);if(s instanceof $n){let l=n?n.previousSibling:t.lastChild;Uw(s.contentDOM,s.children,r),n=l?l.nextSibling:t.firstChild;}}for(;n;)n=dw(n),o=!0;o&&r.trackWrites==t&&(r.trackWrites=null);}var sa=function(t){t&&(this.nodeName=t);};sa.prototype=Object.create(null);var ni=[new sa];function ep(t,e,r){if(t.length==0)return ni;let n=r?ni[0]:new sa,o=[n];for(let i=0;i<t.length;i++){let s=t[i].type.attrs;if(s){s.nodeName&&o.push(n=new sa(s.nodeName));for(let a in s){let l=s[a];l!=null&&(r&&o.length==1&&o.push(n=new sa(e.isInline?"span":"div")),a=="class"?n.class=(n.class?n.class+" ":"")+l:a=="style"?n.style=(n.style?n.style+";":"")+l:a!="nodeName"&&(n[a]=l));}}}return o}function Vw(t,e,r,n){if(r==ni&&n==ni)return e;let o=e;for(let i=0;i<n.length;i++){let s=n[i],a=r[i];if(i){let l;a&&a.nodeName==s.nodeName&&o!=t&&(l=o.parentNode)&&l.nodeName.toLowerCase()==s.nodeName||(l=document.createElement(s.nodeName),l.pmIsDeco=!0,l.appendChild(o),a=ni[0]),o=l;}QD(o,a||ni[0],s);}return o}function QD(t,e,r){for(let n in e)n!="class"&&n!="style"&&n!="nodeName"&&!(n in r)&&t.removeAttribute(n);for(let n in r)n!="class"&&n!="style"&&n!="nodeName"&&r[n]!=e[n]&&t.setAttribute(n,r[n]);if(e.class!=r.class){let n=e.class?e.class.split(" ").filter(Boolean):[],o=r.class?r.class.split(" ").filter(Boolean):[];for(let i=0;i<n.length;i++)o.indexOf(n[i])==-1&&t.classList.remove(n[i]);for(let i=0;i<o.length;i++)n.indexOf(o[i])==-1&&t.classList.add(o[i]);t.classList.length==0&&t.removeAttribute("class");}if(e.style!=r.style){if(e.style){let n=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,o;for(;o=n.exec(e.style);)t.style.removeProperty(o[1]);}r.style&&(t.style.cssText+=r.style);}}function Kw(t,e,r){return Vw(t,t,ni,ep(e,r,t.nodeType!=1))}function nc(t,e){if(t.length!=e.length)return !1;for(let r=0;r<t.length;r++)if(!t[r].type.eq(e[r].type))return !1;return !0}function dw(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}var tp=class{constructor(e,r,n){this.lock=r,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=eP(e.node.content,e);}destroyBetween(e,r){if(e!=r){for(let n=e;n<r;n++)this.top.children[n].destroy();this.top.children.splice(e,r-e),this.changed=!0;}}destroyRest(){this.destroyBetween(this.index,this.top.children.length);}syncToMarks(e,r,n){let o=0,i=this.stack.length>>1,s=Math.min(i,e.length);for(;o<s&&(o==i-1?this.top:this.stack[o+1<<1]).matchesMark(e[o])&&e[o].type.spec.spanning!==!1;)o++;for(;o<i;)this.destroyRest(),this.top.dirty=_r,this.index=this.stack.pop(),this.top=this.stack.pop(),i--;for(;i<e.length;){this.stack.push(this.top,this.index+1);let a=-1;for(let l=this.index;l<Math.min(this.index+3,this.top.children.length);l++){let c=this.top.children[l];if(c.matchesMark(e[i])&&!this.isLocked(c.dom)){a=l;break}}if(a>-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else {let l=$n.create(this.top,e[i],r,n);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0;}this.index=0,i++;}}findNodeMatch(e,r,n,o){let i=-1,s;if(o>=this.preMatch.index&&(s=this.preMatch.matches[o-this.preMatch.index]).parent==this.top&&s.matchesNode(e,r,n))i=this.top.children.indexOf(s,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a<l;a++){let c=this.top.children[a];if(c.matchesNode(e,r,n)&&!this.preMatch.matched.has(c)){i=a;break}}return i<0?!1:(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(e,r,n,o,i){let s=this.top.children[o];return s.dirty==cn&&s.dom==s.contentDOM&&(s.dirty=ri),s.update(e,r,n,i)?(this.destroyBetween(this.index,o),this.index++,!0):!1}findIndexWithChild(e){for(;;){let r=e.parentNode;if(!r)return -1;if(r==this.top.contentDOM){let n=e.pmViewDesc;if(n){for(let o=this.index;o<this.top.children.length;o++)if(this.top.children[o]==n)return o}return -1}e=r;}}updateNextNode(e,r,n,o,i,s){for(let a=this.index;a<this.top.children.length;a++){let l=this.top.children[a];if(l instanceof sn){let c=this.preMatch.matched.get(l);if(c!=null&&c!=i)return !1;let d=l.dom,u,f=this.isLocked(d)&&!(e.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==e.text&&l.dirty!=cn&&nc(r,l.outerDeco));if(!f&&l.update(e,r,n,o))return this.destroyBetween(this.index,a),l.dom!=d&&(this.changed=!0),this.index++,!0;if(!f&&(u=this.recreateWrapper(l,e,r,n,o,s)))return this.destroyBetween(this.index,a),this.top.children[this.index]=u,u.contentDOM&&(u.dirty=ri,u.updateChildren(o,s+1),u.dirty=_r),this.changed=!0,this.index++,!0;break}}return !1}recreateWrapper(e,r,n,o,i,s){if(e.dirty||r.isAtom||!e.children.length||!e.node.content.eq(r.content)||!nc(n,e.outerDeco)||!o.eq(e.innerDeco))return null;let a=sn.create(this.top,r,n,o,i,s);if(a.contentDOM){a.children=e.children,e.children=[];for(let l of a.children)l.parent=a;}return e.destroy(),a}addNode(e,r,n,o,i){let s=sn.create(this.top,e,r,n,o,i);s.contentDOM&&s.updateChildren(o,i+1),this.top.children.splice(this.index++,0,s),this.changed=!0;}placeWidget(e,r,n){let o=this.index<this.top.children.length?this.top.children[this.index]:null;if(o&&o.matchesWidget(e)&&(e==o.widget||!o.widget.type.toDOM.parentNode))this.index++;else {let i=new tc(this.top,e,r,n);this.top.children.splice(this.index++,0,i),this.changed=!0;}}addTextblockHacks(){let e=this.top.children[this.index-1],r=this.top;for(;e instanceof $n;)r=e,e=r.children[r.children.length-1];(!e||!(e instanceof ns)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Qt||qt)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",r),this.addHackNode("BR",this.top));}addHackNode(e,r){if(r==this.top&&this.index<r.children.length&&r.children[this.index].matchesHack(e))this.index++;else {let n=document.createElement(e);e=="IMG"&&(n.className="ProseMirror-separator",n.alt=""),e=="BR"&&(n.className="ProseMirror-trailingBreak");let o=new rc(this.top,[],n,null);r!=this.top?r.children.push(o):r.children.splice(this.index++,0,o),this.changed=!0;}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}};function eP(t,e){let r=e,n=r.children.length,o=t.childCount,i=new Map,s=[];e:for(;o>0;){let a;for(;;)if(n){let c=r.children[n-1];if(c instanceof $n)r=c,n=c.children.length;else {a=c,n--;break}}else {if(r==e)break e;n=r.parent.children.indexOf(r),r=r.parent;}let l=a.node;if(l){if(l!=t.child(o-1))break;--o,i.set(a,o),s.push(a);}}return {index:o,matched:i,matches:s.reverse()}}function tP(t,e){return t.type.side-e.type.side}function rP(t,e,r,n){let o=e.locals(t),i=0;if(o.length==0){for(let c=0;c<t.childCount;c++){let d=t.child(c);n(d,o,e.forChild(i,d),c),i+=d.nodeSize;}return}let s=0,a=[],l=null;for(let c=0;;){let d,u;for(;s<o.length&&o[s].to==i;){let g=o[s++];g.widget&&(d?(u||(u=[d])).push(g):d=g);}if(d)if(u){u.sort(tP);for(let g=0;g<u.length;g++)r(u[g],c,!!l);}else r(d,c,!!l);let f,p;if(l)p=-1,f=l,l=null;else if(c<t.childCount)p=c,f=t.child(c++);else break;for(let g=0;g<a.length;g++)a[g].to<=i&&a.splice(g--,1);for(;s<o.length&&o[s].from<=i&&o[s].to>i;)a.push(o[s++]);let h=i+f.nodeSize;if(f.isText){let g=h;s<o.length&&o[s].from<g&&(g=o[s].from);for(let b=0;b<a.length;b++)a[b].to<g&&(g=a[b].to);g<h&&(l=f.cut(g-i),f=f.cut(0,g-i),h=g,p=-1);}else for(;s<o.length&&o[s].to<h;)s++;let m=f.isInline&&!f.isLeaf?a.filter(g=>!g.inline):a.slice();n(f,m,e.forChild(i,f),p),i=h;}}function nP(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e;}}function oP(t,e,r,n){for(let o=0,i=0;o<t.childCount&&i<=n;){let s=t.child(o++),a=i;if(i+=s.nodeSize,!s.isText)continue;let l=s.text;for(;o<t.childCount;){let c=t.child(o++);if(i+=c.nodeSize,!c.isText)break;l+=c.text;}if(i>=r){if(i>=n&&l.slice(n-e.length-a,n-a)==e)return n-e.length;let c=a<n?l.lastIndexOf(e,n-a-1):-1;if(c>=0&&c+e.length+a>=r)return a+c;if(r==n&&l.length>=n+e.length-a&&l.slice(n-a,n-a+e.length)==e)return n}}return -1}function rp(t,e,r,n,o){let i=[];for(let s=0,a=0;s<t.length;s++){let l=t[s],c=a,d=a+=l.size;c>=r||d<=e?i.push(l):(c<e&&i.push(l.slice(0,e-c,n)),o&&(i.push(o),o=void 0),d>r&&i.push(l.slice(r-c,l.size,n)));}return i}function fp(t,e=null){let r=t.domSelectionRange(),n=t.state.doc;if(!r.focusNode)return null;let o=t.docView.nearestDesc(r.focusNode),i=o&&o.size==0,s=t.docView.posFromDOM(r.focusNode,r.focusOffset,1);if(s<0)return null;let a=n.resolve(s),l,c;if(lc(r)){for(l=s;o&&!o.node;)o=o.parent;let u=o.node;if(o&&u.isAtom&&X.isSelectable(u)&&o.parent&&!(u.isInline&&DD(r.focusNode,r.focusOffset,o.dom))){let f=o.posBefore;c=new X(s==f?a:n.resolve(f));}}else {if(r instanceof t.dom.ownerDocument.defaultView.Selection&&r.rangeCount>1){let u=s,f=s;for(let p=0;p<r.rangeCount;p++){let h=r.getRangeAt(p);u=Math.min(u,t.docView.posFromDOM(h.startContainer,h.startOffset,1)),f=Math.max(f,t.docView.posFromDOM(h.endContainer,h.endOffset,-1));}if(u<0)return null;[l,s]=f==t.state.selection.anchor?[f,u]:[u,f],a=n.resolve(s);}else l=t.docView.posFromDOM(r.anchorNode,r.anchorOffset,1);if(l<0)return null}let d=n.resolve(l);if(!c){let u=e=="pointer"||t.state.selection.head<a.pos&&!i?1:-1;c=pp(t,d,a,u);}return c}function Ww(t){return t.editable?t.hasFocus():qw(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function Ln(t,e=!1){let r=t.state.selection;if(Gw(t,r),!!Ww(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&qt){let n=t.domSelectionRange(),o=t.domObserver.currentSelection;if(n.anchorNode&&o.anchorNode&&si(n.anchorNode,n.anchorOffset,o.anchorNode,o.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)sP(t);else {let{anchor:n,head:o}=r,i,s;uw&&!(r instanceof q)&&(r.$from.parent.inlineContent||(i=fw(t,r.from)),!r.empty&&!r.$from.parent.inlineContent&&(s=fw(t,r.to))),t.docView.setSelection(n,o,t,e),uw&&(i&&pw(i),s&&pw(s)),r.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&iP(t));}t.domObserver.setCurSelection(),t.domObserver.connectSelection();}}var uw=Qt||qt&&Iw<63;function fw(t,e){let{node:r,offset:n}=t.docView.domFromPos(e,0),o=n<r.childNodes.length?r.childNodes[n]:null,i=n?r.childNodes[n-1]:null;if(Qt&&o&&o.contentEditable=="false")return Kf(o);if((!o||o.contentEditable=="false")&&(!i||i.contentEditable=="false")){if(o)return Kf(o);if(i)return Kf(i)}}function Kf(t){return t.contentEditable="true",Qt&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function pw(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null);}function iP(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let r=t.domSelectionRange(),n=r.anchorNode,o=r.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{(r.anchorNode!=n||r.anchorOffset!=o)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!Ww(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection");},20));});}function sP(t){let e=t.domSelection(),r=document.createRange();if(!e)return;let n=t.cursorWrapper.dom,o=n.nodeName=="IMG";o?r.setStart(n.parentNode,Dt(n)+1):r.setStart(n,0),r.collapse(!0),e.removeAllRanges(),e.addRange(r),!o&&!t.state.selection.visible&&cr&&co<=11&&(n.disabled=!0,n.disabled=!1);}function Gw(t,e){if(e instanceof X){let r=t.docView.descAt(e.from);r!=t.lastSelectedViewDesc&&(hw(t),r&&r.selectNode(),t.lastSelectedViewDesc=r);}else hw(t);}function hw(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0);}function pp(t,e,r,n){return t.someProp("createSelectionBetween",o=>o(t,e,r))||q.between(e,r,n)}function mw(t){return t.editable&&!t.hasFocus()?!1:qw(t)}function qw(t){let e=t.domSelectionRange();if(!e.anchorNode)return !1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return !1}}function aP(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),r=t.domSelectionRange();return si(e.node,e.offset,r.anchorNode,r.anchorOffset)}function np(t,e){let{$anchor:r,$head:n}=t.selection,o=e>0?r.max(n):r.min(n),i=o.parent.inlineContent?o.depth?t.doc.resolve(e>0?o.after():o.before()):null:o;return i&&Z.findFrom(i,e)}function ao(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function gw(t,e,r){let n=t.state.selection;if(n instanceof q)if(r.indexOf("s")>-1){let{$head:o}=n,i=o.textOffset?null:e<0?o.nodeBefore:o.nodeAfter;if(!i||i.isText||!i.isLeaf)return !1;let s=t.state.doc.resolve(o.pos+i.nodeSize*(e<0?-1:1));return ao(t,new q(n.$anchor,s))}else if(n.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let o=np(t.state,e);return o&&o instanceof X?ao(t,o):!1}else if(!(Tr&&r.indexOf("m")>-1)){let o=n.$head,i=o.textOffset?null:e<0?o.nodeBefore:o.nodeAfter,s;if(!i||i.isText)return !1;let a=e<0?o.pos-i.nodeSize:o.pos;return i.isAtom||(s=t.docView.descAt(a))&&!s.contentDOM?X.isSelectable(i)?ao(t,new X(e<0?t.state.doc.resolve(o.pos-i.nodeSize):o)):ha?ao(t,new q(t.state.doc.resolve(e<0?a:a+i.nodeSize))):!1:!1}}else return !1;else {if(n instanceof X&&n.node.isInline)return ao(t,new q(e>0?n.$to:n.$from));{let o=np(t.state,e);return o?ao(t,o):!1}}}function oc(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function aa(t,e){let r=t.pmViewDesc;return r&&r.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function Zi(t,e){return e<0?lP(t):cP(t)}function lP(t){let e=t.domSelectionRange(),r=e.focusNode,n=e.focusOffset;if(!r)return;let o,i,s=!1;for(Wr&&r.nodeType==1&&n<oc(r)&&aa(r.childNodes[n],-1)&&(s=!0);;)if(n>0){if(r.nodeType!=1)break;{let a=r.childNodes[n-1];if(aa(a,-1))o=r,i=--n;else if(a.nodeType==3)r=a,n=r.nodeValue.length;else break}}else {if(jw(r))break;{let a=r.previousSibling;for(;a&&aa(a,-1);)o=r.parentNode,i=Dt(a),a=a.previousSibling;if(a)r=a,n=oc(r);else {if(r=r.parentNode,r==t.dom)break;n=0;}}}s?op(t,r,n):o&&op(t,o,i);}function cP(t){let e=t.domSelectionRange(),r=e.focusNode,n=e.focusOffset;if(!r)return;let o=oc(r),i,s;for(;;)if(n<o){if(r.nodeType!=1)break;let a=r.childNodes[n];if(aa(a,1))i=r,s=++n;else break}else {if(jw(r))break;{let a=r.nextSibling;for(;a&&aa(a,1);)i=a.parentNode,s=Dt(a)+1,a=a.nextSibling;if(a)r=a,n=0,o=oc(r);else {if(r=r.parentNode,r==t.dom)break;n=o=0;}}}i&&op(t,i,s);}function jw(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function dP(t,e){for(;t&&e==t.childNodes.length&&!pa(t);)e=Dt(t)+1,t=t.parentNode;for(;t&&e<t.childNodes.length;){let r=t.childNodes[e];if(r.nodeType==3)return r;if(r.nodeType==1&&r.contentEditable=="false")break;t=r,e=0;}}function uP(t,e){for(;t&&!e&&!pa(t);)e=Dt(t),t=t.parentNode;for(;t&&e;){let r=t.childNodes[e-1];if(r.nodeType==3)return r;if(r.nodeType==1&&r.contentEditable=="false")break;t=r,e=t.childNodes.length;}}function op(t,e,r){if(e.nodeType!=3){let i,s;(s=dP(e,r))?(e=s,r=0):(i=uP(e,r))&&(e=i,r=i.nodeValue.length);}let n=t.domSelection();if(!n)return;if(lc(n)){let i=document.createRange();i.setEnd(e,r),i.setStart(e,r),n.removeAllRanges(),n.addRange(i);}else n.extend&&n.extend(e,r);t.domObserver.setCurSelection();let{state:o}=t;setTimeout(()=>{t.state==o&&Ln(t);},50);}function bw(t,e){let r=t.state.doc.resolve(e);if(!(qt||LD)&&r.parent.inlineContent){let o=t.coordsAtPos(e);if(e>r.start()){let i=t.coordsAtPos(e-1),s=(i.top+i.bottom)/2;if(s>o.top&&s<o.bottom&&Math.abs(i.left-o.left)>1)return i.left<o.left?"ltr":"rtl"}if(e<r.end()){let i=t.coordsAtPos(e+1),s=(i.top+i.bottom)/2;if(s>o.top&&s<o.bottom&&Math.abs(i.left-o.left)>1)return i.left>o.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function vw(t,e,r){let n=t.state.selection;if(n instanceof q&&!n.empty||r.indexOf("s")>-1||Tr&&r.indexOf("m")>-1)return !1;let{$from:o,$to:i}=n;if(!o.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let s=np(t.state,e);if(s&&s instanceof X)return ao(t,s)}if(!o.parent.inlineContent){let s=e<0?o:i,a=n instanceof Et?Z.near(s,e):Z.findFrom(s,e);return a?ao(t,a):!1}return !1}function yw(t,e){if(!(t.state.selection instanceof q))return !0;let{$head:r,$anchor:n,empty:o}=t.state.selection;if(!r.sameParent(n))return !0;if(!o)return !1;if(t.endOfTextblock(e>0?"forward":"backward"))return !0;let i=!r.textOffset&&(e<0?r.nodeBefore:r.nodeAfter);if(i&&!i.isText){let s=t.state.tr;return e<0?s.delete(r.pos-i.nodeSize,r.pos):s.delete(r.pos,r.pos+i.nodeSize),t.dispatch(s),!0}return !1}function ww(t,e,r){t.domObserver.stop(),e.contentEditable=r,t.domObserver.start();}function fP(t){if(!Qt||t.state.selection.$head.parentOffset>0)return !1;let{focusNode:e,focusOffset:r}=t.domSelectionRange();if(e&&e.nodeType==1&&r==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let n=e.firstChild;ww(t,n,"true"),setTimeout(()=>ww(t,n,"false"),20);}return !1}function pP(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function hP(t,e){let r=e.keyCode,n=pP(e);if(r==8||Tr&&r==72&&n=="c")return yw(t,-1)||Zi(t,-1);if(r==46&&!e.shiftKey||Tr&&r==68&&n=="c")return yw(t,1)||Zi(t,1);if(r==13||r==27)return !0;if(r==37||Tr&&r==66&&n=="c"){let o=r==37?bw(t,t.state.selection.from)=="ltr"?-1:1:-1;return gw(t,o,n)||Zi(t,o)}else if(r==39||Tr&&r==70&&n=="c"){let o=r==39?bw(t,t.state.selection.from)=="ltr"?1:-1:1;return gw(t,o,n)||Zi(t,o)}else {if(r==38||Tr&&r==80&&n=="c")return vw(t,-1,n)||Zi(t,-1);if(r==40||Tr&&r==78&&n=="c")return fP(t)||vw(t,1,n)||Zi(t,1);if(n==(Tr?"m":"c")&&(r==66||r==73||r==89||r==90))return !0}return !1}function hp(t,e){t.someProp("transformCopied",p=>{e=p(e,t);});let r=[],{content:n,openStart:o,openEnd:i}=e;for(;o>1&&i>1&&n.childCount==1&&n.firstChild.childCount==1;){o--,i--;let p=n.firstChild;r.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),n=p.content;}let s=t.someProp("clipboardSerializer")||Kr.fromSchema(t.state.schema),a=ex(),l=a.createElement("div");l.appendChild(s.serializeFragment(n,{document:a}));let c=l.firstChild,d,u=0;for(;c&&c.nodeType==1&&(d=Qw[c.nodeName.toLowerCase()]);){for(let p=d.length-1;p>=0;p--){let h=a.createElement(d[p]);for(;l.firstChild;)h.appendChild(l.firstChild);l.appendChild(h),u++;}c=l.firstChild;}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${o} ${i}${u?` -${u}`:""} ${JSON.stringify(r)}`);let f=t.someProp("clipboardTextSerializer",p=>p(e,t))||e.content.textBetween(0,e.content.size,`
|
|
100
|
+
|
|
101
|
+
`);return {dom:l,text:f,slice:e}}function Yw(t,e,r,n,o){let i=o.parent.type.spec.code,s,a;if(!r&&!e)return null;let l=e&&(n||i||!r);if(l){if(t.someProp("transformPastedText",f=>{e=f(e,i||n,t);}),i)return e?new H(O.from(t.state.schema.text(e.replace(/\r\n?/g,`
|
|
102
|
+
`))),0,0):H.empty;let u=t.someProp("clipboardTextParser",f=>f(e,o,n,t));if(u)a=u;else {let f=o.marks(),{schema:p}=t.state,h=Kr.fromSchema(p);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(m=>{let g=s.appendChild(document.createElement("p"));m&&g.appendChild(h.serializeNode(p.text(m,f)));});}}else t.someProp("transformPastedHTML",u=>{r=u(r,t);}),s=vP(r),ha&&yP(s);let c=s&&s.querySelector("[data-pm-slice]"),d=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(d&&d[3])for(let u=+d[3];u>0;u--){let f=s.firstChild;for(;f&&f.nodeType!=1;)f=f.nextSibling;if(!f)break;s=f;}if(a||(a=(t.someProp("clipboardParser")||t.someProp("domParser")||mr.fromSchema(t.state.schema)).parseSlice(s,{preserveWhitespace:!!(l||d),context:o,ruleFromNode(f){return f.nodeName=="BR"&&!f.nextSibling&&f.parentNode&&!mP.test(f.parentNode.nodeName)?{ignore:!0}:null}})),d)a=wP(xw(a,+d[1],+d[2]),d[4]);else if(a=H.maxOpen(gP(a.content,o),!0),a.openStart||a.openEnd){let u=0,f=0;for(let p=a.content.firstChild;u<a.openStart&&!p.type.spec.isolating;u++,p=p.firstChild);for(let p=a.content.lastChild;f<a.openEnd&&!p.type.spec.isolating;f++,p=p.lastChild);a=xw(a,u,f);}return t.someProp("transformPasted",u=>{a=u(a,t);}),a}var mP=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function gP(t,e){if(t.childCount<2)return t;for(let r=e.depth;r>=0;r--){let o=e.node(r).contentMatchAt(e.index(r)),i,s=[];if(t.forEach(a=>{if(!s)return;let l=o.findWrapping(a.type),c;if(!l)return s=null;if(c=s.length&&i.length&&Jw(l,i,a,s[s.length-1],0))s[s.length-1]=c;else {s.length&&(s[s.length-1]=Zw(s[s.length-1],i.length));let d=Xw(a,l);s.push(d),o=o.matchType(d.type),i=l;}}),s)return O.from(s)}return t}function Xw(t,e,r=0){for(let n=e.length-1;n>=r;n--)t=e[n].create(null,O.from(t));return t}function Jw(t,e,r,n,o){if(o<t.length&&o<e.length&&t[o]==e[o]){let i=Jw(t,e,r,n.lastChild,o+1);if(i)return n.copy(n.content.replaceChild(n.childCount-1,i));if(n.contentMatchAt(n.childCount).matchType(o==t.length-1?r.type:t[o+1]))return n.copy(n.content.append(O.from(Xw(r,t,o+1))))}}function Zw(t,e){if(e==0)return t;let r=t.content.replaceChild(t.childCount-1,Zw(t.lastChild,e-1)),n=t.contentMatchAt(t.childCount).fillBefore(O.empty,!0);return t.copy(r.append(n))}function ip(t,e,r,n,o,i){let s=e<0?t.firstChild:t.lastChild,a=s.content;return t.childCount>1&&(i=0),o<n-1&&(a=ip(a,e,r,n,o+1,i)),o>=r&&(a=e<0?s.contentMatchAt(0).fillBefore(a,i<=o).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(O.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(a))}function xw(t,e,r){return e<t.openStart&&(t=new H(ip(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),r<t.openEnd&&(t=new H(ip(t.content,1,r,t.openEnd,0,0),t.openStart,r)),t}var Qw={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]},Ew=null;function ex(){return Ew||(Ew=document.implementation.createHTMLDocument("title"))}var Wf=null;function bP(t){let e=window.trustedTypes;return e?(Wf||(Wf=e.defaultPolicy||e.createPolicy("ProseMirrorClipboard",{createHTML:r=>r})),Wf.createHTML(t)):t}function vP(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let r=ex().createElement("div"),n=/<([a-z][^>\s]+)/i.exec(t),o;if((o=n&&Qw[n[1].toLowerCase()])&&(t=o.map(i=>"<"+i+">").join("")+t+o.map(i=>"</"+i+">").reverse().join("")),r.innerHTML=bP(t),o)for(let i=0;i<o.length;i++)r=r.querySelector(o[i])||r;return r}function yP(t){let e=t.querySelectorAll(qt?"span:not([class]):not([style])":"span.Apple-converted-space");for(let r=0;r<e.length;r++){let n=e[r];n.childNodes.length==1&&n.textContent=="\xA0"&&n.parentNode&&n.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),n);}}function wP(t,e){if(!t.size)return t;let r=t.content.firstChild.type.schema,n;try{n=JSON.parse(e);}catch{return t}let{content:o,openStart:i,openEnd:s}=t;for(let a=n.length-2;a>=0;a-=2){let l=r.nodes[n[a]];if(!l||l.hasRequiredAttrs())break;o=O.from(l.create(n[a+1],o)),i++,s++;}return new H(o,i,s)}var er={},tr={},xP={touchstart:!0,touchmove:!0},sp=class{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null;}};function EP(t){for(let e in er){let r=er[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=n=>{SP(t,n)&&!mp(t,n)&&(t.editable||!(n.type in tr))&&r(t,n);},xP[e]?{passive:!0}:void 0);}Qt&&t.dom.addEventListener("input",()=>null),ap(t);}function lo(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now();}function kP(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout);}function ap(t){t.someProp("handleDOMEvents",e=>{for(let r in e)t.input.eventHandlers[r]||t.dom.addEventListener(r,t.input.eventHandlers[r]=n=>mp(t,n));});}function mp(t,e){return t.someProp("handleDOMEvents",r=>{let n=r[e.type];return n?n(t,e)||e.defaultPrevented:!1})}function SP(t,e){if(!e.bubbles)return !0;if(e.defaultPrevented)return !1;for(let r=e.target;r!=t.dom;r=r.parentNode)if(!r||r.nodeType==11||r.pmViewDesc&&r.pmViewDesc.stopEvent(e))return !1;return !0}function CP(t,e){!mp(t,e)&&er[e.type]&&(t.editable||!(e.type in tr))&&er[e.type](t,e);}tr.keydown=(t,e)=>{let r=e;if(t.input.shiftKey=r.keyCode==16||r.shiftKey,!rx(t,r)&&(t.input.lastKeyCode=r.keyCode,t.input.lastKeyCodeTime=Date.now(),!(In&&qt&&r.keyCode==13)))if(r.keyCode!=229&&t.domObserver.forceFlush(),rs&&r.keyCode==13&&!r.ctrlKey&&!r.altKey&&!r.metaKey){let n=Date.now();t.input.lastIOSEnter=n,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==n&&(t.someProp("handleKeyDown",o=>o(t,ti(13,"Enter"))),t.input.lastIOSEnter=0);},200);}else t.someProp("handleKeyDown",n=>n(t,r))||hP(t,r)?r.preventDefault():lo(t,"key");};tr.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1);};tr.keypress=(t,e)=>{let r=e;if(rx(t,r)||!r.charCode||r.ctrlKey&&!r.altKey||Tr&&r.metaKey)return;if(t.someProp("handleKeyPress",o=>o(t,r))){r.preventDefault();return}let n=t.state.selection;if(!(n instanceof q)||!n.$from.sameParent(n.$to)){let o=String.fromCharCode(r.charCode),i=()=>t.state.tr.insertText(o).scrollIntoView();!/[\r\n]/.test(o)&&!t.someProp("handleTextInput",s=>s(t,n.$from.pos,n.$to.pos,o,i))&&t.dispatch(i()),r.preventDefault();}};function cc(t){return {left:t.clientX,top:t.clientY}}function RP(t,e){let r=e.x-t.clientX,n=e.y-t.clientY;return r*r+n*n<100}function gp(t,e,r,n,o){if(n==-1)return !1;let i=t.state.doc.resolve(n);for(let s=i.depth+1;s>0;s--)if(t.someProp(e,a=>s>i.depth?a(t,r,i.nodeAfter,i.before(s),o,!0):a(t,r,i.node(s),i.before(s),o,!1)))return !0;return !1}function es(t,e,r){if(t.focused||t.focus(),t.state.selection.eq(e))return;let n=t.state.tr.setSelection(e);r=="pointer"&&n.setMeta("pointer",!0),t.dispatch(n);}function TP(t,e){if(e==-1)return !1;let r=t.state.doc.resolve(e),n=r.nodeAfter;return n&&n.isAtom&&X.isSelectable(n)?(es(t,new X(r),"pointer"),!0):!1}function NP(t,e){if(e==-1)return !1;let r=t.state.selection,n,o;r instanceof X&&(n=r.node);let i=t.state.doc.resolve(e);for(let s=i.depth+1;s>0;s--){let a=s>i.depth?i.nodeAfter:i.node(s);if(X.isSelectable(a)){n&&r.$from.depth>0&&s>=r.$from.depth&&i.before(r.$from.depth+1)==r.$from.pos?o=i.before(r.$from.depth):o=i.before(s);break}}return o!=null?(es(t,X.create(t.state.doc,o),"pointer"),!0):!1}function _P(t,e,r,n,o){return gp(t,"handleClickOn",e,r,n)||t.someProp("handleClick",i=>i(t,e,n))||(o?NP(t,r):TP(t,r))}function MP(t,e,r,n){return gp(t,"handleDoubleClickOn",e,r,n)||t.someProp("handleDoubleClick",o=>o(t,e,n))}function AP(t,e,r,n){return gp(t,"handleTripleClickOn",e,r,n)||t.someProp("handleTripleClick",o=>o(t,e,n))||OP(t,r,n)}function OP(t,e,r){if(r.button!=0)return !1;let n=t.state.doc;if(e==-1)return n.inlineContent?(es(t,q.create(n,0,n.content.size),"pointer"),!0):!1;let o=n.resolve(e);for(let i=o.depth+1;i>0;i--){let s=i>o.depth?o.nodeAfter:o.node(i),a=o.before(i);if(s.inlineContent)es(t,q.create(n,a+1,a+1+s.content.size),"pointer");else if(X.isSelectable(s))es(t,X.create(n,a),"pointer");else continue;return !0}}function bp(t){return ic(t)}var tx=Tr?"metaKey":"ctrlKey";er.mousedown=(t,e)=>{let r=e;t.input.shiftKey=r.shiftKey;let n=bp(t),o=Date.now(),i="singleClick";o-t.input.lastClick.time<500&&RP(r,t.input.lastClick)&&!r[tx]&&t.input.lastClick.button==r.button&&(t.input.lastClick.type=="singleClick"?i="doubleClick":t.input.lastClick.type=="doubleClick"&&(i="tripleClick")),t.input.lastClick={time:o,x:r.clientX,y:r.clientY,type:i,button:r.button};let s=t.posAtCoords(cc(r));s&&(i=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new lp(t,s,r,!!n)):(i=="doubleClick"?MP:AP)(t,s.pos,s.inside,r)?r.preventDefault():lo(t,"pointer"));};var lp=class{constructor(e,r,n,o){this.view=e,this.pos=r,this.event=n,this.flushed=o,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[tx],this.allowDefault=n.shiftKey;let i,s;if(r.inside>-1)i=e.state.doc.nodeAt(r.inside),s=r.inside;else {let d=e.state.doc.resolve(r.pos);i=d.parent,s=d.depth?d.before():0;}let a=o?null:n.target,l=a?e.docView.nearestDesc(a,!0):null;this.target=l&&l.dom.nodeType==1?l.dom:null;let{selection:c}=e.state;(n.button==0&&i.type.spec.draggable&&i.type.spec.selectable!==!1||c instanceof X&&c.from<=s&&c.to>s)&&(this.mightDrag={node:i,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Wr&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false");},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),lo(e,"pointer");}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>Ln(this.view)),this.view.input.mouseDown=null;}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let r=this.pos;this.view.state.doc!=this.startDoc&&(r=this.view.posAtCoords(cc(e))),this.updateAllowDefault(e),this.allowDefault||!r?lo(this.view,"pointer"):_P(this.view,r.pos,r.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Qt&&this.mightDrag&&!this.mightDrag.node.isAtom||qt&&!this.view.state.selection.visible&&Math.min(Math.abs(r.pos-this.view.state.selection.from),Math.abs(r.pos-this.view.state.selection.to))<=2)?(es(this.view,Z.near(this.view.state.doc.resolve(r.pos)),"pointer"),e.preventDefault()):lo(this.view,"pointer");}move(e){this.updateAllowDefault(e),lo(this.view,"pointer"),e.buttons==0&&this.done();}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0);}};er.touchstart=t=>{t.input.lastTouch=Date.now(),bp(t),lo(t,"pointer");};er.touchmove=t=>{t.input.lastTouch=Date.now(),lo(t,"pointer");};er.contextmenu=t=>bp(t);function rx(t,e){return t.composing?!0:Qt&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}var DP=In?5e3:-1;tr.compositionstart=tr.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,r=e.selection.$to;if(e.selection instanceof q&&(e.storedMarks||!r.textOffset&&r.parentOffset&&r.nodeBefore.marks.some(n=>n.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||r.marks(),ic(t,!0),t.markCursor=null;else if(ic(t,!e.selection.empty),Wr&&e.selection.empty&&r.parentOffset&&!r.textOffset&&r.nodeBefore.marks.length){let n=t.domSelectionRange();for(let o=n.focusNode,i=n.focusOffset;o&&o.nodeType==1&&i!=0;){let s=i<0?o.lastChild:o.childNodes[i-1];if(!s)break;if(s.nodeType==3){let a=t.domSelection();a&&a.collapse(s,s.nodeValue.length);break}else o=s,i=-1;}}t.input.composing=!0;}nx(t,DP);};tr.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,nx(t,20));};function nx(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>ic(t),e));}function ox(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=IP());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty();}function PP(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let r=AD(e.focusNode,e.focusOffset),n=OD(e.focusNode,e.focusOffset);if(r&&n&&r!=n){let o=n.pmViewDesc,i=t.domObserver.lastChangedTextNode;if(r==i||n==i)return i;if(!o||!o.isText(n.nodeValue))return n;if(t.input.compositionNode==n){let s=r.pmViewDesc;if(!(!s||!s.isText(r.nodeValue)))return n}}return r||n}function IP(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function ic(t,e=!1){if(!(In&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),ox(t),e||t.docView&&t.docView.dirty){let r=fp(t),n=t.state.selection;return r&&!r.eq(n)?t.dispatch(t.state.tr.setSelection(r)):(t.markCursor||e)&&!n.$from.node(n.$from.sharedDepth(n.to)).inlineContent?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return !1}}function LP(t,e){if(!t.dom.parentNode)return;let r=t.dom.parentNode.appendChild(document.createElement("div"));r.appendChild(e),r.style.cssText="position: fixed; left: -10000px; top: 10px";let n=getSelection(),o=document.createRange();o.selectNodeContents(e),t.dom.blur(),n.removeAllRanges(),n.addRange(o),setTimeout(()=>{r.parentNode&&r.parentNode.removeChild(r),t.focus();},50);}var la=cr&&co<15||rs&&$D<604;er.copy=tr.cut=(t,e)=>{let r=e,n=t.state.selection,o=r.type=="cut";if(n.empty)return;let i=la?null:r.clipboardData,s=n.content(),{dom:a,text:l}=hp(t,s);i?(r.preventDefault(),i.clearData(),i.setData("text/html",a.innerHTML),i.setData("text/plain",l)):LP(t,a),o&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"));};function $P(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function BP(t,e){if(!t.dom.parentNode)return;let r=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,n=t.dom.parentNode.appendChild(document.createElement(r?"textarea":"div"));r||(n.contentEditable="true"),n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus();let o=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),n.parentNode&&n.parentNode.removeChild(n),r?ca(t,n.value,null,o,e):ca(t,n.textContent,n.innerHTML,o,e);},50);}function ca(t,e,r,n,o){let i=Yw(t,e,r,n,t.state.selection.$from);if(t.someProp("handlePaste",l=>l(t,o,i||H.empty)))return !0;if(!i)return !1;let s=$P(i),a=s?t.state.tr.replaceSelectionWith(s,n):t.state.tr.replaceSelection(i);return t.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function ix(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let r=t.getData("text/uri-list");return r?r.replace(/\r?\n/g," "):""}tr.paste=(t,e)=>{let r=e;if(t.composing&&!In)return;let n=la?null:r.clipboardData,o=t.input.shiftKey&&t.input.lastKeyCode!=45;n&&ca(t,ix(n),n.getData("text/html"),o,r)?r.preventDefault():BP(t,r);};var sc=class{constructor(e,r,n){this.slice=e,this.move=r,this.node=n;}},FP=Tr?"altKey":"ctrlKey";function sx(t,e){let r=t.someProp("dragCopies",n=>!n(e));return r??!e[FP]}er.dragstart=(t,e)=>{let r=e,n=t.input.mouseDown;if(n&&n.done(),!r.dataTransfer)return;let o=t.state.selection,i=o.empty?null:t.posAtCoords(cc(r)),s;if(!(i&&i.pos>=o.from&&i.pos<=(o instanceof X?o.to-1:o.to))){if(n&&n.mightDrag)s=X.create(t.state.doc,n.mightDrag.pos);else if(r.target&&r.target.nodeType==1){let u=t.docView.nearestDesc(r.target,!0);u&&u.node.type.spec.draggable&&u!=t.docView&&(s=X.create(t.state.doc,u.posBefore));}}let a=(s||t.state.selection).content(),{dom:l,text:c,slice:d}=hp(t,a);(!r.dataTransfer.files.length||!qt||Iw>120)&&r.dataTransfer.clearData(),r.dataTransfer.setData(la?"Text":"text/html",l.innerHTML),r.dataTransfer.effectAllowed="copyMove",la||r.dataTransfer.setData("text/plain",c),t.dragging=new sc(d,sx(t,r),s);};er.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null);},50);};tr.dragover=tr.dragenter=(t,e)=>e.preventDefault();tr.drop=(t,e)=>{let r=e,n=t.dragging;if(t.dragging=null,!r.dataTransfer)return;let o=t.posAtCoords(cc(r));if(!o)return;let i=t.state.doc.resolve(o.pos),s=n&&n.slice;s?t.someProp("transformPasted",h=>{s=h(s,t);}):s=Yw(t,ix(r.dataTransfer),la?null:r.dataTransfer.getData("text/html"),!1,i);let a=!!(n&&sx(t,r));if(t.someProp("handleDrop",h=>h(t,r,s||H.empty,a))){r.preventDefault();return}if(!s)return;r.preventDefault();let l=s?Ql(t.state.doc,i.pos,s):i.pos;l==null&&(l=i.pos);let c=t.state.tr;if(a){let{node:h}=n;h?h.replace(c):c.deleteSelection();}let d=c.mapping.map(l),u=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,f=c.doc;if(u?c.replaceRangeWith(d,d,s.content.firstChild):c.replaceRange(d,d,s),c.doc.eq(f))return;let p=c.doc.resolve(d);if(u&&X.isSelectable(s.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new X(p));else {let h=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach((m,g,b,v)=>h=v),c.setSelection(pp(t,p,c.doc.resolve(h)));}t.focus(),t.dispatch(c.setMeta("uiEvent","drop"));};er.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&Ln(t);},20));};er.blur=(t,e)=>{let r=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),r.relatedTarget&&t.dom.contains(r.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1);};er.beforeinput=(t,e)=>{if(qt&&In&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:n}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=n||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",i=>i(t,ti(8,"Backspace")))))return;let{$cursor:o}=t.state.selection;o&&o.pos>0&&t.dispatch(t.state.tr.delete(o.pos-1,o.pos).scrollIntoView());},50);}};for(let t in tr)er[t]=tr[t];function da(t,e){if(t==e)return !0;for(let r in t)if(t[r]!==e[r])return !1;for(let r in e)if(!(r in t))return !1;return !0}var is=class{constructor(e,r){this.toDOM=e,this.spec=r||oi,this.side=this.spec.side||0;}map(e,r,n,o){let{pos:i,deleted:s}=e.mapResult(r.from+o,this.side<0?-1:1);return s?null:new Be(i-n,i-n,this)}valid(){return !0}eq(e){return this==e||e instanceof is&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&da(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e);}},an=class{constructor(e,r){this.attrs=e,this.spec=r||oi;}map(e,r,n,o){let i=e.map(r.from+o,this.spec.inclusiveStart?-1:1)-n,s=e.map(r.to+o,this.spec.inclusiveEnd?1:-1)-n;return i>=s?null:new Be(i,s,this)}valid(e,r){return r.from<r.to}eq(e){return this==e||e instanceof an&&da(this.attrs,e.attrs)&&da(this.spec,e.spec)}static is(e){return e.type instanceof an}destroy(){}},ua=class{constructor(e,r){this.attrs=e,this.spec=r||oi;}map(e,r,n,o){let i=e.mapResult(r.from+o,1);if(i.deleted)return null;let s=e.mapResult(r.to+o,-1);return s.deleted||s.pos<=i.pos?null:new Be(i.pos-n,s.pos-n,this)}valid(e,r){let{index:n,offset:o}=e.content.findIndex(r.from),i;return o==r.from&&!(i=e.child(n)).isText&&o+i.nodeSize==r.to}eq(e){return this==e||e instanceof ua&&da(this.attrs,e.attrs)&&da(this.spec,e.spec)}destroy(){}},Be=class{constructor(e,r,n){this.from=e,this.to=r,this.type=n;}copy(e,r){return new Be(e,r,this.type)}eq(e,r=0){return this.type.eq(e.type)&&this.from+r==e.from&&this.to+r==e.to}map(e,r,n){return this.type.map(e,this,r,n)}static widget(e,r,n){return new Be(e,e,new is(r,n))}static inline(e,r,n,o){return new Be(e,r,new an(n,o))}static node(e,r,n,o){return new Be(e,r,new ua(n,o))}get spec(){return this.type.spec}get inline(){return this.type instanceof an}get widget(){return this.type instanceof is}},Qi=[],oi={},Ee=class{constructor(e,r){this.local=e.length?e:Qi,this.children=r.length?r:Qi;}static create(e,r){return r.length?ac(r,e,0,oi):Gt}find(e,r,n){let o=[];return this.findInner(e??0,r??1e9,o,0,n),o}findInner(e,r,n,o,i){for(let s=0;s<this.local.length;s++){let a=this.local[s];a.from<=r&&a.to>=e&&(!i||i(a.spec))&&n.push(a.copy(a.from+o,a.to+o));}for(let s=0;s<this.children.length;s+=3)if(this.children[s]<r&&this.children[s+1]>e){let a=this.children[s]+1;this.children[s+2].findInner(e-a,r-a,n,o+a,i);}}map(e,r,n){return this==Gt||e.maps.length==0?this:this.mapInner(e,r,0,0,n||oi)}mapInner(e,r,n,o,i){let s;for(let a=0;a<this.local.length;a++){let l=this.local[a].map(e,n,o);l&&l.type.valid(r,l)?(s||(s=[])).push(l):i.onRemove&&i.onRemove(this.local[a].spec);}return this.children.length?zP(this.children,s||[],e,r,n,o,i):s?new Ee(s.sort(ii),Qi):Gt}add(e,r){return r.length?this==Gt?Ee.create(e,r):this.addInner(e,r,0):this}addInner(e,r,n){let o,i=0;e.forEach((a,l)=>{let c=l+n,d;if(d=lx(r,a,c)){for(o||(o=this.children.slice());i<o.length&&o[i]<l;)i+=3;o[i]==l?o[i+2]=o[i+2].addInner(a,d,c+1):o.splice(i,0,l,l+a.nodeSize,ac(d,a,c+1,oi)),i+=3;}});let s=ax(i?cx(r):r,-n);for(let a=0;a<s.length;a++)s[a].type.valid(e,s[a])||s.splice(a--,1);return new Ee(s.length?this.local.concat(s).sort(ii):this.local,o||this.children)}remove(e){return e.length==0||this==Gt?this:this.removeInner(e,0)}removeInner(e,r){let n=this.children,o=this.local;for(let i=0;i<n.length;i+=3){let s,a=n[i]+r,l=n[i+1]+r;for(let d=0,u;d<e.length;d++)(u=e[d])&&u.from>a&&u.to<l&&(e[d]=null,(s||(s=[])).push(u));if(!s)continue;n==this.children&&(n=this.children.slice());let c=n[i+2].removeInner(s,a+1);c!=Gt?n[i+2]=c:(n.splice(i,3),i-=3);}if(o.length){for(let i=0,s;i<e.length;i++)if(s=e[i])for(let a=0;a<o.length;a++)o[a].eq(s,r)&&(o==this.local&&(o=this.local.slice()),o.splice(a--,1));}return n==this.children&&o==this.local?this:o.length||n.length?new Ee(o,n):Gt}forChild(e,r){if(this==Gt)return this;if(r.isLeaf)return Ee.empty;let n,o;for(let a=0;a<this.children.length;a+=3)if(this.children[a]>=e){this.children[a]==e&&(n=this.children[a+2]);break}let i=e+1,s=i+r.content.size;for(let a=0;a<this.local.length;a++){let l=this.local[a];if(l.from<s&&l.to>i&&l.type instanceof an){let c=Math.max(i,l.from)-i,d=Math.min(s,l.to)-i;c<d&&(o||(o=[])).push(l.copy(c,d));}}if(o){let a=new Ee(o.sort(ii),Qi);return n?new on([a,n]):a}return n||Gt}eq(e){if(this==e)return !0;if(!(e instanceof Ee)||this.local.length!=e.local.length||this.children.length!=e.children.length)return !1;for(let r=0;r<this.local.length;r++)if(!this.local[r].eq(e.local[r]))return !1;for(let r=0;r<this.children.length;r+=3)if(this.children[r]!=e.children[r]||this.children[r+1]!=e.children[r+1]||!this.children[r+2].eq(e.children[r+2]))return !1;return !0}locals(e){return vp(this.localsInner(e))}localsInner(e){if(this==Gt)return Qi;if(e.inlineContent||!this.local.some(an.is))return this.local;let r=[];for(let n=0;n<this.local.length;n++)this.local[n].type instanceof an||r.push(this.local[n]);return r}forEachSet(e){e(this);}};Ee.empty=new Ee([],[]);Ee.removeOverlap=vp;var Gt=Ee.empty,on=class{constructor(e){this.members=e;}map(e,r){let n=this.members.map(o=>o.map(e,r,oi));return on.from(n)}forChild(e,r){if(r.isLeaf)return Ee.empty;let n=[];for(let o=0;o<this.members.length;o++){let i=this.members[o].forChild(e,r);i!=Gt&&(i instanceof on?n=n.concat(i.members):n.push(i));}return on.from(n)}eq(e){if(!(e instanceof on)||e.members.length!=this.members.length)return !1;for(let r=0;r<this.members.length;r++)if(!this.members[r].eq(e.members[r]))return !1;return !0}locals(e){let r,n=!0;for(let o=0;o<this.members.length;o++){let i=this.members[o].localsInner(e);if(i.length)if(!r)r=i;else {n&&(r=r.slice(),n=!1);for(let s=0;s<i.length;s++)r.push(i[s]);}}return r?vp(n?r:r.sort(ii)):Qi}static from(e){switch(e.length){case 0:return Gt;case 1:return e[0];default:return new on(e.every(r=>r instanceof Ee)?e:e.reduce((r,n)=>r.concat(n instanceof Ee?n:n.members),[]))}}forEachSet(e){for(let r=0;r<this.members.length;r++)this.members[r].forEachSet(e);}};function zP(t,e,r,n,o,i,s){let a=t.slice();for(let c=0,d=i;c<r.maps.length;c++){let u=0;r.maps[c].forEach((f,p,h,m)=>{let g=m-h-(p-f);for(let b=0;b<a.length;b+=3){let v=a[b+1];if(v<0||f>v+d-u)continue;let y=a[b]+d-u;p>=y?a[b+1]=f<=y?-2:-1:f>=d&&g&&(a[b]+=g,a[b+1]+=g);}u+=g;}),d=r.maps[c].map(d,-1);}let l=!1;for(let c=0;c<a.length;c+=3)if(a[c+1]<0){if(a[c+1]==-2){l=!0,a[c+1]=-1;continue}let d=r.map(t[c]+i),u=d-o;if(u<0||u>=n.content.size){l=!0;continue}let f=r.map(t[c+1]+i,-1),p=f-o,{index:h,offset:m}=n.content.findIndex(u),g=n.maybeChild(h);if(g&&m==u&&m+g.nodeSize==p){let b=a[c+2].mapInner(r,g,d+1,t[c]+i+1,s);b!=Gt?(a[c]=u,a[c+1]=p,a[c+2]=b):(a[c+1]=-2,l=!0);}else l=!0;}if(l){let c=HP(a,t,e,r,o,i,s),d=ac(c,n,0,s);e=d.local;for(let u=0;u<a.length;u+=3)a[u+1]<0&&(a.splice(u,3),u-=3);for(let u=0,f=0;u<d.children.length;u+=3){let p=d.children[u];for(;f<a.length&&a[f]<p;)f+=3;a.splice(f,0,d.children[u],d.children[u+1],d.children[u+2]);}}return new Ee(e.sort(ii),a)}function ax(t,e){if(!e||!t.length)return t;let r=[];for(let n=0;n<t.length;n++){let o=t[n];r.push(new Be(o.from+e,o.to+e,o.type));}return r}function HP(t,e,r,n,o,i,s){function a(l,c){for(let d=0;d<l.local.length;d++){let u=l.local[d].map(n,o,c);u?r.push(u):s.onRemove&&s.onRemove(l.local[d].spec);}for(let d=0;d<l.children.length;d+=3)a(l.children[d+2],l.children[d]+c+1);}for(let l=0;l<t.length;l+=3)t[l+1]==-1&&a(t[l+2],e[l]+i+1);return r}function lx(t,e,r){if(e.isLeaf)return null;let n=r+e.nodeSize,o=null;for(let i=0,s;i<t.length;i++)(s=t[i])&&s.from>r&&s.to<n&&((o||(o=[])).push(s),t[i]=null);return o}function cx(t){let e=[];for(let r=0;r<t.length;r++)t[r]!=null&&e.push(t[r]);return e}function ac(t,e,r,n){let o=[],i=!1;e.forEach((a,l)=>{let c=lx(t,a,l+r);if(c){i=!0;let d=ac(c,a,r+l+1,n);d!=Gt&&o.push(l,l+a.nodeSize,d);}});let s=ax(i?cx(t):t,-r).sort(ii);for(let a=0;a<s.length;a++)s[a].type.valid(e,s[a])||(n.onRemove&&n.onRemove(s[a].spec),s.splice(a--,1));return s.length||o.length?new Ee(s,o):Gt}function ii(t,e){return t.from-e.from||t.to-e.to}function vp(t){let e=t;for(let r=0;r<e.length-1;r++){let n=e[r];if(n.from!=n.to)for(let o=r+1;o<e.length;o++){let i=e[o];if(i.from==n.from){i.to!=n.to&&(e==t&&(e=t.slice()),e[o]=i.copy(i.from,n.to),kw(e,o+1,i.copy(n.to,i.to)));continue}else {i.from<n.to&&(e==t&&(e=t.slice()),e[r]=n.copy(n.from,i.from),kw(e,o,n.copy(i.from,n.to)));break}}}return e}function kw(t,e,r){for(;e<t.length&&ii(r,t[e])>0;)e++;t.splice(e,0,r);}function Gf(t){let e=[];return t.someProp("decorations",r=>{let n=r(t.state);n&&n!=Gt&&e.push(n);}),t.cursorWrapper&&e.push(Ee.create(t.state.doc,[t.cursorWrapper.deco])),on.from(e)}var UP={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},VP=cr&&co<=11,cp=class{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0;}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset;}clear(){this.anchorNode=this.focusNode=null;}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}},dp=class{constructor(e,r){this.view=e,this.handleDOMChange=r,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new cp,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(n=>{for(let o=0;o<n.length;o++)this.queue.push(n[o]);cr&&co<=11&&n.some(o=>o.type=="childList"&&o.removedNodes.length||o.type=="characterData"&&o.oldValue.length>o.target.nodeValue.length)?this.flushSoon():this.flush();}),VP&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon();}),this.onSelectionChange=this.onSelectionChange.bind(this);}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush();},20));}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush());}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,UP)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection();}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let r=0;r<e.length;r++)this.queue.push(e[r]);window.setTimeout(()=>this.flush(),20);}this.observer.disconnect();}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection();}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange);}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange);}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50);}onSelectionChange(){if(mw(this.view)){if(this.suppressingSelectionUpdates)return Ln(this.view);if(cr&&co<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&si(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush();}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange());}ignoreSelectionChange(e){if(!e.focusNode)return !0;let r=new Set,n;for(let i=e.focusNode;i;i=ts(i))r.add(i);for(let i=e.anchorNode;i;i=ts(i))if(r.has(i)){n=i;break}let o=n&&this.view.docView.nearestDesc(n);if(o&&o.ignoreMutation({type:"selection",target:n.nodeType==3?n.parentNode:n}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let r=this.pendingRecords();r.length&&(this.queue=[]);let n=e.domSelectionRange(),o=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&mw(e)&&!this.ignoreSelectionChange(n),i=-1,s=-1,a=!1,l=[];if(e.editable)for(let d=0;d<r.length;d++){let u=this.registerMutation(r[d],l);u&&(i=i<0?u.from:Math.min(u.from,i),s=s<0?u.to:Math.max(u.to,s),u.typeOver&&(a=!0));}if(Wr&&l.length){let d=l.filter(u=>u.nodeName=="BR");if(d.length==2){let[u,f]=d;u.parentNode&&u.parentNode.parentNode==f.parentNode?f.remove():u.remove();}else {let{focusNode:u}=this.currentSelection;for(let f of d){let p=f.parentNode;p&&p.nodeName=="LI"&&(!u||GP(e,u)!=p)&&f.remove();}}}let c=null;i<0&&o&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&lc(n)&&(c=fp(e))&&c.eq(Z.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Ln(e),this.currentSelection.set(n),e.scrollToSelection()):(i>-1||o)&&(i>-1&&(e.docView.markDirty(i,s),KP(e)),this.handleDOMChange(i,s,a,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||Ln(e),this.currentSelection.set(n));}registerMutation(e,r){if(r.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(n==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!n||n.ignoreMutation(e))return null;if(e.type=="childList"){for(let d=0;d<e.addedNodes.length;d++){let u=e.addedNodes[d];r.push(u),u.nodeType==3&&(this.lastChangedTextNode=u);}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return {from:n.posBefore,to:n.posAfter};let o=e.previousSibling,i=e.nextSibling;if(cr&&co<=11&&e.addedNodes.length)for(let d=0;d<e.addedNodes.length;d++){let{previousSibling:u,nextSibling:f}=e.addedNodes[d];(!u||Array.prototype.indexOf.call(e.addedNodes,u)<0)&&(o=u),(!f||Array.prototype.indexOf.call(e.addedNodes,f)<0)&&(i=f);}let s=o&&o.parentNode==e.target?Dt(o)+1:0,a=n.localPosFromDOM(e.target,s,-1),l=i&&i.parentNode==e.target?Dt(i):e.target.childNodes.length,c=n.localPosFromDOM(e.target,l,1);return {from:a,to:c}}else return e.type=="attributes"?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:(this.lastChangedTextNode=e.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}},Sw=new WeakMap,Cw=!1;function KP(t){if(!Sw.has(t)&&(Sw.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=Wr,Cw)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),Cw=!0;}}function Rw(t,e){let r=e.startContainer,n=e.startOffset,o=e.endContainer,i=e.endOffset,s=t.domAtPos(t.state.selection.anchor);return si(s.node,s.offset,o,i)&&([r,n,o,i]=[o,i,r,n]),{anchorNode:r,anchorOffset:n,focusNode:o,focusOffset:i}}function WP(t,e){if(e.getComposedRanges){let o=e.getComposedRanges(t.root)[0];if(o)return Rw(t,o)}let r;function n(o){o.preventDefault(),o.stopImmediatePropagation(),r=o.getTargetRanges()[0];}return t.dom.addEventListener("beforeinput",n,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",n,!0),r?Rw(t,r):null}function GP(t,e){for(let r=e.parentNode;r&&r!=t.dom;r=r.parentNode){let n=t.docView.nearestDesc(r,!0);if(n&&n.node.isBlock)return r}return null}function qP(t,e,r){let{node:n,fromOffset:o,toOffset:i,from:s,to:a}=t.docView.parseRange(e,r),l=t.domSelectionRange(),c,d=l.anchorNode;if(d&&t.dom.contains(d.nodeType==1?d:d.parentNode)&&(c=[{node:d,offset:l.anchorOffset}],lc(l)||c.push({node:l.focusNode,offset:l.focusOffset})),qt&&t.input.lastKeyCode===8)for(let g=i;g>o;g--){let b=n.childNodes[g-1],v=b.pmViewDesc;if(b.nodeName=="BR"&&!v){i=g;break}if(!v||v.size)break}let u=t.state.doc,f=t.someProp("domParser")||mr.fromSchema(t.state.schema),p=u.resolve(s),h=null,m=f.parse(n,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:o,to:i,preserveWhitespace:p.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:jP,context:p});if(c&&c[0].pos!=null){let g=c[0].pos,b=c[1]&&c[1].pos;b==null&&(b=g),h={anchor:g+s,head:b+s};}return {doc:m,sel:h,from:s,to:a}}function jP(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(Qt&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let r=document.createElement("div");return r.appendChild(document.createElement("li")),{skip:r}}else if(t.parentNode.lastChild==t||Qt&&/^(tr|table)$/i.test(t.parentNode.nodeName))return {ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return {ignore:!0};return null}var YP=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function XP(t,e,r,n,o){let i=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let w=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,N=fp(t,w);if(N&&!t.state.selection.eq(N)){if(qt&&In&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",B=>B(t,ti(13,"Enter"))))return;let M=t.state.tr.setSelection(N);w=="pointer"?M.setMeta("pointer",!0):w=="key"&&M.scrollIntoView(),i&&M.setMeta("composition",i),t.dispatch(M);}return}let s=t.state.doc.resolve(e),a=s.sharedDepth(r);e=s.before(a+1),r=t.state.doc.resolve(r).after(a+1);let l=t.state.selection,c=qP(t,e,r),d=t.state.doc,u=d.slice(c.from,c.to),f,p;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(f=t.state.selection.to,p="end"):(f=t.state.selection.from,p="start"),t.input.lastKeyCode=null;let h=QP(u.content,c.doc.content,c.from,f,p);if(h&&t.input.domChangeCount++,(rs&&t.input.lastIOSEnter>Date.now()-225||In)&&o.some(w=>w.nodeType==1&&!YP.test(w.nodeName))&&(!h||h.endA>=h.endB)&&t.someProp("handleKeyDown",w=>w(t,ti(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!h)if(n&&l instanceof q&&!l.empty&&l.$head.sameParent(l.$anchor)&&!t.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))h={start:l.from,endA:l.to,endB:l.to};else {if(c.sel){let w=Tw(t,t.state.doc,c.sel);if(w&&!w.eq(t.state.selection)){let N=t.state.tr.setSelection(w);i&&N.setMeta("composition",i),t.dispatch(N);}}return}t.state.selection.from<t.state.selection.to&&h.start==h.endB&&t.state.selection instanceof q&&(h.start>t.state.selection.from&&h.start<=t.state.selection.from+2&&t.state.selection.from>=c.from?h.start=t.state.selection.from:h.endA<t.state.selection.to&&h.endA>=t.state.selection.to-2&&t.state.selection.to<=c.to&&(h.endB+=t.state.selection.to-h.endA,h.endA=t.state.selection.to)),cr&&co<=11&&h.endB==h.start+1&&h.endA==h.start&&h.start>c.from&&c.doc.textBetween(h.start-c.from-1,h.start-c.from+1)==" \xA0"&&(h.start--,h.endA--,h.endB--);let m=c.doc.resolveNoCache(h.start-c.from),g=c.doc.resolveNoCache(h.endB-c.from),b=d.resolve(h.start),v=m.sameParent(g)&&m.parent.inlineContent&&b.end()>=h.endA,y;if((rs&&t.input.lastIOSEnter>Date.now()-225&&(!v||o.some(w=>w.nodeName=="DIV"||w.nodeName=="P"))||!v&&m.pos<c.doc.content.size&&(!m.sameParent(g)||!m.parent.inlineContent)&&!/\S/.test(c.doc.textBetween(m.pos,g.pos,"",""))&&(y=Z.findFrom(c.doc.resolve(m.pos+1),1,!0))&&y.head>m.pos)&&t.someProp("handleKeyDown",w=>w(t,ti(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>h.start&&ZP(d,h.start,h.endA,m,g)&&t.someProp("handleKeyDown",w=>w(t,ti(8,"Backspace")))){In&&qt&&t.domObserver.suppressSelectionUpdates();return}qt&&h.endB==h.start&&(t.input.lastChromeDelete=Date.now()),In&&!v&&m.start()!=g.start()&&g.parentOffset==0&&m.depth==g.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==h.endA&&(h.endB-=2,g=c.doc.resolveNoCache(h.endB-c.from),setTimeout(()=>{t.someProp("handleKeyDown",function(w){return w(t,ti(13,"Enter"))});},20));let x=h.start,E=h.endA,S=w=>{let N=w||t.state.tr.replace(x,E,c.doc.slice(h.start-c.from,h.endB-c.from));if(c.sel){let M=Tw(t,N.doc,c.sel);M&&!(qt&&t.composing&&M.empty&&(h.start!=h.endB||t.input.lastChromeDelete<Date.now()-100)&&(M.head==x||M.head==N.mapping.map(E)-1)||cr&&M.empty&&M.head==x)&&N.setSelection(M);}return i&&N.setMeta("composition",i),N.scrollIntoView()},R;if(v){if(m.pos==g.pos){cr&&co<=11&&m.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Ln(t),20));let w=S(t.state.tr.delete(x,E)),N=d.resolve(h.start).marksAcross(d.resolve(h.endA));N&&w.ensureMarks(N),t.dispatch(w);}else if(h.endA==h.endB&&(R=JP(m.parent.content.cut(m.parentOffset,g.parentOffset),b.parent.content.cut(b.parentOffset,h.endA-b.start())))){let w=S(t.state.tr);R.type=="add"?w.addMark(x,E,R.mark):w.removeMark(x,E,R.mark),t.dispatch(w);}else if(m.parent.child(m.index()).isText&&m.index()==g.index()-(g.textOffset?0:1)){let w=m.parent.textBetween(m.parentOffset,g.parentOffset),N=()=>S(t.state.tr.insertText(w,x,E));t.someProp("handleTextInput",M=>M(t,x,E,w,N))||t.dispatch(N());}}else t.dispatch(S());}function Tw(t,e,r){return Math.max(r.anchor,r.head)>e.content.size?null:pp(t,e.resolve(r.anchor),e.resolve(r.head))}function JP(t,e){let r=t.firstChild.marks,n=e.firstChild.marks,o=r,i=n,s,a,l;for(let d=0;d<n.length;d++)o=n[d].removeFromSet(o);for(let d=0;d<r.length;d++)i=r[d].removeFromSet(i);if(o.length==1&&i.length==0)a=o[0],s="add",l=d=>d.mark(a.addToSet(d.marks));else if(o.length==0&&i.length==1)a=i[0],s="remove",l=d=>d.mark(a.removeFromSet(d.marks));else return null;let c=[];for(let d=0;d<e.childCount;d++)c.push(l(e.child(d)));if(O.from(c).eq(t))return {mark:a,type:s}}function ZP(t,e,r,n,o){if(r-e<=o.pos-n.pos||qf(n,!0,!1)<o.pos)return !1;let i=t.resolve(e);if(!n.parent.isTextblock){let a=i.nodeAfter;return a!=null&&r==e+a.nodeSize}if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return !1;let s=t.resolve(qf(i,!0,!0));return !s.parent.isTextblock||s.pos>r||qf(s,!0,!1)<r?!1:n.parent.content.cut(n.parentOffset).eq(s.parent.content)}function qf(t,e,r){let n=t.depth,o=e?t.end():t.pos;for(;n>0&&(e||t.indexAfter(n)==t.node(n).childCount);)n--,o++,e=!1;if(r){let i=t.node(n).maybeChild(t.indexAfter(n));for(;i&&!i.isLeaf;)i=i.firstChild,o++;}return o}function QP(t,e,r,n,o){let i=t.findDiffStart(e,r);if(i==null)return null;let{a:s,b:a}=t.findDiffEnd(e,r+t.size,r+e.size);if(o=="end"){let l=Math.max(0,i-Math.min(s,a));n-=s+l-i;}if(s<i&&t.size<e.size){let l=n<=i&&n>=s?i-n:0;i-=l,i&&i<e.size&&Nw(e.textBetween(i-1,i+1))&&(i+=l?1:-1),a=i+(a-s),s=i;}else if(a<i){let l=n<=i&&n>=a?i-n:0;i-=l,i&&i<t.size&&Nw(t.textBetween(i-1,i+1))&&(i+=l?1:-1),s=i+(s-a),a=i;}return {start:i,endA:s,endB:a}}function Nw(t){if(t.length!=2)return !1;let e=t.charCodeAt(0),r=t.charCodeAt(1);return e>=56320&&e<=57343&&r>=55296&&r<=56319}var fa=class{constructor(e,r){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new sp,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=r,this.state=r.state,this.directPlugins=r.plugins||[],this.directPlugins.forEach(Dw),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=Aw(this),Mw(this),this.nodeViews=Ow(this),this.docView=cw(this.state.doc,_w(this),Gf(this),this.dom,this),this.domObserver=new dp(this,(n,o,i,s)=>XP(this,n,o,i,s)),this.domObserver.start(),EP(this),this.updatePluginViews();}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let r in e)this._props[r]=e[r];this._props.state=this.state;}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&ap(this);let r=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Dw),this.directPlugins=e.plugins),this.updateStateInner(e.state,r);}setProps(e){let r={};for(let n in this._props)r[n]=this._props[n];r.state=this.state;for(let n in e)r[n]=e[n];this.update(r);}updateState(e){this.updateStateInner(e,this._props);}updateStateInner(e,r){var n;let o=this.state,i=!1,s=!1;e.storedMarks&&this.composing&&(ox(this),s=!0),this.state=e;let a=o.plugins!=e.plugins||this._props.plugins!=r.plugins;if(a||this._props.plugins!=r.plugins||this._props.nodeViews!=r.nodeViews){let p=Ow(this);t2(p,this.nodeViews)&&(this.nodeViews=p,i=!0);}(a||r.handleDOMEvents!=this._props.handleDOMEvents)&&ap(this),this.editable=Aw(this),Mw(this);let l=Gf(this),c=_w(this),d=o.plugins!=e.plugins&&!o.doc.eq(e.doc)?"reset":e.scrollToSelection>o.scrollToSelection?"to selection":"preserve",u=i||!this.docView.matchesNode(e.doc,c,l);(u||!e.selection.eq(o.selection))&&(s=!0);let f=d=="preserve"&&s&&this.dom.style.overflowAnchor==null&&zD(this);if(s){this.domObserver.stop();let p=u&&(cr||qt)&&!this.composing&&!o.selection.empty&&!e.selection.empty&&e2(o.selection,e.selection);if(u){let h=qt?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=PP(this)),(i||!this.docView.update(e.doc,c,l,this))&&(this.docView.updateOuterDeco(c),this.docView.destroy(),this.docView=cw(e.doc,c,l,this.dom,this)),h&&!this.trackWrites&&(p=!0);}p||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&aP(this))?Ln(this,p):(Gw(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start();}this.updatePluginViews(o),!((n=this.dragging)===null||n===void 0)&&n.node&&!o.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,o),d=="reset"?this.dom.scrollTop=0:d=="to selection"?this.scrollToSelection():f&&HD(f);}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))){if(!this.someProp("handleScrollToSelection",r=>r(this)))if(this.state.selection instanceof X){let r=this.docView.domAfterPos(this.state.selection.from);r.nodeType==1&&nw(this,r.getBoundingClientRect(),e);}else nw(this,this.coordsAtPos(this.state.selection.head,1),e);}}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy();}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let r=0;r<this.directPlugins.length;r++){let n=this.directPlugins[r];n.spec.view&&this.pluginViews.push(n.spec.view(this));}for(let r=0;r<this.state.plugins.length;r++){let n=this.state.plugins[r];n.spec.view&&this.pluginViews.push(n.spec.view(this));}}else for(let r=0;r<this.pluginViews.length;r++){let n=this.pluginViews[r];n.update&&n.update(this,e);}}updateDraggedNode(e,r){let n=e.node,o=-1;if(this.state.doc.nodeAt(n.from)==n.node)o=n.from;else {let i=n.from+(this.state.doc.content.size-r.doc.content.size);(i>0&&this.state.doc.nodeAt(i))==n.node&&(o=i);}this.dragging=new sc(e.slice,e.move,o<0?void 0:X.create(this.state.doc,o));}someProp(e,r){let n=this._props&&this._props[e],o;if(n!=null&&(o=r?r(n):n))return o;for(let s=0;s<this.directPlugins.length;s++){let a=this.directPlugins[s].props[e];if(a!=null&&(o=r?r(a):a))return o}let i=this.state.plugins;if(i)for(let s=0;s<i.length;s++){let a=i[s].props[e];if(a!=null&&(o=r?r(a):a))return o}}hasFocus(){if(cr){let e=this.root.activeElement;if(e==this.dom)return !0;if(!e||!this.dom.contains(e))return !1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return !1;e=e.parentElement;}return !0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&UD(this.dom),Ln(this),this.domObserver.start();}get root(){let e=this._root;if(e==null){for(let r=this.dom.parentNode;r;r=r.parentNode)if(r.nodeType==9||r.nodeType==11&&r.host)return r.getSelection||(Object.getPrototypeOf(r).getSelection=()=>r.ownerDocument.getSelection()),this._root=r}return e||document}updateRoot(){this._root=null;}posAtCoords(e){return qD(this,e)}coordsAtPos(e,r=1){return zw(this,e,r)}domAtPos(e,r=0){return this.docView.domFromPos(e,r)}nodeDOM(e){let r=this.docView.descAt(e);return r?r.nodeDOM:null}posAtDOM(e,r,n=-1){let o=this.docView.posFromDOM(e,r,n);if(o==null)throw new RangeError("DOM position not inside the editor");return o}endOfTextblock(e,r){return ZD(this,r||this.state,e)}pasteHTML(e,r){return ca(this,"",e,!1,r||new ClipboardEvent("paste"))}pasteText(e,r){return ca(this,e,null,!0,r||new ClipboardEvent("paste"))}serializeForClipboard(e){return hp(this,e)}destroy(){this.docView&&(kP(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Gf(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,_D());}get isDestroyed(){return this.docView==null}dispatchEvent(e){return CP(this,e)}domSelectionRange(){let e=this.domSelection();return e?Qt&&this.root.nodeType===11&&PD(this.dom.ownerDocument)==this.dom&&WP(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}};fa.prototype.dispatch=function(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t));};function _w(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",r=>{if(typeof r=="function"&&(r=r(t.state)),r)for(let n in r)n=="class"?e.class+=" "+r[n]:n=="style"?e.style=(e.style?e.style+";":"")+r[n]:!e[n]&&n!="contenteditable"&&n!="nodeName"&&(e[n]=String(r[n]));}),e.translate||(e.translate="no"),[Be.node(0,t.state.doc.content.size,e)]}function Mw(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:Be.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})};}else t.cursorWrapper=null;}function Aw(t){return !t.someProp("editable",e=>e(t.state)===!1)}function e2(t,e){let r=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(r)!=e.$anchor.start(r)}function Ow(t){let e=Object.create(null);function r(n){for(let o in n)Object.prototype.hasOwnProperty.call(e,o)||(e[o]=n[o]);}return t.someProp("nodeViews",r),t.someProp("markViews",r),e}function t2(t,e){let r=0,n=0;for(let o in t){if(t[o]!=e[o])return !0;r++;}for(let o in e)n++;return r!=n}function Dw(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var Bn={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},uc={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},r2=typeof navigator<"u"&&/Mac/.test(navigator.platform),n2=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(bt=0;bt<10;bt++)Bn[48+bt]=Bn[96+bt]=String(bt);var bt;for(bt=1;bt<=24;bt++)Bn[bt+111]="F"+bt;var bt;for(bt=65;bt<=90;bt++)Bn[bt]=String.fromCharCode(bt+32),uc[bt]=String.fromCharCode(bt);var bt;for(dc in Bn)uc.hasOwnProperty(dc)||(uc[dc]=Bn[dc]);var dc;function dx(t){var e=r2&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||n2&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",r=!e&&t.key||(t.shiftKey?uc:Bn)[t.keyCode]||t.key||"Unidentified";return r=="Esc"&&(r="Escape"),r=="Del"&&(r="Delete"),r=="Left"&&(r="ArrowLeft"),r=="Up"&&(r="ArrowUp"),r=="Right"&&(r="ArrowRight"),r=="Down"&&(r="ArrowDown"),r}var o2=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),i2=typeof navigator<"u"&&/Win/.test(navigator.platform);function s2(t){let e=t.split(/-(?!$)/),r=e[e.length-1];r=="Space"&&(r=" ");let n,o,i,s;for(let a=0;a<e.length-1;a++){let l=e[a];if(/^(cmd|meta|m)$/i.test(l))s=!0;else if(/^a(lt)?$/i.test(l))n=!0;else if(/^(c|ctrl|control)$/i.test(l))o=!0;else if(/^s(hift)?$/i.test(l))i=!0;else if(/^mod$/i.test(l))o2?s=!0:o=!0;else throw new Error("Unrecognized modifier name: "+l)}return n&&(r="Alt-"+r),o&&(r="Ctrl-"+r),s&&(r="Meta-"+r),i&&(r="Shift-"+r),r}function a2(t){let e=Object.create(null);for(let r in t)e[s2(r)]=t[r];return e}function yp(t,e,r=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),r&&e.shiftKey&&(t="Shift-"+t),t}function ux(t){return new oe({props:{handleKeyDown:ma(t)}})}function ma(t){let e=a2(t);return function(r,n){let o=dx(n),i,s=e[yp(o,n)];if(s&&s(r.state,r.dispatch,r))return !0;if(o.length==1&&o!=" "){if(n.shiftKey){let a=e[yp(o,n,!1)];if(a&&a(r.state,r.dispatch,r))return !0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(i2&&n.ctrlKey&&n.altKey)&&(i=Bn[n.keyCode])&&i!=o){let a=e[yp(i,n)];if(a&&a(r.state,r.dispatch,r))return !0}}return !1}}var fc=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function px(t,e){let{$cursor:r}=t.selection;return !r||(e?!e.endOfTextblock("backward",t):r.parentOffset>0)?null:r}var xp=(t,e,r)=>{let n=px(t,r);if(!n)return !1;let o=kp(n);if(!o){let s=n.blockRange(),a=s&&An(s);return a==null?!1:(e&&e(t.tr.lift(s,a).scrollIntoView()),!0)}let i=o.nodeBefore;if(Ex(t,o,e,-1))return !0;if(n.parent.content.size==0&&(ss(i,"end")||X.isSelectable(i)))for(let s=n.depth;;s--){let a=ra(t.doc,n.before(s),n.after(s),H.empty);if(a&&a.slice.size<a.to-a.from){if(e){let l=t.tr.step(a);l.setSelection(ss(i,"end")?Z.findFrom(l.doc.resolve(l.mapping.map(o.pos,-1)),-1):X.create(l.doc,o.pos-i.nodeSize)),e(l.scrollIntoView());}return !0}if(s==1||n.node(s-1).childCount>1)break}return i.isAtom&&o.depth==n.depth-1?(e&&e(t.tr.delete(o.pos-i.nodeSize,o.pos).scrollIntoView()),!0):!1},hx=(t,e,r)=>{let n=px(t,r);if(!n)return !1;let o=kp(n);return o?gx(t,o,e):!1},mx=(t,e,r)=>{let n=bx(t,r);if(!n)return !1;let o=Rp(n);return o?gx(t,o,e):!1};function gx(t,e,r){let n=e.nodeBefore,o=n,i=e.pos-1;for(;!o.isTextblock;i--){if(o.type.spec.isolating)return !1;let d=o.lastChild;if(!d)return !1;o=d;}let s=e.nodeAfter,a=s,l=e.pos+1;for(;!a.isTextblock;l++){if(a.type.spec.isolating)return !1;let d=a.firstChild;if(!d)return !1;a=d;}let c=ra(t.doc,i,l,H.empty);if(!c||c.from!=i||c instanceof et&&c.slice.size>=l-i)return !1;if(r){let d=t.tr.step(c);d.setSelection(q.create(d.doc,i)),r(d.scrollIntoView());}return !0}function ss(t,e,r=!1){for(let n=t;n;n=e=="start"?n.firstChild:n.lastChild){if(n.isTextblock)return !0;if(r&&n.childCount!=1)return !1}return !1}var Ep=(t,e,r)=>{let{$head:n,empty:o}=t.selection,i=n;if(!o)return !1;if(n.parent.isTextblock){if(r?!r.endOfTextblock("backward",t):n.parentOffset>0)return !1;i=kp(n);}let s=i&&i.nodeBefore;return !s||!X.isSelectable(s)?!1:(e&&e(t.tr.setSelection(X.create(t.doc,i.pos-s.nodeSize)).scrollIntoView()),!0)};function kp(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function bx(t,e){let{$cursor:r}=t.selection;return !r||(e?!e.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)?null:r}var Sp=(t,e,r)=>{let n=bx(t,r);if(!n)return !1;let o=Rp(n);if(!o)return !1;let i=o.nodeAfter;if(Ex(t,o,e,1))return !0;if(n.parent.content.size==0&&(ss(i,"start")||X.isSelectable(i))){let s=ra(t.doc,n.before(),n.after(),H.empty);if(s&&s.slice.size<s.to-s.from){if(e){let a=t.tr.step(s);a.setSelection(ss(i,"start")?Z.findFrom(a.doc.resolve(a.mapping.map(o.pos)),1):X.create(a.doc,a.mapping.map(o.pos))),e(a.scrollIntoView());}return !0}}return i.isAtom&&o.depth==n.depth-1?(e&&e(t.tr.delete(o.pos,o.pos+i.nodeSize).scrollIntoView()),!0):!1},Cp=(t,e,r)=>{let{$head:n,empty:o}=t.selection,i=n;if(!o)return !1;if(n.parent.isTextblock){if(r?!r.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)return !1;i=Rp(n);}let s=i&&i.nodeAfter;return !s||!X.isSelectable(s)?!1:(e&&e(t.tr.setSelection(X.create(t.doc,i.pos)).scrollIntoView()),!0)};function Rp(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let r=t.node(e);if(t.index(e)+1<r.childCount)return t.doc.resolve(t.after(e+1));if(r.type.spec.isolating)break}return null}var vx=(t,e)=>{let r=t.selection,n=r instanceof X,o;if(n){if(r.node.isTextblock||!Rr(t.doc,r.from))return !1;o=r.from;}else if(o=Qo(t.doc,r.from,-1),o==null)return !1;if(e){let i=t.tr.join(o);n&&i.setSelection(X.create(i.doc,o-t.doc.resolve(o).nodeBefore.nodeSize)),e(i.scrollIntoView());}return !0},yx=(t,e)=>{let r=t.selection,n;if(r instanceof X){if(r.node.isTextblock||!Rr(t.doc,r.to))return !1;n=r.to;}else if(n=Qo(t.doc,r.to,1),n==null)return !1;return e&&e(t.tr.join(n).scrollIntoView()),!0},wx=(t,e)=>{let{$from:r,$to:n}=t.selection,o=r.blockRange(n),i=o&&An(o);return i==null?!1:(e&&e(t.tr.lift(o,i).scrollIntoView()),!0)},Tp=(t,e)=>{let{$head:r,$anchor:n}=t.selection;return !r.parent.type.spec.code||!r.sameParent(n)?!1:(e&&e(t.tr.insertText(`
|
|
103
|
+
`).scrollIntoView()),!0)};function Np(t){for(let e=0;e<t.edgeCount;e++){let{type:r}=t.edge(e);if(r.isTextblock&&!r.hasRequiredAttrs())return r}return null}var _p=(t,e)=>{let{$head:r,$anchor:n}=t.selection;if(!r.parent.type.spec.code||!r.sameParent(n))return !1;let o=r.node(-1),i=r.indexAfter(-1),s=Np(o.contentMatchAt(i));if(!s||!o.canReplaceWith(i,i,s))return !1;if(e){let a=r.after(),l=t.tr.replaceWith(a,a,s.createAndFill());l.setSelection(Z.near(l.doc.resolve(a),1)),e(l.scrollIntoView());}return !0},Mp=(t,e)=>{let r=t.selection,{$from:n,$to:o}=r;if(r instanceof Et||n.parent.inlineContent||o.parent.inlineContent)return !1;let i=Np(o.parent.contentMatchAt(o.indexAfter()));if(!i||!i.isTextblock)return !1;if(e){let s=(!n.parentOffset&&o.index()<o.parent.childCount?n:o).pos,a=t.tr.insert(s,i.createAndFill());a.setSelection(q.create(a.doc,s+1)),e(a.scrollIntoView());}return !0},Ap=(t,e)=>{let{$cursor:r}=t.selection;if(!r||r.parent.content.size)return !1;if(r.depth>1&&r.after()!=r.end(-1)){let i=r.before();if(gr(t.doc,i))return e&&e(t.tr.split(i).scrollIntoView()),!0}let n=r.blockRange(),o=n&&An(n);return o==null?!1:(e&&e(t.tr.lift(n,o).scrollIntoView()),!0)};var xx=(t,e)=>{let{$from:r,to:n}=t.selection,o,i=r.sharedDepth(n);return i==0?!1:(o=r.before(i),e&&e(t.tr.setSelection(X.create(t.doc,o))),!0)};function u2(t,e,r){let n=e.nodeBefore,o=e.nodeAfter,i=e.index();return !n||!o||!n.type.compatibleContent(o.type)?!1:!n.content.size&&e.parent.canReplace(i-1,i)?(r&&r(t.tr.delete(e.pos-n.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(i,i+1)||!(o.isTextblock||Rr(t.doc,e.pos))?!1:(r&&r(t.tr.join(e.pos).scrollIntoView()),!0)}function Ex(t,e,r,n){let o=e.nodeBefore,i=e.nodeAfter,s,a,l=o.type.spec.isolating||i.type.spec.isolating;if(!l&&u2(t,e,r))return !0;let c=!l&&e.parent.canReplace(e.index(),e.index()+1);if(c&&(s=(a=o.contentMatchAt(o.childCount)).findWrapping(i.type))&&a.matchType(s[0]||i.type).validEnd){if(r){let p=e.pos+i.nodeSize,h=O.empty;for(let b=s.length-1;b>=0;b--)h=O.from(s[b].create(null,h));h=O.from(o.copy(h));let m=t.tr.step(new Ye(e.pos-1,p,e.pos,p,new H(h,1,0),s.length,!0)),g=m.doc.resolve(p+2*s.length);g.nodeAfter&&g.nodeAfter.type==o.type&&Rr(m.doc,g.pos)&&m.join(g.pos),r(m.scrollIntoView());}return !0}let d=i.type.spec.isolating||n>0&&l?null:Z.findFrom(e,1),u=d&&d.$from.blockRange(d.$to),f=u&&An(u);if(f!=null&&f>=e.depth)return r&&r(t.tr.lift(u,f).scrollIntoView()),!0;if(c&&ss(i,"start",!0)&&ss(o,"end")){let p=o,h=[];for(;h.push(p),!p.isTextblock;)p=p.lastChild;let m=i,g=1;for(;!m.isTextblock;m=m.firstChild)g++;if(p.canReplace(p.childCount,p.childCount,m.content)){if(r){let b=O.empty;for(let y=h.length-1;y>=0;y--)b=O.from(h[y].copy(b));let v=t.tr.step(new Ye(e.pos-h.length,e.pos+i.nodeSize,e.pos+g,e.pos+i.nodeSize-g,new H(b,h.length,0),0,!0));r(v.scrollIntoView());}return !0}}return !1}function kx(t){return function(e,r){let n=e.selection,o=t<0?n.$from:n.$to,i=o.depth;for(;o.node(i).isInline;){if(!i)return !1;i--;}return o.node(i).isTextblock?(r&&r(e.tr.setSelection(q.create(e.doc,t<0?o.start(i):o.end(i)))),!0):!1}}var Op=kx(-1),Dp=kx(1);function Sx(t,e=null){return function(r,n){let{$from:o,$to:i}=r.selection,s=o.blockRange(i),a=s&&qi(s,t,e);return a?(n&&n(r.tr.wrap(s,a).scrollIntoView()),!0):!1}}function Pp(t,e=null){return function(r,n){let o=!1;for(let i=0;i<r.selection.ranges.length&&!o;i++){let{$from:{pos:s},$to:{pos:a}}=r.selection.ranges[i];r.doc.nodesBetween(s,a,(l,c)=>{if(o)return !1;if(!(!l.isTextblock||l.hasMarkup(t,e)))if(l.type==t)o=!0;else {let d=r.doc.resolve(c),u=d.index();o=d.parent.canReplaceWith(u,u+1,t);}});}if(!o)return !1;if(n){let i=r.tr;for(let s=0;s<r.selection.ranges.length;s++){let{$from:{pos:a},$to:{pos:l}}=r.selection.ranges[s];i.setBlockType(a,l,t,e);}n(i.scrollIntoView());}return !0}}typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform?os.platform()=="darwin":!1;function Cx(t,e=null){return function(r,n){let{$from:o,$to:i}=r.selection,s=o.blockRange(i);if(!s)return !1;let a=n?r.tr:null;return p2(a,s,t,e)?(n&&n(a.scrollIntoView()),!0):!1}}function p2(t,e,r,n=null){let o=!1,i=e,s=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(r)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return !1;let l=s.resolve(e.start-2);i=new Xo(l,l,e.depth),e.endIndex<e.parent.childCount&&(e=new Xo(e.$from,s.resolve(e.$to.end(e.depth)),e.depth)),o=!0;}let a=qi(i,r,n,e);return a?(t&&h2(t,e,a,o,r),!0):!1}function h2(t,e,r,n,o){let i=O.empty;for(let d=r.length-1;d>=0;d--)i=O.from(r[d].type.create(r[d].attrs,i));t.step(new Ye(e.start-(n?2:0),e.end,e.start,e.end,new H(i,0,0),r.length,!0));let s=0;for(let d=0;d<r.length;d++)r[d].type==o&&(s=d+1);let a=r.length-s,l=e.start+r.length-(n?2:0),c=e.parent;for(let d=e.startIndex,u=e.endIndex,f=!0;d<u;d++,f=!1)!f&&gr(t.doc,l,a)&&(t.split(l,a),l+=2*a),l+=c.child(d).nodeSize;return t}function Rx(t){return function(e,r){let{$from:n,$to:o}=e.selection,i=n.blockRange(o,s=>s.childCount>0&&s.firstChild.type==t);return i?r?n.node(i.depth-1).type==t?m2(e,r,t,i):g2(e,r,i):!0:!1}}function m2(t,e,r,n){let o=t.tr,i=n.end,s=n.$to.end(n.depth);i<s&&(o.step(new Ye(i-1,s,i,s,new H(O.from(r.create(null,n.parent.copy())),1,0),1,!0)),n=new Xo(o.doc.resolve(n.$from.pos),o.doc.resolve(s),n.depth));let a=An(n);if(a==null)return !1;o.lift(n,a);let l=o.doc.resolve(o.mapping.map(i,-1)-1);return Rr(o.doc,l.pos)&&l.nodeBefore.type==l.nodeAfter.type&&o.join(l.pos),e(o.scrollIntoView()),!0}function g2(t,e,r){let n=t.tr,o=r.parent;for(let p=r.end,h=r.endIndex-1,m=r.startIndex;h>m;h--)p-=o.child(h).nodeSize,n.delete(p-1,p+1);let i=n.doc.resolve(r.start),s=i.nodeAfter;if(n.mapping.map(r.end)!=r.start+i.nodeAfter.nodeSize)return !1;let a=r.startIndex==0,l=r.endIndex==o.childCount,c=i.node(-1),d=i.index(-1);if(!c.canReplace(d+(a?0:1),d+1,s.content.append(l?O.empty:O.from(o))))return !1;let u=i.pos,f=u+s.nodeSize;return n.step(new Ye(u-(a?1:0),f+(l?1:0),u+1,f-1,new H((a?O.empty:O.from(o.copy(O.empty))).append(l?O.empty:O.from(o.copy(O.empty))),a?0:1,l?0:1),a?0:1)),e(n.scrollIntoView()),!0}function Tx(t){return function(e,r){let{$from:n,$to:o}=e.selection,i=n.blockRange(o,c=>c.childCount>0&&c.firstChild.type==t);if(!i)return !1;let s=i.startIndex;if(s==0)return !1;let a=i.parent,l=a.child(s-1);if(l.type!=t)return !1;if(r){let c=l.lastChild&&l.lastChild.type==a.type,d=O.from(c?t.create():null),u=new H(O.from(t.create(null,O.from(a.type.create(null,d)))),c?3:1,0),f=i.start,p=i.end;r(e.tr.step(new Ye(f-(c?3:1),p,f,p,u,1,!0)).scrollIntoView());}return !0}}var b2=Object.defineProperty,Ix=(t,e)=>{for(var r in e)b2(t,r,{get:e[r],enumerable:!0});};function wc(t){let{state:e,transaction:r}=t,{selection:n}=r,{doc:o}=r,{storedMarks:i}=r;return {...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return i},get selection(){return n},get doc(){return o},get tr(){return n=r.selection,o=r.doc,i=r.storedMarks,r}}}var xc=class{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state;}get hasCustomState(){return !!this.customState}get state(){return this.customState||this.editor.state}get commands(){let{rawCommands:t,editor:e,state:r}=this,{view:n}=e,{tr:o}=r,i=this.buildProps(o);return Object.fromEntries(Object.entries(t).map(([s,a])=>[s,(...c)=>{let d=a(...c)(i);return !o.getMeta("preventDispatch")&&!this.hasCustomState&&n.dispatch(o),d}]))}get chain(){return ()=>this.createChain()}get can(){return ()=>this.createCan()}createChain(t,e=!0){let{rawCommands:r,editor:n,state:o}=this,{view:i}=n,s=[],a=!!t,l=t||o.tr,c=()=>(!a&&e&&!l.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(l),s.every(u=>u===!0)),d={...Object.fromEntries(Object.entries(r).map(([u,f])=>[u,(...h)=>{let m=this.buildProps(l,e),g=f(...h)(m);return s.push(g),d}])),run:c};return d}createCan(t){let{rawCommands:e,state:r}=this,n=!1,o=t||r.tr,i=this.buildProps(o,n);return {...Object.fromEntries(Object.entries(e).map(([a,l])=>[a,(...c)=>l(...c)({...i,dispatch:void 0})])),chain:()=>this.createChain(o,n)}}buildProps(t,e=!0){let{rawCommands:r,editor:n,state:o}=this,{view:i}=n,s={tr:t,editor:n,view:i,state:wc({state:o,transaction:t}),dispatch:e?()=>{}:void 0,chain:()=>this.createChain(t,e),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(r).map(([a,l])=>[a,(...c)=>l(...c)(s)]))}};return s}},v2=class{constructor(){this.callbacks={};}on(t,e){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(e),this}emit(t,...e){let r=this.callbacks[t];return r&&r.forEach(n=>n.apply(this,e)),this}off(t,e){let r=this.callbacks[t];return r&&(e?this.callbacks[t]=r.filter(n=>n!==e):delete this.callbacks[t]),this}once(t,e){let r=(...n)=>{this.off(t,r),e.apply(this,n);};return this.on(t,r)}removeAllListeners(){this.callbacks={};}};function Hp(t,e){let r=new io(t);return e.forEach(n=>{n.steps.forEach(o=>{r.step(o);});}),r}var Lx=t=>{let e=t.childNodes;for(let r=e.length-1;r>=0;r-=1){let n=e[r];n.nodeType===3&&n.nodeValue&&/^(\n\s\s|\n)$/.test(n.nodeValue)?t.removeChild(n):n.nodeType===1&&Lx(n);}return t};function pc(t){if(typeof window>"u")throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");let e=`<body>${t}</body>`,r=new window.DOMParser().parseFromString(e,"text/html").body;return Lx(r)}function ga(t,e,r){if(t instanceof Ot||t instanceof O)return t;r={slice:!0,parseOptions:{},...r};let n=typeof t=="object"&&t!==null,o=typeof t=="string";if(n)try{if(Array.isArray(t)&&t.length>0)return O.fromArray(t.map(a=>e.nodeFromJSON(a)));let s=e.nodeFromJSON(t);return r.errorOnInvalidContent&&s.check(),s}catch(i){if(r.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:i});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",i),ga("",e,r)}if(o){if(r.errorOnInvalidContent){let s=!1,a="",l=new Wi({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:c=>(s=!0,a=typeof c=="string"?c:c.outerHTML,null)}]}})});if(r.slice?mr.fromSchema(l).parseSlice(pc(t),r.parseOptions):mr.fromSchema(l).parse(pc(t),r.parseOptions),r.errorOnInvalidContent&&s)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${a}`)})}let i=mr.fromSchema(e);return r.slice?i.parseSlice(pc(t),r.parseOptions).content:i.parse(pc(t),r.parseOptions)}return ga("",e,r)}function Fp(t,e,r={},n={}){return ga(t,e,{slice:!1,parseOptions:r,errorOnInvalidContent:n.errorOnInvalidContent})}function y2(t){for(let e=0;e<t.edgeCount;e+=1){let{type:r}=t.edge(e);if(r.isTextblock&&!r.hasRequiredAttrs())return r}return null}function Ec(t,e){let r=[];return t.descendants((n,o)=>{e(n)&&r.push({node:n,pos:o});}),r}function $x(t,e,r){let n=[];return t.nodesBetween(e.from,e.to,(o,i)=>{r(o)&&n.push({node:o,pos:i});}),n}function Up(t,e){for(let r=t.depth;r>0;r-=1){let n=t.node(r);if(e(n))return {pos:r>0?t.before(r):0,start:t.start(r),depth:r,node:n}}}function kc(t){return e=>Up(e.$from,t)}function Q(t,e,r){return t.config[e]===void 0&&t.parent?Q(t.parent,e,r):typeof t.config[e]=="function"?t.config[e].bind({...r,parent:t.parent?Q(t.parent,e,r):null}):t.config[e]}function Vp(t){return t.map(e=>{let r={name:e.name,options:e.options,storage:e.storage},n=Q(e,"addExtensions",r);return n?[e,...Vp(n())]:e}).flat(10)}function Kp(t,e){let r=Kr.fromSchema(e).serializeFragment(t),o=document.implementation.createHTMLDocument().createElement("div");return o.appendChild(r),o.innerHTML}function Bx(t){return typeof t=="function"}function Ie(t,e=void 0,...r){return Bx(t)?e?t.bind(e)(...r):t(...r):t}function w2(t={}){return Object.keys(t).length===0&&t.constructor===Object}function ba(t){let e=t.filter(o=>o.type==="extension"),r=t.filter(o=>o.type==="node"),n=t.filter(o=>o.type==="mark");return {baseExtensions:e,nodeExtensions:r,markExtensions:n}}function Fx(t){let e=[],{nodeExtensions:r,markExtensions:n}=ba(t),o=[...r,...n],i={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(s=>{let a={name:s.name,options:s.options,storage:s.storage,extensions:o},l=Q(s,"addGlobalAttributes",a);if(!l)return;l().forEach(d=>{d.types.forEach(u=>{Object.entries(d.attributes).forEach(([f,p])=>{e.push({type:u,name:f,attribute:{...i,...p}});});});});}),o.forEach(s=>{let a={name:s.name,options:s.options,storage:s.storage},l=Q(s,"addAttributes",a);if(!l)return;let c=l();Object.entries(c).forEach(([d,u])=>{let f={...i,...u};typeof f?.default=="function"&&(f.default=f.default()),f?.isRequired&&f?.default===void 0&&delete f.default,e.push({type:s.name,name:d,attribute:f});});}),e}function ie(...t){return t.filter(e=>!!e).reduce((e,r)=>{let n={...e};return Object.entries(r).forEach(([o,i])=>{if(!n[o]){n[o]=i;return}if(o==="class"){let a=i?String(i).split(" "):[],l=n[o]?n[o].split(" "):[],c=a.filter(d=>!l.includes(d));n[o]=[...l,...c].join(" ");}else if(o==="style"){let a=i?i.split(";").map(d=>d.trim()).filter(Boolean):[],l=n[o]?n[o].split(";").map(d=>d.trim()).filter(Boolean):[],c=new Map;l.forEach(d=>{let[u,f]=d.split(":").map(p=>p.trim());c.set(u,f);}),a.forEach(d=>{let[u,f]=d.split(":").map(p=>p.trim());c.set(u,f);}),n[o]=Array.from(c.entries()).map(([d,u])=>`${d}: ${u}`).join("; ");}else n[o]=i;}),n},{})}function vc(t,e){return e.filter(r=>r.type===t.type.name).filter(r=>r.attribute.rendered).map(r=>r.attribute.renderHTML?r.attribute.renderHTML(t.attrs)||{}:{[r.name]:t.attrs[r.name]}).reduce((r,n)=>ie(r,n),{})}function x2(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function Nx(t,e){return "style"in t?t:{...t,getAttrs:r=>{let n=t.getAttrs?t.getAttrs(r):t.attrs;if(n===!1)return !1;let o=e.reduce((i,s)=>{let a=s.attribute.parseHTML?s.attribute.parseHTML(r):x2(r.getAttribute(s.name));return a==null?i:{...i,[s.name]:a}},{});return {...n,...o}}}}function _x(t){return Object.fromEntries(Object.entries(t).filter(([e,r])=>e==="attrs"&&w2(r)?!1:r!=null))}function E2(t,e){var r;let n=Fx(t),{nodeExtensions:o,markExtensions:i}=ba(t),s=(r=o.find(c=>Q(c,"topNode")))==null?void 0:r.name,a=Object.fromEntries(o.map(c=>{let d=n.filter(b=>b.type===c.name),u={name:c.name,options:c.options,storage:c.storage,editor:e},f=t.reduce((b,v)=>{let y=Q(v,"extendNodeSchema",u);return {...b,...y?y(c):{}}},{}),p=_x({...f,content:Ie(Q(c,"content",u)),marks:Ie(Q(c,"marks",u)),group:Ie(Q(c,"group",u)),inline:Ie(Q(c,"inline",u)),atom:Ie(Q(c,"atom",u)),selectable:Ie(Q(c,"selectable",u)),draggable:Ie(Q(c,"draggable",u)),code:Ie(Q(c,"code",u)),whitespace:Ie(Q(c,"whitespace",u)),linebreakReplacement:Ie(Q(c,"linebreakReplacement",u)),defining:Ie(Q(c,"defining",u)),isolating:Ie(Q(c,"isolating",u)),attrs:Object.fromEntries(d.map(b=>{var v,y;return [b.name,{default:(v=b?.attribute)==null?void 0:v.default,validate:(y=b?.attribute)==null?void 0:y.validate}]}))}),h=Ie(Q(c,"parseHTML",u));h&&(p.parseDOM=h.map(b=>Nx(b,d)));let m=Q(c,"renderHTML",u);m&&(p.toDOM=b=>m({node:b,HTMLAttributes:vc(b,d)}));let g=Q(c,"renderText",u);return g&&(p.toText=g),[c.name,p]})),l=Object.fromEntries(i.map(c=>{let d=n.filter(g=>g.type===c.name),u={name:c.name,options:c.options,storage:c.storage,editor:e},f=t.reduce((g,b)=>{let v=Q(b,"extendMarkSchema",u);return {...g,...v?v(c):{}}},{}),p=_x({...f,inclusive:Ie(Q(c,"inclusive",u)),excludes:Ie(Q(c,"excludes",u)),group:Ie(Q(c,"group",u)),spanning:Ie(Q(c,"spanning",u)),code:Ie(Q(c,"code",u)),attrs:Object.fromEntries(d.map(g=>{var b,v;return [g.name,{default:(b=g?.attribute)==null?void 0:b.default,validate:(v=g?.attribute)==null?void 0:v.validate}]}))}),h=Ie(Q(c,"parseHTML",u));h&&(p.parseDOM=h.map(g=>Nx(g,d)));let m=Q(c,"renderHTML",u);return m&&(p.toDOM=g=>m({mark:g,HTMLAttributes:vc(g,d)})),[c.name,p]}));return new Wi({topNode:s,nodes:a,marks:l})}function k2(t){let e=t.filter((r,n)=>t.indexOf(r)!==n);return Array.from(new Set(e))}function Wp(t){return t.sort((r,n)=>{let o=Q(r,"priority")||100,i=Q(n,"priority")||100;return o>i?-1:o<i?1:0})}function zx(t){let e=Wp(Vp(t)),r=k2(e.map(n=>n.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(n=>`'${n}'`).join(", ")}]. This can lead to issues.`),e}function Hx(t,e,r){let{from:n,to:o}=e,{blockSeparator:i=`
|
|
104
|
+
|
|
105
|
+
`,textSerializers:s={}}=r||{},a="";return t.nodesBetween(n,o,(l,c,d,u)=>{var f;l.isBlock&&c>n&&(a+=i);let p=s?.[l.type.name];if(p)return d&&(a+=p({node:l,pos:c,parent:d,index:u,range:e})),!1;l.isText&&(a+=(f=l?.text)==null?void 0:f.slice(Math.max(n,c)-c,o-c));}),a}function S2(t,e){let r={from:0,to:t.content.size};return Hx(t,r,e)}function Ux(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,r])=>[e,r.spec.toText]))}function Fn(t,e){if(typeof t=="string"){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}function Vx(t,e){let r=Fn(e,t.schema),{from:n,to:o,empty:i}=t.selection,s=[];i?(t.storedMarks&&s.push(...t.storedMarks),s.push(...t.selection.$head.marks())):t.doc.nodesBetween(n,o,l=>{s.push(...l.marks);});let a=s.find(l=>l.type.name===r.name);return a?{...a.attrs}:{}}function at(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}function C2(t,e){let r=at(e,t.schema),{from:n,to:o}=t.selection,i=[];t.doc.nodesBetween(n,o,a=>{i.push(a);});let s=i.reverse().find(a=>a.type.name===r.name);return s?{...s.attrs}:{}}function Sc(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function Gp(t,e){let r=Sc(typeof e=="string"?e:e.name,t.schema);return r==="node"?C2(t,e):r==="mark"?Vx(t,e):{}}function R2(t,e=JSON.stringify){let r={};return t.filter(n=>{let o=e(n);return Object.prototype.hasOwnProperty.call(r,o)?!1:r[o]=!0})}function T2(t){let e=R2(t);return e.length===1?e:e.filter((r,n)=>!e.filter((i,s)=>s!==n).some(i=>r.oldRange.from>=i.oldRange.from&&r.oldRange.to<=i.oldRange.to&&r.newRange.from>=i.newRange.from&&r.newRange.to<=i.newRange.to))}function qp(t){let{mapping:e,steps:r}=t,n=[];return e.maps.forEach((o,i)=>{let s=[];if(o.ranges.length)o.forEach((a,l)=>{s.push({from:a,to:l});});else {let{from:a,to:l}=r[i];if(a===void 0||l===void 0)return;s.push({from:a,to:l});}s.forEach(({from:a,to:l})=>{let c=e.slice(i).map(a,-1),d=e.slice(i).map(l),u=e.invert().map(c,-1),f=e.invert().map(d);n.push({oldRange:{from:u,to:f},newRange:{from:c,to:d}});});}),T2(n)}function jp(t){return Object.prototype.toString.call(t)==="[object RegExp]"}function yc(t,e,r={strict:!0}){let n=Object.keys(e);return n.length?n.every(o=>r.strict?e[o]===t[o]:jp(e[o])?e[o].test(t[o]):e[o]===t[o]):!0}function Kx(t,e,r={}){return t.find(n=>n.type===e&&yc(Object.fromEntries(Object.keys(r).map(o=>[o,n.attrs[o]])),r))}function Mx(t,e,r={}){return !!Kx(t,e,r)}function Yp(t,e,r){var n;if(!t||!e)return;let o=t.parent.childAfter(t.parentOffset);if((!o.node||!o.node.marks.some(d=>d.type===e))&&(o=t.parent.childBefore(t.parentOffset)),!o.node||!o.node.marks.some(d=>d.type===e)||(r=r||((n=o.node.marks[0])==null?void 0:n.attrs),!Kx([...o.node.marks],e,r)))return;let s=o.index,a=t.start()+o.offset,l=s+1,c=a+o.node.nodeSize;for(;s>0&&Mx([...t.parent.child(s-1).marks],e,r);)s-=1,a-=t.parent.child(s).nodeSize;for(;l<t.parent.childCount&&Mx([...t.parent.child(l).marks],e,r);)c+=t.parent.child(l).nodeSize,l+=1;return {from:a,to:c}}function Cc(t,e,r){let n=[];return t===e?r.resolve(t).marks().forEach(o=>{let i=r.resolve(t),s=Yp(i,o.type);s&&n.push({mark:o,...s});}):r.nodesBetween(t,e,(o,i)=>{!o||o?.nodeSize===void 0||n.push(...o.marks.map(s=>({from:i,to:i+o.nodeSize,mark:s})));}),n}var Wx=(t,e,r,n=20)=>{let o=t.doc.resolve(r),i=n,s=null;for(;i>0&&s===null;){let a=o.node(i);a?.type.name===e?s=a:i-=1;}return [s,i]};function Lp(t,e){return e.nodes[t]||e.marks[t]||null}function bc(t,e,r){return Object.fromEntries(Object.entries(r).filter(([n])=>{let o=t.find(i=>i.type===e&&i.name===n);return o?o.attribute.keepOnSplit:!1}))}var N2=(t,e=500)=>{let r="",n=t.parentOffset;return t.parent.nodesBetween(Math.max(0,n-e),n,(o,i,s,a)=>{var l,c;let d=((c=(l=o.type.spec).toText)==null?void 0:c.call(l,{node:o,pos:i,parent:s,index:a}))||o.textContent||"%leaf%";r+=o.isAtom&&!o.isText?d:d.slice(0,Math.max(0,n-i));}),r};function zp(t,e,r={}){let{empty:n,ranges:o}=t.selection,i=e?Fn(e,t.schema):null;if(n)return !!(t.storedMarks||t.selection.$from.marks()).filter(u=>i?i.name===u.type.name:!0).find(u=>yc(u.attrs,r,{strict:!1}));let s=0,a=[];if(o.forEach(({$from:u,$to:f})=>{let p=u.pos,h=f.pos;t.doc.nodesBetween(p,h,(m,g)=>{if(!m.isText&&!m.marks.length)return;let b=Math.max(p,g),v=Math.min(h,g+m.nodeSize),y=v-b;s+=y,a.push(...m.marks.map(x=>({mark:x,from:b,to:v})));});}),s===0)return !1;let l=a.filter(u=>i?i.name===u.mark.type.name:!0).filter(u=>yc(u.mark.attrs,r,{strict:!1})).reduce((u,f)=>u+f.to-f.from,0),c=a.filter(u=>i?u.mark.type!==i&&u.mark.type.excludes(i):!0).reduce((u,f)=>u+f.to-f.from,0);return (l>0?l+c:l)>=s}function dn(t,e,r={}){let{from:n,to:o,empty:i}=t.selection,s=e?at(e,t.schema):null,a=[];t.doc.nodesBetween(n,o,(u,f)=>{if(u.isText)return;let p=Math.max(n,f),h=Math.min(o,f+u.nodeSize);a.push({node:u,from:p,to:h});});let l=o-n,c=a.filter(u=>s?s.name===u.node.type.name:!0).filter(u=>yc(u.node.attrs,r,{strict:!1}));return i?!!c.length:c.reduce((u,f)=>u+f.to-f.from,0)>=l}function _2(t,e,r={}){if(!e)return dn(t,null,r)||zp(t,null,r);let n=Sc(e,t.schema);return n==="node"?dn(t,e,r):n==="mark"?zp(t,e,r):!1}var Gx=(t,e)=>{let{$from:r,$to:n,$anchor:o}=t.selection;if(e){let i=kc(a=>a.type.name===e)(t.selection);if(!i)return !1;let s=t.doc.resolve(i.pos+1);return o.pos+1===s.end()}return !(n.parentOffset<n.parent.nodeSize-2||r.pos!==n.pos)},qx=t=>{let{$from:e,$to:r}=t.selection;return !(e.parentOffset>0||e.pos!==r.pos)};function Ax(t,e){return Array.isArray(e)?e.some(r=>(typeof r=="string"?r:r.name)===t.name):e}function Ox(t,e){let{nodeExtensions:r}=ba(e),n=r.find(s=>s.name===t);if(!n)return !1;let o={name:n.name,options:n.options,storage:n.storage},i=Ie(Q(n,"group",o));return typeof i!="string"?!1:i.split(" ").includes("list")}function va(t,{checkChildren:e=!0,ignoreWhitespace:r=!1}={}){var n;if(r){if(t.type.name==="hardBreak")return !0;if(t.isText)return /^\s*$/m.test((n=t.text)!=null?n:"")}if(t.isText)return !t.text;if(t.isAtom||t.isLeaf)return !1;if(t.content.childCount===0)return !0;if(e){let o=!0;return t.content.forEach(i=>{o!==!1&&(va(i,{ignoreWhitespace:r,checkChildren:e})||(o=!1));}),o}return !1}function Rc(t){return t instanceof X}function jx(t){return t instanceof q}function li(t=0,e=0,r=0){return Math.min(Math.max(t,e),r)}function Yx(t,e=null){if(!e)return null;let r=Z.atStart(t),n=Z.atEnd(t);if(e==="start"||e===!0)return r;if(e==="end")return n;let o=r.from,i=n.to;return e==="all"?q.create(t,li(0,o,i),li(t.content.size,o,i)):q.create(t,li(e,o,i),li(e,o,i))}function M2(t,e,r){let n=t.steps.length-1;if(n<e)return;let o=t.steps[n];if(!(o instanceof et||o instanceof Ye))return;let i=t.mapping.maps[n],s=0;i.forEach((a,l,c,d)=>{s===0&&(s=d);}),t.setSelection(Z.near(t.doc.resolve(s),r));}var ya=class{constructor(t){this.find=t.find,this.handler=t.handler;}},A2=(t,e)=>{if(jp(e))return e.exec(t);let r=e(t);if(!r)return null;let n=[r.text];return n.index=r.index,n.input=t,n.data=r.data,r.replaceWith&&(r.text.includes(r.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),n.push(r.replaceWith)),n};function hc(t){var e;let{editor:r,from:n,to:o,text:i,rules:s,plugin:a}=t,{view:l}=r;if(l.composing)return !1;let c=l.state.doc.resolve(n);if(c.parent.type.spec.code||(e=c.nodeBefore||c.nodeAfter)!=null&&e.marks.find(f=>f.type.spec.code))return !1;let d=!1,u=N2(c)+i;return s.forEach(f=>{if(d)return;let p=A2(u,f.find);if(!p)return;let h=l.state.tr,m=wc({state:l.state,transaction:h}),g={from:n-(p[0].length-i.length),to:o},{commands:b,chain:v,can:y}=new xc({editor:r,state:m});f.handler({state:m,range:g,match:p,commands:b,chain:v,can:y})===null||!h.steps.length||(h.setMeta(a,{transform:h,from:n,to:o,text:i}),l.dispatch(h),d=!0);}),d}function O2(t){let{editor:e,rules:r}=t,n=new oe({state:{init(){return null},apply(o,i,s){let a=o.getMeta(n);if(a)return a;let l=o.getMeta("applyInputRules");return !!l&&setTimeout(()=>{let{text:d}=l;typeof d=="string"?d=d:d=Kp(O.from(d),s.schema);let{from:u}=l,f=u+d.length;hc({editor:e,from:u,to:f,text:d,rules:r,plugin:n});}),o.selectionSet||o.docChanged?null:i}},props:{handleTextInput(o,i,s,a){return hc({editor:e,from:i,to:s,text:a,rules:r,plugin:n})},handleDOMEvents:{compositionend:o=>(setTimeout(()=>{let{$cursor:i}=o.state.selection;i&&hc({editor:e,from:i.pos,to:i.pos,text:"",rules:r,plugin:n});}),!1)},handleKeyDown(o,i){if(i.key!=="Enter")return !1;let{$cursor:s}=o.state.selection;return s?hc({editor:e,from:s.pos,to:s.pos,text:`
|
|
106
|
+
`,rules:r,plugin:n}):!1}},isInputRules:!0});return n}function D2(t){return Object.prototype.toString.call(t).slice(8,-1)}function mc(t){return D2(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function Xx(t,e){let r={...t};return mc(t)&&mc(e)&&Object.keys(e).forEach(n=>{mc(e[n])&&mc(t[n])?r[n]=Xx(t[n],e[n]):r[n]=e[n];}),r}var Xp=class{constructor(t={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...t},this.name=this.config.name;}get options(){return {...Ie(Q(this,"addOptions",{name:this.name}))||{}}}get storage(){return {...Ie(Q(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(t={}){let e=this.extend({...this.config,addOptions:()=>Xx(this.options,t)});return e.name=this.name,e.parent=this.parent,e}extend(t={}){let e=new this.constructor({...this.config,...t});return e.parent=this,this.child=e,e.name="name"in t?t.name:e.parent.name,e}},Pt=class Jx extends Xp{constructor(){super(...arguments),this.type="mark";}static create(e={}){let r=typeof e=="function"?e():e;return new Jx(r)}static handleExit({editor:e,mark:r}){let{tr:n}=e.state,o=e.state.selection.$from;if(o.pos===o.end()){let s=o.marks();if(!!!s.find(c=>c?.type.name===r.name))return !1;let l=s.find(c=>c?.type.name===r.name);return l&&n.removeStoredMark(l),n.insertText(" ",o.pos),e.view.dispatch(n),!0}return !1}configure(e){return super.configure(e)}extend(e){let r=typeof e=="function"?e():e;return super.extend(r)}};function P2(t){return typeof t=="number"}var I2=class{constructor(t){this.find=t.find,this.handler=t.handler;}},L2=(t,e,r)=>{if(jp(e))return [...t.matchAll(e)];let n=e(t,r);return n?n.map(o=>{let i=[o.text];return i.index=o.index,i.input=t,i.data=o.data,o.replaceWith&&(o.text.includes(o.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),i.push(o.replaceWith)),i}):[]};function $2(t){let{editor:e,state:r,from:n,to:o,rule:i,pasteEvent:s,dropEvent:a}=t,{commands:l,chain:c,can:d}=new xc({editor:e,state:r}),u=[];return r.doc.nodesBetween(n,o,(p,h)=>{if(!p.isTextblock||p.type.spec.code)return;let m=Math.max(n,h),g=Math.min(o,h+p.content.size),b=p.textBetween(m-h,g-h,void 0,"\uFFFC");L2(b,i.find,s).forEach(y=>{if(y.index===void 0)return;let x=m+y.index+1,E=x+y[0].length,S={from:r.tr.mapping.map(x),to:r.tr.mapping.map(E)},R=i.handler({state:r,range:S,match:y,commands:l,chain:c,can:d,pasteEvent:s,dropEvent:a});u.push(R);});}),u.every(p=>p!==null)}var gc=null,B2=t=>{var e;let r=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return (e=r.clipboardData)==null||e.setData("text/html",t),r};function F2(t){let{editor:e,rules:r}=t,n=null,o=!1,i=!1,s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,a;try{a=typeof DragEvent<"u"?new DragEvent("drop"):null;}catch{a=null;}let l=({state:d,from:u,to:f,rule:p,pasteEvt:h})=>{let m=d.tr,g=wc({state:d,transaction:m});if(!(!$2({editor:e,state:g,from:Math.max(u-1,0),to:f.b-1,rule:p,pasteEvent:h,dropEvent:a})||!m.steps.length)){try{a=typeof DragEvent<"u"?new DragEvent("drop"):null;}catch{a=null;}return s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,m}};return r.map(d=>new oe({view(u){let f=h=>{var m;n=(m=u.dom.parentElement)!=null&&m.contains(h.target)?u.dom.parentElement:null,n&&(gc=e);},p=()=>{gc&&(gc=null);};return window.addEventListener("dragstart",f),window.addEventListener("dragend",p),{destroy(){window.removeEventListener("dragstart",f),window.removeEventListener("dragend",p);}}},props:{handleDOMEvents:{drop:(u,f)=>{if(i=n===u.dom.parentElement,a=f,!i){let p=gc;p?.isEditable&&setTimeout(()=>{let h=p.state.selection;h&&p.commands.deleteRange({from:h.from,to:h.to});},10);}return !1},paste:(u,f)=>{var p;let h=(p=f.clipboardData)==null?void 0:p.getData("text/html");return s=f,o=!!h?.includes("data-pm-slice"),!1}}},appendTransaction:(u,f,p)=>{let h=u[0],m=h.getMeta("uiEvent")==="paste"&&!o,g=h.getMeta("uiEvent")==="drop"&&!i,b=h.getMeta("applyPasteRules"),v=!!b;if(!m&&!g&&!v)return;if(v){let{text:E}=b;typeof E=="string"?E=E:E=Kp(O.from(E),p.schema);let{from:S}=b,R=S+E.length,w=B2(E);return l({rule:d,state:p,from:S,to:{b:R},pasteEvt:w})}let y=f.doc.content.findDiffStart(p.doc.content),x=f.doc.content.findDiffEnd(p.doc.content);if(!(!P2(y)||!x||y===x.b))return l({rule:d,state:p,from:y,to:x,pasteEvt:s})}}))}var Tc=class{constructor(t,e){this.splittableMarks=[],this.editor=e,this.extensions=zx(t),this.schema=E2(this.extensions,e),this.setupExtensions();}get commands(){return this.extensions.reduce((t,e)=>{let r={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:Lp(e.name,this.schema)},n=Q(e,"addCommands",r);return n?{...t,...n()}:t},{})}get plugins(){let{editor:t}=this,e=Wp([...this.extensions].reverse()),r=[],n=[],o=e.map(i=>{let s={name:i.name,options:i.options,storage:this.editor.extensionStorage[i.name],editor:t,type:Lp(i.name,this.schema)},a=[],l=Q(i,"addKeyboardShortcuts",s),c={};if(i.type==="mark"&&Q(i,"exitable",s)&&(c.ArrowRight=()=>Pt.handleExit({editor:t,mark:i})),l){let h=Object.fromEntries(Object.entries(l()).map(([m,g])=>[m,()=>g({editor:t})]));c={...c,...h};}let d=ux(c);a.push(d);let u=Q(i,"addInputRules",s);Ax(i,t.options.enableInputRules)&&u&&r.push(...u());let f=Q(i,"addPasteRules",s);Ax(i,t.options.enablePasteRules)&&f&&n.push(...f());let p=Q(i,"addProseMirrorPlugins",s);if(p){let h=p();a.push(...h);}return a}).flat();return [O2({editor:t,rules:r}),...F2({editor:t,rules:n}),...o]}get attributes(){return Fx(this.extensions)}get nodeViews(){let{editor:t}=this,{nodeExtensions:e}=ba(this.extensions);return Object.fromEntries(e.filter(r=>!!Q(r,"addNodeView")).map(r=>{let n=this.attributes.filter(a=>a.type===r.name),o={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:t,type:at(r.name,this.schema)},i=Q(r,"addNodeView",o);if(!i)return [];let s=(a,l,c,d,u)=>{let f=vc(a,n);return i()({node:a,view:l,getPos:c,decorations:d,innerDecorations:u,editor:t,extension:r,HTMLAttributes:f})};return [r.name,s]}))}get markViews(){let{editor:t}=this,{markExtensions:e}=ba(this.extensions);return Object.fromEntries(e.filter(r=>!!Q(r,"addMarkView")).map(r=>{let n=this.attributes.filter(a=>a.type===r.name),o={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:t,type:Fn(r.name,this.schema)},i=Q(r,"addMarkView",o);if(!i)return [];let s=(a,l,c)=>{let d=vc(a,n);return i()({mark:a,view:l,inline:c,editor:t,extension:r,HTMLAttributes:d,updateAttributes:u=>{ZI(a,t,u);}})};return [r.name,s]}))}setupExtensions(){let t=this.extensions;this.editor.extensionStorage=Object.fromEntries(t.map(e=>[e.name,e.storage])),t.forEach(e=>{var r;let n={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:Lp(e.name,this.schema)};e.type==="mark"&&((r=Ie(Q(e,"keepOnSplit",n)))==null||r)&&this.splittableMarks.push(e.name);let o=Q(e,"onBeforeCreate",n),i=Q(e,"onCreate",n),s=Q(e,"onUpdate",n),a=Q(e,"onSelectionUpdate",n),l=Q(e,"onTransaction",n),c=Q(e,"onFocus",n),d=Q(e,"onBlur",n),u=Q(e,"onDestroy",n);o&&this.editor.on("beforeCreate",o),i&&this.editor.on("create",i),s&&this.editor.on("update",s),a&&this.editor.on("selectionUpdate",a),l&&this.editor.on("transaction",l),c&&this.editor.on("focus",c),d&&this.editor.on("blur",d),u&&this.editor.on("destroy",u);});}};Tc.resolve=zx;Tc.sort=Wp;Tc.flatten=Vp;var z2={};Ix(z2,{ClipboardTextSerializer:()=>Qx,Commands:()=>rE,Delete:()=>nE,Drop:()=>oE,Editable:()=>iE,FocusEvents:()=>aE,Keymap:()=>lE,Paste:()=>cE,Tabindex:()=>dE,focusEventsPluginKey:()=>sE});var se=class Zx extends Xp{constructor(){super(...arguments),this.type="extension";}static create(e={}){let r=typeof e=="function"?e():e;return new Zx(r)}configure(e){return super.configure(e)}extend(e){let r=typeof e=="function"?e():e;return super.extend(r)}},Qx=se.create({name:"clipboardTextSerializer",addOptions(){return {blockSeparator:void 0}},addProseMirrorPlugins(){return [new oe({key:new ae("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{let{editor:t}=this,{state:e,schema:r}=t,{doc:n,selection:o}=e,{ranges:i}=o,s=Math.min(...i.map(d=>d.$from.pos)),a=Math.max(...i.map(d=>d.$to.pos)),l=Ux(r);return Hx(n,{from:s,to:a},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}}),eE={};Ix(eE,{blur:()=>H2,clearContent:()=>U2,clearNodes:()=>V2,command:()=>K2,createParagraphNear:()=>W2,cut:()=>G2,deleteCurrentNode:()=>q2,deleteNode:()=>j2,deleteRange:()=>Y2,deleteSelection:()=>X2,enter:()=>J2,exitCode:()=>Z2,extendMarkRange:()=>Q2,first:()=>eI,focus:()=>rI,forEach:()=>nI,insertContent:()=>oI,insertContentAt:()=>sI,joinBackward:()=>cI,joinDown:()=>lI,joinForward:()=>dI,joinItemBackward:()=>uI,joinItemForward:()=>fI,joinTextblockBackward:()=>pI,joinTextblockForward:()=>hI,joinUp:()=>aI,keyboardShortcut:()=>gI,lift:()=>bI,liftEmptyBlock:()=>vI,liftListItem:()=>yI,newlineInCode:()=>wI,resetAttributes:()=>xI,scrollIntoView:()=>EI,selectAll:()=>kI,selectNodeBackward:()=>SI,selectNodeForward:()=>CI,selectParentNode:()=>RI,selectTextblockEnd:()=>TI,selectTextblockStart:()=>NI,setContent:()=>_I,setMark:()=>AI,setMeta:()=>OI,setNode:()=>DI,setNodeSelection:()=>PI,setTextSelection:()=>II,sinkListItem:()=>LI,splitBlock:()=>$I,splitListItem:()=>BI,toggleList:()=>FI,toggleMark:()=>zI,toggleNode:()=>HI,toggleWrap:()=>UI,undoInputRule:()=>VI,unsetAllMarks:()=>KI,unsetMark:()=>WI,updateAttributes:()=>GI,wrapIn:()=>qI,wrapInList:()=>jI});var H2=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var r;t.isDestroyed||(e.dom.blur(),(r=window?.getSelection())==null||r.removeAllRanges());}),!0),U2=(t=!0)=>({commands:e})=>e.setContent("",{emitUpdate:t}),V2=()=>({state:t,tr:e,dispatch:r})=>{let{selection:n}=e,{ranges:o}=n;return r&&o.forEach(({$from:i,$to:s})=>{t.doc.nodesBetween(i.pos,s.pos,(a,l)=>{if(a.type.isText)return;let{doc:c,mapping:d}=e,u=c.resolve(d.map(l)),f=c.resolve(d.map(l+a.nodeSize)),p=u.blockRange(f);if(!p)return;let h=An(p);if(a.type.isTextblock){let{defaultType:m}=u.parent.contentMatchAt(u.index());e.setNodeMarkup(p.start,m);}(h||h===0)&&e.lift(p,h);});}),!0},K2=t=>e=>t(e),W2=()=>({state:t,dispatch:e})=>Mp(t,e),G2=(t,e)=>({editor:r,tr:n})=>{let{state:o}=r,i=o.doc.slice(t.from,t.to);n.deleteRange(t.from,t.to);let s=n.mapping.map(e);return n.insert(s,i.content),n.setSelection(new q(n.doc.resolve(Math.max(s-1,0)))),!0},q2=()=>({tr:t,dispatch:e})=>{let{selection:r}=t,n=r.$anchor.node();if(n.content.size>0)return !1;let o=t.selection.$anchor;for(let i=o.depth;i>0;i-=1)if(o.node(i).type===n.type){if(e){let a=o.before(i),l=o.after(i);t.delete(a,l).scrollIntoView();}return !0}return !1},j2=t=>({tr:e,state:r,dispatch:n})=>{let o=at(t,r.schema),i=e.selection.$anchor;for(let s=i.depth;s>0;s-=1)if(i.node(s).type===o){if(n){let l=i.before(s),c=i.after(s);e.delete(l,c).scrollIntoView();}return !0}return !1},Y2=t=>({tr:e,dispatch:r})=>{let{from:n,to:o}=t;return r&&e.delete(n,o),!0},X2=()=>({state:t,dispatch:e})=>fc(t,e),J2=()=>({commands:t})=>t.keyboardShortcut("Enter"),Z2=()=>({state:t,dispatch:e})=>_p(t,e),Q2=(t,e={})=>({tr:r,state:n,dispatch:o})=>{let i=Fn(t,n.schema),{doc:s,selection:a}=r,{$from:l,from:c,to:d}=a;if(o){let u=Yp(l,i,e);if(u&&u.from<=c&&u.to>=d){let f=q.create(s,u.from,u.to);r.setSelection(f);}}return !0},eI=t=>e=>{let r=typeof t=="function"?t(e):t;for(let n=0;n<r.length;n+=1)if(r[n](e))return !0;return !1};function tI(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function Jp(){return ["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}var rI=(t=null,e={})=>({editor:r,view:n,tr:o,dispatch:i})=>{e={scrollIntoView:!0,...e};let s=()=>{(Jp()||tI())&&n.dom.focus(),requestAnimationFrame(()=>{r.isDestroyed||(n.focus(),e?.scrollIntoView&&r.commands.scrollIntoView());});};if(n.hasFocus()&&t===null||t===!1)return !0;if(i&&t===null&&!jx(r.state.selection))return s(),!0;let a=Yx(o.doc,t)||r.state.selection,l=r.state.selection.eq(a);return i&&(l||o.setSelection(a),l&&o.storedMarks&&o.setStoredMarks(o.storedMarks),s()),!0},nI=(t,e)=>r=>t.every((n,o)=>e(n,{...r,index:o})),oI=(t,e)=>({tr:r,commands:n})=>n.insertContentAt({from:r.selection.from,to:r.selection.to},t,e),iI=t=>!("type"in t),sI=(t,e,r)=>({tr:n,dispatch:o,editor:i})=>{var s;if(o){r={parseOptions:i.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...r};let a,{selection:l}=i.state,c=b=>{i.emit("contentError",{editor:i,error:b,disableCollaboration:()=>{"collaboration"in i.storage&&typeof i.storage.collaboration=="object"&&i.storage.collaboration&&(i.storage.collaboration.isDisabled=!0);}});},d={preserveWhitespace:"full",...r.parseOptions};if(!r.errorOnInvalidContent&&!i.options.enableContentCheck&&i.options.emitContentError)try{ga(e,i.schema,{parseOptions:d,errorOnInvalidContent:!0});}catch(b){c(b);}try{a=ga(e,i.schema,{parseOptions:d,errorOnInvalidContent:(s=r.errorOnInvalidContent)!=null?s:i.options.enableContentCheck});}catch(b){return c(b),!1}let{from:u,to:f}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},p=!0,h=!0;if((iI(a)?a:[a]).forEach(b=>{b.check(),p=p?b.isText&&b.marks.length===0:!1,h=h?b.isBlock:!1;}),u===f&&h){let{parent:b}=n.doc.resolve(u);b.isTextblock&&!b.type.spec.code&&!b.childCount&&(u-=1,f+=1);}let g;if(p){if(Array.isArray(e))g=e.map(b=>b.text||"").join("");else if(e instanceof O){let b="";e.forEach(v=>{v.text&&(b+=v.text);}),g=b;}else typeof e=="object"&&e&&e.text?g=e.text:g=e;n.insertText(g,u,f);}else {g=a;let b=l.$from.parentOffset===0,v=l.$from.node().isText||l.$from.node().isTextblock,y=l.$from.node().content.size>0;b&&v&&y&&(u=Math.max(0,u-1)),n.replaceWith(u,f,g);}r.updateSelection&&M2(n,n.steps.length-1,-1),r.applyInputRules&&n.setMeta("applyInputRules",{from:u,text:g}),r.applyPasteRules&&n.setMeta("applyPasteRules",{from:u,text:g});}return !0},aI=()=>({state:t,dispatch:e})=>vx(t,e),lI=()=>({state:t,dispatch:e})=>yx(t,e),cI=()=>({state:t,dispatch:e})=>xp(t,e),dI=()=>({state:t,dispatch:e})=>Sp(t,e),uI=()=>({state:t,dispatch:e,tr:r})=>{try{let n=Qo(t.doc,t.selection.$from.pos,-1);return n==null?!1:(r.join(n,2),e&&e(r),!0)}catch{return !1}},fI=()=>({state:t,dispatch:e,tr:r})=>{try{let n=Qo(t.doc,t.selection.$from.pos,1);return n==null?!1:(r.join(n,2),e&&e(r),!0)}catch{return !1}},pI=()=>({state:t,dispatch:e})=>hx(t,e),hI=()=>({state:t,dispatch:e})=>mx(t,e);function tE(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function mI(t){let e=t.split(/-(?!$)/),r=e[e.length-1];r==="Space"&&(r=" ");let n,o,i,s;for(let a=0;a<e.length-1;a+=1){let l=e[a];if(/^(cmd|meta|m)$/i.test(l))s=!0;else if(/^a(lt)?$/i.test(l))n=!0;else if(/^(c|ctrl|control)$/i.test(l))o=!0;else if(/^s(hift)?$/i.test(l))i=!0;else if(/^mod$/i.test(l))Jp()||tE()?s=!0:o=!0;else throw new Error(`Unrecognized modifier name: ${l}`)}return n&&(r=`Alt-${r}`),o&&(r=`Ctrl-${r}`),s&&(r=`Meta-${r}`),i&&(r=`Shift-${r}`),r}var gI=t=>({editor:e,view:r,tr:n,dispatch:o})=>{let i=mI(t).split(/-(?!$)/),s=i.find(c=>!["Alt","Ctrl","Meta","Shift"].includes(c)),a=new KeyboardEvent("keydown",{key:s==="Space"?" ":s,altKey:i.includes("Alt"),ctrlKey:i.includes("Ctrl"),metaKey:i.includes("Meta"),shiftKey:i.includes("Shift"),bubbles:!0,cancelable:!0}),l=e.captureTransaction(()=>{r.someProp("handleKeyDown",c=>c(r,a));});return l?.steps.forEach(c=>{let d=c.map(n.mapping);d&&o&&n.maybeStep(d);}),!0},bI=(t,e={})=>({state:r,dispatch:n})=>{let o=at(t,r.schema);return dn(r,o,e)?wx(r,n):!1},vI=()=>({state:t,dispatch:e})=>Ap(t,e),yI=t=>({state:e,dispatch:r})=>{let n=at(t,e.schema);return Rx(n)(e,r)},wI=()=>({state:t,dispatch:e})=>Tp(t,e);function Dx(t,e){let r=typeof e=="string"?[e]:e;return Object.keys(t).reduce((n,o)=>(r.includes(o)||(n[o]=t[o]),n),{})}var xI=(t,e)=>({tr:r,state:n,dispatch:o})=>{let i=null,s=null,a=Sc(typeof t=="string"?t:t.name,n.schema);return a?(a==="node"&&(i=at(t,n.schema)),a==="mark"&&(s=Fn(t,n.schema)),o&&r.selection.ranges.forEach(l=>{n.doc.nodesBetween(l.$from.pos,l.$to.pos,(c,d)=>{i&&i===c.type&&r.setNodeMarkup(d,void 0,Dx(c.attrs,e)),s&&c.marks.length&&c.marks.forEach(u=>{s===u.type&&r.addMark(d,d+c.nodeSize,s.create(Dx(u.attrs,e)));});});}),!0):!1},EI=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),kI=()=>({tr:t,dispatch:e})=>{if(e){let r=new Et(t.doc);t.setSelection(r);}return !0},SI=()=>({state:t,dispatch:e})=>Ep(t,e),CI=()=>({state:t,dispatch:e})=>Cp(t,e),RI=()=>({state:t,dispatch:e})=>xx(t,e),TI=()=>({state:t,dispatch:e})=>Dp(t,e),NI=()=>({state:t,dispatch:e})=>Op(t,e),_I=(t,{errorOnInvalidContent:e,emitUpdate:r=!0,parseOptions:n={}}={})=>({editor:o,tr:i,dispatch:s,commands:a})=>{let{doc:l}=i;if(n.preserveWhitespace!=="full"){let c=Fp(t,o.schema,n,{errorOnInvalidContent:e??o.options.enableContentCheck});return s&&i.replaceWith(0,l.content.size,c).setMeta("preventUpdate",!r),!0}return s&&i.setMeta("preventUpdate",!r),a.insertContentAt({from:0,to:l.content.size},t,{parseOptions:n,errorOnInvalidContent:e??o.options.enableContentCheck})};function MI(t,e,r){var n;let{selection:o}=e,i=null;if(jx(o)&&(i=o.$cursor),i){let a=(n=t.storedMarks)!=null?n:i.marks();return !!r.isInSet(a)||!a.some(l=>l.type.excludes(r))}let{ranges:s}=o;return s.some(({$from:a,$to:l})=>{let c=a.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(r):!1;return t.doc.nodesBetween(a.pos,l.pos,(d,u,f)=>{if(c)return !1;if(d.isInline){let p=!f||f.type.allowsMarkType(r),h=!!r.isInSet(d.marks)||!d.marks.some(m=>m.type.excludes(r));c=p&&h;}return !c}),c})}var AI=(t,e={})=>({tr:r,state:n,dispatch:o})=>{let{selection:i}=r,{empty:s,ranges:a}=i,l=Fn(t,n.schema);if(o)if(s){let c=Vx(n,l);r.addStoredMark(l.create({...c,...e}));}else a.forEach(c=>{let d=c.$from.pos,u=c.$to.pos;n.doc.nodesBetween(d,u,(f,p)=>{let h=Math.max(p,d),m=Math.min(p+f.nodeSize,u);f.marks.find(b=>b.type===l)?f.marks.forEach(b=>{l===b.type&&r.addMark(h,m,l.create({...b.attrs,...e}));}):r.addMark(h,m,l.create(e));});});return MI(n,r,l)},OI=(t,e)=>({tr:r})=>(r.setMeta(t,e),!0),DI=(t,e={})=>({state:r,dispatch:n,chain:o})=>{let i=at(t,r.schema),s;return r.selection.$anchor.sameParent(r.selection.$head)&&(s=r.selection.$anchor.parent.attrs),i.isTextblock?o().command(({commands:a})=>Pp(i,{...s,...e})(r)?!0:a.clearNodes()).command(({state:a})=>Pp(i,{...s,...e})(a,n)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},PI=t=>({tr:e,dispatch:r})=>{if(r){let{doc:n}=e,o=li(t,0,n.content.size),i=X.create(n,o);e.setSelection(i);}return !0},II=t=>({tr:e,dispatch:r})=>{if(r){let{doc:n}=e,{from:o,to:i}=typeof t=="number"?{from:t,to:t}:t,s=q.atStart(n).from,a=q.atEnd(n).to,l=li(o,s,a),c=li(i,s,a),d=q.create(n,l,c);e.setSelection(d);}return !0},LI=t=>({state:e,dispatch:r})=>{let n=at(t,e.schema);return Tx(n)(e,r)};function Px(t,e){let r=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(r){let n=r.filter(o=>e?.includes(o.type.name));t.tr.ensureMarks(n);}}var $I=({keepMarks:t=!0}={})=>({tr:e,state:r,dispatch:n,editor:o})=>{let{selection:i,doc:s}=e,{$from:a,$to:l}=i,c=o.extensionManager.attributes,d=bc(c,a.node().type.name,a.node().attrs);if(i instanceof X&&i.node.isBlock)return !a.parentOffset||!gr(s,a.pos)?!1:(n&&(t&&Px(r,o.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return !1;let u=l.parentOffset===l.parent.content.size,f=a.depth===0?void 0:y2(a.node(-1).contentMatchAt(a.indexAfter(-1))),p=u&&f?[{type:f,attrs:d}]:void 0,h=gr(e.doc,e.mapping.map(a.pos),1,p);if(!p&&!h&&gr(e.doc,e.mapping.map(a.pos),1,f?[{type:f}]:void 0)&&(h=!0,p=f?[{type:f,attrs:d}]:void 0),n){if(h&&(i instanceof q&&e.deleteSelection(),e.split(e.mapping.map(a.pos),1,p),f&&!u&&!a.parentOffset&&a.parent.type!==f)){let m=e.mapping.map(a.before()),g=e.doc.resolve(m);a.node(-1).canReplaceWith(g.index(),g.index()+1,f)&&e.setNodeMarkup(e.mapping.map(a.before()),f);}t&&Px(r,o.extensionManager.splittableMarks),e.scrollIntoView();}return h},BI=(t,e={})=>({tr:r,state:n,dispatch:o,editor:i})=>{var s;let a=at(t,n.schema),{$from:l,$to:c}=n.selection,d=n.selection.node;if(d&&d.isBlock||l.depth<2||!l.sameParent(c))return !1;let u=l.node(-1);if(u.type!==a)return !1;let f=i.extensionManager.attributes;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==a||l.index(-2)!==l.node(-2).childCount-1)return !1;if(o){let b=O.empty,v=l.index(-1)?1:l.index(-2)?2:3;for(let w=l.depth-v;w>=l.depth-3;w-=1)b=O.from(l.node(w).copy(b));let y=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3,x={...bc(f,l.node().type.name,l.node().attrs),...e},E=((s=a.contentMatch.defaultType)==null?void 0:s.createAndFill(x))||void 0;b=b.append(O.from(a.createAndFill(null,E)||void 0));let S=l.before(l.depth-(v-1));r.replace(S,l.after(-y),new H(b,4-v,0));let R=-1;r.doc.nodesBetween(S,r.doc.content.size,(w,N)=>{if(R>-1)return !1;w.isTextblock&&w.content.size===0&&(R=N+1);}),R>-1&&r.setSelection(q.near(r.doc.resolve(R))),r.scrollIntoView();}return !0}let p=c.pos===l.end()?u.contentMatchAt(0).defaultType:null,h={...bc(f,u.type.name,u.attrs),...e},m={...bc(f,l.node().type.name,l.node().attrs),...e};r.delete(l.pos,c.pos);let g=p?[{type:a,attrs:h},{type:p,attrs:m}]:[{type:a,attrs:h}];if(!gr(r.doc,l.pos,2))return !1;if(o){let{selection:b,storedMarks:v}=n,{splittableMarks:y}=i.extensionManager,x=v||b.$to.parentOffset&&b.$from.marks();if(r.split(l.pos,2,g).scrollIntoView(),!x||!o)return !0;let E=x.filter(S=>y.includes(S.type.name));r.ensureMarks(E);}return !0},$p=(t,e)=>{let r=kc(s=>s.type===e)(t.selection);if(!r)return !0;let n=t.doc.resolve(Math.max(0,r.pos-1)).before(r.depth);if(n===void 0)return !0;let o=t.doc.nodeAt(n);return r.node.type===o?.type&&Rr(t.doc,r.pos)&&t.join(r.pos),!0},Bp=(t,e)=>{let r=kc(s=>s.type===e)(t.selection);if(!r)return !0;let n=t.doc.resolve(r.start).after(r.depth);if(n===void 0)return !0;let o=t.doc.nodeAt(n);return r.node.type===o?.type&&Rr(t.doc,n)&&t.join(n),!0},FI=(t,e,r,n={})=>({editor:o,tr:i,state:s,dispatch:a,chain:l,commands:c,can:d})=>{let{extensions:u,splittableMarks:f}=o.extensionManager,p=at(t,s.schema),h=at(e,s.schema),{selection:m,storedMarks:g}=s,{$from:b,$to:v}=m,y=b.blockRange(v),x=g||m.$to.parentOffset&&m.$from.marks();if(!y)return !1;let E=kc(S=>Ox(S.type.name,u))(m);if(y.depth>=1&&E&&y.depth-E.depth<=1){if(E.node.type===p)return c.liftListItem(h);if(Ox(E.node.type.name,u)&&p.validContent(E.node.content)&&a)return l().command(()=>(i.setNodeMarkup(E.pos,p),!0)).command(()=>$p(i,p)).command(()=>Bp(i,p)).run()}return !r||!x||!a?l().command(()=>d().wrapInList(p,n)?!0:c.clearNodes()).wrapInList(p,n).command(()=>$p(i,p)).command(()=>Bp(i,p)).run():l().command(()=>{let S=d().wrapInList(p,n),R=x.filter(w=>f.includes(w.type.name));return i.ensureMarks(R),S?!0:c.clearNodes()}).wrapInList(p,n).command(()=>$p(i,p)).command(()=>Bp(i,p)).run()},zI=(t,e={},r={})=>({state:n,commands:o})=>{let{extendEmptyMarkRange:i=!1}=r,s=Fn(t,n.schema);return zp(n,s,e)?o.unsetMark(s,{extendEmptyMarkRange:i}):o.setMark(s,e)},HI=(t,e,r={})=>({state:n,commands:o})=>{let i=at(t,n.schema),s=at(e,n.schema),a=dn(n,i,r),l;return n.selection.$anchor.sameParent(n.selection.$head)&&(l=n.selection.$anchor.parent.attrs),a?o.setNode(s,l):o.setNode(i,{...l,...r})},UI=(t,e={})=>({state:r,commands:n})=>{let o=at(t,r.schema);return dn(r,o,e)?n.lift(o):n.wrapIn(o,e)},VI=()=>({state:t,dispatch:e})=>{let r=t.plugins;for(let n=0;n<r.length;n+=1){let o=r[n],i;if(o.spec.isInputRules&&(i=o.getState(t))){if(e){let s=t.tr,a=i.transform;for(let l=a.steps.length-1;l>=0;l-=1)s.step(a.steps[l].invert(a.docs[l]));if(i.text){let l=s.doc.resolve(i.from).marks();s.replaceWith(i.from,i.to,t.schema.text(i.text,l));}else s.delete(i.from,i.to);}return !0}}return !1},KI=()=>({tr:t,dispatch:e})=>{let{selection:r}=t,{empty:n,ranges:o}=r;return n||e&&o.forEach(i=>{t.removeMark(i.$from.pos,i.$to.pos);}),!0},WI=(t,e={})=>({tr:r,state:n,dispatch:o})=>{var i;let{extendEmptyMarkRange:s=!1}=e,{selection:a}=r,l=Fn(t,n.schema),{$from:c,empty:d,ranges:u}=a;if(!o)return !0;if(d&&s){let{from:f,to:p}=a,h=(i=c.marks().find(g=>g.type===l))==null?void 0:i.attrs,m=Yp(c,l,h);m&&(f=m.from,p=m.to),r.removeMark(f,p,l);}else u.forEach(f=>{r.removeMark(f.$from.pos,f.$to.pos,l);});return r.removeStoredMark(l),!0},GI=(t,e={})=>({tr:r,state:n,dispatch:o})=>{let i=null,s=null,a=Sc(typeof t=="string"?t:t.name,n.schema);return a?(a==="node"&&(i=at(t,n.schema)),a==="mark"&&(s=Fn(t,n.schema)),o&&r.selection.ranges.forEach(l=>{let c=l.$from.pos,d=l.$to.pos,u,f,p,h;r.selection.empty?n.doc.nodesBetween(c,d,(m,g)=>{i&&i===m.type&&(p=Math.max(g,c),h=Math.min(g+m.nodeSize,d),u=g,f=m);}):n.doc.nodesBetween(c,d,(m,g)=>{g<c&&i&&i===m.type&&(p=Math.max(g,c),h=Math.min(g+m.nodeSize,d),u=g,f=m),g>=c&&g<=d&&(i&&i===m.type&&r.setNodeMarkup(g,void 0,{...m.attrs,...e}),s&&m.marks.length&&m.marks.forEach(b=>{if(s===b.type){let v=Math.max(g,c),y=Math.min(g+m.nodeSize,d);r.addMark(v,y,s.create({...b.attrs,...e}));}}));}),f&&(u!==void 0&&r.setNodeMarkup(u,void 0,{...f.attrs,...e}),s&&f.marks.length&&f.marks.forEach(m=>{s===m.type&&r.addMark(p,h,s.create({...m.attrs,...e}));}));}),!0):!1},qI=(t,e={})=>({state:r,dispatch:n})=>{let o=at(t,r.schema);return Sx(o,e)(r,n)},jI=(t,e={})=>({state:r,dispatch:n})=>{let o=at(t,r.schema);return Cx(o,e)(r,n)},rE=se.create({name:"commands",addCommands(){return {...eE}}}),nE=se.create({name:"delete",onUpdate({transaction:t,appendedTransactions:e}){var r,n,o;let i=()=>{var s,a,l,c;if((c=(l=(a=(s=this.editor.options.coreExtensionOptions)==null?void 0:s.delete)==null?void 0:a.filterTransaction)==null?void 0:l.call(a,t))!=null?c:t.getMeta("y-sync$"))return;let d=Hp(t.before,[t,...e]);qp(d).forEach(p=>{d.mapping.mapResult(p.oldRange.from).deletedAfter&&d.mapping.mapResult(p.oldRange.to).deletedBefore&&d.before.nodesBetween(p.oldRange.from,p.oldRange.to,(h,m)=>{let g=m+h.nodeSize-2,b=p.oldRange.from<=m&&g<=p.oldRange.to;this.editor.emit("delete",{type:"node",node:h,from:m,to:g,newFrom:d.mapping.map(m),newTo:d.mapping.map(g),deletedRange:p.oldRange,newRange:p.newRange,partial:!b,editor:this.editor,transaction:t,combinedTransform:d});});});let f=d.mapping;d.steps.forEach((p,h)=>{var m,g;if(p instanceof lr){let b=f.slice(h).map(p.from,-1),v=f.slice(h).map(p.to),y=f.invert().map(b,-1),x=f.invert().map(v),E=(m=d.doc.nodeAt(b-1))==null?void 0:m.marks.some(R=>R.eq(p.mark)),S=(g=d.doc.nodeAt(v))==null?void 0:g.marks.some(R=>R.eq(p.mark));this.editor.emit("delete",{type:"mark",mark:p.mark,from:p.from,to:p.to,deletedRange:{from:y,to:x},newRange:{from:b,to:v},partial:!!(S||E),editor:this.editor,transaction:t,combinedTransform:d});}});};(o=(n=(r=this.editor.options.coreExtensionOptions)==null?void 0:r.delete)==null?void 0:n.async)==null||o?setTimeout(i,0):i();}}),oE=se.create({name:"drop",addProseMirrorPlugins(){return [new oe({key:new ae("tiptapDrop"),props:{handleDrop:(t,e,r,n)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:r,moved:n});}}})]}}),iE=se.create({name:"editable",addProseMirrorPlugins(){return [new oe({key:new ae("editable"),props:{editable:()=>this.editor.options.editable}})]}}),sE=new ae("focusEvents"),aE=se.create({name:"focusEvents",addProseMirrorPlugins(){let{editor:t}=this;return [new oe({key:sE,props:{handleDOMEvents:{focus:(e,r)=>{t.isFocused=!0;let n=t.state.tr.setMeta("focus",{event:r}).setMeta("addToHistory",!1);return e.dispatch(n),!1},blur:(e,r)=>{t.isFocused=!1;let n=t.state.tr.setMeta("blur",{event:r}).setMeta("addToHistory",!1);return e.dispatch(n),!1}}}})]}}),lE=se.create({name:"keymap",addKeyboardShortcuts(){let t=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:a})=>{let{selection:l,doc:c}=a,{empty:d,$anchor:u}=l,{pos:f,parent:p}=u,h=u.parent.isTextblock&&f>0?a.doc.resolve(f-1):u,m=h.parent.type.spec.isolating,g=u.pos-u.parentOffset,b=m&&h.parent.childCount===1?g===u.pos:Z.atStart(c).from===f;return !d||!p.type.isTextblock||p.textContent.length||!b||b&&u.parent.type.name==="paragraph"?!1:s.clearNodes()}),()=>s.deleteSelection(),()=>s.joinBackward(),()=>s.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:s})=>[()=>s.deleteSelection(),()=>s.deleteCurrentNode(),()=>s.joinForward(),()=>s.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:s})=>[()=>s.newlineInCode(),()=>s.createParagraphNear(),()=>s.liftEmptyBlock(),()=>s.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},o={...n},i={...n,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Jp()||tE()?i:o},addProseMirrorPlugins(){return [new oe({key:new ae("clearDocument"),appendTransaction:(t,e,r)=>{if(t.some(m=>m.getMeta("composition")))return;let n=t.some(m=>m.docChanged)&&!e.doc.eq(r.doc),o=t.some(m=>m.getMeta("preventClearDocument"));if(!n||o)return;let{empty:i,from:s,to:a}=e.selection,l=Z.atStart(e.doc).from,c=Z.atEnd(e.doc).to;if(i||!(s===l&&a===c)||!va(r.doc))return;let f=r.tr,p=wc({state:r,transaction:f}),{commands:h}=new xc({editor:this.editor,state:p});if(h.clearNodes(),!!f.steps.length)return f}})]}}),cE=se.create({name:"paste",addProseMirrorPlugins(){return [new oe({key:new ae("tiptapPaste"),props:{handlePaste:(t,e,r)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:r});}}})]}}),dE=se.create({name:"tabindex",addProseMirrorPlugins(){return [new oe({key:new ae("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}}),YI=class as{constructor(e,r,n=!1,o=null){this.currentNode=null,this.actualDepth=null,this.isBlock=n,this.resolvedPos=e,this.editor=r,this.currentNode=o;}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return (e=this.actualDepth)!=null?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let r=this.from,n=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can\u2019t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}r=this.from+1,n=this.to-1;}this.editor.commands.insertContentAt({from:r,to:n},e);}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return {from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;let e=this.resolvedPos.start(this.resolvedPos.depth-1),r=this.resolvedPos.doc.resolve(e);return new as(r,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new as(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new as(e,this.editor)}get children(){let e=[];return this.node.content.forEach((r,n)=>{let o=r.isBlock&&!r.isTextblock,i=r.isAtom&&!r.isText,s=this.pos+n+(i?0:1);if(s<0||s>this.resolvedPos.doc.nodeSize-2)return;let a=this.resolvedPos.doc.resolve(s);if(!o&&a.depth<=this.depth)return;let l=new as(a,this.editor,o,o?r:null);o&&(l.actualDepth=this.depth+1),e.push(new as(a,this.editor,o,o?r:null));}),e}get firstChild(){return this.children[0]||null}get lastChild(){let e=this.children;return e[e.length-1]||null}closest(e,r={}){let n=null,o=this.parent;for(;o&&!n;){if(o.node.type.name===e)if(Object.keys(r).length>0){let i=o.node.attrs,s=Object.keys(r);for(let a=0;a<s.length;a+=1){let l=s[a];if(i[l]!==r[l])break}}else n=o;o=o.parent;}return n}querySelector(e,r={}){return this.querySelectorAll(e,r,!0)[0]||null}querySelectorAll(e,r={},n=!1){let o=[];if(!this.children||this.children.length===0)return o;let i=Object.keys(r);return this.children.forEach(s=>{n&&o.length>0||(s.node.type.name===e&&i.every(l=>r[l]===s.node.attrs[l])&&o.push(s),!(n&&o.length>0)&&(o=o.concat(s.querySelectorAll(e,r,n))));}),o}setAttribute(e){let{tr:r}=this.editor.state;r.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(r);}},XI=`.ProseMirror {
|
|
38
107
|
position: relative;
|
|
39
108
|
}
|
|
40
109
|
|
|
@@ -104,19 +173,21 @@ img.ProseMirror-separator {
|
|
|
104
173
|
|
|
105
174
|
.ProseMirror-focused .ProseMirror-gapcursor {
|
|
106
175
|
display: block;
|
|
107
|
-
}`;function
|
|
176
|
+
}`;function JI(t,e,r){let n=document.querySelector(`style[data-tiptap-style${r?`-${r}`:""}]`);if(n!==null)return n;let o=document.createElement("style");return e&&o.setAttribute("nonce",e),o.setAttribute(`data-tiptap-style${r?`-${r}`:""}`,""),o.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(o),o}var uE=class extends v2{constructor(t={}){super(),this.css=null,this.editorView=null,this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:typeof document<"u"?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:n})=>{throw n},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(t),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("contentError",this.options.onContentError),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:n,slice:o,moved:i})=>this.options.onDrop(n,o,i)),this.on("paste",({event:n,slice:o})=>this.options.onPaste(n,o)),this.on("delete",this.options.onDelete);let e=this.createDoc(),r=Yx(e,this.options.autofocus);this.editorState=On.create({doc:e,schema:this.schema,selection:r||void 0}),this.options.element&&this.mount(this.options.element);}mount(t){if(typeof document>"u")throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(t),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0);},0);}unmount(){var t;if(this.editorView){let e=this.editorView.dom;e?.editor&&delete e.editor,this.editorView.destroy();}this.editorView=null,this.isInitialized=!1,(t=this.css)==null||t.remove(),this.css=null;}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&typeof document<"u"&&(this.css=JI(XI,this.options.injectNonce));}setOptions(t={}){this.options={...this.options,...t},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state));}setEditable(t,e=!0){this.setOptions({editable:t}),e&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]});}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:t=>{this.editorState=t;},dispatch:t=>{this.editorState=this.state.apply(t);},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(t,e)=>{if(e==="state")return this.editorState;if(e in t)return Reflect.get(t,e);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${e}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(t,e){let r=Bx(e)?e(t,[...this.state.plugins]):[...this.state.plugins,t],n=this.state.reconfigure({plugins:r});return this.view.updateState(n),n}unregisterPlugin(t){if(this.isDestroyed)return;let e=this.state.plugins,r=e;if([].concat(t).forEach(o=>{let i=typeof o=="string"?`${o}$`:o.key;r=r.filter(s=>!s.key.startsWith(i));}),e.length===r.length)return;let n=this.state.reconfigure({plugins:r});return this.view.updateState(n),n}createExtensionManager(){var t,e;let n=[...this.options.enableCoreExtensions?[iE,Qx.configure({blockSeparator:(e=(t=this.options.coreExtensionOptions)==null?void 0:t.clipboardTextSerializer)==null?void 0:e.blockSeparator}),rE,aE,lE,dE,oE,cE,nE].filter(o=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[o.name]!==!1:!0):[],...this.options.extensions].filter(o=>["extension","node","mark"].includes(o?.type));this.extensionManager=new Tc(n,this);}createCommandManager(){this.commandManager=new xc({editor:this});}createSchema(){this.schema=this.extensionManager.schema;}createDoc(){let t;try{t=Fp(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck});}catch(e){if(!(e instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(e.message))throw e;this.emit("contentError",{editor:this,error:e,disableCollaboration:()=>{"collaboration"in this.storage&&typeof this.storage.collaboration=="object"&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(r=>r.name!=="collaboration"),this.createExtensionManager();}}),t=Fp(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1});}return t}createView(t){var e;this.editorView=new fa(t,{...this.options.editorProps,attributes:{role:"textbox",...(e=this.options.editorProps)==null?void 0:e.attributes},dispatchTransaction:this.dispatchTransaction.bind(this),state:this.editorState});let r=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(r),this.createNodeViews(),this.prependClass(),this.injectCSS();let n=this.view.dom;n.editor=this;}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`;}captureTransaction(t){this.isCapturingTransaction=!0,t(),this.isCapturingTransaction=!1;let e=this.capturedTransaction;return this.capturedTransaction=null,e}dispatchTransaction(t){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=t;return}t.steps.forEach(c=>{var d;return (d=this.capturedTransaction)==null?void 0:d.step(c)});return}let{state:e,transactions:r}=this.state.applyTransaction(t),n=!this.state.selection.eq(e.selection),o=r.includes(t),i=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:t,nextState:e}),!o)return;this.view.updateState(e),this.emit("transaction",{editor:this,transaction:t,appendedTransactions:r.slice(1)}),n&&this.emit("selectionUpdate",{editor:this,transaction:t});let s=r.findLast(c=>c.getMeta("focus")||c.getMeta("blur")),a=s?.getMeta("focus"),l=s?.getMeta("blur");a&&this.emit("focus",{editor:this,event:a.event,transaction:s}),l&&this.emit("blur",{editor:this,event:l.event,transaction:s}),!(t.getMeta("preventUpdate")||!r.some(c=>c.docChanged)||i.doc.eq(e.doc))&&this.emit("update",{editor:this,transaction:t,appendedTransactions:r.slice(1)});}getAttributes(t){return Gp(this.state,t)}isActive(t,e){let r=typeof t=="string"?t:null,n=typeof t=="string"?e:t;return _2(this.state,r,n)}getJSON(){return this.state.doc.toJSON()}getHTML(){return Kp(this.state.doc.content,this.schema)}getText(t){let{blockSeparator:e=`
|
|
108
177
|
|
|
109
|
-
`,textSerializers:n={}}=t||{};return Cx(this.state.doc,{blockSeparator:e,textSerializers:{...zp(this.schema),...n}})}get isEmpty(){return Li(this.state.doc)}destroy(){this.emit("destroy"),this.unmount(),this.removeAllListeners();}get isDestroyed(){var t,e;return (e=(t=this.editorView)==null?void 0:t.isDestroyed)!=null?e:!0}$node(t,e){var n;return ((n=this.$doc)==null?void 0:n.querySelector(t,e))||null}$nodes(t,e){var n;return ((n=this.$doc)==null?void 0:n.querySelectorAll(t,e))||null}$pos(t){let e=this.state.doc.resolve(t);return new JS(e,this)}get $doc(){return this.$pos(0)}};function Pt(t){return new Pi({find:t.find,handler:({state:e,range:n,match:r})=>{let i=Se(t.getAttributes,void 0,r);if(i===!1||i===null)return null;let{tr:o}=e,s=r[r.length-1],a=r[0];if(s){let l=a.search(/\S/),c=n.from+a.indexOf(s),d=c+s.length;if(Yo(n.from,n.to,e.doc).filter(p=>p.mark.type.excluded.find(m=>m===t.type&&m!==p.mark.type)).filter(p=>p.to>c).length)return null;d<n.to&&o.delete(d,n.to),c>n.from&&o.delete(n.from+l,c);let f=n.from+l+s.length;o.addMark(n.from+l,f,t.type.create(i||{})),o.removeStoredMark(t.type);}}})}function Qo(t){return new Pi({find:t.find,handler:({state:e,range:n,match:r})=>{let i=Se(t.getAttributes,void 0,r)||{},{tr:o}=e,s=n.from,a=n.to,l=t.type.create(i);if(r[1]){let c=r[0].lastIndexOf(r[1]),d=s+c;d>a?d=a:a=d+r[1].length;let u=r[0][r[0].length-1];o.insertText(u,s+r[0].length-1),o.replaceWith(d,a,l);}else if(r[0]){let c=t.type.isInline?s:s-1;o.insert(c,t.type.create(i)).delete(o.mapping.map(s),o.mapping.map(a));}o.scrollIntoView();}})}function Bi(t){return new Pi({find:t.find,handler:({state:e,range:n,match:r})=>{let i=e.doc.resolve(n.from),o=Se(t.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,o);}})}function Ie(t){return new Pi({find:t.find,handler:({state:e,range:n,match:r})=>{let i=t.replace,o=n.from,s=n.to;if(r[1]){let a=r[0].lastIndexOf(r[1]);i+=r[0].slice(a+r[1].length),o+=a;let l=o-s;l>0&&(i=r[0].slice(a-l,a)+i,o=s);}e.tr.insertText(i,o,s);}})}function en(t){return new Pi({find:t.find,handler:({state:e,range:n,match:r,chain:i})=>{let o=Se(t.getAttributes,void 0,r)||{},s=e.tr.delete(n.from,n.to),l=s.doc.resolve(n.from).blockRange(),c=l&&Ir(l,t.type,o);if(!c)return null;if(s.wrap(l,c),t.keepMarks&&t.editor){let{selection:u,storedMarks:f}=e,{splittableMarks:p}=t.editor.extensionManager,h=f||u.$to.parentOffset&&u.$from.marks();if(h){let m=h.filter(g=>p.includes(g.type.name));s.ensureMarks(m);}}if(t.keepAttributes){let u=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(u,o).run();}let d=s.doc.resolve(n.from-1).nodeBefore;d&&d.type===t.type&&Rt(s.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,d))&&s.join(n.from-1);}})}function lh(t,e){let{selection:n}=t,{$from:r}=n;if(n instanceof W){let o=r.index();return r.parent.canReplaceWith(o,o+1,e)}let i=r.depth;for(;i>=0;){let o=r.index(i);if(r.node(i).contentMatchAt(o).matchType(e))return !0;i-=1;}return !1}function XS(t,e,n={}){let{state:r}=e,{doc:i,tr:o}=r,s=t;i.descendants((a,l)=>{let c=o.mapping.map(l),d=o.mapping.map(l)+a.nodeSize,u=null;if(a.marks.forEach(p=>{if(p!==s)return !1;u=p;}),!u)return;let f=!1;if(Object.keys(n).forEach(p=>{n[p]!==u.attrs[p]&&(f=!0);}),f){let p=t.type.create({...t.attrs,...n});o.removeMark(c,d,t.type),o.addMark(c,d,p);}}),o.docChanged&&e.view.dispatch(o);}var ge=class ch extends ic{constructor(){super(...arguments),this.type="node";}static create(e={}){let n=typeof e=="function"?e():e;return new ch(n)}configure(e){return super.configure(e)}extend(e){let n=typeof e=="function"?e():e;return super.extend(n)}};function St(t){return new Lx({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:i})=>{let o=Se(t.getAttributes,void 0,r,i);if(o===!1||o===null)return null;let{tr:s}=e,a=r[r.length-1],l=r[0],c=n.to;if(a){let d=l.search(/\S/),u=n.from+l.indexOf(a),f=u+a.length;if(Yo(n.from,n.to,e.doc).filter(h=>h.mark.type.excluded.find(g=>g===t.type&&g!==h.mark.type)).filter(h=>h.to>u).length)return null;f<n.to&&s.delete(f,n.to),u>n.from&&s.delete(n.from+d,u),c=n.from+d+a.length,s.addMark(n.from+d,c,t.type.create(o||{})),s.removeStoredMark(t.type);}}})}var wh=ai(fi(),1),xh=ai(uh(),1),Sh=ai(gh(),1);var uC=(...t)=>e=>{t.forEach(n=>{typeof n=="function"?n(e):n&&(n.current=e);});},fC=({contentComponent:t})=>{let e=(0, yh.useSyncExternalStore)(t.subscribe,t.getSnapshot,t.getServerSnapshot);return jsxRuntime.jsx(jsxRuntime.Fragment,{children:Object.values(e)})};function pC(){let t=new Set,e={};return {subscribe(n){return t.add(n),()=>{t.delete(n);}},getSnapshot(){return e},getServerSnapshot(){return e},setRenderer(n,r){e={...e,[n]:cC__default.default.createPortal(r.reactElement,r.element,n)},t.forEach(i=>i());},removeRenderer(n){let r={...e};delete r[n],e=r,t.forEach(i=>i());}}}var hC=class extends Mn__default.default.Component{constructor(t){var e;super(t),this.editorContentRef=Mn__default.default.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:!!((e=t.editor)!=null&&e.contentComponent)};}componentDidMount(){this.init();}componentDidUpdate(){this.init();}init(){let t=this.props.editor;if(t&&!t.isDestroyed&&t.options.element){if(t.contentComponent)return;let e=this.editorContentRef.current;e.append(...t.options.element.childNodes),t.setOptions({element:e}),t.contentComponent=pC(),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=t.contentComponent.subscribe(()=>{this.setState(n=>n.hasContentComponentInitialized?n:{hasContentComponentInitialized:!0}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent();})),t.createNodeViews(),this.initialized=!0;}}componentWillUnmount(){var t;let e=this.props.editor;if(!e||(this.initialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),e.contentComponent=null,!((t=e.options.element)!=null&&t.firstChild)))return;let n=document.createElement("div");n.append(...e.options.element.childNodes),e.setOptions({element:n});}render(){let{editor:t,innerRef:e,...n}=this.props;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{ref:uC(e,this.editorContentRef),...n}),t?.contentComponent&&jsxRuntime.jsx(fC,{contentComponent:t.contentComponent})]})}},mC=Mn.forwardRef((t,e)=>{let n=Mn__default.default.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[t.editor]);return Mn__default.default.createElement(hC,{key:n,innerRef:e,...t})}),vh=Mn__default.default.memo(mC),CC=typeof window<"u"?Mn.useLayoutEffect:Mn.useEffect,kC=class{constructor(t){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=t,this.lastSnapshot={editor:t,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this);}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return {editor:null,transactionNumber:0}}subscribe(t){return this.subscribers.add(t),()=>{this.subscribers.delete(t);}}watch(t){if(this.editor=t,this.editor){let e=()=>{this.transactionNumber+=1,this.subscribers.forEach(r=>r());},n=this.editor;return n.on("transaction",e),()=>{n.off("transaction",e);}}}};function NC(t){var e;let[n]=Mn.useState(()=>new kC(t.editor)),r=(0, Sh.useSyncExternalStoreWithSelector)(n.subscribe,n.getSnapshot,n.getServerSnapshot,t.selector,(e=t.equalityFn)!=null?e:xh.default);return CC(()=>n.watch(t.editor),[t.editor,n]),Mn.useDebugValue(r),r}var bh=process.env.NODE_ENV!=="production",lc=typeof window>"u",TC=lc||!!(typeof window<"u"&&window.next),_C=class Ch{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this);}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(n=>n());}getInitialEditor(){if(this.options.current.immediatelyRender===void 0){if(lc||TC){if(bh)throw new Error("Tiptap Error: SSR has been detected, please set `immediatelyRender` explicitly to `false` to avoid hydration mismatches.");return null}return this.createEditor()}if(this.options.current.immediatelyRender&&lc&&bh)throw new Error("Tiptap Error: SSR has been detected, and `immediatelyRender` has been set to `true` this is an unsupported configuration that may result in errors, explicitly set `immediatelyRender` to `false` to avoid hydration mismatches.");return this.options.current.immediatelyRender?this.createEditor():null}createEditor(){let e={...this.options.current,onBeforeCreate:(...r)=>{var i,o;return (o=(i=this.options.current).onBeforeCreate)==null?void 0:o.call(i,...r)},onBlur:(...r)=>{var i,o;return (o=(i=this.options.current).onBlur)==null?void 0:o.call(i,...r)},onCreate:(...r)=>{var i,o;return (o=(i=this.options.current).onCreate)==null?void 0:o.call(i,...r)},onDestroy:(...r)=>{var i,o;return (o=(i=this.options.current).onDestroy)==null?void 0:o.call(i,...r)},onFocus:(...r)=>{var i,o;return (o=(i=this.options.current).onFocus)==null?void 0:o.call(i,...r)},onSelectionUpdate:(...r)=>{var i,o;return (o=(i=this.options.current).onSelectionUpdate)==null?void 0:o.call(i,...r)},onTransaction:(...r)=>{var i,o;return (o=(i=this.options.current).onTransaction)==null?void 0:o.call(i,...r)},onUpdate:(...r)=>{var i,o;return (o=(i=this.options.current).onUpdate)==null?void 0:o.call(i,...r)},onContentError:(...r)=>{var i,o;return (o=(i=this.options.current).onContentError)==null?void 0:o.call(i,...r)},onDrop:(...r)=>{var i,o;return (o=(i=this.options.current).onDrop)==null?void 0:o.call(i,...r)},onPaste:(...r)=>{var i,o;return (o=(i=this.options.current).onPaste)==null?void 0:o.call(i,...r)},onDelete:(...r)=>{var i,o;return (o=(i=this.options.current).onDelete)==null?void 0:o.call(i,...r)}};return new ah(e)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e);}}static compareOptions(e,n){return Object.keys(e).every(r=>["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(r)?!0:r==="extensions"&&e.extensions&&n.extensions?e.extensions.length!==n.extensions.length?!1:e.extensions.every((i,o)=>{var s;return i===((s=n.extensions)==null?void 0:s[o])}):e[r]===n[r])}onRender(e){return ()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&e.length===0?Ch.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(e),()=>{this.isComponentMounted=!1,this.scheduleDestroy();})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((r,i)=>r===e[i]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e;}scheduleDestroy(){let e=this.instanceId,n=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){n&&n.setOptions(this.options.current);return}n&&!n.isDestroyed&&(n.destroy(),this.instanceId===e&&this.setEditor(null));},1);}};function kh(t={},e=[]){let n=Mn.useRef(t);n.current=t;let[r]=Mn.useState(()=>new _C(n)),i=(0, wh.useSyncExternalStore)(r.subscribe,r.getEditor,r.getServerSnapshot);return Mn.useDebugValue(i),Mn.useEffect(r.onRender(e)),NC({editor:i,selector:({transactionNumber:o})=>t.shouldRerenderOnTransaction===!1||t.shouldRerenderOnTransaction===void 0?null:t.immediatelyRender&&o===0?0:o+1}),i}var MC=Mn.createContext({editor:null});MC.Consumer;var RC=Mn.createContext({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}});var DC=()=>Mn.useContext(RC);Mn__default.default.forwardRef((t,e)=>{let{onDragStart:n}=DC(),r=t.as||"div";return jsxRuntime.jsx(r,{...t,ref:e,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...t.style}})});Mn__default.default.createContext({markViewContentRef:()=>{}});var jr=(t,e)=>{if(t==="slot")return 0;if(t instanceof Function)return t(e);let{children:n,...r}=e??{};if(t==="svg")throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return [t,r,n]};var BC=/^\s*>\s$/,Nh=ge.create({name:"blockquote",addOptions(){return {HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return [{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return jr("blockquote",{...te(this.options.HTMLAttributes,t),children:jr("slot",{})})},addCommands(){return {setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return {"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return [en({find:BC,type:this.type})]}});var zC=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,FC=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,UC=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,HC=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,Th=nt.create({name:"bold",addOptions(){return {HTMLAttributes:{}}},parseHTML(){return [{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return jr("strong",{...te(this.options.HTMLAttributes,t),children:jr("slot",{})})},addCommands(){return {setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return {"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return [Pt({find:zC,type:this.type}),Pt({find:UC,type:this.type})]},addPasteRules(){return [St({find:FC,type:this.type}),St({find:HC,type:this.type})]}});var $C=/(^|[^`])`([^`]+)`(?!`)/,KC=/(^|[^`])`([^`]+)`(?!`)/g,_h=nt.create({name:"code",addOptions(){return {HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return [{tag:"code"}]},renderHTML({HTMLAttributes:t}){return ["code",te(this.options.HTMLAttributes,t),0]},addCommands(){return {setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return {"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return [Pt({find:$C,type:this.type})]},addPasteRules(){return [St({find:KC,type:this.type})]}});var VC=/^```([a-z]+)?[\s\n]$/,WC=/^~~~([a-z]+)?[\s\n]$/,cc=ge.create({name:"codeBlock",addOptions(){return {languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return {language:{default:this.options.defaultLanguage,parseHTML:t=>{var e;let{languageClassPrefix:n}=this.options,o=[...((e=t.firstElementChild)==null?void 0:e.classList)||[]].filter(s=>s.startsWith(n)).map(s=>s.replace(n,""))[0];return o||null},rendered:!1}}},parseHTML(){return [{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return ["pre",te(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},addCommands(){return {setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return {"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{let{empty:t,$anchor:e}=this.editor.state.selection,n=e.pos===1;return !t||e.parent.type.name!==this.name?!1:n||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return !1;let{state:e}=t,{selection:n}=e,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return !1;let o=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith(`
|
|
178
|
+
`,textSerializers:r={}}=t||{};return S2(this.state.doc,{blockSeparator:e,textSerializers:{...Ux(this.schema),...r}})}get isEmpty(){return va(this.state.doc)}destroy(){this.emit("destroy"),this.unmount(),this.removeAllListeners();}get isDestroyed(){var t,e;return (e=(t=this.editorView)==null?void 0:t.isDestroyed)!=null?e:!0}$node(t,e){var r;return ((r=this.$doc)==null?void 0:r.querySelector(t,e))||null}$nodes(t,e){var r;return ((r=this.$doc)==null?void 0:r.querySelectorAll(t,e))||null}$pos(t){let e=this.state.doc.resolve(t);return new YI(e,this)}get $doc(){return this.$pos(0)}};function Mr(t){return new ya({find:t.find,handler:({state:e,range:r,match:n})=>{let o=Ie(t.getAttributes,void 0,n);if(o===!1||o===null)return null;let{tr:i}=e,s=n[n.length-1],a=n[0];if(s){let l=a.search(/\S/),c=r.from+a.indexOf(s),d=c+s.length;if(Cc(r.from,r.to,e.doc).filter(p=>p.mark.type.excluded.find(m=>m===t.type&&m!==p.mark.type)).filter(p=>p.to>c).length)return null;d<r.to&&i.delete(d,r.to),c>r.from&&i.delete(r.from+l,c);let f=r.from+l+s.length;i.addMark(r.from+l,f,t.type.create(o||{})),i.removeStoredMark(t.type);}}})}function Nc(t){return new ya({find:t.find,handler:({state:e,range:r,match:n})=>{let o=Ie(t.getAttributes,void 0,n)||{},{tr:i}=e,s=r.from,a=r.to,l=t.type.create(o);if(n[1]){let c=n[0].lastIndexOf(n[1]),d=s+c;d>a?d=a:a=d+n[1].length;let u=n[0][n[0].length-1];i.insertText(u,s+n[0].length-1),i.replaceWith(d,a,l);}else if(n[0]){let c=t.type.isInline?s:s-1;i.insert(c,t.type.create(o)).delete(i.mapping.map(s),i.mapping.map(a));}i.scrollIntoView();}})}function wa(t){return new ya({find:t.find,handler:({state:e,range:r,match:n})=>{let o=e.doc.resolve(r.from),i=Ie(t.getAttributes,void 0,n)||{};if(!o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),t.type))return null;e.tr.delete(r.from,r.to).setBlockType(r.from,r.from,t.type,i);}})}function tt(t){return new ya({find:t.find,handler:({state:e,range:r,match:n})=>{let o=t.replace,i=r.from,s=r.to;if(n[1]){let a=n[0].lastIndexOf(n[1]);o+=n[0].slice(a+n[1].length),i+=a;let l=i-s;l>0&&(o=n[0].slice(a-l,a)+o,i=s);}e.tr.insertText(o,i,s);}})}function un(t){return new ya({find:t.find,handler:({state:e,range:r,match:n,chain:o})=>{let i=Ie(t.getAttributes,void 0,n)||{},s=e.tr.delete(r.from,r.to),l=s.doc.resolve(r.from).blockRange(),c=l&&qi(l,t.type,i);if(!c)return null;if(s.wrap(l,c),t.keepMarks&&t.editor){let{selection:u,storedMarks:f}=e,{splittableMarks:p}=t.editor.extensionManager,h=f||u.$to.parentOffset&&u.$from.marks();if(h){let m=h.filter(g=>p.includes(g.type.name));s.ensureMarks(m);}}if(t.keepAttributes){let u=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";o().updateAttributes(u,i).run();}let d=s.doc.resolve(r.from-1).nodeBefore;d&&d.type===t.type&&Rr(s.doc,r.from-1)&&(!t.joinPredicate||t.joinPredicate(n,d))&&s.join(r.from-1);}})}function fE(t,e){let{selection:r}=t,{$from:n}=r;if(r instanceof X){let i=n.index();return n.parent.canReplaceWith(i,i+1,e)}let o=n.depth;for(;o>=0;){let i=n.index(o);if(n.node(o).contentMatchAt(i).matchType(e))return !0;o-=1;}return !1}function ZI(t,e,r={}){let{state:n}=e,{doc:o,tr:i}=n,s=t;o.descendants((a,l)=>{let c=i.mapping.map(l),d=i.mapping.map(l)+a.nodeSize,u=null;if(a.marks.forEach(p=>{if(p!==s)return !1;u=p;}),!u)return;let f=!1;if(Object.keys(r).forEach(p=>{r[p]!==u.attrs[p]&&(f=!0);}),f){let p=t.type.create({...t.attrs,...r});i.removeMark(c,d,t.type),i.addMark(c,d,p);}}),i.docChanged&&e.view.dispatch(i);}var Ne=class pE extends Xp{constructor(){super(...arguments),this.type="node";}static create(e={}){let r=typeof e=="function"?e():e;return new pE(r)}configure(e){return super.configure(e)}extend(e){let r=typeof e=="function"?e():e;return super.extend(r)}};function dr(t){return new I2({find:t.find,handler:({state:e,range:r,match:n,pasteEvent:o})=>{let i=Ie(t.getAttributes,void 0,n,o);if(i===!1||i===null)return null;let{tr:s}=e,a=n[n.length-1],l=n[0],c=r.to;if(a){let d=l.search(/\S/),u=r.from+l.indexOf(a),f=u+a.length;if(Cc(r.from,r.to,e.doc).filter(h=>h.mark.type.excluded.find(g=>g===t.type&&g!==h.mark.type)).filter(h=>h.to>u).length)return null;f<r.to&&s.delete(f,r.to),u>r.from&&s.delete(r.from+d,u),c=r.from+d+a.length,s.addMark(r.from+d,c,t.type.create(i||{})),s.removeStoredMark(t.type);}}})}var CE=ks(Ys(),1),RE=ks(mE(),1),TE=ks(wE(),1);var uL=(...t)=>e=>{t.forEach(r=>{typeof r=="function"?r(e):r&&(r.current=e);});},fL=({contentComponent:t})=>{let e=(0, EE.useSyncExternalStore)(t.subscribe,t.getSnapshot,t.getServerSnapshot);return jsxRuntime.jsx(jsxRuntime.Fragment,{children:Object.values(e)})};function pL(){let t=new Set,e={};return {subscribe(r){return t.add(r),()=>{t.delete(r);}},getSnapshot(){return e},getServerSnapshot(){return e},setRenderer(r,n){e={...e,[r]:Dg__namespace.default.createPortal(n.reactElement,n.element,r)},t.forEach(o=>o());},removeRenderer(r){let n={...e};delete n[r],e=n,t.forEach(o=>o());}}}var hL=class extends ee__namespace.default.Component{constructor(t){var e;super(t),this.editorContentRef=ee__namespace.default.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:!!((e=t.editor)!=null&&e.contentComponent)};}componentDidMount(){this.init();}componentDidUpdate(){this.init();}init(){let t=this.props.editor;if(t&&!t.isDestroyed&&t.options.element){if(t.contentComponent)return;let e=this.editorContentRef.current;e.append(...t.options.element.childNodes),t.setOptions({element:e}),t.contentComponent=pL(),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=t.contentComponent.subscribe(()=>{this.setState(r=>r.hasContentComponentInitialized?r:{hasContentComponentInitialized:!0}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent();})),t.createNodeViews(),this.initialized=!0;}}componentWillUnmount(){var t;let e=this.props.editor;if(!e||(this.initialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),e.contentComponent=null,!((t=e.options.element)!=null&&t.firstChild)))return;let r=document.createElement("div");r.append(...e.options.element.childNodes),e.setOptions({element:r});}render(){let{editor:t,innerRef:e,...r}=this.props;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{ref:uL(e,this.editorContentRef),...r}),t?.contentComponent&&jsxRuntime.jsx(fL,{contentComponent:t.contentComponent})]})}},mL=ee.forwardRef((t,e)=>{let r=ee__namespace.default.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[t.editor]);return ee__namespace.default.createElement(hL,{key:r,innerRef:e,...t})}),SE=ee__namespace.default.memo(mL),SL=typeof window<"u"?ee.useLayoutEffect:ee.useEffect,CL=class{constructor(t){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=t,this.lastSnapshot={editor:t,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this);}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return {editor:null,transactionNumber:0}}subscribe(t){return this.subscribers.add(t),()=>{this.subscribers.delete(t);}}watch(t){if(this.editor=t,this.editor){let e=()=>{this.transactionNumber+=1,this.subscribers.forEach(n=>n());},r=this.editor;return r.on("transaction",e),()=>{r.off("transaction",e);}}}};function RL(t){var e;let[r]=ee.useState(()=>new CL(t.editor)),n=(0, TE.useSyncExternalStoreWithSelector)(r.subscribe,r.getSnapshot,r.getServerSnapshot,t.selector,(e=t.equalityFn)!=null?e:RE.default);return SL(()=>r.watch(t.editor),[t.editor,r]),ee.useDebugValue(n),n}var xE=process.env.NODE_ENV!=="production",eh=typeof window>"u",TL=eh||!!(typeof window<"u"&&window.next),NL=class NE{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this);}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(r=>r());}getInitialEditor(){if(this.options.current.immediatelyRender===void 0){if(eh||TL){if(xE)throw new Error("Tiptap Error: SSR has been detected, please set `immediatelyRender` explicitly to `false` to avoid hydration mismatches.");return null}return this.createEditor()}if(this.options.current.immediatelyRender&&eh&&xE)throw new Error("Tiptap Error: SSR has been detected, and `immediatelyRender` has been set to `true` this is an unsupported configuration that may result in errors, explicitly set `immediatelyRender` to `false` to avoid hydration mismatches.");return this.options.current.immediatelyRender?this.createEditor():null}createEditor(){let e={...this.options.current,onBeforeCreate:(...n)=>{var o,i;return (i=(o=this.options.current).onBeforeCreate)==null?void 0:i.call(o,...n)},onBlur:(...n)=>{var o,i;return (i=(o=this.options.current).onBlur)==null?void 0:i.call(o,...n)},onCreate:(...n)=>{var o,i;return (i=(o=this.options.current).onCreate)==null?void 0:i.call(o,...n)},onDestroy:(...n)=>{var o,i;return (i=(o=this.options.current).onDestroy)==null?void 0:i.call(o,...n)},onFocus:(...n)=>{var o,i;return (i=(o=this.options.current).onFocus)==null?void 0:i.call(o,...n)},onSelectionUpdate:(...n)=>{var o,i;return (i=(o=this.options.current).onSelectionUpdate)==null?void 0:i.call(o,...n)},onTransaction:(...n)=>{var o,i;return (i=(o=this.options.current).onTransaction)==null?void 0:i.call(o,...n)},onUpdate:(...n)=>{var o,i;return (i=(o=this.options.current).onUpdate)==null?void 0:i.call(o,...n)},onContentError:(...n)=>{var o,i;return (i=(o=this.options.current).onContentError)==null?void 0:i.call(o,...n)},onDrop:(...n)=>{var o,i;return (i=(o=this.options.current).onDrop)==null?void 0:i.call(o,...n)},onPaste:(...n)=>{var o,i;return (i=(o=this.options.current).onPaste)==null?void 0:i.call(o,...n)},onDelete:(...n)=>{var o,i;return (i=(o=this.options.current).onDelete)==null?void 0:i.call(o,...n)}};return new uE(e)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e);}}static compareOptions(e,r){return Object.keys(e).every(n=>["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(n)?!0:n==="extensions"&&e.extensions&&r.extensions?e.extensions.length!==r.extensions.length?!1:e.extensions.every((o,i)=>{var s;return o===((s=r.extensions)==null?void 0:s[i])}):e[n]===r[n])}onRender(e){return ()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&e.length===0?NE.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(e),()=>{this.isComponentMounted=!1,this.scheduleDestroy();})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((n,o)=>n===e[o]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e;}scheduleDestroy(){let e=this.instanceId,r=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){r&&r.setOptions(this.options.current);return}r&&!r.isDestroyed&&(r.destroy(),this.instanceId===e&&this.setEditor(null));},1);}};function _E(t={},e=[]){let r=ee.useRef(t);r.current=t;let[n]=ee.useState(()=>new NL(r)),o=(0, CE.useSyncExternalStore)(n.subscribe,n.getEditor,n.getServerSnapshot);return ee.useDebugValue(o),ee.useEffect(n.onRender(e)),RL({editor:o,selector:({transactionNumber:i})=>t.shouldRerenderOnTransaction===!1||t.shouldRerenderOnTransaction===void 0?null:t.immediatelyRender&&i===0?0:i+1}),o}var _L=ee.createContext({editor:null});_L.Consumer;var OL=ee.createContext({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}});var DL=()=>ee.useContext(OL);ee__namespace.default.forwardRef((t,e)=>{let{onDragStart:r}=DL(),n=t.as||"div";return jsxRuntime.jsx(n,{...t,ref:e,"data-node-view-wrapper":"",onDragStart:r,style:{whiteSpace:"normal",...t.style}})});ee__namespace.default.createContext({markViewContentRef:()=>{}});var ls=(t,e)=>{if(t==="slot")return 0;if(t instanceof Function)return t(e);let{children:r,...n}=e??{};if(t==="svg")throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return [t,n,r]};var $L=/^\s*>\s$/,ME=Ne.create({name:"blockquote",addOptions(){return {HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return [{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return ls("blockquote",{...ie(this.options.HTMLAttributes,t),children:ls("slot",{})})},addCommands(){return {setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return {"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return [un({find:$L,type:this.type})]}});var BL=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,FL=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,zL=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,HL=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,AE=Pt.create({name:"bold",addOptions(){return {HTMLAttributes:{}}},parseHTML(){return [{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return ls("strong",{...ie(this.options.HTMLAttributes,t),children:ls("slot",{})})},addCommands(){return {setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return {"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return [Mr({find:BL,type:this.type}),Mr({find:zL,type:this.type})]},addPasteRules(){return [dr({find:FL,type:this.type}),dr({find:HL,type:this.type})]}});var UL=/(^|[^`])`([^`]+)`(?!`)/,VL=/(^|[^`])`([^`]+)`(?!`)/g,OE=Pt.create({name:"code",addOptions(){return {HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return [{tag:"code"}]},renderHTML({HTMLAttributes:t}){return ["code",ie(this.options.HTMLAttributes,t),0]},addCommands(){return {setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return {"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return [Mr({find:UL,type:this.type})]},addPasteRules(){return [dr({find:VL,type:this.type})]}});var KL=/^```([a-z]+)?[\s\n]$/,WL=/^~~~([a-z]+)?[\s\n]$/,th=Ne.create({name:"codeBlock",addOptions(){return {languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return {language:{default:this.options.defaultLanguage,parseHTML:t=>{var e;let{languageClassPrefix:r}=this.options,i=[...((e=t.firstElementChild)==null?void 0:e.classList)||[]].filter(s=>s.startsWith(r)).map(s=>s.replace(r,""))[0];return i||null},rendered:!1}}},parseHTML(){return [{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return ["pre",ie(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},addCommands(){return {setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return {"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{let{empty:t,$anchor:e}=this.editor.state.selection,r=e.pos===1;return !t||e.parent.type.name!==this.name?!1:r||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return !1;let{state:e}=t,{selection:r}=e,{$from:n,empty:o}=r;if(!o||n.parent.type!==this.type)return !1;let i=n.parentOffset===n.parent.nodeSize-2,s=n.parent.textContent.endsWith(`
|
|
110
179
|
|
|
111
|
-
`);return !
|
|
112
|
-
`));return s.replaceSelectionWith(this.type.create({language:
|
|
113
|
-
`},addCommands(){return {setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{let{selection:i,storedMarks:o}=n;if(i.$from.parent.type.spec.isolating)return !1;let{keepMarks:s}=this.options,{splittableMarks:a}=r.extensionManager,l=o||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:c,dispatch:d})=>{if(d&&l&&s){let u=l.filter(f=>a.includes(f.type.name));c.ensureMarks(u);}return !0}).run()})])}},addKeyboardShortcuts(){return {"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}});var Rh=ge.create({name:"heading",addOptions(){return {levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return {level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return [`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,te(this.options.HTMLAttributes,e),0]},addCommands(){return {setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>Bi({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}});var Dh=ge.create({name:"horizontalRule",addOptions(){return {HTMLAttributes:{}}},group:"block",parseHTML(){return [{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return ["hr",te(this.options.HTMLAttributes,t)]},addCommands(){return {setHorizontalRule:()=>({chain:t,state:e})=>{if(!lh(e,e.schema.nodes[this.name]))return !1;let{selection:n}=e,{$to:r}=n,i=t();return Zo(n)?i.insertContentAt(r.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({tr:o,dispatch:s})=>{var a;if(s){let{$to:l}=o.selection,c=l.end();if(l.nodeAfter)l.nodeAfter.isTextblock?o.setSelection(H.create(o.doc,l.pos+1)):l.nodeAfter.isBlock?o.setSelection(W.create(o.doc,l.pos)):o.setSelection(H.create(o.doc,l.pos));else {let d=(a=l.parent.type.contentMatch.defaultType)==null?void 0:a.create();d&&(o.insert(c,d),o.setSelection(H.create(o.doc,c+1)));}o.scrollIntoView();}return !0}).run()}}},addInputRules(){return [Qo({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}});var GC=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,qC=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,jC=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,JC=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,Ih=nt.create({name:"italic",addOptions(){return {HTMLAttributes:{}}},parseHTML(){return [{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return ["em",te(this.options.HTMLAttributes,t),0]},addCommands(){return {setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return {"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return [Pt({find:GC,type:this.type}),Pt({find:jC,type:this.type})]},addPasteRules(){return [St({find:qC,type:this.type}),St({find:JC,type:this.type})]}});var YC="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5m\xF6gensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",ZC="\u03B5\u03BB1\u03C52\u0431\u04331\u0435\u043B3\u0434\u0435\u0442\u04384\u0435\u044E2\u043A\u0430\u0442\u043E\u043B\u0438\u043A6\u043E\u043C3\u043C\u043A\u04342\u043E\u043D1\u0441\u043A\u0432\u04306\u043E\u043D\u043B\u0430\u0439\u043D5\u0440\u04333\u0440\u0443\u04412\u04442\u0441\u0430\u0439\u04423\u0440\u04313\u0443\u043A\u04403\u049B\u0430\u04373\u0570\u0561\u05753\u05D9\u05E9\u05E8\u05D0\u05DC5\u05E7\u05D5\u05DD3\u0627\u0628\u0648\u0638\u0628\u064A5\u0631\u0627\u0645\u0643\u06485\u0644\u0627\u0631\u062F\u06464\u0628\u062D\u0631\u064A\u06465\u062C\u0632\u0627\u0626\u06315\u0633\u0639\u0648\u062F\u064A\u06296\u0639\u0644\u064A\u0627\u06465\u0645\u063A\u0631\u06285\u0645\u0627\u0631\u0627\u062A5\u06CC\u0631\u0627\u06465\u0628\u0627\u0631\u062A2\u0632\u0627\u06314\u064A\u062A\u06433\u06BE\u0627\u0631\u062A5\u062A\u0648\u0646\u06334\u0633\u0648\u062F\u0627\u06463\u0631\u064A\u06295\u0634\u0628\u0643\u06294\u0639\u0631\u0627\u06422\u06282\u0645\u0627\u06464\u0641\u0644\u0633\u0637\u064A\u06466\u0642\u0637\u06313\u0643\u0627\u062B\u0648\u0644\u064A\u06436\u0648\u06453\u0645\u0635\u06312\u0644\u064A\u0633\u064A\u06275\u0648\u0631\u064A\u062A\u0627\u0646\u064A\u06277\u0642\u06394\u0647\u0645\u0631\u0627\u06475\u067E\u0627\u06A9\u0633\u062A\u0627\u06467\u0680\u0627\u0631\u062A4\u0915\u0949\u092E3\u0928\u0947\u091F3\u092D\u093E\u0930\u09240\u092E\u094D3\u094B\u09245\u0938\u0902\u0917\u0920\u09285\u09AC\u09BE\u0982\u09B2\u09BE5\u09AD\u09BE\u09B0\u09A42\u09F0\u09A44\u0A2D\u0A3E\u0A30\u0A244\u0AAD\u0ABE\u0AB0\u0AA44\u0B2D\u0B3E\u0B30\u0B244\u0B87\u0BA8\u0BCD\u0BA4\u0BBF\u0BAF\u0BBE6\u0BB2\u0B99\u0BCD\u0B95\u0BC86\u0B9A\u0BBF\u0B99\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0BC2\u0BB0\u0BCD11\u0C2D\u0C3E\u0C30\u0C24\u0C4D5\u0CAD\u0CBE\u0CB0\u0CA44\u0D2D\u0D3E\u0D30\u0D24\u0D025\u0DBD\u0D82\u0D9A\u0DCF4\u0E04\u0E2D\u0E213\u0E44\u0E17\u0E223\u0EA5\u0EB2\u0EA73\u10D2\u10D42\u307F\u3093\u306A3\u30A2\u30DE\u30BE\u30F34\u30AF\u30E9\u30A6\u30C94\u30B0\u30FC\u30B0\u30EB4\u30B3\u30E02\u30B9\u30C8\u30A23\u30BB\u30FC\u30EB3\u30D5\u30A1\u30C3\u30B7\u30E7\u30F36\u30DD\u30A4\u30F3\u30C84\u4E16\u754C2\u4E2D\u4FE11\u56FD1\u570B1\u6587\u7F513\u4E9A\u9A6C\u900A3\u4F01\u4E1A2\u4F5B\u5C712\u4FE1\u606F2\u5065\u5EB72\u516B\u53662\u516C\u53F81\u76CA2\u53F0\u6E7E1\u70632\u5546\u57CE1\u5E971\u68072\u5609\u91CC0\u5927\u9152\u5E975\u5728\u7EBF2\u5927\u62FF2\u5929\u4E3B\u65593\u5A31\u4E502\u5BB6\u96FB2\u5E7F\u4E1C2\u5FAE\u535A2\u6148\u55842\u6211\u7231\u4F603\u624B\u673A2\u62DB\u80582\u653F\u52A11\u5E9C2\u65B0\u52A0\u57612\u95FB2\u65F6\u5C1A2\u66F8\u7C4D2\u673A\u67842\u6DE1\u9A6C\u95213\u6E38\u620F2\u6FB3\u95802\u70B9\u770B2\u79FB\u52A82\u7EC4\u7EC7\u673A\u67844\u7F51\u57401\u5E971\u7AD91\u7EDC2\u8054\u901A2\u8C37\u6B4C2\u8D2D\u72692\u901A\u8CA92\u96C6\u56E22\u96FB\u8A0A\u76C8\u79D14\u98DE\u5229\u6D663\u98DF\u54C12\u9910\u53852\u9999\u683C\u91CC\u62C93\u6E2F2\uB2F7\uB1371\uCEF42\uC0BC\uC1312\uD55C\uAD6D2",Yr=(t,e)=>{for(let n in e)t[n]=e[n];return t},gc="numeric",bc="ascii",yc="alpha",Hi="asciinumeric",Ui="alphanumeric",Ec="domain",Hh="emoji",XC="scheme",QC="slashscheme",dc="whitespace";function ek(t,e){return t in e||(e[t]=[]),e[t]}function hr(t,e,n){e[gc]&&(e[Hi]=!0,e[Ui]=!0),e[bc]&&(e[Hi]=!0,e[yc]=!0),e[Hi]&&(e[Ui]=!0),e[yc]&&(e[Ui]=!0),e[Ui]&&(e[Ec]=!0),e[Hh]&&(e[Ec]=!0);for(let r in e){let i=ek(r,n);i.indexOf(t)<0&&i.push(t);}}function tk(t,e){let n={};for(let r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}function Ct(t=null){this.j={},this.jr=[],this.jd=null,this.t=t;}Ct.groups={};Ct.prototype={accepts(){return !!this.t},go(t){let e=this,n=e.j[t];if(n)return n;for(let r=0;r<e.jr.length;r++){let i=e.jr[r][0],o=e.jr[r][1];if(o&&i.test(t))return o}return e.jd},has(t,e=!1){return e?t in this.j:!!this.go(t)},ta(t,e,n,r){for(let i=0;i<t.length;i++)this.tt(t[i],e,n,r);},tr(t,e,n,r){r=r||Ct.groups;let i;return e&&e.j?i=e:(i=new Ct(e),n&&r&&hr(e,n,r)),this.jr.push([t,i]),i},ts(t,e,n,r){let i=this,o=t.length;if(!o)return i;for(let s=0;s<o-1;s++)i=i.tt(t[s]);return i.tt(t[o-1],e,n,r)},tt(t,e,n,r){r=r||Ct.groups;let i=this;if(e&&e.j)return i.j[t]=e,e;let o=e,s,a=i.go(t);if(a?(s=new Ct,Yr(s.j,a.j),s.jr.push.apply(s.jr,a.jr),s.jd=a.jd,s.t=a.t):s=new Ct,o){if(r)if(s.t&&typeof s.t=="string"){let l=Yr(tk(s.t,r),n);hr(o,l,r);}else n&&hr(o,n,r);s.t=o;}return i.j[t]=s,s}};var pe=(t,e,n,r,i)=>t.ta(e,n,r,i),Fe=(t,e,n,r,i)=>t.tr(e,n,r,i),Lh=(t,e,n,r,i)=>t.ts(e,n,r,i),P=(t,e,n,r,i)=>t.tt(e,n,r,i),Nn="WORD",vc="UWORD",$h="ASCIINUMERICAL",Kh="ALPHANUMERICAL",qi="LOCALHOST",wc="TLD",xc="UTLD",is="SCHEME",Jr="SLASH_SCHEME",Cc="NUM",Sc="WS",kc="NL",$i="OPENBRACE",Ki="CLOSEBRACE",ss="OPENBRACKET",as="CLOSEBRACKET",ls="OPENPAREN",cs="CLOSEPAREN",ds="OPENANGLEBRACKET",us="CLOSEANGLEBRACKET",fs="FULLWIDTHLEFTPAREN",ps="FULLWIDTHRIGHTPAREN",hs="LEFTCORNERBRACKET",ms="RIGHTCORNERBRACKET",gs="LEFTWHITECORNERBRACKET",bs="RIGHTWHITECORNERBRACKET",ys="FULLWIDTHLESSTHAN",Es="FULLWIDTHGREATERTHAN",vs="AMPERSAND",ws="APOSTROPHE",xs="ASTERISK",Hn="AT",Ss="BACKSLASH",Cs="BACKTICK",ks="CARET",$n="COLON",Nc="COMMA",Ns="DOLLAR",tn="DOT",Ts="EQUALS",Tc="EXCLAMATION",zt="HYPHEN",Vi="PERCENT",_s="PIPE",Ms="PLUS",As="POUND",Wi="QUERY",_c="QUOTE",Vh="FULLWIDTHMIDDLEDOT",Mc="SEMI",nn="SLASH",Gi="TILDE",Os="UNDERSCORE",Wh="EMOJI",Rs="SYM",Gh=Object.freeze({__proto__:null,ALPHANUMERICAL:Kh,AMPERSAND:vs,APOSTROPHE:ws,ASCIINUMERICAL:$h,ASTERISK:xs,AT:Hn,BACKSLASH:Ss,BACKTICK:Cs,CARET:ks,CLOSEANGLEBRACKET:us,CLOSEBRACE:Ki,CLOSEBRACKET:as,CLOSEPAREN:cs,COLON:$n,COMMA:Nc,DOLLAR:Ns,DOT:tn,EMOJI:Wh,EQUALS:Ts,EXCLAMATION:Tc,FULLWIDTHGREATERTHAN:Es,FULLWIDTHLEFTPAREN:fs,FULLWIDTHLESSTHAN:ys,FULLWIDTHMIDDLEDOT:Vh,FULLWIDTHRIGHTPAREN:ps,HYPHEN:zt,LEFTCORNERBRACKET:hs,LEFTWHITECORNERBRACKET:gs,LOCALHOST:qi,NL:kc,NUM:Cc,OPENANGLEBRACKET:ds,OPENBRACE:$i,OPENBRACKET:ss,OPENPAREN:ls,PERCENT:Vi,PIPE:_s,PLUS:Ms,POUND:As,QUERY:Wi,QUOTE:_c,RIGHTCORNERBRACKET:ms,RIGHTWHITECORNERBRACKET:bs,SCHEME:is,SEMI:Mc,SLASH:nn,SLASH_SCHEME:Jr,SYM:Rs,TILDE:Gi,TLD:wc,UNDERSCORE:Os,UTLD:xc,UWORD:vc,WORD:Nn,WS:Sc}),Cn=/[a-z]/,Fi=/\p{L}/u,uc=/\p{Emoji}/u;var kn=/\d/,fc=/\s/;var Ph="\r",pc=`
|
|
114
|
-
`,
|
|
180
|
+
`);return !i||!s?!1:t.chain().command(({tr:a})=>(a.delete(n.pos-2,n.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return !1;let{state:e}=t,{selection:r,doc:n}=e,{$from:o,empty:i}=r;if(!i||o.parent.type!==this.type||!(o.parentOffset===o.parent.nodeSize-2))return !1;let a=o.after();return a===void 0?!1:n.nodeAt(a)?t.commands.command(({tr:c})=>(c.setSelection(Z.near(n.resolve(a))),!0)):t.commands.exitCode()}}},addInputRules(){return [wa({find:KL,type:this.type,getAttributes:t=>({language:t[1]})}),wa({find:WL,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return [new oe({key:new ae("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return !1;let r=e.clipboardData.getData("text/plain"),n=e.clipboardData.getData("vscode-editor-data"),o=n?JSON.parse(n):void 0,i=o?.mode;if(!r||!i)return !1;let{tr:s,schema:a}=t.state,l=a.text(r.replace(/\r\n?/g,`
|
|
181
|
+
`));return s.replaceSelectionWith(this.type.create({language:i},l)),s.selection.$from.parent.type!==this.type&&s.setSelection(q.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.setMeta("paste",!0),t.dispatch(s),!0}}})]}}),DE=th;var PE=Ne.create({name:"doc",topNode:!0,content:"block+"});var IE=Ne.create({name:"hardBreak",addOptions(){return {keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return [{tag:"br"}]},renderHTML({HTMLAttributes:t}){return ["br",ie(this.options.HTMLAttributes,t)]},renderText(){return `
|
|
182
|
+
`},addCommands(){return {setHardBreak:()=>({commands:t,chain:e,state:r,editor:n})=>t.first([()=>t.exitCode(),()=>t.command(()=>{let{selection:o,storedMarks:i}=r;if(o.$from.parent.type.spec.isolating)return !1;let{keepMarks:s}=this.options,{splittableMarks:a}=n.extensionManager,l=i||o.$to.parentOffset&&o.$from.marks();return e().insertContent({type:this.name}).command(({tr:c,dispatch:d})=>{if(d&&l&&s){let u=l.filter(f=>a.includes(f.type.name));c.ensureMarks(u);}return !0}).run()})])}},addKeyboardShortcuts(){return {"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}});var LE=Ne.create({name:"heading",addOptions(){return {levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return {level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return [`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,ie(this.options.HTMLAttributes,e),0]},addCommands(){return {setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>wa({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}});var $E=Ne.create({name:"horizontalRule",addOptions(){return {HTMLAttributes:{}}},group:"block",parseHTML(){return [{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return ["hr",ie(this.options.HTMLAttributes,t)]},addCommands(){return {setHorizontalRule:()=>({chain:t,state:e})=>{if(!fE(e,e.schema.nodes[this.name]))return !1;let{selection:r}=e,{$to:n}=r,o=t();return Rc(r)?o.insertContentAt(n.pos,{type:this.name}):o.insertContent({type:this.name}),o.command(({tr:i,dispatch:s})=>{var a;if(s){let{$to:l}=i.selection,c=l.end();if(l.nodeAfter)l.nodeAfter.isTextblock?i.setSelection(q.create(i.doc,l.pos+1)):l.nodeAfter.isBlock?i.setSelection(X.create(i.doc,l.pos)):i.setSelection(q.create(i.doc,l.pos));else {let d=(a=l.parent.type.contentMatch.defaultType)==null?void 0:a.create();d&&(i.insert(c,d),i.setSelection(q.create(i.doc,c+1)));}i.scrollIntoView();}return !0}).run()}}},addInputRules(){return [Nc({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}});var GL=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,qL=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,jL=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,YL=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,BE=Pt.create({name:"italic",addOptions(){return {HTMLAttributes:{}}},parseHTML(){return [{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return ["em",ie(this.options.HTMLAttributes,t),0]},addCommands(){return {setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return {"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return [Mr({find:GL,type:this.type}),Mr({find:jL,type:this.type})]},addPasteRules(){return [dr({find:qL,type:this.type}),dr({find:YL,type:this.type})]}});var XL="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5m\xF6gensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",JL="\u03B5\u03BB1\u03C52\u0431\u04331\u0435\u043B3\u0434\u0435\u0442\u04384\u0435\u044E2\u043A\u0430\u0442\u043E\u043B\u0438\u043A6\u043E\u043C3\u043C\u043A\u04342\u043E\u043D1\u0441\u043A\u0432\u04306\u043E\u043D\u043B\u0430\u0439\u043D5\u0440\u04333\u0440\u0443\u04412\u04442\u0441\u0430\u0439\u04423\u0440\u04313\u0443\u043A\u04403\u049B\u0430\u04373\u0570\u0561\u05753\u05D9\u05E9\u05E8\u05D0\u05DC5\u05E7\u05D5\u05DD3\u0627\u0628\u0648\u0638\u0628\u064A5\u0631\u0627\u0645\u0643\u06485\u0644\u0627\u0631\u062F\u06464\u0628\u062D\u0631\u064A\u06465\u062C\u0632\u0627\u0626\u06315\u0633\u0639\u0648\u062F\u064A\u06296\u0639\u0644\u064A\u0627\u06465\u0645\u063A\u0631\u06285\u0645\u0627\u0631\u0627\u062A5\u06CC\u0631\u0627\u06465\u0628\u0627\u0631\u062A2\u0632\u0627\u06314\u064A\u062A\u06433\u06BE\u0627\u0631\u062A5\u062A\u0648\u0646\u06334\u0633\u0648\u062F\u0627\u06463\u0631\u064A\u06295\u0634\u0628\u0643\u06294\u0639\u0631\u0627\u06422\u06282\u0645\u0627\u06464\u0641\u0644\u0633\u0637\u064A\u06466\u0642\u0637\u06313\u0643\u0627\u062B\u0648\u0644\u064A\u06436\u0648\u06453\u0645\u0635\u06312\u0644\u064A\u0633\u064A\u06275\u0648\u0631\u064A\u062A\u0627\u0646\u064A\u06277\u0642\u06394\u0647\u0645\u0631\u0627\u06475\u067E\u0627\u06A9\u0633\u062A\u0627\u06467\u0680\u0627\u0631\u062A4\u0915\u0949\u092E3\u0928\u0947\u091F3\u092D\u093E\u0930\u09240\u092E\u094D3\u094B\u09245\u0938\u0902\u0917\u0920\u09285\u09AC\u09BE\u0982\u09B2\u09BE5\u09AD\u09BE\u09B0\u09A42\u09F0\u09A44\u0A2D\u0A3E\u0A30\u0A244\u0AAD\u0ABE\u0AB0\u0AA44\u0B2D\u0B3E\u0B30\u0B244\u0B87\u0BA8\u0BCD\u0BA4\u0BBF\u0BAF\u0BBE6\u0BB2\u0B99\u0BCD\u0B95\u0BC86\u0B9A\u0BBF\u0B99\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0BC2\u0BB0\u0BCD11\u0C2D\u0C3E\u0C30\u0C24\u0C4D5\u0CAD\u0CBE\u0CB0\u0CA44\u0D2D\u0D3E\u0D30\u0D24\u0D025\u0DBD\u0D82\u0D9A\u0DCF4\u0E04\u0E2D\u0E213\u0E44\u0E17\u0E223\u0EA5\u0EB2\u0EA73\u10D2\u10D42\u307F\u3093\u306A3\u30A2\u30DE\u30BE\u30F34\u30AF\u30E9\u30A6\u30C94\u30B0\u30FC\u30B0\u30EB4\u30B3\u30E02\u30B9\u30C8\u30A23\u30BB\u30FC\u30EB3\u30D5\u30A1\u30C3\u30B7\u30E7\u30F36\u30DD\u30A4\u30F3\u30C84\u4E16\u754C2\u4E2D\u4FE11\u56FD1\u570B1\u6587\u7F513\u4E9A\u9A6C\u900A3\u4F01\u4E1A2\u4F5B\u5C712\u4FE1\u606F2\u5065\u5EB72\u516B\u53662\u516C\u53F81\u76CA2\u53F0\u6E7E1\u70632\u5546\u57CE1\u5E971\u68072\u5609\u91CC0\u5927\u9152\u5E975\u5728\u7EBF2\u5927\u62FF2\u5929\u4E3B\u65593\u5A31\u4E502\u5BB6\u96FB2\u5E7F\u4E1C2\u5FAE\u535A2\u6148\u55842\u6211\u7231\u4F603\u624B\u673A2\u62DB\u80582\u653F\u52A11\u5E9C2\u65B0\u52A0\u57612\u95FB2\u65F6\u5C1A2\u66F8\u7C4D2\u673A\u67842\u6DE1\u9A6C\u95213\u6E38\u620F2\u6FB3\u95802\u70B9\u770B2\u79FB\u52A82\u7EC4\u7EC7\u673A\u67844\u7F51\u57401\u5E971\u7AD91\u7EDC2\u8054\u901A2\u8C37\u6B4C2\u8D2D\u72692\u901A\u8CA92\u96C6\u56E22\u96FB\u8A0A\u76C8\u79D14\u98DE\u5229\u6D663\u98DF\u54C12\u9910\u53852\u9999\u683C\u91CC\u62C93\u6E2F2\uB2F7\uB1371\uCEF42\uC0BC\uC1312\uD55C\uAD6D2",ds=(t,e)=>{for(let r in e)t[r]=e[r];return t},lh="numeric",ch="ascii",dh="alpha",Sa="asciinumeric",ka="alphanumeric",uh="domain",WE="emoji",ZL="scheme",QL="slashscheme",rh="whitespace";function e5(t,e){return t in e||(e[t]=[]),e[t]}function ci(t,e,r){e[lh]&&(e[Sa]=!0,e[ka]=!0),e[ch]&&(e[Sa]=!0,e[dh]=!0),e[Sa]&&(e[ka]=!0),e[dh]&&(e[ka]=!0),e[ka]&&(e[uh]=!0),e[WE]&&(e[uh]=!0);for(let n in e){let o=e5(n,r);o.indexOf(t)<0&&o.push(t);}}function t5(t,e){let r={};for(let n in e)e[n].indexOf(t)>=0&&(r[n]=!0);return r}function ur(t=null){this.j={},this.jr=[],this.jd=null,this.t=t;}ur.groups={};ur.prototype={accepts(){return !!this.t},go(t){let e=this,r=e.j[t];if(r)return r;for(let n=0;n<e.jr.length;n++){let o=e.jr[n][0],i=e.jr[n][1];if(i&&o.test(t))return i}return e.jd},has(t,e=!1){return e?t in this.j:!!this.go(t)},ta(t,e,r,n){for(let o=0;o<t.length;o++)this.tt(t[o],e,r,n);},tr(t,e,r,n){n=n||ur.groups;let o;return e&&e.j?o=e:(o=new ur(e),r&&n&&ci(e,r,n)),this.jr.push([t,o]),o},ts(t,e,r,n){let o=this,i=t.length;if(!i)return o;for(let s=0;s<i-1;s++)o=o.tt(t[s]);return o.tt(t[i-1],e,r,n)},tt(t,e,r,n){n=n||ur.groups;let o=this;if(e&&e.j)return o.j[t]=e,e;let i=e,s,a=o.go(t);if(a?(s=new ur,ds(s.j,a.j),s.jr.push.apply(s.jr,a.jr),s.jd=a.jd,s.t=a.t):s=new ur,i){if(n)if(s.t&&typeof s.t=="string"){let l=ds(t5(s.t,n),r);ci(i,l,n);}else r&&ci(i,r,n);s.t=i;}return o.j[t]=s,s}};var we=(t,e,r,n,o)=>t.ta(e,r,n,o),lt=(t,e,r,n,o)=>t.tr(e,r,n,o),FE=(t,e,r,n,o)=>t.ts(e,r,n,o),z=(t,e,r,n,o)=>t.tt(e,r,n,o),Un="WORD",fh="UWORD",GE="ASCIINUMERICAL",qE="ALPHANUMERICAL",Ma="LOCALHOST",ph="TLD",hh="UTLD",Dc="SCHEME",cs="SLASH_SCHEME",gh="NUM",mh="WS",bh="NL",Ca="OPENBRACE",Ra="CLOSEBRACE",Pc="OPENBRACKET",Ic="CLOSEBRACKET",Lc="OPENPAREN",$c="CLOSEPAREN",Bc="OPENANGLEBRACKET",Fc="CLOSEANGLEBRACKET",zc="FULLWIDTHLEFTPAREN",Hc="FULLWIDTHRIGHTPAREN",Uc="LEFTCORNERBRACKET",Vc="RIGHTCORNERBRACKET",Kc="LEFTWHITECORNERBRACKET",Wc="RIGHTWHITECORNERBRACKET",Gc="FULLWIDTHLESSTHAN",qc="FULLWIDTHGREATERTHAN",jc="AMPERSAND",Yc="APOSTROPHE",Xc="ASTERISK",ho="AT",Jc="BACKSLASH",Zc="BACKTICK",Qc="CARET",mo="COLON",vh="COMMA",ed="DOLLAR",fn="DOT",td="EQUALS",yh="EXCLAMATION",Or="HYPHEN",Ta="PERCENT",rd="PIPE",nd="PLUS",od="POUND",Na="QUERY",wh="QUOTE",jE="FULLWIDTHMIDDLEDOT",xh="SEMI",pn="SLASH",_a="TILDE",id="UNDERSCORE",YE="EMOJI",sd="SYM",XE=Object.freeze({__proto__:null,ALPHANUMERICAL:qE,AMPERSAND:jc,APOSTROPHE:Yc,ASCIINUMERICAL:GE,ASTERISK:Xc,AT:ho,BACKSLASH:Jc,BACKTICK:Zc,CARET:Qc,CLOSEANGLEBRACKET:Fc,CLOSEBRACE:Ra,CLOSEBRACKET:Ic,CLOSEPAREN:$c,COLON:mo,COMMA:vh,DOLLAR:ed,DOT:fn,EMOJI:YE,EQUALS:td,EXCLAMATION:yh,FULLWIDTHGREATERTHAN:qc,FULLWIDTHLEFTPAREN:zc,FULLWIDTHLESSTHAN:Gc,FULLWIDTHMIDDLEDOT:jE,FULLWIDTHRIGHTPAREN:Hc,HYPHEN:Or,LEFTCORNERBRACKET:Uc,LEFTWHITECORNERBRACKET:Kc,LOCALHOST:Ma,NL:bh,NUM:gh,OPENANGLEBRACKET:Bc,OPENBRACE:Ca,OPENBRACKET:Pc,OPENPAREN:Lc,PERCENT:Ta,PIPE:rd,PLUS:nd,POUND:od,QUERY:Na,QUOTE:wh,RIGHTCORNERBRACKET:Vc,RIGHTWHITECORNERBRACKET:Wc,SCHEME:Dc,SEMI:xh,SLASH:pn,SLASH_SCHEME:cs,SYM:sd,TILDE:_a,TLD:ph,UNDERSCORE:id,UTLD:hh,UWORD:fh,WORD:Un,WS:mh}),zn=/[a-z]/,Ea=/\p{L}/u,nh=/\p{Emoji}/u;var Hn=/\d/,oh=/\s/;var zE="\r",ih=`
|
|
183
|
+
`,r5="\uFE0F",n5="\u200D",sh="\uFFFC",Mc=null,Ac=null;function o5(t=[]){let e={};ur.groups=e;let r=new ur;Mc==null&&(Mc=HE(XL)),Ac==null&&(Ac=HE(JL)),z(r,"'",Yc),z(r,"{",Ca),z(r,"}",Ra),z(r,"[",Pc),z(r,"]",Ic),z(r,"(",Lc),z(r,")",$c),z(r,"<",Bc),z(r,">",Fc),z(r,"\uFF08",zc),z(r,"\uFF09",Hc),z(r,"\u300C",Uc),z(r,"\u300D",Vc),z(r,"\u300E",Kc),z(r,"\u300F",Wc),z(r,"\uFF1C",Gc),z(r,"\uFF1E",qc),z(r,"&",jc),z(r,"*",Xc),z(r,"@",ho),z(r,"`",Zc),z(r,"^",Qc),z(r,":",mo),z(r,",",vh),z(r,"$",ed),z(r,".",fn),z(r,"=",td),z(r,"!",yh),z(r,"-",Or),z(r,"%",Ta),z(r,"|",rd),z(r,"+",nd),z(r,"#",od),z(r,"?",Na),z(r,'"',wh),z(r,"/",pn),z(r,";",xh),z(r,"~",_a),z(r,"_",id),z(r,"\\",Jc),z(r,"\u30FB",jE);let n=lt(r,Hn,gh,{[lh]:!0});lt(n,Hn,n);let o=lt(n,zn,GE,{[Sa]:!0}),i=lt(n,Ea,qE,{[ka]:!0}),s=lt(r,zn,Un,{[ch]:!0});lt(s,Hn,o),lt(s,zn,s),lt(o,Hn,o),lt(o,zn,o);let a=lt(r,Ea,fh,{[dh]:!0});lt(a,zn),lt(a,Hn,i),lt(a,Ea,a),lt(i,Hn,i),lt(i,zn),lt(i,Ea,i);let l=z(r,ih,bh,{[rh]:!0}),c=z(r,zE,mh,{[rh]:!0}),d=lt(r,oh,mh,{[rh]:!0});z(r,sh,d),z(c,ih,l),z(c,sh,d),lt(c,oh,d),z(d,zE),z(d,ih),lt(d,oh,d),z(d,sh,d);let u=lt(r,nh,YE,{[WE]:!0});z(u,"#"),lt(u,nh,u),z(u,r5,u);let f=z(u,n5);z(f,"#"),lt(f,nh,u);let p=[[zn,s],[Hn,o]],h=[[zn,null],[Ea,a],[Hn,i]];for(let m=0;m<Mc.length;m++)po(r,Mc[m],ph,Un,p);for(let m=0;m<Ac.length;m++)po(r,Ac[m],hh,fh,h);ci(ph,{tld:!0,ascii:!0},e),ci(hh,{utld:!0,alpha:!0},e),po(r,"file",Dc,Un,p),po(r,"mailto",Dc,Un,p),po(r,"http",cs,Un,p),po(r,"https",cs,Un,p),po(r,"ftp",cs,Un,p),po(r,"ftps",cs,Un,p),ci(Dc,{scheme:!0,ascii:!0},e),ci(cs,{slashscheme:!0,ascii:!0},e),t=t.sort((m,g)=>m[0]>g[0]?1:-1);for(let m=0;m<t.length;m++){let g=t[m][0],v=t[m][1]?{[ZL]:!0}:{[QL]:!0};g.indexOf("-")>=0?v[uh]=!0:zn.test(g)?Hn.test(g)?v[Sa]=!0:v[ch]=!0:v[lh]=!0,FE(r,g,g,v);}return FE(r,"localhost",Ma,{ascii:!0}),r.jd=new ur(sd),{start:r,tokens:ds({groups:e},XE)}}function JE(t,e){let r=i5(e.replace(/[A-Z]/g,a=>a.toLowerCase())),n=r.length,o=[],i=0,s=0;for(;s<n;){let a=t,l=null,c=0,d=null,u=-1,f=-1;for(;s<n&&(l=a.go(r[s]));)a=l,a.accepts()?(u=0,f=0,d=a):u>=0&&(u+=r[s].length,f++),c+=r[s].length,i+=r[s].length,s++;i-=u,s-=f,c-=u,o.push({t:d.t,v:e.slice(i-c,i),s:i-c,e:i});}return o}function i5(t){let e=[],r=t.length,n=0;for(;n<r;){let o=t.charCodeAt(n),i,s=o<55296||o>56319||n+1===r||(i=t.charCodeAt(n+1))<56320||i>57343?t[n]:t.slice(n,n+2);e.push(s),n+=s.length;}return e}function po(t,e,r,n,o){let i,s=e.length;for(let a=0;a<s-1;a++){let l=e[a];t.j[l]?i=t.j[l]:(i=new ur(n),i.jr=o.slice(),t.j[l]=i),t=i;}return i=new ur(r),i.jr=o.slice(),t.j[e[s-1]]=i,i}function HE(t){let e=[],r=[],n=0,o="0123456789";for(;n<t.length;){let i=0;for(;o.indexOf(t[n+i])>=0;)i++;if(i>0){e.push(r.join(""));for(let s=parseInt(t.substring(n,n+i),10);s>0;s--)r.pop();n+=i;}else r.push(t[n]),n++;}return e}var Aa={defaultProtocol:"http",events:null,format:UE,formatHref:UE,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Eh(t,e=null){let r=ds({},Aa);t&&(r=ds(r,t instanceof Eh?t.o:t));let n=r.ignoreTags,o=[];for(let i=0;i<n.length;i++)o.push(n[i].toUpperCase());this.o=r,e&&(this.defaultRender=e),this.ignoreTags=o;}Eh.prototype={o:Aa,ignoreTags:[],defaultRender(t){return t},check(t){return this.get("validate",t.toString(),t)},get(t,e,r){let n=e!=null,o=this.o[t];return o&&(typeof o=="object"?(o=r.t in o?o[r.t]:Aa[t],typeof o=="function"&&n&&(o=o(e,r))):typeof o=="function"&&n&&(o=o(e,r.t,r)),o)},getObj(t,e,r){let n=this.o[t];return typeof n=="function"&&e!=null&&(n=n(e,r.t,r)),n},render(t){let e=t.render(this);return (this.get("render",null,t)||this.defaultRender)(e,t.t,t)}};function UE(t){return t}function ZE(t,e){this.t="token",this.v=t,this.tk=e;}ZE.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){let e=this.toString(),r=t.get("truncate",e,this),n=t.get("format",e,this);return r&&n.length>r?n.substring(0,r)+"\u2026":n},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t=Aa.defaultProtocol){return {type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return {type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){let e=this,r=this.toHref(t.get("defaultProtocol")),n=t.get("formatHref",r,this),o=t.get("tagName",r,e),i=this.toFormattedString(t),s={},a=t.get("className",r,e),l=t.get("target",r,e),c=t.get("rel",r,e),d=t.getObj("attributes",r,e),u=t.getObj("events",r,e);return s.href=n,a&&(s.class=a),l&&(s.target=l),c&&(s.rel=c),d&&ds(s,d),{tagName:o,attributes:s,content:i,eventListeners:u}}};function ad(t,e){class r extends ZE{constructor(o,i){super(o,i),this.t=t;}}for(let n in e)r.prototype[n]=e[n];return r.t=t,r}var VE=ad("email",{isLink:!0,toHref(){return "mailto:"+this.toString()}}),KE=ad("text"),s5=ad("nl"),Oc=ad("url",{isLink:!0,toHref(t=Aa.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){let t=this.tk;return t.length>=2&&t[0].t!==Ma&&t[1].t===mo}});var Ar=t=>new ur(t);function a5({groups:t}){let e=t.domain.concat([jc,Xc,ho,Jc,Zc,Qc,ed,td,Or,gh,Ta,rd,nd,od,pn,sd,_a,id]),r=[Yc,mo,vh,fn,yh,Ta,Na,wh,xh,Bc,Fc,Ca,Ra,Ic,Pc,Lc,$c,zc,Hc,Uc,Vc,Kc,Wc,Gc,qc],n=[jc,Yc,Xc,Jc,Zc,Qc,ed,td,Or,Ca,Ra,Ta,rd,nd,od,Na,pn,sd,_a,id],o=Ar(),i=z(o,_a);we(i,n,i),we(i,t.domain,i);let s=Ar(),a=Ar(),l=Ar();we(o,t.domain,s),we(o,t.scheme,a),we(o,t.slashscheme,l),we(s,n,i),we(s,t.domain,s);let c=z(s,ho);z(i,ho,c),z(a,ho,c),z(l,ho,c);let d=z(i,fn);we(d,n,i),we(d,t.domain,i);let u=Ar();we(c,t.domain,u),we(u,t.domain,u);let f=z(u,fn);we(f,t.domain,u);let p=Ar(VE);we(f,t.tld,p),we(f,t.utld,p),z(c,Ma,p);let h=z(u,Or);z(h,Or,h),we(h,t.domain,u),we(p,t.domain,u),z(p,fn,f),z(p,Or,h);let m=z(p,mo);we(m,t.numeric,VE);let g=z(s,Or),b=z(s,fn);z(g,Or,g),we(g,t.domain,s),we(b,n,i),we(b,t.domain,s);let v=Ar(Oc);we(b,t.tld,v),we(b,t.utld,v),we(v,t.domain,s),we(v,n,i),z(v,fn,b),z(v,Or,g),z(v,ho,c);let y=z(v,mo),x=Ar(Oc);we(y,t.numeric,x);let E=Ar(Oc),S=Ar();we(E,e,E),we(E,r,S),we(S,e,E),we(S,r,S),z(v,pn,E),z(x,pn,E);let R=z(a,mo),w=z(l,mo),N=z(w,pn),M=z(N,pn);we(a,t.domain,s),z(a,fn,b),z(a,Or,g),we(l,t.domain,s),z(l,fn,b),z(l,Or,g),we(R,t.domain,E),z(R,pn,E),z(R,Na,E),we(M,t.domain,E),we(M,e,E),z(M,pn,E);let B=[[Ca,Ra],[Pc,Ic],[Lc,$c],[Bc,Fc],[zc,Hc],[Uc,Vc],[Kc,Wc],[Gc,qc]];for(let U=0;U<B.length;U++){let[K,P]=B[U],V=z(E,K);z(S,K,V),z(V,P,E);let C=Ar(Oc);we(V,e,C);let T=Ar();we(V,r),we(C,e,C),we(C,r,T),we(T,e,C),we(T,r,T),z(C,P,E),z(T,P,E);}return z(o,Ma,v),z(o,bh,s5),{start:o,tokens:XE}}function l5(t,e,r){let n=r.length,o=0,i=[],s=[];for(;o<n;){let a=t,l=null,c=null,d=0,u=null,f=-1;for(;o<n&&!(l=a.go(r[o].t));)s.push(r[o++]);for(;o<n&&(c=l||a.go(r[o].t));)l=null,a=c,a.accepts()?(f=0,u=a):f>=0&&f++,o++,d++;if(f<0)o-=d,o<n&&(s.push(r[o]),o++);else {s.length>0&&(i.push(ah(KE,e,s)),s=[]),o-=f,d-=f;let p=u.t,h=r.slice(o-d,o);i.push(ah(p,e,h));}}return s.length>0&&i.push(ah(KE,e,s)),i}function ah(t,e,r){let n=r[0].s,o=r[r.length-1].e,i=e.slice(n,o);return new t(i,r)}var c5=typeof console<"u"&&console&&console.warn||(()=>{}),d5="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",je={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function QE(){return ur.groups={},je.scanner=null,je.parser=null,je.tokenQueue=[],je.pluginQueue=[],je.customSchemes=[],je.initialized=!1,je}function kh(t,e=!1){if(je.initialized&&c5(`linkifyjs: already initialized - will not register custom scheme "${t}" ${d5}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format.
|
|
115
184
|
1. Must only contain digits, lowercase ASCII letters or "-"
|
|
116
185
|
2. Cannot start or end with "-"
|
|
117
|
-
3. "-" cannot repeat`);Te.customSchemes.push([t,e]);}function uk(){Te.scanner=ik(Te.customSchemes);for(let t=0;t<Te.tokenQueue.length;t++)Te.tokenQueue[t][1]({scanner:Te.scanner});Te.parser=ak(Te.scanner.tokens);for(let t=0;t<Te.pluginQueue.length;t++)Te.pluginQueue[t][1]({scanner:Te.scanner,parser:Te.parser});return Te.initialized=!0,Te}function Is(t){return Te.initialized||uk(),lk(Te.parser.start,t,qh(Te.scanner.start,t))}Is.scan=qh;function Ls(t,e=null,n=null){if(e&&typeof e=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);n=e,e=null;}let r=new Ac(n),i=Is(t),o=[];for(let s=0;s<i.length;s++){let a=i[s];a.isLink&&(!e||a.t===e)&&r.check(a)&&o.push(a.toFormattedObject(r));}return o}var Rc="[\0- \xA0\u1680\u180E\u2000-\u2029\u205F\u3000]",fk=new RegExp(Rc),pk=new RegExp(`${Rc}$`),hk=new RegExp(Rc,"g");function mk(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function gk(t){return new Z({key:new re("autolink"),appendTransaction:(e,n,r)=>{let i=e.some(c=>c.docChanged)&&!n.doc.eq(r.doc),o=e.some(c=>c.getMeta("preventAutolink"));if(!i||o)return;let{tr:s}=r,a=Jl(n.doc,[...e]);if(tc(a).forEach(({newRange:c})=>{let d=Dp(r.doc,c,p=>p.isTextblock),u,f;if(d.length>1)u=d[0],f=r.doc.textBetween(u.pos,u.pos+u.node.nodeSize,void 0," ");else if(d.length){let p=r.doc.textBetween(c.from,c.to," "," ");if(!pk.test(p))return;u=d[0],f=r.doc.textBetween(u.pos,c.to,void 0," ");}if(u&&f){let p=f.split(fk).filter(Boolean);if(p.length<=0)return !1;let h=p[p.length-1],m=u.pos+f.lastIndexOf(h);if(!h)return !1;let g=Is(h).map(b=>b.toObject(t.defaultProtocol));if(!mk(g))return !1;g.filter(b=>b.isLink).map(b=>({...b,from:m+b.start+1,to:m+b.end+1})).filter(b=>r.schema.marks.code?!r.doc.rangeHasMark(b.from,b.to,r.schema.marks.code):!0).filter(b=>t.validate(b.value)).filter(b=>t.shouldAutoLink(b.value)).forEach(b=>{Yo(b.from,b.to,r.doc).some(v=>v.mark.type===t.type)||s.addMark(b.from,b.to,t.type.create({href:b.href}));});}}),!!s.steps.length)return s}})}function bk(t){return new Z({key:new re("handleClickLink"),props:{handleClick:(e,n,r)=>{var i,o;if(r.button!==0||!e.editable)return !1;let s=null;if(r.target instanceof HTMLAnchorElement)s=r.target;else {let d=r.target,u=[];for(;d.nodeName!=="DIV";)u.push(d),d=d.parentNode;s=u.find(f=>f.nodeName==="A");}if(!s)return !1;let a=ec(e.state,t.type.name),l=(i=s?.href)!=null?i:a.href,c=(o=s?.target)!=null?o:a.target;return t.enableClickSelection&&t.editor.commands.extendMarkRange(t.type.name),s&&l?(window.open(l,c),!0):!1}}})}function yk(t){return new Z({key:new re("handlePasteLink"),props:{handlePaste:(e,n,r)=>{let{state:i}=e,{selection:o}=i,{empty:s}=o;if(s)return !1;let a="";r.content.forEach(c=>{a+=c.textContent;});let l=Ls(a,{defaultProtocol:t.defaultProtocol}).find(c=>c.isLink&&c.value===a);return !a||!l?!1:t.editor.commands.setMark(t.type,{href:l.href})}}})}function mr(t,e){let n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(r=>{let i=typeof r=="string"?r:r.scheme;i&&n.push(i);}),!t||t.replace(hk,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var Dc=nt.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(t=>{if(typeof t=="string"){Oc(t);return}Oc(t.scheme,t.optionalSlashes);});},onDestroy(){Jh();},inclusive(){return this.options.autolink},addOptions(){return {openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(t,e)=>!!mr(t,e.protocols),validate:t=>!!t,shouldAutoLink:t=>!!t}},addAttributes(){return {href:{default:null,parseHTML(t){return t.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return [{tag:"a[href]",getAttrs:t=>{let e=t.getAttribute("href");return !e||!this.options.isAllowedUri(e,{defaultValidate:n=>!!mr(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:e=>!!mr(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",te(this.options.HTMLAttributes,t),0]:["a",te(this.options.HTMLAttributes,{...t,href:""}),0]},addCommands(){return {setLink:t=>({chain:e})=>{let{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!mr(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,t).setMeta("preventAutolink",!0).run():!1},toggleLink:t=>({chain:e})=>{let{href:n}=t||{};return n&&!this.options.isAllowedUri(n,{defaultValidate:r=>!!mr(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return [St({find:t=>{let e=[];if(t){let{protocols:n,defaultProtocol:r}=this.options,i=Ls(t).filter(o=>o.isLink&&this.options.isAllowedUri(o.value,{defaultValidate:s=>!!mr(s,n),protocols:n,defaultProtocol:r}));i.length&&i.forEach(o=>e.push({text:o.value,data:{href:o.href},index:o.start}));}return e},type:this.type,getAttributes:t=>{var e;return {href:(e=t.data)==null?void 0:e.href}}})]},addProseMirrorPlugins(){let t=[],{protocols:e,defaultProtocol:n}=this.options;return this.options.autolink&&t.push(gk({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:i=>!!mr(i,e),protocols:e,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&t.push(bk({type:this.type,editor:this.editor,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&t.push(yk({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),t}}),Yh=Dc;var Ek=Object.defineProperty,vk=(t,e)=>{for(var n in e)Ek(t,n,{get:e[n],enumerable:!0});},wk="listItem",Zh="textStyle",Xh=/^\s*([-+*])\s$/,Pc=ge.create({name:"bulletList",addOptions(){return {itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return `${this.options.itemTypeName}+`},parseHTML(){return [{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return ["ul",te(this.options.HTMLAttributes,t),0]},addCommands(){return {toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(wk,this.editor.getAttributes(Zh)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return {"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=en({find:Xh,type:this.type});return (this.options.keepMarks||this.options.keepAttributes)&&(t=en({find:Xh,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(Zh),editor:this.editor})),[t]}}),Bc=ge.create({name:"listItem",addOptions(){return {HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return [{tag:"li"}]},renderHTML({HTMLAttributes:t}){return ["li",te(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return {Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),xk={};vk(xk,{findListItemPos:()=>Ji,getNextListDepth:()=>zc,handleBackspace:()=>Ic,handleDelete:()=>Lc,hasListBefore:()=>tm,hasListItemAfter:()=>Sk,hasListItemBefore:()=>nm,listItemHasSubList:()=>rm,nextListIsDeeper:()=>im,nextListIsHigher:()=>om});var Ji=(t,e)=>{let{$from:n}=e.selection,r=ze(t,e.schema),i=null,o=n.depth,s=n.pos,a=null;for(;o>0&&a===null;)i=n.node(o),i.type===r?a=o:(o-=1,s-=1);return a===null?null:{$pos:e.doc.resolve(s),depth:a}},zc=(t,e)=>{let n=Ji(t,e);if(!n)return !1;let[,r]=Hp(e,t,n.$pos.pos+4);return r},tm=(t,e,n)=>{let{$anchor:r}=t.selection,i=Math.max(0,r.pos-2),o=t.doc.resolve(i).node();return !(!o||!n.includes(o.type.name))},nm=(t,e)=>{var n;let{$anchor:r}=e.selection,i=e.doc.resolve(r.pos-2);return !(i.index()===0||((n=i.nodeBefore)==null?void 0:n.type.name)!==t)},rm=(t,e,n)=>{if(!n)return !1;let r=ze(t,e.schema),i=!1;return n.descendants(o=>{o.type===r&&(i=!0);}),i},Ic=(t,e,n)=>{if(t.commands.undoInputRule())return !0;if(t.state.selection.from!==t.state.selection.to)return !1;if(!Qt(t.state,e)&&tm(t.state,e,n)){let{$anchor:a}=t.state.selection,l=t.state.doc.resolve(a.before()-1),c=[];l.node().descendants((f,p)=>{f.type.name===e&&c.push({node:f,pos:p});});let d=c.at(-1);if(!d)return !1;let u=t.state.doc.resolve(l.start()+d.pos+1);return t.chain().cut({from:a.start()-1,to:a.end()+1},u.end()).joinForward().run()}if(!Qt(t.state,e)||!Kp(t.state))return !1;let r=Ji(e,t.state);if(!r)return !1;let o=t.state.doc.resolve(r.$pos.pos-2).node(r.depth),s=rm(e,t.state,o);return nm(e,t.state)&&!s?t.commands.joinItemBackward():t.chain().liftListItem(e).run()},im=(t,e)=>{let n=zc(t,e),r=Ji(t,e);return !r||!n?!1:n>r.depth},om=(t,e)=>{let n=zc(t,e),r=Ji(t,e);return !r||!n?!1:n<r.depth},Lc=(t,e)=>{if(!Qt(t.state,e)||!$p(t.state,e))return !1;let{selection:n}=t.state,{$from:r,$to:i}=n;return !n.empty&&r.sameParent(i)?!1:im(e,t.state)?t.chain().focus(t.state.selection.from+4).lift(e).joinBackward().run():om(e,t.state)?t.chain().joinForward().joinBackward().run():t.commands.joinItemForward()},Sk=(t,e)=>{var n;let{$anchor:r}=e.selection,i=e.doc.resolve(r.pos-r.parentOffset-2);return !(i.index()===i.parent.childCount-1||((n=i.nodeAfter)==null?void 0:n.type.name)!==t)},Fc=ne.create({name:"listKeymap",addOptions(){return {listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}},addKeyboardShortcuts(){return {Delete:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n})=>{t.state.schema.nodes[n]!==void 0&&Lc(t,n)&&(e=!0);}),e},"Mod-Delete":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n})=>{t.state.schema.nodes[n]!==void 0&&Lc(t,n)&&(e=!0);}),e},Backspace:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{t.state.schema.nodes[n]!==void 0&&Ic(t,n,r)&&(e=!0);}),e},"Mod-Backspace":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{t.state.schema.nodes[n]!==void 0&&Ic(t,n,r)&&(e=!0);}),e}}}}),Ck="listItem",Qh="textStyle",em=/^(\d+)\.\s$/,Uc=ge.create({name:"orderedList",addOptions(){return {itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return `${this.options.itemTypeName}+`},addAttributes(){return {start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:null,parseHTML:t=>t.getAttribute("type")}}},parseHTML(){return [{tag:"ol"}]},renderHTML({HTMLAttributes:t}){let{start:e,...n}=t;return e===1?["ol",te(this.options.HTMLAttributes,n),0]:["ol",te(this.options.HTMLAttributes,t),0]},addCommands(){return {toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Ck,this.editor.getAttributes(Qh)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return {"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=en({find:em,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1]});return (this.options.keepMarks||this.options.keepAttributes)&&(t=en({find:em,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(Qh)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),kk=/^\s*(\[([( |x])?\])\s$/,Ps=ge.create({name:"taskItem",addOptions(){return {nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return {checked:{default:!1,keepOnSplit:!1,parseHTML:t=>{let e=t.getAttribute("data-checked");return e===""||e==="true"},renderHTML:t=>({"data-checked":t.checked})}}},parseHTML(){return [{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:t,HTMLAttributes:e}){return ["li",te(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:t.attrs.checked?"checked":null}],["span"]],["div",0]]},addKeyboardShortcuts(){let t={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...t,Tab:()=>this.editor.commands.sinkListItem(this.name)}:t},addNodeView(){return ({node:t,HTMLAttributes:e,getPos:n,editor:r})=>{let i=document.createElement("li"),o=document.createElement("label"),s=document.createElement("span"),a=document.createElement("input"),l=document.createElement("div"),c=()=>{var d,u;a.ariaLabel=((u=(d=this.options.a11y)==null?void 0:d.checkboxLabel)==null?void 0:u.call(d,t,a.checked))||`Task item checkbox for ${t.textContent||"empty task item"}`;};return c(),o.contentEditable="false",a.type="checkbox",a.addEventListener("mousedown",d=>d.preventDefault()),a.addEventListener("change",d=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){a.checked=!a.checked;return}let{checked:u}=d.target;r.isEditable&&typeof n=="function"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:f})=>{let p=n();if(typeof p!="number")return !1;let h=f.doc.nodeAt(p);return f.setNodeMarkup(p,void 0,{...h?.attrs,checked:u}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(t,u)||(a.checked=!a.checked));}),Object.entries(this.options.HTMLAttributes).forEach(([d,u])=>{i.setAttribute(d,u);}),i.dataset.checked=t.attrs.checked,a.checked=t.attrs.checked,o.append(a,s),i.append(o,l),Object.entries(e).forEach(([d,u])=>{i.setAttribute(d,u);}),{dom:i,contentDOM:l,update:d=>d.type!==this.type?!1:(i.dataset.checked=d.attrs.checked,a.checked=d.attrs.checked,c(),!0)}}},addInputRules(){return [en({find:kk,type:this.type,getAttributes:t=>({checked:t[t.length-1]==="x"})})]}}),Bs=ge.create({name:"taskList",addOptions(){return {itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return `${this.options.itemTypeName}+`},parseHTML(){return [{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:t}){return ["ul",te(this.options.HTMLAttributes,t,{"data-type":this.name}),0]},addCommands(){return {toggleTaskList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return {"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});ne.create({name:"listKit",addExtensions(){let t=[];return this.options.bulletList!==!1&&t.push(Pc.configure(this.options.bulletList)),this.options.listItem!==!1&&t.push(Bc.configure(this.options.listItem)),this.options.listKeymap!==!1&&t.push(Fc.configure(this.options.listKeymap)),this.options.orderedList!==!1&&t.push(Uc.configure(this.options.orderedList)),this.options.taskItem!==!1&&t.push(Ps.configure(this.options.taskItem)),this.options.taskList!==!1&&t.push(Bs.configure(this.options.taskList)),t}});var sm=ge.create({name:"paragraph",priority:1e3,addOptions(){return {HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return [{tag:"p"}]},renderHTML({HTMLAttributes:t}){return ["p",te(this.options.HTMLAttributes,t),0]},addCommands(){return {setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return {"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}});var Nk=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,Tk=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,am=nt.create({name:"strike",addOptions(){return {HTMLAttributes:{}}},parseHTML(){return [{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return ["s",te(this.options.HTMLAttributes,t),0]},addCommands(){return {setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return {"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return [Pt({find:Nk,type:this.type})]},addPasteRules(){return [St({find:Tk,type:this.type})]}});var lm=ge.create({name:"text",group:"inline"});var Hc=nt.create({name:"underline",addOptions(){return {HTMLAttributes:{}}},parseHTML(){return [{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return ["u",te(this.options.HTMLAttributes,t),0]},addCommands(){return {setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return {"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),cm=Hc;function dm(t={}){return new Z({view(e){return new $c(e,t)}})}var $c=class{constructor(e,n){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let o=s=>{this[i](s);};return e.dom.addEventListener(i,o),{name:i,handler:o}});}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n));}update(e,n){this.cursorPos!=null&&n.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay());}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay());}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,r,i=this.editorView.dom,o=i.getBoundingClientRect(),s=o.width/i.offsetWidth,a=o.height/i.offsetHeight;if(n){let u=e.nodeBefore,f=e.nodeAfter;if(u||f){let p=this.editorView.nodeDOM(this.cursorPos-(u?u.nodeSize:0));if(p){let h=p.getBoundingClientRect(),m=u?h.bottom:h.top;u&&f&&(m=(m+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let g=this.width/2*a;r={left:h.left,right:h.right,top:m-g,bottom:m+g};}}}if(!r){let u=this.editorView.coordsAtPos(this.cursorPos),f=this.width/2*s;r={left:u.left-f,right:u.left+f,top:u.top,bottom:u.bottom};}let l=this.editorView.dom.offsetParent;this.element||(this.element=l.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let c,d;if(!l||l==document.body&&getComputedStyle(l).position=="static")c=-pageXOffset,d=-pageYOffset;else {let u=l.getBoundingClientRect(),f=u.width/l.offsetWidth,p=u.height/l.offsetHeight;c=u.left-l.scrollLeft*f,d=u.top-l.scrollTop*p;}this.element.style.left=(r.left-c)/s+"px",this.element.style.top=(r.top-d)/a+"px",this.element.style.width=(r.right-r.left)/s+"px",this.element.style.height=(r.bottom-r.top)/a+"px";}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e);}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),i=r&&r.type.spec.disableDropCursor,o=typeof i=="function"?i(this.editorView,n,e):i;if(n&&!o){let s=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=Co(this.editorView.state.doc,s,this.editorView.dragging.slice);a!=null&&(s=a);}this.setCursor(s),this.scheduleRemoval(5e3);}}dragend(){this.scheduleRemoval(20);}drop(){this.scheduleRemoval(20);}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null);}};var Ae=class extends q{constructor(e){super(e,e);}map(e,n){let r=e.resolve(n.map(this.head));return Ae.valid(r)?new Ae(r):q.near(r)}content(){return B.empty}eq(e){return e instanceof Ae&&e.head==this.head}toJSON(){return {type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new Ae(e.resolve(n.pos))}getBookmark(){return new Yi(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!_k(e)||!Mk(e))return !1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let i=n.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&Ae.valid(e))return e;let i=e.pos,o=null;for(let s=e.depth;;s--){let a=e.node(s);if(n>0?e.indexAfter(s)<a.childCount:e.index(s)>0){o=a.child(n>0?e.indexAfter(s):e.index(s)-1);break}else if(s==0)return null;i+=n;let l=e.doc.resolve(i);if(Ae.valid(l))return l}for(;;){let s=n>0?o.firstChild:o.lastChild;if(!s){if(o.isAtom&&!o.isText&&!W.isSelectable(o)){e=e.doc.resolve(i+o.nodeSize*n),r=!1;continue e}break}o=s,i+=n;let a=e.doc.resolve(i);if(Ae.valid(a))return a}return null}}};Ae.prototype.visible=!1;Ae.findFrom=Ae.findGapCursorFrom;q.jsonID("gapcursor",Ae);var Yi=class{constructor(e){this.pos=e;}map(e){return new Yi(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return Ae.valid(n)?new Ae(n):q.near(n)}};function _k(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return !0;continue}for(let i=r.child(n-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return !0;if(i.inlineContent)return !1}}return !0}function Mk(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return !0;continue}for(let i=r.child(n);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return !0;if(i.inlineContent)return !1}}return !0}function um(){return new Z({props:{decorations:Dk,createSelectionBetween(t,e,n){return e.pos==n.pos&&Ae.valid(n)?new Ae(n):null},handleClick:Ok,handleKeyDown:Ak,handleDOMEvents:{beforeinput:Rk}}})}var Ak=Ri({ArrowLeft:zs("horiz",-1),ArrowRight:zs("horiz",1),ArrowUp:zs("vert",-1),ArrowDown:zs("vert",1)});function zs(t,e){let n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,i,o){let s=r.selection,a=e>0?s.$to:s.$from,l=s.empty;if(s instanceof H){if(!o.endOfTextblock(n)||a.depth==0)return !1;l=!1,a=r.doc.resolve(e>0?a.after():a.before());}let c=Ae.findGapCursorFrom(a,e,l);return c?(i&&i(r.tr.setSelection(new Ae(c))),!0):!1}}function Ok(t,e,n){if(!t||!t.editable)return !1;let r=t.state.doc.resolve(e);if(!Ae.valid(r))return !1;let i=t.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&W.isSelectable(t.state.doc.nodeAt(i.inside))?!1:(t.dispatch(t.state.tr.setSelection(new Ae(r))),!0)}function Rk(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof Ae))return !1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return !1;let i=N.empty;for(let s=r.length-1;s>=0;s--)i=N.from(r[s].createAndFill(null,i));let o=t.state.tr.replace(n.pos,n.pos,new B(i,0,0));return o.setSelection(H.near(o.doc.resolve(n.pos+1))),t.dispatch(o),!1}function Dk(t){if(!(t.selection instanceof Ae))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",me.create(t.doc,[Ce.widget(t.selection.head,e,{key:"gapcursor"})])}var Fs=200,rt=function(){};rt.prototype.append=function(e){return e.length?(e=rt.from(e),!this.length&&e||e.length<Fs&&this.leafAppend(e)||this.length<Fs&&e.leafPrepend(this)||this.appendInner(e)):this};rt.prototype.prepend=function(e){return e.length?rt.from(e).append(this):this};rt.prototype.appendInner=function(e){return new Ik(this,e)};rt.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?rt.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))};rt.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};rt.prototype.forEach=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(e,n,r,0):this.forEachInvertedInner(e,n,r,0);};rt.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(o,s){return i.push(e(o,s))},n,r),i};rt.from=function(e){return e instanceof rt?e:e&&e.length?new fm(e):rt.empty};var fm=function(t){function e(r){t.call(this),this.values=r;}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,o){return i==0&&o==this.length?this:new e(this.values.slice(i,o))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,o,s,a){for(var l=o;l<s;l++)if(i(this.values[l],a+l)===!1)return !1},e.prototype.forEachInvertedInner=function(i,o,s,a){for(var l=o-1;l>=s;l--)if(i(this.values[l],a+l)===!1)return !1},e.prototype.leafAppend=function(i){if(this.length+i.length<=Fs)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=Fs)return new e(i.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(rt);rt.empty=new fm([]);var Ik=function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1;}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,i,o,s){var a=this.left.length;if(i<a&&this.left.forEachInner(r,i,Math.min(o,a),s)===!1||o>a&&this.right.forEachInner(r,Math.max(i-a,0),Math.min(this.length,o)-a,s+a)===!1)return !1},e.prototype.forEachInvertedInner=function(r,i,o,s){var a=this.left.length;if(i>a&&this.right.forEachInvertedInner(r,i-a,Math.max(o,a)-a,s+a)===!1||o<a&&this.left.forEachInvertedInner(r,Math.min(i,a),o,s)===!1)return !1},e.prototype.sliceInner=function(r,i){if(r==0&&i==this.length)return this;var o=this.left.length;return i<=o?this.left.slice(r,i):r>=o?this.right.slice(r-o,i-o):this.left.slice(r,o).append(this.right.slice(0,i-o))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(rt),Kc=rt;var Lk=500,At=class{constructor(e,n){this.items=e,this.eventCount=n;}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;n&&(i=this.remapping(r,this.items.length),o=i.maps.length);let s=e.tr,a,l,c=[],d=[];return this.items.forEach((u,f)=>{if(!u.step){i||(i=this.remapping(r,f+1),o=i.maps.length),o--,d.push(u);return}if(i){d.push(new Ft(u.map));let p=u.step.map(i.slice(o)),h;p&&s.maybeStep(p).doc&&(h=s.mapping.maps[s.mapping.maps.length-1],c.push(new Ft(h,void 0,void 0,c.length+d.length))),o--,h&&i.appendMap(h,o);}else s.maybeStep(u.step);if(u.selection)return a=i?u.selection.map(i.slice(o)):u.selection,l=new At(this.items.slice(0,r).append(d.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:s,selection:a}}addTransform(e,n,r,i){let o=[],s=this.eventCount,a=this.items,l=!i&&a.length?a.get(a.length-1):null;for(let d=0;d<e.steps.length;d++){let u=e.steps[d].invert(e.docs[d]),f=new Ft(e.mapping.maps[d],u,n),p;(p=l&&l.merge(f))&&(f=p,d?o.pop():a=a.slice(0,a.length-1)),o.push(f),n&&(s++,n=void 0),i||(l=f);}let c=s-r.depth;return c>Bk&&(a=Pk(a,c),s-=c),new At(a.append(o),s)}remapping(e,n){let r=new Rn;return this.items.forEach((i,o)=>{let s=i.mirrorOffset!=null&&o-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,s);},e,n),r}addMaps(e){return this.eventCount==0?this:new At(this.items.append(e.map(n=>new Ft(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),o=e.mapping,s=e.steps.length,a=this.eventCount;this.items.forEach(f=>{f.selection&&a--;},i);let l=n;this.items.forEach(f=>{let p=o.getMirror(--l);if(p==null)return;s=Math.min(s,p);let h=o.maps[p];if(f.step){let m=e.steps[p].invert(e.docs[p]),g=f.selection&&f.selection.map(o.slice(l+1,p));g&&a++,r.push(new Ft(h,m,g));}else r.push(new Ft(h));},i);let c=[];for(let f=n;f<s;f++)c.push(new Ft(o.maps[f]));let d=this.items.slice(0,i).append(c).append(r),u=new At(d,a);return u.emptyItemCount()>Lk&&(u=u.compress(this.items.length-r.length)),u}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++;}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,i=[],o=0;return this.items.forEach((s,a)=>{if(a>=e)i.push(s),s.selection&&o++;else if(s.step){let l=s.step.map(n.slice(r)),c=l&&l.getMap();if(r--,c&&n.appendMap(c,r),l){let d=s.selection&&s.selection.map(n.slice(r));d&&o++;let u=new Ft(c.invert(),l,d),f,p=i.length-1;(f=i.length&&i[p].merge(u))?i[p]=f:i.push(u);}}else s.map&&r--;},this.items.length,0),new At(Kc.from(i.reverse()),o)}};At.empty=new At(Kc.empty,0);function Pk(t,e){let n;return t.forEach((r,i)=>{if(r.selection&&e--==0)return n=i,!1}),t.slice(n)}var Ft=class{constructor(e,n,r,i){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=i;}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new Ft(n.getMap().invert(),n,this.selection)}}},rn=class{constructor(e,n,r,i,o){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=o;}},Bk=20;function zk(t,e,n,r){let i=n.getMeta(gr),o;if(i)return i.historyState;n.getMeta(Hk)&&(t=new rn(t.done,t.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(s&&s.getMeta(gr))return s.getMeta(gr).redo?new rn(t.done.addTransform(n,void 0,r,Us(e)),t.undone,pm(n.mapping.maps),t.prevTime,t.prevComposition):new rn(t.done,t.undone.addTransform(n,void 0,r,Us(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let a=n.getMeta("composition"),l=t.prevTime==0||!s&&t.prevComposition!=a&&(t.prevTime<(n.time||0)-r.newGroupDelay||!Fk(n,t.prevRanges)),c=s?Vc(t.prevRanges,n.mapping):pm(n.mapping.maps);return new rn(t.done.addTransform(n,l?e.selection.getBookmark():void 0,r,Us(e)),At.empty,c,n.time,a??t.prevComposition)}else return (o=n.getMeta("rebased"))?new rn(t.done.rebased(n,o),t.undone.rebased(n,o),Vc(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new rn(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),Vc(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function Fk(t,e){if(!e)return !1;if(!t.docChanged)return !0;let n=!1;return t.mapping.maps[0].forEach((r,i)=>{for(let o=0;o<e.length;o+=2)r<=e[o+1]&&i>=e[o]&&(n=!0);}),n}function pm(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,i,o,s)=>e.push(o,s));return e}function Vc(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let i=e.map(t[r],1),o=e.map(t[r+1],-1);i<=o&&n.push(i,o);}return n}function Uk(t,e,n){let r=Us(e),i=gr.get(e).spec.config,o=(n?t.undone:t.done).popEvent(e,r);if(!o)return null;let s=o.selection.resolve(o.transform.doc),a=(n?t.done:t.undone).addTransform(o.transform,e.selection.getBookmark(),i,r),l=new rn(n?a:o.remaining,n?o.remaining:a,null,0,-1);return o.transform.setSelection(s).setMeta(gr,{redo:n,historyState:l})}var Wc=!1,hm=null;function Us(t){let e=t.plugins;if(hm!=e){Wc=!1,hm=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){Wc=!0;break}}return Wc}var gr=new re("history"),Hk=new re("closeHistory");function mm(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new Z({key:gr,state:{init(){return new rn(At.empty,At.empty,null,0,-1)},apply(e,n,r){return zk(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,i=r=="historyUndo"?Gc:r=="historyRedo"?qc:null;return i?(n.preventDefault(),i(e.state,e.dispatch)):!1}}}})}function Hs(t,e){return (n,r)=>{let i=gr.getState(n);if(!i||(t?i.undone:i.done).eventCount==0)return !1;if(r){let o=Uk(i,n,t);o&&r(e?o.scrollIntoView():o);}return !0}}var Gc=Hs(!1,!0),qc=Hs(!0,!0);ne.create({name:"characterCount",addOptions(){return {limit:null,mode:"textSize",textCounter:t=>t.length,wordCounter:t=>t.split(" ").filter(e=>e!=="").length}},addStorage(){return {characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=t=>{let e=t?.node||this.editor.state.doc;if((t?.mode||this.options.mode)==="textSize"){let r=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(r)}return e.nodeSize},this.storage.words=t=>{let e=t?.node||this.editor.state.doc,n=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(n)};},addProseMirrorPlugins(){let t=!1;return [new Z({key:new re("characterCount"),appendTransaction:(e,n,r)=>{if(t)return;let i=this.options.limit;if(i==null||i===0){t=!0;return}let o=this.storage.characters({node:r.doc});if(o>i){let s=o-i,a=0,l=s;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);let c=r.tr.deleteRange(a,l);return t=!0,c}t=!0;},filterTransaction:(e,n)=>{let r=this.options.limit;if(!e.docChanged||r===0||r===null||r===void 0)return !0;let i=this.storage.characters({node:n.doc}),o=this.storage.characters({node:e.doc});if(o<=r||i>r&&o>r&&o<=i)return !0;if(i>r&&o>r&&o>i||!e.getMeta("paste"))return !1;let a=e.selection.$head.pos,l=o-r,c=a-l,d=a;return e.deleteRange(c,d),!(this.storage.characters({node:e.doc})>r)}})]}});var bm=ne.create({name:"dropCursor",addOptions(){return {color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return [dm(this.options)]}});ne.create({name:"focus",addOptions(){return {className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return [new Z({key:new re("focus"),props:{decorations:({doc:t,selection:e})=>{let{isEditable:n,isFocused:r}=this.editor,{anchor:i}=e,o=[];if(!n||!r)return me.create(t,[]);let s=0;this.options.mode==="deepest"&&t.descendants((l,c)=>{if(l.isText)return;if(!(i>=c&&i<=c+l.nodeSize-1))return !1;s+=1;});let a=0;return t.descendants((l,c)=>{if(l.isText||!(i>=c&&i<=c+l.nodeSize-1))return !1;if(a+=1,this.options.mode==="deepest"&&s-a>0||this.options.mode==="shallowest"&&a>1)return this.options.mode==="deepest";o.push(Ce.node(c,c+l.nodeSize,{class:this.options.className}));}),me.create(t,o)}}})]}});var Zi=ne.create({name:"gapCursor",addProseMirrorPlugins(){return [um()]},extendNodeSchema(t){var e;let n={name:t.name,options:t.options,storage:t.storage};return {allowGapCursor:(e=Se(j(t,"allowGapCursor",n)))!=null?e:null}}}),jc=ne.create({name:"placeholder",addOptions(){return {emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something \u2026",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return [new Z({key:new re("placeholder"),props:{decorations:({doc:t,selection:e})=>{let n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=e,i=[];if(!n)return null;let o=this.editor.isEmpty;return t.descendants((s,a)=>{let l=r>=a&&r<=a+s.nodeSize,c=!s.isLeaf&&Li(s);if((l||!this.options.showOnlyCurrent)&&c){let d=[this.options.emptyNodeClass];o&&d.push(this.options.emptyEditorClass);let u=Ce.node(a,a+s.nodeSize,{class:d.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:s,pos:a,hasAnchor:l}):this.options.placeholder});i.push(u);}return this.options.includeChildren}),me.create(t,i)}}})]}});ne.create({name:"selection",addOptions(){return {className:"selection"}},addProseMirrorPlugins(){let{editor:t,options:e}=this;return [new Z({key:new re("selection"),props:{decorations(n){return n.selection.empty||t.isFocused||!t.isEditable||Zo(n.selection)||t.view.dragging?null:me.create(n.doc,[Ce.inline(n.selection.from,n.selection.to,{class:e.className})])}}})]}});function gm({types:t,node:e}){return e&&Array.isArray(t)&&t.includes(e.type)||e?.type===t}var ym=ne.create({name:"trailingNode",addOptions(){return {node:"paragraph",notAfter:[]}},addProseMirrorPlugins(){let t=new re(this.name),e=Object.entries(this.editor.schema.nodes).map(([,n])=>n).filter(n=>(this.options.notAfter||[]).concat(this.options.node).includes(n.name));return [new Z({key:t,appendTransaction:(n,r,i)=>{let{doc:o,tr:s,schema:a}=i,l=t.getState(i),c=o.content.size,d=a.nodes[this.options.node];if(l)return s.insert(c,d.create())},state:{init:(n,r)=>{let i=r.tr.doc.lastChild;return !gm({node:i,types:e})},apply:(n,r)=>{if(!n.docChanged)return r;let i=n.doc.lastChild;return !gm({node:i,types:e})}}})]}}),Em=ne.create({name:"undoRedo",addOptions(){return {depth:100,newGroupDelay:500}},addCommands(){return {undo:()=>({state:t,dispatch:e})=>Gc(t,e),redo:()=>({state:t,dispatch:e})=>qc(t,e)}},addProseMirrorPlugins(){return [mm(this.options)]},addKeyboardShortcuts(){return {"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-\u044F":()=>this.editor.commands.undo(),"Shift-Mod-\u044F":()=>this.editor.commands.redo()}}});var $k=ne.create({name:"starterKit",addExtensions(){var t,e,n,r;let i=[];return this.options.bold!==!1&&i.push(Th.configure(this.options.bold)),this.options.blockquote!==!1&&i.push(Nh.configure(this.options.blockquote)),this.options.bulletList!==!1&&i.push(Pc.configure(this.options.bulletList)),this.options.code!==!1&&i.push(_h.configure(this.options.code)),this.options.codeBlock!==!1&&i.push(cc.configure(this.options.codeBlock)),this.options.document!==!1&&i.push(Ah.configure(this.options.document)),this.options.dropcursor!==!1&&i.push(bm.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&i.push(Zi.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&i.push(Oh.configure(this.options.hardBreak)),this.options.heading!==!1&&i.push(Rh.configure(this.options.heading)),this.options.undoRedo!==!1&&i.push(Em.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&i.push(Dh.configure(this.options.horizontalRule)),this.options.italic!==!1&&i.push(Ih.configure(this.options.italic)),this.options.listItem!==!1&&i.push(Bc.configure(this.options.listItem)),this.options.listKeymap!==!1&&i.push(Fc.configure((t=this.options)==null?void 0:t.listKeymap)),this.options.link!==!1&&i.push(Dc.configure((e=this.options)==null?void 0:e.link)),this.options.orderedList!==!1&&i.push(Uc.configure(this.options.orderedList)),this.options.paragraph!==!1&&i.push(sm.configure(this.options.paragraph)),this.options.strike!==!1&&i.push(am.configure(this.options.strike)),this.options.text!==!1&&i.push(lm.configure(this.options.text)),this.options.underline!==!1&&i.push(Hc.configure((n=this.options)==null?void 0:n.underline)),this.options.trailingNode!==!1&&i.push(ym.configure((r=this.options)==null?void 0:r.trailingNode)),i}}),vm=$k;var wm=jc;var Kk=ne.create({name:"textAlign",addOptions(){return {types:[],alignments:["left","center","right","justify"],defaultAlignment:null}},addGlobalAttributes(){return [{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:t=>{let e=t.style.textAlign;return this.options.alignments.includes(e)?e:this.options.defaultAlignment},renderHTML:t=>t.textAlign?{style:`text-align: ${t.textAlign}`}:{}}}}]},addCommands(){return {setTextAlign:t=>({commands:e})=>this.options.alignments.includes(t)?this.options.types.map(n=>e.updateAttributes(n,{textAlign:t})).every(n=>n):!1,unsetTextAlign:()=>({commands:t})=>this.options.types.map(e=>t.resetAttributes(e,"textAlign")).every(e=>e),toggleTextAlign:t=>({editor:e,commands:n})=>this.options.alignments.includes(t)?e.isActive({textAlign:t})?n.unsetTextAlign():n.setTextAlign(t):!1}},addKeyboardShortcuts(){return {"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),xm=Kk;var Vk=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,Wk=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,Gk=nt.create({name:"highlight",addOptions(){return {multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:t=>t.getAttribute("data-color")||t.style.backgroundColor,renderHTML:t=>t.color?{"data-color":t.color,style:`background-color: ${t.color}; color: inherit`}:{}}}:{}},parseHTML(){return [{tag:"mark"}]},renderHTML({HTMLAttributes:t}){return ["mark",te(this.options.HTMLAttributes,t),0]},addCommands(){return {setHighlight:t=>({commands:e})=>e.setMark(this.name,t),toggleHighlight:t=>({commands:e})=>e.toggleMark(this.name,t),unsetHighlight:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return {"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return [Pt({find:Vk,type:this.type})]},addPasteRules(){return [St({find:Wk,type:this.type})]}}),Sm=Gk;var qk=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,jk=ge.create({name:"image",addOptions(){return {inline:!1,allowBase64:!1,HTMLAttributes:{}}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return {src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}},parseHTML(){return [{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:t}){return ["img",te(this.options.HTMLAttributes,t)]},addCommands(){return {setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return [Qo({find:qk,type:this.type,getAttributes:t=>{let[,,e,n,r]=t;return {src:n,alt:e,title:r}}})]}}),Cm=jk;var Yc,Zc;if(typeof WeakMap<"u"){let t=new WeakMap;Yc=e=>t.get(e),Zc=(e,n)=>(t.set(e,n),n);}else {let t=[],n=0;Yc=r=>{for(let i=0;i<t.length;i+=2)if(t[i]==r)return t[i+1]},Zc=(r,i)=>(n==10&&(n=0),t[n++]=r,t[n++]=i);}var Ue=class{constructor(t,e,n,r){this.width=t,this.height=e,this.map=n,this.problems=r;}findCell(t){for(let e=0;e<this.map.length;e++){let n=this.map[e];if(n!=t)continue;let r=e%this.width,i=e/this.width|0,o=r+1,s=i+1;for(let a=1;o<this.width&&this.map[e+a]==n;a++)o++;for(let a=1;s<this.height&&this.map[e+this.width*a]==n;a++)s++;return {left:r,top:i,right:o,bottom:s}}throw new RangeError(`No cell with offset ${t} found`)}colCount(t){for(let e=0;e<this.map.length;e++)if(this.map[e]==t)return e%this.width;throw new RangeError(`No cell with offset ${t} found`)}nextCell(t,e,n){let{left:r,right:i,top:o,bottom:s}=this.findCell(t);return e=="horiz"?(n<0?r==0:i==this.width)?null:this.map[o*this.width+(n<0?r-1:i)]:(n<0?o==0:s==this.height)?null:this.map[r+this.width*(n<0?o-1:s)]}rectBetween(t,e){let{left:n,right:r,top:i,bottom:o}=this.findCell(t),{left:s,right:a,top:l,bottom:c}=this.findCell(e);return {left:Math.min(n,s),top:Math.min(i,l),right:Math.max(r,a),bottom:Math.max(o,c)}}cellsInRect(t){let e=[],n={};for(let r=t.top;r<t.bottom;r++)for(let i=t.left;i<t.right;i++){let o=r*this.width+i,s=this.map[o];n[s]||(n[s]=!0,!(i==t.left&&i&&this.map[o-1]==s||r==t.top&&r&&this.map[o-this.width]==s)&&e.push(s));}return e}positionAt(t,e,n){for(let r=0,i=0;;r++){let o=i+n.child(r).nodeSize;if(r==t){let s=e+t*this.width,a=(t+1)*this.width;for(;s<a&&this.map[s]<i;)s++;return s==a?o-1:this.map[s]}i=o;}}static get(t){return Yc(t)||Zc(t,Jk(t))}};function Jk(t){if(t.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+t.type.name);let e=Yk(t),n=t.childCount,r=[],i=0,o=null,s=[];for(let c=0,d=e*n;c<d;c++)r[c]=0;for(let c=0,d=0;c<n;c++){let u=t.child(c);d++;for(let h=0;;h++){for(;i<r.length&&r[i]!=0;)i++;if(h==u.childCount)break;let m=u.child(h),{colspan:g,rowspan:b,colwidth:v}=m.attrs;for(let S=0;S<b;S++){if(S+c>=n){(o||(o=[])).push({type:"overlong_rowspan",pos:d,n:b-S});break}let T=i+S*e;for(let _=0;_<g;_++){r[T+_]==0?r[T+_]=d:(o||(o=[])).push({type:"collision",row:c,pos:d,n:g-_});let I=v&&v[_];if(I){let k=(T+_)%e*2,y=s[k];y==null||y!=I&&s[k+1]==1?(s[k]=I,s[k+1]=1):y==I&&s[k+1]++;}}}i+=g,d+=m.nodeSize;}let f=(c+1)*e,p=0;for(;i<f;)r[i++]==0&&p++;p&&(o||(o=[])).push({type:"missing",row:c,n:p}),d++;}(e===0||n===0)&&(o||(o=[])).push({type:"zero_sized"});let a=new Ue(e,n,r,o),l=!1;for(let c=0;!l&&c<s.length;c+=2)s[c]!=null&&s[c+1]<n&&(l=!0);return l&&Zk(a,s,t),a}function Yk(t){let e=-1,n=!1;for(let r=0;r<t.childCount;r++){let i=t.child(r),o=0;if(n)for(let s=0;s<r;s++){let a=t.child(s);for(let l=0;l<a.childCount;l++){let c=a.child(l);s+c.attrs.rowspan>r&&(o+=c.attrs.colspan);}}for(let s=0;s<i.childCount;s++){let a=i.child(s);o+=a.attrs.colspan,a.attrs.rowspan>1&&(n=!0);}e==-1?e=o:e!=o&&(e=Math.max(e,o));}return e}function Zk(t,e,n){t.problems||(t.problems=[]);let r={};for(let i=0;i<t.map.length;i++){let o=t.map[i];if(r[o])continue;r[o]=!0;let s=n.nodeAt(o);if(!s)throw new RangeError(`No cell with offset ${o} found`);let a=null,l=s.attrs;for(let c=0;c<l.colspan;c++){let d=(i+c)%t.width,u=e[d*2];u!=null&&(!l.colwidth||l.colwidth[c]!=u)&&((a||(a=Xk(l)))[c]=u);}a&&t.problems.unshift({type:"colwidth mismatch",pos:o,colwidth:a});}}function Xk(t){if(t.colwidth)return t.colwidth.slice();let e=[];for(let n=0;n<t.colspan;n++)e.push(0);return e}function ft(t){let e=t.cached.tableNodeTypes;if(!e){e=t.cached.tableNodeTypes={};for(let n in t.nodes){let r=t.nodes[n],i=r.spec.tableRole;i&&(e[i]=r);}}return e}var Kn=new re("selectingCells");function Zr(t){for(let e=t.depth-1;e>0;e--)if(t.node(e).type.spec.tableRole=="row")return t.node(0).resolve(t.before(e+1));return null}function Qk(t){for(let e=t.depth;e>0;e--){let n=t.node(e).type.spec.tableRole;if(n==="cell"||n==="header_cell")return t.node(e)}return null}function Vt(t){let e=t.selection.$head;for(let n=e.depth;n>0;n--)if(e.node(n).type.spec.tableRole=="row")return !0;return !1}function qs(t){let e=t.selection;if("$anchorCell"in e&&e.$anchorCell)return e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell;if("node"in e&&e.node&&e.node.type.spec.tableRole=="cell")return e.$anchor;let n=Zr(e.$head)||eN(e.$head);if(n)return n;throw new RangeError(`No cell found around position ${e.head}`)}function eN(t){for(let e=t.nodeAfter,n=t.pos;e;e=e.firstChild,n++){let r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n)}for(let e=t.nodeBefore,n=t.pos;e;e=e.lastChild,n--){let r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n-e.nodeSize)}}function Xc(t){return t.parent.type.spec.tableRole=="row"&&!!t.nodeAfter}function tN(t){return t.node(0).resolve(t.pos+t.nodeAfter.nodeSize)}function td(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function Im(t,e,n){let r=t.node(-1),i=Ue.get(r),o=t.start(-1),s=i.nextCell(t.pos-o,e,n);return s==null?null:t.node(0).resolve(o+s)}function br(t,e,n=1){let r={...t,colspan:t.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(e,n),r.colwidth.some(i=>i>0)||(r.colwidth=null)),r}function Lm(t,e,n=1){let r={...t,colspan:t.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let i=0;i<n;i++)r.colwidth.splice(e,0,0);}return r}function nN(t,e,n){let r=ft(e.type.schema).header_cell;for(let i=0;i<t.height;i++)if(e.nodeAt(t.map[n+i*t.width]).type!=r)return !1;return !0}var ke=class Tn extends q{constructor(e,n=e){let r=e.node(-1),i=Ue.get(r),o=e.start(-1),s=i.rectBetween(e.pos-o,n.pos-o),a=e.node(0),l=i.cellsInRect(s).filter(d=>d!=n.pos-o);l.unshift(n.pos-o);let c=l.map(d=>{let u=r.nodeAt(d);if(!u)throw RangeError(`No cell with offset ${d} found`);let f=o+d+1;return new Pr(a.resolve(f),a.resolve(f+u.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=e,this.$headCell=n;}map(e,n){let r=e.resolve(n.map(this.$anchorCell.pos)),i=e.resolve(n.map(this.$headCell.pos));if(Xc(r)&&Xc(i)&&td(r,i)){let o=this.$anchorCell.node(-1)!=r.node(-1);return o&&this.isRowSelection()?Tn.rowSelection(r,i):o&&this.isColSelection()?Tn.colSelection(r,i):new Tn(r,i)}return H.between(r,i)}content(){let e=this.$anchorCell.node(-1),n=Ue.get(e),r=this.$anchorCell.start(-1),i=n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r),o={},s=[];for(let l=i.top;l<i.bottom;l++){let c=[];for(let d=l*n.width+i.left,u=i.left;u<i.right;u++,d++){let f=n.map[d];if(o[f])continue;o[f]=!0;let p=n.findCell(f),h=e.nodeAt(f);if(!h)throw RangeError(`No cell with offset ${f} found`);let m=i.left-p.left,g=p.right-i.right;if(m>0||g>0){let b=h.attrs;if(m>0&&(b=br(b,0,m)),g>0&&(b=br(b,b.colspan-g,g)),p.left<i.left){if(h=h.type.createAndFill(b),!h)throw RangeError(`Could not create cell with attrs ${JSON.stringify(b)}`)}else h=h.type.create(b,h.content);}if(p.top<i.top||p.bottom>i.bottom){let b={...h.attrs,rowspan:Math.min(p.bottom,i.bottom)-Math.max(p.top,i.top)};p.top<i.top?h=h.type.createAndFill(b):h=h.type.create(b,h.content);}c.push(h);}s.push(e.child(l).copy(N.from(c)));}let a=this.isColSelection()&&this.isRowSelection()?e:s;return new B(N.from(a),1,1)}replace(e,n=B.empty){let r=e.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){let{$from:a,$to:l}=i[s],c=e.mapping.slice(r);e.replace(c.map(a.pos),c.map(l.pos),s?B.empty:n);}let o=q.findFrom(e.doc.resolve(e.mapping.slice(r).map(this.to)),-1);o&&e.setSelection(o);}replaceWith(e,n){this.replace(e,new B(N.from(n),0,0));}forEachCell(e){let n=this.$anchorCell.node(-1),r=Ue.get(n),i=this.$anchorCell.start(-1),o=r.cellsInRect(r.rectBetween(this.$anchorCell.pos-i,this.$headCell.pos-i));for(let s=0;s<o.length;s++)e(n.nodeAt(o[s]),i+o[s]);}isColSelection(){let e=this.$anchorCell.index(-1),n=this.$headCell.index(-1);if(Math.min(e,n)>0)return !1;let r=e+this.$anchorCell.nodeAfter.attrs.rowspan,i=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(r,i)==this.$headCell.node(-1).childCount}static colSelection(e,n=e){let r=e.node(-1),i=Ue.get(r),o=e.start(-1),s=i.findCell(e.pos-o),a=i.findCell(n.pos-o),l=e.node(0);return s.top<=a.top?(s.top>0&&(e=l.resolve(o+i.map[s.left])),a.bottom<i.height&&(n=l.resolve(o+i.map[i.width*(i.height-1)+a.right-1]))):(a.top>0&&(n=l.resolve(o+i.map[a.left])),s.bottom<i.height&&(e=l.resolve(o+i.map[i.width*(i.height-1)+s.right-1]))),new Tn(e,n)}isRowSelection(){let e=this.$anchorCell.node(-1),n=Ue.get(e),r=this.$anchorCell.start(-1),i=n.colCount(this.$anchorCell.pos-r),o=n.colCount(this.$headCell.pos-r);if(Math.min(i,o)>0)return !1;let s=i+this.$anchorCell.nodeAfter.attrs.colspan,a=o+this.$headCell.nodeAfter.attrs.colspan;return Math.max(s,a)==n.width}eq(e){return e instanceof Tn&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,n=e){let r=e.node(-1),i=Ue.get(r),o=e.start(-1),s=i.findCell(e.pos-o),a=i.findCell(n.pos-o),l=e.node(0);return s.left<=a.left?(s.left>0&&(e=l.resolve(o+i.map[s.top*i.width])),a.right<i.width&&(n=l.resolve(o+i.map[i.width*(a.top+1)-1]))):(a.left>0&&(n=l.resolve(o+i.map[a.top*i.width])),s.right<i.width&&(e=l.resolve(o+i.map[i.width*(s.top+1)-1]))),new Tn(e,n)}toJSON(){return {type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(e,n){return new Tn(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){return new Tn(e.resolve(n),e.resolve(r))}getBookmark(){return new rN(this.$anchorCell.pos,this.$headCell.pos)}};ke.prototype.visible=!1;q.jsonID("cell",ke);var rN=class Pm{constructor(e,n){this.anchor=e,this.head=n;}map(e){return new Pm(e.map(this.anchor),e.map(this.head))}resolve(e){let n=e.resolve(this.anchor),r=e.resolve(this.head);return n.parent.type.spec.tableRole=="row"&&r.parent.type.spec.tableRole=="row"&&n.index()<n.parent.childCount&&r.index()<r.parent.childCount&&td(n,r)?new ke(n,r):q.near(r,1)}};function iN(t){if(!(t.selection instanceof ke))return null;let e=[];return t.selection.forEachCell((n,r)=>{e.push(Ce.node(r,r+n.nodeSize,{class:"selectedCell"}));}),me.create(t.doc,e)}function oN({$from:t,$to:e}){if(t.pos==e.pos||t.pos<e.pos-6)return !1;let n=t.pos,r=e.pos,i=t.depth;for(;i>=0&&!(t.after(i+1)<t.end(i));i--,n++);for(let o=e.depth;o>=0&&!(e.before(o+1)>e.start(o));o--,r--);return n==r&&/row|table/.test(t.node(i).type.spec.tableRole)}function sN({$from:t,$to:e}){let n,r;for(let i=t.depth;i>0;i--){let o=t.node(i);if(o.type.spec.tableRole==="cell"||o.type.spec.tableRole==="header_cell"){n=o;break}}for(let i=e.depth;i>0;i--){let o=e.node(i);if(o.type.spec.tableRole==="cell"||o.type.spec.tableRole==="header_cell"){r=o;break}}return n!==r&&e.parentOffset===0}function aN(t,e,n){let r=(e||t).selection,i=(e||t).doc,o,s;if(r instanceof W&&(s=r.node.type.spec.tableRole)){if(s=="cell"||s=="header_cell")o=ke.create(i,r.from);else if(s=="row"){let a=i.resolve(r.from+1);o=ke.rowSelection(a,a);}else if(!n){let a=Ue.get(r.node),l=r.from+1,c=l+a.map[a.width*a.height-1];o=ke.create(i,l+1,c);}}else r instanceof H&&oN(r)?o=H.create(i,r.from):r instanceof H&&sN(r)&&(o=H.create(i,r.$from.start(),r.$from.end()));return o&&(e||(e=t.tr)).setSelection(o),e}var lN=new re("fix-tables");function Bm(t,e,n,r){let i=t.childCount,o=e.childCount;e:for(let s=0,a=0;s<o;s++){let l=e.child(s);for(let c=a,d=Math.min(i,s+3);c<d;c++)if(t.child(c)==l){a=c+1,n+=l.nodeSize;continue e}r(l,n),a<i&&t.child(a).sameMarkup(l)?Bm(t.child(a),l,n+1,r):l.nodesBetween(0,l.content.size,r,n+1),n+=l.nodeSize;}}function nd(t,e){let n,r=(i,o)=>{i.type.spec.tableRole=="table"&&(n=cN(t,i,o,n));};return e?e.doc!=t.doc&&Bm(e.doc,t.doc,0,r):t.doc.descendants(r),n}function cN(t,e,n,r){let i=Ue.get(e);if(!i.problems)return r;r||(r=t.tr);let o=[];for(let l=0;l<i.height;l++)o.push(0);for(let l=0;l<i.problems.length;l++){let c=i.problems[l];if(c.type=="collision"){let d=e.nodeAt(c.pos);if(!d)continue;let u=d.attrs;for(let f=0;f<u.rowspan;f++)o[c.row+f]+=c.n;r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,br(u,u.colspan-c.n,c.n));}else if(c.type=="missing")o[c.row]+=c.n;else if(c.type=="overlong_rowspan"){let d=e.nodeAt(c.pos);if(!d)continue;r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,{...d.attrs,rowspan:d.attrs.rowspan-c.n});}else if(c.type=="colwidth mismatch"){let d=e.nodeAt(c.pos);if(!d)continue;r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,{...d.attrs,colwidth:c.colwidth});}else if(c.type=="zero_sized"){let d=r.mapping.map(n);r.delete(d,d+e.nodeSize);}}let s,a;for(let l=0;l<o.length;l++)o[l]&&(s==null&&(s=l),a=l);for(let l=0,c=n+1;l<i.height;l++){let d=e.child(l),u=c+d.nodeSize,f=o[l];if(f>0){let p="cell";d.firstChild&&(p=d.firstChild.type.spec.tableRole);let h=[];for(let g=0;g<f;g++){let b=ft(t.schema)[p].createAndFill();b&&h.push(b);}let m=(l==0||s==l-1)&&a==l?c+1:u-1;r.insert(r.mapping.map(m),h);}c=u;}return r.setMeta(lN,{fixTables:!0})}function on(t){let e=t.selection,n=qs(t),r=n.node(-1),i=n.start(-1),o=Ue.get(r);return {...e instanceof ke?o.rectBetween(e.$anchorCell.pos-i,e.$headCell.pos-i):o.findCell(n.pos-i),tableStart:i,map:o,table:r}}function zm(t,{map:e,tableStart:n,table:r},i){let o=i>0?-1:0;nN(e,r,i+o)&&(o=i==0||i==e.width?null:0);for(let s=0;s<e.height;s++){let a=s*e.width+i;if(i>0&&i<e.width&&e.map[a-1]==e.map[a]){let l=e.map[a],c=r.nodeAt(l);t.setNodeMarkup(t.mapping.map(n+l),null,Lm(c.attrs,i-e.colCount(l))),s+=c.attrs.rowspan-1;}else {let l=o==null?ft(r.type.schema).cell:r.nodeAt(e.map[a+o]).type,c=e.positionAt(s,i,r);t.insert(t.mapping.map(n+c),l.createAndFill());}}return t}function Fm(t,e){if(!Vt(t))return !1;if(e){let n=on(t);e(zm(t.tr,n,n.left));}return !0}function Um(t,e){if(!Vt(t))return !1;if(e){let n=on(t);e(zm(t.tr,n,n.right));}return !0}function dN(t,{map:e,table:n,tableStart:r},i){let o=t.mapping.maps.length;for(let s=0;s<e.height;){let a=s*e.width+i,l=e.map[a],c=n.nodeAt(l),d=c.attrs;if(i>0&&e.map[a-1]==l||i<e.width-1&&e.map[a+1]==l)t.setNodeMarkup(t.mapping.slice(o).map(r+l),null,br(d,i-e.colCount(l)));else {let u=t.mapping.slice(o).map(r+l);t.delete(u,u+c.nodeSize);}s+=d.rowspan;}}function Hm(t,e){if(!Vt(t))return !1;if(e){let n=on(t),r=t.tr;if(n.left==0&&n.right==n.map.width)return !1;for(let i=n.right-1;dN(r,n,i),i!=n.left;i--){let o=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!o)throw RangeError("No table found");n.table=o,n.map=Ue.get(o);}e(r);}return !0}function uN(t,e,n){var r;let i=ft(e.type.schema).header_cell;for(let o=0;o<t.width;o++)if(((r=e.nodeAt(t.map[o+n*t.width]))==null?void 0:r.type)!=i)return !1;return !0}function $m(t,{map:e,tableStart:n,table:r},i){var o;let s=n;for(let c=0;c<i;c++)s+=r.child(c).nodeSize;let a=[],l=i>0?-1:0;uN(e,r,i+l)&&(l=i==0||i==e.height?null:0);for(let c=0,d=e.width*i;c<e.width;c++,d++)if(i>0&&i<e.height&&e.map[d]==e.map[d-e.width]){let u=e.map[d],f=r.nodeAt(u).attrs;t.setNodeMarkup(n+u,null,{...f,rowspan:f.rowspan+1}),c+=f.colspan-1;}else {let u=l==null?ft(r.type.schema).cell:(o=r.nodeAt(e.map[d+l*e.width]))==null?void 0:o.type,f=u?.createAndFill();f&&a.push(f);}return t.insert(s,ft(r.type.schema).row.create(null,a)),t}function Km(t,e){if(!Vt(t))return !1;if(e){let n=on(t);e($m(t.tr,n,n.top));}return !0}function Vm(t,e){if(!Vt(t))return !1;if(e){let n=on(t);e($m(t.tr,n,n.bottom));}return !0}function fN(t,{map:e,table:n,tableStart:r},i){let o=0;for(let c=0;c<i;c++)o+=n.child(c).nodeSize;let s=o+n.child(i).nodeSize,a=t.mapping.maps.length;t.delete(o+r,s+r);let l=new Set;for(let c=0,d=i*e.width;c<e.width;c++,d++){let u=e.map[d];if(!l.has(u)){if(l.add(u),i>0&&u==e.map[d-e.width]){let f=n.nodeAt(u).attrs;t.setNodeMarkup(t.mapping.slice(a).map(u+r),null,{...f,rowspan:f.rowspan-1}),c+=f.colspan-1;}else if(i<e.height&&u==e.map[d+e.width]){let f=n.nodeAt(u),p=f.attrs,h=f.type.create({...p,rowspan:f.attrs.rowspan-1},f.content),m=e.positionAt(i+1,c,n);t.insert(t.mapping.slice(a).map(r+m),h),c+=p.colspan-1;}}}}function Wm(t,e){if(!Vt(t))return !1;if(e){let n=on(t),r=t.tr;if(n.top==0&&n.bottom==n.map.height)return !1;for(let i=n.bottom-1;fN(r,n,i),i!=n.top;i--){let o=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!o)throw RangeError("No table found");n.table=o,n.map=Ue.get(n.table);}e(r);}return !0}function km(t){let e=t.content;return e.childCount==1&&e.child(0).isTextblock&&e.child(0).childCount==0}function pN({width:t,height:e,map:n},r){let i=r.top*t+r.left,o=i,s=(r.bottom-1)*t+r.left,a=i+(r.right-r.left-1);for(let l=r.top;l<r.bottom;l++){if(r.left>0&&n[o]==n[o-1]||r.right<t&&n[a]==n[a+1])return !0;o+=t,a+=t;}for(let l=r.left;l<r.right;l++){if(r.top>0&&n[i]==n[i-t]||r.bottom<e&&n[s]==n[s+t])return !0;i++,s++;}return !1}function rd(t,e){let n=t.selection;if(!(n instanceof ke)||n.$anchorCell.pos==n.$headCell.pos)return !1;let r=on(t),{map:i}=r;if(pN(i,r))return !1;if(e){let o=t.tr,s={},a=N.empty,l,c;for(let d=r.top;d<r.bottom;d++)for(let u=r.left;u<r.right;u++){let f=i.map[d*i.width+u],p=r.table.nodeAt(f);if(!(s[f]||!p))if(s[f]=!0,l==null)l=f,c=p;else {km(p)||(a=a.append(p.content));let h=o.mapping.map(f+r.tableStart);o.delete(h,h+p.nodeSize);}}if(l==null||c==null)return !0;if(o.setNodeMarkup(l+r.tableStart,null,{...Lm(c.attrs,c.attrs.colspan,r.right-r.left-c.attrs.colspan),rowspan:r.bottom-r.top}),a.size){let d=l+1+c.content.size,u=km(c)?l+1:d;o.replaceWith(u+r.tableStart,d+r.tableStart,a);}o.setSelection(new ke(o.doc.resolve(l+r.tableStart))),e(o);}return !0}function id(t,e){let n=ft(t.schema);return hN(({node:r})=>n[r.type.spec.tableRole])(t,e)}function hN(t){return (e,n)=>{var r;let i=e.selection,o,s;if(i instanceof ke){if(i.$anchorCell.pos!=i.$headCell.pos)return !1;o=i.$anchorCell.nodeAfter,s=i.$anchorCell.pos;}else {if(o=Qk(i.$from),!o)return !1;s=(r=Zr(i.$from))==null?void 0:r.pos;}if(o==null||s==null||o.attrs.colspan==1&&o.attrs.rowspan==1)return !1;if(n){let a=o.attrs,l=[],c=a.colwidth;a.rowspan>1&&(a={...a,rowspan:1}),a.colspan>1&&(a={...a,colspan:1});let d=on(e),u=e.tr;for(let p=0;p<d.right-d.left;p++)l.push(c?{...a,colwidth:c&&c[p]?[c[p]]:null}:a);let f;for(let p=d.top;p<d.bottom;p++){let h=d.map.positionAt(p,d.left,d.table);p==d.top&&(h+=o.nodeSize);for(let m=d.left,g=0;m<d.right;m++,g++)m==d.left&&p==d.top||u.insert(f=u.mapping.map(h+d.tableStart,1),t({node:o,row:p,col:m}).createAndFill(l[g]));}u.setNodeMarkup(s,t({node:o,row:d.top,col:d.left}),l[0]),i instanceof ke&&u.setSelection(new ke(u.doc.resolve(i.$anchorCell.pos),f?u.doc.resolve(f):void 0)),n(u);}return !0}}function Gm(t,e){return function(n,r){if(!Vt(n))return !1;let i=qs(n);if(i.nodeAfter.attrs[t]===e)return !1;if(r){let o=n.tr;n.selection instanceof ke?n.selection.forEachCell((s,a)=>{s.attrs[t]!==e&&o.setNodeMarkup(a,null,{...s.attrs,[t]:e});}):o.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[t]:e}),r(o);}return !0}}function mN(t){return function(e,n){if(!Vt(e))return !1;if(n){let r=ft(e.schema),i=on(e),o=e.tr,s=i.map.cellsInRect(t=="column"?{left:i.left,top:0,right:i.right,bottom:i.map.height}:t=="row"?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),a=s.map(l=>i.table.nodeAt(l));for(let l=0;l<s.length;l++)a[l].type==r.header_cell&&o.setNodeMarkup(i.tableStart+s[l],r.cell,a[l].attrs);if(o.steps.length==0)for(let l=0;l<s.length;l++)o.setNodeMarkup(i.tableStart+s[l],r.header_cell,a[l].attrs);n(o);}return !0}}function Nm(t,e,n){let r=e.map.cellsInRect({left:0,top:0,right:t=="row"?e.map.width:1,bottom:t=="column"?e.map.height:1});for(let i=0;i<r.length;i++){let o=e.table.nodeAt(r[i]);if(o&&o.type!==n.header_cell)return !1}return !0}function Xr(t,e){return e=e||{useDeprecatedLogic:!1},e.useDeprecatedLogic?mN(t):function(n,r){if(!Vt(n))return !1;if(r){let i=ft(n.schema),o=on(n),s=n.tr,a=Nm("row",o,i),l=Nm("column",o,i),d=(t==="column"?a:t==="row"?l:!1)?1:0,u=t=="column"?{left:0,top:d,right:1,bottom:o.map.height}:t=="row"?{left:d,top:0,right:o.map.width,bottom:1}:o,f=t=="column"?l?i.cell:i.header_cell:t=="row"?a?i.cell:i.header_cell:i.cell;o.map.cellsInRect(u).forEach(p=>{let h=p+o.tableStart,m=s.doc.nodeAt(h);m&&s.setNodeMarkup(h,f,m.attrs);}),r(s);}return !0}}Xr("row",{useDeprecatedLogic:!0});Xr("column",{useDeprecatedLogic:!0});var qm=Xr("cell",{useDeprecatedLogic:!0});function gN(t,e){if(e<0){let n=t.nodeBefore;if(n)return t.pos-n.nodeSize;for(let r=t.index(-1)-1,i=t.before();r>=0;r--){let o=t.node(-1).child(r),s=o.lastChild;if(s)return i-1-s.nodeSize;i-=o.nodeSize;}}else {if(t.index()<t.parent.childCount-1)return t.pos+t.nodeAfter.nodeSize;let n=t.node(-1);for(let r=t.indexAfter(-1),i=t.after();r<n.childCount;r++){let o=n.child(r);if(o.childCount)return i+1;i+=o.nodeSize;}}return null}function od(t){return function(e,n){if(!Vt(e))return !1;let r=gN(qs(e),t);if(r==null)return !1;if(n){let i=e.doc.resolve(r);n(e.tr.setSelection(H.between(i,tN(i))).scrollIntoView());}return !0}}function jm(t,e){let n=t.selection.$anchor;for(let r=n.depth;r>0;r--)if(n.node(r).type.spec.tableRole=="table")return e&&e(t.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return !1}function $s(t,e){let n=t.selection;if(!(n instanceof ke))return !1;if(e){let r=t.tr,i=ft(t.schema).cell.createAndFill().content;n.forEachCell((o,s)=>{o.content.eq(i)||r.replace(r.mapping.map(s+1),r.mapping.map(s+o.nodeSize-1),new B(i,0,0));}),r.docChanged&&e(r);}return !0}function bN(t){if(!t.size)return null;let{content:e,openStart:n,openEnd:r}=t;for(;e.childCount==1&&(n>0&&r>0||e.child(0).type.spec.tableRole=="table");)n--,r--,e=e.child(0).content;let i=e.child(0),o=i.type.spec.tableRole,s=i.type.schema,a=[];if(o=="row")for(let l=0;l<e.childCount;l++){let c=e.child(l).content,d=l?0:Math.max(0,n-1),u=l<e.childCount-1?0:Math.max(0,r-1);(d||u)&&(c=Qc(ft(s).row,new B(c,d,u)).content),a.push(c);}else if(o=="cell"||o=="header_cell")a.push(n||r?Qc(ft(s).row,new B(e,n,r)).content:e);else return null;return yN(s,a)}function yN(t,e){let n=[];for(let i=0;i<e.length;i++){let o=e[i];for(let s=o.childCount-1;s>=0;s--){let{rowspan:a,colspan:l}=o.child(s).attrs;for(let c=i;c<i+a;c++)n[c]=(n[c]||0)+l;}}let r=0;for(let i=0;i<n.length;i++)r=Math.max(r,n[i]);for(let i=0;i<n.length;i++)if(i>=e.length&&e.push(N.empty),n[i]<r){let o=ft(t).cell.createAndFill(),s=[];for(let a=n[i];a<r;a++)s.push(o);e[i]=e[i].append(N.from(s));}return {height:e.length,width:r,rows:e}}function Qc(t,e){let n=t.createAndFill();return new Dn(n).replace(0,n.content.size,e).doc}function EN({width:t,height:e,rows:n},r,i){if(t!=r){let o=[],s=[];for(let a=0;a<n.length;a++){let l=n[a],c=[];for(let d=o[a]||0,u=0;d<r;u++){let f=l.child(u%l.childCount);d+f.attrs.colspan>r&&(f=f.type.createChecked(br(f.attrs,f.attrs.colspan,d+f.attrs.colspan-r),f.content)),c.push(f),d+=f.attrs.colspan;for(let p=1;p<f.attrs.rowspan;p++)o[a+p]=(o[a+p]||0)+f.attrs.colspan;}s.push(N.from(c));}n=s,t=r;}if(e!=i){let o=[];for(let s=0,a=0;s<i;s++,a++){let l=[],c=n[a%e];for(let d=0;d<c.childCount;d++){let u=c.child(d);s+u.attrs.rowspan>i&&(u=u.type.create({...u.attrs,rowspan:Math.max(1,i-u.attrs.rowspan)},u.content)),l.push(u);}o.push(N.from(l));}n=o,e=i;}return {width:t,height:e,rows:n}}function vN(t,e,n,r,i,o,s){let a=t.doc.type.schema,l=ft(a),c,d;if(i>e.width)for(let u=0,f=0;u<e.height;u++){let p=n.child(u);f+=p.nodeSize;let h=[],m;p.lastChild==null||p.lastChild.type==l.cell?m=c||(c=l.cell.createAndFill()):m=d||(d=l.header_cell.createAndFill());for(let g=e.width;g<i;g++)h.push(m);t.insert(t.mapping.slice(s).map(f-1+r),h);}if(o>e.height){let u=[];for(let h=0,m=(e.height-1)*e.width;h<Math.max(e.width,i);h++){let g=h>=e.width?!1:n.nodeAt(e.map[m+h]).type==l.header_cell;u.push(g?d||(d=l.header_cell.createAndFill()):c||(c=l.cell.createAndFill()));}let f=l.row.create(null,N.from(u)),p=[];for(let h=e.height;h<o;h++)p.push(f);t.insert(t.mapping.slice(s).map(r+n.nodeSize-2),p);}return !!(c||d)}function Tm(t,e,n,r,i,o,s,a){if(s==0||s==e.height)return !1;let l=!1;for(let c=i;c<o;c++){let d=s*e.width+c,u=e.map[d];if(e.map[d-e.width]==u){l=!0;let f=n.nodeAt(u),{top:p,left:h}=e.findCell(u);t.setNodeMarkup(t.mapping.slice(a).map(u+r),null,{...f.attrs,rowspan:s-p}),t.insert(t.mapping.slice(a).map(e.positionAt(s,h,n)),f.type.createAndFill({...f.attrs,rowspan:p+f.attrs.rowspan-s})),c+=f.attrs.colspan-1;}}return l}function _m(t,e,n,r,i,o,s,a){if(s==0||s==e.width)return !1;let l=!1;for(let c=i;c<o;c++){let d=c*e.width+s,u=e.map[d];if(e.map[d-1]==u){l=!0;let f=n.nodeAt(u),p=e.colCount(u),h=t.mapping.slice(a).map(u+r);t.setNodeMarkup(h,null,br(f.attrs,s-p,f.attrs.colspan-(s-p))),t.insert(h+f.nodeSize,f.type.createAndFill(br(f.attrs,0,s-p))),c+=f.attrs.rowspan-1;}}return l}function Mm(t,e,n,r,i){let o=n?t.doc.nodeAt(n-1):t.doc;if(!o)throw new Error("No table found");let s=Ue.get(o),{top:a,left:l}=r,c=l+i.width,d=a+i.height,u=t.tr,f=0;function p(){if(o=n?u.doc.nodeAt(n-1):u.doc,!o)throw new Error("No table found");s=Ue.get(o),f=u.mapping.maps.length;}vN(u,s,o,n,c,d,f)&&p(),Tm(u,s,o,n,l,c,a,f)&&p(),Tm(u,s,o,n,l,c,d,f)&&p(),_m(u,s,o,n,a,d,l,f)&&p(),_m(u,s,o,n,a,d,c,f)&&p();for(let h=a;h<d;h++){let m=s.positionAt(h,l,o),g=s.positionAt(h,c,o);u.replace(u.mapping.slice(f).map(m+n),u.mapping.slice(f).map(g+n),new B(i.rows[h-a],0,0));}p(),u.setSelection(new ke(u.doc.resolve(n+s.positionAt(a,l,o)),u.doc.resolve(n+s.positionAt(d-1,c-1,o)))),e(u);}var wN=Ri({ArrowLeft:Ks("horiz",-1),ArrowRight:Ks("horiz",1),ArrowUp:Ks("vert",-1),ArrowDown:Ks("vert",1),"Shift-ArrowLeft":Vs("horiz",-1),"Shift-ArrowRight":Vs("horiz",1),"Shift-ArrowUp":Vs("vert",-1),"Shift-ArrowDown":Vs("vert",1),Backspace:$s,"Mod-Backspace":$s,Delete:$s,"Mod-Delete":$s});function Ws(t,e,n){return n.eq(t.selection)?!1:(e&&e(t.tr.setSelection(n).scrollIntoView()),!0)}function Ks(t,e){return (n,r,i)=>{if(!i)return !1;let o=n.selection;if(o instanceof ke)return Ws(n,r,q.near(o.$headCell,e));if(t!="horiz"&&!o.empty)return !1;let s=Jm(i,t,e);if(s==null)return !1;if(t=="horiz")return Ws(n,r,q.near(n.doc.resolve(o.head+e),e));{let a=n.doc.resolve(s),l=Im(a,t,e),c;return l?c=q.near(l,1):e<0?c=q.near(n.doc.resolve(a.before(-1)),-1):c=q.near(n.doc.resolve(a.after(-1)),1),Ws(n,r,c)}}}function Vs(t,e){return (n,r,i)=>{if(!i)return !1;let o=n.selection,s;if(o instanceof ke)s=o;else {let l=Jm(i,t,e);if(l==null)return !1;s=new ke(n.doc.resolve(l));}let a=Im(s.$headCell,t,e);return a?Ws(n,r,new ke(s.$anchorCell,a)):!1}}function xN(t,e){let n=t.state.doc,r=Zr(n.resolve(e));return r?(t.dispatch(t.state.tr.setSelection(new ke(r))),!0):!1}function SN(t,e,n){if(!Vt(t.state))return !1;let r=bN(n),i=t.state.selection;if(i instanceof ke){r||(r={width:1,height:1,rows:[N.from(Qc(ft(t.state.schema).cell,n))]});let o=i.$anchorCell.node(-1),s=i.$anchorCell.start(-1),a=Ue.get(o).rectBetween(i.$anchorCell.pos-s,i.$headCell.pos-s);return r=EN(r,a.right-a.left,a.bottom-a.top),Mm(t.state,t.dispatch,s,a,r),!0}else if(r){let o=qs(t.state),s=o.start(-1);return Mm(t.state,t.dispatch,s,Ue.get(o.node(-1)).findCell(o.pos-s),r),!0}else return !1}function CN(t,e){var n;if(e.ctrlKey||e.metaKey)return;let r=Am(t,e.target),i;if(e.shiftKey&&t.state.selection instanceof ke)o(t.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&r&&(i=Zr(t.state.selection.$anchor))!=null&&((n=Jc(t,e))==null?void 0:n.pos)!=i.pos)o(i,e),e.preventDefault();else if(!r)return;function o(l,c){let d=Jc(t,c),u=Kn.getState(t.state)==null;if(!d||!td(l,d))if(u)d=l;else return;let f=new ke(l,d);if(u||!t.state.selection.eq(f)){let p=t.state.tr.setSelection(f);u&&p.setMeta(Kn,l.pos),t.dispatch(p);}}function s(){t.root.removeEventListener("mouseup",s),t.root.removeEventListener("dragstart",s),t.root.removeEventListener("mousemove",a),Kn.getState(t.state)!=null&&t.dispatch(t.state.tr.setMeta(Kn,-1));}function a(l){let c=l,d=Kn.getState(t.state),u;if(d!=null)u=t.state.doc.resolve(d);else if(Am(t,c.target)!=r&&(u=Jc(t,e),!u))return s();u&&o(u,c);}t.root.addEventListener("mouseup",s),t.root.addEventListener("dragstart",s),t.root.addEventListener("mousemove",a);}function Jm(t,e,n){if(!(t.state.selection instanceof H))return null;let{$head:r}=t.state.selection;for(let i=r.depth-1;i>=0;i--){let o=r.node(i);if((n<0?r.index(i):r.indexAfter(i))!=(n<0?0:o.childCount))return null;if(o.type.spec.tableRole=="cell"||o.type.spec.tableRole=="header_cell"){let a=r.before(i),l=e=="vert"?n>0?"down":"up":n>0?"right":"left";return t.endOfTextblock(l)?a:null}}return null}function Am(t,e){for(;e&&e!=t.dom;e=e.parentNode)if(e.nodeName=="TD"||e.nodeName=="TH")return e;return null}function Jc(t,e){let n=t.posAtCoords({left:e.clientX,top:e.clientY});return n&&n?Zr(t.state.doc.resolve(n.pos)):null}var kN=class{constructor(t,e){this.node=t,this.defaultCellMinWidth=e,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${e}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),ed(t,this.colgroup,this.table,e),this.contentDOM=this.table.appendChild(document.createElement("tbody"));}update(t){return t.type!=this.node.type?!1:(this.node=t,ed(t,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(t){return t.type=="attributes"&&(t.target==this.table||this.colgroup.contains(t.target))}};function ed(t,e,n,r,i,o){var s;let a=0,l=!0,c=e.firstChild,d=t.firstChild;if(d){for(let u=0,f=0;u<d.childCount;u++){let{colspan:p,colwidth:h}=d.child(u).attrs;for(let m=0;m<p;m++,f++){let g=i==f?o:h&&h[m],b=g?g+"px":"";if(a+=g||r,g||(l=!1),c)c.style.width!=b&&(c.style.width=b),c=c.nextSibling;else {let v=document.createElement("col");v.style.width=b,e.appendChild(v);}}}for(;c;){let u=c.nextSibling;(s=c.parentNode)==null||s.removeChild(c),c=u;}l?(n.style.width=a+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=a+"px");}}var Ot=new re("tableColumnResizing");function Ym({handleWidth:t=5,cellMinWidth:e=25,defaultCellMinWidth:n=100,View:r=kN,lastColumnResizable:i=!0}={}){let o=new Z({key:Ot,state:{init(s,a){var l,c;let d=(c=(l=o.spec)==null?void 0:l.props)==null?void 0:c.nodeViews,u=ft(a.schema).table.name;return r&&d&&(d[u]=(f,p)=>new r(f,n,p)),new NN(-1,!1)},apply(s,a){return a.apply(s)}},props:{attributes:s=>{let a=Ot.getState(s);return a&&a.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(s,a)=>{TN(s,a,t,i);},mouseleave:s=>{_N(s);},mousedown:(s,a)=>{MN(s,a,e,n);}},decorations:s=>{let a=Ot.getState(s);if(a&&a.activeHandle>-1)return IN(s,a.activeHandle)},nodeViews:{}}});return o}var NN=class Gs{constructor(e,n){this.activeHandle=e,this.dragging=n;}apply(e){let n=this,r=e.getMeta(Ot);if(r&&r.setHandle!=null)return new Gs(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new Gs(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&e.docChanged){let i=e.mapping.map(n.activeHandle,-1);return Xc(e.doc.resolve(i))||(i=-1),new Gs(i,n.dragging)}return n}};function TN(t,e,n,r){if(!t.editable)return;let i=Ot.getState(t.state);if(i&&!i.dragging){let o=ON(e.target),s=-1;if(o){let{left:a,right:l}=o.getBoundingClientRect();e.clientX-a<=n?s=Om(t,e,"left",n):l-e.clientX<=n&&(s=Om(t,e,"right",n));}if(s!=i.activeHandle){if(!r&&s!==-1){let a=t.state.doc.resolve(s),l=a.node(-1),c=Ue.get(l),d=a.start(-1);if(c.colCount(a.pos-d)+a.nodeAfter.attrs.colspan-1==c.width-1)return}Zm(t,s);}}}function _N(t){if(!t.editable)return;let e=Ot.getState(t.state);e&&e.activeHandle>-1&&!e.dragging&&Zm(t,-1);}function MN(t,e,n,r){var i;if(!t.editable)return !1;let o=(i=t.dom.ownerDocument.defaultView)!=null?i:window,s=Ot.getState(t.state);if(!s||s.activeHandle==-1||s.dragging)return !1;let a=t.state.doc.nodeAt(s.activeHandle),l=AN(t,s.activeHandle,a.attrs);t.dispatch(t.state.tr.setMeta(Ot,{setDragging:{startX:e.clientX,startWidth:l}}));function c(u){o.removeEventListener("mouseup",c),o.removeEventListener("mousemove",d);let f=Ot.getState(t.state);f?.dragging&&(RN(t,f.activeHandle,Rm(f.dragging,u,n)),t.dispatch(t.state.tr.setMeta(Ot,{setDragging:null})));}function d(u){if(!u.which)return c(u);let f=Ot.getState(t.state);if(f&&f.dragging){let p=Rm(f.dragging,u,n);Dm(t,f.activeHandle,p,r);}}return Dm(t,s.activeHandle,l,r),o.addEventListener("mouseup",c),o.addEventListener("mousemove",d),e.preventDefault(),!0}function AN(t,e,{colspan:n,colwidth:r}){let i=r&&r[r.length-1];if(i)return i;let o=t.domAtPos(e),a=o.node.childNodes[o.offset].offsetWidth,l=n;if(r)for(let c=0;c<n;c++)r[c]&&(a-=r[c],l--);return a/l}function ON(t){for(;t&&t.nodeName!="TD"&&t.nodeName!="TH";)t=t.classList&&t.classList.contains("ProseMirror")?null:t.parentNode;return t}function Om(t,e,n,r){let i=n=="right"?-r:r,o=t.posAtCoords({left:e.clientX+i,top:e.clientY});if(!o)return -1;let{pos:s}=o,a=Zr(t.state.doc.resolve(s));if(!a)return -1;if(n=="right")return a.pos;let l=Ue.get(a.node(-1)),c=a.start(-1),d=l.map.indexOf(a.pos-c);return d%l.width==0?-1:c+l.map[d-1]}function Rm(t,e,n){let r=e.clientX-t.startX;return Math.max(n,t.startWidth+r)}function Zm(t,e){t.dispatch(t.state.tr.setMeta(Ot,{setHandle:e}));}function RN(t,e,n){let r=t.state.doc.resolve(e),i=r.node(-1),o=Ue.get(i),s=r.start(-1),a=o.colCount(r.pos-s)+r.nodeAfter.attrs.colspan-1,l=t.state.tr;for(let c=0;c<o.height;c++){let d=c*o.width+a;if(c&&o.map[d]==o.map[d-o.width])continue;let u=o.map[d],f=i.nodeAt(u).attrs,p=f.colspan==1?0:a-o.colCount(u);if(f.colwidth&&f.colwidth[p]==n)continue;let h=f.colwidth?f.colwidth.slice():DN(f.colspan);h[p]=n,l.setNodeMarkup(s+u,null,{...f,colwidth:h});}l.docChanged&&t.dispatch(l);}function Dm(t,e,n,r){let i=t.state.doc.resolve(e),o=i.node(-1),s=i.start(-1),a=Ue.get(o).colCount(i.pos-s)+i.nodeAfter.attrs.colspan-1,l=t.domAtPos(i.start(-1)).node;for(;l&&l.nodeName!="TABLE";)l=l.parentNode;l&&ed(o,l.firstChild,l,r,a,n);}function DN(t){return Array(t).fill(0)}function IN(t,e){var n;let r=[],i=t.doc.resolve(e),o=i.node(-1);if(!o)return me.empty;let s=Ue.get(o),a=i.start(-1),l=s.colCount(i.pos-a)+i.nodeAfter.attrs.colspan-1;for(let c=0;c<s.height;c++){let d=l+c*s.width;if((l==s.width-1||s.map[d]!=s.map[d+1])&&(c==0||s.map[d]!=s.map[d-s.width])){let u=s.map[d],f=a+u+o.nodeAt(u).nodeSize-1,p=document.createElement("div");p.className="column-resize-handle",(n=Ot.getState(t))!=null&&n.dragging&&r.push(Ce.node(a+u,a+u+o.nodeAt(u).nodeSize,{class:"column-resize-dragging"})),r.push(Ce.widget(f,p));}}return me.create(t.doc,r)}function Xm({allowTableNodeSelection:t=!1}={}){return new Z({key:Kn,state:{init(){return null},apply(e,n){let r=e.getMeta(Kn);if(r!=null)return r==-1?null:r;if(n==null||!e.docChanged)return n;let{deleted:i,pos:o}=e.mapping.mapResult(n);return i?null:o}},props:{decorations:iN,handleDOMEvents:{mousedown:CN},createSelectionBetween(e){return Kn.getState(e.state)!=null?e.state.selection:null},handleTripleClick:xN,handleKeyDown:wN,handlePaste:SN},appendTransaction(e,n,r){return aN(r,nd(r,n),t)}})}var Js=ge.create({name:"tableCell",addOptions(){return {HTMLAttributes:{}}},content:"block+",addAttributes(){return {colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{let e=t.getAttribute("colwidth");return e?e.split(",").map(r=>parseInt(r,10)):null}}}},tableRole:"cell",isolating:!0,parseHTML(){return [{tag:"td"}]},renderHTML({HTMLAttributes:t}){return ["td",te(this.options.HTMLAttributes,t),0]}}),Ys=ge.create({name:"tableHeader",addOptions(){return {HTMLAttributes:{}}},content:"block+",addAttributes(){return {colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{let e=t.getAttribute("colwidth");return e?e.split(",").map(r=>parseInt(r,10)):null}}}},tableRole:"header_cell",isolating:!0,parseHTML(){return [{tag:"th"}]},renderHTML({HTMLAttributes:t}){return ["th",te(this.options.HTMLAttributes,t),0]}}),Zs=ge.create({name:"tableRow",addOptions(){return {HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return [{tag:"tr"}]},renderHTML({HTMLAttributes:t}){return ["tr",te(this.options.HTMLAttributes,t),0]}});function sd(t,e){return e?["width",`${Math.max(e,t)}px`]:["min-width",`${t}px`]}function Qm(t,e,n,r,i,o){var s;let a=0,l=!0,c=e.firstChild,d=t.firstChild;if(d!==null)for(let u=0,f=0;u<d.childCount;u+=1){let{colspan:p,colwidth:h}=d.child(u).attrs;for(let m=0;m<p;m+=1,f+=1){let g=i===f?o:h&&h[m],b=g?`${g}px`:"";if(a+=g||r,g||(l=!1),c){if(c.style.width!==b){let[v,S]=sd(r,g);c.style.setProperty(v,S);}c=c.nextSibling;}else {let v=document.createElement("col"),[S,T]=sd(r,g);v.style.setProperty(S,T),e.appendChild(v);}}}for(;c;){let u=c.nextSibling;(s=c.parentNode)==null||s.removeChild(c),c=u;}l?(n.style.width=`${a}px`,n.style.minWidth=""):(n.style.width="",n.style.minWidth=`${a}px`);}var LN=class{constructor(t,e){this.node=t,this.cellMinWidth=e,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),Qm(t,this.colgroup,this.table,e),this.contentDOM=this.table.appendChild(document.createElement("tbody"));}update(t){return t.type!==this.node.type?!1:(this.node=t,Qm(t,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(t){return t.type==="attributes"&&(t.target===this.table||this.colgroup.contains(t.target))}};function PN(t,e,n,r){let i=0,o=!0,s=[],a=t.firstChild;if(!a)return {};for(let u=0,f=0;u<a.childCount;u+=1){let{colspan:p,colwidth:h}=a.child(u).attrs;for(let m=0;m<p;m+=1,f+=1){let g=n===f?r:h&&h[m];i+=g||e,g||(o=!1);let[b,v]=sd(e,g);s.push(["col",{style:`${b}: ${v}`}]);}}let l=o?`${i}px`:"",c=o?"":`${i}px`;return {colgroup:["colgroup",{},...s],tableWidth:l,tableMinWidth:c}}function eg(t,e){return e?t.createChecked(null,e):t.createAndFill()}function BN(t){if(t.cached.tableNodeTypes)return t.cached.tableNodeTypes;let e={};return Object.keys(t.nodes).forEach(n=>{let r=t.nodes[n];r.spec.tableRole&&(e[r.spec.tableRole]=r);}),t.cached.tableNodeTypes=e,e}function zN(t,e,n,r,i){let o=BN(t),s=[],a=[];for(let c=0;c<n;c+=1){let d=eg(o.cell,i);if(d&&a.push(d),r){let u=eg(o.header_cell,i);u&&s.push(u);}}let l=[];for(let c=0;c<e;c+=1)l.push(o.row.createChecked(null,r&&c===0?s:a));return o.table.createChecked(null,l)}function FN(t){return t instanceof ke}var js=({editor:t})=>{let{selection:e}=t.state;if(!FN(e))return !1;let n=0,r=Yl(e.ranges[0].$from,o=>o.type.name==="table");return r?.node.descendants(o=>{if(o.type.name==="table")return !1;["tableCell","tableHeader"].includes(o.type.name)&&(n+=1);}),n===e.ranges.length?(t.commands.deleteTable(),!0):!1},ad=ge.create({name:"table",addOptions(){return {HTMLAttributes:{},resizable:!1,handleWidth:5,cellMinWidth:25,View:LN,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML(){return [{tag:"table"}]},renderHTML({node:t,HTMLAttributes:e}){let{colgroup:n,tableWidth:r,tableMinWidth:i}=PN(t,this.options.cellMinWidth);return ["table",te(this.options.HTMLAttributes,e,{style:r?`width: ${r}`:`min-width: ${i}`}),n,["tbody",0]]},addCommands(){return {insertTable:({rows:t=3,cols:e=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:i,editor:o})=>{let s=zN(o.schema,t,e,n);if(i){let a=r.selection.from+1;r.replaceSelectionWith(s).scrollIntoView().setSelection(H.near(r.doc.resolve(a)));}return !0},addColumnBefore:()=>({state:t,dispatch:e})=>Fm(t,e),addColumnAfter:()=>({state:t,dispatch:e})=>Um(t,e),deleteColumn:()=>({state:t,dispatch:e})=>Hm(t,e),addRowBefore:()=>({state:t,dispatch:e})=>Km(t,e),addRowAfter:()=>({state:t,dispatch:e})=>Vm(t,e),deleteRow:()=>({state:t,dispatch:e})=>Wm(t,e),deleteTable:()=>({state:t,dispatch:e})=>jm(t,e),mergeCells:()=>({state:t,dispatch:e})=>rd(t,e),splitCell:()=>({state:t,dispatch:e})=>id(t,e),toggleHeaderColumn:()=>({state:t,dispatch:e})=>Xr("column")(t,e),toggleHeaderRow:()=>({state:t,dispatch:e})=>Xr("row")(t,e),toggleHeaderCell:()=>({state:t,dispatch:e})=>qm(t,e),mergeOrSplit:()=>({state:t,dispatch:e})=>rd(t,e)?!0:id(t,e),setCellAttribute:(t,e)=>({state:n,dispatch:r})=>Gm(t,e)(n,r),goToNextCell:()=>({state:t,dispatch:e})=>od(1)(t,e),goToPreviousCell:()=>({state:t,dispatch:e})=>od(-1)(t,e),fixTables:()=>({state:t,dispatch:e})=>(e&&nd(t),!0),setCellSelection:t=>({tr:e,dispatch:n})=>{if(n){let r=ke.create(e.doc,t.anchorCell,t.headCell);e.setSelection(r);}return !0}}},addKeyboardShortcuts(){return {Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:js,"Mod-Backspace":js,Delete:js,"Mod-Delete":js}},addProseMirrorPlugins(){return [...this.options.resizable&&this.editor.isEditable?[Ym({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],Xm({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(t){let e={name:t.name,options:t.options,storage:t.storage};return {tableRole:Se(j(t,"tableRole",e))}}});ne.create({name:"tableKit",addExtensions(){let t=[];return this.options.table!==!1&&t.push(ad.configure(this.options.table)),this.options.tableCell!==!1&&t.push(Js.configure(this.options.tableCell)),this.options.tableHeader!==!1&&t.push(Ys.configure(this.options.tableHeader)),this.options.tableRow!==!1&&t.push(Zs.configure(this.options.tableRow)),t}});var tg=Zs;var ng=Js;var rg=Ys;var UN=t=>{if(!t.children.length)return;let e=t.querySelectorAll("span");e&&e.forEach(n=>{var r,i;let o=n.getAttribute("style"),s=(i=(r=n.parentElement)==null?void 0:r.closest("span"))==null?void 0:i.getAttribute("style");n.setAttribute("style",`${s};${o}`);});},ld=nt.create({name:"textStyle",priority:101,addOptions(){return {HTMLAttributes:{},mergeNestedSpanStyles:!0}},parseHTML(){return [{tag:"span",consuming:!1,getAttrs:t=>t.hasAttribute("style")?(this.options.mergeNestedSpanStyles&&UN(t),{}):!1}]},renderHTML({HTMLAttributes:t}){return ["span",te(this.options.HTMLAttributes,t),0]},addCommands(){return {toggleTextStyle:t=>({commands:e})=>e.toggleMark(this.name,t),removeEmptyTextStyle:()=>({tr:t})=>{let{selection:e}=t;return t.doc.nodesBetween(e.from,e.to,(n,r)=>{if(n.isTextblock)return !0;n.marks.filter(i=>i.type===this.type).some(i=>Object.values(i.attrs).some(o=>!!o))||t.removeMark(r,r+n.nodeSize,this.type);}),!0}}}}),HN=ne.create({name:"backgroundColor",addOptions(){return {types:["textStyle"]}},addGlobalAttributes(){return [{types:this.options.types,attributes:{backgroundColor:{default:null,parseHTML:t=>{var e;return (e=t.style.backgroundColor)==null?void 0:e.replace(/['"]+/g,"")},renderHTML:t=>t.backgroundColor?{style:`background-color: ${t.backgroundColor}`}:{}}}}]},addCommands(){return {setBackgroundColor:t=>({chain:e})=>e().setMark("textStyle",{backgroundColor:t}).run(),unsetBackgroundColor:()=>({chain:t})=>t().setMark("textStyle",{backgroundColor:null}).removeEmptyTextStyle().run()}}}),cd=ne.create({name:"color",addOptions(){return {types:["textStyle"]}},addGlobalAttributes(){return [{types:this.options.types,attributes:{color:{default:null,parseHTML:t=>{var e;return (e=t.style.color)==null?void 0:e.replace(/['"]+/g,"")},renderHTML:t=>t.color?{style:`color: ${t.color}`}:{}}}}]},addCommands(){return {setColor:t=>({chain:e})=>e().setMark("textStyle",{color:t}).run(),unsetColor:()=>({chain:t})=>t().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}}),$N=ne.create({name:"fontFamily",addOptions(){return {types:["textStyle"]}},addGlobalAttributes(){return [{types:this.options.types,attributes:{fontFamily:{default:null,parseHTML:t=>t.style.fontFamily,renderHTML:t=>t.fontFamily?{style:`font-family: ${t.fontFamily}`}:{}}}}]},addCommands(){return {setFontFamily:t=>({chain:e})=>e().setMark("textStyle",{fontFamily:t}).run(),unsetFontFamily:()=>({chain:t})=>t().setMark("textStyle",{fontFamily:null}).removeEmptyTextStyle().run()}}}),KN=ne.create({name:"fontSize",addOptions(){return {types:["textStyle"]}},addGlobalAttributes(){return [{types:this.options.types,attributes:{fontSize:{default:null,parseHTML:t=>t.style.fontSize,renderHTML:t=>t.fontSize?{style:`font-size: ${t.fontSize}`}:{}}}}]},addCommands(){return {setFontSize:t=>({chain:e})=>e().setMark("textStyle",{fontSize:t}).run(),unsetFontSize:()=>({chain:t})=>t().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().run()}}}),VN=ne.create({name:"lineHeight",addOptions(){return {types:["textStyle"]}},addGlobalAttributes(){return [{types:this.options.types,attributes:{lineHeight:{default:null,parseHTML:t=>t.style.lineHeight,renderHTML:t=>t.lineHeight?{style:`line-height: ${t.lineHeight}`}:{}}}}]},addCommands(){return {setLineHeight:t=>({chain:e})=>e().setMark("textStyle",{lineHeight:t}).run(),unsetLineHeight:()=>({chain:t})=>t().setMark("textStyle",{lineHeight:null}).removeEmptyTextStyle().run()}}});ne.create({name:"textStyleKit",addExtensions(){let t=[];return this.options.backgroundColor!==!1&&t.push(HN.configure(this.options.backgroundColor)),this.options.color!==!1&&t.push(cd.configure(this.options.color)),this.options.fontFamily!==!1&&t.push($N.configure(this.options.fontFamily)),this.options.fontSize!==!1&&t.push(KN.configure(this.options.fontSize)),this.options.lineHeight!==!1&&t.push(VN.configure(this.options.lineHeight)),this.options.textStyle!==!1&&t.push(ld.configure(this.options.textStyle)),t}});var ig=cd;var og=Zi;var sg=Bs;var ag=Ps;var WN=t=>Ie({find:/--$/,replace:t??"\u2014"}),GN=t=>Ie({find:/\.\.\.$/,replace:t??"\u2026"}),qN=t=>Ie({find:/(?:^|[\s{[(<'"\u2018\u201C])(")$/,replace:t??"\u201C"}),jN=t=>Ie({find:/"$/,replace:t??"\u201D"}),JN=t=>Ie({find:/(?:^|[\s{[(<'"\u2018\u201C])(')$/,replace:t??"\u2018"}),YN=t=>Ie({find:/'$/,replace:t??"\u2019"}),ZN=t=>Ie({find:/<-$/,replace:t??"\u2190"}),XN=t=>Ie({find:/->$/,replace:t??"\u2192"}),QN=t=>Ie({find:/\(c\)$/,replace:t??"\xA9"}),eT=t=>Ie({find:/\(tm\)$/,replace:t??"\u2122"}),tT=t=>Ie({find:/\(sm\)$/,replace:t??"\u2120"}),nT=t=>Ie({find:/\(r\)$/,replace:t??"\xAE"}),rT=t=>Ie({find:/(?:^|\s)(1\/2)\s$/,replace:t??"\xBD"}),iT=t=>Ie({find:/\+\/-$/,replace:t??"\xB1"}),oT=t=>Ie({find:/!=$/,replace:t??"\u2260"}),sT=t=>Ie({find:/<<$/,replace:t??"\xAB"}),aT=t=>Ie({find:/>>$/,replace:t??"\xBB"}),lT=t=>Ie({find:/\d+\s?([*x])\s?\d+$/,replace:t??"\xD7"}),cT=t=>Ie({find:/\^2$/,replace:t??"\xB2"}),dT=t=>Ie({find:/\^3$/,replace:t??"\xB3"}),uT=t=>Ie({find:/(?:^|\s)(1\/4)\s$/,replace:t??"\xBC"}),fT=t=>Ie({find:/(?:^|\s)(3\/4)\s$/,replace:t??"\xBE"}),pT=ne.create({name:"typography",addOptions(){return {closeDoubleQuote:"\u201D",closeSingleQuote:"\u2019",copyright:"\xA9",ellipsis:"\u2026",emDash:"\u2014",laquo:"\xAB",leftArrow:"\u2190",multiplication:"\xD7",notEqual:"\u2260",oneHalf:"\xBD",oneQuarter:"\xBC",openDoubleQuote:"\u201C",openSingleQuote:"\u2018",plusMinus:"\xB1",raquo:"\xBB",registeredTrademark:"\xAE",rightArrow:"\u2192",servicemark:"\u2120",superscriptThree:"\xB3",superscriptTwo:"\xB2",threeQuarters:"\xBE",trademark:"\u2122"}},addInputRules(){let t=[];return this.options.emDash!==!1&&t.push(WN(this.options.emDash)),this.options.ellipsis!==!1&&t.push(GN(this.options.ellipsis)),this.options.openDoubleQuote!==!1&&t.push(qN(this.options.openDoubleQuote)),this.options.closeDoubleQuote!==!1&&t.push(jN(this.options.closeDoubleQuote)),this.options.openSingleQuote!==!1&&t.push(JN(this.options.openSingleQuote)),this.options.closeSingleQuote!==!1&&t.push(YN(this.options.closeSingleQuote)),this.options.leftArrow!==!1&&t.push(ZN(this.options.leftArrow)),this.options.rightArrow!==!1&&t.push(XN(this.options.rightArrow)),this.options.copyright!==!1&&t.push(QN(this.options.copyright)),this.options.trademark!==!1&&t.push(eT(this.options.trademark)),this.options.servicemark!==!1&&t.push(tT(this.options.servicemark)),this.options.registeredTrademark!==!1&&t.push(nT(this.options.registeredTrademark)),this.options.oneHalf!==!1&&t.push(rT(this.options.oneHalf)),this.options.plusMinus!==!1&&t.push(iT(this.options.plusMinus)),this.options.notEqual!==!1&&t.push(oT(this.options.notEqual)),this.options.laquo!==!1&&t.push(sT(this.options.laquo)),this.options.raquo!==!1&&t.push(aT(this.options.raquo)),this.options.multiplication!==!1&&t.push(lT(this.options.multiplication)),this.options.superscriptTwo!==!1&&t.push(cT(this.options.superscriptTwo)),this.options.superscriptThree!==!1&&t.push(dT(this.options.superscriptThree)),this.options.oneQuarter!==!1&&t.push(uT(this.options.oneQuarter)),this.options.threeQuarters!==!1&&t.push(fT(this.options.threeQuarters)),t}}),lg=pT;var Mg=ai(_g(),1);var na=Mg.default;function Rg(t,e=[]){return t.map(n=>{let r=[...e,...n.properties?n.properties.className:[]];return n.children?Rg(n.children,r):{text:n.value,classes:r}}).flat()}function Ag(t){return t.value||t.children||[]}function r_(t){return !!na.getLanguage(t)}function Og({doc:t,name:e,lowlight:n,defaultLanguage:r}){let i=[];return qo(t,o=>o.type.name===e).forEach(o=>{var s;let a=o.pos+1,l=o.node.attrs.language||r,c=n.listLanguages(),d=l&&(c.includes(l)||r_(l)||(s=n.registered)!=null&&s.call(n,l))?Ag(n.highlight(l,o.node.textContent)):Ag(n.highlightAuto(o.node.textContent));Rg(d).forEach(u=>{let f=a+u.text.length;if(u.classes.length){let p=Ce.inline(a,f,{class:u.classes.join(" ")});i.push(p);}a=f;});}),me.create(t,i)}function i_(t){return typeof t=="function"}function o_({name:t,lowlight:e,defaultLanguage:n}){if(!["highlight","highlightAuto","listLanguages"].every(i=>i_(e[i])))throw Error("You should provide an instance of lowlight to use the code-block-lowlight extension");let r=new Z({key:new re("lowlight"),state:{init:(i,{doc:o})=>Og({doc:o,name:t,lowlight:e,defaultLanguage:n}),apply:(i,o,s,a)=>{let l=s.selection.$head.parent.type.name,c=a.selection.$head.parent.type.name,d=qo(s.doc,f=>f.type.name===t),u=qo(a.doc,f=>f.type.name===t);return i.docChanged&&([l,c].includes(t)||u.length!==d.length||i.steps.some(f=>f.from!==void 0&&f.to!==void 0&&d.some(p=>p.pos>=f.from&&p.pos+p.node.nodeSize<=f.to)))?Og({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 s_=Mh.extend({addOptions(){var t;return {...(t=this.parent)==null?void 0:t.call(this),lowlight:{},languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}},addProseMirrorPlugins(){var t;return [...((t=this.parent)==null?void 0:t.call(this))||[],o_({name:this.name,lowlight:this.options.lowlight,defaultLanguage:this.options.defaultLanguage})]}}),Dg=s_;function a_(t){let e=t.regex,n=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",o="<[^<>]+>",s="(?!struct)("+r+"|"+e.optional(i)+"[a-zA-Z_]\\w*"+e.optional(o)+")",a={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},l="\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)",c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+l+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},u={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(c,{className:"string"}),{className:"string",begin:/<.*?>/},n,t.C_BLOCK_COMMENT_MODE]},f={className:"title",begin:e.optional(i)+t.IDENT_RE,relevance:0},p=e.optional(i)+t.IDENT_RE+"\\s*\\(",h=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],m=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],g=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],b=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],T={type:m,keyword:h,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:g},_={className:"function.dispatch",relevance:0,keywords:{_hint:b},begin:e.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,t.IDENT_RE,e.lookahead(/(<[^<>]+>|)\s*\(/))},I=[_,u,a,n,t.C_BLOCK_COMMENT_MODE,d,c],k={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:T,contains:I.concat([{begin:/\(/,end:/\)/,keywords:T,contains:I.concat(["self"]),relevance:0}]),relevance:0},y={className:"function",begin:"("+s+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:T,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:T,relevance:0},{begin:p,returnBegin:!0,contains:[f],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[c,d]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:T,relevance:0,contains:[n,t.C_BLOCK_COMMENT_MODE,c,d,a,{begin:/\(/,end:/\)/,keywords:T,relevance:0,contains:["self",n,t.C_BLOCK_COMMENT_MODE,c,d,a]}]},a,n,t.C_BLOCK_COMMENT_MODE,u]};return {name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:T,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(k,y,_,I,[u,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:T,contains:["self",a]},{begin:t.IDENT_RE+"::",keywords:T},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function Ig(t){let e={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},n=a_(t),r=n.keywords;return r.type=[...r.type,...e.type],r.literal=[...r.literal,...e.literal],r.built_in=[...r.built_in,...e.built_in],r._hints=e._hints,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n}function Lg(t){let e=t.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:e.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});let i={className:"subst",begin:/\$\(/,end:/\)/,contains:[t.BACKSLASH_ESCAPE]},o=t.inherit(t.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),s={begin:/<<-?\s*(?=\w+)/,starts:{contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},a={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,n,i]};i.contains.push(a);let l={match:/\\"/},c={className:"string",begin:/'/,end:/'/},d={match:/\\'/},u={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,n]},f=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],p=t.SHEBANG({binary:`(${f.join("|")})`,relevance:10}),h={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[t.inherit(t.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},m=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],g=["true","false"],b={match:/(\/[a-z._-]+)+/},v=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],S=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],T=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],_=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return {name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:m,literal:g,built_in:[...v,...S,"set","shopt",...T,..._]},contains:[p,t.SHEBANG(),h,u,o,s,b,a,l,c,d,n]}}function Pg(t){let e=t.regex,n=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",o="<[^<>]+>",s="("+r+"|"+e.optional(i)+"[a-zA-Z_]\\w*"+e.optional(o)+")",a={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},l="\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)",c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+l+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},u={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(c,{className:"string"}),{className:"string",begin:/<.*?>/},n,t.C_BLOCK_COMMENT_MODE]},f={className:"title",begin:e.optional(i)+t.IDENT_RE,relevance:0},p=e.optional(i)+t.IDENT_RE+"\\s*\\(",g={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},b=[u,a,n,t.C_BLOCK_COMMENT_MODE,d,c],v={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:g,contains:b.concat([{begin:/\(/,end:/\)/,keywords:g,contains:b.concat(["self"]),relevance:0}]),relevance:0},S={begin:"("+s+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:g,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:g,relevance:0},{begin:p,returnBegin:!0,contains:[t.inherit(f,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:g,relevance:0,contains:[n,t.C_BLOCK_COMMENT_MODE,c,d,a,{begin:/\(/,end:/\)/,keywords:g,relevance:0,contains:["self",n,t.C_BLOCK_COMMENT_MODE,c,d,a]}]},a,n,t.C_BLOCK_COMMENT_MODE,u]};return {name:"C",aliases:["h"],keywords:g,disableAutodetect:!0,illegal:"</",contains:[].concat(v,S,b,[u,{begin:t.IDENT_RE+"::",keywords:g},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},t.TITLE_MODE]}]),exports:{preprocessor:u,strings:c,keywords:g}}}function Bg(t){let e=t.regex,n=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",o="<[^<>]+>",s="(?!struct)("+r+"|"+e.optional(i)+"[a-zA-Z_]\\w*"+e.optional(o)+")",a={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},l="\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)",c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+l+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},u={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(c,{className:"string"}),{className:"string",begin:/<.*?>/},n,t.C_BLOCK_COMMENT_MODE]},f={className:"title",begin:e.optional(i)+t.IDENT_RE,relevance:0},p=e.optional(i)+t.IDENT_RE+"\\s*\\(",h=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],m=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],g=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],b=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],T={type:m,keyword:h,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:g},_={className:"function.dispatch",relevance:0,keywords:{_hint:b},begin:e.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,t.IDENT_RE,e.lookahead(/(<[^<>]+>|)\s*\(/))},I=[_,u,a,n,t.C_BLOCK_COMMENT_MODE,d,c],k={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:T,contains:I.concat([{begin:/\(/,end:/\)/,keywords:T,contains:I.concat(["self"]),relevance:0}]),relevance:0},y={className:"function",begin:"("+s+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:T,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:T,relevance:0},{begin:p,returnBegin:!0,contains:[f],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[c,d]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:T,relevance:0,contains:[n,t.C_BLOCK_COMMENT_MODE,c,d,a,{begin:/\(/,end:/\)/,keywords:T,relevance:0,contains:["self",n,t.C_BLOCK_COMMENT_MODE,c,d,a]}]},a,n,t.C_BLOCK_COMMENT_MODE,u]};return {name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:T,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(k,y,_,I,[u,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:T,contains:["self",a]},{begin:t.IDENT_RE+"::",keywords:T},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function zg(t){let e=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],n=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],r=["default","false","null","true"],i=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],o=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],s={keyword:i.concat(o),built_in:e,literal:r},a=t.inherit(t.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),l={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},c={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},d={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},u=t.inherit(d,{illegal:/\n/}),f={className:"subst",begin:/\{/,end:/\}/,keywords:s},p=t.inherit(f,{illegal:/\n/}),h={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},t.BACKSLASH_ESCAPE,p]},m={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},f]},g=t.inherit(m,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},p]});f.contains=[m,h,d,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,l,t.C_BLOCK_COMMENT_MODE],p.contains=[g,h,u,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,l,t.inherit(t.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];let b={variants:[c,m,h,d,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},v={begin:"<",end:">",contains:[{beginKeywords:"in out"},a]},S=t.IDENT_RE+"(<"+t.IDENT_RE+"(\\s*,\\s*"+t.IDENT_RE+")*>)?(\\[\\])?",T={begin:"@"+t.IDENT_RE,relevance:0};return {name:"C#",aliases:["cs","c#"],keywords:s,illegal:/::/,contains:[t.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},b,l,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},a,v,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[a,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[a,v,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+S+"\\s+)+"+t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:s,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[t.TITLE_MODE,v],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,relevance:0,contains:[b,l,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},T]}}var l_=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),c_=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],d_=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],u_=[...c_,...d_],f_=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),p_=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),h_=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),m_=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function Fg(t){let e=t.regex,n=l_(t),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i="and or not only",o=/@-?\w[\w]*(-\w+)*/,s="[a-zA-Z-][a-zA-Z0-9_-]*",a=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE];return {name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+s,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+p_.join("|")+")"},{begin:":(:)?("+h_.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+m_.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...a,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...a,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:e.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:o},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:i,attribute:f_.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...a,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+u_.join("|")+")\\b"}]}}function Ug(t){let e=t.regex;return {name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:e.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:e.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function Hg(t){let o={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return {name:"Go",aliases:["golang"],keywords:o,illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"string",variants:[t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[t.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:o,illegal:/["']/}]}]}}function $g(t){let e=t.regex,n=/[_A-Za-z][_0-9A-Za-z]*/;return {name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[t.HASH_COMMENT_MODE,t.QUOTE_STRING_MODE,t.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:e.concat(n,e.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}function Kg(t){let e=t.regex,n={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:t.NUMBER_RE}]},r=t.COMMENT();r.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];let i={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},o={className:"literal",begin:/\bon|off|true|false|yes|no\b/},s={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},a={begin:/\[/,end:/\]/,contains:[r,o,i,s,n,"self"],relevance:0},l=/[A-Za-z0-9_-]+/,c=/"(\\"|[^"])*"/,d=/'[^']*'/,u=e.either(l,c,d),f=e.concat(u,"(\\s*\\.\\s*",u,")*",e.lookahead(/\s*=\s*[^#\s]/));return {name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[r,{className:"section",begin:/\[+/,end:/\]+/},{begin:f,className:"attr",starts:{end:/$/,contains:[r,a,o,i,s,n]}}]}}var ti="[0-9](_*[0-9])*",ra=`\\.(${ti})`,ia="[0-9a-fA-F](_*[0-9a-fA-F])*",Vg={className:"number",variants:[{begin:`(\\b(${ti})((${ra})|\\.)?|(${ra}))[eE][+-]?(${ti})[fFdD]?\\b`},{begin:`\\b(${ti})((${ra})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${ra})[fFdD]?\\b`},{begin:`\\b(${ti})[fFdD]\\b`},{begin:`\\b0[xX]((${ia})\\.?|(${ia})?\\.(${ia}))[pP][+-]?(${ti})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${ia})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Wg(t,e,n){return n===-1?"":t.replace(e,r=>Wg(t,e,n-1))}function Gg(t){let e=t.regex,n="[\xC0-\u02B8a-zA-Z_$][\xC0-\u02B8a-zA-Z_$0-9]*",r=n+Wg("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),l={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},c={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},d={className:"params",begin:/\(/,end:/\)/,keywords:l,relevance:0,contains:[t.C_BLOCK_COMMENT_MODE],endsParent:!0};return {name:"Java",aliases:["jsp"],keywords:l,illegal:/<\/|#/,contains:[t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[t.BACKSLASH_ESCAPE]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[e.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[d,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",t.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:l,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:l,relevance:0,contains:[c,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,Vg,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},Vg,c]}}var qg="[A-Za-z$_][0-9A-Za-z$_]*",g_=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],b_=["true","false","null","undefined","NaN","Infinity"],jg=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Jg=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Yg=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],y_=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],E_=[].concat(Yg,jg,Jg);function Zg(t){let e=t.regex,n=(M,{after:U})=>{let z="</"+M[0].slice(1);return M.input.indexOf(z,U)!==-1},r=qg,i={begin:"<>",end:"</>"},o=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(M,U)=>{let z=M[0].length+M.index,J=M.input[z];if(J==="<"||J===","){U.ignoreMatch();return}J===">"&&(n(M,{after:z})||U.ignoreMatch());let ie,$=M.input.substring(z);if(ie=$.match(/^\s*=/)){U.ignoreMatch();return}if((ie=$.match(/^\s+extends\s+/))&&ie.index===0){U.ignoreMatch();return}}},a={$pattern:qg,keyword:g_,literal:b_,built_in:E_,"variable.language":y_},l="[0-9](_?[0-9])*",c=`\\.(${l})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",u={className:"number",variants:[{begin:`(\\b(${d})((${c})|\\.)?|(${c}))[eE][+-]?(${l})\\b`},{begin:`\\b(${d})\\b((${c})\\b|\\.)?|(${c})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},f={className:"subst",begin:"\\$\\{",end:"\\}",keywords:a,contains:[]},p={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,f],subLanguage:"xml"}},h={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,f],subLanguage:"css"}},m={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,f],subLanguage:"graphql"}},g={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,f]},v={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},S=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,p,h,m,g,{match:/\$\d+/},u];f.contains=S.concat({begin:/\{/,end:/\}/,keywords:a,contains:["self"].concat(S)});let T=[].concat(v,f.contains),_=T.concat([{begin:/(\s*)\(/,end:/\)/,keywords:a,contains:["self"].concat(T)}]),I={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:_},k={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,e.concat(r,"(",e.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},y={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...jg,...Jg]}},w={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},O={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[I],illegal:/%/},X={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function R(M){return e.concat("(?!",M.join("|"),")")}let ce={match:e.concat(/\b/,R([...Yg,"super","import"].map(M=>`${M}\\s*\\(`)),r,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},Q={begin:e.concat(/\./,e.lookahead(e.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},G={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},I]},x="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",C={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(x)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[I]};return {name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:a,exports:{PARAMS_CONTAINS:_,CLASS_REFERENCE:y},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),w,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,p,h,m,g,v,{match:/\$\d+/},u,y,{scope:"attr",match:r+e.lookahead(":"),relevance:0},C,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[v,t.REGEXP_MODE,{className:"function",begin:x,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:_}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:o},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},O,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[I,t.inherit(t.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},Q,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[I]},ce,X,k,G,{match:/\$[(.]/}]}}function Xg(t){let e={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],i={scope:"literal",beginKeywords:r.join(" ")};return {name:"JSON",aliases:["jsonc"],keywords:{literal:r},contains:[e,n,t.QUOTE_STRING_MODE,i,t.C_NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var ni="[0-9](_*[0-9])*",oa=`\\.(${ni})`,sa="[0-9a-fA-F](_*[0-9a-fA-F])*",v_={className:"number",variants:[{begin:`(\\b(${ni})((${oa})|\\.)?|(${oa}))[eE][+-]?(${ni})[fFdD]?\\b`},{begin:`\\b(${ni})((${oa})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${oa})[fFdD]?\\b`},{begin:`\\b(${ni})[fFdD]\\b`},{begin:`\\b0[xX]((${sa})\\.?|(${sa})?\\.(${sa}))[pP][+-]?(${ni})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${sa})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Qg(t){let e={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},n={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},r={className:"symbol",begin:t.UNDERSCORE_IDENT_RE+"@"},i={className:"subst",begin:/\$\{/,end:/\}/,contains:[t.C_NUMBER_MODE]},o={className:"variable",begin:"\\$"+t.UNDERSCORE_IDENT_RE},s={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[o,i]},{begin:"'",end:"'",illegal:/\n/,contains:[t.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[t.BACKSLASH_ESCAPE,o,i]}]};i.contains.push(s);let a={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+t.UNDERSCORE_IDENT_RE+")?"},l={className:"meta",begin:"@"+t.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[t.inherit(s,{className:"string"}),"self"]}]},c=v_,d=t.COMMENT("/\\*","\\*/",{contains:[t.C_BLOCK_COMMENT_MODE]}),u={variants:[{className:"type",begin:t.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},f=u;return f.variants[1].contains=[u],u.variants[1].contains=[f],{name:"Kotlin",aliases:["kt","kts"],keywords:e,contains:[t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),t.C_LINE_COMMENT_MODE,d,n,r,a,l,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:e,relevance:5,contains:[{begin:t.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[t.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:e,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[u,t.C_LINE_COMMENT_MODE,d],relevance:0},t.C_LINE_COMMENT_MODE,d,a,l,s,t.C_NUMBER_MODE]},d]},{begin:[/class|interface|trait/,/\s+/,t.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},t.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},a,l]},s,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
|
|
118
|
-
`},c]}}var w_=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),x_=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],S_=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],C_=[...x_,...S_],k_=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),eb=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),tb=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),N_=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),T_=eb.concat(tb).sort().reverse();function nb(t){let e=w_(t),n=T_,r="and or not only",i="[\\w-]+",o="("+i+"|@\\{"+i+"\\})",s=[],a=[],l=function(S){return {className:"string",begin:"~?"+S+".*?"+S}},c=function(S,T,_){return {className:S,begin:T,relevance:_}},d={$pattern:/[a-z-]+/,keyword:r,attribute:k_.join(" ")},u={begin:"\\(",end:"\\)",contains:a,keywords:d,relevance:0};a.push(t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,l("'"),l('"'),e.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},e.HEXCOLOR,u,c("variable","@@?"+i,10),c("variable","@\\{"+i+"\\}"),c("built_in","~?`[^`]*?`"),{className:"attribute",begin:i+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},e.IMPORTANT,{beginKeywords:"and not"},e.FUNCTION_DISPATCH);let f=a.concat({begin:/\{/,end:/\}/,contains:s}),p={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(a)},h={begin:o+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},e.CSS_VARIABLE,{className:"attribute",begin:"\\b("+N_.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:a}}]},m={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:d,returnEnd:!0,contains:a,relevance:0}},g={className:"variable",variants:[{begin:"@"+i+"\\s*:",relevance:15},{begin:"@"+i}],starts:{end:"[;}]",returnEnd:!0,contains:f}},b={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:o,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,p,c("keyword","all\\b"),c("variable","@\\{"+i+"\\}"),{begin:"\\b("+C_.join("|")+")\\b",className:"selector-tag"},e.CSS_NUMBER_MODE,c("selector-tag",o,0),c("selector-id","#"+o),c("selector-class","\\."+o,0),c("selector-tag","&",0),e.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+eb.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+tb.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:f},{begin:"!important"},e.FUNCTION_DISPATCH]},v={begin:i+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[b]};return s.push(t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,m,g,v,h,b,p,e.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:s}}function rb(t){let e="\\[=*\\[",n="\\]=*\\]",r={begin:e,end:n,contains:["self"]},i=[t.COMMENT("--(?!"+e+")","$"),t.COMMENT("--"+e,n,{contains:[r],relevance:10})];return {name:"Lua",aliases:["pluto"],keywords:{$pattern:t.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:i.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[t.inherit(t.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:i}].concat(i)},t.C_NUMBER_MODE,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{className:"string",begin:e,end:n,contains:[r],relevance:5}])}}function ib(t){let e={className:"variable",variants:[{begin:"\\$\\("+t.UNDERSCORE_IDENT_RE+"\\)",contains:[t.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},n={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,e]},r={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[e,n]},i={begin:"^"+t.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},o={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},s={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[e]};return {name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[t.HASH_COMMENT_MODE,e,n,r,i,o,s]}}function ob(t){let e=t.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},i={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},o={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},s={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},a=/[A-Za-z][A-Za-z0-9+.-]*/,l={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:e.concat(/\[.+?\]\(/,a,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},c={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},d={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},u=t.inherit(c,{contains:[]}),f=t.inherit(d,{contains:[]});c.contains.push(f),d.contains.push(u);let p=[n,l];return [c,d,u,f].forEach(b=>{b.contains=b.contains.concat(p);}),p=p.concat(c,d),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:p},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:p}]}]},n,o,c,d,{className:"quote",begin:"^>\\s+",contains:p,end:"$"},i,r,l,s,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function sb(t){let e={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},n=/[a-zA-Z@][a-zA-Z0-9_]*/,a={"variable.language":["this","super"],$pattern:n,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},l={$pattern:n,keyword:["@interface","@class","@protocol","@implementation"]};return {name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:a,illegal:"</",contains:[e,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.C_NUMBER_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+l.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:l,contains:[t.UNDERSCORE_TITLE_MODE]},{begin:"\\."+t.UNDERSCORE_IDENT_RE,relevance:0}]}}function ab(t){let e=t.regex,n=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],r=/[dualxmsipngr]{0,12}/,i={$pattern:/[\w.]+/,keyword:n.join(" ")},o={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:i},s={begin:/->\{/,end:/\}/},a={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},l={scope:"variable",variants:[{begin:/\$\d/},{begin:e.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[a]},c={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},d=[t.BACKSLASH_ESCAPE,o,l],u=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],f=(m,g,b="\\1")=>{let v=b==="\\1"?b:e.concat(b,g);return e.concat(e.concat("(?:",m,")"),g,/(?:\\.|[^\\\/])*?/,v,/(?:\\.|[^\\\/])*?/,b,r)},p=(m,g,b)=>e.concat(e.concat("(?:",m,")"),g,/(?:\\.|[^\\\/])*?/,b,r),h=[l,t.HASH_COMMENT_MODE,t.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),s,{className:"string",contains:d,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[t.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},c,{begin:"(\\/\\/|"+t.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[t.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:f("s|tr|y",e.either(...u,{capture:!0}))},{begin:f("s|tr|y","\\(","\\)")},{begin:f("s|tr|y","\\[","\\]")},{begin:f("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:p("(?:m|qr)?",/\//,/\//)},{begin:p("m|qr",e.either(...u,{capture:!0}),/\1/)},{begin:p("m|qr",/\(/,/\)/)},{begin:p("m|qr",/\[/,/\]/)},{begin:p("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[t.TITLE_MODE,a]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[t.TITLE_MODE,a,c]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return o.contains=h,s.contains=h,{name:"Perl",aliases:["pl","pm"],keywords:i,contains:h}}function lb(t){let e=t.regex,n=/(?![A-Za-z0-9])(?![$])/,r=e.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),i=e.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),o=e.concat(/[A-Z]+/,n),s={scope:"variable",match:"\\$+"+r},a={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},l={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},c=t.inherit(t.APOS_STRING_MODE,{illegal:null}),d=t.inherit(t.QUOTE_STRING_MODE,{illegal:null,contains:t.QUOTE_STRING_MODE.contains.concat(l)}),u={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:t.QUOTE_STRING_MODE.contains.concat(l),"on:begin":(Q,G)=>{G.data._beginMatch=Q[1]||Q[2];},"on:end":(Q,G)=>{G.data._beginMatch!==Q[1]&&G.ignoreMatch();}},f=t.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),p=`[
|
|
119
|
-
]`,h={scope:"string",variants:[d,c,u,f]},m={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},g=["false","null","true"],b=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],v=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],T={keyword:b,literal:(Q=>{let G=[];return Q.forEach(x=>{G.push(x),x.toLowerCase()===x?G.push(x.toUpperCase()):G.push(x.toLowerCase());}),G})(g),built_in:v},_=Q=>Q.map(G=>G.replace(/\|\d+$/,"")),I={variants:[{match:[/new/,e.concat(p,"+"),e.concat("(?!",_(v).join("\\b|"),"\\b)"),i],scope:{1:"keyword",4:"title.class"}}]},k=e.concat(r,"\\b(?!\\()"),y={variants:[{match:[e.concat(/::/,e.lookahead(/(?!class\b)/)),k],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[i,e.concat(/::/,e.lookahead(/(?!class\b)/)),k],scope:{1:"title.class",3:"variable.constant"}},{match:[i,e.concat("::",e.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[i,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},w={scope:"attr",match:e.concat(r,e.lookahead(":"),e.lookahead(/(?!::)/))},O={relevance:0,begin:/\(/,end:/\)/,keywords:T,contains:[w,s,y,t.C_BLOCK_COMMENT_MODE,h,m,I]},X={relevance:0,match:[/\b/,e.concat("(?!fn\\b|function\\b|",_(b).join("\\b|"),"|",_(v).join("\\b|"),"\\b)"),r,e.concat(p,"*"),e.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[O]};O.contains.push(X);let R=[w,y,t.C_BLOCK_COMMENT_MODE,h,m,I],ce={begin:e.concat(/#\[\s*\\?/,e.either(i,o)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:g,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:g,keyword:["new","array"]},contains:["self",...R]},...R,{scope:"meta",variants:[{match:i},{match:o}]}]};return {case_insensitive:!1,keywords:T,contains:[ce,t.HASH_COMMENT_MODE,t.COMMENT("//","$"),t.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:t.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},a,{scope:"variable.language",match:/\$this\b/},s,X,y,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},I,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},t.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:T,contains:["self",ce,s,y,t.C_BLOCK_COMMENT_MODE,h,m]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},t.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[t.inherit(t.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},t.UNDERSCORE_TITLE_MODE]},h,m]}}function cb(t){return {name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},t.inherit(t.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),t.inherit(t.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function db(t){return {name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function ub(t){let e=t.regex,n=/[\p{XID_Start}_]\p{XID_Continue}*/u,r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],a={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},l={className:"meta",begin:/^(>>>|\.\.\.) /},c={className:"subst",begin:/\{/,end:/\}/,keywords:a,illegal:/#/},d={begin:/\{\{/,relevance:0},u={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,l,d,c]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,l,d,c]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[t.BACKSLASH_ESCAPE,d,c]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,d,c]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},f="[0-9](_?[0-9])*",p=`(\\b(${f}))?\\.(${f})|\\b(${f})\\.`,h=`\\b|${r.join("|")}`,m={className:"number",relevance:0,variants:[{begin:`(\\b(${f})|(${p}))[eE][+-]?(${f})[jJ]?(?=${h})`},{begin:`(${p})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${h})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${h})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${h})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${h})`},{begin:`\\b(${f})[jJ](?=${h})`}]},g={className:"comment",begin:e.lookahead(/# type:/),end:/$/,keywords:a,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},b={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:["self",l,m,u,t.HASH_COMMENT_MODE]}]};return c.contains=[u,m,l],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:a,illegal:/(<\/|\?)|=>/,contains:[l,m,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},u,g,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[b]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[m,b,u]}]}}function fb(t){return {aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function pb(t){let e=t.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,r=e.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),i=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,o=e.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return {name:"R",keywords:{$pattern:n,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[t.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:e.lookahead(e.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),t.HASH_COMMENT_MODE,{scope:"string",contains:[t.BACKSLASH_ESCAPE],variants:[t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[i,r]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,r]},{scope:{1:"punctuation",2:"number"},match:[o,r]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:i},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:o},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function hb(t){let e=t.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=e.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),i=e.concat(r,/(::\w+)*/),s={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},a={className:"doctag",begin:"@[A-Za-z]+"},l={begin:"#<",end:">"},c=[t.COMMENT("#","$",{contains:[a]}),t.COMMENT("^=begin","^=end",{contains:[a],relevance:10}),t.COMMENT("^__END__",t.MATCH_NOTHING_RE)],d={className:"subst",begin:/#\{/,end:/\}/,keywords:s},u={className:"string",contains:[t.BACKSLASH_ESCAPE,d],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:e.concat(/<<[-~]?'?/,e.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[t.BACKSLASH_ESCAPE,d]})]}]},f="[1-9](_?[0-9])*|0",p="[0-9](_?[0-9])*",h={className:"number",relevance:0,variants:[{begin:`\\b(${f})(\\.(${p}))?([eE][+-]?(${p})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},m={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:s}]},I=[u,{variants:[{match:[/class\s+/,i,/\s+<\s+/,i]},{match:[/\b(class|module)\s+/,i]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:s},{match:[/(include|extend)\s+/,i],scope:{2:"title.class"},keywords:s},{relevance:0,match:[i,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:r,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[m]},{begin:t.IDENT_RE+"::"},{className:"symbol",begin:t.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[u,{begin:n}],relevance:0},h,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:s},{begin:"("+t.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[t.BACKSLASH_ESCAPE,d],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(l,c),relevance:0}].concat(l,c);d.contains=I,m.contains=I;let k="[>?]>",y="[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]",w="(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>",O=[{begin:/^\s*=>/,starts:{end:"$",contains:I}},{className:"meta.prompt",begin:"^("+k+"|"+y+"|"+w+")(?=[ ])",starts:{end:"$",keywords:s,contains:I}}];return c.unshift(l),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:s,illegal:/\/\*/,contains:[t.SHEBANG({binary:"ruby"})].concat(O).concat(c).concat(I)}}function mb(t){let e=t.regex,n=/(r#)?/,r=e.concat(n,t.UNDERSCORE_IDENT_RE),i=e.concat(n,t.IDENT_RE),o={className:"title.function.invoke",relevance:0,begin:e.concat(/\b/,/(?!let|for|while|if|else|match\b)/,i,e.lookahead(/\s*\(/))},s="([ui](8|16|32|64|128|size)|f(32|64))?",a=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],l=["true","false","Some","None","Ok","Err"],c=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],d=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return {name:"Rust",aliases:["rs"],keywords:{$pattern:t.IDENT_RE+"!?",type:d,keyword:a,literal:l,built_in:c},illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.COMMENT("/\\*","\\*/",{contains:["self"]}),t.inherit(t.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+s},{begin:"\\b0o([0-7_]+)"+s},{begin:"\\b0x([A-Fa-f0-9_]+)"+s},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+s}],relevance:0},{begin:[/fn/,/\s+/,r],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,r],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,r,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:t.IDENT_RE+"::",keywords:{keyword:"Self",built_in:c,type:d}},{className:"punctuation",begin:"->"},o]}}var __=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),M_=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],A_=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],O_=[...M_,...A_],R_=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),D_=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),I_=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),L_=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function gb(t){let e=__(t),n=I_,r=D_,i="@[a-z-]+",o="and or not only",a={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return {name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,e.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},e.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+O_.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+r.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},a,{begin:/\(/,end:/\)/,contains:[e.CSS_NUMBER_MODE]},e.CSS_VARIABLE,{className:"attribute",begin:"\\b("+L_.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[e.BLOCK_COMMENT,a,e.HEXCOLOR,e.CSS_NUMBER_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,e.IMPORTANT,e.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:i,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:o,attribute:R_.join(" ")},contains:[{begin:i,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},a,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,e.HEXCOLOR,e.CSS_NUMBER_MODE]},e.FUNCTION_DISPATCH]}}function bb(t){return {name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function yb(t){let e=t.regex,n=t.COMMENT("--","$"),r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},i={begin:/"/,end:/"/,contains:[{match:/""/}]},o=["true","false","unknown"],s=["double precision","large object","with timezone","without timezone"],a=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],l=["add","asc","collation","desc","final","first","last","view"],c=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],d=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],u=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],f=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],p=d,h=[...c,...l].filter(_=>!d.includes(_)),m={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},g={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},b={match:e.concat(/\b/,e.either(...p),/\s*\(/),relevance:0,keywords:{built_in:p}};function v(_){return e.concat(/\b/,e.either(..._.map(I=>I.replace(/\s+/,"\\s+"))),/\b/)}let S={scope:"keyword",match:v(f),relevance:0};function T(_,{exceptions:I,when:k}={}){let y=k;return I=I||[],_.map(w=>w.match(/\|\d+$/)||I.includes(w)?w:y(w)?`${w}|0`:w)}return {name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:T(h,{when:_=>_.length<3}),literal:o,type:a,built_in:u},contains:[{scope:"type",match:v(s)},S,b,m,r,i,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,n,g]}}function xb(t){return t?typeof t=="string"?t:t.source:null}function to(t){return Ne("(?=",t,")")}function Ne(...t){return t.map(n=>xb(n)).join("")}function P_(t){let e=t[t.length-1];return typeof e=="object"&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}function vt(...t){return "("+(P_(t).capture?"":"?:")+t.map(r=>xb(r)).join("|")+")"}var Ed=t=>Ne(/\b/,t,/\w$/.test(t)?/\b/:/\B/),B_=["Protocol","Type"].map(Ed),Eb=["init","self"].map(Ed),z_=["Any","Self"],bd=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],vb=["false","nil","true"],F_=["assignment","associativity","higherThan","left","lowerThan","none","right"],U_=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],wb=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],Sb=vt(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),Cb=vt(Sb,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),yd=Ne(Sb,Cb,"*"),kb=vt(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),la=vt(kb,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),sn=Ne(kb,la,"*"),aa=Ne(/[A-Z]/,la,"*"),H_=["attached","autoclosure",Ne(/convention\(/,vt("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",Ne(/objc\(/,sn,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],$_=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function Nb(t){let e={match:/\s+/,relevance:0},n=t.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[t.C_LINE_COMMENT_MODE,n],i={match:[/\./,vt(...B_,...Eb)],className:{2:"keyword"}},o={match:Ne(/\./,vt(...bd)),relevance:0},s=bd.filter(ve=>typeof ve=="string").concat(["_|0"]),a=bd.filter(ve=>typeof ve!="string").concat(z_).map(Ed),l={variants:[{className:"keyword",match:vt(...a,...Eb)}]},c={$pattern:vt(/\b\w+/,/#\w+/),keyword:s.concat(U_),literal:vb},d=[i,o,l],u={match:Ne(/\./,vt(...wb)),relevance:0},f={className:"built_in",match:Ne(/\b/,vt(...wb),/(?=\()/)},p=[u,f],h={match:/->/,relevance:0},m={className:"operator",relevance:0,variants:[{match:yd},{match:`\\.(\\.|${Cb})+`}]},g=[h,m],b="([0-9]_*)+",v="([0-9a-fA-F]_*)+",S={className:"number",relevance:0,variants:[{match:`\\b(${b})(\\.(${b}))?([eE][+-]?(${b}))?\\b`},{match:`\\b0x(${v})(\\.(${v}))?([pP][+-]?(${b}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},T=(ve="")=>({className:"subst",variants:[{match:Ne(/\\/,ve,/[0\\tnr"']/)},{match:Ne(/\\/,ve,/u\{[0-9a-fA-F]{1,8}\}/)}]}),_=(ve="")=>({className:"subst",match:Ne(/\\/,ve,/[\t ]*(?:[\r\n]|\r\n)/)}),I=(ve="")=>({className:"subst",label:"interpol",begin:Ne(/\\/,ve,/\(/),end:/\)/}),k=(ve="")=>({begin:Ne(ve,/"""/),end:Ne(/"""/,ve),contains:[T(ve),_(ve),I(ve)]}),y=(ve="")=>({begin:Ne(ve,/"/),end:Ne(/"/,ve),contains:[T(ve),I(ve)]}),w={className:"string",variants:[k(),k("#"),k("##"),k("###"),y(),y("#"),y("##"),y("###")]},O=[t.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[t.BACKSLASH_ESCAPE]}],X={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:O},R=ve=>{let Nt=Ne(ve,/\//),A=Ne(/\//,ve);return {begin:Nt,end:A,contains:[...O,{scope:"comment",begin:`#(?!.*${A})`,end:/$/}]}},ce={scope:"regexp",variants:[R("###"),R("##"),R("#"),X]},Q={match:Ne(/`/,sn,/`/)},G={className:"variable",match:/\$\d+/},x={className:"variable",match:`\\$${la}+`},C=[Q,G,x],M={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:$_,contains:[...g,S,w]}]}},U={scope:"keyword",match:Ne(/@/,vt(...H_),to(vt(/\(/,/\s+/)))},z={scope:"meta",match:Ne(/@/,sn)},J=[M,U,z],ie={match:to(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:Ne(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,la,"+")},{className:"type",match:aa,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:Ne(/\s+&\s+/,to(aa)),relevance:0}]},$={begin:/</,end:/>/,keywords:c,contains:[...r,...d,...J,h,ie]};ie.contains.push($);let ae={match:Ne(sn,/\s*:/),keywords:"_|0",relevance:0},_e={begin:/\(/,end:/\)/,relevance:0,keywords:c,contains:["self",ae,...r,ce,...d,...p,...g,S,w,...C,...J,ie]},$e={begin:/</,end:/>/,keywords:"repeat each",contains:[...r,ie]},it={begin:vt(to(Ne(sn,/\s*:/)),to(Ne(sn,/\s+/,sn,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:sn}]},ln={begin:/\(/,end:/\)/,keywords:c,contains:[it,...r,...d,...g,S,w,...J,ie,_e],endsParent:!0,illegal:/["']/},ht={match:[/(func|macro)/,/\s+/,vt(Q.match,sn,yd)],className:{1:"keyword",3:"title.function"},contains:[$e,ln,e],illegal:[/\[/,/%/]},Wt={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[$e,ln,e],illegal:/\[|%/},mt={match:[/operator/,/\s+/,yd],className:{1:"keyword",3:"title"}},jn={begin:[/precedencegroup/,/\s+/,aa],className:{1:"keyword",3:"title"},contains:[ie],keywords:[...F_,...vb],end:/}/},Ut={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},cn={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},ot={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,sn,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:c,contains:[$e,...d,{begin:/:/,end:/\{/,keywords:c,contains:[{scope:"title.class.inherited",match:aa},...d],relevance:0}]};for(let ve of w.variants){let Nt=ve.contains.find(ee=>ee.label==="interpol");Nt.keywords=c;let A=[...d,...p,...g,S,w,...C];Nt.contains=[...A,{begin:/\(/,end:/\)/,contains:["self",...A]}];}return {name:"Swift",keywords:c,contains:[...r,ht,Wt,Ut,cn,ot,mt,jn,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},ce,...d,...p,...g,S,w,...C,...J,ie,_e]}}var ca="[A-Za-z$_][0-9A-Za-z$_]*",Tb=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],_b=["true","false","null","undefined","NaN","Infinity"],Mb=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Ab=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Ob=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Rb=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Db=[].concat(Ob,Mb,Ab);function K_(t){let e=t.regex,n=(M,{after:U})=>{let z="</"+M[0].slice(1);return M.input.indexOf(z,U)!==-1},r=ca,i={begin:"<>",end:"</>"},o=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(M,U)=>{let z=M[0].length+M.index,J=M.input[z];if(J==="<"||J===","){U.ignoreMatch();return}J===">"&&(n(M,{after:z})||U.ignoreMatch());let ie,$=M.input.substring(z);if(ie=$.match(/^\s*=/)){U.ignoreMatch();return}if((ie=$.match(/^\s+extends\s+/))&&ie.index===0){U.ignoreMatch();return}}},a={$pattern:ca,keyword:Tb,literal:_b,built_in:Db,"variable.language":Rb},l="[0-9](_?[0-9])*",c=`\\.(${l})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",u={className:"number",variants:[{begin:`(\\b(${d})((${c})|\\.)?|(${c}))[eE][+-]?(${l})\\b`},{begin:`\\b(${d})\\b((${c})\\b|\\.)?|(${c})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},f={className:"subst",begin:"\\$\\{",end:"\\}",keywords:a,contains:[]},p={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,f],subLanguage:"xml"}},h={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,f],subLanguage:"css"}},m={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,f],subLanguage:"graphql"}},g={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,f]},v={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},S=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,p,h,m,g,{match:/\$\d+/},u];f.contains=S.concat({begin:/\{/,end:/\}/,keywords:a,contains:["self"].concat(S)});let T=[].concat(v,f.contains),_=T.concat([{begin:/(\s*)\(/,end:/\)/,keywords:a,contains:["self"].concat(T)}]),I={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:_},k={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,e.concat(r,"(",e.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},y={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Mb,...Ab]}},w={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},O={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[I],illegal:/%/},X={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function R(M){return e.concat("(?!",M.join("|"),")")}let ce={match:e.concat(/\b/,R([...Ob,"super","import"].map(M=>`${M}\\s*\\(`)),r,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},Q={begin:e.concat(/\./,e.lookahead(e.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},G={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},I]},x="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",C={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(x)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[I]};return {name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:a,exports:{PARAMS_CONTAINS:_,CLASS_REFERENCE:y},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),w,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,p,h,m,g,v,{match:/\$\d+/},u,y,{scope:"attr",match:r+e.lookahead(":"),relevance:0},C,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[v,t.REGEXP_MODE,{className:"function",begin:x,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:_}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:o},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},O,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[I,t.inherit(t.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},Q,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[I]},ce,X,k,G,{match:/\$[(.]/}]}}function Ib(t){let e=t.regex,n=K_(t),r=ca,i=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],o={begin:[/namespace/,/\s+/,t.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},s={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:i},contains:[n.exports.CLASS_REFERENCE]},a={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},l=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],c={$pattern:ca,keyword:Tb.concat(l),literal:_b,built_in:Db.concat(i),"variable.language":Rb},d={className:"meta",begin:"@"+r},u=(m,g,b)=>{let v=m.contains.findIndex(S=>S.label===g);if(v===-1)throw new Error("can not find mode to replace");m.contains.splice(v,1,b);};Object.assign(n.keywords,c),n.exports.PARAMS_CONTAINS.push(d);let f=n.contains.find(m=>m.scope==="attr"),p=Object.assign({},f,{match:e.concat(r,e.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,f,p]),n.contains=n.contains.concat([d,o,s,p]),u(n,"shebang",t.SHEBANG()),u(n,"use_strict",a);let h=n.contains.find(m=>m.label==="func.def");return h.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function Lb(t){let e=t.regex,n={className:"string",begin:/"(""|[^/n])"C\b/},r={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},i=/\d{1,2}\/\d{1,2}\/\d{4}/,o=/\d{4}-\d{1,2}-\d{1,2}/,s=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,a=/\d{1,2}(:\d{1,2}){1,2}/,l={className:"literal",variants:[{begin:e.concat(/# */,e.either(o,i),/ *#/)},{begin:e.concat(/# */,a,/ *#/)},{begin:e.concat(/# */,s,/ *#/)},{begin:e.concat(/# */,e.either(o,i),/ +/,e.either(s,a),/ *#/)}]},c={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},d={className:"label",begin:/^\w+:/},u=t.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),f=t.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return {name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[n,r,l,c,d,u,f,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[f]}]}}function Pb(t){t.regex;let e=t.COMMENT(/\(;/,/;\)/);e.contains.push("self");let n=t.COMMENT(/;;/,/$/),r=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],i={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},o={className:"variable",begin:/\$[\w_]+/},s={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},a={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},l={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},c={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return {name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:r},contains:[n,e,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},o,s,i,t.QUOTE_STRING_MODE,l,c,a]}}function Bb(t){let e=t.regex,n=e.concat(/[\p{L}_]/u,e.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,i={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},o={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},s=t.inherit(o,{begin:/\(/,end:/\)/}),a=t.inherit(t.APOS_STRING_MODE,{className:"string"}),l=t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),c={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[i]},{begin:/'/,end:/'/,contains:[i]},{begin:/[^\s"'=<>`]+/}]}]}]};return {name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[o,l,a,s,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[o,s,l,a]}]}]},t.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},i,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[l]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[c],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[c],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:e.concat(/</,e.lookahead(e.concat(n,e.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:c}]},{className:"tag",begin:e.concat(/<\//,e.lookahead(e.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function zb(t){let e="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},i={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},o={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},s={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[t.BACKSLASH_ESCAPE,i]},a=t.inherit(s,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),l="[0-9]{4}(-[0-9][0-9]){0,2}",c="([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?",d="(\\.[0-9]*)?",u="([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?",f={className:"number",begin:"\\b"+l+c+d+u+"\\b"},p={end:",",endsWithParent:!0,excludeEnd:!0,keywords:e,relevance:0},h={begin:/\{/,end:/\}/,contains:[p],illegal:"\\n",relevance:0},m={begin:"\\[",end:"\\]",contains:[p],illegal:"\\n",relevance:0},g=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+t.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+t.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},t.HASH_COMMENT_MODE,{beginKeywords:e,keywords:{literal:e}},f,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},h,m,o,s],b=[...g];return b.pop(),b.push(a),p.contains=b,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:g}}var vd={arduino:Ig,bash:Lg,c:Pg,cpp:Bg,csharp:zg,css:Fg,diff:Ug,go:Hg,graphql:$g,ini:Kg,java:Gg,javascript:Zg,json:Xg,kotlin:Qg,less:nb,lua:rb,makefile:ib,markdown:ob,objectivec:sb,perl:ab,php:lb,"php-template":cb,plaintext:db,python:ub,"python-repl":fb,r:pb,ruby:hb,rust:mb,scss:gb,shell:bb,sql:yb,swift:Nb,typescript:Ib,vbnet:Lb,wasm:Pb,xml:Bb,yaml:zb};var Fb={},V_="hljs-";function xd(t){let e=na.newInstance();return t&&o(t),{highlight:n,highlightAuto:r,listLanguages:i,register:o,registerAlias:s,registered:a};function n(l,c,d){let u=d||Fb,f=typeof u.prefix=="string"?u.prefix:V_;if(!e.getLanguage(l))throw new Error("Unknown language: `"+l+"` is not registered");e.configure({__emitter:wd,classPrefix:f});let p=e.highlight(c,{ignoreIllegals:!0,language:l});if(p.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:p.errorRaised});let h=p._emitter.root,m=h.data;return m.language=p.language,m.relevance=p.relevance,h}function r(l,c){let u=(c||Fb).subset||i(),f=-1,p=0,h;for(;++f<u.length;){let m=u[f];if(!e.getLanguage(m))continue;let g=n(m,l,c);g.data&&g.data.relevance!==void 0&&g.data.relevance>p&&(p=g.data.relevance,h=g);}return h||{type:"root",children:[],data:{language:void 0,relevance:p}}}function i(){return e.listLanguages()}function o(l,c){if(typeof l=="string")e.registerLanguage(l,c);else {let d;for(d in l)Object.hasOwn(l,d)&&e.registerLanguage(d,l[d]);}}function s(l,c){if(typeof l=="string")e.registerAliases(typeof c=="string"?c:[...c],{languageName:l});else {let d;for(d in l)if(Object.hasOwn(l,d)){let u=l[d];e.registerAliases(typeof u=="string"?u:[...u],{languageName:d});}}}function a(l){return !!e.getLanguage(l)}}var wd=class{constructor(e){this.options=e,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root];}addText(e){if(e==="")return;let n=this.stack[this.stack.length-1],r=n.children[n.children.length-1];r&&r.type==="text"?r.value+=e:n.children.push({type:"text",value:e});}startScope(e){this.openNode(String(e));}endScope(){this.closeNode();}__addSublanguage(e,n){let r=this.stack[this.stack.length-1],i=e.root.children;n?r.children.push({type:"element",tagName:"span",properties:{className:[n]},children:i}):r.children.push(...i);}openNode(e){let n=this,r=e.split(".").map(function(s,a){return a?s+"_".repeat(a):n.options.classPrefix+s}),i=this.stack[this.stack.length-1],o={type:"element",tagName:"span",properties:{className:r},children:[]};i.children.push(o),this.stack.push(o);}closeNode(){this.stack.pop();}finalize(){}toHTML(){return ""}};var an=new re("slashCommands"),Ub=ne.create({name:"slashCommands",addOptions(){return {commands:[],onSelectCommand:()=>{}}},addCommands(){return {selectSlashCommand:t=>({editor:e})=>{let n=an.getState(e.state);if(n&&n.active&&n.filteredCommands[t]){let r=n.filteredCommands[t],{from:i,to:o}=n.range;return e.chain().deleteRange({from:i,to:o}).focus().run(),this.options.onSelectCommand(r),!0}return !1}}},addKeyboardShortcuts(){return {ArrowUp:({editor:t})=>{let e=an.getState(t.state);if(e&&e.active){let n=e.selectedIndex>0?e.selectedIndex-1:e.filteredCommands.length-1;return t.view.dispatch(t.state.tr.setMeta(an,{selectedIndex:n})),!0}return !1},ArrowDown:({editor:t})=>{let e=an.getState(t.state);if(e&&e.active){let n=e.selectedIndex<e.filteredCommands.length-1?e.selectedIndex+1:0;return t.view.dispatch(t.state.tr.setMeta(an,{selectedIndex:n})),!0}return !1},Enter:({editor:t})=>{let e=an.getState(t.state);return e&&e.active?(t.commands.selectSlashCommand(e.selectedIndex),!0):!1},Escape:({editor:t})=>{let e=an.getState(t.state);return e&&e.active?(t.view.dispatch(t.state.tr.setMeta(an,{active:!1})),!0):!1}}},addProseMirrorPlugins(){return [new Z({key:an,state:{init(){return {active:!1,range:{from:0,to:0},query:"",filteredCommands:[],selectedIndex:0}},apply(t,e,n,r){let i=t.getMeta(an);if(i)return {...e,...i};let{selection:o}=r,{empty:s,$from:a}=o;if(!s)return {...e,active:!1};let c=a.parent.textBetween(Math.max(0,a.parentOffset-50),a.parentOffset,null,"\uFFFC").match(/\/(\w*)$/);if(c){let d=c[1].toLowerCase(),u=this.options.commands.filter(f=>f.command.toLowerCase().includes(d)||f.description.toLowerCase().includes(d));return {active:!0,range:{from:a.pos-c[0].length,to:a.pos},query:d,filteredCommands:u,selectedIndex:0}}return {...e,active:!1}}},props:{decorations(t){let e=this.getState(t);if(!e.active)return me.empty;let{from:n}=e.range,r=Ce.widget(n,()=>{let i=document.createElement("div");if(i.className="slash-commands-menu",e.filteredCommands.forEach((o,s)=>{let a=document.createElement("div");if(a.className=`slash-command-item ${s===e.selectedIndex?"selected":""}`,o.icon){let u=document.createElement("div");u.innerHTML=o.icon,a.appendChild(u);}let l=document.createElement("div"),c=document.createElement("div");c.className="command-name",c.textContent=`/${o.command}`,l.appendChild(c);let d=document.createElement("div");d.className="command-description",d.textContent=o.description,l.appendChild(d),a.appendChild(l),a.addEventListener("click",()=>{t.editor.commands.selectSlashCommand(s);}),i.appendChild(a);}),e.filteredCommands.length===0){let o=document.createElement("div");o.className="text-gray-500 p-3 text-sm",o.textContent="No commands found",i.appendChild(o);}return i});return me.create(t.doc,[r])}}})]}});var q_=xd(vd),OM={generateText:async()=>"AI feature is not available in standalone package",isAvailable:!1},jb=({onColorSelect:t,currentColor:e="#000000"})=>jsxRuntime.jsx(moonui.ColorPicker,{value:e,onChange:t,showInput:!0,showPresets:!0,size:"sm",presets:["#000000","#ffffff","#ff0000","#00ff00","#0000ff","#ffff00","#ff00ff","#00ffff","#ff8800","#8800ff","#88ff00","#0088ff","#ff0088","#00ff88","#888888","#f87171","#fb923c","#fbbf24","#facc15","#a3e635","#4ade80","#34d399","#2dd4bf","#22d3ee","#38bdf8","#60a5fa","#818cf8","#a78bfa","#c084fc","#e879f9","#f472b6","#fb7185","#f43f5e","#ef4444","#dc2626"]}),We=({active:t,disabled:e,onClick:n,children:r,tooltip:i})=>{let o=jsxRuntime.jsx("button",{type:"button",onClick:n,disabled:e,className:moonui.cn("p-2 rounded hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors",t&&"bg-gray-100 dark:bg-gray-800",e&&"opacity-50 cursor-not-allowed"),children:r});return i?jsxRuntime.jsxs(moonui.Tooltip,{children:[jsxRuntime.jsx(moonui.TooltipTrigger,{asChild:!0,children:o}),jsxRuntime.jsx(moonui.TooltipContent,{children:jsxRuntime.jsx("p",{children:i})})]}):o};function Yz({placeholder:t="Start writing...",className:e,height:n=300,features:r={bold:!0,italic:!0,underline:!0,strike:!0,heading:!0,lists:!0,blockquote:!0,code:!0,link:!0,image:!0,table:!0,align:!0,color:!0,ai:!0},aiConfig:i={provider:"openai",apiKey:"",model:"gpt-4",temperature:.7,maxTokens:1e3}}){let {hasProAccess:s,isLoading:a}=lt();if(!a&&!s)return jsxRuntime.jsx(moonui.Card,{className:moonui.cn("w-full",e),children:jsxRuntime.jsx(moonui.CardContent,{className:"py-12 text-center",children:jsxRuntime.jsxs("div",{className:"max-w-md mx-auto space-y-4",children:[jsxRuntime.jsx("div",{className:"rounded-full bg-purple-100 dark:bg-purple-900/30 p-3 w-fit mx-auto",children:jsxRuntime.jsx(lucideReact.Lock,{className:"h-6 w-6 text-purple-600 dark:text-purple-400"})}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"font-semibold text-lg mb-2",children:"Pro Feature"}),jsxRuntime.jsx("p",{className:"text-muted-foreground text-sm mb-4",children:"Advanced Rich Text Editor is available exclusively to MoonUI Pro subscribers."}),jsxRuntime.jsx("div",{className:"flex gap-3 justify-center",children:jsxRuntime.jsx("a",{href:"/pricing",children:jsxRuntime.jsxs(moonui.Button,{size:"sm",children:[jsxRuntime.jsx(lucideReact.Sparkles,{className:"mr-2 h-4 w-4"}),"Upgrade to Pro"]})})})]})]})})});let[c,d]=Mn.useState({provider:i.provider||"openai",apiKey:i.apiKey||"",model:i.model||"gpt-4",temperature:i.temperature||.7,maxTokens:i.maxTokens||1e3}),[u,f]=Mn.useState(!1),[p,h]=Mn.useState(!1),[m,g]=Mn.useState(!1),[b,v]=Mn.useState(""),[S,T]=Mn.useState("#000000"),[_,I]=Mn.useState("#ffffff"),k=[{id:"rewrite",command:"rewrite",description:"Rewrite selected text",icon:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21.5 2v6h-6M2.5 22v-6h6M2 11.5a10 10 0 0 1 18.8-4.3M22 12.5a10 10 0 0 1-18.8 4.3"/></svg>',action:async A=>{let ee=await w("rewrite",A);return {text:ee||"",error:ee?void 0:"Failed to rewrite"}}},{id:"expand",command:"expand",description:"Expand text with more details",icon:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="m21 21-6-6m6 6v-4.8m0 4.8h-4.8"/><path d="M3 16.2V21m0 0h4.8M3 21l6-6"/><path d="M21 7.8V3m0 0h-4.8M21 3l-6 6"/><path d="M3 7.8V3m0 0h4.8M3 3l6 6"/></svg>',action:async A=>{let ee=await w("expand",A);return {text:ee||"",error:ee?void 0:"Failed to expand"}}},{id:"summarize",command:"summarize",description:"Summarize text",icon:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M9 11H3"/><path d="M9 7H3"/><path d="M9 15H3"/><path d="M16 10V3"/><path d="M16 10l3-3"/><path d="M13 10l3 3"/><path d="M9 19h12"/></svg>',action:async A=>{let ee=await w("summarize",A);return {text:ee||"",error:ee?void 0:"Failed to summarize"}}},{id:"continue",command:"continue",description:"Continue writing from here",icon:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M5 12h14"/><path d="m12 5 7 7-7 7"/></svg>',action:async A=>{let ee=await w("continue",A);return {text:ee||"",error:ee?void 0:"Failed to continue"}}},{id:"improve",command:"improve",description:"Improve writing quality",icon:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z"/></svg>',action:async A=>{let ee=await w("improve",A);return {text:ee||"",error:ee?void 0:"Failed to improve"}}},{id:"fix",command:"fix",description:"Fix grammar and spelling",icon:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="m6 9 6 6 6-6"/></svg>',action:async A=>{let ee=await w("fix",A);return {text:ee||"",error:ee?void 0:"Failed to fix"}}},{id:"translate",command:"translate",description:"Translate to Turkish",icon:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="m5 8 6 6"/><path d="m4 14 6-6 2-3"/><path d="M2 5h12"/><path d="M7 2v3"/><path d="m22 22-5-10-5 10"/><path d="m14 18 6 0"/></svg>',action:async A=>{let ee=await w("translate",A);return {text:ee||"",error:ee?void 0:"Failed to translate"}}},{id:"ideas",command:"ideas",description:"Generate writing ideas",icon:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 2v20"/><path d="M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6"/></svg>',action:async A=>{let ee=await w("ideas",A);return {text:ee||"",error:ee?void 0:"Failed to generate ideas"}}}],y=kh({extensions:[vm.configure({heading:{levels:[1,2,3]},codeBlock:!1}),wm.configure({placeholder:t}),xm.configure({types:["heading","paragraph"]}),Sm.configure({multicolor:!0}),Yh.configure({openOnClick:!1,HTMLAttributes:{target:"_blank",rel:"noopener noreferrer"}}),Cm.configure({inline:!0,allowBase64:!0}),ad.configure({resizable:!0}),tg,rg,ng,ld,ig,cm,og,sg,ag.configure({nested:!0}),lg,Dg.configure({lowlight:q_}),Ub.configure({commands:k,onSelectCommand:async A=>{if(!y)return;let{from:ee,to:de}=y.state.selection,Y=y.state.doc.textBetween(ee,de," ");h(!0);try{let st=await A.action(Y||y.getText());st.text?y.chain().focus().insertContent(st.text).run():st.error&&moonui.toast({title:"AI Error",description:st.error,variant:"destructive"});}catch{moonui.toast({title:"Error",description:"Failed to execute command",variant:"destructive"});}finally{h(!1);}}})],content:"",editorProps:{attributes:{class:moonui.cn("prose prose-sm sm:prose lg:prose-lg xl:prose-xl focus:outline-none min-h-[200px] p-4 max-w-none","[&_h1]:text-3xl [&_h1]:font-bold [&_h1]:mb-4","[&_h2]:text-2xl [&_h2]:font-bold [&_h2]:mb-3","[&_h3]:text-xl [&_h3]:font-bold [&_h3]:mb-2","[&_h4]:text-lg [&_h4]:font-bold [&_h4]:mb-2","[&_h5]:text-base [&_h5]:font-bold [&_h5]:mb-1","[&_h6]:text-sm [&_h6]:font-bold [&_h6]:mb-1","[&_ul]:list-disc [&_ul]:pl-6 [&_ul]:mb-4","[&_ol]:list-decimal [&_ol]:pl-6 [&_ol]:mb-4","[&_li]:mb-1","[&_table]:border-collapse-collapse [&_table]:w-full [&_table]:mb-4","[&_table_td]:border [&_table_td]:border-gray-300 [&_table_td]:p-2","[&_table_th]:border [&_table_th]:border-gray-300 [&_table_th]:p-2 [&_table_th]:bg-gray-50 [&_table_th]:font-semibold","[&_blockquote]:border-l-4 [&_blockquote]:border-gray-300 [&_blockquote]:pl-4 [&_blockquote]:italic","[&_pre]:bg-gray-100 [&_pre]:dark:bg-gray-800 [&_pre]:p-4 [&_pre]:rounded [&_pre]:overflow-x-auto")}},immediatelyRender:!1}),w=async(A,ee)=>{if(!c.apiKey)return moonui.toast({title:"API Key Required",description:"Please configure your AI settings first.",variant:"destructive"}),f(!0),null;h(!0);try{let de=OM,Y;switch(A){case"rewrite":Y=await de.rewrite(ee);break;case"expand":Y=await de.expand(ee);break;case"summarize":Y=await de.summarize(ee);break;case"fix":Y=await de.fixGrammar(ee);break;case"translate":Y=await de.translate(ee,"Turkish");break;case"tone_professional":Y=await de.changeTone(ee,"professional");break;case"tone_casual":Y=await de.changeTone(ee,"casual");break;case"tone_friendly":Y=await de.changeTone(ee,"friendly");break;case"tone_formal":Y=await de.changeTone(ee,"formal");break;case"continue":Y=await de.continueWriting(ee);break;case"improve":Y=await de.improveWriting(ee);break;case"ideas":Y=await de.generateIdeas(ee,5);break;default:Y=await de.complete(A,ee);}return Y.error?(moonui.toast({title:"AI Error",description:Y.error,variant:"destructive"}),null):Y.text}catch{return moonui.toast({title:"AI Error",description:"Failed to process with AI. Please check your settings.",variant:"destructive"}),null}finally{h(!1);}},O=async A=>{if(!y)return;let ee=y.state.selection,de=y.state.doc.textBetween(ee.from,ee.to," ");if(!de&&A!=="complete"){moonui.toast({title:"No text selected",description:"Please select some text first.",variant:"destructive"});return}let Y=await w(A,de||y.getText());Y&&(de?y.chain().focus().deleteSelection().insertContent(Y).run():y.chain().focus().insertContent(Y).run());},[X,R]=Mn.useState(""),[ce,Q]=Mn.useState(""),[G,x]=Mn.useState(!1),[C,M]=Mn.useState(!1),[U,z]=Mn.useState(!1),[J,ie]=Mn.useState(3),[$,ae]=Mn.useState(3),[_e,$e]=Mn.useState(!1),[it,ln]=Mn.useState(1),[ht,Wt]=Mn.useState("#000000"),[mt,jn]=Mn.useState("solid"),Ut=()=>{ce&&y&&(y.chain().focus().setImage({src:ce}).run(),Q(""),M(!1));},cn=()=>{X&&y&&(y.state.selection.empty?y.chain().focus().insertContent(`<a href="${X}">${X}</a>`).run():y.chain().focus().extendMarkRange("link").setLink({href:X}).run(),R(""),x(!1));},ot=()=>{y?.chain().focus().unsetLink().run();},ve=()=>{y&&J>0&&$>0&&(y.chain().focus().insertTable({rows:J,cols:$,withHeaderRow:!0}).run(),setTimeout(()=>{Nt(it,ht,mt);},100),z(!1));},Nt=(A,ee,de)=>{if(!y)return;let Y=`${A}px ${de} ${ee}`;y.view.dom.querySelectorAll(".ProseMirror table").forEach(st=>{st instanceof HTMLElement&&(st.style.borderCollapse="collapse",st.style.border=Y,st.querySelectorAll("td, th").forEach(Tt=>{Tt instanceof HTMLElement&&(Tt.style.border=Y,Tt.style.padding="8px");}));});};return y?jsxRuntime.jsxs("div",{className:moonui.cn("border rounded-lg overflow-hidden bg-white dark:bg-gray-950",e),children:[jsxRuntime.jsx(moonui.TooltipProvider,{children:jsxRuntime.jsx("div",{className:"border-b bg-gray-50 dark:bg-gray-900 p-3",children:jsxRuntime.jsxs("div",{className:"flex items-center flex-wrap gap-1",children:[(r.bold||r.italic||r.underline||r.strike||r.code)&&jsxRuntime.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[r.bold&&jsxRuntime.jsx(We,{active:y.isActive("bold"),onClick:()=>y.chain().focus().toggleBold().run(),tooltip:"Bold (Cmd+B)",disabled:m,children:jsxRuntime.jsx(lucideReact.Bold,{className:"w-4 h-4"})}),r.italic&&jsxRuntime.jsx(We,{active:y.isActive("italic"),onClick:()=>y.chain().focus().toggleItalic().run(),tooltip:"Italic (Cmd+I)",disabled:m,children:jsxRuntime.jsx(lucideReact.Italic,{className:"w-4 h-4"})}),r.underline&&jsxRuntime.jsx(We,{active:y.isActive("underline"),onClick:()=>y.chain().focus().toggleUnderline().run(),tooltip:"Underline (Cmd+U)",disabled:m,children:jsxRuntime.jsx(lucideReact.Underline,{className:"w-4 h-4"})}),r.strike&&jsxRuntime.jsx(We,{active:y.isActive("strike"),onClick:()=>y.chain().focus().toggleStrike().run(),tooltip:"Strikethrough",disabled:m,children:jsxRuntime.jsx(lucideReact.Strikethrough,{className:"w-4 h-4"})}),r.code&&jsxRuntime.jsx(We,{active:y.isActive("code"),onClick:()=>y.chain().focus().toggleCode().run(),tooltip:"Inline code",disabled:m,children:jsxRuntime.jsx(lucideReact.Code,{className:"w-4 h-4"})})]}),(r.bold||r.italic||r.underline||r.strike||r.code)&&(r.heading||r.align)&&jsxRuntime.jsx("div",{className:"w-px h-6 bg-border mx-1 shrink-0"}),(r.heading||r.align)&&jsxRuntime.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[r.heading&&jsxRuntime.jsxs(moonui.DropdownMenu,{children:[jsxRuntime.jsx(moonui.DropdownMenuTrigger,{asChild:!0,children:jsxRuntime.jsxs(moonui.Button,{variant:"ghost",size:"sm",className:"h-8 px-2",disabled:m,children:[jsxRuntime.jsx(lucideReact.Type,{className:"w-4 h-4 mr-1"}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-3 h-3"})]})}),jsxRuntime.jsxs(moonui.DropdownMenuContent,{children:[jsxRuntime.jsx(moonui.DropdownMenuItem,{onClick:()=>y.chain().focus().setParagraph().run(),children:"Paragraph"}),jsxRuntime.jsxs(moonui.DropdownMenuItem,{onClick:()=>y.chain().focus().toggleHeading({level:1}).run(),children:[jsxRuntime.jsx(lucideReact.Heading1,{className:"w-4 h-4 mr-2"})," Heading 1"]}),jsxRuntime.jsxs(moonui.DropdownMenuItem,{onClick:()=>y.chain().focus().toggleHeading({level:2}).run(),children:[jsxRuntime.jsx(lucideReact.Heading2,{className:"w-4 h-4 mr-2"})," Heading 2"]}),jsxRuntime.jsxs(moonui.DropdownMenuItem,{onClick:()=>y.chain().focus().toggleHeading({level:3}).run(),children:[jsxRuntime.jsx(lucideReact.Heading3,{className:"w-4 h-4 mr-2"})," Heading 3"]})]})]}),r.align&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(We,{active:y.isActive({textAlign:"left"}),onClick:()=>y.chain().focus().setTextAlign("left").run(),tooltip:"Align left",disabled:m,children:jsxRuntime.jsx(lucideReact.AlignLeft,{className:"w-4 h-4"})}),jsxRuntime.jsx(We,{active:y.isActive({textAlign:"center"}),onClick:()=>y.chain().focus().setTextAlign("center").run(),tooltip:"Align center",disabled:m,children:jsxRuntime.jsx(lucideReact.AlignCenter,{className:"w-4 h-4"})}),jsxRuntime.jsx(We,{active:y.isActive({textAlign:"right"}),onClick:()=>y.chain().focus().setTextAlign("right").run(),tooltip:"Align right",disabled:m,children:jsxRuntime.jsx(lucideReact.AlignRight,{className:"w-4 h-4"})}),jsxRuntime.jsx(We,{active:y.isActive({textAlign:"justify"}),onClick:()=>y.chain().focus().setTextAlign("justify").run(),tooltip:"Justify",disabled:m,children:jsxRuntime.jsx(lucideReact.AlignJustify,{className:"w-4 h-4"})})]})]}),(r.heading||r.align)&&(r.lists||r.blockquote)&&jsxRuntime.jsx("div",{className:"w-px h-6 bg-border mx-1 shrink-0"}),(r.lists||r.blockquote)&&jsxRuntime.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[r.lists&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(We,{active:y.isActive("bulletList"),onClick:()=>y.chain().focus().toggleBulletList().run(),tooltip:"Bullet list",disabled:m,children:jsxRuntime.jsx(lucideReact.List,{className:"w-4 h-4"})}),jsxRuntime.jsx(We,{active:y.isActive("orderedList"),onClick:()=>y.chain().focus().toggleOrderedList().run(),tooltip:"Numbered list",disabled:m,children:jsxRuntime.jsx(lucideReact.ListOrdered,{className:"w-4 h-4"})}),jsxRuntime.jsx(We,{active:y.isActive("taskList"),onClick:()=>y.chain().focus().toggleTaskList().run(),tooltip:"Task list",disabled:m,children:jsxRuntime.jsx(lucideReact.CheckSquare,{className:"w-4 h-4"})})]}),r.blockquote&&jsxRuntime.jsx(We,{active:y.isActive("blockquote"),onClick:()=>y.chain().focus().toggleBlockquote().run(),tooltip:"Quote",disabled:m,children:jsxRuntime.jsx(lucideReact.Quote,{className:"w-4 h-4"})})]}),(r.lists||r.blockquote)&&r.color&&jsxRuntime.jsx("div",{className:"w-px h-6 bg-border mx-1 shrink-0"}),r.color&&jsxRuntime.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[jsxRuntime.jsxs(moonui.Popover,{children:[jsxRuntime.jsx(moonui.PopoverTrigger,{asChild:!0,children:jsxRuntime.jsx(moonui.Button,{variant:"ghost",size:"sm",className:"h-8 px-2",disabled:m,title:"Text Color",children:jsxRuntime.jsx(lucideReact.Palette,{className:"w-4 h-4"})})}),jsxRuntime.jsx(moonui.PopoverContent,{className:"w-auto p-0",children:jsxRuntime.jsx(jb,{currentColor:S,onColorSelect:A=>{T(A),y.chain().focus().setColor(A).run();}})})]}),jsxRuntime.jsxs(moonui.Popover,{children:[jsxRuntime.jsx(moonui.PopoverTrigger,{asChild:!0,children:jsxRuntime.jsx(moonui.Button,{variant:"ghost",size:"sm",className:"h-8 px-2",disabled:m,title:"Background Color",children:jsxRuntime.jsx(lucideReact.Highlighter,{className:"w-4 h-4"})})}),jsxRuntime.jsx(moonui.PopoverContent,{className:"w-auto p-0",children:jsxRuntime.jsx(jb,{currentColor:_,onColorSelect:A=>{I(A),y.chain().focus().toggleHighlight({color:A}).run();}})})]})]}),r.color&&(r.link||r.image||r.table)&&jsxRuntime.jsx("div",{className:"w-px h-6 bg-border mx-1 shrink-0"}),(r.link||r.image||r.table)&&jsxRuntime.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[r.link&&jsxRuntime.jsxs(moonui.Dialog,{open:G,onOpenChange:x,children:[jsxRuntime.jsx(moonui.DialogTrigger,{asChild:!0,children:jsxRuntime.jsx(We,{active:y.isActive("link"),tooltip:"Add link",disabled:m,children:jsxRuntime.jsx(lucideReact.Link2,{className:"w-4 h-4"})})}),jsxRuntime.jsxs(moonui.DialogContent,{className:"sm:max-w-[425px]",children:[jsxRuntime.jsxs(moonui.DialogHeader,{children:[jsxRuntime.jsx(moonui.DialogTitle,{children:"Add Link"}),jsxRuntime.jsx(moonui.DialogDescription,{children:"Enter the URL for the link."})]}),jsxRuntime.jsx("div",{className:"grid gap-4 py-4",children:jsxRuntime.jsxs("div",{className:"grid gap-2",children:[jsxRuntime.jsx(moonui.Label,{htmlFor:"url",children:"URL"}),jsxRuntime.jsx(moonui.Input,{id:"url",value:X,onChange:A=>R(A.target.value),placeholder:"https://example.com",onKeyDown:A=>{A.key==="Enter"&&(A.preventDefault(),cn());}})]})}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[y.isActive("link")&&jsxRuntime.jsx(moonui.Button,{variant:"destructive",onClick:()=>{ot(),x(!1);},children:"Remove Link"}),jsxRuntime.jsxs("div",{className:"ml-auto flex gap-2",children:[jsxRuntime.jsx(moonui.Button,{variant:"outline",onClick:()=>x(!1),children:"Cancel"}),jsxRuntime.jsx(moonui.Button,{onClick:cn,children:"Add Link"})]})]})]})]}),r.image&&jsxRuntime.jsxs(moonui.Dialog,{open:C,onOpenChange:M,children:[jsxRuntime.jsx(moonui.DialogTrigger,{asChild:!0,children:jsxRuntime.jsx(We,{tooltip:"Add image",disabled:m,children:jsxRuntime.jsx(lucideReact.Image,{className:"w-4 h-4"})})}),jsxRuntime.jsxs(moonui.DialogContent,{className:"sm:max-w-[425px]",children:[jsxRuntime.jsxs(moonui.DialogHeader,{children:[jsxRuntime.jsx(moonui.DialogTitle,{children:"Add Image"}),jsxRuntime.jsx(moonui.DialogDescription,{children:"Enter the URL for the image."})]}),jsxRuntime.jsx("div",{className:"grid gap-4 py-4",children:jsxRuntime.jsxs("div",{className:"grid gap-2",children:[jsxRuntime.jsx(moonui.Label,{htmlFor:"image-url",children:"Image URL"}),jsxRuntime.jsx(moonui.Input,{id:"image-url",value:ce,onChange:A=>Q(A.target.value),placeholder:"https://example.com/image.jpg",onKeyDown:A=>{A.key==="Enter"&&(A.preventDefault(),Ut());}})]})}),jsxRuntime.jsxs("div",{className:"flex justify-end gap-2",children:[jsxRuntime.jsx(moonui.Button,{variant:"outline",onClick:()=>M(!1),children:"Cancel"}),jsxRuntime.jsx(moonui.Button,{onClick:Ut,children:"Add Image"})]})]})]}),r.table&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(moonui.Dialog,{open:U,onOpenChange:z,children:[jsxRuntime.jsx(moonui.DialogTrigger,{asChild:!0,children:jsxRuntime.jsx(We,{tooltip:"Create table",disabled:m,children:jsxRuntime.jsx(lucideReact.Table,{className:"w-4 h-4"})})}),jsxRuntime.jsxs(moonui.DialogContent,{className:"sm:max-w-[425px]",children:[jsxRuntime.jsxs(moonui.DialogHeader,{children:[jsxRuntime.jsx(moonui.DialogTitle,{children:"Create Table"}),jsxRuntime.jsx(moonui.DialogDescription,{children:"Choose the size for your new table."})]}),jsxRuntime.jsxs("div",{className:"grid gap-4 py-4",children:[jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{className:"grid gap-2",children:[jsxRuntime.jsx(moonui.Label,{htmlFor:"rows",children:"Rows"}),jsxRuntime.jsx(moonui.Input,{id:"rows",type:"number",min:"1",max:"20",value:J,onChange:A=>ie(parseInt(A.target.value)||3)})]}),jsxRuntime.jsxs("div",{className:"grid gap-2",children:[jsxRuntime.jsx(moonui.Label,{htmlFor:"cols",children:"Columns"}),jsxRuntime.jsx(moonui.Input,{id:"cols",type:"number",min:"1",max:"10",value:$,onChange:A=>ae(parseInt(A.target.value)||3)})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:"headerRow",defaultChecked:!0,className:"rounded border-gray-300"}),jsxRuntime.jsx(moonui.Label,{htmlFor:"headerRow",className:"text-sm font-normal",children:"Include header row"})]})]}),jsxRuntime.jsxs("div",{className:"flex justify-end gap-2",children:[jsxRuntime.jsx(moonui.Button,{variant:"outline",onClick:()=>z(!1),children:"Cancel"}),jsxRuntime.jsx(moonui.Button,{onClick:ve,children:"Create Table"})]})]})]}),jsxRuntime.jsxs(moonui.DropdownMenu,{children:[jsxRuntime.jsx(moonui.DropdownMenuTrigger,{asChild:!0,children:jsxRuntime.jsx(moonui.Button,{variant:"ghost",size:"sm",className:"h-8 px-1",children:jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-3 h-3"})})}),jsxRuntime.jsxs(moonui.DropdownMenuContent,{children:[jsxRuntime.jsx(moonui.DropdownMenuItem,{onClick:()=>y.chain().focus().addColumnBefore().run(),children:"Add column before"}),jsxRuntime.jsx(moonui.DropdownMenuItem,{onClick:()=>y.chain().focus().addColumnAfter().run(),children:"Add column after"}),jsxRuntime.jsx(moonui.DropdownMenuItem,{onClick:()=>y.chain().focus().deleteColumn().run(),children:"Delete column"}),jsxRuntime.jsx(moonui.DropdownMenuSeparator,{}),jsxRuntime.jsx(moonui.DropdownMenuItem,{onClick:()=>y.chain().focus().addRowBefore().run(),children:"Add row before"}),jsxRuntime.jsx(moonui.DropdownMenuItem,{onClick:()=>y.chain().focus().addRowAfter().run(),children:"Add row after"}),jsxRuntime.jsx(moonui.DropdownMenuItem,{onClick:()=>y.chain().focus().deleteRow().run(),children:"Delete row"}),jsxRuntime.jsx(moonui.DropdownMenuSeparator,{}),jsxRuntime.jsxs(moonui.DropdownMenuItem,{onClick:()=>$e(!0),children:[jsxRuntime.jsx(lucideReact.Settings,{className:"w-4 h-4 mr-2"}),"Table Borders"]}),jsxRuntime.jsx(moonui.DropdownMenuSeparator,{}),jsxRuntime.jsx(moonui.DropdownMenuItem,{onClick:()=>y.chain().focus().deleteTable().run(),children:"Delete table"})]})]})]})]}),(r.link||r.image||r.table)&&!0&&jsxRuntime.jsx("div",{className:"w-px h-6 bg-border mx-1 shrink-0"}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[jsxRuntime.jsx(We,{onClick:()=>y.chain().focus().undo().run(),disabled:!y.can().undo()||m,tooltip:"Undo (Cmd+Z)",children:jsxRuntime.jsx(lucideReact.Undo,{className:"w-4 h-4"})}),jsxRuntime.jsx(We,{onClick:()=>y.chain().focus().redo().run(),disabled:!y.can().redo()||m,tooltip:"Redo (Cmd+Shift+Z)",children:jsxRuntime.jsx(lucideReact.Redo,{className:"w-4 h-4"})}),jsxRuntime.jsx(We,{active:m,onClick:()=>{m?y.commands.setContent(b):v(y.getHTML()),g(!m);},tooltip:m?"Visual Mode":"Source Code",children:m?jsxRuntime.jsx(lucideReact.Edit,{className:"w-4 h-4"}):jsxRuntime.jsx(lucideReact.Eye,{className:"w-4 h-4"})}),r.ai&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(moonui.DropdownMenu,{children:[jsxRuntime.jsx(moonui.DropdownMenuTrigger,{asChild:!0,children:jsxRuntime.jsxs(moonui.Button,{variant:"ghost",size:"sm",className:"h-8 px-3 bg-purple-100 hover:bg-purple-200 dark:bg-purple-900 dark:hover:bg-purple-800",disabled:p,children:[p?jsxRuntime.jsx(lucideReact.RefreshCw,{className:"w-4 h-4 mr-1 animate-spin"}):jsxRuntime.jsx(lucideReact.Wand2,{className:"w-4 h-4 mr-1"}),"AI Tools"]})}),jsxRuntime.jsxs(moonui.DropdownMenuContent,{className:"w-56",children:[jsxRuntime.jsxs(moonui.DropdownMenuItem,{onClick:()=>O("rewrite"),children:[jsxRuntime.jsx(lucideReact.RefreshCw,{className:"w-4 h-4 mr-2"}),"Rewrite Selection"]}),jsxRuntime.jsxs(moonui.DropdownMenuItem,{onClick:()=>O("improve"),children:[jsxRuntime.jsx(lucideReact.Wand2,{className:"w-4 h-4 mr-2"}),"Improve Writing"]}),jsxRuntime.jsxs(moonui.DropdownMenuItem,{onClick:()=>O("expand"),children:[jsxRuntime.jsx(lucideReact.Maximize,{className:"w-4 h-4 mr-2"}),"Expand Text"]}),jsxRuntime.jsxs(moonui.DropdownMenuItem,{onClick:()=>O("summarize"),children:[jsxRuntime.jsx(lucideReact.FileText,{className:"w-4 h-4 mr-2"}),"Summarize"]}),jsxRuntime.jsxs(moonui.DropdownMenuItem,{onClick:()=>O("continue"),children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-4 h-4 mr-2"}),"Continue Writing"]}),jsxRuntime.jsx(moonui.DropdownMenuSeparator,{}),jsxRuntime.jsxs(moonui.DropdownMenuItem,{onClick:()=>O("fix"),children:[jsxRuntime.jsx(lucideReact.Check,{className:"w-4 h-4 mr-2"}),"Fix Grammar & Spelling"]}),jsxRuntime.jsx(moonui.DropdownMenuSeparator,{}),jsxRuntime.jsxs(moonui.DropdownMenuItem,{onClick:()=>O("tone_professional"),children:[jsxRuntime.jsx(lucideReact.Sparkles,{className:"w-4 h-4 mr-2"}),"Make Professional"]}),jsxRuntime.jsxs(moonui.DropdownMenuItem,{onClick:()=>O("tone_casual"),children:[jsxRuntime.jsx(lucideReact.Sparkles,{className:"w-4 h-4 mr-2"}),"Make Casual"]}),jsxRuntime.jsxs(moonui.DropdownMenuItem,{onClick:()=>O("tone_friendly"),children:[jsxRuntime.jsx(lucideReact.Sparkles,{className:"w-4 h-4 mr-2"}),"Make Friendly"]}),jsxRuntime.jsxs(moonui.DropdownMenuItem,{onClick:()=>O("tone_formal"),children:[jsxRuntime.jsx(lucideReact.Sparkles,{className:"w-4 h-4 mr-2"}),"Make Formal"]}),jsxRuntime.jsx(moonui.DropdownMenuSeparator,{}),jsxRuntime.jsxs(moonui.DropdownMenuItem,{onClick:()=>O("translate"),children:[jsxRuntime.jsx(lucideReact.Languages,{className:"w-4 h-4 mr-2"}),"Translate to Turkish"]}),jsxRuntime.jsxs(moonui.DropdownMenuItem,{onClick:()=>O("ideas"),children:[jsxRuntime.jsx(lucideReact.Sparkles,{className:"w-4 h-4 mr-2"}),"Generate Ideas"]})]})]}),jsxRuntime.jsxs(moonui.Dialog,{open:u,onOpenChange:f,children:[jsxRuntime.jsx(moonui.DialogTrigger,{asChild:!0,children:jsxRuntime.jsx(We,{tooltip:"AI Settings - Configure your API keys here",disabled:m,children:jsxRuntime.jsx(lucideReact.Settings,{className:"w-4 h-4"})})}),jsxRuntime.jsxs(moonui.DialogContent,{className:"sm:max-w-[425px]",children:[jsxRuntime.jsxs(moonui.DialogHeader,{children:[jsxRuntime.jsx(moonui.DialogTitle,{children:"AI Settings"}),jsxRuntime.jsx(moonui.DialogDescription,{children:"Configure your AI provider and API settings."})]}),jsxRuntime.jsxs("div",{className:"grid gap-4 py-4",children:[jsxRuntime.jsxs("div",{className:"grid gap-2",children:[jsxRuntime.jsx(moonui.Label,{htmlFor:"provider",children:"Provider"}),jsxRuntime.jsxs(moonui.Select,{value:c.provider,onValueChange:A=>d({...c,provider:A}),children:[jsxRuntime.jsx(moonui.SelectTrigger,{children:jsxRuntime.jsx(moonui.SelectValue,{})}),jsxRuntime.jsxs(moonui.SelectContent,{children:[jsxRuntime.jsx(moonui.SelectItem,{value:"openai",children:"OpenAI"}),jsxRuntime.jsx(moonui.SelectItem,{value:"claude",children:"Claude (Anthropic)"}),jsxRuntime.jsx(moonui.SelectItem,{value:"gemini",children:"Gemini (Google)"}),jsxRuntime.jsx(moonui.SelectItem,{value:"cohere",children:"Cohere"})]})]})]}),jsxRuntime.jsxs("div",{className:"grid gap-2",children:[jsxRuntime.jsx(moonui.Label,{htmlFor:"apiKey",children:"API Key"}),jsxRuntime.jsx(moonui.Input,{id:"apiKey",type:"password",value:c.apiKey,onChange:A=>d({...c,apiKey:A.target.value}),placeholder:"sk-..."})]}),jsxRuntime.jsxs("div",{className:"grid gap-2",children:[jsxRuntime.jsx(moonui.Label,{htmlFor:"model",children:"Model"}),jsxRuntime.jsxs(moonui.Select,{value:c.model,onValueChange:A=>d({...c,model:A}),children:[jsxRuntime.jsx(moonui.SelectTrigger,{children:jsxRuntime.jsx(moonui.SelectValue,{})}),jsxRuntime.jsxs(moonui.SelectContent,{children:[c.provider==="openai"&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(moonui.SelectItem,{value:"gpt-4",children:"GPT-4"}),jsxRuntime.jsx(moonui.SelectItem,{value:"gpt-3.5-turbo",children:"GPT-3.5 Turbo"})]}),c.provider==="claude"&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(moonui.SelectItem,{value:"claude-3-opus",children:"Claude 3 Opus"}),jsxRuntime.jsx(moonui.SelectItem,{value:"claude-3-sonnet",children:"Claude 3 Sonnet"}),jsxRuntime.jsx(moonui.SelectItem,{value:"claude-3-haiku",children:"Claude 3 Haiku"})]}),c.provider==="gemini"&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(moonui.SelectItem,{value:"gemini-pro",children:"Gemini Pro"}),jsxRuntime.jsx(moonui.SelectItem,{value:"gemini-pro-vision",children:"Gemini Pro Vision"})]}),c.provider==="cohere"&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(moonui.SelectItem,{value:"command",children:"Command"}),jsxRuntime.jsx(moonui.SelectItem,{value:"command-light",children:"Command Light"})]})]})]})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{className:"grid gap-2",children:[jsxRuntime.jsx(moonui.Label,{htmlFor:"temperature",children:"Temperature"}),jsxRuntime.jsx(moonui.Input,{id:"temperature",type:"number",min:"0",max:"2",step:"0.1",value:c.temperature,onChange:A=>d({...c,temperature:parseFloat(A.target.value)})})]}),jsxRuntime.jsxs("div",{className:"grid gap-2",children:[jsxRuntime.jsx(moonui.Label,{htmlFor:"maxTokens",children:"Max Tokens"}),jsxRuntime.jsx(moonui.Input,{id:"maxTokens",type:"number",min:"1",max:"4000",value:c.maxTokens,onChange:A=>d({...c,maxTokens:parseInt(A.target.value)})})]})]})]}),jsxRuntime.jsx("div",{className:"flex justify-end",children:jsxRuntime.jsx(moonui.Button,{onClick:()=>{f(!1),moonui.toast({title:"Settings saved",description:"Your AI settings have been updated."});},children:"Save Settings"})})]})]})]})]})]})})}),jsxRuntime.jsx(moonui.Dialog,{open:_e,onOpenChange:$e,children:jsxRuntime.jsxs(moonui.DialogContent,{className:"sm:max-w-[425px]",children:[jsxRuntime.jsxs(moonui.DialogHeader,{children:[jsxRuntime.jsx(moonui.DialogTitle,{children:"Table Border Settings"}),jsxRuntime.jsx(moonui.DialogDescription,{children:"Customize the appearance of table borders."})]}),jsxRuntime.jsxs("div",{className:"grid gap-6 py-4",children:[jsxRuntime.jsxs("div",{className:"grid gap-3",children:[jsxRuntime.jsx(moonui.Label,{htmlFor:"border-width",children:"Border Width"}),jsxRuntime.jsxs("div",{className:"flex items-center gap-4",children:[jsxRuntime.jsx(moonui.Slider,{id:"border-width",min:0,max:5,step:1,value:[it],onValueChange:A=>ln(A[0]),className:"flex-1"}),jsxRuntime.jsxs("span",{className:"text-sm font-medium w-8",children:[it,"px"]})]})]}),jsxRuntime.jsxs("div",{className:"grid gap-3",children:[jsxRuntime.jsx(moonui.Label,{htmlFor:"border-color",children:"Border Color"}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(moonui.ColorPicker,{value:ht,onChange:Wt,showInput:!0,showPresets:!1,size:"sm"}),jsxRuntime.jsx("span",{className:"text-sm text-muted-foreground",children:ht})]})]}),jsxRuntime.jsxs("div",{className:"grid gap-3",children:[jsxRuntime.jsx(moonui.Label,{htmlFor:"border-style",children:"Border Style"}),jsxRuntime.jsxs(moonui.Select,{value:mt,onValueChange:jn,children:[jsxRuntime.jsx(moonui.SelectTrigger,{children:jsxRuntime.jsx(moonui.SelectValue,{})}),jsxRuntime.jsxs(moonui.SelectContent,{children:[jsxRuntime.jsx(moonui.SelectItem,{value:"solid",children:"Solid"}),jsxRuntime.jsx(moonui.SelectItem,{value:"dashed",children:"Dashed"}),jsxRuntime.jsx(moonui.SelectItem,{value:"dotted",children:"Dotted"}),jsxRuntime.jsx(moonui.SelectItem,{value:"double",children:"Double"}),jsxRuntime.jsx(moonui.SelectItem,{value:"groove",children:"Groove"}),jsxRuntime.jsx(moonui.SelectItem,{value:"ridge",children:"Ridge"}),jsxRuntime.jsx(moonui.SelectItem,{value:"inset",children:"Inset"}),jsxRuntime.jsx(moonui.SelectItem,{value:"outset",children:"Outset"})]})]})]}),jsxRuntime.jsxs("div",{className:"grid gap-3",children:[jsxRuntime.jsx(moonui.Label,{children:"Preview"}),jsxRuntime.jsx("div",{className:"p-4 bg-gray-50 dark:bg-gray-900 rounded-lg",children:jsxRuntime.jsxs("table",{className:"w-full text-sm",style:{borderCollapse:"collapse",border:`${it}px ${mt} ${ht}`},children:[jsxRuntime.jsx("thead",{children:jsxRuntime.jsxs("tr",{children:[jsxRuntime.jsx("th",{style:{border:`${it}px ${mt} ${ht}`,padding:"8px",textAlign:"left"},children:"Header 1"}),jsxRuntime.jsx("th",{style:{border:`${it}px ${mt} ${ht}`,padding:"8px",textAlign:"left"},children:"Header 2"})]})}),jsxRuntime.jsx("tbody",{children:jsxRuntime.jsxs("tr",{children:[jsxRuntime.jsx("td",{style:{border:`${it}px ${mt} ${ht}`,padding:"8px"},children:"Cell 1"}),jsxRuntime.jsx("td",{style:{border:`${it}px ${mt} ${ht}`,padding:"8px"},children:"Cell 2"})]})})]})})]})]}),jsxRuntime.jsxs("div",{className:"flex justify-end gap-2",children:[jsxRuntime.jsx(moonui.Button,{variant:"outline",onClick:()=>$e(!1),children:"Cancel"}),jsxRuntime.jsx(moonui.Button,{onClick:()=>{Nt(it,ht,mt),$e(!1),moonui.toast({title:"Borders applied",description:"Table borders have been updated."});},children:"Apply Borders"})]})]})}),jsxRuntime.jsx("div",{className:"overflow-auto",style:{height:typeof n=="number"?`${n}px`:n},children:m?jsxRuntime.jsx("textarea",{value:b,onChange:A=>v(A.target.value),className:"w-full h-full p-4 font-mono text-sm resize-none focus:outline-none bg-gray-50 dark:bg-gray-900",placeholder:"HTML source code..."}):jsxRuntime.jsx(vh,{editor:y})})]}):null}var JM={success:"bg-green-500 border-green-500",warning:"bg-yellow-500 border-yellow-500",error:"bg-red-500 border-red-500",info:"bg-blue-500 border-blue-500",pending:"bg-gray-400 border-gray-400"},YM={success:jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"h-4 w-4 text-white"}),warning:jsxRuntime.jsx(lucideReact.AlertCircle,{className:"h-4 w-4 text-white"}),error:jsxRuntime.jsx(lucideReact.XCircle,{className:"h-4 w-4 text-white"}),info:jsxRuntime.jsx(lucideReact.Circle,{className:"h-4 w-4 text-white"}),pending:jsxRuntime.jsx(lucideReact.Clock,{className:"h-4 w-4 text-white"})},ZM={success:"text-green-700",warning:"text-yellow-700",error:"text-red-700",info:"text-blue-700",pending:"text-gray-700"};function lF({events:t,onEventClick:e,className:n,showUserInfo:r=!0,showMetadata:i=!0,showRelativeTime:o=!0,groupByDate:s=!1,orientation:a="vertical",compact:l=!1,interactive:c=!0}){let {hasProAccess:u,isLoading:f}=lt();if(!f&&!u)return jsxRuntime.jsx(moonui.Card,{className:moonui.cn("w-full",n),children:jsxRuntime.jsx(moonui.CardContent,{className:"py-12 text-center",children:jsxRuntime.jsxs("div",{className:"max-w-md mx-auto space-y-4",children:[jsxRuntime.jsx("div",{className:"rounded-full bg-purple-100 dark:bg-purple-900/30 p-3 w-fit mx-auto",children:jsxRuntime.jsx(lucideReact.Lock,{className:"h-6 w-6 text-purple-600 dark:text-purple-400"})}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"font-semibold text-lg mb-2",children:"Pro Feature"}),jsxRuntime.jsx("p",{className:"text-muted-foreground text-sm mb-4",children:"Timeline is available exclusively to MoonUI Pro subscribers."}),jsxRuntime.jsx("div",{className:"flex gap-3 justify-center",children:jsxRuntime.jsx("a",{href:"/pricing",children:jsxRuntime.jsxs(moonui.Button,{size:"sm",children:[jsxRuntime.jsx(lucideReact.Sparkles,{className:"mr-2 h-4 w-4"}),"Upgrade to Pro"]})})})]})]})})});let h=[...t].sort((k,y)=>y.date.getTime()-k.date.getTime()),m=k=>k.toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"}),g=k=>k.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!0}),b=k=>{let w=Math.floor((new Date().getTime()-k.getTime())/1e3);if(w<60)return "Just now";if(w<3600){let O=Math.floor(w/60);return `${O} minute${O>1?"s":""} ago`}else if(w<86400){let O=Math.floor(w/3600);return `${O} hour${O>1?"s":""} ago`}else if(w<2592e3){let O=Math.floor(w/86400);return `${O} day${O>1?"s":""} ago`}else return m(k)},v=k=>k.split(" ").map(y=>y[0]).join("").toUpperCase(),S=k=>{let y={};return k.forEach(w=>{let O=m(w.date);y[O]||(y[O]=[]),y[O].push(w);}),y},T=k=>{c&&e&&e(k);},_=(k,y,w)=>{let O=k.color||JM[k.type],X=k.icon||YM[k.type],R=ZM[k.type];return jsxRuntime.jsxs("div",{className:moonui.cn("relative flex gap-4",l?"pb-4":"pb-8",c&&"cursor-pointer hover:bg-muted/50 rounded-lg p-2 -m-2 transition-colors"),onClick:()=>T(k),children:[a==="vertical"&&jsxRuntime.jsxs("div",{className:"flex flex-col items-center",children:[jsxRuntime.jsx("div",{className:moonui.cn("flex items-center justify-center w-8 h-8 rounded-full border-2 bg-background",O),children:X}),!w&&jsxRuntime.jsx("div",{className:"w-0.5 h-full bg-border mt-2"})]}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsxs("div",{className:"flex items-start justify-between gap-2",children:[jsxRuntime.jsxs("div",{className:"flex-1",children:[jsxRuntime.jsx("h4",{className:moonui.cn("font-medium text-sm",l?"mb-1":"mb-2"),children:k.title}),k.description&&jsxRuntime.jsx("p",{className:moonui.cn("text-muted-foreground text-sm",l?"mb-1":"mb-2"),children:k.description})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[o?jsxRuntime.jsx("span",{children:b(k.date)}):jsxRuntime.jsx("span",{children:g(k.date)}),jsxRuntime.jsx(moonui.Badge,{variant:"outline",className:moonui.cn("text-xs",R),children:k.type})]})]}),r&&k.user&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[jsxRuntime.jsxs(moonui.Avatar,{className:"h-6 w-6",children:[jsxRuntime.jsx(moonui.AvatarImage,{src:k.user.avatar}),jsxRuntime.jsx(moonui.AvatarFallback,{className:"text-xs",children:v(k.user.name)})]}),jsxRuntime.jsx("span",{className:"text-sm text-muted-foreground",children:k.user.name})]}),i&&k.metadata&&jsxRuntime.jsxs("div",{className:"flex flex-wrap items-center gap-3 text-xs text-muted-foreground",children:[k.metadata.duration&&jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx(lucideReact.Clock,{className:"h-3 w-3"}),jsxRuntime.jsx("span",{children:k.metadata.duration})]}),k.metadata.location&&jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx(lucideReact.Calendar,{className:"h-3 w-3"}),jsxRuntime.jsx("span",{children:k.metadata.location})]}),k.metadata.comments&&k.metadata.comments>0&&jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx(lucideReact.MessageCircle,{className:"h-3 w-3"}),jsxRuntime.jsx("span",{children:k.metadata.comments})]}),k.metadata.attachments&&k.metadata.attachments>0&&jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx(lucideReact.Paperclip,{className:"h-3 w-3"}),jsxRuntime.jsx("span",{children:k.metadata.attachments})]}),k.metadata.externalLink&&jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx(lucideReact.ExternalLink,{className:"h-3 w-3"}),jsxRuntime.jsx("span",{children:"View details"})]})]}),k.metadata?.tags&&k.metadata.tags.length>0&&jsxRuntime.jsx("div",{className:"flex flex-wrap gap-1 mt-2",children:k.metadata.tags.map((ce,Q)=>jsxRuntime.jsx(moonui.Badge,{variant:"secondary",className:"text-xs",children:ce},Q))})]})]},k.id)},I=()=>{let k=S(h);return Object.entries(k).map(([y,w],O)=>jsxRuntime.jsxs("div",{className:"mb-8",children:[jsxRuntime.jsx("div",{className:"sticky top-0 bg-background/80 backdrop-blur-sm border-b p-2 mb-4",children:jsxRuntime.jsx("h3",{className:"font-medium text-sm text-muted-foreground",children:y})}),w.map((X,R)=>_(X,R,R===w.length-1))]},y))};return jsxRuntime.jsxs(moonui.Card,{className:moonui.cn("w-full",n),children:[jsxRuntime.jsxs(moonui.CardHeader,{children:[jsxRuntime.jsxs(moonui.CardTitle,{className:"flex items-center gap-2",children:[jsxRuntime.jsx(lucideReact.Clock,{className:"h-5 w-5"}),"Timeline"]}),jsxRuntime.jsxs(moonui.CardDescription,{children:[h.length," event",h.length!==1?"s":""," tracked"]})]}),jsxRuntime.jsx(moonui.CardContent,{children:h.length>0?jsxRuntime.jsx("div",{className:moonui.cn("space-y-0",a==="horizontal"&&"flex overflow-x-auto gap-6"),children:s?I():h.map((k,y)=>_(k,y,y===h.length-1))}):jsxRuntime.jsxs("div",{className:"text-center py-8",children:[jsxRuntime.jsx(lucideReact.Clock,{className:"h-12 w-12 mx-auto mb-4 text-muted-foreground"}),jsxRuntime.jsx("p",{className:"text-muted-foreground",children:"No events to display"})]})})]})}function XM({items:t,height:e,itemHeight:n=50,estimatedItemHeight:r=50,variableHeight:i=!1,overscan:o=5,renderItem:s,onScroll:a,className:l}){let[c,d]=Mn.useState(0),[u,f]=Mn.useState(!1),[p,h]=Mn.useState(new Map),m=Mn.useRef(null),g=Mn.useRef(null),b=Mn.useRef(),v=Mn.useRef(),S=Mn.useMemo(()=>{let y=[],w=0;for(let O=0;O<t.length;O++){let X=i?p.get(O)||r:n;y.push({index:O,height:X,top:w}),w+=X;}return y},[t.length,n,r,i,p]),T=Mn.useMemo(()=>S.length>0?S[S.length-1].top+S[S.length-1].height:0,[S]),_=Mn.useMemo(()=>{let y=S.findIndex(R=>R.top+R.height>=c),w=S.findIndex(R=>R.top>c+e),O=Math.max(0,y-o),X=w===-1?Math.min(t.length-1,y+Math.ceil(e/n)+o):Math.min(t.length-1,w+o);return {start:O,end:X}},[c,e,S,o,t.length,n]),I=Mn.useMemo(()=>{let y=[];for(let w=_.start;w<=_.end;w++)if(w>=0&&w<t.length&&S[w]){let O=S[w];y.push({item:t[w],index:w,style:{position:"absolute",top:O.top,left:0,right:0,height:i?"auto":O.height,minHeight:i?O.height:void 0}});}return y},[t,_,S,i]),k=Mn.useCallback(y=>{let w=y.currentTarget.scrollTop;d(w),f(!0),a&&a(w),b.current&&clearTimeout(b.current),v.current&&clearTimeout(v.current),v.current=setTimeout(()=>{f(!1);},150);},[a]);return Mn.useEffect(()=>{if(!i||!m.current)return;let y=new ResizeObserver(O=>{let X=new Map(p),R=!1;O.forEach(ce=>{let G=ce.target.getAttribute("data-index");if(G){let x=parseInt(G,10),C=ce.contentRect.height;X.get(x)!==C&&(X.set(x,C),R=!0);}}),R&&h(X);});return m.current.querySelectorAll("[data-index]").forEach(O=>y.observe(O)),()=>y.disconnect()},[i,p,I]),Mn.useEffect(()=>{let y=O=>{if(m.current)switch(O.key){case"ArrowUp":O.preventDefault(),g.current?.scrollBy({top:-n,behavior:"smooth"});break;case"ArrowDown":O.preventDefault(),g.current?.scrollBy({top:n,behavior:"smooth"});break;case"PageUp":O.preventDefault(),g.current?.scrollBy({top:-e,behavior:"smooth"});break;case"PageDown":O.preventDefault(),g.current?.scrollBy({top:e,behavior:"smooth"});break;case"Home":O.preventDefault(),g.current?.scrollTo({top:0,behavior:"smooth"});break;case"End":O.preventDefault(),g.current?.scrollTo({top:T,behavior:"smooth"});break}},w=m.current;if(w)return w.addEventListener("keydown",y),()=>w.removeEventListener("keydown",y)},[n,e,T]),jsxRuntime.jsxs("div",{ref:m,className:moonui.cn("relative overflow-hidden border rounded-lg bg-background focus:outline-none focus:ring-2 focus:ring-ring",l),style:{height:e},tabIndex:0,role:"listbox","aria-label":`Virtual list with ${t.length} items`,children:[jsxRuntime.jsx("div",{ref:g,className:"h-full overflow-auto scrollbar-thin scrollbar-thumb-muted scrollbar-track-transparent",onScroll:k,children:jsxRuntime.jsx("div",{style:{height:T,position:"relative"},children:I.map(({item:y,index:w,style:O})=>jsxRuntime.jsx("div",{"data-index":w,style:O,role:"option","aria-selected":"false",className:"outline-none",children:s(y,w)},w))})}),u&&jsxRuntime.jsx("div",{className:"absolute top-2 right-2 bg-muted/80 text-muted-foreground px-2 py-1 rounded text-xs",children:"Scrolling..."}),t.length>100&&jsxRuntime.jsxs("div",{className:"absolute bottom-2 right-2 bg-muted/80 text-muted-foreground px-2 py-1 rounded text-xs",children:[Math.round(c/Math.max(T-e,1)*100),"%"]})]})}function hF(t,e={}){let[n,r]=Mn.useState(e),[i,o]=Mn.useState(new Set),s=Mn.useCallback(d=>{r(u=>({...u,...d}));},[]),a=Mn.useCallback(d=>{o(u=>new Set([...u,d]));},[]),l=Mn.useCallback(d=>{o(u=>{let f=new Set(u);return f.delete(d),f});},[]),c=Mn.useCallback(()=>{o(new Set);},[]);return {config:n,updateConfig:s,selectedItems:i,selectItem:a,deselectItem:l,clearSelection:c}}function mF({selectable:t=!1,multiSelect:e=!1,selectedItems:n=new Set,onSelectionChange:r,renderItem:i,...o}){let s=Mn.useCallback(l=>{if(!t||!r)return;let c=new Set(n);e?c.has(l)?c.delete(l):c.add(l):(c.clear(),c.add(l)),r(c);},[t,e,n,r]),a=Mn.useCallback((l,c)=>{let d=n.has(c);return jsxRuntime.jsx("div",{className:moonui.cn("transition-colors",t&&"cursor-pointer hover:bg-muted/50",d&&"bg-primary/10 border-l-4 border-primary"),onClick:()=>t&&s(c),children:i(l,c)})},[i,t,n,s]);return jsxRuntime.jsx(XM,{...o,renderItem:a})}/*! Bundled license information:
|
|
186
|
+
3. "-" cannot repeat`);je.customSchemes.push([t,e]);}function u5(){je.scanner=o5(je.customSchemes);for(let t=0;t<je.tokenQueue.length;t++)je.tokenQueue[t][1]({scanner:je.scanner});je.parser=a5(je.scanner.tokens);for(let t=0;t<je.pluginQueue.length;t++)je.pluginQueue[t][1]({scanner:je.scanner,parser:je.parser});return je.initialized=!0,je}function ld(t){return je.initialized||u5(),l5(je.parser.start,t,JE(je.scanner.start,t))}ld.scan=JE;function cd(t,e=null,r=null){if(e&&typeof e=="object"){if(r)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);r=e,e=null;}let n=new Eh(r),o=ld(t),i=[];for(let s=0;s<o.length;s++){let a=o[s];a.isLink&&(!e||a.t===e)&&n.check(a)&&i.push(a.toFormattedObject(n));}return i}var Sh="[\0- \xA0\u1680\u180E\u2000-\u2029\u205F\u3000]",f5=new RegExp(Sh),p5=new RegExp(`${Sh}$`),h5=new RegExp(Sh,"g");function m5(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function g5(t){return new oe({key:new ae("autolink"),appendTransaction:(e,r,n)=>{let o=e.some(c=>c.docChanged)&&!r.doc.eq(n.doc),i=e.some(c=>c.getMeta("preventAutolink"));if(!o||i)return;let{tr:s}=n,a=Hp(r.doc,[...e]);if(qp(a).forEach(({newRange:c})=>{let d=$x(n.doc,c,p=>p.isTextblock),u,f;if(d.length>1)u=d[0],f=n.doc.textBetween(u.pos,u.pos+u.node.nodeSize,void 0," ");else if(d.length){let p=n.doc.textBetween(c.from,c.to," "," ");if(!p5.test(p))return;u=d[0],f=n.doc.textBetween(u.pos,c.to,void 0," ");}if(u&&f){let p=f.split(f5).filter(Boolean);if(p.length<=0)return !1;let h=p[p.length-1],m=u.pos+f.lastIndexOf(h);if(!h)return !1;let g=ld(h).map(b=>b.toObject(t.defaultProtocol));if(!m5(g))return !1;g.filter(b=>b.isLink).map(b=>({...b,from:m+b.start+1,to:m+b.end+1})).filter(b=>n.schema.marks.code?!n.doc.rangeHasMark(b.from,b.to,n.schema.marks.code):!0).filter(b=>t.validate(b.value)).filter(b=>t.shouldAutoLink(b.value)).forEach(b=>{Cc(b.from,b.to,n.doc).some(v=>v.mark.type===t.type)||s.addMark(b.from,b.to,t.type.create({href:b.href}));});}}),!!s.steps.length)return s}})}function b5(t){return new oe({key:new ae("handleClickLink"),props:{handleClick:(e,r,n)=>{var o,i;if(n.button!==0||!e.editable)return !1;let s=null;if(n.target instanceof HTMLAnchorElement)s=n.target;else {let d=n.target,u=[];for(;d.nodeName!=="DIV";)u.push(d),d=d.parentNode;s=u.find(f=>f.nodeName==="A");}if(!s)return !1;let a=Gp(e.state,t.type.name),l=(o=s?.href)!=null?o:a.href,c=(i=s?.target)!=null?i:a.target;return t.enableClickSelection&&t.editor.commands.extendMarkRange(t.type.name),s&&l?(window.open(l,c),!0):!1}}})}function v5(t){return new oe({key:new ae("handlePasteLink"),props:{handlePaste:(e,r,n)=>{let{state:o}=e,{selection:i}=o,{empty:s}=i;if(s)return !1;let a="";n.content.forEach(c=>{a+=c.textContent;});let l=cd(a,{defaultProtocol:t.defaultProtocol}).find(c=>c.isLink&&c.value===a);return !a||!l?!1:t.editor.commands.setMark(t.type,{href:l.href})}}})}function di(t,e){let r=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(n=>{let o=typeof n=="string"?n:n.scheme;o&&r.push(o);}),!t||t.replace(h5,"").match(new RegExp(`^(?:(?:${r.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var Ch=Pt.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(t=>{if(typeof t=="string"){kh(t);return}kh(t.scheme,t.optionalSlashes);});},onDestroy(){QE();},inclusive(){return this.options.autolink},addOptions(){return {openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(t,e)=>!!di(t,e.protocols),validate:t=>!!t,shouldAutoLink:t=>!!t}},addAttributes(){return {href:{default:null,parseHTML(t){return t.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return [{tag:"a[href]",getAttrs:t=>{let e=t.getAttribute("href");return !e||!this.options.isAllowedUri(e,{defaultValidate:r=>!!di(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:e=>!!di(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",ie(this.options.HTMLAttributes,t),0]:["a",ie(this.options.HTMLAttributes,{...t,href:""}),0]},addCommands(){return {setLink:t=>({chain:e})=>{let{href:r}=t;return this.options.isAllowedUri(r,{defaultValidate:n=>!!di(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,t).setMeta("preventAutolink",!0).run():!1},toggleLink:t=>({chain:e})=>{let{href:r}=t||{};return r&&!this.options.isAllowedUri(r,{defaultValidate:n=>!!di(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return [dr({find:t=>{let e=[];if(t){let{protocols:r,defaultProtocol:n}=this.options,o=cd(t).filter(i=>i.isLink&&this.options.isAllowedUri(i.value,{defaultValidate:s=>!!di(s,r),protocols:r,defaultProtocol:n}));o.length&&o.forEach(i=>e.push({text:i.value,data:{href:i.href},index:i.start}));}return e},type:this.type,getAttributes:t=>{var e;return {href:(e=t.data)==null?void 0:e.href}}})]},addProseMirrorPlugins(){let t=[],{protocols:e,defaultProtocol:r}=this.options;return this.options.autolink&&t.push(g5({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:n=>this.options.isAllowedUri(n,{defaultValidate:o=>!!di(o,e),protocols:e,defaultProtocol:r}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&t.push(b5({type:this.type,editor:this.editor,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&t.push(v5({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),t}}),e1=Ch;var y5=Object.defineProperty,w5=(t,e)=>{for(var r in e)y5(t,r,{get:e[r],enumerable:!0});},x5="listItem",t1="textStyle",r1=/^\s*([-+*])\s$/,Nh=Ne.create({name:"bulletList",addOptions(){return {itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return `${this.options.itemTypeName}+`},parseHTML(){return [{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return ["ul",ie(this.options.HTMLAttributes,t),0]},addCommands(){return {toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(x5,this.editor.getAttributes(t1)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return {"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=un({find:r1,type:this.type});return (this.options.keepMarks||this.options.keepAttributes)&&(t=un({find:r1,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(t1),editor:this.editor})),[t]}}),_h=Ne.create({name:"listItem",addOptions(){return {HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return [{tag:"li"}]},renderHTML({HTMLAttributes:t}){return ["li",ie(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return {Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),E5={};w5(E5,{findListItemPos:()=>Oa,getNextListDepth:()=>Mh,handleBackspace:()=>Rh,handleDelete:()=>Th,hasListBefore:()=>i1,hasListItemAfter:()=>k5,hasListItemBefore:()=>s1,listItemHasSubList:()=>a1,nextListIsDeeper:()=>l1,nextListIsHigher:()=>c1});var Oa=(t,e)=>{let{$from:r}=e.selection,n=at(t,e.schema),o=null,i=r.depth,s=r.pos,a=null;for(;i>0&&a===null;)o=r.node(i),o.type===n?a=i:(i-=1,s-=1);return a===null?null:{$pos:e.doc.resolve(s),depth:a}},Mh=(t,e)=>{let r=Oa(t,e);if(!r)return !1;let[,n]=Wx(e,t,r.$pos.pos+4);return n},i1=(t,e,r)=>{let{$anchor:n}=t.selection,o=Math.max(0,n.pos-2),i=t.doc.resolve(o).node();return !(!i||!r.includes(i.type.name))},s1=(t,e)=>{var r;let{$anchor:n}=e.selection,o=e.doc.resolve(n.pos-2);return !(o.index()===0||((r=o.nodeBefore)==null?void 0:r.type.name)!==t)},a1=(t,e,r)=>{if(!r)return !1;let n=at(t,e.schema),o=!1;return r.descendants(i=>{i.type===n&&(o=!0);}),o},Rh=(t,e,r)=>{if(t.commands.undoInputRule())return !0;if(t.state.selection.from!==t.state.selection.to)return !1;if(!dn(t.state,e)&&i1(t.state,e,r)){let{$anchor:a}=t.state.selection,l=t.state.doc.resolve(a.before()-1),c=[];l.node().descendants((f,p)=>{f.type.name===e&&c.push({node:f,pos:p});});let d=c.at(-1);if(!d)return !1;let u=t.state.doc.resolve(l.start()+d.pos+1);return t.chain().cut({from:a.start()-1,to:a.end()+1},u.end()).joinForward().run()}if(!dn(t.state,e)||!qx(t.state))return !1;let n=Oa(e,t.state);if(!n)return !1;let i=t.state.doc.resolve(n.$pos.pos-2).node(n.depth),s=a1(e,t.state,i);return s1(e,t.state)&&!s?t.commands.joinItemBackward():t.chain().liftListItem(e).run()},l1=(t,e)=>{let r=Mh(t,e),n=Oa(t,e);return !n||!r?!1:r>n.depth},c1=(t,e)=>{let r=Mh(t,e),n=Oa(t,e);return !n||!r?!1:r<n.depth},Th=(t,e)=>{if(!dn(t.state,e)||!Gx(t.state,e))return !1;let{selection:r}=t.state,{$from:n,$to:o}=r;return !r.empty&&n.sameParent(o)?!1:l1(e,t.state)?t.chain().focus(t.state.selection.from+4).lift(e).joinBackward().run():c1(e,t.state)?t.chain().joinForward().joinBackward().run():t.commands.joinItemForward()},k5=(t,e)=>{var r;let{$anchor:n}=e.selection,o=e.doc.resolve(n.pos-n.parentOffset-2);return !(o.index()===o.parent.childCount-1||((r=o.nodeAfter)==null?void 0:r.type.name)!==t)},Ah=se.create({name:"listKeymap",addOptions(){return {listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}},addKeyboardShortcuts(){return {Delete:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:r})=>{t.state.schema.nodes[r]!==void 0&&Th(t,r)&&(e=!0);}),e},"Mod-Delete":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:r})=>{t.state.schema.nodes[r]!==void 0&&Th(t,r)&&(e=!0);}),e},Backspace:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:r,wrapperNames:n})=>{t.state.schema.nodes[r]!==void 0&&Rh(t,r,n)&&(e=!0);}),e},"Mod-Backspace":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:r,wrapperNames:n})=>{t.state.schema.nodes[r]!==void 0&&Rh(t,r,n)&&(e=!0);}),e}}}}),S5="listItem",n1="textStyle",o1=/^(\d+)\.\s$/,Oh=Ne.create({name:"orderedList",addOptions(){return {itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return `${this.options.itemTypeName}+`},addAttributes(){return {start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:null,parseHTML:t=>t.getAttribute("type")}}},parseHTML(){return [{tag:"ol"}]},renderHTML({HTMLAttributes:t}){let{start:e,...r}=t;return e===1?["ol",ie(this.options.HTMLAttributes,r),0]:["ol",ie(this.options.HTMLAttributes,t),0]},addCommands(){return {toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(S5,this.editor.getAttributes(n1)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return {"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=un({find:o1,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,r)=>r.childCount+r.attrs.start===+e[1]});return (this.options.keepMarks||this.options.keepAttributes)&&(t=un({find:o1,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(n1)}),joinPredicate:(e,r)=>r.childCount+r.attrs.start===+e[1],editor:this.editor})),[t]}}),C5=/^\s*(\[([( |x])?\])\s$/,dd=Ne.create({name:"taskItem",addOptions(){return {nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return {checked:{default:!1,keepOnSplit:!1,parseHTML:t=>{let e=t.getAttribute("data-checked");return e===""||e==="true"},renderHTML:t=>({"data-checked":t.checked})}}},parseHTML(){return [{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:t,HTMLAttributes:e}){return ["li",ie(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:t.attrs.checked?"checked":null}],["span"]],["div",0]]},addKeyboardShortcuts(){let t={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...t,Tab:()=>this.editor.commands.sinkListItem(this.name)}:t},addNodeView(){return ({node:t,HTMLAttributes:e,getPos:r,editor:n})=>{let o=document.createElement("li"),i=document.createElement("label"),s=document.createElement("span"),a=document.createElement("input"),l=document.createElement("div"),c=()=>{var d,u;a.ariaLabel=((u=(d=this.options.a11y)==null?void 0:d.checkboxLabel)==null?void 0:u.call(d,t,a.checked))||`Task item checkbox for ${t.textContent||"empty task item"}`;};return c(),i.contentEditable="false",a.type="checkbox",a.addEventListener("mousedown",d=>d.preventDefault()),a.addEventListener("change",d=>{if(!n.isEditable&&!this.options.onReadOnlyChecked){a.checked=!a.checked;return}let{checked:u}=d.target;n.isEditable&&typeof r=="function"&&n.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:f})=>{let p=r();if(typeof p!="number")return !1;let h=f.doc.nodeAt(p);return f.setNodeMarkup(p,void 0,{...h?.attrs,checked:u}),!0}).run(),!n.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(t,u)||(a.checked=!a.checked));}),Object.entries(this.options.HTMLAttributes).forEach(([d,u])=>{o.setAttribute(d,u);}),o.dataset.checked=t.attrs.checked,a.checked=t.attrs.checked,i.append(a,s),o.append(i,l),Object.entries(e).forEach(([d,u])=>{o.setAttribute(d,u);}),{dom:o,contentDOM:l,update:d=>d.type!==this.type?!1:(o.dataset.checked=d.attrs.checked,a.checked=d.attrs.checked,c(),!0)}}},addInputRules(){return [un({find:C5,type:this.type,getAttributes:t=>({checked:t[t.length-1]==="x"})})]}}),ud=Ne.create({name:"taskList",addOptions(){return {itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return `${this.options.itemTypeName}+`},parseHTML(){return [{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:t}){return ["ul",ie(this.options.HTMLAttributes,t,{"data-type":this.name}),0]},addCommands(){return {toggleTaskList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return {"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});se.create({name:"listKit",addExtensions(){let t=[];return this.options.bulletList!==!1&&t.push(Nh.configure(this.options.bulletList)),this.options.listItem!==!1&&t.push(_h.configure(this.options.listItem)),this.options.listKeymap!==!1&&t.push(Ah.configure(this.options.listKeymap)),this.options.orderedList!==!1&&t.push(Oh.configure(this.options.orderedList)),this.options.taskItem!==!1&&t.push(dd.configure(this.options.taskItem)),this.options.taskList!==!1&&t.push(ud.configure(this.options.taskList)),t}});var d1=Ne.create({name:"paragraph",priority:1e3,addOptions(){return {HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return [{tag:"p"}]},renderHTML({HTMLAttributes:t}){return ["p",ie(this.options.HTMLAttributes,t),0]},addCommands(){return {setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return {"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}});var R5=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,T5=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,u1=Pt.create({name:"strike",addOptions(){return {HTMLAttributes:{}}},parseHTML(){return [{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return ["s",ie(this.options.HTMLAttributes,t),0]},addCommands(){return {setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return {"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return [Mr({find:R5,type:this.type})]},addPasteRules(){return [dr({find:T5,type:this.type})]}});var f1=Ne.create({name:"text",group:"inline"});var Dh=Pt.create({name:"underline",addOptions(){return {HTMLAttributes:{}}},parseHTML(){return [{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return ["u",ie(this.options.HTMLAttributes,t),0]},addCommands(){return {setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return {"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),p1=Dh;function h1(t={}){return new oe({view(e){return new Ph(e,t)}})}var Ph=class{constructor(e,r){var n;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(n=r.width)!==null&&n!==void 0?n:1,this.color=r.color===!1?void 0:r.color||"black",this.class=r.class,this.handlers=["dragover","dragend","drop","dragleave"].map(o=>{let i=s=>{this[o](s);};return e.dom.addEventListener(o,i),{name:o,handler:i}});}destroy(){this.handlers.forEach(({name:e,handler:r})=>this.editorView.dom.removeEventListener(e,r));}update(e,r){this.cursorPos!=null&&r.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay());}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay());}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),r=!e.parent.inlineContent,n,o=this.editorView.dom,i=o.getBoundingClientRect(),s=i.width/o.offsetWidth,a=i.height/o.offsetHeight;if(r){let u=e.nodeBefore,f=e.nodeAfter;if(u||f){let p=this.editorView.nodeDOM(this.cursorPos-(u?u.nodeSize:0));if(p){let h=p.getBoundingClientRect(),m=u?h.bottom:h.top;u&&f&&(m=(m+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let g=this.width/2*a;n={left:h.left,right:h.right,top:m-g,bottom:m+g};}}}if(!n){let u=this.editorView.coordsAtPos(this.cursorPos),f=this.width/2*s;n={left:u.left-f,right:u.left+f,top:u.top,bottom:u.bottom};}let l=this.editorView.dom.offsetParent;this.element||(this.element=l.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",r),this.element.classList.toggle("prosemirror-dropcursor-inline",!r);let c,d;if(!l||l==document.body&&getComputedStyle(l).position=="static")c=-pageXOffset,d=-pageYOffset;else {let u=l.getBoundingClientRect(),f=u.width/l.offsetWidth,p=u.height/l.offsetHeight;c=u.left-l.scrollLeft*f,d=u.top-l.scrollTop*p;}this.element.style.left=(n.left-c)/s+"px",this.element.style.top=(n.top-d)/a+"px",this.element.style.width=(n.right-n.left)/s+"px",this.element.style.height=(n.bottom-n.top)/a+"px";}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e);}dragover(e){if(!this.editorView.editable)return;let r=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=r&&r.inside>=0&&this.editorView.state.doc.nodeAt(r.inside),o=n&&n.type.spec.disableDropCursor,i=typeof o=="function"?o(this.editorView,r,e):o;if(r&&!i){let s=r.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=Ql(this.editorView.state.doc,s,this.editorView.dragging.slice);a!=null&&(s=a);}this.setCursor(s),this.scheduleRemoval(5e3);}}dragend(){this.scheduleRemoval(20);}drop(){this.scheduleRemoval(20);}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null);}};var Xe=class extends Z{constructor(e){super(e,e);}map(e,r){let n=e.resolve(r.map(this.head));return Xe.valid(n)?new Xe(n):Z.near(n)}content(){return H.empty}eq(e){return e instanceof Xe&&e.head==this.head}toJSON(){return {type:"gapcursor",pos:this.head}}static fromJSON(e,r){if(typeof r.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new Xe(e.resolve(r.pos))}getBookmark(){return new Da(this.anchor)}static valid(e){let r=e.parent;if(r.isTextblock||!N5(e)||!_5(e))return !1;let n=r.type.spec.allowGapCursor;if(n!=null)return n;let o=r.contentMatchAt(e.index()).defaultType;return o&&o.isTextblock}static findGapCursorFrom(e,r,n=!1){e:for(;;){if(!n&&Xe.valid(e))return e;let o=e.pos,i=null;for(let s=e.depth;;s--){let a=e.node(s);if(r>0?e.indexAfter(s)<a.childCount:e.index(s)>0){i=a.child(r>0?e.indexAfter(s):e.index(s)-1);break}else if(s==0)return null;o+=r;let l=e.doc.resolve(o);if(Xe.valid(l))return l}for(;;){let s=r>0?i.firstChild:i.lastChild;if(!s){if(i.isAtom&&!i.isText&&!X.isSelectable(i)){e=e.doc.resolve(o+i.nodeSize*r),n=!1;continue e}break}i=s,o+=r;let a=e.doc.resolve(o);if(Xe.valid(a))return a}return null}}};Xe.prototype.visible=!1;Xe.findFrom=Xe.findGapCursorFrom;Z.jsonID("gapcursor",Xe);var Da=class{constructor(e){this.pos=e;}map(e){return new Da(e.map(this.pos))}resolve(e){let r=e.resolve(this.pos);return Xe.valid(r)?new Xe(r):Z.near(r)}};function N5(t){for(let e=t.depth;e>=0;e--){let r=t.index(e),n=t.node(e);if(r==0){if(n.type.spec.isolating)return !0;continue}for(let o=n.child(r-1);;o=o.lastChild){if(o.childCount==0&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return !0;if(o.inlineContent)return !1}}return !0}function _5(t){for(let e=t.depth;e>=0;e--){let r=t.indexAfter(e),n=t.node(e);if(r==n.childCount){if(n.type.spec.isolating)return !0;continue}for(let o=n.child(r);;o=o.firstChild){if(o.childCount==0&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return !0;if(o.inlineContent)return !1}}return !0}function m1(){return new oe({props:{decorations:D5,createSelectionBetween(t,e,r){return e.pos==r.pos&&Xe.valid(r)?new Xe(r):null},handleClick:A5,handleKeyDown:M5,handleDOMEvents:{beforeinput:O5}}})}var M5=ma({ArrowLeft:fd("horiz",-1),ArrowRight:fd("horiz",1),ArrowUp:fd("vert",-1),ArrowDown:fd("vert",1)});function fd(t,e){let r=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(n,o,i){let s=n.selection,a=e>0?s.$to:s.$from,l=s.empty;if(s instanceof q){if(!i.endOfTextblock(r)||a.depth==0)return !1;l=!1,a=n.doc.resolve(e>0?a.after():a.before());}let c=Xe.findGapCursorFrom(a,e,l);return c?(o&&o(n.tr.setSelection(new Xe(c))),!0):!1}}function A5(t,e,r){if(!t||!t.editable)return !1;let n=t.state.doc.resolve(e);if(!Xe.valid(n))return !1;let o=t.posAtCoords({left:r.clientX,top:r.clientY});return o&&o.inside>-1&&X.isSelectable(t.state.doc.nodeAt(o.inside))?!1:(t.dispatch(t.state.tr.setSelection(new Xe(n))),!0)}function O5(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof Xe))return !1;let{$from:r}=t.state.selection,n=r.parent.contentMatchAt(r.index()).findWrapping(t.state.schema.nodes.text);if(!n)return !1;let o=O.empty;for(let s=n.length-1;s>=0;s--)o=O.from(n[s].createAndFill(null,o));let i=t.state.tr.replace(r.pos,r.pos,new H(o,0,0));return i.setSelection(q.near(i.doc.resolve(r.pos+1))),t.dispatch(i),!1}function D5(t){if(!(t.selection instanceof Xe))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",Ee.create(t.doc,[Be.widget(t.selection.head,e,{key:"gapcursor"})])}var pd=200,It=function(){};It.prototype.append=function(e){return e.length?(e=It.from(e),!this.length&&e||e.length<pd&&this.leafAppend(e)||this.length<pd&&e.leafPrepend(this)||this.appendInner(e)):this};It.prototype.prepend=function(e){return e.length?It.from(e).append(this):this};It.prototype.appendInner=function(e){return new P5(this,e)};It.prototype.slice=function(e,r){return e===void 0&&(e=0),r===void 0&&(r=this.length),e>=r?It.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,r))};It.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};It.prototype.forEach=function(e,r,n){r===void 0&&(r=0),n===void 0&&(n=this.length),r<=n?this.forEachInner(e,r,n,0):this.forEachInvertedInner(e,r,n,0);};It.prototype.map=function(e,r,n){r===void 0&&(r=0),n===void 0&&(n=this.length);var o=[];return this.forEach(function(i,s){return o.push(e(i,s))},r,n),o};It.from=function(e){return e instanceof It?e:e&&e.length?new g1(e):It.empty};var g1=function(t){function e(n){t.call(this),this.values=n;}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(o,i){return o==0&&i==this.length?this:new e(this.values.slice(o,i))},e.prototype.getInner=function(o){return this.values[o]},e.prototype.forEachInner=function(o,i,s,a){for(var l=i;l<s;l++)if(o(this.values[l],a+l)===!1)return !1},e.prototype.forEachInvertedInner=function(o,i,s,a){for(var l=i-1;l>=s;l--)if(o(this.values[l],a+l)===!1)return !1},e.prototype.leafAppend=function(o){if(this.length+o.length<=pd)return new e(this.values.concat(o.flatten()))},e.prototype.leafPrepend=function(o){if(this.length+o.length<=pd)return new e(o.flatten().concat(this.values))},r.length.get=function(){return this.values.length},r.depth.get=function(){return 0},Object.defineProperties(e.prototype,r),e}(It);It.empty=new g1([]);var P5=function(t){function e(r,n){t.call(this),this.left=r,this.right=n,this.length=r.length+n.length,this.depth=Math.max(r.depth,n.depth)+1;}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(n){return n<this.left.length?this.left.get(n):this.right.get(n-this.left.length)},e.prototype.forEachInner=function(n,o,i,s){var a=this.left.length;if(o<a&&this.left.forEachInner(n,o,Math.min(i,a),s)===!1||i>a&&this.right.forEachInner(n,Math.max(o-a,0),Math.min(this.length,i)-a,s+a)===!1)return !1},e.prototype.forEachInvertedInner=function(n,o,i,s){var a=this.left.length;if(o>a&&this.right.forEachInvertedInner(n,o-a,Math.max(i,a)-a,s+a)===!1||i<a&&this.left.forEachInvertedInner(n,Math.min(o,a),i,s)===!1)return !1},e.prototype.sliceInner=function(n,o){if(n==0&&o==this.length)return this;var i=this.left.length;return o<=i?this.left.slice(n,o):n>=i?this.right.slice(n-i,o-i):this.left.slice(n,i).append(this.right.slice(0,o-i))},e.prototype.leafAppend=function(n){var o=this.right.leafAppend(n);if(o)return new e(this.left,o)},e.prototype.leafPrepend=function(n){var o=this.left.leafPrepend(n);if(o)return new e(o,this.right)},e.prototype.appendInner=function(n){return this.left.depth>=Math.max(this.right.depth,n.depth)+1?new e(this.left,new e(this.right,n)):new e(this,n)},e}(It),Ih=It;var I5=500,br=class{constructor(e,r){this.items=e,this.eventCount=r;}popEvent(e,r){if(this.eventCount==0)return null;let n=this.items.length;for(;;n--)if(this.items.get(n-1).selection){--n;break}let o,i;r&&(o=this.remapping(n,this.items.length),i=o.maps.length);let s=e.tr,a,l,c=[],d=[];return this.items.forEach((u,f)=>{if(!u.step){o||(o=this.remapping(n,f+1),i=o.maps.length),i--,d.push(u);return}if(o){d.push(new Dr(u.map));let p=u.step.map(o.slice(i)),h;p&&s.maybeStep(p).doc&&(h=s.mapping.maps[s.mapping.maps.length-1],c.push(new Dr(h,void 0,void 0,c.length+d.length))),i--,h&&o.appendMap(h,i);}else s.maybeStep(u.step);if(u.selection)return a=o?u.selection.map(o.slice(i)):u.selection,l=new br(this.items.slice(0,n).append(d.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:s,selection:a}}addTransform(e,r,n,o){let i=[],s=this.eventCount,a=this.items,l=!o&&a.length?a.get(a.length-1):null;for(let d=0;d<e.steps.length;d++){let u=e.steps[d].invert(e.docs[d]),f=new Dr(e.mapping.maps[d],u,r),p;(p=l&&l.merge(f))&&(f=p,d?i.pop():a=a.slice(0,a.length-1)),i.push(f),r&&(s++,r=void 0),o||(l=f);}let c=s-n.depth;return c>$5&&(a=L5(a,c),s-=c),new br(a.append(i),s)}remapping(e,r){let n=new oo;return this.items.forEach((o,i)=>{let s=o.mirrorOffset!=null&&i-o.mirrorOffset>=e?n.maps.length-o.mirrorOffset:void 0;n.appendMap(o.map,s);},e,r),n}addMaps(e){return this.eventCount==0?this:new br(this.items.append(e.map(r=>new Dr(r))),this.eventCount)}rebased(e,r){if(!this.eventCount)return this;let n=[],o=Math.max(0,this.items.length-r),i=e.mapping,s=e.steps.length,a=this.eventCount;this.items.forEach(f=>{f.selection&&a--;},o);let l=r;this.items.forEach(f=>{let p=i.getMirror(--l);if(p==null)return;s=Math.min(s,p);let h=i.maps[p];if(f.step){let m=e.steps[p].invert(e.docs[p]),g=f.selection&&f.selection.map(i.slice(l+1,p));g&&a++,n.push(new Dr(h,m,g));}else n.push(new Dr(h));},o);let c=[];for(let f=r;f<s;f++)c.push(new Dr(i.maps[f]));let d=this.items.slice(0,o).append(c).append(n),u=new br(d,a);return u.emptyItemCount()>I5&&(u=u.compress(this.items.length-n.length)),u}emptyItemCount(){let e=0;return this.items.forEach(r=>{r.step||e++;}),e}compress(e=this.items.length){let r=this.remapping(0,e),n=r.maps.length,o=[],i=0;return this.items.forEach((s,a)=>{if(a>=e)o.push(s),s.selection&&i++;else if(s.step){let l=s.step.map(r.slice(n)),c=l&&l.getMap();if(n--,c&&r.appendMap(c,n),l){let d=s.selection&&s.selection.map(r.slice(n));d&&i++;let u=new Dr(c.invert(),l,d),f,p=o.length-1;(f=o.length&&o[p].merge(u))?o[p]=f:o.push(u);}}else s.map&&n--;},this.items.length,0),new br(Ih.from(o.reverse()),i)}};br.empty=new br(Ih.empty,0);function L5(t,e){let r;return t.forEach((n,o)=>{if(n.selection&&e--==0)return r=o,!1}),t.slice(r)}var Dr=class{constructor(e,r,n,o){this.map=e,this.step=r,this.selection=n,this.mirrorOffset=o;}merge(e){if(this.step&&e.step&&!e.selection){let r=e.step.merge(this.step);if(r)return new Dr(r.getMap().invert(),r,this.selection)}}},hn=class{constructor(e,r,n,o,i){this.done=e,this.undone=r,this.prevRanges=n,this.prevTime=o,this.prevComposition=i;}},$5=20;function B5(t,e,r,n){let o=r.getMeta(ui),i;if(o)return o.historyState;r.getMeta(H5)&&(t=new hn(t.done,t.undone,null,0,-1));let s=r.getMeta("appendedTransaction");if(r.steps.length==0)return t;if(s&&s.getMeta(ui))return s.getMeta(ui).redo?new hn(t.done.addTransform(r,void 0,n,hd(e)),t.undone,b1(r.mapping.maps),t.prevTime,t.prevComposition):new hn(t.done,t.undone.addTransform(r,void 0,n,hd(e)),null,t.prevTime,t.prevComposition);if(r.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let a=r.getMeta("composition"),l=t.prevTime==0||!s&&t.prevComposition!=a&&(t.prevTime<(r.time||0)-n.newGroupDelay||!F5(r,t.prevRanges)),c=s?Lh(t.prevRanges,r.mapping):b1(r.mapping.maps);return new hn(t.done.addTransform(r,l?e.selection.getBookmark():void 0,n,hd(e)),br.empty,c,r.time,a??t.prevComposition)}else return (i=r.getMeta("rebased"))?new hn(t.done.rebased(r,i),t.undone.rebased(r,i),Lh(t.prevRanges,r.mapping),t.prevTime,t.prevComposition):new hn(t.done.addMaps(r.mapping.maps),t.undone.addMaps(r.mapping.maps),Lh(t.prevRanges,r.mapping),t.prevTime,t.prevComposition)}function F5(t,e){if(!e)return !1;if(!t.docChanged)return !0;let r=!1;return t.mapping.maps[0].forEach((n,o)=>{for(let i=0;i<e.length;i+=2)n<=e[i+1]&&o>=e[i]&&(r=!0);}),r}function b1(t){let e=[];for(let r=t.length-1;r>=0&&e.length==0;r--)t[r].forEach((n,o,i,s)=>e.push(i,s));return e}function Lh(t,e){if(!t)return null;let r=[];for(let n=0;n<t.length;n+=2){let o=e.map(t[n],1),i=e.map(t[n+1],-1);o<=i&&r.push(o,i);}return r}function z5(t,e,r){let n=hd(e),o=ui.get(e).spec.config,i=(r?t.undone:t.done).popEvent(e,n);if(!i)return null;let s=i.selection.resolve(i.transform.doc),a=(r?t.done:t.undone).addTransform(i.transform,e.selection.getBookmark(),o,n),l=new hn(r?a:i.remaining,r?i.remaining:a,null,0,-1);return i.transform.setSelection(s).setMeta(ui,{redo:r,historyState:l})}var $h=!1,v1=null;function hd(t){let e=t.plugins;if(v1!=e){$h=!1,v1=e;for(let r=0;r<e.length;r++)if(e[r].spec.historyPreserveItems){$h=!0;break}}return $h}var ui=new ae("history"),H5=new ae("closeHistory");function y1(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new oe({key:ui,state:{init(){return new hn(br.empty,br.empty,null,0,-1)},apply(e,r,n){return B5(r,n,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,r){let n=r.inputType,o=n=="historyUndo"?Bh:n=="historyRedo"?Fh:null;return o?(r.preventDefault(),o(e.state,e.dispatch)):!1}}}})}function md(t,e){return (r,n)=>{let o=ui.getState(r);if(!o||(t?o.undone:o.done).eventCount==0)return !1;if(n){let i=z5(o,r,t);i&&n(e?i.scrollIntoView():i);}return !0}}var Bh=md(!1,!0),Fh=md(!0,!0);se.create({name:"characterCount",addOptions(){return {limit:null,mode:"textSize",textCounter:t=>t.length,wordCounter:t=>t.split(" ").filter(e=>e!=="").length}},addStorage(){return {characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=t=>{let e=t?.node||this.editor.state.doc;if((t?.mode||this.options.mode)==="textSize"){let n=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(n)}return e.nodeSize},this.storage.words=t=>{let e=t?.node||this.editor.state.doc,r=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(r)};},addProseMirrorPlugins(){let t=!1;return [new oe({key:new ae("characterCount"),appendTransaction:(e,r,n)=>{if(t)return;let o=this.options.limit;if(o==null||o===0){t=!0;return}let i=this.storage.characters({node:n.doc});if(i>o){let s=i-o,a=0,l=s;console.warn(`[CharacterCount] Initial content exceeded limit of ${o} characters. Content was automatically trimmed.`);let c=n.tr.deleteRange(a,l);return t=!0,c}t=!0;},filterTransaction:(e,r)=>{let n=this.options.limit;if(!e.docChanged||n===0||n===null||n===void 0)return !0;let o=this.storage.characters({node:r.doc}),i=this.storage.characters({node:e.doc});if(i<=n||o>n&&i>n&&i<=o)return !0;if(o>n&&i>n&&i>o||!e.getMeta("paste"))return !1;let a=e.selection.$head.pos,l=i-n,c=a-l,d=a;return e.deleteRange(c,d),!(this.storage.characters({node:e.doc})>n)}})]}});var x1=se.create({name:"dropCursor",addOptions(){return {color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return [h1(this.options)]}});se.create({name:"focus",addOptions(){return {className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return [new oe({key:new ae("focus"),props:{decorations:({doc:t,selection:e})=>{let{isEditable:r,isFocused:n}=this.editor,{anchor:o}=e,i=[];if(!r||!n)return Ee.create(t,[]);let s=0;this.options.mode==="deepest"&&t.descendants((l,c)=>{if(l.isText)return;if(!(o>=c&&o<=c+l.nodeSize-1))return !1;s+=1;});let a=0;return t.descendants((l,c)=>{if(l.isText||!(o>=c&&o<=c+l.nodeSize-1))return !1;if(a+=1,this.options.mode==="deepest"&&s-a>0||this.options.mode==="shallowest"&&a>1)return this.options.mode==="deepest";i.push(Be.node(c,c+l.nodeSize,{class:this.options.className}));}),Ee.create(t,i)}}})]}});var Pa=se.create({name:"gapCursor",addProseMirrorPlugins(){return [m1()]},extendNodeSchema(t){var e;let r={name:t.name,options:t.options,storage:t.storage};return {allowGapCursor:(e=Ie(Q(t,"allowGapCursor",r)))!=null?e:null}}}),zh=se.create({name:"placeholder",addOptions(){return {emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something \u2026",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return [new oe({key:new ae("placeholder"),props:{decorations:({doc:t,selection:e})=>{let r=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:n}=e,o=[];if(!r)return null;let i=this.editor.isEmpty;return t.descendants((s,a)=>{let l=n>=a&&n<=a+s.nodeSize,c=!s.isLeaf&&va(s);if((l||!this.options.showOnlyCurrent)&&c){let d=[this.options.emptyNodeClass];i&&d.push(this.options.emptyEditorClass);let u=Be.node(a,a+s.nodeSize,{class:d.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:s,pos:a,hasAnchor:l}):this.options.placeholder});o.push(u);}return this.options.includeChildren}),Ee.create(t,o)}}})]}});se.create({name:"selection",addOptions(){return {className:"selection"}},addProseMirrorPlugins(){let{editor:t,options:e}=this;return [new oe({key:new ae("selection"),props:{decorations(r){return r.selection.empty||t.isFocused||!t.isEditable||Rc(r.selection)||t.view.dragging?null:Ee.create(r.doc,[Be.inline(r.selection.from,r.selection.to,{class:e.className})])}}})]}});function w1({types:t,node:e}){return e&&Array.isArray(t)&&t.includes(e.type)||e?.type===t}var E1=se.create({name:"trailingNode",addOptions(){return {node:"paragraph",notAfter:[]}},addProseMirrorPlugins(){let t=new ae(this.name),e=Object.entries(this.editor.schema.nodes).map(([,r])=>r).filter(r=>(this.options.notAfter||[]).concat(this.options.node).includes(r.name));return [new oe({key:t,appendTransaction:(r,n,o)=>{let{doc:i,tr:s,schema:a}=o,l=t.getState(o),c=i.content.size,d=a.nodes[this.options.node];if(l)return s.insert(c,d.create())},state:{init:(r,n)=>{let o=n.tr.doc.lastChild;return !w1({node:o,types:e})},apply:(r,n)=>{if(!r.docChanged)return n;let o=r.doc.lastChild;return !w1({node:o,types:e})}}})]}}),k1=se.create({name:"undoRedo",addOptions(){return {depth:100,newGroupDelay:500}},addCommands(){return {undo:()=>({state:t,dispatch:e})=>Bh(t,e),redo:()=>({state:t,dispatch:e})=>Fh(t,e)}},addProseMirrorPlugins(){return [y1(this.options)]},addKeyboardShortcuts(){return {"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-\u044F":()=>this.editor.commands.undo(),"Shift-Mod-\u044F":()=>this.editor.commands.redo()}}});var U5=se.create({name:"starterKit",addExtensions(){var t,e,r,n;let o=[];return this.options.bold!==!1&&o.push(AE.configure(this.options.bold)),this.options.blockquote!==!1&&o.push(ME.configure(this.options.blockquote)),this.options.bulletList!==!1&&o.push(Nh.configure(this.options.bulletList)),this.options.code!==!1&&o.push(OE.configure(this.options.code)),this.options.codeBlock!==!1&&o.push(th.configure(this.options.codeBlock)),this.options.document!==!1&&o.push(PE.configure(this.options.document)),this.options.dropcursor!==!1&&o.push(x1.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&o.push(Pa.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&o.push(IE.configure(this.options.hardBreak)),this.options.heading!==!1&&o.push(LE.configure(this.options.heading)),this.options.undoRedo!==!1&&o.push(k1.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&o.push($E.configure(this.options.horizontalRule)),this.options.italic!==!1&&o.push(BE.configure(this.options.italic)),this.options.listItem!==!1&&o.push(_h.configure(this.options.listItem)),this.options.listKeymap!==!1&&o.push(Ah.configure((t=this.options)==null?void 0:t.listKeymap)),this.options.link!==!1&&o.push(Ch.configure((e=this.options)==null?void 0:e.link)),this.options.orderedList!==!1&&o.push(Oh.configure(this.options.orderedList)),this.options.paragraph!==!1&&o.push(d1.configure(this.options.paragraph)),this.options.strike!==!1&&o.push(u1.configure(this.options.strike)),this.options.text!==!1&&o.push(f1.configure(this.options.text)),this.options.underline!==!1&&o.push(Dh.configure((r=this.options)==null?void 0:r.underline)),this.options.trailingNode!==!1&&o.push(E1.configure((n=this.options)==null?void 0:n.trailingNode)),o}}),S1=U5;var C1=zh;var V5=se.create({name:"textAlign",addOptions(){return {types:[],alignments:["left","center","right","justify"],defaultAlignment:null}},addGlobalAttributes(){return [{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:t=>{let e=t.style.textAlign;return this.options.alignments.includes(e)?e:this.options.defaultAlignment},renderHTML:t=>t.textAlign?{style:`text-align: ${t.textAlign}`}:{}}}}]},addCommands(){return {setTextAlign:t=>({commands:e})=>this.options.alignments.includes(t)?this.options.types.map(r=>e.updateAttributes(r,{textAlign:t})).every(r=>r):!1,unsetTextAlign:()=>({commands:t})=>this.options.types.map(e=>t.resetAttributes(e,"textAlign")).every(e=>e),toggleTextAlign:t=>({editor:e,commands:r})=>this.options.alignments.includes(t)?e.isActive({textAlign:t})?r.unsetTextAlign():r.setTextAlign(t):!1}},addKeyboardShortcuts(){return {"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),R1=V5;var K5=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,W5=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,G5=Pt.create({name:"highlight",addOptions(){return {multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:t=>t.getAttribute("data-color")||t.style.backgroundColor,renderHTML:t=>t.color?{"data-color":t.color,style:`background-color: ${t.color}; color: inherit`}:{}}}:{}},parseHTML(){return [{tag:"mark"}]},renderHTML({HTMLAttributes:t}){return ["mark",ie(this.options.HTMLAttributes,t),0]},addCommands(){return {setHighlight:t=>({commands:e})=>e.setMark(this.name,t),toggleHighlight:t=>({commands:e})=>e.toggleMark(this.name,t),unsetHighlight:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return {"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return [Mr({find:K5,type:this.type})]},addPasteRules(){return [dr({find:W5,type:this.type})]}}),T1=G5;var q5=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,j5=Ne.create({name:"image",addOptions(){return {inline:!1,allowBase64:!1,HTMLAttributes:{}}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return {src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}},parseHTML(){return [{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:t}){return ["img",ie(this.options.HTMLAttributes,t)]},addCommands(){return {setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return [Nc({find:q5,type:this.type,getAttributes:t=>{let[,,e,r,n]=t;return {src:r,alt:e,title:n}}})]}}),N1=j5;var Uh,Vh;if(typeof WeakMap<"u"){let t=new WeakMap;Uh=e=>t.get(e),Vh=(e,r)=>(t.set(e,r),r);}else {let t=[],r=0;Uh=n=>{for(let o=0;o<t.length;o+=2)if(t[o]==n)return t[o+1]},Vh=(n,o)=>(r==10&&(r=0),t[r++]=n,t[r++]=o);}var ct=class{constructor(t,e,r,n){this.width=t,this.height=e,this.map=r,this.problems=n;}findCell(t){for(let e=0;e<this.map.length;e++){let r=this.map[e];if(r!=t)continue;let n=e%this.width,o=e/this.width|0,i=n+1,s=o+1;for(let a=1;i<this.width&&this.map[e+a]==r;a++)i++;for(let a=1;s<this.height&&this.map[e+this.width*a]==r;a++)s++;return {left:n,top:o,right:i,bottom:s}}throw new RangeError(`No cell with offset ${t} found`)}colCount(t){for(let e=0;e<this.map.length;e++)if(this.map[e]==t)return e%this.width;throw new RangeError(`No cell with offset ${t} found`)}nextCell(t,e,r){let{left:n,right:o,top:i,bottom:s}=this.findCell(t);return e=="horiz"?(r<0?n==0:o==this.width)?null:this.map[i*this.width+(r<0?n-1:o)]:(r<0?i==0:s==this.height)?null:this.map[n+this.width*(r<0?i-1:s)]}rectBetween(t,e){let{left:r,right:n,top:o,bottom:i}=this.findCell(t),{left:s,right:a,top:l,bottom:c}=this.findCell(e);return {left:Math.min(r,s),top:Math.min(o,l),right:Math.max(n,a),bottom:Math.max(i,c)}}cellsInRect(t){let e=[],r={};for(let n=t.top;n<t.bottom;n++)for(let o=t.left;o<t.right;o++){let i=n*this.width+o,s=this.map[i];r[s]||(r[s]=!0,!(o==t.left&&o&&this.map[i-1]==s||n==t.top&&n&&this.map[i-this.width]==s)&&e.push(s));}return e}positionAt(t,e,r){for(let n=0,o=0;;n++){let i=o+r.child(n).nodeSize;if(n==t){let s=e+t*this.width,a=(t+1)*this.width;for(;s<a&&this.map[s]<o;)s++;return s==a?i-1:this.map[s]}o=i;}}static get(t){return Uh(t)||Vh(t,Y5(t))}};function Y5(t){if(t.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+t.type.name);let e=X5(t),r=t.childCount,n=[],o=0,i=null,s=[];for(let c=0,d=e*r;c<d;c++)n[c]=0;for(let c=0,d=0;c<r;c++){let u=t.child(c);d++;for(let h=0;;h++){for(;o<n.length&&n[o]!=0;)o++;if(h==u.childCount)break;let m=u.child(h),{colspan:g,rowspan:b,colwidth:v}=m.attrs;for(let y=0;y<b;y++){if(y+c>=r){(i||(i=[])).push({type:"overlong_rowspan",pos:d,n:b-y});break}let x=o+y*e;for(let E=0;E<g;E++){n[x+E]==0?n[x+E]=d:(i||(i=[])).push({type:"collision",row:c,pos:d,n:g-E});let S=v&&v[E];if(S){let R=(x+E)%e*2,w=s[R];w==null||w!=S&&s[R+1]==1?(s[R]=S,s[R+1]=1):w==S&&s[R+1]++;}}}o+=g,d+=m.nodeSize;}let f=(c+1)*e,p=0;for(;o<f;)n[o++]==0&&p++;p&&(i||(i=[])).push({type:"missing",row:c,n:p}),d++;}(e===0||r===0)&&(i||(i=[])).push({type:"zero_sized"});let a=new ct(e,r,n,i),l=!1;for(let c=0;!l&&c<s.length;c+=2)s[c]!=null&&s[c+1]<r&&(l=!0);return l&&J5(a,s,t),a}function X5(t){let e=-1,r=!1;for(let n=0;n<t.childCount;n++){let o=t.child(n),i=0;if(r)for(let s=0;s<n;s++){let a=t.child(s);for(let l=0;l<a.childCount;l++){let c=a.child(l);s+c.attrs.rowspan>n&&(i+=c.attrs.colspan);}}for(let s=0;s<o.childCount;s++){let a=o.child(s);i+=a.attrs.colspan,a.attrs.rowspan>1&&(r=!0);}e==-1?e=i:e!=i&&(e=Math.max(e,i));}return e}function J5(t,e,r){t.problems||(t.problems=[]);let n={};for(let o=0;o<t.map.length;o++){let i=t.map[o];if(n[i])continue;n[i]=!0;let s=r.nodeAt(i);if(!s)throw new RangeError(`No cell with offset ${i} found`);let a=null,l=s.attrs;for(let c=0;c<l.colspan;c++){let d=(o+c)%t.width,u=e[d*2];u!=null&&(!l.colwidth||l.colwidth[c]!=u)&&((a||(a=Z5(l)))[c]=u);}a&&t.problems.unshift({type:"colwidth mismatch",pos:i,colwidth:a});}}function Z5(t){if(t.colwidth)return t.colwidth.slice();let e=[];for(let r=0;r<t.colspan;r++)e.push(0);return e}function jt(t){let e=t.cached.tableNodeTypes;if(!e){e=t.cached.tableNodeTypes={};for(let r in t.nodes){let n=t.nodes[r],o=n.spec.tableRole;o&&(e[o]=n);}}return e}var go=new ae("selectingCells");function us(t){for(let e=t.depth-1;e>0;e--)if(t.node(e).type.spec.tableRole=="row")return t.node(0).resolve(t.before(e+1));return null}function Q5(t){for(let e=t.depth;e>0;e--){let r=t.node(e).type.spec.tableRole;if(r==="cell"||r==="header_cell")return t.node(e)}return null}function Gr(t){let e=t.selection.$head;for(let r=e.depth;r>0;r--)if(e.node(r).type.spec.tableRole=="row")return !0;return !1}function xd(t){let e=t.selection;if("$anchorCell"in e&&e.$anchorCell)return e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell;if("node"in e&&e.node&&e.node.type.spec.tableRole=="cell")return e.$anchor;let r=us(e.$head)||e$(e.$head);if(r)return r;throw new RangeError(`No cell found around position ${e.head}`)}function e$(t){for(let e=t.nodeAfter,r=t.pos;e;e=e.firstChild,r++){let n=e.type.spec.tableRole;if(n=="cell"||n=="header_cell")return t.doc.resolve(r)}for(let e=t.nodeBefore,r=t.pos;e;e=e.lastChild,r--){let n=e.type.spec.tableRole;if(n=="cell"||n=="header_cell")return t.doc.resolve(r-e.nodeSize)}}function Kh(t){return t.parent.type.spec.tableRole=="row"&&!!t.nodeAfter}function t$(t){return t.node(0).resolve(t.pos+t.nodeAfter.nodeSize)}function qh(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function B1(t,e,r){let n=t.node(-1),o=ct.get(n),i=t.start(-1),s=o.nextCell(t.pos-i,e,r);return s==null?null:t.node(0).resolve(i+s)}function fi(t,e,r=1){let n={...t,colspan:t.colspan-r};return n.colwidth&&(n.colwidth=n.colwidth.slice(),n.colwidth.splice(e,r),n.colwidth.some(o=>o>0)||(n.colwidth=null)),n}function F1(t,e,r=1){let n={...t,colspan:t.colspan+r};if(n.colwidth){n.colwidth=n.colwidth.slice();for(let o=0;o<r;o++)n.colwidth.splice(e,0,0);}return n}function r$(t,e,r){let n=jt(e.type.schema).header_cell;for(let o=0;o<t.height;o++)if(e.nodeAt(t.map[r+o*t.width]).type!=n)return !1;return !0}var Fe=class Vn extends Z{constructor(e,r=e){let n=e.node(-1),o=ct.get(n),i=e.start(-1),s=o.rectBetween(e.pos-i,r.pos-i),a=e.node(0),l=o.cellsInRect(s).filter(d=>d!=r.pos-i);l.unshift(r.pos-i);let c=l.map(d=>{let u=n.nodeAt(d);if(!u)throw RangeError(`No cell with offset ${d} found`);let f=i+d+1;return new Yi(a.resolve(f),a.resolve(f+u.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=e,this.$headCell=r;}map(e,r){let n=e.resolve(r.map(this.$anchorCell.pos)),o=e.resolve(r.map(this.$headCell.pos));if(Kh(n)&&Kh(o)&&qh(n,o)){let i=this.$anchorCell.node(-1)!=n.node(-1);return i&&this.isRowSelection()?Vn.rowSelection(n,o):i&&this.isColSelection()?Vn.colSelection(n,o):new Vn(n,o)}return q.between(n,o)}content(){let e=this.$anchorCell.node(-1),r=ct.get(e),n=this.$anchorCell.start(-1),o=r.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),i={},s=[];for(let l=o.top;l<o.bottom;l++){let c=[];for(let d=l*r.width+o.left,u=o.left;u<o.right;u++,d++){let f=r.map[d];if(i[f])continue;i[f]=!0;let p=r.findCell(f),h=e.nodeAt(f);if(!h)throw RangeError(`No cell with offset ${f} found`);let m=o.left-p.left,g=p.right-o.right;if(m>0||g>0){let b=h.attrs;if(m>0&&(b=fi(b,0,m)),g>0&&(b=fi(b,b.colspan-g,g)),p.left<o.left){if(h=h.type.createAndFill(b),!h)throw RangeError(`Could not create cell with attrs ${JSON.stringify(b)}`)}else h=h.type.create(b,h.content);}if(p.top<o.top||p.bottom>o.bottom){let b={...h.attrs,rowspan:Math.min(p.bottom,o.bottom)-Math.max(p.top,o.top)};p.top<o.top?h=h.type.createAndFill(b):h=h.type.create(b,h.content);}c.push(h);}s.push(e.child(l).copy(O.from(c)));}let a=this.isColSelection()&&this.isRowSelection()?e:s;return new H(O.from(a),1,1)}replace(e,r=H.empty){let n=e.steps.length,o=this.ranges;for(let s=0;s<o.length;s++){let{$from:a,$to:l}=o[s],c=e.mapping.slice(n);e.replace(c.map(a.pos),c.map(l.pos),s?H.empty:r);}let i=Z.findFrom(e.doc.resolve(e.mapping.slice(n).map(this.to)),-1);i&&e.setSelection(i);}replaceWith(e,r){this.replace(e,new H(O.from(r),0,0));}forEachCell(e){let r=this.$anchorCell.node(-1),n=ct.get(r),o=this.$anchorCell.start(-1),i=n.cellsInRect(n.rectBetween(this.$anchorCell.pos-o,this.$headCell.pos-o));for(let s=0;s<i.length;s++)e(r.nodeAt(i[s]),o+i[s]);}isColSelection(){let e=this.$anchorCell.index(-1),r=this.$headCell.index(-1);if(Math.min(e,r)>0)return !1;let n=e+this.$anchorCell.nodeAfter.attrs.rowspan,o=r+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,o)==this.$headCell.node(-1).childCount}static colSelection(e,r=e){let n=e.node(-1),o=ct.get(n),i=e.start(-1),s=o.findCell(e.pos-i),a=o.findCell(r.pos-i),l=e.node(0);return s.top<=a.top?(s.top>0&&(e=l.resolve(i+o.map[s.left])),a.bottom<o.height&&(r=l.resolve(i+o.map[o.width*(o.height-1)+a.right-1]))):(a.top>0&&(r=l.resolve(i+o.map[a.left])),s.bottom<o.height&&(e=l.resolve(i+o.map[o.width*(o.height-1)+s.right-1]))),new Vn(e,r)}isRowSelection(){let e=this.$anchorCell.node(-1),r=ct.get(e),n=this.$anchorCell.start(-1),o=r.colCount(this.$anchorCell.pos-n),i=r.colCount(this.$headCell.pos-n);if(Math.min(o,i)>0)return !1;let s=o+this.$anchorCell.nodeAfter.attrs.colspan,a=i+this.$headCell.nodeAfter.attrs.colspan;return Math.max(s,a)==r.width}eq(e){return e instanceof Vn&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,r=e){let n=e.node(-1),o=ct.get(n),i=e.start(-1),s=o.findCell(e.pos-i),a=o.findCell(r.pos-i),l=e.node(0);return s.left<=a.left?(s.left>0&&(e=l.resolve(i+o.map[s.top*o.width])),a.right<o.width&&(r=l.resolve(i+o.map[o.width*(a.top+1)-1]))):(a.left>0&&(r=l.resolve(i+o.map[a.top*o.width])),s.right<o.width&&(e=l.resolve(i+o.map[o.width*(s.top+1)-1]))),new Vn(e,r)}toJSON(){return {type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(e,r){return new Vn(e.resolve(r.anchor),e.resolve(r.head))}static create(e,r,n=r){return new Vn(e.resolve(r),e.resolve(n))}getBookmark(){return new n$(this.$anchorCell.pos,this.$headCell.pos)}};Fe.prototype.visible=!1;Z.jsonID("cell",Fe);var n$=class z1{constructor(e,r){this.anchor=e,this.head=r;}map(e){return new z1(e.map(this.anchor),e.map(this.head))}resolve(e){let r=e.resolve(this.anchor),n=e.resolve(this.head);return r.parent.type.spec.tableRole=="row"&&n.parent.type.spec.tableRole=="row"&&r.index()<r.parent.childCount&&n.index()<n.parent.childCount&&qh(r,n)?new Fe(r,n):Z.near(n,1)}};function o$(t){if(!(t.selection instanceof Fe))return null;let e=[];return t.selection.forEachCell((r,n)=>{e.push(Be.node(n,n+r.nodeSize,{class:"selectedCell"}));}),Ee.create(t.doc,e)}function i$({$from:t,$to:e}){if(t.pos==e.pos||t.pos<e.pos-6)return !1;let r=t.pos,n=e.pos,o=t.depth;for(;o>=0&&!(t.after(o+1)<t.end(o));o--,r++);for(let i=e.depth;i>=0&&!(e.before(i+1)>e.start(i));i--,n--);return r==n&&/row|table/.test(t.node(o).type.spec.tableRole)}function s$({$from:t,$to:e}){let r,n;for(let o=t.depth;o>0;o--){let i=t.node(o);if(i.type.spec.tableRole==="cell"||i.type.spec.tableRole==="header_cell"){r=i;break}}for(let o=e.depth;o>0;o--){let i=e.node(o);if(i.type.spec.tableRole==="cell"||i.type.spec.tableRole==="header_cell"){n=i;break}}return r!==n&&e.parentOffset===0}function a$(t,e,r){let n=(e||t).selection,o=(e||t).doc,i,s;if(n instanceof X&&(s=n.node.type.spec.tableRole)){if(s=="cell"||s=="header_cell")i=Fe.create(o,n.from);else if(s=="row"){let a=o.resolve(n.from+1);i=Fe.rowSelection(a,a);}else if(!r){let a=ct.get(n.node),l=n.from+1,c=l+a.map[a.width*a.height-1];i=Fe.create(o,l+1,c);}}else n instanceof q&&i$(n)?i=q.create(o,n.from):n instanceof q&&s$(n)&&(i=q.create(o,n.$from.start(),n.$from.end()));return i&&(e||(e=t.tr)).setSelection(i),e}var l$=new ae("fix-tables");function H1(t,e,r,n){let o=t.childCount,i=e.childCount;e:for(let s=0,a=0;s<i;s++){let l=e.child(s);for(let c=a,d=Math.min(o,s+3);c<d;c++)if(t.child(c)==l){a=c+1,r+=l.nodeSize;continue e}n(l,r),a<o&&t.child(a).sameMarkup(l)?H1(t.child(a),l,r+1,n):l.nodesBetween(0,l.content.size,n,r+1),r+=l.nodeSize;}}function jh(t,e){let r,n=(o,i)=>{o.type.spec.tableRole=="table"&&(r=c$(t,o,i,r));};return e?e.doc!=t.doc&&H1(e.doc,t.doc,0,n):t.doc.descendants(n),r}function c$(t,e,r,n){let o=ct.get(e);if(!o.problems)return n;n||(n=t.tr);let i=[];for(let l=0;l<o.height;l++)i.push(0);for(let l=0;l<o.problems.length;l++){let c=o.problems[l];if(c.type=="collision"){let d=e.nodeAt(c.pos);if(!d)continue;let u=d.attrs;for(let f=0;f<u.rowspan;f++)i[c.row+f]+=c.n;n.setNodeMarkup(n.mapping.map(r+1+c.pos),null,fi(u,u.colspan-c.n,c.n));}else if(c.type=="missing")i[c.row]+=c.n;else if(c.type=="overlong_rowspan"){let d=e.nodeAt(c.pos);if(!d)continue;n.setNodeMarkup(n.mapping.map(r+1+c.pos),null,{...d.attrs,rowspan:d.attrs.rowspan-c.n});}else if(c.type=="colwidth mismatch"){let d=e.nodeAt(c.pos);if(!d)continue;n.setNodeMarkup(n.mapping.map(r+1+c.pos),null,{...d.attrs,colwidth:c.colwidth});}else if(c.type=="zero_sized"){let d=n.mapping.map(r);n.delete(d,d+e.nodeSize);}}let s,a;for(let l=0;l<i.length;l++)i[l]&&(s==null&&(s=l),a=l);for(let l=0,c=r+1;l<o.height;l++){let d=e.child(l),u=c+d.nodeSize,f=i[l];if(f>0){let p="cell";d.firstChild&&(p=d.firstChild.type.spec.tableRole);let h=[];for(let g=0;g<f;g++){let b=jt(t.schema)[p].createAndFill();b&&h.push(b);}let m=(l==0||s==l-1)&&a==l?c+1:u-1;n.insert(n.mapping.map(m),h);}c=u;}return n.setMeta(l$,{fixTables:!0})}function mn(t){let e=t.selection,r=xd(t),n=r.node(-1),o=r.start(-1),i=ct.get(n);return {...e instanceof Fe?i.rectBetween(e.$anchorCell.pos-o,e.$headCell.pos-o):i.findCell(r.pos-o),tableStart:o,map:i,table:n}}function U1(t,{map:e,tableStart:r,table:n},o){let i=o>0?-1:0;r$(e,n,o+i)&&(i=o==0||o==e.width?null:0);for(let s=0;s<e.height;s++){let a=s*e.width+o;if(o>0&&o<e.width&&e.map[a-1]==e.map[a]){let l=e.map[a],c=n.nodeAt(l);t.setNodeMarkup(t.mapping.map(r+l),null,F1(c.attrs,o-e.colCount(l))),s+=c.attrs.rowspan-1;}else {let l=i==null?jt(n.type.schema).cell:n.nodeAt(e.map[a+i]).type,c=e.positionAt(s,o,n);t.insert(t.mapping.map(r+c),l.createAndFill());}}return t}function V1(t,e){if(!Gr(t))return !1;if(e){let r=mn(t);e(U1(t.tr,r,r.left));}return !0}function K1(t,e){if(!Gr(t))return !1;if(e){let r=mn(t);e(U1(t.tr,r,r.right));}return !0}function d$(t,{map:e,table:r,tableStart:n},o){let i=t.mapping.maps.length;for(let s=0;s<e.height;){let a=s*e.width+o,l=e.map[a],c=r.nodeAt(l),d=c.attrs;if(o>0&&e.map[a-1]==l||o<e.width-1&&e.map[a+1]==l)t.setNodeMarkup(t.mapping.slice(i).map(n+l),null,fi(d,o-e.colCount(l)));else {let u=t.mapping.slice(i).map(n+l);t.delete(u,u+c.nodeSize);}s+=d.rowspan;}}function W1(t,e){if(!Gr(t))return !1;if(e){let r=mn(t),n=t.tr;if(r.left==0&&r.right==r.map.width)return !1;for(let o=r.right-1;d$(n,r,o),o!=r.left;o--){let i=r.tableStart?n.doc.nodeAt(r.tableStart-1):n.doc;if(!i)throw RangeError("No table found");r.table=i,r.map=ct.get(i);}e(n);}return !0}function u$(t,e,r){var n;let o=jt(e.type.schema).header_cell;for(let i=0;i<t.width;i++)if(((n=e.nodeAt(t.map[i+r*t.width]))==null?void 0:n.type)!=o)return !1;return !0}function G1(t,{map:e,tableStart:r,table:n},o){var i;let s=r;for(let c=0;c<o;c++)s+=n.child(c).nodeSize;let a=[],l=o>0?-1:0;u$(e,n,o+l)&&(l=o==0||o==e.height?null:0);for(let c=0,d=e.width*o;c<e.width;c++,d++)if(o>0&&o<e.height&&e.map[d]==e.map[d-e.width]){let u=e.map[d],f=n.nodeAt(u).attrs;t.setNodeMarkup(r+u,null,{...f,rowspan:f.rowspan+1}),c+=f.colspan-1;}else {let u=l==null?jt(n.type.schema).cell:(i=n.nodeAt(e.map[d+l*e.width]))==null?void 0:i.type,f=u?.createAndFill();f&&a.push(f);}return t.insert(s,jt(n.type.schema).row.create(null,a)),t}function q1(t,e){if(!Gr(t))return !1;if(e){let r=mn(t);e(G1(t.tr,r,r.top));}return !0}function j1(t,e){if(!Gr(t))return !1;if(e){let r=mn(t);e(G1(t.tr,r,r.bottom));}return !0}function f$(t,{map:e,table:r,tableStart:n},o){let i=0;for(let c=0;c<o;c++)i+=r.child(c).nodeSize;let s=i+r.child(o).nodeSize,a=t.mapping.maps.length;t.delete(i+n,s+n);let l=new Set;for(let c=0,d=o*e.width;c<e.width;c++,d++){let u=e.map[d];if(!l.has(u)){if(l.add(u),o>0&&u==e.map[d-e.width]){let f=r.nodeAt(u).attrs;t.setNodeMarkup(t.mapping.slice(a).map(u+n),null,{...f,rowspan:f.rowspan-1}),c+=f.colspan-1;}else if(o<e.height&&u==e.map[d+e.width]){let f=r.nodeAt(u),p=f.attrs,h=f.type.create({...p,rowspan:f.attrs.rowspan-1},f.content),m=e.positionAt(o+1,c,r);t.insert(t.mapping.slice(a).map(n+m),h),c+=p.colspan-1;}}}}function Y1(t,e){if(!Gr(t))return !1;if(e){let r=mn(t),n=t.tr;if(r.top==0&&r.bottom==r.map.height)return !1;for(let o=r.bottom-1;f$(n,r,o),o!=r.top;o--){let i=r.tableStart?n.doc.nodeAt(r.tableStart-1):n.doc;if(!i)throw RangeError("No table found");r.table=i,r.map=ct.get(r.table);}e(n);}return !0}function _1(t){let e=t.content;return e.childCount==1&&e.child(0).isTextblock&&e.child(0).childCount==0}function p$({width:t,height:e,map:r},n){let o=n.top*t+n.left,i=o,s=(n.bottom-1)*t+n.left,a=o+(n.right-n.left-1);for(let l=n.top;l<n.bottom;l++){if(n.left>0&&r[i]==r[i-1]||n.right<t&&r[a]==r[a+1])return !0;i+=t,a+=t;}for(let l=n.left;l<n.right;l++){if(n.top>0&&r[o]==r[o-t]||n.bottom<e&&r[s]==r[s+t])return !0;o++,s++;}return !1}function Yh(t,e){let r=t.selection;if(!(r instanceof Fe)||r.$anchorCell.pos==r.$headCell.pos)return !1;let n=mn(t),{map:o}=n;if(p$(o,n))return !1;if(e){let i=t.tr,s={},a=O.empty,l,c;for(let d=n.top;d<n.bottom;d++)for(let u=n.left;u<n.right;u++){let f=o.map[d*o.width+u],p=n.table.nodeAt(f);if(!(s[f]||!p))if(s[f]=!0,l==null)l=f,c=p;else {_1(p)||(a=a.append(p.content));let h=i.mapping.map(f+n.tableStart);i.delete(h,h+p.nodeSize);}}if(l==null||c==null)return !0;if(i.setNodeMarkup(l+n.tableStart,null,{...F1(c.attrs,c.attrs.colspan,n.right-n.left-c.attrs.colspan),rowspan:n.bottom-n.top}),a.size){let d=l+1+c.content.size,u=_1(c)?l+1:d;i.replaceWith(u+n.tableStart,d+n.tableStart,a);}i.setSelection(new Fe(i.doc.resolve(l+n.tableStart))),e(i);}return !0}function Xh(t,e){let r=jt(t.schema);return h$(({node:n})=>r[n.type.spec.tableRole])(t,e)}function h$(t){return (e,r)=>{var n;let o=e.selection,i,s;if(o instanceof Fe){if(o.$anchorCell.pos!=o.$headCell.pos)return !1;i=o.$anchorCell.nodeAfter,s=o.$anchorCell.pos;}else {if(i=Q5(o.$from),!i)return !1;s=(n=us(o.$from))==null?void 0:n.pos;}if(i==null||s==null||i.attrs.colspan==1&&i.attrs.rowspan==1)return !1;if(r){let a=i.attrs,l=[],c=a.colwidth;a.rowspan>1&&(a={...a,rowspan:1}),a.colspan>1&&(a={...a,colspan:1});let d=mn(e),u=e.tr;for(let p=0;p<d.right-d.left;p++)l.push(c?{...a,colwidth:c&&c[p]?[c[p]]:null}:a);let f;for(let p=d.top;p<d.bottom;p++){let h=d.map.positionAt(p,d.left,d.table);p==d.top&&(h+=i.nodeSize);for(let m=d.left,g=0;m<d.right;m++,g++)m==d.left&&p==d.top||u.insert(f=u.mapping.map(h+d.tableStart,1),t({node:i,row:p,col:m}).createAndFill(l[g]));}u.setNodeMarkup(s,t({node:i,row:d.top,col:d.left}),l[0]),o instanceof Fe&&u.setSelection(new Fe(u.doc.resolve(o.$anchorCell.pos),f?u.doc.resolve(f):void 0)),r(u);}return !0}}function X1(t,e){return function(r,n){if(!Gr(r))return !1;let o=xd(r);if(o.nodeAfter.attrs[t]===e)return !1;if(n){let i=r.tr;r.selection instanceof Fe?r.selection.forEachCell((s,a)=>{s.attrs[t]!==e&&i.setNodeMarkup(a,null,{...s.attrs,[t]:e});}):i.setNodeMarkup(o.pos,null,{...o.nodeAfter.attrs,[t]:e}),n(i);}return !0}}function m$(t){return function(e,r){if(!Gr(e))return !1;if(r){let n=jt(e.schema),o=mn(e),i=e.tr,s=o.map.cellsInRect(t=="column"?{left:o.left,top:0,right:o.right,bottom:o.map.height}:t=="row"?{left:0,top:o.top,right:o.map.width,bottom:o.bottom}:o),a=s.map(l=>o.table.nodeAt(l));for(let l=0;l<s.length;l++)a[l].type==n.header_cell&&i.setNodeMarkup(o.tableStart+s[l],n.cell,a[l].attrs);if(i.steps.length==0)for(let l=0;l<s.length;l++)i.setNodeMarkup(o.tableStart+s[l],n.header_cell,a[l].attrs);r(i);}return !0}}function M1(t,e,r){let n=e.map.cellsInRect({left:0,top:0,right:t=="row"?e.map.width:1,bottom:t=="column"?e.map.height:1});for(let o=0;o<n.length;o++){let i=e.table.nodeAt(n[o]);if(i&&i.type!==r.header_cell)return !1}return !0}function fs(t,e){return e=e||{useDeprecatedLogic:!1},e.useDeprecatedLogic?m$(t):function(r,n){if(!Gr(r))return !1;if(n){let o=jt(r.schema),i=mn(r),s=r.tr,a=M1("row",i,o),l=M1("column",i,o),d=(t==="column"?a:t==="row"?l:!1)?1:0,u=t=="column"?{left:0,top:d,right:1,bottom:i.map.height}:t=="row"?{left:d,top:0,right:i.map.width,bottom:1}:i,f=t=="column"?l?o.cell:o.header_cell:t=="row"?a?o.cell:o.header_cell:o.cell;i.map.cellsInRect(u).forEach(p=>{let h=p+i.tableStart,m=s.doc.nodeAt(h);m&&s.setNodeMarkup(h,f,m.attrs);}),n(s);}return !0}}fs("row",{useDeprecatedLogic:!0});fs("column",{useDeprecatedLogic:!0});var J1=fs("cell",{useDeprecatedLogic:!0});function g$(t,e){if(e<0){let r=t.nodeBefore;if(r)return t.pos-r.nodeSize;for(let n=t.index(-1)-1,o=t.before();n>=0;n--){let i=t.node(-1).child(n),s=i.lastChild;if(s)return o-1-s.nodeSize;o-=i.nodeSize;}}else {if(t.index()<t.parent.childCount-1)return t.pos+t.nodeAfter.nodeSize;let r=t.node(-1);for(let n=t.indexAfter(-1),o=t.after();n<r.childCount;n++){let i=r.child(n);if(i.childCount)return o+1;o+=i.nodeSize;}}return null}function Jh(t){return function(e,r){if(!Gr(e))return !1;let n=g$(xd(e),t);if(n==null)return !1;if(r){let o=e.doc.resolve(n);r(e.tr.setSelection(q.between(o,t$(o))).scrollIntoView());}return !0}}function Z1(t,e){let r=t.selection.$anchor;for(let n=r.depth;n>0;n--)if(r.node(n).type.spec.tableRole=="table")return e&&e(t.tr.delete(r.before(n),r.after(n)).scrollIntoView()),!0;return !1}function gd(t,e){let r=t.selection;if(!(r instanceof Fe))return !1;if(e){let n=t.tr,o=jt(t.schema).cell.createAndFill().content;r.forEachCell((i,s)=>{i.content.eq(o)||n.replace(n.mapping.map(s+1),n.mapping.map(s+i.nodeSize-1),new H(o,0,0));}),n.docChanged&&e(n);}return !0}function b$(t){if(!t.size)return null;let{content:e,openStart:r,openEnd:n}=t;for(;e.childCount==1&&(r>0&&n>0||e.child(0).type.spec.tableRole=="table");)r--,n--,e=e.child(0).content;let o=e.child(0),i=o.type.spec.tableRole,s=o.type.schema,a=[];if(i=="row")for(let l=0;l<e.childCount;l++){let c=e.child(l).content,d=l?0:Math.max(0,r-1),u=l<e.childCount-1?0:Math.max(0,n-1);(d||u)&&(c=Wh(jt(s).row,new H(c,d,u)).content),a.push(c);}else if(i=="cell"||i=="header_cell")a.push(r||n?Wh(jt(s).row,new H(e,r,n)).content:e);else return null;return v$(s,a)}function v$(t,e){let r=[];for(let o=0;o<e.length;o++){let i=e[o];for(let s=i.childCount-1;s>=0;s--){let{rowspan:a,colspan:l}=i.child(s).attrs;for(let c=o;c<o+a;c++)r[c]=(r[c]||0)+l;}}let n=0;for(let o=0;o<r.length;o++)n=Math.max(n,r[o]);for(let o=0;o<r.length;o++)if(o>=e.length&&e.push(O.empty),r[o]<n){let i=jt(t).cell.createAndFill(),s=[];for(let a=r[o];a<n;a++)s.push(i);e[o]=e[o].append(O.from(s));}return {height:e.length,width:n,rows:e}}function Wh(t,e){let r=t.createAndFill();return new io(r).replace(0,r.content.size,e).doc}function y$({width:t,height:e,rows:r},n,o){if(t!=n){let i=[],s=[];for(let a=0;a<r.length;a++){let l=r[a],c=[];for(let d=i[a]||0,u=0;d<n;u++){let f=l.child(u%l.childCount);d+f.attrs.colspan>n&&(f=f.type.createChecked(fi(f.attrs,f.attrs.colspan,d+f.attrs.colspan-n),f.content)),c.push(f),d+=f.attrs.colspan;for(let p=1;p<f.attrs.rowspan;p++)i[a+p]=(i[a+p]||0)+f.attrs.colspan;}s.push(O.from(c));}r=s,t=n;}if(e!=o){let i=[];for(let s=0,a=0;s<o;s++,a++){let l=[],c=r[a%e];for(let d=0;d<c.childCount;d++){let u=c.child(d);s+u.attrs.rowspan>o&&(u=u.type.create({...u.attrs,rowspan:Math.max(1,o-u.attrs.rowspan)},u.content)),l.push(u);}i.push(O.from(l));}r=i,e=o;}return {width:t,height:e,rows:r}}function w$(t,e,r,n,o,i,s){let a=t.doc.type.schema,l=jt(a),c,d;if(o>e.width)for(let u=0,f=0;u<e.height;u++){let p=r.child(u);f+=p.nodeSize;let h=[],m;p.lastChild==null||p.lastChild.type==l.cell?m=c||(c=l.cell.createAndFill()):m=d||(d=l.header_cell.createAndFill());for(let g=e.width;g<o;g++)h.push(m);t.insert(t.mapping.slice(s).map(f-1+n),h);}if(i>e.height){let u=[];for(let h=0,m=(e.height-1)*e.width;h<Math.max(e.width,o);h++){let g=h>=e.width?!1:r.nodeAt(e.map[m+h]).type==l.header_cell;u.push(g?d||(d=l.header_cell.createAndFill()):c||(c=l.cell.createAndFill()));}let f=l.row.create(null,O.from(u)),p=[];for(let h=e.height;h<i;h++)p.push(f);t.insert(t.mapping.slice(s).map(n+r.nodeSize-2),p);}return !!(c||d)}function A1(t,e,r,n,o,i,s,a){if(s==0||s==e.height)return !1;let l=!1;for(let c=o;c<i;c++){let d=s*e.width+c,u=e.map[d];if(e.map[d-e.width]==u){l=!0;let f=r.nodeAt(u),{top:p,left:h}=e.findCell(u);t.setNodeMarkup(t.mapping.slice(a).map(u+n),null,{...f.attrs,rowspan:s-p}),t.insert(t.mapping.slice(a).map(e.positionAt(s,h,r)),f.type.createAndFill({...f.attrs,rowspan:p+f.attrs.rowspan-s})),c+=f.attrs.colspan-1;}}return l}function O1(t,e,r,n,o,i,s,a){if(s==0||s==e.width)return !1;let l=!1;for(let c=o;c<i;c++){let d=c*e.width+s,u=e.map[d];if(e.map[d-1]==u){l=!0;let f=r.nodeAt(u),p=e.colCount(u),h=t.mapping.slice(a).map(u+n);t.setNodeMarkup(h,null,fi(f.attrs,s-p,f.attrs.colspan-(s-p))),t.insert(h+f.nodeSize,f.type.createAndFill(fi(f.attrs,0,s-p))),c+=f.attrs.rowspan-1;}}return l}function D1(t,e,r,n,o){let i=r?t.doc.nodeAt(r-1):t.doc;if(!i)throw new Error("No table found");let s=ct.get(i),{top:a,left:l}=n,c=l+o.width,d=a+o.height,u=t.tr,f=0;function p(){if(i=r?u.doc.nodeAt(r-1):u.doc,!i)throw new Error("No table found");s=ct.get(i),f=u.mapping.maps.length;}w$(u,s,i,r,c,d,f)&&p(),A1(u,s,i,r,l,c,a,f)&&p(),A1(u,s,i,r,l,c,d,f)&&p(),O1(u,s,i,r,a,d,l,f)&&p(),O1(u,s,i,r,a,d,c,f)&&p();for(let h=a;h<d;h++){let m=s.positionAt(h,l,i),g=s.positionAt(h,c,i);u.replace(u.mapping.slice(f).map(m+r),u.mapping.slice(f).map(g+r),new H(o.rows[h-a],0,0));}p(),u.setSelection(new Fe(u.doc.resolve(r+s.positionAt(a,l,i)),u.doc.resolve(r+s.positionAt(d-1,c-1,i)))),e(u);}var x$=ma({ArrowLeft:bd("horiz",-1),ArrowRight:bd("horiz",1),ArrowUp:bd("vert",-1),ArrowDown:bd("vert",1),"Shift-ArrowLeft":vd("horiz",-1),"Shift-ArrowRight":vd("horiz",1),"Shift-ArrowUp":vd("vert",-1),"Shift-ArrowDown":vd("vert",1),Backspace:gd,"Mod-Backspace":gd,Delete:gd,"Mod-Delete":gd});function yd(t,e,r){return r.eq(t.selection)?!1:(e&&e(t.tr.setSelection(r).scrollIntoView()),!0)}function bd(t,e){return (r,n,o)=>{if(!o)return !1;let i=r.selection;if(i instanceof Fe)return yd(r,n,Z.near(i.$headCell,e));if(t!="horiz"&&!i.empty)return !1;let s=Q1(o,t,e);if(s==null)return !1;if(t=="horiz")return yd(r,n,Z.near(r.doc.resolve(i.head+e),e));{let a=r.doc.resolve(s),l=B1(a,t,e),c;return l?c=Z.near(l,1):e<0?c=Z.near(r.doc.resolve(a.before(-1)),-1):c=Z.near(r.doc.resolve(a.after(-1)),1),yd(r,n,c)}}}function vd(t,e){return (r,n,o)=>{if(!o)return !1;let i=r.selection,s;if(i instanceof Fe)s=i;else {let l=Q1(o,t,e);if(l==null)return !1;s=new Fe(r.doc.resolve(l));}let a=B1(s.$headCell,t,e);return a?yd(r,n,new Fe(s.$anchorCell,a)):!1}}function E$(t,e){let r=t.state.doc,n=us(r.resolve(e));return n?(t.dispatch(t.state.tr.setSelection(new Fe(n))),!0):!1}function k$(t,e,r){if(!Gr(t.state))return !1;let n=b$(r),o=t.state.selection;if(o instanceof Fe){n||(n={width:1,height:1,rows:[O.from(Wh(jt(t.state.schema).cell,r))]});let i=o.$anchorCell.node(-1),s=o.$anchorCell.start(-1),a=ct.get(i).rectBetween(o.$anchorCell.pos-s,o.$headCell.pos-s);return n=y$(n,a.right-a.left,a.bottom-a.top),D1(t.state,t.dispatch,s,a,n),!0}else if(n){let i=xd(t.state),s=i.start(-1);return D1(t.state,t.dispatch,s,ct.get(i.node(-1)).findCell(i.pos-s),n),!0}else return !1}function S$(t,e){var r;if(e.ctrlKey||e.metaKey)return;let n=P1(t,e.target),o;if(e.shiftKey&&t.state.selection instanceof Fe)i(t.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&n&&(o=us(t.state.selection.$anchor))!=null&&((r=Hh(t,e))==null?void 0:r.pos)!=o.pos)i(o,e),e.preventDefault();else if(!n)return;function i(l,c){let d=Hh(t,c),u=go.getState(t.state)==null;if(!d||!qh(l,d))if(u)d=l;else return;let f=new Fe(l,d);if(u||!t.state.selection.eq(f)){let p=t.state.tr.setSelection(f);u&&p.setMeta(go,l.pos),t.dispatch(p);}}function s(){t.root.removeEventListener("mouseup",s),t.root.removeEventListener("dragstart",s),t.root.removeEventListener("mousemove",a),go.getState(t.state)!=null&&t.dispatch(t.state.tr.setMeta(go,-1));}function a(l){let c=l,d=go.getState(t.state),u;if(d!=null)u=t.state.doc.resolve(d);else if(P1(t,c.target)!=n&&(u=Hh(t,e),!u))return s();u&&i(u,c);}t.root.addEventListener("mouseup",s),t.root.addEventListener("dragstart",s),t.root.addEventListener("mousemove",a);}function Q1(t,e,r){if(!(t.state.selection instanceof q))return null;let{$head:n}=t.state.selection;for(let o=n.depth-1;o>=0;o--){let i=n.node(o);if((r<0?n.index(o):n.indexAfter(o))!=(r<0?0:i.childCount))return null;if(i.type.spec.tableRole=="cell"||i.type.spec.tableRole=="header_cell"){let a=n.before(o),l=e=="vert"?r>0?"down":"up":r>0?"right":"left";return t.endOfTextblock(l)?a:null}}return null}function P1(t,e){for(;e&&e!=t.dom;e=e.parentNode)if(e.nodeName=="TD"||e.nodeName=="TH")return e;return null}function Hh(t,e){let r=t.posAtCoords({left:e.clientX,top:e.clientY});return r&&r?us(t.state.doc.resolve(r.pos)):null}var C$=class{constructor(t,e){this.node=t,this.defaultCellMinWidth=e,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${e}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),Gh(t,this.colgroup,this.table,e),this.contentDOM=this.table.appendChild(document.createElement("tbody"));}update(t){return t.type!=this.node.type?!1:(this.node=t,Gh(t,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(t){return t.type=="attributes"&&(t.target==this.table||this.colgroup.contains(t.target))}};function Gh(t,e,r,n,o,i){var s;let a=0,l=!0,c=e.firstChild,d=t.firstChild;if(d){for(let u=0,f=0;u<d.childCount;u++){let{colspan:p,colwidth:h}=d.child(u).attrs;for(let m=0;m<p;m++,f++){let g=o==f?i:h&&h[m],b=g?g+"px":"";if(a+=g||n,g||(l=!1),c)c.style.width!=b&&(c.style.width=b),c=c.nextSibling;else {let v=document.createElement("col");v.style.width=b,e.appendChild(v);}}}for(;c;){let u=c.nextSibling;(s=c.parentNode)==null||s.removeChild(c),c=u;}l?(r.style.width=a+"px",r.style.minWidth=""):(r.style.width="",r.style.minWidth=a+"px");}}var vr=new ae("tableColumnResizing");function ek({handleWidth:t=5,cellMinWidth:e=25,defaultCellMinWidth:r=100,View:n=C$,lastColumnResizable:o=!0}={}){let i=new oe({key:vr,state:{init(s,a){var l,c;let d=(c=(l=i.spec)==null?void 0:l.props)==null?void 0:c.nodeViews,u=jt(a.schema).table.name;return n&&d&&(d[u]=(f,p)=>new n(f,r,p)),new R$(-1,!1)},apply(s,a){return a.apply(s)}},props:{attributes:s=>{let a=vr.getState(s);return a&&a.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(s,a)=>{T$(s,a,t,o);},mouseleave:s=>{N$(s);},mousedown:(s,a)=>{_$(s,a,e,r);}},decorations:s=>{let a=vr.getState(s);if(a&&a.activeHandle>-1)return P$(s,a.activeHandle)},nodeViews:{}}});return i}var R$=class wd{constructor(e,r){this.activeHandle=e,this.dragging=r;}apply(e){let r=this,n=e.getMeta(vr);if(n&&n.setHandle!=null)return new wd(n.setHandle,!1);if(n&&n.setDragging!==void 0)return new wd(r.activeHandle,n.setDragging);if(r.activeHandle>-1&&e.docChanged){let o=e.mapping.map(r.activeHandle,-1);return Kh(e.doc.resolve(o))||(o=-1),new wd(o,r.dragging)}return r}};function T$(t,e,r,n){if(!t.editable)return;let o=vr.getState(t.state);if(o&&!o.dragging){let i=A$(e.target),s=-1;if(i){let{left:a,right:l}=i.getBoundingClientRect();e.clientX-a<=r?s=I1(t,e,"left",r):l-e.clientX<=r&&(s=I1(t,e,"right",r));}if(s!=o.activeHandle){if(!n&&s!==-1){let a=t.state.doc.resolve(s),l=a.node(-1),c=ct.get(l),d=a.start(-1);if(c.colCount(a.pos-d)+a.nodeAfter.attrs.colspan-1==c.width-1)return}tk(t,s);}}}function N$(t){if(!t.editable)return;let e=vr.getState(t.state);e&&e.activeHandle>-1&&!e.dragging&&tk(t,-1);}function _$(t,e,r,n){var o;if(!t.editable)return !1;let i=(o=t.dom.ownerDocument.defaultView)!=null?o:window,s=vr.getState(t.state);if(!s||s.activeHandle==-1||s.dragging)return !1;let a=t.state.doc.nodeAt(s.activeHandle),l=M$(t,s.activeHandle,a.attrs);t.dispatch(t.state.tr.setMeta(vr,{setDragging:{startX:e.clientX,startWidth:l}}));function c(u){i.removeEventListener("mouseup",c),i.removeEventListener("mousemove",d);let f=vr.getState(t.state);f?.dragging&&(O$(t,f.activeHandle,L1(f.dragging,u,r)),t.dispatch(t.state.tr.setMeta(vr,{setDragging:null})));}function d(u){if(!u.which)return c(u);let f=vr.getState(t.state);if(f&&f.dragging){let p=L1(f.dragging,u,r);$1(t,f.activeHandle,p,n);}}return $1(t,s.activeHandle,l,n),i.addEventListener("mouseup",c),i.addEventListener("mousemove",d),e.preventDefault(),!0}function M$(t,e,{colspan:r,colwidth:n}){let o=n&&n[n.length-1];if(o)return o;let i=t.domAtPos(e),a=i.node.childNodes[i.offset].offsetWidth,l=r;if(n)for(let c=0;c<r;c++)n[c]&&(a-=n[c],l--);return a/l}function A$(t){for(;t&&t.nodeName!="TD"&&t.nodeName!="TH";)t=t.classList&&t.classList.contains("ProseMirror")?null:t.parentNode;return t}function I1(t,e,r,n){let o=r=="right"?-n:n,i=t.posAtCoords({left:e.clientX+o,top:e.clientY});if(!i)return -1;let{pos:s}=i,a=us(t.state.doc.resolve(s));if(!a)return -1;if(r=="right")return a.pos;let l=ct.get(a.node(-1)),c=a.start(-1),d=l.map.indexOf(a.pos-c);return d%l.width==0?-1:c+l.map[d-1]}function L1(t,e,r){let n=e.clientX-t.startX;return Math.max(r,t.startWidth+n)}function tk(t,e){t.dispatch(t.state.tr.setMeta(vr,{setHandle:e}));}function O$(t,e,r){let n=t.state.doc.resolve(e),o=n.node(-1),i=ct.get(o),s=n.start(-1),a=i.colCount(n.pos-s)+n.nodeAfter.attrs.colspan-1,l=t.state.tr;for(let c=0;c<i.height;c++){let d=c*i.width+a;if(c&&i.map[d]==i.map[d-i.width])continue;let u=i.map[d],f=o.nodeAt(u).attrs,p=f.colspan==1?0:a-i.colCount(u);if(f.colwidth&&f.colwidth[p]==r)continue;let h=f.colwidth?f.colwidth.slice():D$(f.colspan);h[p]=r,l.setNodeMarkup(s+u,null,{...f,colwidth:h});}l.docChanged&&t.dispatch(l);}function $1(t,e,r,n){let o=t.state.doc.resolve(e),i=o.node(-1),s=o.start(-1),a=ct.get(i).colCount(o.pos-s)+o.nodeAfter.attrs.colspan-1,l=t.domAtPos(o.start(-1)).node;for(;l&&l.nodeName!="TABLE";)l=l.parentNode;l&&Gh(i,l.firstChild,l,n,a,r);}function D$(t){return Array(t).fill(0)}function P$(t,e){var r;let n=[],o=t.doc.resolve(e),i=o.node(-1);if(!i)return Ee.empty;let s=ct.get(i),a=o.start(-1),l=s.colCount(o.pos-a)+o.nodeAfter.attrs.colspan-1;for(let c=0;c<s.height;c++){let d=l+c*s.width;if((l==s.width-1||s.map[d]!=s.map[d+1])&&(c==0||s.map[d]!=s.map[d-s.width])){let u=s.map[d],f=a+u+i.nodeAt(u).nodeSize-1,p=document.createElement("div");p.className="column-resize-handle",(r=vr.getState(t))!=null&&r.dragging&&n.push(Be.node(a+u,a+u+i.nodeAt(u).nodeSize,{class:"column-resize-dragging"})),n.push(Be.widget(f,p));}}return Ee.create(t.doc,n)}function rk({allowTableNodeSelection:t=!1}={}){return new oe({key:go,state:{init(){return null},apply(e,r){let n=e.getMeta(go);if(n!=null)return n==-1?null:n;if(r==null||!e.docChanged)return r;let{deleted:o,pos:i}=e.mapping.mapResult(r);return o?null:i}},props:{decorations:o$,handleDOMEvents:{mousedown:S$},createSelectionBetween(e){return go.getState(e.state)!=null?e.state.selection:null},handleTripleClick:E$,handleKeyDown:x$,handlePaste:k$},appendTransaction(e,r,n){return a$(n,jh(n,r),t)}})}var kd=Ne.create({name:"tableCell",addOptions(){return {HTMLAttributes:{}}},content:"block+",addAttributes(){return {colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{let e=t.getAttribute("colwidth");return e?e.split(",").map(n=>parseInt(n,10)):null}}}},tableRole:"cell",isolating:!0,parseHTML(){return [{tag:"td"}]},renderHTML({HTMLAttributes:t}){return ["td",ie(this.options.HTMLAttributes,t),0]}}),Sd=Ne.create({name:"tableHeader",addOptions(){return {HTMLAttributes:{}}},content:"block+",addAttributes(){return {colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{let e=t.getAttribute("colwidth");return e?e.split(",").map(n=>parseInt(n,10)):null}}}},tableRole:"header_cell",isolating:!0,parseHTML(){return [{tag:"th"}]},renderHTML({HTMLAttributes:t}){return ["th",ie(this.options.HTMLAttributes,t),0]}}),Cd=Ne.create({name:"tableRow",addOptions(){return {HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return [{tag:"tr"}]},renderHTML({HTMLAttributes:t}){return ["tr",ie(this.options.HTMLAttributes,t),0]}});function Zh(t,e){return e?["width",`${Math.max(e,t)}px`]:["min-width",`${t}px`]}function nk(t,e,r,n,o,i){var s;let a=0,l=!0,c=e.firstChild,d=t.firstChild;if(d!==null)for(let u=0,f=0;u<d.childCount;u+=1){let{colspan:p,colwidth:h}=d.child(u).attrs;for(let m=0;m<p;m+=1,f+=1){let g=o===f?i:h&&h[m],b=g?`${g}px`:"";if(a+=g||n,g||(l=!1),c){if(c.style.width!==b){let[v,y]=Zh(n,g);c.style.setProperty(v,y);}c=c.nextSibling;}else {let v=document.createElement("col"),[y,x]=Zh(n,g);v.style.setProperty(y,x),e.appendChild(v);}}}for(;c;){let u=c.nextSibling;(s=c.parentNode)==null||s.removeChild(c),c=u;}l?(r.style.width=`${a}px`,r.style.minWidth=""):(r.style.width="",r.style.minWidth=`${a}px`);}var I$=class{constructor(t,e){this.node=t,this.cellMinWidth=e,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),nk(t,this.colgroup,this.table,e),this.contentDOM=this.table.appendChild(document.createElement("tbody"));}update(t){return t.type!==this.node.type?!1:(this.node=t,nk(t,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(t){return t.type==="attributes"&&(t.target===this.table||this.colgroup.contains(t.target))}};function L$(t,e,r,n){let o=0,i=!0,s=[],a=t.firstChild;if(!a)return {};for(let u=0,f=0;u<a.childCount;u+=1){let{colspan:p,colwidth:h}=a.child(u).attrs;for(let m=0;m<p;m+=1,f+=1){let g=r===f?n:h&&h[m];o+=g||e,g||(i=!1);let[b,v]=Zh(e,g);s.push(["col",{style:`${b}: ${v}`}]);}}let l=i?`${o}px`:"",c=i?"":`${o}px`;return {colgroup:["colgroup",{},...s],tableWidth:l,tableMinWidth:c}}function ok(t,e){return e?t.createChecked(null,e):t.createAndFill()}function $$(t){if(t.cached.tableNodeTypes)return t.cached.tableNodeTypes;let e={};return Object.keys(t.nodes).forEach(r=>{let n=t.nodes[r];n.spec.tableRole&&(e[n.spec.tableRole]=n);}),t.cached.tableNodeTypes=e,e}function B$(t,e,r,n,o){let i=$$(t),s=[],a=[];for(let c=0;c<r;c+=1){let d=ok(i.cell,o);if(d&&a.push(d),n){let u=ok(i.header_cell,o);u&&s.push(u);}}let l=[];for(let c=0;c<e;c+=1)l.push(i.row.createChecked(null,n&&c===0?s:a));return i.table.createChecked(null,l)}function F$(t){return t instanceof Fe}var Ed=({editor:t})=>{let{selection:e}=t.state;if(!F$(e))return !1;let r=0,n=Up(e.ranges[0].$from,i=>i.type.name==="table");return n?.node.descendants(i=>{if(i.type.name==="table")return !1;["tableCell","tableHeader"].includes(i.type.name)&&(r+=1);}),r===e.ranges.length?(t.commands.deleteTable(),!0):!1},Qh=Ne.create({name:"table",addOptions(){return {HTMLAttributes:{},resizable:!1,handleWidth:5,cellMinWidth:25,View:I$,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML(){return [{tag:"table"}]},renderHTML({node:t,HTMLAttributes:e}){let{colgroup:r,tableWidth:n,tableMinWidth:o}=L$(t,this.options.cellMinWidth);return ["table",ie(this.options.HTMLAttributes,e,{style:n?`width: ${n}`:`min-width: ${o}`}),r,["tbody",0]]},addCommands(){return {insertTable:({rows:t=3,cols:e=3,withHeaderRow:r=!0}={})=>({tr:n,dispatch:o,editor:i})=>{let s=B$(i.schema,t,e,r);if(o){let a=n.selection.from+1;n.replaceSelectionWith(s).scrollIntoView().setSelection(q.near(n.doc.resolve(a)));}return !0},addColumnBefore:()=>({state:t,dispatch:e})=>V1(t,e),addColumnAfter:()=>({state:t,dispatch:e})=>K1(t,e),deleteColumn:()=>({state:t,dispatch:e})=>W1(t,e),addRowBefore:()=>({state:t,dispatch:e})=>q1(t,e),addRowAfter:()=>({state:t,dispatch:e})=>j1(t,e),deleteRow:()=>({state:t,dispatch:e})=>Y1(t,e),deleteTable:()=>({state:t,dispatch:e})=>Z1(t,e),mergeCells:()=>({state:t,dispatch:e})=>Yh(t,e),splitCell:()=>({state:t,dispatch:e})=>Xh(t,e),toggleHeaderColumn:()=>({state:t,dispatch:e})=>fs("column")(t,e),toggleHeaderRow:()=>({state:t,dispatch:e})=>fs("row")(t,e),toggleHeaderCell:()=>({state:t,dispatch:e})=>J1(t,e),mergeOrSplit:()=>({state:t,dispatch:e})=>Yh(t,e)?!0:Xh(t,e),setCellAttribute:(t,e)=>({state:r,dispatch:n})=>X1(t,e)(r,n),goToNextCell:()=>({state:t,dispatch:e})=>Jh(1)(t,e),goToPreviousCell:()=>({state:t,dispatch:e})=>Jh(-1)(t,e),fixTables:()=>({state:t,dispatch:e})=>(e&&jh(t),!0),setCellSelection:t=>({tr:e,dispatch:r})=>{if(r){let n=Fe.create(e.doc,t.anchorCell,t.headCell);e.setSelection(n);}return !0}}},addKeyboardShortcuts(){return {Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:Ed,"Mod-Backspace":Ed,Delete:Ed,"Mod-Delete":Ed}},addProseMirrorPlugins(){return [...this.options.resizable&&this.editor.isEditable?[ek({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],rk({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(t){let e={name:t.name,options:t.options,storage:t.storage};return {tableRole:Ie(Q(t,"tableRole",e))}}});se.create({name:"tableKit",addExtensions(){let t=[];return this.options.table!==!1&&t.push(Qh.configure(this.options.table)),this.options.tableCell!==!1&&t.push(kd.configure(this.options.tableCell)),this.options.tableHeader!==!1&&t.push(Sd.configure(this.options.tableHeader)),this.options.tableRow!==!1&&t.push(Cd.configure(this.options.tableRow)),t}});var ik=Cd;var sk=kd;var ak=Sd;var z$=t=>{if(!t.children.length)return;let e=t.querySelectorAll("span");e&&e.forEach(r=>{var n,o;let i=r.getAttribute("style"),s=(o=(n=r.parentElement)==null?void 0:n.closest("span"))==null?void 0:o.getAttribute("style");r.setAttribute("style",`${s};${i}`);});},em=Pt.create({name:"textStyle",priority:101,addOptions(){return {HTMLAttributes:{},mergeNestedSpanStyles:!0}},parseHTML(){return [{tag:"span",consuming:!1,getAttrs:t=>t.hasAttribute("style")?(this.options.mergeNestedSpanStyles&&z$(t),{}):!1}]},renderHTML({HTMLAttributes:t}){return ["span",ie(this.options.HTMLAttributes,t),0]},addCommands(){return {toggleTextStyle:t=>({commands:e})=>e.toggleMark(this.name,t),removeEmptyTextStyle:()=>({tr:t})=>{let{selection:e}=t;return t.doc.nodesBetween(e.from,e.to,(r,n)=>{if(r.isTextblock)return !0;r.marks.filter(o=>o.type===this.type).some(o=>Object.values(o.attrs).some(i=>!!i))||t.removeMark(n,n+r.nodeSize,this.type);}),!0}}}}),H$=se.create({name:"backgroundColor",addOptions(){return {types:["textStyle"]}},addGlobalAttributes(){return [{types:this.options.types,attributes:{backgroundColor:{default:null,parseHTML:t=>{var e;return (e=t.style.backgroundColor)==null?void 0:e.replace(/['"]+/g,"")},renderHTML:t=>t.backgroundColor?{style:`background-color: ${t.backgroundColor}`}:{}}}}]},addCommands(){return {setBackgroundColor:t=>({chain:e})=>e().setMark("textStyle",{backgroundColor:t}).run(),unsetBackgroundColor:()=>({chain:t})=>t().setMark("textStyle",{backgroundColor:null}).removeEmptyTextStyle().run()}}}),tm=se.create({name:"color",addOptions(){return {types:["textStyle"]}},addGlobalAttributes(){return [{types:this.options.types,attributes:{color:{default:null,parseHTML:t=>{var e;return (e=t.style.color)==null?void 0:e.replace(/['"]+/g,"")},renderHTML:t=>t.color?{style:`color: ${t.color}`}:{}}}}]},addCommands(){return {setColor:t=>({chain:e})=>e().setMark("textStyle",{color:t}).run(),unsetColor:()=>({chain:t})=>t().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}}),U$=se.create({name:"fontFamily",addOptions(){return {types:["textStyle"]}},addGlobalAttributes(){return [{types:this.options.types,attributes:{fontFamily:{default:null,parseHTML:t=>t.style.fontFamily,renderHTML:t=>t.fontFamily?{style:`font-family: ${t.fontFamily}`}:{}}}}]},addCommands(){return {setFontFamily:t=>({chain:e})=>e().setMark("textStyle",{fontFamily:t}).run(),unsetFontFamily:()=>({chain:t})=>t().setMark("textStyle",{fontFamily:null}).removeEmptyTextStyle().run()}}}),V$=se.create({name:"fontSize",addOptions(){return {types:["textStyle"]}},addGlobalAttributes(){return [{types:this.options.types,attributes:{fontSize:{default:null,parseHTML:t=>t.style.fontSize,renderHTML:t=>t.fontSize?{style:`font-size: ${t.fontSize}`}:{}}}}]},addCommands(){return {setFontSize:t=>({chain:e})=>e().setMark("textStyle",{fontSize:t}).run(),unsetFontSize:()=>({chain:t})=>t().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().run()}}}),K$=se.create({name:"lineHeight",addOptions(){return {types:["textStyle"]}},addGlobalAttributes(){return [{types:this.options.types,attributes:{lineHeight:{default:null,parseHTML:t=>t.style.lineHeight,renderHTML:t=>t.lineHeight?{style:`line-height: ${t.lineHeight}`}:{}}}}]},addCommands(){return {setLineHeight:t=>({chain:e})=>e().setMark("textStyle",{lineHeight:t}).run(),unsetLineHeight:()=>({chain:t})=>t().setMark("textStyle",{lineHeight:null}).removeEmptyTextStyle().run()}}});se.create({name:"textStyleKit",addExtensions(){let t=[];return this.options.backgroundColor!==!1&&t.push(H$.configure(this.options.backgroundColor)),this.options.color!==!1&&t.push(tm.configure(this.options.color)),this.options.fontFamily!==!1&&t.push(U$.configure(this.options.fontFamily)),this.options.fontSize!==!1&&t.push(V$.configure(this.options.fontSize)),this.options.lineHeight!==!1&&t.push(K$.configure(this.options.lineHeight)),this.options.textStyle!==!1&&t.push(em.configure(this.options.textStyle)),t}});var lk=tm;var ck=Pa;var dk=ud;var uk=dd;var W$=t=>tt({find:/--$/,replace:t??"\u2014"}),G$=t=>tt({find:/\.\.\.$/,replace:t??"\u2026"}),q$=t=>tt({find:/(?:^|[\s{[(<'"\u2018\u201C])(")$/,replace:t??"\u201C"}),j$=t=>tt({find:/"$/,replace:t??"\u201D"}),Y$=t=>tt({find:/(?:^|[\s{[(<'"\u2018\u201C])(')$/,replace:t??"\u2018"}),X$=t=>tt({find:/'$/,replace:t??"\u2019"}),J$=t=>tt({find:/<-$/,replace:t??"\u2190"}),Z$=t=>tt({find:/->$/,replace:t??"\u2192"}),Q$=t=>tt({find:/\(c\)$/,replace:t??"\xA9"}),e3=t=>tt({find:/\(tm\)$/,replace:t??"\u2122"}),t3=t=>tt({find:/\(sm\)$/,replace:t??"\u2120"}),r3=t=>tt({find:/\(r\)$/,replace:t??"\xAE"}),n3=t=>tt({find:/(?:^|\s)(1\/2)\s$/,replace:t??"\xBD"}),o3=t=>tt({find:/\+\/-$/,replace:t??"\xB1"}),i3=t=>tt({find:/!=$/,replace:t??"\u2260"}),s3=t=>tt({find:/<<$/,replace:t??"\xAB"}),a3=t=>tt({find:/>>$/,replace:t??"\xBB"}),l3=t=>tt({find:/\d+\s?([*x])\s?\d+$/,replace:t??"\xD7"}),c3=t=>tt({find:/\^2$/,replace:t??"\xB2"}),d3=t=>tt({find:/\^3$/,replace:t??"\xB3"}),u3=t=>tt({find:/(?:^|\s)(1\/4)\s$/,replace:t??"\xBC"}),f3=t=>tt({find:/(?:^|\s)(3\/4)\s$/,replace:t??"\xBE"}),p3=se.create({name:"typography",addOptions(){return {closeDoubleQuote:"\u201D",closeSingleQuote:"\u2019",copyright:"\xA9",ellipsis:"\u2026",emDash:"\u2014",laquo:"\xAB",leftArrow:"\u2190",multiplication:"\xD7",notEqual:"\u2260",oneHalf:"\xBD",oneQuarter:"\xBC",openDoubleQuote:"\u201C",openSingleQuote:"\u2018",plusMinus:"\xB1",raquo:"\xBB",registeredTrademark:"\xAE",rightArrow:"\u2192",servicemark:"\u2120",superscriptThree:"\xB3",superscriptTwo:"\xB2",threeQuarters:"\xBE",trademark:"\u2122"}},addInputRules(){let t=[];return this.options.emDash!==!1&&t.push(W$(this.options.emDash)),this.options.ellipsis!==!1&&t.push(G$(this.options.ellipsis)),this.options.openDoubleQuote!==!1&&t.push(q$(this.options.openDoubleQuote)),this.options.closeDoubleQuote!==!1&&t.push(j$(this.options.closeDoubleQuote)),this.options.openSingleQuote!==!1&&t.push(Y$(this.options.openSingleQuote)),this.options.closeSingleQuote!==!1&&t.push(X$(this.options.closeSingleQuote)),this.options.leftArrow!==!1&&t.push(J$(this.options.leftArrow)),this.options.rightArrow!==!1&&t.push(Z$(this.options.rightArrow)),this.options.copyright!==!1&&t.push(Q$(this.options.copyright)),this.options.trademark!==!1&&t.push(e3(this.options.trademark)),this.options.servicemark!==!1&&t.push(t3(this.options.servicemark)),this.options.registeredTrademark!==!1&&t.push(r3(this.options.registeredTrademark)),this.options.oneHalf!==!1&&t.push(n3(this.options.oneHalf)),this.options.plusMinus!==!1&&t.push(o3(this.options.plusMinus)),this.options.notEqual!==!1&&t.push(i3(this.options.notEqual)),this.options.laquo!==!1&&t.push(s3(this.options.laquo)),this.options.raquo!==!1&&t.push(a3(this.options.raquo)),this.options.multiplication!==!1&&t.push(l3(this.options.multiplication)),this.options.superscriptTwo!==!1&&t.push(c3(this.options.superscriptTwo)),this.options.superscriptThree!==!1&&t.push(d3(this.options.superscriptThree)),this.options.oneQuarter!==!1&&t.push(u3(this.options.oneQuarter)),this.options.threeQuarters!==!1&&t.push(f3(this.options.threeQuarters)),t}}),fk=p3;var Dk=ks(Ok(),1);var Md=Dk.default;function Lk(t,e=[]){return t.map(r=>{let n=[...e,...r.properties?r.properties.className:[]];return r.children?Lk(r.children,n):{text:r.value,classes:n}}).flat()}function Pk(t){return t.value||t.children||[]}function n4(t){return !!Md.getLanguage(t)}function Ik({doc:t,name:e,lowlight:r,defaultLanguage:n}){let o=[];return Ec(t,i=>i.type.name===e).forEach(i=>{var s;let a=i.pos+1,l=i.node.attrs.language||n,c=r.listLanguages(),d=l&&(c.includes(l)||n4(l)||(s=r.registered)!=null&&s.call(r,l))?Pk(r.highlight(l,i.node.textContent)):Pk(r.highlightAuto(i.node.textContent));Lk(d).forEach(u=>{let f=a+u.text.length;if(u.classes.length){let p=Be.inline(a,f,{class:u.classes.join(" ")});o.push(p);}a=f;});}),Ee.create(t,o)}function o4(t){return typeof t=="function"}function i4({name:t,lowlight:e,defaultLanguage:r}){if(!["highlight","highlightAuto","listLanguages"].every(o=>o4(e[o])))throw Error("You should provide an instance of lowlight to use the code-block-lowlight extension");let n=new oe({key:new ae("lowlight"),state:{init:(o,{doc:i})=>Ik({doc:i,name:t,lowlight:e,defaultLanguage:r}),apply:(o,i,s,a)=>{let l=s.selection.$head.parent.type.name,c=a.selection.$head.parent.type.name,d=Ec(s.doc,f=>f.type.name===t),u=Ec(a.doc,f=>f.type.name===t);return o.docChanged&&([l,c].includes(t)||u.length!==d.length||o.steps.some(f=>f.from!==void 0&&f.to!==void 0&&d.some(p=>p.pos>=f.from&&p.pos+p.node.nodeSize<=f.to)))?Ik({doc:o.doc,name:t,lowlight:e,defaultLanguage:r}):i.map(o.mapping,o.doc)}},props:{decorations(o){return n.getState(o)}}});return n}var s4=DE.extend({addOptions(){var t;return {...(t=this.parent)==null?void 0:t.call(this),lowlight:{},languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}},addProseMirrorPlugins(){var t;return [...((t=this.parent)==null?void 0:t.call(this))||[],i4({name:this.name,lowlight:this.options.lowlight,defaultLanguage:this.options.defaultLanguage})]}}),$k=s4;function a4(t){let e=t.regex,r=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),n="decltype\\(auto\\)",o="[a-zA-Z_]\\w*::",i="<[^<>]+>",s="(?!struct)("+n+"|"+e.optional(o)+"[a-zA-Z_]\\w*"+e.optional(i)+")",a={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},l="\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)",c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+l+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},u={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(c,{className:"string"}),{className:"string",begin:/<.*?>/},r,t.C_BLOCK_COMMENT_MODE]},f={className:"title",begin:e.optional(o)+t.IDENT_RE,relevance:0},p=e.optional(o)+t.IDENT_RE+"\\s*\\(",h=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],m=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],g=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],b=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],x={type:m,keyword:h,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:g},E={className:"function.dispatch",relevance:0,keywords:{_hint:b},begin:e.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,t.IDENT_RE,e.lookahead(/(<[^<>]+>|)\s*\(/))},S=[E,u,a,r,t.C_BLOCK_COMMENT_MODE,d,c],R={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:x,contains:S.concat([{begin:/\(/,end:/\)/,keywords:x,contains:S.concat(["self"]),relevance:0}]),relevance:0},w={className:"function",begin:"("+s+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:x,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:n,keywords:x,relevance:0},{begin:p,returnBegin:!0,contains:[f],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[c,d]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:x,relevance:0,contains:[r,t.C_BLOCK_COMMENT_MODE,c,d,a,{begin:/\(/,end:/\)/,keywords:x,relevance:0,contains:["self",r,t.C_BLOCK_COMMENT_MODE,c,d,a]}]},a,r,t.C_BLOCK_COMMENT_MODE,u]};return {name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:x,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(R,w,E,S,[u,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:x,contains:["self",a]},{begin:t.IDENT_RE+"::",keywords:x},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function Bk(t){let e={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},r=a4(t),n=r.keywords;return n.type=[...n.type,...e.type],n.literal=[...n.literal,...e.literal],n.built_in=[...n.built_in,...e.built_in],n._hints=e._hints,r.name="Arduino",r.aliases=["ino"],r.supersetOf="cpp",r}function Fk(t){let e=t.regex,r={},n={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[r]}]};Object.assign(r,{className:"variable",variants:[{begin:e.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},n]});let o={className:"subst",begin:/\$\(/,end:/\)/,contains:[t.BACKSLASH_ESCAPE]},i=t.inherit(t.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),s={begin:/<<-?\s*(?=\w+)/,starts:{contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},a={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,r,o]};o.contains.push(a);let l={match:/\\"/},c={className:"string",begin:/'/,end:/'/},d={match:/\\'/},u={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,r]},f=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],p=t.SHEBANG({binary:`(${f.join("|")})`,relevance:10}),h={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[t.inherit(t.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},m=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],g=["true","false"],b={match:/(\/[a-z._-]+)+/},v=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],y=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],x=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],E=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return {name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:m,literal:g,built_in:[...v,...y,"set","shopt",...x,...E]},contains:[p,t.SHEBANG(),h,u,i,s,b,a,l,c,d,r]}}function zk(t){let e=t.regex,r=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),n="decltype\\(auto\\)",o="[a-zA-Z_]\\w*::",i="<[^<>]+>",s="("+n+"|"+e.optional(o)+"[a-zA-Z_]\\w*"+e.optional(i)+")",a={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},l="\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)",c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+l+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},u={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(c,{className:"string"}),{className:"string",begin:/<.*?>/},r,t.C_BLOCK_COMMENT_MODE]},f={className:"title",begin:e.optional(o)+t.IDENT_RE,relevance:0},p=e.optional(o)+t.IDENT_RE+"\\s*\\(",g={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},b=[u,a,r,t.C_BLOCK_COMMENT_MODE,d,c],v={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:g,contains:b.concat([{begin:/\(/,end:/\)/,keywords:g,contains:b.concat(["self"]),relevance:0}]),relevance:0},y={begin:"("+s+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:g,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:n,keywords:g,relevance:0},{begin:p,returnBegin:!0,contains:[t.inherit(f,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:g,relevance:0,contains:[r,t.C_BLOCK_COMMENT_MODE,c,d,a,{begin:/\(/,end:/\)/,keywords:g,relevance:0,contains:["self",r,t.C_BLOCK_COMMENT_MODE,c,d,a]}]},a,r,t.C_BLOCK_COMMENT_MODE,u]};return {name:"C",aliases:["h"],keywords:g,disableAutodetect:!0,illegal:"</",contains:[].concat(v,y,b,[u,{begin:t.IDENT_RE+"::",keywords:g},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},t.TITLE_MODE]}]),exports:{preprocessor:u,strings:c,keywords:g}}}function Hk(t){let e=t.regex,r=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),n="decltype\\(auto\\)",o="[a-zA-Z_]\\w*::",i="<[^<>]+>",s="(?!struct)("+n+"|"+e.optional(o)+"[a-zA-Z_]\\w*"+e.optional(i)+")",a={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},l="\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)",c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+l+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},u={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(c,{className:"string"}),{className:"string",begin:/<.*?>/},r,t.C_BLOCK_COMMENT_MODE]},f={className:"title",begin:e.optional(o)+t.IDENT_RE,relevance:0},p=e.optional(o)+t.IDENT_RE+"\\s*\\(",h=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],m=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],g=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],b=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],x={type:m,keyword:h,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:g},E={className:"function.dispatch",relevance:0,keywords:{_hint:b},begin:e.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,t.IDENT_RE,e.lookahead(/(<[^<>]+>|)\s*\(/))},S=[E,u,a,r,t.C_BLOCK_COMMENT_MODE,d,c],R={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:x,contains:S.concat([{begin:/\(/,end:/\)/,keywords:x,contains:S.concat(["self"]),relevance:0}]),relevance:0},w={className:"function",begin:"("+s+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:x,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:n,keywords:x,relevance:0},{begin:p,returnBegin:!0,contains:[f],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[c,d]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:x,relevance:0,contains:[r,t.C_BLOCK_COMMENT_MODE,c,d,a,{begin:/\(/,end:/\)/,keywords:x,relevance:0,contains:["self",r,t.C_BLOCK_COMMENT_MODE,c,d,a]}]},a,r,t.C_BLOCK_COMMENT_MODE,u]};return {name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:x,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(R,w,E,S,[u,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:x,contains:["self",a]},{begin:t.IDENT_RE+"::",keywords:x},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function Uk(t){let e=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],r=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],n=["default","false","null","true"],o=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],i=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],s={keyword:o.concat(i),built_in:e,literal:n},a=t.inherit(t.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),l={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},c={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},d={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},u=t.inherit(d,{illegal:/\n/}),f={className:"subst",begin:/\{/,end:/\}/,keywords:s},p=t.inherit(f,{illegal:/\n/}),h={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},t.BACKSLASH_ESCAPE,p]},m={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},f]},g=t.inherit(m,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},p]});f.contains=[m,h,d,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,l,t.C_BLOCK_COMMENT_MODE],p.contains=[g,h,u,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,l,t.inherit(t.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];let b={variants:[c,m,h,d,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},v={begin:"<",end:">",contains:[{beginKeywords:"in out"},a]},y=t.IDENT_RE+"(<"+t.IDENT_RE+"(\\s*,\\s*"+t.IDENT_RE+")*>)?(\\[\\])?",x={begin:"@"+t.IDENT_RE,relevance:0};return {name:"C#",aliases:["cs","c#"],keywords:s,illegal:/::/,contains:[t.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},b,l,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},a,v,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[a,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[a,v,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+y+"\\s+)+"+t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:s,contains:[{beginKeywords:r.join(" "),relevance:0},{begin:t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[t.TITLE_MODE,v],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,relevance:0,contains:[b,l,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},x]}}var l4=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),c4=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],d4=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],u4=[...c4,...d4],f4=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),p4=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),h4=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),m4=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function Vk(t){let e=t.regex,r=l4(t),n={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},o="and or not only",i=/@-?\w[\w]*(-\w+)*/,s="[a-zA-Z-][a-zA-Z0-9_-]*",a=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE];return {name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[r.BLOCK_COMMENT,n,r.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+s,relevance:0},r.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+p4.join("|")+")"},{begin:":(:)?("+h4.join("|")+")"}]},r.CSS_VARIABLE,{className:"attribute",begin:"\\b("+m4.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[r.BLOCK_COMMENT,r.HEXCOLOR,r.IMPORTANT,r.CSS_NUMBER_MODE,...a,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...a,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},r.FUNCTION_DISPATCH]},{begin:e.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:i},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:o,attribute:f4.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...a,r.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+u4.join("|")+")\\b"}]}}function Kk(t){let e=t.regex;return {name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:e.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:e.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function Wk(t){let i={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return {name:"Go",aliases:["golang"],keywords:i,illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"string",variants:[t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[t.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:i,illegal:/["']/}]}]}}function Gk(t){let e=t.regex,r=/[_A-Za-z][_0-9A-Za-z]*/;return {name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[t.HASH_COMMENT_MODE,t.QUOTE_STRING_MODE,t.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:e.concat(r,e.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}function qk(t){let e=t.regex,r={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:t.NUMBER_RE}]},n=t.COMMENT();n.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];let o={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},i={className:"literal",begin:/\bon|off|true|false|yes|no\b/},s={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},a={begin:/\[/,end:/\]/,contains:[n,i,o,s,r,"self"],relevance:0},l=/[A-Za-z0-9_-]+/,c=/"(\\"|[^"])*"/,d=/'[^']*'/,u=e.either(l,c,d),f=e.concat(u,"(\\s*\\.\\s*",u,")*",e.lookahead(/\s*=\s*[^#\s]/));return {name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[n,{className:"section",begin:/\[+/,end:/\]+/},{begin:f,className:"attr",starts:{end:/$/,contains:[n,a,i,o,s,r]}}]}}var ms="[0-9](_*[0-9])*",Ad=`\\.(${ms})`,Od="[0-9a-fA-F](_*[0-9a-fA-F])*",jk={className:"number",variants:[{begin:`(\\b(${ms})((${Ad})|\\.)?|(${Ad}))[eE][+-]?(${ms})[fFdD]?\\b`},{begin:`\\b(${ms})((${Ad})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Ad})[fFdD]?\\b`},{begin:`\\b(${ms})[fFdD]\\b`},{begin:`\\b0[xX]((${Od})\\.?|(${Od})?\\.(${Od}))[pP][+-]?(${ms})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Od})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Yk(t,e,r){return r===-1?"":t.replace(e,n=>Yk(t,e,r-1))}function Xk(t){let e=t.regex,r="[\xC0-\u02B8a-zA-Z_$][\xC0-\u02B8a-zA-Z_$0-9]*",n=r+Yk("(?:<"+r+"~~~(?:\\s*,\\s*"+r+"~~~)*>)?",/~~~/g,2),l={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},c={className:"meta",begin:"@"+r,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},d={className:"params",begin:/\(/,end:/\)/,keywords:l,relevance:0,contains:[t.C_BLOCK_COMMENT_MODE],endsParent:!0};return {name:"Java",aliases:["jsp"],keywords:l,illegal:/<\/|#/,contains:[t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[t.BACKSLASH_ESCAPE]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[e.concat(/(?!else)/,r),/\s+/,r,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,r],className:{1:"keyword",3:"title.class"},contains:[d,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+n+"\\s+)",t.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:l,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:l,relevance:0,contains:[c,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,jk,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},jk,c]}}var Jk="[A-Za-z$_][0-9A-Za-z$_]*",g4=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],b4=["true","false","null","undefined","NaN","Infinity"],Zk=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Qk=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],eS=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],v4=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],y4=[].concat(eS,Zk,Qk);function tS(t){let e=t.regex,r=(_,{after:A})=>{let L="</"+_[0].slice(1);return _.input.indexOf(L,A)!==-1},n=Jk,o={begin:"<>",end:"</>"},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(_,A)=>{let L=_[0].length+_.index,Y=_.input[L];if(Y==="<"||Y===","){A.ignoreMatch();return}Y===">"&&(r(_,{after:L})||A.ignoreMatch());let te,ke=_.input.substring(L);if(te=ke.match(/^\s*=/)){A.ignoreMatch();return}if((te=ke.match(/^\s+extends\s+/))&&te.index===0){A.ignoreMatch();return}}},a={$pattern:Jk,keyword:g4,literal:b4,built_in:y4,"variable.language":v4},l="[0-9](_?[0-9])*",c=`\\.(${l})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",u={className:"number",variants:[{begin:`(\\b(${d})((${c})|\\.)?|(${c}))[eE][+-]?(${l})\\b`},{begin:`\\b(${d})\\b((${c})\\b|\\.)?|(${c})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},f={className:"subst",begin:"\\$\\{",end:"\\}",keywords:a,contains:[]},p={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,f],subLanguage:"xml"}},h={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,f],subLanguage:"css"}},m={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,f],subLanguage:"graphql"}},g={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,f]},v={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:n+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},y=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,p,h,m,g,{match:/\$\d+/},u];f.contains=y.concat({begin:/\{/,end:/\}/,keywords:a,contains:["self"].concat(y)});let x=[].concat(v,f.contains),E=x.concat([{begin:/(\s*)\(/,end:/\)/,keywords:a,contains:["self"].concat(x)}]),S={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:E},R={variants:[{match:[/class/,/\s+/,n,/\s+/,/extends/,/\s+/,e.concat(n,"(",e.concat(/\./,n),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,n],scope:{1:"keyword",3:"title.class"}}]},w={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Zk,...Qk]}},N={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},M={variants:[{match:[/function/,/\s+/,n,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[S],illegal:/%/},B={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function U(_){return e.concat("(?!",_.join("|"),")")}let K={match:e.concat(/\b/,U([...eS,"super","import"].map(_=>`${_}\\s*\\(`)),n,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},P={begin:e.concat(/\./,e.lookahead(e.concat(n,/(?![0-9A-Za-z$_(])/))),end:n,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},V={match:[/get|set/,/\s+/,n,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},S]},C="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",T={match:[/const|var|let/,/\s+/,n,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(C)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[S]};return {name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:a,exports:{PARAMS_CONTAINS:E,CLASS_REFERENCE:w},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),N,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,p,h,m,g,v,{match:/\$\d+/},u,w,{scope:"attr",match:n+e.lookahead(":"),relevance:0},T,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[v,t.REGEXP_MODE,{className:"function",begin:C,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:E}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:o.begin,end:o.end},{match:i},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},M,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[S,t.inherit(t.TITLE_MODE,{begin:n,className:"title.function"})]},{match:/\.\.\./,relevance:0},P,{match:"\\$"+n,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[S]},K,B,R,V,{match:/\$[(.]/}]}}function rS(t){let e={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},r={match:/[{}[\],:]/,className:"punctuation",relevance:0},n=["true","false","null"],o={scope:"literal",beginKeywords:n.join(" ")};return {name:"JSON",aliases:["jsonc"],keywords:{literal:n},contains:[e,r,t.QUOTE_STRING_MODE,o,t.C_NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var gs="[0-9](_*[0-9])*",Dd=`\\.(${gs})`,Pd="[0-9a-fA-F](_*[0-9a-fA-F])*",w4={className:"number",variants:[{begin:`(\\b(${gs})((${Dd})|\\.)?|(${Dd}))[eE][+-]?(${gs})[fFdD]?\\b`},{begin:`\\b(${gs})((${Dd})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Dd})[fFdD]?\\b`},{begin:`\\b(${gs})[fFdD]\\b`},{begin:`\\b0[xX]((${Pd})\\.?|(${Pd})?\\.(${Pd}))[pP][+-]?(${gs})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Pd})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function nS(t){let e={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},r={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},n={className:"symbol",begin:t.UNDERSCORE_IDENT_RE+"@"},o={className:"subst",begin:/\$\{/,end:/\}/,contains:[t.C_NUMBER_MODE]},i={className:"variable",begin:"\\$"+t.UNDERSCORE_IDENT_RE},s={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[i,o]},{begin:"'",end:"'",illegal:/\n/,contains:[t.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[t.BACKSLASH_ESCAPE,i,o]}]};o.contains.push(s);let a={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+t.UNDERSCORE_IDENT_RE+")?"},l={className:"meta",begin:"@"+t.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[t.inherit(s,{className:"string"}),"self"]}]},c=w4,d=t.COMMENT("/\\*","\\*/",{contains:[t.C_BLOCK_COMMENT_MODE]}),u={variants:[{className:"type",begin:t.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},f=u;return f.variants[1].contains=[u],u.variants[1].contains=[f],{name:"Kotlin",aliases:["kt","kts"],keywords:e,contains:[t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),t.C_LINE_COMMENT_MODE,d,r,n,a,l,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:e,relevance:5,contains:[{begin:t.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[t.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:e,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[u,t.C_LINE_COMMENT_MODE,d],relevance:0},t.C_LINE_COMMENT_MODE,d,a,l,s,t.C_NUMBER_MODE]},d]},{begin:[/class|interface|trait/,/\s+/,t.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},t.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},a,l]},s,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
|
|
187
|
+
`},c]}}var x4=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),E4=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],k4=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],S4=[...E4,...k4],C4=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),oS=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),iS=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),R4=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),T4=oS.concat(iS).sort().reverse();function sS(t){let e=x4(t),r=T4,n="and or not only",o="[\\w-]+",i="("+o+"|@\\{"+o+"\\})",s=[],a=[],l=function(y){return {className:"string",begin:"~?"+y+".*?"+y}},c=function(y,x,E){return {className:y,begin:x,relevance:E}},d={$pattern:/[a-z-]+/,keyword:n,attribute:C4.join(" ")},u={begin:"\\(",end:"\\)",contains:a,keywords:d,relevance:0};a.push(t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,l("'"),l('"'),e.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},e.HEXCOLOR,u,c("variable","@@?"+o,10),c("variable","@\\{"+o+"\\}"),c("built_in","~?`[^`]*?`"),{className:"attribute",begin:o+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},e.IMPORTANT,{beginKeywords:"and not"},e.FUNCTION_DISPATCH);let f=a.concat({begin:/\{/,end:/\}/,contains:s}),p={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(a)},h={begin:i+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},e.CSS_VARIABLE,{className:"attribute",begin:"\\b("+R4.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:a}}]},m={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:d,returnEnd:!0,contains:a,relevance:0}},g={className:"variable",variants:[{begin:"@"+o+"\\s*:",relevance:15},{begin:"@"+o}],starts:{end:"[;}]",returnEnd:!0,contains:f}},b={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:i,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,p,c("keyword","all\\b"),c("variable","@\\{"+o+"\\}"),{begin:"\\b("+S4.join("|")+")\\b",className:"selector-tag"},e.CSS_NUMBER_MODE,c("selector-tag",i,0),c("selector-id","#"+i),c("selector-class","\\."+i,0),c("selector-tag","&",0),e.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+oS.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+iS.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:f},{begin:"!important"},e.FUNCTION_DISPATCH]},v={begin:o+`:(:)?(${r.join("|")})`,returnBegin:!0,contains:[b]};return s.push(t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,m,g,v,h,b,p,e.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:s}}function aS(t){let e="\\[=*\\[",r="\\]=*\\]",n={begin:e,end:r,contains:["self"]},o=[t.COMMENT("--(?!"+e+")","$"),t.COMMENT("--"+e,r,{contains:[n],relevance:10})];return {name:"Lua",aliases:["pluto"],keywords:{$pattern:t.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:o.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[t.inherit(t.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:o}].concat(o)},t.C_NUMBER_MODE,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{className:"string",begin:e,end:r,contains:[n],relevance:5}])}}function lS(t){let e={className:"variable",variants:[{begin:"\\$\\("+t.UNDERSCORE_IDENT_RE+"\\)",contains:[t.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},r={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,e]},n={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[e,r]},o={begin:"^"+t.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},i={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},s={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[e]};return {name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[t.HASH_COMMENT_MODE,e,r,n,o,i,s]}}function cS(t){let e=t.regex,r={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},n={begin:"^[-\\*]{3,}",end:"$"},o={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},i={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},s={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},a=/[A-Za-z][A-Za-z0-9+.-]*/,l={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:e.concat(/\[.+?\]\(/,a,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},c={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},d={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},u=t.inherit(c,{contains:[]}),f=t.inherit(d,{contains:[]});c.contains.push(f),d.contains.push(u);let p=[r,l];return [c,d,u,f].forEach(b=>{b.contains=b.contains.concat(p);}),p=p.concat(c,d),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:p},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:p}]}]},r,i,c,d,{className:"quote",begin:"^>\\s+",contains:p,end:"$"},o,n,l,s,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function dS(t){let e={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},r=/[a-zA-Z@][a-zA-Z0-9_]*/,a={"variable.language":["this","super"],$pattern:r,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},l={$pattern:r,keyword:["@interface","@class","@protocol","@implementation"]};return {name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:a,illegal:"</",contains:[e,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.C_NUMBER_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+l.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:l,contains:[t.UNDERSCORE_TITLE_MODE]},{begin:"\\."+t.UNDERSCORE_IDENT_RE,relevance:0}]}}function uS(t){let e=t.regex,r=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],n=/[dualxmsipngr]{0,12}/,o={$pattern:/[\w.]+/,keyword:r.join(" ")},i={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:o},s={begin:/->\{/,end:/\}/},a={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},l={scope:"variable",variants:[{begin:/\$\d/},{begin:e.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[a]},c={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},d=[t.BACKSLASH_ESCAPE,i,l],u=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],f=(m,g,b="\\1")=>{let v=b==="\\1"?b:e.concat(b,g);return e.concat(e.concat("(?:",m,")"),g,/(?:\\.|[^\\\/])*?/,v,/(?:\\.|[^\\\/])*?/,b,n)},p=(m,g,b)=>e.concat(e.concat("(?:",m,")"),g,/(?:\\.|[^\\\/])*?/,b,n),h=[l,t.HASH_COMMENT_MODE,t.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),s,{className:"string",contains:d,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[t.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},c,{begin:"(\\/\\/|"+t.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[t.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:f("s|tr|y",e.either(...u,{capture:!0}))},{begin:f("s|tr|y","\\(","\\)")},{begin:f("s|tr|y","\\[","\\]")},{begin:f("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:p("(?:m|qr)?",/\//,/\//)},{begin:p("m|qr",e.either(...u,{capture:!0}),/\1/)},{begin:p("m|qr",/\(/,/\)/)},{begin:p("m|qr",/\[/,/\]/)},{begin:p("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[t.TITLE_MODE,a]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[t.TITLE_MODE,a,c]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return i.contains=h,s.contains=h,{name:"Perl",aliases:["pl","pm"],keywords:o,contains:h}}function fS(t){let e=t.regex,r=/(?![A-Za-z0-9])(?![$])/,n=e.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,r),o=e.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,r),i=e.concat(/[A-Z]+/,r),s={scope:"variable",match:"\\$+"+n},a={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},l={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},c=t.inherit(t.APOS_STRING_MODE,{illegal:null}),d=t.inherit(t.QUOTE_STRING_MODE,{illegal:null,contains:t.QUOTE_STRING_MODE.contains.concat(l)}),u={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:t.QUOTE_STRING_MODE.contains.concat(l),"on:begin":(P,V)=>{V.data._beginMatch=P[1]||P[2];},"on:end":(P,V)=>{V.data._beginMatch!==P[1]&&V.ignoreMatch();}},f=t.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),p=`[
|
|
188
|
+
]`,h={scope:"string",variants:[d,c,u,f]},m={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},g=["false","null","true"],b=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],v=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],x={keyword:b,literal:(P=>{let V=[];return P.forEach(C=>{V.push(C),C.toLowerCase()===C?V.push(C.toUpperCase()):V.push(C.toLowerCase());}),V})(g),built_in:v},E=P=>P.map(V=>V.replace(/\|\d+$/,"")),S={variants:[{match:[/new/,e.concat(p,"+"),e.concat("(?!",E(v).join("\\b|"),"\\b)"),o],scope:{1:"keyword",4:"title.class"}}]},R=e.concat(n,"\\b(?!\\()"),w={variants:[{match:[e.concat(/::/,e.lookahead(/(?!class\b)/)),R],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[o,e.concat(/::/,e.lookahead(/(?!class\b)/)),R],scope:{1:"title.class",3:"variable.constant"}},{match:[o,e.concat("::",e.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[o,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},N={scope:"attr",match:e.concat(n,e.lookahead(":"),e.lookahead(/(?!::)/))},M={relevance:0,begin:/\(/,end:/\)/,keywords:x,contains:[N,s,w,t.C_BLOCK_COMMENT_MODE,h,m,S]},B={relevance:0,match:[/\b/,e.concat("(?!fn\\b|function\\b|",E(b).join("\\b|"),"|",E(v).join("\\b|"),"\\b)"),n,e.concat(p,"*"),e.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[M]};M.contains.push(B);let U=[N,w,t.C_BLOCK_COMMENT_MODE,h,m,S],K={begin:e.concat(/#\[\s*\\?/,e.either(o,i)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:g,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:g,keyword:["new","array"]},contains:["self",...U]},...U,{scope:"meta",variants:[{match:o},{match:i}]}]};return {case_insensitive:!1,keywords:x,contains:[K,t.HASH_COMMENT_MODE,t.COMMENT("//","$"),t.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:t.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},a,{scope:"variable.language",match:/\$this\b/},s,B,w,{match:[/const/,/\s/,n],scope:{1:"keyword",3:"variable.constant"}},S,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},t.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:x,contains:["self",K,s,w,t.C_BLOCK_COMMENT_MODE,h,m]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},t.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[t.inherit(t.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},t.UNDERSCORE_TITLE_MODE]},h,m]}}function pS(t){return {name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},t.inherit(t.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),t.inherit(t.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function hS(t){return {name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function mS(t){let e=t.regex,r=/[\p{XID_Start}_]\p{XID_Continue}*/u,n=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],a={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:n,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},l={className:"meta",begin:/^(>>>|\.\.\.) /},c={className:"subst",begin:/\{/,end:/\}/,keywords:a,illegal:/#/},d={begin:/\{\{/,relevance:0},u={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,l,d,c]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,l,d,c]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[t.BACKSLASH_ESCAPE,d,c]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,d,c]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},f="[0-9](_?[0-9])*",p=`(\\b(${f}))?\\.(${f})|\\b(${f})\\.`,h=`\\b|${n.join("|")}`,m={className:"number",relevance:0,variants:[{begin:`(\\b(${f})|(${p}))[eE][+-]?(${f})[jJ]?(?=${h})`},{begin:`(${p})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${h})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${h})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${h})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${h})`},{begin:`\\b(${f})[jJ](?=${h})`}]},g={className:"comment",begin:e.lookahead(/# type:/),end:/$/,keywords:a,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},b={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:["self",l,m,u,t.HASH_COMMENT_MODE]}]};return c.contains=[u,m,l],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:a,illegal:/(<\/|\?)|=>/,contains:[l,m,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},u,g,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,r],scope:{1:"keyword",3:"title.function"},contains:[b]},{variants:[{match:[/\bclass/,/\s+/,r,/\s*/,/\(\s*/,r,/\s*\)/]},{match:[/\bclass/,/\s+/,r]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[m,b,u]}]}}function gS(t){return {aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function bS(t){let e=t.regex,r=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,n=e.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),o=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,i=e.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return {name:"R",keywords:{$pattern:r,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[t.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:e.lookahead(e.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:r},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),t.HASH_COMMENT_MODE,{scope:"string",contains:[t.BACKSLASH_ESCAPE],variants:[t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[o,n]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,n]},{scope:{1:"punctuation",2:"number"},match:[i,n]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,n]}]},{scope:{3:"operator"},match:[r,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:o},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:i},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function vS(t){let e=t.regex,r="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",n=e.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),o=e.concat(n,/(::\w+)*/),s={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},a={className:"doctag",begin:"@[A-Za-z]+"},l={begin:"#<",end:">"},c=[t.COMMENT("#","$",{contains:[a]}),t.COMMENT("^=begin","^=end",{contains:[a],relevance:10}),t.COMMENT("^__END__",t.MATCH_NOTHING_RE)],d={className:"subst",begin:/#\{/,end:/\}/,keywords:s},u={className:"string",contains:[t.BACKSLASH_ESCAPE,d],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:e.concat(/<<[-~]?'?/,e.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[t.BACKSLASH_ESCAPE,d]})]}]},f="[1-9](_?[0-9])*|0",p="[0-9](_?[0-9])*",h={className:"number",relevance:0,variants:[{begin:`\\b(${f})(\\.(${p}))?([eE][+-]?(${p})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},m={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:s}]},S=[u,{variants:[{match:[/class\s+/,o,/\s+<\s+/,o]},{match:[/\b(class|module)\s+/,o]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:s},{match:[/(include|extend)\s+/,o],scope:{2:"title.class"},keywords:s},{relevance:0,match:[o,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:n,scope:"title.class"},{match:[/def/,/\s+/,r],scope:{1:"keyword",3:"title.function"},contains:[m]},{begin:t.IDENT_RE+"::"},{className:"symbol",begin:t.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[u,{begin:r}],relevance:0},h,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:s},{begin:"("+t.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[t.BACKSLASH_ESCAPE,d],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(l,c),relevance:0}].concat(l,c);d.contains=S,m.contains=S;let R="[>?]>",w="[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]",N="(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>",M=[{begin:/^\s*=>/,starts:{end:"$",contains:S}},{className:"meta.prompt",begin:"^("+R+"|"+w+"|"+N+")(?=[ ])",starts:{end:"$",keywords:s,contains:S}}];return c.unshift(l),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:s,illegal:/\/\*/,contains:[t.SHEBANG({binary:"ruby"})].concat(M).concat(c).concat(S)}}function yS(t){let e=t.regex,r=/(r#)?/,n=e.concat(r,t.UNDERSCORE_IDENT_RE),o=e.concat(r,t.IDENT_RE),i={className:"title.function.invoke",relevance:0,begin:e.concat(/\b/,/(?!let|for|while|if|else|match\b)/,o,e.lookahead(/\s*\(/))},s="([ui](8|16|32|64|128|size)|f(32|64))?",a=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],l=["true","false","Some","None","Ok","Err"],c=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],d=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return {name:"Rust",aliases:["rs"],keywords:{$pattern:t.IDENT_RE+"!?",type:d,keyword:a,literal:l,built_in:c},illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.COMMENT("/\\*","\\*/",{contains:["self"]}),t.inherit(t.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+s},{begin:"\\b0o([0-7_]+)"+s},{begin:"\\b0x([A-Fa-f0-9_]+)"+s},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+s}],relevance:0},{begin:[/fn/,/\s+/,n],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,n],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,n,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{begin:t.IDENT_RE+"::",keywords:{keyword:"Self",built_in:c,type:d}},{className:"punctuation",begin:"->"},i]}}var N4=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),_4=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],M4=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],A4=[..._4,...M4],O4=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),D4=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),P4=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),I4=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function wS(t){let e=N4(t),r=P4,n=D4,o="@[a-z-]+",i="and or not only",a={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return {name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,e.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},e.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+A4.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+n.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+r.join("|")+")"},a,{begin:/\(/,end:/\)/,contains:[e.CSS_NUMBER_MODE]},e.CSS_VARIABLE,{className:"attribute",begin:"\\b("+I4.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[e.BLOCK_COMMENT,a,e.HEXCOLOR,e.CSS_NUMBER_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,e.IMPORTANT,e.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:o,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:i,attribute:O4.join(" ")},contains:[{begin:o,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},a,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,e.HEXCOLOR,e.CSS_NUMBER_MODE]},e.FUNCTION_DISPATCH]}}function xS(t){return {name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function ES(t){let e=t.regex,r=t.COMMENT("--","$"),n={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},o={begin:/"/,end:/"/,contains:[{match:/""/}]},i=["true","false","unknown"],s=["double precision","large object","with timezone","without timezone"],a=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],l=["add","asc","collation","desc","final","first","last","view"],c=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],d=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],u=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],f=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],p=d,h=[...c,...l].filter(E=>!d.includes(E)),m={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},g={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},b={match:e.concat(/\b/,e.either(...p),/\s*\(/),relevance:0,keywords:{built_in:p}};function v(E){return e.concat(/\b/,e.either(...E.map(S=>S.replace(/\s+/,"\\s+"))),/\b/)}let y={scope:"keyword",match:v(f),relevance:0};function x(E,{exceptions:S,when:R}={}){let w=R;return S=S||[],E.map(N=>N.match(/\|\d+$/)||S.includes(N)?N:w(N)?`${N}|0`:N)}return {name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:x(h,{when:E=>E.length<3}),literal:i,type:a,built_in:u},contains:[{scope:"type",match:v(s)},y,b,m,n,o,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,r,g]}}function RS(t){return t?typeof t=="string"?t:t.source:null}function Ba(t){return ze("(?=",t,")")}function ze(...t){return t.map(r=>RS(r)).join("")}function L4(t){let e=t[t.length-1];return typeof e=="object"&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}function rr(...t){return "("+(L4(t).capture?"":"?:")+t.map(n=>RS(n)).join("|")+")"}var um=t=>ze(/\b/,t,/\w$/.test(t)?/\b/:/\B/),$4=["Protocol","Type"].map(um),kS=["init","self"].map(um),B4=["Any","Self"],cm=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],SS=["false","nil","true"],F4=["assignment","associativity","higherThan","left","lowerThan","none","right"],z4=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],CS=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],TS=rr(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),NS=rr(TS,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),dm=ze(TS,NS,"*"),_S=rr(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),Ld=rr(_S,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),gn=ze(_S,Ld,"*"),Id=ze(/[A-Z]/,Ld,"*"),H4=["attached","autoclosure",ze(/convention\(/,rr("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",ze(/objc\(/,gn,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],U4=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function MS(t){let e={match:/\s+/,relevance:0},r=t.COMMENT("/\\*","\\*/",{contains:["self"]}),n=[t.C_LINE_COMMENT_MODE,r],o={match:[/\./,rr(...$4,...kS)],className:{2:"keyword"}},i={match:ze(/\./,rr(...cm)),relevance:0},s=cm.filter(Re=>typeof Re=="string").concat(["_|0"]),a=cm.filter(Re=>typeof Re!="string").concat(B4).map(um),l={variants:[{className:"keyword",match:rr(...a,...kS)}]},c={$pattern:rr(/\b\w+/,/#\w+/),keyword:s.concat(z4),literal:SS},d=[o,i,l],u={match:ze(/\./,rr(...CS)),relevance:0},f={className:"built_in",match:ze(/\b/,rr(...CS),/(?=\()/)},p=[u,f],h={match:/->/,relevance:0},m={className:"operator",relevance:0,variants:[{match:dm},{match:`\\.(\\.|${NS})+`}]},g=[h,m],b="([0-9]_*)+",v="([0-9a-fA-F]_*)+",y={className:"number",relevance:0,variants:[{match:`\\b(${b})(\\.(${b}))?([eE][+-]?(${b}))?\\b`},{match:`\\b0x(${v})(\\.(${v}))?([pP][+-]?(${b}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},x=(Re="")=>({className:"subst",variants:[{match:ze(/\\/,Re,/[0\\tnr"']/)},{match:ze(/\\/,Re,/u\{[0-9a-fA-F]{1,8}\}/)}]}),E=(Re="")=>({className:"subst",match:ze(/\\/,Re,/[\t ]*(?:[\r\n]|\r\n)/)}),S=(Re="")=>({className:"subst",label:"interpol",begin:ze(/\\/,Re,/\(/),end:/\)/}),R=(Re="")=>({begin:ze(Re,/"""/),end:ze(/"""/,Re),contains:[x(Re),E(Re),S(Re)]}),w=(Re="")=>({begin:ze(Re,/"/),end:ze(/"/,Re),contains:[x(Re),S(Re)]}),N={className:"string",variants:[R(),R("#"),R("##"),R("###"),w(),w("#"),w("##"),w("###")]},M=[t.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[t.BACKSLASH_ESCAPE]}],B={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:M},U=Re=>{let wt=ze(Re,/\//),D=ze(/\//,Re);return {begin:wt,end:D,contains:[...M,{scope:"comment",begin:`#(?!.*${D})`,end:/$/}]}},K={scope:"regexp",variants:[U("###"),U("##"),U("#"),B]},P={match:ze(/`/,gn,/`/)},V={className:"variable",match:/\$\d+/},C={className:"variable",match:`\\$${Ld}+`},T=[P,V,C],_={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:U4,contains:[...g,y,N]}]}},A={scope:"keyword",match:ze(/@/,rr(...H4),Ba(rr(/\(/,/\s+/)))},L={scope:"meta",match:ze(/@/,gn)},Y=[_,A,L],te={match:Ba(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:ze(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,Ld,"+")},{className:"type",match:Id,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:ze(/\s+&\s+/,Ba(Id)),relevance:0}]},ke={begin:/</,end:/>/,keywords:c,contains:[...n,...d,...Y,h,te]};te.contains.push(ke);let me={match:ze(gn,/\s*:/),keywords:"_|0",relevance:0},Te={begin:/\(/,end:/\)/,relevance:0,keywords:c,contains:["self",me,...n,K,...d,...p,...g,y,N,...T,...Y,te]},Ae={begin:/</,end:/>/,keywords:"repeat each",contains:[...n,te]},W={begin:rr(Ba(ze(gn,/\s*:/)),Ba(ze(gn,/\s+/,gn,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:gn}]},ue={begin:/\(/,end:/\)/,keywords:c,contains:[W,...n,...d,...g,y,N,...Y,te,Te],endsParent:!0,illegal:/["']/},Oe={match:[/(func|macro)/,/\s+/,rr(P.match,gn,dm)],className:{1:"keyword",3:"title.function"},contains:[Ae,ue,e],illegal:[/\[/,/%/]},Se={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[Ae,ue,e],illegal:/\[|%/},le={match:[/operator/,/\s+/,dm],className:{1:"keyword",3:"title"}},Ce={begin:[/precedencegroup/,/\s+/,Id],className:{1:"keyword",3:"title"},contains:[te],keywords:[...F4,...SS],end:/}/},$e={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},Ke={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},nt={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,gn,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:c,contains:[Ae,...d,{begin:/:/,end:/\{/,keywords:c,contains:[{scope:"title.class.inherited",match:Id},...d],relevance:0}]};for(let Re of N.variants){let wt=Re.contains.find(re=>re.label==="interpol");wt.keywords=c;let D=[...d,...p,...g,y,N,...T];wt.contains=[...D,{begin:/\(/,end:/\)/,contains:["self",...D]}];}return {name:"Swift",keywords:c,contains:[...n,Oe,Se,$e,Ke,nt,le,Ce,{beginKeywords:"import",end:/$/,contains:[...n],relevance:0},K,...d,...p,...g,y,N,...T,...Y,te,Te]}}var $d="[A-Za-z$_][0-9A-Za-z$_]*",AS=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],OS=["true","false","null","undefined","NaN","Infinity"],DS=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],PS=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],IS=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],LS=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],$S=[].concat(IS,DS,PS);function V4(t){let e=t.regex,r=(_,{after:A})=>{let L="</"+_[0].slice(1);return _.input.indexOf(L,A)!==-1},n=$d,o={begin:"<>",end:"</>"},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(_,A)=>{let L=_[0].length+_.index,Y=_.input[L];if(Y==="<"||Y===","){A.ignoreMatch();return}Y===">"&&(r(_,{after:L})||A.ignoreMatch());let te,ke=_.input.substring(L);if(te=ke.match(/^\s*=/)){A.ignoreMatch();return}if((te=ke.match(/^\s+extends\s+/))&&te.index===0){A.ignoreMatch();return}}},a={$pattern:$d,keyword:AS,literal:OS,built_in:$S,"variable.language":LS},l="[0-9](_?[0-9])*",c=`\\.(${l})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",u={className:"number",variants:[{begin:`(\\b(${d})((${c})|\\.)?|(${c}))[eE][+-]?(${l})\\b`},{begin:`\\b(${d})\\b((${c})\\b|\\.)?|(${c})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},f={className:"subst",begin:"\\$\\{",end:"\\}",keywords:a,contains:[]},p={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,f],subLanguage:"xml"}},h={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,f],subLanguage:"css"}},m={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,f],subLanguage:"graphql"}},g={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,f]},v={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:n+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},y=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,p,h,m,g,{match:/\$\d+/},u];f.contains=y.concat({begin:/\{/,end:/\}/,keywords:a,contains:["self"].concat(y)});let x=[].concat(v,f.contains),E=x.concat([{begin:/(\s*)\(/,end:/\)/,keywords:a,contains:["self"].concat(x)}]),S={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:E},R={variants:[{match:[/class/,/\s+/,n,/\s+/,/extends/,/\s+/,e.concat(n,"(",e.concat(/\./,n),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,n],scope:{1:"keyword",3:"title.class"}}]},w={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...DS,...PS]}},N={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},M={variants:[{match:[/function/,/\s+/,n,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[S],illegal:/%/},B={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function U(_){return e.concat("(?!",_.join("|"),")")}let K={match:e.concat(/\b/,U([...IS,"super","import"].map(_=>`${_}\\s*\\(`)),n,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},P={begin:e.concat(/\./,e.lookahead(e.concat(n,/(?![0-9A-Za-z$_(])/))),end:n,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},V={match:[/get|set/,/\s+/,n,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},S]},C="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",T={match:[/const|var|let/,/\s+/,n,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(C)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[S]};return {name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:a,exports:{PARAMS_CONTAINS:E,CLASS_REFERENCE:w},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),N,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,p,h,m,g,v,{match:/\$\d+/},u,w,{scope:"attr",match:n+e.lookahead(":"),relevance:0},T,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[v,t.REGEXP_MODE,{className:"function",begin:C,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:E}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:o.begin,end:o.end},{match:i},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},M,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[S,t.inherit(t.TITLE_MODE,{begin:n,className:"title.function"})]},{match:/\.\.\./,relevance:0},P,{match:"\\$"+n,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[S]},K,B,R,V,{match:/\$[(.]/}]}}function BS(t){let e=t.regex,r=V4(t),n=$d,o=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],i={begin:[/namespace/,/\s+/,t.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},s={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:o},contains:[r.exports.CLASS_REFERENCE]},a={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},l=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],c={$pattern:$d,keyword:AS.concat(l),literal:OS,built_in:$S.concat(o),"variable.language":LS},d={className:"meta",begin:"@"+n},u=(m,g,b)=>{let v=m.contains.findIndex(y=>y.label===g);if(v===-1)throw new Error("can not find mode to replace");m.contains.splice(v,1,b);};Object.assign(r.keywords,c),r.exports.PARAMS_CONTAINS.push(d);let f=r.contains.find(m=>m.scope==="attr"),p=Object.assign({},f,{match:e.concat(n,e.lookahead(/\s*\?:/))});r.exports.PARAMS_CONTAINS.push([r.exports.CLASS_REFERENCE,f,p]),r.contains=r.contains.concat([d,i,s,p]),u(r,"shebang",t.SHEBANG()),u(r,"use_strict",a);let h=r.contains.find(m=>m.label==="func.def");return h.relevance=0,Object.assign(r,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),r}function FS(t){let e=t.regex,r={className:"string",begin:/"(""|[^/n])"C\b/},n={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},o=/\d{1,2}\/\d{1,2}\/\d{4}/,i=/\d{4}-\d{1,2}-\d{1,2}/,s=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,a=/\d{1,2}(:\d{1,2}){1,2}/,l={className:"literal",variants:[{begin:e.concat(/# */,e.either(i,o),/ *#/)},{begin:e.concat(/# */,a,/ *#/)},{begin:e.concat(/# */,s,/ *#/)},{begin:e.concat(/# */,e.either(i,o),/ +/,e.either(s,a),/ *#/)}]},c={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},d={className:"label",begin:/^\w+:/},u=t.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),f=t.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return {name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[r,n,l,c,d,u,f,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[f]}]}}function zS(t){t.regex;let e=t.COMMENT(/\(;/,/;\)/);e.contains.push("self");let r=t.COMMENT(/;;/,/$/),n=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],o={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},i={className:"variable",begin:/\$[\w_]+/},s={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},a={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},l={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},c={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return {name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:n},contains:[r,e,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},i,s,o,t.QUOTE_STRING_MODE,l,c,a]}}function HS(t){let e=t.regex,r=e.concat(/[\p{L}_]/u,e.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),n=/[\p{L}0-9._:-]+/u,o={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},i={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},s=t.inherit(i,{begin:/\(/,end:/\)/}),a=t.inherit(t.APOS_STRING_MODE,{className:"string"}),l=t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),c={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:n,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[o]},{begin:/'/,end:/'/,contains:[o]},{begin:/[^\s"'=<>`]+/}]}]}]};return {name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[i,l,a,s,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[i,s,l,a]}]}]},t.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},o,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[l]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[c],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[c],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:e.concat(/</,e.lookahead(e.concat(r,e.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:r,relevance:0,starts:c}]},{className:"tag",begin:e.concat(/<\//,e.lookahead(e.concat(r,/>/))),contains:[{className:"name",begin:r,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function US(t){let e="true false yes no null",r="[\\w#;/?:@&=+$,.~*'()[\\]]+",n={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},o={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},i={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},s={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[t.BACKSLASH_ESCAPE,o]},a=t.inherit(s,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),l="[0-9]{4}(-[0-9][0-9]){0,2}",c="([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?",d="(\\.[0-9]*)?",u="([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?",f={className:"number",begin:"\\b"+l+c+d+u+"\\b"},p={end:",",endsWithParent:!0,excludeEnd:!0,keywords:e,relevance:0},h={begin:/\{/,end:/\}/,contains:[p],illegal:"\\n",relevance:0},m={begin:"\\[",end:"\\]",contains:[p],illegal:"\\n",relevance:0},g=[n,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+r},{className:"type",begin:"!<"+r+">"},{className:"type",begin:"!"+r},{className:"type",begin:"!!"+r},{className:"meta",begin:"&"+t.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+t.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},t.HASH_COMMENT_MODE,{beginKeywords:e,keywords:{literal:e}},f,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},h,m,i,s],b=[...g];return b.pop(),b.push(a),p.contains=b,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:g}}var fm={arduino:Bk,bash:Fk,c:zk,cpp:Hk,csharp:Uk,css:Vk,diff:Kk,go:Wk,graphql:Gk,ini:qk,java:Xk,javascript:tS,json:rS,kotlin:nS,less:sS,lua:aS,makefile:lS,markdown:cS,objectivec:dS,perl:uS,php:fS,"php-template":pS,plaintext:hS,python:mS,"python-repl":gS,r:bS,ruby:vS,rust:yS,scss:wS,shell:xS,sql:ES,swift:MS,typescript:BS,vbnet:FS,wasm:zS,xml:HS,yaml:US};var VS={},K4="hljs-";function hm(t){let e=Md.newInstance();return t&&i(t),{highlight:r,highlightAuto:n,listLanguages:o,register:i,registerAlias:s,registered:a};function r(l,c,d){let u=d||VS,f=typeof u.prefix=="string"?u.prefix:K4;if(!e.getLanguage(l))throw new Error("Unknown language: `"+l+"` is not registered");e.configure({__emitter:pm,classPrefix:f});let p=e.highlight(c,{ignoreIllegals:!0,language:l});if(p.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:p.errorRaised});let h=p._emitter.root,m=h.data;return m.language=p.language,m.relevance=p.relevance,h}function n(l,c){let u=(c||VS).subset||o(),f=-1,p=0,h;for(;++f<u.length;){let m=u[f];if(!e.getLanguage(m))continue;let g=r(m,l,c);g.data&&g.data.relevance!==void 0&&g.data.relevance>p&&(p=g.data.relevance,h=g);}return h||{type:"root",children:[],data:{language:void 0,relevance:p}}}function o(){return e.listLanguages()}function i(l,c){if(typeof l=="string")e.registerLanguage(l,c);else {let d;for(d in l)Object.hasOwn(l,d)&&e.registerLanguage(d,l[d]);}}function s(l,c){if(typeof l=="string")e.registerAliases(typeof c=="string"?c:[...c],{languageName:l});else {let d;for(d in l)if(Object.hasOwn(l,d)){let u=l[d];e.registerAliases(typeof u=="string"?u:[...u],{languageName:d});}}}function a(l){return !!e.getLanguage(l)}}var pm=class{constructor(e){this.options=e,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root];}addText(e){if(e==="")return;let r=this.stack[this.stack.length-1],n=r.children[r.children.length-1];n&&n.type==="text"?n.value+=e:r.children.push({type:"text",value:e});}startScope(e){this.openNode(String(e));}endScope(){this.closeNode();}__addSublanguage(e,r){let n=this.stack[this.stack.length-1],o=e.root.children;r?n.children.push({type:"element",tagName:"span",properties:{className:[r]},children:o}):n.children.push(...o);}openNode(e){let r=this,n=e.split(".").map(function(s,a){return a?s+"_".repeat(a):r.options.classPrefix+s}),o=this.stack[this.stack.length-1],i={type:"element",tagName:"span",properties:{className:n},children:[]};o.children.push(i),this.stack.push(i);}closeNode(){this.stack.pop();}finalize(){}toHTML(){return ""}};var bn=new ae("slashCommands"),KS=se.create({name:"slashCommands",addOptions(){return {commands:[],onSelectCommand:()=>{}}},addCommands(){return {selectSlashCommand:t=>({editor:e})=>{let r=bn.getState(e.state);if(r&&r.active&&r.filteredCommands[t]){let n=r.filteredCommands[t],{from:o,to:i}=r.range;return e.chain().deleteRange({from:o,to:i}).focus().run(),this.options.onSelectCommand(n),!0}return !1}}},addKeyboardShortcuts(){return {ArrowUp:({editor:t})=>{let e=bn.getState(t.state);if(e&&e.active){let r=e.selectedIndex>0?e.selectedIndex-1:e.filteredCommands.length-1;return t.view.dispatch(t.state.tr.setMeta(bn,{selectedIndex:r})),!0}return !1},ArrowDown:({editor:t})=>{let e=bn.getState(t.state);if(e&&e.active){let r=e.selectedIndex<e.filteredCommands.length-1?e.selectedIndex+1:0;return t.view.dispatch(t.state.tr.setMeta(bn,{selectedIndex:r})),!0}return !1},Enter:({editor:t})=>{let e=bn.getState(t.state);return e&&e.active?(t.commands.selectSlashCommand(e.selectedIndex),!0):!1},Escape:({editor:t})=>{let e=bn.getState(t.state);return e&&e.active?(t.view.dispatch(t.state.tr.setMeta(bn,{active:!1})),!0):!1}}},addProseMirrorPlugins(){return [new oe({key:bn,state:{init(){return {active:!1,range:{from:0,to:0},query:"",filteredCommands:[],selectedIndex:0}},apply(t,e,r,n){let o=t.getMeta(bn);if(o)return {...e,...o};let{selection:i}=n,{empty:s,$from:a}=i;if(!s)return {...e,active:!1};let c=a.parent.textBetween(Math.max(0,a.parentOffset-50),a.parentOffset,null,"\uFFFC").match(/\/(\w*)$/);if(c){let d=c[1].toLowerCase(),u=this.options.commands.filter(f=>f.command.toLowerCase().includes(d)||f.description.toLowerCase().includes(d));return {active:!0,range:{from:a.pos-c[0].length,to:a.pos},query:d,filteredCommands:u,selectedIndex:0}}return {...e,active:!1}}},props:{decorations(t){let e=this.getState(t);if(!e.active)return Ee.empty;let{from:r}=e.range,n=Be.widget(r,()=>{let o=document.createElement("div");if(o.className="slash-commands-menu",e.filteredCommands.forEach((i,s)=>{let a=document.createElement("div");if(a.className=`slash-command-item ${s===e.selectedIndex?"selected":""}`,i.icon){let u=document.createElement("div");u.innerHTML=i.icon,a.appendChild(u);}let l=document.createElement("div"),c=document.createElement("div");c.className="command-name",c.textContent=`/${i.command}`,l.appendChild(c);let d=document.createElement("div");d.className="command-description",d.textContent=i.description,l.appendChild(d),a.appendChild(l),a.addEventListener("click",()=>{t.editor.commands.selectSlashCommand(s);}),o.appendChild(a);}),e.filteredCommands.length===0){let i=document.createElement("div");i.className="text-gray-500 p-3 text-sm",i.textContent="No commands found",o.appendChild(i);}return o});return Ee.create(t.doc,[n])}}})]}});function bs(t){let e=t+"CollectionProvider",[r,n]=Ut(e),[o,i]=r(e,{collectionRef:{current:null},itemMap:new Map}),s=m=>{let{scope:g,children:b}=m,v=ee__namespace.default.useRef(null),y=ee__namespace.default.useRef(new Map).current;return jsxRuntime.jsx(o,{scope:g,itemMap:y,collectionRef:v,children:b})};s.displayName=e;let a=t+"CollectionSlot",l=Br(a),c=ee__namespace.default.forwardRef((m,g)=>{let{scope:b,children:v}=m,y=i(a,b),x=Le(g,y.collectionRef);return jsxRuntime.jsx(l,{ref:x,children:v})});c.displayName=a;let d=t+"CollectionItemSlot",u="data-radix-collection-item",f=Br(d),p=ee__namespace.default.forwardRef((m,g)=>{let{scope:b,children:v,...y}=m,x=ee__namespace.default.useRef(null),E=Le(g,x),S=i(d,b);return ee__namespace.default.useEffect(()=>(S.itemMap.set(x,{ref:x,...y}),()=>void S.itemMap.delete(x))),jsxRuntime.jsx(f,{[u]:"",ref:E,children:v})});p.displayName=d;function h(m){let g=i(t+"CollectionConsumer",m);return ee__namespace.default.useCallback(()=>{let v=g.collectionRef.current;if(!v)return [];let y=Array.from(v.querySelectorAll(`[${u}]`));return Array.from(g.itemMap.values()).sort((S,R)=>y.indexOf(S.ref.current)-y.indexOf(R.ref.current))},[g.collectionRef,g.itemMap])}return [{Provider:s,Slot:c,ItemSlot:p},h,n]}var G4=ee__namespace.createContext(void 0);function Fd(t){let e=ee__namespace.useContext(G4);return t||e||"ltr"}var q4="Arrow",YS=ee__namespace.forwardRef((t,e)=>{let{children:r,width:n=10,height:o=5,...i}=t;return jsxRuntime.jsx(fe.svg,{...i,ref:e,width:n,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?r:jsxRuntime.jsx("polygon",{points:"0,0 30,0 15,10"})})});YS.displayName=q4;var XS=YS;function ZS(t){let[e,r]=ee__namespace.useState(void 0);return Vt(()=>{if(t){r({width:t.offsetWidth,height:t.offsetHeight});let n=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;let i=o[0],s,a;if("borderBoxSize"in i){let l=i.borderBoxSize,c=Array.isArray(l)?l[0]:l;s=c.inlineSize,a=c.blockSize;}else s=t.offsetWidth,a=t.offsetHeight;r({width:s,height:a});});return n.observe(t,{box:"border-box"}),()=>n.unobserve(t)}else r(void 0);},[t]),e}var bm="Popper",[QS,vs]=Ut(bm),[Y4,eC]=QS(bm),tC=t=>{let{__scopePopper:e,children:r}=t,[n,o]=ee__namespace.useState(null);return jsxRuntime.jsx(Y4,{scope:e,anchor:n,onAnchorChange:o,children:r})};tC.displayName=bm;var rC="PopperAnchor",nC=ee__namespace.forwardRef((t,e)=>{let{__scopePopper:r,virtualRef:n,...o}=t,i=eC(rC,r),s=ee__namespace.useRef(null),a=Le(e,s);return ee__namespace.useEffect(()=>{i.onAnchorChange(n?.current||s.current);}),n?null:jsxRuntime.jsx(fe.div,{...o,ref:a})});nC.displayName=rC;var vm="PopperContent",[X4,J4]=QS(vm),oC=ee__namespace.forwardRef((t,e)=>{let{__scopePopper:r,side:n="bottom",sideOffset:o=0,align:i="center",alignOffset:s=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:d=0,sticky:u="partial",hideWhenDetached:f=!1,updatePositionStrategy:p="optimized",onPlaced:h,...m}=t,g=eC(vm,r),[b,v]=ee__namespace.useState(null),y=Le(e,W=>v(W)),[x,E]=ee__namespace.useState(null),S=ZS(x),R=S?.width??0,w=S?.height??0,N=n+(i!=="center"?"-"+i:""),M=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},B=Array.isArray(c)?c:[c],U=B.length>0,K={padding:M,boundary:B.filter(Q4),altBoundary:U},{refs:P,floatingStyles:V,placement:C,isPositioned:T,middlewareData:_}=ml({strategy:"fixed",placement:N,whileElementsMounted:(...W)=>Is(...W,{animationFrame:p==="always"}),elements:{reference:g.anchor},middleware:[gl({mainAxis:o+w,alignmentAxis:s}),l&&bl({mainAxis:!0,crossAxis:!1,limiter:u==="partial"?vl():void 0,...K}),l&&yl({...K}),wl({...K,apply:({elements:W,rects:ue,availableWidth:Oe,availableHeight:Se})=>{let{width:le,height:Ce}=ue.reference,$e=W.floating.style;$e.setProperty("--radix-popper-available-width",`${Oe}px`),$e.setProperty("--radix-popper-available-height",`${Se}px`),$e.setProperty("--radix-popper-anchor-width",`${le}px`),$e.setProperty("--radix-popper-anchor-height",`${Ce}px`);}}),x&&El({element:x,padding:a}),eB({arrowWidth:R,arrowHeight:w}),f&&xl({strategy:"referenceHidden",...K})]}),[A,L]=aC(C),Y=pt(h);Vt(()=>{T&&Y?.();},[T,Y]);let te=_.arrow?.x,ke=_.arrow?.y,me=_.arrow?.centerOffset!==0,[Te,Ae]=ee__namespace.useState();return Vt(()=>{b&&Ae(window.getComputedStyle(b).zIndex);},[b]),jsxRuntime.jsx("div",{ref:P.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:T?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Te,["--radix-popper-transform-origin"]:[_.transformOrigin?.x,_.transformOrigin?.y].join(" "),..._.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:jsxRuntime.jsx(X4,{scope:r,placedSide:A,onArrowChange:E,arrowX:te,arrowY:ke,shouldHideArrow:me,children:jsxRuntime.jsx(fe.div,{"data-side":A,"data-align":L,...m,ref:y,style:{...m.style,animation:T?void 0:"none"}})})})});oC.displayName=vm;var iC="PopperArrow",Z4={top:"bottom",right:"left",bottom:"top",left:"right"},sC=ee__namespace.forwardRef(function(e,r){let{__scopePopper:n,...o}=e,i=J4(iC,n),s=Z4[i.placedSide];return jsxRuntime.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:jsxRuntime.jsx(XS,{...o,ref:r,style:{...o.style,display:"block"}})})});sC.displayName=iC;function Q4(t){return t!==null}var eB=t=>({name:"transformOrigin",options:t,fn(e){let{placement:r,rects:n,middlewareData:o}=e,s=o.arrow?.centerOffset!==0,a=s?0:t.arrowWidth,l=s?0:t.arrowHeight,[c,d]=aC(r),u={start:"0%",center:"50%",end:"100%"}[d],f=(o.arrow?.x??0)+a/2,p=(o.arrow?.y??0)+l/2,h="",m="";return c==="bottom"?(h=s?u:`${f}px`,m=`${-l}px`):c==="top"?(h=s?u:`${f}px`,m=`${n.floating.height+l}px`):c==="right"?(h=`${-l}px`,m=s?u:`${p}px`):c==="left"&&(h=`${n.floating.width+l}px`,m=s?u:`${p}px`),{data:{x:h,y:m}}}});function aC(t){let[e,r="center"]=t.split("-");return [e,r]}var Fa=tC,za=nC,zd=oC,Hd=sC;var ym="rovingFocusGroup.onEntryFocus",tB={bubbles:!1,cancelable:!0},Ha="RovingFocusGroup",[wm,cC,rB]=bs(Ha),[nB,xm]=Ut(Ha,[rB]),[oB,iB]=nB(Ha),dC=ee__namespace.forwardRef((t,e)=>jsxRuntime.jsx(wm.Provider,{scope:t.__scopeRovingFocusGroup,children:jsxRuntime.jsx(wm.Slot,{scope:t.__scopeRovingFocusGroup,children:jsxRuntime.jsx(sB,{...t,ref:e})})}));dC.displayName=Ha;var sB=ee__namespace.forwardRef((t,e)=>{let{__scopeRovingFocusGroup:r,orientation:n,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:d=!1,...u}=t,f=ee__namespace.useRef(null),p=Le(e,f),h=Fd(i),[m,g]=Zr({prop:s,defaultProp:a??null,onChange:l,caller:Ha}),[b,v]=ee__namespace.useState(!1),y=pt(c),x=cC(r),E=ee__namespace.useRef(!1),[S,R]=ee__namespace.useState(0);return ee__namespace.useEffect(()=>{let w=f.current;if(w)return w.addEventListener(ym,y),()=>w.removeEventListener(ym,y)},[y]),jsxRuntime.jsx(oB,{scope:r,orientation:n,dir:h,loop:o,currentTabStopId:m,onItemFocus:ee__namespace.useCallback(w=>g(w),[g]),onItemShiftTab:ee__namespace.useCallback(()=>v(!0),[]),onFocusableItemAdd:ee__namespace.useCallback(()=>R(w=>w+1),[]),onFocusableItemRemove:ee__namespace.useCallback(()=>R(w=>w-1),[]),children:jsxRuntime.jsx(fe.div,{tabIndex:b||S===0?-1:0,"data-orientation":n,...u,ref:p,style:{outline:"none",...t.style},onMouseDown:J(t.onMouseDown,()=>{E.current=!0;}),onFocus:J(t.onFocus,w=>{let N=!E.current;if(w.target===w.currentTarget&&N&&!b){let M=new CustomEvent(ym,tB);if(w.currentTarget.dispatchEvent(M),!M.defaultPrevented){let B=x().filter(C=>C.focusable),U=B.find(C=>C.active),K=B.find(C=>C.id===m),V=[U,K,...B].filter(Boolean).map(C=>C.ref.current);pC(V,d);}}E.current=!1;}),onBlur:J(t.onBlur,()=>v(!1))})})}),uC="RovingFocusGroupItem",fC=ee__namespace.forwardRef((t,e)=>{let{__scopeRovingFocusGroup:r,focusable:n=!0,active:o=!1,tabStopId:i,children:s,...a}=t,l=ir(),c=i||l,d=iB(uC,r),u=d.currentTabStopId===c,f=cC(r),{onFocusableItemAdd:p,onFocusableItemRemove:h,currentTabStopId:m}=d;return ee__namespace.useEffect(()=>{if(n)return p(),()=>h()},[n,p,h]),jsxRuntime.jsx(wm.ItemSlot,{scope:r,id:c,focusable:n,active:o,children:jsxRuntime.jsx(fe.span,{tabIndex:u?0:-1,"data-orientation":d.orientation,...a,ref:e,onMouseDown:J(t.onMouseDown,g=>{n?d.onItemFocus(c):g.preventDefault();}),onFocus:J(t.onFocus,()=>d.onItemFocus(c)),onKeyDown:J(t.onKeyDown,g=>{if(g.key==="Tab"&&g.shiftKey){d.onItemShiftTab();return}if(g.target!==g.currentTarget)return;let b=cB(g,d.orientation,d.dir);if(b!==void 0){if(g.metaKey||g.ctrlKey||g.altKey||g.shiftKey)return;g.preventDefault();let y=f().filter(x=>x.focusable).map(x=>x.ref.current);if(b==="last")y.reverse();else if(b==="prev"||b==="next"){b==="prev"&&y.reverse();let x=y.indexOf(g.currentTarget);y=d.loop?dB(y,x+1):y.slice(x+1);}setTimeout(()=>pC(y));}}),children:typeof s=="function"?s({isCurrentTabStop:u,hasTabStop:m!=null}):s})})});fC.displayName=uC;var aB={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function lB(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function cB(t,e,r){let n=lB(t.key,r);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return aB[n]}function pC(t,e=!1){let r=document.activeElement;for(let n of t)if(n===r||(n.focus({preventScroll:e}),document.activeElement!==r))return}function dB(t,e){return t.map((r,n)=>t[(e+n)%t.length])}var hC=dC,mC=fC;var Em=["Enter"," "],fB=["ArrowDown","PageUp","Home"],bC=["ArrowUp","PageDown","End"],pB=[...fB,...bC],hB={ltr:[...Em,"ArrowRight"],rtl:[...Em,"ArrowLeft"]},mB={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Wa="Menu",[Va,gB,bB]=bs(Wa),[vi,km]=Ut(Wa,[bB,vs,xm]),Ga=vs(),vC=xm(),[yC,vo]=vi(Wa),[vB,qa]=vi(Wa),wC=t=>{let{__scopeMenu:e,open:r=!1,children:n,dir:o,onOpenChange:i,modal:s=!0}=t,a=Ga(e),[l,c]=ee__namespace.useState(null),d=ee__namespace.useRef(!1),u=pt(i),f=Fd(o);return ee__namespace.useEffect(()=>{let p=()=>{d.current=!0,document.addEventListener("pointerdown",h,{capture:!0,once:!0}),document.addEventListener("pointermove",h,{capture:!0,once:!0});},h=()=>d.current=!1;return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",h,{capture:!0}),document.removeEventListener("pointermove",h,{capture:!0});}},[]),jsxRuntime.jsx(Fa,{...a,children:jsxRuntime.jsx(yC,{scope:e,open:r,onOpenChange:u,content:l,onContentChange:c,children:jsxRuntime.jsx(vB,{scope:e,onClose:ee__namespace.useCallback(()=>u(!1),[u]),isUsingKeyboardRef:d,dir:f,modal:s,children:n})})})};wC.displayName=Wa;var yB="MenuAnchor",Sm=ee__namespace.forwardRef((t,e)=>{let{__scopeMenu:r,...n}=t,o=Ga(r);return jsxRuntime.jsx(za,{...o,...n,ref:e})});Sm.displayName=yB;var Cm="MenuPortal",[wB,xC]=vi(Cm,{forceMount:void 0}),EC=t=>{let{__scopeMenu:e,forceMount:r,children:n,container:o}=t,i=vo(Cm,e);return jsxRuntime.jsx(wB,{scope:e,forceMount:r,children:jsxRuntime.jsx(Jt,{present:r||i.open,children:jsxRuntime.jsx(Rn,{asChild:!0,container:o,children:n})})})};EC.displayName=Cm;var Pr="MenuContent",[xB,Rm]=vi(Pr),kC=ee__namespace.forwardRef((t,e)=>{let r=xC(Pr,t.__scopeMenu),{forceMount:n=r.forceMount,...o}=t,i=vo(Pr,t.__scopeMenu),s=qa(Pr,t.__scopeMenu);return jsxRuntime.jsx(Va.Provider,{scope:t.__scopeMenu,children:jsxRuntime.jsx(Jt,{present:n||i.open,children:jsxRuntime.jsx(Va.Slot,{scope:t.__scopeMenu,children:s.modal?jsxRuntime.jsx(EB,{...o,ref:e}):jsxRuntime.jsx(kB,{...o,ref:e})})})})}),EB=ee__namespace.forwardRef((t,e)=>{let r=vo(Pr,t.__scopeMenu),n=ee__namespace.useRef(null),o=Le(e,n);return ee__namespace.useEffect(()=>{let i=n.current;if(i)return Jn(i)},[]),jsxRuntime.jsx(Tm,{...t,ref:o,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:J(t.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),kB=ee__namespace.forwardRef((t,e)=>{let r=vo(Pr,t.__scopeMenu);return jsxRuntime.jsx(Tm,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),SB=Br("MenuContent.ScrollLock"),Tm=ee__namespace.forwardRef((t,e)=>{let{__scopeMenu:r,loop:n=!1,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:u,onInteractOutside:f,onDismiss:p,disableOutsideScroll:h,...m}=t,g=vo(Pr,r),b=qa(Pr,r),v=Ga(r),y=vC(r),x=gB(r),[E,S]=ee__namespace.useState(null),R=ee__namespace.useRef(null),w=Le(e,R,g.onContentChange),N=ee__namespace.useRef(0),M=ee__namespace.useRef(""),B=ee__namespace.useRef(0),U=ee__namespace.useRef(null),K=ee__namespace.useRef("right"),P=ee__namespace.useRef(0),V=h?Vo:ee__namespace.Fragment,C=h?{as:SB,allowPinchZoom:!0}:void 0,T=A=>{let L=M.current+A,Y=x().filter(W=>!W.disabled),te=document.activeElement,ke=Y.find(W=>W.ref.current===te)?.textValue,me=Y.map(W=>W.textValue),Te=$B(me,L,ke),Ae=Y.find(W=>W.textValue===Te)?.ref.current;((function W(ue){M.current=ue,window.clearTimeout(N.current),ue!==""&&(N.current=window.setTimeout(()=>W(""),1e3));}))(L),Ae&&setTimeout(()=>Ae.focus());};ee__namespace.useEffect(()=>()=>window.clearTimeout(N.current),[]),Li();let _=ee__namespace.useCallback(A=>K.current===U.current?.side&&FB(A,U.current?.area),[]);return jsxRuntime.jsx(xB,{scope:r,searchRef:M,onItemEnter:ee__namespace.useCallback(A=>{_(A)&&A.preventDefault();},[_]),onItemLeave:ee__namespace.useCallback(A=>{_(A)||(R.current?.focus(),S(null));},[_]),onTriggerLeave:ee__namespace.useCallback(A=>{_(A)&&A.preventDefault();},[_]),pointerGraceTimerRef:B,onPointerGraceIntentChange:ee__namespace.useCallback(A=>{U.current=A;},[]),children:jsxRuntime.jsx(V,{...C,children:jsxRuntime.jsx(Ho,{asChild:!0,trapped:o,onMountAutoFocus:J(i,A=>{A.preventDefault(),R.current?.focus({preventScroll:!0});}),onUnmountAutoFocus:s,children:jsxRuntime.jsx(Qn,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:u,onInteractOutside:f,onDismiss:p,children:jsxRuntime.jsx(hC,{asChild:!0,...y,dir:b.dir,orientation:"vertical",loop:n,currentTabStopId:E,onCurrentTabStopIdChange:S,onEntryFocus:J(l,A=>{b.isUsingKeyboardRef.current||A.preventDefault();}),preventScrollOnEntryFocus:!0,children:jsxRuntime.jsx(zd,{role:"menu","aria-orientation":"vertical","data-state":FC(g.open),"data-radix-menu-content":"",dir:b.dir,...v,...m,ref:w,style:{outline:"none",...m.style},onKeyDown:J(m.onKeyDown,A=>{let Y=A.target.closest("[data-radix-menu-content]")===A.currentTarget,te=A.ctrlKey||A.altKey||A.metaKey,ke=A.key.length===1;Y&&(A.key==="Tab"&&A.preventDefault(),!te&&ke&&T(A.key));let me=R.current;if(A.target!==me||!pB.includes(A.key))return;A.preventDefault();let Ae=x().filter(W=>!W.disabled).map(W=>W.ref.current);bC.includes(A.key)&&Ae.reverse(),IB(Ae);}),onBlur:J(t.onBlur,A=>{A.currentTarget.contains(A.target)||(window.clearTimeout(N.current),M.current="");}),onPointerMove:J(t.onPointerMove,Ka(A=>{let L=A.target,Y=P.current!==A.clientX;if(A.currentTarget.contains(L)&&Y){let te=A.clientX>P.current?"right":"left";K.current=te,P.current=A.clientX;}}))})})})})})})});kC.displayName=Pr;var CB="MenuGroup",Nm=ee__namespace.forwardRef((t,e)=>{let{__scopeMenu:r,...n}=t;return jsxRuntime.jsx(fe.div,{role:"group",...n,ref:e})});Nm.displayName=CB;var RB="MenuLabel",SC=ee__namespace.forwardRef((t,e)=>{let{__scopeMenu:r,...n}=t;return jsxRuntime.jsx(fe.div,{...n,ref:e})});SC.displayName=RB;var Ud="MenuItem",gC="menu.itemSelect",Kd=ee__namespace.forwardRef((t,e)=>{let{disabled:r=!1,onSelect:n,...o}=t,i=ee__namespace.useRef(null),s=qa(Ud,t.__scopeMenu),a=Rm(Ud,t.__scopeMenu),l=Le(e,i),c=ee__namespace.useRef(!1),d=()=>{let u=i.current;if(!r&&u){let f=new CustomEvent(gC,{bubbles:!0,cancelable:!0});u.addEventListener(gC,p=>n?.(p),{once:!0}),Ei(u,f),f.defaultPrevented?c.current=!1:s.onClose();}};return jsxRuntime.jsx(CC,{...o,ref:l,disabled:r,onClick:J(t.onClick,d),onPointerDown:u=>{t.onPointerDown?.(u),c.current=!0;},onPointerUp:J(t.onPointerUp,u=>{c.current||u.currentTarget?.click();}),onKeyDown:J(t.onKeyDown,u=>{let f=a.searchRef.current!=="";r||f&&u.key===" "||Em.includes(u.key)&&(u.currentTarget.click(),u.preventDefault());})})});Kd.displayName=Ud;var CC=ee__namespace.forwardRef((t,e)=>{let{__scopeMenu:r,disabled:n=!1,textValue:o,...i}=t,s=Rm(Ud,r),a=vC(r),l=ee__namespace.useRef(null),c=Le(e,l),[d,u]=ee__namespace.useState(!1),[f,p]=ee__namespace.useState("");return ee__namespace.useEffect(()=>{let h=l.current;h&&p((h.textContent??"").trim());},[i.children]),jsxRuntime.jsx(Va.ItemSlot,{scope:r,disabled:n,textValue:o??f,children:jsxRuntime.jsx(mC,{asChild:!0,...a,focusable:!n,children:jsxRuntime.jsx(fe.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...i,ref:c,onPointerMove:J(t.onPointerMove,Ka(h=>{n?s.onItemLeave(h):(s.onItemEnter(h),h.defaultPrevented||h.currentTarget.focus({preventScroll:!0}));})),onPointerLeave:J(t.onPointerLeave,Ka(h=>s.onItemLeave(h))),onFocus:J(t.onFocus,()=>u(!0)),onBlur:J(t.onBlur,()=>u(!1))})})})}),TB="MenuCheckboxItem",RC=ee__namespace.forwardRef((t,e)=>{let{checked:r=!1,onCheckedChange:n,...o}=t;return jsxRuntime.jsx(AC,{scope:t.__scopeMenu,checked:r,children:jsxRuntime.jsx(Kd,{role:"menuitemcheckbox","aria-checked":Vd(r)?"mixed":r,...o,ref:e,"data-state":Am(r),onSelect:J(o.onSelect,()=>n?.(Vd(r)?!0:!r),{checkForDefaultPrevented:!1})})})});RC.displayName=TB;var TC="MenuRadioGroup",[NB,_B]=vi(TC,{value:void 0,onValueChange:()=>{}}),NC=ee__namespace.forwardRef((t,e)=>{let{value:r,onValueChange:n,...o}=t,i=pt(n);return jsxRuntime.jsx(NB,{scope:t.__scopeMenu,value:r,onValueChange:i,children:jsxRuntime.jsx(Nm,{...o,ref:e})})});NC.displayName=TC;var _C="MenuRadioItem",MC=ee__namespace.forwardRef((t,e)=>{let{value:r,...n}=t,o=_B(_C,t.__scopeMenu),i=r===o.value;return jsxRuntime.jsx(AC,{scope:t.__scopeMenu,checked:i,children:jsxRuntime.jsx(Kd,{role:"menuitemradio","aria-checked":i,...n,ref:e,"data-state":Am(i),onSelect:J(n.onSelect,()=>o.onValueChange?.(r),{checkForDefaultPrevented:!1})})})});MC.displayName=_C;var _m="MenuItemIndicator",[AC,MB]=vi(_m,{checked:!1}),OC=ee__namespace.forwardRef((t,e)=>{let{__scopeMenu:r,forceMount:n,...o}=t,i=MB(_m,r);return jsxRuntime.jsx(Jt,{present:n||Vd(i.checked)||i.checked===!0,children:jsxRuntime.jsx(fe.span,{...o,ref:e,"data-state":Am(i.checked)})})});OC.displayName=_m;var AB="MenuSeparator",DC=ee__namespace.forwardRef((t,e)=>{let{__scopeMenu:r,...n}=t;return jsxRuntime.jsx(fe.div,{role:"separator","aria-orientation":"horizontal",...n,ref:e})});DC.displayName=AB;var OB="MenuArrow",PC=ee__namespace.forwardRef((t,e)=>{let{__scopeMenu:r,...n}=t,o=Ga(r);return jsxRuntime.jsx(Hd,{...o,...n,ref:e})});PC.displayName=OB;var Mm="MenuSub",[DB,IC]=vi(Mm);var Ua="MenuSubTrigger",LC=ee__namespace.forwardRef((t,e)=>{let r=vo(Ua,t.__scopeMenu),n=qa(Ua,t.__scopeMenu),o=IC(Ua,t.__scopeMenu),i=Rm(Ua,t.__scopeMenu),s=ee__namespace.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=i,c={__scopeMenu:t.__scopeMenu},d=ee__namespace.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null;},[]);return ee__namespace.useEffect(()=>d,[d]),ee__namespace.useEffect(()=>{let u=a.current;return ()=>{window.clearTimeout(u),l(null);}},[a,l]),jsxRuntime.jsx(Sm,{asChild:!0,...c,children:jsxRuntime.jsx(CC,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":o.contentId,"data-state":FC(r.open),...t,ref:Ro(e,o.onTriggerChange),onClick:u=>{t.onClick?.(u),!(t.disabled||u.defaultPrevented)&&(u.currentTarget.focus(),r.open||r.onOpenChange(!0));},onPointerMove:J(t.onPointerMove,Ka(u=>{i.onItemEnter(u),!u.defaultPrevented&&!t.disabled&&!r.open&&!s.current&&(i.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{r.onOpenChange(!0),d();},100));})),onPointerLeave:J(t.onPointerLeave,Ka(u=>{d();let f=r.content?.getBoundingClientRect();if(f){let p=r.content?.dataset.side,h=p==="right",m=h?-5:5,g=f[h?"left":"right"],b=f[h?"right":"left"];i.onPointerGraceIntentChange({area:[{x:u.clientX+m,y:u.clientY},{x:g,y:f.top},{x:b,y:f.top},{x:b,y:f.bottom},{x:g,y:f.bottom}],side:p}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300);}else {if(i.onTriggerLeave(u),u.defaultPrevented)return;i.onPointerGraceIntentChange(null);}})),onKeyDown:J(t.onKeyDown,u=>{let f=i.searchRef.current!=="";t.disabled||f&&u.key===" "||hB[n.dir].includes(u.key)&&(r.onOpenChange(!0),r.content?.focus(),u.preventDefault());})})})});LC.displayName=Ua;var $C="MenuSubContent",BC=ee__namespace.forwardRef((t,e)=>{let r=xC(Pr,t.__scopeMenu),{forceMount:n=r.forceMount,...o}=t,i=vo(Pr,t.__scopeMenu),s=qa(Pr,t.__scopeMenu),a=IC($C,t.__scopeMenu),l=ee__namespace.useRef(null),c=Le(e,l);return jsxRuntime.jsx(Va.Provider,{scope:t.__scopeMenu,children:jsxRuntime.jsx(Jt,{present:n||i.open,children:jsxRuntime.jsx(Va.Slot,{scope:t.__scopeMenu,children:jsxRuntime.jsx(Tm,{id:a.contentId,"aria-labelledby":a.triggerId,...o,ref:c,align:"start",side:s.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{s.isUsingKeyboardRef.current&&l.current?.focus(),d.preventDefault();},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:J(t.onFocusOutside,d=>{d.target!==a.trigger&&i.onOpenChange(!1);}),onEscapeKeyDown:J(t.onEscapeKeyDown,d=>{s.onClose(),d.preventDefault();}),onKeyDown:J(t.onKeyDown,d=>{let u=d.currentTarget.contains(d.target),f=mB[s.dir].includes(d.key);u&&f&&(i.onOpenChange(!1),a.trigger?.focus(),d.preventDefault());})})})})})});BC.displayName=$C;function FC(t){return t?"open":"closed"}function Vd(t){return t==="indeterminate"}function Am(t){return Vd(t)?"indeterminate":t?"checked":"unchecked"}function IB(t){let e=document.activeElement;for(let r of t)if(r===e||(r.focus(),document.activeElement!==e))return}function LB(t,e){return t.map((r,n)=>t[(e+n)%t.length])}function $B(t,e,r){let o=e.length>1&&Array.from(e).every(c=>c===e[0])?e[0]:e,i=r?t.indexOf(r):-1,s=LB(t,Math.max(i,0));o.length===1&&(s=s.filter(c=>c!==r));let l=s.find(c=>c.toLowerCase().startsWith(o.toLowerCase()));return l!==r?l:void 0}function BB(t,e){let{x:r,y:n}=t,o=!1;for(let i=0,s=e.length-1;i<e.length;s=i++){let a=e[i],l=e[s],c=a.x,d=a.y,u=l.x,f=l.y;d>n!=f>n&&r<(u-c)*(n-d)/(f-d)+c&&(o=!o);}return o}function FB(t,e){if(!e)return !1;let r={x:t.clientX,y:t.clientY};return BB(r,e)}function Ka(t){return e=>e.pointerType==="mouse"?t(e):void 0}var zC=wC,HC=Sm,UC=EC,VC=kC,KC=Nm,WC=SC,GC=Kd,qC=RC,jC=NC,YC=MC,XC=OC,JC=DC,ZC=PC;var QC=LC,eR=BC;var Wd="DropdownMenu",[HB,BQ]=Ut(Wd,[km]),nr=km(),[UB,tR]=HB(Wd),rR=t=>{let{__scopeDropdownMenu:e,children:r,dir:n,open:o,defaultOpen:i,onOpenChange:s,modal:a=!0}=t,l=nr(e),c=ee__namespace.useRef(null),[d,u]=Zr({prop:o,defaultProp:i??!1,onChange:s,caller:Wd});return jsxRuntime.jsx(UB,{scope:e,triggerId:ir(),triggerRef:c,contentId:ir(),open:d,onOpenChange:u,onOpenToggle:ee__namespace.useCallback(()=>u(f=>!f),[u]),modal:a,children:jsxRuntime.jsx(zC,{...l,open:d,onOpenChange:u,dir:n,modal:a,children:r})})};rR.displayName=Wd;var nR="DropdownMenuTrigger",oR=ee__namespace.forwardRef((t,e)=>{let{__scopeDropdownMenu:r,disabled:n=!1,...o}=t,i=tR(nR,r),s=nr(r);return jsxRuntime.jsx(HC,{asChild:!0,...s,children:jsxRuntime.jsx(fe.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":n?"":void 0,disabled:n,...o,ref:Ro(e,i.triggerRef),onPointerDown:J(t.onPointerDown,a=>{!n&&a.button===0&&a.ctrlKey===!1&&(i.onOpenToggle(),i.open||a.preventDefault());}),onKeyDown:J(t.onKeyDown,a=>{n||(["Enter"," "].includes(a.key)&&i.onOpenToggle(),a.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault());})})})});oR.displayName=nR;var VB="DropdownMenuPortal",iR=t=>{let{__scopeDropdownMenu:e,...r}=t,n=nr(e);return jsxRuntime.jsx(UC,{...n,...r})};iR.displayName=VB;var sR="DropdownMenuContent",aR=ee__namespace.forwardRef((t,e)=>{let{__scopeDropdownMenu:r,...n}=t,o=tR(sR,r),i=nr(r),s=ee__namespace.useRef(!1);return jsxRuntime.jsx(VC,{id:o.contentId,"aria-labelledby":o.triggerId,...i,...n,ref:e,onCloseAutoFocus:J(t.onCloseAutoFocus,a=>{s.current||o.triggerRef.current?.focus(),s.current=!1,a.preventDefault();}),onInteractOutside:J(t.onInteractOutside,a=>{let l=a.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,d=l.button===2||c;(!o.modal||d)&&(s.current=!0);}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});aR.displayName=sR;var KB="DropdownMenuGroup",WB=ee__namespace.forwardRef((t,e)=>{let{__scopeDropdownMenu:r,...n}=t,o=nr(r);return jsxRuntime.jsx(KC,{...o,...n,ref:e})});WB.displayName=KB;var GB="DropdownMenuLabel",lR=ee__namespace.forwardRef((t,e)=>{let{__scopeDropdownMenu:r,...n}=t,o=nr(r);return jsxRuntime.jsx(WC,{...o,...n,ref:e})});lR.displayName=GB;var qB="DropdownMenuItem",cR=ee__namespace.forwardRef((t,e)=>{let{__scopeDropdownMenu:r,...n}=t,o=nr(r);return jsxRuntime.jsx(GC,{...o,...n,ref:e})});cR.displayName=qB;var jB="DropdownMenuCheckboxItem",dR=ee__namespace.forwardRef((t,e)=>{let{__scopeDropdownMenu:r,...n}=t,o=nr(r);return jsxRuntime.jsx(qC,{...o,...n,ref:e})});dR.displayName=jB;var YB="DropdownMenuRadioGroup",XB=ee__namespace.forwardRef((t,e)=>{let{__scopeDropdownMenu:r,...n}=t,o=nr(r);return jsxRuntime.jsx(jC,{...o,...n,ref:e})});XB.displayName=YB;var JB="DropdownMenuRadioItem",uR=ee__namespace.forwardRef((t,e)=>{let{__scopeDropdownMenu:r,...n}=t,o=nr(r);return jsxRuntime.jsx(YC,{...o,...n,ref:e})});uR.displayName=JB;var ZB="DropdownMenuItemIndicator",fR=ee__namespace.forwardRef((t,e)=>{let{__scopeDropdownMenu:r,...n}=t,o=nr(r);return jsxRuntime.jsx(XC,{...o,...n,ref:e})});fR.displayName=ZB;var QB="DropdownMenuSeparator",pR=ee__namespace.forwardRef((t,e)=>{let{__scopeDropdownMenu:r,...n}=t,o=nr(r);return jsxRuntime.jsx(JC,{...o,...n,ref:e})});pR.displayName=QB;var eF="DropdownMenuArrow",tF=ee__namespace.forwardRef((t,e)=>{let{__scopeDropdownMenu:r,...n}=t,o=nr(r);return jsxRuntime.jsx(ZC,{...o,...n,ref:e})});tF.displayName=eF;var rF="DropdownMenuSubTrigger",hR=ee__namespace.forwardRef((t,e)=>{let{__scopeDropdownMenu:r,...n}=t,o=nr(r);return jsxRuntime.jsx(QC,{...o,...n,ref:e})});hR.displayName=rF;var nF="DropdownMenuSubContent",mR=ee__namespace.forwardRef((t,e)=>{let{__scopeDropdownMenu:r,...n}=t,o=nr(r);return jsxRuntime.jsx(eR,{...o,...n,ref:e,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});mR.displayName=nF;var gR=rR,bR=oR,vR=iR,Om=aR;var Dm=lR,Pm=cR,Im=dR;var Lm=uR,$m=fR,Bm=pR;var Fm=hR,zm=mR;var Gd=gR,qd=bR;var lF=ee__namespace.forwardRef(({className:t,inset:e,children:r,...n},o)=>jsxRuntime.jsxs(Fm,{ref:o,className:I("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",e&&"pl-8",t),...n,children:[r,jsxRuntime.jsx(lucideReact.ChevronRight,{className:"ml-auto h-4 w-4"})]}));lF.displayName=Fm.displayName;var cF=ee__namespace.forwardRef(({className:t,...e},r)=>jsxRuntime.jsx(zm,{ref:r,className:I("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...e}));cF.displayName=zm.displayName;var ja=ee__namespace.forwardRef(({className:t,sideOffset:e=4,...r},n)=>jsxRuntime.jsx(vR,{children:jsxRuntime.jsx(Om,{ref:n,sideOffset:e,className:I("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...r})}));ja.displayName=Om.displayName;var Ve=ee__namespace.forwardRef(({className:t,inset:e,...r},n)=>jsxRuntime.jsx(Pm,{ref:n,className:I("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e&&"pl-8",t),...r}));Ve.displayName=Pm.displayName;var dF=ee__namespace.forwardRef(({className:t,children:e,checked:r,...n},o)=>jsxRuntime.jsxs(Im,{ref:o,className:I("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),checked:r,...n,children:[jsxRuntime.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:jsxRuntime.jsx($m,{children:jsxRuntime.jsx(lucideReact.Check,{className:"h-4 w-4"})})}),e]}));dF.displayName=Im.displayName;var uF=ee__namespace.forwardRef(({className:t,children:e,...r},n)=>jsxRuntime.jsxs(Lm,{ref:n,className:I("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...r,children:[jsxRuntime.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:jsxRuntime.jsx($m,{children:jsxRuntime.jsx(lucideReact.Circle,{className:"h-2 w-2 fill-current"})})}),e]}));uF.displayName=Lm.displayName;var fF=ee__namespace.forwardRef(({className:t,inset:e,...r},n)=>jsxRuntime.jsx(Dm,{ref:n,className:I("px-2 py-1.5 text-sm font-semibold",e&&"pl-8",t),...r}));fF.displayName=Dm.displayName;var yo=ee__namespace.forwardRef(({className:t,...e},r)=>jsxRuntime.jsx(Bm,{ref:r,className:I("-mx-1 my-1 h-px bg-muted",t),...e}));yo.displayName=Bm.displayName;var yR=Ir__namespace.Provider,mF=classVarianceAuthority.cva("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",{variants:{variant:{default:"bg-primary text-primary-foreground",secondary:"bg-secondary text-secondary-foreground",success:"bg-green-500 text-white border-green-600",warning:"bg-yellow-500 text-white border-yellow-600",destructive:"bg-destructive text-destructive-foreground",info:"bg-blue-500 text-white border-blue-600"},size:{sm:"px-2 py-1 text-xs",md:"px-3 py-1.5 text-sm",lg:"px-4 py-2 text-base"}},defaultVariants:{variant:"default",size:"md"}}),Um=Ir__namespace.Root,Vm=Ir__namespace.Trigger,wR=ee__namespace.forwardRef(({className:t,...e},r)=>jsxRuntime.jsx(Ir__namespace.Arrow,{ref:r,className:I("fill-current",t),...e}));wR.displayName=Ir__namespace.Arrow.displayName;var Xd=ee__namespace.forwardRef(({className:t,variant:e,size:r,showArrow:n=!1,sideOffset:o=4,...i},s)=>jsxRuntime.jsxs(Ir__namespace.Content,{ref:s,sideOffset:o,className:I(mF({variant:e,size:r}),t),...i,children:[i.children,n&&jsxRuntime.jsx(wR,{})]}));Xd.displayName=Ir__namespace.Content.displayName;var gF=ee__namespace.forwardRef(({children:t,content:e,variant:r="default",size:n="md",side:o="top",align:i="center",delayDuration:s=400,skipDelayDuration:a=300,sideOffset:l=4,showArrow:c=!1,className:d,open:u,defaultOpen:f,onOpenChange:p,...h},m)=>jsxRuntime.jsxs(Um,{open:u,defaultOpen:f,onOpenChange:p,delayDuration:s,skipDelayDuration:a,children:[jsxRuntime.jsx(Vm,{asChild:!0,children:t}),jsxRuntime.jsx(Xd,{ref:m,side:o,align:i,variant:r,size:n,sideOffset:l,showArrow:c,className:d,...h,children:e})]}));gF.displayName="SimpleTooltip";var Jd="Popover",[ER,fee]=Ut(Jd,[vs]),Ya=vs(),[bF,wo]=ER(Jd),kR=t=>{let{__scopePopover:e,children:r,open:n,defaultOpen:o,onOpenChange:i,modal:s=!1}=t,a=Ya(e),l=ee__namespace.useRef(null),[c,d]=ee__namespace.useState(!1),[u,f]=Zr({prop:n,defaultProp:o??!1,onChange:i,caller:Jd});return jsxRuntime.jsx(Fa,{...a,children:jsxRuntime.jsx(bF,{scope:e,contentId:ir(),triggerRef:l,open:u,onOpenChange:f,onOpenToggle:ee__namespace.useCallback(()=>f(p=>!p),[f]),hasCustomAnchor:c,onCustomAnchorAdd:ee__namespace.useCallback(()=>d(!0),[]),onCustomAnchorRemove:ee__namespace.useCallback(()=>d(!1),[]),modal:s,children:r})})};kR.displayName=Jd;var SR="PopoverAnchor",vF=ee__namespace.forwardRef((t,e)=>{let{__scopePopover:r,...n}=t,o=wo(SR,r),i=Ya(r),{onCustomAnchorAdd:s,onCustomAnchorRemove:a}=o;return ee__namespace.useEffect(()=>(s(),()=>a()),[s,a]),jsxRuntime.jsx(za,{...i,...n,ref:e})});vF.displayName=SR;var CR="PopoverTrigger",RR=ee__namespace.forwardRef((t,e)=>{let{__scopePopover:r,...n}=t,o=wo(CR,r),i=Ya(r),s=Le(e,o.triggerRef),a=jsxRuntime.jsx(fe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":MR(o.open),...n,ref:s,onClick:J(t.onClick,o.onOpenToggle)});return o.hasCustomAnchor?a:jsxRuntime.jsx(za,{asChild:!0,...i,children:a})});RR.displayName=CR;var Km="PopoverPortal",[yF,wF]=ER(Km,{forceMount:void 0});var ys="PopoverContent",TR=ee__namespace.forwardRef((t,e)=>{let r=wF(ys,t.__scopePopover),{forceMount:n=r.forceMount,...o}=t,i=wo(ys,t.__scopePopover);return jsxRuntime.jsx(Jt,{present:n||i.open,children:i.modal?jsxRuntime.jsx(kF,{...o,ref:e}):jsxRuntime.jsx(SF,{...o,ref:e})})});TR.displayName=ys;var EF=Br("PopoverContent.RemoveScroll"),kF=ee__namespace.forwardRef((t,e)=>{let r=wo(ys,t.__scopePopover),n=ee__namespace.useRef(null),o=Le(e,n),i=ee__namespace.useRef(!1);return ee__namespace.useEffect(()=>{let s=n.current;if(s)return Jn(s)},[]),jsxRuntime.jsx(Vo,{as:EF,allowPinchZoom:!0,children:jsxRuntime.jsx(NR,{...t,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:J(t.onCloseAutoFocus,s=>{s.preventDefault(),i.current||r.triggerRef.current?.focus();}),onPointerDownOutside:J(t.onPointerDownOutside,s=>{let a=s.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0,c=a.button===2||l;i.current=c;},{checkForDefaultPrevented:!1}),onFocusOutside:J(t.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),SF=ee__namespace.forwardRef((t,e)=>{let r=wo(ys,t.__scopePopover),n=ee__namespace.useRef(!1),o=ee__namespace.useRef(!1);return jsxRuntime.jsx(NR,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{t.onCloseAutoFocus?.(i),i.defaultPrevented||(n.current||r.triggerRef.current?.focus(),i.preventDefault()),n.current=!1,o.current=!1;},onInteractOutside:i=>{t.onInteractOutside?.(i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));let s=i.target;r.triggerRef.current?.contains(s)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault();}})}),NR=ee__namespace.forwardRef((t,e)=>{let{__scopePopover:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:d,...u}=t,f=wo(ys,r),p=Ya(r);return Li(),jsxRuntime.jsx(Ho,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:i,children:jsxRuntime.jsx(Qn,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:d,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>f.onOpenChange(!1),children:jsxRuntime.jsx(zd,{"data-state":MR(f.open),role:"dialog",id:f.contentId,...p,...u,ref:e,style:{...u.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),_R="PopoverClose",CF=ee__namespace.forwardRef((t,e)=>{let{__scopePopover:r,...n}=t,o=wo(_R,r);return jsxRuntime.jsx(fe.button,{type:"button",...n,ref:e,onClick:J(t.onClick,()=>o.onOpenChange(!1))})});CF.displayName=_R;var RF="PopoverArrow",TF=ee__namespace.forwardRef((t,e)=>{let{__scopePopover:r,...n}=t,o=Ya(r);return jsxRuntime.jsx(Hd,{...o,...n,ref:e})});TF.displayName=RF;function MR(t){return t?"open":"closed"}var AR=kR;var OR=RR;var Wm=TR;var MF=classVarianceAuthority.cva("z-50 w-72 rounded-md border border-border bg-background p-4 shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",{variants:{variant:{default:"",destructive:"border-destructive bg-destructive/5",outline:"border-border bg-transparent",subtle:"border-transparent bg-muted/50"},size:{sm:"w-48 p-3",default:"w-72 p-4",lg:"w-96 p-5"},side:{top:"data-[side=top]:slide-in-from-bottom-2",right:"data-[side=right]:slide-in-from-left-2",bottom:"data-[side=bottom]:slide-in-from-top-2",left:"data-[side=left]:slide-in-from-right-2"},position:{pointerEventsNone:"pointer-events-none",default:""},radius:{none:"rounded-none",sm:"rounded-sm",default:"rounded-md",lg:"rounded-lg",full:"rounded-full"},shadow:{none:"shadow-none",sm:"shadow-sm",default:"shadow-md",md:"shadow-md",lg:"shadow-lg",xl:"shadow-xl"}},defaultVariants:{variant:"default",size:"default",radius:"default",shadow:"default"}}),Gm=AR,qm=OR;var Zd=ee__namespace.forwardRef(({className:t,variant:e,size:r,side:n,position:o,radius:i,shadow:s,backdrop:a=!1,closeOnInteractOutside:l=!0,overlayBackdrop:c=!1,sideOffset:d=4,...u},f)=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[c&&jsxRuntime.jsx("div",{className:"fixed inset-0 z-40 bg-overlay opacity-30"}),jsxRuntime.jsx(Wm,{ref:f,sideOffset:d,collisionPadding:8,onInteractOutside:p=>{l||p.preventDefault();},className:I(MF({variant:e,size:r,side:n,position:o,radius:i,shadow:s}),a&&"backdrop-blur-md bg-opacity-80",t),...u})]}));Zd.displayName=Wm.displayName;var LF=classVarianceAuthority.cva("relative flex w-full touch-none select-none items-center",{variants:{size:{sm:"h-5",default:"h-6",md:"h-8",lg:"h-10"}},defaultVariants:{size:"default"}}),$F=classVarianceAuthority.cva("relative h-1.5 w-full grow overflow-hidden rounded-full",{variants:{variant:{default:"bg-muted",primary:"bg-primary/20",secondary:"bg-secondary/20",accent:"bg-accent/20",success:"bg-success/20",warning:"bg-warning/20",error:"bg-error/20"}},defaultVariants:{variant:"default"}}),BF=classVarianceAuthority.cva("absolute h-full",{variants:{variant:{default:"bg-foreground",primary:"bg-primary",secondary:"bg-secondary",accent:"bg-accent",success:"bg-success",warning:"bg-warning",error:"bg-error"}},defaultVariants:{variant:"primary"}}),FF=classVarianceAuthority.cva("block rounded-full border-2 ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"border-foreground bg-background",primary:"border-primary bg-background",secondary:"border-secondary bg-background",accent:"border-accent bg-background",success:"border-success bg-background",warning:"border-warning bg-background",error:"border-error bg-background"},size:{sm:"h-3 w-3",default:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6"}},defaultVariants:{variant:"primary",size:"default"}}),Ym=ee__namespace.forwardRef(({className:t,size:e,trackVariant:r,rangeVariant:n,thumbVariant:o,thumbSize:i,showValueLabel:s=!1,valueLabelFormat:a,valueLabelClassName:l,value:c,defaultValue:d=[0],onValueChange:u,disabled:f,...p},h)=>{let[m,g]=ee__namespace.useState(c||d||[0]);ee__namespace.useEffect(()=>{c!==void 0&&g(c);},[c]);let b=M=>a?a(M):`${Math.round(M*100)/100}`,v=(M,B,U)=>(M-B)/(U-B)*100,y=ee__namespace.useRef(null),x=p.min||0,E=p.max||100,S=p.step||1,R=M=>{let B=M.map(U=>{if(S<1){let K=S.toString().split(".")[1]?.length||0;return Math.round(U*Math.pow(10,K))/Math.pow(10,K)}return Math.round(U)});g(B),u&&u(B);},w=M=>{if(f)return;let B=y.current;if(!B)return;let U=B.getBoundingClientRect(),K=(M.clientX-U.left)/U.width,P=x+K*(E-x),V=Math.round(P/S)*S,C=Math.max(x,Math.min(E,V)),T=[...m];T[0]=C,R(T);},N=M=>B=>{if(f)return;B.preventDefault();let U=P=>{let V=y.current;if(!V)return;let C=V.getBoundingClientRect(),T=(P.clientX-C.left)/C.width,_=x+T*(E-x),A=Math.round(_/S)*S,L=Math.max(x,Math.min(E,A)),Y=[...m];Y[M]=L,R(Y);},K=()=>{document.removeEventListener("mousemove",U),document.removeEventListener("mouseup",K);};document.addEventListener("mousemove",U),document.addEventListener("mouseup",K);};return jsxRuntime.jsxs("div",{className:"w-full",ref:h,...p,children:[s&&jsxRuntime.jsx("div",{className:I("flex justify-end mb-1 text-sm text-muted-foreground",l),children:m.length===1?jsxRuntime.jsx("span",{children:b(m[0])}):jsxRuntime.jsxs("span",{children:[b(m[0])," - ",b(m[m.length-1])]})}),jsxRuntime.jsxs("div",{className:I(LF({size:e}),t),"data-disabled":f?!0:void 0,children:[jsxRuntime.jsx("div",{ref:y,className:I($F({variant:r||o||"default"})),onClick:w,children:jsxRuntime.jsx("div",{className:I(BF({variant:n||o||"primary"})),style:{left:"0%",width:`${v(m[0],x,E)}%`}})}),m.map((M,B)=>jsxRuntime.jsx("div",{className:I(FF({variant:o||"primary",size:i})),style:{left:`${v(M,x,E)}%`,transform:"translateX(-50%)",position:"absolute",top:"50%",marginTop:i==="sm"?"-6px":i==="lg"?"-12px":"-8px",cursor:f?"not-allowed":"pointer"},onMouseDown:N(B),"aria-label":`Thumb ${B+1}`,tabIndex:f?-1:0,role:"slider","aria-valuemin":x,"aria-valuemax":E,"aria-valuenow":M,"aria-disabled":f},B))]})]})});Ym.displayName="Slider";var HF=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),UF="VisuallyHidden",eu=ee__namespace.forwardRef((t,e)=>jsxRuntime.jsx(fe.span,{...t,ref:e,style:{...HF,...t.style}}));eu.displayName=UF;var tg="ToastProvider",[rg,VF,KF]=bs("Toast"),[BR,Bee]=Ut("Toast",[KF]),[WF,ru]=BR(tg);var FR="ToastViewport",qF=["F8"],Jm="toast.viewportPause",Zm="toast.viewportResume",zR=ee__namespace.forwardRef((t,e)=>{let{__scopeToast:r,hotkey:n=qF,label:o="Notifications ({hotkey})",...i}=t,s=ru(FR,r),a=VF(r),l=ee__namespace.useRef(null),c=ee__namespace.useRef(null),d=ee__namespace.useRef(null),u=ee__namespace.useRef(null),f=Le(e,u,s.onViewportChange),p=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),h=s.toastCount>0;ee__namespace.useEffect(()=>{let g=b=>{n.length!==0&&n.every(y=>b[y]||b.code===y)&&u.current?.focus();};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[n]),ee__namespace.useEffect(()=>{let g=l.current,b=u.current;if(h&&g&&b){let v=()=>{if(!s.isClosePausedRef.current){let S=new CustomEvent(Jm);b.dispatchEvent(S),s.isClosePausedRef.current=!0;}},y=()=>{if(s.isClosePausedRef.current){let S=new CustomEvent(Zm);b.dispatchEvent(S),s.isClosePausedRef.current=!1;}},x=S=>{!g.contains(S.relatedTarget)&&y();},E=()=>{g.contains(document.activeElement)||y();};return g.addEventListener("focusin",v),g.addEventListener("focusout",x),g.addEventListener("pointermove",v),g.addEventListener("pointerleave",E),window.addEventListener("blur",v),window.addEventListener("focus",y),()=>{g.removeEventListener("focusin",v),g.removeEventListener("focusout",x),g.removeEventListener("pointermove",v),g.removeEventListener("pointerleave",E),window.removeEventListener("blur",v),window.removeEventListener("focus",y);}}},[h,s.isClosePausedRef]);let m=ee__namespace.useCallback(({tabbingDirection:g})=>{let v=a().map(y=>{let x=y.ref.current,E=[x,...sz(x)];return g==="forwards"?E:E.reverse()});return (g==="forwards"?v.reverse():v).flat()},[a]);return ee__namespace.useEffect(()=>{let g=u.current;if(g){let b=v=>{let y=v.altKey||v.ctrlKey||v.metaKey;if(v.key==="Tab"&&!y){let E=document.activeElement,S=v.shiftKey;if(v.target===g&&S){c.current?.focus();return}let N=m({tabbingDirection:S?"backwards":"forwards"}),M=N.findIndex(B=>B===E);Xm(N.slice(M+1))?v.preventDefault():S?c.current?.focus():d.current?.focus();}};return g.addEventListener("keydown",b),()=>g.removeEventListener("keydown",b)}},[a,m]),jsxRuntime.jsxs(a0,{ref:l,role:"region","aria-label":o.replace("{hotkey}",p),tabIndex:-1,style:{pointerEvents:h?void 0:"none"},children:[h&&jsxRuntime.jsx(Qm,{ref:c,onFocusFromOutsideViewport:()=>{let g=m({tabbingDirection:"forwards"});Xm(g);}}),jsxRuntime.jsx(rg.Slot,{scope:r,children:jsxRuntime.jsx(fe.ol,{tabIndex:-1,...i,ref:f})}),h&&jsxRuntime.jsx(Qm,{ref:d,onFocusFromOutsideViewport:()=>{let g=m({tabbingDirection:"backwards"});Xm(g);}})]})});zR.displayName=FR;var HR="ToastFocusProxy",Qm=ee__namespace.forwardRef((t,e)=>{let{__scopeToast:r,onFocusFromOutsideViewport:n,...o}=t,i=ru(HR,r);return jsxRuntime.jsx(eu,{"aria-hidden":!0,tabIndex:0,...o,ref:e,style:{position:"fixed"},onFocus:s=>{let a=s.relatedTarget;!i.viewport?.contains(a)&&n();}})});Qm.displayName=HR;var Za="Toast",jF="toast.swipeStart",YF="toast.swipeMove",XF="toast.swipeCancel",JF="toast.swipeEnd",UR=ee__namespace.forwardRef((t,e)=>{let{forceMount:r,open:n,defaultOpen:o,onOpenChange:i,...s}=t,[a,l]=Zr({prop:n,defaultProp:o??!0,onChange:i,caller:Za});return jsxRuntime.jsx(Jt,{present:r||a,children:jsxRuntime.jsx(ez,{open:a,...s,ref:e,onClose:()=>l(!1),onPause:pt(t.onPause),onResume:pt(t.onResume),onSwipeStart:J(t.onSwipeStart,c=>{c.currentTarget.setAttribute("data-swipe","start");}),onSwipeMove:J(t.onSwipeMove,c=>{let{x:d,y:u}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","move"),c.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${d}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${u}px`);}),onSwipeCancel:J(t.onSwipeCancel,c=>{c.currentTarget.setAttribute("data-swipe","cancel"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-y");}),onSwipeEnd:J(t.onSwipeEnd,c=>{let{x:d,y:u}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","end"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${d}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${u}px`),l(!1);})})})});UR.displayName=Za;var[ZF,QF]=BR(Za,{onClose(){}}),ez=ee__namespace.forwardRef((t,e)=>{let{__scopeToast:r,type:n="foreground",duration:o,open:i,onClose:s,onEscapeKeyDown:a,onPause:l,onResume:c,onSwipeStart:d,onSwipeMove:u,onSwipeCancel:f,onSwipeEnd:p,...h}=t,m=ru(Za,r),[g,b]=ee__namespace.useState(null),v=Le(e,P=>b(P)),y=ee__namespace.useRef(null),x=ee__namespace.useRef(null),E=o||m.duration,S=ee__namespace.useRef(0),R=ee__namespace.useRef(E),w=ee__namespace.useRef(0),{onToastAdd:N,onToastRemove:M}=m,B=pt(()=>{g?.contains(document.activeElement)&&m.viewport?.focus(),s();}),U=ee__namespace.useCallback(P=>{!P||P===1/0||(window.clearTimeout(w.current),S.current=new Date().getTime(),w.current=window.setTimeout(B,P));},[B]);ee__namespace.useEffect(()=>{let P=m.viewport;if(P){let V=()=>{U(R.current),c?.();},C=()=>{let T=new Date().getTime()-S.current;R.current=R.current-T,window.clearTimeout(w.current),l?.();};return P.addEventListener(Jm,C),P.addEventListener(Zm,V),()=>{P.removeEventListener(Jm,C),P.removeEventListener(Zm,V);}}},[m.viewport,E,l,c,U]),ee__namespace.useEffect(()=>{i&&!m.isClosePausedRef.current&&U(E);},[i,E,m.isClosePausedRef,U]),ee__namespace.useEffect(()=>(N(),()=>M()),[N,M]);let K=ee__namespace.useMemo(()=>g?YR(g):null,[g]);return m.viewport?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[K&&jsxRuntime.jsx(tz,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0,children:K}),jsxRuntime.jsx(ZF,{scope:r,onClose:B,children:Dg__namespace.createPortal(jsxRuntime.jsx(rg.ItemSlot,{scope:r,children:jsxRuntime.jsx(s0,{asChild:!0,onEscapeKeyDown:J(a,()=>{m.isFocusedToastEscapeKeyDownRef.current||B(),m.isFocusedToastEscapeKeyDownRef.current=!1;}),children:jsxRuntime.jsx(fe.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":m.swipeDirection,...h,ref:v,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:J(t.onKeyDown,P=>{P.key==="Escape"&&(a?.(P.nativeEvent),P.nativeEvent.defaultPrevented||(m.isFocusedToastEscapeKeyDownRef.current=!0,B()));}),onPointerDown:J(t.onPointerDown,P=>{P.button===0&&(y.current={x:P.clientX,y:P.clientY});}),onPointerMove:J(t.onPointerMove,P=>{if(!y.current)return;let V=P.clientX-y.current.x,C=P.clientY-y.current.y,T=!!x.current,_=["left","right"].includes(m.swipeDirection),A=["left","up"].includes(m.swipeDirection)?Math.min:Math.max,L=_?A(0,V):0,Y=_?0:A(0,C),te=P.pointerType==="touch"?10:2,ke={x:L,y:Y},me={originalEvent:P,delta:ke};T?(x.current=ke,tu(YF,u,me,{discrete:!1})):IR(ke,m.swipeDirection,te)?(x.current=ke,tu(jF,d,me,{discrete:!1}),P.target.setPointerCapture(P.pointerId)):(Math.abs(V)>te||Math.abs(C)>te)&&(y.current=null);}),onPointerUp:J(t.onPointerUp,P=>{let V=x.current,C=P.target;if(C.hasPointerCapture(P.pointerId)&&C.releasePointerCapture(P.pointerId),x.current=null,y.current=null,V){let T=P.currentTarget,_={originalEvent:P,delta:V};IR(V,m.swipeDirection,m.swipeThreshold)?tu(JF,p,_,{discrete:!0}):tu(XF,f,_,{discrete:!0}),T.addEventListener("click",A=>A.preventDefault(),{once:!0});}})})})}),m.viewport)})]}):null}),tz=t=>{let{__scopeToast:e,children:r,...n}=t,o=ru(Za,e),[i,s]=ee__namespace.useState(!1),[a,l]=ee__namespace.useState(!1);return oz(()=>s(!0)),ee__namespace.useEffect(()=>{let c=window.setTimeout(()=>l(!0),1e3);return ()=>window.clearTimeout(c)},[]),a?null:jsxRuntime.jsx(Rn,{asChild:!0,children:jsxRuntime.jsx(eu,{...n,children:i&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[o.label," ",r]})})})},rz="ToastTitle",VR=ee__namespace.forwardRef((t,e)=>{let{__scopeToast:r,...n}=t;return jsxRuntime.jsx(fe.div,{...n,ref:e})});VR.displayName=rz;var nz="ToastDescription",KR=ee__namespace.forwardRef((t,e)=>{let{__scopeToast:r,...n}=t;return jsxRuntime.jsx(fe.div,{...n,ref:e})});KR.displayName=nz;var WR="ToastAction",GR=ee__namespace.forwardRef((t,e)=>{let{altText:r,...n}=t;return r.trim()?jsxRuntime.jsx(jR,{altText:r,asChild:!0,children:jsxRuntime.jsx(ng,{...n,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${WR}\`. Expected non-empty \`string\`.`),null)});GR.displayName=WR;var qR="ToastClose",ng=ee__namespace.forwardRef((t,e)=>{let{__scopeToast:r,...n}=t,o=QF(qR,r);return jsxRuntime.jsx(jR,{asChild:!0,children:jsxRuntime.jsx(fe.button,{type:"button",...n,ref:e,onClick:J(t.onClick,o.onClose)})})});ng.displayName=qR;var jR=ee__namespace.forwardRef((t,e)=>{let{__scopeToast:r,altText:n,...o}=t;return jsxRuntime.jsx(fe.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0,...o,ref:e})});function YR(t){let e=[];return Array.from(t.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&e.push(n.textContent),iz(n)){let o=n.ariaHidden||n.hidden||n.style.display==="none",i=n.dataset.radixToastAnnounceExclude==="";if(!o)if(i){let s=n.dataset.radixToastAnnounceAlt;s&&e.push(s);}else e.push(...YR(n));}}),e}function tu(t,e,r,{discrete:n}){let o=r.originalEvent.currentTarget,i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:r});e&&o.addEventListener(t,e,{once:!0}),n?Ei(o,i):o.dispatchEvent(i);}var IR=(t,e,r=0)=>{let n=Math.abs(t.x),o=Math.abs(t.y),i=n>o;return e==="left"||e==="right"?i&&n>r:!i&&o>r};function oz(t=()=>{}){let e=pt(t);Vt(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n);}},[e]);}function iz(t){return t.nodeType===t.ELEMENT_NODE}function sz(t){let e=[],r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{let o=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||o?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)e.push(r.currentNode);return e}function Xm(t){let e=document.activeElement;return t.some(r=>r===e?!0:(r.focus(),document.activeElement!==e))}var og=zR,ig=UR,sg=VR,ag=KR,lg=GR,cg=ng;var dz=ee__namespace.forwardRef(({className:t,...e},r)=>jsxRuntime.jsx(og,{ref:r,className:I("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",t),...e}));dz.displayName=og.displayName;var uz=classVarianceAuthority.cva("group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-8 shadow-sm transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground",success:"border-green-200 bg-green-50 text-green-900 dark:border-green-800 dark:bg-green-900/20 dark:text-green-100",warning:"border-orange-200 bg-orange-50 text-orange-900 dark:border-orange-800 dark:bg-orange-900/20 dark:text-orange-100",info:"border-blue-200 bg-blue-50 text-blue-900 dark:border-blue-800 dark:bg-blue-900/20 dark:text-blue-100"}},defaultVariants:{variant:"default"}}),fz=ee__namespace.forwardRef(({className:t,variant:e,...r},n)=>jsxRuntime.jsx(ig,{ref:n,className:I(uz({variant:e}),t),...r}));fz.displayName=ig.displayName;var pz=ee__namespace.forwardRef(({className:t,...e},r)=>jsxRuntime.jsx(lg,{ref:r,className:I("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",t),...e}));pz.displayName=lg.displayName;var hz=ee__namespace.forwardRef(({className:t,...e},r)=>jsxRuntime.jsx(cg,{ref:r,className:I("absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",t),"toast-close":"",...e,children:jsxRuntime.jsx(lucideReact.X,{className:"h-4 w-4"})}));hz.displayName=cg.displayName;var mz=ee__namespace.forwardRef(({className:t,...e},r)=>jsxRuntime.jsx(sg,{ref:r,className:I("text-sm font-semibold [&+div]:text-xs",t),...e}));mz.displayName=sg.displayName;var gz=ee__namespace.forwardRef(({className:t,...e},r)=>jsxRuntime.jsx(ag,{ref:r,className:I("text-sm opacity-90",t),...e}));gz.displayName=ag.displayName;var bz=5,vz=1e6,dg=new Map,XR=t=>{if(dg.has(t))return;let e=setTimeout(()=>{dg.delete(t),nu({type:"REMOVE_TOAST",toastId:t});},vz);dg.set(t,e);},yz=(t,e)=>{switch(e.type){case"ADD_TOAST":return {...t,toasts:[e.toast,...t.toasts].slice(0,bz)};case"UPDATE_TOAST":return {...t,toasts:t.toasts.map(r=>r.id===e.toast.id?{...r,...e.toast}:r)};case"DISMISS_TOAST":{let{toastId:r}=e;return r?XR(r):t.toasts.forEach(n=>{XR(n.id);}),{...t,toasts:t.toasts.map(n=>n.id===r||r===void 0?{...n,open:!1}:n)}}case"REMOVE_TOAST":return e.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(r=>r.id!==e.toastId)}}},wz=[],ug={toasts:[]},xz=0;function nu(t){ug=yz(ug,t),wz.forEach(e=>{e(ug);});}function Gn({...t}){let e=`toast-${Date.now()}-${++xz}`,r=o=>nu({type:"UPDATE_TOAST",toast:{...o,id:e}}),n=()=>nu({type:"DISMISS_TOAST",toastId:e});return nu({type:"ADD_TOAST",toast:{...t,id:e,open:!0,onOpenChange:o=>{o||n();}}}),{id:e,dismiss:n,update:r}}ko(`.slash-commands-menu{border-radius:var(--radius);border-width:1px;--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);box-shadow:var(--shadow-lg)}.slash-commands-menu:is(.dark *){--tw-border-opacity: 1;border-color:rgb(55 65 81 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity, 1))}.slash-commands-menu{max-height:20rem;min-width:280px;overflow-y:auto;padding:.5rem}.slash-command-item{display:flex;cursor:pointer;align-items:center;gap:.75rem;border-radius:calc(var(--radius) - 2px);padding:.5rem .75rem;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke}.slash-command-item:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.slash-command-item:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.slash-command-item.selected{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.slash-command-item.selected:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.slash-command-item svg{height:1rem;width:1rem;--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.slash-command-item svg:is(.dark *){--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.slash-command-item>div{flex:1 1 0%}.slash-command-item .command-name{font-size:.875rem;line-height:1.25rem;font-weight:500;--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.slash-command-item .command-name:is(.dark *){--tw-text-opacity: 1;color:rgb(243 244 246 / var(--tw-text-opacity, 1))}.slash-command-item .command-description{margin-top:.125rem;font-size:.75rem;line-height:1rem;--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.slash-command-item .command-description:is(.dark *){--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.dark .slash-commands-menu{box-shadow:0 10px 15px -3px #0000004d,0 4px 6px -2px #0003}
|
|
189
|
+
`);ko(`.ProseMirror table{border-collapse:collapse;margin:0;overflow:hidden;table-layout:fixed;width:100%;border:1px solid #d1d5db}.ProseMirror table td,.ProseMirror table th{border:1px solid #d1d5db;box-sizing:border-box;min-width:1em;padding:6px 8px;position:relative;vertical-align:top}.ProseMirror table th{background-color:#f9fafb;font-weight:600;text-align:left}.ProseMirror table .selectedCell:after{background-color:#3b82f61a;content:"";inset:0;pointer-events:none;position:absolute;z-index:2}.ProseMirror table .column-resize-handle{background-color:#3b82f6;bottom:-2px;position:absolute;right:-2px;top:0;width:4px;pointer-events:none}.dark .ProseMirror table,.dark .ProseMirror table td,.dark .ProseMirror table th{border:1px solid #374151}.dark .ProseMirror table th{background-color:#111827}.dark .ProseMirror table .selectedCell:after{background-color:#3b82f633}
|
|
190
|
+
`);var Ez=hm(fm),t9=t=>({generateText:async e=>"AI functionality requires proper API configuration"}),tT=({onColorSelect:t,currentColor:e="#000000"})=>jsxRuntime.jsx(zi,{value:e,onChange:t,showInput:!0,showPresets:!0,size:"sm",presets:["#000000","#ffffff","#ff0000","#00ff00","#0000ff","#ffff00","#ff00ff","#00ffff","#ff8800","#8800ff","#88ff00","#0088ff","#ff0088","#00ff88","#888888","#f87171","#fb923c","#fbbf24","#facc15","#a3e635","#4ade80","#34d399","#2dd4bf","#22d3ee","#38bdf8","#60a5fa","#818cf8","#a78bfa","#c084fc","#e879f9","#f472b6","#fb7185","#f43f5e","#ef4444","#dc2626"]}),yt=({active:t,disabled:e,onClick:r,children:n,tooltip:o})=>{let i=jsxRuntime.jsx("button",{type:"button",onClick:r,disabled:e,className:I("p-2 rounded hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors",t&&"bg-gray-100 dark:bg-gray-800",e&&"opacity-50 cursor-not-allowed"),children:n});return o?jsxRuntime.jsxs(Um,{children:[jsxRuntime.jsx(Vm,{asChild:!0,children:i}),jsxRuntime.jsx(Xd,{children:jsxRuntime.jsx("p",{children:o})})]}):i};function Pte({placeholder:t="Start writing...",className:e,height:r=300,features:n={bold:!0,italic:!0,underline:!0,strike:!0,heading:!0,lists:!0,blockquote:!0,code:!0,link:!0,image:!0,table:!0,align:!0,color:!0,ai:!0},aiConfig:o={provider:"openai",apiKey:"",model:"gpt-4",temperature:.7,maxTokens:1e3}}){let i={hasAccess:!0},{hasProAccess:s,isLoading:a}=xi();if(!i.isDocsMode&&!a&&!s)return jsxRuntime.jsx(yn,{className:I("w-full",e),children:jsxRuntime.jsx(wn,{className:"py-12 text-center",children:jsxRuntime.jsxs("div",{className:"max-w-md mx-auto space-y-4",children:[jsxRuntime.jsx("div",{className:"rounded-full bg-purple-100 dark:bg-purple-900/30 p-3 w-fit mx-auto",children:jsxRuntime.jsx(lucideReact.Lock,{className:"h-6 w-6 text-purple-600 dark:text-purple-400"})}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"font-semibold text-lg mb-2",children:"Pro Feature"}),jsxRuntime.jsx("p",{className:"text-muted-foreground text-sm mb-4",children:"Advanced Rich Text Editor is available exclusively to MoonUI Pro subscribers."}),jsxRuntime.jsx("div",{className:"flex gap-3 justify-center",children:jsxRuntime.jsx("a",{href:"/pricing",children:jsxRuntime.jsxs(xe,{size:"sm",children:[jsxRuntime.jsx(lucideReact.Sparkles,{className:"mr-2 h-4 w-4"}),"Upgrade to Pro"]})})})]})]})})});let[c,d]=ee.useState({provider:o.provider||"openai",apiKey:o.apiKey||"",model:o.model||"gpt-4",temperature:o.temperature||.7,maxTokens:o.maxTokens||1e3}),[u,f]=ee.useState(!1),[p,h]=ee.useState(!1),[m,g]=ee.useState(!1),[b,v]=ee.useState(""),[y,x]=ee.useState("#000000"),[E,S]=ee.useState("#ffffff"),R=[{id:"rewrite",command:"rewrite",description:"Rewrite selected text",icon:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21.5 2v6h-6M2.5 22v-6h6M2 11.5a10 10 0 0 1 18.8-4.3M22 12.5a10 10 0 0 1-18.8 4.3"/></svg>',action:async D=>{let re=await N("rewrite",D);return {text:re||"",error:re?void 0:"Failed to rewrite"}}},{id:"expand",command:"expand",description:"Expand text with more details",icon:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="m21 21-6-6m6 6v-4.8m0 4.8h-4.8"/><path d="M3 16.2V21m0 0h4.8M3 21l6-6"/><path d="M21 7.8V3m0 0h-4.8M21 3l-6 6"/><path d="M3 7.8V3m0 0h4.8M3 3l6 6"/></svg>',action:async D=>{let re=await N("expand",D);return {text:re||"",error:re?void 0:"Failed to expand"}}},{id:"summarize",command:"summarize",description:"Summarize text",icon:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M9 11H3"/><path d="M9 7H3"/><path d="M9 15H3"/><path d="M16 10V3"/><path d="M16 10l3-3"/><path d="M13 10l3 3"/><path d="M9 19h12"/></svg>',action:async D=>{let re=await N("summarize",D);return {text:re||"",error:re?void 0:"Failed to summarize"}}},{id:"continue",command:"continue",description:"Continue writing from here",icon:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M5 12h14"/><path d="m12 5 7 7-7 7"/></svg>',action:async D=>{let re=await N("continue",D);return {text:re||"",error:re?void 0:"Failed to continue"}}},{id:"improve",command:"improve",description:"Improve writing quality",icon:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z"/></svg>',action:async D=>{let re=await N("improve",D);return {text:re||"",error:re?void 0:"Failed to improve"}}},{id:"fix",command:"fix",description:"Fix grammar and spelling",icon:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="m6 9 6 6 6-6"/></svg>',action:async D=>{let re=await N("fix",D);return {text:re||"",error:re?void 0:"Failed to fix"}}},{id:"translate",command:"translate",description:"Translate to Turkish",icon:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="m5 8 6 6"/><path d="m4 14 6-6 2-3"/><path d="M2 5h12"/><path d="M7 2v3"/><path d="m22 22-5-10-5 10"/><path d="m14 18 6 0"/></svg>',action:async D=>{let re=await N("translate",D);return {text:re||"",error:re?void 0:"Failed to translate"}}},{id:"ideas",command:"ideas",description:"Generate writing ideas",icon:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 2v20"/><path d="M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6"/></svg>',action:async D=>{let re=await N("ideas",D);return {text:re||"",error:re?void 0:"Failed to generate ideas"}}}],w=_E({extensions:[S1.configure({heading:{levels:[1,2,3]},codeBlock:!1}),C1.configure({placeholder:t}),R1.configure({types:["heading","paragraph"]}),T1.configure({multicolor:!0}),e1.configure({openOnClick:!1,HTMLAttributes:{target:"_blank",rel:"noopener noreferrer"}}),N1.configure({inline:!0,allowBase64:!0}),Qh.configure({resizable:!0}),ik,ak,sk,em,lk,p1,ck,dk,uk.configure({nested:!0}),fk,$k.configure({lowlight:Ez}),KS.configure({commands:R,onSelectCommand:async D=>{if(!w)return;let{from:re,to:ce}=w.state.selection,ne=w.state.doc.textBetween(re,ce," ");h(!0);try{let $t=await D.action(ne||w.getText());$t.text?w.chain().focus().insertContent($t.text).run():$t.error&&Gn({title:"AI Error",description:$t.error,variant:"destructive"});}catch{Gn({title:"Error",description:"Failed to execute command",variant:"destructive"});}finally{h(!1);}}})],content:"",editorProps:{attributes:{class:I("prose prose-sm sm:prose lg:prose-lg xl:prose-xl focus:outline-none min-h-[200px] p-4 max-w-none","[&_h1]:text-3xl [&_h1]:font-bold [&_h1]:mb-4","[&_h2]:text-2xl [&_h2]:font-bold [&_h2]:mb-3","[&_h3]:text-xl [&_h3]:font-bold [&_h3]:mb-2","[&_h4]:text-lg [&_h4]:font-bold [&_h4]:mb-2","[&_h5]:text-base [&_h5]:font-bold [&_h5]:mb-1","[&_h6]:text-sm [&_h6]:font-bold [&_h6]:mb-1","[&_ul]:list-disc [&_ul]:pl-6 [&_ul]:mb-4","[&_ol]:list-decimal [&_ol]:pl-6 [&_ol]:mb-4","[&_li]:mb-1","[&_table]:border-collapse-collapse [&_table]:w-full [&_table]:mb-4","[&_table_td]:border [&_table_td]:border-gray-300 [&_table_td]:p-2","[&_table_th]:border [&_table_th]:border-gray-300 [&_table_th]:p-2 [&_table_th]:bg-gray-50 [&_table_th]:font-semibold","[&_blockquote]:border-l-4 [&_blockquote]:border-gray-300 [&_blockquote]:pl-4 [&_blockquote]:italic","[&_pre]:bg-gray-100 [&_pre]:dark:bg-gray-800 [&_pre]:p-4 [&_pre]:rounded [&_pre]:overflow-x-auto")}},immediatelyRender:!1}),N=async(D,re)=>{if(!c.apiKey)return Gn({title:"API Key Required",description:"Please configure your AI settings first.",variant:"destructive"}),f(!0),null;h(!0);try{let ce=t9(c),ne;switch(D){case"rewrite":ne=await ce.rewrite(re);break;case"expand":ne=await ce.expand(re);break;case"summarize":ne=await ce.summarize(re);break;case"fix":ne=await ce.fixGrammar(re);break;case"translate":ne=await ce.translate(re,"Turkish");break;case"tone_professional":ne=await ce.changeTone(re,"professional");break;case"tone_casual":ne=await ce.changeTone(re,"casual");break;case"tone_friendly":ne=await ce.changeTone(re,"friendly");break;case"tone_formal":ne=await ce.changeTone(re,"formal");break;case"continue":ne=await ce.continueWriting(re);break;case"improve":ne=await ce.improveWriting(re);break;case"ideas":ne=await ce.generateIdeas(re,5);break;default:ne=await ce.complete(D,re);}return ne.error?(Gn({title:"AI Error",description:ne.error,variant:"destructive"}),null):ne.text}catch{return Gn({title:"AI Error",description:"Failed to process with AI. Please check your settings.",variant:"destructive"}),null}finally{h(!1);}},M=async D=>{if(!w)return;let re=w.state.selection,ce=w.state.doc.textBetween(re.from,re.to," ");if(!ce&&D!=="complete"){Gn({title:"No text selected",description:"Please select some text first.",variant:"destructive"});return}let ne=await N(D,ce||w.getText());ne&&(ce?w.chain().focus().deleteSelection().insertContent(ne).run():w.chain().focus().insertContent(ne).run());},[B,U]=ee.useState(""),[K,P]=ee.useState(""),[V,C]=ee.useState(!1),[T,_]=ee.useState(!1),[A,L]=ee.useState(!1),[Y,te]=ee.useState(3),[ke,me]=ee.useState(3),[Te,Ae]=ee.useState(!1),[W,ue]=ee.useState(1),[Oe,Se]=ee.useState("#000000"),[le,Ce]=ee.useState("solid"),$e=()=>{K&&w&&(w.chain().focus().setImage({src:K}).run(),P(""),_(!1));},Ke=()=>{B&&w&&(w.state.selection.empty?w.chain().focus().insertContent(`<a href="${B}">${B}</a>`).run():w.chain().focus().extendMarkRange("link").setLink({href:B}).run(),U(""),C(!1));},nt=()=>{w?.chain().focus().unsetLink().run();},Re=()=>{w&&Y>0&&ke>0&&(w.chain().focus().insertTable({rows:Y,cols:ke,withHeaderRow:!0}).run(),setTimeout(()=>{wt(W,Oe,le);},100),L(!1));},wt=(D,re,ce)=>{if(!w)return;let ne=`${D}px ${ce} ${re}`;w.view.dom.querySelectorAll(".ProseMirror table").forEach($t=>{$t instanceof HTMLElement&&($t.style.borderCollapse="collapse",$t.style.border=ne,$t.querySelectorAll("td, th").forEach(pr=>{pr instanceof HTMLElement&&(pr.style.border=ne,pr.style.padding="8px");}));});};return w?jsxRuntime.jsxs("div",{className:I("border rounded-lg overflow-hidden bg-white dark:bg-gray-950",e),children:[jsxRuntime.jsx(yR,{children:jsxRuntime.jsx("div",{className:"border-b bg-gray-50 dark:bg-gray-900 p-3",children:jsxRuntime.jsxs("div",{className:"flex items-center flex-wrap gap-1",children:[(n.bold||n.italic||n.underline||n.strike||n.code)&&jsxRuntime.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[n.bold&&jsxRuntime.jsx(yt,{active:w.isActive("bold"),onClick:()=>w.chain().focus().toggleBold().run(),tooltip:"Bold (Cmd+B)",disabled:m,children:jsxRuntime.jsx(lucideReact.Bold,{className:"w-4 h-4"})}),n.italic&&jsxRuntime.jsx(yt,{active:w.isActive("italic"),onClick:()=>w.chain().focus().toggleItalic().run(),tooltip:"Italic (Cmd+I)",disabled:m,children:jsxRuntime.jsx(lucideReact.Italic,{className:"w-4 h-4"})}),n.underline&&jsxRuntime.jsx(yt,{active:w.isActive("underline"),onClick:()=>w.chain().focus().toggleUnderline().run(),tooltip:"Underline (Cmd+U)",disabled:m,children:jsxRuntime.jsx(lucideReact.Underline,{className:"w-4 h-4"})}),n.strike&&jsxRuntime.jsx(yt,{active:w.isActive("strike"),onClick:()=>w.chain().focus().toggleStrike().run(),tooltip:"Strikethrough",disabled:m,children:jsxRuntime.jsx(lucideReact.Strikethrough,{className:"w-4 h-4"})}),n.code&&jsxRuntime.jsx(yt,{active:w.isActive("code"),onClick:()=>w.chain().focus().toggleCode().run(),tooltip:"Inline code",disabled:m,children:jsxRuntime.jsx(lucideReact.Code,{className:"w-4 h-4"})})]}),(n.bold||n.italic||n.underline||n.strike||n.code)&&(n.heading||n.align)&&jsxRuntime.jsx("div",{className:"w-px h-6 bg-border mx-1 shrink-0"}),(n.heading||n.align)&&jsxRuntime.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[n.heading&&jsxRuntime.jsxs(Gd,{children:[jsxRuntime.jsx(qd,{asChild:!0,children:jsxRuntime.jsxs(xe,{variant:"ghost",size:"sm",className:"h-8 px-2",disabled:m,children:[jsxRuntime.jsx(lucideReact.Type,{className:"w-4 h-4 mr-1"}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-3 h-3"})]})}),jsxRuntime.jsxs(ja,{children:[jsxRuntime.jsx(Ve,{onClick:()=>w.chain().focus().setParagraph().run(),children:"Paragraph"}),jsxRuntime.jsxs(Ve,{onClick:()=>w.chain().focus().toggleHeading({level:1}).run(),children:[jsxRuntime.jsx(lucideReact.Heading1,{className:"w-4 h-4 mr-2"})," Heading 1"]}),jsxRuntime.jsxs(Ve,{onClick:()=>w.chain().focus().toggleHeading({level:2}).run(),children:[jsxRuntime.jsx(lucideReact.Heading2,{className:"w-4 h-4 mr-2"})," Heading 2"]}),jsxRuntime.jsxs(Ve,{onClick:()=>w.chain().focus().toggleHeading({level:3}).run(),children:[jsxRuntime.jsx(lucideReact.Heading3,{className:"w-4 h-4 mr-2"})," Heading 3"]})]})]}),n.align&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(yt,{active:w.isActive({textAlign:"left"}),onClick:()=>w.chain().focus().setTextAlign("left").run(),tooltip:"Align left",disabled:m,children:jsxRuntime.jsx(lucideReact.AlignLeft,{className:"w-4 h-4"})}),jsxRuntime.jsx(yt,{active:w.isActive({textAlign:"center"}),onClick:()=>w.chain().focus().setTextAlign("center").run(),tooltip:"Align center",disabled:m,children:jsxRuntime.jsx(lucideReact.AlignCenter,{className:"w-4 h-4"})}),jsxRuntime.jsx(yt,{active:w.isActive({textAlign:"right"}),onClick:()=>w.chain().focus().setTextAlign("right").run(),tooltip:"Align right",disabled:m,children:jsxRuntime.jsx(lucideReact.AlignRight,{className:"w-4 h-4"})}),jsxRuntime.jsx(yt,{active:w.isActive({textAlign:"justify"}),onClick:()=>w.chain().focus().setTextAlign("justify").run(),tooltip:"Justify",disabled:m,children:jsxRuntime.jsx(lucideReact.AlignJustify,{className:"w-4 h-4"})})]})]}),(n.heading||n.align)&&(n.lists||n.blockquote)&&jsxRuntime.jsx("div",{className:"w-px h-6 bg-border mx-1 shrink-0"}),(n.lists||n.blockquote)&&jsxRuntime.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[n.lists&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(yt,{active:w.isActive("bulletList"),onClick:()=>w.chain().focus().toggleBulletList().run(),tooltip:"Bullet list",disabled:m,children:jsxRuntime.jsx(lucideReact.List,{className:"w-4 h-4"})}),jsxRuntime.jsx(yt,{active:w.isActive("orderedList"),onClick:()=>w.chain().focus().toggleOrderedList().run(),tooltip:"Numbered list",disabled:m,children:jsxRuntime.jsx(lucideReact.ListOrdered,{className:"w-4 h-4"})}),jsxRuntime.jsx(yt,{active:w.isActive("taskList"),onClick:()=>w.chain().focus().toggleTaskList().run(),tooltip:"Task list",disabled:m,children:jsxRuntime.jsx(lucideReact.CheckSquare,{className:"w-4 h-4"})})]}),n.blockquote&&jsxRuntime.jsx(yt,{active:w.isActive("blockquote"),onClick:()=>w.chain().focus().toggleBlockquote().run(),tooltip:"Quote",disabled:m,children:jsxRuntime.jsx(lucideReact.Quote,{className:"w-4 h-4"})})]}),(n.lists||n.blockquote)&&n.color&&jsxRuntime.jsx("div",{className:"w-px h-6 bg-border mx-1 shrink-0"}),n.color&&jsxRuntime.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[jsxRuntime.jsxs(Gm,{children:[jsxRuntime.jsx(qm,{asChild:!0,children:jsxRuntime.jsx(xe,{variant:"ghost",size:"sm",className:"h-8 px-2",disabled:m,title:"Text Color",children:jsxRuntime.jsx(lucideReact.Palette,{className:"w-4 h-4"})})}),jsxRuntime.jsx(Zd,{className:"w-auto p-0",children:jsxRuntime.jsx(tT,{currentColor:y,onColorSelect:D=>{x(D),w.chain().focus().setColor(D).run();}})})]}),jsxRuntime.jsxs(Gm,{children:[jsxRuntime.jsx(qm,{asChild:!0,children:jsxRuntime.jsx(xe,{variant:"ghost",size:"sm",className:"h-8 px-2",disabled:m,title:"Background Color",children:jsxRuntime.jsx(lucideReact.Highlighter,{className:"w-4 h-4"})})}),jsxRuntime.jsx(Zd,{className:"w-auto p-0",children:jsxRuntime.jsx(tT,{currentColor:E,onColorSelect:D=>{S(D),w.chain().focus().toggleHighlight({color:D}).run();}})})]})]}),n.color&&(n.link||n.image||n.table)&&jsxRuntime.jsx("div",{className:"w-px h-6 bg-border mx-1 shrink-0"}),(n.link||n.image||n.table)&&jsxRuntime.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[n.link&&jsxRuntime.jsxs(to,{open:V,onOpenChange:C,children:[jsxRuntime.jsx(qs,{asChild:!0,children:jsxRuntime.jsx(yt,{active:w.isActive("link"),tooltip:"Add link",disabled:m,children:jsxRuntime.jsx(lucideReact.Link2,{className:"w-4 h-4"})})}),jsxRuntime.jsxs(Tn,{className:"sm:max-w-[425px]",children:[jsxRuntime.jsxs(Qr,{children:[jsxRuntime.jsx(en,{children:"Add Link"}),jsxRuntime.jsx(tn,{children:"Enter the URL for the link."})]}),jsxRuntime.jsx("div",{className:"grid gap-4 py-4",children:jsxRuntime.jsxs("div",{className:"grid gap-2",children:[jsxRuntime.jsx(He,{htmlFor:"url",children:"URL"}),jsxRuntime.jsx(Ft,{id:"url",value:B,onChange:D=>U(D.target.value),placeholder:"https://example.com",onKeyDown:D=>{D.key==="Enter"&&(D.preventDefault(),Ke());}})]})}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[w.isActive("link")&&jsxRuntime.jsx(xe,{variant:"destructive",onClick:()=>{nt(),C(!1);},children:"Remove Link"}),jsxRuntime.jsxs("div",{className:"ml-auto flex gap-2",children:[jsxRuntime.jsx(xe,{variant:"outline",onClick:()=>C(!1),children:"Cancel"}),jsxRuntime.jsx(xe,{onClick:Ke,children:"Add Link"})]})]})]})]}),n.image&&jsxRuntime.jsxs(to,{open:T,onOpenChange:_,children:[jsxRuntime.jsx(qs,{asChild:!0,children:jsxRuntime.jsx(yt,{tooltip:"Add image",disabled:m,children:jsxRuntime.jsx(lucideReact.Image,{className:"w-4 h-4"})})}),jsxRuntime.jsxs(Tn,{className:"sm:max-w-[425px]",children:[jsxRuntime.jsxs(Qr,{children:[jsxRuntime.jsx(en,{children:"Add Image"}),jsxRuntime.jsx(tn,{children:"Enter the URL for the image."})]}),jsxRuntime.jsx("div",{className:"grid gap-4 py-4",children:jsxRuntime.jsxs("div",{className:"grid gap-2",children:[jsxRuntime.jsx(He,{htmlFor:"image-url",children:"Image URL"}),jsxRuntime.jsx(Ft,{id:"image-url",value:K,onChange:D=>P(D.target.value),placeholder:"https://example.com/image.jpg",onKeyDown:D=>{D.key==="Enter"&&(D.preventDefault(),$e());}})]})}),jsxRuntime.jsxs("div",{className:"flex justify-end gap-2",children:[jsxRuntime.jsx(xe,{variant:"outline",onClick:()=>_(!1),children:"Cancel"}),jsxRuntime.jsx(xe,{onClick:$e,children:"Add Image"})]})]})]}),n.table&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(to,{open:A,onOpenChange:L,children:[jsxRuntime.jsx(qs,{asChild:!0,children:jsxRuntime.jsx(yt,{tooltip:"Create table",disabled:m,children:jsxRuntime.jsx(lucideReact.Table,{className:"w-4 h-4"})})}),jsxRuntime.jsxs(Tn,{className:"sm:max-w-[425px]",children:[jsxRuntime.jsxs(Qr,{children:[jsxRuntime.jsx(en,{children:"Create Table"}),jsxRuntime.jsx(tn,{children:"Choose the size for your new table."})]}),jsxRuntime.jsxs("div",{className:"grid gap-4 py-4",children:[jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{className:"grid gap-2",children:[jsxRuntime.jsx(He,{htmlFor:"rows",children:"Rows"}),jsxRuntime.jsx(Ft,{id:"rows",type:"number",min:"1",max:"20",value:Y,onChange:D=>te(parseInt(D.target.value)||3)})]}),jsxRuntime.jsxs("div",{className:"grid gap-2",children:[jsxRuntime.jsx(He,{htmlFor:"cols",children:"Columns"}),jsxRuntime.jsx(Ft,{id:"cols",type:"number",min:"1",max:"10",value:ke,onChange:D=>me(parseInt(D.target.value)||3)})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:"headerRow",defaultChecked:!0,className:"rounded border-gray-300"}),jsxRuntime.jsx(He,{htmlFor:"headerRow",className:"text-sm font-normal",children:"Include header row"})]})]}),jsxRuntime.jsxs("div",{className:"flex justify-end gap-2",children:[jsxRuntime.jsx(xe,{variant:"outline",onClick:()=>L(!1),children:"Cancel"}),jsxRuntime.jsx(xe,{onClick:Re,children:"Create Table"})]})]})]}),jsxRuntime.jsxs(Gd,{children:[jsxRuntime.jsx(qd,{asChild:!0,children:jsxRuntime.jsx(xe,{variant:"ghost",size:"sm",className:"h-8 px-1",children:jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-3 h-3"})})}),jsxRuntime.jsxs(ja,{children:[jsxRuntime.jsx(Ve,{onClick:()=>w.chain().focus().addColumnBefore().run(),children:"Add column before"}),jsxRuntime.jsx(Ve,{onClick:()=>w.chain().focus().addColumnAfter().run(),children:"Add column after"}),jsxRuntime.jsx(Ve,{onClick:()=>w.chain().focus().deleteColumn().run(),children:"Delete column"}),jsxRuntime.jsx(yo,{}),jsxRuntime.jsx(Ve,{onClick:()=>w.chain().focus().addRowBefore().run(),children:"Add row before"}),jsxRuntime.jsx(Ve,{onClick:()=>w.chain().focus().addRowAfter().run(),children:"Add row after"}),jsxRuntime.jsx(Ve,{onClick:()=>w.chain().focus().deleteRow().run(),children:"Delete row"}),jsxRuntime.jsx(yo,{}),jsxRuntime.jsxs(Ve,{onClick:()=>Ae(!0),children:[jsxRuntime.jsx(lucideReact.Settings,{className:"w-4 h-4 mr-2"}),"Table Borders"]}),jsxRuntime.jsx(yo,{}),jsxRuntime.jsx(Ve,{onClick:()=>w.chain().focus().deleteTable().run(),children:"Delete table"})]})]})]})]}),(n.link||n.image||n.table)&&!0&&jsxRuntime.jsx("div",{className:"w-px h-6 bg-border mx-1 shrink-0"}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[jsxRuntime.jsx(yt,{onClick:()=>w.chain().focus().undo().run(),disabled:!w.can().undo()||m,tooltip:"Undo (Cmd+Z)",children:jsxRuntime.jsx(lucideReact.Undo,{className:"w-4 h-4"})}),jsxRuntime.jsx(yt,{onClick:()=>w.chain().focus().redo().run(),disabled:!w.can().redo()||m,tooltip:"Redo (Cmd+Shift+Z)",children:jsxRuntime.jsx(lucideReact.Redo,{className:"w-4 h-4"})}),jsxRuntime.jsx(yt,{active:m,onClick:()=>{m?w.commands.setContent(b):v(w.getHTML()),g(!m);},tooltip:m?"Visual Mode":"Source Code",children:m?jsxRuntime.jsx(lucideReact.Edit,{className:"w-4 h-4"}):jsxRuntime.jsx(lucideReact.Eye,{className:"w-4 h-4"})}),n.ai&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(Gd,{children:[jsxRuntime.jsx(qd,{asChild:!0,children:jsxRuntime.jsxs(xe,{variant:"ghost",size:"sm",className:"h-8 px-3 bg-purple-100 hover:bg-purple-200 dark:bg-purple-900 dark:hover:bg-purple-800",disabled:p,children:[p?jsxRuntime.jsx(lucideReact.RefreshCw,{className:"w-4 h-4 mr-1 animate-spin"}):jsxRuntime.jsx(lucideReact.Wand2,{className:"w-4 h-4 mr-1"}),"AI Tools"]})}),jsxRuntime.jsxs(ja,{className:"w-56",children:[jsxRuntime.jsxs(Ve,{onClick:()=>M("rewrite"),children:[jsxRuntime.jsx(lucideReact.RefreshCw,{className:"w-4 h-4 mr-2"}),"Rewrite Selection"]}),jsxRuntime.jsxs(Ve,{onClick:()=>M("improve"),children:[jsxRuntime.jsx(lucideReact.Wand2,{className:"w-4 h-4 mr-2"}),"Improve Writing"]}),jsxRuntime.jsxs(Ve,{onClick:()=>M("expand"),children:[jsxRuntime.jsx(lucideReact.Maximize,{className:"w-4 h-4 mr-2"}),"Expand Text"]}),jsxRuntime.jsxs(Ve,{onClick:()=>M("summarize"),children:[jsxRuntime.jsx(lucideReact.FileText,{className:"w-4 h-4 mr-2"}),"Summarize"]}),jsxRuntime.jsxs(Ve,{onClick:()=>M("continue"),children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-4 h-4 mr-2"}),"Continue Writing"]}),jsxRuntime.jsx(yo,{}),jsxRuntime.jsxs(Ve,{onClick:()=>M("fix"),children:[jsxRuntime.jsx(lucideReact.Check,{className:"w-4 h-4 mr-2"}),"Fix Grammar & Spelling"]}),jsxRuntime.jsx(yo,{}),jsxRuntime.jsxs(Ve,{onClick:()=>M("tone_professional"),children:[jsxRuntime.jsx(lucideReact.Sparkles,{className:"w-4 h-4 mr-2"}),"Make Professional"]}),jsxRuntime.jsxs(Ve,{onClick:()=>M("tone_casual"),children:[jsxRuntime.jsx(lucideReact.Sparkles,{className:"w-4 h-4 mr-2"}),"Make Casual"]}),jsxRuntime.jsxs(Ve,{onClick:()=>M("tone_friendly"),children:[jsxRuntime.jsx(lucideReact.Sparkles,{className:"w-4 h-4 mr-2"}),"Make Friendly"]}),jsxRuntime.jsxs(Ve,{onClick:()=>M("tone_formal"),children:[jsxRuntime.jsx(lucideReact.Sparkles,{className:"w-4 h-4 mr-2"}),"Make Formal"]}),jsxRuntime.jsx(yo,{}),jsxRuntime.jsxs(Ve,{onClick:()=>M("translate"),children:[jsxRuntime.jsx(lucideReact.Languages,{className:"w-4 h-4 mr-2"}),"Translate to Turkish"]}),jsxRuntime.jsxs(Ve,{onClick:()=>M("ideas"),children:[jsxRuntime.jsx(lucideReact.Sparkles,{className:"w-4 h-4 mr-2"}),"Generate Ideas"]})]})]}),jsxRuntime.jsxs(to,{open:u,onOpenChange:f,children:[jsxRuntime.jsx(qs,{asChild:!0,children:jsxRuntime.jsx(yt,{tooltip:"AI Settings - Configure your API keys here",disabled:m,children:jsxRuntime.jsx(lucideReact.Settings,{className:"w-4 h-4"})})}),jsxRuntime.jsxs(Tn,{className:"sm:max-w-[425px]",children:[jsxRuntime.jsxs(Qr,{children:[jsxRuntime.jsx(en,{children:"AI Settings"}),jsxRuntime.jsx(tn,{children:"Configure your AI provider and API settings."})]}),jsxRuntime.jsxs("div",{className:"grid gap-4 py-4",children:[jsxRuntime.jsxs("div",{className:"grid gap-2",children:[jsxRuntime.jsx(He,{htmlFor:"provider",children:"Provider"}),jsxRuntime.jsxs(Bo,{value:c.provider,onValueChange:D=>d({...c,provider:D}),children:[jsxRuntime.jsx(Fo,{children:jsxRuntime.jsx(Pi,{})}),jsxRuntime.jsxs(zo,{children:[jsxRuntime.jsx(Ge,{value:"openai",children:"OpenAI"}),jsxRuntime.jsx(Ge,{value:"claude",children:"Claude (Anthropic)"}),jsxRuntime.jsx(Ge,{value:"gemini",children:"Gemini (Google)"}),jsxRuntime.jsx(Ge,{value:"cohere",children:"Cohere"})]})]})]}),jsxRuntime.jsxs("div",{className:"grid gap-2",children:[jsxRuntime.jsx(He,{htmlFor:"apiKey",children:"API Key"}),jsxRuntime.jsx(Ft,{id:"apiKey",type:"password",value:c.apiKey,onChange:D=>d({...c,apiKey:D.target.value}),placeholder:"sk-..."})]}),jsxRuntime.jsxs("div",{className:"grid gap-2",children:[jsxRuntime.jsx(He,{htmlFor:"model",children:"Model"}),jsxRuntime.jsxs(Bo,{value:c.model,onValueChange:D=>d({...c,model:D}),children:[jsxRuntime.jsx(Fo,{children:jsxRuntime.jsx(Pi,{})}),jsxRuntime.jsxs(zo,{children:[c.provider==="openai"&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Ge,{value:"gpt-4",children:"GPT-4"}),jsxRuntime.jsx(Ge,{value:"gpt-3.5-turbo",children:"GPT-3.5 Turbo"})]}),c.provider==="claude"&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Ge,{value:"claude-3-opus",children:"Claude 3 Opus"}),jsxRuntime.jsx(Ge,{value:"claude-3-sonnet",children:"Claude 3 Sonnet"}),jsxRuntime.jsx(Ge,{value:"claude-3-haiku",children:"Claude 3 Haiku"})]}),c.provider==="gemini"&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Ge,{value:"gemini-pro",children:"Gemini Pro"}),jsxRuntime.jsx(Ge,{value:"gemini-pro-vision",children:"Gemini Pro Vision"})]}),c.provider==="cohere"&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Ge,{value:"command",children:"Command"}),jsxRuntime.jsx(Ge,{value:"command-light",children:"Command Light"})]})]})]})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{className:"grid gap-2",children:[jsxRuntime.jsx(He,{htmlFor:"temperature",children:"Temperature"}),jsxRuntime.jsx(Ft,{id:"temperature",type:"number",min:"0",max:"2",step:"0.1",value:c.temperature,onChange:D=>d({...c,temperature:parseFloat(D.target.value)})})]}),jsxRuntime.jsxs("div",{className:"grid gap-2",children:[jsxRuntime.jsx(He,{htmlFor:"maxTokens",children:"Max Tokens"}),jsxRuntime.jsx(Ft,{id:"maxTokens",type:"number",min:"1",max:"4000",value:c.maxTokens,onChange:D=>d({...c,maxTokens:parseInt(D.target.value)})})]})]})]}),jsxRuntime.jsx("div",{className:"flex justify-end",children:jsxRuntime.jsx(xe,{onClick:()=>{f(!1),Gn({title:"Settings saved",description:"Your AI settings have been updated."});},children:"Save Settings"})})]})]})]})]})]})})}),jsxRuntime.jsx(to,{open:Te,onOpenChange:Ae,children:jsxRuntime.jsxs(Tn,{className:"sm:max-w-[425px]",children:[jsxRuntime.jsxs(Qr,{children:[jsxRuntime.jsx(en,{children:"Table Border Settings"}),jsxRuntime.jsx(tn,{children:"Customize the appearance of table borders."})]}),jsxRuntime.jsxs("div",{className:"grid gap-6 py-4",children:[jsxRuntime.jsxs("div",{className:"grid gap-3",children:[jsxRuntime.jsx(He,{htmlFor:"border-width",children:"Border Width"}),jsxRuntime.jsxs("div",{className:"flex items-center gap-4",children:[jsxRuntime.jsx(Ym,{id:"border-width",min:0,max:5,step:1,value:[W],onValueChange:D=>ue(D[0]),className:"flex-1"}),jsxRuntime.jsxs("span",{className:"text-sm font-medium w-8",children:[W,"px"]})]})]}),jsxRuntime.jsxs("div",{className:"grid gap-3",children:[jsxRuntime.jsx(He,{htmlFor:"border-color",children:"Border Color"}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(zi,{value:Oe,onChange:Se,showInput:!0,showPresets:!1,size:"sm"}),jsxRuntime.jsx("span",{className:"text-sm text-muted-foreground",children:Oe})]})]}),jsxRuntime.jsxs("div",{className:"grid gap-3",children:[jsxRuntime.jsx(He,{htmlFor:"border-style",children:"Border Style"}),jsxRuntime.jsxs(Bo,{value:le,onValueChange:Ce,children:[jsxRuntime.jsx(Fo,{children:jsxRuntime.jsx(Pi,{})}),jsxRuntime.jsxs(zo,{children:[jsxRuntime.jsx(Ge,{value:"solid",children:"Solid"}),jsxRuntime.jsx(Ge,{value:"dashed",children:"Dashed"}),jsxRuntime.jsx(Ge,{value:"dotted",children:"Dotted"}),jsxRuntime.jsx(Ge,{value:"double",children:"Double"}),jsxRuntime.jsx(Ge,{value:"groove",children:"Groove"}),jsxRuntime.jsx(Ge,{value:"ridge",children:"Ridge"}),jsxRuntime.jsx(Ge,{value:"inset",children:"Inset"}),jsxRuntime.jsx(Ge,{value:"outset",children:"Outset"})]})]})]}),jsxRuntime.jsxs("div",{className:"grid gap-3",children:[jsxRuntime.jsx(He,{children:"Preview"}),jsxRuntime.jsx("div",{className:"p-4 bg-gray-50 dark:bg-gray-900 rounded-lg",children:jsxRuntime.jsxs("table",{className:"w-full text-sm",style:{borderCollapse:"collapse",border:`${W}px ${le} ${Oe}`},children:[jsxRuntime.jsx("thead",{children:jsxRuntime.jsxs("tr",{children:[jsxRuntime.jsx("th",{style:{border:`${W}px ${le} ${Oe}`,padding:"8px",textAlign:"left"},children:"Header 1"}),jsxRuntime.jsx("th",{style:{border:`${W}px ${le} ${Oe}`,padding:"8px",textAlign:"left"},children:"Header 2"})]})}),jsxRuntime.jsx("tbody",{children:jsxRuntime.jsxs("tr",{children:[jsxRuntime.jsx("td",{style:{border:`${W}px ${le} ${Oe}`,padding:"8px"},children:"Cell 1"}),jsxRuntime.jsx("td",{style:{border:`${W}px ${le} ${Oe}`,padding:"8px"},children:"Cell 2"})]})})]})})]})]}),jsxRuntime.jsxs("div",{className:"flex justify-end gap-2",children:[jsxRuntime.jsx(xe,{variant:"outline",onClick:()=>Ae(!1),children:"Cancel"}),jsxRuntime.jsx(xe,{onClick:()=>{wt(W,Oe,le),Ae(!1),Gn({title:"Borders applied",description:"Table borders have been updated."});},children:"Apply Borders"})]})]})}),jsxRuntime.jsx("div",{className:"overflow-auto",style:{height:typeof r=="number"?`${r}px`:r},children:m?jsxRuntime.jsx("textarea",{value:b,onChange:D=>v(D.target.value),className:"w-full h-full p-4 font-mono text-sm resize-none focus:outline-none bg-gray-50 dark:bg-gray-900",placeholder:"HTML source code..."}):jsxRuntime.jsx(SE,{editor:w})})]}):null}var mg=class{constructor(e,r="lru"){this.cache=new Map;this.maxSize=e,this.strategy=r;}set(e,r,n=!1){this.cache.size>=this.maxSize&&this.evict(),this.cache.set(e,{data:r,timestamp:Date.now(),accessCount:0,compressed:n});}get(e){let r=this.cache.get(e);return r?(r.accessCount++,r.timestamp=Date.now(),r.data):null}evict(){if(this.cache.size===0)return;let e=null;switch(this.strategy){case"lru":let r=1/0;for(let[o,i]of this.cache)i.timestamp<r&&(r=i.timestamp,e=o);break;case"lfu":let n=1/0;for(let[o,i]of this.cache)i.accessCount<n&&(n=i.accessCount,e=o);break;case"fifo":e=this.cache.keys().next().value;break}e&&this.cache.delete(e);}clear(){this.cache.clear();}getStats(){return {size:this.cache.size,hitRate:.95}}};function Fte({data:t,config:e={},renderItem:r,height:n=400,onMemoryUpdate:o,className:i}){let{chunkSize:s=1e3,maxMemoryItems:a=1e4,cacheStrategy:l="lru",compression:c=!1,autoCleanup:d=!0,cleanupThreshold:u=.8,streamingMode:f=!1,enableAnalytics:p=!1,analyticsCallback:h}=e,[m,g]=ee.useState({start:0,end:Math.min(s,t.length)}),[b,v]=ee.useState({memoryUsage:0,itemCount:0,cacheHitRate:.95}),y=ee.useRef(null),x=ee.useRef(new mg(Math.floor(a/s),l)),E=ee.useRef(),S=ee.useMemo(()=>{let w=m.start,N=Math.min(m.end,t.length),M=`${w}-${N}`,B=x.current.get(M);if(B&&B.length===N-w)return B;let U=t.slice(w,N);return x.current.set(M,U,c),U},[t,m,c]),R=ee.useCallback(w=>{let N=w.currentTarget.scrollTop,M=w.currentTarget.clientHeight,B=60,U=Math.floor(N/B),K=Math.ceil(M/B),P=Math.floor(K*.5),V=Math.max(0,U-P),C=Math.min(t.length,U+K+P);E.current&&clearTimeout(E.current),E.current=setTimeout(()=>{g({start:V,end:C});},16);},[t.length]);return ee.useEffect(()=>{let w=x.current.getStats(),N={memoryUsage:S.length*1024,itemCount:S.length,cacheHitRate:w.hitRate,compressionRatio:c?.7:1,lastCleanup:Date.now()};v(N),p&&h&&h(N),o&&o(N);},[S,p,h,o,c]),ee.useEffect(()=>{if(!d)return;let w=setInterval(()=>{S.length/a>u&&x.current.clear();},5e3);return ()=>clearInterval(w)},[d,u,a,S.length]),jsxRuntime.jsx("div",{ref:y,className:I("overflow-auto border rounded-lg bg-background",i),style:{height:n},onScroll:R,children:jsxRuntime.jsx("div",{style:{height:t.length*60,position:"relative"},children:jsxRuntime.jsx("div",{style:{transform:`translateY(${m.start*60}px)`,position:"absolute",width:"100%"},children:S.map((w,N)=>jsxRuntime.jsx(ee__namespace.default.Fragment,{children:r(w,m.start+N)},m.start+N))})})})}function zte({onStatsUpdate:t,showRealTime:e=!1,className:r}){let[n,o]=ee.useState({memoryUsage:0,itemCount:0,cacheHitRate:.95});return ee.useEffect(()=>{if(!e)return;let i=setInterval(()=>{let s={memoryUsage:Math.random()*50*1024*1024,itemCount:Math.floor(Math.random()*5e4),cacheHitRate:.9+Math.random()*.1,lastCleanup:Date.now()};o(s),t&&t(s);},1e3);return ()=>clearInterval(i)},[e,t]),e?jsxRuntime.jsx("div",{className:I("text-xs text-muted-foreground",r),children:"Memory Analytics Active - Updates every second"}):null}function Hte(t=[],e){let[r,n]=ee.useState(t),{interval:o=1e3,maxItems:i=1e4}=e||{},s=ee.useCallback(l=>{n(c=>{let d=[...c,l];return d.length>i?d.slice(-i):d});},[i]),a=ee.useCallback(()=>{n([]);},[]);return {data:r,addItem:s,clearData:a}}function o9({items:t,height:e,itemHeight:r=50,estimatedItemHeight:n=50,variableHeight:o=!1,overscan:i=5,renderItem:s,onScroll:a,className:l}){let[c,d]=ee.useState(0),[u,f]=ee.useState(!1),[p,h]=ee.useState(new Map),m=ee.useRef(null),g=ee.useRef(null),b=ee.useRef(),v=ee.useRef(),y=ee.useMemo(()=>{let w=[],N=0;for(let M=0;M<t.length;M++){let B=o?p.get(M)||n:r;w.push({index:M,height:B,top:N}),N+=B;}return w},[t.length,r,n,o,p]),x=ee.useMemo(()=>y.length>0?y[y.length-1].top+y[y.length-1].height:0,[y]),E=ee.useMemo(()=>{let w=y.findIndex(U=>U.top+U.height>=c),N=y.findIndex(U=>U.top>c+e),M=Math.max(0,w-i),B=N===-1?Math.min(t.length-1,w+Math.ceil(e/r)+i):Math.min(t.length-1,N+i);return {start:M,end:B}},[c,e,y,i,t.length,r]),S=ee.useMemo(()=>{let w=[];for(let N=E.start;N<=E.end;N++)if(N>=0&&N<t.length&&y[N]){let M=y[N];w.push({item:t[N],index:N,style:{position:"absolute",top:M.top,left:0,right:0,height:o?"auto":M.height,minHeight:o?M.height:void 0}});}return w},[t,E,y,o]),R=ee.useCallback(w=>{let N=w.currentTarget.scrollTop;d(N),f(!0),a&&a(N),b.current&&clearTimeout(b.current),v.current&&clearTimeout(v.current),v.current=setTimeout(()=>{f(!1);},150);},[a]);return ee.useEffect(()=>{if(!o||!m.current)return;let w=new ResizeObserver(M=>{let B=new Map(p),U=!1;M.forEach(K=>{let V=K.target.getAttribute("data-index");if(V){let C=parseInt(V,10),T=K.contentRect.height;B.get(C)!==T&&(B.set(C,T),U=!0);}}),U&&h(B);});return m.current.querySelectorAll("[data-index]").forEach(M=>w.observe(M)),()=>w.disconnect()},[o,p,S]),ee.useEffect(()=>{let w=M=>{if(m.current)switch(M.key){case"ArrowUp":M.preventDefault(),g.current?.scrollBy({top:-r,behavior:"smooth"});break;case"ArrowDown":M.preventDefault(),g.current?.scrollBy({top:r,behavior:"smooth"});break;case"PageUp":M.preventDefault(),g.current?.scrollBy({top:-e,behavior:"smooth"});break;case"PageDown":M.preventDefault(),g.current?.scrollBy({top:e,behavior:"smooth"});break;case"Home":M.preventDefault(),g.current?.scrollTo({top:0,behavior:"smooth"});break;case"End":M.preventDefault(),g.current?.scrollTo({top:x,behavior:"smooth"});break}},N=m.current;if(N)return N.addEventListener("keydown",w),()=>N.removeEventListener("keydown",w)},[r,e,x]),jsxRuntime.jsxs("div",{ref:m,className:I("relative overflow-hidden border rounded-lg bg-background focus:outline-none focus:ring-2 focus:ring-ring",l),style:{height:e},tabIndex:0,role:"listbox","aria-label":`Virtual list with ${t.length} items`,children:[jsxRuntime.jsx("div",{ref:g,className:"h-full overflow-auto scrollbar-thin scrollbar-thumb-muted scrollbar-track-transparent",onScroll:R,children:jsxRuntime.jsx("div",{style:{height:x,position:"relative"},children:S.map(({item:w,index:N,style:M})=>jsxRuntime.jsx("div",{"data-index":N,style:M,role:"option","aria-selected":"false",className:"outline-none",children:s(w,N)},N))})}),u&&jsxRuntime.jsx("div",{className:"absolute top-2 right-2 bg-muted/80 text-muted-foreground px-2 py-1 rounded text-xs",children:"Scrolling..."}),t.length>100&&jsxRuntime.jsxs("div",{className:"absolute bottom-2 right-2 bg-muted/80 text-muted-foreground px-2 py-1 rounded text-xs",children:[Math.round(c/Math.max(x-e,1)*100),"%"]})]})}function qte(t,e={}){let[r,n]=ee.useState(e),[o,i]=ee.useState(new Set),s=ee.useCallback(d=>{n(u=>({...u,...d}));},[]),a=ee.useCallback(d=>{i(u=>new Set([...u,d]));},[]),l=ee.useCallback(d=>{i(u=>{let f=new Set(u);return f.delete(d),f});},[]),c=ee.useCallback(()=>{i(new Set);},[]);return {config:r,updateConfig:s,selectedItems:o,selectItem:a,deselectItem:l,clearSelection:c}}function jte({selectable:t=!1,multiSelect:e=!1,selectedItems:r=new Set,onSelectionChange:n,renderItem:o,...i}){let s=ee.useCallback(l=>{if(!t||!n)return;let c=new Set(r);e?c.has(l)?c.delete(l):c.add(l):(c.clear(),c.add(l)),n(c);},[t,e,r,n]),a=ee.useCallback((l,c)=>{let d=r.has(c);return jsxRuntime.jsx("div",{className:I("transition-colors",t&&"cursor-pointer hover:bg-muted/50",d&&"bg-primary/10 border-l-4 border-primary"),onClick:()=>t&&s(c),children:o(l,c)})},[o,t,r,s]);return jsxRuntime.jsx(o9,{...i,renderItem:a})}var a9=ee__namespace.default.forwardRef(({children:t,onSwipeLeft:e,onSwipeRight:r,onSwipeStart:n,onSwipeEnd:o,threshold:i=100,disabled:s=!1,className:a,style:l,...c},d)=>{let u=framerMotion.useMotionValue(0),f=framerMotion.useTransform(u,[-200,200],[-30,30]),p=framerMotion.useTransform(u,[0,i],[0,1]),h=framerMotion.useTransform(u,[-i,0],[1,0]),m=()=>{s||n?.();},g=(b,v)=>{if(!s)if(o?.(),Math.abs(v.offset.x)>i){let y=v.offset.x>0?"right":"left",x=v.offset.x>0?400:-400;framerMotion.animate(u,x,{duration:.3}),y==="right"&&r?r():y==="left"&&e&&e();}else framerMotion.animate(u,0,{type:"spring",stiffness:300,damping:20});};return jsxRuntime.jsxs(framerMotion.motion.div,{ref:d,drag:s?!1:"x",dragConstraints:{left:-300,right:300},style:{x:u,rotate:f,...l},onDragStart:m,onDragEnd:g,className:I("relative cursor-grab active:cursor-grabbing select-none",s&&"cursor-default",a),...c,children:[jsxRuntime.jsx(framerMotion.motion.div,{style:{opacity:p},className:"absolute top-4 right-4 bg-green-500 text-white px-3 py-1 rounded-lg font-bold text-lg rotate-[15deg] pointer-events-none z-10",children:"LIKE"}),jsxRuntime.jsx(framerMotion.motion.div,{style:{opacity:h},className:"absolute top-4 left-4 bg-red-500 text-white px-3 py-1 rounded-lg font-bold text-lg rotate-[-15deg] pointer-events-none z-10",children:"NOPE"}),t]})});a9.displayName="SwipeableCard";function are({items:t,onReorder:e,renderItem:r,keyExtractor:n,direction:o="vertical",className:i,droppableId:s="draggable-list",disabled:a=!1}){return jsxRuntime.jsx(dnd.DragDropContext,{onDragEnd:c=>{if(!c.destination||a)return;let d=c.source.index,u=c.destination.index;if(d===u)return;let f=Array.from(t),[p]=f.splice(d,1);f.splice(u,0,p),e(f);},children:jsxRuntime.jsx(dnd.Droppable,{droppableId:s,direction:o,isDropDisabled:a,children:(c,d)=>jsxRuntime.jsxs("div",{...c.droppableProps,ref:c.innerRef,className:I("space-y-2",o==="horizontal"&&"flex space-y-0 space-x-2",d.isDraggingOver&&"bg-muted/50 rounded-lg",i),children:[t.map((u,f)=>jsxRuntime.jsx(dnd.Draggable,{draggableId:n(u),index:f,isDragDisabled:a,children:(p,h)=>jsxRuntime.jsx("div",{ref:p.innerRef,...p.draggableProps,...p.dragHandleProps,className:I("transition-all duration-200",h.isDragging&&"rotate-2 scale-105 shadow-lg z-50",a&&"cursor-not-allowed opacity-50"),style:{...p.draggableProps.style,transform:h.isDragging?p.draggableProps.style?.transform:"none"},children:r(u,f)})},n(u))),c.placeholder]})})})}/*! Bundled license information:
|
|
120
191
|
|
|
121
192
|
use-sync-external-store/cjs/use-sync-external-store-shim.production.js:
|
|
122
193
|
(**
|
|
@@ -163,17 +234,14 @@ use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.developme
|
|
|
163
234
|
*)
|
|
164
235
|
*/
|
|
165
236
|
|
|
166
|
-
exports.
|
|
167
|
-
exports.
|
|
168
|
-
exports.
|
|
169
|
-
exports.
|
|
170
|
-
exports.
|
|
171
|
-
exports.
|
|
172
|
-
exports.
|
|
173
|
-
exports.
|
|
174
|
-
exports.
|
|
175
|
-
exports.
|
|
176
|
-
exports.
|
|
177
|
-
exports.VirtualList = XM;
|
|
178
|
-
exports.useStreamingData = G1;
|
|
179
|
-
exports.useVirtualList = hF;
|
|
237
|
+
exports.Calendar = ZV;
|
|
238
|
+
exports.DraggableList = are;
|
|
239
|
+
exports.Kanban = hK;
|
|
240
|
+
exports.MemoryAnalytics = zte;
|
|
241
|
+
exports.MemoryEfficientData = Fte;
|
|
242
|
+
exports.RichTextEditor = Pte;
|
|
243
|
+
exports.SelectableVirtualList = jte;
|
|
244
|
+
exports.SwipeableCard = a9;
|
|
245
|
+
exports.VirtualList = o9;
|
|
246
|
+
exports.useStreamingData = Hte;
|
|
247
|
+
exports.useVirtualList = qte;
|