@bigbinary/neetoui-rn 3.4.0 → 3.5.1
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/lib/typescript/src/components/ChatInput/AttachmentsView.d.ts +2 -1
- package/lib/typescript/src/components/ChatInput/AttachmentsView.d.ts.map +1 -1
- package/lib/typescript/src/components/ChatInput/ChatInput.d.ts +76 -0
- package/lib/typescript/src/components/ChatInput/ChatInput.d.ts.map +1 -1
- package/lib/typescript/src/components/ChatInput/MentionSuggestionList.d.ts +9 -0
- package/lib/typescript/src/components/ChatInput/MentionSuggestionList.d.ts.map +1 -0
- package/lib/typescript/src/components/ChatInput/MentionsInput.d.ts +3 -1
- package/lib/typescript/src/components/ChatInput/MentionsInput.d.ts.map +1 -1
- package/lib/typescript/src/components/ChatInput/SegmentedOptions.d.ts +10 -0
- package/lib/typescript/src/components/ChatInput/SegmentedOptions.d.ts.map +1 -0
- package/lib/typescript/src/components/ChatInput/constants.d.ts +3 -0
- package/lib/typescript/src/components/ChatInput/constants.d.ts.map +1 -1
- package/lib/typescript/src/components/ChatInput/index.d.ts +1 -1
- package/lib/typescript/src/components/ChatInput/index.d.ts.map +1 -1
- package/lib/typescript/src/components/ChatInput/mentions.d.ts +2 -0
- package/lib/typescript/src/components/ChatInput/mentions.d.ts.map +1 -1
- package/lib/typescript/src/components/RichTextEditor/LazyRichTextEditor.d.ts +3 -0
- package/lib/typescript/src/components/RichTextEditor/LazyRichTextEditor.d.ts.map +1 -0
- package/lib/typescript/src/components/RichTextEditor/MentionSuggestionBar.d.ts +8 -0
- package/lib/typescript/src/components/RichTextEditor/MentionSuggestionBar.d.ts.map +1 -0
- package/lib/typescript/src/components/RichTextEditor/RichTextEditor.d.ts +39 -0
- package/lib/typescript/src/components/RichTextEditor/RichTextEditor.d.ts.map +1 -0
- package/lib/typescript/src/components/RichTextEditor/RichTextToolbar.d.ts +8 -0
- package/lib/typescript/src/components/RichTextEditor/RichTextToolbar.d.ts.map +1 -0
- package/lib/typescript/src/components/RichTextEditor/bridges/CodeBlockBridge.d.ts +13 -0
- package/lib/typescript/src/components/RichTextEditor/bridges/CodeBlockBridge.d.ts.map +1 -0
- package/lib/typescript/src/components/RichTextEditor/bridges/ComposerBridge.d.ts +27 -0
- package/lib/typescript/src/components/RichTextEditor/bridges/ComposerBridge.d.ts.map +1 -0
- package/lib/typescript/src/components/RichTextEditor/bridges/FigureBridge.d.ts +3 -0
- package/lib/typescript/src/components/RichTextEditor/bridges/FigureBridge.d.ts.map +1 -0
- package/lib/typescript/src/components/RichTextEditor/bridges/MentionBridge.d.ts +35 -0
- package/lib/typescript/src/components/RichTextEditor/bridges/MentionBridge.d.ts.map +1 -0
- package/lib/typescript/src/components/RichTextEditor/bridges/VariableBridge.d.ts +3 -0
- package/lib/typescript/src/components/RichTextEditor/bridges/VariableBridge.d.ts.map +1 -0
- package/lib/typescript/src/components/RichTextEditor/bridges/index.d.ts +8 -0
- package/lib/typescript/src/components/RichTextEditor/bridges/index.d.ts.map +1 -0
- package/lib/typescript/src/components/RichTextEditor/bridges/nodes/Figure.d.ts +3 -0
- package/lib/typescript/src/components/RichTextEditor/bridges/nodes/Figure.d.ts.map +1 -0
- package/lib/typescript/src/components/RichTextEditor/bridges/nodes/Mention.d.ts +3 -0
- package/lib/typescript/src/components/RichTextEditor/bridges/nodes/Mention.d.ts.map +1 -0
- package/lib/typescript/src/components/RichTextEditor/bridges/nodes/Variable.d.ts +3 -0
- package/lib/typescript/src/components/RichTextEditor/bridges/nodes/Variable.d.ts.map +1 -0
- package/lib/typescript/src/components/RichTextEditor/bridges/types.d.ts +7 -0
- package/lib/typescript/src/components/RichTextEditor/bridges/types.d.ts.map +1 -0
- package/lib/typescript/src/components/RichTextEditor/editorCss.d.ts +21 -0
- package/lib/typescript/src/components/RichTextEditor/editorCss.d.ts.map +1 -0
- package/lib/typescript/src/components/RichTextEditor/icons/index.d.ts +9 -0
- package/lib/typescript/src/components/RichTextEditor/icons/index.d.ts.map +1 -0
- package/lib/typescript/src/components/RichTextEditor/index.d.ts +3 -0
- package/lib/typescript/src/components/RichTextEditor/index.d.ts.map +1 -0
- package/lib/typescript/src/components/RichTextEditor/injectableText.d.ts +2 -0
- package/lib/typescript/src/components/RichTextEditor/injectableText.d.ts.map +1 -0
- package/lib/typescript/src/components/RichTextEditor/web/build/editorHtml.d.ts +2 -0
- package/lib/typescript/src/components/RichTextEditor/web/build/editorHtml.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +2 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/package.json +30 -7
- package/src/components/ChatInput/AttachmentsView.tsx +6 -0
- package/src/components/ChatInput/ChatInput.tsx +557 -91
- package/src/components/ChatInput/MentionSuggestionList.tsx +71 -0
- package/src/components/ChatInput/MentionsInput.tsx +34 -46
- package/src/components/ChatInput/SegmentedOptions.tsx +84 -0
- package/src/components/ChatInput/constants.ts +10 -0
- package/src/components/ChatInput/index.ts +3 -0
- package/src/components/ChatInput/mentions.ts +22 -0
- package/src/components/RichTextEditor/LazyRichTextEditor.tsx +19 -0
- package/src/components/RichTextEditor/MentionSuggestionBar.tsx +79 -0
- package/src/components/RichTextEditor/RichTextEditor.tsx +213 -0
- package/src/components/RichTextEditor/RichTextToolbar.tsx +452 -0
- package/src/components/RichTextEditor/bridges/CodeBlockBridge.ts +29 -0
- package/src/components/RichTextEditor/bridges/ComposerBridge.ts +107 -0
- package/src/components/RichTextEditor/bridges/FigureBridge.ts +7 -0
- package/src/components/RichTextEditor/bridges/MentionBridge.ts +79 -0
- package/src/components/RichTextEditor/bridges/VariableBridge.ts +7 -0
- package/src/components/RichTextEditor/bridges/index.ts +66 -0
- package/src/components/RichTextEditor/bridges/nodes/Figure.ts +127 -0
- package/src/components/RichTextEditor/bridges/nodes/Mention.ts +48 -0
- package/src/components/RichTextEditor/bridges/nodes/Variable.ts +68 -0
- package/src/components/RichTextEditor/bridges/types.ts +24 -0
- package/src/components/RichTextEditor/editorCss.ts +69 -0
- package/src/components/RichTextEditor/icons/index.tsx +41 -0
- package/src/components/RichTextEditor/index.ts +2 -0
- package/src/components/RichTextEditor/injectableText.ts +11 -0
- package/src/components/RichTextEditor/web/build/editorHtml.ts +3 -0
- package/src/index.ts +8 -0
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
// Generated by `yarn build:editor`. Do not edit.
|
|
3
|
+
export const editorHtml: string = "<!doctype html>\n<html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\" />\n <meta\n name=\"viewport\"\n content=\"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no\"\n />\n <title>RichTextEditor</title>\n <style>\n body {\n margin: 0;\n padding: 0;\n }\n #root > div:nth-of-type(1) {\n position: absolute;\n height: 100%;\n overflow: auto;\n width: 100%;\n top: 0;\n bottom: 0;\n }\n #root > div.dynamic-height {\n height: unset;\n }\n #root div .ProseMirror {\n min-height: 100%;\n overflow: visible;\n }\n #root div.dynamic-height .ProseMirror {\n height: unset;\n }\n .ProseMirror:focus {\n outline: none;\n }\n .ProseMirror p {\n margin: 0;\n }\n .highlight-background {\n background-color: #e6e6ff;\n }\n .neeto-editor-variable {\n background-color: #f0f3f5;\n border-radius: 4px;\n padding: 0 2px;\n }\n pre {\n background-color: #f0f3f5;\n border-radius: 4px;\n padding: 8px;\n white-space: pre-wrap;\n }\n .neeto-editor__image-wrapper figure {\n margin: 4px 0;\n }\n .neeto-editor__image img {\n max-width: 100%;\n }\n .neeto-editor__image--bordered img {\n border: 1px solid #d9d9d9;\n }\n figcaption:empty {\n display: none;\n }\n </style>\n <script type=\"module\" crossorigin>(function(){const t=document.createElement(\"link\").relList;if(t&&t.supports&&t.supports(\"modulepreload\"))return;for(const s of document.querySelectorAll('link[rel=\"modulepreload\"]'))i(s);new MutationObserver(s=>{for(const o of s)if(o.type===\"childList\")for(const u of o.addedNodes)u.tagName===\"LINK\"&&u.rel===\"modulepreload\"&&i(u)}).observe(document,{childList:!0,subtree:!0});function e(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin===\"use-credentials\"?o.credentials=\"include\":s.crossOrigin===\"anonymous\"?o.credentials=\"omit\":o.credentials=\"same-origin\",o}function i(s){if(s.ep)return;s.ep=!0;const o=e(s);fetch(s.href,o)}})();var Ja=typeof globalThis<\"u\"?globalThis:typeof window<\"u\"?window:typeof global<\"u\"?global:typeof self<\"u\"?self:{};function mp(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,\"default\")?n.default:n}var Vd={exports:{}},ql={};/**\n * @license React\n * react-jsx-runtime.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */var K0;function GM(){if(K0)return ql;K0=1;var n=Symbol.for(\"react.transitional.element\"),t=Symbol.for(\"react.fragment\");function e(i,s,o){var u=null;if(o!==void 0&&(u=\"\"+o),s.key!==void 0&&(u=\"\"+s.key),\"key\"in s){o={};for(var c in s)c!==\"key\"&&(o[c]=s[c])}else o=s;return s=o.ref,{$$typeof:n,type:i,key:u,ref:s!==void 0?s:null,props:o}}return ql.Fragment=t,ql.jsx=e,ql.jsxs=e,ql}var G0;function YM(){return G0||(G0=1,Vd.exports=GM()),Vd.exports}var hn=YM(),$d={exports:{}},Vl={},Pd={exports:{}},Kd={};/**\n * @license React\n * scheduler.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */var Y0;function XM(){return Y0||(Y0=1,(function(n){function t(z,G){var it=z.length;z.push(G);t:for(;0<it;){var Ct=it-1>>>1,A=z[Ct];if(0<s(A,G))z[Ct]=G,z[it]=A,it=Ct;else break t}}function e(z){return z.length===0?null:z[0]}function i(z){if(z.length===0)return null;var G=z[0],it=z.pop();if(it!==G){z[0]=it;t:for(var Ct=0,A=z.length,V=A>>>1;Ct<V;){var F=2*(Ct+1)-1,K=z[F],W=F+1,St=z[W];if(0>s(K,it))W<A&&0>s(St,K)?(z[Ct]=St,z[W]=it,Ct=W):(z[Ct]=K,z[F]=it,Ct=F);else if(W<A&&0>s(St,it))z[Ct]=St,z[W]=it,Ct=W;else break t}}return G}function s(z,G){var it=z.sortIndex-G.sortIndex;return it!==0?it:z.id-G.id}if(n.unstable_now=void 0,typeof performance==\"object\"&&typeof performance.now==\"function\"){var o=performance;n.unstable_now=function(){return o.now()}}else{var u=Date,c=u.now();n.unstable_now=function(){return u.now()-c}}var d=[],p=[],m=1,y=null,b=3,v=!1,E=!1,M=!1,x=!1,O=typeof setTimeout==\"function\"?setTimeout:null,B=typeof clearTimeout==\"function\"?clearTimeout:null,I=typeof setImmediate<\"u\"?setImmediate:null;function q(z){for(var G=e(p);G!==null;){if(G.callback===null)i(p);else if(G.startTime<=z)i(p),G.sortIndex=G.expirationTime,t(d,G);else break;G=e(p)}}function P(z){if(M=!1,q(z),!E)if(e(d)!==null)E=!0,et||(et=!0,Dt());else{var G=e(p);G!==null&>(P,G.startTime-z)}}var et=!1,Y=-1,nt=5,ct=-1;function Et(){return x?!0:!(n.unstable_now()-ct<nt)}function $t(){if(x=!1,et){var z=n.unstable_now();ct=z;var G=!0;try{t:{E=!1,M&&(M=!1,B(Y),Y=-1),v=!0;var it=b;try{e:{for(q(z),y=e(d);y!==null&&!(y.expirationTime>z&&Et());){var Ct=y.callback;if(typeof Ct==\"function\"){y.callback=null,b=y.priorityLevel;var A=Ct(y.expirationTime<=z);if(z=n.unstable_now(),typeof A==\"function\"){y.callback=A,q(z),G=!0;break e}y===e(d)&&i(d),q(z)}else i(d);y=e(d)}if(y!==null)G=!0;else{var V=e(p);V!==null&>(P,V.startTime-z),G=!1}}break t}finally{y=null,b=it,v=!1}G=void 0}}finally{G?Dt():et=!1}}}var Dt;if(typeof I==\"function\")Dt=function(){I($t)};else if(typeof MessageChannel<\"u\"){var vt=new MessageChannel,Mt=vt.port2;vt.port1.onmessage=$t,Dt=function(){Mt.postMessage(null)}}else Dt=function(){O($t,0)};function gt(z,G){Y=O(function(){z(n.unstable_now())},G)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(z){z.callback=null},n.unstable_forceFrameRate=function(z){0>z||125<z?console.error(\"forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported\"):nt=0<z?Math.floor(1e3/z):5},n.unstable_getCurrentPriorityLevel=function(){return b},n.unstable_next=function(z){switch(b){case 1:case 2:case 3:var G=3;break;default:G=b}var it=b;b=G;try{return z()}finally{b=it}},n.unstable_requestPaint=function(){x=!0},n.unstable_runWithPriority=function(z,G){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var it=b;b=z;try{return G()}finally{b=it}},n.unstable_scheduleCallback=function(z,G,it){var Ct=n.unstable_now();switch(typeof it==\"object\"&&it!==null?(it=it.delay,it=typeof it==\"number\"&&0<it?Ct+it:Ct):it=Ct,z){case 1:var A=-1;break;case 2:A=250;break;case 5:A=1073741823;break;case 4:A=1e4;break;default:A=5e3}return A=it+A,z={id:m++,callback:G,priorityLevel:z,startTime:it,expirationTime:A,sortIndex:-1},it>Ct?(z.sortIndex=it,t(p,z),e(d)===null&&z===e(p)&&(M?(B(Y),Y=-1):M=!0,gt(P,it-Ct))):(z.sortIndex=A,t(d,z),E||v||(E=!0,et||(et=!0,Dt()))),z},n.unstable_shouldYield=Et,n.unstable_wrapCallback=function(z){var G=b;return function(){var it=b;b=G;try{return z.apply(this,arguments)}finally{b=it}}}})(Kd)),Kd}var X0;function FM(){return X0||(X0=1,Pd.exports=XM()),Pd.exports}var Gd={exports:{}},ft={};/**\n * @license React\n * react.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */var F0;function QM(){if(F0)return ft;F0=1;var n=Symbol.for(\"react.transitional.element\"),t=Symbol.for(\"react.portal\"),e=Symbol.for(\"react.fragment\"),i=Symbol.for(\"react.strict_mode\"),s=Symbol.for(\"react.profiler\"),o=Symbol.for(\"react.consumer\"),u=Symbol.for(\"react.context\"),c=Symbol.for(\"react.forward_ref\"),d=Symbol.for(\"react.suspense\"),p=Symbol.for(\"react.memo\"),m=Symbol.for(\"react.lazy\"),y=Symbol.iterator;function b(A){return A===null||typeof A!=\"object\"?null:(A=y&&A[y]||A[\"@@iterator\"],typeof A==\"function\"?A:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,M={};function x(A,V,F){this.props=A,this.context=V,this.refs=M,this.updater=F||v}x.prototype.isReactComponent={},x.prototype.setState=function(A,V){if(typeof A!=\"object\"&&typeof A!=\"function\"&&A!=null)throw Error(\"takes an object of state variables to update or a function which returns an object of state variables.\");this.updater.enqueueSetState(this,A,V,\"setState\")},x.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,\"forceUpdate\")};function O(){}O.prototype=x.prototype;function B(A,V,F){this.props=A,this.context=V,this.refs=M,this.updater=F||v}var I=B.prototype=new O;I.constructor=B,E(I,x.prototype),I.isPureReactComponent=!0;var q=Array.isArray,P={H:null,A:null,T:null,S:null,V:null},et=Object.prototype.hasOwnProperty;function Y(A,V,F,K,W,St){return F=St.ref,{$$typeof:n,type:A,key:V,ref:F!==void 0?F:null,props:St}}function nt(A,V){return Y(A.type,V,void 0,void 0,void 0,A.props)}function ct(A){return typeof A==\"object\"&&A!==null&&A.$$typeof===n}function Et(A){var V={\"=\":\"=0\",\":\":\"=2\"};return\"$\"+A.replace(/[=:]/g,function(F){return V[F]})}var $t=/\\/+/g;function Dt(A,V){return typeof A==\"object\"&&A!==null&&A.key!=null?Et(\"\"+A.key):V.toString(36)}function vt(){}function Mt(A){switch(A.status){case\"fulfilled\":return A.value;case\"rejected\":throw A.reason;default:switch(typeof A.status==\"string\"?A.then(vt,vt):(A.status=\"pending\",A.then(function(V){A.status===\"pending\"&&(A.status=\"fulfilled\",A.value=V)},function(V){A.status===\"pending\"&&(A.status=\"rejected\",A.reason=V)})),A.status){case\"fulfilled\":return A.value;case\"rejected\":throw A.reason}}throw A}function gt(A,V,F,K,W){var St=typeof A;(St===\"undefined\"||St===\"boolean\")&&(A=null);var ut=!1;if(A===null)ut=!0;else switch(St){case\"bigint\":case\"string\":case\"number\":ut=!0;break;case\"object\":switch(A.$$typeof){case n:case t:ut=!0;break;case m:return ut=A._init,gt(ut(A._payload),V,F,K,W)}}if(ut)return W=W(A),ut=K===\"\"?\".\"+Dt(A,0):K,q(W)?(F=\"\",ut!=null&&(F=ut.replace($t,\"$&/\")+\"/\"),gt(W,V,F,\"\",function(oi){return oi})):W!=null&&(ct(W)&&(W=nt(W,F+(W.key==null||A&&A.key===W.key?\"\":(\"\"+W.key).replace($t,\"$&/\")+\"/\")+ut)),V.push(W)),1;ut=0;var De=K===\"\"?\".\":K+\":\";if(q(A))for(var Pt=0;Pt<A.length;Pt++)K=A[Pt],St=De+Dt(K,Pt),ut+=gt(K,V,F,St,W);else if(Pt=b(A),typeof Pt==\"function\")for(A=Pt.call(A),Pt=0;!(K=A.next()).done;)K=K.value,St=De+Dt(K,Pt++),ut+=gt(K,V,F,St,W);else if(St===\"object\"){if(typeof A.then==\"function\")return gt(Mt(A),V,F,K,W);throw V=String(A),Error(\"Objects are not valid as a React child (found: \"+(V===\"[object Object]\"?\"object with keys {\"+Object.keys(A).join(\", \")+\"}\":V)+\"). If you meant to render a collection of children, use an array instead.\")}return ut}function z(A,V,F){if(A==null)return A;var K=[],W=0;return gt(A,K,\"\",\"\",function(St){return V.call(F,St,W++)}),K}function G(A){if(A._status===-1){var V=A._result;V=V(),V.then(function(F){(A._status===0||A._status===-1)&&(A._status=1,A._result=F)},function(F){(A._status===0||A._status===-1)&&(A._status=2,A._result=F)}),A._status===-1&&(A._status=0,A._result=V)}if(A._status===1)return A._result.default;throw A._result}var it=typeof reportError==\"function\"?reportError:function(A){if(typeof window==\"object\"&&typeof window.ErrorEvent==\"function\"){var V=new window.ErrorEvent(\"error\",{bubbles:!0,cancelable:!0,message:typeof A==\"object\"&&A!==null&&typeof A.message==\"string\"?String(A.message):String(A),error:A});if(!window.dispatchEvent(V))return}else if(typeof process==\"object\"&&typeof process.emit==\"function\"){process.emit(\"uncaughtException\",A);return}console.error(A)};function Ct(){}return ft.Children={map:z,forEach:function(A,V,F){z(A,function(){V.apply(this,arguments)},F)},count:function(A){var V=0;return z(A,function(){V++}),V},toArray:function(A){return z(A,function(V){return V})||[]},only:function(A){if(!ct(A))throw Error(\"React.Children.only expected to receive a single React element child.\");return A}},ft.Component=x,ft.Fragment=e,ft.Profiler=s,ft.PureComponent=B,ft.StrictMode=i,ft.Suspense=d,ft.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=P,ft.__COMPILER_RUNTIME={__proto__:null,c:function(A){return P.H.useMemoCache(A)}},ft.cache=function(A){return function(){return A.apply(null,arguments)}},ft.cloneElement=function(A,V,F){if(A==null)throw Error(\"The argument must be a React element, but you passed \"+A+\".\");var K=E({},A.props),W=A.key,St=void 0;if(V!=null)for(ut in V.ref!==void 0&&(St=void 0),V.key!==void 0&&(W=\"\"+V.key),V)!et.call(V,ut)||ut===\"key\"||ut===\"__self\"||ut===\"__source\"||ut===\"ref\"&&V.ref===void 0||(K[ut]=V[ut]);var ut=arguments.length-2;if(ut===1)K.children=F;else if(1<ut){for(var De=Array(ut),Pt=0;Pt<ut;Pt++)De[Pt]=arguments[Pt+2];K.children=De}return Y(A.type,W,void 0,void 0,St,K)},ft.createContext=function(A){return A={$$typeof:u,_currentValue:A,_currentValue2:A,_threadCount:0,Provider:null,Consumer:null},A.Provider=A,A.Consumer={$$typeof:o,_context:A},A},ft.createElement=function(A,V,F){var K,W={},St=null;if(V!=null)for(K in V.key!==void 0&&(St=\"\"+V.key),V)et.call(V,K)&&K!==\"key\"&&K!==\"__self\"&&K!==\"__source\"&&(W[K]=V[K]);var ut=arguments.length-2;if(ut===1)W.children=F;else if(1<ut){for(var De=Array(ut),Pt=0;Pt<ut;Pt++)De[Pt]=arguments[Pt+2];W.children=De}if(A&&A.defaultProps)for(K in ut=A.defaultProps,ut)W[K]===void 0&&(W[K]=ut[K]);return Y(A,St,void 0,void 0,null,W)},ft.createRef=function(){return{current:null}},ft.forwardRef=function(A){return{$$typeof:c,render:A}},ft.isValidElement=ct,ft.lazy=function(A){return{$$typeof:m,_payload:{_status:-1,_result:A},_init:G}},ft.memo=function(A,V){return{$$typeof:p,type:A,compare:V===void 0?null:V}},ft.startTransition=function(A){var V=P.T,F={};P.T=F;try{var K=A(),W=P.S;W!==null&&W(F,K),typeof K==\"object\"&&K!==null&&typeof K.then==\"function\"&&K.then(Ct,it)}catch(St){it(St)}finally{P.T=V}},ft.unstable_useCacheRefresh=function(){return P.H.useCacheRefresh()},ft.use=function(A){return P.H.use(A)},ft.useActionState=function(A,V,F){return P.H.useActionState(A,V,F)},ft.useCallback=function(A,V){return P.H.useCallback(A,V)},ft.useContext=function(A){return P.H.useContext(A)},ft.useDebugValue=function(){},ft.useDeferredValue=function(A,V){return P.H.useDeferredValue(A,V)},ft.useEffect=function(A,V,F){var K=P.H;if(typeof F==\"function\")throw Error(\"useEffect CRUD overload is not enabled in this build of React.\");return K.useEffect(A,V)},ft.useId=function(){return P.H.useId()},ft.useImperativeHandle=function(A,V,F){return P.H.useImperativeHandle(A,V,F)},ft.useInsertionEffect=function(A,V){return P.H.useInsertionEffect(A,V)},ft.useLayoutEffect=function(A,V){return P.H.useLayoutEffect(A,V)},ft.useMemo=function(A,V){return P.H.useMemo(A,V)},ft.useOptimistic=function(A,V){return P.H.useOptimistic(A,V)},ft.useReducer=function(A,V,F){return P.H.useReducer(A,V,F)},ft.useRef=function(A){return P.H.useRef(A)},ft.useState=function(A){return P.H.useState(A)},ft.useSyncExternalStore=function(A,V,F){return P.H.useSyncExternalStore(A,V,F)},ft.useTransition=function(){return P.H.useTransition()},ft.version=\"19.1.0\",ft}var Q0;function wo(){return Q0||(Q0=1,Gd.exports=QM()),Gd.exports}var Yd={exports:{}},Me={};/**\n * @license React\n * react-dom.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */var J0;function JM(){if(J0)return Me;J0=1;var n=wo();function t(d){var p=\"https://react.dev/errors/\"+d;if(1<arguments.length){p+=\"?args[]=\"+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)p+=\"&args[]=\"+encodeURIComponent(arguments[m])}return\"Minified React error #\"+d+\"; visit \"+p+\" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.\"}function e(){}var i={d:{f:e,r:function(){throw Error(t(522))},D:e,C:e,L:e,m:e,X:e,S:e,M:e},p:0,findDOMNode:null},s=Symbol.for(\"react.portal\");function o(d,p,m){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:y==null?null:\"\"+y,children:d,containerInfo:p,implementation:m}}var u=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(d,p){if(d===\"font\")return\"\";if(typeof p==\"string\")return p===\"use-credentials\"?p:\"\"}return Me.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,Me.createPortal=function(d,p){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(t(299));return o(d,p,null,m)},Me.flushSync=function(d){var p=u.T,m=i.p;try{if(u.T=null,i.p=2,d)return d()}finally{u.T=p,i.p=m,i.d.f()}},Me.preconnect=function(d,p){typeof d==\"string\"&&(p?(p=p.crossOrigin,p=typeof p==\"string\"?p===\"use-credentials\"?p:\"\":void 0):p=null,i.d.C(d,p))},Me.prefetchDNS=function(d){typeof d==\"string\"&&i.d.D(d)},Me.preinit=function(d,p){if(typeof d==\"string\"&&p&&typeof p.as==\"string\"){var m=p.as,y=c(m,p.crossOrigin),b=typeof p.integrity==\"string\"?p.integrity:void 0,v=typeof p.fetchPriority==\"string\"?p.fetchPriority:void 0;m===\"style\"?i.d.S(d,typeof p.precedence==\"string\"?p.precedence:void 0,{crossOrigin:y,integrity:b,fetchPriority:v}):m===\"script\"&&i.d.X(d,{crossOrigin:y,integrity:b,fetchPriority:v,nonce:typeof p.nonce==\"string\"?p.nonce:void 0})}},Me.preinitModule=function(d,p){if(typeof d==\"string\")if(typeof p==\"object\"&&p!==null){if(p.as==null||p.as===\"script\"){var m=c(p.as,p.crossOrigin);i.d.M(d,{crossOrigin:m,integrity:typeof p.integrity==\"string\"?p.integrity:void 0,nonce:typeof p.nonce==\"string\"?p.nonce:void 0})}}else p==null&&i.d.M(d)},Me.preload=function(d,p){if(typeof d==\"string\"&&typeof p==\"object\"&&p!==null&&typeof p.as==\"string\"){var m=p.as,y=c(m,p.crossOrigin);i.d.L(d,m,{crossOrigin:y,integrity:typeof p.integrity==\"string\"?p.integrity:void 0,nonce:typeof p.nonce==\"string\"?p.nonce:void 0,type:typeof p.type==\"string\"?p.type:void 0,fetchPriority:typeof p.fetchPriority==\"string\"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy==\"string\"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet==\"string\"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes==\"string\"?p.imageSizes:void 0,media:typeof p.media==\"string\"?p.media:void 0})}},Me.preloadModule=function(d,p){if(typeof d==\"string\")if(p){var m=c(p.as,p.crossOrigin);i.d.m(d,{as:typeof p.as==\"string\"&&p.as!==\"script\"?p.as:void 0,crossOrigin:m,integrity:typeof p.integrity==\"string\"?p.integrity:void 0})}else i.d.m(d)},Me.requestFormReset=function(d){i.d.r(d)},Me.unstable_batchedUpdates=function(d,p){return d(p)},Me.useFormState=function(d,p,m){return u.H.useFormState(d,p,m)},Me.useFormStatus=function(){return u.H.useHostTransitionStatus()},Me.version=\"19.1.0\",Me}var Z0;function h1(){if(Z0)return Yd.exports;Z0=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>\"u\"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=\"function\"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(t){console.error(t)}}return n(),Yd.exports=JM(),Yd.exports}/**\n * @license React\n * react-dom-client.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */var W0;function ZM(){if(W0)return Vl;W0=1;var n=FM(),t=wo(),e=h1();function i(r){var l=\"https://react.dev/errors/\"+r;if(1<arguments.length){l+=\"?args[]=\"+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)l+=\"&args[]=\"+encodeURIComponent(arguments[a])}return\"Minified React error #\"+r+\"; visit \"+l+\" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.\"}function s(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function o(r){var l=r,a=r;if(r.alternate)for(;l.return;)l=l.return;else{r=l;do l=r,(l.flags&4098)!==0&&(a=l.return),r=l.return;while(r)}return l.tag===3?a:null}function u(r){if(r.tag===13){var l=r.memoizedState;if(l===null&&(r=r.alternate,r!==null&&(l=r.memoizedState)),l!==null)return l.dehydrated}return null}function c(r){if(o(r)!==r)throw Error(i(188))}function d(r){var l=r.alternate;if(!l){if(l=o(r),l===null)throw Error(i(188));return l!==r?null:r}for(var a=r,f=l;;){var h=a.return;if(h===null)break;var g=h.alternate;if(g===null){if(f=h.return,f!==null){a=f;continue}break}if(h.child===g.child){for(g=h.child;g;){if(g===a)return c(h),r;if(g===f)return c(h),l;g=g.sibling}throw Error(i(188))}if(a.return!==f.return)a=h,f=g;else{for(var S=!1,T=h.child;T;){if(T===a){S=!0,a=h,f=g;break}if(T===f){S=!0,f=h,a=g;break}T=T.sibling}if(!S){for(T=g.child;T;){if(T===a){S=!0,a=g,f=h;break}if(T===f){S=!0,f=g,a=h;break}T=T.sibling}if(!S)throw Error(i(189))}}if(a.alternate!==f)throw Error(i(190))}if(a.tag!==3)throw Error(i(188));return a.stateNode.current===a?r:l}function p(r){var l=r.tag;if(l===5||l===26||l===27||l===6)return r;for(r=r.child;r!==null;){if(l=p(r),l!==null)return l;r=r.sibling}return null}var m=Object.assign,y=Symbol.for(\"react.element\"),b=Symbol.for(\"react.transitional.element\"),v=Symbol.for(\"react.portal\"),E=Symbol.for(\"react.fragment\"),M=Symbol.for(\"react.strict_mode\"),x=Symbol.for(\"react.profiler\"),O=Symbol.for(\"react.provider\"),B=Symbol.for(\"react.consumer\"),I=Symbol.for(\"react.context\"),q=Symbol.for(\"react.forward_ref\"),P=Symbol.for(\"react.suspense\"),et=Symbol.for(\"react.suspense_list\"),Y=Symbol.for(\"react.memo\"),nt=Symbol.for(\"react.lazy\"),ct=Symbol.for(\"react.activity\"),Et=Symbol.for(\"react.memo_cache_sentinel\"),$t=Symbol.iterator;function Dt(r){return r===null||typeof r!=\"object\"?null:(r=$t&&r[$t]||r[\"@@iterator\"],typeof r==\"function\"?r:null)}var vt=Symbol.for(\"react.client.reference\");function Mt(r){if(r==null)return null;if(typeof r==\"function\")return r.$$typeof===vt?null:r.displayName||r.name||null;if(typeof r==\"string\")return r;switch(r){case E:return\"Fragment\";case x:return\"Profiler\";case M:return\"StrictMode\";case P:return\"Suspense\";case et:return\"SuspenseList\";case ct:return\"Activity\"}if(typeof r==\"object\")switch(r.$$typeof){case v:return\"Portal\";case I:return(r.displayName||\"Context\")+\".Provider\";case B:return(r._context.displayName||\"Context\")+\".Consumer\";case q:var l=r.render;return r=r.displayName,r||(r=l.displayName||l.name||\"\",r=r!==\"\"?\"ForwardRef(\"+r+\")\":\"ForwardRef\"),r;case Y:return l=r.displayName||null,l!==null?l:Mt(r.type)||\"Memo\";case nt:l=r._payload,r=r._init;try{return Mt(r(l))}catch{}}return null}var gt=Array.isArray,z=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G=e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,it={pending:!1,data:null,method:null,action:null},Ct=[],A=-1;function V(r){return{current:r}}function F(r){0>A||(r.current=Ct[A],Ct[A]=null,A--)}function K(r,l){A++,Ct[A]=r.current,r.current=l}var W=V(null),St=V(null),ut=V(null),De=V(null);function Pt(r,l){switch(K(ut,l),K(St,r),K(W,null),l.nodeType){case 9:case 11:r=(r=l.documentElement)&&(r=r.namespaceURI)?v0(r):0;break;default:if(r=l.tagName,l=l.namespaceURI)l=v0(l),r=S0(l,r);else switch(r){case\"svg\":r=1;break;case\"math\":r=2;break;default:r=0}}F(W),K(W,r)}function oi(){F(W),F(St),F(ut)}function Ac(r){r.memoizedState!==null&&K(De,r);var l=W.current,a=S0(l,r.type);l!==a&&(K(St,r),K(W,a))}function Ho(r){St.current===r&&(F(W),F(St)),De.current===r&&(F(De),Hl._currentValue=it)}var Cc=Object.prototype.hasOwnProperty,Oc=n.unstable_scheduleCallback,wc=n.unstable_cancelCallback,MT=n.unstable_shouldYield,kT=n.unstable_requestPaint,En=n.unstable_now,AT=n.unstable_getCurrentPriorityLevel,Wp=n.unstable_ImmediatePriority,tm=n.unstable_UserBlockingPriority,_o=n.unstable_NormalPriority,CT=n.unstable_LowPriority,em=n.unstable_IdlePriority,OT=n.log,wT=n.unstable_setDisableYieldValue,Ps=null,Ve=null;function ai(r){if(typeof OT==\"function\"&&wT(r),Ve&&typeof Ve.setStrictMode==\"function\")try{Ve.setStrictMode(Ps,r)}catch{}}var $e=Math.clz32?Math.clz32:RT,NT=Math.log,DT=Math.LN2;function RT(r){return r>>>=0,r===0?32:31-(NT(r)/DT|0)|0}var Uo=256,Io=4194304;function Qi(r){var l=r&42;if(l!==0)return l;switch(r&-r){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return r&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return r}}function jo(r,l,a){var f=r.pendingLanes;if(f===0)return 0;var h=0,g=r.suspendedLanes,S=r.pingedLanes;r=r.warmLanes;var T=f&134217727;return T!==0?(f=T&~g,f!==0?h=Qi(f):(S&=T,S!==0?h=Qi(S):a||(a=T&~r,a!==0&&(h=Qi(a))))):(T=f&~g,T!==0?h=Qi(T):S!==0?h=Qi(S):a||(a=f&~r,a!==0&&(h=Qi(a)))),h===0?0:l!==0&&l!==h&&(l&g)===0&&(g=h&-h,a=l&-l,g>=a||g===32&&(a&4194048)!==0)?l:h}function Ks(r,l){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&l)===0}function LT(r,l){switch(r){case 1:case 2:case 4:case 8:case 64:return l+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return l+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function nm(){var r=Uo;return Uo<<=1,(Uo&4194048)===0&&(Uo=256),r}function im(){var r=Io;return Io<<=1,(Io&62914560)===0&&(Io=4194304),r}function Nc(r){for(var l=[],a=0;31>a;a++)l.push(r);return l}function Gs(r,l){r.pendingLanes|=l,l!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function zT(r,l,a,f,h,g){var S=r.pendingLanes;r.pendingLanes=a,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=a,r.entangledLanes&=a,r.errorRecoveryDisabledLanes&=a,r.shellSuspendCounter=0;var T=r.entanglements,k=r.expirationTimes,D=r.hiddenUpdates;for(a=S&~a;0<a;){var H=31-$e(a),U=1<<H;T[H]=0,k[H]=-1;var R=D[H];if(R!==null)for(D[H]=null,H=0;H<R.length;H++){var L=R[H];L!==null&&(L.lane&=-536870913)}a&=~U}f!==0&&rm(r,f,0),g!==0&&h===0&&r.tag!==0&&(r.suspendedLanes|=g&~(S&~l))}function rm(r,l,a){r.pendingLanes|=l,r.suspendedLanes&=~l;var f=31-$e(l);r.entangledLanes|=l,r.entanglements[f]=r.entanglements[f]|1073741824|a&4194090}function sm(r,l){var a=r.entangledLanes|=l;for(r=r.entanglements;a;){var f=31-$e(a),h=1<<f;h&l|r[f]&l&&(r[f]|=l),a&=~h}}function Dc(r){switch(r){case 2:r=1;break;case 8:r=4;break;case 32:r=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:r=128;break;case 268435456:r=134217728;break;default:r=0}return r}function Rc(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function lm(){var r=G.p;return r!==0?r:(r=window.event,r===void 0?32:I0(r.type))}function BT(r,l){var a=G.p;try{return G.p=r,l()}finally{G.p=a}}var ui=Math.random().toString(36).slice(2),Te=\"__reactFiber$\"+ui,Be=\"__reactProps$\"+ui,zr=\"__reactContainer$\"+ui,Lc=\"__reactEvents$\"+ui,HT=\"__reactListeners$\"+ui,_T=\"__reactHandles$\"+ui,om=\"__reactResources$\"+ui,Ys=\"__reactMarker$\"+ui;function zc(r){delete r[Te],delete r[Be],delete r[Lc],delete r[HT],delete r[_T]}function Br(r){var l=r[Te];if(l)return l;for(var a=r.parentNode;a;){if(l=a[zr]||a[Te]){if(a=l.alternate,l.child!==null||a!==null&&a.child!==null)for(r=M0(r);r!==null;){if(a=r[Te])return a;r=M0(r)}return l}r=a,a=r.parentNode}return null}function Hr(r){if(r=r[Te]||r[zr]){var l=r.tag;if(l===5||l===6||l===13||l===26||l===27||l===3)return r}return null}function Xs(r){var l=r.tag;if(l===5||l===26||l===27||l===6)return r.stateNode;throw Error(i(33))}function _r(r){var l=r[om];return l||(l=r[om]={hoistableStyles:new Map,hoistableScripts:new Map}),l}function ue(r){r[Ys]=!0}var am=new Set,um={};function Ji(r,l){Ur(r,l),Ur(r+\"Capture\",l)}function Ur(r,l){for(um[r]=l,r=0;r<l.length;r++)am.add(l[r])}var UT=RegExp(\"^[:A-Z_a-z\\\\u00C0-\\\\u00D6\\\\u00D8-\\\\u00F6\\\\u00F8-\\\\u02FF\\\\u0370-\\\\u037D\\\\u037F-\\\\u1FFF\\\\u200C-\\\\u200D\\\\u2070-\\\\u218F\\\\u2C00-\\\\u2FEF\\\\u3001-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFFD][:A-Z_a-z\\\\u00C0-\\\\u00D6\\\\u00D8-\\\\u00F6\\\\u00F8-\\\\u02FF\\\\u0370-\\\\u037D\\\\u037F-\\\\u1FFF\\\\u200C-\\\\u200D\\\\u2070-\\\\u218F\\\\u2C00-\\\\u2FEF\\\\u3001-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFFD\\\\-.0-9\\\\u00B7\\\\u0300-\\\\u036F\\\\u203F-\\\\u2040]*$\"),cm={},fm={};function IT(r){return Cc.call(fm,r)?!0:Cc.call(cm,r)?!1:UT.test(r)?fm[r]=!0:(cm[r]=!0,!1)}function qo(r,l,a){if(IT(l))if(a===null)r.removeAttribute(l);else{switch(typeof a){case\"undefined\":case\"function\":case\"symbol\":r.removeAttribute(l);return;case\"boolean\":var f=l.toLowerCase().slice(0,5);if(f!==\"data-\"&&f!==\"aria-\"){r.removeAttribute(l);return}}r.setAttribute(l,\"\"+a)}}function Vo(r,l,a){if(a===null)r.removeAttribute(l);else{switch(typeof a){case\"undefined\":case\"function\":case\"symbol\":case\"boolean\":r.removeAttribute(l);return}r.setAttribute(l,\"\"+a)}}function Dn(r,l,a,f){if(f===null)r.removeAttribute(a);else{switch(typeof f){case\"undefined\":case\"function\":case\"symbol\":case\"boolean\":r.removeAttribute(a);return}r.setAttributeNS(l,a,\"\"+f)}}var Bc,dm;function Ir(r){if(Bc===void 0)try{throw Error()}catch(a){var l=a.stack.trim().match(/\\n( *(at )?)/);Bc=l&&l[1]||\"\",dm=-1<a.stack.indexOf(`\n at`)?\" (<anonymous>)\":-1<a.stack.indexOf(\"@\")?\"@unknown:0:0\":\"\"}return`\n`+Bc+r+dm}var Hc=!1;function _c(r,l){if(!r||Hc)return\"\";Hc=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var f={DetermineComponentFrameRoot:function(){try{if(l){var U=function(){throw Error()};if(Object.defineProperty(U.prototype,\"props\",{set:function(){throw Error()}}),typeof Reflect==\"object\"&&Reflect.construct){try{Reflect.construct(U,[])}catch(L){var R=L}Reflect.construct(r,[],U)}else{try{U.call()}catch(L){R=L}r.call(U.prototype)}}else{try{throw Error()}catch(L){R=L}(U=r())&&typeof U.catch==\"function\"&&U.catch(function(){})}}catch(L){if(L&&R&&typeof L.stack==\"string\")return[L.stack,R.stack]}return[null,null]}};f.DetermineComponentFrameRoot.displayName=\"DetermineComponentFrameRoot\";var h=Object.getOwnPropertyDescriptor(f.DetermineComponentFrameRoot,\"name\");h&&h.configurable&&Object.defineProperty(f.DetermineComponentFrameRoot,\"name\",{value:\"DetermineComponentFrameRoot\"});var g=f.DetermineComponentFrameRoot(),S=g[0],T=g[1];if(S&&T){var k=S.split(`\n`),D=T.split(`\n`);for(h=f=0;f<k.length&&!k[f].includes(\"DetermineComponentFrameRoot\");)f++;for(;h<D.length&&!D[h].includes(\"DetermineComponentFrameRoot\");)h++;if(f===k.length||h===D.length)for(f=k.length-1,h=D.length-1;1<=f&&0<=h&&k[f]!==D[h];)h--;for(;1<=f&&0<=h;f--,h--)if(k[f]!==D[h]){if(f!==1||h!==1)do if(f--,h--,0>h||k[f]!==D[h]){var H=`\n`+k[f].replace(\" at new \",\" at \");return r.displayName&&H.includes(\"<anonymous>\")&&(H=H.replace(\"<anonymous>\",r.displayName)),H}while(1<=f&&0<=h);break}}}finally{Hc=!1,Error.prepareStackTrace=a}return(a=r?r.displayName||r.name:\"\")?Ir(a):\"\"}function jT(r){switch(r.tag){case 26:case 27:case 5:return Ir(r.type);case 16:return Ir(\"Lazy\");case 13:return Ir(\"Suspense\");case 19:return Ir(\"SuspenseList\");case 0:case 15:return _c(r.type,!1);case 11:return _c(r.type.render,!1);case 1:return _c(r.type,!0);case 31:return Ir(\"Activity\");default:return\"\"}}function hm(r){try{var l=\"\";do l+=jT(r),r=r.return;while(r);return l}catch(a){return`\nError generating stack: `+a.message+`\n`+a.stack}}function tn(r){switch(typeof r){case\"bigint\":case\"boolean\":case\"number\":case\"string\":case\"undefined\":return r;case\"object\":return r;default:return\"\"}}function pm(r){var l=r.type;return(r=r.nodeName)&&r.toLowerCase()===\"input\"&&(l===\"checkbox\"||l===\"radio\")}function qT(r){var l=pm(r)?\"checked\":\"value\",a=Object.getOwnPropertyDescriptor(r.constructor.prototype,l),f=\"\"+r[l];if(!r.hasOwnProperty(l)&&typeof a<\"u\"&&typeof a.get==\"function\"&&typeof a.set==\"function\"){var h=a.get,g=a.set;return Object.defineProperty(r,l,{configurable:!0,get:function(){return h.call(this)},set:function(S){f=\"\"+S,g.call(this,S)}}),Object.defineProperty(r,l,{enumerable:a.enumerable}),{getValue:function(){return f},setValue:function(S){f=\"\"+S},stopTracking:function(){r._valueTracker=null,delete r[l]}}}}function $o(r){r._valueTracker||(r._valueTracker=qT(r))}function mm(r){if(!r)return!1;var l=r._valueTracker;if(!l)return!0;var a=l.getValue(),f=\"\";return r&&(f=pm(r)?r.checked?\"true\":\"false\":r.value),r=f,r!==a?(l.setValue(r),!0):!1}function Po(r){if(r=r||(typeof document<\"u\"?document:void 0),typeof r>\"u\")return null;try{return r.activeElement||r.body}catch{return r.body}}var VT=/[\\n\"\\\\]/g;function en(r){return r.replace(VT,function(l){return\"\\\\\"+l.charCodeAt(0).toString(16)+\" \"})}function Uc(r,l,a,f,h,g,S,T){r.name=\"\",S!=null&&typeof S!=\"function\"&&typeof S!=\"symbol\"&&typeof S!=\"boolean\"?r.type=S:r.removeAttribute(\"type\"),l!=null?S===\"number\"?(l===0&&r.value===\"\"||r.value!=l)&&(r.value=\"\"+tn(l)):r.value!==\"\"+tn(l)&&(r.value=\"\"+tn(l)):S!==\"submit\"&&S!==\"reset\"||r.removeAttribute(\"value\"),l!=null?Ic(r,S,tn(l)):a!=null?Ic(r,S,tn(a)):f!=null&&r.removeAttribute(\"value\"),h==null&&g!=null&&(r.defaultChecked=!!g),h!=null&&(r.checked=h&&typeof h!=\"function\"&&typeof h!=\"symbol\"),T!=null&&typeof T!=\"function\"&&typeof T!=\"symbol\"&&typeof T!=\"boolean\"?r.name=\"\"+tn(T):r.removeAttribute(\"name\")}function gm(r,l,a,f,h,g,S,T){if(g!=null&&typeof g!=\"function\"&&typeof g!=\"symbol\"&&typeof g!=\"boolean\"&&(r.type=g),l!=null||a!=null){if(!(g!==\"submit\"&&g!==\"reset\"||l!=null))return;a=a!=null?\"\"+tn(a):\"\",l=l!=null?\"\"+tn(l):a,T||l===r.value||(r.value=l),r.defaultValue=l}f=f??h,f=typeof f!=\"function\"&&typeof f!=\"symbol\"&&!!f,r.checked=T?r.checked:!!f,r.defaultChecked=!!f,S!=null&&typeof S!=\"function\"&&typeof S!=\"symbol\"&&typeof S!=\"boolean\"&&(r.name=S)}function Ic(r,l,a){l===\"number\"&&Po(r.ownerDocument)===r||r.defaultValue===\"\"+a||(r.defaultValue=\"\"+a)}function jr(r,l,a,f){if(r=r.options,l){l={};for(var h=0;h<a.length;h++)l[\"$\"+a[h]]=!0;for(a=0;a<r.length;a++)h=l.hasOwnProperty(\"$\"+r[a].value),r[a].selected!==h&&(r[a].selected=h),h&&f&&(r[a].defaultSelected=!0)}else{for(a=\"\"+tn(a),l=null,h=0;h<r.length;h++){if(r[h].value===a){r[h].selected=!0,f&&(r[h].defaultSelected=!0);return}l!==null||r[h].disabled||(l=r[h])}l!==null&&(l.selected=!0)}}function ym(r,l,a){if(l!=null&&(l=\"\"+tn(l),l!==r.value&&(r.value=l),a==null)){r.defaultValue!==l&&(r.defaultValue=l);return}r.defaultValue=a!=null?\"\"+tn(a):\"\"}function bm(r,l,a,f){if(l==null){if(f!=null){if(a!=null)throw Error(i(92));if(gt(f)){if(1<f.length)throw Error(i(93));f=f[0]}a=f}a==null&&(a=\"\"),l=a}a=tn(l),r.defaultValue=a,f=r.textContent,f===a&&f!==\"\"&&f!==null&&(r.value=f)}function qr(r,l){if(l){var a=r.firstChild;if(a&&a===r.lastChild&&a.nodeType===3){a.nodeValue=l;return}}r.textContent=l}var $T=new Set(\"animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp\".split(\" \"));function vm(r,l,a){var f=l.indexOf(\"--\")===0;a==null||typeof a==\"boolean\"||a===\"\"?f?r.setProperty(l,\"\"):l===\"float\"?r.cssFloat=\"\":r[l]=\"\":f?r.setProperty(l,a):typeof a!=\"number\"||a===0||$T.has(l)?l===\"float\"?r.cssFloat=a:r[l]=(\"\"+a).trim():r[l]=a+\"px\"}function Sm(r,l,a){if(l!=null&&typeof l!=\"object\")throw Error(i(62));if(r=r.style,a!=null){for(var f in a)!a.hasOwnProperty(f)||l!=null&&l.hasOwnProperty(f)||(f.indexOf(\"--\")===0?r.setProperty(f,\"\"):f===\"float\"?r.cssFloat=\"\":r[f]=\"\");for(var h in l)f=l[h],l.hasOwnProperty(h)&&a[h]!==f&&vm(r,h,f)}else for(var g in l)l.hasOwnProperty(g)&&vm(r,g,l[g])}function jc(r){if(r.indexOf(\"-\")===-1)return!1;switch(r){case\"annotation-xml\":case\"color-profile\":case\"font-face\":case\"font-face-src\":case\"font-face-uri\":case\"font-face-format\":case\"font-face-name\":case\"missing-glyph\":return!1;default:return!0}}var PT=new Map([[\"acceptCharset\",\"accept-charset\"],[\"htmlFor\",\"for\"],[\"httpEquiv\",\"http-equiv\"],[\"crossOrigin\",\"crossorigin\"],[\"accentHeight\",\"accent-height\"],[\"alignmentBaseline\",\"alignment-baseline\"],[\"arabicForm\",\"arabic-form\"],[\"baselineShift\",\"baseline-shift\"],[\"capHeight\",\"cap-height\"],[\"clipPath\",\"clip-path\"],[\"clipRule\",\"clip-rule\"],[\"colorInterpolation\",\"color-interpolation\"],[\"colorInterpolationFilters\",\"color-interpolation-filters\"],[\"colorProfile\",\"color-profile\"],[\"colorRendering\",\"color-rendering\"],[\"dominantBaseline\",\"dominant-baseline\"],[\"enableBackground\",\"enable-background\"],[\"fillOpacity\",\"fill-opacity\"],[\"fillRule\",\"fill-rule\"],[\"floodColor\",\"flood-color\"],[\"floodOpacity\",\"flood-opacity\"],[\"fontFamily\",\"font-family\"],[\"fontSize\",\"font-size\"],[\"fontSizeAdjust\",\"font-size-adjust\"],[\"fontStretch\",\"font-stretch\"],[\"fontStyle\",\"font-style\"],[\"fontVariant\",\"font-variant\"],[\"fontWeight\",\"font-weight\"],[\"glyphName\",\"glyph-name\"],[\"glyphOrientationHorizontal\",\"glyph-orientation-horizontal\"],[\"glyphOrientationVertical\",\"glyph-orientation-vertical\"],[\"horizAdvX\",\"horiz-adv-x\"],[\"horizOriginX\",\"horiz-origin-x\"],[\"imageRendering\",\"image-rendering\"],[\"letterSpacing\",\"letter-spacing\"],[\"lightingColor\",\"lighting-color\"],[\"markerEnd\",\"marker-end\"],[\"markerMid\",\"marker-mid\"],[\"markerStart\",\"marker-start\"],[\"overlinePosition\",\"overline-position\"],[\"overlineThickness\",\"overline-thickness\"],[\"paintOrder\",\"paint-order\"],[\"panose-1\",\"panose-1\"],[\"pointerEvents\",\"pointer-events\"],[\"renderingIntent\",\"rendering-intent\"],[\"shapeRendering\",\"shape-rendering\"],[\"stopColor\",\"stop-color\"],[\"stopOpacity\",\"stop-opacity\"],[\"strikethroughPosition\",\"strikethrough-position\"],[\"strikethroughThickness\",\"strikethrough-thickness\"],[\"strokeDasharray\",\"stroke-dasharray\"],[\"strokeDashoffset\",\"stroke-dashoffset\"],[\"strokeLinecap\",\"stroke-linecap\"],[\"strokeLinejoin\",\"stroke-linejoin\"],[\"strokeMiterlimit\",\"stroke-miterlimit\"],[\"strokeOpacity\",\"stroke-opacity\"],[\"strokeWidth\",\"stroke-width\"],[\"textAnchor\",\"text-anchor\"],[\"textDecoration\",\"text-decoration\"],[\"textRendering\",\"text-rendering\"],[\"transformOrigin\",\"transform-origin\"],[\"underlinePosition\",\"underline-position\"],[\"underlineThickness\",\"underline-thickness\"],[\"unicodeBidi\",\"unicode-bidi\"],[\"unicodeRange\",\"unicode-range\"],[\"unitsPerEm\",\"units-per-em\"],[\"vAlphabetic\",\"v-alphabetic\"],[\"vHanging\",\"v-hanging\"],[\"vIdeographic\",\"v-ideographic\"],[\"vMathematical\",\"v-mathematical\"],[\"vectorEffect\",\"vector-effect\"],[\"vertAdvY\",\"vert-adv-y\"],[\"vertOriginX\",\"vert-origin-x\"],[\"vertOriginY\",\"vert-origin-y\"],[\"wordSpacing\",\"word-spacing\"],[\"writingMode\",\"writing-mode\"],[\"xmlnsXlink\",\"xmlns:xlink\"],[\"xHeight\",\"x-height\"]]),KT=/^[\\u0000-\\u001F ]*j[\\r\\n\\t]*a[\\r\\n\\t]*v[\\r\\n\\t]*a[\\r\\n\\t]*s[\\r\\n\\t]*c[\\r\\n\\t]*r[\\r\\n\\t]*i[\\r\\n\\t]*p[\\r\\n\\t]*t[\\r\\n\\t]*:/i;function Ko(r){return KT.test(\"\"+r)?\"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')\":r}var qc=null;function Vc(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var Vr=null,$r=null;function Em(r){var l=Hr(r);if(l&&(r=l.stateNode)){var a=r[Be]||null;t:switch(r=l.stateNode,l.type){case\"input\":if(Uc(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),l=a.name,a.type===\"radio\"&&l!=null){for(a=r;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name=\"'+en(\"\"+l)+'\"][type=\"radio\"]'),l=0;l<a.length;l++){var f=a[l];if(f!==r&&f.form===r.form){var h=f[Be]||null;if(!h)throw Error(i(90));Uc(f,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name)}}for(l=0;l<a.length;l++)f=a[l],f.form===r.form&&mm(f)}break t;case\"textarea\":ym(r,a.value,a.defaultValue);break t;case\"select\":l=a.value,l!=null&&jr(r,!!a.multiple,l,!1)}}}var $c=!1;function Tm(r,l,a){if($c)return r(l,a);$c=!0;try{var f=r(l);return f}finally{if($c=!1,(Vr!==null||$r!==null)&&(Na(),Vr&&(l=Vr,r=$r,$r=Vr=null,Em(l),r)))for(l=0;l<r.length;l++)Em(r[l])}}function Fs(r,l){var a=r.stateNode;if(a===null)return null;var f=a[Be]||null;if(f===null)return null;a=f[l];t:switch(l){case\"onClick\":case\"onClickCapture\":case\"onDoubleClick\":case\"onDoubleClickCapture\":case\"onMouseDown\":case\"onMouseDownCapture\":case\"onMouseMove\":case\"onMouseMoveCapture\":case\"onMouseUp\":case\"onMouseUpCapture\":case\"onMouseEnter\":(f=!f.disabled)||(r=r.type,f=!(r===\"button\"||r===\"input\"||r===\"select\"||r===\"textarea\")),r=!f;break t;default:r=!1}if(r)return null;if(a&&typeof a!=\"function\")throw Error(i(231,l,typeof a));return a}var Rn=!(typeof window>\"u\"||typeof window.document>\"u\"||typeof window.document.createElement>\"u\"),Pc=!1;if(Rn)try{var Qs={};Object.defineProperty(Qs,\"passive\",{get:function(){Pc=!0}}),window.addEventListener(\"test\",Qs,Qs),window.removeEventListener(\"test\",Qs,Qs)}catch{Pc=!1}var ci=null,Kc=null,Go=null;function xm(){if(Go)return Go;var r,l=Kc,a=l.length,f,h=\"value\"in ci?ci.value:ci.textContent,g=h.length;for(r=0;r<a&&l[r]===h[r];r++);var S=a-r;for(f=1;f<=S&&l[a-f]===h[g-f];f++);return Go=h.slice(r,1<f?1-f:void 0)}function Yo(r){var l=r.keyCode;return\"charCode\"in r?(r=r.charCode,r===0&&l===13&&(r=13)):r=l,r===10&&(r=13),32<=r||r===13?r:0}function Xo(){return!0}function Mm(){return!1}function He(r){function l(a,f,h,g,S){this._reactName=a,this._targetInst=h,this.type=f,this.nativeEvent=g,this.target=S,this.currentTarget=null;for(var T in r)r.hasOwnProperty(T)&&(a=r[T],this[T]=a?a(g):g[T]);return this.isDefaultPrevented=(g.defaultPrevented!=null?g.defaultPrevented:g.returnValue===!1)?Xo:Mm,this.isPropagationStopped=Mm,this}return m(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!=\"unknown\"&&(a.returnValue=!1),this.isDefaultPrevented=Xo)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!=\"unknown\"&&(a.cancelBubble=!0),this.isPropagationStopped=Xo)},persist:function(){},isPersistent:Xo}),l}var Zi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Fo=He(Zi),Js=m({},Zi,{view:0,detail:0}),GT=He(Js),Gc,Yc,Zs,Qo=m({},Js,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Fc,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return\"movementX\"in r?r.movementX:(r!==Zs&&(Zs&&r.type===\"mousemove\"?(Gc=r.screenX-Zs.screenX,Yc=r.screenY-Zs.screenY):Yc=Gc=0,Zs=r),Gc)},movementY:function(r){return\"movementY\"in r?r.movementY:Yc}}),km=He(Qo),YT=m({},Qo,{dataTransfer:0}),XT=He(YT),FT=m({},Js,{relatedTarget:0}),Xc=He(FT),QT=m({},Zi,{animationName:0,elapsedTime:0,pseudoElement:0}),JT=He(QT),ZT=m({},Zi,{clipboardData:function(r){return\"clipboardData\"in r?r.clipboardData:window.clipboardData}}),WT=He(ZT),tx=m({},Zi,{data:0}),Am=He(tx),ex={Esc:\"Escape\",Spacebar:\" \",Left:\"ArrowLeft\",Up:\"ArrowUp\",Right:\"ArrowRight\",Down:\"ArrowDown\",Del:\"Delete\",Win:\"OS\",Menu:\"ContextMenu\",Apps:\"ContextMenu\",Scroll:\"ScrollLock\",MozPrintableKey:\"Unidentified\"},nx={8:\"Backspace\",9:\"Tab\",12:\"Clear\",13:\"Enter\",16:\"Shift\",17:\"Control\",18:\"Alt\",19:\"Pause\",20:\"CapsLock\",27:\"Escape\",32:\" \",33:\"PageUp\",34:\"PageDown\",35:\"End\",36:\"Home\",37:\"ArrowLeft\",38:\"ArrowUp\",39:\"ArrowRight\",40:\"ArrowDown\",45:\"Insert\",46:\"Delete\",112:\"F1\",113:\"F2\",114:\"F3\",115:\"F4\",116:\"F5\",117:\"F6\",118:\"F7\",119:\"F8\",120:\"F9\",121:\"F10\",122:\"F11\",123:\"F12\",144:\"NumLock\",145:\"ScrollLock\",224:\"Meta\"},ix={Alt:\"altKey\",Control:\"ctrlKey\",Meta:\"metaKey\",Shift:\"shiftKey\"};function rx(r){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(r):(r=ix[r])?!!l[r]:!1}function Fc(){return rx}var sx=m({},Js,{key:function(r){if(r.key){var l=ex[r.key]||r.key;if(l!==\"Unidentified\")return l}return r.type===\"keypress\"?(r=Yo(r),r===13?\"Enter\":String.fromCharCode(r)):r.type===\"keydown\"||r.type===\"keyup\"?nx[r.keyCode]||\"Unidentified\":\"\"},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Fc,charCode:function(r){return r.type===\"keypress\"?Yo(r):0},keyCode:function(r){return r.type===\"keydown\"||r.type===\"keyup\"?r.keyCode:0},which:function(r){return r.type===\"keypress\"?Yo(r):r.type===\"keydown\"||r.type===\"keyup\"?r.keyCode:0}}),lx=He(sx),ox=m({},Qo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Cm=He(ox),ax=m({},Js,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Fc}),ux=He(ax),cx=m({},Zi,{propertyName:0,elapsedTime:0,pseudoElement:0}),fx=He(cx),dx=m({},Qo,{deltaX:function(r){return\"deltaX\"in r?r.deltaX:\"wheelDeltaX\"in r?-r.wheelDeltaX:0},deltaY:function(r){return\"deltaY\"in r?r.deltaY:\"wheelDeltaY\"in r?-r.wheelDeltaY:\"wheelDelta\"in r?-r.wheelDelta:0},deltaZ:0,deltaMode:0}),hx=He(dx),px=m({},Zi,{newState:0,oldState:0}),mx=He(px),gx=[9,13,27,32],Qc=Rn&&\"CompositionEvent\"in window,Ws=null;Rn&&\"documentMode\"in document&&(Ws=document.documentMode);var yx=Rn&&\"TextEvent\"in window&&!Ws,Om=Rn&&(!Qc||Ws&&8<Ws&&11>=Ws),wm=\" \",Nm=!1;function Dm(r,l){switch(r){case\"keyup\":return gx.indexOf(l.keyCode)!==-1;case\"keydown\":return l.keyCode!==229;case\"keypress\":case\"mousedown\":case\"focusout\":return!0;default:return!1}}function Rm(r){return r=r.detail,typeof r==\"object\"&&\"data\"in r?r.data:null}var Pr=!1;function bx(r,l){switch(r){case\"compositionend\":return Rm(l);case\"keypress\":return l.which!==32?null:(Nm=!0,wm);case\"textInput\":return r=l.data,r===wm&&Nm?null:r;default:return null}}function vx(r,l){if(Pr)return r===\"compositionend\"||!Qc&&Dm(r,l)?(r=xm(),Go=Kc=ci=null,Pr=!1,r):null;switch(r){case\"paste\":return null;case\"keypress\":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1<l.char.length)return l.char;if(l.which)return String.fromCharCode(l.which)}return null;case\"compositionend\":return Om&&l.locale!==\"ko\"?null:l.data;default:return null}}var Sx={color:!0,date:!0,datetime:!0,\"datetime-local\":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Lm(r){var l=r&&r.nodeName&&r.nodeName.toLowerCase();return l===\"input\"?!!Sx[r.type]:l===\"textarea\"}function zm(r,l,a,f){Vr?$r?$r.push(f):$r=[f]:Vr=f,l=Ha(l,\"onChange\"),0<l.length&&(a=new Fo(\"onChange\",\"change\",null,a,f),r.push({event:a,listeners:l}))}var tl=null,el=null;function Ex(r){p0(r,0)}function Jo(r){var l=Xs(r);if(mm(l))return r}function Bm(r,l){if(r===\"change\")return l}var Hm=!1;if(Rn){var Jc;if(Rn){var Zc=\"oninput\"in document;if(!Zc){var _m=document.createElement(\"div\");_m.setAttribute(\"oninput\",\"return;\"),Zc=typeof _m.oninput==\"function\"}Jc=Zc}else Jc=!1;Hm=Jc&&(!document.documentMode||9<document.documentMode)}function Um(){tl&&(tl.detachEvent(\"onpropertychange\",Im),el=tl=null)}function Im(r){if(r.propertyName===\"value\"&&Jo(el)){var l=[];zm(l,el,r,Vc(r)),Tm(Ex,l)}}function Tx(r,l,a){r===\"focusin\"?(Um(),tl=l,el=a,tl.attachEvent(\"onpropertychange\",Im)):r===\"focusout\"&&Um()}function xx(r){if(r===\"selectionchange\"||r===\"keyup\"||r===\"keydown\")return Jo(el)}function Mx(r,l){if(r===\"click\")return Jo(l)}function kx(r,l){if(r===\"input\"||r===\"change\")return Jo(l)}function Ax(r,l){return r===l&&(r!==0||1/r===1/l)||r!==r&&l!==l}var Pe=typeof Object.is==\"function\"?Object.is:Ax;function nl(r,l){if(Pe(r,l))return!0;if(typeof r!=\"object\"||r===null||typeof l!=\"object\"||l===null)return!1;var a=Object.keys(r),f=Object.keys(l);if(a.length!==f.length)return!1;for(f=0;f<a.length;f++){var h=a[f];if(!Cc.call(l,h)||!Pe(r[h],l[h]))return!1}return!0}function jm(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function qm(r,l){var a=jm(r);r=0;for(var f;a;){if(a.nodeType===3){if(f=r+a.textContent.length,r<=l&&f>=l)return{node:a,offset:l-r};r=f}t:{for(;a;){if(a.nextSibling){a=a.nextSibling;break t}a=a.parentNode}a=void 0}a=jm(a)}}function Vm(r,l){return r&&l?r===l?!0:r&&r.nodeType===3?!1:l&&l.nodeType===3?Vm(r,l.parentNode):\"contains\"in r?r.contains(l):r.compareDocumentPosition?!!(r.compareDocumentPosition(l)&16):!1:!1}function $m(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var l=Po(r.document);l instanceof r.HTMLIFrameElement;){try{var a=typeof l.contentWindow.location.href==\"string\"}catch{a=!1}if(a)r=l.contentWindow;else break;l=Po(r.document)}return l}function Wc(r){var l=r&&r.nodeName&&r.nodeName.toLowerCase();return l&&(l===\"input\"&&(r.type===\"text\"||r.type===\"search\"||r.type===\"tel\"||r.type===\"url\"||r.type===\"password\")||l===\"textarea\"||r.contentEditable===\"true\")}var Cx=Rn&&\"documentMode\"in document&&11>=document.documentMode,Kr=null,tf=null,il=null,ef=!1;function Pm(r,l,a){var f=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;ef||Kr==null||Kr!==Po(f)||(f=Kr,\"selectionStart\"in f&&Wc(f)?f={start:f.selectionStart,end:f.selectionEnd}:(f=(f.ownerDocument&&f.ownerDocument.defaultView||window).getSelection(),f={anchorNode:f.anchorNode,anchorOffset:f.anchorOffset,focusNode:f.focusNode,focusOffset:f.focusOffset}),il&&nl(il,f)||(il=f,f=Ha(tf,\"onSelect\"),0<f.length&&(l=new Fo(\"onSelect\",\"select\",null,l,a),r.push({event:l,listeners:f}),l.target=Kr)))}function Wi(r,l){var a={};return a[r.toLowerCase()]=l.toLowerCase(),a[\"Webkit\"+r]=\"webkit\"+l,a[\"Moz\"+r]=\"moz\"+l,a}var Gr={animationend:Wi(\"Animation\",\"AnimationEnd\"),animationiteration:Wi(\"Animation\",\"AnimationIteration\"),animationstart:Wi(\"Animation\",\"AnimationStart\"),transitionrun:Wi(\"Transition\",\"TransitionRun\"),transitionstart:Wi(\"Transition\",\"TransitionStart\"),transitioncancel:Wi(\"Transition\",\"TransitionCancel\"),transitionend:Wi(\"Transition\",\"TransitionEnd\")},nf={},Km={};Rn&&(Km=document.createElement(\"div\").style,\"AnimationEvent\"in window||(delete Gr.animationend.animation,delete Gr.animationiteration.animation,delete Gr.animationstart.animation),\"TransitionEvent\"in window||delete Gr.transitionend.transition);function tr(r){if(nf[r])return nf[r];if(!Gr[r])return r;var l=Gr[r],a;for(a in l)if(l.hasOwnProperty(a)&&a in Km)return nf[r]=l[a];return r}var Gm=tr(\"animationend\"),Ym=tr(\"animationiteration\"),Xm=tr(\"animationstart\"),Ox=tr(\"transitionrun\"),wx=tr(\"transitionstart\"),Nx=tr(\"transitioncancel\"),Fm=tr(\"transitionend\"),Qm=new Map,rf=\"abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel\".split(\" \");rf.push(\"scrollEnd\");function mn(r,l){Qm.set(r,l),Ji(l,[r])}var Jm=new WeakMap;function nn(r,l){if(typeof r==\"object\"&&r!==null){var a=Jm.get(r);return a!==void 0?a:(l={value:r,source:l,stack:hm(l)},Jm.set(r,l),l)}return{value:r,source:l,stack:hm(l)}}var rn=[],Yr=0,sf=0;function Zo(){for(var r=Yr,l=sf=Yr=0;l<r;){var a=rn[l];rn[l++]=null;var f=rn[l];rn[l++]=null;var h=rn[l];rn[l++]=null;var g=rn[l];if(rn[l++]=null,f!==null&&h!==null){var S=f.pending;S===null?h.next=h:(h.next=S.next,S.next=h),f.pending=h}g!==0&&Zm(a,h,g)}}function Wo(r,l,a,f){rn[Yr++]=r,rn[Yr++]=l,rn[Yr++]=a,rn[Yr++]=f,sf|=f,r.lanes|=f,r=r.alternate,r!==null&&(r.lanes|=f)}function lf(r,l,a,f){return Wo(r,l,a,f),ta(r)}function Xr(r,l){return Wo(r,null,null,l),ta(r)}function Zm(r,l,a){r.lanes|=a;var f=r.alternate;f!==null&&(f.lanes|=a);for(var h=!1,g=r.return;g!==null;)g.childLanes|=a,f=g.alternate,f!==null&&(f.childLanes|=a),g.tag===22&&(r=g.stateNode,r===null||r._visibility&1||(h=!0)),r=g,g=g.return;return r.tag===3?(g=r.stateNode,h&&l!==null&&(h=31-$e(a),r=g.hiddenUpdates,f=r[h],f===null?r[h]=[l]:f.push(l),l.lane=a|536870912),g):null}function ta(r){if(50<Ol)throw Ol=0,dd=null,Error(i(185));for(var l=r.return;l!==null;)r=l,l=r.return;return r.tag===3?r.stateNode:null}var Fr={};function Dx(r,l,a,f){this.tag=r,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=f,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ke(r,l,a,f){return new Dx(r,l,a,f)}function of(r){return r=r.prototype,!(!r||!r.isReactComponent)}function Ln(r,l){var a=r.alternate;return a===null?(a=Ke(r.tag,l,r.key,r.mode),a.elementType=r.elementType,a.type=r.type,a.stateNode=r.stateNode,a.alternate=r,r.alternate=a):(a.pendingProps=l,a.type=r.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=r.flags&65011712,a.childLanes=r.childLanes,a.lanes=r.lanes,a.child=r.child,a.memoizedProps=r.memoizedProps,a.memoizedState=r.memoizedState,a.updateQueue=r.updateQueue,l=r.dependencies,a.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},a.sibling=r.sibling,a.index=r.index,a.ref=r.ref,a.refCleanup=r.refCleanup,a}function Wm(r,l){r.flags&=65011714;var a=r.alternate;return a===null?(r.childLanes=0,r.lanes=l,r.child=null,r.subtreeFlags=0,r.memoizedProps=null,r.memoizedState=null,r.updateQueue=null,r.dependencies=null,r.stateNode=null):(r.childLanes=a.childLanes,r.lanes=a.lanes,r.child=a.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=a.memoizedProps,r.memoizedState=a.memoizedState,r.updateQueue=a.updateQueue,r.type=a.type,l=a.dependencies,r.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),r}function ea(r,l,a,f,h,g){var S=0;if(f=r,typeof r==\"function\")of(r)&&(S=1);else if(typeof r==\"string\")S=LM(r,a,W.current)?26:r===\"html\"||r===\"head\"||r===\"body\"?27:5;else t:switch(r){case ct:return r=Ke(31,a,l,h),r.elementType=ct,r.lanes=g,r;case E:return er(a.children,h,g,l);case M:S=8,h|=24;break;case x:return r=Ke(12,a,l,h|2),r.elementType=x,r.lanes=g,r;case P:return r=Ke(13,a,l,h),r.elementType=P,r.lanes=g,r;case et:return r=Ke(19,a,l,h),r.elementType=et,r.lanes=g,r;default:if(typeof r==\"object\"&&r!==null)switch(r.$$typeof){case O:case I:S=10;break t;case B:S=9;break t;case q:S=11;break t;case Y:S=14;break t;case nt:S=16,f=null;break t}S=29,a=Error(i(130,r===null?\"null\":typeof r,\"\")),f=null}return l=Ke(S,a,l,h),l.elementType=r,l.type=f,l.lanes=g,l}function er(r,l,a,f){return r=Ke(7,r,f,l),r.lanes=a,r}function af(r,l,a){return r=Ke(6,r,null,l),r.lanes=a,r}function uf(r,l,a){return l=Ke(4,r.children!==null?r.children:[],r.key,l),l.lanes=a,l.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},l}var Qr=[],Jr=0,na=null,ia=0,sn=[],ln=0,nr=null,zn=1,Bn=\"\";function ir(r,l){Qr[Jr++]=ia,Qr[Jr++]=na,na=r,ia=l}function tg(r,l,a){sn[ln++]=zn,sn[ln++]=Bn,sn[ln++]=nr,nr=r;var f=zn;r=Bn;var h=32-$e(f)-1;f&=~(1<<h),a+=1;var g=32-$e(l)+h;if(30<g){var S=h-h%5;g=(f&(1<<S)-1).toString(32),f>>=S,h-=S,zn=1<<32-$e(l)+h|a<<h|f,Bn=g+r}else zn=1<<g|a<<h|f,Bn=r}function cf(r){r.return!==null&&(ir(r,1),tg(r,1,0))}function ff(r){for(;r===na;)na=Qr[--Jr],Qr[Jr]=null,ia=Qr[--Jr],Qr[Jr]=null;for(;r===nr;)nr=sn[--ln],sn[ln]=null,Bn=sn[--ln],sn[ln]=null,zn=sn[--ln],sn[ln]=null}var Re=null,Yt=null,At=!1,rr=null,Tn=!1,df=Error(i(519));function sr(r){var l=Error(i(418,\"\"));throw ll(nn(l,r)),df}function eg(r){var l=r.stateNode,a=r.type,f=r.memoizedProps;switch(l[Te]=r,l[Be]=f,a){case\"dialog\":bt(\"cancel\",l),bt(\"close\",l);break;case\"iframe\":case\"object\":case\"embed\":bt(\"load\",l);break;case\"video\":case\"audio\":for(a=0;a<Nl.length;a++)bt(Nl[a],l);break;case\"source\":bt(\"error\",l);break;case\"img\":case\"image\":case\"link\":bt(\"error\",l),bt(\"load\",l);break;case\"details\":bt(\"toggle\",l);break;case\"input\":bt(\"invalid\",l),gm(l,f.value,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name,!0),$o(l);break;case\"select\":bt(\"invalid\",l);break;case\"textarea\":bt(\"invalid\",l),bm(l,f.value,f.defaultValue,f.children),$o(l)}a=f.children,typeof a!=\"string\"&&typeof a!=\"number\"&&typeof a!=\"bigint\"||l.textContent===\"\"+a||f.suppressHydrationWarning===!0||b0(l.textContent,a)?(f.popover!=null&&(bt(\"beforetoggle\",l),bt(\"toggle\",l)),f.onScroll!=null&&bt(\"scroll\",l),f.onScrollEnd!=null&&bt(\"scrollend\",l),f.onClick!=null&&(l.onclick=_a),l=!0):l=!1,l||sr(r)}function ng(r){for(Re=r.return;Re;)switch(Re.tag){case 5:case 13:Tn=!1;return;case 27:case 3:Tn=!0;return;default:Re=Re.return}}function rl(r){if(r!==Re)return!1;if(!At)return ng(r),At=!0,!1;var l=r.tag,a;if((a=l!==3&&l!==27)&&((a=l===5)&&(a=r.type,a=!(a!==\"form\"&&a!==\"button\")||Od(r.type,r.memoizedProps)),a=!a),a&&Yt&&sr(r),ng(r),l===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(i(317));t:{for(r=r.nextSibling,l=0;r;){if(r.nodeType===8)if(a=r.data,a===\"/$\"){if(l===0){Yt=yn(r.nextSibling);break t}l--}else a!==\"$\"&&a!==\"$!\"&&a!==\"$?\"||l++;r=r.nextSibling}Yt=null}}else l===27?(l=Yt,Ai(r.type)?(r=Rd,Rd=null,Yt=r):Yt=l):Yt=Re?yn(r.stateNode.nextSibling):null;return!0}function sl(){Yt=Re=null,At=!1}function ig(){var r=rr;return r!==null&&(Ie===null?Ie=r:Ie.push.apply(Ie,r),rr=null),r}function ll(r){rr===null?rr=[r]:rr.push(r)}var hf=V(null),lr=null,Hn=null;function fi(r,l,a){K(hf,l._currentValue),l._currentValue=a}function _n(r){r._currentValue=hf.current,F(hf)}function pf(r,l,a){for(;r!==null;){var f=r.alternate;if((r.childLanes&l)!==l?(r.childLanes|=l,f!==null&&(f.childLanes|=l)):f!==null&&(f.childLanes&l)!==l&&(f.childLanes|=l),r===a)break;r=r.return}}function mf(r,l,a,f){var h=r.child;for(h!==null&&(h.return=r);h!==null;){var g=h.dependencies;if(g!==null){var S=h.child;g=g.firstContext;t:for(;g!==null;){var T=g;g=h;for(var k=0;k<l.length;k++)if(T.context===l[k]){g.lanes|=a,T=g.alternate,T!==null&&(T.lanes|=a),pf(g.return,a,r),f||(S=null);break t}g=T.next}}else if(h.tag===18){if(S=h.return,S===null)throw Error(i(341));S.lanes|=a,g=S.alternate,g!==null&&(g.lanes|=a),pf(S,a,r),S=null}else S=h.child;if(S!==null)S.return=h;else for(S=h;S!==null;){if(S===r){S=null;break}if(h=S.sibling,h!==null){h.return=S.return,S=h;break}S=S.return}h=S}}function ol(r,l,a,f){r=null;for(var h=l,g=!1;h!==null;){if(!g){if((h.flags&524288)!==0)g=!0;else if((h.flags&262144)!==0)break}if(h.tag===10){var S=h.alternate;if(S===null)throw Error(i(387));if(S=S.memoizedProps,S!==null){var T=h.type;Pe(h.pendingProps.value,S.value)||(r!==null?r.push(T):r=[T])}}else if(h===De.current){if(S=h.alternate,S===null)throw Error(i(387));S.memoizedState.memoizedState!==h.memoizedState.memoizedState&&(r!==null?r.push(Hl):r=[Hl])}h=h.return}r!==null&&mf(l,r,a,f),l.flags|=262144}function ra(r){for(r=r.firstContext;r!==null;){if(!Pe(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function or(r){lr=r,Hn=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function xe(r){return rg(lr,r)}function sa(r,l){return lr===null&&or(r),rg(r,l)}function rg(r,l){var a=l._currentValue;if(l={context:l,memoizedValue:a,next:null},Hn===null){if(r===null)throw Error(i(308));Hn=l,r.dependencies={lanes:0,firstContext:l},r.flags|=524288}else Hn=Hn.next=l;return a}var Rx=typeof AbortController<\"u\"?AbortController:function(){var r=[],l=this.signal={aborted:!1,addEventListener:function(a,f){r.push(f)}};this.abort=function(){l.aborted=!0,r.forEach(function(a){return a()})}},Lx=n.unstable_scheduleCallback,zx=n.unstable_NormalPriority,se={$$typeof:I,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function gf(){return{controller:new Rx,data:new Map,refCount:0}}function al(r){r.refCount--,r.refCount===0&&Lx(zx,function(){r.controller.abort()})}var ul=null,yf=0,Zr=0,Wr=null;function Bx(r,l){if(ul===null){var a=ul=[];yf=0,Zr=vd(),Wr={status:\"pending\",value:void 0,then:function(f){a.push(f)}}}return yf++,l.then(sg,sg),l}function sg(){if(--yf===0&&ul!==null){Wr!==null&&(Wr.status=\"fulfilled\");var r=ul;ul=null,Zr=0,Wr=null;for(var l=0;l<r.length;l++)(0,r[l])()}}function Hx(r,l){var a=[],f={status:\"pending\",value:null,reason:null,then:function(h){a.push(h)}};return r.then(function(){f.status=\"fulfilled\",f.value=l;for(var h=0;h<a.length;h++)(0,a[h])(l)},function(h){for(f.status=\"rejected\",f.reason=h,h=0;h<a.length;h++)(0,a[h])(void 0)}),f}var lg=z.S;z.S=function(r,l){typeof l==\"object\"&&l!==null&&typeof l.then==\"function\"&&Bx(r,l),lg!==null&&lg(r,l)};var ar=V(null);function bf(){var r=ar.current;return r!==null?r:jt.pooledCache}function la(r,l){l===null?K(ar,ar.current):K(ar,l.pool)}function og(){var r=bf();return r===null?null:{parent:se._currentValue,pool:r}}var cl=Error(i(460)),ag=Error(i(474)),oa=Error(i(542)),vf={then:function(){}};function ug(r){return r=r.status,r===\"fulfilled\"||r===\"rejected\"}function aa(){}function cg(r,l,a){switch(a=r[a],a===void 0?r.push(l):a!==l&&(l.then(aa,aa),l=a),l.status){case\"fulfilled\":return l.value;case\"rejected\":throw r=l.reason,dg(r),r;default:if(typeof l.status==\"string\")l.then(aa,aa);else{if(r=jt,r!==null&&100<r.shellSuspendCounter)throw Error(i(482));r=l,r.status=\"pending\",r.then(function(f){if(l.status===\"pending\"){var h=l;h.status=\"fulfilled\",h.value=f}},function(f){if(l.status===\"pending\"){var h=l;h.status=\"rejected\",h.reason=f}})}switch(l.status){case\"fulfilled\":return l.value;case\"rejected\":throw r=l.reason,dg(r),r}throw fl=l,cl}}var fl=null;function fg(){if(fl===null)throw Error(i(459));var r=fl;return fl=null,r}function dg(r){if(r===cl||r===oa)throw Error(i(483))}var di=!1;function Sf(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ef(r,l){r=r.updateQueue,l.updateQueue===r&&(l.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,callbacks:null})}function hi(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function pi(r,l,a){var f=r.updateQueue;if(f===null)return null;if(f=f.shared,(wt&2)!==0){var h=f.pending;return h===null?l.next=l:(l.next=h.next,h.next=l),f.pending=l,l=ta(r),Zm(r,null,a),l}return Wo(r,f,l,a),ta(r)}function dl(r,l,a){if(l=l.updateQueue,l!==null&&(l=l.shared,(a&4194048)!==0)){var f=l.lanes;f&=r.pendingLanes,a|=f,l.lanes=a,sm(r,a)}}function Tf(r,l){var a=r.updateQueue,f=r.alternate;if(f!==null&&(f=f.updateQueue,a===f)){var h=null,g=null;if(a=a.firstBaseUpdate,a!==null){do{var S={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};g===null?h=g=S:g=g.next=S,a=a.next}while(a!==null);g===null?h=g=l:g=g.next=l}else h=g=l;a={baseState:f.baseState,firstBaseUpdate:h,lastBaseUpdate:g,shared:f.shared,callbacks:f.callbacks},r.updateQueue=a;return}r=a.lastBaseUpdate,r===null?a.firstBaseUpdate=l:r.next=l,a.lastBaseUpdate=l}var xf=!1;function hl(){if(xf){var r=Wr;if(r!==null)throw r}}function pl(r,l,a,f){xf=!1;var h=r.updateQueue;di=!1;var g=h.firstBaseUpdate,S=h.lastBaseUpdate,T=h.shared.pending;if(T!==null){h.shared.pending=null;var k=T,D=k.next;k.next=null,S===null?g=D:S.next=D,S=k;var H=r.alternate;H!==null&&(H=H.updateQueue,T=H.lastBaseUpdate,T!==S&&(T===null?H.firstBaseUpdate=D:T.next=D,H.lastBaseUpdate=k))}if(g!==null){var U=h.baseState;S=0,H=D=k=null,T=g;do{var R=T.lane&-536870913,L=R!==T.lane;if(L?(Tt&R)===R:(f&R)===R){R!==0&&R===Zr&&(xf=!0),H!==null&&(H=H.next={lane:0,tag:T.tag,payload:T.payload,callback:null,next:null});t:{var at=r,st=T;R=l;var zt=a;switch(st.tag){case 1:if(at=st.payload,typeof at==\"function\"){U=at.call(zt,U,R);break t}U=at;break t;case 3:at.flags=at.flags&-65537|128;case 0:if(at=st.payload,R=typeof at==\"function\"?at.call(zt,U,R):at,R==null)break t;U=m({},U,R);break t;case 2:di=!0}}R=T.callback,R!==null&&(r.flags|=64,L&&(r.flags|=8192),L=h.callbacks,L===null?h.callbacks=[R]:L.push(R))}else L={lane:R,tag:T.tag,payload:T.payload,callback:T.callback,next:null},H===null?(D=H=L,k=U):H=H.next=L,S|=R;if(T=T.next,T===null){if(T=h.shared.pending,T===null)break;L=T,T=L.next,L.next=null,h.lastBaseUpdate=L,h.shared.pending=null}}while(!0);H===null&&(k=U),h.baseState=k,h.firstBaseUpdate=D,h.lastBaseUpdate=H,g===null&&(h.shared.lanes=0),Ti|=S,r.lanes=S,r.memoizedState=U}}function hg(r,l){if(typeof r!=\"function\")throw Error(i(191,r));r.call(l)}function pg(r,l){var a=r.callbacks;if(a!==null)for(r.callbacks=null,r=0;r<a.length;r++)hg(a[r],l)}var ts=V(null),ua=V(0);function mg(r,l){r=Pn,K(ua,r),K(ts,l),Pn=r|l.baseLanes}function Mf(){K(ua,Pn),K(ts,ts.current)}function kf(){Pn=ua.current,F(ts),F(ua)}var mi=0,ht=null,Rt=null,ee=null,ca=!1,es=!1,ur=!1,fa=0,ml=0,ns=null,_x=0;function Wt(){throw Error(i(321))}function Af(r,l){if(l===null)return!1;for(var a=0;a<l.length&&a<r.length;a++)if(!Pe(r[a],l[a]))return!1;return!0}function Cf(r,l,a,f,h,g){return mi=g,ht=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,z.H=r===null||r.memoizedState===null?Zg:Wg,ur=!1,g=a(f,h),ur=!1,es&&(g=yg(l,a,f,h)),gg(r),g}function gg(r){z.H=ya;var l=Rt!==null&&Rt.next!==null;if(mi=0,ee=Rt=ht=null,ca=!1,ml=0,ns=null,l)throw Error(i(300));r===null||ce||(r=r.dependencies,r!==null&&ra(r)&&(ce=!0))}function yg(r,l,a,f){ht=r;var h=0;do{if(es&&(ns=null),ml=0,es=!1,25<=h)throw Error(i(301));if(h+=1,ee=Rt=null,r.updateQueue!=null){var g=r.updateQueue;g.lastEffect=null,g.events=null,g.stores=null,g.memoCache!=null&&(g.memoCache.index=0)}z.H=Px,g=l(a,f)}while(es);return g}function Ux(){var r=z.H,l=r.useState()[0];return l=typeof l.then==\"function\"?gl(l):l,r=r.useState()[0],(Rt!==null?Rt.memoizedState:null)!==r&&(ht.flags|=1024),l}function Of(){var r=fa!==0;return fa=0,r}function wf(r,l,a){l.updateQueue=r.updateQueue,l.flags&=-2053,r.lanes&=~a}function Nf(r){if(ca){for(r=r.memoizedState;r!==null;){var l=r.queue;l!==null&&(l.pending=null),r=r.next}ca=!1}mi=0,ee=Rt=ht=null,es=!1,ml=fa=0,ns=null}function _e(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ee===null?ht.memoizedState=ee=r:ee=ee.next=r,ee}function ne(){if(Rt===null){var r=ht.alternate;r=r!==null?r.memoizedState:null}else r=Rt.next;var l=ee===null?ht.memoizedState:ee.next;if(l!==null)ee=l,Rt=r;else{if(r===null)throw ht.alternate===null?Error(i(467)):Error(i(310));Rt=r,r={memoizedState:Rt.memoizedState,baseState:Rt.baseState,baseQueue:Rt.baseQueue,queue:Rt.queue,next:null},ee===null?ht.memoizedState=ee=r:ee=ee.next=r}return ee}function Df(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function gl(r){var l=ml;return ml+=1,ns===null&&(ns=[]),r=cg(ns,r,l),l=ht,(ee===null?l.memoizedState:ee.next)===null&&(l=l.alternate,z.H=l===null||l.memoizedState===null?Zg:Wg),r}function da(r){if(r!==null&&typeof r==\"object\"){if(typeof r.then==\"function\")return gl(r);if(r.$$typeof===I)return xe(r)}throw Error(i(438,String(r)))}function Rf(r){var l=null,a=ht.updateQueue;if(a!==null&&(l=a.memoCache),l==null){var f=ht.alternate;f!==null&&(f=f.updateQueue,f!==null&&(f=f.memoCache,f!=null&&(l={data:f.data.map(function(h){return h.slice()}),index:0})))}if(l==null&&(l={data:[],index:0}),a===null&&(a=Df(),ht.updateQueue=a),a.memoCache=l,a=l.data[l.index],a===void 0)for(a=l.data[l.index]=Array(r),f=0;f<r;f++)a[f]=Et;return l.index++,a}function Un(r,l){return typeof l==\"function\"?l(r):l}function ha(r){var l=ne();return Lf(l,Rt,r)}function Lf(r,l,a){var f=r.queue;if(f===null)throw Error(i(311));f.lastRenderedReducer=a;var h=r.baseQueue,g=f.pending;if(g!==null){if(h!==null){var S=h.next;h.next=g.next,g.next=S}l.baseQueue=h=g,f.pending=null}if(g=r.baseState,h===null)r.memoizedState=g;else{l=h.next;var T=S=null,k=null,D=l,H=!1;do{var U=D.lane&-536870913;if(U!==D.lane?(Tt&U)===U:(mi&U)===U){var R=D.revertLane;if(R===0)k!==null&&(k=k.next={lane:0,revertLane:0,action:D.action,hasEagerState:D.hasEagerState,eagerState:D.eagerState,next:null}),U===Zr&&(H=!0);else if((mi&R)===R){D=D.next,R===Zr&&(H=!0);continue}else U={lane:0,revertLane:D.revertLane,action:D.action,hasEagerState:D.hasEagerState,eagerState:D.eagerState,next:null},k===null?(T=k=U,S=g):k=k.next=U,ht.lanes|=R,Ti|=R;U=D.action,ur&&a(g,U),g=D.hasEagerState?D.eagerState:a(g,U)}else R={lane:U,revertLane:D.revertLane,action:D.action,hasEagerState:D.hasEagerState,eagerState:D.eagerState,next:null},k===null?(T=k=R,S=g):k=k.next=R,ht.lanes|=U,Ti|=U;D=D.next}while(D!==null&&D!==l);if(k===null?S=g:k.next=T,!Pe(g,r.memoizedState)&&(ce=!0,H&&(a=Wr,a!==null)))throw a;r.memoizedState=g,r.baseState=S,r.baseQueue=k,f.lastRenderedState=g}return h===null&&(f.lanes=0),[r.memoizedState,f.dispatch]}function zf(r){var l=ne(),a=l.queue;if(a===null)throw Error(i(311));a.lastRenderedReducer=r;var f=a.dispatch,h=a.pending,g=l.memoizedState;if(h!==null){a.pending=null;var S=h=h.next;do g=r(g,S.action),S=S.next;while(S!==h);Pe(g,l.memoizedState)||(ce=!0),l.memoizedState=g,l.baseQueue===null&&(l.baseState=g),a.lastRenderedState=g}return[g,f]}function bg(r,l,a){var f=ht,h=ne(),g=At;if(g){if(a===void 0)throw Error(i(407));a=a()}else a=l();var S=!Pe((Rt||h).memoizedState,a);S&&(h.memoizedState=a,ce=!0),h=h.queue;var T=Eg.bind(null,f,h,r);if(yl(2048,8,T,[r]),h.getSnapshot!==l||S||ee!==null&&ee.memoizedState.tag&1){if(f.flags|=2048,is(9,pa(),Sg.bind(null,f,h,a,l),null),jt===null)throw Error(i(349));g||(mi&124)!==0||vg(f,l,a)}return a}function vg(r,l,a){r.flags|=16384,r={getSnapshot:l,value:a},l=ht.updateQueue,l===null?(l=Df(),ht.updateQueue=l,l.stores=[r]):(a=l.stores,a===null?l.stores=[r]:a.push(r))}function Sg(r,l,a,f){l.value=a,l.getSnapshot=f,Tg(l)&&xg(r)}function Eg(r,l,a){return a(function(){Tg(l)&&xg(r)})}function Tg(r){var l=r.getSnapshot;r=r.value;try{var a=l();return!Pe(r,a)}catch{return!0}}function xg(r){var l=Xr(r,2);l!==null&&Qe(l,r,2)}function Bf(r){var l=_e();if(typeof r==\"function\"){var a=r;if(r=a(),ur){ai(!0);try{a()}finally{ai(!1)}}}return l.memoizedState=l.baseState=r,l.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Un,lastRenderedState:r},l}function Mg(r,l,a,f){return r.baseState=a,Lf(r,Rt,typeof f==\"function\"?f:Un)}function Ix(r,l,a,f,h){if(ga(r))throw Error(i(485));if(r=l.action,r!==null){var g={payload:h,action:r,next:null,isTransition:!0,status:\"pending\",value:null,reason:null,listeners:[],then:function(S){g.listeners.push(S)}};z.T!==null?a(!0):g.isTransition=!1,f(g),a=l.pending,a===null?(g.next=l.pending=g,kg(l,g)):(g.next=a.next,l.pending=a.next=g)}}function kg(r,l){var a=l.action,f=l.payload,h=r.state;if(l.isTransition){var g=z.T,S={};z.T=S;try{var T=a(h,f),k=z.S;k!==null&&k(S,T),Ag(r,l,T)}catch(D){Hf(r,l,D)}finally{z.T=g}}else try{g=a(h,f),Ag(r,l,g)}catch(D){Hf(r,l,D)}}function Ag(r,l,a){a!==null&&typeof a==\"object\"&&typeof a.then==\"function\"?a.then(function(f){Cg(r,l,f)},function(f){return Hf(r,l,f)}):Cg(r,l,a)}function Cg(r,l,a){l.status=\"fulfilled\",l.value=a,Og(l),r.state=a,l=r.pending,l!==null&&(a=l.next,a===l?r.pending=null:(a=a.next,l.next=a,kg(r,a)))}function Hf(r,l,a){var f=r.pending;if(r.pending=null,f!==null){f=f.next;do l.status=\"rejected\",l.reason=a,Og(l),l=l.next;while(l!==f)}r.action=null}function Og(r){r=r.listeners;for(var l=0;l<r.length;l++)(0,r[l])()}function wg(r,l){return l}function Ng(r,l){if(At){var a=jt.formState;if(a!==null){t:{var f=ht;if(At){if(Yt){e:{for(var h=Yt,g=Tn;h.nodeType!==8;){if(!g){h=null;break e}if(h=yn(h.nextSibling),h===null){h=null;break e}}g=h.data,h=g===\"F!\"||g===\"F\"?h:null}if(h){Yt=yn(h.nextSibling),f=h.data===\"F!\";break t}}sr(f)}f=!1}f&&(l=a[0])}}return a=_e(),a.memoizedState=a.baseState=l,f={pending:null,lanes:0,dispatch:null,lastRenderedReducer:wg,lastRenderedState:l},a.queue=f,a=Fg.bind(null,ht,f),f.dispatch=a,f=Bf(!1),g=qf.bind(null,ht,!1,f.queue),f=_e(),h={state:l,dispatch:null,action:r,pending:null},f.queue=h,a=Ix.bind(null,ht,h,g,a),h.dispatch=a,f.memoizedState=r,[l,a,!1]}function Dg(r){var l=ne();return Rg(l,Rt,r)}function Rg(r,l,a){if(l=Lf(r,l,wg)[0],r=ha(Un)[0],typeof l==\"object\"&&l!==null&&typeof l.then==\"function\")try{var f=gl(l)}catch(S){throw S===cl?oa:S}else f=l;l=ne();var h=l.queue,g=h.dispatch;return a!==l.memoizedState&&(ht.flags|=2048,is(9,pa(),jx.bind(null,h,a),null)),[f,g,r]}function jx(r,l){r.action=l}function Lg(r){var l=ne(),a=Rt;if(a!==null)return Rg(l,a,r);ne(),l=l.memoizedState,a=ne();var f=a.queue.dispatch;return a.memoizedState=r,[l,f,!1]}function is(r,l,a,f){return r={tag:r,create:a,deps:f,inst:l,next:null},l=ht.updateQueue,l===null&&(l=Df(),ht.updateQueue=l),a=l.lastEffect,a===null?l.lastEffect=r.next=r:(f=a.next,a.next=r,r.next=f,l.lastEffect=r),r}function pa(){return{destroy:void 0,resource:void 0}}function zg(){return ne().memoizedState}function ma(r,l,a,f){var h=_e();f=f===void 0?null:f,ht.flags|=r,h.memoizedState=is(1|l,pa(),a,f)}function yl(r,l,a,f){var h=ne();f=f===void 0?null:f;var g=h.memoizedState.inst;Rt!==null&&f!==null&&Af(f,Rt.memoizedState.deps)?h.memoizedState=is(l,g,a,f):(ht.flags|=r,h.memoizedState=is(1|l,g,a,f))}function Bg(r,l){ma(8390656,8,r,l)}function Hg(r,l){yl(2048,8,r,l)}function _g(r,l){return yl(4,2,r,l)}function Ug(r,l){return yl(4,4,r,l)}function Ig(r,l){if(typeof l==\"function\"){r=r();var a=l(r);return function(){typeof a==\"function\"?a():l(null)}}if(l!=null)return r=r(),l.current=r,function(){l.current=null}}function jg(r,l,a){a=a!=null?a.concat([r]):null,yl(4,4,Ig.bind(null,l,r),a)}function _f(){}function qg(r,l){var a=ne();l=l===void 0?null:l;var f=a.memoizedState;return l!==null&&Af(l,f[1])?f[0]:(a.memoizedState=[r,l],r)}function Vg(r,l){var a=ne();l=l===void 0?null:l;var f=a.memoizedState;if(l!==null&&Af(l,f[1]))return f[0];if(f=r(),ur){ai(!0);try{r()}finally{ai(!1)}}return a.memoizedState=[f,l],f}function Uf(r,l,a){return a===void 0||(mi&1073741824)!==0?r.memoizedState=l:(r.memoizedState=a,r=Ky(),ht.lanes|=r,Ti|=r,a)}function $g(r,l,a,f){return Pe(a,l)?a:ts.current!==null?(r=Uf(r,a,f),Pe(r,l)||(ce=!0),r):(mi&42)===0?(ce=!0,r.memoizedState=a):(r=Ky(),ht.lanes|=r,Ti|=r,l)}function Pg(r,l,a,f,h){var g=G.p;G.p=g!==0&&8>g?g:8;var S=z.T,T={};z.T=T,qf(r,!1,l,a);try{var k=h(),D=z.S;if(D!==null&&D(T,k),k!==null&&typeof k==\"object\"&&typeof k.then==\"function\"){var H=Hx(k,f);bl(r,l,H,Fe(r))}else bl(r,l,f,Fe(r))}catch(U){bl(r,l,{then:function(){},status:\"rejected\",reason:U},Fe())}finally{G.p=g,z.T=S}}function qx(){}function If(r,l,a,f){if(r.tag!==5)throw Error(i(476));var h=Kg(r).queue;Pg(r,h,l,it,a===null?qx:function(){return Gg(r),a(f)})}function Kg(r){var l=r.memoizedState;if(l!==null)return l;l={memoizedState:it,baseState:it,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Un,lastRenderedState:it},next:null};var a={};return l.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Un,lastRenderedState:a},next:null},r.memoizedState=l,r=r.alternate,r!==null&&(r.memoizedState=l),l}function Gg(r){var l=Kg(r).next.queue;bl(r,l,{},Fe())}function jf(){return xe(Hl)}function Yg(){return ne().memoizedState}function Xg(){return ne().memoizedState}function Vx(r){for(var l=r.return;l!==null;){switch(l.tag){case 24:case 3:var a=Fe();r=hi(a);var f=pi(l,r,a);f!==null&&(Qe(f,l,a),dl(f,l,a)),l={cache:gf()},r.payload=l;return}l=l.return}}function $x(r,l,a){var f=Fe();a={lane:f,revertLane:0,action:a,hasEagerState:!1,eagerState:null,next:null},ga(r)?Qg(l,a):(a=lf(r,l,a,f),a!==null&&(Qe(a,r,f),Jg(a,l,f)))}function Fg(r,l,a){var f=Fe();bl(r,l,a,f)}function bl(r,l,a,f){var h={lane:f,revertLane:0,action:a,hasEagerState:!1,eagerState:null,next:null};if(ga(r))Qg(l,h);else{var g=r.alternate;if(r.lanes===0&&(g===null||g.lanes===0)&&(g=l.lastRenderedReducer,g!==null))try{var S=l.lastRenderedState,T=g(S,a);if(h.hasEagerState=!0,h.eagerState=T,Pe(T,S))return Wo(r,l,h,0),jt===null&&Zo(),!1}catch{}finally{}if(a=lf(r,l,h,f),a!==null)return Qe(a,r,f),Jg(a,l,f),!0}return!1}function qf(r,l,a,f){if(f={lane:2,revertLane:vd(),action:f,hasEagerState:!1,eagerState:null,next:null},ga(r)){if(l)throw Error(i(479))}else l=lf(r,a,f,2),l!==null&&Qe(l,r,2)}function ga(r){var l=r.alternate;return r===ht||l!==null&&l===ht}function Qg(r,l){es=ca=!0;var a=r.pending;a===null?l.next=l:(l.next=a.next,a.next=l),r.pending=l}function Jg(r,l,a){if((a&4194048)!==0){var f=l.lanes;f&=r.pendingLanes,a|=f,l.lanes=a,sm(r,a)}}var ya={readContext:xe,use:da,useCallback:Wt,useContext:Wt,useEffect:Wt,useImperativeHandle:Wt,useLayoutEffect:Wt,useInsertionEffect:Wt,useMemo:Wt,useReducer:Wt,useRef:Wt,useState:Wt,useDebugValue:Wt,useDeferredValue:Wt,useTransition:Wt,useSyncExternalStore:Wt,useId:Wt,useHostTransitionStatus:Wt,useFormState:Wt,useActionState:Wt,useOptimistic:Wt,useMemoCache:Wt,useCacheRefresh:Wt},Zg={readContext:xe,use:da,useCallback:function(r,l){return _e().memoizedState=[r,l===void 0?null:l],r},useContext:xe,useEffect:Bg,useImperativeHandle:function(r,l,a){a=a!=null?a.concat([r]):null,ma(4194308,4,Ig.bind(null,l,r),a)},useLayoutEffect:function(r,l){return ma(4194308,4,r,l)},useInsertionEffect:function(r,l){ma(4,2,r,l)},useMemo:function(r,l){var a=_e();l=l===void 0?null:l;var f=r();if(ur){ai(!0);try{r()}finally{ai(!1)}}return a.memoizedState=[f,l],f},useReducer:function(r,l,a){var f=_e();if(a!==void 0){var h=a(l);if(ur){ai(!0);try{a(l)}finally{ai(!1)}}}else h=l;return f.memoizedState=f.baseState=h,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:h},f.queue=r,r=r.dispatch=$x.bind(null,ht,r),[f.memoizedState,r]},useRef:function(r){var l=_e();return r={current:r},l.memoizedState=r},useState:function(r){r=Bf(r);var l=r.queue,a=Fg.bind(null,ht,l);return l.dispatch=a,[r.memoizedState,a]},useDebugValue:_f,useDeferredValue:function(r,l){var a=_e();return Uf(a,r,l)},useTransition:function(){var r=Bf(!1);return r=Pg.bind(null,ht,r.queue,!0,!1),_e().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,l,a){var f=ht,h=_e();if(At){if(a===void 0)throw Error(i(407));a=a()}else{if(a=l(),jt===null)throw Error(i(349));(Tt&124)!==0||vg(f,l,a)}h.memoizedState=a;var g={value:a,getSnapshot:l};return h.queue=g,Bg(Eg.bind(null,f,g,r),[r]),f.flags|=2048,is(9,pa(),Sg.bind(null,f,g,a,l),null),a},useId:function(){var r=_e(),l=jt.identifierPrefix;if(At){var a=Bn,f=zn;a=(f&~(1<<32-$e(f)-1)).toString(32)+a,l=\"«\"+l+\"R\"+a,a=fa++,0<a&&(l+=\"H\"+a.toString(32)),l+=\"»\"}else a=_x++,l=\"«\"+l+\"r\"+a.toString(32)+\"»\";return r.memoizedState=l},useHostTransitionStatus:jf,useFormState:Ng,useActionState:Ng,useOptimistic:function(r){var l=_e();l.memoizedState=l.baseState=r;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return l.queue=a,l=qf.bind(null,ht,!0,a),a.dispatch=l,[r,l]},useMemoCache:Rf,useCacheRefresh:function(){return _e().memoizedState=Vx.bind(null,ht)}},Wg={readContext:xe,use:da,useCallback:qg,useContext:xe,useEffect:Hg,useImperativeHandle:jg,useInsertionEffect:_g,useLayoutEffect:Ug,useMemo:Vg,useReducer:ha,useRef:zg,useState:function(){return ha(Un)},useDebugValue:_f,useDeferredValue:function(r,l){var a=ne();return $g(a,Rt.memoizedState,r,l)},useTransition:function(){var r=ha(Un)[0],l=ne().memoizedState;return[typeof r==\"boolean\"?r:gl(r),l]},useSyncExternalStore:bg,useId:Yg,useHostTransitionStatus:jf,useFormState:Dg,useActionState:Dg,useOptimistic:function(r,l){var a=ne();return Mg(a,Rt,r,l)},useMemoCache:Rf,useCacheRefresh:Xg},Px={readContext:xe,use:da,useCallback:qg,useContext:xe,useEffect:Hg,useImperativeHandle:jg,useInsertionEffect:_g,useLayoutEffect:Ug,useMemo:Vg,useReducer:zf,useRef:zg,useState:function(){return zf(Un)},useDebugValue:_f,useDeferredValue:function(r,l){var a=ne();return Rt===null?Uf(a,r,l):$g(a,Rt.memoizedState,r,l)},useTransition:function(){var r=zf(Un)[0],l=ne().memoizedState;return[typeof r==\"boolean\"?r:gl(r),l]},useSyncExternalStore:bg,useId:Yg,useHostTransitionStatus:jf,useFormState:Lg,useActionState:Lg,useOptimistic:function(r,l){var a=ne();return Rt!==null?Mg(a,Rt,r,l):(a.baseState=r,[r,a.queue.dispatch])},useMemoCache:Rf,useCacheRefresh:Xg},rs=null,vl=0;function ba(r){var l=vl;return vl+=1,rs===null&&(rs=[]),cg(rs,r,l)}function Sl(r,l){l=l.props.ref,r.ref=l!==void 0?l:null}function va(r,l){throw l.$$typeof===y?Error(i(525)):(r=Object.prototype.toString.call(l),Error(i(31,r===\"[object Object]\"?\"object with keys {\"+Object.keys(l).join(\", \")+\"}\":r)))}function ty(r){var l=r._init;return l(r._payload)}function ey(r){function l(w,C){if(r){var N=w.deletions;N===null?(w.deletions=[C],w.flags|=16):N.push(C)}}function a(w,C){if(!r)return null;for(;C!==null;)l(w,C),C=C.sibling;return null}function f(w){for(var C=new Map;w!==null;)w.key!==null?C.set(w.key,w):C.set(w.index,w),w=w.sibling;return C}function h(w,C){return w=Ln(w,C),w.index=0,w.sibling=null,w}function g(w,C,N){return w.index=N,r?(N=w.alternate,N!==null?(N=N.index,N<C?(w.flags|=67108866,C):N):(w.flags|=67108866,C)):(w.flags|=1048576,C)}function S(w){return r&&w.alternate===null&&(w.flags|=67108866),w}function T(w,C,N,_){return C===null||C.tag!==6?(C=af(N,w.mode,_),C.return=w,C):(C=h(C,N),C.return=w,C)}function k(w,C,N,_){var Q=N.type;return Q===E?H(w,C,N.props.children,_,N.key):C!==null&&(C.elementType===Q||typeof Q==\"object\"&&Q!==null&&Q.$$typeof===nt&&ty(Q)===C.type)?(C=h(C,N.props),Sl(C,N),C.return=w,C):(C=ea(N.type,N.key,N.props,null,w.mode,_),Sl(C,N),C.return=w,C)}function D(w,C,N,_){return C===null||C.tag!==4||C.stateNode.containerInfo!==N.containerInfo||C.stateNode.implementation!==N.implementation?(C=uf(N,w.mode,_),C.return=w,C):(C=h(C,N.children||[]),C.return=w,C)}function H(w,C,N,_,Q){return C===null||C.tag!==7?(C=er(N,w.mode,_,Q),C.return=w,C):(C=h(C,N),C.return=w,C)}function U(w,C,N){if(typeof C==\"string\"&&C!==\"\"||typeof C==\"number\"||typeof C==\"bigint\")return C=af(\"\"+C,w.mode,N),C.return=w,C;if(typeof C==\"object\"&&C!==null){switch(C.$$typeof){case b:return N=ea(C.type,C.key,C.props,null,w.mode,N),Sl(N,C),N.return=w,N;case v:return C=uf(C,w.mode,N),C.return=w,C;case nt:var _=C._init;return C=_(C._payload),U(w,C,N)}if(gt(C)||Dt(C))return C=er(C,w.mode,N,null),C.return=w,C;if(typeof C.then==\"function\")return U(w,ba(C),N);if(C.$$typeof===I)return U(w,sa(w,C),N);va(w,C)}return null}function R(w,C,N,_){var Q=C!==null?C.key:null;if(typeof N==\"string\"&&N!==\"\"||typeof N==\"number\"||typeof N==\"bigint\")return Q!==null?null:T(w,C,\"\"+N,_);if(typeof N==\"object\"&&N!==null){switch(N.$$typeof){case b:return N.key===Q?k(w,C,N,_):null;case v:return N.key===Q?D(w,C,N,_):null;case nt:return Q=N._init,N=Q(N._payload),R(w,C,N,_)}if(gt(N)||Dt(N))return Q!==null?null:H(w,C,N,_,null);if(typeof N.then==\"function\")return R(w,C,ba(N),_);if(N.$$typeof===I)return R(w,C,sa(w,N),_);va(w,N)}return null}function L(w,C,N,_,Q){if(typeof _==\"string\"&&_!==\"\"||typeof _==\"number\"||typeof _==\"bigint\")return w=w.get(N)||null,T(C,w,\"\"+_,Q);if(typeof _==\"object\"&&_!==null){switch(_.$$typeof){case b:return w=w.get(_.key===null?N:_.key)||null,k(C,w,_,Q);case v:return w=w.get(_.key===null?N:_.key)||null,D(C,w,_,Q);case nt:var mt=_._init;return _=mt(_._payload),L(w,C,N,_,Q)}if(gt(_)||Dt(_))return w=w.get(N)||null,H(C,w,_,Q,null);if(typeof _.then==\"function\")return L(w,C,N,ba(_),Q);if(_.$$typeof===I)return L(w,C,N,sa(C,_),Q);va(C,_)}return null}function at(w,C,N,_){for(var Q=null,mt=null,Z=C,ot=C=0,de=null;Z!==null&&ot<N.length;ot++){Z.index>ot?(de=Z,Z=null):de=Z.sibling;var kt=R(w,Z,N[ot],_);if(kt===null){Z===null&&(Z=de);break}r&&Z&&kt.alternate===null&&l(w,Z),C=g(kt,C,ot),mt===null?Q=kt:mt.sibling=kt,mt=kt,Z=de}if(ot===N.length)return a(w,Z),At&&ir(w,ot),Q;if(Z===null){for(;ot<N.length;ot++)Z=U(w,N[ot],_),Z!==null&&(C=g(Z,C,ot),mt===null?Q=Z:mt.sibling=Z,mt=Z);return At&&ir(w,ot),Q}for(Z=f(Z);ot<N.length;ot++)de=L(Z,w,ot,N[ot],_),de!==null&&(r&&de.alternate!==null&&Z.delete(de.key===null?ot:de.key),C=g(de,C,ot),mt===null?Q=de:mt.sibling=de,mt=de);return r&&Z.forEach(function(Di){return l(w,Di)}),At&&ir(w,ot),Q}function st(w,C,N,_){if(N==null)throw Error(i(151));for(var Q=null,mt=null,Z=C,ot=C=0,de=null,kt=N.next();Z!==null&&!kt.done;ot++,kt=N.next()){Z.index>ot?(de=Z,Z=null):de=Z.sibling;var Di=R(w,Z,kt.value,_);if(Di===null){Z===null&&(Z=de);break}r&&Z&&Di.alternate===null&&l(w,Z),C=g(Di,C,ot),mt===null?Q=Di:mt.sibling=Di,mt=Di,Z=de}if(kt.done)return a(w,Z),At&&ir(w,ot),Q;if(Z===null){for(;!kt.done;ot++,kt=N.next())kt=U(w,kt.value,_),kt!==null&&(C=g(kt,C,ot),mt===null?Q=kt:mt.sibling=kt,mt=kt);return At&&ir(w,ot),Q}for(Z=f(Z);!kt.done;ot++,kt=N.next())kt=L(Z,w,ot,kt.value,_),kt!==null&&(r&&kt.alternate!==null&&Z.delete(kt.key===null?ot:kt.key),C=g(kt,C,ot),mt===null?Q=kt:mt.sibling=kt,mt=kt);return r&&Z.forEach(function(KM){return l(w,KM)}),At&&ir(w,ot),Q}function zt(w,C,N,_){if(typeof N==\"object\"&&N!==null&&N.type===E&&N.key===null&&(N=N.props.children),typeof N==\"object\"&&N!==null){switch(N.$$typeof){case b:t:{for(var Q=N.key;C!==null;){if(C.key===Q){if(Q=N.type,Q===E){if(C.tag===7){a(w,C.sibling),_=h(C,N.props.children),_.return=w,w=_;break t}}else if(C.elementType===Q||typeof Q==\"object\"&&Q!==null&&Q.$$typeof===nt&&ty(Q)===C.type){a(w,C.sibling),_=h(C,N.props),Sl(_,N),_.return=w,w=_;break t}a(w,C);break}else l(w,C);C=C.sibling}N.type===E?(_=er(N.props.children,w.mode,_,N.key),_.return=w,w=_):(_=ea(N.type,N.key,N.props,null,w.mode,_),Sl(_,N),_.return=w,w=_)}return S(w);case v:t:{for(Q=N.key;C!==null;){if(C.key===Q)if(C.tag===4&&C.stateNode.containerInfo===N.containerInfo&&C.stateNode.implementation===N.implementation){a(w,C.sibling),_=h(C,N.children||[]),_.return=w,w=_;break t}else{a(w,C);break}else l(w,C);C=C.sibling}_=uf(N,w.mode,_),_.return=w,w=_}return S(w);case nt:return Q=N._init,N=Q(N._payload),zt(w,C,N,_)}if(gt(N))return at(w,C,N,_);if(Dt(N)){if(Q=Dt(N),typeof Q!=\"function\")throw Error(i(150));return N=Q.call(N),st(w,C,N,_)}if(typeof N.then==\"function\")return zt(w,C,ba(N),_);if(N.$$typeof===I)return zt(w,C,sa(w,N),_);va(w,N)}return typeof N==\"string\"&&N!==\"\"||typeof N==\"number\"||typeof N==\"bigint\"?(N=\"\"+N,C!==null&&C.tag===6?(a(w,C.sibling),_=h(C,N),_.return=w,w=_):(a(w,C),_=af(N,w.mode,_),_.return=w,w=_),S(w)):a(w,C)}return function(w,C,N,_){try{vl=0;var Q=zt(w,C,N,_);return rs=null,Q}catch(Z){if(Z===cl||Z===oa)throw Z;var mt=Ke(29,Z,null,w.mode);return mt.lanes=_,mt.return=w,mt}finally{}}}var ss=ey(!0),ny=ey(!1),on=V(null),xn=null;function gi(r){var l=r.alternate;K(le,le.current&1),K(on,r),xn===null&&(l===null||ts.current!==null||l.memoizedState!==null)&&(xn=r)}function iy(r){if(r.tag===22){if(K(le,le.current),K(on,r),xn===null){var l=r.alternate;l!==null&&l.memoizedState!==null&&(xn=r)}}else yi()}function yi(){K(le,le.current),K(on,on.current)}function In(r){F(on),xn===r&&(xn=null),F(le)}var le=V(0);function Sa(r){for(var l=r;l!==null;){if(l.tag===13){var a=l.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||a.data===\"$?\"||Dd(a)))return l}else if(l.tag===19&&l.memoizedProps.revealOrder!==void 0){if((l.flags&128)!==0)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===r)break;for(;l.sibling===null;){if(l.return===null||l.return===r)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}function Vf(r,l,a,f){l=r.memoizedState,a=a(f,l),a=a==null?l:m({},l,a),r.memoizedState=a,r.lanes===0&&(r.updateQueue.baseState=a)}var $f={enqueueSetState:function(r,l,a){r=r._reactInternals;var f=Fe(),h=hi(f);h.payload=l,a!=null&&(h.callback=a),l=pi(r,h,f),l!==null&&(Qe(l,r,f),dl(l,r,f))},enqueueReplaceState:function(r,l,a){r=r._reactInternals;var f=Fe(),h=hi(f);h.tag=1,h.payload=l,a!=null&&(h.callback=a),l=pi(r,h,f),l!==null&&(Qe(l,r,f),dl(l,r,f))},enqueueForceUpdate:function(r,l){r=r._reactInternals;var a=Fe(),f=hi(a);f.tag=2,l!=null&&(f.callback=l),l=pi(r,f,a),l!==null&&(Qe(l,r,a),dl(l,r,a))}};function ry(r,l,a,f,h,g,S){return r=r.stateNode,typeof r.shouldComponentUpdate==\"function\"?r.shouldComponentUpdate(f,g,S):l.prototype&&l.prototype.isPureReactComponent?!nl(a,f)||!nl(h,g):!0}function sy(r,l,a,f){r=l.state,typeof l.componentWillReceiveProps==\"function\"&&l.componentWillReceiveProps(a,f),typeof l.UNSAFE_componentWillReceiveProps==\"function\"&&l.UNSAFE_componentWillReceiveProps(a,f),l.state!==r&&$f.enqueueReplaceState(l,l.state,null)}function cr(r,l){var a=l;if(\"ref\"in l){a={};for(var f in l)f!==\"ref\"&&(a[f]=l[f])}if(r=r.defaultProps){a===l&&(a=m({},a));for(var h in r)a[h]===void 0&&(a[h]=r[h])}return a}var Ea=typeof reportError==\"function\"?reportError:function(r){if(typeof window==\"object\"&&typeof window.ErrorEvent==\"function\"){var l=new window.ErrorEvent(\"error\",{bubbles:!0,cancelable:!0,message:typeof r==\"object\"&&r!==null&&typeof r.message==\"string\"?String(r.message):String(r),error:r});if(!window.dispatchEvent(l))return}else if(typeof process==\"object\"&&typeof process.emit==\"function\"){process.emit(\"uncaughtException\",r);return}console.error(r)};function ly(r){Ea(r)}function oy(r){console.error(r)}function ay(r){Ea(r)}function Ta(r,l){try{var a=r.onUncaughtError;a(l.value,{componentStack:l.stack})}catch(f){setTimeout(function(){throw f})}}function uy(r,l,a){try{var f=r.onCaughtError;f(a.value,{componentStack:a.stack,errorBoundary:l.tag===1?l.stateNode:null})}catch(h){setTimeout(function(){throw h})}}function Pf(r,l,a){return a=hi(a),a.tag=3,a.payload={element:null},a.callback=function(){Ta(r,l)},a}function cy(r){return r=hi(r),r.tag=3,r}function fy(r,l,a,f){var h=a.type.getDerivedStateFromError;if(typeof h==\"function\"){var g=f.value;r.payload=function(){return h(g)},r.callback=function(){uy(l,a,f)}}var S=a.stateNode;S!==null&&typeof S.componentDidCatch==\"function\"&&(r.callback=function(){uy(l,a,f),typeof h!=\"function\"&&(xi===null?xi=new Set([this]):xi.add(this));var T=f.stack;this.componentDidCatch(f.value,{componentStack:T!==null?T:\"\"})})}function Kx(r,l,a,f,h){if(a.flags|=32768,f!==null&&typeof f==\"object\"&&typeof f.then==\"function\"){if(l=a.alternate,l!==null&&ol(l,a,h,!0),a=on.current,a!==null){switch(a.tag){case 13:return xn===null?pd():a.alternate===null&&Xt===0&&(Xt=3),a.flags&=-257,a.flags|=65536,a.lanes=h,f===vf?a.flags|=16384:(l=a.updateQueue,l===null?a.updateQueue=new Set([f]):l.add(f),gd(r,f,h)),!1;case 22:return a.flags|=65536,f===vf?a.flags|=16384:(l=a.updateQueue,l===null?(l={transitions:null,markerInstances:null,retryQueue:new Set([f])},a.updateQueue=l):(a=l.retryQueue,a===null?l.retryQueue=new Set([f]):a.add(f)),gd(r,f,h)),!1}throw Error(i(435,a.tag))}return gd(r,f,h),pd(),!1}if(At)return l=on.current,l!==null?((l.flags&65536)===0&&(l.flags|=256),l.flags|=65536,l.lanes=h,f!==df&&(r=Error(i(422),{cause:f}),ll(nn(r,a)))):(f!==df&&(l=Error(i(423),{cause:f}),ll(nn(l,a))),r=r.current.alternate,r.flags|=65536,h&=-h,r.lanes|=h,f=nn(f,a),h=Pf(r.stateNode,f,h),Tf(r,h),Xt!==4&&(Xt=2)),!1;var g=Error(i(520),{cause:f});if(g=nn(g,a),Cl===null?Cl=[g]:Cl.push(g),Xt!==4&&(Xt=2),l===null)return!0;f=nn(f,a),a=l;do{switch(a.tag){case 3:return a.flags|=65536,r=h&-h,a.lanes|=r,r=Pf(a.stateNode,f,r),Tf(a,r),!1;case 1:if(l=a.type,g=a.stateNode,(a.flags&128)===0&&(typeof l.getDerivedStateFromError==\"function\"||g!==null&&typeof g.componentDidCatch==\"function\"&&(xi===null||!xi.has(g))))return a.flags|=65536,h&=-h,a.lanes|=h,h=cy(h),fy(h,r,a,f),Tf(a,h),!1}a=a.return}while(a!==null);return!1}var dy=Error(i(461)),ce=!1;function me(r,l,a,f){l.child=r===null?ny(l,null,a,f):ss(l,r.child,a,f)}function hy(r,l,a,f,h){a=a.render;var g=l.ref;if(\"ref\"in f){var S={};for(var T in f)T!==\"ref\"&&(S[T]=f[T])}else S=f;return or(l),f=Cf(r,l,a,S,g,h),T=Of(),r!==null&&!ce?(wf(r,l,h),jn(r,l,h)):(At&&T&&cf(l),l.flags|=1,me(r,l,f,h),l.child)}function py(r,l,a,f,h){if(r===null){var g=a.type;return typeof g==\"function\"&&!of(g)&&g.defaultProps===void 0&&a.compare===null?(l.tag=15,l.type=g,my(r,l,g,f,h)):(r=ea(a.type,null,f,l,l.mode,h),r.ref=l.ref,r.return=l,l.child=r)}if(g=r.child,!Zf(r,h)){var S=g.memoizedProps;if(a=a.compare,a=a!==null?a:nl,a(S,f)&&r.ref===l.ref)return jn(r,l,h)}return l.flags|=1,r=Ln(g,f),r.ref=l.ref,r.return=l,l.child=r}function my(r,l,a,f,h){if(r!==null){var g=r.memoizedProps;if(nl(g,f)&&r.ref===l.ref)if(ce=!1,l.pendingProps=f=g,Zf(r,h))(r.flags&131072)!==0&&(ce=!0);else return l.lanes=r.lanes,jn(r,l,h)}return Kf(r,l,a,f,h)}function gy(r,l,a){var f=l.pendingProps,h=f.children,g=r!==null?r.memoizedState:null;if(f.mode===\"hidden\"){if((l.flags&128)!==0){if(f=g!==null?g.baseLanes|a:a,r!==null){for(h=l.child=r.child,g=0;h!==null;)g=g|h.lanes|h.childLanes,h=h.sibling;l.childLanes=g&~f}else l.childLanes=0,l.child=null;return yy(r,l,f,a)}if((a&536870912)!==0)l.memoizedState={baseLanes:0,cachePool:null},r!==null&&la(l,g!==null?g.cachePool:null),g!==null?mg(l,g):Mf(),iy(l);else return l.lanes=l.childLanes=536870912,yy(r,l,g!==null?g.baseLanes|a:a,a)}else g!==null?(la(l,g.cachePool),mg(l,g),yi(),l.memoizedState=null):(r!==null&&la(l,null),Mf(),yi());return me(r,l,h,a),l.child}function yy(r,l,a,f){var h=bf();return h=h===null?null:{parent:se._currentValue,pool:h},l.memoizedState={baseLanes:a,cachePool:h},r!==null&&la(l,null),Mf(),iy(l),r!==null&&ol(r,l,f,!0),null}function xa(r,l){var a=l.ref;if(a===null)r!==null&&r.ref!==null&&(l.flags|=4194816);else{if(typeof a!=\"function\"&&typeof a!=\"object\")throw Error(i(284));(r===null||r.ref!==a)&&(l.flags|=4194816)}}function Kf(r,l,a,f,h){return or(l),a=Cf(r,l,a,f,void 0,h),f=Of(),r!==null&&!ce?(wf(r,l,h),jn(r,l,h)):(At&&f&&cf(l),l.flags|=1,me(r,l,a,h),l.child)}function by(r,l,a,f,h,g){return or(l),l.updateQueue=null,a=yg(l,f,a,h),gg(r),f=Of(),r!==null&&!ce?(wf(r,l,g),jn(r,l,g)):(At&&f&&cf(l),l.flags|=1,me(r,l,a,g),l.child)}function vy(r,l,a,f,h){if(or(l),l.stateNode===null){var g=Fr,S=a.contextType;typeof S==\"object\"&&S!==null&&(g=xe(S)),g=new a(f,g),l.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,g.updater=$f,l.stateNode=g,g._reactInternals=l,g=l.stateNode,g.props=f,g.state=l.memoizedState,g.refs={},Sf(l),S=a.contextType,g.context=typeof S==\"object\"&&S!==null?xe(S):Fr,g.state=l.memoizedState,S=a.getDerivedStateFromProps,typeof S==\"function\"&&(Vf(l,a,S,f),g.state=l.memoizedState),typeof a.getDerivedStateFromProps==\"function\"||typeof g.getSnapshotBeforeUpdate==\"function\"||typeof g.UNSAFE_componentWillMount!=\"function\"&&typeof g.componentWillMount!=\"function\"||(S=g.state,typeof g.componentWillMount==\"function\"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount==\"function\"&&g.UNSAFE_componentWillMount(),S!==g.state&&$f.enqueueReplaceState(g,g.state,null),pl(l,f,g,h),hl(),g.state=l.memoizedState),typeof g.componentDidMount==\"function\"&&(l.flags|=4194308),f=!0}else if(r===null){g=l.stateNode;var T=l.memoizedProps,k=cr(a,T);g.props=k;var D=g.context,H=a.contextType;S=Fr,typeof H==\"object\"&&H!==null&&(S=xe(H));var U=a.getDerivedStateFromProps;H=typeof U==\"function\"||typeof g.getSnapshotBeforeUpdate==\"function\",T=l.pendingProps!==T,H||typeof g.UNSAFE_componentWillReceiveProps!=\"function\"&&typeof g.componentWillReceiveProps!=\"function\"||(T||D!==S)&&sy(l,g,f,S),di=!1;var R=l.memoizedState;g.state=R,pl(l,f,g,h),hl(),D=l.memoizedState,T||R!==D||di?(typeof U==\"function\"&&(Vf(l,a,U,f),D=l.memoizedState),(k=di||ry(l,a,k,f,R,D,S))?(H||typeof g.UNSAFE_componentWillMount!=\"function\"&&typeof g.componentWillMount!=\"function\"||(typeof g.componentWillMount==\"function\"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount==\"function\"&&g.UNSAFE_componentWillMount()),typeof g.componentDidMount==\"function\"&&(l.flags|=4194308)):(typeof g.componentDidMount==\"function\"&&(l.flags|=4194308),l.memoizedProps=f,l.memoizedState=D),g.props=f,g.state=D,g.context=S,f=k):(typeof g.componentDidMount==\"function\"&&(l.flags|=4194308),f=!1)}else{g=l.stateNode,Ef(r,l),S=l.memoizedProps,H=cr(a,S),g.props=H,U=l.pendingProps,R=g.context,D=a.contextType,k=Fr,typeof D==\"object\"&&D!==null&&(k=xe(D)),T=a.getDerivedStateFromProps,(D=typeof T==\"function\"||typeof g.getSnapshotBeforeUpdate==\"function\")||typeof g.UNSAFE_componentWillReceiveProps!=\"function\"&&typeof g.componentWillReceiveProps!=\"function\"||(S!==U||R!==k)&&sy(l,g,f,k),di=!1,R=l.memoizedState,g.state=R,pl(l,f,g,h),hl();var L=l.memoizedState;S!==U||R!==L||di||r!==null&&r.dependencies!==null&&ra(r.dependencies)?(typeof T==\"function\"&&(Vf(l,a,T,f),L=l.memoizedState),(H=di||ry(l,a,H,f,R,L,k)||r!==null&&r.dependencies!==null&&ra(r.dependencies))?(D||typeof g.UNSAFE_componentWillUpdate!=\"function\"&&typeof g.componentWillUpdate!=\"function\"||(typeof g.componentWillUpdate==\"function\"&&g.componentWillUpdate(f,L,k),typeof g.UNSAFE_componentWillUpdate==\"function\"&&g.UNSAFE_componentWillUpdate(f,L,k)),typeof g.componentDidUpdate==\"function\"&&(l.flags|=4),typeof g.getSnapshotBeforeUpdate==\"function\"&&(l.flags|=1024)):(typeof g.componentDidUpdate!=\"function\"||S===r.memoizedProps&&R===r.memoizedState||(l.flags|=4),typeof g.getSnapshotBeforeUpdate!=\"function\"||S===r.memoizedProps&&R===r.memoizedState||(l.flags|=1024),l.memoizedProps=f,l.memoizedState=L),g.props=f,g.state=L,g.context=k,f=H):(typeof g.componentDidUpdate!=\"function\"||S===r.memoizedProps&&R===r.memoizedState||(l.flags|=4),typeof g.getSnapshotBeforeUpdate!=\"function\"||S===r.memoizedProps&&R===r.memoizedState||(l.flags|=1024),f=!1)}return g=f,xa(r,l),f=(l.flags&128)!==0,g||f?(g=l.stateNode,a=f&&typeof a.getDerivedStateFromError!=\"function\"?null:g.render(),l.flags|=1,r!==null&&f?(l.child=ss(l,r.child,null,h),l.child=ss(l,null,a,h)):me(r,l,a,h),l.memoizedState=g.state,r=l.child):r=jn(r,l,h),r}function Sy(r,l,a,f){return sl(),l.flags|=256,me(r,l,a,f),l.child}var Gf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Yf(r){return{baseLanes:r,cachePool:og()}}function Xf(r,l,a){return r=r!==null?r.childLanes&~a:0,l&&(r|=an),r}function Ey(r,l,a){var f=l.pendingProps,h=!1,g=(l.flags&128)!==0,S;if((S=g)||(S=r!==null&&r.memoizedState===null?!1:(le.current&2)!==0),S&&(h=!0,l.flags&=-129),S=(l.flags&32)!==0,l.flags&=-33,r===null){if(At){if(h?gi(l):yi(),At){var T=Yt,k;if(k=T){t:{for(k=T,T=Tn;k.nodeType!==8;){if(!T){T=null;break t}if(k=yn(k.nextSibling),k===null){T=null;break t}}T=k}T!==null?(l.memoizedState={dehydrated:T,treeContext:nr!==null?{id:zn,overflow:Bn}:null,retryLane:536870912,hydrationErrors:null},k=Ke(18,null,null,0),k.stateNode=T,k.return=l,l.child=k,Re=l,Yt=null,k=!0):k=!1}k||sr(l)}if(T=l.memoizedState,T!==null&&(T=T.dehydrated,T!==null))return Dd(T)?l.lanes=32:l.lanes=536870912,null;In(l)}return T=f.children,f=f.fallback,h?(yi(),h=l.mode,T=Ma({mode:\"hidden\",children:T},h),f=er(f,h,a,null),T.return=l,f.return=l,T.sibling=f,l.child=T,h=l.child,h.memoizedState=Yf(a),h.childLanes=Xf(r,S,a),l.memoizedState=Gf,f):(gi(l),Ff(l,T))}if(k=r.memoizedState,k!==null&&(T=k.dehydrated,T!==null)){if(g)l.flags&256?(gi(l),l.flags&=-257,l=Qf(r,l,a)):l.memoizedState!==null?(yi(),l.child=r.child,l.flags|=128,l=null):(yi(),h=f.fallback,T=l.mode,f=Ma({mode:\"visible\",children:f.children},T),h=er(h,T,a,null),h.flags|=2,f.return=l,h.return=l,f.sibling=h,l.child=f,ss(l,r.child,null,a),f=l.child,f.memoizedState=Yf(a),f.childLanes=Xf(r,S,a),l.memoizedState=Gf,l=h);else if(gi(l),Dd(T)){if(S=T.nextSibling&&T.nextSibling.dataset,S)var D=S.dgst;S=D,f=Error(i(419)),f.stack=\"\",f.digest=S,ll({value:f,source:null,stack:null}),l=Qf(r,l,a)}else if(ce||ol(r,l,a,!1),S=(a&r.childLanes)!==0,ce||S){if(S=jt,S!==null&&(f=a&-a,f=(f&42)!==0?1:Dc(f),f=(f&(S.suspendedLanes|a))!==0?0:f,f!==0&&f!==k.retryLane))throw k.retryLane=f,Xr(r,f),Qe(S,r,f),dy;T.data===\"$?\"||pd(),l=Qf(r,l,a)}else T.data===\"$?\"?(l.flags|=192,l.child=r.child,l=null):(r=k.treeContext,Yt=yn(T.nextSibling),Re=l,At=!0,rr=null,Tn=!1,r!==null&&(sn[ln++]=zn,sn[ln++]=Bn,sn[ln++]=nr,zn=r.id,Bn=r.overflow,nr=l),l=Ff(l,f.children),l.flags|=4096);return l}return h?(yi(),h=f.fallback,T=l.mode,k=r.child,D=k.sibling,f=Ln(k,{mode:\"hidden\",children:f.children}),f.subtreeFlags=k.subtreeFlags&65011712,D!==null?h=Ln(D,h):(h=er(h,T,a,null),h.flags|=2),h.return=l,f.return=l,f.sibling=h,l.child=f,f=h,h=l.child,T=r.child.memoizedState,T===null?T=Yf(a):(k=T.cachePool,k!==null?(D=se._currentValue,k=k.parent!==D?{parent:D,pool:D}:k):k=og(),T={baseLanes:T.baseLanes|a,cachePool:k}),h.memoizedState=T,h.childLanes=Xf(r,S,a),l.memoizedState=Gf,f):(gi(l),a=r.child,r=a.sibling,a=Ln(a,{mode:\"visible\",children:f.children}),a.return=l,a.sibling=null,r!==null&&(S=l.deletions,S===null?(l.deletions=[r],l.flags|=16):S.push(r)),l.child=a,l.memoizedState=null,a)}function Ff(r,l){return l=Ma({mode:\"visible\",children:l},r.mode),l.return=r,r.child=l}function Ma(r,l){return r=Ke(22,r,null,l),r.lanes=0,r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},r}function Qf(r,l,a){return ss(l,r.child,null,a),r=Ff(l,l.pendingProps.children),r.flags|=2,l.memoizedState=null,r}function Ty(r,l,a){r.lanes|=l;var f=r.alternate;f!==null&&(f.lanes|=l),pf(r.return,l,a)}function Jf(r,l,a,f,h){var g=r.memoizedState;g===null?r.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:f,tail:a,tailMode:h}:(g.isBackwards=l,g.rendering=null,g.renderingStartTime=0,g.last=f,g.tail=a,g.tailMode=h)}function xy(r,l,a){var f=l.pendingProps,h=f.revealOrder,g=f.tail;if(me(r,l,f.children,a),f=le.current,(f&2)!==0)f=f&1|2,l.flags|=128;else{if(r!==null&&(r.flags&128)!==0)t:for(r=l.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&Ty(r,a,l);else if(r.tag===19)Ty(r,a,l);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===l)break t;for(;r.sibling===null;){if(r.return===null||r.return===l)break t;r=r.return}r.sibling.return=r.return,r=r.sibling}f&=1}switch(K(le,f),h){case\"forwards\":for(a=l.child,h=null;a!==null;)r=a.alternate,r!==null&&Sa(r)===null&&(h=a),a=a.sibling;a=h,a===null?(h=l.child,l.child=null):(h=a.sibling,a.sibling=null),Jf(l,!1,h,a,g);break;case\"backwards\":for(a=null,h=l.child,l.child=null;h!==null;){if(r=h.alternate,r!==null&&Sa(r)===null){l.child=h;break}r=h.sibling,h.sibling=a,a=h,h=r}Jf(l,!0,a,null,g);break;case\"together\":Jf(l,!1,null,null,void 0);break;default:l.memoizedState=null}return l.child}function jn(r,l,a){if(r!==null&&(l.dependencies=r.dependencies),Ti|=l.lanes,(a&l.childLanes)===0)if(r!==null){if(ol(r,l,a,!1),(a&l.childLanes)===0)return null}else return null;if(r!==null&&l.child!==r.child)throw Error(i(153));if(l.child!==null){for(r=l.child,a=Ln(r,r.pendingProps),l.child=a,a.return=l;r.sibling!==null;)r=r.sibling,a=a.sibling=Ln(r,r.pendingProps),a.return=l;a.sibling=null}return l.child}function Zf(r,l){return(r.lanes&l)!==0?!0:(r=r.dependencies,!!(r!==null&&ra(r)))}function Gx(r,l,a){switch(l.tag){case 3:Pt(l,l.stateNode.containerInfo),fi(l,se,r.memoizedState.cache),sl();break;case 27:case 5:Ac(l);break;case 4:Pt(l,l.stateNode.containerInfo);break;case 10:fi(l,l.type,l.memoizedProps.value);break;case 13:var f=l.memoizedState;if(f!==null)return f.dehydrated!==null?(gi(l),l.flags|=128,null):(a&l.child.childLanes)!==0?Ey(r,l,a):(gi(l),r=jn(r,l,a),r!==null?r.sibling:null);gi(l);break;case 19:var h=(r.flags&128)!==0;if(f=(a&l.childLanes)!==0,f||(ol(r,l,a,!1),f=(a&l.childLanes)!==0),h){if(f)return xy(r,l,a);l.flags|=128}if(h=l.memoizedState,h!==null&&(h.rendering=null,h.tail=null,h.lastEffect=null),K(le,le.current),f)break;return null;case 22:case 23:return l.lanes=0,gy(r,l,a);case 24:fi(l,se,r.memoizedState.cache)}return jn(r,l,a)}function My(r,l,a){if(r!==null)if(r.memoizedProps!==l.pendingProps)ce=!0;else{if(!Zf(r,a)&&(l.flags&128)===0)return ce=!1,Gx(r,l,a);ce=(r.flags&131072)!==0}else ce=!1,At&&(l.flags&1048576)!==0&&tg(l,ia,l.index);switch(l.lanes=0,l.tag){case 16:t:{r=l.pendingProps;var f=l.elementType,h=f._init;if(f=h(f._payload),l.type=f,typeof f==\"function\")of(f)?(r=cr(f,r),l.tag=1,l=vy(null,l,f,r,a)):(l.tag=0,l=Kf(null,l,f,r,a));else{if(f!=null){if(h=f.$$typeof,h===q){l.tag=11,l=hy(null,l,f,r,a);break t}else if(h===Y){l.tag=14,l=py(null,l,f,r,a);break t}}throw l=Mt(f)||f,Error(i(306,l,\"\"))}}return l;case 0:return Kf(r,l,l.type,l.pendingProps,a);case 1:return f=l.type,h=cr(f,l.pendingProps),vy(r,l,f,h,a);case 3:t:{if(Pt(l,l.stateNode.containerInfo),r===null)throw Error(i(387));f=l.pendingProps;var g=l.memoizedState;h=g.element,Ef(r,l),pl(l,f,null,a);var S=l.memoizedState;if(f=S.cache,fi(l,se,f),f!==g.cache&&mf(l,[se],a,!0),hl(),f=S.element,g.isDehydrated)if(g={element:f,isDehydrated:!1,cache:S.cache},l.updateQueue.baseState=g,l.memoizedState=g,l.flags&256){l=Sy(r,l,f,a);break t}else if(f!==h){h=nn(Error(i(424)),l),ll(h),l=Sy(r,l,f,a);break t}else{switch(r=l.stateNode.containerInfo,r.nodeType){case 9:r=r.body;break;default:r=r.nodeName===\"HTML\"?r.ownerDocument.body:r}for(Yt=yn(r.firstChild),Re=l,At=!0,rr=null,Tn=!0,a=ny(l,null,f,a),l.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling}else{if(sl(),f===h){l=jn(r,l,a);break t}me(r,l,f,a)}l=l.child}return l;case 26:return xa(r,l),r===null?(a=O0(l.type,null,l.pendingProps,null))?l.memoizedState=a:At||(a=l.type,r=l.pendingProps,f=Ua(ut.current).createElement(a),f[Te]=l,f[Be]=r,ye(f,a,r),ue(f),l.stateNode=f):l.memoizedState=O0(l.type,r.memoizedProps,l.pendingProps,r.memoizedState),null;case 27:return Ac(l),r===null&&At&&(f=l.stateNode=k0(l.type,l.pendingProps,ut.current),Re=l,Tn=!0,h=Yt,Ai(l.type)?(Rd=h,Yt=yn(f.firstChild)):Yt=h),me(r,l,l.pendingProps.children,a),xa(r,l),r===null&&(l.flags|=4194304),l.child;case 5:return r===null&&At&&((h=f=Yt)&&(f=SM(f,l.type,l.pendingProps,Tn),f!==null?(l.stateNode=f,Re=l,Yt=yn(f.firstChild),Tn=!1,h=!0):h=!1),h||sr(l)),Ac(l),h=l.type,g=l.pendingProps,S=r!==null?r.memoizedProps:null,f=g.children,Od(h,g)?f=null:S!==null&&Od(h,S)&&(l.flags|=32),l.memoizedState!==null&&(h=Cf(r,l,Ux,null,null,a),Hl._currentValue=h),xa(r,l),me(r,l,f,a),l.child;case 6:return r===null&&At&&((r=a=Yt)&&(a=EM(a,l.pendingProps,Tn),a!==null?(l.stateNode=a,Re=l,Yt=null,r=!0):r=!1),r||sr(l)),null;case 13:return Ey(r,l,a);case 4:return Pt(l,l.stateNode.containerInfo),f=l.pendingProps,r===null?l.child=ss(l,null,f,a):me(r,l,f,a),l.child;case 11:return hy(r,l,l.type,l.pendingProps,a);case 7:return me(r,l,l.pendingProps,a),l.child;case 8:return me(r,l,l.pendingProps.children,a),l.child;case 12:return me(r,l,l.pendingProps.children,a),l.child;case 10:return f=l.pendingProps,fi(l,l.type,f.value),me(r,l,f.children,a),l.child;case 9:return h=l.type._context,f=l.pendingProps.children,or(l),h=xe(h),f=f(h),l.flags|=1,me(r,l,f,a),l.child;case 14:return py(r,l,l.type,l.pendingProps,a);case 15:return my(r,l,l.type,l.pendingProps,a);case 19:return xy(r,l,a);case 31:return f=l.pendingProps,a=l.mode,f={mode:f.mode,children:f.children},r===null?(a=Ma(f,a),a.ref=l.ref,l.child=a,a.return=l,l=a):(a=Ln(r.child,f),a.ref=l.ref,l.child=a,a.return=l,l=a),l;case 22:return gy(r,l,a);case 24:return or(l),f=xe(se),r===null?(h=bf(),h===null&&(h=jt,g=gf(),h.pooledCache=g,g.refCount++,g!==null&&(h.pooledCacheLanes|=a),h=g),l.memoizedState={parent:f,cache:h},Sf(l),fi(l,se,h)):((r.lanes&a)!==0&&(Ef(r,l),pl(l,null,null,a),hl()),h=r.memoizedState,g=l.memoizedState,h.parent!==f?(h={parent:f,cache:f},l.memoizedState=h,l.lanes===0&&(l.memoizedState=l.updateQueue.baseState=h),fi(l,se,f)):(f=g.cache,fi(l,se,f),f!==h.cache&&mf(l,[se],a,!0))),me(r,l,l.pendingProps.children,a),l.child;case 29:throw l.pendingProps}throw Error(i(156,l.tag))}function qn(r){r.flags|=4}function ky(r,l){if(l.type!==\"stylesheet\"||(l.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!L0(l)){if(l=on.current,l!==null&&((Tt&4194048)===Tt?xn!==null:(Tt&62914560)!==Tt&&(Tt&536870912)===0||l!==xn))throw fl=vf,ag;r.flags|=8192}}function ka(r,l){l!==null&&(r.flags|=4),r.flags&16384&&(l=r.tag!==22?im():536870912,r.lanes|=l,cs|=l)}function El(r,l){if(!At)switch(r.tailMode){case\"hidden\":l=r.tail;for(var a=null;l!==null;)l.alternate!==null&&(a=l),l=l.sibling;a===null?r.tail=null:a.sibling=null;break;case\"collapsed\":a=r.tail;for(var f=null;a!==null;)a.alternate!==null&&(f=a),a=a.sibling;f===null?l||r.tail===null?r.tail=null:r.tail.sibling=null:f.sibling=null}}function Gt(r){var l=r.alternate!==null&&r.alternate.child===r.child,a=0,f=0;if(l)for(var h=r.child;h!==null;)a|=h.lanes|h.childLanes,f|=h.subtreeFlags&65011712,f|=h.flags&65011712,h.return=r,h=h.sibling;else for(h=r.child;h!==null;)a|=h.lanes|h.childLanes,f|=h.subtreeFlags,f|=h.flags,h.return=r,h=h.sibling;return r.subtreeFlags|=f,r.childLanes=a,l}function Yx(r,l,a){var f=l.pendingProps;switch(ff(l),l.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Gt(l),null;case 1:return Gt(l),null;case 3:return a=l.stateNode,f=null,r!==null&&(f=r.memoizedState.cache),l.memoizedState.cache!==f&&(l.flags|=2048),_n(se),oi(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(r===null||r.child===null)&&(rl(l)?qn(l):r===null||r.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,ig())),Gt(l),null;case 26:return a=l.memoizedState,r===null?(qn(l),a!==null?(Gt(l),ky(l,a)):(Gt(l),l.flags&=-16777217)):a?a!==r.memoizedState?(qn(l),Gt(l),ky(l,a)):(Gt(l),l.flags&=-16777217):(r.memoizedProps!==f&&qn(l),Gt(l),l.flags&=-16777217),null;case 27:Ho(l),a=ut.current;var h=l.type;if(r!==null&&l.stateNode!=null)r.memoizedProps!==f&&qn(l);else{if(!f){if(l.stateNode===null)throw Error(i(166));return Gt(l),null}r=W.current,rl(l)?eg(l):(r=k0(h,f,a),l.stateNode=r,qn(l))}return Gt(l),null;case 5:if(Ho(l),a=l.type,r!==null&&l.stateNode!=null)r.memoizedProps!==f&&qn(l);else{if(!f){if(l.stateNode===null)throw Error(i(166));return Gt(l),null}if(r=W.current,rl(l))eg(l);else{switch(h=Ua(ut.current),r){case 1:r=h.createElementNS(\"http://www.w3.org/2000/svg\",a);break;case 2:r=h.createElementNS(\"http://www.w3.org/1998/Math/MathML\",a);break;default:switch(a){case\"svg\":r=h.createElementNS(\"http://www.w3.org/2000/svg\",a);break;case\"math\":r=h.createElementNS(\"http://www.w3.org/1998/Math/MathML\",a);break;case\"script\":r=h.createElement(\"div\"),r.innerHTML=\"<script><\\/script>\",r=r.removeChild(r.firstChild);break;case\"select\":r=typeof f.is==\"string\"?h.createElement(\"select\",{is:f.is}):h.createElement(\"select\"),f.multiple?r.multiple=!0:f.size&&(r.size=f.size);break;default:r=typeof f.is==\"string\"?h.createElement(a,{is:f.is}):h.createElement(a)}}r[Te]=l,r[Be]=f;t:for(h=l.child;h!==null;){if(h.tag===5||h.tag===6)r.appendChild(h.stateNode);else if(h.tag!==4&&h.tag!==27&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===l)break t;for(;h.sibling===null;){if(h.return===null||h.return===l)break t;h=h.return}h.sibling.return=h.return,h=h.sibling}l.stateNode=r;t:switch(ye(r,a,f),a){case\"button\":case\"input\":case\"select\":case\"textarea\":r=!!f.autoFocus;break t;case\"img\":r=!0;break t;default:r=!1}r&&qn(l)}}return Gt(l),l.flags&=-16777217,null;case 6:if(r&&l.stateNode!=null)r.memoizedProps!==f&&qn(l);else{if(typeof f!=\"string\"&&l.stateNode===null)throw Error(i(166));if(r=ut.current,rl(l)){if(r=l.stateNode,a=l.memoizedProps,f=null,h=Re,h!==null)switch(h.tag){case 27:case 5:f=h.memoizedProps}r[Te]=l,r=!!(r.nodeValue===a||f!==null&&f.suppressHydrationWarning===!0||b0(r.nodeValue,a)),r||sr(l)}else r=Ua(r).createTextNode(f),r[Te]=l,l.stateNode=r}return Gt(l),null;case 13:if(f=l.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(h=rl(l),f!==null&&f.dehydrated!==null){if(r===null){if(!h)throw Error(i(318));if(h=l.memoizedState,h=h!==null?h.dehydrated:null,!h)throw Error(i(317));h[Te]=l}else sl(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Gt(l),h=!1}else h=ig(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=h),h=!0;if(!h)return l.flags&256?(In(l),l):(In(l),null)}if(In(l),(l.flags&128)!==0)return l.lanes=a,l;if(a=f!==null,r=r!==null&&r.memoizedState!==null,a){f=l.child,h=null,f.alternate!==null&&f.alternate.memoizedState!==null&&f.alternate.memoizedState.cachePool!==null&&(h=f.alternate.memoizedState.cachePool.pool);var g=null;f.memoizedState!==null&&f.memoizedState.cachePool!==null&&(g=f.memoizedState.cachePool.pool),g!==h&&(f.flags|=2048)}return a!==r&&a&&(l.child.flags|=8192),ka(l,l.updateQueue),Gt(l),null;case 4:return oi(),r===null&&xd(l.stateNode.containerInfo),Gt(l),null;case 10:return _n(l.type),Gt(l),null;case 19:if(F(le),h=l.memoizedState,h===null)return Gt(l),null;if(f=(l.flags&128)!==0,g=h.rendering,g===null)if(f)El(h,!1);else{if(Xt!==0||r!==null&&(r.flags&128)!==0)for(r=l.child;r!==null;){if(g=Sa(r),g!==null){for(l.flags|=128,El(h,!1),r=g.updateQueue,l.updateQueue=r,ka(l,r),l.subtreeFlags=0,r=a,a=l.child;a!==null;)Wm(a,r),a=a.sibling;return K(le,le.current&1|2),l.child}r=r.sibling}h.tail!==null&&En()>Oa&&(l.flags|=128,f=!0,El(h,!1),l.lanes=4194304)}else{if(!f)if(r=Sa(g),r!==null){if(l.flags|=128,f=!0,r=r.updateQueue,l.updateQueue=r,ka(l,r),El(h,!0),h.tail===null&&h.tailMode===\"hidden\"&&!g.alternate&&!At)return Gt(l),null}else 2*En()-h.renderingStartTime>Oa&&a!==536870912&&(l.flags|=128,f=!0,El(h,!1),l.lanes=4194304);h.isBackwards?(g.sibling=l.child,l.child=g):(r=h.last,r!==null?r.sibling=g:l.child=g,h.last=g)}return h.tail!==null?(l=h.tail,h.rendering=l,h.tail=l.sibling,h.renderingStartTime=En(),l.sibling=null,r=le.current,K(le,f?r&1|2:r&1),l):(Gt(l),null);case 22:case 23:return In(l),kf(),f=l.memoizedState!==null,r!==null?r.memoizedState!==null!==f&&(l.flags|=8192):f&&(l.flags|=8192),f?(a&536870912)!==0&&(l.flags&128)===0&&(Gt(l),l.subtreeFlags&6&&(l.flags|=8192)):Gt(l),a=l.updateQueue,a!==null&&ka(l,a.retryQueue),a=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(a=r.memoizedState.cachePool.pool),f=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(f=l.memoizedState.cachePool.pool),f!==a&&(l.flags|=2048),r!==null&&F(ar),null;case 24:return a=null,r!==null&&(a=r.memoizedState.cache),l.memoizedState.cache!==a&&(l.flags|=2048),_n(se),Gt(l),null;case 25:return null;case 30:return null}throw Error(i(156,l.tag))}function Xx(r,l){switch(ff(l),l.tag){case 1:return r=l.flags,r&65536?(l.flags=r&-65537|128,l):null;case 3:return _n(se),oi(),r=l.flags,(r&65536)!==0&&(r&128)===0?(l.flags=r&-65537|128,l):null;case 26:case 27:case 5:return Ho(l),null;case 13:if(In(l),r=l.memoizedState,r!==null&&r.dehydrated!==null){if(l.alternate===null)throw Error(i(340));sl()}return r=l.flags,r&65536?(l.flags=r&-65537|128,l):null;case 19:return F(le),null;case 4:return oi(),null;case 10:return _n(l.type),null;case 22:case 23:return In(l),kf(),r!==null&&F(ar),r=l.flags,r&65536?(l.flags=r&-65537|128,l):null;case 24:return _n(se),null;case 25:return null;default:return null}}function Ay(r,l){switch(ff(l),l.tag){case 3:_n(se),oi();break;case 26:case 27:case 5:Ho(l);break;case 4:oi();break;case 13:In(l);break;case 19:F(le);break;case 10:_n(l.type);break;case 22:case 23:In(l),kf(),r!==null&&F(ar);break;case 24:_n(se)}}function Tl(r,l){try{var a=l.updateQueue,f=a!==null?a.lastEffect:null;if(f!==null){var h=f.next;a=h;do{if((a.tag&r)===r){f=void 0;var g=a.create,S=a.inst;f=g(),S.destroy=f}a=a.next}while(a!==h)}}catch(T){_t(l,l.return,T)}}function bi(r,l,a){try{var f=l.updateQueue,h=f!==null?f.lastEffect:null;if(h!==null){var g=h.next;f=g;do{if((f.tag&r)===r){var S=f.inst,T=S.destroy;if(T!==void 0){S.destroy=void 0,h=l;var k=a,D=T;try{D()}catch(H){_t(h,k,H)}}}f=f.next}while(f!==g)}}catch(H){_t(l,l.return,H)}}function Cy(r){var l=r.updateQueue;if(l!==null){var a=r.stateNode;try{pg(l,a)}catch(f){_t(r,r.return,f)}}}function Oy(r,l,a){a.props=cr(r.type,r.memoizedProps),a.state=r.memoizedState;try{a.componentWillUnmount()}catch(f){_t(r,l,f)}}function xl(r,l){try{var a=r.ref;if(a!==null){switch(r.tag){case 26:case 27:case 5:var f=r.stateNode;break;case 30:f=r.stateNode;break;default:f=r.stateNode}typeof a==\"function\"?r.refCleanup=a(f):a.current=f}}catch(h){_t(r,l,h)}}function Mn(r,l){var a=r.ref,f=r.refCleanup;if(a!==null)if(typeof f==\"function\")try{f()}catch(h){_t(r,l,h)}finally{r.refCleanup=null,r=r.alternate,r!=null&&(r.refCleanup=null)}else if(typeof a==\"function\")try{a(null)}catch(h){_t(r,l,h)}else a.current=null}function wy(r){var l=r.type,a=r.memoizedProps,f=r.stateNode;try{t:switch(l){case\"button\":case\"input\":case\"select\":case\"textarea\":a.autoFocus&&f.focus();break t;case\"img\":a.src?f.src=a.src:a.srcSet&&(f.srcset=a.srcSet)}}catch(h){_t(r,r.return,h)}}function Wf(r,l,a){try{var f=r.stateNode;mM(f,r.type,a,l),f[Be]=l}catch(h){_t(r,r.return,h)}}function Ny(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&Ai(r.type)||r.tag===4}function td(r){t:for(;;){for(;r.sibling===null;){if(r.return===null||Ny(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.tag===27&&Ai(r.type)||r.flags&2||r.child===null||r.tag===4)continue t;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function ed(r,l,a){var f=r.tag;if(f===5||f===6)r=r.stateNode,l?(a.nodeType===9?a.body:a.nodeName===\"HTML\"?a.ownerDocument.body:a).insertBefore(r,l):(l=a.nodeType===9?a.body:a.nodeName===\"HTML\"?a.ownerDocument.body:a,l.appendChild(r),a=a._reactRootContainer,a!=null||l.onclick!==null||(l.onclick=_a));else if(f!==4&&(f===27&&Ai(r.type)&&(a=r.stateNode,l=null),r=r.child,r!==null))for(ed(r,l,a),r=r.sibling;r!==null;)ed(r,l,a),r=r.sibling}function Aa(r,l,a){var f=r.tag;if(f===5||f===6)r=r.stateNode,l?a.insertBefore(r,l):a.appendChild(r);else if(f!==4&&(f===27&&Ai(r.type)&&(a=r.stateNode),r=r.child,r!==null))for(Aa(r,l,a),r=r.sibling;r!==null;)Aa(r,l,a),r=r.sibling}function Dy(r){var l=r.stateNode,a=r.memoizedProps;try{for(var f=r.type,h=l.attributes;h.length;)l.removeAttributeNode(h[0]);ye(l,f,a),l[Te]=r,l[Be]=a}catch(g){_t(r,r.return,g)}}var Vn=!1,te=!1,nd=!1,Ry=typeof WeakSet==\"function\"?WeakSet:Set,fe=null;function Fx(r,l){if(r=r.containerInfo,Ad=Pa,r=$m(r),Wc(r)){if(\"selectionStart\"in r)var a={start:r.selectionStart,end:r.selectionEnd};else t:{a=(a=r.ownerDocument)&&a.defaultView||window;var f=a.getSelection&&a.getSelection();if(f&&f.rangeCount!==0){a=f.anchorNode;var h=f.anchorOffset,g=f.focusNode;f=f.focusOffset;try{a.nodeType,g.nodeType}catch{a=null;break t}var S=0,T=-1,k=-1,D=0,H=0,U=r,R=null;e:for(;;){for(var L;U!==a||h!==0&&U.nodeType!==3||(T=S+h),U!==g||f!==0&&U.nodeType!==3||(k=S+f),U.nodeType===3&&(S+=U.nodeValue.length),(L=U.firstChild)!==null;)R=U,U=L;for(;;){if(U===r)break e;if(R===a&&++D===h&&(T=S),R===g&&++H===f&&(k=S),(L=U.nextSibling)!==null)break;U=R,R=U.parentNode}U=L}a=T===-1||k===-1?null:{start:T,end:k}}else a=null}a=a||{start:0,end:0}}else a=null;for(Cd={focusedElem:r,selectionRange:a},Pa=!1,fe=l;fe!==null;)if(l=fe,r=l.child,(l.subtreeFlags&1024)!==0&&r!==null)r.return=l,fe=r;else for(;fe!==null;){switch(l=fe,g=l.alternate,r=l.flags,l.tag){case 0:break;case 11:case 15:break;case 1:if((r&1024)!==0&&g!==null){r=void 0,a=l,h=g.memoizedProps,g=g.memoizedState,f=a.stateNode;try{var at=cr(a.type,h,a.elementType===a.type);r=f.getSnapshotBeforeUpdate(at,g),f.__reactInternalSnapshotBeforeUpdate=r}catch(st){_t(a,a.return,st)}}break;case 3:if((r&1024)!==0){if(r=l.stateNode.containerInfo,a=r.nodeType,a===9)Nd(r);else if(a===1)switch(r.nodeName){case\"HEAD\":case\"HTML\":case\"BODY\":Nd(r);break;default:r.textContent=\"\"}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((r&1024)!==0)throw Error(i(163))}if(r=l.sibling,r!==null){r.return=l.return,fe=r;break}fe=l.return}}function Ly(r,l,a){var f=a.flags;switch(a.tag){case 0:case 11:case 15:vi(r,a),f&4&&Tl(5,a);break;case 1:if(vi(r,a),f&4)if(r=a.stateNode,l===null)try{r.componentDidMount()}catch(S){_t(a,a.return,S)}else{var h=cr(a.type,l.memoizedProps);l=l.memoizedState;try{r.componentDidUpdate(h,l,r.__reactInternalSnapshotBeforeUpdate)}catch(S){_t(a,a.return,S)}}f&64&&Cy(a),f&512&&xl(a,a.return);break;case 3:if(vi(r,a),f&64&&(r=a.updateQueue,r!==null)){if(l=null,a.child!==null)switch(a.child.tag){case 27:case 5:l=a.child.stateNode;break;case 1:l=a.child.stateNode}try{pg(r,l)}catch(S){_t(a,a.return,S)}}break;case 27:l===null&&f&4&&Dy(a);case 26:case 5:vi(r,a),l===null&&f&4&&wy(a),f&512&&xl(a,a.return);break;case 12:vi(r,a);break;case 13:vi(r,a),f&4&&Hy(r,a),f&64&&(r=a.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(a=rM.bind(null,a),TM(r,a))));break;case 22:if(f=a.memoizedState!==null||Vn,!f){l=l!==null&&l.memoizedState!==null||te,h=Vn;var g=te;Vn=f,(te=l)&&!g?Si(r,a,(a.subtreeFlags&8772)!==0):vi(r,a),Vn=h,te=g}break;case 30:break;default:vi(r,a)}}function zy(r){var l=r.alternate;l!==null&&(r.alternate=null,zy(l)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(l=r.stateNode,l!==null&&zc(l)),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}var Kt=null,Ue=!1;function $n(r,l,a){for(a=a.child;a!==null;)By(r,l,a),a=a.sibling}function By(r,l,a){if(Ve&&typeof Ve.onCommitFiberUnmount==\"function\")try{Ve.onCommitFiberUnmount(Ps,a)}catch{}switch(a.tag){case 26:te||Mn(a,l),$n(r,l,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:te||Mn(a,l);var f=Kt,h=Ue;Ai(a.type)&&(Kt=a.stateNode,Ue=!1),$n(r,l,a),Rl(a.stateNode),Kt=f,Ue=h;break;case 5:te||Mn(a,l);case 6:if(f=Kt,h=Ue,Kt=null,$n(r,l,a),Kt=f,Ue=h,Kt!==null)if(Ue)try{(Kt.nodeType===9?Kt.body:Kt.nodeName===\"HTML\"?Kt.ownerDocument.body:Kt).removeChild(a.stateNode)}catch(g){_t(a,l,g)}else try{Kt.removeChild(a.stateNode)}catch(g){_t(a,l,g)}break;case 18:Kt!==null&&(Ue?(r=Kt,x0(r.nodeType===9?r.body:r.nodeName===\"HTML\"?r.ownerDocument.body:r,a.stateNode),jl(r)):x0(Kt,a.stateNode));break;case 4:f=Kt,h=Ue,Kt=a.stateNode.containerInfo,Ue=!0,$n(r,l,a),Kt=f,Ue=h;break;case 0:case 11:case 14:case 15:te||bi(2,a,l),te||bi(4,a,l),$n(r,l,a);break;case 1:te||(Mn(a,l),f=a.stateNode,typeof f.componentWillUnmount==\"function\"&&Oy(a,l,f)),$n(r,l,a);break;case 21:$n(r,l,a);break;case 22:te=(f=te)||a.memoizedState!==null,$n(r,l,a),te=f;break;default:$n(r,l,a)}}function Hy(r,l){if(l.memoizedState===null&&(r=l.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{jl(r)}catch(a){_t(l,l.return,a)}}function Qx(r){switch(r.tag){case 13:case 19:var l=r.stateNode;return l===null&&(l=r.stateNode=new Ry),l;case 22:return r=r.stateNode,l=r._retryCache,l===null&&(l=r._retryCache=new Ry),l;default:throw Error(i(435,r.tag))}}function id(r,l){var a=Qx(r);l.forEach(function(f){var h=sM.bind(null,r,f);a.has(f)||(a.add(f),f.then(h,h))})}function Ge(r,l){var a=l.deletions;if(a!==null)for(var f=0;f<a.length;f++){var h=a[f],g=r,S=l,T=S;t:for(;T!==null;){switch(T.tag){case 27:if(Ai(T.type)){Kt=T.stateNode,Ue=!1;break t}break;case 5:Kt=T.stateNode,Ue=!1;break t;case 3:case 4:Kt=T.stateNode.containerInfo,Ue=!0;break t}T=T.return}if(Kt===null)throw Error(i(160));By(g,S,h),Kt=null,Ue=!1,g=h.alternate,g!==null&&(g.return=null),h.return=null}if(l.subtreeFlags&13878)for(l=l.child;l!==null;)_y(l,r),l=l.sibling}var gn=null;function _y(r,l){var a=r.alternate,f=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:Ge(l,r),Ye(r),f&4&&(bi(3,r,r.return),Tl(3,r),bi(5,r,r.return));break;case 1:Ge(l,r),Ye(r),f&512&&(te||a===null||Mn(a,a.return)),f&64&&Vn&&(r=r.updateQueue,r!==null&&(f=r.callbacks,f!==null&&(a=r.shared.hiddenCallbacks,r.shared.hiddenCallbacks=a===null?f:a.concat(f))));break;case 26:var h=gn;if(Ge(l,r),Ye(r),f&512&&(te||a===null||Mn(a,a.return)),f&4){var g=a!==null?a.memoizedState:null;if(f=r.memoizedState,a===null)if(f===null)if(r.stateNode===null){t:{f=r.type,a=r.memoizedProps,h=h.ownerDocument||h;e:switch(f){case\"title\":g=h.getElementsByTagName(\"title\")[0],(!g||g[Ys]||g[Te]||g.namespaceURI===\"http://www.w3.org/2000/svg\"||g.hasAttribute(\"itemprop\"))&&(g=h.createElement(f),h.head.insertBefore(g,h.querySelector(\"head > title\"))),ye(g,f,a),g[Te]=r,ue(g),f=g;break t;case\"link\":var S=D0(\"link\",\"href\",h).get(f+(a.href||\"\"));if(S){for(var T=0;T<S.length;T++)if(g=S[T],g.getAttribute(\"href\")===(a.href==null||a.href===\"\"?null:a.href)&&g.getAttribute(\"rel\")===(a.rel==null?null:a.rel)&&g.getAttribute(\"title\")===(a.title==null?null:a.title)&&g.getAttribute(\"crossorigin\")===(a.crossOrigin==null?null:a.crossOrigin)){S.splice(T,1);break e}}g=h.createElement(f),ye(g,f,a),h.head.appendChild(g);break;case\"meta\":if(S=D0(\"meta\",\"content\",h).get(f+(a.content||\"\"))){for(T=0;T<S.length;T++)if(g=S[T],g.getAttribute(\"content\")===(a.content==null?null:\"\"+a.content)&&g.getAttribute(\"name\")===(a.name==null?null:a.name)&&g.getAttribute(\"property\")===(a.property==null?null:a.property)&&g.getAttribute(\"http-equiv\")===(a.httpEquiv==null?null:a.httpEquiv)&&g.getAttribute(\"charset\")===(a.charSet==null?null:a.charSet)){S.splice(T,1);break e}}g=h.createElement(f),ye(g,f,a),h.head.appendChild(g);break;default:throw Error(i(468,f))}g[Te]=r,ue(g),f=g}r.stateNode=f}else R0(h,r.type,r.stateNode);else r.stateNode=N0(h,f,r.memoizedProps);else g!==f?(g===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):g.count--,f===null?R0(h,r.type,r.stateNode):N0(h,f,r.memoizedProps)):f===null&&r.stateNode!==null&&Wf(r,r.memoizedProps,a.memoizedProps)}break;case 27:Ge(l,r),Ye(r),f&512&&(te||a===null||Mn(a,a.return)),a!==null&&f&4&&Wf(r,r.memoizedProps,a.memoizedProps);break;case 5:if(Ge(l,r),Ye(r),f&512&&(te||a===null||Mn(a,a.return)),r.flags&32){h=r.stateNode;try{qr(h,\"\")}catch(L){_t(r,r.return,L)}}f&4&&r.stateNode!=null&&(h=r.memoizedProps,Wf(r,h,a!==null?a.memoizedProps:h)),f&1024&&(nd=!0);break;case 6:if(Ge(l,r),Ye(r),f&4){if(r.stateNode===null)throw Error(i(162));f=r.memoizedProps,a=r.stateNode;try{a.nodeValue=f}catch(L){_t(r,r.return,L)}}break;case 3:if(qa=null,h=gn,gn=Ia(l.containerInfo),Ge(l,r),gn=h,Ye(r),f&4&&a!==null&&a.memoizedState.isDehydrated)try{jl(l.containerInfo)}catch(L){_t(r,r.return,L)}nd&&(nd=!1,Uy(r));break;case 4:f=gn,gn=Ia(r.stateNode.containerInfo),Ge(l,r),Ye(r),gn=f;break;case 12:Ge(l,r),Ye(r);break;case 13:Ge(l,r),Ye(r),r.child.flags&8192&&r.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(ud=En()),f&4&&(f=r.updateQueue,f!==null&&(r.updateQueue=null,id(r,f)));break;case 22:h=r.memoizedState!==null;var k=a!==null&&a.memoizedState!==null,D=Vn,H=te;if(Vn=D||h,te=H||k,Ge(l,r),te=H,Vn=D,Ye(r),f&8192)t:for(l=r.stateNode,l._visibility=h?l._visibility&-2:l._visibility|1,h&&(a===null||k||Vn||te||fr(r)),a=null,l=r;;){if(l.tag===5||l.tag===26){if(a===null){k=a=l;try{if(g=k.stateNode,h)S=g.style,typeof S.setProperty==\"function\"?S.setProperty(\"display\",\"none\",\"important\"):S.display=\"none\";else{T=k.stateNode;var U=k.memoizedProps.style,R=U!=null&&U.hasOwnProperty(\"display\")?U.display:null;T.style.display=R==null||typeof R==\"boolean\"?\"\":(\"\"+R).trim()}}catch(L){_t(k,k.return,L)}}}else if(l.tag===6){if(a===null){k=l;try{k.stateNode.nodeValue=h?\"\":k.memoizedProps}catch(L){_t(k,k.return,L)}}}else if((l.tag!==22&&l.tag!==23||l.memoizedState===null||l===r)&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===r)break t;for(;l.sibling===null;){if(l.return===null||l.return===r)break t;a===l&&(a=null),l=l.return}a===l&&(a=null),l.sibling.return=l.return,l=l.sibling}f&4&&(f=r.updateQueue,f!==null&&(a=f.retryQueue,a!==null&&(f.retryQueue=null,id(r,a))));break;case 19:Ge(l,r),Ye(r),f&4&&(f=r.updateQueue,f!==null&&(r.updateQueue=null,id(r,f)));break;case 30:break;case 21:break;default:Ge(l,r),Ye(r)}}function Ye(r){var l=r.flags;if(l&2){try{for(var a,f=r.return;f!==null;){if(Ny(f)){a=f;break}f=f.return}if(a==null)throw Error(i(160));switch(a.tag){case 27:var h=a.stateNode,g=td(r);Aa(r,g,h);break;case 5:var S=a.stateNode;a.flags&32&&(qr(S,\"\"),a.flags&=-33);var T=td(r);Aa(r,T,S);break;case 3:case 4:var k=a.stateNode.containerInfo,D=td(r);ed(r,D,k);break;default:throw Error(i(161))}}catch(H){_t(r,r.return,H)}r.flags&=-3}l&4096&&(r.flags&=-4097)}function Uy(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var l=r;Uy(l),l.tag===5&&l.flags&1024&&l.stateNode.reset(),r=r.sibling}}function vi(r,l){if(l.subtreeFlags&8772)for(l=l.child;l!==null;)Ly(r,l.alternate,l),l=l.sibling}function fr(r){for(r=r.child;r!==null;){var l=r;switch(l.tag){case 0:case 11:case 14:case 15:bi(4,l,l.return),fr(l);break;case 1:Mn(l,l.return);var a=l.stateNode;typeof a.componentWillUnmount==\"function\"&&Oy(l,l.return,a),fr(l);break;case 27:Rl(l.stateNode);case 26:case 5:Mn(l,l.return),fr(l);break;case 22:l.memoizedState===null&&fr(l);break;case 30:fr(l);break;default:fr(l)}r=r.sibling}}function Si(r,l,a){for(a=a&&(l.subtreeFlags&8772)!==0,l=l.child;l!==null;){var f=l.alternate,h=r,g=l,S=g.flags;switch(g.tag){case 0:case 11:case 15:Si(h,g,a),Tl(4,g);break;case 1:if(Si(h,g,a),f=g,h=f.stateNode,typeof h.componentDidMount==\"function\")try{h.componentDidMount()}catch(D){_t(f,f.return,D)}if(f=g,h=f.updateQueue,h!==null){var T=f.stateNode;try{var k=h.shared.hiddenCallbacks;if(k!==null)for(h.shared.hiddenCallbacks=null,h=0;h<k.length;h++)hg(k[h],T)}catch(D){_t(f,f.return,D)}}a&&S&64&&Cy(g),xl(g,g.return);break;case 27:Dy(g);case 26:case 5:Si(h,g,a),a&&f===null&&S&4&&wy(g),xl(g,g.return);break;case 12:Si(h,g,a);break;case 13:Si(h,g,a),a&&S&4&&Hy(h,g);break;case 22:g.memoizedState===null&&Si(h,g,a),xl(g,g.return);break;case 30:break;default:Si(h,g,a)}l=l.sibling}}function rd(r,l){var a=null;r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(a=r.memoizedState.cachePool.pool),r=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(r=l.memoizedState.cachePool.pool),r!==a&&(r!=null&&r.refCount++,a!=null&&al(a))}function sd(r,l){r=null,l.alternate!==null&&(r=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==r&&(l.refCount++,r!=null&&al(r))}function kn(r,l,a,f){if(l.subtreeFlags&10256)for(l=l.child;l!==null;)Iy(r,l,a,f),l=l.sibling}function Iy(r,l,a,f){var h=l.flags;switch(l.tag){case 0:case 11:case 15:kn(r,l,a,f),h&2048&&Tl(9,l);break;case 1:kn(r,l,a,f);break;case 3:kn(r,l,a,f),h&2048&&(r=null,l.alternate!==null&&(r=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==r&&(l.refCount++,r!=null&&al(r)));break;case 12:if(h&2048){kn(r,l,a,f),r=l.stateNode;try{var g=l.memoizedProps,S=g.id,T=g.onPostCommit;typeof T==\"function\"&&T(S,l.alternate===null?\"mount\":\"update\",r.passiveEffectDuration,-0)}catch(k){_t(l,l.return,k)}}else kn(r,l,a,f);break;case 13:kn(r,l,a,f);break;case 23:break;case 22:g=l.stateNode,S=l.alternate,l.memoizedState!==null?g._visibility&2?kn(r,l,a,f):Ml(r,l):g._visibility&2?kn(r,l,a,f):(g._visibility|=2,ls(r,l,a,f,(l.subtreeFlags&10256)!==0)),h&2048&&rd(S,l);break;case 24:kn(r,l,a,f),h&2048&&sd(l.alternate,l);break;default:kn(r,l,a,f)}}function ls(r,l,a,f,h){for(h=h&&(l.subtreeFlags&10256)!==0,l=l.child;l!==null;){var g=r,S=l,T=a,k=f,D=S.flags;switch(S.tag){case 0:case 11:case 15:ls(g,S,T,k,h),Tl(8,S);break;case 23:break;case 22:var H=S.stateNode;S.memoizedState!==null?H._visibility&2?ls(g,S,T,k,h):Ml(g,S):(H._visibility|=2,ls(g,S,T,k,h)),h&&D&2048&&rd(S.alternate,S);break;case 24:ls(g,S,T,k,h),h&&D&2048&&sd(S.alternate,S);break;default:ls(g,S,T,k,h)}l=l.sibling}}function Ml(r,l){if(l.subtreeFlags&10256)for(l=l.child;l!==null;){var a=r,f=l,h=f.flags;switch(f.tag){case 22:Ml(a,f),h&2048&&rd(f.alternate,f);break;case 24:Ml(a,f),h&2048&&sd(f.alternate,f);break;default:Ml(a,f)}l=l.sibling}}var kl=8192;function as(r){if(r.subtreeFlags&kl)for(r=r.child;r!==null;)jy(r),r=r.sibling}function jy(r){switch(r.tag){case 26:as(r),r.flags&kl&&r.memoizedState!==null&&BM(gn,r.memoizedState,r.memoizedProps);break;case 5:as(r);break;case 3:case 4:var l=gn;gn=Ia(r.stateNode.containerInfo),as(r),gn=l;break;case 22:r.memoizedState===null&&(l=r.alternate,l!==null&&l.memoizedState!==null?(l=kl,kl=16777216,as(r),kl=l):as(r));break;default:as(r)}}function qy(r){var l=r.alternate;if(l!==null&&(r=l.child,r!==null)){l.child=null;do l=r.sibling,r.sibling=null,r=l;while(r!==null)}}function Al(r){var l=r.deletions;if((r.flags&16)!==0){if(l!==null)for(var a=0;a<l.length;a++){var f=l[a];fe=f,$y(f,r)}qy(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)Vy(r),r=r.sibling}function Vy(r){switch(r.tag){case 0:case 11:case 15:Al(r),r.flags&2048&&bi(9,r,r.return);break;case 3:Al(r);break;case 12:Al(r);break;case 22:var l=r.stateNode;r.memoizedState!==null&&l._visibility&2&&(r.return===null||r.return.tag!==13)?(l._visibility&=-3,Ca(r)):Al(r);break;default:Al(r)}}function Ca(r){var l=r.deletions;if((r.flags&16)!==0){if(l!==null)for(var a=0;a<l.length;a++){var f=l[a];fe=f,$y(f,r)}qy(r)}for(r=r.child;r!==null;){switch(l=r,l.tag){case 0:case 11:case 15:bi(8,l,l.return),Ca(l);break;case 22:a=l.stateNode,a._visibility&2&&(a._visibility&=-3,Ca(l));break;default:Ca(l)}r=r.sibling}}function $y(r,l){for(;fe!==null;){var a=fe;switch(a.tag){case 0:case 11:case 15:bi(8,a,l);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var f=a.memoizedState.cachePool.pool;f!=null&&f.refCount++}break;case 24:al(a.memoizedState.cache)}if(f=a.child,f!==null)f.return=a,fe=f;else t:for(a=r;fe!==null;){f=fe;var h=f.sibling,g=f.return;if(zy(f),f===a){fe=null;break t}if(h!==null){h.return=g,fe=h;break t}fe=g}}}var Jx={getCacheForType:function(r){var l=xe(se),a=l.data.get(r);return a===void 0&&(a=r(),l.data.set(r,a)),a}},Zx=typeof WeakMap==\"function\"?WeakMap:Map,wt=0,jt=null,yt=null,Tt=0,Nt=0,Xe=null,Ei=!1,us=!1,ld=!1,Pn=0,Xt=0,Ti=0,dr=0,od=0,an=0,cs=0,Cl=null,Ie=null,ad=!1,ud=0,Oa=1/0,wa=null,xi=null,ge=0,Mi=null,fs=null,ds=0,cd=0,fd=null,Py=null,Ol=0,dd=null;function Fe(){if((wt&2)!==0&&Tt!==0)return Tt&-Tt;if(z.T!==null){var r=Zr;return r!==0?r:vd()}return lm()}function Ky(){an===0&&(an=(Tt&536870912)===0||At?nm():536870912);var r=on.current;return r!==null&&(r.flags|=32),an}function Qe(r,l,a){(r===jt&&(Nt===2||Nt===9)||r.cancelPendingCommit!==null)&&(hs(r,0),ki(r,Tt,an,!1)),Gs(r,a),((wt&2)===0||r!==jt)&&(r===jt&&((wt&2)===0&&(dr|=a),Xt===4&&ki(r,Tt,an,!1)),An(r))}function Gy(r,l,a){if((wt&6)!==0)throw Error(i(327));var f=!a&&(l&124)===0&&(l&r.expiredLanes)===0||Ks(r,l),h=f?eM(r,l):md(r,l,!0),g=f;do{if(h===0){us&&!f&&ki(r,l,0,!1);break}else{if(a=r.current.alternate,g&&!Wx(a)){h=md(r,l,!1),g=!1;continue}if(h===2){if(g=l,r.errorRecoveryDisabledLanes&g)var S=0;else S=r.pendingLanes&-536870913,S=S!==0?S:S&536870912?536870912:0;if(S!==0){l=S;t:{var T=r;h=Cl;var k=T.current.memoizedState.isDehydrated;if(k&&(hs(T,S).flags|=256),S=md(T,S,!1),S!==2){if(ld&&!k){T.errorRecoveryDisabledLanes|=g,dr|=g,h=4;break t}g=Ie,Ie=h,g!==null&&(Ie===null?Ie=g:Ie.push.apply(Ie,g))}h=S}if(g=!1,h!==2)continue}}if(h===1){hs(r,0),ki(r,l,0,!0);break}t:{switch(f=r,g=h,g){case 0:case 1:throw Error(i(345));case 4:if((l&4194048)!==l)break;case 6:ki(f,l,an,!Ei);break t;case 2:Ie=null;break;case 3:case 5:break;default:throw Error(i(329))}if((l&62914560)===l&&(h=ud+300-En(),10<h)){if(ki(f,l,an,!Ei),jo(f,0,!0)!==0)break t;f.timeoutHandle=E0(Yy.bind(null,f,a,Ie,wa,ad,l,an,dr,cs,Ei,g,2,-0,0),h);break t}Yy(f,a,Ie,wa,ad,l,an,dr,cs,Ei,g,0,-0,0)}}break}while(!0);An(r)}function Yy(r,l,a,f,h,g,S,T,k,D,H,U,R,L){if(r.timeoutHandle=-1,U=l.subtreeFlags,(U&8192||(U&16785408)===16785408)&&(Bl={stylesheets:null,count:0,unsuspend:zM},jy(l),U=HM(),U!==null)){r.cancelPendingCommit=U(t0.bind(null,r,l,g,a,f,h,S,T,k,H,1,R,L)),ki(r,g,S,!D);return}t0(r,l,g,a,f,h,S,T,k)}function Wx(r){for(var l=r;;){var a=l.tag;if((a===0||a===11||a===15)&&l.flags&16384&&(a=l.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var f=0;f<a.length;f++){var h=a[f],g=h.getSnapshot;h=h.value;try{if(!Pe(g(),h))return!1}catch{return!1}}if(a=l.child,l.subtreeFlags&16384&&a!==null)a.return=l,l=a;else{if(l===r)break;for(;l.sibling===null;){if(l.return===null||l.return===r)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function ki(r,l,a,f){l&=~od,l&=~dr,r.suspendedLanes|=l,r.pingedLanes&=~l,f&&(r.warmLanes|=l),f=r.expirationTimes;for(var h=l;0<h;){var g=31-$e(h),S=1<<g;f[g]=-1,h&=~S}a!==0&&rm(r,a,l)}function Na(){return(wt&6)===0?(wl(0),!1):!0}function hd(){if(yt!==null){if(Nt===0)var r=yt.return;else r=yt,Hn=lr=null,Nf(r),rs=null,vl=0,r=yt;for(;r!==null;)Ay(r.alternate,r),r=r.return;yt=null}}function hs(r,l){var a=r.timeoutHandle;a!==-1&&(r.timeoutHandle=-1,yM(a)),a=r.cancelPendingCommit,a!==null&&(r.cancelPendingCommit=null,a()),hd(),jt=r,yt=a=Ln(r.current,null),Tt=l,Nt=0,Xe=null,Ei=!1,us=Ks(r,l),ld=!1,cs=an=od=dr=Ti=Xt=0,Ie=Cl=null,ad=!1,(l&8)!==0&&(l|=l&32);var f=r.entangledLanes;if(f!==0)for(r=r.entanglements,f&=l;0<f;){var h=31-$e(f),g=1<<h;l|=r[h],f&=~g}return Pn=l,Zo(),a}function Xy(r,l){ht=null,z.H=ya,l===cl||l===oa?(l=fg(),Nt=3):l===ag?(l=fg(),Nt=4):Nt=l===dy?8:l!==null&&typeof l==\"object\"&&typeof l.then==\"function\"?6:1,Xe=l,yt===null&&(Xt=1,Ta(r,nn(l,r.current)))}function Fy(){var r=z.H;return z.H=ya,r===null?ya:r}function Qy(){var r=z.A;return z.A=Jx,r}function pd(){Xt=4,Ei||(Tt&4194048)!==Tt&&on.current!==null||(us=!0),(Ti&134217727)===0&&(dr&134217727)===0||jt===null||ki(jt,Tt,an,!1)}function md(r,l,a){var f=wt;wt|=2;var h=Fy(),g=Qy();(jt!==r||Tt!==l)&&(wa=null,hs(r,l)),l=!1;var S=Xt;t:do try{if(Nt!==0&&yt!==null){var T=yt,k=Xe;switch(Nt){case 8:hd(),S=6;break t;case 3:case 2:case 9:case 6:on.current===null&&(l=!0);var D=Nt;if(Nt=0,Xe=null,ps(r,T,k,D),a&&us){S=0;break t}break;default:D=Nt,Nt=0,Xe=null,ps(r,T,k,D)}}tM(),S=Xt;break}catch(H){Xy(r,H)}while(!0);return l&&r.shellSuspendCounter++,Hn=lr=null,wt=f,z.H=h,z.A=g,yt===null&&(jt=null,Tt=0,Zo()),S}function tM(){for(;yt!==null;)Jy(yt)}function eM(r,l){var a=wt;wt|=2;var f=Fy(),h=Qy();jt!==r||Tt!==l?(wa=null,Oa=En()+500,hs(r,l)):us=Ks(r,l);t:do try{if(Nt!==0&&yt!==null){l=yt;var g=Xe;e:switch(Nt){case 1:Nt=0,Xe=null,ps(r,l,g,1);break;case 2:case 9:if(ug(g)){Nt=0,Xe=null,Zy(l);break}l=function(){Nt!==2&&Nt!==9||jt!==r||(Nt=7),An(r)},g.then(l,l);break t;case 3:Nt=7;break t;case 4:Nt=5;break t;case 7:ug(g)?(Nt=0,Xe=null,Zy(l)):(Nt=0,Xe=null,ps(r,l,g,7));break;case 5:var S=null;switch(yt.tag){case 26:S=yt.memoizedState;case 5:case 27:var T=yt;if(!S||L0(S)){Nt=0,Xe=null;var k=T.sibling;if(k!==null)yt=k;else{var D=T.return;D!==null?(yt=D,Da(D)):yt=null}break e}}Nt=0,Xe=null,ps(r,l,g,5);break;case 6:Nt=0,Xe=null,ps(r,l,g,6);break;case 8:hd(),Xt=6;break t;default:throw Error(i(462))}}nM();break}catch(H){Xy(r,H)}while(!0);return Hn=lr=null,z.H=f,z.A=h,wt=a,yt!==null?0:(jt=null,Tt=0,Zo(),Xt)}function nM(){for(;yt!==null&&!MT();)Jy(yt)}function Jy(r){var l=My(r.alternate,r,Pn);r.memoizedProps=r.pendingProps,l===null?Da(r):yt=l}function Zy(r){var l=r,a=l.alternate;switch(l.tag){case 15:case 0:l=by(a,l,l.pendingProps,l.type,void 0,Tt);break;case 11:l=by(a,l,l.pendingProps,l.type.render,l.ref,Tt);break;case 5:Nf(l);default:Ay(a,l),l=yt=Wm(l,Pn),l=My(a,l,Pn)}r.memoizedProps=r.pendingProps,l===null?Da(r):yt=l}function ps(r,l,a,f){Hn=lr=null,Nf(l),rs=null,vl=0;var h=l.return;try{if(Kx(r,h,l,a,Tt)){Xt=1,Ta(r,nn(a,r.current)),yt=null;return}}catch(g){if(h!==null)throw yt=h,g;Xt=1,Ta(r,nn(a,r.current)),yt=null;return}l.flags&32768?(At||f===1?r=!0:us||(Tt&536870912)!==0?r=!1:(Ei=r=!0,(f===2||f===9||f===3||f===6)&&(f=on.current,f!==null&&f.tag===13&&(f.flags|=16384))),Wy(l,r)):Da(l)}function Da(r){var l=r;do{if((l.flags&32768)!==0){Wy(l,Ei);return}r=l.return;var a=Yx(l.alternate,l,Pn);if(a!==null){yt=a;return}if(l=l.sibling,l!==null){yt=l;return}yt=l=r}while(l!==null);Xt===0&&(Xt=5)}function Wy(r,l){do{var a=Xx(r.alternate,r);if(a!==null){a.flags&=32767,yt=a;return}if(a=r.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!l&&(r=r.sibling,r!==null)){yt=r;return}yt=r=a}while(r!==null);Xt=6,yt=null}function t0(r,l,a,f,h,g,S,T,k){r.cancelPendingCommit=null;do Ra();while(ge!==0);if((wt&6)!==0)throw Error(i(327));if(l!==null){if(l===r.current)throw Error(i(177));if(g=l.lanes|l.childLanes,g|=sf,zT(r,a,g,S,T,k),r===jt&&(yt=jt=null,Tt=0),fs=l,Mi=r,ds=a,cd=g,fd=h,Py=f,(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,lM(_o,function(){return s0(),null})):(r.callbackNode=null,r.callbackPriority=0),f=(l.flags&13878)!==0,(l.subtreeFlags&13878)!==0||f){f=z.T,z.T=null,h=G.p,G.p=2,S=wt,wt|=4;try{Fx(r,l,a)}finally{wt=S,G.p=h,z.T=f}}ge=1,e0(),n0(),i0()}}function e0(){if(ge===1){ge=0;var r=Mi,l=fs,a=(l.flags&13878)!==0;if((l.subtreeFlags&13878)!==0||a){a=z.T,z.T=null;var f=G.p;G.p=2;var h=wt;wt|=4;try{_y(l,r);var g=Cd,S=$m(r.containerInfo),T=g.focusedElem,k=g.selectionRange;if(S!==T&&T&&T.ownerDocument&&Vm(T.ownerDocument.documentElement,T)){if(k!==null&&Wc(T)){var D=k.start,H=k.end;if(H===void 0&&(H=D),\"selectionStart\"in T)T.selectionStart=D,T.selectionEnd=Math.min(H,T.value.length);else{var U=T.ownerDocument||document,R=U&&U.defaultView||window;if(R.getSelection){var L=R.getSelection(),at=T.textContent.length,st=Math.min(k.start,at),zt=k.end===void 0?st:Math.min(k.end,at);!L.extend&&st>zt&&(S=zt,zt=st,st=S);var w=qm(T,st),C=qm(T,zt);if(w&&C&&(L.rangeCount!==1||L.anchorNode!==w.node||L.anchorOffset!==w.offset||L.focusNode!==C.node||L.focusOffset!==C.offset)){var N=U.createRange();N.setStart(w.node,w.offset),L.removeAllRanges(),st>zt?(L.addRange(N),L.extend(C.node,C.offset)):(N.setEnd(C.node,C.offset),L.addRange(N))}}}}for(U=[],L=T;L=L.parentNode;)L.nodeType===1&&U.push({element:L,left:L.scrollLeft,top:L.scrollTop});for(typeof T.focus==\"function\"&&T.focus(),T=0;T<U.length;T++){var _=U[T];_.element.scrollLeft=_.left,_.element.scrollTop=_.top}}Pa=!!Ad,Cd=Ad=null}finally{wt=h,G.p=f,z.T=a}}r.current=l,ge=2}}function n0(){if(ge===2){ge=0;var r=Mi,l=fs,a=(l.flags&8772)!==0;if((l.subtreeFlags&8772)!==0||a){a=z.T,z.T=null;var f=G.p;G.p=2;var h=wt;wt|=4;try{Ly(r,l.alternate,l)}finally{wt=h,G.p=f,z.T=a}}ge=3}}function i0(){if(ge===4||ge===3){ge=0,kT();var r=Mi,l=fs,a=ds,f=Py;(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?ge=5:(ge=0,fs=Mi=null,r0(r,r.pendingLanes));var h=r.pendingLanes;if(h===0&&(xi=null),Rc(a),l=l.stateNode,Ve&&typeof Ve.onCommitFiberRoot==\"function\")try{Ve.onCommitFiberRoot(Ps,l,void 0,(l.current.flags&128)===128)}catch{}if(f!==null){l=z.T,h=G.p,G.p=2,z.T=null;try{for(var g=r.onRecoverableError,S=0;S<f.length;S++){var T=f[S];g(T.value,{componentStack:T.stack})}}finally{z.T=l,G.p=h}}(ds&3)!==0&&Ra(),An(r),h=r.pendingLanes,(a&4194090)!==0&&(h&42)!==0?r===dd?Ol++:(Ol=0,dd=r):Ol=0,wl(0)}}function r0(r,l){(r.pooledCacheLanes&=l)===0&&(l=r.pooledCache,l!=null&&(r.pooledCache=null,al(l)))}function Ra(r){return e0(),n0(),i0(),s0()}function s0(){if(ge!==5)return!1;var r=Mi,l=cd;cd=0;var a=Rc(ds),f=z.T,h=G.p;try{G.p=32>a?32:a,z.T=null,a=fd,fd=null;var g=Mi,S=ds;if(ge=0,fs=Mi=null,ds=0,(wt&6)!==0)throw Error(i(331));var T=wt;if(wt|=4,Vy(g.current),Iy(g,g.current,S,a),wt=T,wl(0,!1),Ve&&typeof Ve.onPostCommitFiberRoot==\"function\")try{Ve.onPostCommitFiberRoot(Ps,g)}catch{}return!0}finally{G.p=h,z.T=f,r0(r,l)}}function l0(r,l,a){l=nn(a,l),l=Pf(r.stateNode,l,2),r=pi(r,l,2),r!==null&&(Gs(r,2),An(r))}function _t(r,l,a){if(r.tag===3)l0(r,r,a);else for(;l!==null;){if(l.tag===3){l0(l,r,a);break}else if(l.tag===1){var f=l.stateNode;if(typeof l.type.getDerivedStateFromError==\"function\"||typeof f.componentDidCatch==\"function\"&&(xi===null||!xi.has(f))){r=nn(a,r),a=cy(2),f=pi(l,a,2),f!==null&&(fy(a,f,l,r),Gs(f,2),An(f));break}}l=l.return}}function gd(r,l,a){var f=r.pingCache;if(f===null){f=r.pingCache=new Zx;var h=new Set;f.set(l,h)}else h=f.get(l),h===void 0&&(h=new Set,f.set(l,h));h.has(a)||(ld=!0,h.add(a),r=iM.bind(null,r,l,a),l.then(r,r))}function iM(r,l,a){var f=r.pingCache;f!==null&&f.delete(l),r.pingedLanes|=r.suspendedLanes&a,r.warmLanes&=~a,jt===r&&(Tt&a)===a&&(Xt===4||Xt===3&&(Tt&62914560)===Tt&&300>En()-ud?(wt&2)===0&&hs(r,0):od|=a,cs===Tt&&(cs=0)),An(r)}function o0(r,l){l===0&&(l=im()),r=Xr(r,l),r!==null&&(Gs(r,l),An(r))}function rM(r){var l=r.memoizedState,a=0;l!==null&&(a=l.retryLane),o0(r,a)}function sM(r,l){var a=0;switch(r.tag){case 13:var f=r.stateNode,h=r.memoizedState;h!==null&&(a=h.retryLane);break;case 19:f=r.stateNode;break;case 22:f=r.stateNode._retryCache;break;default:throw Error(i(314))}f!==null&&f.delete(l),o0(r,a)}function lM(r,l){return Oc(r,l)}var La=null,ms=null,yd=!1,za=!1,bd=!1,hr=0;function An(r){r!==ms&&r.next===null&&(ms===null?La=ms=r:ms=ms.next=r),za=!0,yd||(yd=!0,aM())}function wl(r,l){if(!bd&&za){bd=!0;do for(var a=!1,f=La;f!==null;){if(r!==0){var h=f.pendingLanes;if(h===0)var g=0;else{var S=f.suspendedLanes,T=f.pingedLanes;g=(1<<31-$e(42|r)+1)-1,g&=h&~(S&~T),g=g&201326741?g&201326741|1:g?g|2:0}g!==0&&(a=!0,f0(f,g))}else g=Tt,g=jo(f,f===jt?g:0,f.cancelPendingCommit!==null||f.timeoutHandle!==-1),(g&3)===0||Ks(f,g)||(a=!0,f0(f,g));f=f.next}while(a);bd=!1}}function oM(){a0()}function a0(){za=yd=!1;var r=0;hr!==0&&(gM()&&(r=hr),hr=0);for(var l=En(),a=null,f=La;f!==null;){var h=f.next,g=u0(f,l);g===0?(f.next=null,a===null?La=h:a.next=h,h===null&&(ms=a)):(a=f,(r!==0||(g&3)!==0)&&(za=!0)),f=h}wl(r)}function u0(r,l){for(var a=r.suspendedLanes,f=r.pingedLanes,h=r.expirationTimes,g=r.pendingLanes&-62914561;0<g;){var S=31-$e(g),T=1<<S,k=h[S];k===-1?((T&a)===0||(T&f)!==0)&&(h[S]=LT(T,l)):k<=l&&(r.expiredLanes|=T),g&=~T}if(l=jt,a=Tt,a=jo(r,r===l?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),f=r.callbackNode,a===0||r===l&&(Nt===2||Nt===9)||r.cancelPendingCommit!==null)return f!==null&&f!==null&&wc(f),r.callbackNode=null,r.callbackPriority=0;if((a&3)===0||Ks(r,a)){if(l=a&-a,l===r.callbackPriority)return l;switch(f!==null&&wc(f),Rc(a)){case 2:case 8:a=tm;break;case 32:a=_o;break;case 268435456:a=em;break;default:a=_o}return f=c0.bind(null,r),a=Oc(a,f),r.callbackPriority=l,r.callbackNode=a,l}return f!==null&&f!==null&&wc(f),r.callbackPriority=2,r.callbackNode=null,2}function c0(r,l){if(ge!==0&&ge!==5)return r.callbackNode=null,r.callbackPriority=0,null;var a=r.callbackNode;if(Ra()&&r.callbackNode!==a)return null;var f=Tt;return f=jo(r,r===jt?f:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),f===0?null:(Gy(r,f,l),u0(r,En()),r.callbackNode!=null&&r.callbackNode===a?c0.bind(null,r):null)}function f0(r,l){if(Ra())return null;Gy(r,l,!0)}function aM(){bM(function(){(wt&6)!==0?Oc(Wp,oM):a0()})}function vd(){return hr===0&&(hr=nm()),hr}function d0(r){return r==null||typeof r==\"symbol\"||typeof r==\"boolean\"?null:typeof r==\"function\"?r:Ko(\"\"+r)}function h0(r,l){var a=l.ownerDocument.createElement(\"input\");return a.name=l.name,a.value=l.value,r.id&&a.setAttribute(\"form\",r.id),l.parentNode.insertBefore(a,l),r=new FormData(r),a.parentNode.removeChild(a),r}function uM(r,l,a,f,h){if(l===\"submit\"&&a&&a.stateNode===h){var g=d0((h[Be]||null).action),S=f.submitter;S&&(l=(l=S[Be]||null)?d0(l.formAction):S.getAttribute(\"formAction\"),l!==null&&(g=l,S=null));var T=new Fo(\"action\",\"action\",null,f,h);r.push({event:T,listeners:[{instance:null,listener:function(){if(f.defaultPrevented){if(hr!==0){var k=S?h0(h,S):new FormData(h);If(a,{pending:!0,data:k,method:h.method,action:g},null,k)}}else typeof g==\"function\"&&(T.preventDefault(),k=S?h0(h,S):new FormData(h),If(a,{pending:!0,data:k,method:h.method,action:g},g,k))},currentTarget:h}]})}}for(var Sd=0;Sd<rf.length;Sd++){var Ed=rf[Sd],cM=Ed.toLowerCase(),fM=Ed[0].toUpperCase()+Ed.slice(1);mn(cM,\"on\"+fM)}mn(Gm,\"onAnimationEnd\"),mn(Ym,\"onAnimationIteration\"),mn(Xm,\"onAnimationStart\"),mn(\"dblclick\",\"onDoubleClick\"),mn(\"focusin\",\"onFocus\"),mn(\"focusout\",\"onBlur\"),mn(Ox,\"onTransitionRun\"),mn(wx,\"onTransitionStart\"),mn(Nx,\"onTransitionCancel\"),mn(Fm,\"onTransitionEnd\"),Ur(\"onMouseEnter\",[\"mouseout\",\"mouseover\"]),Ur(\"onMouseLeave\",[\"mouseout\",\"mouseover\"]),Ur(\"onPointerEnter\",[\"pointerout\",\"pointerover\"]),Ur(\"onPointerLeave\",[\"pointerout\",\"pointerover\"]),Ji(\"onChange\",\"change click focusin focusout input keydown keyup selectionchange\".split(\" \")),Ji(\"onSelect\",\"focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange\".split(\" \")),Ji(\"onBeforeInput\",[\"compositionend\",\"keypress\",\"textInput\",\"paste\"]),Ji(\"onCompositionEnd\",\"compositionend focusout keydown keypress keyup mousedown\".split(\" \")),Ji(\"onCompositionStart\",\"compositionstart focusout keydown keypress keyup mousedown\".split(\" \")),Ji(\"onCompositionUpdate\",\"compositionupdate focusout keydown keypress keyup mousedown\".split(\" \"));var Nl=\"abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting\".split(\" \"),dM=new Set(\"beforetoggle cancel close invalid load scroll scrollend toggle\".split(\" \").concat(Nl));function p0(r,l){l=(l&4)!==0;for(var a=0;a<r.length;a++){var f=r[a],h=f.event;f=f.listeners;t:{var g=void 0;if(l)for(var S=f.length-1;0<=S;S--){var T=f[S],k=T.instance,D=T.currentTarget;if(T=T.listener,k!==g&&h.isPropagationStopped())break t;g=T,h.currentTarget=D;try{g(h)}catch(H){Ea(H)}h.currentTarget=null,g=k}else for(S=0;S<f.length;S++){if(T=f[S],k=T.instance,D=T.currentTarget,T=T.listener,k!==g&&h.isPropagationStopped())break t;g=T,h.currentTarget=D;try{g(h)}catch(H){Ea(H)}h.currentTarget=null,g=k}}}}function bt(r,l){var a=l[Lc];a===void 0&&(a=l[Lc]=new Set);var f=r+\"__bubble\";a.has(f)||(m0(l,r,2,!1),a.add(f))}function Td(r,l,a){var f=0;l&&(f|=4),m0(a,r,f,l)}var Ba=\"_reactListening\"+Math.random().toString(36).slice(2);function xd(r){if(!r[Ba]){r[Ba]=!0,am.forEach(function(a){a!==\"selectionchange\"&&(dM.has(a)||Td(a,!1,r),Td(a,!0,r))});var l=r.nodeType===9?r:r.ownerDocument;l===null||l[Ba]||(l[Ba]=!0,Td(\"selectionchange\",!1,l))}}function m0(r,l,a,f){switch(I0(l)){case 2:var h=IM;break;case 8:h=jM;break;default:h=_d}a=h.bind(null,l,a,r),h=void 0,!Pc||l!==\"touchstart\"&&l!==\"touchmove\"&&l!==\"wheel\"||(h=!0),f?h!==void 0?r.addEventListener(l,a,{capture:!0,passive:h}):r.addEventListener(l,a,!0):h!==void 0?r.addEventListener(l,a,{passive:h}):r.addEventListener(l,a,!1)}function Md(r,l,a,f,h){var g=f;if((l&1)===0&&(l&2)===0&&f!==null)t:for(;;){if(f===null)return;var S=f.tag;if(S===3||S===4){var T=f.stateNode.containerInfo;if(T===h)break;if(S===4)for(S=f.return;S!==null;){var k=S.tag;if((k===3||k===4)&&S.stateNode.containerInfo===h)return;S=S.return}for(;T!==null;){if(S=Br(T),S===null)return;if(k=S.tag,k===5||k===6||k===26||k===27){f=g=S;continue t}T=T.parentNode}}f=f.return}Tm(function(){var D=g,H=Vc(a),U=[];t:{var R=Qm.get(r);if(R!==void 0){var L=Fo,at=r;switch(r){case\"keypress\":if(Yo(a)===0)break t;case\"keydown\":case\"keyup\":L=lx;break;case\"focusin\":at=\"focus\",L=Xc;break;case\"focusout\":at=\"blur\",L=Xc;break;case\"beforeblur\":case\"afterblur\":L=Xc;break;case\"click\":if(a.button===2)break t;case\"auxclick\":case\"dblclick\":case\"mousedown\":case\"mousemove\":case\"mouseup\":case\"mouseout\":case\"mouseover\":case\"contextmenu\":L=km;break;case\"drag\":case\"dragend\":case\"dragenter\":case\"dragexit\":case\"dragleave\":case\"dragover\":case\"dragstart\":case\"drop\":L=XT;break;case\"touchcancel\":case\"touchend\":case\"touchmove\":case\"touchstart\":L=ux;break;case Gm:case Ym:case Xm:L=JT;break;case Fm:L=fx;break;case\"scroll\":case\"scrollend\":L=GT;break;case\"wheel\":L=hx;break;case\"copy\":case\"cut\":case\"paste\":L=WT;break;case\"gotpointercapture\":case\"lostpointercapture\":case\"pointercancel\":case\"pointerdown\":case\"pointermove\":case\"pointerout\":case\"pointerover\":case\"pointerup\":L=Cm;break;case\"toggle\":case\"beforetoggle\":L=mx}var st=(l&4)!==0,zt=!st&&(r===\"scroll\"||r===\"scrollend\"),w=st?R!==null?R+\"Capture\":null:R;st=[];for(var C=D,N;C!==null;){var _=C;if(N=_.stateNode,_=_.tag,_!==5&&_!==26&&_!==27||N===null||w===null||(_=Fs(C,w),_!=null&&st.push(Dl(C,_,N))),zt)break;C=C.return}0<st.length&&(R=new L(R,at,null,a,H),U.push({event:R,listeners:st}))}}if((l&7)===0){t:{if(R=r===\"mouseover\"||r===\"pointerover\",L=r===\"mouseout\"||r===\"pointerout\",R&&a!==qc&&(at=a.relatedTarget||a.fromElement)&&(Br(at)||at[zr]))break t;if((L||R)&&(R=H.window===H?H:(R=H.ownerDocument)?R.defaultView||R.parentWindow:window,L?(at=a.relatedTarget||a.toElement,L=D,at=at?Br(at):null,at!==null&&(zt=o(at),st=at.tag,at!==zt||st!==5&&st!==27&&st!==6)&&(at=null)):(L=null,at=D),L!==at)){if(st=km,_=\"onMouseLeave\",w=\"onMouseEnter\",C=\"mouse\",(r===\"pointerout\"||r===\"pointerover\")&&(st=Cm,_=\"onPointerLeave\",w=\"onPointerEnter\",C=\"pointer\"),zt=L==null?R:Xs(L),N=at==null?R:Xs(at),R=new st(_,C+\"leave\",L,a,H),R.target=zt,R.relatedTarget=N,_=null,Br(H)===D&&(st=new st(w,C+\"enter\",at,a,H),st.target=N,st.relatedTarget=zt,_=st),zt=_,L&&at)e:{for(st=L,w=at,C=0,N=st;N;N=gs(N))C++;for(N=0,_=w;_;_=gs(_))N++;for(;0<C-N;)st=gs(st),C--;for(;0<N-C;)w=gs(w),N--;for(;C--;){if(st===w||w!==null&&st===w.alternate)break e;st=gs(st),w=gs(w)}st=null}else st=null;L!==null&&g0(U,R,L,st,!1),at!==null&&zt!==null&&g0(U,zt,at,st,!0)}}t:{if(R=D?Xs(D):window,L=R.nodeName&&R.nodeName.toLowerCase(),L===\"select\"||L===\"input\"&&R.type===\"file\")var Q=Bm;else if(Lm(R))if(Hm)Q=kx;else{Q=xx;var mt=Tx}else L=R.nodeName,!L||L.toLowerCase()!==\"input\"||R.type!==\"checkbox\"&&R.type!==\"radio\"?D&&jc(D.elementType)&&(Q=Bm):Q=Mx;if(Q&&(Q=Q(r,D))){zm(U,Q,a,H);break t}mt&&mt(r,R,D),r===\"focusout\"&&D&&R.type===\"number\"&&D.memoizedProps.value!=null&&Ic(R,\"number\",R.value)}switch(mt=D?Xs(D):window,r){case\"focusin\":(Lm(mt)||mt.contentEditable===\"true\")&&(Kr=mt,tf=D,il=null);break;case\"focusout\":il=tf=Kr=null;break;case\"mousedown\":ef=!0;break;case\"contextmenu\":case\"mouseup\":case\"dragend\":ef=!1,Pm(U,a,H);break;case\"selectionchange\":if(Cx)break;case\"keydown\":case\"keyup\":Pm(U,a,H)}var Z;if(Qc)t:{switch(r){case\"compositionstart\":var ot=\"onCompositionStart\";break t;case\"compositionend\":ot=\"onCompositionEnd\";break t;case\"compositionupdate\":ot=\"onCompositionUpdate\";break t}ot=void 0}else Pr?Dm(r,a)&&(ot=\"onCompositionEnd\"):r===\"keydown\"&&a.keyCode===229&&(ot=\"onCompositionStart\");ot&&(Om&&a.locale!==\"ko\"&&(Pr||ot!==\"onCompositionStart\"?ot===\"onCompositionEnd\"&&Pr&&(Z=xm()):(ci=H,Kc=\"value\"in ci?ci.value:ci.textContent,Pr=!0)),mt=Ha(D,ot),0<mt.length&&(ot=new Am(ot,r,null,a,H),U.push({event:ot,listeners:mt}),Z?ot.data=Z:(Z=Rm(a),Z!==null&&(ot.data=Z)))),(Z=yx?bx(r,a):vx(r,a))&&(ot=Ha(D,\"onBeforeInput\"),0<ot.length&&(mt=new Am(\"onBeforeInput\",\"beforeinput\",null,a,H),U.push({event:mt,listeners:ot}),mt.data=Z)),uM(U,r,D,a,H)}p0(U,l)})}function Dl(r,l,a){return{instance:r,listener:l,currentTarget:a}}function Ha(r,l){for(var a=l+\"Capture\",f=[];r!==null;){var h=r,g=h.stateNode;if(h=h.tag,h!==5&&h!==26&&h!==27||g===null||(h=Fs(r,a),h!=null&&f.unshift(Dl(r,h,g)),h=Fs(r,l),h!=null&&f.push(Dl(r,h,g))),r.tag===3)return f;r=r.return}return[]}function gs(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function g0(r,l,a,f,h){for(var g=l._reactName,S=[];a!==null&&a!==f;){var T=a,k=T.alternate,D=T.stateNode;if(T=T.tag,k!==null&&k===f)break;T!==5&&T!==26&&T!==27||D===null||(k=D,h?(D=Fs(a,g),D!=null&&S.unshift(Dl(a,D,k))):h||(D=Fs(a,g),D!=null&&S.push(Dl(a,D,k)))),a=a.return}S.length!==0&&r.push({event:l,listeners:S})}var hM=/\\r\\n?/g,pM=/\\u0000|\\uFFFD/g;function y0(r){return(typeof r==\"string\"?r:\"\"+r).replace(hM,`\n`).replace(pM,\"\")}function b0(r,l){return l=y0(l),y0(r)===l}function _a(){}function Lt(r,l,a,f,h,g){switch(a){case\"children\":typeof f==\"string\"?l===\"body\"||l===\"textarea\"&&f===\"\"||qr(r,f):(typeof f==\"number\"||typeof f==\"bigint\")&&l!==\"body\"&&qr(r,\"\"+f);break;case\"className\":Vo(r,\"class\",f);break;case\"tabIndex\":Vo(r,\"tabindex\",f);break;case\"dir\":case\"role\":case\"viewBox\":case\"width\":case\"height\":Vo(r,a,f);break;case\"style\":Sm(r,f,g);break;case\"data\":if(l!==\"object\"){Vo(r,\"data\",f);break}case\"src\":case\"href\":if(f===\"\"&&(l!==\"a\"||a!==\"href\")){r.removeAttribute(a);break}if(f==null||typeof f==\"function\"||typeof f==\"symbol\"||typeof f==\"boolean\"){r.removeAttribute(a);break}f=Ko(\"\"+f),r.setAttribute(a,f);break;case\"action\":case\"formAction\":if(typeof f==\"function\"){r.setAttribute(a,\"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')\");break}else typeof g==\"function\"&&(a===\"formAction\"?(l!==\"input\"&&Lt(r,l,\"name\",h.name,h,null),Lt(r,l,\"formEncType\",h.formEncType,h,null),Lt(r,l,\"formMethod\",h.formMethod,h,null),Lt(r,l,\"formTarget\",h.formTarget,h,null)):(Lt(r,l,\"encType\",h.encType,h,null),Lt(r,l,\"method\",h.method,h,null),Lt(r,l,\"target\",h.target,h,null)));if(f==null||typeof f==\"symbol\"||typeof f==\"boolean\"){r.removeAttribute(a);break}f=Ko(\"\"+f),r.setAttribute(a,f);break;case\"onClick\":f!=null&&(r.onclick=_a);break;case\"onScroll\":f!=null&&bt(\"scroll\",r);break;case\"onScrollEnd\":f!=null&&bt(\"scrollend\",r);break;case\"dangerouslySetInnerHTML\":if(f!=null){if(typeof f!=\"object\"||!(\"__html\"in f))throw Error(i(61));if(a=f.__html,a!=null){if(h.children!=null)throw Error(i(60));r.innerHTML=a}}break;case\"multiple\":r.multiple=f&&typeof f!=\"function\"&&typeof f!=\"symbol\";break;case\"muted\":r.muted=f&&typeof f!=\"function\"&&typeof f!=\"symbol\";break;case\"suppressContentEditableWarning\":case\"suppressHydrationWarning\":case\"defaultValue\":case\"defaultChecked\":case\"innerHTML\":case\"ref\":break;case\"autoFocus\":break;case\"xlinkHref\":if(f==null||typeof f==\"function\"||typeof f==\"boolean\"||typeof f==\"symbol\"){r.removeAttribute(\"xlink:href\");break}a=Ko(\"\"+f),r.setAttributeNS(\"http://www.w3.org/1999/xlink\",\"xlink:href\",a);break;case\"contentEditable\":case\"spellCheck\":case\"draggable\":case\"value\":case\"autoReverse\":case\"externalResourcesRequired\":case\"focusable\":case\"preserveAlpha\":f!=null&&typeof f!=\"function\"&&typeof f!=\"symbol\"?r.setAttribute(a,\"\"+f):r.removeAttribute(a);break;case\"inert\":case\"allowFullScreen\":case\"async\":case\"autoPlay\":case\"controls\":case\"default\":case\"defer\":case\"disabled\":case\"disablePictureInPicture\":case\"disableRemotePlayback\":case\"formNoValidate\":case\"hidden\":case\"loop\":case\"noModule\":case\"noValidate\":case\"open\":case\"playsInline\":case\"readOnly\":case\"required\":case\"reversed\":case\"scoped\":case\"seamless\":case\"itemScope\":f&&typeof f!=\"function\"&&typeof f!=\"symbol\"?r.setAttribute(a,\"\"):r.removeAttribute(a);break;case\"capture\":case\"download\":f===!0?r.setAttribute(a,\"\"):f!==!1&&f!=null&&typeof f!=\"function\"&&typeof f!=\"symbol\"?r.setAttribute(a,f):r.removeAttribute(a);break;case\"cols\":case\"rows\":case\"size\":case\"span\":f!=null&&typeof f!=\"function\"&&typeof f!=\"symbol\"&&!isNaN(f)&&1<=f?r.setAttribute(a,f):r.removeAttribute(a);break;case\"rowSpan\":case\"start\":f==null||typeof f==\"function\"||typeof f==\"symbol\"||isNaN(f)?r.removeAttribute(a):r.setAttribute(a,f);break;case\"popover\":bt(\"beforetoggle\",r),bt(\"toggle\",r),qo(r,\"popover\",f);break;case\"xlinkActuate\":Dn(r,\"http://www.w3.org/1999/xlink\",\"xlink:actuate\",f);break;case\"xlinkArcrole\":Dn(r,\"http://www.w3.org/1999/xlink\",\"xlink:arcrole\",f);break;case\"xlinkRole\":Dn(r,\"http://www.w3.org/1999/xlink\",\"xlink:role\",f);break;case\"xlinkShow\":Dn(r,\"http://www.w3.org/1999/xlink\",\"xlink:show\",f);break;case\"xlinkTitle\":Dn(r,\"http://www.w3.org/1999/xlink\",\"xlink:title\",f);break;case\"xlinkType\":Dn(r,\"http://www.w3.org/1999/xlink\",\"xlink:type\",f);break;case\"xmlBase\":Dn(r,\"http://www.w3.org/XML/1998/namespace\",\"xml:base\",f);break;case\"xmlLang\":Dn(r,\"http://www.w3.org/XML/1998/namespace\",\"xml:lang\",f);break;case\"xmlSpace\":Dn(r,\"http://www.w3.org/XML/1998/namespace\",\"xml:space\",f);break;case\"is\":qo(r,\"is\",f);break;case\"innerText\":case\"textContent\":break;default:(!(2<a.length)||a[0]!==\"o\"&&a[0]!==\"O\"||a[1]!==\"n\"&&a[1]!==\"N\")&&(a=PT.get(a)||a,qo(r,a,f))}}function kd(r,l,a,f,h,g){switch(a){case\"style\":Sm(r,f,g);break;case\"dangerouslySetInnerHTML\":if(f!=null){if(typeof f!=\"object\"||!(\"__html\"in f))throw Error(i(61));if(a=f.__html,a!=null){if(h.children!=null)throw Error(i(60));r.innerHTML=a}}break;case\"children\":typeof f==\"string\"?qr(r,f):(typeof f==\"number\"||typeof f==\"bigint\")&&qr(r,\"\"+f);break;case\"onScroll\":f!=null&&bt(\"scroll\",r);break;case\"onScrollEnd\":f!=null&&bt(\"scrollend\",r);break;case\"onClick\":f!=null&&(r.onclick=_a);break;case\"suppressContentEditableWarning\":case\"suppressHydrationWarning\":case\"innerHTML\":case\"ref\":break;case\"innerText\":case\"textContent\":break;default:if(!um.hasOwnProperty(a))t:{if(a[0]===\"o\"&&a[1]===\"n\"&&(h=a.endsWith(\"Capture\"),l=a.slice(2,h?a.length-7:void 0),g=r[Be]||null,g=g!=null?g[a]:null,typeof g==\"function\"&&r.removeEventListener(l,g,h),typeof f==\"function\")){typeof g!=\"function\"&&g!==null&&(a in r?r[a]=null:r.hasAttribute(a)&&r.removeAttribute(a)),r.addEventListener(l,f,h);break t}a in r?r[a]=f:f===!0?r.setAttribute(a,\"\"):qo(r,a,f)}}}function ye(r,l,a){switch(l){case\"div\":case\"span\":case\"svg\":case\"path\":case\"a\":case\"g\":case\"p\":case\"li\":break;case\"img\":bt(\"error\",r),bt(\"load\",r);var f=!1,h=!1,g;for(g in a)if(a.hasOwnProperty(g)){var S=a[g];if(S!=null)switch(g){case\"src\":f=!0;break;case\"srcSet\":h=!0;break;case\"children\":case\"dangerouslySetInnerHTML\":throw Error(i(137,l));default:Lt(r,l,g,S,a,null)}}h&&Lt(r,l,\"srcSet\",a.srcSet,a,null),f&&Lt(r,l,\"src\",a.src,a,null);return;case\"input\":bt(\"invalid\",r);var T=g=S=h=null,k=null,D=null;for(f in a)if(a.hasOwnProperty(f)){var H=a[f];if(H!=null)switch(f){case\"name\":h=H;break;case\"type\":S=H;break;case\"checked\":k=H;break;case\"defaultChecked\":D=H;break;case\"value\":g=H;break;case\"defaultValue\":T=H;break;case\"children\":case\"dangerouslySetInnerHTML\":if(H!=null)throw Error(i(137,l));break;default:Lt(r,l,f,H,a,null)}}gm(r,g,T,k,D,S,h,!1),$o(r);return;case\"select\":bt(\"invalid\",r),f=S=g=null;for(h in a)if(a.hasOwnProperty(h)&&(T=a[h],T!=null))switch(h){case\"value\":g=T;break;case\"defaultValue\":S=T;break;case\"multiple\":f=T;default:Lt(r,l,h,T,a,null)}l=g,a=S,r.multiple=!!f,l!=null?jr(r,!!f,l,!1):a!=null&&jr(r,!!f,a,!0);return;case\"textarea\":bt(\"invalid\",r),g=h=f=null;for(S in a)if(a.hasOwnProperty(S)&&(T=a[S],T!=null))switch(S){case\"value\":f=T;break;case\"defaultValue\":h=T;break;case\"children\":g=T;break;case\"dangerouslySetInnerHTML\":if(T!=null)throw Error(i(91));break;default:Lt(r,l,S,T,a,null)}bm(r,f,h,g),$o(r);return;case\"option\":for(k in a)if(a.hasOwnProperty(k)&&(f=a[k],f!=null))switch(k){case\"selected\":r.selected=f&&typeof f!=\"function\"&&typeof f!=\"symbol\";break;default:Lt(r,l,k,f,a,null)}return;case\"dialog\":bt(\"beforetoggle\",r),bt(\"toggle\",r),bt(\"cancel\",r),bt(\"close\",r);break;case\"iframe\":case\"object\":bt(\"load\",r);break;case\"video\":case\"audio\":for(f=0;f<Nl.length;f++)bt(Nl[f],r);break;case\"image\":bt(\"error\",r),bt(\"load\",r);break;case\"details\":bt(\"toggle\",r);break;case\"embed\":case\"source\":case\"link\":bt(\"error\",r),bt(\"load\",r);case\"area\":case\"base\":case\"br\":case\"col\":case\"hr\":case\"keygen\":case\"meta\":case\"param\":case\"track\":case\"wbr\":case\"menuitem\":for(D in a)if(a.hasOwnProperty(D)&&(f=a[D],f!=null))switch(D){case\"children\":case\"dangerouslySetInnerHTML\":throw Error(i(137,l));default:Lt(r,l,D,f,a,null)}return;default:if(jc(l)){for(H in a)a.hasOwnProperty(H)&&(f=a[H],f!==void 0&&kd(r,l,H,f,a,void 0));return}}for(T in a)a.hasOwnProperty(T)&&(f=a[T],f!=null&&Lt(r,l,T,f,a,null))}function mM(r,l,a,f){switch(l){case\"div\":case\"span\":case\"svg\":case\"path\":case\"a\":case\"g\":case\"p\":case\"li\":break;case\"input\":var h=null,g=null,S=null,T=null,k=null,D=null,H=null;for(L in a){var U=a[L];if(a.hasOwnProperty(L)&&U!=null)switch(L){case\"checked\":break;case\"value\":break;case\"defaultValue\":k=U;default:f.hasOwnProperty(L)||Lt(r,l,L,null,f,U)}}for(var R in f){var L=f[R];if(U=a[R],f.hasOwnProperty(R)&&(L!=null||U!=null))switch(R){case\"type\":g=L;break;case\"name\":h=L;break;case\"checked\":D=L;break;case\"defaultChecked\":H=L;break;case\"value\":S=L;break;case\"defaultValue\":T=L;break;case\"children\":case\"dangerouslySetInnerHTML\":if(L!=null)throw Error(i(137,l));break;default:L!==U&&Lt(r,l,R,L,f,U)}}Uc(r,S,T,k,D,H,g,h);return;case\"select\":L=S=T=R=null;for(g in a)if(k=a[g],a.hasOwnProperty(g)&&k!=null)switch(g){case\"value\":break;case\"multiple\":L=k;default:f.hasOwnProperty(g)||Lt(r,l,g,null,f,k)}for(h in f)if(g=f[h],k=a[h],f.hasOwnProperty(h)&&(g!=null||k!=null))switch(h){case\"value\":R=g;break;case\"defaultValue\":T=g;break;case\"multiple\":S=g;default:g!==k&&Lt(r,l,h,g,f,k)}l=T,a=S,f=L,R!=null?jr(r,!!a,R,!1):!!f!=!!a&&(l!=null?jr(r,!!a,l,!0):jr(r,!!a,a?[]:\"\",!1));return;case\"textarea\":L=R=null;for(T in a)if(h=a[T],a.hasOwnProperty(T)&&h!=null&&!f.hasOwnProperty(T))switch(T){case\"value\":break;case\"children\":break;default:Lt(r,l,T,null,f,h)}for(S in f)if(h=f[S],g=a[S],f.hasOwnProperty(S)&&(h!=null||g!=null))switch(S){case\"value\":R=h;break;case\"defaultValue\":L=h;break;case\"children\":break;case\"dangerouslySetInnerHTML\":if(h!=null)throw Error(i(91));break;default:h!==g&&Lt(r,l,S,h,f,g)}ym(r,R,L);return;case\"option\":for(var at in a)if(R=a[at],a.hasOwnProperty(at)&&R!=null&&!f.hasOwnProperty(at))switch(at){case\"selected\":r.selected=!1;break;default:Lt(r,l,at,null,f,R)}for(k in f)if(R=f[k],L=a[k],f.hasOwnProperty(k)&&R!==L&&(R!=null||L!=null))switch(k){case\"selected\":r.selected=R&&typeof R!=\"function\"&&typeof R!=\"symbol\";break;default:Lt(r,l,k,R,f,L)}return;case\"img\":case\"link\":case\"area\":case\"base\":case\"br\":case\"col\":case\"embed\":case\"hr\":case\"keygen\":case\"meta\":case\"param\":case\"source\":case\"track\":case\"wbr\":case\"menuitem\":for(var st in a)R=a[st],a.hasOwnProperty(st)&&R!=null&&!f.hasOwnProperty(st)&&Lt(r,l,st,null,f,R);for(D in f)if(R=f[D],L=a[D],f.hasOwnProperty(D)&&R!==L&&(R!=null||L!=null))switch(D){case\"children\":case\"dangerouslySetInnerHTML\":if(R!=null)throw Error(i(137,l));break;default:Lt(r,l,D,R,f,L)}return;default:if(jc(l)){for(var zt in a)R=a[zt],a.hasOwnProperty(zt)&&R!==void 0&&!f.hasOwnProperty(zt)&&kd(r,l,zt,void 0,f,R);for(H in f)R=f[H],L=a[H],!f.hasOwnProperty(H)||R===L||R===void 0&&L===void 0||kd(r,l,H,R,f,L);return}}for(var w in a)R=a[w],a.hasOwnProperty(w)&&R!=null&&!f.hasOwnProperty(w)&&Lt(r,l,w,null,f,R);for(U in f)R=f[U],L=a[U],!f.hasOwnProperty(U)||R===L||R==null&&L==null||Lt(r,l,U,R,f,L)}var Ad=null,Cd=null;function Ua(r){return r.nodeType===9?r:r.ownerDocument}function v0(r){switch(r){case\"http://www.w3.org/2000/svg\":return 1;case\"http://www.w3.org/1998/Math/MathML\":return 2;default:return 0}}function S0(r,l){if(r===0)switch(l){case\"svg\":return 1;case\"math\":return 2;default:return 0}return r===1&&l===\"foreignObject\"?0:r}function Od(r,l){return r===\"textarea\"||r===\"noscript\"||typeof l.children==\"string\"||typeof l.children==\"number\"||typeof l.children==\"bigint\"||typeof l.dangerouslySetInnerHTML==\"object\"&&l.dangerouslySetInnerHTML!==null&&l.dangerouslySetInnerHTML.__html!=null}var wd=null;function gM(){var r=window.event;return r&&r.type===\"popstate\"?r===wd?!1:(wd=r,!0):(wd=null,!1)}var E0=typeof setTimeout==\"function\"?setTimeout:void 0,yM=typeof clearTimeout==\"function\"?clearTimeout:void 0,T0=typeof Promise==\"function\"?Promise:void 0,bM=typeof queueMicrotask==\"function\"?queueMicrotask:typeof T0<\"u\"?function(r){return T0.resolve(null).then(r).catch(vM)}:E0;function vM(r){setTimeout(function(){throw r})}function Ai(r){return r===\"head\"}function x0(r,l){var a=l,f=0,h=0;do{var g=a.nextSibling;if(r.removeChild(a),g&&g.nodeType===8)if(a=g.data,a===\"/$\"){if(0<f&&8>f){a=f;var S=r.ownerDocument;if(a&1&&Rl(S.documentElement),a&2&&Rl(S.body),a&4)for(a=S.head,Rl(a),S=a.firstChild;S;){var T=S.nextSibling,k=S.nodeName;S[Ys]||k===\"SCRIPT\"||k===\"STYLE\"||k===\"LINK\"&&S.rel.toLowerCase()===\"stylesheet\"||a.removeChild(S),S=T}}if(h===0){r.removeChild(g),jl(l);return}h--}else a===\"$\"||a===\"$?\"||a===\"$!\"?h++:f=a.charCodeAt(0)-48;else f=0;a=g}while(a);jl(l)}function Nd(r){var l=r.firstChild;for(l&&l.nodeType===10&&(l=l.nextSibling);l;){var a=l;switch(l=l.nextSibling,a.nodeName){case\"HTML\":case\"HEAD\":case\"BODY\":Nd(a),zc(a);continue;case\"SCRIPT\":case\"STYLE\":continue;case\"LINK\":if(a.rel.toLowerCase()===\"stylesheet\")continue}r.removeChild(a)}}function SM(r,l,a,f){for(;r.nodeType===1;){var h=a;if(r.nodeName.toLowerCase()!==l.toLowerCase()){if(!f&&(r.nodeName!==\"INPUT\"||r.type!==\"hidden\"))break}else if(f){if(!r[Ys])switch(l){case\"meta\":if(!r.hasAttribute(\"itemprop\"))break;return r;case\"link\":if(g=r.getAttribute(\"rel\"),g===\"stylesheet\"&&r.hasAttribute(\"data-precedence\"))break;if(g!==h.rel||r.getAttribute(\"href\")!==(h.href==null||h.href===\"\"?null:h.href)||r.getAttribute(\"crossorigin\")!==(h.crossOrigin==null?null:h.crossOrigin)||r.getAttribute(\"title\")!==(h.title==null?null:h.title))break;return r;case\"style\":if(r.hasAttribute(\"data-precedence\"))break;return r;case\"script\":if(g=r.getAttribute(\"src\"),(g!==(h.src==null?null:h.src)||r.getAttribute(\"type\")!==(h.type==null?null:h.type)||r.getAttribute(\"crossorigin\")!==(h.crossOrigin==null?null:h.crossOrigin))&&g&&r.hasAttribute(\"async\")&&!r.hasAttribute(\"itemprop\"))break;return r;default:return r}}else if(l===\"input\"&&r.type===\"hidden\"){var g=h.name==null?null:\"\"+h.name;if(h.type===\"hidden\"&&r.getAttribute(\"name\")===g)return r}else return r;if(r=yn(r.nextSibling),r===null)break}return null}function EM(r,l,a){if(l===\"\")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!==\"INPUT\"||r.type!==\"hidden\")&&!a||(r=yn(r.nextSibling),r===null))return null;return r}function Dd(r){return r.data===\"$!\"||r.data===\"$?\"&&r.ownerDocument.readyState===\"complete\"}function TM(r,l){var a=r.ownerDocument;if(r.data!==\"$?\"||a.readyState===\"complete\")l();else{var f=function(){l(),a.removeEventListener(\"DOMContentLoaded\",f)};a.addEventListener(\"DOMContentLoaded\",f),r._reactRetry=f}}function yn(r){for(;r!=null;r=r.nextSibling){var l=r.nodeType;if(l===1||l===3)break;if(l===8){if(l=r.data,l===\"$\"||l===\"$!\"||l===\"$?\"||l===\"F!\"||l===\"F\")break;if(l===\"/$\")return null}}return r}var Rd=null;function M0(r){r=r.previousSibling;for(var l=0;r;){if(r.nodeType===8){var a=r.data;if(a===\"$\"||a===\"$!\"||a===\"$?\"){if(l===0)return r;l--}else a===\"/$\"&&l++}r=r.previousSibling}return null}function k0(r,l,a){switch(l=Ua(a),r){case\"html\":if(r=l.documentElement,!r)throw Error(i(452));return r;case\"head\":if(r=l.head,!r)throw Error(i(453));return r;case\"body\":if(r=l.body,!r)throw Error(i(454));return r;default:throw Error(i(451))}}function Rl(r){for(var l=r.attributes;l.length;)r.removeAttributeNode(l[0]);zc(r)}var un=new Map,A0=new Set;function Ia(r){return typeof r.getRootNode==\"function\"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var Kn=G.d;G.d={f:xM,r:MM,D:kM,C:AM,L:CM,m:OM,X:NM,S:wM,M:DM};function xM(){var r=Kn.f(),l=Na();return r||l}function MM(r){var l=Hr(r);l!==null&&l.tag===5&&l.type===\"form\"?Gg(l):Kn.r(r)}var ys=typeof document>\"u\"?null:document;function C0(r,l,a){var f=ys;if(f&&typeof l==\"string\"&&l){var h=en(l);h='link[rel=\"'+r+'\"][href=\"'+h+'\"]',typeof a==\"string\"&&(h+='[crossorigin=\"'+a+'\"]'),A0.has(h)||(A0.add(h),r={rel:r,crossOrigin:a,href:l},f.querySelector(h)===null&&(l=f.createElement(\"link\"),ye(l,\"link\",r),ue(l),f.head.appendChild(l)))}}function kM(r){Kn.D(r),C0(\"dns-prefetch\",r,null)}function AM(r,l){Kn.C(r,l),C0(\"preconnect\",r,l)}function CM(r,l,a){Kn.L(r,l,a);var f=ys;if(f&&r&&l){var h='link[rel=\"preload\"][as=\"'+en(l)+'\"]';l===\"image\"&&a&&a.imageSrcSet?(h+='[imagesrcset=\"'+en(a.imageSrcSet)+'\"]',typeof a.imageSizes==\"string\"&&(h+='[imagesizes=\"'+en(a.imageSizes)+'\"]')):h+='[href=\"'+en(r)+'\"]';var g=h;switch(l){case\"style\":g=bs(r);break;case\"script\":g=vs(r)}un.has(g)||(r=m({rel:\"preload\",href:l===\"image\"&&a&&a.imageSrcSet?void 0:r,as:l},a),un.set(g,r),f.querySelector(h)!==null||l===\"style\"&&f.querySelector(Ll(g))||l===\"script\"&&f.querySelector(zl(g))||(l=f.createElement(\"link\"),ye(l,\"link\",r),ue(l),f.head.appendChild(l)))}}function OM(r,l){Kn.m(r,l);var a=ys;if(a&&r){var f=l&&typeof l.as==\"string\"?l.as:\"script\",h='link[rel=\"modulepreload\"][as=\"'+en(f)+'\"][href=\"'+en(r)+'\"]',g=h;switch(f){case\"audioworklet\":case\"paintworklet\":case\"serviceworker\":case\"sharedworker\":case\"worker\":case\"script\":g=vs(r)}if(!un.has(g)&&(r=m({rel:\"modulepreload\",href:r},l),un.set(g,r),a.querySelector(h)===null)){switch(f){case\"audioworklet\":case\"paintworklet\":case\"serviceworker\":case\"sharedworker\":case\"worker\":case\"script\":if(a.querySelector(zl(g)))return}f=a.createElement(\"link\"),ye(f,\"link\",r),ue(f),a.head.appendChild(f)}}}function wM(r,l,a){Kn.S(r,l,a);var f=ys;if(f&&r){var h=_r(f).hoistableStyles,g=bs(r);l=l||\"default\";var S=h.get(g);if(!S){var T={loading:0,preload:null};if(S=f.querySelector(Ll(g)))T.loading=5;else{r=m({rel:\"stylesheet\",href:r,\"data-precedence\":l},a),(a=un.get(g))&&Ld(r,a);var k=S=f.createElement(\"link\");ue(k),ye(k,\"link\",r),k._p=new Promise(function(D,H){k.onload=D,k.onerror=H}),k.addEventListener(\"load\",function(){T.loading|=1}),k.addEventListener(\"error\",function(){T.loading|=2}),T.loading|=4,ja(S,l,f)}S={type:\"stylesheet\",instance:S,count:1,state:T},h.set(g,S)}}}function NM(r,l){Kn.X(r,l);var a=ys;if(a&&r){var f=_r(a).hoistableScripts,h=vs(r),g=f.get(h);g||(g=a.querySelector(zl(h)),g||(r=m({src:r,async:!0},l),(l=un.get(h))&&zd(r,l),g=a.createElement(\"script\"),ue(g),ye(g,\"link\",r),a.head.appendChild(g)),g={type:\"script\",instance:g,count:1,state:null},f.set(h,g))}}function DM(r,l){Kn.M(r,l);var a=ys;if(a&&r){var f=_r(a).hoistableScripts,h=vs(r),g=f.get(h);g||(g=a.querySelector(zl(h)),g||(r=m({src:r,async:!0,type:\"module\"},l),(l=un.get(h))&&zd(r,l),g=a.createElement(\"script\"),ue(g),ye(g,\"link\",r),a.head.appendChild(g)),g={type:\"script\",instance:g,count:1,state:null},f.set(h,g))}}function O0(r,l,a,f){var h=(h=ut.current)?Ia(h):null;if(!h)throw Error(i(446));switch(r){case\"meta\":case\"title\":return null;case\"style\":return typeof a.precedence==\"string\"&&typeof a.href==\"string\"?(l=bs(a.href),a=_r(h).hoistableStyles,f=a.get(l),f||(f={type:\"style\",instance:null,count:0,state:null},a.set(l,f)),f):{type:\"void\",instance:null,count:0,state:null};case\"link\":if(a.rel===\"stylesheet\"&&typeof a.href==\"string\"&&typeof a.precedence==\"string\"){r=bs(a.href);var g=_r(h).hoistableStyles,S=g.get(r);if(S||(h=h.ownerDocument||h,S={type:\"stylesheet\",instance:null,count:0,state:{loading:0,preload:null}},g.set(r,S),(g=h.querySelector(Ll(r)))&&!g._p&&(S.instance=g,S.state.loading=5),un.has(r)||(a={rel:\"preload\",as:\"style\",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},un.set(r,a),g||RM(h,r,a,S.state))),l&&f===null)throw Error(i(528,\"\"));return S}if(l&&f!==null)throw Error(i(529,\"\"));return null;case\"script\":return l=a.async,a=a.src,typeof a==\"string\"&&l&&typeof l!=\"function\"&&typeof l!=\"symbol\"?(l=vs(a),a=_r(h).hoistableScripts,f=a.get(l),f||(f={type:\"script\",instance:null,count:0,state:null},a.set(l,f)),f):{type:\"void\",instance:null,count:0,state:null};default:throw Error(i(444,r))}}function bs(r){return'href=\"'+en(r)+'\"'}function Ll(r){return'link[rel=\"stylesheet\"]['+r+\"]\"}function w0(r){return m({},r,{\"data-precedence\":r.precedence,precedence:null})}function RM(r,l,a,f){r.querySelector('link[rel=\"preload\"][as=\"style\"]['+l+\"]\")?f.loading=1:(l=r.createElement(\"link\"),f.preload=l,l.addEventListener(\"load\",function(){return f.loading|=1}),l.addEventListener(\"error\",function(){return f.loading|=2}),ye(l,\"link\",a),ue(l),r.head.appendChild(l))}function vs(r){return'[src=\"'+en(r)+'\"]'}function zl(r){return\"script[async]\"+r}function N0(r,l,a){if(l.count++,l.instance===null)switch(l.type){case\"style\":var f=r.querySelector('style[data-href~=\"'+en(a.href)+'\"]');if(f)return l.instance=f,ue(f),f;var h=m({},a,{\"data-href\":a.href,\"data-precedence\":a.precedence,href:null,precedence:null});return f=(r.ownerDocument||r).createElement(\"style\"),ue(f),ye(f,\"style\",h),ja(f,a.precedence,r),l.instance=f;case\"stylesheet\":h=bs(a.href);var g=r.querySelector(Ll(h));if(g)return l.state.loading|=4,l.instance=g,ue(g),g;f=w0(a),(h=un.get(h))&&Ld(f,h),g=(r.ownerDocument||r).createElement(\"link\"),ue(g);var S=g;return S._p=new Promise(function(T,k){S.onload=T,S.onerror=k}),ye(g,\"link\",f),l.state.loading|=4,ja(g,a.precedence,r),l.instance=g;case\"script\":return g=vs(a.src),(h=r.querySelector(zl(g)))?(l.instance=h,ue(h),h):(f=a,(h=un.get(g))&&(f=m({},a),zd(f,h)),r=r.ownerDocument||r,h=r.createElement(\"script\"),ue(h),ye(h,\"link\",f),r.head.appendChild(h),l.instance=h);case\"void\":return null;default:throw Error(i(443,l.type))}else l.type===\"stylesheet\"&&(l.state.loading&4)===0&&(f=l.instance,l.state.loading|=4,ja(f,a.precedence,r));return l.instance}function ja(r,l,a){for(var f=a.querySelectorAll('link[rel=\"stylesheet\"][data-precedence],style[data-precedence]'),h=f.length?f[f.length-1]:null,g=h,S=0;S<f.length;S++){var T=f[S];if(T.dataset.precedence===l)g=T;else if(g!==h)break}g?g.parentNode.insertBefore(r,g.nextSibling):(l=a.nodeType===9?a.head:a,l.insertBefore(r,l.firstChild))}function Ld(r,l){r.crossOrigin==null&&(r.crossOrigin=l.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=l.referrerPolicy),r.title==null&&(r.title=l.title)}function zd(r,l){r.crossOrigin==null&&(r.crossOrigin=l.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=l.referrerPolicy),r.integrity==null&&(r.integrity=l.integrity)}var qa=null;function D0(r,l,a){if(qa===null){var f=new Map,h=qa=new Map;h.set(a,f)}else h=qa,f=h.get(a),f||(f=new Map,h.set(a,f));if(f.has(r))return f;for(f.set(r,null),a=a.getElementsByTagName(r),h=0;h<a.length;h++){var g=a[h];if(!(g[Ys]||g[Te]||r===\"link\"&&g.getAttribute(\"rel\")===\"stylesheet\")&&g.namespaceURI!==\"http://www.w3.org/2000/svg\"){var S=g.getAttribute(l)||\"\";S=r+S;var T=f.get(S);T?T.push(g):f.set(S,[g])}}return f}function R0(r,l,a){r=r.ownerDocument||r,r.head.insertBefore(a,l===\"title\"?r.querySelector(\"head > title\"):null)}function LM(r,l,a){if(a===1||l.itemProp!=null)return!1;switch(r){case\"meta\":case\"title\":return!0;case\"style\":if(typeof l.precedence!=\"string\"||typeof l.href!=\"string\"||l.href===\"\")break;return!0;case\"link\":if(typeof l.rel!=\"string\"||typeof l.href!=\"string\"||l.href===\"\"||l.onLoad||l.onError)break;switch(l.rel){case\"stylesheet\":return r=l.disabled,typeof l.precedence==\"string\"&&r==null;default:return!0}case\"script\":if(l.async&&typeof l.async!=\"function\"&&typeof l.async!=\"symbol\"&&!l.onLoad&&!l.onError&&l.src&&typeof l.src==\"string\")return!0}return!1}function L0(r){return!(r.type===\"stylesheet\"&&(r.state.loading&3)===0)}var Bl=null;function zM(){}function BM(r,l,a){if(Bl===null)throw Error(i(475));var f=Bl;if(l.type===\"stylesheet\"&&(typeof a.media!=\"string\"||matchMedia(a.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var h=bs(a.href),g=r.querySelector(Ll(h));if(g){r=g._p,r!==null&&typeof r==\"object\"&&typeof r.then==\"function\"&&(f.count++,f=Va.bind(f),r.then(f,f)),l.state.loading|=4,l.instance=g,ue(g);return}g=r.ownerDocument||r,a=w0(a),(h=un.get(h))&&Ld(a,h),g=g.createElement(\"link\"),ue(g);var S=g;S._p=new Promise(function(T,k){S.onload=T,S.onerror=k}),ye(g,\"link\",a),l.instance=g}f.stylesheets===null&&(f.stylesheets=new Map),f.stylesheets.set(l,r),(r=l.state.preload)&&(l.state.loading&3)===0&&(f.count++,l=Va.bind(f),r.addEventListener(\"load\",l),r.addEventListener(\"error\",l))}}function HM(){if(Bl===null)throw Error(i(475));var r=Bl;return r.stylesheets&&r.count===0&&Bd(r,r.stylesheets),0<r.count?function(l){var a=setTimeout(function(){if(r.stylesheets&&Bd(r,r.stylesheets),r.unsuspend){var f=r.unsuspend;r.unsuspend=null,f()}},6e4);return r.unsuspend=l,function(){r.unsuspend=null,clearTimeout(a)}}:null}function Va(){if(this.count--,this.count===0){if(this.stylesheets)Bd(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var $a=null;function Bd(r,l){r.stylesheets=null,r.unsuspend!==null&&(r.count++,$a=new Map,l.forEach(_M,r),$a=null,Va.call(r))}function _M(r,l){if(!(l.state.loading&4)){var a=$a.get(r);if(a)var f=a.get(null);else{a=new Map,$a.set(r,a);for(var h=r.querySelectorAll(\"link[data-precedence],style[data-precedence]\"),g=0;g<h.length;g++){var S=h[g];(S.nodeName===\"LINK\"||S.getAttribute(\"media\")!==\"not all\")&&(a.set(S.dataset.precedence,S),f=S)}f&&a.set(null,f)}h=l.instance,S=h.getAttribute(\"data-precedence\"),g=a.get(S)||f,g===f&&a.set(null,h),a.set(S,h),this.count++,f=Va.bind(this),h.addEventListener(\"load\",f),h.addEventListener(\"error\",f),g?g.parentNode.insertBefore(h,g.nextSibling):(r=r.nodeType===9?r.head:r,r.insertBefore(h,r.firstChild)),l.state.loading|=4}}var Hl={$$typeof:I,Provider:null,Consumer:null,_currentValue:it,_currentValue2:it,_threadCount:0};function UM(r,l,a,f,h,g,S,T){this.tag=1,this.containerInfo=r,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Nc(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Nc(0),this.hiddenUpdates=Nc(null),this.identifierPrefix=f,this.onUncaughtError=h,this.onCaughtError=g,this.onRecoverableError=S,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=T,this.incompleteTransitions=new Map}function z0(r,l,a,f,h,g,S,T,k,D,H,U){return r=new UM(r,l,a,S,T,k,D,U),l=1,g===!0&&(l|=24),g=Ke(3,null,null,l),r.current=g,g.stateNode=r,l=gf(),l.refCount++,r.pooledCache=l,l.refCount++,g.memoizedState={element:f,isDehydrated:a,cache:l},Sf(g),r}function B0(r){return r?(r=Fr,r):Fr}function H0(r,l,a,f,h,g){h=B0(h),f.context===null?f.context=h:f.pendingContext=h,f=hi(l),f.payload={element:a},g=g===void 0?null:g,g!==null&&(f.callback=g),a=pi(r,f,l),a!==null&&(Qe(a,r,l),dl(a,r,l))}function _0(r,l){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var a=r.retryLane;r.retryLane=a!==0&&a<l?a:l}}function Hd(r,l){_0(r,l),(r=r.alternate)&&_0(r,l)}function U0(r){if(r.tag===13){var l=Xr(r,67108864);l!==null&&Qe(l,r,67108864),Hd(r,67108864)}}var Pa=!0;function IM(r,l,a,f){var h=z.T;z.T=null;var g=G.p;try{G.p=2,_d(r,l,a,f)}finally{G.p=g,z.T=h}}function jM(r,l,a,f){var h=z.T;z.T=null;var g=G.p;try{G.p=8,_d(r,l,a,f)}finally{G.p=g,z.T=h}}function _d(r,l,a,f){if(Pa){var h=Ud(f);if(h===null)Md(r,l,f,Ka,a),j0(r,f);else if(VM(h,r,l,a,f))f.stopPropagation();else if(j0(r,f),l&4&&-1<qM.indexOf(r)){for(;h!==null;){var g=Hr(h);if(g!==null)switch(g.tag){case 3:if(g=g.stateNode,g.current.memoizedState.isDehydrated){var S=Qi(g.pendingLanes);if(S!==0){var T=g;for(T.pendingLanes|=2,T.entangledLanes|=2;S;){var k=1<<31-$e(S);T.entanglements[1]|=k,S&=~k}An(g),(wt&6)===0&&(Oa=En()+500,wl(0))}}break;case 13:T=Xr(g,2),T!==null&&Qe(T,g,2),Na(),Hd(g,2)}if(g=Ud(f),g===null&&Md(r,l,f,Ka,a),g===h)break;h=g}h!==null&&f.stopPropagation()}else Md(r,l,f,null,a)}}function Ud(r){return r=Vc(r),Id(r)}var Ka=null;function Id(r){if(Ka=null,r=Br(r),r!==null){var l=o(r);if(l===null)r=null;else{var a=l.tag;if(a===13){if(r=u(l),r!==null)return r;r=null}else if(a===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;r=null}else l!==r&&(r=null)}}return Ka=r,null}function I0(r){switch(r){case\"beforetoggle\":case\"cancel\":case\"click\":case\"close\":case\"contextmenu\":case\"copy\":case\"cut\":case\"auxclick\":case\"dblclick\":case\"dragend\":case\"dragstart\":case\"drop\":case\"focusin\":case\"focusout\":case\"input\":case\"invalid\":case\"keydown\":case\"keypress\":case\"keyup\":case\"mousedown\":case\"mouseup\":case\"paste\":case\"pause\":case\"play\":case\"pointercancel\":case\"pointerdown\":case\"pointerup\":case\"ratechange\":case\"reset\":case\"resize\":case\"seeked\":case\"submit\":case\"toggle\":case\"touchcancel\":case\"touchend\":case\"touchstart\":case\"volumechange\":case\"change\":case\"selectionchange\":case\"textInput\":case\"compositionstart\":case\"compositionend\":case\"compositionupdate\":case\"beforeblur\":case\"afterblur\":case\"beforeinput\":case\"blur\":case\"fullscreenchange\":case\"focus\":case\"hashchange\":case\"popstate\":case\"select\":case\"selectstart\":return 2;case\"drag\":case\"dragenter\":case\"dragexit\":case\"dragleave\":case\"dragover\":case\"mousemove\":case\"mouseout\":case\"mouseover\":case\"pointermove\":case\"pointerout\":case\"pointerover\":case\"scroll\":case\"touchmove\":case\"wheel\":case\"mouseenter\":case\"mouseleave\":case\"pointerenter\":case\"pointerleave\":return 8;case\"message\":switch(AT()){case Wp:return 2;case tm:return 8;case _o:case CT:return 32;case em:return 268435456;default:return 32}default:return 32}}var jd=!1,Ci=null,Oi=null,wi=null,_l=new Map,Ul=new Map,Ni=[],qM=\"mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset\".split(\" \");function j0(r,l){switch(r){case\"focusin\":case\"focusout\":Ci=null;break;case\"dragenter\":case\"dragleave\":Oi=null;break;case\"mouseover\":case\"mouseout\":wi=null;break;case\"pointerover\":case\"pointerout\":_l.delete(l.pointerId);break;case\"gotpointercapture\":case\"lostpointercapture\":Ul.delete(l.pointerId)}}function Il(r,l,a,f,h,g){return r===null||r.nativeEvent!==g?(r={blockedOn:l,domEventName:a,eventSystemFlags:f,nativeEvent:g,targetContainers:[h]},l!==null&&(l=Hr(l),l!==null&&U0(l)),r):(r.eventSystemFlags|=f,l=r.targetContainers,h!==null&&l.indexOf(h)===-1&&l.push(h),r)}function VM(r,l,a,f,h){switch(l){case\"focusin\":return Ci=Il(Ci,r,l,a,f,h),!0;case\"dragenter\":return Oi=Il(Oi,r,l,a,f,h),!0;case\"mouseover\":return wi=Il(wi,r,l,a,f,h),!0;case\"pointerover\":var g=h.pointerId;return _l.set(g,Il(_l.get(g)||null,r,l,a,f,h)),!0;case\"gotpointercapture\":return g=h.pointerId,Ul.set(g,Il(Ul.get(g)||null,r,l,a,f,h)),!0}return!1}function q0(r){var l=Br(r.target);if(l!==null){var a=o(l);if(a!==null){if(l=a.tag,l===13){if(l=u(a),l!==null){r.blockedOn=l,BT(r.priority,function(){if(a.tag===13){var f=Fe();f=Dc(f);var h=Xr(a,f);h!==null&&Qe(h,a,f),Hd(a,f)}});return}}else if(l===3&&a.stateNode.current.memoizedState.isDehydrated){r.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}r.blockedOn=null}function Ga(r){if(r.blockedOn!==null)return!1;for(var l=r.targetContainers;0<l.length;){var a=Ud(r.nativeEvent);if(a===null){a=r.nativeEvent;var f=new a.constructor(a.type,a);qc=f,a.target.dispatchEvent(f),qc=null}else return l=Hr(a),l!==null&&U0(l),r.blockedOn=a,!1;l.shift()}return!0}function V0(r,l,a){Ga(r)&&a.delete(l)}function $M(){jd=!1,Ci!==null&&Ga(Ci)&&(Ci=null),Oi!==null&&Ga(Oi)&&(Oi=null),wi!==null&&Ga(wi)&&(wi=null),_l.forEach(V0),Ul.forEach(V0)}function Ya(r,l){r.blockedOn===l&&(r.blockedOn=null,jd||(jd=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,$M)))}var Xa=null;function $0(r){Xa!==r&&(Xa=r,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Xa===r&&(Xa=null);for(var l=0;l<r.length;l+=3){var a=r[l],f=r[l+1],h=r[l+2];if(typeof f!=\"function\"){if(Id(f||a)===null)continue;break}var g=Hr(a);g!==null&&(r.splice(l,3),l-=3,If(g,{pending:!0,data:h,method:a.method,action:f},f,h))}}))}function jl(r){function l(k){return Ya(k,r)}Ci!==null&&Ya(Ci,r),Oi!==null&&Ya(Oi,r),wi!==null&&Ya(wi,r),_l.forEach(l),Ul.forEach(l);for(var a=0;a<Ni.length;a++){var f=Ni[a];f.blockedOn===r&&(f.blockedOn=null)}for(;0<Ni.length&&(a=Ni[0],a.blockedOn===null);)q0(a),a.blockedOn===null&&Ni.shift();if(a=(r.ownerDocument||r).$$reactFormReplay,a!=null)for(f=0;f<a.length;f+=3){var h=a[f],g=a[f+1],S=h[Be]||null;if(typeof g==\"function\")S||$0(a);else if(S){var T=null;if(g&&g.hasAttribute(\"formAction\")){if(h=g,S=g[Be]||null)T=S.formAction;else if(Id(h)!==null)continue}else T=S.action;typeof T==\"function\"?a[f+1]=T:(a.splice(f,3),f-=3),$0(a)}}}function qd(r){this._internalRoot=r}Fa.prototype.render=qd.prototype.render=function(r){var l=this._internalRoot;if(l===null)throw Error(i(409));var a=l.current,f=Fe();H0(a,f,r,l,null,null)},Fa.prototype.unmount=qd.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var l=r.containerInfo;H0(r.current,2,null,r,null,null),Na(),l[zr]=null}};function Fa(r){this._internalRoot=r}Fa.prototype.unstable_scheduleHydration=function(r){if(r){var l=lm();r={blockedOn:null,target:r,priority:l};for(var a=0;a<Ni.length&&l!==0&&l<Ni[a].priority;a++);Ni.splice(a,0,r),a===0&&q0(r)}};var P0=t.version;if(P0!==\"19.1.0\")throw Error(i(527,P0,\"19.1.0\"));G.findDOMNode=function(r){var l=r._reactInternals;if(l===void 0)throw typeof r.render==\"function\"?Error(i(188)):(r=Object.keys(r).join(\",\"),Error(i(268,r)));return r=d(l),r=r!==null?p(r):null,r=r===null?null:r.stateNode,r};var PM={bundleType:0,version:\"19.1.0\",rendererPackageName:\"react-dom\",currentDispatcherRef:z,reconcilerVersion:\"19.1.0\"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<\"u\"){var Qa=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Qa.isDisabled&&Qa.supportsFiber)try{Ps=Qa.inject(PM),Ve=Qa}catch{}}return Vl.createRoot=function(r,l){if(!s(r))throw Error(i(299));var a=!1,f=\"\",h=ly,g=oy,S=ay,T=null;return l!=null&&(l.unstable_strictMode===!0&&(a=!0),l.identifierPrefix!==void 0&&(f=l.identifierPrefix),l.onUncaughtError!==void 0&&(h=l.onUncaughtError),l.onCaughtError!==void 0&&(g=l.onCaughtError),l.onRecoverableError!==void 0&&(S=l.onRecoverableError),l.unstable_transitionCallbacks!==void 0&&(T=l.unstable_transitionCallbacks)),l=z0(r,1,!1,null,null,a,f,h,g,S,T,null),r[zr]=l.current,xd(r),new qd(l)},Vl.hydrateRoot=function(r,l,a){if(!s(r))throw Error(i(299));var f=!1,h=\"\",g=ly,S=oy,T=ay,k=null,D=null;return a!=null&&(a.unstable_strictMode===!0&&(f=!0),a.identifierPrefix!==void 0&&(h=a.identifierPrefix),a.onUncaughtError!==void 0&&(g=a.onUncaughtError),a.onCaughtError!==void 0&&(S=a.onCaughtError),a.onRecoverableError!==void 0&&(T=a.onRecoverableError),a.unstable_transitionCallbacks!==void 0&&(k=a.unstable_transitionCallbacks),a.formState!==void 0&&(D=a.formState)),l=z0(r,1,!0,l,a??null,f,h,g,S,T,k,D),l.context=B0(null),a=l.current,f=Fe(),f=Dc(f),h=hi(f),h.callback=null,pi(a,h,f),a=f,l.current.lanes=a,Gs(l,a),An(l),r[zr]=l.current,xd(r),new Fa(l)},Vl.version=\"19.1.0\",Vl}var tb;function WM(){if(tb)return $d.exports;tb=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>\"u\"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=\"function\"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(t){console.error(t)}}return n(),$d.exports=ZM(),$d.exports}var tk=WM(),Xd,eb;function p1(){if(eb)return Xd;eb=1;function n(t){var e=typeof t;return t!=null&&(e==\"object\"||e==\"function\")}return Xd=n,Xd}var Fd,nb;function ek(){if(nb)return Fd;nb=1;var n=typeof Ja==\"object\"&&Ja&&Ja.Object===Object&&Ja;return Fd=n,Fd}var Qd,ib;function m1(){if(ib)return Qd;ib=1;var n=ek(),t=typeof self==\"object\"&&self&&self.Object===Object&&self,e=n||t||Function(\"return this\")();return Qd=e,Qd}var Jd,rb;function nk(){if(rb)return Jd;rb=1;var n=m1(),t=function(){return n.Date.now()};return Jd=t,Jd}var Zd,sb;function ik(){if(sb)return Zd;sb=1;var n=/\\s/;function t(e){for(var i=e.length;i--&&n.test(e.charAt(i)););return i}return Zd=t,Zd}var Wd,lb;function rk(){if(lb)return Wd;lb=1;var n=ik(),t=/^\\s+/;function e(i){return i&&i.slice(0,n(i)+1).replace(t,\"\")}return Wd=e,Wd}var th,ob;function g1(){if(ob)return th;ob=1;var n=m1(),t=n.Symbol;return th=t,th}var eh,ab;function sk(){if(ab)return eh;ab=1;var n=g1(),t=Object.prototype,e=t.hasOwnProperty,i=t.toString,s=n?n.toStringTag:void 0;function o(u){var c=e.call(u,s),d=u[s];try{u[s]=void 0;var p=!0}catch{}var m=i.call(u);return p&&(c?u[s]=d:delete u[s]),m}return eh=o,eh}var nh,ub;function lk(){if(ub)return nh;ub=1;var n=Object.prototype,t=n.toString;function e(i){return t.call(i)}return nh=e,nh}var ih,cb;function ok(){if(cb)return ih;cb=1;var n=g1(),t=sk(),e=lk(),i=\"[object Null]\",s=\"[object Undefined]\",o=n?n.toStringTag:void 0;function u(c){return c==null?c===void 0?s:i:o&&o in Object(c)?t(c):e(c)}return ih=u,ih}var rh,fb;function ak(){if(fb)return rh;fb=1;function n(t){return t!=null&&typeof t==\"object\"}return rh=n,rh}var sh,db;function uk(){if(db)return sh;db=1;var n=ok(),t=ak(),e=\"[object Symbol]\";function i(s){return typeof s==\"symbol\"||t(s)&&n(s)==e}return sh=i,sh}var lh,hb;function ck(){if(hb)return lh;hb=1;var n=rk(),t=p1(),e=uk(),i=NaN,s=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,u=/^0o[0-7]+$/i,c=parseInt;function d(p){if(typeof p==\"number\")return p;if(e(p))return i;if(t(p)){var m=typeof p.valueOf==\"function\"?p.valueOf():p;p=t(m)?m+\"\":m}if(typeof p!=\"string\")return p===0?p:+p;p=n(p);var y=o.test(p);return y||u.test(p)?c(p.slice(2),y?2:8):s.test(p)?i:+p}return lh=d,lh}var oh,pb;function fk(){if(pb)return oh;pb=1;var n=p1(),t=nk(),e=ck(),i=\"Expected a function\",s=Math.max,o=Math.min;function u(c,d,p){var m,y,b,v,E,M,x=0,O=!1,B=!1,I=!0;if(typeof c!=\"function\")throw new TypeError(i);d=e(d)||0,n(p)&&(O=!!p.leading,B=\"maxWait\"in p,b=B?s(e(p.maxWait)||0,d):b,I=\"trailing\"in p?!!p.trailing:I);function q(vt){var Mt=m,gt=y;return m=y=void 0,x=vt,v=c.apply(gt,Mt),v}function P(vt){return x=vt,E=setTimeout(nt,d),O?q(vt):v}function et(vt){var Mt=vt-M,gt=vt-x,z=d-Mt;return B?o(z,b-gt):z}function Y(vt){var Mt=vt-M,gt=vt-x;return M===void 0||Mt>=d||Mt<0||B&>>=b}function nt(){var vt=t();if(Y(vt))return ct(vt);E=setTimeout(nt,et(vt))}function ct(vt){return E=void 0,I&&m?q(vt):(m=y=void 0,v)}function Et(){E!==void 0&&clearTimeout(E),x=0,m=M=y=E=void 0}function $t(){return E===void 0?v:ct(t())}function Dt(){var vt=t(),Mt=Y(vt);if(m=arguments,y=this,M=vt,Mt){if(E===void 0)return P(M);if(B)return clearTimeout(E),E=setTimeout(nt,d),q(M)}return E===void 0&&(E=setTimeout(nt,d)),v}return Dt.cancel=Et,Dt.flush=$t,Dt}return oh=u,oh}var dk=fk();const hk=mp(dk);var ie=wo();const Cr=mp(ie);function be(n){this.content=n}be.prototype={constructor:be,find:function(n){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===n)return t;return-1},get:function(n){var t=this.find(n);return t==-1?void 0:this.content[t+1]},update:function(n,t,e){var i=e&&e!=n?this.remove(e):this,s=i.find(n),o=i.content.slice();return s==-1?o.push(e||n,t):(o[s+1]=t,e&&(o[s]=e)),new be(o)},remove:function(n){var t=this.find(n);if(t==-1)return this;var e=this.content.slice();return e.splice(t,2),new be(e)},addToStart:function(n,t){return new be([n,t].concat(this.remove(n).content))},addToEnd:function(n,t){var e=this.remove(n).content.slice();return e.push(n,t),new be(e)},addBefore:function(n,t,e){var i=this.remove(t),s=i.content.slice(),o=i.find(n);return s.splice(o==-1?s.length:o,0,t,e),new be(s)},forEach:function(n){for(var t=0;t<this.content.length;t+=2)n(this.content[t],this.content[t+1])},prepend:function(n){return n=be.from(n),n.size?new be(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=be.from(n),n.size?new be(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var t=this;n=be.from(n);for(var e=0;e<n.content.length;e+=2)t=t.remove(n.content[e]);return t},toObject:function(){var n={};return this.forEach(function(t,e){n[t]=e}),n},get size(){return this.content.length>>1}};be.from=function(n){if(n instanceof be)return n;var t=[];if(n)for(var e in n)t.push(e,n[e]);return new be(t)};function y1(n,t,e){for(let i=0;;i++){if(i==n.childCount||i==t.childCount)return n.childCount==t.childCount?null:e;let s=n.child(i),o=t.child(i);if(s==o){e+=s.nodeSize;continue}if(!s.sameMarkup(o))return e;if(s.isText&&s.text!=o.text){let u=s.text,c=o.text,d=0;for(;u[d]==c[d];d++)e++;return d&&d<u.length&&d<c.length&&S1(u.charCodeAt(d-1))&&v1(u.charCodeAt(d))&&e--,e}if(s.content.size||o.content.size){let u=y1(s.content,o.content,e+1);if(u!=null)return u}e+=s.nodeSize}}function b1(n,t,e,i){for(let s=n.childCount,o=t.childCount;;){if(s==0||o==0)return s==o?null:{a:e,b:i};let u=n.child(--s),c=t.child(--o),d=u.nodeSize;if(u==c){e-=d,i-=d;continue}if(!u.sameMarkup(c))return{a:e,b:i};if(u.isText&&u.text!=c.text){let p=u.text,m=c.text,y=p.length,b=m.length;for(;y>0&&b>0&&p[y-1]==m[b-1];)y--,b--,e--,i--;return y&&b&&y<p.length&&S1(p.charCodeAt(y-1))&&v1(p.charCodeAt(y))&&(e++,i++),{a:e,b:i}}if(u.content.size||c.content.size){let p=b1(u.content,c.content,e-1,i-1);if(p)return p}e-=d,i-=d}}function v1(n){return n>=56320&&n<57344}function S1(n){return n>=55296&&n<56320}class j{constructor(t,e){if(this.content=t,this.size=e||0,e==null)for(let i=0;i<t.length;i++)this.size+=t[i].nodeSize}nodesBetween(t,e,i,s=0,o){for(let u=0,c=0;c<e;u++){let d=this.content[u],p=c+d.nodeSize;if(p>t&&i(d,s+c,o||null,u)!==!1&&d.content.size){let m=c+1;d.nodesBetween(Math.max(0,t-m),Math.min(d.content.size,e-m),i,s+m)}c=p}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,e,i,s){let o=\"\",u=!0;return this.nodesBetween(t,e,(c,d)=>{let p=c.isText?c.text.slice(Math.max(t,d)-d,e-d):c.isLeaf?s?typeof s==\"function\"?s(c):s:c.type.spec.leafText?c.type.spec.leafText(c):\"\":\"\";c.isBlock&&(c.isLeaf&&p||c.isTextblock)&&i&&(u?u=!1:o+=i),o+=p},0),o}append(t){if(!t.size)return this;if(!this.size)return t;let e=this.lastChild,i=t.firstChild,s=this.content.slice(),o=0;for(e.isText&&e.sameMarkup(i)&&(s[s.length-1]=e.withText(e.text+i.text),o=1);o<t.content.length;o++)s.push(t.content[o]);return new j(s,this.size+t.size)}cut(t,e=this.size){if(t==0&&e==this.size)return this;let i=[],s=0;if(e>t)for(let o=0,u=0;u<e;o++){let c=this.content[o],d=u+c.nodeSize;d>t&&((u<t||d>e)&&(c.isText?c=c.cut(Math.max(0,t-u),Math.min(c.text.length,e-u)):c=c.cut(Math.max(0,t-u-1),Math.min(c.content.size,e-u-1))),i.push(c),s+=c.nodeSize),u=d}return new j(i,s)}cutByIndex(t,e){return t==e?j.empty:t==0&&e==this.content.length?this:new j(this.content.slice(t,e))}replaceChild(t,e){let i=this.content[t];if(i==e)return this;let s=this.content.slice(),o=this.size+e.nodeSize-i.nodeSize;return s[t]=e,new j(s,o)}addToStart(t){return new j([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new j(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let e=0;e<this.content.length;e++)if(!this.content[e].eq(t.content[e]))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(t){let e=this.content[t];if(!e)throw new RangeError(\"Index \"+t+\" out of range for \"+this);return e}maybeChild(t){return this.content[t]||null}forEach(t){for(let e=0,i=0;e<this.content.length;e++){let s=this.content[e];t(s,i,e),i+=s.nodeSize}}findDiffStart(t,e=0){return y1(this,t,e)}findDiffEnd(t,e=this.size,i=t.size){return b1(this,t,e,i)}findIndex(t){if(t==0)return Za(0,t);if(t==this.size)return Za(this.content.length,t);if(t>this.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let e=0,i=0;;e++){let s=this.child(e),o=i+s.nodeSize;if(o>=t)return o==t?Za(e+1,o):Za(e,i);i=o}}toString(){return\"<\"+this.toStringInner()+\">\"}toStringInner(){return this.content.join(\", \")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,e){if(!e)return j.empty;if(!Array.isArray(e))throw new RangeError(\"Invalid input for Fragment.fromJSON\");return j.fromArray(e.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return j.empty;let e,i=0;for(let s=0;s<t.length;s++){let o=t[s];i+=o.nodeSize,s&&o.isText&&t[s-1].sameMarkup(o)?(e||(e=t.slice(0,s)),e[e.length-1]=o.withText(e[e.length-1].text+o.text)):e&&e.push(o)}return new j(e||t,i)}static from(t){if(!t)return j.empty;if(t instanceof j)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new j([t],t.nodeSize);throw new RangeError(\"Can not convert \"+t+\" to a Fragment\"+(t.nodesBetween?\" (looks like multiple versions of prosemirror-model were loaded)\":\"\"))}}j.empty=new j([],0);const ah={index:0,offset:0};function Za(n,t){return ah.index=n,ah.offset=t,ah}function vu(n,t){if(n===t)return!0;if(!(n&&typeof n==\"object\")||!(t&&typeof t==\"object\"))return!1;let e=Array.isArray(n);if(Array.isArray(t)!=e)return!1;if(e){if(n.length!=t.length)return!1;for(let i=0;i<n.length;i++)if(!vu(n[i],t[i]))return!1}else{for(let i in n)if(!(i in t)||!vu(n[i],t[i]))return!1;for(let i in t)if(!(i in n))return!1}return!0}let Ut=class zh{constructor(t,e){this.type=t,this.attrs=e}addToSet(t){let e,i=!1;for(let s=0;s<t.length;s++){let o=t[s];if(this.eq(o))return t;if(this.type.excludes(o.type))e||(e=t.slice(0,s));else{if(o.type.excludes(this.type))return t;!i&&o.type.rank>this.type.rank&&(e||(e=t.slice(0,s)),e.push(this),i=!0),e&&e.push(o)}}return e||(e=t.slice()),i||e.push(this),e}removeFromSet(t){for(let e=0;e<t.length;e++)if(this.eq(t[e]))return t.slice(0,e).concat(t.slice(e+1));return t}isInSet(t){for(let e=0;e<t.length;e++)if(this.eq(t[e]))return!0;return!1}eq(t){return this==t||this.type==t.type&&vu(this.attrs,t.attrs)}toJSON(){let t={type:this.type.name};for(let e in this.attrs){t.attrs=this.attrs;break}return t}static fromJSON(t,e){if(!e)throw new RangeError(\"Invalid input for Mark.fromJSON\");let i=t.marks[e.type];if(!i)throw new RangeError(`There is no mark type ${e.type} in this schema`);return i.create(e.attrs)}static sameSet(t,e){if(t==e)return!0;if(t.length!=e.length)return!1;for(let i=0;i<t.length;i++)if(!t[i].eq(e[i]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return zh.none;if(t instanceof zh)return[t];let e=t.slice();return e.sort((i,s)=>i.type.rank-s.type.rank),e}};Ut.none=[];class bo extends Error{}class X{constructor(t,e,i){this.content=t,this.openStart=e,this.openEnd=i}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,e){let i=T1(this.content,t+this.openStart,e,this.openStart+1,this.openEnd+1);return i&&new X(i,this.openStart,this.openEnd)}removeBetween(t,e){return new X(E1(this.content,t+this.openStart,e+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+\"(\"+this.openStart+\",\"+this.openEnd+\")\"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,e){if(!e)return X.empty;let i=e.openStart||0,s=e.openEnd||0;if(typeof i!=\"number\"||typeof s!=\"number\")throw new RangeError(\"Invalid input for Slice.fromJSON\");return new X(j.fromJSON(t,e.content),i,s)}static maxOpen(t,e=!0){let i=0,s=0;for(let o=t.firstChild;o&&!o.isLeaf&&(e||!o.type.spec.isolating);o=o.firstChild)i++;for(let o=t.lastChild;o&&!o.isLeaf&&(e||!o.type.spec.isolating);o=o.lastChild)s++;return new X(t,i,s)}}X.empty=new X(j.empty,0,0);function E1(n,t,e){let{index:i,offset:s}=n.findIndex(t),o=n.maybeChild(i),{index:u,offset:c}=n.findIndex(e);if(s==t||o.isText){if(c!=e&&!n.child(u).isText)throw new RangeError(\"Removing non-flat range\");return n.cut(0,t).append(n.cut(e))}if(i!=u)throw new RangeError(\"Removing non-flat range\");return n.replaceChild(i,o.copy(E1(o.content,t-s-1,e-s-1)))}function T1(n,t,e,i,s,o){let{index:u,offset:c}=n.findIndex(t),d=n.maybeChild(u);if(c==t||d.isText)return o&&i<=0&&s<=0&&!o.canReplace(u,u,e)?null:n.cut(0,t).append(e).append(n.cut(t));let p=T1(d.content,t-c-1,e,u==0?i-1:0,u==n.childCount-1?s-1:0,d);return p&&n.replaceChild(u,d.copy(p))}function pk(n,t,e){if(e.openStart>n.depth)throw new bo(\"Inserted content deeper than insertion position\");if(n.depth-e.openStart!=t.depth-e.openEnd)throw new bo(\"Inconsistent open depths\");return x1(n,t,e,0)}function x1(n,t,e,i){let s=n.index(i),o=n.node(i);if(s==t.index(i)&&i<n.depth-e.openStart){let u=x1(n,t,e,i+1);return o.copy(o.content.replaceChild(s,u))}else if(e.content.size)if(!e.openStart&&!e.openEnd&&n.depth==i&&t.depth==i){let u=n.parent,c=u.content;return xr(u,c.cut(0,n.parentOffset).append(e.content).append(c.cut(t.parentOffset)))}else{let{start:u,end:c}=mk(e,n);return xr(o,k1(n,u,c,t,i))}else return xr(o,Su(n,t,i))}function M1(n,t){if(!t.type.compatibleContent(n.type))throw new bo(\"Cannot join \"+t.type.name+\" onto \"+n.type.name)}function Bh(n,t,e){let i=n.node(e);return M1(i,t.node(e)),i}function Tr(n,t){let e=t.length-1;e>=0&&n.isText&&n.sameMarkup(t[e])?t[e]=n.withText(t[e].text+n.text):t.push(n)}function io(n,t,e,i){let s=(t||n).node(e),o=0,u=t?t.index(e):s.childCount;n&&(o=n.index(e),n.depth>e?o++:n.textOffset&&(Tr(n.nodeAfter,i),o++));for(let c=o;c<u;c++)Tr(s.child(c),i);t&&t.depth==e&&t.textOffset&&Tr(t.nodeBefore,i)}function xr(n,t){if(!n.type.validContent(t))throw new bo(\"Invalid content for node \"+n.type.name);return n.copy(t)}function k1(n,t,e,i,s){let o=n.depth>s&&Bh(n,t,s+1),u=i.depth>s&&Bh(e,i,s+1),c=[];return io(null,n,s,c),o&&u&&t.index(s)==e.index(s)?(M1(o,u),Tr(xr(o,k1(n,t,e,i,s+1)),c)):(o&&Tr(xr(o,Su(n,t,s+1)),c),io(t,e,s,c),u&&Tr(xr(u,Su(e,i,s+1)),c)),io(i,null,s,c),new j(c)}function Su(n,t,e){let i=[];if(io(null,n,e,i),n.depth>e){let s=Bh(n,t,e+1);Tr(xr(s,Su(n,t,e+1)),i)}return io(t,null,e,i),new j(i)}function mk(n,t){let e=t.depth-n.openStart,s=t.node(e).copy(n.content);for(let o=e-1;o>=0;o--)s=t.node(o).copy(j.from(s));return{start:s.resolveNoCache(n.openStart+e),end:s.resolveNoCache(s.content.size-n.openEnd-e)}}class vo{constructor(t,e,i){this.pos=t,this.path=e,this.parentOffset=i,this.depth=e.length/3-1}resolveDepth(t){return t==null?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[this.resolveDepth(t)*3]}index(t){return this.path[this.resolveDepth(t)*3+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t==this.depth&&!this.textOffset?0:1)}start(t){return t=this.resolveDepth(t),t==0?0:this.path[t*3-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(t=this.resolveDepth(t),!t)throw new RangeError(\"There is no position before the top-level node\");return t==this.depth+1?this.pos:this.path[t*3-1]}after(t){if(t=this.resolveDepth(t),!t)throw new RangeError(\"There is no position after the top-level node\");return t==this.depth+1?this.pos:this.path[t*3-1]+this.path[t*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,e=this.index(this.depth);if(e==t.childCount)return null;let i=this.pos-this.path[this.path.length-1],s=t.child(e);return i?t.child(e).cut(i):s}get nodeBefore(){let t=this.index(this.depth),e=this.pos-this.path[this.path.length-1];return e?this.parent.child(t).cut(0,e):t==0?null:this.parent.child(t-1)}posAtIndex(t,e){e=this.resolveDepth(e);let i=this.path[e*3],s=e==0?0:this.path[e*3-1]+1;for(let o=0;o<t;o++)s+=i.child(o).nodeSize;return s}marks(){let t=this.parent,e=this.index();if(t.content.size==0)return Ut.none;if(this.textOffset)return t.child(e).marks;let i=t.maybeChild(e-1),s=t.maybeChild(e);if(!i){let c=i;i=s,s=c}let o=i.marks;for(var u=0;u<o.length;u++)o[u].type.spec.inclusive===!1&&(!s||!o[u].isInSet(s.marks))&&(o=o[u--].removeFromSet(o));return o}marksAcross(t){let e=this.parent.maybeChild(this.index());if(!e||!e.isInline)return null;let i=e.marks,s=t.parent.maybeChild(t.index());for(var o=0;o<i.length;o++)i[o].type.spec.inclusive===!1&&(!s||!i[o].isInSet(s.marks))&&(i=i[o--].removeFromSet(i));return i}sharedDepth(t){for(let e=this.depth;e>0;e--)if(this.start(e)<=t&&this.end(e)>=t)return e;return 0}blockRange(t=this,e){if(t.pos<this.pos)return t.blockRange(this);for(let i=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);i>=0;i--)if(t.pos<=this.end(i)&&(!e||e(this.node(i))))return new Eu(this,t,i);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos<this.pos?t:this}toString(){let t=\"\";for(let e=1;e<=this.depth;e++)t+=(t?\"/\":\"\")+this.node(e).type.name+\"_\"+this.index(e-1);return t+\":\"+this.parentOffset}static resolve(t,e){if(!(e>=0&&e<=t.content.size))throw new RangeError(\"Position \"+e+\" out of range\");let i=[],s=0,o=e;for(let u=t;;){let{index:c,offset:d}=u.content.findIndex(o),p=o-d;if(i.push(u,c,s+d),!p||(u=u.child(c),u.isText))break;o=p-1,s+=d+1}return new vo(e,i,o)}static resolveCached(t,e){let i=mb.get(t);if(i)for(let o=0;o<i.elts.length;o++){let u=i.elts[o];if(u.pos==e)return u}else mb.set(t,i=new gk);let s=i.elts[i.i]=vo.resolve(t,e);return i.i=(i.i+1)%yk,s}}class gk{constructor(){this.elts=[],this.i=0}}const yk=12,mb=new WeakMap;class Eu{constructor(t,e,i){this.$from=t,this.$to=e,this.depth=i}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)}}const bk=Object.create(null);let Mr=class Hh{constructor(t,e,i,s=Ut.none){this.type=t,this.attrs=e,this.marks=s,this.content=i||j.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(t){return this.content.child(t)}maybeChild(t){return this.content.maybeChild(t)}forEach(t){this.content.forEach(t)}nodesBetween(t,e,i,s=0){this.content.nodesBetween(t,e,i,s,this)}descendants(t){this.nodesBetween(0,this.content.size,t)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,\"\")}textBetween(t,e,i,s){return this.content.textBetween(t,e,i,s)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)}sameMarkup(t){return this.hasMarkup(t.type,t.attrs,t.marks)}hasMarkup(t,e,i){return this.type==t&&vu(this.attrs,e||t.defaultAttrs||bk)&&Ut.sameSet(this.marks,i||Ut.none)}copy(t=null){return t==this.content?this:new Hh(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new Hh(this.type,this.attrs,this.content,t)}cut(t,e=this.content.size){return t==0&&e==this.content.size?this:this.copy(this.content.cut(t,e))}slice(t,e=this.content.size,i=!1){if(t==e)return X.empty;let s=this.resolve(t),o=this.resolve(e),u=i?0:s.sharedDepth(e),c=s.start(u),p=s.node(u).content.cut(s.pos-c,o.pos-c);return new X(p,s.depth-u,o.depth-u)}replace(t,e,i){return pk(this.resolve(t),this.resolve(e),i)}nodeAt(t){for(let e=this;;){let{index:i,offset:s}=e.content.findIndex(t);if(e=e.maybeChild(i),!e)return null;if(s==t||e.isText)return e;t-=s+1}}childAfter(t){let{index:e,offset:i}=this.content.findIndex(t);return{node:this.content.maybeChild(e),index:e,offset:i}}childBefore(t){if(t==0)return{node:null,index:0,offset:0};let{index:e,offset:i}=this.content.findIndex(t);if(i<t)return{node:this.content.child(e),index:e,offset:i};let s=this.content.child(e-1);return{node:s,index:e-1,offset:i-s.nodeSize}}resolve(t){return vo.resolveCached(this,t)}resolveNoCache(t){return vo.resolve(this,t)}rangeHasMark(t,e,i){let s=!1;return e>t&&this.nodesBetween(t,e,o=>(i.isInSet(o.marks)&&(s=!0),!s)),s}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 t=this.type.name;return this.content.size&&(t+=\"(\"+this.content.toStringInner()+\")\"),A1(this.marks,t)}contentMatchAt(t){let e=this.type.contentMatch.matchFragment(this.content,0,t);if(!e)throw new Error(\"Called contentMatchAt on a node with invalid content\");return e}canReplace(t,e,i=j.empty,s=0,o=i.childCount){let u=this.contentMatchAt(t).matchFragment(i,s,o),c=u&&u.matchFragment(this.content,e);if(!c||!c.validEnd)return!1;for(let d=s;d<o;d++)if(!this.type.allowsMarks(i.child(d).marks))return!1;return!0}canReplaceWith(t,e,i,s){if(s&&!this.type.allowsMarks(s))return!1;let o=this.contentMatchAt(t).matchType(i),u=o&&o.matchFragment(this.content,e);return u?u.validEnd:!1}canAppend(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)}check(){this.type.checkContent(this.content),gb(this.type.attrs,this.attrs,\"node\",this.type.name);let t=Ut.none;for(let e=0;e<this.marks.length;e++){let i=this.marks[e];gb(i.type.attrs,i.attrs,\"mark\",i.type.name),t=i.addToSet(t)}if(!Ut.sameSet(t,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let t={type:this.type.name};for(let e in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(e=>e.toJSON())),t}static fromJSON(t,e){if(!e)throw new RangeError(\"Invalid input for Node.fromJSON\");let i;if(e.marks){if(!Array.isArray(e.marks))throw new RangeError(\"Invalid mark data for Node.fromJSON\");i=e.marks.map(t.markFromJSON)}if(e.type==\"text\"){if(typeof e.text!=\"string\")throw new RangeError(\"Invalid text node in JSON\");return t.text(e.text,i)}let s=j.fromJSON(t,e.content);return t.nodeType(e.type).create(e.attrs,s,i)}};Mr.prototype.text=void 0;class Tu extends Mr{constructor(t,e,i,s){if(super(t,e,null,s),!i)throw new RangeError(\"Empty text nodes are not allowed\");this.text=i}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):A1(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,e){return this.text.slice(t,e)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new Tu(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new Tu(this.type,this.attrs,t,this.marks)}cut(t=0,e=this.text.length){return t==0&&e==this.text.length?this:this.withText(this.text.slice(t,e))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function A1(n,t){for(let e=n.length-1;e>=0;e--)t=n[e].type.name+\"(\"+t+\")\";return t}function gb(n,t,e,i){for(let s in t)if(!(s in n))throw new RangeError(`Unsupported attribute ${s} for ${e} of type ${i}`);for(let s in n)n[s].validate&&n[s].validate(t[s])}class Or{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,e){let i=new vk(t,e);if(i.next==null)return Or.empty;let s=C1(i);i.next&&i.err(\"Unexpected trailing text\");let o=Ak(kk(s));return Ck(o,i),o}matchType(t){for(let e=0;e<this.next.length;e++)if(this.next[e].type==t)return this.next[e].next;return null}matchFragment(t,e=0,i=t.childCount){let s=this;for(let o=e;s&&o<i;o++)s=s.matchType(t.child(o).type);return s}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let t=0;t<this.next.length;t++){let{type:e}=this.next[t];if(!(e.isText||e.hasRequiredAttrs()))return e}return null}compatible(t){for(let e=0;e<this.next.length;e++)for(let i=0;i<t.next.length;i++)if(this.next[e].type==t.next[i].type)return!0;return!1}fillBefore(t,e=!1,i=0){let s=[this];function o(u,c){let d=u.matchFragment(t,i);if(d&&(!e||d.validEnd))return j.from(c.map(p=>p.createAndFill()));for(let p=0;p<u.next.length;p++){let{type:m,next:y}=u.next[p];if(!(m.isText||m.hasRequiredAttrs())&&s.indexOf(y)==-1){s.push(y);let b=o(y,c.concat(m));if(b)return b}}return null}return o(this,[])}findWrapping(t){for(let i=0;i<this.wrapCache.length;i+=2)if(this.wrapCache[i]==t)return this.wrapCache[i+1];let e=this.computeWrapping(t);return this.wrapCache.push(t,e),e}computeWrapping(t){let e=Object.create(null),i=[{match:this,type:null,via:null}];for(;i.length;){let s=i.shift(),o=s.match;if(o.matchType(t)){let u=[];for(let c=s;c.type;c=c.via)u.push(c.type);return u.reverse()}for(let u=0;u<o.next.length;u++){let{type:c,next:d}=o.next[u];!c.isLeaf&&!c.hasRequiredAttrs()&&!(c.name in e)&&(!s.type||d.validEnd)&&(i.push({match:c.contentMatch,type:c,via:s}),e[c.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(t){if(t>=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];function e(i){t.push(i);for(let s=0;s<i.next.length;s++)t.indexOf(i.next[s].next)==-1&&e(i.next[s].next)}return e(this),t.map((i,s)=>{let o=s+(i.validEnd?\"*\":\" \")+\" \";for(let u=0;u<i.next.length;u++)o+=(u?\", \":\"\")+i.next[u].type.name+\"->\"+t.indexOf(i.next[u].next);return o}).join(`\n`)}}Or.empty=new Or(!0);class vk{constructor(t,e){this.string=t,this.nodeTypes=e,this.inline=null,this.pos=0,this.tokens=t.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(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+\" (in content expression '\"+this.string+\"')\")}}function C1(n){let t=[];do t.push(Sk(n));while(n.eat(\"|\"));return t.length==1?t[0]:{type:\"choice\",exprs:t}}function Sk(n){let t=[];do t.push(Ek(n));while(n.next&&n.next!=\")\"&&n.next!=\"|\");return t.length==1?t[0]:{type:\"seq\",exprs:t}}function Ek(n){let t=Mk(n);for(;;)if(n.eat(\"+\"))t={type:\"plus\",expr:t};else if(n.eat(\"*\"))t={type:\"star\",expr:t};else if(n.eat(\"?\"))t={type:\"opt\",expr:t};else if(n.eat(\"{\"))t=Tk(n,t);else break;return t}function yb(n){/\\D/.test(n.next)&&n.err(\"Expected number, got '\"+n.next+\"'\");let t=Number(n.next);return n.pos++,t}function Tk(n,t){let e=yb(n),i=e;return n.eat(\",\")&&(n.next!=\"}\"?i=yb(n):i=-1),n.eat(\"}\")||n.err(\"Unclosed braced range\"),{type:\"range\",min:e,max:i,expr:t}}function xk(n,t){let e=n.nodeTypes,i=e[t];if(i)return[i];let s=[];for(let o in e){let u=e[o];u.isInGroup(t)&&s.push(u)}return s.length==0&&n.err(\"No node type or group '\"+t+\"' found\"),s}function Mk(n){if(n.eat(\"(\")){let t=C1(n);return n.eat(\")\")||n.err(\"Missing closing paren\"),t}else if(/\\W/.test(n.next))n.err(\"Unexpected token '\"+n.next+\"'\");else{let t=xk(n,n.next).map(e=>(n.inline==null?n.inline=e.isInline:n.inline!=e.isInline&&n.err(\"Mixing inline and block content\"),{type:\"name\",value:e}));return n.pos++,t.length==1?t[0]:{type:\"choice\",exprs:t}}}function kk(n){let t=[[]];return s(o(n,0),e()),t;function e(){return t.push([])-1}function i(u,c,d){let p={term:d,to:c};return t[u].push(p),p}function s(u,c){u.forEach(d=>d.to=c)}function o(u,c){if(u.type==\"choice\")return u.exprs.reduce((d,p)=>d.concat(o(p,c)),[]);if(u.type==\"seq\")for(let d=0;;d++){let p=o(u.exprs[d],c);if(d==u.exprs.length-1)return p;s(p,c=e())}else if(u.type==\"star\"){let d=e();return i(c,d),s(o(u.expr,d),d),[i(d)]}else if(u.type==\"plus\"){let d=e();return s(o(u.expr,c),d),s(o(u.expr,d),d),[i(d)]}else{if(u.type==\"opt\")return[i(c)].concat(o(u.expr,c));if(u.type==\"range\"){let d=c;for(let p=0;p<u.min;p++){let m=e();s(o(u.expr,d),m),d=m}if(u.max==-1)s(o(u.expr,d),d);else for(let p=u.min;p<u.max;p++){let m=e();i(d,m),s(o(u.expr,d),m),d=m}return[i(d)]}else{if(u.type==\"name\")return[i(c,void 0,u.value)];throw new Error(\"Unknown expr type\")}}}}function O1(n,t){return t-n}function bb(n,t){let e=[];return i(t),e.sort(O1);function i(s){let o=n[s];if(o.length==1&&!o[0].term)return i(o[0].to);e.push(s);for(let u=0;u<o.length;u++){let{term:c,to:d}=o[u];!c&&e.indexOf(d)==-1&&i(d)}}}function Ak(n){let t=Object.create(null);return e(bb(n,0));function e(i){let s=[];i.forEach(u=>{n[u].forEach(({term:c,to:d})=>{if(!c)return;let p;for(let m=0;m<s.length;m++)s[m][0]==c&&(p=s[m][1]);bb(n,d).forEach(m=>{p||s.push([c,p=[]]),p.indexOf(m)==-1&&p.push(m)})})});let o=t[i.join(\",\")]=new Or(i.indexOf(n.length-1)>-1);for(let u=0;u<s.length;u++){let c=s[u][1].sort(O1);o.next.push({type:s[u][0],next:t[c.join(\",\")]||e(c)})}return o}}function Ck(n,t){for(let e=0,i=[n];e<i.length;e++){let s=i[e],o=!s.validEnd,u=[];for(let c=0;c<s.next.length;c++){let{type:d,next:p}=s.next[c];u.push(d.name),o&&!(d.isText||d.hasRequiredAttrs())&&(o=!1),i.indexOf(p)==-1&&i.push(p)}o&&t.err(\"Only non-generatable nodes (\"+u.join(\", \")+\") in a required position (see https://prosemirror.net/docs/guide/#generatable)\")}}function w1(n){let t=Object.create(null);for(let e in n){let i=n[e];if(!i.hasDefault)return null;t[e]=i.default}return t}function N1(n,t){let e=Object.create(null);for(let i in n){let s=n[i],o=t&&t[i];if(o===void 0)if(s.hasDefault)o=s.default;else throw new RangeError(\"No value supplied for attribute \"+i);else s.validate&&s.validate(o);e[i]=o}return e}function D1(n,t){let e=Object.create(null);if(t)for(let i in t)e[i]=new wk(n,i,t[i]);return e}let vb=class R1{constructor(t,e,i){this.name=t,this.schema=e,this.spec=i,this.markSet=null,this.groups=i.group?i.group.split(\" \"):[],this.attrs=D1(t,i.attrs),this.defaultAttrs=w1(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(i.inline||t==\"text\"),this.isText=t==\"text\"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Or.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(t){return this.groups.indexOf(t)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?\"pre\":\"normal\")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}compatibleContent(t){return this==t||this.contentMatch.compatible(t.contentMatch)}computeAttrs(t){return!t&&this.defaultAttrs?this.defaultAttrs:N1(this.attrs,t)}create(t=null,e,i){if(this.isText)throw new Error(\"NodeType.create can't construct text nodes\");return new Mr(this,this.computeAttrs(t),j.from(e),Ut.setFrom(i))}createChecked(t=null,e,i){return e=j.from(e),this.checkContent(e),new Mr(this,this.computeAttrs(t),e,Ut.setFrom(i))}createAndFill(t=null,e,i){if(t=this.computeAttrs(t),e=j.from(e),e.size){let u=this.contentMatch.fillBefore(e);if(!u)return null;e=u.append(e)}let s=this.contentMatch.matchFragment(e),o=s&&s.fillBefore(j.empty,!0);return o?new Mr(this,t,e.append(o),Ut.setFrom(i)):null}validContent(t){let e=this.contentMatch.matchFragment(t);if(!e||!e.validEnd)return!1;for(let i=0;i<t.childCount;i++)if(!this.allowsMarks(t.child(i).marks))return!1;return!0}checkContent(t){if(!this.validContent(t))throw new RangeError(`Invalid content for node ${this.name}: ${t.toString().slice(0,50)}`)}checkAttrs(t){}allowsMarkType(t){return this.markSet==null||this.markSet.indexOf(t)>-1}allowsMarks(t){if(this.markSet==null)return!0;for(let e=0;e<t.length;e++)if(!this.allowsMarkType(t[e].type))return!1;return!0}allowedMarks(t){if(this.markSet==null)return t;let e;for(let i=0;i<t.length;i++)this.allowsMarkType(t[i].type)?e&&e.push(t[i]):e||(e=t.slice(0,i));return e?e.length?e:Ut.none:t}static compile(t,e){let i=Object.create(null);t.forEach((o,u)=>i[o]=new R1(o,e,u));let s=e.spec.topNode||\"doc\";if(!i[s])throw new RangeError(\"Schema is missing its top node type ('\"+s+\"')\");if(!i.text)throw new RangeError(\"Every schema needs a 'text' type\");for(let o in i.text.attrs)throw new RangeError(\"The text node type should not have attributes\");return i}};function Ok(n,t,e){let i=e.split(\"|\");return s=>{let o=s===null?\"null\":typeof s;if(i.indexOf(o)<0)throw new RangeError(`Expected value of type ${i} for attribute ${t} on type ${n}, got ${o}`)}}class wk{constructor(t,e,i){this.hasDefault=Object.prototype.hasOwnProperty.call(i,\"default\"),this.default=i.default,this.validate=typeof i.validate==\"string\"?Ok(t,e,i.validate):i.validate}get isRequired(){return!this.hasDefault}}class oc{constructor(t,e,i,s){this.name=t,this.rank=e,this.schema=i,this.spec=s,this.attrs=D1(t,s.attrs),this.excluded=null;let o=w1(this.attrs);this.instance=o?new Ut(this,o):null}create(t=null){return!t&&this.instance?this.instance:new Ut(this,N1(this.attrs,t))}static compile(t,e){let i=Object.create(null),s=0;return t.forEach((o,u)=>i[o]=new oc(o,s++,e,u)),i}removeFromSet(t){for(var e=0;e<t.length;e++)t[e].type==this&&(t=t.slice(0,e).concat(t.slice(e+1)),e--);return t}isInSet(t){for(let e=0;e<t.length;e++)if(t[e].type==this)return t[e]}excludes(t){return this.excluded.indexOf(t)>-1}}class hu{constructor(t){this.linebreakReplacement=null,this.cached=Object.create(null);let e=this.spec={};for(let s in t)e[s]=t[s];e.nodes=be.from(t.nodes),e.marks=be.from(t.marks||{}),this.nodes=vb.compile(this.spec.nodes,this),this.marks=oc.compile(this.spec.marks,this);let i=Object.create(null);for(let s in this.nodes){if(s in this.marks)throw new RangeError(s+\" can not be both a node and a mark\");let o=this.nodes[s],u=o.spec.content||\"\",c=o.spec.marks;if(o.contentMatch=i[u]||(i[u]=Or.parse(u,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=c==\"_\"?null:c?Sb(this,c.split(\" \")):c==\"\"||!o.inlineContent?[]:null}for(let s in this.marks){let o=this.marks[s],u=o.spec.excludes;o.excluded=u==null?[o]:u==\"\"?[]:Sb(this,u.split(\" \"))}this.nodeFromJSON=s=>Mr.fromJSON(this,s),this.markFromJSON=s=>Ut.fromJSON(this,s),this.topNodeType=this.nodes[this.spec.topNode||\"doc\"],this.cached.wrappings=Object.create(null)}node(t,e=null,i,s){if(typeof t==\"string\")t=this.nodeType(t);else if(t instanceof vb){if(t.schema!=this)throw new RangeError(\"Node type from different schema used (\"+t.name+\")\")}else throw new RangeError(\"Invalid node type: \"+t);return t.createChecked(e,i,s)}text(t,e){let i=this.nodes.text;return new Tu(i,i.defaultAttrs,t,Ut.setFrom(e))}mark(t,e){return typeof t==\"string\"&&(t=this.marks[t]),t.create(e)}nodeType(t){let e=this.nodes[t];if(!e)throw new RangeError(\"Unknown node type: \"+t);return e}}function Sb(n,t){let e=[];for(let i=0;i<t.length;i++){let s=t[i],o=n.marks[s],u=o;if(o)e.push(o);else for(let c in n.marks){let d=n.marks[c];(s==\"_\"||d.spec.group&&d.spec.group.split(\" \").indexOf(s)>-1)&&e.push(u=d)}if(!u)throw new SyntaxError(\"Unknown mark type: '\"+t[i]+\"'\")}return e}function Nk(n){return n.tag!=null}function Dk(n){return n.style!=null}let ro=class _h{constructor(t,e){this.schema=t,this.rules=e,this.tags=[],this.styles=[];let i=this.matchedStyles=[];e.forEach(s=>{if(Nk(s))this.tags.push(s);else if(Dk(s)){let o=/[^=]*/.exec(s.style)[0];i.indexOf(o)<0&&i.push(o),this.styles.push(s)}}),this.normalizeLists=!this.tags.some(s=>{if(!/^(ul|ol)\\b/.test(s.tag)||!s.node)return!1;let o=t.nodes[s.node];return o.contentMatch.matchType(o)})}parse(t,e={}){let i=new Tb(this,e,!1);return i.addAll(t,Ut.none,e.from,e.to),i.finish()}parseSlice(t,e={}){let i=new Tb(this,e,!0);return i.addAll(t,Ut.none,e.from,e.to),X.maxOpen(i.finish())}matchTag(t,e,i){for(let s=i?this.tags.indexOf(i)+1:0;s<this.tags.length;s++){let o=this.tags[s];if(zk(t,o.tag)&&(o.namespace===void 0||t.namespaceURI==o.namespace)&&(!o.context||e.matchesContext(o.context))){if(o.getAttrs){let u=o.getAttrs(t);if(u===!1)continue;o.attrs=u||void 0}return o}}}matchStyle(t,e,i,s){for(let o=s?this.styles.indexOf(s)+1:0;o<this.styles.length;o++){let u=this.styles[o],c=u.style;if(!(c.indexOf(t)!=0||u.context&&!i.matchesContext(u.context)||c.length>t.length&&(c.charCodeAt(t.length)!=61||c.slice(t.length+1)!=e))){if(u.getAttrs){let d=u.getAttrs(e);if(d===!1)continue;u.attrs=d||void 0}return u}}}static schemaRules(t){let e=[];function i(s){let o=s.priority==null?50:s.priority,u=0;for(;u<e.length;u++){let c=e[u];if((c.priority==null?50:c.priority)<o)break}e.splice(u,0,s)}for(let s in t.marks){let o=t.marks[s].spec.parseDOM;o&&o.forEach(u=>{i(u=xb(u)),u.mark||u.ignore||u.clearMark||(u.mark=s)})}for(let s in t.nodes){let o=t.nodes[s].spec.parseDOM;o&&o.forEach(u=>{i(u=xb(u)),u.node||u.ignore||u.mark||(u.node=s)})}return e}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new _h(t,_h.schemaRules(t)))}};const L1={address:!0,article:!0,aside:!0,blockquote:!0,body:!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},Rk={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},z1={ol:!0,ul:!0},So=1,Uh=2,so=4;function Eb(n,t,e){return t!=null?(t?So:0)|(t===\"full\"?Uh:0):n&&n.whitespace==\"pre\"?So|Uh:e&~so}class Wa{constructor(t,e,i,s,o,u){this.type=t,this.attrs=e,this.marks=i,this.solid=s,this.options=u,this.content=[],this.activeMarks=Ut.none,this.match=o||(u&so?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let e=this.type.contentMatch.fillBefore(j.from(t));if(e)this.match=this.type.contentMatch.matchFragment(e);else{let i=this.type.contentMatch,s;return(s=i.findWrapping(t.type))?(this.match=i,s):null}}return this.match.findWrapping(t.type)}finish(t){if(!(this.options&So)){let i=this.content[this.content.length-1],s;if(i&&i.isText&&(s=/[ \\t\\r\\n\\u000c]+$/.exec(i.text))){let o=i;i.text.length==s[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-s[0].length))}}let e=j.from(this.content);return!t&&this.match&&(e=e.append(this.match.fillBefore(j.empty,!0))),this.type?this.type.create(this.attrs,e,this.marks):e}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!L1.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class Tb{constructor(t,e,i){this.parser=t,this.options=e,this.isOpen=i,this.open=0,this.localPreserveWS=!1;let s=e.topNode,o,u=Eb(null,e.preserveWhitespace,0)|(i?so:0);s?o=new Wa(s.type,s.attrs,Ut.none,!0,e.topMatch||s.type.contentMatch,u):i?o=new Wa(null,null,Ut.none,!0,null,u):o=new Wa(t.schema.topNodeType,null,Ut.none,!0,null,u),this.nodes=[o],this.find=e.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t,e){t.nodeType==3?this.addTextNode(t,e):t.nodeType==1&&this.addElement(t,e)}addTextNode(t,e){let i=t.nodeValue,s=this.top,o=s.options&Uh?\"full\":this.localPreserveWS||(s.options&So)>0,{schema:u}=this.parser;if(o===\"full\"||s.inlineContext(t)||/[^ \\t\\r\\n\\u000c]/.test(i)){if(o)if(o===\"full\")i=i.replace(/\\r\\n?/g,`\n`);else if(u.linebreakReplacement&&/[\\r\\n]/.test(i)&&this.top.findWrapping(u.linebreakReplacement.create())){let c=i.split(/\\r?\\n|\\r/);for(let d=0;d<c.length;d++)d&&this.insertNode(u.linebreakReplacement.create(),e,!0),c[d]&&this.insertNode(u.text(c[d]),e,!/\\S/.test(c[d]));i=\"\"}else i=i.replace(/\\r?\\n|\\r/g,\" \");else if(i=i.replace(/[ \\t\\r\\n\\u000c]+/g,\" \"),/^[ \\t\\r\\n\\u000c]/.test(i)&&this.open==this.nodes.length-1){let c=s.content[s.content.length-1],d=t.previousSibling;(!c||d&&d.nodeName==\"BR\"||c.isText&&/[ \\t\\r\\n\\u000c]$/.test(c.text))&&(i=i.slice(1))}i&&this.insertNode(u.text(i),e,!/\\S/.test(i)),this.findInText(t)}else this.findInside(t)}addElement(t,e,i){let s=this.localPreserveWS,o=this.top;(t.tagName==\"PRE\"||/pre/.test(t.style&&t.style.whiteSpace))&&(this.localPreserveWS=!0);let u=t.nodeName.toLowerCase(),c;z1.hasOwnProperty(u)&&this.parser.normalizeLists&&Lk(t);let d=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(c=this.parser.matchTag(t,this,i));t:if(d?d.ignore:Rk.hasOwnProperty(u))this.findInside(t),this.ignoreFallback(t,e);else if(!d||d.skip||d.closeParent){d&&d.closeParent?this.open=Math.max(0,this.open-1):d&&d.skip.nodeType&&(t=d.skip);let p,m=this.needsBlock;if(L1.hasOwnProperty(u))o.content.length&&o.content[0].isInline&&this.open&&(this.open--,o=this.top),p=!0,o.type||(this.needsBlock=!0);else if(!t.firstChild){this.leafFallback(t,e);break t}let y=d&&d.skip?e:this.readStyles(t,e);y&&this.addAll(t,y),p&&this.sync(o),this.needsBlock=m}else{let p=this.readStyles(t,e);p&&this.addElementByRule(t,d,p,d.consuming===!1?c:void 0)}this.localPreserveWS=s}leafFallback(t,e){t.nodeName==\"BR\"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode(`\n`),e)}ignoreFallback(t,e){t.nodeName==\"BR\"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text(\"-\"),e,!0)}readStyles(t,e){let i=t.style;if(i&&i.length)for(let s=0;s<this.parser.matchedStyles.length;s++){let o=this.parser.matchedStyles[s],u=i.getPropertyValue(o);if(u)for(let c=void 0;;){let d=this.parser.matchStyle(o,u,this,c);if(!d)break;if(d.ignore)return null;if(d.clearMark?e=e.filter(p=>!d.clearMark(p)):e=e.concat(this.parser.schema.marks[d.mark].create(d.attrs)),d.consuming===!1)c=d;else break}}return e}addElementByRule(t,e,i,s){let o,u;if(e.node)if(u=this.parser.schema.nodes[e.node],u.isLeaf)this.insertNode(u.create(e.attrs),i,t.nodeName==\"BR\")||this.leafFallback(t,i);else{let d=this.enter(u,e.attrs||null,i,e.preserveWhitespace);d&&(o=!0,i=d)}else{let d=this.parser.schema.marks[e.mark];i=i.concat(d.create(e.attrs))}let c=this.top;if(u&&u.isLeaf)this.findInside(t);else if(s)this.addElement(t,i,s);else if(e.getContent)this.findInside(t),e.getContent(t,this.parser.schema).forEach(d=>this.insertNode(d,i,!1));else{let d=t;typeof e.contentElement==\"string\"?d=t.querySelector(e.contentElement):typeof e.contentElement==\"function\"?d=e.contentElement(t):e.contentElement&&(d=e.contentElement),this.findAround(t,d,!0),this.addAll(d,i),this.findAround(t,d,!1)}o&&this.sync(c)&&this.open--}addAll(t,e,i,s){let o=i||0;for(let u=i?t.childNodes[i]:t.firstChild,c=s==null?null:t.childNodes[s];u!=c;u=u.nextSibling,++o)this.findAtPoint(t,o),this.addDOM(u,e);this.findAtPoint(t,o)}findPlace(t,e,i){let s,o;for(let u=this.open,c=0;u>=0;u--){let d=this.nodes[u],p=d.findWrapping(t);if(p&&(!s||s.length>p.length+c)&&(s=p,o=d,!p.length))break;if(d.solid){if(i)break;c+=2}}if(!s)return null;this.sync(o);for(let u=0;u<s.length;u++)e=this.enterInner(s[u],null,e,!1);return e}insertNode(t,e,i){if(t.isInline&&this.needsBlock&&!this.top.type){let o=this.textblockFromContext();o&&(e=this.enterInner(o,null,e))}let s=this.findPlace(t,e,i);if(s){this.closeExtra();let o=this.top;o.match&&(o.match=o.match.matchType(t.type));let u=Ut.none;for(let c of s.concat(t.marks))(o.type?o.type.allowsMarkType(c.type):Mb(c.type,t.type))&&(u=c.addToSet(u));return o.content.push(t.mark(u)),!0}return!1}enter(t,e,i,s){let o=this.findPlace(t.create(e),i,!1);return o&&(o=this.enterInner(t,e,i,!0,s)),o}enterInner(t,e,i,s=!1,o){this.closeExtra();let u=this.top;u.match=u.match&&u.match.matchType(t);let c=Eb(t,o,u.options);u.options&so&&u.content.length==0&&(c|=so);let d=Ut.none;return i=i.filter(p=>(u.type?u.type.allowsMarkType(p.type):Mb(p.type,t))?(d=p.addToSet(d),!1):!0),this.nodes.push(new Wa(t,e,d,s,null,c)),this.open++,i}closeExtra(t=!1){let e=this.nodes.length-1;if(e>this.open){for(;e>this.open;e--)this.nodes[e-1].content.push(this.nodes[e].finish(t));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(t){for(let e=this.open;e>=0;e--){if(this.nodes[e]==t)return this.open=e,!0;this.localPreserveWS&&(this.nodes[e].options|=So)}return!1}get currentPos(){this.closeExtra();let t=0;for(let e=this.open;e>=0;e--){let i=this.nodes[e].content;for(let s=i.length-1;s>=0;s--)t+=i[s].nodeSize;e&&t++}return t}findAtPoint(t,e){if(this.find)for(let i=0;i<this.find.length;i++)this.find[i].node==t&&this.find[i].offset==e&&(this.find[i].pos=this.currentPos)}findInside(t){if(this.find)for(let e=0;e<this.find.length;e++)this.find[e].pos==null&&t.nodeType==1&&t.contains(this.find[e].node)&&(this.find[e].pos=this.currentPos)}findAround(t,e,i){if(t!=e&&this.find)for(let s=0;s<this.find.length;s++)this.find[s].pos==null&&t.nodeType==1&&t.contains(this.find[s].node)&&e.compareDocumentPosition(this.find[s].node)&(i?2:4)&&(this.find[s].pos=this.currentPos)}findInText(t){if(this.find)for(let e=0;e<this.find.length;e++)this.find[e].node==t&&(this.find[e].pos=this.currentPos-(t.nodeValue.length-this.find[e].offset))}matchesContext(t){if(t.indexOf(\"|\")>-1)return t.split(/\\s*\\|\\s*/).some(this.matchesContext,this);let e=t.split(\"/\"),i=this.options.context,s=!this.isOpen&&(!i||i.parent.type==this.nodes[0].type),o=-(i?i.depth+1:0)+(s?0:1),u=(c,d)=>{for(;c>=0;c--){let p=e[c];if(p==\"\"){if(c==e.length-1||c==0)continue;for(;d>=o;d--)if(u(c-1,d))return!0;return!1}else{let m=d>0||d==0&&s?this.nodes[d].type:i&&d>=o?i.node(d-o).type:null;if(!m||m.name!=p&&!m.isInGroup(p))return!1;d--}}return!0};return u(e.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let e=t.depth;e>=0;e--){let i=t.node(e).contentMatchAt(t.indexAfter(e)).defaultType;if(i&&i.isTextblock&&i.defaultAttrs)return i}for(let e in this.parser.schema.nodes){let i=this.parser.schema.nodes[e];if(i.isTextblock&&i.defaultAttrs)return i}}}function Lk(n){for(let t=n.firstChild,e=null;t;t=t.nextSibling){let i=t.nodeType==1?t.nodeName.toLowerCase():null;i&&z1.hasOwnProperty(i)&&e?(e.appendChild(t),t=e):i==\"li\"?e=t:i&&(e=null)}}function zk(n,t){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,t)}function xb(n){let t={};for(let e in n)t[e]=n[e];return t}function Mb(n,t){let e=t.schema.nodes;for(let i in e){let s=e[i];if(!s.allowsMarkType(n))continue;let o=[],u=c=>{o.push(c);for(let d=0;d<c.edgeCount;d++){let{type:p,next:m}=c.edge(d);if(p==t||o.indexOf(m)<0&&u(m))return!0}};if(u(s.contentMatch))return!0}}class Rr{constructor(t,e){this.nodes=t,this.marks=e}serializeFragment(t,e={},i){i||(i=tu(e).createDocumentFragment());let s=i,o=[];return t.forEach(u=>{if(o.length||u.marks.length){let c=0,d=0;for(;c<o.length&&d<u.marks.length;){let p=u.marks[d];if(!this.marks[p.type.name]){d++;continue}if(!p.eq(o[c][0])||p.type.spec.spanning===!1)break;c++,d++}for(;c<o.length;)s=o.pop()[1];for(;d<u.marks.length;){let p=u.marks[d++],m=this.serializeMark(p,u.isInline,e);m&&(o.push([p,s]),s.appendChild(m.dom),s=m.contentDOM||m.dom)}}s.appendChild(this.serializeNodeInner(u,e))}),i}serializeNodeInner(t,e){if(t.isText)return tu(e).createTextNode(t.text);let{dom:i,contentDOM:s}=pu(tu(e),this.nodes[t.type.name](t),null,t.attrs);if(s){if(t.isLeaf)throw new RangeError(\"Content hole not allowed in a leaf node spec\");this.serializeFragment(t.content,e,s)}return i}serializeNode(t,e={}){let i=this.serializeNodeInner(t,e);for(let s=t.marks.length-1;s>=0;s--){let o=this.serializeMark(t.marks[s],t.isInline,e);o&&((o.contentDOM||o.dom).appendChild(i),i=o.dom)}return i}serializeMark(t,e,i={}){let s=this.marks[t.type.name];return s&&pu(tu(i),s(t,e),null,t.attrs)}static renderSpec(t,e,i=null,s){return typeof e==\"string\"?{dom:t.createTextNode(e)}:pu(t,e,i,s)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new Rr(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let e=kb(t.nodes);return e.text||(e.text=i=>i.text),e}static marksFromSchema(t){return kb(t.marks)}}function kb(n){let t={};for(let e in n){let i=n[e].spec.toDOM;i&&(t[e]=i)}return t}function tu(n){return n.document||window.document}const Ab=new WeakMap;function Bk(n){let t=Ab.get(n);return t===void 0&&Ab.set(n,t=Hk(n)),t}function Hk(n){let t=null;function e(i){if(i&&typeof i==\"object\")if(Array.isArray(i))if(typeof i[0]==\"string\")t||(t=[]),t.push(i);else for(let s=0;s<i.length;s++)e(i[s]);else for(let s in i)e(i[s])}return e(n),t}function pu(n,t,e,i){if(t.nodeType==1)return{dom:t};if(t.dom&&t.dom.nodeType==1)return t;let s=t[0],o;if(typeof s!=\"string\")throw new RangeError(\"Invalid array passed to renderSpec\");if(i&&(o=Bk(i))&&o.indexOf(t)>-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 u=s.indexOf(\" \");u>0&&(e=s.slice(0,u),s=s.slice(u+1));let c,d=e?n.createElementNS(e,s):n.createElement(s),p=t[1],m=1;if(p&&typeof p==\"object\"&&p.nodeType==null&&!Array.isArray(p)){m=2;for(let y in p)if(p[y]!=null){let b=y.indexOf(\" \");b>0?d.setAttributeNS(y.slice(0,b),y.slice(b+1),p[y]):y==\"style\"&&d.style?d.style.cssText=p[y]:d.setAttribute(y,p[y])}}for(let y=m;y<t.length;y++){let b=t[y];if(b===0){if(y<t.length-1||y>m)throw new RangeError(\"Content hole must be the only child of its parent node\");return{dom:d,contentDOM:d}}else if(typeof b==\"string\")d.appendChild(n.createTextNode(b));else{let{dom:v,contentDOM:E}=pu(n,b,e,i);if(d.appendChild(v),E){if(c)throw new RangeError(\"Multiple content holes\");c=E}}}return{dom:d,contentDOM:c}}const B1=65535,H1=Math.pow(2,16);function _k(n,t){return n+t*H1}function Cb(n){return n&B1}function Uk(n){return(n-(n&B1))/H1}const _1=1,U1=2,mu=4,I1=8;class Ih{constructor(t,e,i){this.pos=t,this.delInfo=e,this.recover=i}get deleted(){return(this.delInfo&I1)>0}get deletedBefore(){return(this.delInfo&(_1|mu))>0}get deletedAfter(){return(this.delInfo&(U1|mu))>0}get deletedAcross(){return(this.delInfo&mu)>0}}class Je{constructor(t,e=!1){if(this.ranges=t,this.inverted=e,!t.length&&Je.empty)return Je.empty}recover(t){let e=0,i=Cb(t);if(!this.inverted)for(let s=0;s<i;s++)e+=this.ranges[s*3+2]-this.ranges[s*3+1];return this.ranges[i*3]+e+Uk(t)}mapResult(t,e=1){return this._map(t,e,!1)}map(t,e=1){return this._map(t,e,!0)}_map(t,e,i){let s=0,o=this.inverted?2:1,u=this.inverted?1:2;for(let c=0;c<this.ranges.length;c+=3){let d=this.ranges[c]-(this.inverted?s:0);if(d>t)break;let p=this.ranges[c+o],m=this.ranges[c+u],y=d+p;if(t<=y){let b=p?t==d?-1:t==y?1:e:e,v=d+s+(b<0?0:m);if(i)return v;let E=t==(e<0?d:y)?null:_k(c/3,t-d),M=0;return p&&(M|=t==d?U1:t==y?_1:mu,(e<0?t!=d:t!=y)&&(M|=I1)),new Ih(v,M,E)}s+=m-p}return i?t+s:new Ih(t+s,0,null)}touches(t,e){let i=0,s=Cb(e),o=this.inverted?2:1,u=this.inverted?1:2;for(let c=0;c<this.ranges.length;c+=3){let d=this.ranges[c]-(this.inverted?i:0);if(d>t)break;let p=this.ranges[c+o],m=d+p;if(t<=m&&c==s*3)return!0;i+=this.ranges[c+u]-p}return!1}forEach(t){let e=this.inverted?2:1,i=this.inverted?1:2;for(let s=0,o=0;s<this.ranges.length;s+=3){let u=this.ranges[s],c=u-(this.inverted?o:0),d=u+(this.inverted?0:o),p=this.ranges[s+e],m=this.ranges[s+i];t(c,c+p,d,d+m),o+=m-p}}invert(){return new Je(this.ranges,!this.inverted)}toString(){return(this.inverted?\"-\":\"\")+JSON.stringify(this.ranges)}static offset(t){return t==0?Je.empty:new Je(t<0?[0,-t,0]:[0,0,t])}}Je.empty=new Je([]);class Eo{constructor(t,e,i=0,s=t?t.length:0){this.mirror=e,this.from=i,this.to=s,this._maps=t||[],this.ownData=!(t||e)}get maps(){return this._maps}slice(t=0,e=this.maps.length){return new Eo(this._maps,this.mirror,t,e)}appendMap(t,e){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(t),e!=null&&this.setMirror(this._maps.length-1,e)}appendMapping(t){for(let e=0,i=this._maps.length;e<t._maps.length;e++){let s=t.getMirror(e);this.appendMap(t._maps[e],s!=null&&s<e?i+s:void 0)}}getMirror(t){if(this.mirror){for(let e=0;e<this.mirror.length;e++)if(this.mirror[e]==t)return this.mirror[e+(e%2?-1:1)]}}setMirror(t,e){this.mirror||(this.mirror=[]),this.mirror.push(t,e)}appendMappingInverted(t){for(let e=t.maps.length-1,i=this._maps.length+t._maps.length;e>=0;e--){let s=t.getMirror(e);this.appendMap(t._maps[e].invert(),s!=null&&s>e?i-s-1:void 0)}}invert(){let t=new Eo;return t.appendMappingInverted(this),t}map(t,e=1){if(this.mirror)return this._map(t,e,!0);for(let i=this.from;i<this.to;i++)t=this._maps[i].map(t,e);return t}mapResult(t,e=1){return this._map(t,e,!1)}_map(t,e,i){let s=0;for(let o=this.from;o<this.to;o++){let u=this._maps[o],c=u.mapResult(t,e);if(c.recover!=null){let d=this.getMirror(o);if(d!=null&&d>o&&d<this.to){o=d,t=this._maps[d].recover(c.recover);continue}}s|=c.delInfo,t=c.pos}return i?t:new Ih(t,s,null)}}const uh=Object.create(null);class we{getMap(){return Je.empty}merge(t){return null}static fromJSON(t,e){if(!e||!e.stepType)throw new RangeError(\"Invalid input for Step.fromJSON\");let i=uh[e.stepType];if(!i)throw new RangeError(`No step type ${e.stepType} defined`);return i.fromJSON(t,e)}static jsonID(t,e){if(t in uh)throw new RangeError(\"Duplicate use of step JSON ID \"+t);return uh[t]=e,e.prototype.jsonID=t,e}}class re{constructor(t,e){this.doc=t,this.failed=e}static ok(t){return new re(t,null)}static fail(t){return new re(null,t)}static fromReplace(t,e,i,s){try{return re.ok(t.replace(e,i,s))}catch(o){if(o instanceof bo)return re.fail(o.message);throw o}}}function gp(n,t,e){let i=[];for(let s=0;s<n.childCount;s++){let o=n.child(s);o.content.size&&(o=o.copy(gp(o.content,t,o))),o.isInline&&(o=t(o,e,s)),i.push(o)}return j.fromArray(i)}class Ui extends we{constructor(t,e,i){super(),this.from=t,this.to=e,this.mark=i}apply(t){let e=t.slice(this.from,this.to),i=t.resolve(this.from),s=i.node(i.sharedDepth(this.to)),o=new X(gp(e.content,(u,c)=>!u.isAtom||!c.type.allowsMarkType(this.mark.type)?u:u.mark(this.mark.addToSet(u.marks)),s),e.openStart,e.openEnd);return re.fromReplace(t,this.from,this.to,o)}invert(){return new vn(this.from,this.to,this.mark)}map(t){let e=t.mapResult(this.from,1),i=t.mapResult(this.to,-1);return e.deleted&&i.deleted||e.pos>=i.pos?null:new Ui(e.pos,i.pos,this.mark)}merge(t){return t instanceof Ui&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Ui(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:\"addMark\",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,e){if(typeof e.from!=\"number\"||typeof e.to!=\"number\")throw new RangeError(\"Invalid input for AddMarkStep.fromJSON\");return new Ui(e.from,e.to,t.markFromJSON(e.mark))}}we.jsonID(\"addMark\",Ui);class vn extends we{constructor(t,e,i){super(),this.from=t,this.to=e,this.mark=i}apply(t){let e=t.slice(this.from,this.to),i=new X(gp(e.content,s=>s.mark(this.mark.removeFromSet(s.marks)),t),e.openStart,e.openEnd);return re.fromReplace(t,this.from,this.to,i)}invert(){return new Ui(this.from,this.to,this.mark)}map(t){let e=t.mapResult(this.from,1),i=t.mapResult(this.to,-1);return e.deleted&&i.deleted||e.pos>=i.pos?null:new vn(e.pos,i.pos,this.mark)}merge(t){return t instanceof vn&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new vn(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:\"removeMark\",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,e){if(typeof e.from!=\"number\"||typeof e.to!=\"number\")throw new RangeError(\"Invalid input for RemoveMarkStep.fromJSON\");return new vn(e.from,e.to,t.markFromJSON(e.mark))}}we.jsonID(\"removeMark\",vn);class Ii extends we{constructor(t,e){super(),this.pos=t,this.mark=e}apply(t){let e=t.nodeAt(this.pos);if(!e)return re.fail(\"No node at mark step's position\");let i=e.type.create(e.attrs,null,this.mark.addToSet(e.marks));return re.fromReplace(t,this.pos,this.pos+1,new X(j.from(i),0,e.isLeaf?0:1))}invert(t){let e=t.nodeAt(this.pos);if(e){let i=this.mark.addToSet(e.marks);if(i.length==e.marks.length){for(let s=0;s<e.marks.length;s++)if(!e.marks[s].isInSet(i))return new Ii(this.pos,e.marks[s]);return new Ii(this.pos,this.mark)}}return new wr(this.pos,this.mark)}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new Ii(e.pos,this.mark)}toJSON(){return{stepType:\"addNodeMark\",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,e){if(typeof e.pos!=\"number\")throw new RangeError(\"Invalid input for AddNodeMarkStep.fromJSON\");return new Ii(e.pos,t.markFromJSON(e.mark))}}we.jsonID(\"addNodeMark\",Ii);class wr extends we{constructor(t,e){super(),this.pos=t,this.mark=e}apply(t){let e=t.nodeAt(this.pos);if(!e)return re.fail(\"No node at mark step's position\");let i=e.type.create(e.attrs,null,this.mark.removeFromSet(e.marks));return re.fromReplace(t,this.pos,this.pos+1,new X(j.from(i),0,e.isLeaf?0:1))}invert(t){let e=t.nodeAt(this.pos);return!e||!this.mark.isInSet(e.marks)?this:new Ii(this.pos,this.mark)}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new wr(e.pos,this.mark)}toJSON(){return{stepType:\"removeNodeMark\",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,e){if(typeof e.pos!=\"number\")throw new RangeError(\"Invalid input for RemoveNodeMarkStep.fromJSON\");return new wr(e.pos,t.markFromJSON(e.mark))}}we.jsonID(\"removeNodeMark\",wr);class Qt extends we{constructor(t,e,i,s=!1){super(),this.from=t,this.to=e,this.slice=i,this.structure=s}apply(t){return this.structure&&jh(t,this.from,this.to)?re.fail(\"Structure replace would overwrite content\"):re.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new Je([this.from,this.to-this.from,this.slice.size])}invert(t){return new Qt(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let e=t.mapResult(this.to,-1),i=this.from==this.to&&Qt.MAP_BIAS<0?e:t.mapResult(this.from,1);return i.deletedAcross&&e.deletedAcross?null:new Qt(i.pos,Math.max(i.pos,e.pos),this.slice,this.structure)}merge(t){if(!(t instanceof Qt)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let e=this.slice.size+t.slice.size==0?X.empty:new X(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new Qt(this.from,this.to+(t.to-t.from),e,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let e=this.slice.size+t.slice.size==0?X.empty:new X(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new Qt(t.from,this.to,e,this.structure)}else return null}toJSON(){let t={stepType:\"replace\",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,e){if(typeof e.from!=\"number\"||typeof e.to!=\"number\")throw new RangeError(\"Invalid input for ReplaceStep.fromJSON\");return new Qt(e.from,e.to,X.fromJSON(t,e.slice),!!e.structure)}}Qt.MAP_BIAS=1;we.jsonID(\"replace\",Qt);class he extends we{constructor(t,e,i,s,o,u,c=!1){super(),this.from=t,this.to=e,this.gapFrom=i,this.gapTo=s,this.slice=o,this.insert=u,this.structure=c}apply(t){if(this.structure&&(jh(t,this.from,this.gapFrom)||jh(t,this.gapTo,this.to)))return re.fail(\"Structure gap-replace would overwrite content\");let e=t.slice(this.gapFrom,this.gapTo);if(e.openStart||e.openEnd)return re.fail(\"Gap is not a flat range\");let i=this.slice.insertAt(this.insert,e.content);return i?re.fromReplace(t,this.from,this.to,i):re.fail(\"Content does not fit in gap\")}getMap(){return new Je([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let e=this.gapTo-this.gapFrom;return new he(this.from,this.from+this.slice.size+e,this.from+this.insert,this.from+this.insert+e,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let e=t.mapResult(this.from,1),i=t.mapResult(this.to,-1),s=this.from==this.gapFrom?e.pos:t.map(this.gapFrom,-1),o=this.to==this.gapTo?i.pos:t.map(this.gapTo,1);return e.deletedAcross&&i.deletedAcross||s<e.pos||o>i.pos?null:new he(e.pos,i.pos,s,o,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:\"replaceAround\",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,e){if(typeof e.from!=\"number\"||typeof e.to!=\"number\"||typeof e.gapFrom!=\"number\"||typeof e.gapTo!=\"number\"||typeof e.insert!=\"number\")throw new RangeError(\"Invalid input for ReplaceAroundStep.fromJSON\");return new he(e.from,e.to,e.gapFrom,e.gapTo,X.fromJSON(t,e.slice),e.insert,!!e.structure)}}we.jsonID(\"replaceAround\",he);function jh(n,t,e){let i=n.resolve(t),s=e-t,o=i.depth;for(;s>0&&o>0&&i.indexAfter(o)==i.node(o).childCount;)o--,s--;if(s>0){let u=i.node(o).maybeChild(i.indexAfter(o));for(;s>0;){if(!u||u.isLeaf)return!0;u=u.firstChild,s--}}return!1}function Ik(n,t,e,i){let s=[],o=[],u,c;n.doc.nodesBetween(t,e,(d,p,m)=>{if(!d.isInline)return;let y=d.marks;if(!i.isInSet(y)&&m.type.allowsMarkType(i.type)){let b=Math.max(p,t),v=Math.min(p+d.nodeSize,e),E=i.addToSet(y);for(let M=0;M<y.length;M++)y[M].isInSet(E)||(u&&u.to==b&&u.mark.eq(y[M])?u.to=v:s.push(u=new vn(b,v,y[M])));c&&c.to==b?c.to=v:o.push(c=new Ui(b,v,i))}}),s.forEach(d=>n.step(d)),o.forEach(d=>n.step(d))}function jk(n,t,e,i){let s=[],o=0;n.doc.nodesBetween(t,e,(u,c)=>{if(!u.isInline)return;o++;let d=null;if(i instanceof oc){let p=u.marks,m;for(;m=i.isInSet(p);)(d||(d=[])).push(m),p=m.removeFromSet(p)}else i?i.isInSet(u.marks)&&(d=[i]):d=u.marks;if(d&&d.length){let p=Math.min(c+u.nodeSize,e);for(let m=0;m<d.length;m++){let y=d[m],b;for(let v=0;v<s.length;v++){let E=s[v];E.step==o-1&&y.eq(s[v].style)&&(b=E)}b?(b.to=p,b.step=o):s.push({style:y,from:Math.max(c,t),to:p,step:o})}}}),s.forEach(u=>n.step(new vn(u.from,u.to,u.style)))}function yp(n,t,e,i=e.contentMatch,s=!0){let o=n.doc.nodeAt(t),u=[],c=t+1;for(let d=0;d<o.childCount;d++){let p=o.child(d),m=c+p.nodeSize,y=i.matchType(p.type);if(!y)u.push(new Qt(c,m,X.empty));else{i=y;for(let b=0;b<p.marks.length;b++)e.allowsMarkType(p.marks[b].type)||n.step(new vn(c,m,p.marks[b]));if(s&&p.isText&&e.whitespace!=\"pre\"){let b,v=/\\r?\\n|\\r/g,E;for(;b=v.exec(p.text);)E||(E=new X(j.from(e.schema.text(\" \",e.allowedMarks(p.marks))),0,0)),u.push(new Qt(c+b.index,c+b.index+b[0].length,E))}}c=m}if(!i.validEnd){let d=i.fillBefore(j.empty,!0);n.replace(c,c,new X(d,0,0))}for(let d=u.length-1;d>=0;d--)n.step(u[d])}function qk(n,t,e){return(t==0||n.canReplace(t,n.childCount))&&(e==n.childCount||n.canReplace(0,e))}function qs(n){let e=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let i=n.depth,s=0,o=0;;--i){let u=n.$from.node(i),c=n.$from.index(i)+s,d=n.$to.indexAfter(i)-o;if(i<n.depth&&u.canReplace(c,d,e))return i;if(i==0||u.type.spec.isolating||!qk(u,c,d))break;c&&(s=1),d<u.childCount&&(o=1)}return null}function Vk(n,t,e){let{$from:i,$to:s,depth:o}=t,u=i.before(o+1),c=s.after(o+1),d=u,p=c,m=j.empty,y=0;for(let E=o,M=!1;E>e;E--)M||i.index(E)>0?(M=!0,m=j.from(i.node(E).copy(m)),y++):d--;let b=j.empty,v=0;for(let E=o,M=!1;E>e;E--)M||s.after(E+1)<s.end(E)?(M=!0,b=j.from(s.node(E).copy(b)),v++):p++;n.step(new he(d,p,u,c,new X(m.append(b),y,v),m.size-y,!0))}function bp(n,t,e=null,i=n){let s=$k(n,t),o=s&&Pk(i,t);return o?s.map(Ob).concat({type:t,attrs:e}).concat(o.map(Ob)):null}function Ob(n){return{type:n,attrs:null}}function $k(n,t){let{parent:e,startIndex:i,endIndex:s}=n,o=e.contentMatchAt(i).findWrapping(t);if(!o)return null;let u=o.length?o[0]:t;return e.canReplaceWith(i,s,u)?o:null}function Pk(n,t){let{parent:e,startIndex:i,endIndex:s}=n,o=e.child(i),u=t.contentMatch.findWrapping(o.type);if(!u)return null;let d=(u.length?u[u.length-1]:t).contentMatch;for(let p=i;d&&p<s;p++)d=d.matchType(e.child(p).type);return!d||!d.validEnd?null:u}function Kk(n,t,e){let i=j.empty;for(let u=e.length-1;u>=0;u--){if(i.size){let c=e[u].type.contentMatch.matchFragment(i);if(!c||!c.validEnd)throw new RangeError(\"Wrapper type given to Transform.wrap does not form valid content of its parent wrapper\")}i=j.from(e[u].type.create(e[u].attrs,i))}let s=t.start,o=t.end;n.step(new he(s,o,s,o,new X(i,0,0),e.length,!0))}function Gk(n,t,e,i,s){if(!i.isTextblock)throw new RangeError(\"Type given to setBlockType should be a textblock\");let o=n.steps.length;n.doc.nodesBetween(t,e,(u,c)=>{let d=typeof s==\"function\"?s(u):s;if(u.isTextblock&&!u.hasMarkup(i,d)&&Yk(n.doc,n.mapping.slice(o).map(c),i)){let p=null;if(i.schema.linebreakReplacement){let v=i.whitespace==\"pre\",E=!!i.contentMatch.matchType(i.schema.linebreakReplacement);v&&!E?p=!1:!v&&E&&(p=!0)}p===!1&&q1(n,u,c,o),yp(n,n.mapping.slice(o).map(c,1),i,void 0,p===null);let m=n.mapping.slice(o),y=m.map(c,1),b=m.map(c+u.nodeSize,1);return n.step(new he(y,b,y+1,b-1,new X(j.from(i.create(d,null,u.marks)),0,0),1,!0)),p===!0&&j1(n,u,c,o),!1}})}function j1(n,t,e,i){t.forEach((s,o)=>{if(s.isText){let u,c=/\\r?\\n|\\r/g;for(;u=c.exec(s.text);){let d=n.mapping.slice(i).map(e+1+o+u.index);n.replaceWith(d,d+1,t.type.schema.linebreakReplacement.create())}}})}function q1(n,t,e,i){t.forEach((s,o)=>{if(s.type==s.type.schema.linebreakReplacement){let u=n.mapping.slice(i).map(e+1+o);n.replaceWith(u,u+1,t.type.schema.text(`\n`))}})}function Yk(n,t,e){let i=n.resolve(t),s=i.index();return i.parent.canReplaceWith(s,s+1,e)}function Xk(n,t,e,i,s){let o=n.doc.nodeAt(t);if(!o)throw new RangeError(\"No node at given position\");e||(e=o.type);let u=e.create(i,null,s||o.marks);if(o.isLeaf)return n.replaceWith(t,t+o.nodeSize,u);if(!e.validContent(o.content))throw new RangeError(\"Invalid content for node type \"+e.name);n.step(new he(t,t+o.nodeSize,t+1,t+o.nodeSize-1,new X(j.from(u),0,0),1,!0))}function ei(n,t,e=1,i){let s=n.resolve(t),o=s.depth-e,u=i&&i[i.length-1]||s.parent;if(o<0||s.parent.type.spec.isolating||!s.parent.canReplace(s.index(),s.parent.childCount)||!u.type.validContent(s.parent.content.cutByIndex(s.index(),s.parent.childCount)))return!1;for(let p=s.depth-1,m=e-2;p>o;p--,m--){let y=s.node(p),b=s.index(p);if(y.type.spec.isolating)return!1;let v=y.content.cutByIndex(b,y.childCount),E=i&&i[m+1];E&&(v=v.replaceChild(0,E.type.create(E.attrs)));let M=i&&i[m]||y;if(!y.canReplace(b+1,y.childCount)||!M.type.validContent(v))return!1}let c=s.indexAfter(o),d=i&&i[0];return s.node(o).canReplaceWith(c,c,d?d.type:s.node(o+1).type)}function Fk(n,t,e=1,i){let s=n.doc.resolve(t),o=j.empty,u=j.empty;for(let c=s.depth,d=s.depth-e,p=e-1;c>d;c--,p--){o=j.from(s.node(c).copy(o));let m=i&&i[p];u=j.from(m?m.type.create(m.attrs,u):s.node(c).copy(u))}n.step(new Qt(t,t,new X(o.append(u),e,e),!0))}function Yi(n,t){let e=n.resolve(t),i=e.index();return V1(e.nodeBefore,e.nodeAfter)&&e.parent.canReplace(i,i+1)}function Qk(n,t){t.content.size||n.type.compatibleContent(t.type);let e=n.contentMatchAt(n.childCount),{linebreakReplacement:i}=n.type.schema;for(let s=0;s<t.childCount;s++){let o=t.child(s),u=o.type==i?n.type.schema.nodes.text:o.type;if(e=e.matchType(u),!e||!n.type.allowsMarks(o.marks))return!1}return e.validEnd}function V1(n,t){return!!(n&&t&&!n.isLeaf&&Qk(n,t))}function ac(n,t,e=-1){let i=n.resolve(t);for(let s=i.depth;;s--){let o,u,c=i.index(s);if(s==i.depth?(o=i.nodeBefore,u=i.nodeAfter):e>0?(o=i.node(s+1),c++,u=i.node(s).maybeChild(c)):(o=i.node(s).maybeChild(c-1),u=i.node(s+1)),o&&!o.isTextblock&&V1(o,u)&&i.node(s).canReplace(c,c+1))return t;if(s==0)break;t=e<0?i.before(s):i.after(s)}}function Jk(n,t,e){let i=null,{linebreakReplacement:s}=n.doc.type.schema,o=n.doc.resolve(t-e),u=o.node().type;if(s&&u.inlineContent){let m=u.whitespace==\"pre\",y=!!u.contentMatch.matchType(s);m&&!y?i=!1:!m&&y&&(i=!0)}let c=n.steps.length;if(i===!1){let m=n.doc.resolve(t+e);q1(n,m.node(),m.before(),c)}u.inlineContent&&yp(n,t+e-1,u,o.node().contentMatchAt(o.index()),i==null);let d=n.mapping.slice(c),p=d.map(t-e);if(n.step(new Qt(p,d.map(t+e,-1),X.empty,!0)),i===!0){let m=n.doc.resolve(p);j1(n,m.node(),m.before(),n.steps.length)}return n}function Zk(n,t,e){let i=n.resolve(t);if(i.parent.canReplaceWith(i.index(),i.index(),e))return t;if(i.parentOffset==0)for(let s=i.depth-1;s>=0;s--){let o=i.index(s);if(i.node(s).canReplaceWith(o,o,e))return i.before(s+1);if(o>0)return null}if(i.parentOffset==i.parent.content.size)for(let s=i.depth-1;s>=0;s--){let o=i.indexAfter(s);if(i.node(s).canReplaceWith(o,o,e))return i.after(s+1);if(o<i.node(s).childCount)return null}return null}function $1(n,t,e){let i=n.resolve(t);if(!e.content.size)return t;let s=e.content;for(let o=0;o<e.openStart;o++)s=s.firstChild.content;for(let o=1;o<=(e.openStart==0&&e.size?2:1);o++)for(let u=i.depth;u>=0;u--){let c=u==i.depth?0:i.pos<=(i.start(u+1)+i.end(u+1))/2?-1:1,d=i.index(u)+(c>0?1:0),p=i.node(u),m=!1;if(o==1)m=p.canReplace(d,d,s);else{let y=p.contentMatchAt(d).findWrapping(s.firstChild.type);m=y&&p.canReplaceWith(d,d,y[0])}if(m)return c==0?i.pos:c<0?i.before(u+1):i.after(u+1)}return null}function uc(n,t,e=t,i=X.empty){if(t==e&&!i.size)return null;let s=n.resolve(t),o=n.resolve(e);return P1(s,o,i)?new Qt(t,e,i):new Wk(s,o,i).fit()}function P1(n,t,e){return!e.openStart&&!e.openEnd&&n.start()==t.start()&&n.parent.canReplace(n.index(),t.index(),e.content)}class Wk{constructor(t,e,i){this.$from=t,this.$to=e,this.unplaced=i,this.frontier=[],this.placed=j.empty;for(let s=0;s<=t.depth;s++){let o=t.node(s);this.frontier.push({type:o.type,match:o.contentMatchAt(t.indexAfter(s))})}for(let s=t.depth;s>0;s--)this.placed=j.from(t.node(s).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let p=this.findFittable();p?this.placeNodes(p):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),e=this.placed.size-this.depth-this.$from.depth,i=this.$from,s=this.close(t<0?this.$to:i.doc.resolve(t));if(!s)return null;let o=this.placed,u=i.depth,c=s.depth;for(;u&&c&&o.childCount==1;)o=o.firstChild.content,u--,c--;let d=new X(o,u,c);return t>-1?new he(i.pos,t,this.$to.pos,this.$to.end(),d,e):d.size||i.pos!=this.$to.pos?new Qt(i.pos,s.pos,d):null}findFittable(){let t=this.unplaced.openStart;for(let e=this.unplaced.content,i=0,s=this.unplaced.openEnd;i<t;i++){let o=e.firstChild;if(e.childCount>1&&(s=0),o.type.spec.isolating&&s<=i){t=i;break}e=o.content}for(let e=1;e<=2;e++)for(let i=e==1?t:this.unplaced.openStart;i>=0;i--){let s,o=null;i?(o=wb(this.unplaced.content,i-1).firstChild,s=o.content):s=this.unplaced.content;let u=s.firstChild;for(let c=this.depth;c>=0;c--){let{type:d,match:p}=this.frontier[c],m,y=null;if(e==1&&(u?p.matchType(u.type)||(y=p.fillBefore(j.from(u),!1)):o&&d.compatibleContent(o.type)))return{sliceDepth:i,frontierDepth:c,parent:o,inject:y};if(e==2&&u&&(m=p.findWrapping(u.type)))return{sliceDepth:i,frontierDepth:c,parent:o,wrap:m};if(o&&p.matchType(o.type))break}}}openMore(){let{content:t,openStart:e,openEnd:i}=this.unplaced;return Nb(t,-1)<=e?!1:(this.unplaced.size>1&&Nb(t,1)>i&&i++,this.unplaced=new X(t,e+1,i),!0)}dropNode(){let{content:t,openStart:e,openEnd:i}=this.unplaced,s=wb(t,e);if(s.childCount<=1&&e>0){let o=t.size-e<=e+s.size;this.unplaced=new X(Jl(t,e-1,1),e-1,o?e-1:i)}else this.unplaced=new X(Jl(t,e,1),e,i)}placeNodes({sliceDepth:t,frontierDepth:e,parent:i,inject:s,wrap:o}){for(;this.depth>e;)this.closeFrontierNode();if(o)for(let M=0;M<o.length;M++)this.openFrontierNode(o[M]);let u=this.unplaced,c=i?i.content:u.content,d=u.openStart-t,p=0,m=[],{match:y,type:b}=this.frontier[e];if(s){for(let M=0;M<s.childCount;M++)m.push(s.child(M));y=y.matchFragment(s)}let v=c.size+t-(u.content.size-u.openEnd);for(;p<c.childCount;){let M=c.child(p),x=y.matchType(M.type);if(!x)break;p++,(p>1||d==0||M.content.size)&&(y=x,m.push(K1(M.mark(b.allowedMarks(M.marks)),p==1?d:0,p==c.childCount?v:-1)))}let E=p==c.childCount;E||(v=-1),this.placed=Zl(this.placed,e,j.from(m)),this.frontier[e].match=y,E&&v<0&&i&&i.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let M=0,x=c;M<v;M++){let O=x.lastChild;this.frontier.push({type:O.type,match:O.contentMatchAt(O.childCount)}),x=O.content}this.unplaced=E?t==0?X.empty:new X(Jl(u.content,t-1,1),t-1,v<0?u.openEnd:t-1):new X(Jl(u.content,t,p),u.openStart,u.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let t=this.frontier[this.depth],e;if(!t.type.isTextblock||!ch(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(e=this.findCloseLevel(this.$to))&&e.depth==this.depth)return-1;let{depth:i}=this.$to,s=this.$to.after(i);for(;i>1&&s==this.$to.end(--i);)++s;return s}findCloseLevel(t){t:for(let e=Math.min(this.depth,t.depth);e>=0;e--){let{match:i,type:s}=this.frontier[e],o=e<t.depth&&t.end(e+1)==t.pos+(t.depth-(e+1)),u=ch(t,e,s,i,o);if(u){for(let c=e-1;c>=0;c--){let{match:d,type:p}=this.frontier[c],m=ch(t,c,p,d,!0);if(!m||m.childCount)continue t}return{depth:e,fit:u,move:o?t.doc.resolve(t.after(e+1)):t}}}}close(t){let e=this.findCloseLevel(t);if(!e)return null;for(;this.depth>e.depth;)this.closeFrontierNode();e.fit.childCount&&(this.placed=Zl(this.placed,e.depth,e.fit)),t=e.move;for(let i=e.depth+1;i<=t.depth;i++){let s=t.node(i),o=s.type.contentMatch.fillBefore(s.content,!0,t.index(i));this.openFrontierNode(s.type,s.attrs,o)}return t}openFrontierNode(t,e=null,i){let s=this.frontier[this.depth];s.match=s.match.matchType(t),this.placed=Zl(this.placed,this.depth,j.from(t.create(e,i))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(j.empty,!0);e.childCount&&(this.placed=Zl(this.placed,this.frontier.length,e))}}function Jl(n,t,e){return t==0?n.cutByIndex(e,n.childCount):n.replaceChild(0,n.firstChild.copy(Jl(n.firstChild.content,t-1,e)))}function Zl(n,t,e){return t==0?n.append(e):n.replaceChild(n.childCount-1,n.lastChild.copy(Zl(n.lastChild.content,t-1,e)))}function wb(n,t){for(let e=0;e<t;e++)n=n.firstChild.content;return n}function K1(n,t,e){if(t<=0)return n;let i=n.content;return t>1&&(i=i.replaceChild(0,K1(i.firstChild,t-1,i.childCount==1?e-1:0))),t>0&&(i=n.type.contentMatch.fillBefore(i).append(i),e<=0&&(i=i.append(n.type.contentMatch.matchFragment(i).fillBefore(j.empty,!0)))),n.copy(i)}function ch(n,t,e,i,s){let o=n.node(t),u=s?n.indexAfter(t):n.index(t);if(u==o.childCount&&!e.compatibleContent(o.type))return null;let c=i.fillBefore(o.content,!0,u);return c&&!tA(e,o.content,u)?c:null}function tA(n,t,e){for(let i=e;i<t.childCount;i++)if(!n.allowsMarks(t.child(i).marks))return!0;return!1}function eA(n){return n.spec.defining||n.spec.definingForContent}function Nb(n,t){for(let e=0;;e++){let i=t<0?n.firstChild:n.lastChild;if(!i||i.isAtom)return e;n=i.content}}function nA(n,t,e,i){if(!i.size)return n.deleteRange(t,e);let s=n.doc.resolve(t),o=n.doc.resolve(e);if(P1(s,o,i))return n.step(new Qt(t,e,i));let u=Y1(s,o);u[u.length-1]==0&&u.pop();let c=-(s.depth+1);u.unshift(c);for(let b=s.depth,v=s.pos-1;b>0;b--,v--){let E=s.node(b).type.spec;if(E.defining||E.definingAsContext||E.isolating)break;u.indexOf(b)>-1?c=b:s.before(b)==v&&u.splice(1,0,-b)}let d=u.indexOf(c),p=[],m=i.openStart;for(let b=i.content,v=0;;v++){let E=b.firstChild;if(p.push(E),v==i.openStart)break;b=E.content}for(let b=m-1;b>=0;b--){let v=p[b],E=eA(v.type);if(E&&!v.sameMarkup(s.node(Math.abs(c)-1)))m=b;else if(E||!v.type.isTextblock)break}for(let b=i.openStart;b>=0;b--){let v=(b+m+1)%(i.openStart+1),E=p[v];if(E)for(let M=0;M<u.length;M++){let x=u[(M+d)%u.length],O=!0;x<0&&(O=!1,x=-x);let B=s.node(x-1),I=s.index(x-1);if(B.canReplaceWith(I,I,E.type,E.marks))return n.replace(s.before(x),O?o.after(x):e,new X(G1(i.content,0,i.openStart,v),v,i.openEnd))}}let y=n.steps.length;for(let b=u.length-1;b>=0&&(n.replace(t,e,i),!(n.steps.length>y));b--){let v=u[b];v<0||(t=s.before(v),e=o.after(v))}}function G1(n,t,e,i,s){if(t<e){let o=n.firstChild;n=n.replaceChild(0,o.copy(G1(o.content,t+1,e,i,o)))}if(t>i){let o=s.contentMatchAt(0),u=o.fillBefore(n).append(n);n=u.append(o.matchFragment(u).fillBefore(j.empty,!0))}return n}function iA(n,t,e,i){if(!i.isInline&&t==e&&n.doc.resolve(t).parent.content.size){let s=Zk(n.doc,t,i.type);s!=null&&(t=e=s)}n.replaceRange(t,e,new X(j.from(i),0,0))}function rA(n,t,e){let i=n.doc.resolve(t),s=n.doc.resolve(e);if(i.parent.isTextblock&&s.parent.isTextblock&&i.start()!=s.start()&&i.parentOffset==0&&s.parentOffset==0){let u=i.sharedDepth(e),c=!1;for(let d=i.depth;d>u;d--)i.node(d).type.spec.isolating&&(c=!0);for(let d=s.depth;d>u;d--)s.node(d).type.spec.isolating&&(c=!0);if(!c){for(let d=i.depth;d>0&&t==i.start(d);d--)t=i.before(d);for(let d=s.depth;d>0&&e==s.start(d);d--)e=s.before(d);i=n.doc.resolve(t),s=n.doc.resolve(e)}}let o=Y1(i,s);for(let u=0;u<o.length;u++){let c=o[u],d=u==o.length-1;if(d&&c==0||i.node(c).type.contentMatch.validEnd)return n.delete(i.start(c),s.end(c));if(c>0&&(d||i.node(c-1).canReplace(i.index(c-1),s.indexAfter(c-1))))return n.delete(i.before(c),s.after(c))}for(let u=1;u<=i.depth&&u<=s.depth;u++)if(t-i.start(u)==i.depth-u&&e>i.end(u)&&s.end(u)-e!=s.depth-u&&i.start(u-1)==s.start(u-1)&&i.node(u-1).canReplace(i.index(u-1),s.index(u-1)))return n.delete(i.before(u),e);n.delete(t,e)}function Y1(n,t){let e=[],i=Math.min(n.depth,t.depth);for(let s=i;s>=0;s--){let o=n.start(s);if(o<n.pos-(n.depth-s)||t.end(s)>t.pos+(t.depth-s)||n.node(s).type.spec.isolating||t.node(s).type.spec.isolating)break;(o==t.start(s)||s==n.depth&&s==t.depth&&n.parent.inlineContent&&t.parent.inlineContent&&s&&t.start(s-1)==o-1)&&e.push(s)}return e}class Ds extends we{constructor(t,e,i){super(),this.pos=t,this.attr=e,this.value=i}apply(t){let e=t.nodeAt(this.pos);if(!e)return re.fail(\"No node at attribute step's position\");let i=Object.create(null);for(let o in e.attrs)i[o]=e.attrs[o];i[this.attr]=this.value;let s=e.type.create(i,null,e.marks);return re.fromReplace(t,this.pos,this.pos+1,new X(j.from(s),0,e.isLeaf?0:1))}getMap(){return Je.empty}invert(t){return new Ds(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new Ds(e.pos,this.attr,this.value)}toJSON(){return{stepType:\"attr\",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,e){if(typeof e.pos!=\"number\"||typeof e.attr!=\"string\")throw new RangeError(\"Invalid input for AttrStep.fromJSON\");return new Ds(e.pos,e.attr,e.value)}}we.jsonID(\"attr\",Ds);class To extends we{constructor(t,e){super(),this.attr=t,this.value=e}apply(t){let e=Object.create(null);for(let s in t.attrs)e[s]=t.attrs[s];e[this.attr]=this.value;let i=t.type.create(e,t.content,t.marks);return re.ok(i)}getMap(){return Je.empty}invert(t){return new To(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:\"docAttr\",attr:this.attr,value:this.value}}static fromJSON(t,e){if(typeof e.attr!=\"string\")throw new RangeError(\"Invalid input for DocAttrStep.fromJSON\");return new To(e.attr,e.value)}}we.jsonID(\"docAttr\",To);let Ls=class extends Error{};Ls=function n(t){let e=Error.call(this,t);return e.__proto__=n.prototype,e};Ls.prototype=Object.create(Error.prototype);Ls.prototype.constructor=Ls;Ls.prototype.name=\"TransformError\";class X1{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new Eo}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let e=this.maybeStep(t);if(e.failed)throw new Ls(e.failed);return this}maybeStep(t){let e=t.apply(this.doc);return e.failed||this.addStep(t,e.doc),e}get docChanged(){return this.steps.length>0}changedRange(){let t=1e9,e=-1e9;for(let i=0;i<this.mapping.maps.length;i++){let s=this.mapping.maps[i];i&&(t=s.map(t,1),e=s.map(e,-1)),s.forEach((o,u,c,d)=>{t=Math.min(t,c),e=Math.max(e,d)})}return t==1e9?null:{from:t,to:e}}addStep(t,e){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=e}replace(t,e=t,i=X.empty){let s=uc(this.doc,t,e,i);return s&&this.step(s),this}replaceWith(t,e,i){return this.replace(t,e,new X(j.from(i),0,0))}delete(t,e){return this.replace(t,e,X.empty)}insert(t,e){return this.replaceWith(t,t,e)}replaceRange(t,e,i){return nA(this,t,e,i),this}replaceRangeWith(t,e,i){return iA(this,t,e,i),this}deleteRange(t,e){return rA(this,t,e),this}lift(t,e){return Vk(this,t,e),this}join(t,e=1){return Jk(this,t,e),this}wrap(t,e){return Kk(this,t,e),this}setBlockType(t,e=t,i,s=null){return Gk(this,t,e,i,s),this}setNodeMarkup(t,e,i=null,s){return Xk(this,t,e,i,s),this}setNodeAttribute(t,e,i){return this.step(new Ds(t,e,i)),this}setDocAttribute(t,e){return this.step(new To(t,e)),this}addNodeMark(t,e){return this.step(new Ii(t,e)),this}removeNodeMark(t,e){let i=this.doc.nodeAt(t);if(!i)throw new RangeError(\"No node at position \"+t);if(e instanceof Ut)e.isInSet(i.marks)&&this.step(new wr(t,e));else{let s=i.marks,o,u=[];for(;o=e.isInSet(s);)u.push(new wr(t,o)),s=o.removeFromSet(s);for(let c=u.length-1;c>=0;c--)this.step(u[c])}return this}split(t,e=1,i){return Fk(this,t,e,i),this}addMark(t,e,i){return Ik(this,t,e,i),this}removeMark(t,e,i){return jk(this,t,e,i),this}clearIncompatible(t,e,i){return yp(this,t,e,i),this}}const fh=Object.create(null);class dt{constructor(t,e,i){this.$anchor=t,this.$head=e,this.ranges=i||[new sA(t.min(e),t.max(e))]}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 t=this.ranges;for(let e=0;e<t.length;e++)if(t[e].$from.pos!=t[e].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(t,e=X.empty){let i=e.content.lastChild,s=null;for(let c=0;c<e.openEnd;c++)s=i,i=i.lastChild;let o=t.steps.length,u=this.ranges;for(let c=0;c<u.length;c++){let{$from:d,$to:p}=u[c],m=t.mapping.slice(o);t.replaceRange(m.map(d.pos),m.map(p.pos),c?X.empty:e),c==0&&Lb(t,o,(i?i.isInline:s&&s.isTextblock)?-1:1)}}replaceWith(t,e){let i=t.steps.length,s=this.ranges;for(let o=0;o<s.length;o++){let{$from:u,$to:c}=s[o],d=t.mapping.slice(i),p=d.map(u.pos),m=d.map(c.pos);o?t.deleteRange(p,m):(t.replaceRangeWith(p,m,e),Lb(t,i,e.isInline?-1:1))}}static findFrom(t,e,i=!1){let s=t.parent.inlineContent?new lt(t):As(t.node(0),t.parent,t.pos,t.index(),e,i);if(s)return s;for(let o=t.depth-1;o>=0;o--){let u=e<0?As(t.node(0),t.node(o),t.before(o+1),t.index(o),e,i):As(t.node(0),t.node(o),t.after(o+1),t.index(o)+1,e,i);if(u)return u}return null}static near(t,e=1){return this.findFrom(t,e)||this.findFrom(t,-e)||new Ze(t.node(0))}static atStart(t){return As(t,t,0,0,1)||new Ze(t)}static atEnd(t){return As(t,t,t.content.size,t.childCount,-1)||new Ze(t)}static fromJSON(t,e){if(!e||!e.type)throw new RangeError(\"Invalid input for Selection.fromJSON\");let i=fh[e.type];if(!i)throw new RangeError(`No selection type ${e.type} defined`);return i.fromJSON(t,e)}static jsonID(t,e){if(t in fh)throw new RangeError(\"Duplicate use of selection JSON ID \"+t);return fh[t]=e,e.prototype.jsonID=t,e}getBookmark(){return lt.between(this.$anchor,this.$head).getBookmark()}}dt.prototype.visible=!0;class sA{constructor(t,e){this.$from=t,this.$to=e}}let Db=!1;function Rb(n){!Db&&!n.parent.inlineContent&&(Db=!0,console.warn(\"TextSelection endpoint not pointing into a node with inline content (\"+n.parent.type.name+\")\"))}class lt extends dt{constructor(t,e=t){Rb(t),Rb(e),super(t,e)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,e){let i=t.resolve(e.map(this.head));if(!i.parent.inlineContent)return dt.near(i);let s=t.resolve(e.map(this.anchor));return new lt(s.parent.inlineContent?s:i,i)}replace(t,e=X.empty){if(super.replace(t,e),e==X.empty){let i=this.$from.marksAcross(this.$to);i&&t.ensureMarks(i)}}eq(t){return t instanceof lt&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new cc(this.anchor,this.head)}toJSON(){return{type:\"text\",anchor:this.anchor,head:this.head}}static fromJSON(t,e){if(typeof e.anchor!=\"number\"||typeof e.head!=\"number\")throw new RangeError(\"Invalid input for TextSelection.fromJSON\");return new lt(t.resolve(e.anchor),t.resolve(e.head))}static create(t,e,i=e){let s=t.resolve(e);return new this(s,i==e?s:t.resolve(i))}static between(t,e,i){let s=t.pos-e.pos;if((!i||s)&&(i=s>=0?1:-1),!e.parent.inlineContent){let o=dt.findFrom(e,i,!0)||dt.findFrom(e,-i,!0);if(o)e=o.$head;else return dt.near(e,i)}return t.parent.inlineContent||(s==0?t=e:(t=(dt.findFrom(t,-i,!0)||dt.findFrom(t,i,!0)).$anchor,t.pos<e.pos!=s<0&&(t=e))),new lt(t,e)}}dt.jsonID(\"text\",lt);class cc{constructor(t,e){this.anchor=t,this.head=e}map(t){return new cc(t.map(this.anchor),t.map(this.head))}resolve(t){return lt.between(t.resolve(this.anchor),t.resolve(this.head))}}class rt extends dt{constructor(t){let e=t.nodeAfter,i=t.node(0).resolve(t.pos+e.nodeSize);super(t,i),this.node=e}map(t,e){let{deleted:i,pos:s}=e.mapResult(this.anchor),o=t.resolve(s);return i?dt.near(o):new rt(o)}content(){return new X(j.from(this.node),0,0)}eq(t){return t instanceof rt&&t.anchor==this.anchor}toJSON(){return{type:\"node\",anchor:this.anchor}}getBookmark(){return new vp(this.anchor)}static fromJSON(t,e){if(typeof e.anchor!=\"number\")throw new RangeError(\"Invalid input for NodeSelection.fromJSON\");return new rt(t.resolve(e.anchor))}static create(t,e){return new rt(t.resolve(e))}static isSelectable(t){return!t.isText&&t.type.spec.selectable!==!1}}rt.prototype.visible=!1;dt.jsonID(\"node\",rt);class vp{constructor(t){this.anchor=t}map(t){let{deleted:e,pos:i}=t.mapResult(this.anchor);return e?new cc(i,i):new vp(i)}resolve(t){let e=t.resolve(this.anchor),i=e.nodeAfter;return i&&rt.isSelectable(i)?new rt(e):dt.near(e)}}class Ze extends dt{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t,e=X.empty){if(e==X.empty){t.delete(0,t.doc.content.size);let i=dt.atStart(t.doc);i.eq(t.selection)||t.setSelection(i)}else super.replace(t,e)}toJSON(){return{type:\"all\"}}static fromJSON(t){return new Ze(t)}map(t){return new Ze(t)}eq(t){return t instanceof Ze}getBookmark(){return lA}}dt.jsonID(\"all\",Ze);const lA={map(){return this},resolve(n){return new Ze(n)}};function As(n,t,e,i,s,o=!1){if(t.inlineContent)return lt.create(n,e);for(let u=i-(s>0?0:1);s>0?u<t.childCount:u>=0;u+=s){let c=t.child(u);if(c.isAtom){if(!o&&rt.isSelectable(c))return rt.create(n,e-(s<0?c.nodeSize:0))}else{let d=As(n,c,e+s,s<0?c.childCount:0,s,o);if(d)return d}e+=c.nodeSize*s}return null}function Lb(n,t,e){let i=n.steps.length-1;if(i<t)return;let s=n.steps[i];if(!(s instanceof Qt||s instanceof he))return;let o=n.mapping.maps[i],u;o.forEach((c,d,p,m)=>{u==null&&(u=m)}),n.setSelection(dt.near(n.doc.resolve(u),e))}const zb=1,eu=2,Bb=4;class oA extends X1{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.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(t){if(t.$from.doc!=this.doc)throw new RangeError(\"Selection passed to setSelection must point at the current document\");return this.curSelection=t,this.curSelectionFor=this.steps.length,this.updated=(this.updated|zb)&~eu,this.storedMarks=null,this}get selectionSet(){return(this.updated&zb)>0}setStoredMarks(t){return this.storedMarks=t,this.updated|=eu,this}ensureMarks(t){return Ut.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&eu)>0}addStep(t,e){super.addStep(t,e),this.updated=this.updated&~eu,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t,e=!0){let i=this.selection;return e&&(t=t.mark(this.storedMarks||(i.empty?i.$from.marks():i.$from.marksAcross(i.$to)||Ut.none))),i.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,e,i){let s=this.doc.type.schema;if(e==null)return t?this.replaceSelectionWith(s.text(t),!0):this.deleteSelection();{if(i==null&&(i=e),!t)return this.deleteRange(e,i);let o=this.storedMarks;if(!o){let u=this.doc.resolve(e);o=i==e?u.marks():u.marksAcross(this.doc.resolve(i))}return this.replaceRangeWith(e,i,s.text(t,o)),!this.selection.empty&&this.selection.to==e+t.length&&this.setSelection(dt.near(this.selection.$to)),this}}setMeta(t,e){return this.meta[typeof t==\"string\"?t:t.key]=e,this}getMeta(t){return this.meta[typeof t==\"string\"?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=Bb,this}get scrolledIntoView(){return(this.updated&Bb)>0}}function Hb(n,t){return!t||!n?n:n.bind(t)}class Wl{constructor(t,e,i){this.name=t,this.init=Hb(e.init,i),this.apply=Hb(e.apply,i)}}const aA=[new Wl(\"doc\",{init(n){return n.doc||n.schema.topNodeType.createAndFill()},apply(n){return n.doc}}),new Wl(\"selection\",{init(n,t){return n.selection||dt.atStart(t.doc)},apply(n){return n.selection}}),new Wl(\"storedMarks\",{init(n){return n.storedMarks||null},apply(n,t,e,i){return i.selection.$cursor?n.storedMarks:null}}),new Wl(\"scrollToSelection\",{init(){return 0},apply(n,t){return n.scrolledIntoView?t+1:t}})];class dh{constructor(t,e){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=aA.slice(),e&&e.forEach(i=>{if(this.pluginsByKey[i.key])throw new RangeError(\"Adding different instances of a keyed plugin (\"+i.key+\")\");this.plugins.push(i),this.pluginsByKey[i.key]=i,i.spec.state&&this.fields.push(new Wl(i.key,i.spec.state,i))})}}class Zn{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(t){return this.applyTransaction(t).state}filterTransaction(t,e=-1){for(let i=0;i<this.config.plugins.length;i++)if(i!=e){let s=this.config.plugins[i];if(s.spec.filterTransaction&&!s.spec.filterTransaction.call(s,t,this))return!1}return!0}applyTransaction(t){if(!this.filterTransaction(t))return{state:this,transactions:[]};let e=[t],i=this.applyInner(t),s=null;for(;;){let o=!1;for(let u=0;u<this.config.plugins.length;u++){let c=this.config.plugins[u];if(c.spec.appendTransaction){let d=s?s[u].n:0,p=s?s[u].state:this,m=d<e.length&&c.spec.appendTransaction.call(c,d?e.slice(d):e,p,i);if(m&&i.filterTransaction(m,u)){if(m.setMeta(\"appendedTransaction\",t),!s){s=[];for(let y=0;y<this.config.plugins.length;y++)s.push(y<u?{state:i,n:e.length}:{state:this,n:0})}e.push(m),i=i.applyInner(m),o=!0}s&&(s[u]={state:i,n:e.length})}}if(!o)return{state:i,transactions:e}}}applyInner(t){if(!t.before.eq(this.doc))throw new RangeError(\"Applying a mismatched transaction\");let e=new Zn(this.config),i=this.config.fields;for(let s=0;s<i.length;s++){let o=i[s];e[o.name]=o.apply(t,this[o.name],this,e)}return e}get tr(){return new oA(this)}static create(t){let e=new dh(t.doc?t.doc.type.schema:t.schema,t.plugins),i=new Zn(e);for(let s=0;s<e.fields.length;s++)i[e.fields[s].name]=e.fields[s].init(t,i);return i}reconfigure(t){let e=new dh(this.schema,t.plugins),i=e.fields,s=new Zn(e);for(let o=0;o<i.length;o++){let u=i[o].name;s[u]=this.hasOwnProperty(u)?this[u]:i[o].init(t,s)}return s}toJSON(t){let e={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(e.storedMarks=this.storedMarks.map(i=>i.toJSON())),t&&typeof t==\"object\")for(let i in t){if(i==\"doc\"||i==\"selection\")throw new RangeError(\"The JSON fields `doc` and `selection` are reserved\");let s=t[i],o=s.spec.state;o&&o.toJSON&&(e[i]=o.toJSON.call(s,this[s.key]))}return e}static fromJSON(t,e,i){if(!e)throw new RangeError(\"Invalid input for EditorState.fromJSON\");if(!t.schema)throw new RangeError(\"Required config field 'schema' missing\");let s=new dh(t.schema,t.plugins),o=new Zn(s);return s.fields.forEach(u=>{if(u.name==\"doc\")o.doc=Mr.fromJSON(t.schema,e.doc);else if(u.name==\"selection\")o.selection=dt.fromJSON(o.doc,e.selection);else if(u.name==\"storedMarks\")e.storedMarks&&(o.storedMarks=e.storedMarks.map(t.schema.markFromJSON));else{if(i)for(let c in i){let d=i[c],p=d.spec.state;if(d.key==u.name&&p&&p.fromJSON&&Object.prototype.hasOwnProperty.call(e,c)){o[u.name]=p.fromJSON.call(d,t,e[c],o);return}}o[u.name]=u.init(t,o)}}),o}}function F1(n,t,e){for(let i in n){let s=n[i];s instanceof Function?s=s.bind(t):i==\"handleDOMEvents\"&&(s=F1(s,t,{})),e[i]=s}return e}class It{constructor(t){this.spec=t,this.props={},t.props&&F1(t.props,this,this.props),this.key=t.key?t.key.key:Q1(\"plugin\")}getState(t){return t[this.key]}}const hh=Object.create(null);function Q1(n){return n in hh?n+\"$\"+ ++hh[n]:(hh[n]=0,n+\"$\")}class Zt{constructor(t=\"key\"){this.key=Q1(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}var uA=h1();const cA=mp(uA);var ph={exports:{}},mh={};/**\n * @license React\n * use-sync-external-store-shim.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */var _b;function fA(){if(_b)return mh;_b=1;var n=wo();function t(y,b){return y===b&&(y!==0||1/y===1/b)||y!==y&&b!==b}var e=typeof Object.is==\"function\"?Object.is:t,i=n.useState,s=n.useEffect,o=n.useLayoutEffect,u=n.useDebugValue;function c(y,b){var v=b(),E=i({inst:{value:v,getSnapshot:b}}),M=E[0].inst,x=E[1];return o(function(){M.value=v,M.getSnapshot=b,d(M)&&x({inst:M})},[y,v,b]),s(function(){return d(M)&&x({inst:M}),y(function(){d(M)&&x({inst:M})})},[y]),u(v),v}function d(y){var b=y.getSnapshot;y=y.value;try{var v=b();return!e(y,v)}catch{return!0}}function p(y,b){return b()}var m=typeof window>\"u\"||typeof window.document>\"u\"||typeof window.document.createElement>\"u\"?p:c;return mh.useSyncExternalStore=n.useSyncExternalStore!==void 0?n.useSyncExternalStore:m,mh}var Ub;function J1(){return Ub||(Ub=1,ph.exports=fA()),ph.exports}var Z1=J1(),Ib=Object.defineProperty,dA=(n,t)=>{let e={};for(var i in n)Ib(e,i,{get:n[i],enumerable:!0});return Ib(e,Symbol.toStringTag,{value:\"Module\"}),e};const W1=(n,t)=>n.selection.empty?!1:(t&&t(n.tr.deleteSelection().scrollIntoView()),!0);function tS(n,t){let{$cursor:e}=n.selection;return!e||(t?!t.endOfTextblock(\"backward\",n):e.parentOffset>0)?null:e}const eS=(n,t,e)=>{let i=tS(n,e);if(!i)return!1;let s=Sp(i);if(!s){let u=i.blockRange(),c=u&&qs(u);return c==null?!1:(t&&t(n.tr.lift(u,c).scrollIntoView()),!0)}let o=s.nodeBefore;if(cS(n,s,t,-1))return!0;if(i.parent.content.size==0&&(zs(o,\"end\")||rt.isSelectable(o)))for(let u=i.depth;;u--){let c=uc(n.doc,i.before(u),i.after(u),X.empty);if(c&&c.slice.size<c.to-c.from){if(t){let d=n.tr.step(c);d.setSelection(zs(o,\"end\")?dt.findFrom(d.doc.resolve(d.mapping.map(s.pos,-1)),-1):rt.create(d.doc,s.pos-o.nodeSize)),t(d.scrollIntoView())}return!0}if(u==1||i.node(u-1).childCount>1)break}return o.isAtom&&s.depth==i.depth-1?(t&&t(n.tr.delete(s.pos-o.nodeSize,s.pos).scrollIntoView()),!0):!1},hA=(n,t,e)=>{let i=tS(n,e);if(!i)return!1;let s=Sp(i);return s?nS(n,s,t):!1},pA=(n,t,e)=>{let i=rS(n,e);if(!i)return!1;let s=Ep(i);return s?nS(n,s,t):!1};function nS(n,t,e){let i=t.nodeBefore,s=i,o=t.pos-1;for(;!s.isTextblock;o--){if(s.type.spec.isolating)return!1;let m=s.lastChild;if(!m)return!1;s=m}let u=t.nodeAfter,c=u,d=t.pos+1;for(;!c.isTextblock;d++){if(c.type.spec.isolating)return!1;let m=c.firstChild;if(!m)return!1;c=m}let p=uc(n.doc,o,d,X.empty);if(!p||p.from!=o||p instanceof Qt&&p.slice.size>=d-o)return!1;if(e){let m=n.tr.step(p);m.setSelection(lt.create(m.doc,o)),e(m.scrollIntoView())}return!0}function zs(n,t,e=!1){for(let i=n;i;i=t==\"start\"?i.firstChild:i.lastChild){if(i.isTextblock)return!0;if(e&&i.childCount!=1)return!1}return!1}const iS=(n,t,e)=>{let{$head:i,empty:s}=n.selection,o=i;if(!s)return!1;if(i.parent.isTextblock){if(e?!e.endOfTextblock(\"backward\",n):i.parentOffset>0)return!1;o=Sp(i)}let u=o&&o.nodeBefore;return!u||!rt.isSelectable(u)?!1:(t&&t(n.tr.setSelection(rt.create(n.doc,o.pos-u.nodeSize)).scrollIntoView()),!0)};function Sp(n){if(!n.parent.type.spec.isolating)for(let t=n.depth-1;t>=0;t--){if(n.index(t)>0)return n.doc.resolve(n.before(t+1));if(n.node(t).type.spec.isolating)break}return null}function rS(n,t){let{$cursor:e}=n.selection;return!e||(t?!t.endOfTextblock(\"forward\",n):e.parentOffset<e.parent.content.size)?null:e}const sS=(n,t,e)=>{let i=rS(n,e);if(!i)return!1;let s=Ep(i);if(!s)return!1;let o=s.nodeAfter;if(cS(n,s,t,1))return!0;if(i.parent.content.size==0&&(zs(o,\"start\")||rt.isSelectable(o))){let u=uc(n.doc,i.before(),i.after(),X.empty);if(u&&u.slice.size<u.to-u.from){if(t){let c=n.tr.step(u);c.setSelection(zs(o,\"start\")?dt.findFrom(c.doc.resolve(c.mapping.map(s.pos)),1):rt.create(c.doc,c.mapping.map(s.pos))),t(c.scrollIntoView())}return!0}}return o.isAtom&&s.depth==i.depth-1?(t&&t(n.tr.delete(s.pos,s.pos+o.nodeSize).scrollIntoView()),!0):!1},lS=(n,t,e)=>{let{$head:i,empty:s}=n.selection,o=i;if(!s)return!1;if(i.parent.isTextblock){if(e?!e.endOfTextblock(\"forward\",n):i.parentOffset<i.parent.content.size)return!1;o=Ep(i)}let u=o&&o.nodeAfter;return!u||!rt.isSelectable(u)?!1:(t&&t(n.tr.setSelection(rt.create(n.doc,o.pos)).scrollIntoView()),!0)};function Ep(n){if(!n.parent.type.spec.isolating)for(let t=n.depth-1;t>=0;t--){let e=n.node(t);if(n.index(t)+1<e.childCount)return n.doc.resolve(n.after(t+1));if(e.type.spec.isolating)break}return null}const mA=(n,t)=>{let e=n.selection,i=e instanceof rt,s;if(i){if(e.node.isTextblock||!Yi(n.doc,e.from))return!1;s=e.from}else if(s=ac(n.doc,e.from,-1),s==null)return!1;if(t){let o=n.tr.join(s);i&&o.setSelection(rt.create(o.doc,s-n.doc.resolve(s).nodeBefore.nodeSize)),t(o.scrollIntoView())}return!0},gA=(n,t)=>{let e=n.selection,i;if(e instanceof rt){if(e.node.isTextblock||!Yi(n.doc,e.to))return!1;i=e.to}else if(i=ac(n.doc,e.to,1),i==null)return!1;return t&&t(n.tr.join(i).scrollIntoView()),!0},yA=(n,t)=>{let{$from:e,$to:i}=n.selection,s=e.blockRange(i),o=s&&qs(s);return o==null?!1:(t&&t(n.tr.lift(s,o).scrollIntoView()),!0)},oS=(n,t)=>{let{$head:e,$anchor:i}=n.selection;return!e.parent.type.spec.code||!e.sameParent(i)?!1:(t&&t(n.tr.insertText(`\n`).scrollIntoView()),!0)};function Tp(n){for(let t=0;t<n.edgeCount;t++){let{type:e}=n.edge(t);if(e.isTextblock&&!e.hasRequiredAttrs())return e}return null}const bA=(n,t)=>{let{$head:e,$anchor:i}=n.selection;if(!e.parent.type.spec.code||!e.sameParent(i))return!1;let s=e.node(-1),o=e.indexAfter(-1),u=Tp(s.contentMatchAt(o));if(!u||!s.canReplaceWith(o,o,u))return!1;if(t){let c=e.after(),d=n.tr.replaceWith(c,c,u.createAndFill());d.setSelection(dt.near(d.doc.resolve(c),1)),t(d.scrollIntoView())}return!0},aS=(n,t)=>{let e=n.selection,{$from:i,$to:s}=e;if(e instanceof Ze||i.parent.inlineContent||s.parent.inlineContent)return!1;let o=Tp(s.parent.contentMatchAt(s.indexAfter()));if(!o||!o.isTextblock)return!1;if(t){let u=(!i.parentOffset&&s.index()<s.parent.childCount?i:s).pos,c=n.tr.insert(u,o.createAndFill());c.setSelection(lt.create(c.doc,u+1)),t(c.scrollIntoView())}return!0},uS=(n,t)=>{let{$cursor:e}=n.selection;if(!e||e.parent.content.size)return!1;if(e.depth>1&&e.after()!=e.end(-1)){let o=e.before();if(ei(n.doc,o))return t&&t(n.tr.split(o).scrollIntoView()),!0}let i=e.blockRange(),s=i&&qs(i);return s==null?!1:(t&&t(n.tr.lift(i,s).scrollIntoView()),!0)};function vA(n){return(t,e)=>{if(t.selection instanceof rt&&t.selection.node.isBlock){let{$from:v}=t.selection;return!v.parentOffset||!ei(t.doc,v.pos)?!1:(e&&e(t.tr.split(v.pos).scrollIntoView()),!0)}if(!t.selection.$from.depth)return!1;let i=t.tr;!t.selection.empty&&(t.selection instanceof lt||t.selection instanceof Ze)&&i.deleteSelection();let{$from:s}=i.selection,o=i.steps.length,u=[],c,d,p=!1,m=!1;for(let v=s.depth;;v--)if(s.node(v).isBlock){p=s.end(v)==s.pos+(s.depth-v),m=s.start(v)==s.pos-(s.depth-v),d=Tp(s.node(v-1).contentMatchAt(s.indexAfter(v-1))),u.unshift(p&&d?{type:d}:null),c=v;break}else{if(v==1)return!1;u.unshift(null)}let y=s.pos,b=ei(i.doc,y,u.length,u);if(b||(u[0]=d?{type:d}:null,b=ei(i.doc,y,u.length,u)),!b)return!1;if(i.split(y,u.length,u),!p&&m&&s.node(c).type!=d){let v=i.mapping.slice(o),E=v.map(s.before(c)),M=i.doc.resolve(E);d&&s.node(c-1).canReplaceWith(M.index(),M.index()+1,d)&&i.setNodeMarkup(v.map(s.before(c)),d)}return e&&e(i.scrollIntoView()),!0}}const SA=vA(),EA=(n,t)=>{let{$from:e,to:i}=n.selection,s,o=e.sharedDepth(i);return o==0?!1:(s=e.before(o),t&&t(n.tr.setSelection(rt.create(n.doc,s))),!0)};function TA(n,t,e){let i=t.nodeBefore,s=t.nodeAfter,o=t.index();return!i||!s||!i.type.compatibleContent(s.type)?!1:!i.content.size&&t.parent.canReplace(o-1,o)?(e&&e(n.tr.delete(t.pos-i.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(o,o+1)||!(s.isTextblock||Yi(n.doc,t.pos))?!1:(e&&e(n.tr.join(t.pos).scrollIntoView()),!0)}function cS(n,t,e,i){let s=t.nodeBefore,o=t.nodeAfter,u,c,d=s.type.spec.isolating||o.type.spec.isolating;if(!d&&TA(n,t,e))return!0;let p=!d&&t.parent.canReplace(t.index(),t.index()+1);if(p&&(u=(c=s.contentMatchAt(s.childCount)).findWrapping(o.type))&&c.matchType(u[0]||o.type).validEnd){if(e){let v=t.pos+o.nodeSize,E=j.empty;for(let O=u.length-1;O>=0;O--)E=j.from(u[O].create(null,E));E=j.from(s.copy(E));let M=n.tr.step(new he(t.pos-1,v,t.pos,v,new X(E,1,0),u.length,!0)),x=M.doc.resolve(v+2*u.length);x.nodeAfter&&x.nodeAfter.type==s.type&&Yi(M.doc,x.pos)&&M.join(x.pos),e(M.scrollIntoView())}return!0}let m=o.type.spec.isolating||i>0&&d?null:dt.findFrom(t,1),y=m&&m.$from.blockRange(m.$to),b=y&&qs(y);if(b!=null&&b>=t.depth)return e&&e(n.tr.lift(y,b).scrollIntoView()),!0;if(p&&zs(o,\"start\",!0)&&zs(s,\"end\")){let v=s,E=[];for(;E.push(v),!v.isTextblock;)v=v.lastChild;let M=o,x=1;for(;!M.isTextblock;M=M.firstChild)x++;if(v.canReplace(v.childCount,v.childCount,M.content)){if(e){let O=j.empty;for(let I=E.length-1;I>=0;I--)O=j.from(E[I].copy(O));let B=n.tr.step(new he(t.pos-E.length,t.pos+o.nodeSize,t.pos+x,t.pos+o.nodeSize-x,new X(O,E.length,0),0,!0));e(B.scrollIntoView())}return!0}}return!1}function fS(n){return function(t,e){let i=t.selection,s=n<0?i.$from:i.$to,o=s.depth;for(;s.node(o).isInline;){if(!o)return!1;o--}return s.node(o).isTextblock?(e&&e(t.tr.setSelection(lt.create(t.doc,n<0?s.start(o):s.end(o)))),!0):!1}}const xA=fS(-1),MA=fS(1);function kA(n,t=null){return function(e,i){let{$from:s,$to:o}=e.selection,u=s.blockRange(o),c=u&&bp(u,n,t);return c?(i&&i(e.tr.wrap(u,c).scrollIntoView()),!0):!1}}function jb(n,t=null){return function(e,i){let s=!1;for(let o=0;o<e.selection.ranges.length&&!s;o++){let{$from:{pos:u},$to:{pos:c}}=e.selection.ranges[o];e.doc.nodesBetween(u,c,(d,p)=>{if(s)return!1;if(!(!d.isTextblock||d.hasMarkup(n,t)))if(d.type==n)s=!0;else{let m=e.doc.resolve(p),y=m.index();s=m.parent.canReplaceWith(y,y+1,n)}})}if(!s)return!1;if(i){let o=e.tr;for(let u=0;u<e.selection.ranges.length;u++){let{$from:{pos:c},$to:{pos:d}}=e.selection.ranges[u];o.setBlockType(c,d,n,t)}i(o.scrollIntoView())}return!0}}function xp(...n){return function(t,e,i){for(let s=0;s<n.length;s++)if(n[s](t,e,i))return!0;return!1}}xp(W1,eS,iS);xp(W1,sS,lS);xp(oS,aS,uS,SA);typeof navigator<\"u\"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<\"u\"&&os.platform&&os.platform()==\"darwin\";function AA(n,t=null){return function(e,i){let{$from:s,$to:o}=e.selection,u=s.blockRange(o);if(!u)return!1;let c=i?e.tr:null;return CA(c,u,n,t)?(i&&i(c.scrollIntoView()),!0):!1}}function CA(n,t,e,i=null){let s=!1,o=t,u=t.$from.doc;if(t.depth>=2&&t.$from.node(t.depth-1).type.compatibleContent(e)&&t.startIndex==0){if(t.$from.index(t.depth-1)==0)return!1;let d=u.resolve(t.start-2);o=new Eu(d,d,t.depth),t.endIndex<t.parent.childCount&&(t=new Eu(t.$from,u.resolve(t.$to.end(t.depth)),t.depth)),s=!0}let c=bp(o,e,i,t);return c?(n&&OA(n,t,c,s,e),!0):!1}function OA(n,t,e,i,s){let o=j.empty;for(let m=e.length-1;m>=0;m--)o=j.from(e[m].type.create(e[m].attrs,o));n.step(new he(t.start-(i?2:0),t.end,t.start,t.end,new X(o,0,0),e.length,!0));let u=0;for(let m=0;m<e.length;m++)e[m].type==s&&(u=m+1);let c=e.length-u,d=t.start+e.length-(i?2:0),p=t.parent;for(let m=t.startIndex,y=t.endIndex,b=!0;m<y;m++,b=!1)!b&&ei(n.doc,d,c)&&(n.split(d,c),d+=2*c),d+=p.child(m).nodeSize;return n}function wA(n){return function(t,e){let{$from:i,$to:s}=t.selection,o=i.blockRange(s,u=>u.childCount>0&&u.firstChild.type==n);return o?e?i.node(o.depth-1).type==n?NA(t,e,n,o):DA(t,e,o):!0:!1}}function NA(n,t,e,i){let s=n.tr,o=i.end,u=i.$to.end(i.depth);o<u&&(s.step(new he(o-1,u,o,u,new X(j.from(e.create(null,i.parent.copy())),1,0),1,!0)),i=new Eu(s.doc.resolve(i.$from.pos),s.doc.resolve(u),i.depth));const c=qs(i);if(c==null)return!1;s.lift(i,c);let d=s.doc.resolve(s.mapping.map(o,-1)-1);return Yi(s.doc,d.pos)&&d.nodeBefore.type==d.nodeAfter.type&&s.join(d.pos),t(s.scrollIntoView()),!0}function DA(n,t,e){let i=n.tr,s=e.parent;for(let v=e.end,E=e.endIndex-1,M=e.startIndex;E>M;E--)v-=s.child(E).nodeSize,i.delete(v-1,v+1);let o=i.doc.resolve(e.start),u=o.nodeAfter;if(i.mapping.map(e.end)!=e.start+o.nodeAfter.nodeSize)return!1;let c=e.startIndex==0,d=e.endIndex==s.childCount,p=o.node(-1),m=o.index(-1);if(!p.canReplace(m+(c?0:1),m+1,u.content.append(d?j.empty:j.from(s))))return!1;let y=o.pos,b=y+u.nodeSize;return i.step(new he(y-(c?1:0),b+(d?1:0),y+1,b-1,new X((c?j.empty:j.from(s.copy(j.empty))).append(d?j.empty:j.from(s.copy(j.empty))),c?0:1,d?0:1),c?0:1)),t(i.scrollIntoView()),!0}function RA(n){return function(t,e){let{$from:i,$to:s}=t.selection,o=i.blockRange(s,p=>p.childCount>0&&p.firstChild.type==n);if(!o)return!1;let u=o.startIndex;if(u==0)return!1;let c=o.parent,d=c.child(u-1);if(d.type!=n)return!1;if(e){let p=d.lastChild&&d.lastChild.type==c.type,m=j.from(p?n.create():null),y=new X(j.from(n.create(null,j.from(c.type.create(null,m)))),p?3:1,0),b=o.start,v=o.end;e(t.tr.step(new he(b-(p?3:1),v,b,v,y,1,!0)).scrollIntoView())}return!0}}const ve=function(n){for(var t=0;;t++)if(n=n.previousSibling,!n)return t},Bs=function(n){let t=n.assignedSlot||n.parentNode;return t&&t.nodeType==11?t.host:t};let qh=null;const Jn=function(n,t,e){let i=qh||(qh=document.createRange());return i.setEnd(n,e??n.nodeValue.length),i.setStart(n,t||0),i},LA=function(){qh=null},Nr=function(n,t,e,i){return e&&(qb(n,t,e,i,-1)||qb(n,t,e,i,1))},zA=/^(img|br|input|textarea|hr)$/i;function qb(n,t,e,i,s){for(var o;;){if(n==e&&t==i)return!0;if(t==(s<0?0:Ae(n))){let u=n.parentNode;if(!u||!tt(u)||No(n)||zA.test(n.nodeName)||n.contentEditable==\"false\")return!1;t=ve(n)+(s<0?0:1),n=u}else if(tt(n)){let u=n.childNodes[t+(s<0?-1:0)];if(tt(u)&&u.contentEditable==\"false\")if(!((o=u.pmViewDesc)===null||o===void 0)&&o.ignoreForSelection)t+=s;else return!1;else n=u,t=s<0?Ae(n):0}else return!1}}function Ae(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function tt(n){return n.nodeType==1}function oe(n){return n.nodeType==3}function Dr(n,t){return t?n.contains(tt(t)?t:t.parentNode):!1}function BA(n,t){for(;;){if(oe(n)&&t)return n;if(tt(n)&&t>0){if(n.contentEditable==\"false\")return null;n=n.childNodes[t-1],t=Ae(n)}else if(n.parentNode&&!No(n))t=ve(n),n=n.parentNode;else return null}}function HA(n,t){for(;;){if(oe(n)&&t<n.nodeValue.length)return n;if(tt(n)&&t<n.childNodes.length){if(n.contentEditable==\"false\")return null;n=n.childNodes[t],t=0}else if(n.parentNode&&!No(n))t=ve(n)+1,n=n.parentNode;else return null}}function _A(n,t,e){for(let i=t==0,s=t==Ae(n);i||s;){if(n==e)return!0;let o=ve(n);if(n=n.parentNode,!n)return!1;i=i&&o==0,s=s&&o==Ae(n)}}function No(n){let t;for(let e=n;e&&!(t=e.pmViewDesc);e=e.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==n||t.contentDOM==n)}const fc=function(n){return n.focusNode&&Nr(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)};function gr(n,t){let e=document.createEvent(\"Event\");return e.initEvent(\"keydown\",!0,!0),e.keyCode=n,e.key=e.code=t,e}function UA(n){let t=n.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function IA(n,t,e){if(n.caretPositionFromPoint)try{let i=n.caretPositionFromPoint(t,e);if(i)return{node:i.offsetNode,offset:Math.min(Ae(i.offsetNode),i.offset)}}catch{}if(n.caretRangeFromPoint){let i=n.caretRangeFromPoint(t,e);if(i)return{node:i.startContainer,offset:Math.min(Ae(i.startContainer),i.startOffset)}}}const Nn=typeof navigator<\"u\"?navigator:null,Vb=typeof document<\"u\"?document:null,Xi=Nn&&Nn.userAgent||\"\",Vh=/Edge\\/(\\d+)/.exec(Xi),dS=/MSIE \\d/.exec(Xi),$h=/Trident\\/(?:[7-9]|\\d{2,})\\..*rv:(\\d+)/.exec(Xi),qe=!!(dS||$h||Vh),ji=dS?document.documentMode:$h?+$h[1]:Vh?+Vh[1]:0,We=!qe&&/gecko\\/(\\d+)/i.test(Xi);We&&+(/Firefox\\/(\\d+)/.exec(Xi)||[0,0])[1];const Ph=!qe&&/Chrome\\/(\\d+)/.exec(Xi),Ee=!!Ph,hS=Ph?+Ph[1]:0,Oe=!qe&&!!Nn&&/Apple Computer/.test(Nn.vendor),Hs=Oe&&(/Mobile\\/\\w+/.test(Xi)||!!Nn&&Nn.maxTouchPoints>2),dn=Hs||(Nn?/Mac/.test(Nn.platform):!1),pS=Nn?/Win/.test(Nn.platform):!1,Wn=/Android \\d/.test(Xi),dc=!!Vb&&\"webkitFontSmoothing\"in Vb.documentElement.style,jA=dc?+(/\\bAppleWebKit\\/(\\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function qA(n){let t=n.defaultView&&n.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:n.documentElement.clientWidth,top:0,bottom:n.documentElement.clientHeight}}function Gn(n,t){return typeof n==\"number\"?n:n[t]}function VA(n){let t=n.getBoundingClientRect(),e=t.width/n.offsetWidth||1,i=t.height/n.offsetHeight||1;return{left:t.left,right:t.left+n.clientWidth*e,top:t.top,bottom:t.top+n.clientHeight*i}}function $b(n,t,e){if(!Kh(t)&&t.left==0)return;let i=n.someProp(\"scrollThreshold\")||0,s=n.someProp(\"scrollMargin\")||5,o=n.dom.ownerDocument;for(let u=e||n.dom;u;){if(!tt(u)){u=Bs(u);continue}let c=u==o.body,d=c?qA(o):VA(u),p=0,m=0;if(t.top<d.top+Gn(i,\"top\")?m=-(d.top-t.top+Gn(s,\"top\")):t.bottom>d.bottom-Gn(i,\"bottom\")&&(m=t.bottom-t.top>d.bottom-d.top?t.top+Gn(s,\"top\")-d.top:t.bottom-d.bottom+Gn(s,\"bottom\")),t.left<d.left+Gn(i,\"left\")?p=-(d.left-t.left+Gn(s,\"left\")):t.right>d.right-Gn(i,\"right\")&&(p=t.right-d.right+Gn(s,\"right\")),p||m)if(c)o.defaultView.scrollBy(p,m);else{let b=u.scrollLeft,v=u.scrollTop;m&&(u.scrollTop+=m),p&&(u.scrollLeft+=p);let E=u.scrollLeft-b,M=u.scrollTop-v;t={left:t.left-E,top:t.top-M,right:t.right-E,bottom:t.bottom-M}}let y=c?\"fixed\":getComputedStyle(u).position;if(/^(fixed|sticky)$/.test(y))break;u=y==\"absolute\"?u.offsetParent:Bs(u)}}function $A(n){let t=n.dom.getBoundingClientRect(),e=Math.max(0,t.top),i,s;for(let o=(t.left+t.right)/2,u=e+1;u<Math.min(innerHeight,t.bottom);u+=5){let c=n.root.elementFromPoint(o,u);if(!c||c==n.dom||!n.dom.contains(c))continue;let d=c.getBoundingClientRect();if(d.top>=e-20){i=c,s=d.top;break}}return{refDOM:i,refTop:s,stack:mS(n.dom)}}function mS(n){let t=[],e=n.ownerDocument;for(let i=n;i&&(t.push({dom:i,top:i.scrollTop,left:i.scrollLeft}),n!=e);i=Bs(i));return t}function PA({refDOM:n,refTop:t,stack:e}){let i=n?n.getBoundingClientRect().top:0;gS(e,i==0?0:i-t)}function gS(n,t){for(let e=0;e<n.length;e++){let{dom:i,top:s,left:o}=n[e];i.scrollTop!=s+t&&(i.scrollTop=s+t),i.scrollLeft!=o&&(i.scrollLeft=o)}}let Ss=null;function KA(n){if(n.setActive)return n.setActive();if(Ss)return n.focus(Ss);let t=mS(n);n.focus(Ss==null?{get preventScroll(){return Ss={preventScroll:!0},!0}}:void 0),Ss||(Ss=!1,gS(t,0))}function yS(n,t){let e,i=2e8,s,o=0,u=t.top,c=t.top,d,p;for(let m=n.firstChild,y=0;m;m=m.nextSibling,y++){let b;if(tt(m))b=m.getClientRects();else if(oe(m))b=Jn(m).getClientRects();else continue;for(let v=0;v<b.length;v++){let E=b[v];if(E.top<=u&&E.bottom>=c){u=Math.max(E.bottom,u),c=Math.min(E.top,c);let M=E.left>t.left?E.left-t.left:E.right<t.left?t.left-E.right:0;if(M<i){e=m,i=M,s=M&&oe(e)?{left:E.right<t.left?E.right:E.left,top:t.top}:t,tt(m)&&M&&(o=y+(t.left>=(E.left+E.right)/2?1:0));continue}}else E.top>t.top&&!d&&E.left<=t.left&&E.right>=t.left&&(d=m,p={left:Math.max(E.left,Math.min(E.right,t.left)),top:E.top});!e&&(t.left>=E.right&&t.top>=E.top||t.left>=E.left&&t.top>=E.bottom)&&(o=y+1)}}return!e&&d&&(e=d,s=p,i=0),e&&oe(e)?GA(e,s):!e||i?{node:n,offset:o}:yS(e,s)}function GA(n,t){let e=n.nodeValue.length,i=document.createRange(),s;for(let o=0;o<e;o++){i.setEnd(n,o+1),i.setStart(n,o);let u=Li(i,1);if(u.top!=u.bottom&&Mp(t,u)){s={node:n,offset:o+(t.left>=(u.left+u.right)/2?1:0)};break}}return i.detach(),s||{node:n,offset:0}}function Mp(n,t){return n.left>=t.left-1&&n.left<=t.right+1&&n.top>=t.top-1&&n.top<=t.bottom+1}function YA(n,t){let e=n.parentNode;return e&&/^li$/i.test(e.nodeName)&&t.left<n.getBoundingClientRect().left?e:n}function XA(n,t,e){let{node:i,offset:s}=yS(t,e),o=-1;if(tt(i)&&!i.firstChild){let u=i.getBoundingClientRect();o=u.left!=u.right&&e.left>(u.left+u.right)/2?1:-1}return n.docView.posFromDOM(i,s,o)}function FA(n,t,e,i){let s=-1;for(let o=t,u=!1;o!=n.dom;){let c=n.docView.nearestDesc(o,!0),d;if(!c)return null;if(tt(c.dom)&&(c.node.isBlock&&c.parent||!c.contentDOM)&&((d=c.dom.getBoundingClientRect()).width||d.height)&&(c.node.isBlock&&c.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(c.dom.nodeName)&&(!u&&d.left>i.left||d.top>i.top?s=c.posBefore:(!u&&d.right<i.left||d.bottom<i.top)&&(s=c.posAfter),u=!0),!c.contentDOM&&s<0&&!c.node.isText))return(c.node.isBlock?i.top<(d.top+d.bottom)/2:i.left<(d.left+d.right)/2)?c.posBefore:c.posAfter;o=c.dom.parentNode}return s>-1?s:n.docView.posFromDOM(t,e,-1)}function bS(n,t,e){let i=n.childNodes.length;if(i&&e.top<e.bottom)for(let s=Math.max(0,Math.min(i-1,Math.floor(i*(t.top-e.top)/(e.bottom-e.top))-2)),o=s;;){let u=n.childNodes[o];if(tt(u)){let c=u.getClientRects();for(let d=0;d<c.length;d++){let p=c[d];if(Mp(t,p))return bS(u,t,p)}}if((o=(o+1)%i)==s)break}return n}function QA(n,t){let e=n.dom.ownerDocument,i,s=0,o=IA(e,t.left,t.top);o&&({node:i,offset:s}=o);let u=(n.root.elementFromPoint?n.root:e).elementFromPoint(t.left,t.top),c;if(!u||!n.dom.contains(u)){let p=n.dom.getBoundingClientRect();if(!Mp(t,p)||(u=bS(n.dom,t,p),!u))return null}if(Oe)for(let p=u;i&&p;p=Bs(p))p.draggable&&(i=void 0);if(u=YA(u,t),i){if(We&&tt(i)&&(s=Math.min(s,i.childNodes.length),s<i.childNodes.length)){let m=i.childNodes[s],y;m.nodeName==\"IMG\"&&(y=m.getBoundingClientRect()).right<=t.left&&y.bottom>t.top&&s++}let p;dc&&s&&tt(i)&&tt(p=i.childNodes[s-1])&&p.contentEditable==\"false\"&&p.getBoundingClientRect().top>=t.top&&s--,i==n.dom&&s==i.childNodes.length-1&&tt(i.lastChild)&&t.top>i.lastChild.getBoundingClientRect().bottom?c=n.state.doc.content.size:(s==0||!tt(i)||i.childNodes[s-1].nodeName!=\"BR\")&&(c=FA(n,i,s,t))}c==null&&(c=XA(n,u,t));let d=n.docView.nearestDesc(u,!0);return{pos:c,inside:d?d.posAtStart-d.border:-1}}function Kh(n){return n.top<n.bottom||n.left<n.right}function Li(n,t){let e=n.getClientRects();if(e.length){let i=e[t<0?0:e.length-1];if(Kh(i))return i}return Array.prototype.find.call(e,Kh)||n.getBoundingClientRect()}const JA=/[\\u0590-\\u05f4\\u0600-\\u06ff\\u0700-\\u08ac]/;function vS(n,t,e){let{node:i,offset:s,atom:o}=n.docView.domFromPos(t,e<0?-1:1),u=dc||We;if(oe(i))if(u&&(JA.test(i.nodeValue)||(e<0?!s:s==i.nodeValue.length))){let d=Li(Jn(i,s,s),e);if(We&&s&&/\\s/.test(i.nodeValue[s-1])&&s<i.nodeValue.length){let p=Li(Jn(i,s-1,s-1),-1);if(p.top==d.top){let m=Li(Jn(i,s,s+1),-1);if(m.top!=d.top)return $l(m,m.left<p.left)}}return d}else{let d=s,p=s,m=e<0?1:-1;return e<0&&!s?(p++,m=-1):e>=0&&s==i.nodeValue.length?(d--,m=1):e<0?d--:p++,$l(Li(Jn(i,d,p),m),m<0)}if(!n.state.doc.resolve(t-(o||0)).parent.inlineContent){if(o==null&&s&&(e<0||s==Ae(i))){let d=i.childNodes[s-1];if(tt(d))return gh(d.getBoundingClientRect(),!1)}if(o==null&&s<Ae(i)){let d=i.childNodes[s];if(tt(d))return gh(d.getBoundingClientRect(),!0)}return gh(i.getBoundingClientRect(),e>=0)}if(o==null&&s&&(e<0||s==Ae(i))){let d=i.childNodes[s-1],p=oe(d)?Jn(d,Ae(d)-(u?0:1)):tt(d)&&(d.nodeName!=\"BR\"||!d.nextSibling)?d:null;if(p)return $l(Li(p,1),!1)}if(o==null&&s<Ae(i)){let d=i.childNodes[s];for(;d.pmViewDesc&&d.pmViewDesc.ignoreForCoords;)d=d.nextSibling;let p=d?oe(d)?Jn(d,0,u?0:1):tt(d)?d:null:null;if(p)return $l(Li(p,-1),!0)}return $l(Li(oe(i)?Jn(i):i,-e),e>=0)}function $l(n,t){if(n.width==0)return n;let e=t?n.left:n.right;return{top:n.top,bottom:n.bottom,left:e,right:e}}function gh(n,t){if(n.height==0)return n;let e=t?n.top:n.bottom;return{top:e,bottom:e,left:n.left,right:n.right}}function SS(n,t,e){let i=n.state,s=n.root.activeElement;i!=t&&n.updateState(t),s!=n.dom&&n.focus();try{return e()}finally{i!=t&&n.updateState(i),s!=n.dom&&s&&s.focus()}}function ZA(n,t,e){let i=t.selection,s=e==\"up\"?i.$from:i.$to;return SS(n,t,()=>{let{node:o}=n.docView.domFromPos(s.pos,e==\"up\"?-1:1);for(;;){let c=n.docView.nearestDesc(o,!0);if(!c)break;if(c.node.isBlock){o=c.contentDOM||c.dom;break}o=c.dom.parentNode}let u=vS(n,s.pos,1);for(let c=o.firstChild;c;c=c.nextSibling){let d;if(tt(c))d=c.getClientRects();else if(oe(c))d=Jn(c,0,c.nodeValue.length).getClientRects();else continue;for(let p=0;p<d.length;p++){let m=d[p];if(m.bottom>m.top+1&&(e==\"up\"?u.top-m.top>(m.bottom-u.top)*2:m.bottom-u.bottom>(u.bottom-m.top)*2))return!1}}return!0})}const WA=/[\\u0590-\\u08ac]/;function tC(n,t,e){let{$head:i}=t.selection;if(!i.parent.isTextblock)return!1;let s=i.parentOffset,o=!s,u=s==i.parent.content.size,c=n.domSelection();return c?!WA.test(i.parent.textContent)||!c.modify?e==\"left\"||e==\"backward\"?o:u:SS(n,t,()=>{let{focusNode:d,focusOffset:p,anchorNode:m,anchorOffset:y}=n.domSelectionRange(),b=c.caretBidiLevel;c.modify(\"move\",e,\"character\");let v=i.depth?n.docView.domAfterPos(i.before()):n.dom,{focusNode:E,focusOffset:M}=n.domSelectionRange(),x=E&&!Dr(v,E)||d==E&&p==M;try{c.collapse(m,y),d&&(d!=m||p!=y)&&c.extend&&c.extend(d,p)}catch{}return b!=null&&(c.caretBidiLevel=b),x}):i.pos==i.start()||i.pos==i.end()}let Pb=null,Kb=null,Gb=!1;function eC(n,t,e){return Pb==t&&Kb==e?Gb:(Pb=t,Kb=e,Gb=e==\"up\"||e==\"down\"?ZA(n,t,e):tC(n,t,e))}const pn=0,Yb=1,yr=2,Sn=3;class Do{constructor(t,e,i,s){this.parent=t,this.children=e,this.dom=i,this.contentDOM=s,this.dirty=pn,i.pmViewDesc=this}matchesWidget(t){return!1}matchesMark(t){return!1}matchesNode(t,e,i){return!1}matchesHack(t){return!1}parseRule(t){return null}stopEvent(t){return!1}get size(){let t=0;for(let e=0;e<this.children.length;e++)t+=this.children[e].size;return t}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let t=0;t<this.children.length;t++)this.children[t].destroy()}posBeforeChild(t){for(let e=0,i=this.posAtStart;;e++){let s=this.children[e];if(s==t)return i;i+=s.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(t,e,i){if(this.contentDOM&&Dr(this.contentDOM,t))if(i<0){let o,u;if(t==this.contentDOM)o=t.childNodes[e-1];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;o=t.previousSibling}for(;o&&!((u=o.pmViewDesc)&&u.parent==this);)o=o.previousSibling;return o?this.posBeforeChild(u)+u.size:this.posAtStart}else{let o,u;if(t==this.contentDOM)o=t.childNodes[e];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;o=t.nextSibling}for(;o&&!((u=o.pmViewDesc)&&u.parent==this);)o=o.nextSibling;return o?this.posBeforeChild(u):this.posAtEnd}let s;if(t==this.dom&&this.contentDOM)s=e>ve(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))s=!!(t.compareDocumentPosition(this.contentDOM)&4);else if(this.dom.firstChild){if(e==0)for(let o=t;;o=o.parentNode){if(o==this.dom){s=!1;break}if(o.previousSibling)break}if(s==null&&e==t.childNodes.length)for(let o=t;;o=o.parentNode){if(o==this.dom){s=!0;break}if(o.nextSibling)break}}return s??i>0?this.posAtEnd:this.posAtStart}nearestDesc(t,e=!1){for(let i=!0,s=t;s;s=s.parentNode){let o=this.getDesc(s),u;if(o&&(!e||o.node))if(i&&(u=o.nodeDOM)&&!(tt(u)?Dr(u,t):u==t))i=!1;else return o}}getDesc(t){let e=t.pmViewDesc;for(let i=e;i;i=i.parent)if(i==this)return e}posFromDOM(t,e,i){for(let s=t;s;s=s.parentNode){let o=this.getDesc(s);if(o)return o.localPosFromDOM(t,e,i)}return-1}descAt(t){for(let e=0,i=0;e<this.children.length;e++){let s=this.children[e],o=i+s.size;if(i==t&&o!=i){for(;!s.border&&s.children.length;)for(let u=0;u<s.children.length;u++){let c=s.children[u];if(c.size){s=c;break}}return s}if(t<o)return s.descAt(t-i-s.border);i=o}}domFromPos(t,e){if(!this.contentDOM)return{node:this.dom,offset:0,atom:t+1};let i=0,s=0;for(let o=0;i<this.children.length;i++){let u=this.children[i],c=o+u.size;if(c>t){s=t-o;break}o=c}if(s)return this.children[i].domFromPos(s-this.children[i].border,e);for(;i>0;i--){let o=this.children[i-1];if(o.size||!(o instanceof TS||o instanceof ES&&o.side>=0))break}if(e<=0){let o,u=!0;for(;o=i?this.children[i-1]:null,!(!o||o.dom.parentNode==this.contentDOM);i--,u=!1);return o&&e&&u&&!o.border&&!o.domAtom?o.domFromPos(o.size,e):{node:this.contentDOM,offset:o?ve(o.dom)+1:0}}else{let o,u=!0;for(;o=i<this.children.length?this.children[i]:null,!(!o||o.dom.parentNode==this.contentDOM);i++,u=!1);return o&&u&&!o.border&&!o.domAtom?o.domFromPos(0,e):{node:this.contentDOM,offset:o?ve(o.dom):this.contentDOM.childNodes.length}}}parseRange(t,e,i=0){if(this.children.length==0)return{node:this.contentDOM,from:t,to:e,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let s=-1,o=-1;for(let u=i,c=0;;c++){let d=this.children[c],p=u+d.size;if(s==-1&&t<=p){let m=u+d.border;if(t>=m&&e<=p-d.border&&d.node&&d.contentDOM&&this.contentDOM.contains(d.contentDOM))return d.parseRange(t,e,m);t=u;for(let y=c;y>0;y--){let b=this.children[y-1];if(b.size&&b.dom.parentNode==this.contentDOM&&!b.emptyChildAt(1)){s=ve(b.dom)+1;break}t-=b.size}s==-1&&(s=0)}if(s>-1&&(p>e||c==this.children.length-1)){e=p;for(let m=c+1;m<this.children.length;m++){let y=this.children[m];if(y.size&&y.dom.parentNode==this.contentDOM&&!y.emptyChildAt(-1)){o=ve(y.dom);break}e+=y.size}o==-1&&(o=this.contentDOM.childNodes.length);break}u=p}return{node:this.contentDOM,from:t,to:e,fromOffset:s,toOffset:o}}emptyChildAt(t){if(this.border||!this.contentDOM||!this.children.length)return!1;let e=this.children[t<0?0:this.children.length-1];return e.size==0||e.emptyChildAt(t)}domAfterPos(t){let{node:e,offset:i}=this.domFromPos(t,0);if(!tt(e)||i==e.childNodes.length)throw new RangeError(\"No node after pos \"+t);return e.childNodes[i]}setSelection(t,e,i,s=!1){let o=Math.min(t,e),u=Math.max(t,e);for(let v=0,E=0;v<this.children.length;v++){let M=this.children[v],x=E+M.size;if(o>E&&u<x)return M.setSelection(t-E-M.border,e-E-M.border,i,s);E=x}let c=this.domFromPos(t,t?-1:1),d=e==t?c:this.domFromPos(e,e?-1:1),p=i.root.getSelection(),m=i.domSelectionRange(),y=!1;if((We||Oe)&&t==e){let{node:v,offset:E}=c;if(oe(v)){if(y=!!(E&&v.nodeValue[E-1]==`\n`),y&&E==v.nodeValue.length)for(let M=v,x;M;M=M.parentNode){if(x=M.nextSibling){x.nodeName==\"BR\"&&(c=d={node:x.parentNode,offset:ve(x)+1});break}let O=M.pmViewDesc;if(O&&O.node&&O.node.isBlock)break}}else{let M=v.childNodes[E-1];y=M&&(M.nodeName==\"BR\"||M.contentEditable==\"false\")}}if(We&&m.focusNode&&m.focusNode!=d.node&&tt(m.focusNode)){let v=m.focusNode.childNodes[m.focusOffset];v&&v.contentEditable==\"false\"&&(s=!0)}if(!(s||y&&Oe)&&Nr(c.node,c.offset,m.anchorNode,m.anchorOffset)&&Nr(d.node,d.offset,m.focusNode,m.focusOffset))return;let b=!1;if((p.extend||t==e)&&!(y&&We)){p.collapse(c.node,c.offset);try{t!=e&&p.extend(d.node,d.offset),b=!0}catch{}}if(!b){if(t>e){let E=c;c=d,d=E}let v=document.createRange();v.setEnd(d.node,d.offset),v.setStart(c.node,c.offset),p.removeAllRanges(),p.addRange(v)}}ignoreMutation(t){return!this.contentDOM&&t.type!=\"selection\"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(t,e){for(let i=0,s=0;s<this.children.length;s++){let o=this.children[s],u=i+o.size;if(i==u?t<=u&&e>=i:t<u&&e>i){let c=i+o.border,d=u-o.border;if(t>=c&&e<=d){this.dirty=t==i||e==u?yr:Yb,t==c&&e==d&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=Sn:o.markDirty(t-c,e-c);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?yr:Sn}i=u}this.dirty=yr}markParentsDirty(){let t=1;for(let e=this.parent;e;e=e.parent,t++){let i=t==1?yr:Yb;e.dirty<i&&(e.dirty=i)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(t){return!1}}class ES extends Do{constructor(t,e,i,s){let o,u=e.type.toDOM;if(typeof u==\"function\"&&(u=u(i,()=>{if(!o)return s;if(o.parent)return o.parent.posBeforeChild(o)})),!e.type.spec.raw){let c=tt(u)?u:document.createElement(\"span\");c!=u&&c.appendChild(u),c.hasAttribute(\"contenteditable\")||(c.contentEditable=\"false\"),c.classList.add(\"ProseMirror-widget\")}super(t,[],u,null),this.widget=e,this.widget=e,o=this}matchesWidget(t){return this.dirty==pn&&t.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(t){let e=this.widget.spec.stopEvent;return e?e(t):!1}ignoreMutation(t){return t.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}}class nC extends Do{constructor(t,e,i,s){super(t,[],e,null),this.textDOM=i,this.text=s}get size(){return this.text.length}localPosFromDOM(t,e){return t!=this.textDOM?this.posAtStart+(e?this.size:0):this.posAtStart+e}domFromPos(t){return{node:this.textDOM,offset:t}}ignoreMutation(t){return t.type===\"characterData\"&&t.target.nodeValue==t.oldValue}}class qi extends Do{constructor(t,e,i,s,o){super(t,[],i,s),this.mark=e,this.spec=o}static create(t,e,i,s){let o=s.nodeViews[e.type.name],u=o&&o(e,s,i);return(!u||!u.dom)&&(u=Rr.renderSpec(document,e.type.spec.toDOM(e,i),null,e.attrs)),new qi(t,e,u.dom,u.contentDOM||u.dom,u)}parseRule(){return this.dirty&Sn||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(t){return this.dirty!=Sn&&this.mark.eq(t)}markDirty(t,e){if(super.markDirty(t,e),this.dirty!=pn){let i=this.parent;for(;!i.node;)i=i.parent;i.dirty<this.dirty&&(i.dirty=this.dirty),this.dirty=pn}}slice(t,e,i){let s=qi.create(this.parent,this.mark,!0,i),o=this.children,u=this.size;e<u&&(o=Yh(o,e,u,i)),t>0&&(o=Yh(o,0,t,i));for(let c=0;c<o.length;c++)o[c].parent=s;return s.children=o,s}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class Vi extends Do{constructor(t,e,i,s,o,u,c){super(t,[],o,u),this.node=e,this.outerDeco=i,this.innerDeco=s,this.nodeDOM=c}static create(t,e,i,s,o,u){let c=o.nodeViews[e.type.name],d,p=c&&c(e,o,()=>{if(!d)return u;if(d.parent)return d.parent.posBeforeChild(d)},i,s),m=p&&p.dom,y=p&&p.contentDOM;if(e.isText){if(!m)m=document.createTextNode(e.text);else if(!oe(m))throw new RangeError(\"Text must be rendered as a DOM text node\")}else m||({dom:m,contentDOM:y}=Rr.renderSpec(document,e.type.spec.toDOM(e),null,e.attrs));!y&&!e.isText&&m.nodeName!=\"BR\"&&(m.hasAttribute(\"contenteditable\")||(m.contentEditable=\"false\"),e.type.spec.draggable&&(m.draggable=!0));let b=m;return m=kS(m,i,e),p?d=new iC(t,e,i,s,m,y||null,b,p):e.isText?new hc(t,e,i,s,m,b):new Vi(t,e,i,s,m,y||null,b)}parseRule(t){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 i=this.children.length-1;i>=0;i--){let s=this.children[i];if(this.dom.contains(s.dom.parentNode)){e.contentElement=s.dom.parentNode;break}}if(!e.contentElement){let i=t&&t.find(s=>tt(s)&&t.indexOf(s.parentNode)<0&&this.dom.contains(s));i?e.contentElement=i:e.getContent=()=>j.empty}}return e}matchesNode(t,e,i){return this.dirty==pn&&t.eq(this.node)&&xu(e,this.outerDeco)&&i.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(t,e){let i=this.node.inlineContent,s=e,o=t.composing?this.localCompositionInfo(t,e):null,u=o&&o.pos>-1?o:null,c=o&&o.pos<0,d=new sC(this,u&&u.node,t),p=this.node.inlineContent,m=p&&this.node.isBlock;aC(this.node,this.innerDeco,(y,b,v)=>{y.spec.marks?d.syncToMarks(y.spec.marks,i,t,b):y.type.side>=0&&!v&&d.syncToMarks(b==this.node.childCount?Ut.none:this.node.child(b).marks,i,t,b),d.placeWidget(y,t,s)},(y,b,v,E)=>{d.syncToMarks(y.marks,i,t,E),m&&y.isAtom&&!y.isText&&d.addHackNode(\"IMG\",d.top);let M;d.findNodeMatch(y,b,v,E)||c&&t.state.selection.from>s&&t.state.selection.to<s+y.nodeSize&&(M=d.findIndexWithChild(o.node))>-1&&d.updateNodeAt(y,b,v,M,t)||d.updateNextNode(y,b,v,t,E,s)||d.addNode(y,b,v,t,s),s+=y.nodeSize,p&&(m=y.isAtom&&!y.isText)}),d.syncToMarks([],i,t,0),this.node.isTextblock&&d.addTextblockHacks(),d.destroyRest(),(d.changed||this.dirty==yr)&&(u&&this.protectLocalComposition(t,u),xS(this.contentDOM,this.children,t),Hs&&uC(this.dom))}localCompositionInfo(t,e){let{from:i,to:s}=t.state.selection;if(!(t.state.selection instanceof lt)||i<e||s>e+this.node.content.size)return null;let o=t.input.compositionNode;if(!o||!this.dom.contains(o.parentNode))return null;if(this.node.inlineContent){let u=o.nodeValue,c=cC(this.node.content,u,i-e,s-e);return c<0?null:{node:o,pos:c,text:u}}else return{node:o,pos:-1,text:\"\"}}protectLocalComposition(t,{node:e,pos:i,text:s}){if(this.getDesc(e))return;let o=e;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 u=new nC(this,o,e,s);t.input.compositionNodes.push(u),this.children=Yh(this.children,i,i+s.length,t,u)}update(t,e,i,s){return this.dirty==Sn||!t.sameMarkup(this.node)?!1:(this.updateInner(t,e,i,s),!0)}updateInner(t,e,i,s){this.updateOuterDeco(e),this.node=t,this.innerDeco=i,this.contentDOM&&this.updateChildren(s,this.posAtStart),this.dirty=pn}updateOuterDeco(t){if(xu(t,this.outerDeco))return;let e=!tt(this.nodeDOM),i=this.dom;this.dom=MS(this.dom,this.nodeDOM,Gh(this.outerDeco,this.node,e),Gh(t,this.node,e)),this.dom!=i&&(i.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=t}selectNode(){tt(this.nodeDOM)&&(this.nodeDOM.classList.add(\"ProseMirror-selectednode\"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){tt(this.nodeDOM)&&(this.nodeDOM.classList.remove(\"ProseMirror-selectednode\"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute(\"draggable\"))}get domAtom(){return this.node.isAtom}}function Xb(n,t,e,i,s){kS(i,t,n);let o=new Vi(void 0,n,t,e,i,i,i);return o.contentDOM&&o.updateChildren(s,0),o}class hc extends Vi{constructor(t,e,i,s,o,u){super(t,e,i,s,o,null,u)}parseRule(){let t=this.nodeDOM.parentNode;for(;t&&t!=this.dom&&!t.pmIsDeco;)t=t.parentNode;return{skip:t||!0}}update(t,e,i,s){return this.dirty==Sn||this.dirty!=pn&&!this.inParent()||!t.sameMarkup(this.node)?!1:(this.updateOuterDeco(e),(this.dirty!=pn||t.text!=this.node.text)&&t.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=t.text,s.trackWrites==this.nodeDOM&&(s.trackWrites=null)),this.node=t,this.dirty=pn,!0)}inParent(){let t=this.parent.contentDOM;for(let e=this.nodeDOM;e;e=e.parentNode)if(e==t)return!0;return!1}domFromPos(t){return{node:this.nodeDOM,offset:t}}localPosFromDOM(t,e,i){return t==this.nodeDOM?this.posAtStart+Math.min(e,this.node.text.length):super.localPosFromDOM(t,e,i)}ignoreMutation(t){return t.type!=\"characterData\"&&t.type!=\"selection\"}slice(t,e,i){let s=this.node.cut(t,e),o=document.createTextNode(s.text);return new hc(this.parent,s,this.outerDeco,this.innerDeco,o,o)}markDirty(t,e){super.markDirty(t,e),this.dom!=this.nodeDOM&&(t==0||e==this.nodeDOM.nodeValue.length)&&(this.dirty=Sn)}get domAtom(){return!1}isText(t){return this.node.text==t}}class TS extends Do{parseRule(){return{ignore:!0}}matchesHack(t){return this.dirty==pn&&this.dom.nodeName==t}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName==\"IMG\"}}class iC extends Vi{constructor(t,e,i,s,o,u,c,d){super(t,e,i,s,o,u,c),this.spec=d}update(t,e,i,s){if(this.dirty==Sn)return!1;if(this.spec.update&&(this.node.type==t.type||this.spec.multiType)){let o=this.spec.update(t,e,i);return o&&this.updateInner(t,e,i,s),o}else return!this.contentDOM&&!t.isLeaf?!1:super.update(t,e,i,s)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(t,e,i,s){this.spec.setSelection?this.spec.setSelection(t,e,i.root):super.setSelection(t,e,i,s)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(t){return this.spec.stopEvent?this.spec.stopEvent(t):!1}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}}function xS(n,t,e){let i=n.firstChild,s=!1;for(let o=0;o<t.length;o++){let u=t[o],c=u.dom;if(c.parentNode==n){for(;c!=i;)i=Fb(i),s=!0;i=i.nextSibling}else s=!0,n.insertBefore(c,i);if(u instanceof qi){let d=i?i.previousSibling:n.lastChild;xS(u.contentDOM,u.children,e),i=d?d.nextSibling:n.firstChild}}for(;i;)i=Fb(i),s=!0;s&&e.trackWrites==n&&(e.trackWrites=null)}const lo=function(n){n&&(this.nodeName=n)};lo.prototype=Object.create(null);const br=[new lo];function Gh(n,t,e){if(n.length==0)return br;let i=e?br[0]:new lo,s=[i];for(let o=0;o<n.length;o++){let u=n[o].type.attrs;if(u){u.nodeName&&s.push(i=new lo(u.nodeName));for(let c in u){let d=u[c];d!=null&&(e&&s.length==1&&s.push(i=new lo(t.isInline?\"span\":\"div\")),c==\"class\"?i.class=(i.class?i.class+\" \":\"\")+d:c==\"style\"?i.style=(i.style?i.style+\";\":\"\")+d:c!=\"nodeName\"&&(i[c]=d))}}}return s}function MS(n,t,e,i){if(e==br&&i==br)return t;let s=t;for(let o=0;o<i.length;o++){let u=i[o],c=e[o];if(o){let d;c&&c.nodeName==u.nodeName&&s!=n&&(d=s.parentNode)&&d.nodeName.toLowerCase()==u.nodeName||(d=document.createElement(u.nodeName),d.pmIsDeco=!0,d.appendChild(s),c=br[0]),s=d}rC(s,c||br[0],u)}return s}function rC(n,t,e){for(let i in t)i!=\"class\"&&i!=\"style\"&&i!=\"nodeName\"&&!(i in e)&&n.removeAttribute(i);for(let i in e)i!=\"class\"&&i!=\"style\"&&i!=\"nodeName\"&&e[i]!=t[i]&&n.setAttribute(i,e[i]);if(t.class!=e.class){let i=t.class?t.class.split(\" \").filter(Boolean):[],s=e.class?e.class.split(\" \").filter(Boolean):[];for(let o=0;o<i.length;o++)s.indexOf(i[o])==-1&&n.classList.remove(i[o]);for(let o=0;o<s.length;o++)i.indexOf(s[o])==-1&&n.classList.add(s[o]);n.classList.length==0&&n.removeAttribute(\"class\")}if(t.style!=e.style){if(t.style){let i=/\\s*([\\w\\-\\xa1-\\uffff]+)\\s*:(?:\"(?:\\\\.|[^\"])*\"|'(?:\\\\.|[^'])*'|\\(.*?\\)|[^;])*/g,s;for(;s=i.exec(t.style);)n.style.removeProperty(s[1])}e.style&&(n.style.cssText+=e.style)}}function kS(n,t,e){return MS(n,n,br,Gh(t,e,!tt(n)))}function xu(n,t){if(n.length!=t.length)return!1;for(let e=0;e<n.length;e++)if(!n[e].type.eq(t[e].type))return!1;return!0}function Fb(n){let t=n.nextSibling;return n.parentNode.removeChild(n),t}class sC{constructor(t,e,i){this.lock=e,this.view=i,this.index=0,this.stack=[],this.changed=!1,this.top=t,this.preMatch=lC(t.node.content,t)}destroyBetween(t,e){if(t!=e){for(let i=t;i<e;i++)this.top.children[i].destroy();this.top.children.splice(t,e-t),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(t,e,i,s){let o=0,u=this.stack.length>>1,c=Math.min(u,t.length);for(;o<c&&(o==u-1?this.top:this.stack[o+1<<1]).matchesMark(t[o])&&t[o].type.spec.spanning!==!1;)o++;for(;o<u;)this.destroyRest(),this.top.dirty=pn,this.index=this.stack.pop(),this.top=this.stack.pop(),u--;for(;u<t.length;){this.stack.push(this.top,this.index+1);let d=-1,p=this.top.children.length;s<this.preMatch.index&&(p=Math.min(this.index+3,p));for(let m=this.index;m<p;m++){let y=this.top.children[m];if(y.matchesMark(t[u])&&!this.isLocked(y.dom)){d=m;break}}if(d<0&&this.index<this.top.children.length){let m=this.top.children[this.index];m instanceof qi&&m.dirty!=Sn&&m.mark.type==t[u].type&&m.spec.update&&!this.isLocked(m.dom)&&m.spec.update(t[u])&&(m.mark=t[u],d=this.index,this.changed=!0)}if(d>-1)d>this.index&&(this.changed=!0,this.destroyBetween(this.index,d)),this.top=this.top.children[this.index];else{let m=qi.create(this.top,t[u],e,i);this.top.children.splice(this.index,0,m),this.top=m,this.changed=!0}this.index=0,u++}}findNodeMatch(t,e,i,s){let o=-1,u;if(s>=this.preMatch.index&&(u=this.preMatch.matches[s-this.preMatch.index]).parent==this.top&&u.matchesNode(t,e,i))o=this.top.children.indexOf(u,this.index);else for(let c=this.index,d=Math.min(this.top.children.length,c+5);c<d;c++){let p=this.top.children[c];if(p.matchesNode(t,e,i)&&!this.preMatch.matched.has(p)){o=c;break}}return o<0?!1:(this.destroyBetween(this.index,o),this.index++,!0)}updateNodeAt(t,e,i,s,o){let u=this.top.children[s];return u.dirty==Sn&&u.dom==u.contentDOM&&(u.dirty=yr),u.update(t,e,i,o)?(this.destroyBetween(this.index,s),this.index++,!0):!1}findIndexWithChild(t){for(;;){let e=t.parentNode;if(!e)return-1;if(e==this.top.contentDOM){let i=t.pmViewDesc;if(i){for(let s=this.index;s<this.top.children.length;s++)if(this.top.children[s]==i)return s}return-1}t=e}}updateNextNode(t,e,i,s,o,u){for(let c=this.index;c<this.top.children.length;c++){let d=this.top.children[c];if(d instanceof Vi){let p=this.preMatch.matched.get(d);if(p!=null&&p!=o)return!1;let m=d.dom,y,b=this.isLocked(m)&&!(t.isText&&d.node&&d.node.isText&&d.nodeDOM.nodeValue==t.text&&d.dirty!=Sn&&xu(e,d.outerDeco));if(!b&&d.update(t,e,i,s))return this.destroyBetween(this.index,c),d.dom!=m&&(this.changed=!0),this.index++,!0;if(!b&&(y=this.recreateWrapper(d,t,e,i,s,u)))return this.destroyBetween(this.index,c),this.top.children[this.index]=y,y.contentDOM&&(y.dirty=yr,y.updateChildren(s,u+1),y.dirty=pn),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(t,e,i,s,o,u){if(t.dirty||e.isAtom||!t.children.length||!t.node.content.eq(e.content)||!xu(i,t.outerDeco)||!s.eq(t.innerDeco))return null;let c=Vi.create(this.top,e,i,s,o,u);if(c.contentDOM){c.children=t.children,t.children=[];for(let d of c.children)d.parent=c}return t.destroy(),c}addNode(t,e,i,s,o){let u=Vi.create(this.top,t,e,i,s,o);u.contentDOM&&u.updateChildren(s,o+1),this.top.children.splice(this.index++,0,u),this.changed=!0}placeWidget(t,e,i){let s=this.index<this.top.children.length?this.top.children[this.index]:null;if(s&&s.matchesWidget(t)&&(t==s.widget||!s.widget.type.toDOM.parentNode))this.index++;else{let o=new ES(this.top,t,e,i);this.top.children.splice(this.index++,0,o),this.changed=!0}}addTextblockHacks(){let t=this.top.children[this.index-1],e=this.top;for(;t instanceof qi;)e=t,t=e.children[e.children.length-1];(!t||!(t instanceof hc)||/\\n$/.test(t.node.text)||this.view.requiresGeckoHackNode&&/\\s$/.test(t.node.text))&&((Oe||Ee)&&t&&t.dom.contentEditable==\"false\"&&this.addHackNode(\"IMG\",e),this.addHackNode(\"BR\",this.top))}addHackNode(t,e){if(e==this.top&&this.index<e.children.length&&e.children[this.index].matchesHack(t))this.index++;else{let i=document.createElement(t);t==\"IMG\"&&(i.className=\"ProseMirror-separator\",i.alt=\"\"),t==\"BR\"&&(i.className=\"ProseMirror-trailingBreak\");let s=new TS(this.top,[],i,null);e!=this.top?e.children.push(s):e.children.splice(this.index++,0,s),this.changed=!0}}isLocked(t){return this.lock&&(t==this.lock||tt(t)&&t.contains(this.lock.parentNode))}}function lC(n,t){let e=t,i=e.children.length,s=n.childCount,o=new Map,u=[];t:for(;s>0;){let c;for(;;)if(i){let p=e.children[i-1];if(p instanceof qi)e=p,i=p.children.length;else{c=p,i--;break}}else{if(e==t)break t;i=e.parent.children.indexOf(e),e=e.parent}let d=c.node;if(d){if(d!=n.child(s-1))break;--s,o.set(c,s),u.push(c)}}return{index:s,matched:o,matches:u.reverse()}}function oC(n,t){return n.type.side-t.type.side}function aC(n,t,e,i){let s=t.locals(n),o=0;if(s.length==0){for(let p=0;p<n.childCount;p++){let m=n.child(p);i(m,s,t.forChild(o,m),p),o+=m.nodeSize}return}let u=0,c=[],d=null;for(let p=0;;){let m,y;for(;u<s.length&&s[u].to==o;){let x=s[u++];x.widget&&(m?(y||(y=[m])).push(x):m=x)}if(m)if(y){y.sort(oC);for(let x=0;x<y.length;x++)e(y[x],p,!!d)}else e(m,p,!!d);let b,v;if(d)v=-1,b=d,d=null;else if(p<n.childCount)v=p,b=n.child(p++);else break;for(let x=0;x<c.length;x++)c[x].to<=o&&c.splice(x--,1);for(;u<s.length&&s[u].from<=o&&s[u].to>o;)c.push(s[u++]);let E=o+b.nodeSize;if(b.isText){let x=E;u<s.length&&s[u].from<x&&(x=s[u].from);for(let O=0;O<c.length;O++)c[O].to<x&&(x=c[O].to);x<E&&(d=b.cut(x-o),b=b.cut(0,x-o),E=x,v=-1)}else for(;u<s.length&&s[u].to<E;)u++;let M=b.isInline&&!b.isLeaf?c.filter(x=>!x.inline):c.slice();i(b,M,t.forChild(o,b),v),o=E}}function uC(n){if(n.nodeName==\"UL\"||n.nodeName==\"OL\"){let t=n.style.cssText;n.style.cssText=t+\"; list-style: square !important\",window.getComputedStyle(n).listStyle,n.style.cssText=t}}function cC(n,t,e,i){for(let s=0,o=0;s<n.childCount&&o<=i;){let u=n.child(s++),c=o;if(o+=u.nodeSize,!u.isText)continue;let d=u.text;for(;s<n.childCount;){let p=n.child(s++);if(o+=p.nodeSize,!p.isText)break;d+=p.text}if(o>=e){if(o>=i&&d.slice(i-t.length-c,i-c)==t)return i-t.length;let p=c<i?d.lastIndexOf(t,i-c-1):-1;if(p>=0&&p+t.length+c>=e)return c+p;if(e==i&&d.length>=i+t.length-c&&d.slice(i-c,i-c+t.length)==t)return i}}return-1}function Yh(n,t,e,i,s){let o=[];for(let u=0,c=0;u<n.length;u++){let d=n[u],p=c,m=c+=d.size;p>=e||m<=t?o.push(d):(p<t&&o.push(d.slice(0,t-p,i)),s&&(o.push(s),s=void 0),m>e&&o.push(d.slice(e-p,d.size,i)))}return o}function kp(n,t=null){let e=n.domSelectionRange(),i=n.state.doc;if(!e.focusNode)return null;let s=n.docView.nearestDesc(e.focusNode),o=s&&s.size==0,u=n.docView.posFromDOM(e.focusNode,e.focusOffset,1);if(u<0)return null;let c=i.resolve(u),d,p;if(fc(e)){for(d=u;s&&!s.node;)s=s.parent;if(s&&s.node.isAtom&&rt.isSelectable(s.node)&&s.parent&&!(s.node.isInline&&_A(e.focusNode,e.focusOffset,s.dom))){let y=s.posBefore;p=new rt(u==y?c:i.resolve(y))}else if(We&&t==\"key\"&&u>n.state.selection.to&&tt(e.focusNode)&&e.focusOffset==e.focusNode.childNodes.length&&s&&s.posAtStart>n.state.selection.to)for(let y=e.focusNode;;y=y.parentNode){if(getComputedStyle(y).overflow!=\"visible\"){p=dt.findFrom(i.resolve(s.posAtStart),1);break}if(y==s.dom||y.nextSibling||!y.parentNode||!tt(y.parentNode))break}}else{if(e instanceof n.dom.ownerDocument.defaultView.Selection&&e.rangeCount>1){let y=u,b=u;for(let v=0;v<e.rangeCount;v++){let E=e.getRangeAt(v);y=Math.min(y,n.docView.posFromDOM(E.startContainer,E.startOffset,1)),b=Math.max(b,n.docView.posFromDOM(E.endContainer,E.endOffset,-1))}if(y<0)return null;[d,u]=b==n.state.selection.anchor?[b,y]:[y,b],c=i.resolve(u)}else d=n.docView.posFromDOM(e.anchorNode,e.anchorOffset,1);if(d<0)return null}let m=i.resolve(d);if(!p){let y=t==\"pointer\"||n.state.selection.head<c.pos&&!o?1:-1;p=Ap(n,m,c,y)}return p}function AS(n){return n.editable?n.hasFocus():OS(n)&&document.activeElement&&document.activeElement.contains(n.dom)}function ni(n,t=!1){let e=n.state.selection;if(CS(n,e),!AS(n))return;let i=n.input.mouseDown;if(!t&&Ee&&i){let s=n.domSelectionRange(),o=n.domObserver.currentSelection;if(s.anchorNode&&o.anchorNode&&Nr(s.anchorNode,s.anchorOffset,o.anchorNode,o.anchorOffset)&&i.delaySelUpdate()){n.domObserver.setCurSelection();return}}if(n.domObserver.disconnectSelection(),n.cursorWrapper)dC(n);else{let{anchor:s,head:o}=e,u,c;Qb&&!(e instanceof lt)&&(e.$from.parent.inlineContent||(u=Jb(n,e.from)),!e.empty&&!e.$from.parent.inlineContent&&(c=Jb(n,e.to))),n.docView.setSelection(s,o,n,t),Qb&&(u&&Zb(u),c&&Zb(c)),e.visible?n.dom.classList.remove(\"ProseMirror-hideselection\"):(n.dom.classList.add(\"ProseMirror-hideselection\"),\"onselectionchange\"in document&&fC(n))}n.domObserver.setCurSelection(),n.domObserver.connectSelection()}const Qb=Oe||Ee&&hS<63;function Jb(n,t){let{node:e,offset:i}=n.docView.domFromPos(t,0),s=i<e.childNodes.length?e.childNodes[i]:null,o=i?e.childNodes[i-1]:null;if(Oe&&s&&s.contentEditable==\"false\")return yh(s);if((!s||s.contentEditable==\"false\")&&(!o||o.contentEditable==\"false\")){if(s)return yh(s);if(o)return yh(o)}}function yh(n){return n.contentEditable=\"true\",Oe&&n.draggable&&(n.draggable=!1,n.wasDraggable=!0),n}function Zb(n){n.contentEditable=\"false\",n.wasDraggable&&(n.draggable=!0,n.wasDraggable=null)}function fC(n){let t=n.dom.ownerDocument;t.removeEventListener(\"selectionchange\",n.input.hideSelectionGuard);let e=n.domSelectionRange(),i=e.anchorNode,s=e.anchorOffset;t.addEventListener(\"selectionchange\",n.input.hideSelectionGuard=()=>{(e.anchorNode!=i||e.anchorOffset!=s)&&(t.removeEventListener(\"selectionchange\",n.input.hideSelectionGuard),setTimeout(()=>{(!AS(n)||n.state.selection.visible)&&n.dom.classList.remove(\"ProseMirror-hideselection\")},20))})}function dC(n){let t=n.domSelection();if(!t)return;let e=n.cursorWrapper.dom,i=e.nodeName==\"IMG\";i?t.collapse(e.parentNode,ve(e)+1):t.collapse(e,0),!i&&!n.state.selection.visible&&qe&&ji<=11&&(e.disabled=!0,e.disabled=!1)}function CS(n,t){if(t instanceof rt){let e=n.docView.descAt(t.from);e!=n.lastSelectedViewDesc&&(Wb(n),e&&e.selectNode(),n.lastSelectedViewDesc=e)}else Wb(n)}function Wb(n){n.lastSelectedViewDesc&&(n.lastSelectedViewDesc.parent&&n.lastSelectedViewDesc.deselectNode(),n.lastSelectedViewDesc=void 0)}function Ap(n,t,e,i){return n.someProp(\"createSelectionBetween\",s=>s(n,t,e))||lt.between(t,e,i)}function tv(n){return n.editable&&!n.hasFocus()?!1:OS(n)}function OS(n){let t=n.domSelectionRange();if(!t.anchorNode)return!1;try{return Dr(n.dom,t.anchorNode)&&(n.editable||Dr(n.dom,t.focusNode))}catch{return!1}}function hC(n){let t=n.docView.domFromPos(n.state.selection.anchor,0),e=n.domSelectionRange();return Nr(t.node,t.offset,e.anchorNode,e.anchorOffset)}function Xh(n,t){let{$anchor:e,$head:i}=n.selection,s=t>0?e.max(i):e.min(i),o=s.parent.inlineContent?s.depth?n.doc.resolve(t>0?s.after():s.before()):null:s;return o&&dt.findFrom(o,t)}function zi(n,t){return n.dispatch(n.state.tr.setSelection(t).scrollIntoView()),!0}function ev(n,t,e){let i=n.state.selection;if(i instanceof lt)if(e.indexOf(\"s\")>-1){let{$head:s}=i,o=s.textOffset?null:t<0?s.nodeBefore:s.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let u=n.state.doc.resolve(s.pos+o.nodeSize*(t<0?-1:1));return zi(n,new lt(i.$anchor,u))}else if(i.empty){if(n.endOfTextblock(t>0?\"forward\":\"backward\")){let s=Xh(n.state,t);return s&&s instanceof rt?zi(n,s):!1}else if(!(dn&&e.indexOf(\"m\")>-1)){let s=i.$head,o=s.textOffset?null:t<0?s.nodeBefore:s.nodeAfter,u;if(!o||o.isText)return!1;let c=t<0?s.pos-o.nodeSize:s.pos;return o.isAtom||(u=n.docView.descAt(c))&&!u.contentDOM?rt.isSelectable(o)?zi(n,new rt(t<0?n.state.doc.resolve(s.pos-o.nodeSize):s)):zi(n,new lt(n.state.doc.resolve(t<0?c:c+o.nodeSize))):!1}}else return!1;else{if(i instanceof rt&&i.node.isInline)return zi(n,new lt(t>0?i.$to:i.$from));{let s=Xh(n.state,t);return s?zi(n,s):!1}}}function oo(n,t){let e=n.pmViewDesc;return e?e.size==0&&(t<0||n.nextSibling||n.nodeName!=\"BR\"):tt(n)&&n.contentEditable==\"false\"}function Es(n,t){return t<0?pC(n):mC(n)}function pC(n){let t=n.domSelectionRange(),e=t.focusNode,i=t.focusOffset;if(!e)return;let s,o,u=!1;for(We&&tt(e)&&i<Ae(e)&&oo(e.childNodes[i],-1)&&(u=!0);;)if(i>0){if(!tt(e))break;let c=e.childNodes[i-1];if(oo(c,-1))s=e,o=--i;else if(oe(c))e=c,i=e.nodeValue.length;else break}else{if(wS(e))break;{let c=e.previousSibling;for(;c&&oo(c,-1);)s=e.parentNode,o=ve(c),c=c.previousSibling;if(c)e=c,i=Ae(e);else{if(e=e.parentNode,e==n.dom)break;i=0}}}u?Fh(n,e,i):s&&Fh(n,s,o)}function mC(n){let t=n.domSelectionRange(),e=t.focusNode,i=t.focusOffset;if(!e)return;let s=Ae(e),o,u;for(;;)if(i<s){if(!tt(e))break;let c=e.childNodes[i];if(oo(c,1))o=e,u=++i;else break}else{if(wS(e))break;{let c=e.nextSibling;for(;c&&oo(c,1);)o=c.parentNode,u=ve(c)+1,c=c.nextSibling;if(c)e=c,i=0,s=Ae(e);else{if(e=e.parentNode,e==n.dom)break;i=s=0}}}o&&Fh(n,o,u)}function wS(n){let t=n.pmViewDesc;return t&&t.node&&t.node.isBlock}function gC(n,t){for(;n&&t==n.childNodes.length&&!No(n);)t=ve(n)+1,n=n.parentNode;for(;n&&t<n.childNodes.length;){let e=n.childNodes[t];if(oe(e))return e;if(tt(e)&&e.contentEditable==\"false\")break;n=e,t=0}}function yC(n,t){for(;n&&!t&&!No(n);)t=ve(n),n=n.parentNode;for(;n&&t;){let e=n.childNodes[t-1];if(oe(e))return e;if(tt(e)&&e.contentEditable==\"false\")break;n=e,t=n.childNodes.length}}function Fh(n,t,e){if(!oe(t)){let o,u;(u=gC(t,e))?(t=u,e=0):(o=yC(t,e))&&(t=o,e=o.nodeValue.length)}let i=n.domSelection();if(!i)return;if(fc(i)){let o=document.createRange();o.setEnd(t,e),o.setStart(t,e),i.removeAllRanges(),i.addRange(o)}else i.extend&&i.extend(t,e);n.domObserver.setCurSelection();let{state:s}=n;setTimeout(()=>{n.state==s&&ni(n)},50)}function nv(n,t){let e=n.state.doc.resolve(t);if(!(Ee||pS)&&e.parent.inlineContent){let s=n.coordsAtPos(t);if(t>e.start()){let o=n.coordsAtPos(t-1),u=(o.top+o.bottom)/2;if(u>s.top&&u<s.bottom&&Math.abs(o.left-s.left)>1)return o.left<s.left?\"ltr\":\"rtl\"}if(t<e.end()){let o=n.coordsAtPos(t+1),u=(o.top+o.bottom)/2;if(u>s.top&&u<s.bottom&&Math.abs(o.left-s.left)>1)return o.left>s.left?\"ltr\":\"rtl\"}}return getComputedStyle(n.dom).direction==\"rtl\"?\"rtl\":\"ltr\"}function iv(n,t,e){let i=n.state.selection;if(i instanceof lt&&!i.empty||e.indexOf(\"s\")>-1||dn&&e.indexOf(\"m\")>-1)return!1;let{$from:s,$to:o}=i;if(!s.parent.inlineContent||n.endOfTextblock(t<0?\"up\":\"down\")){let u=Xh(n.state,t);if(u&&u instanceof rt)return zi(n,u)}if(!s.parent.inlineContent){let u=t<0?s:o,c=i instanceof Ze?dt.near(u,t):dt.findFrom(u,t);return c?zi(n,c):!1}return!1}function rv(n,t){if(!(n.state.selection instanceof lt))return!0;let{$head:e,$anchor:i,empty:s}=n.state.selection;if(!e.sameParent(i))return!0;if(!s)return!1;if(n.endOfTextblock(t>0?\"forward\":\"backward\"))return!0;let o=!e.textOffset&&(t<0?e.nodeBefore:e.nodeAfter);if(o&&!o.isText){let u=n.state.tr;return t<0?u.delete(e.pos-o.nodeSize,e.pos):u.delete(e.pos,e.pos+o.nodeSize),n.dispatch(u),!0}return!1}function sv(n,t,e){n.domObserver.stop(),t.contentEditable=e,n.domObserver.start()}function bC(n){if(!Oe||n.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:e}=n.domSelectionRange();if(t&&tt(t)&&e==0&&t.firstChild&&tt(t.firstChild)&&t.firstChild.contentEditable==\"false\"){let i=t.firstChild;sv(n,i,\"true\"),setTimeout(()=>sv(n,i,\"false\"),20)}return!1}function vC(n){let t=\"\";return n.ctrlKey&&(t+=\"c\"),n.metaKey&&(t+=\"m\"),n.altKey&&(t+=\"a\"),n.shiftKey&&(t+=\"s\"),t}function SC(n,t){let e=t.keyCode,i=vC(t);if(e==8||dn&&e==72&&i==\"c\")return rv(n,-1)||Es(n,-1);if(e==46&&!t.shiftKey||dn&&e==68&&i==\"c\")return rv(n,1)||Es(n,1);if(e==13||e==27)return!0;if(e==37||dn&&e==66&&i==\"c\"){let s=e==37?nv(n,n.state.selection.from)==\"ltr\"?-1:1:-1;return ev(n,s,i)||Es(n,s)}else if(e==39||dn&&e==70&&i==\"c\"){let s=e==39?nv(n,n.state.selection.from)==\"ltr\"?1:-1:1;return ev(n,s,i)||Es(n,s)}else{if(e==38||dn&&e==80&&i==\"c\")return iv(n,-1,i)||Es(n,-1);if(e==40||dn&&e==78&&i==\"c\")return bC(n)||iv(n,1,i)||Es(n,1);if(i==(dn?\"m\":\"c\")&&(e==66||e==73||e==89||e==90))return!0}return!1}function Cp(n,t){n.someProp(\"transformCopied\",v=>{t=v(t,n)});let e=[],{content:i,openStart:s,openEnd:o}=t;for(;s>1&&o>1&&i.childCount==1&&i.firstChild.childCount==1;){s--,o--;let v=i.firstChild;e.push(v.type.name,v.attrs!=v.type.defaultAttrs?v.attrs:null),i=v.content}let u=n.someProp(\"clipboardSerializer\")||Rr.fromSchema(n.state.schema),c=BS(),d=c.createElement(\"div\");d.appendChild(u.serializeFragment(i,{document:c}));let p=d.firstChild,m,y=0;for(;p&&tt(p)&&(m=zS[p.nodeName.toLowerCase()]);){for(let v=m.length-1;v>=0;v--){let E=c.createElement(m[v]);for(;d.firstChild;)E.appendChild(d.firstChild);d.appendChild(E),y++}p=d.firstChild}p&&tt(p)&&p.setAttribute(\"data-pm-slice\",`${s} ${o}${y?` -${y}`:\"\"} ${JSON.stringify(e)}`);let b=n.someProp(\"clipboardTextSerializer\",v=>v(t,n))||t.content.textBetween(0,t.content.size,`\n\n`);return{dom:d,text:b,slice:t}}function NS(n,t,e,i,s){let o=s.parent.type.spec.code,u,c;if(!e&&!t)return null;let d=!!t&&(i||o||!e);if(d){if(n.someProp(\"transformPastedText\",b=>{t=b(t,o||i,n)}),o)return c=new X(j.from(n.state.schema.text(t.replace(/\\r\\n?/g,`\n`))),0,0),n.someProp(\"transformPasted\",b=>{c=b(c,n,!0)}),c;let y=n.someProp(\"clipboardTextParser\",b=>b(t,s,i,n));if(y)c=y;else{let b=s.marks(),{schema:v}=n.state,E=Rr.fromSchema(v);u=document.createElement(\"div\"),t.split(/(?:\\r\\n?|\\n)+/).forEach(M=>{let x=u.appendChild(document.createElement(\"p\"));M&&x.appendChild(E.serializeNode(v.text(M,b)))})}}else n.someProp(\"transformPastedHTML\",y=>{e=y(e,n)}),u=MC(e),dc&&kC(u);let p=u&&u.querySelector(\"[data-pm-slice]\"),m=p&&/^(\\d+) (\\d+)(?: -(\\d+))? (.*)/.exec(p.getAttribute(\"data-pm-slice\")||\"\");if(m&&m[3])for(let y=+m[3];y>0;y--){let b=u.firstChild;for(;b&&!tt(b);)b=b.nextSibling;if(!b)break;u=b}if(c||(c=(n.someProp(\"clipboardParser\")||n.someProp(\"domParser\")||ro.fromSchema(n.state.schema)).parseSlice(u,{preserveWhitespace:!!(d||m),context:s,ruleFromNode(b){return b.nodeName==\"BR\"&&!b.nextSibling&&b.parentNode&&!EC.test(b.parentNode.nodeName)?{ignore:!0}:null}})),m)c=AC(lv(c,+m[1],+m[2]),m[4]);else if(c=X.maxOpen(TC(c.content,s),!0),c.openStart||c.openEnd){let y=0,b=0;for(let v=c.content.firstChild;y<c.openStart&&!v.type.spec.isolating;y++,v=v.firstChild);for(let v=c.content.lastChild;b<c.openEnd&&!v.type.spec.isolating;b++,v=v.lastChild);c=lv(c,y,b)}return n.someProp(\"transformPasted\",y=>{c=y(c,n,d)}),c}const EC=/^(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 TC(n,t){if(n.childCount<2)return n;for(let e=t.depth;e>=0;e--){let s=t.node(e).contentMatchAt(t.index(e)),o,u=[];if(n.forEach(c=>{if(!u)return;let d=s.findWrapping(c.type),p;if(!d)return u=null;if(p=u.length&&o.length&&RS(d,o,c,u[u.length-1],0))u[u.length-1]=p;else{u.length&&(u[u.length-1]=LS(u[u.length-1],o.length));let m=DS(c,d);u.push(m),s=s.matchType(m.type),o=d}}),u)return j.from(u)}return n}function DS(n,t,e=0){for(let i=t.length-1;i>=e;i--)n=t[i].create(null,j.from(n));return n}function RS(n,t,e,i,s){if(s<n.length&&s<t.length&&n[s]==t[s]){let o=RS(n,t,e,i.lastChild,s+1);if(o)return i.copy(i.content.replaceChild(i.childCount-1,o));if(i.contentMatchAt(i.childCount).matchType(s==n.length-1?e.type:n[s+1]))return i.copy(i.content.append(j.from(DS(e,n,s+1))))}}function LS(n,t){if(t==0)return n;let e=n.content.replaceChild(n.childCount-1,LS(n.lastChild,t-1)),i=n.contentMatchAt(n.childCount).fillBefore(j.empty,!0);return n.copy(e.append(i))}function Qh(n,t,e,i,s,o){let u=t<0?n.firstChild:n.lastChild,c=u.content;return n.childCount>1&&(o=0),s<i-1&&(c=Qh(c,t,e,i,s+1,o)),s>=e&&(c=t<0?u.contentMatchAt(0).fillBefore(c,o<=s).append(c):c.append(u.contentMatchAt(u.childCount).fillBefore(j.empty,!0))),n.replaceChild(t<0?0:n.childCount-1,u.copy(c))}function lv(n,t,e){return t<n.openStart&&(n=new X(Qh(n.content,-1,t,n.openStart,0,n.openEnd),t,n.openEnd)),e<n.openEnd&&(n=new X(Qh(n.content,1,e,n.openEnd,0,0),n.openStart,e)),n}const zS={thead:[\"table\"],tbody:[\"table\"],tfoot:[\"table\"],caption:[\"table\"],colgroup:[\"table\"],col:[\"table\",\"colgroup\"],tr:[\"table\",\"tbody\"],td:[\"table\",\"tbody\",\"tr\"],th:[\"table\",\"tbody\",\"tr\"]};function BS(){return document.implementation.createHTMLDocument(\"title\")}let Pl=null;function xC(n){let t=window.trustedTypes;if(!t)return n;if(!Pl){if(Pl=t.defaultPolicy)try{return Pl.createHTML(n)}catch{}Pl=t.createPolicy(\"ProseMirrorClipboard\",{createHTML:e=>e})}return Pl.createHTML(n)}function MC(n){let t=/^(\\s*<meta [^>]*>)*/.exec(n);t&&(n=n.slice(t[0].length));let e=BS(),i=e.body,s=/<([a-z][^>\\s]+)/i.exec(n),o;if((o=s&&zS[s[1].toLowerCase()])&&(n=o.map(u=>\"<\"+u+\">\").join(\"\")+n+o.map(u=>\"</\"+u+\">\").reverse().join(\"\")),i.innerHTML=xC(n),o)for(let u=0;u<o.length;u++)i=i.querySelector(o[u])||i;for(let u=0;u<e.styleSheets.length;u++){let c=e.styleSheets[u];for(let d=0;d<c.rules.length;d++){let p=c.rules[d];if(p instanceof CSSStyleRule){let m=i.querySelectorAll(p.selectorText);for(let y=0;y<m.length;y++)m[y].style.cssText+=p.style.cssText}}}return i}function kC(n){let t=n.querySelectorAll(Ee?\"span:not([class]):not([style])\":\"span.Apple-converted-space\");for(let e=0;e<t.length;e++){let i=t[e];i.childNodes.length==1&&i.textContent==\" \"&&i.parentNode&&i.parentNode.replaceChild(n.ownerDocument.createTextNode(\" \"),i)}}function AC(n,t){if(!n.size)return n;let e=n.content.firstChild.type.schema,i;try{i=JSON.parse(t)}catch{return n}let{content:s,openStart:o,openEnd:u}=n;for(let c=i.length-2;c>=0;c-=2){let d=e.nodes[i[c]];if(!d||d.hasRequiredAttrs())break;try{s=j.from(d.create(i[c+1],s))}catch{break}o++,u++}return new X(s,o,u)}const Le={},ze={},CC={touchstart:!0,touchmove:!0};class OC{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.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function wC(n){for(let t in Le){let e=Le[t];n.dom.addEventListener(t,n.input.eventHandlers[t]=i=>{DC(n,i)&&!Op(n,i)&&(n.editable||!(i.type in ze))&&e(n,i)},CC[t]?{passive:!0}:void 0)}Oe&&n.dom.addEventListener(\"input\",()=>null),Jh(n)}function ti(n,t){n.input.lastSelectionOrigin=t,n.input.lastSelectionTime=Date.now()}function NC(n){n.input.mouseDown&&n.input.mouseDown.done(),n.domObserver.stop();for(let t in n.input.eventHandlers)n.dom.removeEventListener(t,n.input.eventHandlers[t]);clearTimeout(n.input.composingTimeout),clearTimeout(n.input.lastIOSEnterFallbackTimeout)}function Jh(n){n.someProp(\"handleDOMEvents\",t=>{for(let e in t)n.input.eventHandlers[e]||n.dom.addEventListener(e,n.input.eventHandlers[e]=i=>Op(n,i))})}function Op(n,t){return n.someProp(\"handleDOMEvents\",e=>{let i=e[t.type];return i?i(n,t)||t.defaultPrevented:!1})}function DC(n,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let e=t.target;e!=n.dom;e=e.parentNode)if(!e||e.nodeType==11||e.pmViewDesc&&e.pmViewDesc.stopEvent(t))return!1;return!0}function RC(n,t){!Op(n,t)&&Le[t.type]&&(n.editable||!(t.type in ze))&&Le[t.type](n,t)}ze.keydown=(n,t)=>{let e=t;if(n.input.shiftKey=e.keyCode==16||e.shiftKey,!IS(n)&&(n.input.lastKeyCode=e.keyCode,n.input.lastKeyCodeTime=Date.now(),!(Wn&&Ee&&e.keyCode==13)))if(e.keyCode!=229&&n.domObserver.forceFlush(),Hs&&e.keyCode==13&&!e.ctrlKey&&!e.altKey&&!e.metaKey){let i=Date.now();n.input.lastIOSEnter=i,n.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{n.input.lastIOSEnter==i&&(n.someProp(\"handleKeyDown\",s=>s(n,gr(13,\"Enter\"))),n.input.lastIOSEnter=0)},200)}else n.someProp(\"handleKeyDown\",i=>i(n,e))||SC(n,e)?e.preventDefault():ti(n,\"key\")};ze.keyup=(n,t)=>{t.keyCode==16&&(n.input.shiftKey=!1)};ze.keypress=(n,t)=>{let e=t;if(IS(n)||!e.charCode||e.ctrlKey&&!e.altKey||dn&&e.metaKey)return;if(n.someProp(\"handleKeyPress\",s=>s(n,e))){e.preventDefault();return}let i=n.state.selection;if(!(i instanceof lt)||!i.$from.sameParent(i.$to)){let s=String.fromCharCode(e.charCode),o=()=>n.state.tr.insertText(s).scrollIntoView();!/[\\r\\n]/.test(s)&&!n.someProp(\"handleTextInput\",u=>u(n,i.$from.pos,i.$to.pos,s,o))&&n.dispatch(o()),e.preventDefault()}};function Ro(n){return{left:n.clientX,top:n.clientY}}function LC(n,t){let e=t.x-n.clientX,i=t.y-n.clientY;return e*e+i*i<100}function wp(n,t,e,i,s){if(i==-1)return!1;let o=n.state.doc.resolve(i);for(let u=o.depth+1;u>0;u--)if(n.someProp(t,c=>u>o.depth?c(n,e,o.nodeAfter,o.before(u),s,!0):c(n,e,o.node(u),o.before(u),s,!1)))return!0;return!1}function Lo(n,t,e){if(n.focused||n.focus(),n.state.selection.eq(t))return;let i=n.state.tr.setSelection(t);i.setMeta(\"pointer\",!0),n.dispatch(i)}function zC(n,t){if(t==-1)return!1;let e=n.state.doc.resolve(t),i=e.nodeAfter;return i&&i.isAtom&&rt.isSelectable(i)?(Lo(n,new rt(e)),!0):!1}function BC(n,t){if(t==-1)return!1;let e=n.state.selection,i,s;e instanceof rt&&(i=e.node);let o=n.state.doc.resolve(t);for(let u=o.depth+1;u>0;u--){let c=u>o.depth?o.nodeAfter:o.node(u);if(rt.isSelectable(c)){i&&e.$from.depth>0&&u>=e.$from.depth&&o.before(e.$from.depth+1)==e.$from.pos?s=o.before(e.$from.depth):s=o.before(u);break}}return s!=null?(Lo(n,rt.create(n.state.doc,s)),!0):!1}function HC(n,t,e,i,s){return wp(n,\"handleClickOn\",t,e,i)||n.someProp(\"handleClick\",o=>o(n,t,i))||(s?BC(n,e):zC(n,e))}function _C(n,t,e,i){return wp(n,\"handleDoubleClickOn\",t,e,i)||n.someProp(\"handleDoubleClick\",s=>s(n,t,i))}function UC(n,t,e,i){return wp(n,\"handleTripleClickOn\",t,e,i)||n.someProp(\"handleTripleClick\",s=>s(n,t,i))||IC(n,e,i)}function IC(n,t,e){if(e.button!=0)return!1;let i=HS(n,t,!0),s=n.state.doc;return i?(Lo(n,i),i instanceof lt&&s.eq(n.state.doc)&&(n.input.mouseDown=new qC(n,i)),!0):!1}function HS(n,t,e){let i=n.state.doc;if(t==-1)return i.inlineContent?lt.create(i,0,i.content.size):null;let s=i.resolve(t);for(let o=s.depth+1;o>0;o--){let u=o>s.depth?s.nodeAfter:s.node(o),c=s.before(o);if(u.inlineContent)return lt.create(i,c+1,c+1+u.content.size);if(e&&rt.isSelectable(u))return rt.create(i,c)}return null}function Np(n){return Mu(n)}const _S=dn?\"metaKey\":\"ctrlKey\";Le.mousedown=(n,t)=>{let e=t;n.input.shiftKey=e.shiftKey;let i=Np(n),s=Date.now(),o=\"singleClick\";s-n.input.lastClick.time<500&&LC(e,n.input.lastClick)&&!e[_S]&&n.input.lastClick.button==e.button&&(n.input.lastClick.type==\"singleClick\"?o=\"doubleClick\":n.input.lastClick.type==\"doubleClick\"&&(o=\"tripleClick\")),n.input.lastClick={time:s,x:e.clientX,y:e.clientY,type:o,button:e.button},n.input.mouseDown&&n.input.mouseDown.done();let u=n.posAtCoords(Ro(e));u&&(o==\"singleClick\"?n.input.mouseDown=new jC(n,u,e,!!i):(o==\"doubleClick\"?_C:UC)(n,u.pos,u.inside,e)?e.preventDefault():ti(n,\"pointer\"))};class US{constructor(t){this.view=t,this.mightDrag=null,t.root.addEventListener(\"mouseup\",this.up=this.up.bind(this)),t.root.addEventListener(\"mousemove\",this.move=this.move.bind(this))}up(t){this.done()}move(t){t.buttons==0&&this.done()}done(){this.view.root.removeEventListener(\"mouseup\",this.up),this.view.root.removeEventListener(\"mousemove\",this.move),this.view.input.mouseDown==this&&(this.view.input.mouseDown=null)}delaySelUpdate(){return!1}}class jC extends US{constructor(t,e,i,s){super(t),this.pos=e,this.event=i,this.flushed=s,this.delayedSelectionSync=!1,this.startDoc=t.state.doc,this.selectNode=!!i[_S],this.allowDefault=i.shiftKey;let o,u;if(e.inside>-1)o=t.state.doc.nodeAt(e.inside),u=e.inside;else{let m=t.state.doc.resolve(e.pos);o=m.parent,u=m.depth?m.before():0}const c=s?null:i.target,d=c?t.docView.nearestDesc(c,!0):null;this.target=d&&tt(d.nodeDOM)?d.nodeDOM:null;let{selection:p}=t.state;i.button==0&&(o.type.spec.draggable&&o.type.spec.selectable!==!1||p instanceof rt&&p.from<=u&&p.to>u)&&(this.mightDrag={node:o,pos:u,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&We&&!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()),ti(t,\"pointer\")}done(){super.done(),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(()=>{this.view.isDestroyed||ni(this.view)})}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let e=this.pos;this.view.state.doc!=this.startDoc&&(e=this.view.posAtCoords(Ro(t))),this.updateAllowDefault(t),this.allowDefault||!e?ti(this.view,\"pointer\"):HC(this.view,e.pos,e.inside,t,this.selectNode)?t.preventDefault():t.button==0&&(this.flushed||Oe&&this.mightDrag&&!this.mightDrag.node.isAtom||Ee&&!this.view.state.selection.visible&&Math.min(Math.abs(e.pos-this.view.state.selection.from),Math.abs(e.pos-this.view.state.selection.to))<=2)?(Lo(this.view,dt.near(this.view.state.doc.resolve(e.pos))),t.preventDefault()):ti(this.view,\"pointer\")}move(t){this.updateAllowDefault(t),ti(this.view,\"pointer\"),super.move(t)}updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}delaySelUpdate(){return this.allowDefault?(this.delayedSelectionSync=!0,!0):!1}}class qC extends US{constructor(t,e){super(t),this.startSelection=e,this.startDoc=t.state.doc}move(t){if(t.buttons==0||this.view.isDestroyed||!this.view.state.doc.eq(this.startDoc)){this.done();return}t.preventDefault(),ti(this.view,\"pointer\");let e=this.view.posAtCoords(Ro(t)),i=e&&HS(this.view,e.inside,!1);if(!i)return;let{doc:s}=this.view.state,o=this.startSelection,[u,c]=i.from<o.from?[o.to,i.from]:[o.from,i.to];Lo(this.view,lt.create(s,u,c))}}Le.touchstart=n=>{n.input.lastTouch=Date.now(),Np(n),ti(n,\"pointer\")};Le.touchmove=n=>{n.input.lastTouch=Date.now(),ti(n,\"pointer\")};Le.contextmenu=n=>Np(n);function IS(n,t){return n.composing?!0:Oe&&Math.abs(Date.now()-n.input.compositionEndedAt)<500?(n.input.compositionEndedAt=-2e8,!0):!1}const VC=Wn?5e3:-1;ze.compositionstart=ze.compositionupdate=n=>{if(!n.composing){n.domObserver.flush();let{state:t}=n,e=t.selection.$to;if(t.selection instanceof lt&&t.selection.empty&&(t.storedMarks||!e.textOffset&&e.parentOffset&&e.nodeBefore.marks.some(i=>i.type.spec.inclusive===!1)||Ee&&pS&&$C(n)))n.markCursor=n.state.storedMarks||e.marks(),Mu(n,!0),n.markCursor=null;else if(Mu(n,!t.selection.empty),We&&t.selection.empty&&e.parentOffset&&!e.textOffset&&e.nodeBefore.marks.length){let i=n.domSelectionRange();for(let s=i.focusNode,o=i.focusOffset;s&&tt(s)&&o!=0;){let u=o<0?s.lastChild:s.childNodes[o-1];if(!u)break;if(oe(u)){let c=n.domSelection();c&&c.collapse(u,u.nodeValue.length);break}else s=u,o=-1}}n.input.composing=!0}jS(n,VC)};function $C(n){let{focusNode:t,focusOffset:e}=n.domSelectionRange();if(!t||!tt(t)||e>=t.childNodes.length)return!1;let i=t.childNodes[e];return tt(i)&&i.contentEditable==\"false\"}ze.compositionend=(n,t)=>{n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=Date.now(),n.input.compositionPendingChanges=n.domObserver.pendingRecords().length?n.input.compositionID:0,n.input.compositionNode=null,n.input.badSafariComposition?n.domObserver.forceFlush():n.input.compositionPendingChanges&&Promise.resolve().then(()=>n.domObserver.flush()),n.input.compositionID++,jS(n,20))};function jS(n,t){clearTimeout(n.input.composingTimeout),t>-1&&(n.input.composingTimeout=setTimeout(()=>Mu(n),t))}function qS(n){for(n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=Date.now());n.input.compositionNodes.length>0;)n.input.compositionNodes.pop().markParentsDirty()}function PC(n){let t=n.domSelectionRange();if(!t.focusNode)return null;let e=BA(t.focusNode,t.focusOffset),i=HA(t.focusNode,t.focusOffset);if(e&&i&&e!=i){let s=i.pmViewDesc,o=n.domObserver.lastChangedTextNode;if(e==o||i==o)return o;if(!s||!s.isText(i.nodeValue))return i;if(n.input.compositionNode==i){let u=e.pmViewDesc;if(!(!u||!u.isText(e.nodeValue)))return i}}return e||i}function Mu(n,t=!1){if(!(Wn&&n.domObserver.flushingSoon>=0)){if(n.domObserver.forceFlush(),qS(n),t||n.docView&&n.docView.dirty){let e=kp(n),i=n.state.selection;return e&&!e.eq(i)?n.dispatch(n.state.tr.setSelection(e)):(n.markCursor||t)&&!i.$from.node(i.$from.sharedDepth(i.to)).inlineContent?n.dispatch(n.state.tr.deleteSelection()):n.updateState(n.state),!0}return!1}}function KC(n,t){if(!n.dom.parentNode)return;let e=n.dom.parentNode.appendChild(document.createElement(\"div\"));e.appendChild(t),e.style.cssText=\"position: fixed; left: -10000px; top: 10px\";let i=getSelection(),s=document.createRange();s.selectNodeContents(t),n.dom.blur(),i.removeAllRanges(),i.addRange(s),setTimeout(()=>{e.parentNode&&e.parentNode.removeChild(e),n.focus()},50)}const xo=qe&&ji<15||Hs&&jA<604;Le.copy=ze.cut=(n,t)=>{let e=t,i=n.state.selection,s=e.type==\"cut\";if(i.empty)return;let o=xo?null:e.clipboardData,u=i.content(),{dom:c,text:d}=Cp(n,u);o?(e.preventDefault(),o.clearData(),o.setData(\"text/html\",c.innerHTML),o.setData(\"text/plain\",d)):KC(n,c),s&&n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta(\"uiEvent\",\"cut\"))};function GC(n){return n.openStart==0&&n.openEnd==0&&n.content.childCount==1?n.content.firstChild:null}function YC(n,t){if(!n.dom.parentNode)return;let e=n.input.shiftKey||n.state.selection.$from.parent.type.spec.code,i=n.dom.parentNode.appendChild(document.createElement(e?\"textarea\":\"div\"));e||(i.contentEditable=\"true\"),i.style.cssText=\"position: fixed; left: -10000px; top: 10px\",i.focus();let s=n.input.shiftKey&&n.input.lastKeyCode!=45;setTimeout(()=>{n.focus(),i.parentNode&&i.parentNode.removeChild(i),e?Mo(n,i.value,null,s,t):Mo(n,i.textContent,i.innerHTML,s,t)},50)}function Mo(n,t,e,i,s){let o=NS(n,t,e,i,n.state.selection.$from);if(n.someProp(\"handlePaste\",d=>d(n,s,o||X.empty)))return!0;if(!o)return!1;let u=GC(o),c=u?n.state.tr.replaceSelectionWith(u,i):n.state.tr.replaceSelection(o);return n.dispatch(c.scrollIntoView().setMeta(\"paste\",!0).setMeta(\"uiEvent\",\"paste\")),!0}function VS(n){let t=n.getData(\"text/plain\")||n.getData(\"Text\");if(t)return t;let e=n.getData(\"text/uri-list\");return e?e.replace(/\\r?\\n/g,\" \"):\"\"}ze.paste=(n,t)=>{let e=t;if(n.composing&&!Wn)return;let i=xo?null:e.clipboardData,s=n.input.shiftKey&&n.input.lastKeyCode!=45;i&&Mo(n,VS(i),i.getData(\"text/html\"),s,e)?e.preventDefault():YC(n,e)};class $S{constructor(t,e,i){this.slice=t,this.move=e,this.node=i}}const XC=dn?\"altKey\":\"ctrlKey\";function PS(n,t){let e;return n.someProp(\"dragCopies\",i=>{e=e||i(t)}),e!=null?!e:!t[XC]}Le.dragstart=(n,t)=>{let e=t,i=n.input.mouseDown;if(i&&i.done(),!e.dataTransfer)return;let s=n.state.selection,o=s.empty?null:n.posAtCoords(Ro(e)),u;if(!(o&&o.pos>=s.from&&o.pos<=(s instanceof rt?s.to-1:s.to))){if(i&&i.mightDrag)u=rt.create(n.state.doc,i.mightDrag.pos);else if(e.target&&tt(e.target)){let y=n.docView.nearestDesc(e.target,!0);y&&y.node.type.spec.draggable&&y!=n.docView&&(u=rt.create(n.state.doc,y.posBefore))}}let c=(u||n.state.selection).content(),{dom:d,text:p,slice:m}=Cp(n,c);(!e.dataTransfer.files.length||!Ee||hS>120)&&e.dataTransfer.clearData(),e.dataTransfer.setData(xo?\"Text\":\"text/html\",d.innerHTML),e.dataTransfer.effectAllowed=\"copyMove\",xo||e.dataTransfer.setData(\"text/plain\",p),n.dragging=new $S(m,PS(n,e),u)};Le.dragend=n=>{let t=n.dragging;window.setTimeout(()=>{n.dragging==t&&(n.dragging=null)},50)};ze.dragover=ze.dragenter=(n,t)=>t.preventDefault();ze.drop=(n,t)=>{try{FC(n,t,n.dragging)}finally{n.dragging=null}};function FC(n,t,e){if(!t.dataTransfer)return;let i=n.posAtCoords(Ro(t));if(!i)return;let s=n.state.doc.resolve(i.pos),o=e&&e.slice;o?n.someProp(\"transformPasted\",v=>{o=v(o,n,!1)}):o=NS(n,VS(t.dataTransfer),xo?null:t.dataTransfer.getData(\"text/html\"),!1,s);let u=!!(e&&PS(n,t));if(n.someProp(\"handleDrop\",v=>v(n,t,o||X.empty,u))){t.preventDefault();return}if(!o)return;t.preventDefault();let c=o?$1(n.state.doc,s.pos,o):s.pos;c==null&&(c=s.pos);let d=n.state.tr;if(u){let{node:v}=e;v?v.replace(d):d.deleteSelection()}let p=d.mapping.map(c),m=o.openStart==0&&o.openEnd==0&&o.content.childCount==1,y=d.doc;if(m?d.replaceRangeWith(p,p,o.content.firstChild):d.replaceRange(p,p,o),d.doc.eq(y))return;let b=d.doc.resolve(p);if(m&&rt.isSelectable(o.content.firstChild)&&b.nodeAfter&&b.nodeAfter.sameMarkup(o.content.firstChild))d.setSelection(new rt(b));else{let v=d.mapping.map(c);d.mapping.maps[d.mapping.maps.length-1].forEach((E,M,x,O)=>v=O),d.setSelection(Ap(n,b,d.doc.resolve(v)))}n.focus(),n.dispatch(d.setMeta(\"uiEvent\",\"drop\"))}Le.focus=n=>{n.input.lastFocus=Date.now(),n.focused||(n.domObserver.stop(),n.dom.classList.add(\"ProseMirror-focused\"),n.domObserver.start(),n.focused=!0,setTimeout(()=>{n.docView&&n.hasFocus()&&!n.domObserver.currentSelection.eq(n.domSelectionRange())&&ni(n)},20))};Le.blur=(n,t)=>{let e=t;n.focused&&(n.domObserver.stop(),n.dom.classList.remove(\"ProseMirror-focused\"),n.domObserver.start(),e.relatedTarget&&n.dom.contains(e.relatedTarget)&&n.domObserver.currentSelection.clear(),n.focused=!1)};Le.beforeinput=(n,t)=>{if(Wn&&t.inputType==\"deleteContentBackward\"){n.domObserver.flushSoon();let{domChangeCount:i}=n.input;setTimeout(()=>{if(n.input.domChangeCount!=i||(n.dom.blur(),n.focus(),n.someProp(\"handleKeyDown\",o=>o(n,gr(8,\"Backspace\")))))return;let{$cursor:s}=n.state.selection;s&&s.pos>0&&n.dispatch(n.state.tr.delete(s.pos-1,s.pos).scrollIntoView())},50)}};for(let n in ze)Le[n]=ze[n];function ko(n,t){if(n==t)return!0;for(let e in n)if(n[e]!==t[e])return!1;for(let e in t)if(!(e in n))return!1;return!0}class ku{constructor(t,e){this.toDOM=t,this.spec=e||kr,this.side=this.spec.side||0}map(t,e,i,s){let{pos:o,deleted:u}=t.mapResult(e.from+s,this.side<0?-1:1);return u?null:new Ce(o-i,o-i,this)}valid(){return!0}eq(t){return this==t||t instanceof ku&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&ko(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class $i{constructor(t,e){this.attrs=t,this.spec=e||kr}map(t,e,i,s){let o=t.map(e.from+s,this.spec.inclusiveStart?-1:1)-i,u=t.map(e.to+s,this.spec.inclusiveEnd?1:-1)-i;return o>=u?null:new Ce(o,u,this)}valid(t,e){return e.from<e.to}eq(t){return this==t||t instanceof $i&&ko(this.attrs,t.attrs)&&ko(this.spec,t.spec)}static is(t){return t.type instanceof $i}destroy(){}}class Dp{constructor(t,e){this.attrs=t,this.spec=e||kr}map(t,e,i,s){let o=t.mapResult(e.from+s,1);if(o.deleted)return null;let u=t.mapResult(e.to+s,-1);return u.deleted||u.pos<=o.pos?null:new Ce(o.pos-i,u.pos-i,this)}valid(t,e){let{index:i,offset:s}=t.content.findIndex(e.from),o;return s==e.from&&!(o=t.child(i)).isText&&s+o.nodeSize==e.to}eq(t){return this==t||t instanceof Dp&&ko(this.attrs,t.attrs)&&ko(this.spec,t.spec)}destroy(){}}class Ce{constructor(t,e,i){this.from=t,this.to=e,this.type=i}copy(t,e){return new Ce(t,e,this.type)}eq(t,e=0){return this.type.eq(t.type)&&this.from+e==t.from&&this.to+e==t.to}map(t,e,i){return this.type.map(t,this,e,i)}static widget(t,e,i){return new Ce(t,t,new ku(e,i))}static inline(t,e,i,s){return new Ce(t,e,new $i(i,s))}static node(t,e,i,s){return new Ce(t,e,new Dp(i,s))}get spec(){return this.type.spec}get inline(){return this.type instanceof $i}get widget(){return this.type instanceof ku}}const Cs=[],kr={};class xt{constructor(t,e){this.local=t.length?t:Cs,this.children=e.length?e:Cs}static create(t,e){return e.length?Au(e,t,0,kr):ke}find(t,e,i){let s=[];return this.findInner(t??0,e??1e9,s,0,i),s}findInner(t,e,i,s,o){for(let u=0;u<this.local.length;u++){let c=this.local[u];c.from<=e&&c.to>=t&&(!o||o(c.spec))&&i.push(c.copy(c.from+s,c.to+s))}for(let u=0;u<this.children.length;u+=3)if(this.children[u]<e&&this.children[u+1]>t){let c=this.children[u]+1;this.children[u+2].findInner(t-c,e-c,i,s+c,o)}}map(t,e,i){return this==ke||t.maps.length==0?this:this.mapInner(t,e,0,0,i||kr)}mapInner(t,e,i,s,o){let u;for(let c=0;c<this.local.length;c++){let d=this.local[c].map(t,i,s);d&&d.type.valid(e,d)?(u||(u=[])).push(d):o.onRemove&&o.onRemove(this.local[c].spec)}return this.children.length?QC(this.children,u||[],t,e,i,s,o):u?new xt(u.sort(Ar),Cs):ke}add(t,e){return e.length?this==ke?xt.create(t,e):this.addInner(t,e,0):this}addInner(t,e,i){let s,o=0;t.forEach((c,d)=>{let p=d+i,m;if(m=GS(e,c,p)){for(s||(s=this.children.slice());o<s.length&&s[o]<d;)o+=3;s[o]==d?s[o+2]=s[o+2].addInner(c,m,p+1):s.splice(o,0,d,d+c.nodeSize,Au(m,c,p+1,kr)),o+=3}});let u=KS(o?YS(e):e,-i);for(let c=0;c<u.length;c++)u[c].type.valid(t,u[c])||u.splice(c--,1);return new xt(u.length?this.local.concat(u).sort(Ar):this.local,s||this.children)}remove(t){return t.length==0||this==ke?this:this.removeInner(t,0)}removeInner(t,e){let i=this.children,s=this.local;for(let o=0;o<i.length;o+=3){let u,c=i[o]+e,d=i[o+1]+e;for(let m=0,y;m<t.length;m++)(y=t[m])&&y.from>c&&y.to<d&&(t[m]=null,(u||(u=[])).push(y));if(!u)continue;i==this.children&&(i=this.children.slice());let p=i[o+2].removeInner(u,c+1);p!=ke?i[o+2]=p:(i.splice(o,3),o-=3)}if(s.length){for(let o=0,u;o<t.length;o++)if(u=t[o])for(let c=0;c<s.length;c++)s[c].eq(u,e)&&(s==this.local&&(s=this.local.slice()),s.splice(c--,1))}return i==this.children&&s==this.local?this:s.length||i.length?new xt(s,i):ke}forChild(t,e){if(this==ke)return this;if(e.isLeaf)return xt.empty;let i,s;for(let c=0;c<this.children.length;c+=3)if(this.children[c]>=t){this.children[c]==t&&(i=this.children[c+2]);break}let o=t+1,u=o+e.content.size;for(let c=0;c<this.local.length;c++){let d=this.local[c];if(d.from<u&&d.to>o&&d.type instanceof $i){let p=Math.max(o,d.from)-o,m=Math.min(u,d.to)-o;p<m&&(s||(s=[])).push(d.copy(p,m))}}if(s){let c=new xt(s.sort(Ar),Cs);return i?new _i([c,i]):c}return i||ke}eq(t){if(this==t)return!0;if(!(t instanceof xt)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let e=0;e<this.local.length;e++)if(!this.local[e].eq(t.local[e]))return!1;for(let e=0;e<this.children.length;e+=3)if(this.children[e]!=t.children[e]||this.children[e+1]!=t.children[e+1]||!this.children[e+2].eq(t.children[e+2]))return!1;return!0}locals(t){return Rp(this.localsInner(t))}localsInner(t){if(this==ke)return Cs;if(t.inlineContent||!this.local.some($i.is))return this.local;let e=[];for(let i=0;i<this.local.length;i++)this.local[i].type instanceof $i||e.push(this.local[i]);return e}forEachSet(t){t(this)}}xt.empty=new xt([],[]);xt.removeOverlap=Rp;const ke=xt.empty;class _i{constructor(t){this.members=t}map(t,e){const i=this.members.map(s=>s.map(t,e,kr));return _i.from(i)}forChild(t,e){if(e.isLeaf)return xt.empty;let i=[];for(let s=0;s<this.members.length;s++){let o=this.members[s].forChild(t,e);o!=ke&&(o instanceof _i?i=i.concat(o.members):i.push(o))}return _i.from(i)}eq(t){if(!(t instanceof _i)||t.members.length!=this.members.length)return!1;for(let e=0;e<this.members.length;e++)if(!this.members[e].eq(t.members[e]))return!1;return!0}locals(t){let e,i=!0;for(let s=0;s<this.members.length;s++){let o=this.members[s].localsInner(t);if(o.length)if(!e)e=o;else{i&&(e=e.slice(),i=!1);for(let u=0;u<o.length;u++)e.push(o[u])}}return e?Rp(i?e:e.sort(Ar)):Cs}static from(t){switch(t.length){case 0:return ke;case 1:return t[0];default:return new _i(t.every(e=>e instanceof xt)?t:t.reduce((e,i)=>e.concat(i instanceof xt?i:i.members),[]))}}forEachSet(t){for(let e=0;e<this.members.length;e++)this.members[e].forEachSet(t)}}function QC(n,t,e,i,s,o,u){let c=n.slice();for(let p=0,m=o;p<e.maps.length;p++){let y=0;e.maps[p].forEach((b,v,E,M)=>{let x=M-E-(v-b);for(let O=0;O<c.length;O+=3){let B=c[O+1];if(B<0||b>B+m-y)continue;let I=c[O]+m-y;v>=I?c[O+1]=b<=I?-2:-1:b>=m&&x&&(c[O]+=x,c[O+1]+=x)}y+=x}),m=e.maps[p].map(m,-1)}let d=!1;for(let p=0;p<c.length;p+=3)if(c[p+1]<0){if(c[p+1]==-2){d=!0,c[p+1]=-1;continue}let m=e.map(n[p]+o),y=m-s;if(y<0||y>=i.content.size){d=!0;continue}let b=e.map(n[p+1]+o,-1),v=b-s,{index:E,offset:M}=i.content.findIndex(y),x=i.maybeChild(E);if(x&&M==y&&M+x.nodeSize==v){let O=c[p+2].mapInner(e,x,m+1,n[p]+o+1,u);O!=ke?(c[p]=y,c[p+1]=v,c[p+2]=O):(c[p+1]=-2,d=!0)}else d=!0}if(d){let p=JC(c,n,t,e,s,o,u),m=Au(p,i,0,u);t=m.local;for(let y=0;y<c.length;y+=3)c[y+1]<0&&(c.splice(y,3),y-=3);for(let y=0,b=0;y<m.children.length;y+=3){let v=m.children[y];for(;b<c.length&&c[b]<v;)b+=3;c.splice(b,0,m.children[y],m.children[y+1],m.children[y+2])}}return new xt(t.sort(Ar),c)}function KS(n,t){if(!t||!n.length)return n;let e=[];for(let i=0;i<n.length;i++){let s=n[i];e.push(new Ce(s.from+t,s.to+t,s.type))}return e}function JC(n,t,e,i,s,o,u){function c(d,p){for(let m=0;m<d.local.length;m++){let y=d.local[m].map(i,s,p);y?e.push(y):u.onRemove&&u.onRemove(d.local[m].spec)}for(let m=0;m<d.children.length;m+=3)c(d.children[m+2],d.children[m]+p+1)}for(let d=0;d<n.length;d+=3)n[d+1]==-1&&c(n[d+2],t[d]+o+1);return e}function GS(n,t,e){if(t.isLeaf)return null;let i=e+t.nodeSize,s=null;for(let o=0,u;o<n.length;o++)(u=n[o])&&u.from>e&&u.to<i&&((s||(s=[])).push(u),n[o]=null);return s}function YS(n){let t=[];for(let e=0;e<n.length;e++)n[e]!=null&&t.push(n[e]);return t}function Au(n,t,e,i){let s=[],o=!1;t.forEach((c,d)=>{let p=GS(n,c,d+e);if(p){o=!0;let m=Au(p,c,e+d+1,i);m!=ke&&s.push(d,d+c.nodeSize,m)}});let u=KS(o?YS(n):n,-e).sort(Ar);for(let c=0;c<u.length;c++)u[c].type.valid(t,u[c])||(i.onRemove&&i.onRemove(u[c].spec),u.splice(c--,1));return u.length||s.length?new xt(u,s):ke}function Ar(n,t){return n.from-t.from||n.to-t.to}function Rp(n){let t=n;for(let e=0;e<t.length-1;e++){let i=t[e];if(i.from!=i.to)for(let s=e+1;s<t.length;s++){let o=t[s];if(o.from==i.from){o.to!=i.to&&(t==n&&(t=n.slice()),t[s]=o.copy(o.from,i.to),ov(t,s+1,o.copy(i.to,o.to)));continue}else{o.from<i.to&&(t==n&&(t=n.slice()),t[e]=i.copy(i.from,o.from),ov(t,s,i.copy(o.from,i.to)));break}}}return t}function ov(n,t,e){for(;t<n.length&&Ar(e,n[t])>0;)t++;n.splice(t,0,e)}function bh(n){let t=[];return n.someProp(\"decorations\",e=>{let i=e(n.state);i&&i!=ke&&t.push(i)}),n.cursorWrapper&&t.push(xt.create(n.state.doc,[n.cursorWrapper.deco])),_i.from(t)}const ZC={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},WC=qe&&ji<=11;class tO{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset}}class eO{constructor(t,e){this.view=t,this.handleDOMChange=e,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new tO,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(i=>{for(let s=0;s<i.length;s++)this.queue.push(i[s]);qe&&ji<=11&&i.some(s=>s.type==\"childList\"&&s.removedNodes.length||s.type==\"characterData\"&&s.oldValue.length>s.target.nodeValue.length)?this.flushSoon():Oe&&t.composing&&i.some(s=>s.type==\"childList\"&&s.target.nodeName==\"TR\")?(t.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),WC&&(this.onCharData=i=>{this.queue.push({target:i.target,type:\"characterData\",oldValue:i.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,ZC)),this.onCharData&&this.view.dom.addEventListener(\"DOMCharacterDataModified\",this.onCharData),this.connectSelection()}stop(){if(this.observer){let t=this.observer.takeRecords();if(t.length){for(let e=0;e<t.length;e++)this.queue.push(t[e]);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(tv(this.view)){if(this.suppressingSelectionUpdates)return ni(this.view);if(qe&&ji<=11&&!this.view.state.selection.empty){let t=this.view.domSelectionRange();if(t.focusNode&&Nr(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(t){if(!t.focusNode)return!0;let e=new Set,i;for(let o=t.focusNode;o;o=Bs(o))e.add(o);for(let o=t.anchorNode;o;o=Bs(o))if(e.has(o)){i=o;break}let s=i&&this.view.docView.nearestDesc(i);if(s&&s.ignoreMutation({type:\"selection\",target:oe(i)?i.parentNode:i}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}flush(){let{view:t}=this;if(!t.docView||this.flushingSoon>-1)return;let e=this.pendingRecords();e.length&&(this.queue=[]);let i=t.domSelectionRange(),s=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(i)&&tv(t)&&!this.ignoreSelectionChange(i),o=-1,u=-1,c=!1,d=[];if(t.editable)for(let m=0;m<e.length;m++){let y=this.registerMutation(e[m],d);y&&(o=o<0?y.from:Math.min(y.from,o),u=u<0?y.to:Math.max(y.to,u),y.typeOver&&(c=!0))}if(d.some(m=>m.nodeName==\"BR\")&&(t.input.lastKeyCode==8||t.input.lastKeyCode==46||Ee&&(t.composing||t.input.compositionEndedAt>Date.now()-50)&&e.some(m=>m.type==\"childList\"&&m.removedNodes.length))){for(let m of d)if(m.nodeName==\"BR\"&&m.parentNode){let y=m.nextSibling;for(;y&&tt(y);){if(y.contentEditable==\"false\"){m.parentNode.removeChild(m);break}y=y.firstChild}}}else if(We&&d.length){let m=d.filter(y=>y.nodeName==\"BR\");if(m.length==2){let[y,b]=m;y.parentNode&&y.parentNode.parentNode==b.parentNode?b.remove():y.remove()}else{let{focusNode:y}=this.currentSelection;for(let b of m){let v=b.parentNode;v&&v.nodeName==\"LI\"&&(!y||rO(t,y)!=v)&&b.remove()}}}let p=null;o<0&&s&&t.input.lastFocus>Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)<Date.now()-300&&fc(i)&&(p=kp(t))&&p.eq(dt.near(t.state.doc.resolve(0),1))?(t.input.lastFocus=0,ni(t),this.currentSelection.set(i),t.scrollToSelection()):(o>-1||s)&&(o>-1&&(t.docView.markDirty(o,u),nO(t)),t.input.badSafariComposition&&(t.input.badSafariComposition=!1,sO(t,d)),this.handleDOMChange(o,u,c,d),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(i)||ni(t),this.currentSelection.set(i))}registerMutation(t,e){if(e.indexOf(t.target)>-1)return null;let i=this.view.docView.nearestDesc(t.target);if(t.type==\"attributes\"&&(i==this.view.docView||t.attributeName==\"contenteditable\"||t.attributeName==\"style\"&&!t.oldValue&&!t.target.getAttribute(\"style\"))||!i||i.ignoreMutation(t))return null;if(t.type==\"childList\"){for(let m=0;m<t.addedNodes.length;m++){let y=t.addedNodes[m];e.push(y),oe(y)&&(this.lastChangedTextNode=y)}if(i.contentDOM&&i.contentDOM!=i.dom&&!i.contentDOM.contains(t.target))return{from:i.posBefore,to:i.posAfter};let s=t.previousSibling,o=t.nextSibling;if(qe&&ji<=11&&t.addedNodes.length)for(let m=0;m<t.addedNodes.length;m++){let{previousSibling:y,nextSibling:b}=t.addedNodes[m];(!y||Array.prototype.indexOf.call(t.addedNodes,y)<0)&&(s=y),(!b||Array.prototype.indexOf.call(t.addedNodes,b)<0)&&(o=b)}let u=s&&s.parentNode==t.target?ve(s)+1:0,c=i.localPosFromDOM(t.target,u,-1),d=o&&o.parentNode==t.target?ve(o):t.target.childNodes.length,p=i.localPosFromDOM(t.target,d,1);return{from:c,to:p}}else return t.type==\"attributes\"?{from:i.posAtStart-i.border,to:i.posAtEnd+i.border}:(this.lastChangedTextNode=t.target,{from:i.posAtStart,to:i.posAtEnd,typeOver:t.target.nodeValue==t.oldValue})}}let av=new WeakMap,uv=!1;function nO(n){if(!av.has(n)&&(av.set(n,null),[\"normal\",\"nowrap\",\"pre-line\"].indexOf(getComputedStyle(n.dom).whiteSpace)!==-1)){if(n.requiresGeckoHackNode=We,uv)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.\"),uv=!0}}function cv(n,t){let e=t.startContainer,i=t.startOffset,s=t.endContainer,o=t.endOffset,u=n.domAtPos(n.state.selection.anchor);return Nr(u.node,u.offset,s,o)&&([e,i,s,o]=[s,o,e,i]),{anchorNode:e,anchorOffset:i,focusNode:s,focusOffset:o}}function iO(n,t){if(t.getComposedRanges){let s=t.getComposedRanges(n.root)[0];if(s)return cv(n,s)}let e;function i(s){s.preventDefault(),s.stopImmediatePropagation(),e=s.getTargetRanges()[0]}return n.dom.addEventListener(\"beforeinput\",i,!0),document.execCommand(\"indent\"),n.dom.removeEventListener(\"beforeinput\",i,!0),e?cv(n,e):null}function rO(n,t){for(let e=t.parentNode;e&&e!=n.dom;e=e.parentNode){let i=n.docView.nearestDesc(e,!0);if(i&&i.node.isBlock)return e}return null}function sO(n,t){var e;let{focusNode:i,focusOffset:s}=n.domSelectionRange();for(let o of t)if(((e=o.parentNode)===null||e===void 0?void 0:e.nodeName)==\"TR\"){let u=o.nextSibling;for(;u&&u.nodeName!=\"TD\"&&u.nodeName!=\"TH\";)u=u.nextSibling;if(u){let c=u;for(;;){let d=c.firstChild;if(!d||!tt(d)||d.contentEditable==\"false\"||/^(BR|IMG)$/.test(d.nodeName))break;c=d}c.insertBefore(o,c.firstChild),i==o&&n.domSelection().collapse(o,s)}else o.parentNode.removeChild(o)}}function lO(n,t,e,i){let{node:s,fromOffset:o,toOffset:u,from:c,to:d}=n.docView.parseRange(t,e),p=n.domSelectionRange(),m,y=p.anchorNode;if(y&&Dr(n.dom,y)&&(m=[{node:y,offset:p.anchorOffset}],fc(p)||m.push({node:p.focusNode,offset:p.focusOffset})),Ee&&n.input.lastKeyCode===8)for(let O=u;O>o;O--){let B=s.childNodes[O-1],I=B.pmViewDesc;if(B.nodeName==\"BR\"&&!I){u=O;break}if(!I||I.size)break}let b=n.state.doc,v=n.someProp(\"domParser\")||ro.fromSchema(n.state.schema),E=b.resolve(c),M=null,x=v.parse(s,{topNode:E.parent,topMatch:E.parent.contentMatchAt(E.index()),topOpen:!0,from:o,to:u,preserveWhitespace:E.parent.type.whitespace==\"pre\"?\"full\":!0,findPositions:m,ruleFromNode:oO(i),context:E});if(m&&m[0].pos!=null){let O=m[0].pos,B=m[1]&&m[1].pos;B==null&&(B=O),M={anchor:O+c,head:B+c}}return{doc:x,sel:M,from:c,to:d}}const oO=n=>t=>{let e=t.pmViewDesc;if(e)return e.parseRule(n);if(t.nodeName==\"BR\"&&t.parentNode){if(Oe&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let i=document.createElement(\"div\");return i.appendChild(document.createElement(\"li\")),{skip:i}}else if(t.parentNode.lastChild==t||Oe&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName==\"IMG\"&&t.getAttribute(\"mark-placeholder\"))return{ignore:!0};return null},aO=/^(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 uO(n,t,e,i,s){let o=n.input.compositionPendingChanges||(n.composing?n.input.compositionID:0);if(n.input.compositionPendingChanges=0,t<0){let Y=n.input.lastSelectionTime>Date.now()-50?n.input.lastSelectionOrigin:null,nt=kp(n,Y);if(nt&&!n.state.selection.eq(nt)){if(Ee&&Wn&&n.input.lastKeyCode===13&&Date.now()-100<n.input.lastKeyCodeTime&&n.someProp(\"handleKeyDown\",Et=>Et(n,gr(13,\"Enter\"))))return;let ct=n.state.tr.setSelection(nt);Y==\"pointer\"?ct.setMeta(\"pointer\",!0):Y==\"key\"&&ct.scrollIntoView(),o&&ct.setMeta(\"composition\",o),n.dispatch(ct)}return}let u=n.state.doc.resolve(t),c=u.sharedDepth(e);t=u.before(c+1),e=n.state.doc.resolve(e).after(c+1);let d=n.state.selection,p=lO(n,t,e,s),m=n.state.doc,y=m.slice(p.from,p.to),b,v;n.input.lastKeyCode===8&&Date.now()-100<n.input.lastKeyCodeTime?(b=n.state.selection.to,v=\"end\"):(b=n.state.selection.from,v=\"start\"),n.input.lastKeyCode=null;let E=hO(y.content,p.doc.content,p.from,b,v);if(E&&n.input.domChangeCount++,(Hs&&n.input.lastIOSEnter>Date.now()-225||Wn)&&s.some(Y=>tt(Y)&&!aO.test(Y.nodeName))&&(!E||E.endA>=E.endB)&&n.someProp(\"handleKeyDown\",Y=>Y(n,gr(13,\"Enter\")))){n.input.lastIOSEnter=0;return}if(!E)if(i&&d instanceof lt&&!d.empty&&d.$head.sameParent(d.$anchor)&&!n.composing&&!(p.sel&&p.sel.anchor!=p.sel.head))E={start:d.from,endA:d.to,endB:d.to};else{if(p.sel){let Y=fv(n,n.state.doc,p.sel);if(Y&&!Y.eq(n.state.selection)){let nt=n.state.tr.setSelection(Y);o&&nt.setMeta(\"composition\",o),n.dispatch(nt)}}return}n.state.selection.from<n.state.selection.to&&E.start==E.endB&&n.state.selection instanceof lt&&(E.start>n.state.selection.from&&E.start<=n.state.selection.from+2&&n.state.selection.from>=p.from?E.start=n.state.selection.from:E.endA<n.state.selection.to&&E.endA>=n.state.selection.to-2&&n.state.selection.to<=p.to&&(E.endB+=n.state.selection.to-E.endA,E.endA=n.state.selection.to)),qe&&ji<=11&&E.endB==E.start+1&&E.endA==E.start&&E.start>p.from&&p.doc.textBetween(E.start-p.from-1,E.start-p.from+1)==\" \"&&(E.start--,E.endA--,E.endB--);let M=p.doc.resolveNoCache(E.start-p.from),x=p.doc.resolveNoCache(E.endB-p.from),O=m.resolve(E.start),B=M.sameParent(x)&&M.parent.inlineContent&&O.end()>=E.endA;if((Hs&&n.input.lastIOSEnter>Date.now()-225&&(!B||s.some(Y=>Y.nodeName==\"DIV\"||Y.nodeName==\"P\"))||!B&&dO(p.doc,M.pos,x.pos))&&n.someProp(\"handleKeyDown\",Y=>Y(n,gr(13,\"Enter\")))){n.input.lastIOSEnter=0;return}if(n.state.selection.anchor>E.start&&fO(m,E.start,E.endA,M,x)&&n.someProp(\"handleKeyDown\",Y=>Y(n,gr(8,\"Backspace\")))){Wn&&Ee&&n.domObserver.suppressSelectionUpdates();return}Ee&&E.endB==E.start&&(n.input.lastChromeDelete=Date.now()),Wn&&!B&&M.start()!=x.start()&&x.parentOffset==0&&M.depth==x.depth&&p.sel&&p.sel.anchor==p.sel.head&&p.sel.head==E.endA&&(E.endB-=2,x=p.doc.resolveNoCache(E.endB-p.from),setTimeout(()=>{n.someProp(\"handleKeyDown\",function(Y){return Y(n,gr(13,\"Enter\"))})},20));let I=E.start,q=E.endA,P=Y=>{let nt=Y||n.state.tr.replace(I,q,p.doc.slice(E.start-p.from,E.endB-p.from));if(p.sel){let ct=fv(n,nt.doc,p.sel);ct&&!(Ee&&n.composing&&ct.empty&&(E.start!=E.endB||n.input.lastChromeDelete<Date.now()-100)&&(ct.head==I||ct.head==nt.mapping.map(q)-1)||qe&&ct.empty&&ct.head==I)&&nt.setSelection(ct)}return o&&nt.setMeta(\"composition\",o),nt.scrollIntoView()},et;if(B)if(M.pos==x.pos){qe&&ji<=11&&M.parentOffset==0&&(n.domObserver.suppressSelectionUpdates(),setTimeout(()=>ni(n),20));let Y=P(n.state.tr.delete(I,q)),nt=m.resolve(E.start).marksAcross(m.resolve(E.endA));nt&&Y.ensureMarks(nt),n.dispatch(Y)}else if(E.endA==E.endB&&(et=cO(M.parent.content.cut(M.parentOffset,x.parentOffset),O.parent.content.cut(O.parentOffset,E.endA-O.start())))){let Y=P(n.state.tr);et.type==\"add\"?Y.addMark(I,q,et.mark):Y.removeMark(I,q,et.mark),n.dispatch(Y)}else if(M.parent.child(M.index()).isText&&M.index()==x.index()-(x.textOffset?0:1)){let Y=M.parent.textBetween(M.parentOffset,x.parentOffset),nt=()=>P(n.state.tr.insertText(Y,I,q));n.someProp(\"handleTextInput\",ct=>ct(n,I,q,Y,nt))||n.dispatch(nt())}else n.dispatch(P());else n.dispatch(P())}function fv(n,t,e){return Math.max(e.anchor,e.head)>t.content.size?null:Ap(n,t.resolve(e.anchor),t.resolve(e.head))}function cO(n,t){let e=n.firstChild.marks,i=t.firstChild.marks,s=e,o=i,u,c,d;for(let m=0;m<i.length;m++)s=i[m].removeFromSet(s);for(let m=0;m<e.length;m++)o=e[m].removeFromSet(o);if(s.length==1&&o.length==0)c=s[0],u=\"add\",d=m=>m.mark(c.addToSet(m.marks));else if(s.length==0&&o.length==1)c=o[0],u=\"remove\",d=m=>m.mark(c.removeFromSet(m.marks));else return null;let p=[];for(let m=0;m<t.childCount;m++)p.push(d(t.child(m)));if(j.from(p).eq(n))return{mark:c,type:u}}function fO(n,t,e,i,s){if(e-t<=s.pos-i.pos||vh(i,!0,!1)<s.pos)return!1;let o=n.resolve(t);if(!i.parent.isTextblock){let c=o.nodeAfter;return c!=null&&e==t+c.nodeSize}if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;let u=n.resolve(vh(o,!0,!0));return!u.parent.isTextblock||u.pos>e||vh(u,!0,!1)<e?!1:i.parent.content.cut(i.parentOffset).eq(u.parent.content)}function dO(n,t,e){let i=0,s=0;return n.nodesBetween(t,e,(o,u)=>{o.isTextblock&&u>=t&&u<e?i++:(o.isText?/\\S/.test(o.text.slice(Math.max(0,t-u),Math.min(o.nodeSize,e-u))):o.isLeaf)&&s++}),s==0&&i==1}function vh(n,t,e){let i=n.depth,s=t?n.end():n.pos;for(;i>0&&(t||n.indexAfter(i)==n.node(i).childCount);)i--,s++,t=!1;if(e){let o=n.node(i).maybeChild(n.indexAfter(i));for(;o&&!o.isLeaf;)o=o.firstChild,s++}return s}function hO(n,t,e,i,s){let o=n.findDiffStart(t,e),u=e+n.size,c=e+t.size;if(o==null)return null;let{a:d,b:p}=n.findDiffEnd(t,u,c);if(s==\"end\"){let m=Math.max(0,o-Math.min(d,p));i-=d+m-o}if(d<o&&u<c){let m=i<=o&&i>=d?o-i:0;o-=m,p=o+(p-d),d=o}else if(p<o){let m=i<=o&&i>=p?o-i:0;o-=m,d=o+(d-p),p=o}return{start:o,endA:d,endB:p}}class XS{constructor(t,e){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 OC,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=e,this.state=e.state,this.directPlugins=e.plugins||[],this.directPlugins.forEach(gv),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement(\"div\"),t&&(t.appendChild?t.appendChild(this.dom):typeof t==\"function\"?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=pv(this),hv(this),this.nodeViews=mv(this),this.docView=Xb(this.state.doc,dv(this),bh(this),this.dom,this),this.domObserver=new eO(this,(i,s,o,u)=>uO(this,i,s,o,u)),this.domObserver.start(),wC(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let t=this._props;this._props={};for(let e in t)this._props[e]=t[e];this._props.state=this.state}return this._props}update(t){t.handleDOMEvents!=this._props.handleDOMEvents&&Jh(this);let e=this._props;this._props=t,t.plugins&&(t.plugins.forEach(gv),this.directPlugins=t.plugins),this.updateStateInner(t.state,e)}setProps(t){let e={};for(let i in this._props)e[i]=this._props[i];e.state=this.state;for(let i in t)e[i]=t[i];this.update(e)}updateState(t){this.updateStateInner(t,this._props)}updateStateInner(t,e){var i;let s=this.state,o=!1,u=!1;t.storedMarks&&this.composing&&(qS(this),u=!0),this.state=t;let c=s.plugins!=t.plugins||this._props.plugins!=e.plugins;if(c||this._props.plugins!=e.plugins||this._props.nodeViews!=e.nodeViews){let v=mv(this);mO(v,this.nodeViews)&&(this.nodeViews=v,o=!0)}(c||e.handleDOMEvents!=this._props.handleDOMEvents)&&Jh(this),this.editable=pv(this),hv(this);let d=bh(this),p=dv(this),m=s.plugins!=t.plugins&&!s.doc.eq(t.doc)?\"reset\":t.scrollToSelection>s.scrollToSelection?\"to selection\":\"preserve\",y=o||!this.docView.matchesNode(t.doc,p,d);(y||!t.selection.eq(s.selection))&&(u=!0);let b=m==\"preserve\"&&u&&this.dom.style.overflowAnchor==null&&$A(this);if(u){this.domObserver.stop();let v=y&&(qe||Ee)&&!this.composing&&!s.selection.empty&&!t.selection.empty&&pO(s.selection,t.selection);if(y){let M=Ee?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=PC(this)),(o||!this.docView.update(t.doc,p,d,this))&&(this.docView.updateOuterDeco(p),this.docView.destroy(),this.docView=Xb(t.doc,p,d,this.dom,this)),M&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(v=!0)}let E=this.input.mouseDown;v||!(E&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&hC(this)&&E.delaySelUpdate())?ni(this,v):(CS(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(s),!((i=this.dragging)===null||i===void 0)&&i.node&&!s.doc.eq(t.doc)&&this.updateDraggedNode(this.dragging,s),m==\"reset\"?this.dom.scrollTop=0:m==\"to selection\"?this.scrollToSelection():b&&PA(b)}scrollToSelection(){let t=this.domSelectionRange().focusNode;if(!(!t||!Dr(this.dom,t))){if(!this.someProp(\"handleScrollToSelection\",e=>e(this)))if(this.state.selection instanceof rt){let e=this.docView.domAfterPos(this.state.selection.from);tt(e)&&$b(this,e.getBoundingClientRect(),t)}else $b(this,this.coordsAtPos(this.state.selection.head,1),t)}}destroyPluginViews(){let t;for(;t=this.pluginViews.pop();)t.destroy&&t.destroy()}updatePluginViews(t){if(!t||t.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let e=0;e<this.directPlugins.length;e++){let i=this.directPlugins[e];i.spec.view&&this.pluginViews.push(i.spec.view(this))}for(let e=0;e<this.state.plugins.length;e++){let i=this.state.plugins[e];i.spec.view&&this.pluginViews.push(i.spec.view(this))}}else for(let e=0;e<this.pluginViews.length;e++){let i=this.pluginViews[e];i.update&&i.update(this,t)}}updateDraggedNode(t,e){let i=t.node,s=-1;if(i.from<this.state.doc.content.size&&this.state.doc.nodeAt(i.from)==i.node)s=i.from;else{let o=i.from+(this.state.doc.content.size-e.doc.content.size);(o>0&&o<this.state.doc.content.size&&this.state.doc.nodeAt(o))==i.node&&(s=o)}this.dragging=new $S(t.slice,t.move,s<0?void 0:rt.create(this.state.doc,s))}someProp(t,e){let i=this._props&&this._props[t],s;if(i!=null&&(s=e?e(i):i))return s;for(let u=0;u<this.directPlugins.length;u++){let c=this.directPlugins[u].props[t];if(c!=null&&(s=e?e(c):c))return s}let o=this.state.plugins;if(o)for(let u=0;u<o.length;u++){let c=o[u].props[t];if(c!=null&&(s=e?e(c):c))return s}}hasFocus(){if(qe){let t=this.root.activeElement;if(t==this.dom)return!0;if(!t||!this.dom.contains(t))return!1;for(;t&&this.dom!=t&&this.dom.contains(t);){if(t.contentEditable==\"false\")return!1;t=t.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&KA(this.dom),ni(this),this.domObserver.start()}get root(){let t=this._root;if(t==null){for(let e=this.dom.parentNode;e;e=e.parentNode)if(e.nodeType==9||e.nodeType==11&&e.host)return e.getSelection||(Object.getPrototypeOf(e).getSelection=()=>e.ownerDocument.getSelection()),this._root=e}return t||document}updateRoot(){this._root=null}posAtCoords(t){return QA(this,t)}coordsAtPos(t,e=1){return vS(this,t,e)}domAtPos(t,e=0){return this.docView.domFromPos(t,e)}nodeDOM(t){let e=this.docView.descAt(t);return e?e.nodeDOM:null}posAtDOM(t,e,i=-1){let s=this.docView.posFromDOM(t,e,i);if(s==null)throw new RangeError(\"DOM position not inside the editor\");return s}endOfTextblock(t,e){return eC(this,e||this.state,t)}pasteHTML(t,e){return Mo(this,\"\",t,!1,e||new ClipboardEvent(\"paste\"))}pasteText(t,e){return Mo(this,t,null,!0,e||new ClipboardEvent(\"paste\"))}serializeForClipboard(t){return Cp(this,t)}destroy(){this.docView&&(NC(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],bh(this),this),this.dom.textContent=\"\"):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,LA())}get isDestroyed(){return this.docView==null}dispatchEvent(t){return RC(this,t)}domSelectionRange(){let t=this.dom.isConnected!==!1&&this.domSelection();return t?Oe&&this.root.nodeType===11&&UA(this.dom.ownerDocument)==this.dom&&iO(this,t)||t:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}XS.prototype.dispatch=function(n){let t=this._props.dispatchTransaction;t?t.call(this,n):this.updateState(this.state.apply(n))};function dv(n){let t=Object.create(null);return t.class=\"ProseMirror\",t.contenteditable=String(n.editable),n.someProp(\"attributes\",e=>{if(typeof e==\"function\"&&(e=e(n.state)),e)for(let i in e)i==\"class\"?t.class+=\" \"+e[i]:i==\"style\"?t.style=(t.style?t.style+\";\":\"\")+e[i]:!t[i]&&i!=\"contenteditable\"&&i!=\"nodeName\"&&(t[i]=String(e[i]))}),t.translate||(t.translate=\"no\"),[Ce.node(0,n.state.doc.content.size,t)]}function hv(n){if(n.markCursor){let t=document.createElement(\"img\");t.className=\"ProseMirror-separator\",t.setAttribute(\"mark-placeholder\",\"true\"),t.setAttribute(\"alt\",\"\"),n.cursorWrapper={dom:t,deco:Ce.widget(n.state.selection.from,t,{raw:!0,marks:n.markCursor})}}else n.cursorWrapper=null}function pv(n){return!n.someProp(\"editable\",t=>t(n.state)===!1)}function pO(n,t){let e=Math.min(n.$anchor.sharedDepth(n.head),t.$anchor.sharedDepth(t.head));return n.$anchor.start(e)!=t.$anchor.start(e)}function mv(n){let t=Object.create(null);function e(i){for(let s in i)Object.prototype.hasOwnProperty.call(t,s)||(t[s]=i[s])}return n.someProp(\"nodeViews\",e),n.someProp(\"markViews\",e),t}function mO(n,t){let e=0,i=0;for(let s in n){if(n[s]!=t[s])return!0;e++}for(let s in t)i++;return e!=i}function gv(n){if(n.spec.state||n.spec.filterTransaction||n.spec.appendTransaction)throw new RangeError(\"Plugins passed directly to the view must not have a state component\")}var Ki={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:\"'\"},Cu={48:\")\",49:\"!\",50:\"@\",51:\"#\",52:\"$\",53:\"%\",54:\"^\",55:\"&\",56:\"*\",57:\"(\",59:\":\",61:\"+\",173:\"_\",186:\":\",187:\"+\",188:\"<\",189:\"_\",190:\">\",191:\"?\",192:\"~\",219:\"{\",220:\"|\",221:\"}\",222:'\"'},gO=typeof navigator<\"u\"&&/Mac/.test(navigator.platform),yO=typeof navigator<\"u\"&&/MSIE \\d|Trident\\/(?:[7-9]|\\d{2,})\\..*rv:(\\d+)/.exec(navigator.userAgent);for(var Se=0;Se<10;Se++)Ki[48+Se]=Ki[96+Se]=String(Se);for(var Se=1;Se<=24;Se++)Ki[Se+111]=\"F\"+Se;for(var Se=65;Se<=90;Se++)Ki[Se]=String.fromCharCode(Se+32),Cu[Se]=String.fromCharCode(Se);for(var Sh in Ki)Cu.hasOwnProperty(Sh)||(Cu[Sh]=Ki[Sh]);function bO(n){var t=gO&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||yO&&n.shiftKey&&n.key&&n.key.length==1||n.key==\"Unidentified\",e=!t&&n.key||(n.shiftKey?Cu:Ki)[n.keyCode]||n.key||\"Unidentified\";return e==\"Esc\"&&(e=\"Escape\"),e==\"Del\"&&(e=\"Delete\"),e==\"Left\"&&(e=\"ArrowLeft\"),e==\"Up\"&&(e=\"ArrowUp\"),e==\"Right\"&&(e=\"ArrowRight\"),e==\"Down\"&&(e=\"ArrowDown\"),e}const vO=typeof navigator<\"u\"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),SO=typeof navigator<\"u\"&&/Win/.test(navigator.platform);function EO(n){let t=n.split(/-(?!$)/),e=t[t.length-1];e==\"Space\"&&(e=\" \");let i,s,o,u;for(let c=0;c<t.length-1;c++){let d=t[c];if(/^(cmd|meta|m)$/i.test(d))u=!0;else if(/^a(lt)?$/i.test(d))i=!0;else if(/^(c|ctrl|control)$/i.test(d))s=!0;else if(/^s(hift)?$/i.test(d))o=!0;else if(/^mod$/i.test(d))vO?u=!0:s=!0;else throw new Error(\"Unrecognized modifier name: \"+d)}return i&&(e=\"Alt-\"+e),s&&(e=\"Ctrl-\"+e),u&&(e=\"Meta-\"+e),o&&(e=\"Shift-\"+e),e}function TO(n){let t=Object.create(null);for(let e in n)t[EO(e)]=n[e];return t}function Eh(n,t,e=!0){return t.altKey&&(n=\"Alt-\"+n),t.ctrlKey&&(n=\"Ctrl-\"+n),t.metaKey&&(n=\"Meta-\"+n),e&&t.shiftKey&&(n=\"Shift-\"+n),n}function xO(n){return new It({props:{handleKeyDown:FS(n)}})}function FS(n){let t=TO(n);return function(e,i){let s=bO(i),o,u=t[Eh(s,i)];if(u&&u(e.state,e.dispatch,e))return!0;if(s.length==1&&s!=\" \"){if(i.shiftKey){let c=t[Eh(s,i,!1)];if(c&&c(e.state,e.dispatch,e))return!0}if((i.altKey||i.metaKey||i.ctrlKey)&&!(SO&&i.ctrlKey&&i.altKey)&&(o=Ki[i.keyCode])&&o!=s){let c=t[Eh(o,i)];if(c&&c(e.state,e.dispatch,e))return!0}}return!1}}var Ou=200,pe=function(){};pe.prototype.append=function(t){return t.length?(t=pe.from(t),!this.length&&t||t.length<Ou&&this.leafAppend(t)||this.length<Ou&&t.leafPrepend(this)||this.appendInner(t)):this};pe.prototype.prepend=function(t){return t.length?pe.from(t).append(this):this};pe.prototype.appendInner=function(t){return new MO(this,t)};pe.prototype.slice=function(t,e){return t===void 0&&(t=0),e===void 0&&(e=this.length),t>=e?pe.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,e))};pe.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)};pe.prototype.forEach=function(t,e,i){e===void 0&&(e=0),i===void 0&&(i=this.length),e<=i?this.forEachInner(t,e,i,0):this.forEachInvertedInner(t,e,i,0)};pe.prototype.map=function(t,e,i){e===void 0&&(e=0),i===void 0&&(i=this.length);var s=[];return this.forEach(function(o,u){return s.push(t(o,u))},e,i),s};pe.from=function(t){return t instanceof pe?t:t&&t.length?new QS(t):pe.empty};var QS=(function(n){function t(i){n.call(this),this.values=i}n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t;var e={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(s,o){return s==0&&o==this.length?this:new t(this.values.slice(s,o))},t.prototype.getInner=function(s){return this.values[s]},t.prototype.forEachInner=function(s,o,u,c){for(var d=o;d<u;d++)if(s(this.values[d],c+d)===!1)return!1},t.prototype.forEachInvertedInner=function(s,o,u,c){for(var d=o-1;d>=u;d--)if(s(this.values[d],c+d)===!1)return!1},t.prototype.leafAppend=function(s){if(this.length+s.length<=Ou)return new t(this.values.concat(s.flatten()))},t.prototype.leafPrepend=function(s){if(this.length+s.length<=Ou)return new t(s.flatten().concat(this.values))},e.length.get=function(){return this.values.length},e.depth.get=function(){return 0},Object.defineProperties(t.prototype,e),t})(pe);pe.empty=new QS([]);var MO=(function(n){function t(e,i){n.call(this),this.left=e,this.right=i,this.length=e.length+i.length,this.depth=Math.max(e.depth,i.depth)+1}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(i){return i<this.left.length?this.left.get(i):this.right.get(i-this.left.length)},t.prototype.forEachInner=function(i,s,o,u){var c=this.left.length;if(s<c&&this.left.forEachInner(i,s,Math.min(o,c),u)===!1||o>c&&this.right.forEachInner(i,Math.max(s-c,0),Math.min(this.length,o)-c,u+c)===!1)return!1},t.prototype.forEachInvertedInner=function(i,s,o,u){var c=this.left.length;if(s>c&&this.right.forEachInvertedInner(i,s-c,Math.max(o,c)-c,u+c)===!1||o<c&&this.left.forEachInvertedInner(i,Math.min(s,c),o,u)===!1)return!1},t.prototype.sliceInner=function(i,s){if(i==0&&s==this.length)return this;var o=this.left.length;return s<=o?this.left.slice(i,s):i>=o?this.right.slice(i-o,s-o):this.left.slice(i,o).append(this.right.slice(0,s-o))},t.prototype.leafAppend=function(i){var s=this.right.leafAppend(i);if(s)return new t(this.left,s)},t.prototype.leafPrepend=function(i){var s=this.left.leafPrepend(i);if(s)return new t(s,this.right)},t.prototype.appendInner=function(i){return this.left.depth>=Math.max(this.right.depth,i.depth)+1?new t(this.left,new t(this.right,i)):new t(this,i)},t})(pe);const kO=500;class bn{constructor(t,e){this.items=t,this.eventCount=e}popEvent(t,e){if(this.eventCount==0)return null;let i=this.items.length;for(;;i--)if(this.items.get(i-1).selection){--i;break}let s,o;e&&(s=this.remapping(i,this.items.length),o=s.maps.length);let u=t.tr,c,d,p=[],m=[];return this.items.forEach((y,b)=>{if(!y.step){s||(s=this.remapping(i,b+1),o=s.maps.length),o--,m.push(y);return}if(s){m.push(new Cn(y.map));let v=y.step.map(s.slice(o)),E;v&&u.maybeStep(v).doc&&(E=u.mapping.maps[u.mapping.maps.length-1],p.push(new Cn(E,void 0,void 0,p.length+m.length))),o--,E&&s.appendMap(E,o)}else u.maybeStep(y.step);if(y.selection)return c=s?y.selection.map(s.slice(o)):y.selection,d=new bn(this.items.slice(0,i).append(m.reverse().concat(p)),this.eventCount-1),!1},this.items.length,0),{remaining:d,transform:u,selection:c}}addTransform(t,e,i,s){let o=[],u=this.eventCount,c=this.items,d=!s&&c.length?c.get(c.length-1):null;for(let m=0;m<t.steps.length;m++){let y=t.steps[m].invert(t.docs[m]),b=new Cn(t.mapping.maps[m],y,e),v;(v=d&&d.merge(b))&&(b=v,m?o.pop():c=c.slice(0,c.length-1)),o.push(b),e&&(u++,e=void 0),s||(d=b)}let p=u-i.depth;return p>CO&&(c=AO(c,p),u-=p),new bn(c.append(o),u)}remapping(t,e){let i=new Eo;return this.items.forEach((s,o)=>{let u=s.mirrorOffset!=null&&o-s.mirrorOffset>=t?i.maps.length-s.mirrorOffset:void 0;i.appendMap(s.map,u)},t,e),i}addMaps(t){return this.eventCount==0?this:new bn(this.items.append(t.map(e=>new Cn(e))),this.eventCount)}rebased(t,e){if(!this.eventCount)return this;e=Math.min(this.items.length,e);let i=[],s=this.items.length-e,o=t.mapping,u=t.steps.length,c=this.eventCount;this.items.forEach(b=>{b.selection&&c--},s);let d=e;this.items.forEach(b=>{let v=o.getMirror(--d);if(v==null)return;u=Math.min(u,v);let E=o.maps[v];if(b.step){let M=t.steps[v].invert(t.docs[v]),x=b.selection&&b.selection.map(o.slice(d+1,v));x&&c++,i.push(new Cn(E,M,x))}else i.push(new Cn(E))},s);let p=[];for(let b=e;b<u;b++)p.push(new Cn(o.maps[b]));let m=this.items.slice(0,s).append(p).append(i),y=new bn(m,c);return y.emptyItemCount()>kO&&(y=y.compress(this.items.length-i.length)),y}emptyItemCount(){let t=0;return this.items.forEach(e=>{e.step||t++}),t}compress(t=this.items.length){let e=this.remapping(0,t),i=e.maps.length,s=[],o=0;return this.items.forEach((u,c)=>{if(c>=t)s.push(u),u.selection&&o++;else if(u.step){let d=u.step.map(e.slice(i)),p=d&&d.getMap();if(i--,p&&e.appendMap(p,i),d){let m=u.selection&&u.selection.map(e.slice(i));m&&o++;let y=new Cn(p.invert(),d,m),b,v=s.length-1;(b=s.length&&s[v].merge(y))?s[v]=b:s.push(y)}}else u.map&&i--},this.items.length,0),new bn(pe.from(s.reverse()),o)}}bn.empty=new bn(pe.empty,0);function AO(n,t){let e;return n.forEach((i,s)=>{if(i.selection&&t--==0)return e=s,!1}),n.slice(e)}class Cn{constructor(t,e,i,s){this.map=t,this.step=e,this.selection=i,this.mirrorOffset=s}merge(t){if(this.step&&t.step&&!t.selection){let e=t.step.merge(this.step);if(e)return new Cn(e.getMap().invert(),e,this.selection)}}}class Bi{constructor(t,e,i,s,o){this.done=t,this.undone=e,this.prevRanges=i,this.prevTime=s,this.prevComposition=o}}const CO=20;function OO(n,t,e,i){let s=e.getMeta(Pi),o;if(s)return s.historyState;e.getMeta(JS)&&(n=new Bi(n.done,n.undone,null,0,-1));let u=e.getMeta(\"appendedTransaction\");if(e.steps.length==0)return n;if(u&&u.getMeta(Pi))return u.getMeta(Pi).redo?new Bi(n.done.addTransform(e,void 0,i,gu(t)),n.undone,yv(e.mapping.maps),n.prevTime,n.prevComposition):new Bi(n.done,n.undone.addTransform(e,void 0,i,gu(t)),null,n.prevTime,n.prevComposition);if(e.getMeta(\"addToHistory\")!==!1&&!(u&&u.getMeta(\"addToHistory\")===!1)){let c=e.getMeta(\"composition\"),d=n.prevTime==0||!u&&n.prevComposition!=c&&(n.prevTime<(e.time||0)-i.newGroupDelay||!wO(e,n.prevRanges)),p=u?Th(n.prevRanges,e.mapping):yv(e.mapping.maps);return new Bi(n.done.addTransform(e,d?t.selection.getBookmark():void 0,i,gu(t)),bn.empty,p,e.time,c??n.prevComposition)}else return(o=e.getMeta(\"rebased\"))?new Bi(n.done.rebased(e,o),n.undone.rebased(e,o),Th(n.prevRanges,e.mapping),n.prevTime,n.prevComposition):new Bi(n.done.addMaps(e.mapping.maps),n.undone.addMaps(e.mapping.maps),Th(n.prevRanges,e.mapping),n.prevTime,n.prevComposition)}function wO(n,t){if(!t)return!1;if(!n.docChanged)return!0;let e=!1;return n.mapping.maps[0].forEach((i,s)=>{for(let o=0;o<t.length;o+=2)i<=t[o+1]&&s>=t[o]&&(e=!0)}),e}function yv(n){let t=[];for(let e=n.length-1;e>=0&&t.length==0;e--)n[e].forEach((i,s,o,u)=>t.push(o,u));return t}function Th(n,t){if(!n)return null;let e=[];for(let i=0;i<n.length;i+=2){let s=t.map(n[i],1),o=t.map(n[i+1],-1);s<=o&&e.push(s,o)}return e}function NO(n,t,e){let i=gu(t),s=Pi.get(t).spec.config,o=(e?n.undone:n.done).popEvent(t,i);if(!o)return null;let u=o.selection.resolve(o.transform.doc),c=(e?n.done:n.undone).addTransform(o.transform,t.selection.getBookmark(),s,i),d=new Bi(e?c:o.remaining,e?o.remaining:c,null,0,-1);return o.transform.setSelection(u).setMeta(Pi,{redo:e,historyState:d})}let xh=!1,bv=null;function gu(n){let t=n.plugins;if(bv!=t){xh=!1,bv=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){xh=!0;break}}return xh}function DO(n){return n.setMeta(JS,!0)}const Pi=new Zt(\"history\"),JS=new Zt(\"closeHistory\");function RO(n={}){return n={depth:n.depth||100,newGroupDelay:n.newGroupDelay||500},new It({key:Pi,state:{init(){return new Bi(bn.empty,bn.empty,null,0,-1)},apply(t,e,i){return OO(e,i,t,n)}},config:n,props:{handleDOMEvents:{beforeinput(t,e){let i=e.inputType,s=i==\"historyUndo\"?WS:i==\"historyRedo\"?tE:null;return!s||!t.editable?!1:(e.preventDefault(),s(t.state,t.dispatch))}}}})}function ZS(n,t){return(e,i)=>{let s=Pi.getState(e);if(!s||(n?s.undone:s.done).eventCount==0)return!1;if(i){let o=NO(s,e,n);o&&i(t?o.scrollIntoView():o)}return!0}}const WS=ZS(!1,!0),tE=ZS(!0,!0);function LO(n){return n.getMeta(Pi)!=null}function pc(n){const{state:t,transaction:e}=n;let{selection:i}=e,{doc:s}=e,{storedMarks:o}=e;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return o},get selection(){return i},get doc(){return s},get tr(){return i=e.selection,s=e.doc,o=e.storedMarks,e}}}var Rs=class eE{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(){const{rawCommands:t,editor:e,state:i}=this,{view:s}=e,{tr:o}=i,u=this.buildProps(o);return Object.fromEntries(Object.entries(t).map(([c,d])=>[c,(...m)=>{const y=d(...m)(u);return!o.getMeta(\"preventDispatch\")&&!this.hasCustomState&&s.dispatch(o),y}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,e=!0){const{rawCommands:i,editor:s,state:o}=this,{view:u}=s,c=[],d=!!t,p=t||o.tr,m=()=>(!d&&e&&!p.getMeta(\"preventDispatch\")&&!this.hasCustomState&&u.dispatch(p),c.every(b=>b===!0)),y={...Object.fromEntries(Object.entries(i).map(([b,v])=>[b,(...M)=>{const x=this.buildProps(p,e),O=v(...M)(x);return c.push(O),y}])),run:m};return y}static createFakeChain(){const t=new Proxy({},{get:(e,i)=>{if(i!==\"then\")return i===\"run\"?()=>!1:()=>t}});return t}createCan(t){const{rawCommands:e,state:i}=this,s=!1,o=t||i.tr,u=this.buildProps(o,s);return{...Object.fromEntries(Object.entries(e).map(([c,d])=>[c,(...p)=>d(...p)({...u,dispatch:void 0})])),chain:()=>this.createChain(o,s)}}static createFallbackCan(){const t=eE.createFakeChain();return new Proxy({chain:()=>t},{get:(e,i)=>{if(i!==\"then\")return i===\"chain\"?e.chain:()=>!1}})}buildProps(t,e=!0){const{rawCommands:i,editor:s,state:o}=this,{view:u}=s,c={tr:t,editor:s,view:u,state:pc({state:o,transaction:t}),dispatch:e?()=>{}:void 0,chain:()=>this.createChain(t,e),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(i).map(([d,p])=>[d,(...m)=>p(...m)(c)]))}};return c}};const zO=()=>({editor:n,view:t})=>(requestAnimationFrame(()=>{if(!n.isDestroyed){var e;t.dom.blur(),(e=window)===null||e===void 0||(e=e.getSelection())===null||e===void 0||e.removeAllRanges()}}),!0),BO=(n=!0)=>({commands:t})=>t.setContent(\"\",{emitUpdate:n}),HO=()=>({state:n,tr:t,dispatch:e})=>{const{selection:i}=t,{ranges:s}=i;return e&&s.forEach(({$from:o,$to:u})=>{n.doc.nodesBetween(o.pos,u.pos,(c,d)=>{if(c.type.isText)return;const{doc:p,mapping:m}=t,y=p.resolve(m.map(d)),b=p.resolve(m.map(d+c.nodeSize)),v=y.blockRange(b);if(!v)return;const E=qs(v);if(c.type.isTextblock){const{defaultType:M}=y.parent.contentMatchAt(y.index());t.setNodeMarkup(v.start,M)}(E||E===0)&&t.lift(v,E)})}),!0},_O=n=>t=>n(t),UO=()=>({state:n,dispatch:t})=>aS(n,t),IO=(n,t)=>({editor:e,tr:i})=>{const{state:s}=e,o=s.doc.slice(n.from,n.to);i.deleteRange(n.from,n.to);const u=i.mapping.map(t);return i.insert(u,o.content),i.setSelection(new lt(i.doc.resolve(Math.max(u-1,0)))),!0},jO=()=>({tr:n,dispatch:t})=>{const{selection:e}=n,i=e.$anchor.node();if(i.content.size>0)return!1;const s=n.selection.$anchor;for(let o=s.depth;o>0;o-=1)if(s.node(o).type===i.type){if(t){const u=s.before(o),c=s.after(o);n.delete(u,c).scrollIntoView()}return!0}return!1};function ae(n,t){if(typeof n==\"string\"){if(!t.nodes[n])throw Error(`There is no node type named '${n}'. Maybe you forgot to add the extension?`);return t.nodes[n]}return n}const qO=n=>({tr:t,state:e,dispatch:i})=>{const s=ae(n,e.schema),o=t.selection.$anchor;for(let u=o.depth;u>0;u-=1)if(o.node(u).type===s){if(i){const c=o.before(u),d=o.after(u);t.delete(c,d).scrollIntoView()}return!0}return!1},VO=n=>({tr:t,dispatch:e})=>{const{from:i,to:s}=n;return e&&t.delete(i,s),!0},$O=n=>n.content?/^text(\\*|\\+)/.test(n.content):!1,vv=(n,t,e)=>{if(!n.parent.isInline||e===\"left\"&&n.pos>n.start()||e===\"right\"&&n.pos<n.end())return n.pos;const i=t.nodes[n.parent.type.name].spec;return $O(i)?e===\"left\"?n.start()-1:n.end()+1:n.pos},PO=(n,t,e)=>({from:vv(n,e,\"left\"),to:vv(t,e,\"right\")}),KO=()=>({state:n,dispatch:t})=>{if(n.selection.empty)return!1;if(t){const e=n.tr,{ranges:i}=n.selection,s=e.steps.length;i.forEach(o=>{const u=e.mapping.slice(s),c=e.doc.resolve(u.map(o.$from.pos)),d=e.doc.resolve(u.map(o.$to.pos)),{from:p,to:m}=PO(c,d,n.schema);e.deleteRange(p,m)}),e.selection.empty||e.setSelection(lt.near(e.doc.resolve(e.selection.from))),e.scrollIntoView(),t(e)}return!0},GO=()=>({commands:n})=>n.keyboardShortcut(\"Enter\"),YO=()=>({state:n,dispatch:t})=>bA(n,t);function Lp(n){return Object.prototype.toString.call(n)===\"[object RegExp]\"}function wu(n,t,e={strict:!0}){const i=Object.keys(t);return i.length?i.every(s=>e.strict?t[s]===n[s]:Lp(t[s])?t[s].test(n[s]):t[s]===n[s]):!0}function nE(n,t,e={}){return n.find(i=>i.type===t&&wu(Object.fromEntries(Object.keys(e).map(s=>[s,i.attrs[s]])),e))}function Sv(n,t,e={}){return!!nE(n,t,e)}function mc(n,t,e){if(!n||!t)return;let i=n.parent.childAfter(n.parentOffset);if((!i.node||!i.node.marks.some(d=>d.type===t))&&(i=n.parent.childBefore(n.parentOffset)),!i.node||!i.node.marks.some(d=>d.type===t))return;if(!e){const d=i.node.marks.find(p=>p.type===t);d&&(e=d.attrs)}if(!nE([...i.node.marks],t,e))return;let s=i.index,o=n.start()+i.offset,u=s+1,c=o+i.node.nodeSize;for(;s>0&&Sv([...n.parent.child(s-1).marks],t,e);)s-=1,o-=n.parent.child(s).nodeSize;for(;u<n.parent.childCount&&Sv([...n.parent.child(u).marks],t,e);)c+=n.parent.child(u).nodeSize,u+=1;return{from:o,to:c}}function si(n,t){if(typeof n==\"string\"){if(!t.marks[n])throw Error(`There is no mark type named '${n}'. Maybe you forgot to add the extension?`);return t.marks[n]}return n}const XO=(n,t)=>({tr:e,state:i,dispatch:s})=>{const o=si(n,i.schema),{doc:u,selection:c}=e,{$from:d,from:p,to:m}=c;if(s){const y=mc(d,o,t);if(y&&y.from<=p&&y.to>=m){const b=lt.create(u,y.from,y.to);e.setSelection(b)}}return!0},FO=n=>t=>{const e=typeof n==\"function\"?n(t):n;for(let i=0;i<e.length;i+=1)if(e[i](t))return!0;return!1};function iE(n){return n instanceof lt}function vr(n=0,t=0,e=0){return Math.min(Math.max(n,t),e)}function Zh(n,t=null){if(!t)return null;const e=dt.atStart(n),i=dt.atEnd(n);if(t===\"start\"||t===!0)return e;if(t===\"end\")return i;const s=e.from,o=i.to;return t===\"all\"?lt.create(n,vr(0,s,o),vr(n.content.size,s,o)):lt.create(n,vr(t,s,o),vr(t,s,o))}function Wh(){return[\"Android\"].includes(navigator.platform)||/android/i.test(navigator.userAgent)}function Ao(){return[\"iPad Simulator\",\"iPhone Simulator\",\"iPod Simulator\",\"iPad\",\"iPhone\",\"iPod\"].includes(navigator.platform)||navigator.userAgent.includes(\"Mac\")&&\"ontouchend\"in document}function QO(){return typeof navigator<\"u\"?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}const JO=(n=null,t={})=>({editor:e,view:i,tr:s,dispatch:o})=>{t={scrollIntoView:!0,...t};const u=()=>{(Ao()||Wh())&&i.dom.focus(),QO()&&!Ao()&&!Wh()&&i.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{e.isDestroyed||(i.focus(),t!=null&&t.scrollIntoView&&e.commands.scrollIntoView())})};try{if(i.hasFocus()&&n===null||n===!1)return!0}catch{return!1}if(o&&n===null&&!iE(e.state.selection))return u(),!0;const c=Zh(s.doc,n)||e.state.selection,d=e.state.selection.eq(c);return o&&(d||s.setSelection(c),d&&s.storedMarks&&s.setStoredMarks(s.storedMarks),u()),!0},ZO=(n,t)=>e=>n.every((i,s)=>t(i,{...e,index:s})),WO=(n,t)=>({tr:e,commands:i})=>i.insertContentAt({from:e.selection.from,to:e.selection.to},n,t),rE=n=>{const t=n.childNodes;for(let e=t.length-1;e>=0;e-=1){const i=t[e];i.nodeType===3&&i.nodeValue&&/^(\\n\\s\\s|\\n)$/.test(i.nodeValue)?n.removeChild(i):i.nodeType===1&&rE(i)}return n};function nu(n){if(typeof window>\"u\")throw new Error(\"[tiptap error]: there is no window object available, so this function cannot be used\");const t=`<body>${n}</body>`,e=new window.DOMParser().parseFromString(t,\"text/html\").body;return rE(e)}function sE(n){return typeof(n==null?void 0:n.nodesBetween)==\"function\"}function _s(n,t,e){if(sE(n))return n;const i=typeof n==\"object\"&&n!==null;e={slice:!0,parseOptions:{},...e};const s=typeof n==\"string\";if(i)try{if(Array.isArray(n)&&n.length>0)return j.fromArray(n.map(u=>t.nodeFromJSON(u)));const o=t.nodeFromJSON(n);return e.errorOnInvalidContent&&o.check(),o}catch(o){if(e.errorOnInvalidContent)throw new Error(\"[tiptap error]: Invalid JSON content\",{cause:o});return console.warn(\"[tiptap warn]: Invalid content.\",\"Passed value:\",n,\"Error:\",o),_s(\"\",t,e)}if(s){if(e.errorOnInvalidContent){let u=!1,c=\"\";const d=new hu({topNode:t.spec.topNode,marks:t.spec.marks,nodes:t.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:\"inline*\",group:\"block\",parseDOM:[{tag:\"*\",getAttrs:p=>(u=!0,c=typeof p==\"string\"?p:p.outerHTML,null)}]}})});if(e.slice?ro.fromSchema(d).parseSlice(nu(n),e.parseOptions):ro.fromSchema(d).parse(nu(n),e.parseOptions),e.errorOnInvalidContent&&u)throw new Error(\"[tiptap error]: Invalid HTML content\",{cause:new Error(`Invalid element found: ${c}`)})}const o=ro.fromSchema(t);return e.slice?o.parseSlice(nu(n),e.parseOptions).content:o.parse(nu(n),e.parseOptions)}return _s(\"\",t,e)}function lE(n){return!(\"type\"in n)}function oE(n,t,e){const i=n.steps.length-1;if(i<t)return;const s=n.steps[i];if(!(s instanceof Qt||s instanceof he))return;const o=n.mapping.maps[i];let u=0;o.forEach((c,d,p,m)=>{u===0&&(u=m)}),n.setSelection(dt.near(n.doc.resolve(u),e))}const tw=(n,t,e)=>({tr:i,dispatch:s,editor:o})=>{if(s){e={parseOptions:o.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...e};let c;const d=x=>{o.emit(\"contentError\",{editor:o,error:x,disableCollaboration:()=>{\"collaboration\"in o.storage&&typeof o.storage.collaboration==\"object\"&&o.storage.collaboration&&(o.storage.collaboration.isDisabled=!0)}})},p={preserveWhitespace:\"full\",...e.parseOptions};if(!e.errorOnInvalidContent&&!o.options.enableContentCheck&&o.options.emitContentError)try{_s(t,o.schema,{parseOptions:p,errorOnInvalidContent:!0})}catch(x){d(x)}try{var u;c=_s(t,o.schema,{parseOptions:p,errorOnInvalidContent:(u=e.errorOnInvalidContent)!==null&&u!==void 0?u:o.options.enableContentCheck})}catch(x){return d(x),!1}let{from:m,to:y}=typeof n==\"number\"?{from:n,to:n}:{from:n.from,to:n.to},b=!0,v=!0;const E=lE(c)?c.content:[c];if(E.forEach(x=>{x.check(),b=b?x.isText&&x.marks.length===0:!1,v=v?x.isBlock:!1}),m===y&&v){const{parent:x}=i.doc.resolve(m);x.isTextblock&&!x.type.spec.code&&!x.childCount&&(m-=1,y+=1)}let M;if(b)Array.isArray(t)?M=t.map(x=>x.text||\"\").join(\"\"):sE(t)?M=E.map(x=>{var O;return(O=x.text)!==null&&O!==void 0?O:\"\"}).join(\"\"):typeof t==\"object\"&&t&&t.text?M=t.text:M=t,i.insertText(M,m,y);else{M=j.from(E);const x=i.doc.resolve(m),O=x.node(),B=x.parentOffset===0,I=O.isText||O.isTextblock,q=O.content.size>0;B&&I&&q&&v&&(m=Math.max(0,m-1)),i.replaceWith(m,y,E)}e.updateSelection&&oE(i,i.steps.length-1,-1),e.applyInputRules&&i.setMeta(\"applyInputRules\",{from:m,text:M}),e.applyPasteRules&&i.setMeta(\"applyPasteRules\",{from:m,text:M})}return!0};function aE(n){for(let t=0;t<n.edgeCount;t+=1){const{type:e}=n.edge(t);if(e.isTextblock&&!e.hasRequiredAttrs())return e}return null}const ew=(n={})=>({tr:t,dispatch:e,editor:i})=>{const{pos:s,attrs:o,content:u,updateSelection:c=!0}=n;let d;typeof s==\"number\"?d=t.doc.resolve(s):s?d=s:d=t.selection.$from;const p=aE(d.parent.contentMatchAt(d.index()));if(!p)return!1;const m=Object.keys(p.spec.attrs||{}),y=o?Object.fromEntries(Object.entries(o).filter(([v])=>m.includes(v))):{};let b;if(u){const v=_s(u,i.schema);b=p.createAndFill(y,v)}else b=p.createAndFill(y);return b?(e&&(t.insert(d.pos,b),c&&oE(t,t.steps.length-1,-1)),!0):!1},nw=()=>({state:n,dispatch:t})=>mA(n,t),iw=()=>({state:n,dispatch:t})=>gA(n,t),rw=()=>({state:n,dispatch:t})=>eS(n,t),sw=()=>({state:n,dispatch:t})=>sS(n,t),uE=(n,t)=>{const e=n.resolve(t),i=e.nodeBefore,s=e.nodeAfter;return!i||!s?!1:!i.type.spec.isolating&&!s.type.spec.isolating},lw=()=>({state:n,dispatch:t,tr:e})=>{try{const i=ac(n.doc,n.selection.$from.pos,-1);return i==null||!uE(n.doc,i)?!1:(e.join(i,2),t&&t(e),!0)}catch{return!1}},ow=()=>({state:n,dispatch:t,tr:e})=>{try{const i=ac(n.doc,n.selection.$from.pos,1);return i==null||!uE(n.doc,i)?!1:(e.join(i,2),t&&t(e),!0)}catch{return!1}},aw=()=>({state:n,dispatch:t})=>hA(n,t),uw=()=>({state:n,dispatch:t})=>pA(n,t);function cE(){return typeof navigator<\"u\"?/Mac/.test(navigator.platform):!1}function cw(n){const t=n.split(/-(?!$)/);let e=t[t.length-1];e===\"Space\"&&(e=\" \");let i,s,o,u;for(let c=0;c<t.length-1;c+=1){const d=t[c];if(/^(cmd|meta|m)$/i.test(d))u=!0;else if(/^a(lt)?$/i.test(d))i=!0;else if(/^(c|ctrl|control)$/i.test(d))s=!0;else if(/^s(hift)?$/i.test(d))o=!0;else if(/^mod$/i.test(d))Ao()||cE()?u=!0:s=!0;else throw new Error(`Unrecognized modifier name: ${d}`)}return i&&(e=`Alt-${e}`),s&&(e=`Ctrl-${e}`),u&&(e=`Meta-${e}`),o&&(e=`Shift-${e}`),e}const fw=n=>({editor:t,view:e,tr:i,dispatch:s})=>{const o=cw(n).split(/-(?!$)/),u=o.find(p=>![\"Alt\",\"Ctrl\",\"Meta\",\"Shift\"].includes(p)),c=new KeyboardEvent(\"keydown\",{key:u===\"Space\"?\" \":u,altKey:o.includes(\"Alt\"),ctrlKey:o.includes(\"Ctrl\"),metaKey:o.includes(\"Meta\"),shiftKey:o.includes(\"Shift\"),bubbles:!0,cancelable:!0}),d=t.captureTransaction(()=>{e.someProp(\"handleKeyDown\",p=>p(e,c))});return d==null||d.steps.forEach(p=>{const m=p.map(i.mapping);m&&s&&i.maybeStep(m)}),!0};function ii(n,t,e={}){const{from:i,to:s,empty:o}=n.selection,u=t?ae(t,n.schema):null,c=[];n.doc.nodesBetween(i,s,(m,y)=>{if(m.isText)return;const b=Math.max(i,y),v=Math.min(s,y+m.nodeSize);c.push({node:m,from:b,to:v})});const d=s-i,p=c.filter(m=>u?u.name===m.node.type.name:!0).filter(m=>wu(m.node.attrs,e,{strict:!1}));return o?!!p.length:p.reduce((m,y)=>m+y.to-y.from,0)>=d}const dw=(n,t={})=>({state:e,dispatch:i})=>ii(e,ae(n,e.schema),t)?yA(e,i):!1,hw=()=>({state:n,dispatch:t})=>uS(n,t),pw=n=>({state:t,dispatch:e})=>{const i=ae(n,t.schema);return wA(i)(t,e)},mw=()=>({state:n,dispatch:t})=>oS(n,t);function gc(n,t){return t.nodes[n]?\"node\":t.marks[n]?\"mark\":null}function Ev(n,t){const e=typeof t==\"string\"?[t]:t;return Object.keys(n).reduce((i,s)=>(e.includes(s)||(i[s]=n[s]),i),{})}const gw=(n,t)=>({tr:e,state:i,dispatch:s})=>{let o=null,u=null;const c=gc(typeof n==\"string\"?n:n.name,i.schema);if(!c)return!1;c===\"node\"&&(o=ae(n,i.schema)),c===\"mark\"&&(u=si(n,i.schema));let d=!1;return e.selection.ranges.forEach(p=>{i.doc.nodesBetween(p.$from.pos,p.$to.pos,(m,y)=>{o&&o===m.type&&(d=!0,s&&e.setNodeMarkup(y,void 0,Ev(m.attrs,t))),u&&m.marks.length&&m.marks.forEach(b=>{u===b.type&&(d=!0,s&&e.addMark(y,y+m.nodeSize,u.create(Ev(b.attrs,t))))})})}),d},yw=()=>({tr:n,dispatch:t})=>(t&&n.scrollIntoView(),!0),bw=()=>({tr:n,dispatch:t})=>{if(t){const e=new Ze(n.doc);n.setSelection(e)}return!0},vw=()=>({state:n,dispatch:t})=>iS(n,t),Sw=()=>({state:n,dispatch:t})=>lS(n,t),Ew=()=>({state:n,dispatch:t})=>EA(n,t),Tw=()=>({state:n,dispatch:t})=>MA(n,t),xw=()=>({state:n,dispatch:t})=>xA(n,t);function tp(n,t,e={},i={}){return _s(n,t,{slice:!1,parseOptions:e,errorOnInvalidContent:i.errorOnInvalidContent})}const Mw=(n,{errorOnInvalidContent:t,emitUpdate:e=!0,parseOptions:i={}}={})=>({editor:s,tr:o,dispatch:u,commands:c})=>{const{doc:d}=o;if(i.preserveWhitespace!==\"full\"){const p=tp(n,s.schema,i,{errorOnInvalidContent:t??s.options.enableContentCheck});if(u){const m=lE(p)?p.content:[p];o.replaceWith(0,d.content.size,m).setMeta(\"preventUpdate\",!e)}return!0}return u&&o.setMeta(\"preventUpdate\",!e),c.insertContentAt({from:0,to:d.content.size},n,{parseOptions:i,errorOnInvalidContent:t??s.options.enableContentCheck})};function fE(n,t){const e=si(t,n.schema),{from:i,to:s,empty:o}=n.selection,u=[];o?(n.storedMarks&&u.push(...n.storedMarks),u.push(...n.selection.$head.marks())):n.doc.nodesBetween(i,s,d=>{u.push(...d.marks)});const c=u.find(d=>d.type.name===e.name);return c?{...c.attrs}:{}}function dE(n,t){const e=new X1(n);return t.forEach(i=>{i.steps.forEach(s=>{e.step(s)})}),e}function kw(n,t,e){const i=[];return n.nodesBetween(t.from,t.to,(s,o)=>{e(s)&&i.push({node:s,pos:o})}),i}function Aw(n,t){for(let e=n.depth;e>0;e-=1){const i=n.node(e);if(t(i))return{pos:e>0?n.before(e):0,start:n.start(e),depth:e,node:i}}}function yc(n){return t=>Aw(t.$from,n)}function J(n,t,e){return n.config[t]===void 0&&n.parent?J(n.parent,t,e):typeof n.config[t]==\"function\"?n.config[t].bind({...e,parent:n.parent?J(n.parent,t,e):null}):n.config[t]}function zp(n){return n.map(t=>{const e=J(t,\"addExtensions\",{name:t.name,options:t.options,storage:t.storage});return e?[t,...zp(e())]:t}).flat(10)}function Bp(n,t){const e=Rr.fromSchema(t).serializeFragment(n),i=document.implementation.createHTMLDocument().createElement(\"div\");return i.appendChild(e),i.innerHTML}function hE(n,t){const e=new Map;for(const s of n){var i;const o=(i=e.get(s.type))!==null&&i!==void 0?i:new Map;o.set(s.name,s),e.set(s.type,o)}return[...Object.values(t.nodes),...Object.values(t.marks)].flatMap(s=>{var o;return Object.entries((o=s.spec.attrs)!==null&&o!==void 0?o:{}).map(([u,c])=>{var d;const p=(d=e.get(s.name))===null||d===void 0?void 0:d.get(u),m=Object.hasOwn(c,\"default\");return{type:s.name,name:u,attribute:{rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,...p==null?void 0:p.attribute,default:c.default,isRequired:!m,validate:c.validate}}})})}const Cw={content:\"string\",marks:\"string\",group:\"string\",inline:\"boolean\",atom:\"boolean\",selectable:\"boolean\",draggable:\"boolean\",code:\"boolean\",whitespace:[\"pre\",\"normal\"],definingAsContext:\"boolean\",definingForContent:\"boolean\",defining:\"boolean\",isolating:\"boolean\",linebreakReplacement:\"boolean\"},Ow={inclusive:\"boolean\",excludes:\"string\",group:\"string\",spanning:\"boolean\",code:\"boolean\"};function ww(n,t,e){return Object.fromEntries(Object.entries(t).flatMap(([i,s])=>{const o=n[i];if(o===void 0)return[];if(!(typeof s==\"string\"?typeof o===s:typeof o==\"string\"&&s.includes(o)))throw new RangeError(`Invalid schemaSpec field '${e}.${i}'`);return[[i,o]]}))}function Tv(n,t,e,i){return{...Object.fromEntries(Object.entries(t).filter(([s])=>s!==\"attrs\"&&!Object.hasOwn(i,s))),...ww(e,i,n),attrs:e.attrs}}function xv(n,t,e){for(const i of Object.keys(t))if(!Object.hasOwn(n,i))throw new RangeError(`schemaSpec requires a local ${e} extension named '${i}'`);for(const i of Object.keys(n))if(!Object.hasOwn(t,i))throw new RangeError(`Local ${e} extension '${i}' is not in schemaSpec`)}function Nw(n,t){xv(n.nodes,t.nodes,\"node\"),xv(n.marks,t.marks,\"mark\");let e=t.spec.nodes,i=t.spec.marks;return t.spec.nodes.forEach((s,o)=>{e=e.update(s,Tv(s,n.nodes[s],o,Cw))}),t.spec.marks.forEach((s,o)=>{i=i.update(s,Tv(s,n.marks[s],o,Ow))}),{topNode:t.topNodeType.name,nodes:e,marks:i}}function pE(n){const t=n.filter((e,i)=>n.indexOf(e)!==i);return Array.from(new Set(t))}function Us(n){return{baseExtensions:n.filter(t=>t.type===\"extension\"),nodeExtensions:n.filter(t=>t.type===\"node\"),markExtensions:n.filter(t=>t.type===\"mark\")}}function Hp(n){const t=[],{nodeExtensions:e,markExtensions:i}=Us(n),s=[...e,...i],o={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},u=e.filter(p=>p.name!==\"text\").map(p=>p.name),c=i.map(p=>p.name),d=[...u,...c];return n.forEach(p=>{const m=J(p,\"addGlobalAttributes\",{name:p.name,options:p.options,storage:p.storage,extensions:s});m&&m().forEach(y=>{let b;Array.isArray(y.types)?b=y.types:y.types===\"*\"?b=d:y.types===\"nodes\"?b=u:y.types===\"marks\"?b=c:b=[],b.forEach(v=>{Object.entries(y.attributes).forEach(([E,M])=>{t.push({type:v,name:E,attribute:{...o,...M}})})})})}),s.forEach(p=>{const m=J(p,\"addAttributes\",{name:p.name,options:p.options,storage:p.storage});if(!m)return;const y=m();Object.entries(y).forEach(([b,v])=>{const E={...o,...v};typeof(E==null?void 0:E.default)==\"function\"&&(E.default=E.default()),E!=null&&E.isRequired&&(E==null?void 0:E.default)===void 0&&delete E.default,t.push({type:p.name,name:b,attribute:E})})}),t}function ep(n){return typeof n==\"function\"}function Ot(n,t=void 0,...e){return ep(n)?t?n.bind(t)(...e):n(...e):n}function Dw(n={}){return Object.keys(n).length===0&&n.constructor===Object}function Rw(n){const t=[];let e=\"\",i=!1,s=!1,o=0;const u=n.length;for(let c=0;c<u;c+=1){const d=n[c];if(d===\"'\"&&!s){i=!i,e+=d;continue}if(d==='\"'&&!i){s=!s,e+=d;continue}if(!i&&!s){if(d===\"(\"){o+=1,e+=d;continue}if(d===\")\"&&o>0){o-=1,e+=d;continue}if(d===\";\"&&o===0){t.push(e),e=\"\";continue}}e+=d}return e&&t.push(e),t}function Mv(n){const t=[],e=Rw(n||\"\"),i=e.length;for(let s=0;s<i;s+=1){const o=e[s],u=o.indexOf(\":\");if(u===-1)continue;const c=o.slice(0,u).trim(),d=o.slice(u+1).trim();c&&d&&t.push([c,d])}return t}function Vt(...n){return n.filter(t=>!!t).reduce((t,e)=>{const i={...t};return Object.entries(e).forEach(([s,o])=>{if(s===\"__proto__\"){Object.defineProperty(i,s,{configurable:!0,enumerable:!0,value:o,writable:!0});return}if(!i[s]){i[s]=o;return}if(s===\"class\"){const u=o?String(o).split(\" \"):[],c=i[s]?i[s].split(\" \"):[],d=u.filter(p=>!c.includes(p));i[s]=[...c,...d].join(\" \")}else if(s===\"style\"){const u=new Map([...Mv(i[s]),...Mv(o)]);i[s]=Array.from(u.entries()).map(([c,d])=>`${c}: ${d}`).join(\"; \")}else i[s]=o}),i},{})}function Is(n,t){return t.filter(e=>e.type===n.type.name).filter(e=>e.attribute.rendered).map(e=>e.attribute.renderHTML?e.attribute.renderHTML(n.attrs)||{}:{[e.name]:n.attrs[e.name]}).reduce((e,i)=>Vt(e,i),{})}function Lw(n){return typeof n!=\"string\"?n:n.match(/^[+-]?(?:\\d*\\.)?\\d+$/)?Number(n):n===\"true\"?!0:n===\"false\"?!1:n}function kv(n,t){return\"style\"in n?n:{...n,getAttrs:e=>{const i=n.getAttrs?n.getAttrs(e):n.attrs;if(i===!1)return!1;const s=t.reduce((o,u)=>{const c=u.attribute.parseHTML?u.attribute.parseHTML(e):Lw(e.getAttribute(u.name));return c==null?o:{...o,[u.name]:c}},{});return{...i,...s}}}}function Av(n){return Object.fromEntries(Object.entries(n).filter(([t,e])=>t===\"attrs\"&&Dw(e)?!1:e!=null))}function Cv(n){var t,e;const i={};return!(!(n==null||(t=n.attribute)===null||t===void 0)&&t.isRequired)&&\"default\"in((n==null?void 0:n.attribute)||{})&&(i.default=n.attribute.default),(n==null||(e=n.attribute)===null||e===void 0?void 0:e.validate)!==void 0&&(i.validate=n.attribute.validate),[n.name,i]}function Ov(n,t,e=Hp(n)){var i;const{nodeExtensions:s,markExtensions:o}=Us(n);return{topNode:(i=s.find(u=>J(u,\"topNode\")))===null||i===void 0?void 0:i.name,nodes:Object.fromEntries(s.map(u=>{const c=e.filter(v=>v.type===u.name),d={name:u.name,options:u.options,storage:u.storage,editor:t},p=Av({...n.reduce((v,E)=>{const M=J(E,\"extendNodeSchema\",d);return{...v,...M?M(u):{}}},{}),content:Ot(J(u,\"content\",d)),marks:Ot(J(u,\"marks\",d)),group:Ot(J(u,\"group\",d)),inline:Ot(J(u,\"inline\",d)),atom:Ot(J(u,\"atom\",d)),selectable:Ot(J(u,\"selectable\",d)),draggable:Ot(J(u,\"draggable\",d)),code:Ot(J(u,\"code\",d)),whitespace:Ot(J(u,\"whitespace\",d)),linebreakReplacement:Ot(J(u,\"linebreakReplacement\",d)),defining:Ot(J(u,\"defining\",d)),isolating:Ot(J(u,\"isolating\",d)),attrs:Object.fromEntries(c.map(Cv))}),m=Ot(J(u,\"parseHTML\",d));m&&(p.parseDOM=m.map(v=>kv(v,c)));const y=J(u,\"renderHTML\",d);y&&(p.toDOM=v=>y({node:v,HTMLAttributes:Is(v,c)}));const b=J(u,\"renderText\",d);return b&&(p.toText=b),[u.name,p]})),marks:Object.fromEntries(o.map(u=>{const c=e.filter(b=>b.type===u.name),d={name:u.name,options:u.options,storage:u.storage,editor:t},p=Av({...n.reduce((b,v)=>{const E=J(v,\"extendMarkSchema\",d);return{...b,...E?E(u):{}}},{}),inclusive:Ot(J(u,\"inclusive\",d)),excludes:Ot(J(u,\"excludes\",d)),group:Ot(J(u,\"group\",d)),spanning:Ot(J(u,\"spanning\",d)),code:Ot(J(u,\"code\",d)),attrs:Object.fromEntries(c.map(Cv))}),m=Ot(J(u,\"parseHTML\",d));m&&(p.parseDOM=m.map(b=>kv(b,c)));const y=J(u,\"renderHTML\",d);return y&&(p.toDOM=b=>y({mark:b,HTMLAttributes:Is(b,c)})),[u.name,p]}))}}function zw(n,t,e){if(e===void 0)return new hu(Ov(n,t));const i=pE(n.filter(u=>u.type!==\"extension\").map(u=>u.name));if(i.length)throw new RangeError(`Duplicate local schema types: ${i.join(\", \")}`);const s=new hu(e),o=Ov(n,t,hE(Hp(n),s));return new hu(Nw(o,s))}function ao(n){return n.sort((e,i)=>{const s=J(e,\"priority\")||100,o=J(i,\"priority\")||100;return s>o?-1:s<o?1:0})}function mE(n){const t=ao(zp(n)),e=pE(t.map(i=>i.name));return e.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${e.map(i=>`'${i}'`).join(\", \")}]. This can lead to issues.`),t}function gE(n,t,e){const{from:i,to:s}=t,{blockSeparator:o=`\n\n`,textSerializers:u={}}=e||{};let c=\"\";return n.nodesBetween(i,s,(d,p,m,y)=>{d.isBlock&&p>i&&(c+=o);const b=u==null?void 0:u[d.type.name];if(b)return m&&(c+=b({node:d,pos:p,parent:m,index:y,range:t})),!1;if(d.isText){var v;c+=d==null||(v=d.text)===null||v===void 0?void 0:v.slice(Math.max(i,p)-p,s-p)}}),c}function Bw(n,t){return gE(n,{from:0,to:n.content.size},t)}function yE(n){return Object.fromEntries(Object.entries(n.nodes).filter(([,t])=>t.spec.toText).map(([t,e])=>[t,e.spec.toText]))}function Hw(n,t){const e=ae(t,n.schema),{from:i,to:s}=n.selection,o=[];n.doc.nodesBetween(i,s,c=>{o.push(c)});const u=o.reverse().find(c=>c.type.name===e.name);return u?{...u.attrs}:{}}function bE(n,t){const e=gc(typeof t==\"string\"?t:t.name,n.schema);return e===\"node\"?Hw(n,t):e===\"mark\"?fE(n,t):{}}function _w(n,t=JSON.stringify){const e={};return n.filter(i=>{const s=t(i);return Object.prototype.hasOwnProperty.call(e,s)?!1:e[s]=!0})}function Uw(n){const t=_w(n);return t.length===1?t:t.filter((e,i)=>!t.filter((s,o)=>o!==i).some(s=>e.oldRange.from>=s.oldRange.from&&e.oldRange.to<=s.oldRange.to&&e.newRange.from>=s.newRange.from&&e.newRange.to<=s.newRange.to))}function bc(n){const{mapping:t,steps:e}=n,i=[];return t.maps.forEach((s,o)=>{const u=[];if(s.ranges.length)s.forEach((c,d)=>{u.push({from:c,to:d})});else{const{from:c,to:d}=e[o];if(c===void 0||d===void 0)return;u.push({from:c,to:d})}u.forEach(({from:c,to:d})=>{const p=t.slice(o).map(c,-1),m=t.slice(o).map(d),y=t.invert().map(p,-1),b=t.invert().map(m);i.push({oldRange:{from:y,to:b},newRange:{from:p,to:m}})})}),Uw(i)}function vc(n,t,e){const i=[];return n===t?e.resolve(n).marks().forEach(s=>{const o=mc(e.resolve(n),s.type);o&&i.push({mark:s,...o})}):e.nodesBetween(n,t,(s,o)=>{!s||(s==null?void 0:s.nodeSize)===void 0||i.push(...s.marks.map(u=>({from:o,to:o+s.nodeSize,mark:u})))}),i}const Iw=(n,t,e,i=20)=>{const s=n.doc.resolve(e);let o=i,u=null;for(;o>0&&u===null;){const c=s.node(o);(c==null?void 0:c.type.name)===t?u=c:o-=1}return[u,o]},jw=n=>{const t=n.depth-1;if(t<0)return null;const e=n.index(t);return e===0?null:n.node(t).child(e-1)};function Ts(n,t){return t.nodes[n]||t.marks[n]||null}function yu(n,t,e){return Object.fromEntries(Object.entries(e).filter(([i])=>{const s=n.find(o=>o.type===t&&o.name===i);return s?s.attribute.keepOnSplit:!1}))}const qw=(n,t=500)=>{let e=\"\";const i=n.parentOffset;return n.parent.nodesBetween(Math.max(0,i-t),i,(s,o,u,c)=>{var d,p;const m=((d=(p=s.type.spec).toText)===null||d===void 0?void 0:d.call(p,{node:s,pos:o,parent:u,index:c}))||s.textContent||\"%leaf%\";e+=s.isAtom&&!s.isText?m:m.slice(0,Math.max(0,i-o))}),e};function np(n,t,e={}){const{empty:i,ranges:s}=n.selection,o=t?si(t,n.schema):null;if(i)return!!(n.storedMarks||n.selection.$from.marks()).filter(m=>o?o.name===m.type.name:!0).find(m=>wu(m.attrs,e,{strict:!1}));let u=0;const c=[];if(s.forEach(({$from:m,$to:y})=>{const b=m.pos,v=y.pos;n.doc.nodesBetween(b,v,(E,M)=>{if(o&&E.inlineContent&&!E.type.allowsMarkType(o))return!1;if(!E.isText&&!E.marks.length)return;const x=Math.max(b,M),O=Math.min(v,M+E.nodeSize),B=O-x;u+=B,c.push(...E.marks.map(I=>({mark:I,from:x,to:O})))})}),u===0)return!1;const d=c.filter(m=>o?o.name===m.mark.type.name:!0).filter(m=>wu(m.mark.attrs,e,{strict:!1})).reduce((m,y)=>m+y.to-y.from,0),p=c.filter(m=>o?m.mark.type!==o&&m.mark.type.excludes(o):!0).reduce((m,y)=>m+y.to-y.from,0);return(d>0?d+p:d)>=u}function Vw(n,t,e={}){if(!t)return ii(n,null,e)||np(n,null,e);const i=gc(t,n.schema);return i===\"node\"?ii(n,t,e):i===\"mark\"?np(n,t,e):!1}const $w=(n,t)=>{const{$from:e,$to:i,$anchor:s}=n.selection;if(t){const o=yc(c=>c.type.name===t)(n.selection);if(!o)return!1;const u=n.doc.resolve(o.pos+1);return s.pos+1===u.end()}return!(i.parentOffset<i.parent.nodeSize-2||e.pos!==i.pos)},Pw=n=>{const{$from:t,$to:e}=n.selection;return!(t.parentOffset>0||t.pos!==e.pos)};function wv(n,t){return Array.isArray(t)?t.some(e=>(typeof e==\"string\"?e:e.name)===n.name):t}function Kl(n,t){const{nodeExtensions:e}=Us(t),i=e.find(o=>o.name===n);if(!i)return!1;const s=Ot(J(i,\"group\",{name:i.name,options:i.options,storage:i.storage}));return typeof s!=\"string\"?!1:s.split(\" \").includes(\"list\")}function zo(n,{checkChildren:t=!0,ignoreWhitespace:e=!1}={}){if(e){if(n.type.name===\"hardBreak\")return!0;if(n.isText){var i;return!/\\S/.test((i=n.text)!==null&&i!==void 0?i:\"\")}}if(n.isText)return!n.text;if(n.isAtom||n.isLeaf)return!1;if(n.content.childCount===0)return!0;if(t){let s=!0;return n.content.forEach(o=>{s!==!1&&(zo(o,{ignoreWhitespace:e,checkChildren:t})||(s=!1))}),s}return!1}function Kw(n){return n instanceof rt}function Gw(n){if(n===null||typeof n!=\"object\")return!1;const t=n;return!(typeof t.apply!=\"function\"||typeof t.getMap!=\"function\"||typeof t.invert!=\"function\"||typeof t.map!=\"function\"||typeof t.merge!=\"function\"||typeof t.toJSON!=\"function\")}function Yw(n){if(n===null||typeof n!=\"object\")return!1;const t=n;if(!Gw(t))return!1;const e=t.toJSON();return!(e===null||typeof e!=\"object\"||e.stepType!==\"replace\")}var vE=class SE{constructor(t){this.position=t}static fromJSON(t){return new SE(t.position)}toJSON(){return{position:this.position}}};function Xw(n,t){const e=t.mapping.mapResult(n.position);return{position:new vE(e.pos),mapResult:e}}function Fw(n){return new vE(n)}function Qw(n,t,e){const{selection:i}=t;let s=null;if(iE(i)&&(s=i.$cursor),s){var o;const c=(o=n.storedMarks)!==null&&o!==void 0?o:s.marks();return s.parent.type.allowsMarkType(e)&&(!!e.isInSet(c)||!c.some(d=>d.type.excludes(e)))}const{ranges:u}=i;return u.some(({$from:c,$to:d})=>{let p=c.depth===0?n.doc.inlineContent&&n.doc.type.allowsMarkType(e):!1;return n.doc.nodesBetween(c.pos,d.pos,(m,y,b)=>{if(p)return!1;if(m.isInline){const v=!b||b.type.allowsMarkType(e),E=!!e.isInSet(m.marks)||!m.marks.some(M=>M.type.excludes(e));p=v&&E}return!p}),p})}const Jw=(n,t={})=>({tr:e,state:i,dispatch:s})=>{const{selection:o}=e,{empty:u,ranges:c}=o,d=si(n,i.schema);if(s)if(u){const p=fE(i,d);e.addStoredMark(d.create({...p,...t}))}else c.forEach(p=>{const m=p.$from.pos,y=p.$to.pos;i.doc.nodesBetween(m,y,(b,v)=>{const E=Math.max(v,m),M=Math.min(v+b.nodeSize,y);b.marks.find(x=>x.type===d)?b.marks.forEach(x=>{d===x.type&&e.addMark(E,M,d.create({...x.attrs,...t}))}):e.addMark(E,M,d.create(t))})});return Qw(i,e,d)},Zw=(n,t)=>({tr:e})=>(e.setMeta(n,t),!0),Ww=(n,t={})=>({state:e,dispatch:i,chain:s})=>{const o=ae(n,e.schema);let u;return e.selection.$anchor.sameParent(e.selection.$head)&&(u=e.selection.$anchor.parent.attrs),o.isTextblock?s().command(({commands:c})=>jb(o,{...u,...t})(e)?!0:c.clearNodes()).command(({state:c})=>jb(o,{...u,...t})(c,i)).run():(console.warn('[tiptap warn]: Currently \"setNode()\" only supports text block nodes.'),!1)},tN=n=>({tr:t,dispatch:e})=>{if(e){const{doc:i}=t,s=vr(n,0,i.content.size),o=rt.create(i,s);t.setSelection(o)}return!0},eN=(n,t)=>({tr:e,state:i,dispatch:s})=>{const{selection:o}=i;let u,c;return typeof t==\"number\"?(u=t,c=t):t&&\"from\"in t&&\"to\"in t?(u=t.from,c=t.to):(u=o.from,c=o.to),s&&e.doc.nodesBetween(u,c,(d,p)=>{d.isText||e.setNodeMarkup(p,void 0,{...d.attrs,dir:n})}),!0},nN=n=>({tr:t,dispatch:e})=>{if(e){const{doc:i}=t,{from:s,to:o}=typeof n==\"number\"?{from:n,to:n}:n,u=lt.atStart(i).from,c=lt.atEnd(i).to,d=vr(s,u,c),p=vr(o,u,c),m=lt.create(i,d,p);t.setSelection(m)}return!0},iN=n=>({state:t,dispatch:e})=>{const i=ae(n,t.schema);return RA(i)(t,e)};function Nv(n,t){const e=n.storedMarks||n.selection.$to.parentOffset&&n.selection.$from.marks();if(e){const i=e.filter(s=>t==null?void 0:t.includes(s.type.name));n.tr.ensureMarks(i)}}const rN=({keepMarks:n=!0}={})=>({tr:t,state:e,dispatch:i,editor:s})=>{const{selection:o,doc:u}=t,{$from:c,$to:d}=o,p=s.extensionManager.attributes,m=yu(p,c.node().type.name,c.node().attrs);if(o instanceof rt&&o.node.isBlock)return!c.parentOffset||!ei(u,c.pos)?!1:(i&&(n&&Nv(e,s.extensionManager.splittableMarks),t.split(c.pos).scrollIntoView()),!0);if(!c.parent.isBlock)return!1;const y=d.parentOffset===d.parent.content.size,b=c.depth===0?void 0:aE(c.node(-1).contentMatchAt(c.indexAfter(-1)));let v=y&&b?[{type:b,attrs:m}]:void 0;const E=o instanceof lt&&!o.empty?Zn.create({doc:t.doc,selection:o}).tr.deleteSelection():null,M=E?E.doc:t.doc,x=E?E.mapping.map(c.pos):c.pos;let O=ei(M,x,1,v);if(!v&&!O&&ei(M,x,1,b?[{type:b}]:void 0)&&(O=!0,v=b?[{type:b,attrs:m}]:void 0),i){if(O){const B=t.steps.length;if(o instanceof lt&&t.deleteSelection(),t.split(t.mapping.slice(B).map(c.pos),1,v),b&&!y&&!c.parentOffset&&c.parent.type!==b){const I=t.mapping.slice(B).map(c.before()),q=t.doc.resolve(I);c.node(-1).canReplaceWith(q.index(),q.index()+1,b)&&t.setNodeMarkup(t.mapping.slice(B).map(c.before()),b)}}n&&Nv(e,s.extensionManager.splittableMarks),t.scrollIntoView()}return O},sN=(n,t={})=>({tr:e,state:i,dispatch:s,editor:o})=>{const u=ae(n,i.schema),{$from:c,$to:d}=i.selection,p=i.selection.node;if(p&&p.isBlock||c.depth<2||!c.sameParent(d))return!1;const m=c.node(-1);if(m.type!==u)return!1;const y=o.extensionManager.attributes;if(c.parent.content.size===0&&c.node(-1).childCount===c.indexAfter(-1)){if(c.depth===2||c.node(-3).type!==u||c.index(-2)!==c.node(-2).childCount-1)return!1;if(s){var b;let q=j.empty;const P=c.index(-1)?1:c.index(-2)?2:3;for(let $t=c.depth-P;$t>=c.depth-3;$t-=1)q=j.from(c.node($t).copy(q));const et=c.indexAfter(-1)<c.node(-2).childCount?1:c.indexAfter(-2)<c.node(-3).childCount?2:3,Y={...yu(y,c.node().type.name,c.node().attrs),...t},nt=((b=u.contentMatch.defaultType)===null||b===void 0?void 0:b.createAndFill(Y))||void 0;q=q.append(j.from(u.createAndFill(null,nt)||void 0));const ct=c.before(c.depth-(P-1));e.replace(ct,c.after(-et),new X(q,4-P,0));let Et=-1;e.doc.nodesBetween(ct,e.doc.content.size,($t,Dt)=>{if(Et>-1)return!1;$t.isTextblock&&$t.content.size===0&&(Et=Dt+1)}),Et>-1&&e.setSelection(lt.near(e.doc.resolve(Et))),e.scrollIntoView()}return!0}const v=d.pos===c.end()?m.contentMatchAt(0).defaultType:null,E={...yu(y,m.type.name,m.attrs),...t},M={...yu(y,c.node().type.name,c.node().attrs),...t},x=c.parentOffset===0&&c.index(-1)===0,O=c.before(-1);e.delete(c.pos,d.pos);const B=x?m.attrs:E,I=v?[{type:u,attrs:B},{type:v,attrs:M}]:[{type:u,attrs:B}];if(!ei(e.doc,c.pos,2))return!1;if(s){const{selection:q,storedMarks:P}=i,{splittableMarks:et}=o.extensionManager,Y=P||q.$to.parentOffset&&q.$from.marks();if(e.split(c.pos,2,I).scrollIntoView(),x&&e.setNodeMarkup(O,void 0,E),!Y||!s)return!0;const nt=Y.filter(ct=>et.includes(ct.type.name));e.ensureMarks(nt)}return!0};function EE(n,t,e){if(!n.validContent(t))return null;try{return n.create(e,t)}catch{return null}}function _p(n,t){if(n.pendingContent.length===0)return!0;const e=EE(t,j.from(n.pendingContent));return e?(n.items.push(e),n.pendingContent=[],!0):!1}function lN(n,t,e){return e.validContent(j.from([...t.pendingContent,n]))?(t.pendingContent.push(n),!0):!_p(t,e)||!e.validContent(j.from(n))?!1:(t.pendingContent.push(n),!0)}function oN(n,t,e,i){const s=i(n,e);if(!s)return!1;const o=EE(e.listType,j.from(s),n.attrs);return o?e.itemType.validContent(j.from([...t.pendingContent,o]))?(t.pendingContent.push(o),!0):_p(t,e.itemType)?(t.items.push(...s),!0):!1:!1}function aN(n,t,e){const i={items:[],pendingContent:[]};for(let s=0;s<n.childCount;s+=1){const o=n.child(s);if(!(t.isListNode(o)?oN(o,i,t,e):lN(o,i,t.itemType)))return null}return _p(i,t.itemType)?i.items:null}function TE(n,t){const e=[];for(let i=0;i<n.childCount;i+=1){const s=aN(n.child(i),t,TE);if(!s)return null;e.push(...s)}return e}function Dv(n,t){let e=null;return n.descendants((i,s)=>i!==t?!0:(e=s,!1)),e}function Rv(n){return!n||n===\"1\"?null:n}function xE(n,t){return Rv(n)===Rv(t)}const iu=(n,t)=>{const e=yc(o=>o.type===t)(n.selection);if(!e)return!0;const i=n.doc.resolve(Math.max(0,e.pos-1)).before(e.depth);if(i===void 0)return!0;const s=n.doc.nodeAt(i);return!(e.node.type===(s==null?void 0:s.type)&&Yi(n.doc,e.pos))||!xE(e.node.attrs.type,s==null?void 0:s.attrs.type)||n.join(e.pos),!0},ru=(n,t)=>{const e=yc(o=>o.type===t)(n.selection);if(!e)return!0;const i=n.doc.resolve(e.start).after(e.depth);if(i===void 0)return!0;const s=n.doc.nodeAt(i);return!(e.node.type===(s==null?void 0:s.type)&&Yi(n.doc,i))||!xE(e.node.attrs.type,s==null?void 0:s.attrs.type)||n.join(i),!0};function uN(n){const t=n.doc,e=t.firstChild;if(!e)return null;const i=t.resolve(1),s=t.resolve(e.nodeSize-1);return lt.between(i,s)}const cN=(n,t,e,i={})=>({editor:s,tr:o,state:u,dispatch:c,chain:d,commands:p,can:m})=>{const{extensions:y,splittableMarks:b}=s.extensionManager,v=ae(n,u.schema),E=ae(t,u.schema),{selection:M,storedMarks:x}=u,{$from:O,$to:B}=M,I=O.blockRange(B),q=x||M.$to.parentOffset&&M.$from.marks();if(!I)return!1;const P=yc(Mt=>Kl(Mt.type.name,y))(M),et=M.from===0&&M.to===u.doc.content.size,Y=u.doc.content.content,nt=Y.length===1?Y[0]:null,ct=et&&nt&&Kl(nt.type.name,y)?{node:nt,pos:0}:null,Et=P??ct,$t=!!P&&I.depth>=1&&I.depth-P.depth<=1,Dt=!!ct;if(($t||Dt)&&Et){if(Et.node.type===v)return et&&Dt?d().command(({tr:Mt,dispatch:gt})=>{const z=uN(Mt);return z?(Mt.setSelection(z),gt&>(Mt),!0):!1}).liftListItem(E).run():p.liftListItem(E);if(Kl(Et.node.type.name,y)&&v.validContent(Et.node.content))return d().command(()=>(o.setNodeMarkup(Et.pos,v),!0)).command(()=>iu(o,v)).command(()=>ru(o,v)).run();if(Kl(Et.node.type.name,y)){var vt;const Mt=(vt=Et.node.firstChild)===null||vt===void 0?void 0:vt.type;if(Mt&&Mt!==E){const gt=TE(Et.node,{listType:v,itemType:E,isListNode:G=>Kl(G.type.name,y)}),z=gt?j.from(gt):null;return!z||!v.validContent(z)?!1:d().command(()=>{const{$anchor:G,$head:it}=o.selection,Ct=G.parent,A=it.parent,V=G.parentOffset,F=it.parentOffset;let K;try{K=v.create(i,z)}catch{return!1}if(o.replaceWith(Et.pos,Et.pos+Et.node.nodeSize,K),Ct.inlineContent&&A.inlineContent){const W=Dv(K,Ct),St=Dv(K,A);if(W!==null&&St!==null){const ut=Et.pos+W+2+V,De=Et.pos+St+2+F;o.setSelection(lt.create(o.doc,ut,De))}}return!0}).command(()=>iu(o,v)).command(()=>ru(o,v)).run()}}}return!e||!q||!c?d().command(()=>m().wrapInList(v,i)?!0:p.clearNodes()).wrapInList(v,i).command(()=>iu(o,v)).command(()=>ru(o,v)).run():d().command(()=>{const Mt=m().wrapInList(v,i),gt=q.filter(z=>b.includes(z.type.name));return o.ensureMarks(gt),Mt?!0:p.clearNodes()}).wrapInList(v,i).command(()=>iu(o,v)).command(()=>ru(o,v)).run()},fN=(n,t={},e={})=>({state:i,commands:s})=>{const{extendEmptyMarkRange:o=!1}=e,u=si(n,i.schema);return np(i,u,t)?s.unsetMark(u,{extendEmptyMarkRange:o}):s.setMark(u,t)},dN=(n,t,e={})=>({state:i,commands:s})=>{const o=ae(n,i.schema),u=ae(t,i.schema),c=ii(i,o,e);let d;return i.selection.$anchor.sameParent(i.selection.$head)&&(d=i.selection.$anchor.parent.attrs),c?s.setNode(u,d):s.setNode(o,{...d,...e})},hN=(n,t={})=>({state:e,commands:i})=>{const s=ae(n,e.schema);return ii(e,s,t)?i.lift(s):i.wrapIn(s,t)},pN=()=>({state:n,dispatch:t})=>{const e=n.plugins;for(let i=0;i<e.length;i+=1){const s=e[i];let o;if(s.spec.isInputRules&&(o=s.getState(n))){if(t){const u=n.tr,c=o.transform;for(let d=c.steps.length-1;d>=0;d-=1)u.step(c.steps[d].invert(c.docs[d]));if(o.text){const d=u.doc.resolve(o.from).marks();u.replaceWith(o.from,o.to,n.schema.text(o.text,d))}else u.delete(o.from,o.to)}return!0}}return!1},mN=(n={})=>({tr:t,dispatch:e,editor:i})=>{const{ignoreClearable:s=!1}=n,{selection:o}=t,{empty:u,ranges:c}=o;if(u)return!0;const{nonClearableMarks:d}=i.extensionManager;if(e){const p=Object.values(i.schema.marks).filter(m=>s||!d.includes(m.name));c.forEach(m=>{for(const y of p)t.removeMark(m.$from.pos,m.$to.pos,y)})}return!0},gN=(n,t={})=>({tr:e,state:i,dispatch:s})=>{const{extendEmptyMarkRange:o=!1}=t,{selection:u}=e,c=si(n,i.schema),{$from:d,empty:p,ranges:m}=u;if(!s)return!0;if(p&&o){var y;let{from:b,to:v}=u;const E=mc(d,c,(y=d.marks().find(M=>M.type===c))===null||y===void 0?void 0:y.attrs);E&&(b=E.from,v=E.to),e.removeMark(b,v,c)}else m.forEach(b=>{e.removeMark(b.$from.pos,b.$to.pos,c)});return e.removeStoredMark(c),!0},yN=n=>({tr:t,state:e,dispatch:i})=>{const{selection:s}=e;let o,u;return typeof n==\"number\"?(o=n,u=n):n&&\"from\"in n&&\"to\"in n?(o=n.from,u=n.to):(o=s.from,u=s.to),i&&t.doc.nodesBetween(o,u,(c,d)=>{if(c.isText)return;const p={...c.attrs};delete p.dir,t.setNodeMarkup(d,void 0,p)}),!0},bN=(n,t={})=>({tr:e,state:i,dispatch:s})=>{let o=null,u=null;const c=gc(typeof n==\"string\"?n:n.name,i.schema);if(!c)return!1;c===\"node\"&&(o=ae(n,i.schema)),c===\"mark\"&&(u=si(n,i.schema));let d=!1;return e.selection.ranges.forEach(p=>{const m=p.$from.pos,y=p.$to.pos;let b,v,E,M;e.selection.empty?i.doc.nodesBetween(m,y,(x,O)=>{o&&o===x.type&&(d=!0,E=Math.max(O,m),M=Math.min(O+x.nodeSize,y),b=O,v=x)}):i.doc.nodesBetween(m,y,(x,O)=>{O<m&&o&&o===x.type&&(d=!0,E=Math.max(O,m),M=Math.min(O+x.nodeSize,y),b=O,v=x),O>=m&&O<=y&&(o&&o===x.type&&(d=!0,s&&e.setNodeMarkup(O,void 0,{...x.attrs,...t})),u&&x.marks.length&&x.marks.forEach(B=>{if(u===B.type&&(d=!0,s)){const I=Math.max(O,m),q=Math.min(O+x.nodeSize,y);e.addMark(I,q,u.create({...B.attrs,...t}))}}))}),v&&(b!==void 0&&s&&e.setNodeMarkup(b,void 0,{...v.attrs,...t}),u&&v.marks.length&&v.marks.forEach(x=>{u===x.type&&s&&e.addMark(E,M,u.create({...x.attrs,...t}))}))}),d},Os=new Zt(\"__tiptap_decorations__\"),vN=n=>({tr:t,dispatch:e})=>(e&&t.setMeta(Os,{type:\"force\",name:n}),!0),SN=(n,t={})=>({state:e,dispatch:i})=>{const s=ae(n,e.schema);return kA(s,t)(e,i)},EN=(n,t={})=>({state:e,dispatch:i})=>{const s=ae(n,e.schema);return AA(s,t)(e,i)};var TN=dA({blur:()=>zO,clearContent:()=>BO,clearNodes:()=>HO,command:()=>_O,createParagraphNear:()=>UO,cut:()=>IO,deleteCurrentNode:()=>jO,deleteNode:()=>qO,deleteRange:()=>VO,deleteSelection:()=>KO,enter:()=>GO,exitCode:()=>YO,extendMarkRange:()=>XO,first:()=>FO,focus:()=>JO,forEach:()=>ZO,insertContent:()=>WO,insertContentAt:()=>tw,insertDefaultBlock:()=>ew,joinBackward:()=>rw,joinDown:()=>iw,joinForward:()=>sw,joinItemBackward:()=>lw,joinItemForward:()=>ow,joinTextblockBackward:()=>aw,joinTextblockForward:()=>uw,joinUp:()=>nw,keyboardShortcut:()=>fw,lift:()=>dw,liftEmptyBlock:()=>hw,liftListItem:()=>pw,newlineInCode:()=>mw,resetAttributes:()=>gw,scrollIntoView:()=>yw,selectAll:()=>bw,selectNodeBackward:()=>vw,selectNodeForward:()=>Sw,selectParentNode:()=>Ew,selectTextblockEnd:()=>Tw,selectTextblockStart:()=>xw,setContent:()=>Mw,setMark:()=>Jw,setMeta:()=>Zw,setNode:()=>Ww,setNodeSelection:()=>tN,setTextDirection:()=>eN,setTextSelection:()=>nN,sinkListItem:()=>iN,splitBlock:()=>rN,splitListItem:()=>sN,toggleList:()=>cN,toggleMark:()=>fN,toggleNode:()=>dN,toggleWrap:()=>hN,undoInputRule:()=>pN,unsetAllMarks:()=>mN,unsetMark:()=>gN,unsetTextDirection:()=>yN,updateAttributes:()=>bN,updateDecorations:()=>vN,wrapIn:()=>SN,wrapInList:()=>EN});const Gl=new WeakMap;function xN(n,t){var e;Gl.set(n,((e=Gl.get(n))!==null&&e!==void 0?e:0)+1);try{return t()}finally{var i;const s=((i=Gl.get(n))!==null&&i!==void 0?i:1)-1;s>0?Gl.set(n,s):Gl.delete(n)}}var MN=class{constructor(){this.callbacks={}}on(n,t){return this.callbacks[n]||(this.callbacks[n]=[]),this.callbacks[n].push(t),this}emit(n,...t){const e=this.callbacks[n];return e&&e.forEach(i=>i.apply(this,t)),this}off(n,t){const e=this.callbacks[n];return e&&(t?this.callbacks[n]=e.filter(i=>i!==t):delete this.callbacks[n]),this}once(n,t){const e=(...i)=>{this.off(n,e),t.apply(this,i)};return this.on(n,e)}removeAllListeners(){this.callbacks={}}};function kN(n){return n.kind===\"widget\"}function ME(n,t){const e=[],i=new Set;for(const s of n)s.kind===\"widget\"&&kN(s)&&i.add(s.key),e.push(s.toPMDecoration(t));return{decorations:e,widgetKeys:i}}function AN(n,t,e){const{decorations:i,widgetKeys:s}=ME(t,e);return{set:xt.create(n,i),widgetKeys:s}}function kE({position:n,from:t,to:e,docSize:i}){return n<t?!1:n<e?!0:n===e&&e===i}function CN({decorations:n,from:t,to:e,docSize:i,extensionName:s,warnedExtensions:o}){return n.filter(u=>kE({position:u.anchor,from:t,to:e,docSize:i})?!0:(u.anchor===e||o.has(s)||(o.add(s),console.warn(`[tiptap warn]: Extension \"${s}\" returned a decoration outside the requested range [${t}, ${e}). It was ignored.`)),!1))}function ON(n){var t;const e=(t=n.spec)===null||t===void 0?void 0:t.key;return typeof e==\"string\"?e:void 0}function AE(n){return n.jsonID===\"attr\"}function wN(n){let t=!1;if(n.getMap().forEach(()=>{t=!0}),t||AE(n))return!0;const e=n;return typeof e.from==\"number\"&&typeof e.to==\"number\"}function NN(n,t){let e=null,i=0,s=0;for(let o=0;o<n.childCount&&!(s>t.to);o+=1){const u=s+n.child(o).nodeSize;u>=t.from&&(e===null&&(e=s),i=u),s=u}return e===null?null:{from:e,to:i}}function DN(n,t){if(n.steps.some(o=>!wN(o)))return{type:\"full\"};const e=bc(n).map(({newRange:o})=>o);n.steps.forEach((o,u)=>{if(!AE(o))return;const c=n.mapping.slice(u);e.push({from:c.map(o.pos,-1),to:c.map(o.pos+1)})});const i=[];for(const o of e){const u=NN(t,o);u&&i.push(u)}i.sort((o,u)=>o.from-u.from);const s=[];for(const o of i){const u=s[s.length-1];u&&o.from<=u.to?u.to=Math.max(u.to,o.to):s.push({...o})}return{type:\"ranges\",ranges:s}}function CE(n,t,e,i){return n.map(t,e,{onRemove:s=>{const o=s==null?void 0:s.key;typeof o==\"string\"&&i.delete(o)}})}function RN(n,t,e){var i,s;const o=(i=t.decorationSetsByExtension[n])!==null&&i!==void 0?i:xt.empty,u=new Set((s=t.widgetKeysByExtension[n])!==null&&s!==void 0?s:[]);return{set:CE(o,e.mapping,e.doc,u),widgetKeys:u}}function Lv(n,t){const e=Object.values(t).flatMap(i=>i.find());return xt.create(n,e)}function zv(n){const t=new Set;for(const e of Object.values(n))for(const i of e)t.add(i);return t}function LN(n,t){var e;switch((e=t.update)!==null&&e!==void 0?e:\"document\"){case\"document\":if(t.createInRange)throw new Error(`[tiptap error]: Extension \"${n}\" provides createInRange() but does not use the \"changedRanges\" decoration update strategy.`);return;case\"changedRanges\":if(!t.createInRange)throw new Error(`[tiptap error]: Extension \"${n}\" uses the \"changedRanges\" decoration update strategy but does not provide createInRange().`);return;case\"manual\":if(t.createInRange)throw new Error(`[tiptap error]: Extension \"${n}\" uses the \"manual\" decoration update strategy, which is not compatible with createInRange(). createInRange() requires the \"changedRanges\" strategy.`);if(t.shouldUpdate)throw new Error(`[tiptap error]: Extension \"${n}\" cannot combine the \"manual\" decoration update strategy with shouldUpdate().`);return;default:throw new Error(`[tiptap error]: Extension \"${n}\" uses an unknown decoration update strategy. Expected \"document\", \"changedRanges\", or \"manual\".`)}}function zN(n,t,e){return e?!0:n.update===\"manual\"?!1:n.shouldUpdate?n.shouldUpdate(t):t.tr.docChanged}const BN=new Set;var HN=class{constructor(n){this.warnedWidgetKeys=new Set,this.warnedOutOfRangeExtensions=new Set,this.handleBeforeTransaction=({nextState:t})=>{const e=Os.getState(t);e&&this.warnDuplicateWidgetKeys(e)},this.editor=n.editor,this.entries=this.resolveEntries(n.entries),this.entries.forEach(({name:t,spec:e})=>LN(t,e)),this.plugin=this.entries.length>0?this.createPlugin():null,this.editor.on(\"beforeTransaction\",this.handleBeforeTransaction)}destroy(){this.editor.off(\"beforeTransaction\",this.handleBeforeTransaction)}liveWidgetKeys(){var n,t;return(n=(t=Os.getState(this.editor.state))===null||t===void 0?void 0:t.widgetKeys)!==null&&n!==void 0?n:BN}get mountedView(){return this.editor.isDestroyed?null:this.editor.view}resolveEntries(n){const t=[];for(const{name:e,addDecorations:i}of n){const s=i();s&&t.push({name:e,spec:s})}return t}createPlugin(){const{editor:n,entries:t}=this;return new It({key:Os,state:{init:(e,i)=>{const s={},o={};for(const{name:c,spec:d}of t){const{set:p,widgetKeys:m}=this.buildFullSet(c,d,i);s[c]=p,o[c]=m}const u={decorationSetsByExtension:s,widgetKeysByExtension:o,mergedDecorationSet:this.buildMergedSet(i.doc,s),widgetKeys:zv(o)};return this.warnDuplicateWidgetKeys(u),u},apply:(e,i,s,o)=>{const u=e.getMeta(Os),c=(u==null?void 0:u.type)===\"force\"&&!u.name,d=(u==null?void 0:u.type)===\"force\"?u.name:void 0,p={},m={},y=new Set;return xN(n,()=>{for(const{name:b,spec:v}of t){const E=c||d===b;if(zN(v,{editor:n,tr:e,oldState:s,newState:o},E))if(v.update===\"changedRanges\"&&e.docChanged&&!E){const M=this.applyChangedRangesRecompute(b,v,i,e,o);p[b]=M.set,m[b]=M.widgetKeys,y.add(b)}else{const{set:M,widgetKeys:x}=this.buildFullSet(b,v,o);p[b]=M,m[b]=x,y.add(b)}else{const M=RN(b,i,e);p[b]=M.set,m[b]=M.widgetKeys}}}),y.size===0&&!e.docChanged?i:{decorationSetsByExtension:p,widgetKeysByExtension:m,mergedDecorationSet:this.mergeAfterApply({entries:t,previous:i,tr:e,decorationSetsByExtension:p,recomputedNames:y}),widgetKeys:zv(m)}}},props:{decorations(e){var i,s;return(i=(s=Os.getState(e))===null||s===void 0?void 0:s.mergedDecorationSet)!==null&&i!==void 0?i:xt.empty}}})}applyChangedRangesRecompute(n,t,e,i,s){const o=DN(i,s.doc);return o.type===\"full\"?this.buildFullSet(n,t,s):this.rebuildRanges(n,t,e,i,s,o.ranges)}rebuildRanges(n,t,e,i,s,o){var u,c;const d=(u=e.decorationSetsByExtension[n])!==null&&u!==void 0?u:xt.empty,p=new Set((c=e.widgetKeysByExtension[n])!==null&&c!==void 0?c:[]);let m=CE(d,i.mapping,i.doc,p);const y=s.doc.content.size;for(const{from:b,to:v}of o){const E=m.find(b,v).filter(O=>kE({position:O.from,from:b,to:v,docSize:y}));for(const O of E){const B=ON(O);B&&p.delete(B)}m=m.remove(E);const{decorations:M,widgetKeys:x}=ME(CN({decorations:this.runCreate(n,\"createInRange\",()=>t.createInRange({editor:this.editor,state:s,view:this.mountedView,from:b,to:v})),from:b,to:v,docSize:y,extensionName:n,warnedExtensions:this.warnedOutOfRangeExtensions}),n);m=m.add(s.doc,M);for(const O of x)p.add(O)}return{set:m,widgetKeys:p}}buildFullSet(n,t,e){const i=this.runCreate(n,\"create\",()=>t.create({editor:this.editor,state:e,view:this.mountedView}));return AN(e.doc,i,n)}runCreate(n,t,e){try{return e()}catch(i){return console.error(`[tiptap error]: Extension \"${n}\" threw in \\`addDecorations().${t}()\\`. Its decorations were dropped for this update.`,i),[]}}warnDuplicateWidgetKeys(n){}buildMergedSet(n,t){const e=Object.keys(t);return e.length===1?t[e[0]]:Lv(n,t)}mergeAfterApply({entries:n,previous:t,tr:e,decorationSetsByExtension:i,recomputedNames:s}){return n.length===1?i[n[0].name]:s.size===0?t.mergedDecorationSet.map(e.mapping,e.doc):Lv(e.doc,i)}};function _N(n,t,e){const i=document.querySelector(\"style[data-tiptap-style]\");if(i!==null)return i;const s=document.createElement(\"style\");return t&&s.setAttribute(\"nonce\",t),s.setAttribute(\"data-tiptap-style\",\"\"),s.innerHTML=n,document.getElementsByTagName(\"head\")[0].appendChild(s),s}function Vs(n,t){const e=n.getAttribute(\"style\");if(!e)return null;const i=e.split(\";\").map(o=>o.trim()).filter(Boolean),s=t.toLowerCase();for(let o=i.length-1;o>=0;o-=1){const u=i[o],c=u.indexOf(\":\");if(c!==-1&&u.slice(0,c).trim().toLowerCase()===s)return u.slice(c+1).trim()}return null}function UN(n){return typeof n==\"number\"}function IN(n){return Object.prototype.toString.call(n).slice(8,-1)}function su(n){return IN(n)!==\"Object\"?!1:n.constructor===Object&&Object.getPrototypeOf(n)===Object.prototype}function $s(n){return typeof n==\"string\"&&n.trim().length>0&&!/[;{}]/.test(n)}function Bv(n,t,e){const i=n.split(`\n`),s=[];let o=\"\",u=0;const c=t.baseIndentSize||2;for(;u<i.length;){const m=i[u],y=m.match(t.itemPattern);if(!y){if(s.length>0)break;if(m.trim()===\"\"){u+=1,o=`${o}${m}\n`;continue}else return}const b=t.extractItemData(y),{indentLevel:v,mainContent:E}=b;o=`${o}${m}\n`;const M=[E];for(u+=1;u<i.length;){var d;const I=i[u];if(I.trim()===\"\"){var p;const q=i.slice(u+1).findIndex(P=>P.trim()!==\"\");if(q===-1)break;if((((p=i[u+1+q].match(/^(\\s*)/))===null||p===void 0||(p=p[1])===null||p===void 0?void 0:p.length)||0)>v){M.push(I),o=`${o}${I}\n`,u+=1;continue}else break}if((((d=I.match(/^(\\s*)/))===null||d===void 0||(d=d[1])===null||d===void 0?void 0:d.length)||0)>v)M.push(I),o=`${o}${I}\n`,u+=1;else break}let x;const O=M.slice(1);if(O.length>0){const I=O.map(q=>q.slice(v+c)).join(`\n`);I.trim()&&(t.customNestedParser?x=t.customNestedParser(I):x=e.blockTokens(I))}const B=t.createToken(b,x);s.push(B)}if(s.length!==0)return{items:s,raw:o}}const Hv=4;function _v(n){let t=0;for(const e of n)t=e===\"\t\"?t+Hv-t%Hv:t+1;return t}function OE(n,t,e,i,s){if(!n||!Array.isArray(n.content))return\"\";const o=typeof e==\"function\"?e(i):e,[u,...c]=n.content;let d=`${o}${t.renderChildren([u])}`;return c&&c.length>0&&c.forEach((p,m)=>{var y,b;const v=(y=(b=t.renderChild)===null||b===void 0?void 0:b.call(t,p,m+1))!==null&&y!==void 0?y:t.renderChildren([p]);if(v!=null){const E=x=>{if(!(s!=null&&s.alignNestedToPrefix))return t.indent(x);const O=t.indent(\"\"),B=_v(o);return(_v(O)>=B?O:\" \".repeat(B))+x},M=v.split(`\n`).map(x=>E(x||\"\")).join(`\n`);d+=p.type===\"paragraph\"?`\n\n${M}`:`\n${M}`}}),d}function wE(n,t){const e={...n};return su(n)&&su(t)&&Object.keys(t).forEach(i=>{su(t[i])&&su(n[i])?e[i]=wE(n[i],t[i]):e[i]=t[i]}),e}function jN(n,t,e={}){const{state:i}=t,{doc:s,tr:o}=i,u=n;s.descendants((c,d)=>{const p=o.mapping.map(d),m=o.mapping.map(d)+c.nodeSize;let y=null;if(c.marks.forEach(v=>{if(v!==u)return!1;y=v}),!y)return;let b=!1;if(Object.keys(e).forEach(v=>{e[v]!==y.attrs[v]&&(b=!0)}),b){const v=n.type.create({...n.attrs,...e});o.removeMark(p,m,n.type),o.addMark(p,m,v)}}),o.docChanged&&t.view.dispatch(o)}var Bo=class{constructor(n){var t;this.find=n.find,this.handler=n.handler,this.undoable=(t=n.undoable)!==null&&t!==void 0?t:!0}};const qN=(n,t)=>{if(Lp(t))return t.exec(n);const e=t(n);if(!e)return null;const i=[e.text];return i.index=e.index,i.input=n,i.data=e.data,e.replaceWith&&(e.text.includes(e.replaceWith)||console.warn('[tiptap warn]: \"inputRuleMatch.replaceWith\" must be part of \"inputRuleMatch.text\".'),i.push(e.replaceWith)),i};function VN(n){const{editor:t,from:e,to:i,text:s,insertText:o}=n;if(!o)return{inputTransaction:null,tr:t.view.state.tr};const u=t.view.state.tr.insertText(s,e,i);return{inputTransaction:u,tr:Zn.create({doc:u.doc,selection:u.selection,storedMarks:u.storedMarks}).tr}}function $N(n){const{editor:t,from:e,to:i,text:s,rule:o,match:u,plugin:c,insertText:d}=n,{view:p}=t,{inputTransaction:m,tr:y}=VN({editor:t,from:e,to:i,text:s,insertText:d}),b=m?e+s.length:i,v=pc({state:p.state,transaction:y}),E={from:e-(u[0].length-s.length),to:b},{commands:M,chain:x,can:O}=new Rs({editor:t,state:v});return o.handler({state:v,range:E,match:u,commands:M,chain:x,can:O})===null||!y.steps.length?!1:(m&&(p.dispatch(m),!p.state.doc.eq(m.doc))||(DO(y),y.setMeta(\"inputRule\",!0),o.undoable&&y.setMeta(c,{transform:y,from:e,to:b,text:s}),p.dispatch(y)),!0)}function PN(n,t,e){const i=t[0].length-e.length;if(i<=0)return!0;const s=n.parentOffset-i;return s>=0&&n.parent.textBetween(s,n.parentOffset)===t[0].slice(0,i)}function lu(n){var t;const{editor:e,from:i,to:s,text:o,rules:u,plugin:c,insertText:d}=n,{view:p}=e;if(p.composing)return!1;const m=p.state.doc.resolve(i);if(m.parent.type.spec.code||!((t=m.nodeBefore||m.nodeAfter)===null||t===void 0)&&t.marks.find(b=>b.type.spec.code))return!1;const y=qw(m)+o;for(const b of u){const v=qN(y,b.find);if(!(!v||!PN(m,v,o))&&$N({editor:e,from:i,to:s,text:o,rule:b,match:v,plugin:c,insertText:d}))return!0}return!1}function KN(n){const{editor:t,rules:e}=n,i=new It({state:{init(){return null},apply(s,o,u){const c=s.getMeta(i);if(c)return c;const d=s.getMeta(\"applyInputRules\");return d&&setTimeout(()=>{let{text:p}=d;typeof p==\"string\"?p=p:p=Bp(j.from(p),u.schema);const{from:m}=d,y=m+p.length;lu({editor:t,from:m,to:y,text:p,rules:e,plugin:i})}),s.selectionSet||s.docChanged?null:o}},props:{handleTextInput(s,o,u,c){return lu({editor:t,from:o,to:u,text:c,rules:e,plugin:i,insertText:!0})},handleDOMEvents:{compositionend:s=>(setTimeout(()=>{const{$cursor:o}=s.state.selection;o&&lu({editor:t,from:o.pos,to:o.pos,text:\"\",rules:e,plugin:i})}),!1)},handleKeyDown(s,o){if(o.key!==\"Enter\")return!1;const{$cursor:u}=s.state.selection;return u?lu({editor:t,from:u.pos,to:u.pos,text:`\n`,rules:e,plugin:i}):!1}},isInputRules:!0});return i}var Up=class{constructor(n={}){this.type=\"extendable\",this.parent=null,this.child=null,this.name=\"\",this.config={name:this.name},this.config={...this.config,...n},this.name=this.config.name}get options(){return{...Ot(J(this,\"addOptions\",{name:this.name}))}}get storage(){return{...Ot(J(this,\"addStorage\",{name:this.name,options:this.options}))}}configure(n={}){const t=this.extend({...this.config,addOptions:()=>wE(this.options,n)});return t.name=this.name,t.parent=this.parent,this.child=null,t}extend(n={}){const t=new this.constructor({...this.config,...n});return t.parent=this,this.child=t,t.name=\"name\"in n?n.name:t.parent.name,t}},li=class NE extends Up{constructor(...t){super(...t),this.type=\"mark\"}static create(t={}){const e=typeof t==\"function\"?t():t;return new NE(e)}static handleExit({editor:t,mark:e}){const{tr:i}=t.state,s=t.state.selection.$from;if(s.pos===s.end()){const o=s.marks();if(!o.find(c=>(c==null?void 0:c.type.name)===e.name))return!1;const u=o.find(c=>(c==null?void 0:c.type.name)===e.name);return u&&i.removeStoredMark(u),i.insertText(\" \",s.pos),t.view.dispatch(i),!0}return!1}configure(t){return super.configure(t)}extend(t){const e=typeof t==\"function\"?t():t;return super.extend(e)}},DE=class{constructor(n){this.find=n.find,this.handler=n.handler}};const GN=(n,t,e)=>{if(Lp(t))return[...n.matchAll(t)];const i=t(n,e);return i?i.map(s=>{const o=[s.text];return o.index=s.index,o.input=n,o.data=s.data,s.replaceWith&&(s.text.includes(s.replaceWith)||console.warn('[tiptap warn]: \"pasteRuleMatch.replaceWith\" must be part of \"pasteRuleMatch.text\".'),o.push(s.replaceWith)),o}):[]};function YN(n){const{editor:t,state:e,from:i,to:s,rule:o,pasteEvent:u,dropEvent:c}=n,{commands:d,chain:p,can:m}=new Rs({editor:t,state:e}),y=[];return e.doc.nodesBetween(i,s,(b,v)=>{var E,M,x,O;if(!((E=b.type)===null||E===void 0||(E=E.spec)===null||E===void 0)&&E.code||!(b.isText||b.isTextblock||b.isInline))return;const B=(M=(x=(O=b.content)===null||O===void 0?void 0:O.size)!==null&&x!==void 0?x:b.nodeSize)!==null&&M!==void 0?M:0,I=Math.max(i,v),q=Math.min(s,v+B);if(I>=q)return;const P=b.isText?b.text||\"\":b.textBetween(I-v,q-v,void 0,\"\");GN(P,o.find,u).forEach(et=>{if(et.index===void 0)return;const Y=I+et.index+1,nt=Y+et[0].length,ct={from:e.tr.mapping.map(Y),to:e.tr.mapping.map(nt)},Et=o.handler({state:e,range:ct,match:et,commands:d,chain:p,can:m,pasteEvent:u,dropEvent:c});y.push(Et)})}),y.every(b=>b!==null)}let xs=null;const XN=n=>{var t;const e=new ClipboardEvent(\"paste\",{clipboardData:new DataTransfer});return(t=e.clipboardData)===null||t===void 0||t.setData(\"text/html\",n),e};function FN(n){const{editor:t,rules:e}=n;let i=null,s=!1,o=!1,u=typeof ClipboardEvent<\"u\"?new ClipboardEvent(\"paste\"):null,c;try{c=typeof DragEvent<\"u\"?new DragEvent(\"drop\"):null}catch{c=null}const d=({state:p,from:m,to:y,rule:b,pasteEvt:v})=>{const E=p.tr,M=pc({state:p,transaction:E});if(!(!YN({editor:t,state:M,from:Math.max(m-1,0),to:y.b-1,rule:b,pasteEvent:v,dropEvent:c})||!E.steps.length)){try{c=typeof DragEvent<\"u\"?new DragEvent(\"drop\"):null}catch{c=null}return u=typeof ClipboardEvent<\"u\"?new ClipboardEvent(\"paste\"):null,E}};return t.on(\"destroy\",()=>{xs===t&&(xs=null)}),e.map(p=>new It({view(m){const y=v=>{var E;i=!((E=m.dom.parentElement)===null||E===void 0)&&E.contains(v.target)?m.dom.parentElement:null,i&&(xs=t)},b=()=>{xs&&(xs=null)};return window.addEventListener(\"dragstart\",y),window.addEventListener(\"dragend\",b),{destroy(){window.removeEventListener(\"dragstart\",y),window.removeEventListener(\"dragend\",b)}}},props:{handleDOMEvents:{drop:(m,y)=>{if(o=i===m.dom.parentElement,c=y,!o){const b=xs;b!=null&&b.isEditable&&setTimeout(()=>{if(b.isDestroyed)return;const v=b.state.selection;v&&b.commands.deleteRange({from:v.from,to:v.to})},10)}return!1},paste:(m,y)=>{var b;const v=(b=y.clipboardData)===null||b===void 0?void 0:b.getData(\"text/html\");return u=y,s=!!(v!=null&&v.includes(\"data-pm-slice\")),!1}}},appendTransaction:(m,y,b)=>{const v=m[0],E=v.getMeta(\"uiEvent\")===\"paste\"&&!s,M=v.getMeta(\"uiEvent\")===\"drop\"&&!o,x=v.getMeta(\"applyPasteRules\"),O=!!x;if(!E&&!M&&!O)return;if(O){let{text:q}=x;typeof q==\"string\"?q=q:q=Bp(j.from(q),b.schema);const{from:P}=x,et=P+q.length,Y=XN(q);return d({rule:p,state:b,from:P,to:{b:et},pasteEvt:Y})}const B=y.doc.content.findDiffStart(b.doc.content),I=y.doc.content.findDiffEnd(b.doc.content);if(!(!UN(B)||!I||B===I.b))return d({rule:p,state:b,from:B,to:I,pasteEvt:u})}}))}var Sc=class{constructor(n,t){this.splittableMarks=[],this.nonClearableMarks=[],this.decorationManager=null,this.editor=t,this.baseExtensions=n,this.extensions=mE(n),this.hasSchemaSpec=t.options.schemaSpec!==void 0,this.schema=zw(this.extensions,t,t.options.schemaSpec),this.setupExtensions()}get commands(){return this.extensions.reduce((n,t)=>{const e=J(t,\"addCommands\",{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:Ts(t.name,this.schema)});return e?{...n,...e()}:n},{})}get plugins(){const{editor:n}=this,t=ao([...this.extensions].reverse()).flatMap(i=>{const s={name:i.name,options:i.options,storage:this.editor.extensionStorage[i.name],editor:n,type:Ts(i.name,this.schema)},o=[],u=J(i,\"addKeyboardShortcuts\",s);let c={};if(i.type===\"mark\"&&J(i,\"exitable\",s)&&(c.ArrowRight=()=>li.handleExit({editor:n,mark:i})),u){const b=Object.fromEntries(Object.entries(u()).map(([v,E])=>[v,()=>E({editor:n})]));c={...c,...b}}const d=xO(c);o.push(d);const p=J(i,\"addInputRules\",s);if(wv(i,n.options.enableInputRules)&&p){const b=p();if(b&&b.length){const v=KN({editor:n,rules:b}),E=Array.isArray(v)?v:[v];o.push(...E)}}const m=J(i,\"addPasteRules\",s);if(wv(i,n.options.enablePasteRules)&&m){const b=m();if(b&&b.length){const v=FN({editor:n,rules:b});o.push(...v)}}const y=J(i,\"addProseMirrorPlugins\",s);if(y){const b=y();o.push(...b)}return o}),e=this.createDecorationPlugin();return e&&t.push(e),t}createDecorationPlugin(){var n;const{editor:t}=this;(n=this.decorationManager)===null||n===void 0||n.destroy();const e=[];return this.extensions.forEach(i=>{const s=J(i,\"addDecorations\",{name:i.name,options:i.options,storage:this.editor.extensionStorage[i.name],editor:t,type:Ts(i.name,this.schema)});s&&e.push({name:i.name,addDecorations:s})}),this.decorationManager=new HN({editor:t,entries:e}),this.decorationManager.plugin}get attributes(){const n=Hp(this.extensions);return this.hasSchemaSpec?hE(n,this.schema):n}get nodeViews(){const{editor:n}=this,{nodeExtensions:t}=Us(this.extensions);return Object.fromEntries(t.filter(e=>!!J(e,\"addNodeView\")).map(e=>{const i=this.attributes.filter(c=>c.type===e.name),s=J(e,\"addNodeView\",{name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:n,type:ae(e.name,this.schema)});if(!s)return[];const o=s();if(!o)return[];const u=(c,d,p,m,y)=>{const b=Is(c,i);return o({node:c,view:d,getPos:p,decorations:m,innerDecorations:y,editor:n,extension:e,HTMLAttributes:b})};return[e.name,u]}))}dispatchTransaction(n){const{editor:t}=this;return ao([...this.extensions].reverse()).reduceRight((e,i)=>{const s={name:i.name,options:i.options,storage:this.editor.extensionStorage[i.name],editor:t,type:Ts(i.name,this.schema)},o=J(i,\"dispatchTransaction\",s);return o?u=>{o.call(s,{transaction:u,next:e})}:e},n)}transformPastedHTML(n){const{editor:t}=this;return ao([...this.extensions]).reduce((e,i)=>{const s={name:i.name,options:i.options,storage:this.editor.extensionStorage[i.name],editor:t,type:Ts(i.name,this.schema)},o=J(i,\"transformPastedHTML\",s);return o?(u,c)=>{const d=e(u,c);return o.call(s,d)}:e},n||(e=>e))}get markViews(){const{editor:n}=this,{markExtensions:t}=Us(this.extensions);return Object.fromEntries(t.filter(e=>!!J(e,\"addMarkView\")).map(e=>{const i=this.attributes.filter(u=>u.type===e.name),s=J(e,\"addMarkView\",{name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:n,type:si(e.name,this.schema)});if(!s)return[];const o=(u,c,d)=>{const p=Is(u,i);return s()({mark:u,view:c,inline:d,editor:n,extension:e,HTMLAttributes:p,updateAttributes:m=>{jN(u,n,m)}})};return[e.name,o]}))}destroy(){var n;(n=this.decorationManager)===null||n===void 0||n.destroy(),this.extensions.forEach(t=>{let e=t;for(;e.parent;){const i=e.parent;i.child===e&&(i.child=null),e=i}}),this.extensions=[],this.baseExtensions=[],this.decorationManager=null,this.schema=null,this.editor=null}setupExtensions(){const n=this.extensions;this.editor.extensionStorage=Object.fromEntries(n.map(t=>[t.name,t.storage])),n.forEach(t=>{const e={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:Ts(t.name,this.schema)};if(t.type===\"mark\"){var i,s;(!((i=Ot(J(t,\"keepOnSplit\",e)))!==null&&i!==void 0)||i)&&this.splittableMarks.push(t.name),!((s=Ot(J(t,\"clearable\",e)))!==null&&s!==void 0)||s||this.nonClearableMarks.push(t.name)}const o=J(t,\"onBeforeCreate\",e),u=J(t,\"onCreate\",e),c=J(t,\"onUpdate\",e),d=J(t,\"onSelectionUpdate\",e),p=J(t,\"onTransaction\",e),m=J(t,\"onFocus\",e),y=J(t,\"onBlur\",e),b=J(t,\"onDestroy\",e);o&&this.editor.on(\"beforeCreate\",o),u&&this.editor.on(\"create\",u),c&&this.editor.on(\"update\",c),d&&this.editor.on(\"selectionUpdate\",d),p&&this.editor.on(\"transaction\",p),m&&this.editor.on(\"focus\",m),y&&this.editor.on(\"blur\",y),b&&this.editor.on(\"destroy\",b)})}};Sc.resolve=mE;Sc.sort=ao;Sc.flatten=zp;var Bt=class RE extends Up{constructor(...t){super(...t),this.type=\"extension\"}static create(t={}){const e=typeof t==\"function\"?t():t;return new RE(e)}configure(t){return super.configure(t)}extend(t){const e=typeof t==\"function\"?t():t;return super.extend(e)}};const QN=Bt.create({name:\"clipboardTextSerializer\",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new It({key:new Zt(\"clipboardTextSerializer\"),props:{clipboardTextSerializer:()=>{const{editor:n}=this,{state:t,schema:e}=n,{doc:i,selection:s}=t,o=yE(e),{blockSeparator:u}=this.options,c={...u!==void 0?{blockSeparator:u}:{},textSerializers:o};return[...s.ranges].sort((d,p)=>d.$from.pos-p.$from.pos).map(({$from:d,$to:p})=>gE(i,{from:d.pos,to:p.pos},c)).join(u??`\n\n`)}}})]}}),JN=Bt.create({name:\"commands\",addCommands(){return{...TN}}}),ZN=Bt.create({name:\"delete\",onUpdate({transaction:n,appendedTransactions:t}){var e,i;const s=()=>{var o,u,c;if((o=(u=this.editor.options.coreExtensionOptions)===null||u===void 0||(u=u.delete)===null||u===void 0||(c=u.filterTransaction)===null||c===void 0?void 0:c.call(u,n))!==null&&o!==void 0?o:n.getMeta(\"y-sync$\"))return;const d=dE(n.before,[n,...t]);bc(d).forEach(m=>{d.mapping.mapResult(m.oldRange.from).deletedAfter&&d.mapping.mapResult(m.oldRange.to).deletedBefore&&d.before.nodesBetween(m.oldRange.from,m.oldRange.to,(y,b)=>{const v=b+y.nodeSize-2,E=m.oldRange.from<=b&&v<=m.oldRange.to;this.editor.emit(\"delete\",{type:\"node\",node:y,from:b,to:v,newFrom:d.mapping.map(b),newTo:d.mapping.map(v),deletedRange:m.oldRange,newRange:m.newRange,partial:!E,editor:this.editor,transaction:n,combinedTransform:d})})});const p=d.mapping;d.steps.forEach((m,y)=>{if(m instanceof vn){var b,v;const E=p.slice(y).map(m.from,-1),M=p.slice(y).map(m.to),x=p.invert().map(E,-1),O=p.invert().map(M),B=E>0?(b=d.doc.nodeAt(E-1))===null||b===void 0?void 0:b.marks.some(q=>q.eq(m.mark)):!1,I=(v=d.doc.nodeAt(M))===null||v===void 0?void 0:v.marks.some(q=>q.eq(m.mark));this.editor.emit(\"delete\",{type:\"mark\",mark:m.mark,from:m.from,to:m.to,deletedRange:{from:x,to:O},newRange:{from:E,to:M},partial:!!(I||B),editor:this.editor,transaction:n,combinedTransform:d})}})};!((e=(i=this.editor.options.coreExtensionOptions)===null||i===void 0||(i=i.delete)===null||i===void 0?void 0:i.async)!==null&&e!==void 0)||e?setTimeout(s,0):s()}}),WN=Bt.create({name:\"drop\",addProseMirrorPlugins(){return[new It({key:new Zt(\"tiptapDrop\"),props:{handleDrop:(n,t,e,i)=>{this.editor.emit(\"drop\",{editor:this.editor,event:t,slice:e,moved:i})}}})]}}),tD=Bt.create({name:\"editable\",addProseMirrorPlugins(){return[new It({key:new Zt(\"editable\"),props:{editable:()=>this.editor.options.editable}})]}}),eD=new Zt(\"focusEvents\"),nD=Bt.create({name:\"focusEvents\",addProseMirrorPlugins(){const{editor:n}=this;return[new It({key:eD,props:{handleDOMEvents:{focus:(t,e)=>{n.isFocused=!0;const i=n.state.tr.setMeta(\"focus\",{event:e}).setMeta(\"addToHistory\",!1);return t.dispatch(i),!1},blur:(t,e)=>{n.isFocused=!1;const i=n.state.tr.setMeta(\"blur\",{event:e}).setMeta(\"addToHistory\",!1);return t.dispatch(i),!1}}}})]}}),iD=Bt.create({name:\"keymap\",addKeyboardShortcuts(){const n=()=>this.editor.commands.first(({commands:u})=>[()=>u.undoInputRule(),()=>u.command(({tr:c})=>{const{selection:d,doc:p}=c,{empty:m,$anchor:y}=d,{pos:b,parent:v}=y,E=y.parent.isTextblock&&b>0?c.doc.resolve(b-1):y,M=E.parent.type.spec.isolating,x=y.pos-y.parentOffset,O=M&&E.parent.childCount===1?x===y.pos:dt.atStart(p).from===b;return!m||!v.type.isTextblock||v.textContent.length||!O||O&&y.parent.type.name===\"paragraph\"?!1:u.clearNodes()}),()=>u.deleteSelection(),()=>u.joinBackward(),()=>u.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:u})=>[()=>u.deleteSelection(),()=>u.deleteCurrentNode(),()=>u.joinForward(),()=>u.selectNodeForward()]),i={Enter:()=>this.editor.commands.first(({commands:u})=>[()=>u.newlineInCode(),()=>u.createParagraphNear(),()=>u.liftEmptyBlock(),()=>u.splitBlock()]),\"Mod-Enter\":()=>this.editor.commands.exitCode(),Backspace:n,\"Mod-Backspace\":n,\"Shift-Backspace\":n,Delete:t,\"Mod-Delete\":t,\"Mod-a\":()=>this.editor.commands.selectAll()},s={...i},o={...i,\"Ctrl-h\":n,\"Alt-Backspace\":n,\"Ctrl-d\":t,\"Ctrl-Alt-Backspace\":t,\"Alt-Delete\":t,\"Alt-d\":t,\"Ctrl-a\":()=>this.editor.commands.selectTextblockStart(),\"Ctrl-e\":()=>this.editor.commands.selectTextblockEnd()};return Ao()||cE()?o:s},addProseMirrorPlugins(){return[new It({key:new Zt(\"clearDocument\"),appendTransaction:(n,t,e)=>{if(n.some(v=>v.getMeta(\"composition\")))return;const i=n.some(v=>v.docChanged)&&!t.doc.eq(e.doc),s=n.some(v=>v.getMeta(\"preventClearDocument\"));if(!i||s)return;const{empty:o,from:u,to:c}=t.selection,d=dt.atStart(t.doc).from,p=dt.atEnd(t.doc).to;if(o||!(u===d&&c===p)||!zo(e.doc))return;const m=e.tr,y=pc({state:e,transaction:m}),{commands:b}=new Rs({editor:this.editor,state:y});if(b.clearNodes(),!!m.steps.length)return m}})]}}),rD=Bt.create({name:\"paste\",addProseMirrorPlugins(){return[new It({key:new Zt(\"tiptapPaste\"),props:{handlePaste:(n,t,e)=>{this.editor.emit(\"paste\",{editor:this.editor,event:t,slice:e})}}})]}}),sD=Bt.create({name:\"tabindex\",addOptions(){return{value:void 0}},addProseMirrorPlugins(){return[new It({key:new Zt(\"tabindex\"),props:{attributes:()=>{var n;return!this.editor.isEditable&&this.options.value===void 0?{}:{tabindex:(n=this.options.value)!==null&&n!==void 0?n:\"0\"}}}})]}}),lD=Bt.create({name:\"textDirection\",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];const{nodeExtensions:n}=Us(this.extensions);return[{types:n.filter(t=>t.name!==\"text\").map(t=>t.name),attributes:{dir:{default:this.options.direction,parseHTML:t=>{const e=t.getAttribute(\"dir\");return e&&(e===\"ltr\"||e===\"rtl\"||e===\"auto\")?e:this.options.direction},renderHTML:t=>t.dir?{dir:t.dir}:{}}}}]},addProseMirrorPlugins(){return[new It({key:new Zt(\"textDirection\"),props:{attributes:()=>{const n=this.options.direction;return n?{dir:n}:{}}}})]}});let Uv=!1;function oD(n){if(Uv)return;Uv=!0;let t;try{const e=Qt.fromJSON(n,{from:0,to:0});if(!Yw(e))return;t=e.slice.content}catch{return}t instanceof j||console.warn(\"[tiptap warn]: prosemirror-model is loaded more than once. Wrapping and splitting nodes will fail. Deduplicate it in your lock file, or alias it to a single copy in your bundler.\")}var aD=class to{get name(){return this.node.type.name}constructor(t,e,i=!1,s=null){this.currentNode=null,this.actualDepth=null,this.isBlock=i,this.resolvedPos=t,this.editor=e,this.currentNode=s}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var t;return(t=this.actualDepth)!==null&&t!==void 0?t:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(t){let e=this.from,i=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}e=this.from+1,i=this.to-1}this.editor.commands.insertContentAt({from:e,to:i},t)}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;const t=this.resolvedPos.start(this.resolvedPos.depth-1),e=this.resolvedPos.doc.resolve(t);return new to(e,this.editor)}get before(){let t=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.from-3)),new to(t,this.editor)}get after(){let t=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.to+3)),new to(t,this.editor)}get children(){const t=[];return this.node.content.forEach((e,i)=>{const s=e.isBlock&&!e.isTextblock,o=e.isAtom&&!e.isText,u=e.isInline,c=this.pos+i+(o?0:1);if(c<0||c>this.resolvedPos.doc.nodeSize-2)return;const d=this.resolvedPos.doc.resolve(c);if(!s&&!u&&d.depth<=this.depth)return;const p=new to(d,this.editor,s,s||u?e:null);s&&(p.actualDepth=this.depth+1),t.push(p)}),t}get firstChild(){return this.children[0]||null}get lastChild(){const t=this.children;return t[t.length-1]||null}closest(t,e={}){let i=null,s=this.parent;for(;s&&!i;){if(s.node.type.name===t)if(Object.keys(e).length>0){const o=s.node.attrs,u=Object.keys(e);for(let c=0;c<u.length;c+=1){const d=u[c];if(o[d]!==e[d])break}}else i=s;s=s.parent}return i}querySelector(t,e={}){return this.querySelectorAll(t,e,!0)[0]||null}querySelectorAll(t,e={},i=!1){let s=[];if(!this.children||this.children.length===0)return s;const o=Object.keys(e);return this.children.forEach(u=>{i&&s.length>0||(u.node.type.name===t&&o.every(c=>e[c]===u.node.attrs[c])&&s.push(u),!(i&&s.length>0)&&(s=s.concat(u.querySelectorAll(t,e,i))))}),s}setAttribute(t){const{tr:e}=this.editor.state;e.setNodeMarkup(this.from,void 0,{...this.node.attrs,...t}),this.editor.view.dispatch(e)}};const uD=`.ProseMirror {\n position: relative;\n}\n\n.ProseMirror {\n word-wrap: break-word;\n white-space: pre-wrap;\n white-space: break-spaces;\n -webkit-font-variant-ligatures: none;\n font-variant-ligatures: none;\n font-feature-settings: \"liga\" 0; /* the above doesn't seem to work in Edge */\n}\n\n.ProseMirror [contenteditable=\"false\"] {\n white-space: normal;\n}\n\n.ProseMirror [contenteditable=\"false\"] [contenteditable=\"true\"] {\n white-space: pre-wrap;\n}\n\n.ProseMirror pre {\n white-space: pre-wrap;\n}\n\nimg.ProseMirror-separator {\n display: inline !important;\n border: none !important;\n margin: 0 !important;\n width: 0 !important;\n height: 0 !important;\n}\n\n.ProseMirror-gapcursor {\n display: none;\n pointer-events: none;\n position: absolute;\n margin: 0;\n}\n\n.ProseMirror-gapcursor:after {\n content: \"\";\n display: block;\n position: absolute;\n top: -2px;\n width: 20px;\n border-top: 1px solid black;\n animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;\n}\n\n@keyframes ProseMirror-cursor-blink {\n to {\n visibility: hidden;\n }\n}\n\n.ProseMirror-hideselection *::selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection * {\n caret-color: transparent;\n}\n\n.ProseMirror-focused .ProseMirror-gapcursor {\n display: block;\n}`;var cD=class extends MN{constructor(t={}){super(),this.css=null,this.className=\"tiptap\",this.editorView=null,this.isFocused=!1,this.destroyed=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.hasWarnedStaleDecorationRead=!1,this.options={element:typeof document<\"u\"?document.createElement(\"div\"):null,content:\"\",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:i})=>{throw i},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:Xw,createMappablePosition:Fw},this.setOptions(t),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on(\"beforeCreate\",this.options.onBeforeCreate),this.emit(\"beforeCreate\",{editor:this}),this.on(\"mount\",this.options.onMount),this.on(\"unmount\",this.options.onUnmount),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:i,slice:s,moved:o})=>this.options.onDrop(i,s,o)),this.on(\"paste\",({event:i,slice:s})=>this.options.onPaste(i,s)),this.on(\"delete\",this.options.onDelete);const e=this.createDoc();if(!this.editorState){const i=Zh(e,this.options.autofocus);this.editorState=Zn.create({doc:e,schema:this.schema,selection:i||void 0})}oD(this.schema),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),this.emit(\"mount\",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit(\"create\",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){this.editorState=this.editorView.state;const t=this.editorView.dom;t!=null&&t.editor&&delete t.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove==\"function\"?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(t){console.warn(\"Failed to remove CSS element:\",t)}this.css=null,this.emit(\"unmount\",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager?this.commandManager.chain():Rs.createFakeChain()}can(){return this.commandManager?this.commandManager.can():Rs.createFallbackCan()}injectCSS(){this.options.injectCSS&&typeof document<\"u\"&&(this.css=_N(uD,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,attributes:this.getEditorViewAttributes()}),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.dispatchTransaction(t)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(t,e)=>{if(this.editorView)return this.editorView[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){const i=ep(e)?e(t,[...this.state.plugins]):[...this.state.plugins,t],s=this.state.reconfigure({plugins:i});return this.view.updateState(s),s}unregisterPlugin(t){if(this.isDestroyed)return;const e=this.state.plugins;let i=e;if([].concat(t).forEach(o=>{const u=typeof o==\"string\"?`${o}$`:o.key;i=i.filter(c=>!c.key.startsWith(u))}),e.length===i.length)return;const s=this.state.reconfigure({plugins:i});return this.view.updateState(s),s}createExtensionManager(){var t,e;const i=[...this.options.enableCoreExtensions?[tD,QN.configure({blockSeparator:(t=this.options.coreExtensionOptions)===null||t===void 0||(t=t.clipboardTextSerializer)===null||t===void 0?void 0:t.blockSeparator}),JN,nD,iD,sD.configure({value:(e=this.options.coreExtensionOptions)===null||e===void 0||(e=e.tabindex)===null||e===void 0?void 0:e.value}),WN,rD,ZN,lD.configure({direction:this.options.textDirection})].filter(s=>typeof this.options.enableCoreExtensions==\"object\"?this.options.enableCoreExtensions[s.name]!==!1:!0):[],...this.options.extensions].filter(s=>[\"extension\",\"node\",\"mark\"].includes(s==null?void 0:s.type));this.extensionManager=new Sc(i,this)}createCommandManager(){this.commandManager=new Rs({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let t;try{t=tp(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;const i=tp(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1});return this.editorState=Zn.create({doc:i,schema:this.schema,selection:Zh(i,this.options.autofocus)||void 0}),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(s=>s.name!==\"collaboration\"),this.createExtensionManager()}}),this.editorState.doc}return t}getEditorViewAttributes(){var t;const e=(t=this.options.editorProps)===null||t===void 0?void 0:t.attributes;return ep(e)?i=>({role:\"textbox\",...e(i)}):{role:\"textbox\",...e}}createView(t){const{editorProps:e,enableExtensionDispatchTransaction:i}=this.options,s=e.dispatchTransaction||this.dispatchTransaction.bind(this),o=i?this.extensionManager.dispatchTransaction(s):s,u=e.transformPastedHTML,c=this.extensionManager.transformPastedHTML(u);this.editorView=new XS(t,{...e,attributes:this.getEditorViewAttributes(),dispatchTransaction:o,transformPastedHTML:c,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});const d=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(d),this.prependClass(),this.injectCSS();const p=this.view.dom;p.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(t){this.isCapturingTransaction=!0,t(),this.isCapturingTransaction=!1;const 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(m=>{var y;return(y=this.capturedTransaction)===null||y===void 0?void 0:y.step(m)});return}const{state:e,transactions:i}=this.state.applyTransaction(t),s=!this.state.selection.eq(e.selection),o=i.includes(t),u=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:i.slice(1)}),s&&this.emit(\"selectionUpdate\",{editor:this,transaction:t});const c=i.findLast(m=>m.getMeta(\"focus\")||m.getMeta(\"blur\")),d=c==null?void 0:c.getMeta(\"focus\"),p=c==null?void 0:c.getMeta(\"blur\");d&&this.emit(\"focus\",{editor:this,event:d.event,transaction:c}),p&&this.emit(\"blur\",{editor:this,event:p.event,transaction:c}),!(t.getMeta(\"preventUpdate\")||!i.some(m=>m.docChanged)||u.doc.eq(e.doc))&&this.emit(\"update\",{editor:this,transaction:t,appendedTransactions:i.slice(1)})}getAttributes(t){return bE(this.state,t)}isActive(t,e){const i=typeof t==\"string\"?t:null,s=typeof t==\"string\"?e:t;return Vw(this.state,i,s)}getJSON(){return this.state.doc.toJSON()}getHTML(){return Bp(this.state.doc.content,this.schema)}getText(t){const{blockSeparator:e=`\n\n`,textSerializers:i={}}=t||{};return Bw(this.state.doc,{blockSeparator:e,textSerializers:{...yE(this.schema),...i}})}get isEmpty(){return zo(this.state.doc)}destroy(){this.destroyed||(this.destroyed=!0,this.emit(\"destroy\"),this.unmount(),this.removeAllListeners(),this.extensionManager.destroy(),this.extensionManager=null,this.schema=null,this.commandManager=null,this.extensionStorage={})}get isDestroyed(){var t,e;return(t=(e=this.editorView)===null||e===void 0?void 0:e.isDestroyed)!==null&&t!==void 0?t:!0}$node(t,e){var i;return((i=this.$doc)===null||i===void 0?void 0:i.querySelector(t,e))||null}$nodes(t,e){var i;return((i=this.$doc)===null||i===void 0?void 0:i.querySelectorAll(t,e))||null}$pos(t){const e=this.state.doc.resolve(t),i=t>0&&e.nodeAfter&&!e.nodeAfter.isText&&e.nodeAfter.isAtom?e.nodeAfter:null;return new aD(e,this,!1,i)}get $doc(){return this.$pos(0)}};function Gi(n){return new Bo({find:n.find,handler:({state:t,range:e,match:i})=>{const s=Ot(n.getAttributes,void 0,i);if(s===!1||s===null)return null;const{tr:o}=t,u=i[i.length-1],c=i[0];if(u){const d=c.search(/\\S/),p=e.from+c.indexOf(u),m=p+u.length;if(vc(e.from,e.to,t.doc).filter(b=>b.mark.type.excluded.find(v=>v===n.type&&v!==b.mark.type)).filter(b=>b.to>p).length)return null;m<e.to&&o.delete(m,e.to),p>e.from&&o.delete(e.from+d,p);const y=e.from+d+u.length;o.addMark(e.from+d,y,n.type.create(s||{})),o.removeStoredMark(n.type)}},undoable:n.undoable})}function fD(n){return new Bo({find:n.find,handler:({state:t,range:e,match:i})=>{const s=Ot(n.getAttributes,void 0,i)||{},{tr:o}=t,u=e.from;let c=e.to;const d=n.type.create(s);if(i[1]){let p=u+i[0].lastIndexOf(i[1]);p>c?p=c:c=p+i[1].length;const m=i[0][i[0].length-1];o.insertText(m,u+i[0].length-1),o.replaceWith(p,c,d)}else if(i[0]){const p=n.type.isInline?u:u-1;o.insert(p,n.type.create(s)).delete(o.mapping.map(u),o.mapping.map(c))}o.scrollIntoView()},undoable:n.undoable})}function ip(n){return new Bo({find:n.find,handler:({state:t,range:e,match:i})=>{const s=t.doc.resolve(e.from),o=Ot(n.getAttributes,void 0,i)||{};if(!s.node(-1).canReplaceWith(s.index(-1),s.indexAfter(-1),n.type))return null;t.tr.delete(e.from,e.to).setBlockType(e.from,e.from,n.type,o)},undoable:n.undoable})}function js(n){return new Bo({find:n.find,handler:({state:t,range:e,match:i,chain:s})=>{const o=Ot(n.getAttributes,void 0,i)||{},u=t.tr.delete(e.from,e.to),c=u.doc.resolve(e.from).blockRange(),d=c&&bp(c,n.type,o);if(!d)return null;if(u.wrap(c,d),n.keepMarks&&n.editor){const{selection:m,storedMarks:y}=t,{splittableMarks:b}=n.editor.extensionManager,v=y||m.$to.parentOffset&&m.$from.marks();if(v){const E=v.filter(M=>b.includes(M.type.name));u.ensureMarks(E)}}if(n.keepAttributes){const m=n.type.name===\"bulletList\"||n.type.name===\"orderedList\"?\"listItem\":\"taskList\";s().updateAttributes(m,o).run()}const p=u.doc.resolve(e.from-1).nodeBefore;p&&p.type===n.type&&Yi(u.doc,e.from-1)&&(!n.joinPredicate||n.joinPredicate(i,p))&&u.join(e.from-1)},undoable:n.undoable})}const dD=n=>\"touches\"in n;var hD=class{constructor(n){var t,e,i,s,o,u;this.directions=[\"bottom-left\",\"bottom-right\",\"top-left\",\"top-right\"],this.minSize={height:8,width:8},this.preserveAspectRatio=!1,this.classNames={container:\"\",wrapper:\"\",handle:\"\",resizing:\"\"},this.initialWidth=0,this.initialHeight=0,this.aspectRatio=1,this.isResizing=!1,this.activeHandle=null,this.startX=0,this.startY=0,this.startWidth=0,this.startHeight=0,this.isShiftKeyPressed=!1,this.lastEditableState=void 0,this.handleMap=new Map,this.handleMouseMove=c=>{if(!this.isResizing||!this.activeHandle)return;const d=c.clientX-this.startX,p=c.clientY-this.startY;this.handleResize(d,p)},this.handleTouchMove=c=>{if(!this.isResizing||!this.activeHandle)return;const d=c.touches[0];if(!d)return;const p=d.clientX-this.startX,m=d.clientY-this.startY;this.handleResize(p,m)},this.handleMouseUp=()=>{if(!this.isResizing)return;const c=this.element.offsetWidth,d=this.element.offsetHeight;this.onCommit(c,d),this.isResizing=!1,this.activeHandle=null,this.container.dataset.resizeState=\"false\",this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener(\"mousemove\",this.handleMouseMove),document.removeEventListener(\"mouseup\",this.handleMouseUp),document.removeEventListener(\"keydown\",this.handleKeyDown),document.removeEventListener(\"keyup\",this.handleKeyUp)},this.handleKeyDown=c=>{c.key===\"Shift\"&&(this.isShiftKeyPressed=!0)},this.handleKeyUp=c=>{c.key===\"Shift\"&&(this.isShiftKeyPressed=!1)},this.node=n.node,this.editor=n.editor,this.element=n.element,this.element.draggable=!1,this.contentElement=n.contentElement,this.getPos=n.getPos,this.onResize=n.onResize,this.onCommit=n.onCommit,this.onUpdate=n.onUpdate,!((t=n.options)===null||t===void 0)&&t.min&&(this.minSize={...this.minSize,...n.options.min}),!((e=n.options)===null||e===void 0)&&e.max&&(this.maxSize=n.options.max),!(n==null||(i=n.options)===null||i===void 0)&&i.directions&&(this.directions=n.options.directions),!((s=n.options)===null||s===void 0)&&s.preserveAspectRatio&&(this.preserveAspectRatio=n.options.preserveAspectRatio),!((o=n.options)===null||o===void 0)&&o.className&&(this.classNames={container:n.options.className.container||\"\",wrapper:n.options.className.wrapper||\"\",handle:n.options.className.handle||\"\",resizing:n.options.className.resizing||\"\"}),!((u=n.options)===null||u===void 0)&&u.createCustomHandle&&(this.createCustomHandle=n.options.createCustomHandle),this.wrapper=this.createWrapper(),this.container=this.createContainer(),this.applyInitialSize(),this.attachHandles(),this.editor.on(\"update\",this.handleEditorUpdate.bind(this))}get dom(){return this.container}get contentDOM(){var n;return(n=this.contentElement)!==null&&n!==void 0?n:null}handleEditorUpdate(){const n=this.editor.isEditable;n!==this.lastEditableState&&(this.lastEditableState=n,n?n&&this.handleMap.size===0&&this.attachHandles():this.removeHandles())}update(n,t,e){return n.type!==this.node.type?!1:(this.node=n,this.onUpdate?this.onUpdate(n,t,e):!0)}destroy(){this.isResizing&&(this.container.dataset.resizeState=\"false\",this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener(\"mousemove\",this.handleMouseMove),document.removeEventListener(\"mouseup\",this.handleMouseUp),document.removeEventListener(\"keydown\",this.handleKeyDown),document.removeEventListener(\"keyup\",this.handleKeyUp),this.isResizing=!1,this.activeHandle=null),this.editor.off(\"update\",this.handleEditorUpdate.bind(this)),this.container.remove()}createContainer(){const n=document.createElement(\"div\");return n.dataset.resizeContainer=\"\",n.dataset.node=this.node.type.name,n.style.display=this.node.type.isInline?\"inline-flex\":\"flex\",this.classNames.container&&(n.className=this.classNames.container),n.appendChild(this.wrapper),n}createWrapper(){const n=document.createElement(\"div\");return n.style.position=\"relative\",n.style.display=\"block\",n.dataset.resizeWrapper=\"\",this.classNames.wrapper&&(n.className=this.classNames.wrapper),n.appendChild(this.element),n}createHandle(n){const t=document.createElement(\"div\");return t.dataset.resizeHandle=n,t.style.position=\"absolute\",this.classNames.handle&&(t.className=this.classNames.handle),t}positionHandle(n,t){const e=t.includes(\"top\"),i=t.includes(\"bottom\"),s=t.includes(\"left\"),o=t.includes(\"right\");e&&(n.style.top=\"0\"),i&&(n.style.bottom=\"0\"),s&&(n.style.left=\"0\"),o&&(n.style.right=\"0\"),(t===\"top\"||t===\"bottom\")&&(n.style.left=\"0\",n.style.right=\"0\"),(t===\"left\"||t===\"right\")&&(n.style.top=\"0\",n.style.bottom=\"0\")}attachHandles(){this.directions.forEach(n=>{let t;this.createCustomHandle?t=this.createCustomHandle(n):t=this.createHandle(n),t instanceof HTMLElement||(console.warn(`[ResizableNodeView] createCustomHandle(\"${n}\") did not return an HTMLElement. Falling back to default handle.`),t=this.createHandle(n)),this.createCustomHandle||this.positionHandle(t,n),t.addEventListener(\"mousedown\",e=>this.handleResizeStart(e,n)),t.addEventListener(\"touchstart\",e=>this.handleResizeStart(e,n)),this.handleMap.set(n,t),this.wrapper.appendChild(t)})}removeHandles(){this.handleMap.forEach(n=>n.remove()),this.handleMap.clear()}applyInitialSize(){const n=this.node.attrs.width,t=this.node.attrs.height;n?(this.element.style.width=`${n}px`,this.initialWidth=n):this.initialWidth=this.element.offsetWidth,t?(this.element.style.height=`${t}px`,this.initialHeight=t):this.initialHeight=this.element.offsetHeight,this.initialWidth>0&&this.initialHeight>0&&(this.aspectRatio=this.initialWidth/this.initialHeight)}handleResizeStart(n,t){n.preventDefault(),n.stopPropagation(),this.isResizing=!0,this.activeHandle=t,dD(n)?(this.startX=n.touches[0].clientX,this.startY=n.touches[0].clientY):(this.startX=n.clientX,this.startY=n.clientY),this.startWidth=this.element.offsetWidth,this.startHeight=this.element.offsetHeight,this.startWidth>0&&this.startHeight>0&&(this.aspectRatio=this.startWidth/this.startHeight),this.getPos(),this.container.dataset.resizeState=\"true\",this.classNames.resizing&&this.container.classList.add(this.classNames.resizing),document.addEventListener(\"mousemove\",this.handleMouseMove),document.addEventListener(\"touchmove\",this.handleTouchMove),document.addEventListener(\"mouseup\",this.handleMouseUp),document.addEventListener(\"keydown\",this.handleKeyDown),document.addEventListener(\"keyup\",this.handleKeyUp)}handleResize(n,t){if(!this.activeHandle)return;const e=this.preserveAspectRatio||this.isShiftKeyPressed,{width:i,height:s}=this.calculateNewDimensions(this.activeHandle,n,t),o=this.applyConstraints(i,s,e);this.element.style.width=`${o.width}px`,this.element.style.height=`${o.height}px`,this.onResize&&this.onResize(o.width,o.height)}calculateNewDimensions(n,t,e){let i=this.startWidth,s=this.startHeight;const o=n.includes(\"right\"),u=n.includes(\"left\"),c=n.includes(\"bottom\"),d=n.includes(\"top\");return o?i=this.startWidth+t:u&&(i=this.startWidth-t),c?s=this.startHeight+e:d&&(s=this.startHeight-e),(n===\"right\"||n===\"left\")&&(i=this.startWidth+(o?t:-t)),(n===\"top\"||n===\"bottom\")&&(s=this.startHeight+(c?e:-e)),this.preserveAspectRatio||this.isShiftKeyPressed?this.applyAspectRatio(i,s,n):{width:i,height:s}}applyConstraints(n,t,e){var i,s;if(!e){var o,u;let p=Math.max(this.minSize.width,n),m=Math.max(this.minSize.height,t);return!((o=this.maxSize)===null||o===void 0)&&o.width&&(p=Math.min(this.maxSize.width,p)),!((u=this.maxSize)===null||u===void 0)&&u.height&&(m=Math.min(this.maxSize.height,m)),{width:p,height:m}}let c=n,d=t;return c<this.minSize.width&&(c=this.minSize.width,d=c/this.aspectRatio),d<this.minSize.height&&(d=this.minSize.height,c=d*this.aspectRatio),!((i=this.maxSize)===null||i===void 0)&&i.width&&c>this.maxSize.width&&(c=this.maxSize.width,d=c/this.aspectRatio),!((s=this.maxSize)===null||s===void 0)&&s.height&&d>this.maxSize.height&&(d=this.maxSize.height,c=d*this.aspectRatio),{width:c,height:d}}applyAspectRatio(n,t,e){const i=e===\"left\"||e===\"right\",s=e===\"top\"||e===\"bottom\";return i?{width:n,height:n/this.aspectRatio}:s?{width:t*this.aspectRatio,height:t}:{width:n,height:n/this.aspectRatio}}},Ne=class LE extends Up{constructor(...t){super(...t),this.type=\"node\"}static create(t={}){const e=typeof t==\"function\"?t():t;return new LE(e)}configure(t){return super.configure(t)}extend(t){const e=typeof t==\"function\"?t():t;return super.extend(e)}};function ri(n){return new DE({find:n.find,handler:({state:t,range:e,match:i,pasteEvent:s})=>{const o=Ot(n.getAttributes,void 0,i,s);if(o===!1||o===null)return null;const{tr:u}=t,c=i[i.length-1],d=i[0];let p=e.to;if(c){const m=d.search(/\\S/),y=e.from+d.indexOf(c),b=y+c.length;if(vc(e.from,e.to,t.doc).filter(v=>v.mark.type.excluded.find(E=>E===n.type&&E!==v.mark.type)).filter(v=>v.to>y).length)return null;b<e.to&&u.delete(b,e.to),y>e.from&&u.delete(e.from+m,y),p=e.from+m+c.length,u.addMark(e.from+m,p,n.type.create(o||{})),i.index!==void 0&&i.input!==void 0&&i.index+i[0].length>=i.input.length||u.removeStoredMark(n.type)}}})}const{getOwnPropertyNames:pD,getOwnPropertySymbols:mD}=Object,{hasOwnProperty:gD}=Object.prototype;function Yl(n,t){return function(i,s,o){return n(i,s,o)&&t(i,s,o)}}function Xl(n){return function(e,i,s){if(!e||!i||typeof e!=\"object\"||typeof i!=\"object\")return n(e,i,s);const{cache:o}=s,u=o.get(e),c=o.get(i);if(u&&c)return u===i&&c===e;o.set(e,i),o.set(i,e);const d=n(e,i,s);return o.delete(e),o.delete(i),d}}function yD(n){return n!=null?n[Symbol.toStringTag]:void 0}function Iv(n){return pD(n).concat(mD(n))}const bD=Object.hasOwn||((n,t)=>gD.call(n,t));function Lr(n,t){return n===t||!n&&!t&&n!==n&&t!==t}const vD=\"__v\",SD=\"__o\",ED=\"_owner\",{getOwnPropertyDescriptor:rp,keys:jv}=Object,TD=rp(Object.getPrototypeOf(Int8Array.prototype),Symbol.toStringTag).get;function xD(n,t){return n.byteLength===t.byteLength&&Nu(new Uint8Array(n),new Uint8Array(t))}function MD(n,t,e){let i=n.length;if(t.length!==i)return!1;for(;i-- >0;)if(!e.equals(n[i],t[i],i,i,n,t,e))return!1;return!0}function kD(n,t){return n.byteLength===t.byteLength&&Nu(new Uint8Array(n.buffer,n.byteOffset,n.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function AD(n,t){return Lr(n.getTime(),t.getTime())}function qv(n,t,e){return n.name===t.name&&n.message===t.message&&n.stack===t.stack&&e.equals(n.cause,t.cause,\"cause\",\"cause\",n,t,e)}function CD(n,t){return n===t}function Vv(n,t,e){const i=n.size;if(i!==t.size)return!1;if(!i)return!0;const s=new Array(i),o=n.entries();let u,c,d=0;for(;(u=o.next())&&!u.done;){const p=t.entries();let m=!1,y=0;for(;(c=p.next())&&!c.done;){if(s[y]){y++;continue}const b=u.value,v=c.value;if(e.equals(b[0],v[0],d,y,n,t,e)&&e.equals(b[1],v[1],b[0],v[0],n,t,e)){m=s[y]=!0;break}y++}if(!m)return!1;d++}return!0}const OD=Lr;function $v(n,t,e){const i=jv(n);let s=i.length;if(jv(t).length!==s)return!1;for(;s-- >0;)if(!zE(n,t,e,i[s]))return!1;return!0}function Ms(n,t,e){const i=Iv(n);let s=i.length;if(Iv(t).length!==s)return!1;let o,u,c;for(;s-- >0;)if(o=i[s],!zE(n,t,e,o)||(u=rp(n,o),c=rp(t,o),(u||c)&&(!u||!c||u.configurable!==c.configurable||u.enumerable!==c.enumerable||u.writable!==c.writable)))return!1;return!0}function wD(n,t){return Lr(n.valueOf(),t.valueOf())}function ND(n,t){return n.source===t.source&&n.flags===t.flags}function Pv(n,t,e){const i=n.size;if(i!==t.size)return!1;if(!i)return!0;const s=new Array(i),o=n.values();let u,c;for(;(u=o.next())&&!u.done;){const d=t.values();let p=!1,m=0;for(;(c=d.next())&&!c.done;){if(!s[m]&&e.equals(u.value,c.value,u.value,c.value,n,t,e)){p=s[m]=!0;break}m++}if(!p)return!1}return!0}function Nu(n,t){let e=n.length;if(t.length!==e||n.byteOffset!==t.byteOffset)return!1;const i=TD.call(n);if(i===\"Float64Array\"||i===\"Float32Array\"||i===\"Float16Array\"){for(;e-- >0;)if(n[e]!==t[e]&&(n[e]===n[e]||t[e]===t[e]))return!1;return!0}for(;e-- >0;)if(n[e]!==t[e])return!1;return!0}function DD(n,t){return n.href===t.href?!0:n.protocol===t.protocol&&n.username===t.username&&n.password===t.password&&n.host===t.host&&n.pathname===t.pathname&&n.hash===t.hash&&RD(n.searchParams,t.searchParams)}function RD(n,t){const e=n.toString(),i=t.toString();return e===i||Kv(e)===Kv(i)}function Kv(n){return n.split(\"&\").sort().join(\"&\")}function zE(n,t,e,i){return(i===ED||i===SD||i===vD)&&(n.$$typeof||t.$$typeof)?!0:bD(t,i)&&e.equals(n[i],t[i],i,i,n,t,e)}const LD=\"[object ArrayBuffer]\",zD=\"[object Arguments]\",BD=\"[object Boolean]\",HD=\"[object DataView]\",_D=\"[object Date]\",UD=\"[object Error]\",ID=\"[object Map]\",jD=\"[object Number]\",qD=\"[object Object]\",VD=\"[object RegExp]\",$D=\"[object Set]\",PD=\"[object String]\",KD={\"[object Int8Array]\":!0,\"[object Uint8Array]\":!0,\"[object Uint8ClampedArray]\":!0,\"[object Int16Array]\":!0,\"[object Uint16Array]\":!0,\"[object Int32Array]\":!0,\"[object Uint32Array]\":!0,\"[object Float16Array]\":!0,\"[object Float32Array]\":!0,\"[object Float64Array]\":!0,\"[object BigInt64Array]\":!0,\"[object BigUint64Array]\":!0},GD=\"[object URL]\",YD=Object.prototype.toString;function XD({areArrayBuffersEqual:n,areArraysEqual:t,areDataViewsEqual:e,areDatesEqual:i,areErrorsEqual:s,areFunctionsEqual:o,areMapsEqual:u,areNumbersEqual:c,areObjectsEqual:d,arePrimitiveWrappersEqual:p,areRegExpsEqual:m,areSetsEqual:y,areTypedArraysEqual:b,areUrlsEqual:v,unknownTagComparators:E}){return function(x,O,B){if(x===O)return!0;if(x==null||O==null)return!1;const I=typeof x;if(I!==typeof O)return!1;if(I!==\"object\")return I===\"number\"?c(x,O,B):I===\"function\"?o(x,O,B):!1;const q=x.constructor;if(q!==O.constructor)return!1;if(q===Object)return d(x,O,B);if(Array.isArray(x))return t(x,O,B);if(q===Date)return i(x,O,B);if(q===RegExp)return m(x,O,B);if(q===Map)return u(x,O,B);if(q===Set)return y(x,O,B);if(q==null)return d(x,O,B);const P=YD.call(x);if(P===_D)return i(x,O,B);if(P===VD)return m(x,O,B);if(P===ID)return u(x,O,B);if(P===$D)return y(x,O,B);if(P===qD)return typeof x.then!=\"function\"&&typeof O.then!=\"function\"&&d(x,O,B);if(P===GD)return v(x,O,B);if(P===UD)return s(x,O,B);if(P===zD)return d(x,O,B);if(KD[P])return b(x,O,B);if(P===LD)return n(x,O,B);if(P===HD)return e(x,O,B);if(P===BD||P===jD||P===PD)return p(x,O,B);if(E){let et=E[P];if(!et){const Y=yD(x);Y&&(et=E[Y])}if(et)return et(x,O,B)}return!1}}function FD({circular:n,createCustomConfig:t,strict:e}){let i={areArrayBuffersEqual:xD,areArraysEqual:e?Ms:MD,areDataViewsEqual:kD,areDatesEqual:AD,areErrorsEqual:e?Yl(qv,Ms):Yl(qv,$v),areFunctionsEqual:CD,areMapsEqual:e?Yl(Vv,Ms):Vv,areNumbersEqual:OD,areObjectsEqual:e?Ms:$v,arePrimitiveWrappersEqual:wD,areRegExpsEqual:ND,areSetsEqual:e?Yl(Pv,Ms):Pv,areTypedArraysEqual:e?Yl(Nu,Ms):Nu,areUrlsEqual:DD,unknownTagComparators:void 0};if(t&&(i=Object.assign({},i,t(i))),n){const s=Xl(i.areArraysEqual),o=Xl(i.areErrorsEqual),u=Xl(i.areMapsEqual),c=Xl(i.areObjectsEqual),d=Xl(i.areSetsEqual);i=Object.assign({},i,{areArraysEqual:s,areErrorsEqual:o,areMapsEqual:u,areObjectsEqual:c,areSetsEqual:d})}return i}function QD(n){return function(t,e,i,s,o,u,c){return n(t,e,c)}}function JD({circular:n,comparator:t,createState:e,equals:i,strict:s}){if(e)return function(c,d){const{cache:p=n?new WeakMap:void 0,meta:m}=e();return t(c,d,{cache:p,equals:i,meta:m,strict:s})};if(n)return function(c,d){return t(c,d,{cache:new WeakMap,equals:i,meta:void 0,strict:s})};const o={cache:void 0,equals:i,meta:void 0,strict:s};return function(c,d){return t(c,d,o)}}Fi();Fi({strict:!0});const ZD=Fi({circular:!0});Fi({circular:!0,strict:!0});Fi({createInternalComparator:()=>Lr});Fi({strict:!0,createInternalComparator:()=>Lr});Fi({circular:!0,createInternalComparator:()=>Lr});Fi({circular:!0,createInternalComparator:()=>Lr,strict:!0});function Fi(n={}){const{circular:t=!1,createInternalComparator:e,createState:i,strict:s=!1}=n,o=FD(n),u=XD(o),c=e?e(u):QD(u);return JD({circular:t,comparator:u,createState:i,equals:c,strict:s})}var Mh={exports:{}},kh={};/**\n * @license React\n * use-sync-external-store-shim/with-selector.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */var Gv;function WD(){if(Gv)return kh;Gv=1;var n=wo(),t=J1();function e(p,m){return p===m&&(p!==0||1/p===1/m)||p!==p&&m!==m}var i=typeof Object.is==\"function\"?Object.is:e,s=t.useSyncExternalStore,o=n.useRef,u=n.useEffect,c=n.useMemo,d=n.useDebugValue;return kh.useSyncExternalStoreWithSelector=function(p,m,y,b,v){var E=o(null);if(E.current===null){var M={hasValue:!1,value:null};E.current=M}else M=E.current;E=c(function(){function O(et){if(!B){if(B=!0,I=et,et=b(et),v!==void 0&&M.hasValue){var Y=M.value;if(v(Y,et))return q=Y}return q=et}if(Y=q,i(I,et))return Y;var nt=b(et);return v!==void 0&&v(Y,nt)?(I=et,Y):(I=et,q=nt)}var B=!1,I,q,P=y===void 0?null:y;return[function(){return O(m())},P===null?void 0:function(){return O(P())}]},[m,y,b,v]);var x=s(p,E[0],E[1]);return u(function(){M.hasValue=!0,M.value=x},[x]),d(x),x},kh}var Yv;function tR(){return Yv||(Yv=1,Mh.exports=WD()),Mh.exports}var eR=tR();function nR(n,t){var e,i;if(n.isDestroyed||t.defaultPrevented||!t.cancelable||!n.isEditable||t.inputType!==\"insertParagraph\"&&t.inputType!==\"insertLineBreak\"||!Ao()&&!Wh())return;const s=n.view,o=s.root,u=(e=(i=o.getSelection)===null||i===void 0?void 0:i.call(o))!==null&&e!==void 0?e:s.dom.ownerDocument.getSelection(),c=u==null?void 0:u.anchorNode,d=(c==null?void 0:c.nodeType)===1?c:c==null?void 0:c.parentElement,p=d==null?void 0:d.closest(\"[data-node-view-content-react]\");if(!p||!s.dom.contains(p))return;const m=s.input.lastKeyCode;m===13&&(s.input.lastKeyCode=null),s.domObserver.forceFlush(),s.domObserver.flush();const y=new KeyboardEvent(\"keydown\",{key:\"Enter\",code:\"Enter\",keyCode:13,shiftKey:t.inputType===\"insertLineBreak\",bubbles:!0,cancelable:!0});s.someProp(\"handleKeyDown\",b=>b(s,y))?(t.preventDefault(),s.input.lastIOSEnter=0,clearTimeout(s.input.lastIOSEnterFallbackTimeout)):m===13&&(s.input.lastKeyCode=m)}const Xv=new Zt(\"reactMobileEnter\"),iR=(...n)=>t=>{n.forEach(e=>{typeof e==\"function\"?e(t):e&&(e.current=t)})},rR=({contentComponent:n})=>{const t=Z1.useSyncExternalStore(n.subscribe,n.getSnapshot,n.getServerSnapshot);return hn.jsx(hn.Fragment,{children:Object.values(t)})};function sR(){const n=new Set;let t={},e=!1;const i=()=>{e||!n.size||(e=!0,queueMicrotask(()=>{e=!1,n.forEach(s=>s())}))};return{subscribe(s){return n.add(s),()=>{n.delete(s)}},getSnapshot(){return t},getServerSnapshot(){return t},setRenderer(s,o){t={...t,[s]:cA.createPortal(o.reactElement,o.element,s)},i()},removeRenderer(s){const o={...t};delete o[s],t=o,i()}}}var lR=class extends Cr.Component{constructor(n){super(n),this.editorContentRef=Cr.createRef()}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){var n;const t=this.props.editor;if(t&&!t.isDestroyed&&(!((n=t.view.dom)===null||n===void 0)&&n.parentNode)){if(t.contentComponent)return;const e=this.editorContentRef.current;e.append(...t.view.dom.parentNode.childNodes),t.setOptions({element:e}),t.contentComponent=sR(),t.createNodeViews(),t.registerPlugin(new It({key:Xv,props:{handleDOMEvents:{beforeinput:(i,s)=>nR(t,s)}}})),t.isEditorContentInitialized=!0,this.forceUpdate()}}componentWillUnmount(){const n=this.props.editor;if(n){n.isEditorContentInitialized=!1,n.isDestroyed||(n.unregisterPlugin(Xv),n.view.setProps({nodeViews:{}})),n.contentComponent=null;try{var t;if(!(!((t=n.view.dom)===null||t===void 0)&&t.parentNode))return;const e=document.createElement(\"div\");e.append(...n.view.dom.parentNode.childNodes),n.setOptions({element:e})}catch{}}}render(){const{editor:n,innerRef:t,...e}=this.props;return hn.jsxs(hn.Fragment,{children:[hn.jsx(\"div\",{ref:iR(t,this.editorContentRef),...e}),(n==null?void 0:n.contentComponent)&&hn.jsx(rR,{contentComponent:n.contentComponent})]})}};const oR=ie.forwardRef((n,t)=>{const e=Cr.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[n.editor]);return Cr.createElement(lR,{key:e,innerRef:t,...n})}),BE=Cr.memo(oR),aR=typeof window<\"u\"?ie.useLayoutEffect:ie.useEffect;var uR=class{constructor(n){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=n,this.lastSnapshot={editor:n,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(n){return this.subscribers.add(n),()=>{this.subscribers.delete(n)}}watch(n){if(this.editor=n,this.editor){let t;const e=s=>{(s==null?void 0:s.transaction)!==void 0&&s.transaction===t||(t=s==null?void 0:s.transaction,this.transactionNumber+=1,this.subscribers.forEach(o=>o()))},i=this.editor;return i.on(\"transaction\",e),i.on(\"update\",e),()=>{i.off(\"transaction\",e),i.off(\"update\",e)}}}};function cR(n){var t;const[e]=ie.useState(()=>new uR(n.editor)),i=eR.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getServerSnapshot,n.selector,(t=n.equalityFn)!==null&&t!==void 0?t:ZD);return aR(()=>e.watch(n.editor),[n.editor,e]),ie.useDebugValue(i),i}const fR=!1,HE=typeof window>\"u\",dR=HE||!!(typeof window<\"u\"&&window.next);var hR=class _E{constructor(t){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId=\"\",this.options=t,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(t){this.editor=t,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(e=>e())}getInitialEditor(){const t=this.options.current.immediatelyRender;let e=t??!0;return HE?(e&&fR&&console.warn(\"SSR detected. `immediatelyRender` has been set to false to avoid hydration mismatches\"),e=!1):dR&&t===void 0&&(e=!1),e?this.createEditor():null}createEditor(){const t={...this.options.current,onBeforeCreate:(...e)=>{var i,s;return(i=(s=this.options.current).onBeforeCreate)===null||i===void 0?void 0:i.call(s,...e)},onBlur:(...e)=>{var i,s;return(i=(s=this.options.current).onBlur)===null||i===void 0?void 0:i.call(s,...e)},onCreate:(...e)=>{var i,s;return(i=(s=this.options.current).onCreate)===null||i===void 0?void 0:i.call(s,...e)},onDestroy:(...e)=>{var i,s;return(i=(s=this.options.current).onDestroy)===null||i===void 0?void 0:i.call(s,...e)},onFocus:(...e)=>{var i,s;return(i=(s=this.options.current).onFocus)===null||i===void 0?void 0:i.call(s,...e)},onSelectionUpdate:(...e)=>{var i,s;return(i=(s=this.options.current).onSelectionUpdate)===null||i===void 0?void 0:i.call(s,...e)},onTransaction:(...e)=>{var i,s;return(i=(s=this.options.current).onTransaction)===null||i===void 0?void 0:i.call(s,...e)},onUpdate:(...e)=>{var i,s;return(i=(s=this.options.current).onUpdate)===null||i===void 0?void 0:i.call(s,...e)},onContentError:(...e)=>{var i,s;return(i=(s=this.options.current).onContentError)===null||i===void 0?void 0:i.call(s,...e)},onDrop:(...e)=>{var i,s;return(i=(s=this.options.current).onDrop)===null||i===void 0?void 0:i.call(s,...e)},onPaste:(...e)=>{var i,s;return(i=(s=this.options.current).onPaste)===null||i===void 0?void 0:i.call(s,...e)},onDelete:(...e)=>{var i,s;return(i=(s=this.options.current).onDelete)===null||i===void 0?void 0:i.call(s,...e)},onMount:(...e)=>{var i,s;return(i=(s=this.options.current).onMount)===null||i===void 0?void 0:i.call(s,...e)},onUnmount:(...e)=>{var i,s;return(i=(s=this.options.current).onUnmount)===null||i===void 0?void 0:i.call(s,...e)}};return new cD(t)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(t){return this.subscriptions.add(t),()=>{this.subscriptions.delete(t)}}static compareOptions(t,e){return Object.keys(t).every(i=>[\"onCreate\",\"onBeforeCreate\",\"onDestroy\",\"onUpdate\",\"onTransaction\",\"onFocus\",\"onBlur\",\"onSelectionUpdate\",\"onContentError\",\"onDrop\",\"onPaste\"].includes(i)?!0:i===\"extensions\"&&t.extensions&&e.extensions?t.extensions.length!==e.extensions.length?!1:t.extensions.every((s,o)=>{var u;return s===((u=e.extensions)===null||u===void 0?void 0:u[o])}):t[i]===e[i])}onRender(t){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&t.length===0?_E.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(t),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(t){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=t;return}if(this.previousDeps.length===t.length&&this.previousDeps.every((e,i)=>e===t[i]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=t}scheduleDestroy(){const t=this.instanceId,e=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===t){e&&e.setOptions(this.options.current);return}e&&!e.isDestroyed&&(e.destroy(),this.instanceId===t&&this.setEditor(null))},1)}};function pR(n={},t=[]){const e=ie.useRef(n);e.current=n;const[i]=ie.useState(()=>new hR(e)),s=Z1.useSyncExternalStore(i.subscribe,i.getEditor,i.getServerSnapshot);return ie.useDebugValue(s),ie.useEffect(i.onRender(t)),cR({editor:s,selector:({transactionNumber:o})=>n.shouldRerenderOnTransaction===!1||n.shouldRerenderOnTransaction===void 0?null:n.immediatelyRender&&o===0?0:o+1}),s}const UE=ie.createContext({editor:null});UE.Consumer;const mR=ie.createContext({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),gR=()=>ie.useContext(mR);Cr.forwardRef((n,t)=>{const{onDragStart:e}=gR(),i=n.as||\"div\";return hn.jsx(i,{...n,ref:t,\"data-node-view-wrapper\":\"\",onDragStart:e,style:{whiteSpace:\"normal\",...n.style}})});Cr.createContext({markViewContentRef:()=>{}});const Ip=ie.createContext({get editor(){throw new Error(\"useTiptap must be used within a <Tiptap> provider\")}});Ip.displayName=\"TiptapContext\";const yR=()=>ie.useContext(Ip);function IE({children:n,...t}){const e=\"editor\"in t?t.editor:t.instance;if(!e)throw new Error(\"Tiptap: An editor instance is required. Pass a non-null `editor` prop.\");const i=ie.useMemo(()=>({editor:e}),[e]),s=ie.useMemo(()=>({editor:e}),[e]);return hn.jsx(UE.Provider,{value:s,children:hn.jsx(Ip.Provider,{value:i,children:n})})}IE.displayName=\"Tiptap\";function jE({...n}){const{editor:t}=yR();return hn.jsx(BE,{editor:t,...n})}jE.displayName=\"Tiptap.Content\";Object.assign(IE,{Content:jE});var qE=(n=>(n.Action=\"action\",n))(qE||{});class Ht{constructor({forceName:t,tiptapExtension:e,tiptapExtensionDeps:i,onBridgeMessage:s,onEditorMessage:o,extendEditorState:u,extendEditorInstance:c,extendCSS:d,config:p,extendConfig:m}){e?this.name=Array.isArray(e)?e.map(y=>y.name).join(\"+\"):e.name:this.name=t||\"BridgeExtension\",this.tiptapExtension=e,this.tiptapExtensionDeps=i,this.onBridgeMessage=s,this.onEditorMessage=o,this.extendEditorState=u,this.extendEditorInstance=c,this.extendCSS=d,this.config=p,this.extendConfig=m}clone(){return new Ht({...this,forceName:this.name})}configureExtension(t){const e=this.clone();return e.config=t,e}configureCSS(t){const e=this.clone();return e.extendCSS=t,e}extendExtension(t){const e=this.clone();return e.extendConfig=t,e}configureTiptapExtensionsOnRunTime(t,e){var i,s;return this.tiptapExtension&&(t&&(this.tiptapExtension=(i=this.tiptapExtension)==null?void 0:i.configure(t)),e&&(this.tiptapExtension=(s=this.tiptapExtension)==null?void 0:s.extend(e))),[this.tiptapExtension,...this.tiptapExtensionDeps||[]]}}class bR{constructor(){this.subscriptions={},this.subscriptions={}}onMessage(t,e){this.subscriptions[t]&&this.subscriptions[t].forEach(i=>{i(e)})}addListener(t,e){this.subscriptions[t]||(this.subscriptions[t]=[]),this.subscriptions[t].push(e)}sendAsyncMessage(t,e){const i=Math.random().toString(36).substring(7);return t.payload=t.payload||{},t.payload.messageId=i,new Promise(s=>{this.addListener(i,s),e(t)})}}const ks=new bR,VE=()=>{let n=!1;try{require(\"expo-constants\")&&(n=!0)}catch{n=!1}return n};class vR{constructor(){this.focus=!1,window.document.addEventListener(\"focus\",()=>{this.focus=!0},!0),window.document.addEventListener(\"blur\",()=>{this.focus=!1},!0)}get isFocused(){return this.focus}}const SR={isFocused:!1},ER=VE()?SR:new vR,TR=Ne.create({name:\"doc\",topNode:!0,content:\"block+\",renderMarkdown:(n,t)=>n.content?t.renderChildren(n.content,`\n\n`):\"\"});var xR=TR;const ou=\" \",Ah=\" \",MR=Ne.create({name:\"paragraph\",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:\"block\",content:\"inline*\",parseHTML(){return[{tag:\"p\"}]},renderHTML({HTMLAttributes:n}){return[\"p\",Vt(this.options.HTMLAttributes,n),0]},parseMarkdown:(n,t)=>{const e=n.tokens||[];if(e.length===1&&e[0].type===\"image\")return t.parseChildren([e[0]]);const i=t.parseInline(e);return e.length===1&&e[0].type===\"text\"&&(e[0].raw===ou||e[0].text===ou||e[0].raw===Ah||e[0].text===Ah)&&i.length===1&&i[0].type===\"text\"&&(i[0].text===ou||i[0].text===Ah)?t.createNode(\"paragraph\",void 0,[]):t.createNode(\"paragraph\",void 0,i)},renderMarkdown:(n,t,e)=>{if(!n)return\"\";const i=Array.isArray(n.content)?n.content:[];if(i.length===0){var s,o;const u=Array.isArray(e==null||(s=e.previousNode)===null||s===void 0?void 0:s.content)?e.previousNode.content:[];return(e==null||(o=e.previousNode)===null||o===void 0?void 0:o.type)===\"paragraph\"&&u.length===0?ou:\"\"}return t.renderChildren(i)},addCommands(){return{setParagraph:()=>({commands:n})=>n.setNode(this.name)}},addKeyboardShortcuts(){return{\"Mod-Alt-0\":()=>this.editor.commands.setParagraph()}}});var kR=MR;const AR=Ne.create({name:\"text\",group:\"inline\",parseMarkdown:n=>({type:\"text\",text:n.text||\"\"}),renderMarkdown:n=>n.text||\"\"});var CR=AR,eo=(n=>(n.SetSelection=\"set-selection\",n.GetHTML=\"get-html\",n.GetJSON=\"get-json\",n.GetText=\"get-text\",n.SendHTMLToNative=\"send-html-back\",n.SendTextToNative=\"send-text-back\",n.SendJSONToNative=\"send-json-back\",n.SetContent=\"set-content\",n.StateUpdate=\"stateUpdate\",n.Focus=\"focus\",n.Blur=\"blur\",n.EditorReady=\"editor-ready\",n.UpdateScrollThresholdAndMargin=\"update-scroll-threshold-and-margin\",n.ContentUpdate=\"content-update\",n.DocumentHeight=\"document-height\",n.SetEditable=\"set-editable\",n))(eo||{});const OR=new Ht({forceName:\"coreBridge\",tiptapExtension:xR,tiptapExtensionDeps:[kR,CR],onBridgeMessage:(n,t,e)=>t.type===\"set-content\"?(n.commands.setContent(t.payload.content),!0):(t.type===\"get-html\"&&e({type:\"send-html-back\",payload:{content:n.getHTML(),messageId:t.payload.messageId}}),t.type===\"get-json\"&&e({type:\"send-json-back\",payload:{content:n.getJSON(),messageId:t.payload.messageId}}),t.type===\"get-text\"&&e({type:\"send-text-back\",payload:{content:n.getText(),messageId:t.payload.messageId}}),t.type===\"set-selection\"?(n.commands.setTextSelection({from:t.payload.from,to:t.payload.to}),!0):t.type===\"focus\"?(n.commands.focus(t.payload),!0):t.type===\"blur\"?(n.commands.blur(),!0):t.type===\"update-scroll-threshold-and-margin\"?(n.setOptions({editorProps:{scrollThreshold:{top:0,bottom:t.payload,right:0,left:0},scrollMargin:{top:0,bottom:t.payload,right:0,left:0}}}),!0):t.type===\"set-editable\"?(n.setEditable(t.payload),!0):!1),onEditorMessage:({type:n,payload:t},e)=>n===\"send-html-back\"||n===\"send-text-back\"||n===\"send-json-back\"?(ks.onMessage(t.messageId,t.content),!0):(n===\"editor-ready\"&&e.autofocus&&e.focus(\"end\"),n===\"stateUpdate\"&&e._updateEditorState(t),n===\"content-update\"&&e._onContentUpdate(),!1),extendEditorInstance:(n,t,e,i,s)=>({updateScrollThresholdAndMargin:o=>n({type:\"update-scroll-threshold-and-margin\",payload:o}),setSelection:(o,u)=>{n({type:\"set-selection\",payload:{from:o,to:u}})},setContent:o=>{n({type:\"set-content\",payload:{content:o}})},getHTML:async()=>await ks.sendAsyncMessage({type:\"get-html\"},n),getText:async()=>await ks.sendAsyncMessage({type:\"get-text\"},n),getJSON:async()=>await ks.sendAsyncMessage({type:\"get-json\"},n),focus:o=>{var u;s===\"android\"?setTimeout(()=>{var c;(c=t==null?void 0:t.current)==null||c.requestFocus()},100):(u=t==null?void 0:t.current)==null||u.requestFocus(),e&&e.current&&i&&i({...e.current,isFocused:!0}),n({type:\"focus\",payload:o})},blur:()=>{n({type:\"blur\",payload:void 0})},injectJS:o=>{var u;(u=t==null?void 0:t.current)==null||u.injectJavaScript(o)},setEditable:o=>{n({type:\"set-editable\",payload:o})}}),extendEditorState:n=>({isFocused:ER.isFocused,isReady:!0,selection:{from:n.state.selection.from,to:n.state.selection.to},editable:n.isEditable,empty:n.isEmpty})}),wR=Bt.create({name:\"eventHandler\",addProseMirrorPlugins(){return[new It({key:new Zt(\"blueBackground\"),state:{init(){return xt.empty},apply(n,t,e,i){if(n.selection.empty)return xt.empty;{const s=[],{from:o,to:u}=n.selection;return s.push(Ce.inline(o,u,{class:\"highlight-background\"})),xt.create(i.doc,s)}}},props:{decorations(n){return this.getState(n)}}})]}});class NR{constructor(){this.connected=!1,this.resizeObserver=null,this.currentHeight=null}connect(t,e){this.connected=!0,this.currentHeight=t.getBoundingClientRect().height,e(this.currentHeight),this.resizeObserver=new ResizeObserver(i=>{for(let s of i){const o=s.target.getBoundingClientRect().height;this.currentHeight!==o&&(this.currentHeight=o,e(o))}}),this.resizeObserver.observe(t)}disconnect(){var t;(t=this.resizeObserver)==null||t.disconnect()}get height(){return this.currentHeight}}const DR={height:0,connect:()=>{},connected:!0},Fv=VE()?DR:new NR,Fl=n=>{var t;(t=window.ReactNativeWebView)==null||t.postMessage(JSON.stringify(n))},RR=n=>{const{tiptapOptions:t={},bridges:e=[]}=n||{},i=ie.useMemo(()=>JSON.parse(window.bridgeExtensionConfigMap||\"{}\"),[]);function s(m){return m!=null}const o=e.map(m=>{const y=i[m.name];if(!y)return null;const{optionsConfig:b,extendConfig:v}=y;return m.configureTiptapExtensionsOnRunTime(b,v)}).filter(s).flat(),u={...t,extensions:[...window.disableColorHighlight?[]:[wR],...o,...t.extensions||[]]},c=hk(m=>{let y={};const b=e.reduce((v,E)=>E.extendEditorState?Object.assign(v,E.extendEditorState(m)):v,y);Fl({type:eo.StateUpdate,payload:b})},10),d=window.initialContent||\"\",p=pR({content:d,onCreate:()=>Fl({type:eo.EditorReady,payload:void 0}),onUpdate:m=>{c(m.editor),Fl({type:eo.ContentUpdate,payload:void 0})},onSelectionUpdate:m=>c(m.editor),onTransaction:m=>c(m.editor),editable:window.editable,shouldRerenderOnTransaction:!0,...u});return ie.useEffect(()=>{if(!p)return;const m=b=>{e.forEach(v=>{v.onBridgeMessage&&v.onBridgeMessage(p,b,Fl)})},y=b=>{if(!(b instanceof MessageEvent))return;const v=JSON.parse(b.data);if(v.type===qE.Action){if(v.id){if(window.lastMessageID===v.id)return;window.lastMessageID=v.id}m(v.payload)}};return window.addEventListener(\"message\",y),document.addEventListener(\"message\",y),()=>{window.removeEventListener(\"message\",y),document.removeEventListener(\"message\",y)}},[p,e]),ie.useEffect(()=>{if(p&&!Fv.connected&&window.dynamicHeight){const m=document.querySelector(\".dynamic-height\");Fv.connect(document.querySelector(\".ProseMirror\"),y=>{m&&(m.scrollTop=0),Fl({type:eo.DocumentHeight,payload:y})})}},[p]),p},$E=new WeakSet,PE=new WeakSet;function pr(n){const t=n;return $E.add(t),t}function sp(n){return Array.isArray(n)&&$E.has(n)}function KE(n){return n.flatMap(t=>t==null?[]:Array.isArray(t)&&PE.has(t)&&!sp(t)?KE(t):[t])}function LR(n,t){if(n===\"slot\")return 0;if(n instanceof Function){const s=n(t);return Array.isArray(s)&&!sp(s)&&!PE.has(s)?pr(s):s}const{children:e,...i}=t??{};if(n===\"svg\")throw new Error(\"SVG elements are not supported in the JSX syntax, use the array syntax instead\");if(Array.isArray(e)){if(sp(e))return pr([n,i,e]);if(e.length===0)return pr([n,i]);const s=KE(e);return s.length===0?pr([n,i]):pr([n,i,...s])}return e!=null?pr([n,i,e]):pr([n,i])}const Du=(n,t)=>LR(n,t),zR=(n,t)=>{var e;const{state:i}=n,{selection:s}=i;if(!s.empty)return!1;const{$from:o}=s;if(o.parentOffset!==0)return!1;const u=o.depth-1;if(u<0)return!1;const c=o.node(u),d=o.index(u);if(d===0)return!1;if(c.type===t)return n.commands.lift(t.name);const p=c.child(d-1);if(p.type!==t||!(!((e=p.lastChild)===null||e===void 0)&&e.isTextblock))return!1;const m=o.before()-1-1;return n.commands.command(({tr:y,dispatch:b})=>{if(!b)return!0;const v=o.parent.content,E=new X(v,0,0);return y.replace(m,o.after(),E),y.setSelection(lt.create(y.doc,m+v.size)),y.scrollIntoView(),b(y),!0})},BR=/^\\s*>\\s$/,HR=Ne.create({name:\"blockquote\",addOptions(){return{HTMLAttributes:{}}},content:\"block+\",group:\"block\",defining:!0,parseHTML(){return[{tag:\"blockquote\"}]},renderHTML({HTMLAttributes:n}){return Du(\"blockquote\",{...Vt(this.options.HTMLAttributes,n),children:Du(\"slot\",{})})},parseMarkdown:(n,t)=>{var e;const i=(e=t.parseBlockChildren)!==null&&e!==void 0?e:t.parseChildren;return t.createNode(\"blockquote\",void 0,i(n.tokens||[]))},renderMarkdown:(n,t)=>{if(!n.content)return\"\";const e=\">\",i=[];return n.content.forEach((s,o)=>{var u,c;const d=((u=(c=t.renderChild)===null||c===void 0?void 0:c.call(t,s,o))!==null&&u!==void 0?u:t.renderChildren([s])).split(`\n`).map(p=>p.trim()===\"\"?e:`${e} ${p}`);i.push(d.join(`\n`))}),i.join(`\n${e}\n`)},addCommands(){return{setBlockquote:()=>({commands:n})=>n.wrapIn(this.name),toggleBlockquote:()=>({commands:n})=>n.toggleWrap(this.name),unsetBlockquote:()=>({commands:n})=>n.lift(this.name)}},addKeyboardShortcuts(){return{\"Mod-Shift-b\":()=>this.editor.commands.toggleBlockquote(),Backspace:()=>zR(this.editor,this.type)}},addInputRules(){return[js({find:BR,type:this.type})]}});var _R=HR;const UR=new Ht({tiptapExtension:_R,onBridgeMessage:(n,t)=>(t.type===\"toggle-blockquote\"&&n.chain().focus().toggleBlockquote().run(),!1),extendEditorInstance:n=>({toggleBlockquote:()=>n({type:\"toggle-blockquote\"})}),extendEditorState:n=>({canToggleBlockquote:n.can().toggleBlockquote(),isBlockquoteActive:n.isActive(\"blockquote\")}),extendCSS:`\n blockquote {\n border-left: 3px solid #0d0d0d1a;\n padding-left: 1rem;\n }\n `}),IR=/(?:^|\\s)(\\*\\*(?!\\s+\\*\\*)((?:[^*]+))\\*\\*(?!\\s+\\*\\*))$/,jR=/(?:^|\\s)(\\*\\*(?!\\s+\\*\\*)((?:[^*]+))\\*\\*(?!\\s+\\*\\*))/g,qR=/(?:^|\\s)(__(?!\\s+__)((?:[^_]+))__(?!\\s+__))$/,VR=/(?:^|\\s)(__(?!\\s+__)((?:[^_]+))__(?!\\s+__))/g,$R=li.create({name:\"bold\",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:\"strong\"},{tag:\"b\",getAttrs:n=>n.style.fontWeight!==\"normal\"&&null},{style:\"font-weight=400\",clearMark:n=>n.type.name===this.name},{style:\"font-weight\",getAttrs:n=>/^(bold(er)?|[5-9]\\d{2,})$/.test(n)&&null}]},renderHTML({HTMLAttributes:n}){return Du(\"strong\",{...Vt(this.options.HTMLAttributes,n),children:Du(\"slot\",{})})},markdownTokenName:\"strong\",parseMarkdown:(n,t)=>t.applyMark(\"bold\",t.parseInline(n.tokens||[])),markdownOptions:{htmlReopen:{open:\"<strong>\",close:\"</strong>\"}},renderMarkdown:(n,t)=>`**${t.renderChildren(n)}**`,addCommands(){return{setBold:()=>({commands:n})=>n.setMark(this.name),toggleBold:()=>({commands:n})=>n.toggleMark(this.name),unsetBold:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{\"Mod-b\":()=>this.editor.commands.toggleBold(),\"Mod-B\":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Gi({find:IR,type:this.type}),Gi({find:qR,type:this.type})]},addPasteRules(){return[ri({find:jR,type:this.type}),ri({find:VR,type:this.type})]}});var PR=$R;const KR=new Ht({tiptapExtension:PR,onBridgeMessage:(n,t)=>(t.type===\"toggle-bold\"&&n.chain().focus().toggleBold().run(),!1),extendEditorInstance:n=>({toggleBold:()=>n({type:\"toggle-bold\"})}),extendEditorState:n=>({canToggleBold:n.can().toggleBold(),isBoldActive:n.isActive(\"bold\")})}),GR=\"listItem\",Qv=\"textStyle\",Jv=/^\\s*([-+*])\\s$/,GE=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:n}){return[\"ul\",Vt(this.options.HTMLAttributes,n),0]},markdownTokenName:\"list\",parseMarkdown:(n,t)=>n.type!==\"list\"||n.ordered?[]:{type:\"bulletList\",content:n.items?t.parseChildren(n.items):[]},renderMarkdown:(n,t)=>n.content?t.renderChildren(n.content,`\n`):\"\",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:n,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(GR,this.editor.getAttributes(Qv)).run():n.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{\"Mod-Shift-8\":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let n=js({find:Jv,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(n=js({find:Jv,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(Qv),editor:this.editor})),[n]}}),YR=(n,t,e)=>{const{selection:i}=n;if(!i.empty)return null;const{$from:s}=i;if(!s.parent.isTextblock||s.parentOffset!==s.parent.content.size)return null;let o=-1;for(let v=s.depth;v>0;v-=1)if(s.node(v).type.name===t){o=v;break}if(o<0)return null;const u=s.node(o),c=s.index(o);if(c+1>=u.childCount)return null;const d=u.child(c+1);if(!e.includes(d.type.name))return null;const p=n.schema.nodes[t];let m=!1;if(d.forEach(v=>{v.type===p&&v.childCount>1&&(m=!0)}),!m)return null;const y=n.doc.resolve(s.after()).nodeAfter;if(!y||!e.includes(y.type.name))return null;const b=[];return y.forEach(v=>{b.push(v)}),b.length===0?null:{listItemDepth:o,nestedList:y,nestedListPos:s.after(),insertPos:s.after(o),items:b}},XR=(n,t,e,i)=>{const s=YR(n,e,i);if(!s)return!1;const{selection:o}=n,{nestedList:u,nestedListPos:c,insertPos:d,items:p}=s,m=n.tr;m.delete(c,c+u.nodeSize);const y=m.mapping.map(d);return m.insert(y,j.from(p)),m.setSelection(o.map(m.doc,m.mapping)),t&&t(m),!0},FR=(n,t,e)=>XR(n.state,n.view.dispatch,t,e),YE=(n,t)=>Bt.create({name:`${n}BranchingDeleteKeymap`,priority:101,addKeyboardShortcuts(){const e=()=>FR(this.editor,n,t);return{Delete:e,\"Mod-Delete\":e}}}),XE=[[1e3,\"m\"],[900,\"cm\"],[500,\"d\"],[400,\"cd\"],[100,\"c\"],[90,\"xc\"],[50,\"l\"],[40,\"xl\"],[10,\"x\"],[9,\"ix\"],[5,\"v\"],[4,\"iv\"],[1,\"i\"]],au=\"abcdefghijklmnopqrstuvwxyz\",FE=String.raw`\\d+|[ivxlcdmIVXLCDM]+|${\"[a-zA-Z]{1,2}\"}`;function Ec(n){let t=n,e=\"\";for(const[i,s]of XE)for(;t>=i;)e+=s,t-=i;return e}function jp(n){return Ec(n).toUpperCase()}function QE(n){const t=n.toLowerCase();let e=0,i=0;for(;e<t.length;){let s=!1;for(const[o,u]of XE)if(t.startsWith(u,e)){i+=o,e+=u.length,s=!0;break}if(!s)return 0}return i}function QR(n){if(!/^[ivxlcdmIVXLCDM]+$/.test(n))return!1;const t=QE(n);return t<=0?!1:(n===n.toLowerCase()?Ec(t):jp(t))===n}function JR(n){const t=n.toLowerCase();if(t.length===1)return t.charCodeAt(0)-97+1;if(t.length===2){const e=t.charCodeAt(0)-97,i=t.charCodeAt(1)-97;return(e+1)*26+i+1}return 0}function Ru(n){if(n<=26)return au[n-1];const t=Math.floor((n-1)/26)-1,e=(n-1)%26;return t<0?au[e]:au[t]+au[e]}function Tc(n){if(!(!n||/^\\d+$/.test(n))){if(QR(n))return n===n.toLowerCase()?\"i\":\"I\";if(/^[a-z]{1,2}$/.test(n))return\"a\";if(/^[A-Z]{1,2}$/.test(n))return\"A\"}}function qp(n){if(/^\\d+$/.test(n))return parseInt(n,10);const t=Tc(n);if(t===\"i\"||t===\"I\")return QE(n);if(t===\"a\"||t===\"A\"){const i=JR(n);return i>0?i:1}const e=parseInt(n,10);return Number.isNaN(e)?1:e}function ZR(n,t){if(n===\"numeric\")return String(t);switch(n){case\"a\":return Ru(t);case\"A\":return Ru(t).toUpperCase();case\"i\":return Ec(t);case\"I\":return jp(t);default:return String(t)}}function WR(n){var t;if(n.length===0)return!1;const e=(t=Tc(n[0]))!==null&&t!==void 0?t:\"numeric\",i=qp(n[0]);if(i<1)return!1;for(let s=0;s<n.length;s++){const o=ZR(e,i+s);if(n[s]!==o)return!1}return!0}function t2(n){return{type:Tc(n),start:qp(n)}}function e2(n){const{type:t,start:e}=t2(n),i={};return t&&(i.type=t),e!==1&&(i.start=e),i}function n2(n,t,e=\". \"){const i=t+1;if(!n||n===\"1\")return`${i}${e}`;switch(n){case\"a\":return`${Ru(i)}${e}`;case\"A\":return`${Ru(i).toUpperCase()}${e}`;case\"i\":return`${Ec(i)}${e}`;case\"I\":return`${jp(i)}${e}`;default:return`${i}${e}`}}function i2(n){var t,e;const i=(t=n.tokens)===null||t===void 0?void 0:t[0];return!!(n.text&&((e=n.tokens)===null||e===void 0?void 0:e.length)===1&&(i==null?void 0:i.type)===\"list\"&&i.ordered&&i.raw===n.text)}function r2(n,t){return t.tokenizeInline?t.parseInline(t.tokenizeInline(n)):t.parseInline([{type:\"text\",raw:n,text:n}])}const xc=Ne.create({name:\"listItem\",addOptions(){return{HTMLAttributes:{},bulletListTypeName:\"bulletList\",orderedListTypeName:\"orderedList\"}},content:\"paragraph block*\",defining:!0,parseHTML(){return[{tag:\"li\"}]},renderHTML({HTMLAttributes:n}){return[\"li\",Vt(this.options.HTMLAttributes,n),0]},markdownTokenName:\"list_item\",parseMarkdown:(n,t)=>{var e;if(n.type!==\"list_item\")return[];const i=(e=t.parseBlockChildren)!==null&&e!==void 0?e:t.parseChildren;let s=[];if(n.tokens&&n.tokens.length>0){if(i2(n))return{type:\"listItem\",content:[{type:\"paragraph\",content:r2(n.text||\"\",t)}]};if(n.tokens.some(o=>o.type===\"paragraph\"))s=i(n.tokens);else{const o=n.tokens[0];if(o&&o.type===\"text\"&&o.tokens&&o.tokens.length>0){if(s=[{type:\"paragraph\",content:t.parseInline(o.tokens)}],n.tokens.length>1){const u=i(n.tokens.slice(1));s.push(...u)}}else s=i(n.tokens)}}return s.length===0&&(s=[{type:\"paragraph\",content:[]}]),{type:\"listItem\",content:s}},renderMarkdown:(n,t,e)=>OE(n,t,i=>{if(i.parentType===\"bulletList\")return\"- \";if(i.parentType===\"orderedList\"){var s,o;const u=((s=i.meta)===null||s===void 0||(s=s.parentAttrs)===null||s===void 0?void 0:s.start)||1;return n2((o=i.meta)===null||o===void 0||(o=o.parentAttrs)===null||o===void 0?void 0:o.type,u-1+(i.index||0),\". \")}return\"- \"},e,{alignNestedToPrefix:(e==null?void 0:e.parentType)===\"orderedList\"}),addExtensions(){return[YE(this.name,[this.options.bulletListTypeName,this.options.orderedListTypeName])]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),\"Shift-Tab\":()=>this.editor.commands.liftListItem(this.name)}}}),Vp=(n,t)=>{const{$from:e}=t.selection,i=ae(n,t.schema);let s=null,o=e.depth,u=e.pos,c=null;for(;o>0&&c===null;)s=e.node(o),s.type===i?c=o:(o-=1,u-=1);return c===null?null:{$pos:t.doc.resolve(u),depth:c}},JE=(n,t)=>{const e=Vp(n,t);if(!e)return!1;const[,i]=Iw(t,n,e.$pos.pos+4);return i},s2=(n,t,e)=>{const{$anchor:i}=n.selection,s=Math.max(0,i.pos-2),o=n.doc.resolve(s).node();return!(!o||!e.includes(o.type.name))},Zv=(n,t,e)=>{if(n.commands.undoInputRule())return!0;if(n.state.selection.from!==n.state.selection.to)return!1;if(!ii(n.state,t)&&s2(n.state,t,e)){const{$anchor:o}=n.state.selection,u=n.state.doc.resolve(o.before()-1),c=[];u.node().descendants((m,y)=>{m.type.name===t&&c.push({node:m,pos:y})});const d=c.at(-1);if(!d)return!1;const p=n.state.doc.resolve(u.start()+d.pos+1);return n.chain().cut({from:o.start()-1,to:o.end()+1},p.end()).joinForward().run()}if(!ii(n.state,t)||!Pw(n.state))return!1;const{$from:i}=n.state.selection,s=i.depth-1;return i.node(s).type!==n.schema.nodes[t]||i.index(s)!==0?!1:n.chain().liftListItem(t).run()},l2=(n,t)=>{const e=JE(n,t),i=Vp(n,t);return!i||!e?!1:e>i.depth},o2=(n,t)=>{const e=JE(n,t),i=Vp(n,t);return!i||!e?!1:e<i.depth},Wv=(n,t)=>{if(!ii(n.state,t)||!$w(n.state,t))return!1;const{selection:e}=n.state,{$from:i,$to:s}=e;return!e.empty&&i.sameParent(s)?!1:l2(t,n.state)?n.chain().focus(n.state.selection.from+4).lift(t).joinBackward().run():o2(t,n.state)?n.chain().joinForward().joinBackward().run():n.commands.joinItemForward()},a2=(n,t,e)=>{const{state:i}=n,{selection:s}=i;if(!s.empty)return!1;const{$from:o}=s;if(o.parentOffset!==0||!o.parent.isTextblock||ii(i,t))return!1;const u=jw(o);if(!u||!e.includes(u.type.name))return!1;const c=u.lastChild;if(!c||c.type.name!==t)return!1;const d=o.parent;if(!c.canReplace(c.childCount,c.childCount,j.from(d)))return!1;const p=o.before(),m=o.after(),y=p-2;return n.commands.command(({tr:b,dispatch:v})=>(v&&(b.delete(p,m).insert(y,j.from(d)),b.setSelection(lt.create(b.doc,y+1)),b.scrollIntoView()),!0))},u2=Bt.create({name:\"listKeymap\",addOptions(){return{listTypes:[{itemName:\"listItem\",wrapperNames:[\"bulletList\",\"orderedList\"]},{itemName:\"taskItem\",wrapperNames:[\"taskList\"]}]}},addKeyboardShortcuts(){return{Delete:({editor:n})=>{let t=!1;return this.options.listTypes.forEach(({itemName:e})=>{n.state.schema.nodes[e]!==void 0&&Wv(n,e)&&(t=!0)}),t},\"Mod-Delete\":({editor:n})=>{let t=!1;return this.options.listTypes.forEach(({itemName:e})=>{n.state.schema.nodes[e]!==void 0&&Wv(n,e)&&(t=!0)}),t},Backspace:({editor:n})=>{let t=!1;return this.options.listTypes.forEach(({itemName:e,wrapperNames:i})=>{n.state.schema.nodes[e]!==void 0&&Zv(n,e,i)&&(t=!0)}),t},\"Mod-Backspace\":({editor:n})=>{let t=!1;return this.options.listTypes.forEach(({itemName:e,wrapperNames:i})=>{n.state.schema.nodes[e]!==void 0&&Zv(n,e,i)&&(t=!0)}),t},Tab:({editor:n})=>{for(const{itemName:t,wrapperNames:e}of this.options.listTypes)if(n.state.schema.nodes[t]!==void 0&&a2(n,t,e))return!0;return!1}}}}),Lu=new RegExp(`^(\\\\s*)(${FE})([.)])\\\\s+(.*)$`),c2=/^\\s/,ws={heading:/^#{1,6}(?:\\s|$)/,bulletItem:/^[-+*]\\s+/,codeFence:/^(?:```|~~~)/,blockMath:/^\\$\\$/,thematicBreak:/^(?:(?:-[ \\t]*){3,}|(?:_[ \\t]*){3,}|(?:\\*[ \\t]*){3,})$/};function f2(n){return Lu.test(n.trimStart())}function d2(n){const t=n.trimStart();return ws.bulletItem.test(t)||f2(t)||ws.heading.test(t)||ws.thematicBreak.test(t)&&!t.startsWith(\"-\")||/^>\\s?/.test(t)||ws.codeFence.test(t)||ws.blockMath.test(t)}function h2(n){return Object.values(ws).some(t=>t.test(n))}function p2(n){const t=[],e=[];let i=!1;return n.forEach(s=>{if(i){e.push(s);return}if(s.trim()===\"\"){i=!0,e.push(s);return}if(t.length>0&&d2(s)){i=!0,e.push(s);return}t.push(s)}),{paragraphLines:t,blockLines:e}}function t1(n){const t=[];let e=0,i=0;for(;e<n.length;){const s=n[e],o=s.match(Lu);if(!o)break;const[,u,c,d,p]=o,m=u.length,y=parseInt(c,10),b=isNaN(y)?Tc(c):void 0,v=isNaN(y)?qp(c):y,E=[p];let M=e+1;const x=[s];let O=!1;for(;M<n.length;){const B=n[M];if(B.match(Lu))break;if(B.trim()===\"\")x.push(B),E.push(\"\"),O=!0,M+=1;else if(B.match(c2)){const I=B.length-B.trimStart().length,q=m+c.length+1;x.push(B),E.push(B.slice(Math.min(I,q))),M+=1}else{if(O||h2(B))break;x.push(B),E.push(B),M+=1}}t.push({indent:m,number:v,type:b,content:E.join(`\n`).trim(),contentLines:E,raw:x.join(`\n`)}),i=M,e=M}return[t,i]}const m2=new RegExp(`^(${FE})([.)])\\\\s+(.+)$`);function g2(n){const t=n.split(`\n`).filter(i=>i.trim().length>0);if(t.length===0)return null;const e=[];for(const i of t){const s=i.trim().match(m2);if(!s)return null;e.push({marker:s[1],content:s[3]})}return WR(e.map(i=>i.marker))?{type:\"orderedList\",attrs:e2(e[0].marker),content:e.map(i=>({type:\"listItem\",content:[{type:\"paragraph\",content:[{type:\"text\",text:i.content}]}]}))}:null}function ZE(n,t,e){const i=[];let s=0;for(;s<n.length;){const o=n[s];if(o.indent===t){const{paragraphLines:u,blockLines:c}=p2(o.contentLines),d=u.join(`\n`).trim(),p=[];d&&p.push({type:\"paragraph\",raw:d,tokens:e.inlineTokens(d)});const m=c.join(`\n`).trim();if(m){const v=e.blockTokens(m);p.push(...v)}let y=s+1;const b=[];for(;y<n.length&&n[y].indent>t;)b.push(n[y]),y+=1;if(b.length>0){const v=ZE(b,Math.min(...b.map(E=>E.indent)),e);p.push({type:\"list\",ordered:!0,start:b[0].number,typeMarker:b[0].type,items:v,raw:b.map(E=>E.raw).join(`\n`)})}i.push({type:\"list_item\",raw:o.raw,tokens:p}),s=y}else s+=1}return i}function y2(n,t){return n.map(e=>{if(e.type!==\"list_item\")return t.parseChildren([e])[0];const i=[];return e.tokens&&e.tokens.length>0&&e.tokens.forEach(s=>{if(s.type===\"paragraph\"||s.type===\"list\"||s.type===\"blockquote\"||s.type===\"code\")i.push(...t.parseChildren([s]));else if(s.type===\"text\"&&s.tokens){const o=t.parseChildren([s]);i.push({type:\"paragraph\",content:o})}else{const o=t.parseChildren([s]);o.length>0&&i.push(...o)}}),{type:\"listItem\",content:i}})}const b2=64;function e1(n,t){const e=[];let i=0;for(;e.length<t;){const s=n.indexOf(`\n`,i);if(s===-1)return e.push(n.slice(i)),e;e.push(n.slice(i,s)),i=s+1}return e}function v2(n){const t=n.indexOf(`\n`),e=t===-1?n:n.slice(0,t);if(!Lu.test(e))return[[],0,[]];let i=b2,s=e1(n,i),o=t1(s);for(;o[1]===s.length&&s.length===i;)i*=2,s=e1(n,i),o=t1(s);return[o[0],o[1],s]}const S2=\"listItem\",n1=\"textStyle\",i1=/^(\\d+)\\.\\s$/;function r1(n){const t=n.match(/list-style-type\\s*:\\s*([^;]+)/i);if(!t)return null;switch(t[1].trim().toLowerCase()){case\"upper-roman\":return\"I\";case\"lower-roman\":return\"i\";case\"upper-alpha\":case\"upper-latin\":return\"A\";case\"lower-alpha\":case\"lower-latin\":return\"a\";default:return null}}const WE=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:n=>n.hasAttribute(\"start\")?parseInt(n.getAttribute(\"start\")||\"\",10):1},type:{default:null,parseHTML:n=>{const t=n.getAttribute(\"type\");if(t)return t;const e=n.getAttribute(\"style\");if(e){const s=r1(e);if(s)return s}const i=n.querySelector(\"li\");if(i){const s=i.getAttribute(\"style\");if(s){const o=r1(s);if(o)return o}}return null}}}},parseHTML(){return[{tag:\"ol\"}]},renderHTML({HTMLAttributes:n}){const{start:t,type:e,...i}=n,s=Vt(this.options.HTMLAttributes,i);return t!==1&&(s.start=t),e&&e!==\"1\"&&(s.type=e),[\"ol\",s,0]},markdownTokenName:\"list\",parseMarkdown:(n,t)=>{if(n.type!==\"list\"||!n.ordered)return[];const e=n.start||1,i=n.typeMarker,s=n.items?y2(n.items,t):[],o={};return e!==1&&(o.start=e),i&&(o.type=i),Object.keys(o).length>0?{type:\"orderedList\",attrs:o,content:s}:{type:\"orderedList\",content:s}},renderMarkdown:(n,t)=>n.content?t.renderChildren(n.content,`\n`):\"\",markdownTokenizer:{name:\"orderedList\",level:\"block\",start:()=>-1,tokenize:(n,t,e)=>{var i,s;const[o,u,c]=v2(n);if(o.length===0)return;const d=ZE(o,o[0].indent,e);if(d.length!==0)return{type:\"list\",ordered:!0,start:((i=o[0])===null||i===void 0?void 0:i.number)||1,typeMarker:(s=o[0])===null||s===void 0?void 0:s.type,items:d,raw:c.slice(0,u).join(`\n`)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:n,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(S2,this.editor.getAttributes(n1)).run():n.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{\"Mod-Shift-7\":()=>this.editor.commands.toggleOrderedList()}},addProseMirrorPlugins(){return[new It({props:{handlePaste:(n,t)=>{var e,i;const s=(e=t.clipboardData)===null||e===void 0?void 0:e.getData(\"text/html\");if(s!=null&&s.trim())return!1;const o=(i=t.clipboardData)===null||i===void 0?void 0:i.getData(\"text/plain\");if(!o)return!1;const u=g2(o);if(!u)return!1;try{const c=n.state.schema.nodeFromJSON(u),d=n.state.tr.replaceSelectionWith(c);return n.dispatch(d),!0}catch{return!1}}}})]},addInputRules(){const n=(e,i)=>(!i.attrs.type||i.attrs.type===\"1\")&&i.childCount+i.attrs.start===+e[1];let t=js({find:i1,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:n});return(this.options.keepMarks||this.options.keepAttributes)&&(t=js({find:i1,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(n1)}),joinPredicate:n,editor:this.editor})),[t]}}),E2=/^\\s*(\\[([( |x])?\\])\\s$/,T2=\"position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0\",x2=(n,t,e)=>{var i;return(e==null||(i=e.checkboxLabel)===null||i===void 0?void 0:i.call(e,n,t))||`Task item checkbox for ${n.textContent||\"empty task item\"}`},tT=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:n=>{const t=n.getAttribute(\"data-checked\");return t===\"\"||t===\"true\"},renderHTML:n=>({\"data-checked\":n.checked})}}},parseHTML(){return[{tag:`li[data-type=\"${this.name}\"]`,priority:51,contentElement:n=>{var t;return(t=n.querySelector(\"div\"))!==null&&t!==void 0?t:n}}]},renderHTML({node:n,HTMLAttributes:t}){return[\"li\",Vt(this.options.HTMLAttributes,t,{\"data-type\":this.name}),[\"label\",[\"input\",{type:\"checkbox\",checked:n.attrs.checked?\"checked\":null}],[\"span\"]],[\"div\",0]]},parseMarkdown:(n,t)=>{const e=[];if(n.tokens&&n.tokens.length>0?e.push(t.createNode(\"paragraph\",{},t.parseInline(n.tokens))):n.text?e.push(t.createNode(\"paragraph\",{},[t.createNode(\"text\",{text:n.text})])):e.push(t.createNode(\"paragraph\",{},[])),n.nestedTokens&&n.nestedTokens.length>0){const i=t.parseChildren(n.nestedTokens);e.push(...i)}return t.createNode(\"taskItem\",{checked:n.checked||!1},e)},renderMarkdown:(n,t)=>{var e;const i=`- [${!((e=n.attrs)===null||e===void 0)&&e.checked?\"x\":\" \"}] `;return OE(n,t,i)},addExtensions(){return this.options.nested?[YE(this.name,[this.options.taskListTypeName])]:[]},addKeyboardShortcuts(){const n={Enter:()=>this.editor.commands.splitListItem(this.name),\"Shift-Tab\":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...n,Tab:()=>this.editor.commands.sinkListItem(this.name)}:n},addNodeView(){return({node:n,HTMLAttributes:t,getPos:e,editor:i})=>{const s=document.createElement(\"li\"),o=document.createElement(\"label\"),u=document.createElement(\"span\"),c=document.createElement(\"input\"),d=document.createElement(\"div\");u.style.cssText=T2;const p=y=>{const b=x2(y,y.attrs.checked,this.options.a11y);c.setAttribute(\"aria-label\",b),u.textContent=b};p(n),o.contentEditable=\"false\",c.type=\"checkbox\",c.addEventListener(\"mousedown\",y=>y.preventDefault()),c.addEventListener(\"change\",y=>{if(!i.isEditable&&!this.options.onReadOnlyChecked){c.checked=!c.checked;return}const{checked:b}=y.target;i.isEditable&&typeof e==\"function\"&&i.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:v})=>{const E=e();if(typeof E!=\"number\")return!1;const M=v.doc.nodeAt(E);return v.setNodeMarkup(E,void 0,{...M==null?void 0:M.attrs,checked:b}),!0}).run(),!i.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(n,b)||(c.checked=!c.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([y,b])=>{s.setAttribute(y,b)}),s.dataset.checked=n.attrs.checked,c.checked=n.attrs.checked,o.append(c,u),s.append(o,d),Object.entries(t).forEach(([y,b])=>{s.setAttribute(y,b)});let m=new Set(Object.keys(t));return{dom:s,contentDOM:d,update:y=>{if(y.type!==this.type)return!1;s.dataset.checked=y.attrs.checked,c.checked=y.attrs.checked,p(y);const b=i.extensionManager.attributes,v=Is(y,b),E=new Set(Object.keys(v)),M=this.options.HTMLAttributes;return m.forEach(x=>{E.has(x)||(x in M?s.setAttribute(x,M[x]):s.removeAttribute(x))}),Object.entries(v).forEach(([x,O])=>{O==null?x in M?s.setAttribute(x,M[x]):s.removeAttribute(x):s.setAttribute(x,O)}),m=E,!0}}}},addInputRules(){return[js({find:E2,type:this.type,getAttributes:n=>({checked:n[n.length-1]===\"x\"})})]}}),eT=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:n}){return[\"ul\",Vt(this.options.HTMLAttributes,n,{\"data-type\":this.name}),0]},parseMarkdown:(n,t)=>t.createNode(\"taskList\",{},t.parseChildren(n.items||[])),renderMarkdown:(n,t)=>n.content?t.renderChildren(n.content,`\n`):\"\",markdownTokenizer:{name:\"taskList\",level:\"block\",start(n){var t;const e=(t=n.match(/^\\s*[-+*]\\s+\\[([ xX])\\]\\s+/))===null||t===void 0?void 0:t.index;return e!==void 0?e:-1},tokenize(n,t,e){const i=o=>{const u=Bv(o,{itemPattern:/^(\\s*)([-+*])\\s+\\[([ xX])\\]\\s+(.*)$/,extractItemData:c=>({indentLevel:c[1].length,mainContent:c[4],checked:c[3].toLowerCase()===\"x\"}),createToken:(c,d)=>({type:\"taskItem\",raw:\"\",mainContent:c.mainContent,indentLevel:c.indentLevel,checked:c.checked,text:c.mainContent,tokens:e.inlineTokens(c.mainContent),nestedTokens:d}),customNestedParser:i},e);if(u){const c={type:\"taskList\",raw:u.raw,items:u.items},d=o.slice(u.raw.length);return d.trim()?[c,...e.blockTokens(d)]:[c]}return e.blockTokens(o)},s=Bv(n,{itemPattern:/^(\\s*)([-+*])\\s+\\[([ xX])\\]\\s+(.*)$/,extractItemData:o=>({indentLevel:o[1].length,mainContent:o[4],checked:o[3].toLowerCase()===\"x\"}),createToken:(o,u)=>({type:\"taskItem\",raw:\"\",mainContent:o.mainContent,indentLevel:o.indentLevel,checked:o.checked,text:o.mainContent,tokens:e.inlineTokens(o.mainContent),nestedTokens:u}),customNestedParser:i},e);if(s)return{type:\"taskList\",raw:s.raw,items:s.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:n})=>n.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{\"Mod-Shift-9\":()=>this.editor.commands.toggleTaskList()}}});Bt.create({name:\"listKit\",addExtensions(){const n=[];return this.options.bulletList!==!1&&n.push(GE.configure(this.options.bulletList)),this.options.listItem!==!1&&n.push(xc.configure(this.options.listItem)),this.options.listKeymap!==!1&&n.push(u2.configure(this.options.listKeymap)),this.options.orderedList!==!1&&n.push(WE.configure(this.options.orderedList)),this.options.taskItem!==!1&&n.push(tT.configure(this.options.taskItem)),this.options.taskList!==!1&&n.push(eT.configure(this.options.taskList)),n}});const M2=new Ht({tiptapExtension:GE,tiptapExtensionDeps:[xc],onBridgeMessage:(n,t)=>(t.type===\"toggle-bulletList\"&&n.chain().focus().toggleBulletList().run(),!1),extendEditorInstance:n=>({toggleBulletList:()=>n({type:\"toggle-bulletList\"})}),extendEditorState:n=>({canToggleBulletList:n.can().toggleBulletList(),isBulletListActive:n.isActive(\"bulletList\")})}),k2=n=>{const t=/`([^`]+)`(?!`)$/.exec(n);return!t||t.index>0&&n[t.index-1]===\"`\"?null:{index:t.index,text:t[0],replaceWith:t[1]}},A2=n=>{const t=/`([^`]+)`(?!`)/g,e=[];let i;for(;(i=t.exec(n))!==null;)i.index>0&&n[i.index-1]===\"`\"||e.push({index:i.index,text:i[0],replaceWith:i[1]});return e};function C2(n){const t=new Set((n.match(/`+/g)||[]).map(i=>i.length));let e=1;for(;t.has(e);)e+=1;return e}const O2=li.create({name:\"code\",addOptions(){return{HTMLAttributes:{}}},excludes:\"_\",code:!0,exitable:!0,parseHTML(){return[{tag:\"code\"}]},renderHTML({HTMLAttributes:n}){return[\"code\",Vt(this.options.HTMLAttributes,n),0]},markdownTokenName:\"codespan\",parseMarkdown:(n,t)=>t.applyMark(\"code\",[{type:\"text\",text:n.text||\"\"}]),renderMarkdown:(n,t,e)=>{var i;if(!n.content)return\"\";const s=typeof(e==null||(i=e.meta)===null||i===void 0?void 0:i.markText)==\"string\"?e.meta.markText:\"\",o=\"`\".repeat(C2(s)),u=s.startsWith(\"`\")||s.endsWith(\"`\")?\" \":\"\";return`${o}${u}${t.renderChildren(n.content)}${u}${o}`},addCommands(){return{setCode:()=>({commands:n})=>n.setMark(this.name),toggleCode:()=>({commands:n})=>n.toggleMark(this.name),unsetCode:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{\"Mod-e\":()=>this.editor.commands.toggleCode()}},addInputRules(){return[Gi({find:k2,type:this.type})]},addPasteRules(){return[ri({find:A2,type:this.type})]}});var w2=O2;const N2=new Ht({tiptapExtension:w2,onBridgeMessage:(n,t)=>(t.type===\"toggle-code\"&&n.chain().focus().toggleCode().run(),!1),extendEditorInstance:n=>({toggleCode:()=>n({type:\"toggle-code\"})}),extendEditorState:n=>({canToggleCode:n.can().toggleCode(),isCodeActive:n.isActive(\"code\")}),extendCSS:`\n code {\n background-color: #6161611a;\n border-radius: 0.25em;\n box-decoration-break: clone;\n color: #616161;\n font-size: 0.9rem;\n padding: 0.25em;\n }\n `}),D2=20,nT=(n,t=0)=>{const e=[];return!n.children.length||t>D2||Array.from(n.children).forEach(i=>{i.tagName===\"SPAN\"?e.push(i):i.children.length&&e.push(...nT(i,t+1))}),e},R2=n=>{if(!n.children.length)return;const t=nT(n);t&&t.forEach(e=>{var i;const s=e.getAttribute(\"style\"),o=(i=e.parentElement)===null||i===void 0||(i=i.closest(\"span\"))===null||i===void 0?void 0:i.getAttribute(\"style\");e.setAttribute(\"style\",`${o};${s}`)})},$p=li.create({name:\"textStyle\",priority:101,addOptions(){return{HTMLAttributes:{},mergeNestedSpanStyles:!0}},parseHTML(){return[{tag:\"span\",consuming:!1,getAttrs:n=>n.hasAttribute(\"style\")?(this.options.mergeNestedSpanStyles&&R2(n),{}):!1}]},renderHTML({HTMLAttributes:n}){return[\"span\",Vt(this.options.HTMLAttributes,n),0]},addCommands(){return{toggleTextStyle:n=>({commands:t})=>t.toggleMark(this.name,n),removeEmptyTextStyle:()=>({tr:n})=>{const{selection:t}=n;return n.doc.nodesBetween(t.from,t.to,(e,i)=>{if(!e.isInline)return!0;e.marks.filter(s=>s.type===this.type).some(s=>Object.values(s.attrs).some(o=>!!o))||n.removeMark(i,i+e.nodeSize,this.type)}),!0}}}}),L2=Bt.create({name:\"backgroundColor\",addOptions(){return{types:[\"textStyle\"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{backgroundColor:{default:null,parseHTML:n=>{var t;const e=(t=Vs(n,\"background-color\"))!==null&&t!==void 0?t:n.style.backgroundColor;return e==null?void 0:e.replace(/['\"]+/g,\"\")},renderHTML:n=>$s(n.backgroundColor)?{style:`background-color: ${n.backgroundColor}`}:{}}}}]},addCommands(){return{setBackgroundColor:n=>({chain:t})=>t().setMark(\"textStyle\",{backgroundColor:n}).run(),unsetBackgroundColor:()=>({chain:n})=>n().setMark(\"textStyle\",{backgroundColor:null}).removeEmptyTextStyle().run()}}}),iT=Bt.create({name:\"color\",addOptions(){return{types:[\"textStyle\"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:n=>{var t;const e=(t=Vs(n,\"color\"))!==null&&t!==void 0?t:n.style.color;return e==null?void 0:e.replace(/['\"]+/g,\"\")},renderHTML:n=>$s(n.color)?{style:`color: ${n.color}`}:{}}}}]},addCommands(){return{setColor:n=>({chain:t})=>t().setMark(\"textStyle\",{color:n}).run(),unsetColor:()=>({chain:n})=>n().setMark(\"textStyle\",{color:null}).removeEmptyTextStyle().run()}}}),z2=Bt.create({name:\"fontFamily\",addOptions(){return{types:[\"textStyle\"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontFamily:{default:null,parseHTML:n=>{var t;return(t=Vs(n,\"font-family\"))!==null&&t!==void 0?t:n.style.fontFamily},renderHTML:n=>$s(n.fontFamily)?{style:`font-family: ${n.fontFamily}`}:{}}}}]},addCommands(){return{setFontFamily:n=>({chain:t})=>t().setMark(\"textStyle\",{fontFamily:n}).run(),unsetFontFamily:()=>({chain:n})=>n().setMark(\"textStyle\",{fontFamily:null}).removeEmptyTextStyle().run()}}}),B2=Bt.create({name:\"fontSize\",addOptions(){return{types:[\"textStyle\"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontSize:{default:null,parseHTML:n=>{var t;return(t=Vs(n,\"font-size\"))!==null&&t!==void 0?t:n.style.fontSize},renderHTML:n=>$s(n.fontSize)?{style:`font-size: ${n.fontSize}`}:{}}}}]},addCommands(){return{setFontSize:n=>({chain:t})=>t().setMark(\"textStyle\",{fontSize:n}).run(),unsetFontSize:()=>({chain:n})=>n().setMark(\"textStyle\",{fontSize:null}).removeEmptyTextStyle().run()}}}),H2=Bt.create({name:\"lineHeight\",addOptions(){return{types:[\"textStyle\"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{lineHeight:{default:null,parseHTML:n=>{var t;return(t=Vs(n,\"line-height\"))!==null&&t!==void 0?t:n.style.lineHeight},renderHTML:n=>$s(n.lineHeight)?{style:`line-height: ${n.lineHeight}`}:{}}}}]},addCommands(){return{setLineHeight:n=>({chain:t})=>t().setMark(\"textStyle\",{lineHeight:n}).run(),unsetLineHeight:()=>({chain:n})=>n().setMark(\"textStyle\",{lineHeight:null}).removeEmptyTextStyle().run()}}});Bt.create({name:\"textStyleKit\",addExtensions(){const n=[];return this.options.backgroundColor!==!1&&n.push(L2.configure(this.options.backgroundColor)),this.options.color!==!1&&n.push(iT.configure(this.options.color)),this.options.fontFamily!==!1&&n.push(z2.configure(this.options.fontFamily)),this.options.fontSize!==!1&&n.push(B2.configure(this.options.fontSize)),this.options.lineHeight!==!1&&n.push(H2.configure(this.options.lineHeight)),this.options.textStyle!==!1&&n.push($p.configure(this.options.textStyle)),n}});const _2=new Ht({tiptapExtension:iT,tiptapExtensionDeps:[$p],onBridgeMessage:(n,{type:t,payload:e})=>{switch(t){case\"set-color\":n.chain().focus().setColor(e).run();break;case\"unset-color\":n.chain().focus().unsetColor().run();break}return!1},extendEditorInstance:n=>({setColor:t=>n({type:\"set-color\",payload:t}),unsetColor:()=>n({type:\"unset-color\",payload:void 0})}),extendEditorState:n=>({activeColor:n.getAttributes(\"textStyle\").color})}),U2=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(n=>({tag:`h${n}`,attrs:{level:n}}))},renderHTML({node:n,HTMLAttributes:t}){return[`h${this.options.levels.includes(n.attrs.level)?n.attrs.level:this.options.levels[0]}`,Vt(this.options.HTMLAttributes,t),0]},parseMarkdown:(n,t)=>t.createNode(\"heading\",{level:n.depth||1},t.parseInline(n.tokens||[])),renderMarkdown:(n,t)=>{var e;const i=!((e=n.attrs)===null||e===void 0)&&e.level?parseInt(n.attrs.level,10):1,s=\"#\".repeat(i);return n.content?`${s} ${t.renderChildren(n.content)}`:\"\"},addCommands(){return{setHeading:n=>({commands:t})=>this.options.levels.includes(n.level)?t.setNode(this.name,n):!1,toggleHeading:n=>({commands:t})=>this.options.levels.includes(n.level)?t.toggleNode(this.name,\"paragraph\",n):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((n,t)=>({...n,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(n=>ip({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${n}})\\\\s$`),type:this.type,getAttributes:{level:n}}))}});var I2=U2;const j2=new Ht({tiptapExtension:I2,onBridgeMessage:(n,t)=>(t.type===\"toggle-heading\"&&n.chain().focus().toggleHeading({level:t.payload}).run(),!1),extendEditorInstance:n=>({toggleHeading:t=>n({type:\"toggle-heading\",payload:t})}),extendEditorState:n=>{var t;return{canToggleHeading:n.can().toggleHeading({level:1}),headingLevel:(t=n.getAttributes(\"heading\"))==null?void 0:t.level}}}),q2=/(?:^|\\s)(==(?!\\s+==)((?:[^=]+))==(?!\\s+==))$/,V2=/(?:^|\\s)(==(?!\\s+==)((?:[^=]+))==(?!\\s+==))/g,$2=li.create({name:\"highlight\",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:n=>n.getAttribute(\"data-color\")||Vs(n,\"background-color\")||n.style.backgroundColor,renderHTML:n=>$s(n.color)?{\"data-color\":n.color,style:`background-color: ${n.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:\"mark\"}]},renderHTML({HTMLAttributes:n}){return[\"mark\",Vt(this.options.HTMLAttributes,n),0]},renderMarkdown:(n,t)=>`==${t.renderChildren(n)}==`,parseMarkdown:(n,t)=>t.applyMark(\"highlight\",t.parseInline(n.tokens||[])),markdownTokenizer:{name:\"highlight\",level:\"inline\",start:n=>n.indexOf(\"==\"),tokenize(n,t,e){const i=/^(==)([^=]+)(==)/.exec(n);if(i){const s=i[2].trim(),o=e.inlineTokens(s);return{type:\"highlight\",raw:i[0],text:s,tokens:o}}}},addCommands(){return{setHighlight:n=>({commands:t})=>t.setMark(this.name,n),toggleHighlight:n=>({commands:t})=>t.toggleMark(this.name,n),unsetHighlight:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{\"Mod-Shift-h\":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[Gi({find:q2,type:this.type})]},addPasteRules(){return[ri({find:V2,type:this.type})]}}),P2=new Ht({tiptapExtension:$2.configure({multicolor:!0}),tiptapExtensionDeps:[$p],onBridgeMessage:(n,{type:t,payload:e})=>{switch(t){case\"set-highlight\":n.chain().focus().setHighlight({color:e}).run();break;case\"toggle-highlight\":n.chain().focus().toggleHighlight({color:e}).run();break;case\"unset-highlight\":n.chain().focus().unsetHighlight().run();break}return!1},extendEditorInstance:n=>({setHighlight:t=>n({type:\"set-highlight\",payload:t}),toggleHighlight:t=>n({type:\"toggle-highlight\",payload:t}),unsetHighlight:()=>n({type:\"unset-highlight\",payload:void 0})}),extendEditorState:n=>({activeHighlight:n.getAttributes(\"highlight\").color})});function K2(n={}){return new It({view(t){return new G2(t,n)}})}class G2{constructor(t,e){var i;this.editorView=t,this.cursorPos=null,this.element=null,this.timeout=-1,this.lastDragEvent=null,this.width=(i=e.width)!==null&&i!==void 0?i:1,this.color=e.color===!1?void 0:e.color||\"black\",this.class=e.class,this.handlers=[\"dragover\",\"dragend\",\"drop\",\"dragleave\"].map(s=>{let o=u=>{this[s](u)};return t.dom.addEventListener(s,o),{name:s,handler:o}})}destroy(){this.setCursor(null),this.handlers.forEach(({name:t,handler:e})=>this.editorView.dom.removeEventListener(t,e))}update(t,e){if(this.cursorPos!=null&&e.doc!=t.state.doc)if(this.lastDragEvent){let i=this.computeTarget(this.lastDragEvent);i==this.cursorPos?this.updateOverlay():this.setCursor(i)}else this.updateOverlay()}setCursor(t){t!=this.cursorPos&&(this.cursorPos=t,t==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let t=this.editorView.state.doc.resolve(this.cursorPos),e=!t.parent.inlineContent,i,s=this.editorView.dom,o=s.getBoundingClientRect(),u=o.width/s.offsetWidth,c=o.height/s.offsetHeight;if(e){let y=t.nodeBefore,b=t.nodeAfter;if(y||b){let v=this.editorView.nodeDOM(this.cursorPos-(y?y.nodeSize:0));if(v){let E=v.getBoundingClientRect(),M=y?E.bottom:E.top;y&&b&&(M=(M+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let x=this.width/2*c;i={left:E.left,right:E.right,top:M-x,bottom:M+x}}}}if(!i){let y=this.editorView.coordsAtPos(this.cursorPos),b=this.width/2*u;i={left:y.left-b,right:y.left+b,top:y.top,bottom:y.bottom}}let d=this.editorView.dom.offsetParent;this.element||(this.element=d.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\",e),this.element.classList.toggle(\"prosemirror-dropcursor-inline\",!e);let p,m;if(!d||d==document.body&&getComputedStyle(d).position==\"static\")p=-pageXOffset,m=-pageYOffset;else{let y=d.getBoundingClientRect(),b=y.width/d.offsetWidth,v=y.height/d.offsetHeight;p=y.left-d.scrollLeft*b,m=y.top-d.scrollTop*v}this.element.style.left=(i.left-p)/u+\"px\",this.element.style.top=(i.top-m)/c+\"px\",this.element.style.width=(i.right-i.left)/u+\"px\",this.element.style.height=(i.bottom-i.top)/c+\"px\"}scheduleRemoval(t){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),t)}computeTarget(t){let e=this.editorView.posAtCoords({left:t.clientX,top:t.clientY}),i=e&&e.inside>=0&&this.editorView.state.doc.nodeAt(e.inside),s=i&&i.type.spec.disableDropCursor,o=typeof s==\"function\"?s(this.editorView,e,t):s;if(!e||o)return null;let u=e.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let c=$1(this.editorView.state.doc,u,this.editorView.dragging.slice);c!=null&&(u=c)}return u}dragover(t){if(!this.editorView.editable)return;this.lastDragEvent=t;let e=this.computeTarget(t);e!=null&&(this.setCursor(e),this.scheduleRemoval(5e3))}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(t){this.editorView.dom.contains(t.relatedTarget)||this.setCursor(null)}}class Jt extends dt{constructor(t){super(t,t)}map(t,e){let i=t.resolve(e.map(this.head));return Jt.valid(i)?new Jt(i):dt.near(i)}content(){return X.empty}eq(t){return t instanceof Jt&&t.head==this.head}toJSON(){return{type:\"gapcursor\",pos:this.head}}static fromJSON(t,e){if(typeof e.pos!=\"number\")throw new RangeError(\"Invalid input for GapCursor.fromJSON\");return new Jt(t.resolve(e.pos))}getBookmark(){return new Pp(this.anchor)}static valid(t){let e=t.parent;if(e.inlineContent||!Y2(t)||!X2(t))return!1;let i=e.type.spec.allowGapCursor;if(i!=null)return i;let s=e.contentMatchAt(t.index()).defaultType;return s&&s.isTextblock}static findGapCursorFrom(t,e,i=!1){t:for(;;){if(!i&&Jt.valid(t))return t;let s=t.pos,o=null;for(let u=t.depth;;u--){let c=t.node(u);if(e>0?t.indexAfter(u)<c.childCount:t.index(u)>0){o=c.child(e>0?t.indexAfter(u):t.index(u)-1);break}else if(u==0)return null;s+=e;let d=t.doc.resolve(s);if(Jt.valid(d))return d}for(;;){let u=e>0?o.firstChild:o.lastChild;if(!u){if(o.isAtom&&!o.isText&&!rt.isSelectable(o)){t=t.doc.resolve(s+o.nodeSize*e),i=!1;continue t}break}o=u,s+=e;let c=t.doc.resolve(s);if(Jt.valid(c))return c}return null}}}Jt.prototype.visible=!1;Jt.findFrom=Jt.findGapCursorFrom;dt.jsonID(\"gapcursor\",Jt);class Pp{constructor(t){this.pos=t}map(t){return new Pp(t.map(this.pos))}resolve(t){let e=t.resolve(this.pos);return Jt.valid(e)?new Jt(e):dt.near(e)}}function rT(n){return n.isAtom||n.spec.isolating||n.spec.createGapCursor}function Y2(n){for(let t=n.depth;t>=0;t--){let e=n.index(t),i=n.node(t);if(e==0){if(i.type.spec.isolating)return!0;continue}for(let s=i.child(e-1);;s=s.lastChild){if(s.childCount==0&&!s.inlineContent||rT(s.type))return!0;if(s.inlineContent)return!1}}return!0}function X2(n){for(let t=n.depth;t>=0;t--){let e=n.indexAfter(t),i=n.node(t);if(e==i.childCount){if(i.type.spec.isolating)return!0;continue}for(let s=i.child(e);;s=s.firstChild){if(s.childCount==0&&!s.inlineContent||rT(s.type))return!0;if(s.inlineContent)return!1}}return!0}function F2(){return new It({props:{decorations:W2,createSelectionBetween(n,t,e){return t.pos==e.pos&&Jt.valid(e)?new Jt(e):null},handleClick:J2,handleKeyDown:Q2,handleDOMEvents:{beforeinput:Z2}}})}const Q2=FS({ArrowLeft:uu(\"horiz\",-1),ArrowRight:uu(\"horiz\",1),ArrowUp:uu(\"vert\",-1),ArrowDown:uu(\"vert\",1)});function uu(n,t){const e=n==\"vert\"?t>0?\"down\":\"up\":t>0?\"right\":\"left\";return function(i,s,o){let u=i.selection,c=t>0?u.$to:u.$from,d=u.empty;if(u instanceof lt){if(!o.endOfTextblock(e)||c.depth==0)return!1;d=!1,c=i.doc.resolve(t>0?c.after():c.before())}let p=Jt.findGapCursorFrom(c,t,d);return p?(s&&s(i.tr.setSelection(new Jt(p))),!0):!1}}function J2(n,t,e){if(!n||!n.editable)return!1;let i=n.state.doc.resolve(t);if(!Jt.valid(i))return!1;let s=n.posAtCoords({left:e.clientX,top:e.clientY});return s&&s.inside>-1&&rt.isSelectable(n.state.doc.nodeAt(s.inside))?!1:(n.dispatch(n.state.tr.setSelection(new Jt(i))),!0)}function Z2(n,t){if(t.inputType!=\"insertCompositionText\"||!(n.state.selection instanceof Jt))return!1;let{$from:e}=n.state.selection,i=e.parent.contentMatchAt(e.index()).findWrapping(n.state.schema.nodes.text);if(!i)return!1;let s=j.empty;for(let u=i.length-1;u>=0;u--)s=j.from(i[u].createAndFill(null,s));let o=n.state.tr.replace(e.pos,e.pos,new X(s,0,0));return o.setSelection(lt.near(o.doc.resolve(e.pos+1))),n.dispatch(o),!1}function W2(n){if(!(n.selection instanceof Jt))return null;let t=document.createElement(\"div\");return t.className=\"ProseMirror-gapcursor\",xt.create(n.doc,[Ce.widget(n.selection.head,t,{key:\"gapcursor\"})])}Bt.create({name:\"characterCount\",addOptions(){return{limit:null,autoTrim:!0,mode:\"textSize\",textCounter:n=>n.length,wordCounter:n=>n.split(\" \").filter(t=>t!==\"\").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=n=>{const t=(n==null?void 0:n.node)||this.editor.state.doc;if(((n==null?void 0:n.mode)||this.options.mode)===\"textSize\"){const e=t.textBetween(0,t.content.size,void 0,\" \");return this.options.textCounter(e)}return t.nodeSize},this.storage.words=n=>{const t=(n==null?void 0:n.node)||this.editor.state.doc,e=t.textBetween(0,t.content.size,\" \",\" \");return this.options.wordCounter(e)}},addProseMirrorPlugins(){let n=!1;return[new It({key:new Zt(\"characterCount\"),appendTransaction:(t,e,i)=>{if(n)return;const s=this.options.limit,o=this.options.autoTrim;if(s==null||s===0||o===!1){n=!0;return}const u=this.storage.characters({node:i.doc});if(u>s){const c=u-s,d=0,p=c;console.warn(`[CharacterCount] Initial content exceeded limit of ${s} characters. Content was automatically trimmed.`);const m=i.tr.deleteRange(d,p);return n=!0,m}n=!0},filterTransaction:(t,e)=>{const i=this.options.limit;if(!t.docChanged||i===0||i===null||i===void 0)return!0;const s=this.storage.characters({node:e.doc}),o=this.storage.characters({node:t.doc});if(o<=i||s>i&&o>i&&o<=s)return!0;if(s>i&&o>i&&o>s||!t.getMeta(\"paste\"))return!1;const u=t.selection.$head.pos,c=u-(o-i),d=u;return t.deleteRange(c,d),!(this.storage.characters({node:t.doc})>i)}})]}});const tL=Bt.create({name:\"dropCursor\",addOptions(){return{color:\"currentColor\",width:1,class:void 0}},addProseMirrorPlugins(){return[K2(this.options)]}});Bt.create({name:\"focus\",addOptions(){return{className:\"has-focus\",mode:\"all\"}},addProseMirrorPlugins(){return[new It({key:new Zt(\"focus\"),props:{decorations:({doc:n,selection:t})=>{const{isEditable:e,isFocused:i}=this.editor,{anchor:s}=t,o=[];if(!e||!i)return xt.create(n,[]);let u=0;this.options.mode===\"deepest\"&&n.descendants((d,p)=>{if(!d.isText){if(!(s>=p&&s<=p+d.nodeSize-1))return!1;u+=1}});let c=0;return n.descendants((d,p)=>{if(d.isText||!(s>=p&&s<=p+d.nodeSize-1))return!1;if(c+=1,this.options.mode===\"deepest\"&&u-c>0||this.options.mode===\"shallowest\"&&c>1)return this.options.mode===\"deepest\";o.push(Ce.node(p,p+d.nodeSize,{class:this.options.className}))}),xt.create(n,o)}}})]}});Bt.create({name:\"gapCursor\",addProseMirrorPlugins(){return[F2()]},extendNodeSchema(n){var t;const e={name:n.name,options:n.options,storage:n.storage};return{allowGapCursor:(t=Ot(J(n,\"allowGapCursor\",e)))!==null&&t!==void 0?t:null}}});const sT=\"placeholder\",s1=new Zt(\"tiptap__placeholder\");function lT(n){const{editor:t,placeholder:e,dataAttribute:i,pos:s,node:o,isEmptyDoc:u,hasAnchor:c,classes:{emptyNode:d,emptyEditor:p}}=n,m=[d];return u&&m.push(p),Ce.node(s,s+o.nodeSize,{class:m.join(\" \"),[i]:typeof e==\"function\"?e({editor:t,node:o,pos:s,hasAnchor:c}):e})}function oT(n,t){return typeof n==\"function\"?n(t):n}function aT({editor:n,options:t,dataAttribute:e,doc:i,selection:s,from:o,to:u}){const{anchor:c}=s,d=[],p=n.isEmpty;return i.nodesBetween(o,u,(m,y)=>{const b=c>=y&&c<=y+m.nodeSize,v=!m.isLeaf&&zo(m);return m.type.isTextblock&&(b||!t.showOnlyCurrent)&&v&&d.push(lT({editor:n,isEmptyDoc:p,dataAttribute:e,hasAnchor:b,placeholder:t.placeholder,classes:{emptyEditor:t.emptyEditorClass,emptyNode:oT(t.emptyNodeClass,{editor:n,node:m,pos:y,hasAnchor:b})},node:m,pos:y})),t.includeChildren}),d}function uT({editor:n,options:t,dataAttribute:e,doc:i,selection:s}){if(!(n.isEditable||!t.showOnlyWhenEditable))return null;const{anchor:o}=s,u=[],c=n.isEmpty;if(t.showOnlyCurrent&&!t.includeChildren){const d=i.resolve(o),p=d.depth>0?d.node(1):d.nodeAfter,m=d.depth>0?d.before(1):o;if(p&&p.type.isTextblock&&zo(p)){const y=o>=m&&o<=m+p.nodeSize;u.push(lT({editor:n,isEmptyDoc:c,dataAttribute:e,hasAnchor:y,placeholder:t.placeholder,classes:{emptyEditor:t.emptyEditorClass,emptyNode:oT(t.emptyNodeClass,{editor:n,node:p,pos:m,hasAnchor:y})},node:p,pos:m}))}}else u.push(...aT({editor:n,options:t,dataAttribute:e,doc:i,selection:s,from:0,to:i.content.size}));return xt.create(i,u)}function uo(n,t){const e=n.resolve(t);if(e.depth===0){var i;const o=(i=e.nodeAfter)!==null&&i!==void 0?i:e.nodeBefore;if(!o)return{from:t,to:t};const u=e.nodeAfter?t:t-o.nodeSize;return{from:u,to:u+o.nodeSize}}const s=e.before(1);return{from:s,to:s+e.node(1).nodeSize}}function co(n,t){return{from:Math.max(0,t.from-1),to:Math.min(n.content.size,t.to-1)}}function eL(n,t,e){const i=[];return n.forEach((s,o)=>{const u=o,c=u+s.nodeSize,d=u+1,p=c+1;d<e&&p>t&&i.push({from:u,to:c})}),i}function nL(n){if(n.length===0)return[];const t=[...n].sort((i,s)=>i.from-s.from),e=[{...t[0]}];for(let i=1;i<t.length;i+=1){const s=e[e.length-1],o=t[i];o.from<=s.to?s.to=Math.max(s.to,o.to):e.push({...o})}return e}function iL(n,t){const e=eL(n,t.from,t.to);return e.push(co(n,uo(n,t.from))),t.to>t.from?e.push(co(n,uo(n,Math.min(t.to,n.content.size+1)-1))):t.from<n.content.size+1&&e.push(co(n,uo(n,Math.min(t.from+1,n.content.size)))),e}function rL(n,t,e){const i=[];if(n.docChanged){const s=bc(n);for(const o of s)i.push(...iL(e.doc,o.newRange))}return n.selectionSet&&(i.push(co(e.doc,uo(e.doc,n.mapping.map(t.selection.anchor)))),i.push(co(e.doc,uo(e.doc,e.selection.anchor)))),nL(i)}function sL(n,t,e){const i=Math.max(0,Math.min(n,e.content.size));return{from:i,to:Math.max(i,Math.min(t,e.content.size))}}function lL({decorations:n,ranges:t,editor:e,options:i,dataAttribute:s,doc:o,selection:u}){let c=n;for(const d of t){const{from:p,to:m}=sL(d.from,d.to,o),y=c.find(p,m).filter(v=>v.from>=p&&v.to<=m);y.length&&(c=c.remove(y));const b=aT({editor:e,options:i,dataAttribute:s,doc:o,selection:u,from:p,to:m});b.length&&(c=c.add(o,b))}return c}function oL({editor:n,options:t,dataAttribute:e}){return{init(i,s){const o=uT({editor:n,options:t,dataAttribute:e,doc:s.doc,selection:s.selection});return o??xt.empty},apply(i,s,o,u){return!i.docChanged&&!i.selectionSet?s:lL({decorations:s.map(i.mapping,i.doc),ranges:rL(i,o,u),editor:n,options:t,dataAttribute:e,doc:u.doc,selection:u.selection})}}}function aL(n){return n.replace(/\\s+/g,\"-\").replace(/[^a-zA-Z0-9-]/g,\"\").replace(/^[0-9-]+/,\"\").replace(/^-+/,\"\").toLowerCase()}function uL({editor:n,options:t}){const e=t.dataAttribute?`data-${aL(t.dataAttribute)}`:`data-${sT}`,i=t.showOnlyCurrent&&!t.includeChildren;return new It({key:s1,...i?{}:{state:oL({editor:n,options:t,dataAttribute:e})},props:{decorations:i?({doc:s,selection:o})=>uT({editor:n,options:t,dataAttribute:e,doc:s,selection:o}):s=>{var o;return t.showOnlyWhenEditable&&!n.isEditable?xt.empty:(o=s1.getState(s))!==null&&o!==void 0?o:xt.empty}}})}const cL=Bt.create({name:\"placeholder\",addOptions(){return{emptyEditorClass:\"is-editor-empty\",emptyNodeClass:\"is-empty\",dataAttribute:sT,placeholder:\"Write something …\",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[uL({editor:this.editor,options:this.options})]}});function lp(n,t){return!n.selection.empty&&!Kw(n.selection)&&t.isEditable}function fL(n,t){return lp(n,t)&&!t.isFocused&&!t.view.dragging}function dL(){var n;(n=window.getSelection())===null||n===void 0||n.removeAllRanges()}function hL(n){n.focus()}Bt.create({name:\"selection\",addOptions(){return{className:\"selection\"}},addProseMirrorPlugins(){const{editor:n,options:t}=this;return[new It({key:new Zt(\"selection\"),props:{decorations(e){return fL(e,n)?xt.create(e.doc,[Ce.inline(e.selection.from,e.selection.to,{class:t.className})]):null},handleDOMEvents:{blur(e){return lp(e.state,n)&&dL(),!1},focus(e){return lp(e.state,n)&&requestAnimationFrame(()=>{!n.isDestroyed&&e.hasFocus()&&hL(e)}),!1}}}})]}});function l1({types:n,node:t}){return t&&Array.isArray(n)&&n.includes(t.type)||(t==null?void 0:t.type)===n}Bt.create({name:\"trailingNode\",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var n;const t=new Zt(this.name),e=this.options.node||((n=this.editor.schema.topNodeType.contentMatch.defaultType)===null||n===void 0?void 0:n.name)||\"paragraph\",i=Object.entries(this.editor.schema.nodes).map(([,s])=>s).filter(s=>(this.options.notAfter||[]).concat(e).includes(s.name));return[new It({key:t,appendTransaction:(s,o,u)=>{const{doc:c,tr:d,schema:p}=u,m=t.getState(u),y=c.content.size,b=p.nodes[e];if(!s.some(v=>v.getMeta(\"skipTrailingNode\"))&&m)return d.insert(y,b.create())},state:{init:(s,o)=>{const u=o.tr.doc.lastChild;return!l1({node:u,types:i})},apply:(s,o)=>{if(!s.docChanged||s.getMeta(\"__uniqueIDTransaction\"))return o;const u=s.doc.lastChild;return!l1({node:u,types:i})}}})]}});const pL=Bt.create({name:\"undoRedo\",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:n,dispatch:t})=>WS(n,t),redo:()=>({state:n,dispatch:t})=>tE(n,t)}},addProseMirrorPlugins(){return[RO(this.options)]},addKeyboardShortcuts(){return{\"Mod-z\":()=>this.editor.commands.undo(),\"Shift-Mod-z\":()=>this.editor.commands.redo(),\"Mod-y\":()=>this.editor.commands.redo(),\"Mod-я\":()=>this.editor.commands.undo(),\"Shift-Mod-я\":()=>this.editor.commands.redo()}}}),mL=new Ht({tiptapExtension:pL,onBridgeMessage:(n,t)=>(t.type===\"undo\"&&n.chain().focus().undo().run(),t.type===\"redo\"&&n.chain().focus().redo().run(),!1),extendEditorInstance:n=>({redo:()=>n({type:\"redo\"}),undo:()=>n({type:\"undo\"})}),extendEditorState:n=>{var t,e,i,s;return{canUndo:((e=(t=n.can()).undo)==null?void 0:e.call(t))??!1,canRedo:((s=(i=n.can()).redo)==null?void 0:s.call(i))??!1}}}),gL=/(?:^|\\s)(!\\[(.+|:?)]\\((\\S+)(?:(?:\\s+)[\"'](\\S+)[\"'])?\\))$/,yL=Ne.create({name:\"image\",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}},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:n}){return[\"img\",Vt(this.options.HTMLAttributes,n)]},parseMarkdown:(n,t)=>t.createNode(\"image\",{src:n.href,title:n.title,alt:n.text}),renderMarkdown:n=>{var t,e,i,s,o,u;const c=(t=(e=n.attrs)===null||e===void 0?void 0:e.src)!==null&&t!==void 0?t:\"\",d=(i=(s=n.attrs)===null||s===void 0?void 0:s.alt)!==null&&i!==void 0?i:\"\",p=(o=(u=n.attrs)===null||u===void 0?void 0:u.title)!==null&&o!==void 0?o:\"\";return p?``:``},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||typeof document>\"u\")return null;const{directions:n,minWidth:t,minHeight:e,alwaysPreserveAspectRatio:i}=this.options.resize,s=new Set([\"src\",\"width\",\"height\"]);return({node:o,getPos:u,HTMLAttributes:c,editor:d})=>{const p=document.createElement(\"img\");p.draggable=!1;const m=Vt(this.options.HTMLAttributes,c);Object.entries(m).forEach(([O,B])=>{if(B!=null)switch(O){case\"src\":case\"width\":case\"height\":break;default:p.setAttribute(O,B)}}),m.src!==null&&(p.src=m.src);let y={...c};const b=O=>{if(typeof O==\"string\"&&O!==\"\"){p.getAttribute(\"src\")!==O&&(p.src=O);return}p.hasAttribute(\"src\")&&p.removeAttribute(\"src\"),p.src!==\"\"&&(p.src=\"\")};b(c.src);const v=O=>{if(O.type!==o.type)return!1;const B=d.extensionManager.attributes.filter(q=>q.type===O.type.name),I=Is(O,B);return Object.keys(y).forEach(q=>{!s.has(q)&&!(q in I)&&p.removeAttribute(q)}),Object.entries(I).forEach(([q,P])=>{s.has(q)||(P!=null?p.setAttribute(q,P):p.removeAttribute(q))}),b(I.src),y=I,!0},E=new hD({element:p,editor:d,node:o,getPos:u,onResize:(O,B)=>{p.style.width=`${O}px`,p.style.height=`${B}px`},onCommit:(O,B)=>{const I=u();I!==void 0&&this.editor.chain().setNodeSelection(I).updateAttributes(this.name,{width:O,height:B}).run()},onUpdate:v,options:{directions:n,min:{width:t,height:e},preserveAspectRatio:i===!0}}),M=E.dom,x=()=>{M.style.visibility=\"\",M.style.pointerEvents=\"\"};return M.style.visibility=\"hidden\",M.style.pointerEvents=\"none\",p.complete&&p.naturalWidth>0?x():(p.onload=x,p.onerror=x),E}},addCommands(){return{setImage:n=>({commands:t})=>t.insertContent({type:this.name,attrs:n})}},addInputRules(){return[fD({find:gL,type:this.type,getAttributes:n=>{const[,,t,e,i]=n;return{src:e,alt:t,title:i}}})]}});var bL=yL;const cT=new Ht({tiptapExtension:bL.configure({allowBase64:!0}),onBridgeMessage:(n,t)=>(t.type===\"set-image\"&&n.chain().focus().setImage({src:t.payload}).setTextSelection(n.state.selection.to+1).run(),!1),extendEditorInstance:n=>({setImage:t=>n({type:\"set-image\",payload:t})}),extendEditorState:()=>({}),extendCSS:`\n img {\n height: auto;\n max-width: 100%;\n }\n\n img &.ProseMirror-selectednode {\n outline: 3px solid #68cef8;\n }\n `}),vL=/(?:^|\\s)(\\*(?!\\s+\\*)((?:[^*]+))\\*(?!\\s+\\*))$/,SL=/(?:^|\\s)(\\*(?!\\s+\\*)((?:[^*]+))\\*(?!\\s+\\*))/g,EL=/(?:^|\\s)(_(?!\\s+_)((?:[^_]+))_(?!\\s+_))$/,TL=/(?:^|\\s)(_(?!\\s+_)((?:[^_]+))_(?!\\s+_))/g,xL=li.create({name:\"italic\",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:\"em\"},{tag:\"i\",getAttrs:n=>n.style.fontStyle!==\"normal\"&&null},{style:\"font-style=normal\",clearMark:n=>n.type.name===this.name},{style:\"font-style=italic\"}]},renderHTML({HTMLAttributes:n}){return[\"em\",Vt(this.options.HTMLAttributes,n),0]},addCommands(){return{setItalic:()=>({commands:n})=>n.setMark(this.name),toggleItalic:()=>({commands:n})=>n.toggleMark(this.name),unsetItalic:()=>({commands:n})=>n.unsetMark(this.name)}},markdownTokenName:\"em\",parseMarkdown:(n,t)=>t.applyMark(\"italic\",t.parseInline(n.tokens||[])),markdownOptions:{htmlReopen:{open:\"<em>\",close:\"</em>\"}},renderMarkdown:(n,t)=>`*${t.renderChildren(n)}*`,addKeyboardShortcuts(){return{\"Mod-i\":()=>this.editor.commands.toggleItalic(),\"Mod-I\":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Gi({find:vL,type:this.type}),Gi({find:EL,type:this.type})]},addPasteRules(){return[ri({find:SL,type:this.type}),ri({find:TL,type:this.type})]}});var ML=xL;const kL=new Ht({tiptapExtension:ML,onBridgeMessage:(n,t)=>(t.type===\"toggle-italic\"&&n.chain().focus().toggleItalic().run(),!1),extendEditorInstance:n=>({toggleItalic:()=>n({type:\"toggle-italic\"})}),extendEditorState:n=>({canToggleItalic:n.can().toggleItalic(),isItalicActive:n.isActive(\"italic\")})}),AL=\"aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2\",CL=\"ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2\",op=\"numeric\",ap=\"ascii\",up=\"alpha\",fo=\"asciinumeric\",no=\"alphanumeric\",cp=\"domain\",fT=\"emoji\",OL=\"scheme\",wL=\"slashscheme\",Ch=\"whitespace\";function NL(n,t){return n in t||(t[n]=[]),t[n]}function Sr(n,t,e){t[op]&&(t[fo]=!0,t[no]=!0),t[ap]&&(t[fo]=!0,t[up]=!0),t[fo]&&(t[no]=!0),t[up]&&(t[no]=!0),t[no]&&(t[cp]=!0),t[fT]&&(t[cp]=!0);for(const i in t){const s=NL(i,e);s.indexOf(n)<0&&s.push(n)}}function DL(n,t){const e={};for(const i in t)t[i].indexOf(n)>=0&&(e[i]=!0);return e}function je(n=null){this.j={},this.jr=[],this.jd=null,this.t=n}je.groups={};je.prototype={accepts(){return!!this.t},go(n){const t=this,e=t.j[n];if(e)return e;for(let i=0;i<t.jr.length;i++){const s=t.jr[i][0],o=t.jr[i][1];if(o&&s.test(n))return o}return t.jd},has(n,t=!1){return t?n in this.j:!!this.go(n)},ta(n,t,e,i){for(let s=0;s<n.length;s++)this.tt(n[s],t,e,i)},tr(n,t,e,i){i=i||je.groups;let s;return t&&t.j?s=t:(s=new je(t),e&&i&&Sr(t,e,i)),this.jr.push([n,s]),s},ts(n,t,e,i){let s=this;const o=n.length;if(!o)return s;for(let u=0;u<o-1;u++)s=s.tt(n[u]);return s.tt(n[o-1],t,e,i)},tt(n,t,e,i){i=i||je.groups;const s=this;if(t&&t.j)return s.j[n]=t,t;const o=t;let u,c=s.go(n);if(c?(u=new je,Object.assign(u.j,c.j),u.jr.push.apply(u.jr,c.jr),u.jd=c.jd,u.t=c.t):u=new je,o){if(i)if(u.t&&typeof u.t==\"string\"){const d=Object.assign(DL(u.t,i),e);Sr(o,d,i)}else e&&Sr(o,e,i);u.t=o}return s.j[n]=u,u}};const pt=(n,t,e,i,s)=>n.ta(t,e,i,s),Ft=(n,t,e,i,s)=>n.tr(t,e,i,s),o1=(n,t,e,i,s)=>n.ts(t,e,i,s),$=(n,t,e,i,s)=>n.tt(t,e,i,s),Qn=\"WORD\",fp=\"UWORD\",dT=\"ASCIINUMERICAL\",hT=\"ALPHANUMERICAL\",Co=\"LOCALHOST\",dp=\"TLD\",hp=\"UTLD\",bu=\"SCHEME\",Ns=\"SLASH_SCHEME\",Kp=\"NUM\",pp=\"WS\",Gp=\"NL\",ho=\"OPENBRACE\",po=\"CLOSEBRACE\",zu=\"OPENBRACKET\",Bu=\"CLOSEBRACKET\",Hu=\"OPENPAREN\",_u=\"CLOSEPAREN\",Uu=\"OPENANGLEBRACKET\",Iu=\"CLOSEANGLEBRACKET\",ju=\"FULLWIDTHLEFTPAREN\",qu=\"FULLWIDTHRIGHTPAREN\",Vu=\"LEFTCORNERBRACKET\",$u=\"RIGHTCORNERBRACKET\",Pu=\"LEFTWHITECORNERBRACKET\",Ku=\"RIGHTWHITECORNERBRACKET\",Gu=\"FULLWIDTHLESSTHAN\",Yu=\"FULLWIDTHGREATERTHAN\",Xu=\"AMPERSAND\",Fu=\"APOSTROPHE\",Qu=\"ASTERISK\",Hi=\"AT\",Ju=\"BACKSLASH\",Zu=\"BACKTICK\",Wu=\"CARET\",Er=\"COLON\",Yp=\"COMMA\",tc=\"DOLLAR\",On=\"DOT\",ec=\"EQUALS\",Xp=\"EXCLAMATION\",fn=\"HYPHEN\",mo=\"PERCENT\",nc=\"PIPE\",ic=\"PLUS\",rc=\"POUND\",go=\"QUERY\",Fp=\"QUOTE\",pT=\"FULLWIDTHMIDDLEDOT\",Qp=\"SEMI\",wn=\"SLASH\",yo=\"TILDE\",sc=\"UNDERSCORE\",mT=\"EMOJI\",lc=\"SYM\";var gT=Object.freeze({__proto__:null,ALPHANUMERICAL:hT,AMPERSAND:Xu,APOSTROPHE:Fu,ASCIINUMERICAL:dT,ASTERISK:Qu,AT:Hi,BACKSLASH:Ju,BACKTICK:Zu,CARET:Wu,CLOSEANGLEBRACKET:Iu,CLOSEBRACE:po,CLOSEBRACKET:Bu,CLOSEPAREN:_u,COLON:Er,COMMA:Yp,DOLLAR:tc,DOT:On,EMOJI:mT,EQUALS:ec,EXCLAMATION:Xp,FULLWIDTHGREATERTHAN:Yu,FULLWIDTHLEFTPAREN:ju,FULLWIDTHLESSTHAN:Gu,FULLWIDTHMIDDLEDOT:pT,FULLWIDTHRIGHTPAREN:qu,HYPHEN:fn,LEFTCORNERBRACKET:Vu,LEFTWHITECORNERBRACKET:Pu,LOCALHOST:Co,NL:Gp,NUM:Kp,OPENANGLEBRACKET:Uu,OPENBRACE:ho,OPENBRACKET:zu,OPENPAREN:Hu,PERCENT:mo,PIPE:nc,PLUS:ic,POUND:rc,QUERY:go,QUOTE:Fp,RIGHTCORNERBRACKET:$u,RIGHTWHITECORNERBRACKET:Ku,SCHEME:bu,SEMI:Qp,SLASH:wn,SLASH_SCHEME:Ns,SYM:lc,TILDE:yo,TLD:dp,UNDERSCORE:sc,UTLD:hp,UWORD:fp,WORD:Qn,WS:pp});const Yn=/[a-z]/,Ql=new RegExp(\"\\\\p{L}\",\"u\"),Oh=new RegExp(\"\\\\p{Emoji}\",\"u\"),Xn=/\\d/,wh=/\\s/,a1=\"\\r\",Nh=`\n`,RL=\"️\",LL=\"\",Dh=\"\";let cu=null,fu=null;function zL(n=[]){const t={};je.groups=t;const e=new je;cu==null&&(cu=u1(AL)),fu==null&&(fu=u1(CL)),$(e,\"'\",Fu),$(e,\"{\",ho),$(e,\"}\",po),$(e,\"[\",zu),$(e,\"]\",Bu),$(e,\"(\",Hu),$(e,\")\",_u),$(e,\"<\",Uu),$(e,\">\",Iu),$(e,\"(\",ju),$(e,\")\",qu),$(e,\"「\",Vu),$(e,\"」\",$u),$(e,\"『\",Pu),$(e,\"』\",Ku),$(e,\"<\",Gu),$(e,\">\",Yu),$(e,\"&\",Xu),$(e,\"*\",Qu),$(e,\"@\",Hi),$(e,\"`\",Zu),$(e,\"^\",Wu),$(e,\":\",Er),$(e,\",\",Yp),$(e,\"$\",tc),$(e,\".\",On),$(e,\"=\",ec),$(e,\"!\",Xp),$(e,\"-\",fn),$(e,\"%\",mo),$(e,\"|\",nc),$(e,\"+\",ic),$(e,\"#\",rc),$(e,\"?\",go),$(e,'\"',Fp),$(e,\"/\",wn),$(e,\";\",Qp),$(e,\"~\",yo),$(e,\"_\",sc),$(e,\"\\\\\",Ju),$(e,\"・\",pT);const i=Ft(e,Xn,Kp,{[op]:!0});Ft(i,Xn,i);const s=Ft(i,Yn,dT,{[fo]:!0}),o=Ft(i,Ql,hT,{[no]:!0}),u=Ft(e,Yn,Qn,{[ap]:!0});Ft(u,Xn,s),Ft(u,Yn,u),Ft(s,Xn,s),Ft(s,Yn,s);const c=Ft(e,Ql,fp,{[up]:!0});Ft(c,Yn),Ft(c,Xn,o),Ft(c,Ql,c),Ft(o,Xn,o),Ft(o,Yn),Ft(o,Ql,o);const d=$(e,Nh,Gp,{[Ch]:!0}),p=$(e,a1,pp,{[Ch]:!0}),m=Ft(e,wh,pp,{[Ch]:!0});$(e,Dh,m),$(p,Nh,d),$(p,Dh,m),Ft(p,wh,m),$(m,a1),$(m,Nh),Ft(m,wh,m),$(m,Dh,m);const y=Ft(e,Oh,mT,{[fT]:!0});$(y,\"#\"),Ft(y,Oh,y),$(y,RL,y);const b=$(y,LL);$(b,\"#\"),Ft(b,Oh,y);const v=[[Yn,u],[Xn,s]],E=[[Yn,null],[Ql,c],[Xn,o]];for(let M=0;M<cu.length;M++)Ri(e,cu[M],dp,Qn,v);for(let M=0;M<fu.length;M++)Ri(e,fu[M],hp,fp,E);Sr(dp,{tld:!0,ascii:!0},t),Sr(hp,{utld:!0,alpha:!0},t),Ri(e,\"file\",bu,Qn,v),Ri(e,\"mailto\",bu,Qn,v),Ri(e,\"http\",Ns,Qn,v),Ri(e,\"https\",Ns,Qn,v),Ri(e,\"ftp\",Ns,Qn,v),Ri(e,\"ftps\",Ns,Qn,v),Sr(bu,{scheme:!0,ascii:!0},t),Sr(Ns,{slashscheme:!0,ascii:!0},t),n=n.sort((M,x)=>M[0]>x[0]?1:-1);for(let M=0;M<n.length;M++){const x=n[M][0],B=n[M][1]?{[OL]:!0}:{[wL]:!0};x.indexOf(\"-\")>=0?B[cp]=!0:Yn.test(x)?Xn.test(x)?B[fo]=!0:B[ap]=!0:B[op]=!0,o1(e,x,x,B)}return o1(e,\"localhost\",Co,{ascii:!0}),e.jd=new je(lc),{start:e,tokens:Object.assign({groups:t},gT)}}function yT(n,t){const e=BL(t.replace(/[A-Z]/g,c=>c.toLowerCase())),i=e.length,s=[];let o=0,u=0;for(;u<i;){let c=n,d=null,p=0,m=null,y=-1,b=-1;for(;u<i&&(d=c.go(e[u]));)c=d,c.accepts()?(y=0,b=0,m=c):y>=0&&(y+=e[u].length,b++),p+=e[u].length,o+=e[u].length,u++;o-=y,u-=b,p-=y,s.push({t:m.t,v:t.slice(o-p,o),s:o-p,e:o})}return s}function BL(n){const t=[],e=n.length;let i=0;for(;i<e;){let s=n.charCodeAt(i),o,u=s<55296||s>56319||i+1===e||(o=n.charCodeAt(i+1))<56320||o>57343?n[i]:n.slice(i,i+2);t.push(u),i+=u.length}return t}function Ri(n,t,e,i,s){let o;const u=t.length;for(let c=0;c<u-1;c++){const d=t[c];n.j[d]?o=n.j[d]:(o=new je(i),o.jr=s.slice(),n.j[d]=o),n=o}return o=new je(e),o.jr=s.slice(),n.j[t[u-1]]=o,o}function u1(n){const t=[],e=[];let i=0,s=\"0123456789\";for(;i<n.length;){let o=0;for(;s.indexOf(n[i+o])>=0;)o++;if(o>0){t.push(e.join(\"\"));for(let u=parseInt(n.substring(i,i+o),10);u>0;u--)e.pop();i+=o}else e.push(n[i]),i++}return t}const Oo={defaultProtocol:\"http\",events:null,format:c1,formatHref:c1,nl2br:!1,tagName:\"a\",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Jp(n,t=null){let e=Object.assign({},Oo);n&&(e=Object.assign(e,n instanceof Jp?n.o:n));const i=e.ignoreTags,s=[];for(let o=0;o<i.length;o++)s.push(i[o].toUpperCase());this.o=e,t&&(this.defaultRender=t),this.ignoreTags=s}Jp.prototype={o:Oo,ignoreTags:[],defaultRender(n){return n},check(n){return this.get(\"validate\",n.toString(),n)},get(n,t,e){const i=t!=null;let s=this.o[n];return s&&(typeof s==\"object\"?(s=e.t in s?s[e.t]:Oo[n],typeof s==\"function\"&&i&&(s=s(t,e))):typeof s==\"function\"&&i&&(s=s(t,e.t,e)),s)},getObj(n,t,e){let i=this.o[n];return typeof i==\"function\"&&t!=null&&(i=i(t,e.t,e)),i},render(n){const t=n.render(this);return(this.get(\"render\",null,n)||this.defaultRender)(t,n.t,n)}};function c1(n){return n}function bT(n,t){this.t=\"token\",this.v=n,this.tk=t}bT.prototype={isLink:!1,toString(){return this.v},toHref(n){return this.toString()},toFormattedString(n){const t=this.toString(),e=n.get(\"truncate\",t,this),i=n.get(\"format\",t,this);return e&&i.length>e?i.substring(0,e)+\"…\":i},toFormattedHref(n){return n.get(\"formatHref\",this.toHref(n.get(\"defaultProtocol\")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(n=Oo.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(n),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(n){return{type:this.t,value:this.toFormattedString(n),isLink:this.isLink,href:this.toFormattedHref(n),start:this.startIndex(),end:this.endIndex()}},validate(n){return n.get(\"validate\",this.toString(),this)},render(n){const t=this,e=this.toHref(n.get(\"defaultProtocol\")),i=n.get(\"formatHref\",e,this),s=n.get(\"tagName\",e,t),o=this.toFormattedString(n),u={},c=n.get(\"className\",e,t),d=n.get(\"target\",e,t),p=n.get(\"rel\",e,t),m=n.getObj(\"attributes\",e,t),y=n.getObj(\"events\",e,t);return u.href=i,c&&(u.class=c),d&&(u.target=d),p&&(u.rel=p),m&&Object.assign(u,m),{tagName:s,attributes:u,content:o,eventListeners:y}}};function Mc(n,t){class e extends bT{constructor(s,o){super(s,o),this.t=n}}for(const i in t)e.prototype[i]=t[i];return e.t=n,e}const HL=Mc(\"email\",{isLink:!0,toHref(){return\"mailto:\"+this.toString()}}),f1=Mc(\"text\"),_L=Mc(\"nl\"),du=Mc(\"url\",{isLink:!0,toHref(n=Oo.defaultProtocol){return this.hasProtocol()?this.v:`${n}://${this.v}`},hasProtocol(){const n=this.tk;return n.length>=2&&n[0].t!==Co&&n[1].t===Er}}),cn=n=>new je(n);function UL({groups:n}){const t=n.domain.concat([Xu,Qu,Hi,Ju,Zu,Wu,tc,ec,fn,Kp,mo,nc,ic,rc,wn,lc,yo,sc]),e=[Fu,Er,Yp,On,Xp,mo,go,Fp,Qp,Uu,Iu,ho,po,Bu,zu,Hu,_u,ju,qu,Vu,$u,Pu,Ku,Gu,Yu],i=[Xu,Fu,Qu,Ju,Zu,Wu,tc,ec,fn,ho,po,mo,nc,ic,rc,go,wn,lc,yo,sc],s=cn(),o=$(s,yo);pt(o,i,o),pt(o,n.domain,o);const u=cn(),c=cn(),d=cn();pt(s,n.domain,u),pt(s,n.scheme,c),pt(s,n.slashscheme,d),pt(u,i,o),pt(u,n.domain,u);const p=$(u,Hi);$(o,Hi,p),$(c,Hi,p),$(d,Hi,p);const m=$(o,On);pt(m,i,o),pt(m,n.domain,o);const y=cn();pt(p,n.domain,y),pt(y,n.domain,y);const b=$(y,On);pt(b,n.domain,y);const v=cn(HL);pt(b,n.tld,v),pt(b,n.utld,v),$(p,Co,v);const E=$(y,fn);$(E,fn,E),pt(E,n.domain,y),pt(v,n.domain,y),$(v,On,b),$(v,fn,E);const M=$(u,fn),x=$(u,On);$(M,fn,M),pt(M,n.domain,u),pt(x,i,o),pt(x,n.domain,u);const O=cn(du);pt(x,n.tld,O),pt(x,n.utld,O),pt(O,n.domain,u),pt(O,i,o),$(O,On,x),$(O,fn,M),$(O,Hi,p);const B=$(O,Er),I=cn(du);pt(B,n.numeric,I);const q=cn(du),P=cn();pt(q,t,q),pt(q,e,P),pt(P,t,q),pt(P,e,P),$(O,wn,q),$(I,wn,q);const et=$(c,Er),Y=$(d,Er),nt=$(Y,wn),ct=$(nt,wn);pt(c,n.domain,u),$(c,On,x),$(c,fn,M),pt(d,n.domain,u),$(d,On,x),$(d,fn,M),pt(et,n.domain,q),$(et,wn,q),$(et,go,q),pt(ct,n.domain,q),pt(ct,t,q),$(ct,wn,q);const Et=[[ho,po],[zu,Bu],[Hu,_u],[Uu,Iu],[ju,qu],[Vu,$u],[Pu,Ku],[Gu,Yu]];for(let $t=0;$t<Et.length;$t++){const[Dt,vt]=Et[$t],Mt=$(q,Dt);$(P,Dt,Mt);const gt=cn(du);pt(Mt,t,gt);const z=cn();pt(Mt,e,z),$(Mt,vt,q),pt(gt,t,gt),pt(gt,e,z),pt(z,t,gt),pt(z,e,z),$(gt,vt,q),$(z,vt,q)}return $(s,Co,O),$(s,Gp,_L),{start:s,tokens:gT}}function IL(n,t,e){let i=e.length,s=0,o=[],u=[];for(;s<i;){let c=n,d=null,p=null,m=0,y=null,b=-1;for(;s<i&&!(d=c.go(e[s].t));)u.push(e[s++]);for(;s<i&&(p=d||c.go(e[s].t));)d=null,c=p,c.accepts()?(b=0,y=c):b>=0&&b++,s++,m++;if(b<0)s-=m,s<i&&(u.push(e[s]),s++);else{u.length>0&&(o.push(Rh(f1,t,u)),u=[]),s-=b,m-=b;const v=y.t,E=e.slice(s-m,s);o.push(Rh(v,t,E))}}return u.length>0&&o.push(Rh(f1,t,u)),o}function Rh(n,t,e){const i=e[0].s,s=e[e.length-1].e,o=t.slice(i,s);return new n(o,e)}const jL=typeof console<\"u\"&&console&&console.warn||(()=>{}),qL=\"until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.\",qt={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function VL(){return je.groups={},qt.scanner=null,qt.parser=null,qt.tokenQueue=[],qt.pluginQueue=[],qt.customSchemes=[],qt.initialized=!1,qt}function d1(n,t=!1){if(qt.initialized&&jL(`linkifyjs: already initialized - will not register custom scheme \"${n}\" ${qL}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(n))throw new Error(`linkifyjs: incorrect scheme format.\n1. Must only contain digits, lowercase ASCII letters or \"-\"\n2. Cannot start or end with \"-\"\n3. \"-\" cannot repeat`);qt.customSchemes.push([n,t])}function $L(){qt.scanner=zL(qt.customSchemes);for(let n=0;n<qt.tokenQueue.length;n++)qt.tokenQueue[n][1]({scanner:qt.scanner});qt.parser=UL(qt.scanner.tokens);for(let n=0;n<qt.pluginQueue.length;n++)qt.pluginQueue[n][1]({scanner:qt.scanner,parser:qt.parser});return qt.initialized=!0,qt}function Zp(n){return qt.initialized||$L(),IL(qt.parser.start,n,yT(qt.scanner.start,n))}Zp.scan=yT;function vT(n,t=null,e=null){if(t&&typeof t==\"object\"){if(e)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);e=t,t=null}const i=new Jp(e),s=Zp(n),o=[];for(let u=0;u<s.length;u++){const c=s[u];c.isLink&&(!t||c.t===t)&&i.check(c)&&o.push(c.toFormattedObject(i))}return o}const kc=\"[\\0- -\\u2029 ]\",PL=new RegExp(kc),KL=new RegExp(`${kc}$`),GL=new RegExp(`${kc}+$`),YL=new RegExp(kc,\"g\");function XL(n,t,e){var i,s;const o=n.doc.resolve(t.to);if(!(!((i=o.nodeBefore)===null||i===void 0)&&i.isText))return;const u=(s=n.doc.textBetween(t.from,t.to,\"\",\"\").match(GL))===null||s===void 0?void 0:s[0];if(!u)return;const c=t.to-u.length,d=vc(c,t.to,n.doc).filter(y=>y.mark.type===e);if(!d.length)return;const{nodeAfter:p}=o;if(p&&d.some(y=>y.mark.isInSet(p.marks)))return;const m=n.storedMarks;n.removeMark(c,t.to,e),n.setStoredMarks(m),n.selection.empty&&n.selection.from===t.to&&n.removeStoredMark(e)}function FL(n){return n.length===1?n[0].isLink:n.length===3&&n[1].isLink?[\"()\",\"[]\"].includes(n[0].value+n[2].value):!1}function QL(n){return new It({key:new Zt(\"autolink\"),appendTransaction:(t,e,i)=>{const s=t.some(d=>d.docChanged)&&!e.doc.eq(i.doc),o=t.some(d=>d.getMeta(\"preventAutolink\"));if(!s||o)return;const{tr:u}=i,c=dE(e.doc,[...t]);if(!t.some(LO)){const d=[];c.steps.forEach((p,m)=>{if(!(p instanceof Qt)||!p.slice.size)return;const y=c.mapping.slice(m+1),b=y.map(p.from,1),v=y.map(p.from+p.slice.size,-1);b<v&&d.push({from:b,to:v})}),d.sort((p,m)=>m.to-p.to),d.forEach(p=>XL(u,p,n.type))}if(bc(c).forEach(({newRange:d})=>{const p=kw(i.doc,d,b=>b.isTextblock);let m,y;if(p.length>1)m=p[0],y=i.doc.textBetween(m.pos,m.pos+m.node.nodeSize,void 0,\" \");else if(p.length){const b=i.doc.textBetween(d.from,d.to,\" \",\" \");if(!KL.test(b))return;m=p[0],y=i.doc.textBetween(m.pos,d.to,void 0,\" \")}if(m&&y){const b=y.split(PL).filter(Boolean);if(b.length<=0)return!1;const v=b[b.length-1],E=m.pos+y.lastIndexOf(v);if(!v)return!1;const M=Zp(v).map(x=>x.toObject(n.defaultProtocol));if(!FL(M))return!1;M.filter(x=>x.isLink).map(x=>({...x,from:E+x.start+1,to:E+x.end+1})).filter(x=>i.schema.marks.code?!i.doc.rangeHasMark(x.from,x.to,i.schema.marks.code):!0).filter(x=>n.validate(x.value)).filter(x=>n.shouldAutoLink(x.value)).forEach(x=>{vc(x.from,x.to,i.doc).some(O=>O.mark.type===n.type)||u.addMark(x.from,x.to,n.type.create({href:x.href}))})}}),!!u.steps.length)return u}})}function JL(n){return new It({key:new Zt(\"handleClickLink\"),props:{handleClick:(t,e,i)=>{if(i.button!==0||!t.editable)return!1;let s=null;if(i.target instanceof HTMLAnchorElement)s=i.target;else{const d=i.target;if(!d)return!1;const p=n.editor.view.dom;s=d.closest(\"a\"),s&&!p.contains(s)&&(s=null)}if(!s)return!1;let o=!1;if(n.enableClickSelection&&(o=n.editor.commands.extendMarkRange(n.type.name)),n.openOnClick){var u,c;const d=bE(t.state,n.type.name),p=(u=s.href)!==null&&u!==void 0?u:d.href,m=(c=s.target)!==null&&c!==void 0?c:d.target;p&&(window.open(p,m),o=!0)}return o}}})}const ZL=/\\[([^[\\]]+)\\]\\(((?:[^\\s()]|\\([^\\s()]*\\))+)(?:\\s+(?:([\"'])(.*?)\\3|“(.*?)”|‘(.*?)’))?\\)$/,WL=/\\[([^[\\]]+)\\]\\(((?:[^\\s()]|\\([^\\s()]*\\))+)(?:\\s+(?:([\"'])(.*?)\\3|“(.*?)”|‘(.*?)’))?\\)/g;function ST(n,t){let e=0;for(let i=t-1;i>=0&&n[i]===\"\\\\\";i-=1)e+=1;return e%2===1}function tz(n,t){let e=0,i=0;for(;i<t;){if(n[i]!==\"`\"){i+=1;continue}if(e===0&&ST(n,i)){i+=1;continue}let s=0;for(;i<t&&n[i]===\"`\";)s+=1,i+=1;e===0?e=s:s===e&&(e=0)}return e>0}function ET(n,t,e){var i,s;const[,o,u]=t;return(t.index?n[t.index-1]:void 0)===\"!\"||ST(n,(i=t.index)!==null&&i!==void 0?i:0)||tz(n,(s=t.index)!==null&&s!==void 0?s:0)?!1:!!o.trim()&&e(u)}function TT(n){var t,e;const[i,s,o,,u,c,d]=n,p=(t=u??c)!==null&&t!==void 0?t:d;return{index:(e=n.index)!==null&&e!==void 0?e:0,text:i,replaceWith:s,data:{href:o,title:p||null,markdown:!0}}}function ez(n,t){return n.index<t.index+t.text.length&&t.index<n.index+n.text.length}function xT(n){var t,e,i;return{href:(t=n.data)===null||t===void 0?void 0:t.href,title:(e=(i=n.data)===null||i===void 0?void 0:i.title)!==null&&e!==void 0?e:null}}function nz(n){const t=Gi({find:e=>{const i=ZL.exec(e);return!i||!ET(e,i,n.isAllowedHref)?null:TT(i)},type:n.type,getAttributes:xT});return new Bo({find:t.find,handler:e=>{const i=t.handler(e);return i!==null&&e.state.tr.steps.length&&e.state.tr.setMeta(\"preventAutolink\",!0),i}})}function iz(n){const t=ri({find:e=>{var i,s;const o=[];for(const c of e.matchAll(WL))ET(e,c,n.isAllowedHref)&&o.push(TT(c));const u=((i=(s=n.findPlainUrls)===null||s===void 0?void 0:s.call(n,e))!==null&&i!==void 0?i:[]).filter(c=>!o.some(d=>ez(d,c)));return[...o,...u]},type:n.type,getAttributes:xT});return new DE({find:t.find,handler:e=>{var i;const s=t.handler(e);return s!==null&&e.state.tr.steps.length&&(!((i=e.match.data)===null||i===void 0)&&i.markdown)&&e.state.tr.setMeta(\"preventAutolink\",!0),s}})}function rz(n){return new It({key:new Zt(\"handlePasteLink\"),props:{handlePaste:(t,e,i)=>{const{shouldAutoLink:s}=n,{state:o}=t,{selection:u}=o,{empty:c}=u;if(c)return!1;let d=\"\";i.content.forEach(m=>{d+=m.textContent});const p=vT(d,{defaultProtocol:n.defaultProtocol}).find(m=>m.isLink&&m.value===d);return!d||!p||s!==void 0&&!s(p.value)?!1:n.editor.commands.setMark(n.type,{href:p.href})}}})}function Fn(n,t){const e=[\"http\",\"https\",\"ftp\",\"ftps\",\"mailto\",\"tel\",\"callto\",\"sms\",\"cid\",\"xmpp\"];return t&&t.forEach(i=>{const s=typeof i==\"string\"?i:i.scheme;s&&e.push(s)}),!n||n.replace(YL,\"\").match(new RegExp(`^(?:(?:${e.map(i=>i.replace(/[-/\\\\^$*+?.()|[\\]{}]/g,\"\\\\$&\")).join(\"|\")}):|[^a-z]|[a-z0-9+.\\\\-]+(?:[^a-z+.\\\\-:]|$))`,\"i\"))}const sz=li.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(n=>{if(typeof n==\"string\"){d1(n);return}d1(n.scheme,n.optionalSlashes)})},onDestroy(){VL()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,markdownLinks:!1,autolink:!0,protocols:[],defaultProtocol:\"http\",HTMLAttributes:{target:\"_blank\",rel:\"noopener noreferrer nofollow\",class:null},isAllowedUri:(n,t)=>!!Fn(n,t.protocols),validate:n=>!!n,shouldAutoLink:n=>{const t=/^[a-z][a-z0-9+.-]*:\\/\\//i.test(n),e=/^[a-z][a-z0-9+.-]*:/i.test(n);if(t||e&&!n.includes(\"@\"))return!0;const i=(n.includes(\"@\")?n.split(\"@\").pop():n).split(/[/?#:]/)[0];return!(/^\\d{1,3}(\\.\\d{1,3}){3}$/.test(i)||!/\\./.test(i))}}},addAttributes(){var n,t,e;return{href:{default:null,parseHTML(i){return i.getAttribute(\"href\")}},target:{default:(n=this.options.HTMLAttributes.target)!==null&&n!==void 0?n:null},rel:{default:(t=this.options.HTMLAttributes.rel)!==null&&t!==void 0?t:null},class:{default:(e=this.options.HTMLAttributes.class)!==null&&e!==void 0?e:null},title:{default:null}}},parseHTML(){return[{tag:\"a[href]\",getAttrs:n=>{const t=n.getAttribute(\"href\");return!t||!this.options.isAllowedUri(t,{defaultValidate:e=>!!Fn(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:n}){return this.options.isAllowedUri(n.href,{defaultValidate:t=>!!Fn(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?[\"a\",Vt(this.options.HTMLAttributes,n),0]:[\"a\",Vt(this.options.HTMLAttributes,{...n,href:\"\"}),0]},markdownTokenName:\"link\",parseMarkdown:(n,t)=>t.applyMark(\"link\",t.parseInline(n.tokens||[]),{href:n.href,title:n.title||null}),renderMarkdown:(n,t)=>{var e,i,s,o;const u=(e=(i=n.attrs)===null||i===void 0?void 0:i.href)!==null&&e!==void 0?e:\"\",c=(s=(o=n.attrs)===null||o===void 0?void 0:o.title)!==null&&s!==void 0?s:\"\",d=t.renderChildren(n);return c?`[${d}](${u} \"${c}\")`:`[${d}](${u})`},addCommands(){return{setLink:n=>({chain:t})=>{const{href:e}=n;return this.options.isAllowedUri(e,{defaultValidate:i=>!!Fn(i,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?t().setMark(this.name,n).setMeta(\"preventAutolink\",!0).run():!1},toggleLink:n=>({chain:t})=>{const{href:e}=n||{};return e&&!this.options.isAllowedUri(e,{defaultValidate:i=>!!Fn(i,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:t().toggleMark(this.name,n,{extendEmptyMarkRange:!0}).setMeta(\"preventAutolink\",!0).run()},unsetLink:()=>({chain:n})=>n().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta(\"preventAutolink\",!0).run()}},addInputRules(){return this.options.markdownLinks?[nz({type:this.type,isAllowedHref:n=>this.options.isAllowedUri(n,{defaultValidate:t=>!!Fn(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})})]:[]},addPasteRules(){const n=t=>{const e=[];if(t){const{protocols:i,defaultProtocol:s}=this.options;vT(t).filter(o=>o.isLink&&this.options.isAllowedUri(o.value,{defaultValidate:u=>!!Fn(u,i),protocols:i,defaultProtocol:s})).forEach(o=>{this.options.shouldAutoLink(o.value)&&e.push({text:o.value,data:{href:o.href},index:o.start})})}return e};return this.options.markdownLinks?[iz({type:this.type,isAllowedHref:t=>this.options.isAllowedUri(t,{defaultValidate:e=>!!Fn(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}),findPlainUrls:n})]:[ri({find:n,type:this.type,getAttributes:t=>{var e;return{href:(e=t.data)===null||e===void 0?void 0:e.href}}})]},addProseMirrorPlugins(){const n=[],{protocols:t,defaultProtocol:e}=this.options;return this.options.autolink&&n.push(QL({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:i=>this.options.isAllowedUri(i,{defaultValidate:s=>!!Fn(s,t),protocols:t,defaultProtocol:e}),shouldAutoLink:this.options.shouldAutoLink})),n.push(JL({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick===\"whenNotEditable\"?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&n.push(rz({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),n}});var lz=sz;const oz=new Ht({tiptapExtension:lz.configure({openOnClick:!1,autolink:!0}),onBridgeMessage:(n,{type:t,payload:e})=>{if(t===\"set-link\"){if(e===null)return!1;if(e===\"\")return n.chain().focus().extendMarkRange(\"link\").unsetLink().setTextSelection(n.state.selection.from).run(),!1;n.chain().focus().extendMarkRange(\"link\").setLink({href:e}).setTextSelection(n.state.selection.from).run()}return!1},extendEditorInstance:n=>({setLink:t=>n({type:\"set-link\",payload:t})}),extendEditorState:n=>({canSetLink:!n.state.selection.empty,isLinkActive:n.isActive(\"link\"),activeLink:n.getAttributes(\"link\").href})}),az=new Ht({tiptapExtension:xc,onBridgeMessage:(n,t)=>{switch(t.type){case\"lift\":n.chain().focus().liftListItem(n.schema.nodes.listItem.name).run();break;case\"sink\":n.chain().focus().sinkListItem(n.schema.nodes.listItem.name).run();break}return!1},extendEditorInstance:n=>({lift:()=>n({type:\"lift\"}),sink:()=>n({type:\"sink\"})}),extendEditorState:n=>({canLift:n.can().liftListItem(n.state.schema.nodes.listItem.name),canSink:n.can().sinkListItem(n.state.schema.nodes.listItem.name)})}),uz=new Ht({tiptapExtension:WE,tiptapExtensionDeps:[xc],onBridgeMessage:(n,t)=>(t.type===\"toggle-orderedList\"&&n.chain().focus().toggleOrderedList().run(),!1),extendEditorInstance:n=>({toggleOrderedList:()=>n({type:\"toggle-orderedList\"})}),extendEditorState:n=>({canToggleOrderedList:n.can().toggleOrderedList(),isOrderedListActive:n.isActive(\"orderedList\")})}),cz=new Ht({tiptapExtension:cL,extendCSS:`\n .is-editor-empty:first-child::before {\n color: #adb5bd;\n content: attr(data-placeholder);\n float: left;\n height: 0;\n pointer-events: none;\n }\n `,onBridgeMessage:(n,t)=>{switch(t.type){case\"set-placeholder\":n.extensionManager.extensions.forEach(i=>{i.name===\"placeholder\"&&(i.options.placeholder=t.payload)}),n.setOptions();break}return!1},extendEditorInstance:n=>({setPlaceholder:e=>n({type:\"set-placeholder\",payload:e})})}),fz=/(?:^|\\s)(~~(?!\\s+~~)((?:[^~]+))~~(?!\\s+~~))$/,dz=/(?:^|\\s)(~~(?!\\s+~~)((?:[^~]+))~~(?!\\s+~~))/g,hz=li.create({name:\"strike\",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:\"s\"},{tag:\"del\"},{tag:\"strike\"},{style:\"text-decoration\",consuming:!1,getAttrs:n=>n.includes(\"line-through\")?{}:!1}]},renderHTML({HTMLAttributes:n}){return[\"s\",Vt(this.options.HTMLAttributes,n),0]},markdownTokenName:\"del\",parseMarkdown:(n,t)=>t.applyMark(\"strike\",t.parseInline(n.tokens||[])),renderMarkdown:(n,t)=>`~~${t.renderChildren(n)}~~`,addCommands(){return{setStrike:()=>({commands:n})=>n.setMark(this.name),toggleStrike:()=>({commands:n})=>n.toggleMark(this.name),unsetStrike:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{\"Mod-Shift-s\":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Gi({find:fz,type:this.type})]},addPasteRules(){return[ri({find:dz,type:this.type})]}});var pz=hz;const mz=new Ht({tiptapExtension:pz,onBridgeMessage:(n,t)=>(t.type===\"toggle-strike\"&&n.chain().focus().toggleStrike().run(),!1),extendEditorInstance:n=>({toggleStrike:()=>n({type:\"toggle-strike\"})}),extendEditorState:n=>({canToggleStrike:n.can().toggleStrike(),isStrikeActive:n.isActive(\"strike\")})}),gz=li.create({name:\"underline\",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:\"u\"},{style:\"text-decoration\",consuming:!1,getAttrs:n=>n.includes(\"underline\")?{}:!1}]},renderHTML({HTMLAttributes:n}){return[\"u\",Vt(this.options.HTMLAttributes,n),0]},parseMarkdown(n,t){return t.applyMark(this.name||\"underline\",t.parseInline(n.tokens||[]))},renderMarkdown(n,t){return`++${t.renderChildren(n)}++`},markdownTokenizer:{name:\"underline\",level:\"inline\",start(n){return n.indexOf(\"++\")},tokenize(n,t,e){const i=/^(\\+\\+)([\\s\\S]+?)(\\+\\+)/.exec(n);if(!i)return;const s=i[2].trim();return{type:\"underline\",raw:i[0],text:s,tokens:e.inlineTokens(s)}}},addCommands(){return{setUnderline:()=>({commands:n})=>n.setMark(this.name),toggleUnderline:()=>({commands:n})=>n.toggleMark(this.name),unsetUnderline:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{\"Mod-u\":()=>this.editor.commands.toggleUnderline(),\"Mod-U\":()=>this.editor.commands.toggleUnderline()}}});var yz=gz;const bz=new Ht({tiptapExtension:yz,onBridgeMessage:(n,t)=>(t.type===\"toggle-underline\"&&n.chain().focus().toggleUnderline().run(),!1),extendEditorInstance:n=>({toggleUnderline:()=>n({type:\"toggle-underline\"})}),extendEditorState:n=>({canToggleUnderline:n.can().toggleUnderline(),isUnderlineActive:n.isActive(\"underline\")})}),vz=new Ht({tiptapExtension:eT,tiptapExtensionDeps:[tT.configure({nested:!0})],onBridgeMessage:(n,t)=>(t.type===\"toggle-task-list\"&&n.chain().focus().toggleTaskList().run(),t.type===\"lift-task-list-item\"&&n.chain().focus().liftListItem(n.state.schema.nodes.taskItem.name).run(),t.type===\"sink-task-list-item\"&&n.chain().focus().sinkListItem(n.state.schema.nodes.taskItem.name).run(),!1),extendEditorInstance:n=>({toggleTaskList:()=>n({type:\"toggle-task-list\"}),liftTaskListItem:()=>n({type:\"lift-task-list-item\"}),sinkTaskListItem:()=>n({type:\"sink-task-list-item\"})}),extendEditorState:n=>({canToggleTaskList:n.can().toggleTaskList(),isTaskListActive:n.isActive(\"taskList\"),canLiftTaskListItem:n.can().liftListItem(n.state.schema.nodes.taskItem.name),canSinkTaskListItem:n.can().sinkListItem(n.state.schema.nodes.taskItem.name)}),extendCSS:`\n ul[data-type=\"taskList\"] {\n list-style: none;\n padding: 0;\n }\n \n ul[data-type=\"taskList\"] > li {\n display: flex;\n }\n \n ul[data-type=\"taskList\"] p {\n margin: 0;\n }\n \n ul[data-type=\"taskList\"] li {\n display: flex;\n }\n \n ul[data-type=\"taskList\"] li > label > input {\n font-size: inherit;\n font-family: inherit;\n color: #000;\n margin: 0.1rem;\n border: 1px solid black;\n border-radius: 0.3rem;\n padding: 0.1rem 0.4rem;\n background: white;\n accent-color: black;\n }\n ul[data-type=\"taskList\"] li > label {\n flex: 0 0 auto;\n margin-right: 0.5rem;\n user-select: none;\n }\n \n ul[data-type=\"taskList\"] li > div {\n flex: 1 1 auto;\n } \n `}),Sz=new Ht({tiptapExtension:tL}),Ez=Ne.create({name:\"hardBreak\",markdownTokenName:\"br\",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:\"inline\",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:\"br\"}]},renderHTML({HTMLAttributes:n}){return[\"br\",Vt(this.options.HTMLAttributes,n)]},renderText(){return`\n`},renderMarkdown:()=>` \n`,parseMarkdown:()=>({type:\"hardBreak\"}),addCommands(){return{setHardBreak:()=>({commands:n,chain:t,state:e,editor:i})=>n.first([()=>n.exitCode(),()=>n.command(()=>{const{selection:s,storedMarks:o}=e;if(s.$from.parent.type.spec.isolating)return!1;const{keepMarks:u}=this.options,{splittableMarks:c}=i.extensionManager,d=o||s.$to.parentOffset&&s.$from.marks();return t().insertContent({type:this.name}).command(({tr:p,dispatch:m})=>{if(m&&d&&u){const y=d.filter(b=>c.includes(b.type.name));p.ensureMarks(y)}return!0}).scrollIntoView().run()})])}},addKeyboardShortcuts(){return{\"Mod-Enter\":()=>this.editor.commands.setHardBreak(),\"Shift-Enter\":()=>this.editor.commands.setHardBreak()}}});var Tz=Ez;const xz=new Ht({tiptapExtension:Tz,onBridgeMessage:(n,t)=>(t.type===\"set-hard-break\"&&(console.log(\"setting hard break\"),n.chain().focus().setHardBreak().run()),!1),extendEditorInstance:n=>({setHardBreak:()=>n({type:\"set-hard-break\"})}),extendEditorState:()=>({})}),Mz=[KR,mL,N2,kL,mz,bz,uz,j2,cT,M2,UR,vz,oz,_2,P2,OR,cz,az,Sz,xz],Lh=4,kz=/^```([a-z]+)?[\\s\\n]$/,Az=/^~~~([a-z]+)?[\\s\\n]$/,Cz=Ne.create({name:\"codeBlock\",addOptions(){return{languageClassPrefix:\"language-\",exitOnTripleEnter:!0,exitOnArrowDown:!0,exitOnArrowUp:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:Lh,HTMLAttributes:{}}},content:\"text*\",marks:\"\",group:\"block\",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:n=>{var t;const{languageClassPrefix:e}=this.options;if(!e)return null;const i=[...((t=n.firstElementChild)===null||t===void 0?void 0:t.classList)||[]].filter(s=>s.startsWith(e)).map(s=>s.replace(e,\"\"))[0];return i||null},rendered:!1}}},parseHTML(){return[{tag:\"pre\",preserveWhitespace:\"full\"}]},renderHTML({node:n,HTMLAttributes:t}){return[\"pre\",Vt(this.options.HTMLAttributes,t),[\"code\",{class:n.attrs.language?this.options.languageClassPrefix+n.attrs.language:null},0]]},markdownTokenName:\"code\",parseMarkdown:(n,t)=>{var e,i;return((e=n.raw)===null||e===void 0?void 0:e.startsWith(\"```\"))===!1&&((i=n.raw)===null||i===void 0?void 0:i.startsWith(\"~~~\"))===!1&&n.codeBlockStyle!==\"indented\"?[]:t.createNode(\"codeBlock\",{language:n.lang||null},n.text?[t.createTextNode(n.text)]:[])},renderMarkdown:(n,t)=>{var e;let i=\"\";const s=((e=n.attrs)===null||e===void 0?void 0:e.language)||\"\";return n.content?i=[`\\`\\`\\`${s}`,t.renderChildren(n.content),\"```\"].join(`\n`):i=`\\`\\`\\`${s}\n\n\\`\\`\\``,i},addCommands(){return{setCodeBlock:n=>({commands:t})=>t.setNode(this.name,n),toggleCodeBlock:n=>({commands:t})=>t.toggleNode(this.name,\"paragraph\",n)}},addKeyboardShortcuts(){return{\"Mod-Alt-c\":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:n,$anchor:t}=this.editor.state.selection,e=t.pos===1;return!n||t.parent.type.name!==this.name?!1:e||!t.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:n})=>{var t;if(!this.options.enableTabIndentation)return!1;const e=(t=this.options.tabSize)!==null&&t!==void 0?t:Lh,{state:i}=n,{selection:s}=i,{$from:o,empty:u}=s;if(o.parent.type!==this.type)return!1;const c=\" \".repeat(e);return u?n.commands.insertContent(c):n.commands.command(({tr:d})=>{const{from:p,to:m}=s,y=i.doc.textBetween(p,m,`\n`,`\n`).split(`\n`).map(b=>c+b).join(`\n`);return d.replaceWith(p,m,i.schema.text(y)),!0})},\"Shift-Tab\":({editor:n})=>{var t;if(!this.options.enableTabIndentation)return!1;const e=(t=this.options.tabSize)!==null&&t!==void 0?t:Lh,{state:i}=n,{selection:s}=i,{$from:o,empty:u}=s;return o.parent.type!==this.type?!1:u?n.commands.command(({tr:c})=>{var d;const{pos:p}=o,m=o.start(),y=o.end(),b=i.doc.textBetween(m,y,`\n`,`\n`).split(`\n`);let v=0,E=0;const M=p-m;for(let I=0;I<b.length;I+=1){if(E+b[I].length>=M){v=I;break}E+=b[I].length+1}const x=((d=b[v].match(/^ */))===null||d===void 0?void 0:d[0])||\"\",O=Math.min(x.length,e);if(O===0)return!0;let B=m;for(let I=0;I<v;I+=1)B+=b[I].length+1;return c.delete(B,B+O),p-B<=O&&c.setSelection(lt.create(c.doc,B)),!0}):n.commands.command(({tr:c})=>{const{from:d,to:p}=s,m=i.doc.textBetween(d,p,`\n`,`\n`).split(`\n`).map(y=>{var b;const v=((b=y.match(/^ */))===null||b===void 0?void 0:b[0])||\"\",E=Math.min(v.length,e);return y.slice(E)}).join(`\n`);return c.replaceWith(d,p,i.schema.text(m)),!0})},Enter:({editor:n})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:t}=n,{selection:e}=t,{$from:i,empty:s}=e;if(!s||i.parent.type!==this.type)return!1;const o=i.parentOffset===i.parent.nodeSize-2,u=i.parent.textContent.endsWith(`\n\n`);return!o||!u?!1:n.chain().command(({tr:c})=>(c.delete(i.pos-2,i.pos),!0)).exitCode().run()},ArrowUp:({editor:n})=>{if(!this.options.exitOnArrowUp)return!1;const{state:t}=n,{selection:e}=t,{$from:i,empty:s}=e;if(!s||i.parent.type!==this.type||i.parentOffset!==0)return!1;const o=i.before();return o>0?!1:n.commands.insertDefaultBlock({pos:o})},ArrowDown:({editor:n})=>{if(!this.options.exitOnArrowDown)return!1;const{state:t}=n,{selection:e,doc:i}=t,{$from:s,empty:o}=e;if(!o||s.parent.type!==this.type||s.parentOffset!==s.parent.nodeSize-2)return!1;const u=s.after();return u===void 0?!1:i.nodeAt(u)?n.commands.command(({tr:c})=>(c.setSelection(dt.near(i.resolve(u))),!0)):n.commands.exitCode()}}},addInputRules(){return[ip({find:kz,type:this.type,getAttributes:n=>({language:n[1]})}),ip({find:Az,type:this.type,getAttributes:n=>({language:n[1]})})]},addProseMirrorPlugins(){return[new It({key:new Zt(\"codeBlockVSCodeHandler\"),props:{handlePaste:(n,t)=>{if(!t.clipboardData||this.editor.isActive(this.type.name))return!1;const e=t.clipboardData.getData(\"text/plain\"),i=t.clipboardData.getData(\"vscode-editor-data\"),s=i?JSON.parse(i):void 0,o=s==null?void 0:s.mode;if(!e||!o)return!1;const{tr:u,schema:c}=n.state,d=c.text(e.replace(/\\r\\n?/g,`\n`));return u.replaceSelectionWith(this.type.create({language:o},d)),u.selection.$from.parent.type!==this.type&&u.setSelection(lt.near(u.doc.resolve(Math.max(0,u.selection.from-2)))),u.setMeta(\"paste\",!0),n.dispatch(u),!0}}})]}});var Oz=Cz;const wz=new Ht({tiptapExtension:Oz.configure({HTMLAttributes:{}}),onBridgeMessage:(n,t)=>t.type!==\"toggle-code-block\"?!1:(n.chain().focus().toggleCodeBlock().run(),!0),extendEditorInstance:n=>({toggleCodeBlock:()=>n({type:\"toggle-code-block\"})}),extendEditorState:n=>({isCodeBlockActive:n.isActive(\"codeBlock\")})}),Nz=(n,t)=>{const{doc:e}=n.state,i=Math.min(new DOMParser().parseFromString(t,\"text/html\").body.children.length,e.childCount);let s=0;for(let o=e.childCount-i;o<e.childCount;o++)s+=e.child(o).nodeSize;return Math.max(1,e.content.size-s-1)},Dz=n=>{const{state:t}=n,{from:e,to:i,empty:s,$from:o}=t.selection,u=t.schema.marks.link,c=s&&u&&mc(o,u)||{from:e,to:i};return{linkRange:{from:c.from,to:c.to},linkText:t.doc.textBetween(c.from,c.to,\" \"),linkOpensInNewTab:n.getAttributes(\"link\").target!==\"_self\"}},Rz=new Ht({forceName:\"composer\",onBridgeMessage:(n,t)=>{if(t.type===\"insert-html\")return n.chain().focus().insertContent(t.payload).run(),!0;if(t.type===\"focus-before-trailing\")return n.chain().focus().setTextSelection(Nz(n,t.payload)).run(),!0;if(t.type!==\"focus-empty-paragraph\")return!1;let e;return n.state.doc.descendants((i,s)=>e!==void 0?!1:(i.type.name===\"paragraph\"&&i.content.size===0&&(e=s+1),!0)),n.commands.focus(e??\"end\"),!0},extendEditorState:Dz,extendEditorInstance:n=>({focusEmptyParagraph:()=>n({type:\"focus-empty-paragraph\"}),insertHTML:t=>n({type:\"insert-html\",payload:t}),focusBeforeTrailing:t=>n({type:\"focus-before-trailing\",payload:t})})}),mr=n=>n.tagName===\"IMG\"?n:n.querySelector(\"img\"),Lz=n=>{if(!n)return null;const t=parseInt(n.getAttribute(\"width\")??\"\",10)||parseInt(n.style.width,10);return Number.isFinite(t)&&t>0?t:null},zz=Ne.create({name:\"image\",addOptions(){return{HTMLAttributes:{},openImageInNewTab:!0}},group:\"block\",content:\"inline*\",draggable:!1,isolating:!0,addAttributes(){return{id:{default:null,parseHTML:n=>n.getAttribute(\"id\")},src:{default:null,parseHTML:n=>{var t;return(t=mr(n))==null?void 0:t.getAttribute(\"src\")}},alt:{default:\"image\",parseHTML:n=>{var t;return((t=mr(n))==null?void 0:t.getAttribute(\"alt\"))||\"image\"}},figheight:{default:\"auto\",parseHTML:n=>{var t;return(t=mr(n))==null?void 0:t.getAttribute(\"figheight\")}},figwidth:{default:500,parseHTML:n=>{var t;return((t=mr(n))==null?void 0:t.getAttribute(\"figwidth\"))??Lz(mr(n))}},align:{default:\"left\",parseHTML:n=>{var t;return(t=mr(n))==null?void 0:t.getAttribute(\"align\")}},border:{default:!0,parseHTML:n=>{var t;return((t=mr(n))==null?void 0:t.getAttribute(\"data-border\"))===\"true\"}}}},parseHTML(){return[{tag:\"figure\",contentElement:n=>n.querySelector(\"figcaption\")??n.ownerDocument.createElement(\"figcaption\")},{tag:\"img[src]\"}]},renderHTML({node:n,HTMLAttributes:t}){const{align:e,src:i,figheight:s,figwidth:o,border:u}=n.attrs;if(!i)return[\"span\"];const c=this.options.openImageInNewTab?\"\":\"pointer-events:none;\",d=s===\"auto\"?\"auto\":`${s}px`;return[\"div\",{class:[\"neeto-editor__image-wrapper\",`neeto-editor__image--${e}`,u&&\"neeto-editor__image--bordered\"].filter(Boolean).join(\" \")},[\"figure\",this.options.HTMLAttributes,[\"a\",{href:i,target:\"_blank\",rel:\"noopener noreferrer\",class:\"neeto-editor__image\",style:`height:${d};width:${o}px;display:inline-block;${c}`},[\"img\",Vt(t,{draggable:!1,contenteditable:!1,\"data-border\":u})]],[\"figcaption\",{style:`width:${o}px;`},0]]]}}),Bz=new Ht({tiptapExtension:zz}),Hz=Ne.create({name:\"mention\",group:\"inline\",inline:!0,selectable:!1,atom:!0,addAttributes(){return{id:{default:null,parseHTML:n=>n.getAttribute(\"data-id\"),renderHTML:n=>n.id?{\"data-id\":n.id}:{}},label:{default:null,parseHTML:n=>n.getAttribute(\"data-label\"),renderHTML:n=>n.label?{\"data-label\":n.label}:{}}}},parseHTML(){return[{tag:`span[data-type=\"${this.name}\"]`}]},renderHTML({node:n,HTMLAttributes:t}){return[\"span\",Vt({\"data-type\":this.name},t),`@${n.attrs.label??n.attrs.id}`]},renderText({node:n}){return`@${n.attrs.label??n.attrs.id}`}}),_z=/(?:^|\\s)@([^\\s@]*)$/,Uz=n=>{const{empty:t,$from:e}=n.state.selection;if(!t||!e.parent.isTextblock)return null;const i=e.parent.textBetween(0,e.parentOffset,void 0,\"\"),s=_z.exec(i);if(!s)return null;const o=s[1]??\"\";return{query:o,from:e.pos-o.length-1,to:e.pos}},Iz=new Ht({forceName:\"mention\",tiptapExtension:Hz,onBridgeMessage:(n,t)=>{if(t.type!==\"insert-mention\")return!1;const{id:e,label:i,range:s}=t.payload;return n.chain().focus().insertContentAt(s,[{type:\"mention\",attrs:{id:e,label:i}},{type:\"text\",text:\" \"}]).run(),!0},extendEditorState:n=>({mentionQuery:Uz(n)}),extendEditorInstance:n=>({insertMention:({id:t,label:e},i)=>n({type:\"insert-mention\",payload:{id:t,label:e,range:i}})})}),jz=Ne.create({name:\"variable\",addOptions(){return{HTMLAttributes:{class:\"neeto-editor-variable\"},charOpen:\"{{\",charClose:\"}}\",renderLabel({options:n,node:t}){return`${n.charOpen}${t.attrs.id||t.attrs.label}${n.charClose}`}}},group:\"inline\",inline:!0,selectable:!1,atom:!0,addAttributes(){return{id:{default:null,parseHTML:n=>n.getAttribute(\"data-id\"),renderHTML:n=>n.id?{\"data-id\":n.id}:{}},label:{default:null,parseHTML:n=>n.getAttribute(\"data-label\"),renderHTML:n=>n.label?{\"data-label\":n.label}:{}}}},parseHTML(){return[{tag:\"span[data-variable]\"}]},renderHTML({node:n,HTMLAttributes:t}){return[\"span\",Vt({\"data-variable\":\"\"},this.options.HTMLAttributes,t),this.options.renderLabel({options:this.options,node:n})]},renderText({node:n}){return this.options.renderLabel({options:this.options,node:n})}}),qz=new Ht({tiptapExtension:jz}),Vz=n=>{const t=new Set(n.flatMap(e=>e.tiptapExtension?[e.tiptapExtension.name]:[]));return n.map(e=>{const i=e.tiptapExtensionDeps;if(!(i!=null&&i.length))return e;const s=i.filter(o=>!t.has(o.name));return s.forEach(o=>t.add(o.name)),s.length===i.length?e:new Ht({...e,forceName:e.name,tiptapExtensionDeps:s})})},$z=Vz([...Mz.filter(n=>n!==cT),wz,qz,Bz,Iz,Rz]),Pz=()=>{const n=RR({bridges:$z});return hn.jsx(BE,{className:window.dynamicHeight?\"dynamic-height\":void 0,editor:n})},Kz=setInterval(()=>{window.contentInjected&&(clearInterval(Kz),tk.createRoot(document.getElementById(\"root\")).render(hn.jsx(Pz,{})))},1);</script>\n </head>\n <body>\n <div id=\"root\"></div>\n </body>\n</html>\n";
|