itsvertical 0.0.3 → 0.0.5

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.
@@ -0,0 +1,448 @@
1
+ function ez(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const o=Object.getOwnPropertyDescriptor(r,i);o&&Object.defineProperty(e,i,o.get?o:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();function uO(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var fO={exports:{}},zm={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var tz=Symbol.for("react.transitional.element"),nz=Symbol.for("react.fragment");function dO(e,t,n){var r=null;if(n!==void 0&&(r=""+n),t.key!==void 0&&(r=""+t.key),"key"in t){n={};for(var i in t)i!=="key"&&(n[i]=t[i])}else n=t;return t=n.ref,{$$typeof:tz,type:e,key:r,ref:t!==void 0?t:null,props:n}}zm.Fragment=nz;zm.jsx=dO;zm.jsxs=dO;fO.exports=zm;var w=fO.exports,hO={exports:{}},Im={},pO={exports:{}},mO={};/**
10
+ * @license React
11
+ * scheduler.production.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */(function(e){function t(D,I){var N=D.length;D.push(I);e:for(;0<N;){var L=N-1>>>1,F=D[L];if(0<i(F,I))D[L]=I,D[N]=F,N=L;else break e}}function n(D){return D.length===0?null:D[0]}function r(D){if(D.length===0)return null;var I=D[0],N=D.pop();if(N!==I){D[0]=N;e:for(var L=0,F=D.length,te=F>>>1;L<te;){var ae=2*(L+1)-1,Ee=D[ae],ge=ae+1,X=D[ge];if(0>i(Ee,N))ge<F&&0>i(X,Ee)?(D[L]=X,D[ge]=N,L=ge):(D[L]=Ee,D[ae]=N,L=ae);else if(ge<F&&0>i(X,N))D[L]=X,D[ge]=N,L=ge;else break e}}return I}function i(D,I){var N=D.sortIndex-I.sortIndex;return N!==0?N:D.id-I.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var s=Date,a=s.now();e.unstable_now=function(){return s.now()-a}}var l=[],c=[],u=1,f=null,d=3,h=!1,p=!1,g=!1,y=!1,v=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;function m(D){for(var I=n(c);I!==null;){if(I.callback===null)r(c);else if(I.startTime<=D)r(c),I.sortIndex=I.expirationTime,t(l,I);else break;I=n(c)}}function E(D){if(g=!1,m(D),!p)if(n(l)!==null)p=!0,T||(T=!0,_());else{var I=n(c);I!==null&&V(E,I.startTime-D)}}var T=!1,C=-1,O=5,A=-1;function k(){return y?!0:!(e.unstable_now()-A<O)}function z(){if(y=!1,T){var D=e.unstable_now();A=D;var I=!0;try{e:{p=!1,g&&(g=!1,b(C),C=-1),h=!0;var N=d;try{t:{for(m(D),f=n(l);f!==null&&!(f.expirationTime>D&&k());){var L=f.callback;if(typeof L=="function"){f.callback=null,d=f.priorityLevel;var F=L(f.expirationTime<=D);if(D=e.unstable_now(),typeof F=="function"){f.callback=F,m(D),I=!0;break t}f===n(l)&&r(l),m(D)}else r(l);f=n(l)}if(f!==null)I=!0;else{var te=n(c);te!==null&&V(E,te.startTime-D),I=!1}}break e}finally{f=null,d=N,h=!1}I=void 0}}finally{I?_():T=!1}}}var _;if(typeof x=="function")_=function(){x(z)};else if(typeof MessageChannel<"u"){var H=new MessageChannel,U=H.port2;H.port1.onmessage=z,_=function(){U.postMessage(null)}}else _=function(){v(z,0)};function V(D,I){C=v(function(){D(e.unstable_now())},I)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(D){D.callback=null},e.unstable_forceFrameRate=function(D){0>D||125<D?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):O=0<D?Math.floor(1e3/D):5},e.unstable_getCurrentPriorityLevel=function(){return d},e.unstable_next=function(D){switch(d){case 1:case 2:case 3:var I=3;break;default:I=d}var N=d;d=I;try{return D()}finally{d=N}},e.unstable_requestPaint=function(){y=!0},e.unstable_runWithPriority=function(D,I){switch(D){case 1:case 2:case 3:case 4:case 5:break;default:D=3}var N=d;d=D;try{return I()}finally{d=N}},e.unstable_scheduleCallback=function(D,I,N){var L=e.unstable_now();switch(typeof N=="object"&&N!==null?(N=N.delay,N=typeof N=="number"&&0<N?L+N:L):N=L,D){case 1:var F=-1;break;case 2:F=250;break;case 5:F=1073741823;break;case 4:F=1e4;break;default:F=5e3}return F=N+F,D={id:u++,callback:I,priorityLevel:D,startTime:N,expirationTime:F,sortIndex:-1},N>L?(D.sortIndex=N,t(c,D),n(l)===null&&D===n(c)&&(g?(b(C),C=-1):g=!0,V(E,N-L))):(D.sortIndex=F,t(l,D),p||h||(p=!0,T||(T=!0,_()))),D},e.unstable_shouldYield=k,e.unstable_wrapCallback=function(D){var I=d;return function(){var N=d;d=I;try{return D.apply(this,arguments)}finally{d=N}}}})(mO);pO.exports=mO;var rz=pO.exports,gO={exports:{}},ie={};/**
18
+ * @license React
19
+ * react.production.js
20
+ *
21
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var i1=Symbol.for("react.transitional.element"),iz=Symbol.for("react.portal"),oz=Symbol.for("react.fragment"),sz=Symbol.for("react.strict_mode"),az=Symbol.for("react.profiler"),lz=Symbol.for("react.consumer"),cz=Symbol.for("react.context"),uz=Symbol.for("react.forward_ref"),fz=Symbol.for("react.suspense"),dz=Symbol.for("react.memo"),vO=Symbol.for("react.lazy"),hz=Symbol.for("react.activity"),Ew=Symbol.iterator;function pz(e){return e===null||typeof e!="object"?null:(e=Ew&&e[Ew]||e["@@iterator"],typeof e=="function"?e:null)}var yO={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},bO=Object.assign,xO={};function sc(e,t,n){this.props=e,this.context=t,this.refs=xO,this.updater=n||yO}sc.prototype.isReactComponent={};sc.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=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,e,t,"setState")};sc.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function SO(){}SO.prototype=sc.prototype;function o1(e,t,n){this.props=e,this.context=t,this.refs=xO,this.updater=n||yO}var s1=o1.prototype=new SO;s1.constructor=o1;bO(s1,sc.prototype);s1.isPureReactComponent=!0;var Cw=Array.isArray;function By(){}var tt={H:null,A:null,T:null,S:null},wO=Object.prototype.hasOwnProperty;function a1(e,t,n){var r=n.ref;return{$$typeof:i1,type:e,key:t,ref:r!==void 0?r:null,props:n}}function mz(e,t){return a1(e.type,t,e.props)}function l1(e){return typeof e=="object"&&e!==null&&e.$$typeof===i1}function gz(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Tw=/\/+/g;function Gg(e,t){return typeof e=="object"&&e!==null&&e.key!=null?gz(""+e.key):t.toString(36)}function vz(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(By,By):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function Ka(e,t,n,r,i){var o=typeof e;(o==="undefined"||o==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(o){case"bigint":case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case i1:case iz:s=!0;break;case vO:return s=e._init,Ka(s(e._payload),t,n,r,i)}}if(s)return i=i(e),s=r===""?"."+Gg(e,0):r,Cw(i)?(n="",s!=null&&(n=s.replace(Tw,"$&/")+"/"),Ka(i,t,n,"",function(c){return c})):i!=null&&(l1(i)&&(i=mz(i,n+(i.key==null||e&&e.key===i.key?"":(""+i.key).replace(Tw,"$&/")+"/")+s)),t.push(i)),1;s=0;var a=r===""?".":r+":";if(Cw(e))for(var l=0;l<e.length;l++)r=e[l],o=a+Gg(r,l),s+=Ka(r,t,n,o,i);else if(l=pz(e),typeof l=="function")for(e=l.call(e),l=0;!(r=e.next()).done;)r=r.value,o=a+Gg(r,l++),s+=Ka(r,t,n,o,i);else if(o==="object"){if(typeof e.then=="function")return Ka(vz(e),t,n,r,i);throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return s}function wd(e,t,n){if(e==null)return e;var r=[],i=0;return Ka(e,r,"","",function(o){return t.call(n,o,i++)}),r}function yz(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Mw=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},bz={map:wd,forEach:function(e,t,n){wd(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return wd(e,function(){t++}),t},toArray:function(e){return wd(e,function(t){return t})||[]},only:function(e){if(!l1(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ie.Activity=hz;ie.Children=bz;ie.Component=sc;ie.Fragment=oz;ie.Profiler=az;ie.PureComponent=o1;ie.StrictMode=sz;ie.Suspense=fz;ie.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=tt;ie.__COMPILER_RUNTIME={__proto__:null,c:function(e){return tt.H.useMemoCache(e)}};ie.cache=function(e){return function(){return e.apply(null,arguments)}};ie.cacheSignal=function(){return null};ie.cloneElement=function(e,t,n){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var r=bO({},e.props),i=e.key;if(t!=null)for(o in t.key!==void 0&&(i=""+t.key),t)!wO.call(t,o)||o==="key"||o==="__self"||o==="__source"||o==="ref"&&t.ref===void 0||(r[o]=t[o]);var o=arguments.length-2;if(o===1)r.children=n;else if(1<o){for(var s=Array(o),a=0;a<o;a++)s[a]=arguments[a+2];r.children=s}return a1(e.type,i,r)};ie.createContext=function(e){return e={$$typeof:cz,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:lz,_context:e},e};ie.createElement=function(e,t,n){var r,i={},o=null;if(t!=null)for(r in t.key!==void 0&&(o=""+t.key),t)wO.call(t,r)&&r!=="key"&&r!=="__self"&&r!=="__source"&&(i[r]=t[r]);var s=arguments.length-2;if(s===1)i.children=n;else if(1<s){for(var a=Array(s),l=0;l<s;l++)a[l]=arguments[l+2];i.children=a}if(e&&e.defaultProps)for(r in s=e.defaultProps,s)i[r]===void 0&&(i[r]=s[r]);return a1(e,o,i)};ie.createRef=function(){return{current:null}};ie.forwardRef=function(e){return{$$typeof:uz,render:e}};ie.isValidElement=l1;ie.lazy=function(e){return{$$typeof:vO,_payload:{_status:-1,_result:e},_init:yz}};ie.memo=function(e,t){return{$$typeof:dz,type:e,compare:t===void 0?null:t}};ie.startTransition=function(e){var t=tt.T,n={};tt.T=n;try{var r=e(),i=tt.S;i!==null&&i(n,r),typeof r=="object"&&r!==null&&typeof r.then=="function"&&r.then(By,Mw)}catch(o){Mw(o)}finally{t!==null&&n.types!==null&&(t.types=n.types),tt.T=t}};ie.unstable_useCacheRefresh=function(){return tt.H.useCacheRefresh()};ie.use=function(e){return tt.H.use(e)};ie.useActionState=function(e,t,n){return tt.H.useActionState(e,t,n)};ie.useCallback=function(e,t){return tt.H.useCallback(e,t)};ie.useContext=function(e){return tt.H.useContext(e)};ie.useDebugValue=function(){};ie.useDeferredValue=function(e,t){return tt.H.useDeferredValue(e,t)};ie.useEffect=function(e,t){return tt.H.useEffect(e,t)};ie.useEffectEvent=function(e){return tt.H.useEffectEvent(e)};ie.useId=function(){return tt.H.useId()};ie.useImperativeHandle=function(e,t,n){return tt.H.useImperativeHandle(e,t,n)};ie.useInsertionEffect=function(e,t){return tt.H.useInsertionEffect(e,t)};ie.useLayoutEffect=function(e,t){return tt.H.useLayoutEffect(e,t)};ie.useMemo=function(e,t){return tt.H.useMemo(e,t)};ie.useOptimistic=function(e,t){return tt.H.useOptimistic(e,t)};ie.useReducer=function(e,t,n){return tt.H.useReducer(e,t,n)};ie.useRef=function(e){return tt.H.useRef(e)};ie.useState=function(e){return tt.H.useState(e)};ie.useSyncExternalStore=function(e,t,n){return tt.H.useSyncExternalStore(e,t,n)};ie.useTransition=function(){return tt.H.useTransition()};ie.version="19.2.0";gO.exports=ie;var S=gO.exports;const Ce=uO(S),EO=ez({__proto__:null,default:Ce},[S]);var CO={exports:{}},xn={};/**
26
+ * @license React
27
+ * react-dom.production.js
28
+ *
29
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var xz=S;function TO(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function ho(){}var vn={d:{f:ho,r:function(){throw Error(TO(522))},D:ho,C:ho,L:ho,m:ho,X:ho,S:ho,M:ho},p:0,findDOMNode:null},Sz=Symbol.for("react.portal");function wz(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Sz,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}var gu=xz.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function Pm(e,t){if(e==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}xn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=vn;xn.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(TO(299));return wz(e,t,null,n)};xn.flushSync=function(e){var t=gu.T,n=vn.p;try{if(gu.T=null,vn.p=2,e)return e()}finally{gu.T=t,vn.p=n,vn.d.f()}};xn.preconnect=function(e,t){typeof e=="string"&&(t?(t=t.crossOrigin,t=typeof t=="string"?t==="use-credentials"?t:"":void 0):t=null,vn.d.C(e,t))};xn.prefetchDNS=function(e){typeof e=="string"&&vn.d.D(e)};xn.preinit=function(e,t){if(typeof e=="string"&&t&&typeof t.as=="string"){var n=t.as,r=Pm(n,t.crossOrigin),i=typeof t.integrity=="string"?t.integrity:void 0,o=typeof t.fetchPriority=="string"?t.fetchPriority:void 0;n==="style"?vn.d.S(e,typeof t.precedence=="string"?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:o}):n==="script"&&vn.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:o,nonce:typeof t.nonce=="string"?t.nonce:void 0})}};xn.preinitModule=function(e,t){if(typeof e=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var n=Pm(t.as,t.crossOrigin);vn.d.M(e,{crossOrigin:n,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0})}}else t==null&&vn.d.M(e)};xn.preload=function(e,t){if(typeof e=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var n=t.as,r=Pm(n,t.crossOrigin);vn.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0,type:typeof t.type=="string"?t.type:void 0,fetchPriority:typeof t.fetchPriority=="string"?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy=="string"?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet=="string"?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes=="string"?t.imageSizes:void 0,media:typeof t.media=="string"?t.media:void 0})}};xn.preloadModule=function(e,t){if(typeof e=="string")if(t){var n=Pm(t.as,t.crossOrigin);vn.d.m(e,{as:typeof t.as=="string"&&t.as!=="script"?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity=="string"?t.integrity:void 0})}else vn.d.m(e)};xn.requestFormReset=function(e){vn.d.r(e)};xn.unstable_batchedUpdates=function(e,t){return e(t)};xn.useFormState=function(e,t,n){return gu.H.useFormState(e,t,n)};xn.useFormStatus=function(){return gu.H.useHostTransitionStatus()};xn.version="19.2.0";function MO(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(MO)}catch(e){console.error(e)}}MO(),CO.exports=xn;var ke=CO.exports;const OO=uO(ke);/**
34
+ * @license React
35
+ * react-dom-client.production.js
36
+ *
37
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
38
+ *
39
+ * This source code is licensed under the MIT license found in the
40
+ * LICENSE file in the root directory of this source tree.
41
+ */var Mt=rz,AO=S,Ez=ke;function j(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function kO(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function If(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function DO(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function NO(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Ow(e){if(If(e)!==e)throw Error(j(188))}function Cz(e){var t=e.alternate;if(!t){if(t=If(e),t===null)throw Error(j(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return Ow(i),e;if(o===r)return Ow(i),t;o=o.sibling}throw Error(j(188))}if(n.return!==r.return)n=i,r=o;else{for(var s=!1,a=i.child;a;){if(a===n){s=!0,n=i,r=o;break}if(a===r){s=!0,r=i,n=o;break}a=a.sibling}if(!s){for(a=o.child;a;){if(a===n){s=!0,n=o,r=i;break}if(a===r){s=!0,r=o,n=i;break}a=a.sibling}if(!s)throw Error(j(189))}}if(n.alternate!==r)throw Error(j(190))}if(n.tag!==3)throw Error(j(188));return n.stateNode.current===n?e:t}function _O(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=_O(e),t!==null)return t;e=e.sibling}return null}var nt=Object.assign,Tz=Symbol.for("react.element"),Ed=Symbol.for("react.transitional.element"),Uc=Symbol.for("react.portal"),al=Symbol.for("react.fragment"),RO=Symbol.for("react.strict_mode"),Hy=Symbol.for("react.profiler"),LO=Symbol.for("react.consumer"),zi=Symbol.for("react.context"),c1=Symbol.for("react.forward_ref"),$y=Symbol.for("react.suspense"),Uy=Symbol.for("react.suspense_list"),u1=Symbol.for("react.memo"),bo=Symbol.for("react.lazy"),Vy=Symbol.for("react.activity"),Mz=Symbol.for("react.memo_cache_sentinel"),Aw=Symbol.iterator;function Dc(e){return e===null||typeof e!="object"?null:(e=Aw&&e[Aw]||e["@@iterator"],typeof e=="function"?e:null)}var Oz=Symbol.for("react.client.reference");function Fy(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Oz?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case al:return"Fragment";case Hy:return"Profiler";case RO:return"StrictMode";case $y:return"Suspense";case Uy:return"SuspenseList";case Vy:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case Uc:return"Portal";case zi:return e.displayName||"Context";case LO:return(e._context.displayName||"Context")+".Consumer";case c1:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case u1:return t=e.displayName||null,t!==null?t:Fy(e.type)||"Memo";case bo:t=e._payload,e=e._init;try{return Fy(e(t))}catch{}}return null}var Vc=Array.isArray,ee=AO.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,_e=Ez.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ys={pending:!1,data:null,method:null,action:null},qy=[],ll=-1;function bi(e){return{current:e}}function _t(e){0>ll||(e.current=qy[ll],qy[ll]=null,ll--)}function We(e,t){ll++,qy[ll]=e.current,e.current=t}var li=bi(null),Gu=bi(null),Uo=bi(null),Wh=bi(null);function Yh(e,t){switch(We(Uo,t),We(Gu,e),We(li,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?LE(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=LE(t),e=e2(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}_t(li),We(li,e)}function Rl(){_t(li),_t(Gu),_t(Uo)}function Ky(e){e.memoizedState!==null&&We(Wh,e);var t=li.current,n=e2(t,e.type);t!==n&&(We(Gu,e),We(li,n))}function Gh(e){Gu.current===e&&(_t(li),_t(Gu)),Wh.current===e&&(_t(Wh),af._currentValue=Ys)}var Xg,kw;function Ds(e){if(Xg===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Xg=t&&t[1]||"",kw=-1<n.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+Xg+e+kw}var Qg=!1;function Jg(e,t){if(!e||Qg)return"";Qg=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var f=function(){throw Error()};if(Object.defineProperty(f.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(f,[])}catch(h){var d=h}Reflect.construct(e,[],f)}else{try{f.call()}catch(h){d=h}e.call(f.prototype)}}else{try{throw Error()}catch(h){d=h}(f=e())&&typeof f.catch=="function"&&f.catch(function(){})}}catch(h){if(h&&d&&typeof h.stack=="string")return[h.stack,d.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var o=r.DetermineComponentFrameRoot(),s=o[0],a=o[1];if(s&&a){var l=s.split(`
44
+ `),c=a.split(`
45
+ `);for(i=r=0;r<l.length&&!l[r].includes("DetermineComponentFrameRoot");)r++;for(;i<c.length&&!c[i].includes("DetermineComponentFrameRoot");)i++;if(r===l.length||i===c.length)for(r=l.length-1,i=c.length-1;1<=r&&0<=i&&l[r]!==c[i];)i--;for(;1<=r&&0<=i;r--,i--)if(l[r]!==c[i]){if(r!==1||i!==1)do if(r--,i--,0>i||l[r]!==c[i]){var u=`
46
+ `+l[r].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Qg=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?Ds(n):""}function Az(e,t){switch(e.tag){case 26:case 27:case 5:return Ds(e.type);case 16:return Ds("Lazy");case 13:return e.child!==t&&t!==null?Ds("Suspense Fallback"):Ds("Suspense");case 19:return Ds("SuspenseList");case 0:case 15:return Jg(e.type,!1);case 11:return Jg(e.type.render,!1);case 1:return Jg(e.type,!0);case 31:return Ds("Activity");default:return""}}function Dw(e){try{var t="",n=null;do t+=Az(e,n),n=e,e=e.return;while(e);return t}catch(r){return`
47
+ Error generating stack: `+r.message+`
48
+ `+r.stack}}var Wy=Object.prototype.hasOwnProperty,f1=Mt.unstable_scheduleCallback,Zg=Mt.unstable_cancelCallback,kz=Mt.unstable_shouldYield,Dz=Mt.unstable_requestPaint,Gn=Mt.unstable_now,Nz=Mt.unstable_getCurrentPriorityLevel,jO=Mt.unstable_ImmediatePriority,zO=Mt.unstable_UserBlockingPriority,Xh=Mt.unstable_NormalPriority,_z=Mt.unstable_LowPriority,IO=Mt.unstable_IdlePriority,Rz=Mt.log,Lz=Mt.unstable_setDisableYieldValue,Pf=null,Xn=null;function No(e){if(typeof Rz=="function"&&Lz(e),Xn&&typeof Xn.setStrictMode=="function")try{Xn.setStrictMode(Pf,e)}catch{}}var Qn=Math.clz32?Math.clz32:Iz,jz=Math.log,zz=Math.LN2;function Iz(e){return e>>>=0,e===0?32:31-(jz(e)/zz|0)|0}var Cd=256,Td=262144,Md=4194304;function Ns(e){var t=e&42;if(t!==0)return t;switch(e&-e){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:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Bm(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,o=e.suspendedLanes,s=e.pingedLanes;e=e.warmLanes;var a=r&134217727;return a!==0?(r=a&~o,r!==0?i=Ns(r):(s&=a,s!==0?i=Ns(s):n||(n=a&~e,n!==0&&(i=Ns(n))))):(a=r&~o,a!==0?i=Ns(a):s!==0?i=Ns(s):n||(n=r&~e,n!==0&&(i=Ns(n)))),i===0?0:t!==0&&t!==i&&!(t&o)&&(o=i&-i,n=t&-t,o>=n||o===32&&(n&4194048)!==0)?t:i}function Bf(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Pz(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 PO(){var e=Md;return Md<<=1,!(Md&62914560)&&(Md=4194304),e}function ev(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Hf(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Bz(e,t,n,r,i,o){var s=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var a=e.entanglements,l=e.expirationTimes,c=e.hiddenUpdates;for(n=s&~n;0<n;){var u=31-Qn(n),f=1<<u;a[u]=0,l[u]=-1;var d=c[u];if(d!==null)for(c[u]=null,u=0;u<d.length;u++){var h=d[u];h!==null&&(h.lane&=-536870913)}n&=~f}r!==0&&BO(e,r,0),o!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=o&~(s&~t))}function BO(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Qn(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function HO(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Qn(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function $O(e,t){var n=t&-t;return n=n&42?1:d1(n),n&(e.suspendedLanes|t)?0:n}function d1(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function h1(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function UO(){var e=_e.p;return e!==0?e:(e=window.event,e===void 0?32:f2(e.type))}function Nw(e,t){var n=_e.p;try{return _e.p=e,t()}finally{_e.p=n}}var ds=Math.random().toString(36).slice(2),Kt="__reactFiber$"+ds,zn="__reactProps$"+ds,ac="__reactContainer$"+ds,Yy="__reactEvents$"+ds,Hz="__reactListeners$"+ds,$z="__reactHandles$"+ds,_w="__reactResources$"+ds,$f="__reactMarker$"+ds;function p1(e){delete e[Kt],delete e[zn],delete e[Yy],delete e[Hz],delete e[$z]}function cl(e){var t=e[Kt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ac]||n[Kt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=BE(e);e!==null;){if(n=e[Kt])return n;e=BE(e)}return t}e=n,n=e.parentNode}return null}function lc(e){if(e=e[Kt]||e[ac]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Fc(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(j(33))}function Sl(e){var t=e[_w];return t||(t=e[_w]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function At(e){e[$f]=!0}var VO=new Set,FO={};function wa(e,t){Ll(e,t),Ll(e+"Capture",t)}function Ll(e,t){for(FO[e]=t,e=0;e<t.length;e++)VO.add(t[e])}var Uz=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]*$"),Rw={},Lw={};function Vz(e){return Wy.call(Lw,e)?!0:Wy.call(Rw,e)?!1:Uz.test(e)?Lw[e]=!0:(Rw[e]=!0,!1)}function hh(e,t,n){if(Vz(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var r=t.toLowerCase().slice(0,5);if(r!=="data-"&&r!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function Od(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function Ci(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+r)}}function ur(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function qO(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Fz(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,o=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(s){n=""+s,o.call(this,s)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(s){n=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Gy(e){if(!e._valueTracker){var t=qO(e)?"checked":"value";e._valueTracker=Fz(e,t,""+e[t])}}function KO(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=qO(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Qh(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var qz=/[\n"\\]/g;function hr(e){return e.replace(qz,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Xy(e,t,n,r,i,o,s,a){e.name="",s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"?e.type=s:e.removeAttribute("type"),t!=null?s==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+ur(t)):e.value!==""+ur(t)&&(e.value=""+ur(t)):s!=="submit"&&s!=="reset"||e.removeAttribute("value"),t!=null?Qy(e,s,ur(t)):n!=null?Qy(e,s,ur(n)):r!=null&&e.removeAttribute("value"),i==null&&o!=null&&(e.defaultChecked=!!o),i!=null&&(e.checked=i&&typeof i!="function"&&typeof i!="symbol"),a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"?e.name=""+ur(a):e.removeAttribute("name")}function WO(e,t,n,r,i,o,s,a){if(o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(e.type=o),t!=null||n!=null){if(!(o!=="submit"&&o!=="reset"||t!=null)){Gy(e);return}n=n!=null?""+ur(n):"",t=t!=null?""+ur(t):n,a||t===e.value||(e.value=t),e.defaultValue=t}r=r??i,r=typeof r!="function"&&typeof r!="symbol"&&!!r,e.checked=a?e.checked:!!r,e.defaultChecked=!!r,s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(e.name=s),Gy(e)}function Qy(e,t,n){t==="number"&&Qh(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function wl(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+ur(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function YO(e,t,n){if(t!=null&&(t=""+ur(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+ur(n):""}function GO(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(j(92));if(Vc(r)){if(1<r.length)throw Error(j(93));r=r[0]}n=r}n==null&&(n=""),t=n}n=ur(t),e.defaultValue=n,r=e.textContent,r===n&&r!==""&&r!==null&&(e.value=r),Gy(e)}function jl(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Kz=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 jw(e,t,n){var r=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?r?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":r?e.setProperty(t,n):typeof n!="number"||n===0||Kz.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function XO(e,t,n){if(t!=null&&typeof t!="object")throw Error(j(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf("--")===0?e.setProperty(r,""):r==="float"?e.cssFloat="":e[r]="");for(var i in t)r=t[i],t.hasOwnProperty(i)&&n[i]!==r&&jw(e,i,r)}else for(var o in t)t.hasOwnProperty(o)&&jw(e,o,t[o])}function m1(e){if(e.indexOf("-")===-1)return!1;switch(e){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 Wz=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"]]),Yz=/^[\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 ph(e){return Yz.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Ii(){}var Jy=null;function g1(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ul=null,El=null;function zw(e){var t=lc(e);if(t&&(e=t.stateNode)){var n=e[zn]||null;e:switch(e=t.stateNode,t.type){case"input":if(Xy(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+hr(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=r[zn]||null;if(!i)throw Error(j(90));Xy(r,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&KO(r)}break e;case"textarea":YO(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&wl(e,!!n.multiple,t,!1)}}}var tv=!1;function QO(e,t,n){if(tv)return e(t,n);tv=!0;try{var r=e(t);return r}finally{if(tv=!1,(ul!==null||El!==null)&&(Qm(),ul&&(t=ul,e=El,El=ul=null,zw(t),e)))for(t=0;t<e.length;t++)zw(e[t])}}function Xu(e,t){var n=e.stateNode;if(n===null)return null;var r=n[zn]||null;if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(j(231,t,typeof n));return n}var Gi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Zy=!1;if(Gi)try{var Nc={};Object.defineProperty(Nc,"passive",{get:function(){Zy=!0}}),window.addEventListener("test",Nc,Nc),window.removeEventListener("test",Nc,Nc)}catch{Zy=!1}var _o=null,v1=null,mh=null;function JO(){if(mh)return mh;var e,t=v1,n=t.length,r,i="value"in _o?_o.value:_o.textContent,o=i.length;for(e=0;e<n&&t[e]===i[e];e++);var s=n-e;for(r=1;r<=s&&t[n-r]===i[o-r];r++);return mh=i.slice(e,1<r?1-r:void 0)}function gh(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Ad(){return!0}function Iw(){return!1}function Pn(e){function t(n,r,i,o,s){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=o,this.target=s,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(o):o[a]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?Ad:Iw,this.isPropagationStopped=Iw,this}return nt(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Ad)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Ad)},persist:function(){},isPersistent:Ad}),t}var Ea={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Hm=Pn(Ea),Uf=nt({},Ea,{view:0,detail:0}),Gz=Pn(Uf),nv,rv,_c,$m=nt({},Uf,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:y1,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==_c&&(_c&&e.type==="mousemove"?(nv=e.screenX-_c.screenX,rv=e.screenY-_c.screenY):rv=nv=0,_c=e),nv)},movementY:function(e){return"movementY"in e?e.movementY:rv}}),Pw=Pn($m),Xz=nt({},$m,{dataTransfer:0}),Qz=Pn(Xz),Jz=nt({},Uf,{relatedTarget:0}),iv=Pn(Jz),Zz=nt({},Ea,{animationName:0,elapsedTime:0,pseudoElement:0}),eI=Pn(Zz),tI=nt({},Ea,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),nI=Pn(tI),rI=nt({},Ea,{data:0}),Bw=Pn(rI),iI={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},oI={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"},sI={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function aI(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=sI[e])?!!t[e]:!1}function y1(){return aI}var lI=nt({},Uf,{key:function(e){if(e.key){var t=iI[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=gh(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?oI[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:y1,charCode:function(e){return e.type==="keypress"?gh(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?gh(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),cI=Pn(lI),uI=nt({},$m,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Hw=Pn(uI),fI=nt({},Uf,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:y1}),dI=Pn(fI),hI=nt({},Ea,{propertyName:0,elapsedTime:0,pseudoElement:0}),pI=Pn(hI),mI=nt({},$m,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),gI=Pn(mI),vI=nt({},Ea,{newState:0,oldState:0}),yI=Pn(vI),bI=[9,13,27,32],b1=Gi&&"CompositionEvent"in window,vu=null;Gi&&"documentMode"in document&&(vu=document.documentMode);var xI=Gi&&"TextEvent"in window&&!vu,ZO=Gi&&(!b1||vu&&8<vu&&11>=vu),$w=" ",Uw=!1;function eA(e,t){switch(e){case"keyup":return bI.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function tA(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var fl=!1;function SI(e,t){switch(e){case"compositionend":return tA(t);case"keypress":return t.which!==32?null:(Uw=!0,$w);case"textInput":return e=t.data,e===$w&&Uw?null:e;default:return null}}function wI(e,t){if(fl)return e==="compositionend"||!b1&&eA(e,t)?(e=JO(),mh=v1=_o=null,fl=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return ZO&&t.locale!=="ko"?null:t.data;default:return null}}var EI={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 Vw(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!EI[e.type]:t==="textarea"}function nA(e,t,n,r){ul?El?El.push(r):El=[r]:ul=r,t=mp(t,"onChange"),0<t.length&&(n=new Hm("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var yu=null,Qu=null;function CI(e){Qk(e,0)}function Um(e){var t=Fc(e);if(KO(t))return e}function Fw(e,t){if(e==="change")return t}var rA=!1;if(Gi){var ov;if(Gi){var sv="oninput"in document;if(!sv){var qw=document.createElement("div");qw.setAttribute("oninput","return;"),sv=typeof qw.oninput=="function"}ov=sv}else ov=!1;rA=ov&&(!document.documentMode||9<document.documentMode)}function Kw(){yu&&(yu.detachEvent("onpropertychange",iA),Qu=yu=null)}function iA(e){if(e.propertyName==="value"&&Um(Qu)){var t=[];nA(t,Qu,e,g1(e)),QO(CI,t)}}function TI(e,t,n){e==="focusin"?(Kw(),yu=t,Qu=n,yu.attachEvent("onpropertychange",iA)):e==="focusout"&&Kw()}function MI(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Um(Qu)}function OI(e,t){if(e==="click")return Um(t)}function AI(e,t){if(e==="input"||e==="change")return Um(t)}function kI(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var tr=typeof Object.is=="function"?Object.is:kI;function Ju(e,t){if(tr(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Wy.call(t,i)||!tr(e[i],t[i]))return!1}return!0}function Ww(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Yw(e,t){var n=Ww(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Ww(n)}}function oA(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?oA(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function sA(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Qh(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Qh(e.document)}return t}function x1(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var DI=Gi&&"documentMode"in document&&11>=document.documentMode,dl=null,e0=null,bu=null,t0=!1;function Gw(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;t0||dl==null||dl!==Qh(r)||(r=dl,"selectionStart"in r&&x1(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),bu&&Ju(bu,r)||(bu=r,r=mp(e0,"onSelect"),0<r.length&&(t=new Hm("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=dl)))}function Ts(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var hl={animationend:Ts("Animation","AnimationEnd"),animationiteration:Ts("Animation","AnimationIteration"),animationstart:Ts("Animation","AnimationStart"),transitionrun:Ts("Transition","TransitionRun"),transitionstart:Ts("Transition","TransitionStart"),transitioncancel:Ts("Transition","TransitionCancel"),transitionend:Ts("Transition","TransitionEnd")},av={},aA={};Gi&&(aA=document.createElement("div").style,"AnimationEvent"in window||(delete hl.animationend.animation,delete hl.animationiteration.animation,delete hl.animationstart.animation),"TransitionEvent"in window||delete hl.transitionend.transition);function Ca(e){if(av[e])return av[e];if(!hl[e])return e;var t=hl[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in aA)return av[e]=t[n];return e}var lA=Ca("animationend"),cA=Ca("animationiteration"),uA=Ca("animationstart"),NI=Ca("transitionrun"),_I=Ca("transitionstart"),RI=Ca("transitioncancel"),fA=Ca("transitionend"),dA=new Map,n0="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(" ");n0.push("scrollEnd");function Fr(e,t){dA.set(e,t),wa(t,[e])}var Jh=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},lr=[],pl=0,S1=0;function Vm(){for(var e=pl,t=S1=pl=0;t<e;){var n=lr[t];lr[t++]=null;var r=lr[t];lr[t++]=null;var i=lr[t];lr[t++]=null;var o=lr[t];if(lr[t++]=null,r!==null&&i!==null){var s=r.pending;s===null?i.next=i:(i.next=s.next,s.next=i),r.pending=i}o!==0&&hA(n,i,o)}}function Fm(e,t,n,r){lr[pl++]=e,lr[pl++]=t,lr[pl++]=n,lr[pl++]=r,S1|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function w1(e,t,n,r){return Fm(e,t,n,r),Zh(e)}function Ta(e,t){return Fm(e,null,null,t),Zh(e)}function hA(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,o=e.return;o!==null;)o.childLanes|=n,r=o.alternate,r!==null&&(r.childLanes|=n),o.tag===22&&(e=o.stateNode,e===null||e._visibility&1||(i=!0)),e=o,o=o.return;return e.tag===3?(o=e.stateNode,i&&t!==null&&(i=31-Qn(n),e=o.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),o):null}function Zh(e){if(50<Au)throw Au=0,E0=null,Error(j(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ml={};function LI(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function qn(e,t,n,r){return new LI(e,t,n,r)}function E1(e){return e=e.prototype,!(!e||!e.isReactComponent)}function $i(e,t){var n=e.alternate;return n===null?(n=qn(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function pA(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function vh(e,t,n,r,i,o){var s=0;if(r=e,typeof e=="function")E1(e)&&(s=1);else if(typeof e=="string")s=B4(e,n,li.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case Vy:return e=qn(31,n,t,i),e.elementType=Vy,e.lanes=o,e;case al:return Gs(n.children,i,o,t);case RO:s=8,i|=24;break;case Hy:return e=qn(12,n,t,i|2),e.elementType=Hy,e.lanes=o,e;case $y:return e=qn(13,n,t,i),e.elementType=$y,e.lanes=o,e;case Uy:return e=qn(19,n,t,i),e.elementType=Uy,e.lanes=o,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case zi:s=10;break e;case LO:s=9;break e;case c1:s=11;break e;case u1:s=14;break e;case bo:s=16,r=null;break e}s=29,n=Error(j(130,e===null?"null":typeof e,"")),r=null}return t=qn(s,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function Gs(e,t,n,r){return e=qn(7,e,r,t),e.lanes=n,e}function lv(e,t,n){return e=qn(6,e,null,t),e.lanes=n,e}function mA(e){var t=qn(18,null,null,0);return t.stateNode=e,t}function cv(e,t,n){return t=qn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Xw=new WeakMap;function pr(e,t){if(typeof e=="object"&&e!==null){var n=Xw.get(e);return n!==void 0?n:(t={value:e,source:t,stack:Dw(t)},Xw.set(e,t),t)}return{value:e,source:t,stack:Dw(t)}}var gl=[],vl=0,ep=null,Zu=0,fr=[],dr=0,rs=null,ri=1,ii="";function Li(e,t){gl[vl++]=Zu,gl[vl++]=ep,ep=e,Zu=t}function gA(e,t,n){fr[dr++]=ri,fr[dr++]=ii,fr[dr++]=rs,rs=e;var r=ri;e=ii;var i=32-Qn(r)-1;r&=~(1<<i),n+=1;var o=32-Qn(t)+i;if(30<o){var s=i-i%5;o=(r&(1<<s)-1).toString(32),r>>=s,i-=s,ri=1<<32-Qn(t)+i|n<<i|r,ii=o+e}else ri=1<<o|n<<i|r,ii=e}function C1(e){e.return!==null&&(Li(e,1),gA(e,1,0))}function T1(e){for(;e===ep;)ep=gl[--vl],gl[vl]=null,Zu=gl[--vl],gl[vl]=null;for(;e===rs;)rs=fr[--dr],fr[dr]=null,ii=fr[--dr],fr[dr]=null,ri=fr[--dr],fr[dr]=null}function vA(e,t){fr[dr++]=ri,fr[dr++]=ii,fr[dr++]=rs,ri=t.id,ii=t.overflow,rs=e}var Wt=null,Ze=null,Se=!1,Vo=null,mr=!1,r0=Error(j(519));function is(e){var t=Error(j(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ef(pr(t,e)),r0}function Qw(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[Kt]=e,t[zn]=r,n){case"dialog":ve("cancel",t),ve("close",t);break;case"iframe":case"object":case"embed":ve("load",t);break;case"video":case"audio":for(n=0;n<of.length;n++)ve(of[n],t);break;case"source":ve("error",t);break;case"img":case"image":case"link":ve("error",t),ve("load",t);break;case"details":ve("toggle",t);break;case"input":ve("invalid",t),WO(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":ve("invalid",t);break;case"textarea":ve("invalid",t),GO(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||r.suppressHydrationWarning===!0||Zk(t.textContent,n)?(r.popover!=null&&(ve("beforetoggle",t),ve("toggle",t)),r.onScroll!=null&&ve("scroll",t),r.onScrollEnd!=null&&ve("scrollend",t),r.onClick!=null&&(t.onclick=Ii),t=!0):t=!1,t||is(e,!0)}function Jw(e){for(Wt=e.return;Wt;)switch(Wt.tag){case 5:case 31:case 13:mr=!1;return;case 27:case 3:mr=!0;return;default:Wt=Wt.return}}function Ia(e){if(e!==Wt)return!1;if(!Se)return Jw(e),Se=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||A0(e.type,e.memoizedProps)),n=!n),n&&Ze&&is(e),Jw(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(j(317));Ze=PE(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(j(317));Ze=PE(e)}else t===27?(t=Ze,hs(e.type)?(e=_0,_0=null,Ze=e):Ze=t):Ze=Wt?xr(e.stateNode.nextSibling):null;return!0}function oa(){Ze=Wt=null,Se=!1}function uv(){var e=Vo;return e!==null&&(An===null?An=e:An.push.apply(An,e),Vo=null),e}function ef(e){Vo===null?Vo=[e]:Vo.push(e)}var i0=bi(null),Ma=null,Pi=null;function To(e,t,n){We(i0,t._currentValue),t._currentValue=n}function Ui(e){e._currentValue=i0.current,_t(i0)}function o0(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function s0(e,t,n,r){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var o=i.dependencies;if(o!==null){var s=i.child;o=o.firstContext;e:for(;o!==null;){var a=o;o=i;for(var l=0;l<t.length;l++)if(a.context===t[l]){o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),o0(o.return,n,e),r||(s=null);break e}o=a.next}}else if(i.tag===18){if(s=i.return,s===null)throw Error(j(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),o0(s,n,e),s=null}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===e){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}}function cc(e,t,n,r){e=null;for(var i=t,o=!1;i!==null;){if(!o){if(i.flags&524288)o=!0;else if(i.flags&262144)break}if(i.tag===10){var s=i.alternate;if(s===null)throw Error(j(387));if(s=s.memoizedProps,s!==null){var a=i.type;tr(i.pendingProps.value,s.value)||(e!==null?e.push(a):e=[a])}}else if(i===Wh.current){if(s=i.alternate,s===null)throw Error(j(387));s.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e!==null?e.push(af):e=[af])}i=i.return}e!==null&&s0(t,e,n,r),t.flags|=262144}function tp(e){for(e=e.firstContext;e!==null;){if(!tr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function sa(e){Ma=e,Pi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Yt(e){return yA(Ma,e)}function kd(e,t){return Ma===null&&sa(e),yA(e,t)}function yA(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Pi===null){if(e===null)throw Error(j(308));Pi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Pi=Pi.next=t;return n}var jI=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,r){e.push(r)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},zI=Mt.unstable_scheduleCallback,II=Mt.unstable_NormalPriority,St={$$typeof:zi,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function M1(){return{controller:new jI,data:new Map,refCount:0}}function Vf(e){e.refCount--,e.refCount===0&&zI(II,function(){e.controller.abort()})}var xu=null,a0=0,zl=0,Cl=null;function PI(e,t){if(xu===null){var n=xu=[];a0=0,zl=Q1(),Cl={status:"pending",value:void 0,then:function(r){n.push(r)}}}return a0++,t.then(Zw,Zw),t}function Zw(){if(--a0===0&&xu!==null){Cl!==null&&(Cl.status="fulfilled");var e=xu;xu=null,zl=0,Cl=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function BI(e,t){var n=[],r={status:"pending",value:null,reason:null,then:function(i){n.push(i)}};return e.then(function(){r.status="fulfilled",r.value=t;for(var i=0;i<n.length;i++)(0,n[i])(t)},function(i){for(r.status="rejected",r.reason=i,i=0;i<n.length;i++)(0,n[i])(void 0)}),r}var eE=ee.S;ee.S=function(e,t){_k=Gn(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&PI(e,t),eE!==null&&eE(e,t)};var Xs=bi(null);function O1(){var e=Xs.current;return e!==null?e:qe.pooledCache}function yh(e,t){t===null?We(Xs,Xs.current):We(Xs,t.pool)}function bA(){var e=O1();return e===null?null:{parent:St._currentValue,pool:e}}var uc=Error(j(460)),A1=Error(j(474)),qm=Error(j(542)),np={then:function(){}};function tE(e){return e=e.status,e==="fulfilled"||e==="rejected"}function xA(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Ii,Ii),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,rE(e),e;default:if(typeof t.status=="string")t.then(Ii,Ii);else{if(e=qe,e!==null&&100<e.shellSuspendCounter)throw Error(j(482));e=t,e.status="pending",e.then(function(r){if(t.status==="pending"){var i=t;i.status="fulfilled",i.value=r}},function(r){if(t.status==="pending"){var i=t;i.status="rejected",i.reason=r}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,rE(e),e}throw Qs=t,uc}}function _s(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(Qs=n,uc):n}}var Qs=null;function nE(){if(Qs===null)throw Error(j(459));var e=Qs;return Qs=null,e}function rE(e){if(e===uc||e===qm)throw Error(j(483))}var Tl=null,tf=0;function Dd(e){var t=tf;return tf+=1,Tl===null&&(Tl=[]),xA(Tl,e,t)}function Rc(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Nd(e,t){throw t.$$typeof===Tz?Error(j(525)):(e=Object.prototype.toString.call(t),Error(j(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function SA(e){function t(v,b){if(e){var x=v.deletions;x===null?(v.deletions=[b],v.flags|=16):x.push(b)}}function n(v,b){if(!e)return null;for(;b!==null;)t(v,b),b=b.sibling;return null}function r(v){for(var b=new Map;v!==null;)v.key!==null?b.set(v.key,v):b.set(v.index,v),v=v.sibling;return b}function i(v,b){return v=$i(v,b),v.index=0,v.sibling=null,v}function o(v,b,x){return v.index=x,e?(x=v.alternate,x!==null?(x=x.index,x<b?(v.flags|=67108866,b):x):(v.flags|=67108866,b)):(v.flags|=1048576,b)}function s(v){return e&&v.alternate===null&&(v.flags|=67108866),v}function a(v,b,x,m){return b===null||b.tag!==6?(b=lv(x,v.mode,m),b.return=v,b):(b=i(b,x),b.return=v,b)}function l(v,b,x,m){var E=x.type;return E===al?u(v,b,x.props.children,m,x.key):b!==null&&(b.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===bo&&_s(E)===b.type)?(b=i(b,x.props),Rc(b,x),b.return=v,b):(b=vh(x.type,x.key,x.props,null,v.mode,m),Rc(b,x),b.return=v,b)}function c(v,b,x,m){return b===null||b.tag!==4||b.stateNode.containerInfo!==x.containerInfo||b.stateNode.implementation!==x.implementation?(b=cv(x,v.mode,m),b.return=v,b):(b=i(b,x.children||[]),b.return=v,b)}function u(v,b,x,m,E){return b===null||b.tag!==7?(b=Gs(x,v.mode,m,E),b.return=v,b):(b=i(b,x),b.return=v,b)}function f(v,b,x){if(typeof b=="string"&&b!==""||typeof b=="number"||typeof b=="bigint")return b=lv(""+b,v.mode,x),b.return=v,b;if(typeof b=="object"&&b!==null){switch(b.$$typeof){case Ed:return x=vh(b.type,b.key,b.props,null,v.mode,x),Rc(x,b),x.return=v,x;case Uc:return b=cv(b,v.mode,x),b.return=v,b;case bo:return b=_s(b),f(v,b,x)}if(Vc(b)||Dc(b))return b=Gs(b,v.mode,x,null),b.return=v,b;if(typeof b.then=="function")return f(v,Dd(b),x);if(b.$$typeof===zi)return f(v,kd(v,b),x);Nd(v,b)}return null}function d(v,b,x,m){var E=b!==null?b.key:null;if(typeof x=="string"&&x!==""||typeof x=="number"||typeof x=="bigint")return E!==null?null:a(v,b,""+x,m);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case Ed:return x.key===E?l(v,b,x,m):null;case Uc:return x.key===E?c(v,b,x,m):null;case bo:return x=_s(x),d(v,b,x,m)}if(Vc(x)||Dc(x))return E!==null?null:u(v,b,x,m,null);if(typeof x.then=="function")return d(v,b,Dd(x),m);if(x.$$typeof===zi)return d(v,b,kd(v,x),m);Nd(v,x)}return null}function h(v,b,x,m,E){if(typeof m=="string"&&m!==""||typeof m=="number"||typeof m=="bigint")return v=v.get(x)||null,a(b,v,""+m,E);if(typeof m=="object"&&m!==null){switch(m.$$typeof){case Ed:return v=v.get(m.key===null?x:m.key)||null,l(b,v,m,E);case Uc:return v=v.get(m.key===null?x:m.key)||null,c(b,v,m,E);case bo:return m=_s(m),h(v,b,x,m,E)}if(Vc(m)||Dc(m))return v=v.get(x)||null,u(b,v,m,E,null);if(typeof m.then=="function")return h(v,b,x,Dd(m),E);if(m.$$typeof===zi)return h(v,b,x,kd(b,m),E);Nd(b,m)}return null}function p(v,b,x,m){for(var E=null,T=null,C=b,O=b=0,A=null;C!==null&&O<x.length;O++){C.index>O?(A=C,C=null):A=C.sibling;var k=d(v,C,x[O],m);if(k===null){C===null&&(C=A);break}e&&C&&k.alternate===null&&t(v,C),b=o(k,b,O),T===null?E=k:T.sibling=k,T=k,C=A}if(O===x.length)return n(v,C),Se&&Li(v,O),E;if(C===null){for(;O<x.length;O++)C=f(v,x[O],m),C!==null&&(b=o(C,b,O),T===null?E=C:T.sibling=C,T=C);return Se&&Li(v,O),E}for(C=r(C);O<x.length;O++)A=h(C,v,O,x[O],m),A!==null&&(e&&A.alternate!==null&&C.delete(A.key===null?O:A.key),b=o(A,b,O),T===null?E=A:T.sibling=A,T=A);return e&&C.forEach(function(z){return t(v,z)}),Se&&Li(v,O),E}function g(v,b,x,m){if(x==null)throw Error(j(151));for(var E=null,T=null,C=b,O=b=0,A=null,k=x.next();C!==null&&!k.done;O++,k=x.next()){C.index>O?(A=C,C=null):A=C.sibling;var z=d(v,C,k.value,m);if(z===null){C===null&&(C=A);break}e&&C&&z.alternate===null&&t(v,C),b=o(z,b,O),T===null?E=z:T.sibling=z,T=z,C=A}if(k.done)return n(v,C),Se&&Li(v,O),E;if(C===null){for(;!k.done;O++,k=x.next())k=f(v,k.value,m),k!==null&&(b=o(k,b,O),T===null?E=k:T.sibling=k,T=k);return Se&&Li(v,O),E}for(C=r(C);!k.done;O++,k=x.next())k=h(C,v,O,k.value,m),k!==null&&(e&&k.alternate!==null&&C.delete(k.key===null?O:k.key),b=o(k,b,O),T===null?E=k:T.sibling=k,T=k);return e&&C.forEach(function(_){return t(v,_)}),Se&&Li(v,O),E}function y(v,b,x,m){if(typeof x=="object"&&x!==null&&x.type===al&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case Ed:e:{for(var E=x.key;b!==null;){if(b.key===E){if(E=x.type,E===al){if(b.tag===7){n(v,b.sibling),m=i(b,x.props.children),m.return=v,v=m;break e}}else if(b.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===bo&&_s(E)===b.type){n(v,b.sibling),m=i(b,x.props),Rc(m,x),m.return=v,v=m;break e}n(v,b);break}else t(v,b);b=b.sibling}x.type===al?(m=Gs(x.props.children,v.mode,m,x.key),m.return=v,v=m):(m=vh(x.type,x.key,x.props,null,v.mode,m),Rc(m,x),m.return=v,v=m)}return s(v);case Uc:e:{for(E=x.key;b!==null;){if(b.key===E)if(b.tag===4&&b.stateNode.containerInfo===x.containerInfo&&b.stateNode.implementation===x.implementation){n(v,b.sibling),m=i(b,x.children||[]),m.return=v,v=m;break e}else{n(v,b);break}else t(v,b);b=b.sibling}m=cv(x,v.mode,m),m.return=v,v=m}return s(v);case bo:return x=_s(x),y(v,b,x,m)}if(Vc(x))return p(v,b,x,m);if(Dc(x)){if(E=Dc(x),typeof E!="function")throw Error(j(150));return x=E.call(x),g(v,b,x,m)}if(typeof x.then=="function")return y(v,b,Dd(x),m);if(x.$$typeof===zi)return y(v,b,kd(v,x),m);Nd(v,x)}return typeof x=="string"&&x!==""||typeof x=="number"||typeof x=="bigint"?(x=""+x,b!==null&&b.tag===6?(n(v,b.sibling),m=i(b,x),m.return=v,v=m):(n(v,b),m=lv(x,v.mode,m),m.return=v,v=m),s(v)):n(v,b)}return function(v,b,x,m){try{tf=0;var E=y(v,b,x,m);return Tl=null,E}catch(C){if(C===uc||C===qm)throw C;var T=qn(29,C,null,v.mode);return T.lanes=m,T.return=v,T}finally{}}}var aa=SA(!0),wA=SA(!1),xo=!1;function k1(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function l0(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Fo(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function qo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Ne&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Zh(e),hA(e,null,n),t}return Fm(e,r,t,n),Zh(e)}function Su(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,HO(e,n)}}function fv(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var s={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};o===null?i=o=s:o=o.next=s,n=n.next}while(n!==null);o===null?i=o=t:o=o.next=t}else i=o=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var c0=!1;function wu(){if(c0){var e=Cl;if(e!==null)throw e}}function Eu(e,t,n,r){c0=!1;var i=e.updateQueue;xo=!1;var o=i.firstBaseUpdate,s=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var l=a,c=l.next;l.next=null,s===null?o=c:s.next=c,s=l;var u=e.alternate;u!==null&&(u=u.updateQueue,a=u.lastBaseUpdate,a!==s&&(a===null?u.firstBaseUpdate=c:a.next=c,u.lastBaseUpdate=l))}if(o!==null){var f=i.baseState;s=0,u=c=l=null,a=o;do{var d=a.lane&-536870913,h=d!==a.lane;if(h?(be&d)===d:(r&d)===d){d!==0&&d===zl&&(c0=!0),u!==null&&(u=u.next={lane:0,tag:a.tag,payload:a.payload,callback:null,next:null});e:{var p=e,g=a;d=t;var y=n;switch(g.tag){case 1:if(p=g.payload,typeof p=="function"){f=p.call(y,f,d);break e}f=p;break e;case 3:p.flags=p.flags&-65537|128;case 0:if(p=g.payload,d=typeof p=="function"?p.call(y,f,d):p,d==null)break e;f=nt({},f,d);break e;case 2:xo=!0}}d=a.callback,d!==null&&(e.flags|=64,h&&(e.flags|=8192),h=i.callbacks,h===null?i.callbacks=[d]:h.push(d))}else h={lane:d,tag:a.tag,payload:a.payload,callback:a.callback,next:null},u===null?(c=u=h,l=f):u=u.next=h,s|=d;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;h=a,a=h.next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}while(!0);u===null&&(l=f),i.baseState=l,i.firstBaseUpdate=c,i.lastBaseUpdate=u,o===null&&(i.shared.lanes=0),as|=s,e.lanes=s,e.memoizedState=f}}function EA(e,t){if(typeof e!="function")throw Error(j(191,e));e.call(t)}function CA(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)EA(n[e],t)}var Il=bi(null),rp=bi(0);function iE(e,t){e=Zi,We(rp,e),We(Il,t),Zi=e|t.baseLanes}function u0(){We(rp,Zi),We(Il,Il.current)}function D1(){Zi=rp.current,_t(Il),_t(rp)}var nr=bi(null),br=null;function Mo(e){var t=e.alternate;We(gt,gt.current&1),We(nr,e),br===null&&(t===null||Il.current!==null||t.memoizedState!==null)&&(br=e)}function f0(e){We(gt,gt.current),We(nr,e),br===null&&(br=e)}function TA(e){e.tag===22?(We(gt,gt.current),We(nr,e),br===null&&(br=e)):Oo()}function Oo(){We(gt,gt.current),We(nr,nr.current)}function Vn(e){_t(nr),br===e&&(br=null),_t(gt)}var gt=bi(0);function ip(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||D0(n)||N0(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Xi=0,se=null,$e=null,bt=null,op=!1,Ml=!1,la=!1,sp=0,nf=0,Ol=null,HI=0;function st(){throw Error(j(321))}function N1(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!tr(e[n],t[n]))return!1;return!0}function _1(e,t,n,r,i,o){return Xi=o,se=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ee.H=e===null||e.memoizedState===null?nk:V1,la=!1,o=n(r,i),la=!1,Ml&&(o=OA(t,n,r,i)),MA(e),o}function MA(e){ee.H=rf;var t=$e!==null&&$e.next!==null;if(Xi=0,bt=$e=se=null,op=!1,nf=0,Ol=null,t)throw Error(j(300));e===null||wt||(e=e.dependencies,e!==null&&tp(e)&&(wt=!0))}function OA(e,t,n,r){se=e;var i=0;do{if(Ml&&(Ol=null),nf=0,Ml=!1,25<=i)throw Error(j(301));if(i+=1,bt=$e=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}ee.H=rk,o=t(n,r)}while(Ml);return o}function $I(){var e=ee.H,t=e.useState()[0];return t=typeof t.then=="function"?Ff(t):t,e=e.useState()[0],($e!==null?$e.memoizedState:null)!==e&&(se.flags|=1024),t}function R1(){var e=sp!==0;return sp=0,e}function L1(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function j1(e){if(op){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}op=!1}Xi=0,bt=$e=se=null,Ml=!1,nf=sp=0,Ol=null}function pn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return bt===null?se.memoizedState=bt=e:bt=bt.next=e,bt}function vt(){if($e===null){var e=se.alternate;e=e!==null?e.memoizedState:null}else e=$e.next;var t=bt===null?se.memoizedState:bt.next;if(t!==null)bt=t,$e=e;else{if(e===null)throw se.alternate===null?Error(j(467)):Error(j(310));$e=e,e={memoizedState:$e.memoizedState,baseState:$e.baseState,baseQueue:$e.baseQueue,queue:$e.queue,next:null},bt===null?se.memoizedState=bt=e:bt=bt.next=e}return bt}function Km(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ff(e){var t=nf;return nf+=1,Ol===null&&(Ol=[]),e=xA(Ol,e,t),t=se,(bt===null?t.memoizedState:bt.next)===null&&(t=t.alternate,ee.H=t===null||t.memoizedState===null?nk:V1),e}function Wm(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Ff(e);if(e.$$typeof===zi)return Yt(e)}throw Error(j(438,String(e)))}function z1(e){var t=null,n=se.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=se.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(i){return i.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=Km(),se.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=Mz;return t.index++,n}function Qi(e,t){return typeof t=="function"?t(e):t}function bh(e){var t=vt();return I1(t,$e,e)}function I1(e,t,n){var r=e.queue;if(r===null)throw Error(j(311));r.lastRenderedReducer=n;var i=e.baseQueue,o=r.pending;if(o!==null){if(i!==null){var s=i.next;i.next=o.next,o.next=s}t.baseQueue=i=o,r.pending=null}if(o=e.baseState,i===null)e.memoizedState=o;else{t=i.next;var a=s=null,l=null,c=t,u=!1;do{var f=c.lane&-536870913;if(f!==c.lane?(be&f)===f:(Xi&f)===f){var d=c.revertLane;if(d===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),f===zl&&(u=!0);else if((Xi&d)===d){c=c.next,d===zl&&(u=!0);continue}else f={lane:0,revertLane:c.revertLane,gesture:null,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null},l===null?(a=l=f,s=o):l=l.next=f,se.lanes|=d,as|=d;f=c.action,la&&n(o,f),o=c.hasEagerState?c.eagerState:n(o,f)}else d={lane:f,revertLane:c.revertLane,gesture:c.gesture,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null},l===null?(a=l=d,s=o):l=l.next=d,se.lanes|=f,as|=f;c=c.next}while(c!==null&&c!==t);if(l===null?s=o:l.next=a,!tr(o,e.memoizedState)&&(wt=!0,u&&(n=Cl,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return i===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function dv(e){var t=vt(),n=t.queue;if(n===null)throw Error(j(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,o=t.memoizedState;if(i!==null){n.pending=null;var s=i=i.next;do o=e(o,s.action),s=s.next;while(s!==i);tr(o,t.memoizedState)||(wt=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function AA(e,t,n){var r=se,i=vt(),o=Se;if(o){if(n===void 0)throw Error(j(407));n=n()}else n=t();var s=!tr(($e||i).memoizedState,n);if(s&&(i.memoizedState=n,wt=!0),i=i.queue,P1(NA.bind(null,r,i,e),[e]),i.getSnapshot!==t||s||bt!==null&&bt.memoizedState.tag&1){if(r.flags|=2048,Pl(9,{destroy:void 0},DA.bind(null,r,i,n,t),null),qe===null)throw Error(j(349));o||Xi&127||kA(r,t,n)}return n}function kA(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=se.updateQueue,t===null?(t=Km(),se.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function DA(e,t,n,r){t.value=n,t.getSnapshot=r,_A(t)&&RA(e)}function NA(e,t,n){return n(function(){_A(t)&&RA(e)})}function _A(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!tr(e,n)}catch{return!0}}function RA(e){var t=Ta(e,2);t!==null&&_n(t,e,2)}function d0(e){var t=pn();if(typeof e=="function"){var n=e;if(e=n(),la){No(!0);try{n()}finally{No(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qi,lastRenderedState:e},t}function LA(e,t,n,r){return e.baseState=n,I1(e,$e,typeof r=="function"?r:Qi)}function UI(e,t,n,r,i){if(Gm(e))throw Error(j(485));if(e=t.action,e!==null){var o={payload:i,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(s){o.listeners.push(s)}};ee.T!==null?n(!0):o.isTransition=!1,r(o),n=t.pending,n===null?(o.next=t.pending=o,jA(t,o)):(o.next=n.next,t.pending=n.next=o)}}function jA(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var o=ee.T,s={};ee.T=s;try{var a=n(i,r),l=ee.S;l!==null&&l(s,a),oE(e,t,a)}catch(c){h0(e,t,c)}finally{o!==null&&s.types!==null&&(o.types=s.types),ee.T=o}}else try{o=n(i,r),oE(e,t,o)}catch(c){h0(e,t,c)}}function oE(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(r){sE(e,t,r)},function(r){return h0(e,t,r)}):sE(e,t,n)}function sE(e,t,n){t.status="fulfilled",t.value=n,zA(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,jA(e,n)))}function h0(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status="rejected",t.reason=n,zA(t),t=t.next;while(t!==r)}e.action=null}function zA(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function IA(e,t){return t}function aE(e,t){if(Se){var n=qe.formState;if(n!==null){e:{var r=se;if(Se){if(Ze){t:{for(var i=Ze,o=mr;i.nodeType!==8;){if(!o){i=null;break t}if(i=xr(i.nextSibling),i===null){i=null;break t}}o=i.data,i=o==="F!"||o==="F"?i:null}if(i){Ze=xr(i.nextSibling),r=i.data==="F!";break e}}is(r)}r=!1}r&&(t=n[0])}}return n=pn(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:IA,lastRenderedState:t},n.queue=r,n=ZA.bind(null,se,r),r.dispatch=n,r=d0(!1),o=U1.bind(null,se,!1,r.queue),r=pn(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=UI.bind(null,se,i,o,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function lE(e){var t=vt();return PA(t,$e,e)}function PA(e,t,n){if(t=I1(e,t,IA)[0],e=bh(Qi)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var r=Ff(t)}catch(s){throw s===uc?qm:s}else r=t;t=vt();var i=t.queue,o=i.dispatch;return n!==t.memoizedState&&(se.flags|=2048,Pl(9,{destroy:void 0},VI.bind(null,i,n),null)),[r,o,e]}function VI(e,t){e.action=t}function cE(e){var t=vt(),n=$e;if(n!==null)return PA(t,n,e);vt(),t=t.memoizedState,n=vt();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Pl(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=se.updateQueue,t===null&&(t=Km(),se.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function BA(){return vt().memoizedState}function xh(e,t,n,r){var i=pn();se.flags|=e,i.memoizedState=Pl(1|t,{destroy:void 0},n,r===void 0?null:r)}function Ym(e,t,n,r){var i=vt();r=r===void 0?null:r;var o=i.memoizedState.inst;$e!==null&&r!==null&&N1(r,$e.memoizedState.deps)?i.memoizedState=Pl(t,o,n,r):(se.flags|=e,i.memoizedState=Pl(1|t,o,n,r))}function uE(e,t){xh(8390656,8,e,t)}function P1(e,t){Ym(2048,8,e,t)}function FI(e){se.flags|=4;var t=se.updateQueue;if(t===null)t=Km(),se.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function HA(e){var t=vt().memoizedState;return FI({ref:t,nextImpl:e}),function(){if(Ne&2)throw Error(j(440));return t.impl.apply(void 0,arguments)}}function $A(e,t){return Ym(4,2,e,t)}function UA(e,t){return Ym(4,4,e,t)}function VA(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function FA(e,t,n){n=n!=null?n.concat([e]):null,Ym(4,4,VA.bind(null,t,e),n)}function B1(){}function qA(e,t){var n=vt();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&N1(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function KA(e,t){var n=vt();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&N1(t,r[1]))return r[0];if(r=e(),la){No(!0);try{e()}finally{No(!1)}}return n.memoizedState=[r,t],r}function H1(e,t,n){return n===void 0||Xi&1073741824&&!(be&261930)?e.memoizedState=t:(e.memoizedState=n,e=Lk(),se.lanes|=e,as|=e,n)}function WA(e,t,n,r){return tr(n,t)?n:Il.current!==null?(e=H1(e,n,r),tr(e,t)||(wt=!0),e):!(Xi&42)||Xi&1073741824&&!(be&261930)?(wt=!0,e.memoizedState=n):(e=Lk(),se.lanes|=e,as|=e,t)}function YA(e,t,n,r,i){var o=_e.p;_e.p=o!==0&&8>o?o:8;var s=ee.T,a={};ee.T=a,U1(e,!1,t,n);try{var l=i(),c=ee.S;if(c!==null&&c(a,l),l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=BI(l,r);Cu(e,t,u,Jn(e))}else Cu(e,t,r,Jn(e))}catch(f){Cu(e,t,{then:function(){},status:"rejected",reason:f},Jn())}finally{_e.p=o,s!==null&&a.types!==null&&(s.types=a.types),ee.T=s}}function qI(){}function p0(e,t,n,r){if(e.tag!==5)throw Error(j(476));var i=GA(e).queue;YA(e,i,t,Ys,n===null?qI:function(){return XA(e),n(r)})}function GA(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Ys,baseState:Ys,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qi,lastRenderedState:Ys},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qi,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function XA(e){var t=GA(e);t.next===null&&(t=e.alternate.memoizedState),Cu(e,t.next.queue,{},Jn())}function $1(){return Yt(af)}function QA(){return vt().memoizedState}function JA(){return vt().memoizedState}function KI(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Jn();e=Fo(n);var r=qo(t,e,n);r!==null&&(_n(r,t,n),Su(r,t,n)),t={cache:M1()},e.payload=t;return}t=t.return}}function WI(e,t,n){var r=Jn();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Gm(e)?ek(t,n):(n=w1(e,t,n,r),n!==null&&(_n(n,e,r),tk(n,t,r)))}function ZA(e,t,n){var r=Jn();Cu(e,t,n,r)}function Cu(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Gm(e))ek(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var s=t.lastRenderedState,a=o(s,n);if(i.hasEagerState=!0,i.eagerState=a,tr(a,s))return Fm(e,t,i,0),qe===null&&Vm(),!1}catch{}finally{}if(n=w1(e,t,i,r),n!==null)return _n(n,e,r),tk(n,t,r),!0}return!1}function U1(e,t,n,r){if(r={lane:2,revertLane:Q1(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Gm(e)){if(t)throw Error(j(479))}else t=w1(e,n,r,2),t!==null&&_n(t,e,2)}function Gm(e){var t=e.alternate;return e===se||t!==null&&t===se}function ek(e,t){Ml=op=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function tk(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,HO(e,n)}}var rf={readContext:Yt,use:Wm,useCallback:st,useContext:st,useEffect:st,useImperativeHandle:st,useLayoutEffect:st,useInsertionEffect:st,useMemo:st,useReducer:st,useRef:st,useState:st,useDebugValue:st,useDeferredValue:st,useTransition:st,useSyncExternalStore:st,useId:st,useHostTransitionStatus:st,useFormState:st,useActionState:st,useOptimistic:st,useMemoCache:st,useCacheRefresh:st};rf.useEffectEvent=st;var nk={readContext:Yt,use:Wm,useCallback:function(e,t){return pn().memoizedState=[e,t===void 0?null:t],e},useContext:Yt,useEffect:uE,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,xh(4194308,4,VA.bind(null,t,e),n)},useLayoutEffect:function(e,t){return xh(4194308,4,e,t)},useInsertionEffect:function(e,t){xh(4,2,e,t)},useMemo:function(e,t){var n=pn();t=t===void 0?null:t;var r=e();if(la){No(!0);try{e()}finally{No(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=pn();if(n!==void 0){var i=n(t);if(la){No(!0);try{n(t)}finally{No(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=WI.bind(null,se,e),[r.memoizedState,e]},useRef:function(e){var t=pn();return e={current:e},t.memoizedState=e},useState:function(e){e=d0(e);var t=e.queue,n=ZA.bind(null,se,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:B1,useDeferredValue:function(e,t){var n=pn();return H1(n,e,t)},useTransition:function(){var e=d0(!1);return e=YA.bind(null,se,e.queue,!0,!1),pn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=se,i=pn();if(Se){if(n===void 0)throw Error(j(407));n=n()}else{if(n=t(),qe===null)throw Error(j(349));be&127||kA(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,uE(NA.bind(null,r,o,e),[e]),r.flags|=2048,Pl(9,{destroy:void 0},DA.bind(null,r,o,n,t),null),n},useId:function(){var e=pn(),t=qe.identifierPrefix;if(Se){var n=ii,r=ri;n=(r&~(1<<32-Qn(r)-1)).toString(32)+n,t="_"+t+"R_"+n,n=sp++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=HI++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:$1,useFormState:aE,useActionState:aE,useOptimistic:function(e){var t=pn();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=U1.bind(null,se,!0,n),n.dispatch=t,[e,t]},useMemoCache:z1,useCacheRefresh:function(){return pn().memoizedState=KI.bind(null,se)},useEffectEvent:function(e){var t=pn(),n={impl:e};return t.memoizedState=n,function(){if(Ne&2)throw Error(j(440));return n.impl.apply(void 0,arguments)}}},V1={readContext:Yt,use:Wm,useCallback:qA,useContext:Yt,useEffect:P1,useImperativeHandle:FA,useInsertionEffect:$A,useLayoutEffect:UA,useMemo:KA,useReducer:bh,useRef:BA,useState:function(){return bh(Qi)},useDebugValue:B1,useDeferredValue:function(e,t){var n=vt();return WA(n,$e.memoizedState,e,t)},useTransition:function(){var e=bh(Qi)[0],t=vt().memoizedState;return[typeof e=="boolean"?e:Ff(e),t]},useSyncExternalStore:AA,useId:QA,useHostTransitionStatus:$1,useFormState:lE,useActionState:lE,useOptimistic:function(e,t){var n=vt();return LA(n,$e,e,t)},useMemoCache:z1,useCacheRefresh:JA};V1.useEffectEvent=HA;var rk={readContext:Yt,use:Wm,useCallback:qA,useContext:Yt,useEffect:P1,useImperativeHandle:FA,useInsertionEffect:$A,useLayoutEffect:UA,useMemo:KA,useReducer:dv,useRef:BA,useState:function(){return dv(Qi)},useDebugValue:B1,useDeferredValue:function(e,t){var n=vt();return $e===null?H1(n,e,t):WA(n,$e.memoizedState,e,t)},useTransition:function(){var e=dv(Qi)[0],t=vt().memoizedState;return[typeof e=="boolean"?e:Ff(e),t]},useSyncExternalStore:AA,useId:QA,useHostTransitionStatus:$1,useFormState:cE,useActionState:cE,useOptimistic:function(e,t){var n=vt();return $e!==null?LA(n,$e,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:z1,useCacheRefresh:JA};rk.useEffectEvent=HA;function hv(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:nt({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var m0={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Jn(),i=Fo(r);i.payload=t,n!=null&&(i.callback=n),t=qo(e,i,r),t!==null&&(_n(t,e,r),Su(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Jn(),i=Fo(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=qo(e,i,r),t!==null&&(_n(t,e,r),Su(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Jn(),r=Fo(n);r.tag=2,t!=null&&(r.callback=t),t=qo(e,r,n),t!==null&&(_n(t,e,n),Su(t,e,n))}};function fE(e,t,n,r,i,o,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,o,s):t.prototype&&t.prototype.isPureReactComponent?!Ju(n,r)||!Ju(i,o):!0}function dE(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&m0.enqueueReplaceState(t,t.state,null)}function ca(e,t){var n=t;if("ref"in t){n={};for(var r in t)r!=="ref"&&(n[r]=t[r])}if(e=e.defaultProps){n===t&&(n=nt({},n));for(var i in e)n[i]===void 0&&(n[i]=e[i])}return n}function ik(e){Jh(e)}function ok(e){console.error(e)}function sk(e){Jh(e)}function ap(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(r){setTimeout(function(){throw r})}}function hE(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(i){setTimeout(function(){throw i})}}function g0(e,t,n){return n=Fo(n),n.tag=3,n.payload={element:null},n.callback=function(){ap(e,t)},n}function ak(e){return e=Fo(e),e.tag=3,e}function lk(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i=="function"){var o=r.value;e.payload=function(){return i(o)},e.callback=function(){hE(t,n,r)}}var s=n.stateNode;s!==null&&typeof s.componentDidCatch=="function"&&(e.callback=function(){hE(t,n,r),typeof i!="function"&&(Ko===null?Ko=new Set([this]):Ko.add(this));var a=r.stack;this.componentDidCatch(r.value,{componentStack:a!==null?a:""})})}function YI(e,t,n,r,i){if(n.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(t=n.alternate,t!==null&&cc(t,n,i,!0),n=nr.current,n!==null){switch(n.tag){case 31:case 13:return br===null?dp():n.alternate===null&&ct===0&&(ct=3),n.flags&=-257,n.flags|=65536,n.lanes=i,r===np?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Cv(e,r,i)),!1;case 22:return n.flags|=65536,r===np?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Cv(e,r,i)),!1}throw Error(j(435,n.tag))}return Cv(e,r,i),dp(),!1}if(Se)return t=nr.current,t!==null?(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=i,r!==r0&&(e=Error(j(422),{cause:r}),ef(pr(e,n)))):(r!==r0&&(t=Error(j(423),{cause:r}),ef(pr(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,r=pr(r,n),i=g0(e.stateNode,r,i),fv(e,i),ct!==4&&(ct=2)),!1;var o=Error(j(520),{cause:r});if(o=pr(o,n),Ou===null?Ou=[o]:Ou.push(o),ct!==4&&(ct=2),t===null)return!0;r=pr(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=g0(n.stateNode,r,e),fv(n,e),!1;case 1:if(t=n.type,o=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||o!==null&&typeof o.componentDidCatch=="function"&&(Ko===null||!Ko.has(o))))return n.flags|=65536,i&=-i,n.lanes|=i,i=ak(i),lk(i,e,n,r),fv(n,i),!1}n=n.return}while(n!==null);return!1}var F1=Error(j(461)),wt=!1;function Bt(e,t,n,r){t.child=e===null?wA(t,null,n,r):aa(t,e.child,n,r)}function pE(e,t,n,r,i){n=n.render;var o=t.ref;if("ref"in r){var s={};for(var a in r)a!=="ref"&&(s[a]=r[a])}else s=r;return sa(t),r=_1(e,t,n,s,o,i),a=R1(),e!==null&&!wt?(L1(e,t,i),Ji(e,t,i)):(Se&&a&&C1(t),t.flags|=1,Bt(e,t,r,i),t.child)}function mE(e,t,n,r,i){if(e===null){var o=n.type;return typeof o=="function"&&!E1(o)&&o.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=o,ck(e,t,o,r,i)):(e=vh(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!q1(e,i)){var s=o.memoizedProps;if(n=n.compare,n=n!==null?n:Ju,n(s,r)&&e.ref===t.ref)return Ji(e,t,i)}return t.flags|=1,e=$i(o,r),e.ref=t.ref,e.return=t,t.child=e}function ck(e,t,n,r,i){if(e!==null){var o=e.memoizedProps;if(Ju(o,r)&&e.ref===t.ref)if(wt=!1,t.pendingProps=r=o,q1(e,i))e.flags&131072&&(wt=!0);else return t.lanes=e.lanes,Ji(e,t,i)}return v0(e,t,n,r,i)}function uk(e,t,n,r){var i=r.children,o=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode==="hidden"){if(t.flags&128){if(o=o!==null?o.baseLanes|n:n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~o}else r=0,t.child=null;return gE(e,t,o,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&yh(t,o!==null?o.cachePool:null),o!==null?iE(t,o):u0(),TA(t);else return r=t.lanes=536870912,gE(e,t,o!==null?o.baseLanes|n:n,n,r)}else o!==null?(yh(t,o.cachePool),iE(t,o),Oo(),t.memoizedState=null):(e!==null&&yh(t,null),u0(),Oo());return Bt(e,t,i,n),t.child}function qc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function gE(e,t,n,r,i){var o=O1();return o=o===null?null:{parent:St._currentValue,pool:o},t.memoizedState={baseLanes:n,cachePool:o},e!==null&&yh(t,null),u0(),TA(t),e!==null&&cc(e,t,r,!0),t.childLanes=i,null}function Sh(e,t){return t=lp({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function vE(e,t,n){return aa(t,e.child,null,n),e=Sh(t,t.pendingProps),e.flags|=2,Vn(t),t.memoizedState=null,e}function GI(e,t,n){var r=t.pendingProps,i=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Se){if(r.mode==="hidden")return e=Sh(t,r),t.lanes=536870912,qc(null,e);if(f0(t),(e=Ze)?(e=n2(e,mr),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:rs!==null?{id:ri,overflow:ii}:null,retryLane:536870912,hydrationErrors:null},n=mA(e),n.return=t,t.child=n,Wt=t,Ze=null)):e=null,e===null)throw is(t);return t.lanes=536870912,null}return Sh(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(f0(t),i)if(t.flags&256)t.flags&=-257,t=vE(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(j(558));else if(wt||cc(e,t,n,!1),i=(n&e.childLanes)!==0,wt||i){if(r=qe,r!==null&&(s=$O(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Ta(e,s),_n(r,e,s),F1;dp(),t=vE(e,t,n)}else e=o.treeContext,Ze=xr(s.nextSibling),Wt=t,Se=!0,Vo=null,mr=!1,e!==null&&vA(t,e),t=Sh(t,r),t.flags|=4096;return t}return e=$i(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function wh(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(j(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function v0(e,t,n,r,i){return sa(t),n=_1(e,t,n,r,void 0,i),r=R1(),e!==null&&!wt?(L1(e,t,i),Ji(e,t,i)):(Se&&r&&C1(t),t.flags|=1,Bt(e,t,n,i),t.child)}function yE(e,t,n,r,i,o){return sa(t),t.updateQueue=null,n=OA(t,r,n,i),MA(e),r=R1(),e!==null&&!wt?(L1(e,t,o),Ji(e,t,o)):(Se&&r&&C1(t),t.flags|=1,Bt(e,t,n,o),t.child)}function bE(e,t,n,r,i){if(sa(t),t.stateNode===null){var o=ml,s=n.contextType;typeof s=="object"&&s!==null&&(o=Yt(s)),o=new n(r,o),t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,o.updater=m0,t.stateNode=o,o._reactInternals=t,o=t.stateNode,o.props=r,o.state=t.memoizedState,o.refs={},k1(t),s=n.contextType,o.context=typeof s=="object"&&s!==null?Yt(s):ml,o.state=t.memoizedState,s=n.getDerivedStateFromProps,typeof s=="function"&&(hv(t,n,s,r),o.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(s=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),s!==o.state&&m0.enqueueReplaceState(o,o.state,null),Eu(t,r,o,i),wu(),o.state=t.memoizedState),typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!0}else if(e===null){o=t.stateNode;var a=t.memoizedProps,l=ca(n,a);o.props=l;var c=o.context,u=n.contextType;s=ml,typeof u=="object"&&u!==null&&(s=Yt(u));var f=n.getDerivedStateFromProps;u=typeof f=="function"||typeof o.getSnapshotBeforeUpdate=="function",a=t.pendingProps!==a,u||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a||c!==s)&&dE(t,o,r,s),xo=!1;var d=t.memoizedState;o.state=d,Eu(t,r,o,i),wu(),c=t.memoizedState,a||d!==c||xo?(typeof f=="function"&&(hv(t,n,f,r),c=t.memoizedState),(l=xo||fE(t,n,l,r,d,c,s))?(u||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),o.props=r,o.state=c,o.context=s,r=l):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,l0(e,t),s=t.memoizedProps,u=ca(n,s),o.props=u,f=t.pendingProps,d=o.context,c=n.contextType,l=ml,typeof c=="object"&&c!==null&&(l=Yt(c)),a=n.getDerivedStateFromProps,(c=typeof a=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(s!==f||d!==l)&&dE(t,o,r,l),xo=!1,d=t.memoizedState,o.state=d,Eu(t,r,o,i),wu();var h=t.memoizedState;s!==f||d!==h||xo||e!==null&&e.dependencies!==null&&tp(e.dependencies)?(typeof a=="function"&&(hv(t,n,a,r),h=t.memoizedState),(u=xo||fE(t,n,u,r,d,h,l)||e!==null&&e.dependencies!==null&&tp(e.dependencies))?(c||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,h,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,h,l)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=h),o.props=r,o.state=h,o.context=l,r=u):(typeof o.componentDidUpdate!="function"||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),r=!1)}return o=r,wh(e,t),r=(t.flags&128)!==0,o||r?(o=t.stateNode,n=r&&typeof n.getDerivedStateFromError!="function"?null:o.render(),t.flags|=1,e!==null&&r?(t.child=aa(t,e.child,null,i),t.child=aa(t,null,n,i)):Bt(e,t,n,i),t.memoizedState=o.state,e=t.child):e=Ji(e,t,i),e}function xE(e,t,n,r){return oa(),t.flags|=256,Bt(e,t,n,r),t.child}var pv={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function mv(e){return{baseLanes:e,cachePool:bA()}}function gv(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=Yn),e}function fk(e,t,n){var r=t.pendingProps,i=!1,o=(t.flags&128)!==0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(gt.current&2)!==0),s&&(i=!0,t.flags&=-129),s=(t.flags&32)!==0,t.flags&=-33,e===null){if(Se){if(i?Mo(t):Oo(),(e=Ze)?(e=n2(e,mr),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:rs!==null?{id:ri,overflow:ii}:null,retryLane:536870912,hydrationErrors:null},n=mA(e),n.return=t,t.child=n,Wt=t,Ze=null)):e=null,e===null)throw is(t);return N0(e)?t.lanes=32:t.lanes=536870912,null}var a=r.children;return r=r.fallback,i?(Oo(),i=t.mode,a=lp({mode:"hidden",children:a},i),r=Gs(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=mv(n),r.childLanes=gv(e,s,n),t.memoizedState=pv,qc(null,r)):(Mo(t),y0(t,a))}var l=e.memoizedState;if(l!==null&&(a=l.dehydrated,a!==null)){if(o)t.flags&256?(Mo(t),t.flags&=-257,t=vv(e,t,n)):t.memoizedState!==null?(Oo(),t.child=e.child,t.flags|=128,t=null):(Oo(),a=r.fallback,i=t.mode,r=lp({mode:"visible",children:r.children},i),a=Gs(a,i,n,null),a.flags|=2,r.return=t,a.return=t,r.sibling=a,t.child=r,aa(t,e.child,null,n),r=t.child,r.memoizedState=mv(n),r.childLanes=gv(e,s,n),t.memoizedState=pv,t=qc(null,r));else if(Mo(t),N0(a)){if(s=a.nextSibling&&a.nextSibling.dataset,s)var c=s.dgst;s=c,r=Error(j(419)),r.stack="",r.digest=s,ef({value:r,source:null,stack:null}),t=vv(e,t,n)}else if(wt||cc(e,t,n,!1),s=(n&e.childLanes)!==0,wt||s){if(s=qe,s!==null&&(r=$O(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,Ta(e,r),_n(s,e,r),F1;D0(a)||dp(),t=vv(e,t,n)}else D0(a)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Ze=xr(a.nextSibling),Wt=t,Se=!0,Vo=null,mr=!1,e!==null&&vA(t,e),t=y0(t,r.children),t.flags|=4096);return t}return i?(Oo(),a=r.fallback,i=t.mode,l=e.child,c=l.sibling,r=$i(l,{mode:"hidden",children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,c!==null?a=$i(c,a):(a=Gs(a,i,n,null),a.flags|=2),a.return=t,r.return=t,r.sibling=a,t.child=r,qc(null,r),r=t.child,a=e.child.memoizedState,a===null?a=mv(n):(i=a.cachePool,i!==null?(l=St._currentValue,i=i.parent!==l?{parent:l,pool:l}:i):i=bA(),a={baseLanes:a.baseLanes|n,cachePool:i}),r.memoizedState=a,r.childLanes=gv(e,s,n),t.memoizedState=pv,qc(e.child,r)):(Mo(t),n=e.child,e=n.sibling,n=$i(n,{mode:"visible",children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function y0(e,t){return t=lp({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function lp(e,t){return e=qn(22,e,null,t),e.lanes=0,e}function vv(e,t,n){return aa(t,e.child,null,n),e=y0(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function SE(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),o0(e.return,t,n)}function yv(e,t,n,r,i,o){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:o}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=i,s.treeForkCount=o)}function dk(e,t,n){var r=t.pendingProps,i=r.revealOrder,o=r.tail;r=r.children;var s=gt.current,a=(s&2)!==0;if(a?(s=s&1|2,t.flags|=128):s&=1,We(gt,s),Bt(e,t,r,n),r=Se?Zu:0,!a&&e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&SE(e,n,t);else if(e.tag===19)SE(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&ip(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),yv(t,!1,i,n,o,r);break;case"backwards":case"unstable_legacy-backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&ip(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}yv(t,!0,n,null,o,r);break;case"together":yv(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Ji(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),as|=t.lanes,!(n&t.childLanes))if(e!==null){if(cc(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(j(153));if(t.child!==null){for(e=t.child,n=$i(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=$i(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function q1(e,t){return e.lanes&t?!0:(e=e.dependencies,!!(e!==null&&tp(e)))}function XI(e,t,n){switch(t.tag){case 3:Yh(t,t.stateNode.containerInfo),To(t,St,e.memoizedState.cache),oa();break;case 27:case 5:Ky(t);break;case 4:Yh(t,t.stateNode.containerInfo);break;case 10:To(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,f0(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated!==null?(Mo(t),t.flags|=128,null):n&t.child.childLanes?fk(e,t,n):(Mo(t),e=Ji(e,t,n),e!==null?e.sibling:null);Mo(t);break;case 19:var i=(e.flags&128)!==0;if(r=(n&t.childLanes)!==0,r||(cc(e,t,n,!1),r=(n&t.childLanes)!==0),i){if(r)return dk(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),We(gt,gt.current),r)break;return null;case 22:return t.lanes=0,uk(e,t,n,t.pendingProps);case 24:To(t,St,e.memoizedState.cache)}return Ji(e,t,n)}function hk(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)wt=!0;else{if(!q1(e,n)&&!(t.flags&128))return wt=!1,XI(e,t,n);wt=!!(e.flags&131072)}else wt=!1,Se&&t.flags&1048576&&gA(t,Zu,t.index);switch(t.lanes=0,t.tag){case 16:e:{var r=t.pendingProps;if(e=_s(t.elementType),t.type=e,typeof e=="function")E1(e)?(r=ca(e,r),t.tag=1,t=bE(null,t,e,r,n)):(t.tag=0,t=v0(null,t,e,r,n));else{if(e!=null){var i=e.$$typeof;if(i===c1){t.tag=11,t=pE(null,t,e,r,n);break e}else if(i===u1){t.tag=14,t=mE(null,t,e,r,n);break e}}throw t=Fy(e)||e,Error(j(306,t,""))}}return t;case 0:return v0(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,i=ca(r,t.pendingProps),bE(e,t,r,i,n);case 3:e:{if(Yh(t,t.stateNode.containerInfo),e===null)throw Error(j(387));r=t.pendingProps;var o=t.memoizedState;i=o.element,l0(e,t),Eu(t,r,null,n);var s=t.memoizedState;if(r=s.cache,To(t,St,r),r!==o.cache&&s0(t,[St],n,!0),wu(),r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=xE(e,t,r,n);break e}else if(r!==i){i=pr(Error(j(424)),t),ef(i),t=xE(e,t,r,n);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(Ze=xr(e.firstChild),Wt=t,Se=!0,Vo=null,mr=!0,n=wA(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(oa(),r===i){t=Ji(e,t,n);break e}Bt(e,t,r,n)}t=t.child}return t;case 26:return wh(e,t),e===null?(n=$E(t.type,null,t.pendingProps,null))?t.memoizedState=n:Se||(n=t.type,e=t.pendingProps,r=gp(Uo.current).createElement(n),r[Kt]=t,r[zn]=e,Qt(r,n,e),At(r),t.stateNode=r):t.memoizedState=$E(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Ky(t),e===null&&Se&&(r=t.stateNode=r2(t.type,t.pendingProps,Uo.current),Wt=t,mr=!0,i=Ze,hs(t.type)?(_0=i,Ze=xr(r.firstChild)):Ze=i),Bt(e,t,t.pendingProps.children,n),wh(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Se&&((i=r=Ze)&&(r=M4(r,t.type,t.pendingProps,mr),r!==null?(t.stateNode=r,Wt=t,Ze=xr(r.firstChild),mr=!1,i=!0):i=!1),i||is(t)),Ky(t),i=t.type,o=t.pendingProps,s=e!==null?e.memoizedProps:null,r=o.children,A0(i,o)?r=null:s!==null&&A0(i,s)&&(t.flags|=32),t.memoizedState!==null&&(i=_1(e,t,$I,null,null,n),af._currentValue=i),wh(e,t),Bt(e,t,r,n),t.child;case 6:return e===null&&Se&&((e=n=Ze)&&(n=O4(n,t.pendingProps,mr),n!==null?(t.stateNode=n,Wt=t,Ze=null,e=!0):e=!1),e||is(t)),null;case 13:return fk(e,t,n);case 4:return Yh(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=aa(t,null,r,n):Bt(e,t,r,n),t.child;case 11:return pE(e,t,t.type,t.pendingProps,n);case 7:return Bt(e,t,t.pendingProps,n),t.child;case 8:return Bt(e,t,t.pendingProps.children,n),t.child;case 12:return Bt(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,To(t,t.type,r.value),Bt(e,t,r.children,n),t.child;case 9:return i=t.type._context,r=t.pendingProps.children,sa(t),i=Yt(i),r=r(i),t.flags|=1,Bt(e,t,r,n),t.child;case 14:return mE(e,t,t.type,t.pendingProps,n);case 15:return ck(e,t,t.type,t.pendingProps,n);case 19:return dk(e,t,n);case 31:return GI(e,t,n);case 22:return uk(e,t,n,t.pendingProps);case 24:return sa(t),r=Yt(St),e===null?(i=O1(),i===null&&(i=qe,o=M1(),i.pooledCache=o,o.refCount++,o!==null&&(i.pooledCacheLanes|=n),i=o),t.memoizedState={parent:r,cache:i},k1(t),To(t,St,i)):(e.lanes&n&&(l0(e,t),Eu(t,null,null,n),wu()),i=e.memoizedState,o=t.memoizedState,i.parent!==r?(i={parent:r,cache:r},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),To(t,St,r)):(r=o.cache,To(t,St,r),r!==i.cache&&s0(t,[St],n,!0))),Bt(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(j(156,t.tag))}function Ti(e){e.flags|=4}function bv(e,t,n,r,i){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(Ik())e.flags|=8192;else throw Qs=np,A1}else e.flags&=-16777217}function wE(e,t){if(t.type!=="stylesheet"||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!s2(t))if(Ik())e.flags|=8192;else throw Qs=np,A1}function _d(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?PO():536870912,e.lanes|=t,Bl|=t)}function Lc(e,t){if(!Se)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Qe(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function QI(e,t,n){var r=t.pendingProps;switch(T1(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Qe(t),null;case 1:return Qe(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Ui(St),Rl(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Ia(t)?Ti(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,uv())),Qe(t),null;case 26:var i=t.type,o=t.memoizedState;return e===null?(Ti(t),o!==null?(Qe(t),wE(t,o)):(Qe(t),bv(t,i,null,r,n))):o?o!==e.memoizedState?(Ti(t),Qe(t),wE(t,o)):(Qe(t),t.flags&=-16777217):(e=e.memoizedProps,e!==r&&Ti(t),Qe(t),bv(t,i,e,r,n)),null;case 27:if(Gh(t),n=Uo.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ti(t);else{if(!r){if(t.stateNode===null)throw Error(j(166));return Qe(t),null}e=li.current,Ia(t)?Qw(t):(e=r2(i,r,n),t.stateNode=e,Ti(t))}return Qe(t),null;case 5:if(Gh(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ti(t);else{if(!r){if(t.stateNode===null)throw Error(j(166));return Qe(t),null}if(o=li.current,Ia(t))Qw(t);else{var s=gp(Uo.current);switch(o){case 1:o=s.createElementNS("http://www.w3.org/2000/svg",i);break;case 2:o=s.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;default:switch(i){case"svg":o=s.createElementNS("http://www.w3.org/2000/svg",i);break;case"math":o=s.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;case"script":o=s.createElement("div"),o.innerHTML="<script><\/script>",o=o.removeChild(o.firstChild);break;case"select":o=typeof r.is=="string"?s.createElement("select",{is:r.is}):s.createElement("select"),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is=="string"?s.createElement(i,{is:r.is}):s.createElement(i)}}o[Kt]=t,o[zn]=r;e:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break e;for(;s.sibling===null;){if(s.return===null||s.return===t)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;e:switch(Qt(o,i,r),i){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&Ti(t)}}return Qe(t),bv(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Ti(t);else{if(typeof r!="string"&&t.stateNode===null)throw Error(j(166));if(e=Uo.current,Ia(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,i=Wt,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[Kt]=t,e=!!(e.nodeValue===n||r!==null&&r.suppressHydrationWarning===!0||Zk(e.nodeValue,n)),e||is(t,!0)}else e=gp(e).createTextNode(r),e[Kt]=t,t.stateNode=e}return Qe(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Ia(t),n!==null){if(e===null){if(!r)throw Error(j(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(j(557));e[Kt]=t}else oa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Qe(t),e=!1}else n=uv(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Vn(t),t):(Vn(t),null);if(t.flags&128)throw Error(j(558))}return Qe(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=Ia(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(j(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(j(317));i[Kt]=t}else oa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Qe(t),i=!1}else i=uv(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(Vn(t),t):(Vn(t),null)}return Vn(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,i=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(i=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==i&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),_d(t,t.updateQueue),Qe(t),null);case 4:return Rl(),e===null&&J1(t.stateNode.containerInfo),Qe(t),null;case 10:return Ui(t.type),Qe(t),null;case 19:if(_t(gt),r=t.memoizedState,r===null)return Qe(t),null;if(i=(t.flags&128)!==0,o=r.rendering,o===null)if(i)Lc(r,!1);else{if(ct!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=ip(e),o!==null){for(t.flags|=128,Lc(r,!1),e=o.updateQueue,t.updateQueue=e,_d(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)pA(n,e),n=n.sibling;return We(gt,gt.current&1|2),Se&&Li(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Gn()>up&&(t.flags|=128,i=!0,Lc(r,!1),t.lanes=4194304)}else{if(!i)if(e=ip(o),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,_d(t,e),Lc(r,!0),r.tail===null&&r.tailMode==="hidden"&&!o.alternate&&!Se)return Qe(t),null}else 2*Gn()-r.renderingStartTime>up&&n!==536870912&&(t.flags|=128,i=!0,Lc(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e!==null?e.sibling=o:t.child=o,r.last=o)}return r.tail!==null?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Gn(),e.sibling=null,n=gt.current,We(gt,i?n&1|2:n&1),Se&&Li(t,r.treeForkCount),e):(Qe(t),null);case 22:case 23:return Vn(t),D1(),r=t.memoizedState!==null,e!==null?e.memoizedState!==null!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Qe(t),t.subtreeFlags&6&&(t.flags|=8192)):Qe(t),n=t.updateQueue,n!==null&&_d(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&_t(Xs),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Ui(St),Qe(t),null;case 25:return null;case 30:return null}throw Error(j(156,t.tag))}function JI(e,t){switch(T1(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ui(St),Rl(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Gh(t),null;case 31:if(t.memoizedState!==null){if(Vn(t),t.alternate===null)throw Error(j(340));oa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Vn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(j(340));oa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return _t(gt),null;case 4:return Rl(),null;case 10:return Ui(t.type),null;case 22:case 23:return Vn(t),D1(),e!==null&&_t(Xs),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ui(St),null;case 25:return null;default:return null}}function pk(e,t){switch(T1(t),t.tag){case 3:Ui(St),Rl();break;case 26:case 27:case 5:Gh(t);break;case 4:Rl();break;case 31:t.memoizedState!==null&&Vn(t);break;case 13:Vn(t);break;case 19:_t(gt);break;case 10:Ui(t.type);break;case 22:case 23:Vn(t),D1(),e!==null&&_t(Xs);break;case 24:Ui(St)}}function qf(e,t){try{var n=t.updateQueue,r=n!==null?n.lastEffect:null;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var o=n.create,s=n.inst;r=o(),s.destroy=r}n=n.next}while(n!==i)}}catch(a){ze(t,t.return,a)}}function ss(e,t,n){try{var r=t.updateQueue,i=r!==null?r.lastEffect:null;if(i!==null){var o=i.next;r=o;do{if((r.tag&e)===e){var s=r.inst,a=s.destroy;if(a!==void 0){s.destroy=void 0,i=t;var l=n,c=a;try{c()}catch(u){ze(i,l,u)}}}r=r.next}while(r!==o)}}catch(u){ze(t,t.return,u)}}function mk(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{CA(t,n)}catch(r){ze(e,e.return,r)}}}function gk(e,t,n){n.props=ca(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(r){ze(e,t,r)}}function Tu(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n=="function"?e.refCleanup=n(r):n.current=r}}catch(i){ze(e,t,i)}}function oi(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r=="function")try{r()}catch(i){ze(e,t,i)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(i){ze(e,t,i)}else n.current=null}function vk(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&r.focus();break e;case"img":n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(i){ze(e,e.return,i)}}function xv(e,t,n){try{var r=e.stateNode;x4(r,e.type,n,t),r[zn]=t}catch(i){ze(e,e.return,i)}}function yk(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&hs(e.type)||e.tag===4}function Sv(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||yk(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&hs(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function b0(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Ii));else if(r!==4&&(r===27&&hs(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(b0(e,t,n),e=e.sibling;e!==null;)b0(e,t,n),e=e.sibling}function cp(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&hs(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(cp(e,t,n),e=e.sibling;e!==null;)cp(e,t,n),e=e.sibling}function bk(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Qt(t,r,n),t[Kt]=e,t[zn]=n}catch(o){ze(e,e.return,o)}}var ji=!1,xt=!1,wv=!1,EE=typeof WeakSet=="function"?WeakSet:Set,Ot=null;function ZI(e,t){if(e=e.containerInfo,M0=xp,e=sA(e),x1(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var s=0,a=-1,l=-1,c=0,u=0,f=e,d=null;t:for(;;){for(var h;f!==n||i!==0&&f.nodeType!==3||(a=s+i),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(h=f.firstChild)!==null;)d=f,f=h;for(;;){if(f===e)break t;if(d===n&&++c===i&&(a=s),d===o&&++u===r&&(l=s),(h=f.nextSibling)!==null)break;f=d,d=f.parentNode}f=h}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(O0={focusedElem:e,selectionRange:n},xp=!1,Ot=t;Ot!==null;)if(t=Ot,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ot=e;else for(;Ot!==null;){switch(t=Ot,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n<e.length;n++)i=e[n],i.ref.impl=i.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,i=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var p=ca(n.type,i);e=r.getSnapshotBeforeUpdate(p,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(g){ze(n,n.return,g)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)k0(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":k0(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(j(163))}if(e=t.sibling,e!==null){e.return=t.return,Ot=e;break}Ot=t.return}}function xk(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Oi(e,n),r&4&&qf(5,n);break;case 1:if(Oi(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(s){ze(n,n.return,s)}else{var i=ca(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(s){ze(n,n.return,s)}}r&64&&mk(n),r&512&&Tu(n,n.return);break;case 3:if(Oi(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{CA(e,t)}catch(s){ze(n,n.return,s)}}break;case 27:t===null&&r&4&&bk(n);case 26:case 5:Oi(e,n),t===null&&r&4&&vk(n),r&512&&Tu(n,n.return);break;case 12:Oi(e,n);break;case 31:Oi(e,n),r&4&&Ek(e,n);break;case 13:Oi(e,n),r&4&&Ck(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=l4.bind(null,n),A4(e,n))));break;case 22:if(r=n.memoizedState!==null||ji,!r){t=t!==null&&t.memoizedState!==null||xt,i=ji;var o=xt;ji=r,(xt=t)&&!o?Ni(e,n,(n.subtreeFlags&8772)!==0):Oi(e,n),ji=i,xt=o}break;case 30:break;default:Oi(e,n)}}function Sk(e){var t=e.alternate;t!==null&&(e.alternate=null,Sk(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&p1(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var rt=null,On=!1;function Mi(e,t,n){for(n=n.child;n!==null;)wk(e,t,n),n=n.sibling}function wk(e,t,n){if(Xn&&typeof Xn.onCommitFiberUnmount=="function")try{Xn.onCommitFiberUnmount(Pf,n)}catch{}switch(n.tag){case 26:xt||oi(n,t),Mi(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:xt||oi(n,t);var r=rt,i=On;hs(n.type)&&(rt=n.stateNode,On=!1),Mi(e,t,n),ku(n.stateNode),rt=r,On=i;break;case 5:xt||oi(n,t);case 6:if(r=rt,i=On,rt=null,Mi(e,t,n),rt=r,On=i,rt!==null)if(On)try{(rt.nodeType===9?rt.body:rt.nodeName==="HTML"?rt.ownerDocument.body:rt).removeChild(n.stateNode)}catch(o){ze(n,t,o)}else try{rt.removeChild(n.stateNode)}catch(o){ze(n,t,o)}break;case 18:rt!==null&&(On?(e=rt,zE(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),Vl(e)):zE(rt,n.stateNode));break;case 4:r=rt,i=On,rt=n.stateNode.containerInfo,On=!0,Mi(e,t,n),rt=r,On=i;break;case 0:case 11:case 14:case 15:ss(2,n,t),xt||ss(4,n,t),Mi(e,t,n);break;case 1:xt||(oi(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"&&gk(n,t,r)),Mi(e,t,n);break;case 21:Mi(e,t,n);break;case 22:xt=(r=xt)||n.memoizedState!==null,Mi(e,t,n),xt=r;break;default:Mi(e,t,n)}}function Ek(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Vl(e)}catch(n){ze(t,t.return,n)}}}function Ck(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Vl(e)}catch(n){ze(t,t.return,n)}}function e4(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new EE),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new EE),t;default:throw Error(j(435,e.tag))}}function Rd(e,t){var n=e4(e);t.forEach(function(r){if(!n.has(r)){n.add(r);var i=c4.bind(null,e,r);r.then(i,i)}})}function Tn(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r],o=e,s=t,a=s;e:for(;a!==null;){switch(a.tag){case 27:if(hs(a.type)){rt=a.stateNode,On=!1;break e}break;case 5:rt=a.stateNode,On=!1;break e;case 3:case 4:rt=a.stateNode.containerInfo,On=!0;break e}a=a.return}if(rt===null)throw Error(j(160));wk(o,s,i),rt=null,On=!1,o=i.alternate,o!==null&&(o.return=null),i.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Tk(t,e),t=t.sibling}var Rr=null;function Tk(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Tn(t,e),Mn(e),r&4&&(ss(3,e,e.return),qf(3,e),ss(5,e,e.return));break;case 1:Tn(t,e),Mn(e),r&512&&(xt||n===null||oi(n,n.return)),r&64&&ji&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var i=Rr;if(Tn(t,e),Mn(e),r&512&&(xt||n===null||oi(n,n.return)),r&4){var o=n!==null?n.memoizedState:null;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){e:{r=e.type,n=e.memoizedProps,i=i.ownerDocument||i;t:switch(r){case"title":o=i.getElementsByTagName("title")[0],(!o||o[$f]||o[Kt]||o.namespaceURI==="http://www.w3.org/2000/svg"||o.hasAttribute("itemprop"))&&(o=i.createElement(r),i.head.insertBefore(o,i.querySelector("head > title"))),Qt(o,r,n),o[Kt]=e,At(o),r=o;break e;case"link":var s=VE("link","href",i).get(r+(n.href||""));if(s){for(var a=0;a<s.length;a++)if(o=s[a],o.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&o.getAttribute("rel")===(n.rel==null?null:n.rel)&&o.getAttribute("title")===(n.title==null?null:n.title)&&o.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(a,1);break t}}o=i.createElement(r),Qt(o,r,n),i.head.appendChild(o);break;case"meta":if(s=VE("meta","content",i).get(r+(n.content||""))){for(a=0;a<s.length;a++)if(o=s[a],o.getAttribute("content")===(n.content==null?null:""+n.content)&&o.getAttribute("name")===(n.name==null?null:n.name)&&o.getAttribute("property")===(n.property==null?null:n.property)&&o.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute("charset")===(n.charSet==null?null:n.charSet)){s.splice(a,1);break t}}o=i.createElement(r),Qt(o,r,n),i.head.appendChild(o);break;default:throw Error(j(468,r))}o[Kt]=e,At(o),r=o}e.stateNode=r}else FE(i,e.type,e.stateNode);else e.stateNode=UE(i,r,e.memoizedProps);else o!==r?(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?FE(i,e.type,e.stateNode):UE(i,r,e.memoizedProps)):r===null&&e.stateNode!==null&&xv(e,e.memoizedProps,n.memoizedProps)}break;case 27:Tn(t,e),Mn(e),r&512&&(xt||n===null||oi(n,n.return)),n!==null&&r&4&&xv(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Tn(t,e),Mn(e),r&512&&(xt||n===null||oi(n,n.return)),e.flags&32){i=e.stateNode;try{jl(i,"")}catch(p){ze(e,e.return,p)}}r&4&&e.stateNode!=null&&(i=e.memoizedProps,xv(e,i,n!==null?n.memoizedProps:i)),r&1024&&(wv=!0);break;case 6:if(Tn(t,e),Mn(e),r&4){if(e.stateNode===null)throw Error(j(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(p){ze(e,e.return,p)}}break;case 3:if(Th=null,i=Rr,Rr=vp(t.containerInfo),Tn(t,e),Rr=i,Mn(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Vl(t.containerInfo)}catch(p){ze(e,e.return,p)}wv&&(wv=!1,Mk(e));break;case 4:r=Rr,Rr=vp(e.stateNode.containerInfo),Tn(t,e),Mn(e),Rr=r;break;case 12:Tn(t,e),Mn(e);break;case 31:Tn(t,e),Mn(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Rd(e,r)));break;case 13:Tn(t,e),Mn(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Xm=Gn()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Rd(e,r)));break;case 22:i=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,c=ji,u=xt;if(ji=c||i,xt=u||l,Tn(t,e),xt=u,ji=c,Mn(e),r&8192)e:for(t=e.stateNode,t._visibility=i?t._visibility&-2:t._visibility|1,i&&(n===null||l||ji||xt||Rs(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,i)s=o.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none";else{a=l.stateNode;var f=l.memoizedProps.style,d=f!=null&&f.hasOwnProperty("display")?f.display:null;a.style.display=d==null||typeof d=="boolean"?"":(""+d).trim()}}catch(p){ze(l,l.return,p)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=i?"":l.memoizedProps}catch(p){ze(l,l.return,p)}}}else if(t.tag===18){if(n===null){l=t;try{var h=l.stateNode;i?IE(h,!0):IE(l.stateNode,!1)}catch(p){ze(l,l.return,p)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,Rd(e,n))));break;case 19:Tn(t,e),Mn(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Rd(e,r)));break;case 30:break;case 21:break;default:Tn(t,e),Mn(e)}}function Mn(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(yk(r)){n=r;break}r=r.return}if(n==null)throw Error(j(160));switch(n.tag){case 27:var i=n.stateNode,o=Sv(e);cp(e,o,i);break;case 5:var s=n.stateNode;n.flags&32&&(jl(s,""),n.flags&=-33);var a=Sv(e);cp(e,a,s);break;case 3:case 4:var l=n.stateNode.containerInfo,c=Sv(e);b0(e,c,l);break;default:throw Error(j(161))}}catch(u){ze(e,e.return,u)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Mk(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Mk(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Oi(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)xk(e,t.alternate,t),t=t.sibling}function Rs(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:ss(4,t,t.return),Rs(t);break;case 1:oi(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&gk(t,t.return,n),Rs(t);break;case 27:ku(t.stateNode);case 26:case 5:oi(t,t.return),Rs(t);break;case 22:t.memoizedState===null&&Rs(t);break;case 30:Rs(t);break;default:Rs(t)}e=e.sibling}}function Ni(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var r=t.alternate,i=e,o=t,s=o.flags;switch(o.tag){case 0:case 11:case 15:Ni(i,o,n),qf(4,o);break;case 1:if(Ni(i,o,n),r=o,i=r.stateNode,typeof i.componentDidMount=="function")try{i.componentDidMount()}catch(c){ze(r,r.return,c)}if(r=o,i=r.updateQueue,i!==null){var a=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)EA(l[i],a)}catch(c){ze(r,r.return,c)}}n&&s&64&&mk(o),Tu(o,o.return);break;case 27:bk(o);case 26:case 5:Ni(i,o,n),n&&r===null&&s&4&&vk(o),Tu(o,o.return);break;case 12:Ni(i,o,n);break;case 31:Ni(i,o,n),n&&s&4&&Ek(i,o);break;case 13:Ni(i,o,n),n&&s&4&&Ck(i,o);break;case 22:o.memoizedState===null&&Ni(i,o,n),Tu(o,o.return);break;case 30:break;default:Ni(i,o,n)}t=t.sibling}}function K1(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Vf(n))}function W1(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Vf(e))}function Nr(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Ok(e,t,n,r),t=t.sibling}function Ok(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Nr(e,t,n,r),i&2048&&qf(9,t);break;case 1:Nr(e,t,n,r);break;case 3:Nr(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Vf(e)));break;case 12:if(i&2048){Nr(e,t,n,r),e=t.stateNode;try{var o=t.memoizedProps,s=o.id,a=o.onPostCommit;typeof a=="function"&&a(s,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(l){ze(t,t.return,l)}}else Nr(e,t,n,r);break;case 31:Nr(e,t,n,r);break;case 13:Nr(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState!==null?o._visibility&2?Nr(e,t,n,r):Mu(e,t):o._visibility&2?Nr(e,t,n,r):(o._visibility|=2,Wa(e,t,n,r,(t.subtreeFlags&10256)!==0||!1)),i&2048&&K1(s,t);break;case 24:Nr(e,t,n,r),i&2048&&W1(t.alternate,t);break;default:Nr(e,t,n,r)}}function Wa(e,t,n,r,i){for(i=i&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var o=e,s=t,a=n,l=r,c=s.flags;switch(s.tag){case 0:case 11:case 15:Wa(o,s,a,l,i),qf(8,s);break;case 23:break;case 22:var u=s.stateNode;s.memoizedState!==null?u._visibility&2?Wa(o,s,a,l,i):Mu(o,s):(u._visibility|=2,Wa(o,s,a,l,i)),i&&c&2048&&K1(s.alternate,s);break;case 24:Wa(o,s,a,l,i),i&&c&2048&&W1(s.alternate,s);break;default:Wa(o,s,a,l,i)}t=t.sibling}}function Mu(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Mu(n,r),i&2048&&K1(r.alternate,r);break;case 24:Mu(n,r),i&2048&&W1(r.alternate,r);break;default:Mu(n,r)}t=t.sibling}}var Kc=8192;function Pa(e,t,n){if(e.subtreeFlags&Kc)for(e=e.child;e!==null;)Ak(e,t,n),e=e.sibling}function Ak(e,t,n){switch(e.tag){case 26:Pa(e,t,n),e.flags&Kc&&e.memoizedState!==null&&H4(n,Rr,e.memoizedState,e.memoizedProps);break;case 5:Pa(e,t,n);break;case 3:case 4:var r=Rr;Rr=vp(e.stateNode.containerInfo),Pa(e,t,n),Rr=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Kc,Kc=16777216,Pa(e,t,n),Kc=r):Pa(e,t,n));break;default:Pa(e,t,n)}}function kk(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function jc(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Ot=r,Nk(r,e)}kk(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Dk(e),e=e.sibling}function Dk(e){switch(e.tag){case 0:case 11:case 15:jc(e),e.flags&2048&&ss(9,e,e.return);break;case 3:jc(e);break;case 12:jc(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Eh(e)):jc(e);break;default:jc(e)}}function Eh(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Ot=r,Nk(r,e)}kk(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:ss(8,t,t.return),Eh(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Eh(t));break;default:Eh(t)}e=e.sibling}}function Nk(e,t){for(;Ot!==null;){var n=Ot;switch(n.tag){case 0:case 11:case 15:ss(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Vf(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,Ot=r;else e:for(n=e;Ot!==null;){r=Ot;var i=r.sibling,o=r.return;if(Sk(r),r===n){Ot=null;break e}if(i!==null){i.return=o,Ot=i;break e}Ot=o}}}var t4={getCacheForType:function(e){var t=Yt(St),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Yt(St).controller.signal}},n4=typeof WeakMap=="function"?WeakMap:Map,Ne=0,qe=null,ye=null,be=0,Le=0,$n=null,Ro=!1,fc=!1,Y1=!1,Zi=0,ct=0,as=0,Js=0,G1=0,Yn=0,Bl=0,Ou=null,An=null,x0=!1,Xm=0,_k=0,up=1/0,fp=null,Ko=null,Tt=0,Wo=null,Hl=null,Vi=0,S0=0,w0=null,Rk=null,Au=0,E0=null;function Jn(){return Ne&2&&be!==0?be&-be:ee.T!==null?Q1():UO()}function Lk(){if(Yn===0)if(!(be&536870912)||Se){var e=Td;Td<<=1,!(Td&3932160)&&(Td=262144),Yn=e}else Yn=536870912;return e=nr.current,e!==null&&(e.flags|=32),Yn}function _n(e,t,n){(e===qe&&(Le===2||Le===9)||e.cancelPendingCommit!==null)&&($l(e,0),Lo(e,be,Yn,!1)),Hf(e,n),(!(Ne&2)||e!==qe)&&(e===qe&&(!(Ne&2)&&(Js|=n),ct===4&&Lo(e,be,Yn,!1)),xi(e))}function jk(e,t,n){if(Ne&6)throw Error(j(327));var r=!n&&(t&127)===0&&(t&e.expiredLanes)===0||Bf(e,t),i=r?o4(e,t):Ev(e,t,!0),o=r;do{if(i===0){fc&&!r&&Lo(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!r4(n)){i=Ev(e,t,!1),o=!1;continue}if(i===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s!==0?s:s&536870912?536870912:0;if(s!==0){t=s;e:{var a=e;i=Ou;var l=a.current.memoizedState.isDehydrated;if(l&&($l(a,s).flags|=256),s=Ev(a,s,!1),s!==2){if(Y1&&!l){a.errorRecoveryDisabledLanes|=o,Js|=o,i=4;break e}o=An,An=i,o!==null&&(An===null?An=o:An.push.apply(An,o))}i=s}if(o=!1,i!==2)continue}}if(i===1){$l(e,0),Lo(e,t,0,!0);break}e:{switch(r=e,o=i,o){case 0:case 1:throw Error(j(345));case 4:if((t&4194048)!==t)break;case 6:Lo(r,t,Yn,!Ro);break e;case 2:An=null;break;case 3:case 5:break;default:throw Error(j(329))}if((t&62914560)===t&&(i=Xm+300-Gn(),10<i)){if(Lo(r,t,Yn,!Ro),Bm(r,0,!0)!==0)break e;Vi=t,r.timeoutHandle=t2(CE.bind(null,r,n,An,fp,x0,t,Yn,Js,Bl,Ro,o,"Throttled",-0,0),i);break e}CE(r,n,An,fp,x0,t,Yn,Js,Bl,Ro,o,null,-0,0)}}break}while(!0);xi(e)}function CE(e,t,n,r,i,o,s,a,l,c,u,f,d,h){if(e.timeoutHandle=-1,f=t.subtreeFlags,f&8192||(f&16785408)===16785408){f={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ii},Ak(t,o,f);var p=(o&62914560)===o?Xm-Gn():(o&4194048)===o?_k-Gn():0;if(p=$4(f,p),p!==null){Vi=o,e.cancelPendingCommit=p(ME.bind(null,e,t,o,n,r,i,s,a,l,u,f,null,d,h)),Lo(e,o,s,!c);return}}ME(e,t,o,n,r,i,s,a,l)}function r4(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],o=i.getSnapshot;i=i.value;try{if(!tr(o(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Lo(e,t,n,r){t&=~G1,t&=~Js,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var o=31-Qn(i),s=1<<o;r[o]=-1,i&=~s}n!==0&&BO(e,n,t)}function Qm(){return Ne&6?!0:(Kf(0),!1)}function X1(){if(ye!==null){if(Le===0)var e=ye.return;else e=ye,Pi=Ma=null,j1(e),Tl=null,tf=0,e=ye;for(;e!==null;)pk(e.alternate,e),e=e.return;ye=null}}function $l(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,E4(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Vi=0,X1(),qe=e,ye=n=$i(e.current,null),be=t,Le=0,$n=null,Ro=!1,fc=Bf(e,t),Y1=!1,Bl=Yn=G1=Js=as=ct=0,An=Ou=null,x0=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Qn(r),o=1<<i;t|=e[i],r&=~o}return Zi=t,Vm(),n}function zk(e,t){se=null,ee.H=rf,t===uc||t===qm?(t=nE(),Le=3):t===A1?(t=nE(),Le=4):Le=t===F1?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,$n=t,ye===null&&(ct=1,ap(e,pr(t,e.current)))}function Ik(){var e=nr.current;return e===null?!0:(be&4194048)===be?br===null:(be&62914560)===be||be&536870912?e===br:!1}function Pk(){var e=ee.H;return ee.H=rf,e===null?rf:e}function Bk(){var e=ee.A;return ee.A=t4,e}function dp(){ct=4,Ro||(be&4194048)!==be&&nr.current!==null||(fc=!0),!(as&134217727)&&!(Js&134217727)||qe===null||Lo(qe,be,Yn,!1)}function Ev(e,t,n){var r=Ne;Ne|=2;var i=Pk(),o=Bk();(qe!==e||be!==t)&&(fp=null,$l(e,t)),t=!1;var s=ct;e:do try{if(Le!==0&&ye!==null){var a=ye,l=$n;switch(Le){case 8:X1(),s=6;break e;case 3:case 2:case 9:case 6:nr.current===null&&(t=!0);var c=Le;if(Le=0,$n=null,yl(e,a,l,c),n&&fc){s=0;break e}break;default:c=Le,Le=0,$n=null,yl(e,a,l,c)}}i4(),s=ct;break}catch(u){zk(e,u)}while(!0);return t&&e.shellSuspendCounter++,Pi=Ma=null,Ne=r,ee.H=i,ee.A=o,ye===null&&(qe=null,be=0,Vm()),s}function i4(){for(;ye!==null;)Hk(ye)}function o4(e,t){var n=Ne;Ne|=2;var r=Pk(),i=Bk();qe!==e||be!==t?(fp=null,up=Gn()+500,$l(e,t)):fc=Bf(e,t);e:do try{if(Le!==0&&ye!==null){t=ye;var o=$n;t:switch(Le){case 1:Le=0,$n=null,yl(e,t,o,1);break;case 2:case 9:if(tE(o)){Le=0,$n=null,TE(t);break}t=function(){Le!==2&&Le!==9||qe!==e||(Le=7),xi(e)},o.then(t,t);break e;case 3:Le=7;break e;case 4:Le=5;break e;case 7:tE(o)?(Le=0,$n=null,TE(t)):(Le=0,$n=null,yl(e,t,o,7));break;case 5:var s=null;switch(ye.tag){case 26:s=ye.memoizedState;case 5:case 27:var a=ye;if(s?s2(s):a.stateNode.complete){Le=0,$n=null;var l=a.sibling;if(l!==null)ye=l;else{var c=a.return;c!==null?(ye=c,Jm(c)):ye=null}break t}}Le=0,$n=null,yl(e,t,o,5);break;case 6:Le=0,$n=null,yl(e,t,o,6);break;case 8:X1(),ct=6;break e;default:throw Error(j(462))}}s4();break}catch(u){zk(e,u)}while(!0);return Pi=Ma=null,ee.H=r,ee.A=i,Ne=n,ye!==null?0:(qe=null,be=0,Vm(),ct)}function s4(){for(;ye!==null&&!kz();)Hk(ye)}function Hk(e){var t=hk(e.alternate,e,Zi);e.memoizedProps=e.pendingProps,t===null?Jm(e):ye=t}function TE(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=yE(n,t,t.pendingProps,t.type,void 0,be);break;case 11:t=yE(n,t,t.pendingProps,t.type.render,t.ref,be);break;case 5:j1(t);default:pk(n,t),t=ye=pA(t,Zi),t=hk(n,t,Zi)}e.memoizedProps=e.pendingProps,t===null?Jm(e):ye=t}function yl(e,t,n,r){Pi=Ma=null,j1(t),Tl=null,tf=0;var i=t.return;try{if(YI(e,i,t,n,be)){ct=1,ap(e,pr(n,e.current)),ye=null;return}}catch(o){if(i!==null)throw ye=i,o;ct=1,ap(e,pr(n,e.current)),ye=null;return}t.flags&32768?(Se||r===1?e=!0:fc||be&536870912?e=!1:(Ro=e=!0,(r===2||r===9||r===3||r===6)&&(r=nr.current,r!==null&&r.tag===13&&(r.flags|=16384))),$k(t,e)):Jm(t)}function Jm(e){var t=e;do{if(t.flags&32768){$k(t,Ro);return}e=t.return;var n=QI(t.alternate,t,Zi);if(n!==null){ye=n;return}if(t=t.sibling,t!==null){ye=t;return}ye=t=e}while(t!==null);ct===0&&(ct=5)}function $k(e,t){do{var n=JI(e.alternate,e);if(n!==null){n.flags&=32767,ye=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){ye=e;return}ye=e=n}while(e!==null);ct=6,ye=null}function ME(e,t,n,r,i,o,s,a,l){e.cancelPendingCommit=null;do Zm();while(Tt!==0);if(Ne&6)throw Error(j(327));if(t!==null){if(t===e.current)throw Error(j(177));if(o=t.lanes|t.childLanes,o|=S1,Bz(e,n,o,s,a,l),e===qe&&(ye=qe=null,be=0),Hl=t,Wo=e,Vi=n,S0=o,w0=i,Rk=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,u4(Xh,function(){return Kk(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!==0,t.subtreeFlags&13878||r){r=ee.T,ee.T=null,i=_e.p,_e.p=2,s=Ne,Ne|=4;try{ZI(e,t,n)}finally{Ne=s,_e.p=i,ee.T=r}}Tt=1,Uk(),Vk(),Fk()}}function Uk(){if(Tt===1){Tt=0;var e=Wo,t=Hl,n=(t.flags&13878)!==0;if(t.subtreeFlags&13878||n){n=ee.T,ee.T=null;var r=_e.p;_e.p=2;var i=Ne;Ne|=4;try{Tk(t,e);var o=O0,s=sA(e.containerInfo),a=o.focusedElem,l=o.selectionRange;if(s!==a&&a&&a.ownerDocument&&oA(a.ownerDocument.documentElement,a)){if(l!==null&&x1(a)){var c=l.start,u=l.end;if(u===void 0&&(u=c),"selectionStart"in a)a.selectionStart=c,a.selectionEnd=Math.min(u,a.value.length);else{var f=a.ownerDocument||document,d=f&&f.defaultView||window;if(d.getSelection){var h=d.getSelection(),p=a.textContent.length,g=Math.min(l.start,p),y=l.end===void 0?g:Math.min(l.end,p);!h.extend&&g>y&&(s=y,y=g,g=s);var v=Yw(a,g),b=Yw(a,y);if(v&&b&&(h.rangeCount!==1||h.anchorNode!==v.node||h.anchorOffset!==v.offset||h.focusNode!==b.node||h.focusOffset!==b.offset)){var x=f.createRange();x.setStart(v.node,v.offset),h.removeAllRanges(),g>y?(h.addRange(x),h.extend(b.node,b.offset)):(x.setEnd(b.node,b.offset),h.addRange(x))}}}}for(f=[],h=a;h=h.parentNode;)h.nodeType===1&&f.push({element:h,left:h.scrollLeft,top:h.scrollTop});for(typeof a.focus=="function"&&a.focus(),a=0;a<f.length;a++){var m=f[a];m.element.scrollLeft=m.left,m.element.scrollTop=m.top}}xp=!!M0,O0=M0=null}finally{Ne=i,_e.p=r,ee.T=n}}e.current=t,Tt=2}}function Vk(){if(Tt===2){Tt=0;var e=Wo,t=Hl,n=(t.flags&8772)!==0;if(t.subtreeFlags&8772||n){n=ee.T,ee.T=null;var r=_e.p;_e.p=2;var i=Ne;Ne|=4;try{xk(e,t.alternate,t)}finally{Ne=i,_e.p=r,ee.T=n}}Tt=3}}function Fk(){if(Tt===4||Tt===3){Tt=0,Dz();var e=Wo,t=Hl,n=Vi,r=Rk;t.subtreeFlags&10256||t.flags&10256?Tt=5:(Tt=0,Hl=Wo=null,qk(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(Ko=null),h1(n),t=t.stateNode,Xn&&typeof Xn.onCommitFiberRoot=="function")try{Xn.onCommitFiberRoot(Pf,t,void 0,(t.current.flags&128)===128)}catch{}if(r!==null){t=ee.T,i=_e.p,_e.p=2,ee.T=null;try{for(var o=e.onRecoverableError,s=0;s<r.length;s++){var a=r[s];o(a.value,{componentStack:a.stack})}}finally{ee.T=t,_e.p=i}}Vi&3&&Zm(),xi(e),i=e.pendingLanes,n&261930&&i&42?e===E0?Au++:(Au=0,E0=e):Au=0,Kf(0)}}function qk(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Vf(t)))}function Zm(){return Uk(),Vk(),Fk(),Kk()}function Kk(){if(Tt!==5)return!1;var e=Wo,t=S0;S0=0;var n=h1(Vi),r=ee.T,i=_e.p;try{_e.p=32>n?32:n,ee.T=null,n=w0,w0=null;var o=Wo,s=Vi;if(Tt=0,Hl=Wo=null,Vi=0,Ne&6)throw Error(j(331));var a=Ne;if(Ne|=4,Dk(o.current),Ok(o,o.current,s,n),Ne=a,Kf(0,!1),Xn&&typeof Xn.onPostCommitFiberRoot=="function")try{Xn.onPostCommitFiberRoot(Pf,o)}catch{}return!0}finally{_e.p=i,ee.T=r,qk(e,t)}}function OE(e,t,n){t=pr(n,t),t=g0(e.stateNode,t,2),e=qo(e,t,2),e!==null&&(Hf(e,2),xi(e))}function ze(e,t,n){if(e.tag===3)OE(e,e,n);else for(;t!==null;){if(t.tag===3){OE(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Ko===null||!Ko.has(r))){e=pr(n,e),n=ak(2),r=qo(t,n,2),r!==null&&(lk(n,r,t,e),Hf(r,2),xi(r));break}}t=t.return}}function Cv(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new n4;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Y1=!0,i.add(n),e=a4.bind(null,e,t,n),t.then(e,e))}function a4(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,qe===e&&(be&n)===n&&(ct===4||ct===3&&(be&62914560)===be&&300>Gn()-Xm?!(Ne&2)&&$l(e,0):G1|=n,Bl===be&&(Bl=0)),xi(e)}function Wk(e,t){t===0&&(t=PO()),e=Ta(e,t),e!==null&&(Hf(e,t),xi(e))}function l4(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Wk(e,n)}function c4(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(j(314))}r!==null&&r.delete(t),Wk(e,n)}function u4(e,t){return f1(e,t)}var hp=null,Ya=null,C0=!1,pp=!1,Tv=!1,jo=0;function xi(e){e!==Ya&&e.next===null&&(Ya===null?hp=Ya=e:Ya=Ya.next=e),pp=!0,C0||(C0=!0,d4())}function Kf(e,t){if(!Tv&&pp){Tv=!0;do for(var n=!1,r=hp;r!==null;){if(e!==0){var i=r.pendingLanes;if(i===0)var o=0;else{var s=r.suspendedLanes,a=r.pingedLanes;o=(1<<31-Qn(42|e)+1)-1,o&=i&~(s&~a),o=o&201326741?o&201326741|1:o?o|2:0}o!==0&&(n=!0,AE(r,o))}else o=be,o=Bm(r,r===qe?o:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(o&3)||Bf(r,o)||(n=!0,AE(r,o));r=r.next}while(n);Tv=!1}}function f4(){Yk()}function Yk(){pp=C0=!1;var e=0;jo!==0&&w4()&&(e=jo);for(var t=Gn(),n=null,r=hp;r!==null;){var i=r.next,o=Gk(r,t);o===0?(r.next=null,n===null?hp=i:n.next=i,i===null&&(Ya=n)):(n=r,(e!==0||o&3)&&(pp=!0)),r=i}Tt!==0&&Tt!==5||Kf(e),jo!==0&&(jo=0)}function Gk(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,o=e.pendingLanes&-62914561;0<o;){var s=31-Qn(o),a=1<<s,l=i[s];l===-1?(!(a&n)||a&r)&&(i[s]=Pz(a,t)):l<=t&&(e.expiredLanes|=a),o&=~a}if(t=qe,n=be,n=Bm(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Le===2||Le===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Zg(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Bf(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Zg(r),h1(n)){case 2:case 8:n=zO;break;case 32:n=Xh;break;case 268435456:n=IO;break;default:n=Xh}return r=Xk.bind(null,e),n=f1(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Zg(r),e.callbackPriority=2,e.callbackNode=null,2}function Xk(e,t){if(Tt!==0&&Tt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Zm()&&e.callbackNode!==n)return null;var r=be;return r=Bm(e,e===qe?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(jk(e,r,t),Gk(e,Gn()),e.callbackNode!=null&&e.callbackNode===n?Xk.bind(null,e):null)}function AE(e,t){if(Zm())return null;jk(e,t,!0)}function d4(){C4(function(){Ne&6?f1(jO,f4):Yk()})}function Q1(){if(jo===0){var e=zl;e===0&&(e=Cd,Cd<<=1,!(Cd&261888)&&(Cd=256)),jo=e}return jo}function kE(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:ph(""+e)}function DE(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function h4(e,t,n,r,i){if(t==="submit"&&n&&n.stateNode===i){var o=kE((i[zn]||null).action),s=r.submitter;s&&(t=(t=s[zn]||null)?kE(t.formAction):s.getAttribute("formAction"),t!==null&&(o=t,s=null));var a=new Hm("action","action",null,r,i);e.push({event:a,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(jo!==0){var l=s?DE(i,s):new FormData(i);p0(n,{pending:!0,data:l,method:i.method,action:o},null,l)}}else typeof o=="function"&&(a.preventDefault(),l=s?DE(i,s):new FormData(i),p0(n,{pending:!0,data:l,method:i.method,action:o},o,l))},currentTarget:i}]})}}for(var Mv=0;Mv<n0.length;Mv++){var Ov=n0[Mv],p4=Ov.toLowerCase(),m4=Ov[0].toUpperCase()+Ov.slice(1);Fr(p4,"on"+m4)}Fr(lA,"onAnimationEnd");Fr(cA,"onAnimationIteration");Fr(uA,"onAnimationStart");Fr("dblclick","onDoubleClick");Fr("focusin","onFocus");Fr("focusout","onBlur");Fr(NI,"onTransitionRun");Fr(_I,"onTransitionStart");Fr(RI,"onTransitionCancel");Fr(fA,"onTransitionEnd");Ll("onMouseEnter",["mouseout","mouseover"]);Ll("onMouseLeave",["mouseout","mouseover"]);Ll("onPointerEnter",["pointerout","pointerover"]);Ll("onPointerLeave",["pointerout","pointerover"]);wa("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));wa("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));wa("onBeforeInput",["compositionend","keypress","textInput","paste"]);wa("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));wa("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));wa("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var of="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(" "),g4=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(of));function Qk(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var o=void 0;if(t)for(var s=r.length-1;0<=s;s--){var a=r[s],l=a.instance,c=a.currentTarget;if(a=a.listener,l!==o&&i.isPropagationStopped())break e;o=a,i.currentTarget=c;try{o(i)}catch(u){Jh(u)}i.currentTarget=null,o=l}else for(s=0;s<r.length;s++){if(a=r[s],l=a.instance,c=a.currentTarget,a=a.listener,l!==o&&i.isPropagationStopped())break e;o=a,i.currentTarget=c;try{o(i)}catch(u){Jh(u)}i.currentTarget=null,o=l}}}}function ve(e,t){var n=t[Yy];n===void 0&&(n=t[Yy]=new Set);var r=e+"__bubble";n.has(r)||(Jk(t,e,2,!1),n.add(r))}function Av(e,t,n){var r=0;t&&(r|=4),Jk(n,e,r,t)}var Ld="_reactListening"+Math.random().toString(36).slice(2);function J1(e){if(!e[Ld]){e[Ld]=!0,VO.forEach(function(n){n!=="selectionchange"&&(g4.has(n)||Av(n,!1,e),Av(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ld]||(t[Ld]=!0,Av("selectionchange",!1,t))}}function Jk(e,t,n,r){switch(f2(t)){case 2:var i=F4;break;case 8:i=q4;break;default:i=nx}n=i.bind(null,t,n,e),i=void 0,!Zy||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),r?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function kv(e,t,n,r,i){var o=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var a=r.stateNode.containerInfo;if(a===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;a!==null;){if(s=cl(a),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=o=s;continue e}a=a.parentNode}}r=r.return}QO(function(){var c=o,u=g1(n),f=[];e:{var d=dA.get(e);if(d!==void 0){var h=Hm,p=e;switch(e){case"keypress":if(gh(n)===0)break e;case"keydown":case"keyup":h=cI;break;case"focusin":p="focus",h=iv;break;case"focusout":p="blur",h=iv;break;case"beforeblur":case"afterblur":h=iv;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":h=Pw;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=Qz;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=dI;break;case lA:case cA:case uA:h=eI;break;case fA:h=pI;break;case"scroll":case"scrollend":h=Gz;break;case"wheel":h=gI;break;case"copy":case"cut":case"paste":h=nI;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=Hw;break;case"toggle":case"beforetoggle":h=yI}var g=(t&4)!==0,y=!g&&(e==="scroll"||e==="scrollend"),v=g?d!==null?d+"Capture":null:d;g=[];for(var b=c,x;b!==null;){var m=b;if(x=m.stateNode,m=m.tag,m!==5&&m!==26&&m!==27||x===null||v===null||(m=Xu(b,v),m!=null&&g.push(sf(b,m,x))),y)break;b=b.return}0<g.length&&(d=new h(d,p,null,n,u),f.push({event:d,listeners:g}))}}if(!(t&7)){e:{if(d=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",d&&n!==Jy&&(p=n.relatedTarget||n.fromElement)&&(cl(p)||p[ac]))break e;if((h||d)&&(d=u.window===u?u:(d=u.ownerDocument)?d.defaultView||d.parentWindow:window,h?(p=n.relatedTarget||n.toElement,h=c,p=p?cl(p):null,p!==null&&(y=If(p),g=p.tag,p!==y||g!==5&&g!==27&&g!==6)&&(p=null)):(h=null,p=c),h!==p)){if(g=Pw,m="onMouseLeave",v="onMouseEnter",b="mouse",(e==="pointerout"||e==="pointerover")&&(g=Hw,m="onPointerLeave",v="onPointerEnter",b="pointer"),y=h==null?d:Fc(h),x=p==null?d:Fc(p),d=new g(m,b+"leave",h,n,u),d.target=y,d.relatedTarget=x,m=null,cl(u)===c&&(g=new g(v,b+"enter",p,n,u),g.target=x,g.relatedTarget=y,m=g),y=m,h&&p)t:{for(g=v4,v=h,b=p,x=0,m=v;m;m=g(m))x++;m=0;for(var E=b;E;E=g(E))m++;for(;0<x-m;)v=g(v),x--;for(;0<m-x;)b=g(b),m--;for(;x--;){if(v===b||b!==null&&v===b.alternate){g=v;break t}v=g(v),b=g(b)}g=null}else g=null;h!==null&&NE(f,d,h,g,!1),p!==null&&y!==null&&NE(f,y,p,g,!0)}}e:{if(d=c?Fc(c):window,h=d.nodeName&&d.nodeName.toLowerCase(),h==="select"||h==="input"&&d.type==="file")var T=Fw;else if(Vw(d))if(rA)T=AI;else{T=MI;var C=TI}else h=d.nodeName,!h||h.toLowerCase()!=="input"||d.type!=="checkbox"&&d.type!=="radio"?c&&m1(c.elementType)&&(T=Fw):T=OI;if(T&&(T=T(e,c))){nA(f,T,n,u);break e}C&&C(e,d,c),e==="focusout"&&c&&d.type==="number"&&c.memoizedProps.value!=null&&Qy(d,"number",d.value)}switch(C=c?Fc(c):window,e){case"focusin":(Vw(C)||C.contentEditable==="true")&&(dl=C,e0=c,bu=null);break;case"focusout":bu=e0=dl=null;break;case"mousedown":t0=!0;break;case"contextmenu":case"mouseup":case"dragend":t0=!1,Gw(f,n,u);break;case"selectionchange":if(DI)break;case"keydown":case"keyup":Gw(f,n,u)}var O;if(b1)e:{switch(e){case"compositionstart":var A="onCompositionStart";break e;case"compositionend":A="onCompositionEnd";break e;case"compositionupdate":A="onCompositionUpdate";break e}A=void 0}else fl?eA(e,n)&&(A="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(A="onCompositionStart");A&&(ZO&&n.locale!=="ko"&&(fl||A!=="onCompositionStart"?A==="onCompositionEnd"&&fl&&(O=JO()):(_o=u,v1="value"in _o?_o.value:_o.textContent,fl=!0)),C=mp(c,A),0<C.length&&(A=new Bw(A,e,null,n,u),f.push({event:A,listeners:C}),O?A.data=O:(O=tA(n),O!==null&&(A.data=O)))),(O=xI?SI(e,n):wI(e,n))&&(A=mp(c,"onBeforeInput"),0<A.length&&(C=new Bw("onBeforeInput","beforeinput",null,n,u),f.push({event:C,listeners:A}),C.data=O)),h4(f,e,c,n,u)}Qk(f,t)})}function sf(e,t,n){return{instance:e,listener:t,currentTarget:n}}function mp(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,o=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||o===null||(i=Xu(e,n),i!=null&&r.unshift(sf(e,i,o)),i=Xu(e,t),i!=null&&r.push(sf(e,i,o))),e.tag===3)return r;e=e.return}return[]}function v4(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function NE(e,t,n,r,i){for(var o=t._reactName,s=[];n!==null&&n!==r;){var a=n,l=a.alternate,c=a.stateNode;if(a=a.tag,l!==null&&l===r)break;a!==5&&a!==26&&a!==27||c===null||(l=c,i?(c=Xu(n,o),c!=null&&s.unshift(sf(n,c,l))):i||(c=Xu(n,o),c!=null&&s.push(sf(n,c,l)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var y4=/\r\n?/g,b4=/\u0000|\uFFFD/g;function _E(e){return(typeof e=="string"?e:""+e).replace(y4,`
49
+ `).replace(b4,"")}function Zk(e,t){return t=_E(t),_E(e)===t}function He(e,t,n,r,i,o){switch(n){case"children":typeof r=="string"?t==="body"||t==="textarea"&&r===""||jl(e,r):(typeof r=="number"||typeof r=="bigint")&&t!=="body"&&jl(e,""+r);break;case"className":Od(e,"class",r);break;case"tabIndex":Od(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":Od(e,n,r);break;case"style":XO(e,r,o);break;case"data":if(t!=="object"){Od(e,"data",r);break}case"src":case"href":if(r===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(r==null||typeof r=="function"||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(n);break}r=ph(""+r),e.setAttribute(n,r);break;case"action":case"formAction":if(typeof r=="function"){e.setAttribute(n,"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 o=="function"&&(n==="formAction"?(t!=="input"&&He(e,t,"name",i.name,i,null),He(e,t,"formEncType",i.formEncType,i,null),He(e,t,"formMethod",i.formMethod,i,null),He(e,t,"formTarget",i.formTarget,i,null)):(He(e,t,"encType",i.encType,i,null),He(e,t,"method",i.method,i,null),He(e,t,"target",i.target,i,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(n);break}r=ph(""+r),e.setAttribute(n,r);break;case"onClick":r!=null&&(e.onclick=Ii);break;case"onScroll":r!=null&&ve("scroll",e);break;case"onScrollEnd":r!=null&&ve("scrollend",e);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(j(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(j(60));e.innerHTML=n}}break;case"multiple":e.multiple=r&&typeof r!="function"&&typeof r!="symbol";break;case"muted":e.muted=r&&typeof r!="function"&&typeof r!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(r==null||typeof r=="function"||typeof r=="boolean"||typeof r=="symbol"){e.removeAttribute("xlink:href");break}n=ph(""+r),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(n,""+r):e.removeAttribute(n);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":r&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":r===!0?e.setAttribute(n,""):r!==!1&&r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(n,r):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":r!=null&&typeof r!="function"&&typeof r!="symbol"&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case"rowSpan":case"start":r==null||typeof r=="function"||typeof r=="symbol"||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case"popover":ve("beforetoggle",e),ve("toggle",e),hh(e,"popover",r);break;case"xlinkActuate":Ci(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":Ci(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":Ci(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":Ci(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":Ci(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":Ci(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":Ci(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":Ci(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":Ci(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":hh(e,"is",r);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=Wz.get(n)||n,hh(e,n,r))}}function T0(e,t,n,r,i,o){switch(n){case"style":XO(e,r,o);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(j(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(j(60));e.innerHTML=n}}break;case"children":typeof r=="string"?jl(e,r):(typeof r=="number"||typeof r=="bigint")&&jl(e,""+r);break;case"onScroll":r!=null&&ve("scroll",e);break;case"onScrollEnd":r!=null&&ve("scrollend",e);break;case"onClick":r!=null&&(e.onclick=Ii);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!FO.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(i=n.endsWith("Capture"),t=n.slice(2,i?n.length-7:void 0),o=e[zn]||null,o=o!=null?o[n]:null,typeof o=="function"&&e.removeEventListener(t,o,i),typeof r=="function")){typeof o!="function"&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,i);break e}n in e?e[n]=r:r===!0?e.setAttribute(n,""):hh(e,n,r)}}}function Qt(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ve("error",e),ve("load",e);var r=!1,i=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case"src":r=!0;break;case"srcSet":i=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(j(137,t));default:He(e,t,o,s,n,null)}}i&&He(e,t,"srcSet",n.srcSet,n,null),r&&He(e,t,"src",n.src,n,null);return;case"input":ve("invalid",e);var a=o=s=i=null,l=null,c=null;for(r in n)if(n.hasOwnProperty(r)){var u=n[r];if(u!=null)switch(r){case"name":i=u;break;case"type":s=u;break;case"checked":l=u;break;case"defaultChecked":c=u;break;case"value":o=u;break;case"defaultValue":a=u;break;case"children":case"dangerouslySetInnerHTML":if(u!=null)throw Error(j(137,t));break;default:He(e,t,r,u,n,null)}}WO(e,o,a,l,c,s,i,!1);return;case"select":ve("invalid",e),r=s=o=null;for(i in n)if(n.hasOwnProperty(i)&&(a=n[i],a!=null))switch(i){case"value":o=a;break;case"defaultValue":s=a;break;case"multiple":r=a;default:He(e,t,i,a,n,null)}t=o,n=s,e.multiple=!!r,t!=null?wl(e,!!r,t,!1):n!=null&&wl(e,!!r,n,!0);return;case"textarea":ve("invalid",e),o=i=r=null;for(s in n)if(n.hasOwnProperty(s)&&(a=n[s],a!=null))switch(s){case"value":r=a;break;case"defaultValue":i=a;break;case"children":o=a;break;case"dangerouslySetInnerHTML":if(a!=null)throw Error(j(91));break;default:He(e,t,s,a,n,null)}GO(e,r,i,o);return;case"option":for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case"selected":e.selected=r&&typeof r!="function"&&typeof r!="symbol";break;default:He(e,t,l,r,n,null)}return;case"dialog":ve("beforetoggle",e),ve("toggle",e),ve("cancel",e),ve("close",e);break;case"iframe":case"object":ve("load",e);break;case"video":case"audio":for(r=0;r<of.length;r++)ve(of[r],e);break;case"image":ve("error",e),ve("load",e);break;case"details":ve("toggle",e);break;case"embed":case"source":case"link":ve("error",e),ve("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(c in n)if(n.hasOwnProperty(c)&&(r=n[c],r!=null))switch(c){case"children":case"dangerouslySetInnerHTML":throw Error(j(137,t));default:He(e,t,c,r,n,null)}return;default:if(m1(t)){for(u in n)n.hasOwnProperty(u)&&(r=n[u],r!==void 0&&T0(e,t,u,r,n,void 0));return}}for(a in n)n.hasOwnProperty(a)&&(r=n[a],r!=null&&He(e,t,a,r,n,null))}function x4(e,t,n,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var i=null,o=null,s=null,a=null,l=null,c=null,u=null;for(h in n){var f=n[h];if(n.hasOwnProperty(h)&&f!=null)switch(h){case"checked":break;case"value":break;case"defaultValue":l=f;default:r.hasOwnProperty(h)||He(e,t,h,null,r,f)}}for(var d in r){var h=r[d];if(f=n[d],r.hasOwnProperty(d)&&(h!=null||f!=null))switch(d){case"type":o=h;break;case"name":i=h;break;case"checked":c=h;break;case"defaultChecked":u=h;break;case"value":s=h;break;case"defaultValue":a=h;break;case"children":case"dangerouslySetInnerHTML":if(h!=null)throw Error(j(137,t));break;default:h!==f&&He(e,t,d,h,r,f)}}Xy(e,s,a,l,c,u,o,i);return;case"select":h=s=a=d=null;for(o in n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case"value":break;case"multiple":h=l;default:r.hasOwnProperty(o)||He(e,t,o,null,r,l)}for(i in r)if(o=r[i],l=n[i],r.hasOwnProperty(i)&&(o!=null||l!=null))switch(i){case"value":d=o;break;case"defaultValue":a=o;break;case"multiple":s=o;default:o!==l&&He(e,t,i,o,r,l)}t=a,n=s,r=h,d!=null?wl(e,!!n,d,!1):!!r!=!!n&&(t!=null?wl(e,!!n,t,!0):wl(e,!!n,n?[]:"",!1));return;case"textarea":h=d=null;for(a in n)if(i=n[a],n.hasOwnProperty(a)&&i!=null&&!r.hasOwnProperty(a))switch(a){case"value":break;case"children":break;default:He(e,t,a,null,r,i)}for(s in r)if(i=r[s],o=n[s],r.hasOwnProperty(s)&&(i!=null||o!=null))switch(s){case"value":d=i;break;case"defaultValue":h=i;break;case"children":break;case"dangerouslySetInnerHTML":if(i!=null)throw Error(j(91));break;default:i!==o&&He(e,t,s,i,r,o)}YO(e,d,h);return;case"option":for(var p in n)if(d=n[p],n.hasOwnProperty(p)&&d!=null&&!r.hasOwnProperty(p))switch(p){case"selected":e.selected=!1;break;default:He(e,t,p,null,r,d)}for(l in r)if(d=r[l],h=n[l],r.hasOwnProperty(l)&&d!==h&&(d!=null||h!=null))switch(l){case"selected":e.selected=d&&typeof d!="function"&&typeof d!="symbol";break;default:He(e,t,l,d,r,h)}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 g in n)d=n[g],n.hasOwnProperty(g)&&d!=null&&!r.hasOwnProperty(g)&&He(e,t,g,null,r,d);for(c in r)if(d=r[c],h=n[c],r.hasOwnProperty(c)&&d!==h&&(d!=null||h!=null))switch(c){case"children":case"dangerouslySetInnerHTML":if(d!=null)throw Error(j(137,t));break;default:He(e,t,c,d,r,h)}return;default:if(m1(t)){for(var y in n)d=n[y],n.hasOwnProperty(y)&&d!==void 0&&!r.hasOwnProperty(y)&&T0(e,t,y,void 0,r,d);for(u in r)d=r[u],h=n[u],!r.hasOwnProperty(u)||d===h||d===void 0&&h===void 0||T0(e,t,u,d,r,h);return}}for(var v in n)d=n[v],n.hasOwnProperty(v)&&d!=null&&!r.hasOwnProperty(v)&&He(e,t,v,null,r,d);for(f in r)d=r[f],h=n[f],!r.hasOwnProperty(f)||d===h||d==null&&h==null||He(e,t,f,d,r,h)}function RE(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function S4(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),r=0;r<n.length;r++){var i=n[r],o=i.transferSize,s=i.initiatorType,a=i.duration;if(o&&a&&RE(s)){for(s=0,a=i.responseEnd,r+=1;r<n.length;r++){var l=n[r],c=l.startTime;if(c>a)break;var u=l.transferSize,f=l.initiatorType;u&&RE(f)&&(l=l.responseEnd,s+=u*(l<a?1:(a-c)/(l-c)))}if(--r,t+=8*(o+s)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var M0=null,O0=null;function gp(e){return e.nodeType===9?e:e.ownerDocument}function LE(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function e2(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function A0(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Dv=null;function w4(){var e=window.event;return e&&e.type==="popstate"?e===Dv?!1:(Dv=e,!0):(Dv=null,!1)}var t2=typeof setTimeout=="function"?setTimeout:void 0,E4=typeof clearTimeout=="function"?clearTimeout:void 0,jE=typeof Promise=="function"?Promise:void 0,C4=typeof queueMicrotask=="function"?queueMicrotask:typeof jE<"u"?function(e){return jE.resolve(null).then(e).catch(T4)}:t2;function T4(e){setTimeout(function(){throw e})}function hs(e){return e==="head"}function zE(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"||n==="/&"){if(r===0){e.removeChild(i),Vl(t);return}r--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")r++;else if(n==="html")ku(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,ku(n);for(var o=n.firstChild;o;){var s=o.nextSibling,a=o.nodeName;o[$f]||a==="SCRIPT"||a==="STYLE"||a==="LINK"&&o.rel.toLowerCase()==="stylesheet"||n.removeChild(o),o=s}}else n==="body"&&ku(e.ownerDocument.body);n=i}while(n);Vl(t)}function IE(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),r&&r.nodeType===8)if(n=r.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=r}while(n)}function k0(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":k0(n),p1(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function M4(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(r){if(!e[$f])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(o=e.getAttribute("rel"),o==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(o!==i.rel||e.getAttribute("href")!==(i.href==null||i.href===""?null:i.href)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute("title")!==(i.title==null?null:i.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(o=e.getAttribute("src"),(o!==(i.src==null?null:i.src)||e.getAttribute("type")!==(i.type==null?null:i.type)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin))&&o&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var o=i.name==null?null:""+i.name;if(i.type==="hidden"&&e.getAttribute("name")===o)return e}else return e;if(e=xr(e.nextSibling),e===null)break}return null}function O4(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=xr(e.nextSibling),e===null))return null;return e}function n2(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=xr(e.nextSibling),e===null))return null;return e}function D0(e){return e.data==="$?"||e.data==="$~"}function N0(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function A4(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var r=function(){t(),n.removeEventListener("DOMContentLoaded",r)};n.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}function xr(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var _0=null;function PE(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return xr(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function BE(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function r2(e,t,n){switch(t=gp(n),e){case"html":if(e=t.documentElement,!e)throw Error(j(452));return e;case"head":if(e=t.head,!e)throw Error(j(453));return e;case"body":if(e=t.body,!e)throw Error(j(454));return e;default:throw Error(j(451))}}function ku(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);p1(e)}var Mr=new Map,HE=new Set;function vp(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var io=_e.d;_e.d={f:k4,r:D4,D:N4,C:_4,L:R4,m:L4,X:z4,S:j4,M:I4};function k4(){var e=io.f(),t=Qm();return e||t}function D4(e){var t=lc(e);t!==null&&t.tag===5&&t.type==="form"?XA(t):io.r(e)}var dc=typeof document>"u"?null:document;function i2(e,t,n){var r=dc;if(r&&typeof t=="string"&&t){var i=hr(t);i='link[rel="'+e+'"][href="'+i+'"]',typeof n=="string"&&(i+='[crossorigin="'+n+'"]'),HE.has(i)||(HE.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement("link"),Qt(t,"link",e),At(t),r.head.appendChild(t)))}}function N4(e){io.D(e),i2("dns-prefetch",e,null)}function _4(e,t){io.C(e,t),i2("preconnect",e,t)}function R4(e,t,n){io.L(e,t,n);var r=dc;if(r&&e&&t){var i='link[rel="preload"][as="'+hr(t)+'"]';t==="image"&&n&&n.imageSrcSet?(i+='[imagesrcset="'+hr(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(i+='[imagesizes="'+hr(n.imageSizes)+'"]')):i+='[href="'+hr(e)+'"]';var o=i;switch(t){case"style":o=Ul(e);break;case"script":o=hc(e)}Mr.has(o)||(e=nt({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Mr.set(o,e),r.querySelector(i)!==null||t==="style"&&r.querySelector(Wf(o))||t==="script"&&r.querySelector(Yf(o))||(t=r.createElement("link"),Qt(t,"link",e),At(t),r.head.appendChild(t)))}}function L4(e,t){io.m(e,t);var n=dc;if(n&&e){var r=t&&typeof t.as=="string"?t.as:"script",i='link[rel="modulepreload"][as="'+hr(r)+'"][href="'+hr(e)+'"]',o=i;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":o=hc(e)}if(!Mr.has(o)&&(e=nt({rel:"modulepreload",href:e},t),Mr.set(o,e),n.querySelector(i)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Yf(o)))return}r=n.createElement("link"),Qt(r,"link",e),At(r),n.head.appendChild(r)}}}function j4(e,t,n){io.S(e,t,n);var r=dc;if(r&&e){var i=Sl(r).hoistableStyles,o=Ul(e);t=t||"default";var s=i.get(o);if(!s){var a={loading:0,preload:null};if(s=r.querySelector(Wf(o)))a.loading=5;else{e=nt({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Mr.get(o))&&Z1(e,n);var l=s=r.createElement("link");At(l),Qt(l,"link",e),l._p=new Promise(function(c,u){l.onload=c,l.onerror=u}),l.addEventListener("load",function(){a.loading|=1}),l.addEventListener("error",function(){a.loading|=2}),a.loading|=4,Ch(s,t,r)}s={type:"stylesheet",instance:s,count:1,state:a},i.set(o,s)}}}function z4(e,t){io.X(e,t);var n=dc;if(n&&e){var r=Sl(n).hoistableScripts,i=hc(e),o=r.get(i);o||(o=n.querySelector(Yf(i)),o||(e=nt({src:e,async:!0},t),(t=Mr.get(i))&&ex(e,t),o=n.createElement("script"),At(o),Qt(o,"link",e),n.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},r.set(i,o))}}function I4(e,t){io.M(e,t);var n=dc;if(n&&e){var r=Sl(n).hoistableScripts,i=hc(e),o=r.get(i);o||(o=n.querySelector(Yf(i)),o||(e=nt({src:e,async:!0,type:"module"},t),(t=Mr.get(i))&&ex(e,t),o=n.createElement("script"),At(o),Qt(o,"link",e),n.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},r.set(i,o))}}function $E(e,t,n,r){var i=(i=Uo.current)?vp(i):null;if(!i)throw Error(j(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=Ul(n.href),n=Sl(i).hoistableStyles,r=n.get(t),r||(r={type:"style",instance:null,count:0,state:null},n.set(t,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=Ul(n.href);var o=Sl(i).hoistableStyles,s=o.get(e);if(s||(i=i.ownerDocument||i,s={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=i.querySelector(Wf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),Mr.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Mr.set(e,n),o||P4(i,e,n,s.state))),t&&r===null)throw Error(j(528,""));return s}if(t&&r!==null)throw Error(j(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=hc(n),n=Sl(i).hoistableScripts,r=n.get(t),r||(r={type:"script",instance:null,count:0,state:null},n.set(t,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(j(444,e))}}function Ul(e){return'href="'+hr(e)+'"'}function Wf(e){return'link[rel="stylesheet"]['+e+"]"}function o2(e){return nt({},e,{"data-precedence":e.precedence,precedence:null})}function P4(e,t,n,r){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?r.loading=1:(t=e.createElement("link"),r.preload=t,t.addEventListener("load",function(){return r.loading|=1}),t.addEventListener("error",function(){return r.loading|=2}),Qt(t,"link",n),At(t),e.head.appendChild(t))}function hc(e){return'[src="'+hr(e)+'"]'}function Yf(e){return"script[async]"+e}function UE(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+hr(n.href)+'"]');if(r)return t.instance=r,At(r),r;var i=nt({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement("style"),At(r),Qt(r,"style",i),Ch(r,n.precedence,e),t.instance=r;case"stylesheet":i=Ul(n.href);var o=e.querySelector(Wf(i));if(o)return t.state.loading|=4,t.instance=o,At(o),o;r=o2(n),(i=Mr.get(i))&&Z1(r,i),o=(e.ownerDocument||e).createElement("link"),At(o);var s=o;return s._p=new Promise(function(a,l){s.onload=a,s.onerror=l}),Qt(o,"link",r),t.state.loading|=4,Ch(o,n.precedence,e),t.instance=o;case"script":return o=hc(n.src),(i=e.querySelector(Yf(o)))?(t.instance=i,At(i),i):(r=n,(i=Mr.get(o))&&(r=nt({},n),ex(r,i)),e=e.ownerDocument||e,i=e.createElement("script"),At(i),Qt(i,"link",r),e.head.appendChild(i),t.instance=i);case"void":return null;default:throw Error(j(443,t.type))}else t.type==="stylesheet"&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Ch(r,n.precedence,e));return t.instance}function Ch(e,t,n){for(var r=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),i=r.length?r[r.length-1]:null,o=i,s=0;s<r.length;s++){var a=r[s];if(a.dataset.precedence===t)o=a;else if(o!==i)break}o?o.parentNode.insertBefore(e,o.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Z1(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function ex(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Th=null;function VE(e,t,n){if(Th===null){var r=new Map,i=Th=new Map;i.set(n,r)}else i=Th,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var o=n[i];if(!(o[$f]||o[Kt]||e==="link"&&o.getAttribute("rel")==="stylesheet")&&o.namespaceURI!=="http://www.w3.org/2000/svg"){var s=o.getAttribute(t)||"";s=e+s;var a=r.get(s);a?a.push(o):r.set(s,[o])}}return r}function FE(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function B4(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function s2(e){return!(e.type==="stylesheet"&&!(e.state.loading&3))}function H4(e,t,n,r){if(n.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&!(n.state.loading&4)){if(n.instance===null){var i=Ul(r.href),o=t.querySelector(Wf(i));if(o){t=o._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=yp.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=o,At(o);return}o=t.ownerDocument||t,r=o2(r),(i=Mr.get(i))&&Z1(r,i),o=o.createElement("link"),At(o);var s=o;s._p=new Promise(function(a,l){s.onload=a,s.onerror=l}),Qt(o,"link",r),n.instance=o}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=yp.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Nv=0;function $4(e,t){return e.stylesheets&&e.count===0&&Mh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Mh(e,e.stylesheets),e.unsuspend){var o=e.unsuspend;e.unsuspend=null,o()}},6e4+t);0<e.imgBytes&&Nv===0&&(Nv=62500*S4());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Mh(e,e.stylesheets),e.unsuspend)){var o=e.unsuspend;e.unsuspend=null,o()}},(e.imgBytes>Nv?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function yp(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Mh(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var bp=null;function Mh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,bp=new Map,t.forEach(U4,e),bp=null,yp.call(e))}function U4(e,t){if(!(t.state.loading&4)){var n=bp.get(e);if(n)var r=n.get(null);else{n=new Map,bp.set(e,n);for(var i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),o=0;o<i.length;o++){var s=i[o];(s.nodeName==="LINK"||s.getAttribute("media")!=="not all")&&(n.set(s.dataset.precedence,s),r=s)}r&&n.set(null,r)}i=t.instance,s=i.getAttribute("data-precedence"),o=n.get(s)||r,o===r&&n.set(null,i),n.set(s,i),this.count++,r=yp.bind(this),i.addEventListener("load",r),i.addEventListener("error",r),o?o.parentNode.insertBefore(i,o.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var af={$$typeof:zi,Provider:null,Consumer:null,_currentValue:Ys,_currentValue2:Ys,_threadCount:0};function V4(e,t,n,r,i,o,s,a,l){this.tag=1,this.containerInfo=e,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=ev(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ev(0),this.hiddenUpdates=ev(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=o,this.onRecoverableError=s,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=l,this.incompleteTransitions=new Map}function a2(e,t,n,r,i,o,s,a,l,c,u,f){return e=new V4(e,t,n,s,l,c,u,f,a),t=1,o===!0&&(t|=24),o=qn(3,null,null,t),e.current=o,o.stateNode=e,t=M1(),t.refCount++,e.pooledCache=t,t.refCount++,o.memoizedState={element:r,isDehydrated:n,cache:t},k1(o),e}function l2(e){return e?(e=ml,e):ml}function c2(e,t,n,r,i,o){i=l2(i),r.context===null?r.context=i:r.pendingContext=i,r=Fo(t),r.payload={element:n},o=o===void 0?null:o,o!==null&&(r.callback=o),n=qo(e,r,t),n!==null&&(_n(n,e,t),Su(n,e,t))}function qE(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function tx(e,t){qE(e,t),(e=e.alternate)&&qE(e,t)}function u2(e){if(e.tag===13||e.tag===31){var t=Ta(e,67108864);t!==null&&_n(t,e,67108864),tx(e,67108864)}}function KE(e){if(e.tag===13||e.tag===31){var t=Jn();t=d1(t);var n=Ta(e,t);n!==null&&_n(n,e,t),tx(e,t)}}var xp=!0;function F4(e,t,n,r){var i=ee.T;ee.T=null;var o=_e.p;try{_e.p=2,nx(e,t,n,r)}finally{_e.p=o,ee.T=i}}function q4(e,t,n,r){var i=ee.T;ee.T=null;var o=_e.p;try{_e.p=8,nx(e,t,n,r)}finally{_e.p=o,ee.T=i}}function nx(e,t,n,r){if(xp){var i=R0(r);if(i===null)kv(e,t,r,Sp,n),WE(e,r);else if(W4(i,e,t,n,r))r.stopPropagation();else if(WE(e,r),t&4&&-1<K4.indexOf(e)){for(;i!==null;){var o=lc(i);if(o!==null)switch(o.tag){case 3:if(o=o.stateNode,o.current.memoizedState.isDehydrated){var s=Ns(o.pendingLanes);if(s!==0){var a=o;for(a.pendingLanes|=2,a.entangledLanes|=2;s;){var l=1<<31-Qn(s);a.entanglements[1]|=l,s&=~l}xi(o),!(Ne&6)&&(up=Gn()+500,Kf(0))}}break;case 31:case 13:a=Ta(o,2),a!==null&&_n(a,o,2),Qm(),tx(o,2)}if(o=R0(r),o===null&&kv(e,t,r,Sp,n),o===i)break;i=o}i!==null&&r.stopPropagation()}else kv(e,t,r,null,n)}}function R0(e){return e=g1(e),rx(e)}var Sp=null;function rx(e){if(Sp=null,e=cl(e),e!==null){var t=If(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=DO(t),e!==null)return e;e=null}else if(n===31){if(e=NO(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Sp=e,null}function f2(e){switch(e){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(Nz()){case jO:return 2;case zO:return 8;case Xh:case _z:return 32;case IO:return 268435456;default:return 32}default:return 32}}var L0=!1,Yo=null,Go=null,Xo=null,lf=new Map,cf=new Map,Ao=[],K4="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 WE(e,t){switch(e){case"focusin":case"focusout":Yo=null;break;case"dragenter":case"dragleave":Go=null;break;case"mouseover":case"mouseout":Xo=null;break;case"pointerover":case"pointerout":lf.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":cf.delete(t.pointerId)}}function zc(e,t,n,r,i,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:o,targetContainers:[i]},t!==null&&(t=lc(t),t!==null&&u2(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function W4(e,t,n,r,i){switch(t){case"focusin":return Yo=zc(Yo,e,t,n,r,i),!0;case"dragenter":return Go=zc(Go,e,t,n,r,i),!0;case"mouseover":return Xo=zc(Xo,e,t,n,r,i),!0;case"pointerover":var o=i.pointerId;return lf.set(o,zc(lf.get(o)||null,e,t,n,r,i)),!0;case"gotpointercapture":return o=i.pointerId,cf.set(o,zc(cf.get(o)||null,e,t,n,r,i)),!0}return!1}function d2(e){var t=cl(e.target);if(t!==null){var n=If(t);if(n!==null){if(t=n.tag,t===13){if(t=DO(n),t!==null){e.blockedOn=t,Nw(e.priority,function(){KE(n)});return}}else if(t===31){if(t=NO(n),t!==null){e.blockedOn=t,Nw(e.priority,function(){KE(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Oh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=R0(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Jy=r,n.target.dispatchEvent(r),Jy=null}else return t=lc(n),t!==null&&u2(t),e.blockedOn=n,!1;t.shift()}return!0}function YE(e,t,n){Oh(e)&&n.delete(t)}function Y4(){L0=!1,Yo!==null&&Oh(Yo)&&(Yo=null),Go!==null&&Oh(Go)&&(Go=null),Xo!==null&&Oh(Xo)&&(Xo=null),lf.forEach(YE),cf.forEach(YE)}function jd(e,t){e.blockedOn===t&&(e.blockedOn=null,L0||(L0=!0,Mt.unstable_scheduleCallback(Mt.unstable_NormalPriority,Y4)))}var zd=null;function GE(e){zd!==e&&(zd=e,Mt.unstable_scheduleCallback(Mt.unstable_NormalPriority,function(){zd===e&&(zd=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!="function"){if(rx(r||n)===null)continue;break}var o=lc(n);o!==null&&(e.splice(t,3),t-=3,p0(o,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Vl(e){function t(l){return jd(l,e)}Yo!==null&&jd(Yo,e),Go!==null&&jd(Go,e),Xo!==null&&jd(Xo,e),lf.forEach(t),cf.forEach(t);for(var n=0;n<Ao.length;n++){var r=Ao[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Ao.length&&(n=Ao[0],n.blockedOn===null);)d2(n),n.blockedOn===null&&Ao.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],o=n[r+1],s=i[zn]||null;if(typeof o=="function")s||GE(n);else if(s){var a=null;if(o&&o.hasAttribute("formAction")){if(i=o,s=o[zn]||null)a=s.formAction;else if(rx(i)!==null)continue}else a=s.action;typeof a=="function"?n[r+1]=a:(n.splice(r,3),r-=3),GE(n)}}}function h2(){function e(o){o.canIntercept&&o.info==="react-transition"&&o.intercept({handler:function(){return new Promise(function(s){return i=s})},focusReset:"manual",scroll:"manual"})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var o=navigation.currentEntry;o&&o.url!=null&&navigation.navigate(o.url,{state:o.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var r=!1,i=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),i!==null&&(i(),i=null)}}}function ix(e){this._internalRoot=e}eg.prototype.render=ix.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(j(409));var n=t.current,r=Jn();c2(n,r,e,t,null,null)};eg.prototype.unmount=ix.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;c2(e.current,2,null,e,null,null),Qm(),t[ac]=null}};function eg(e){this._internalRoot=e}eg.prototype.unstable_scheduleHydration=function(e){if(e){var t=UO();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ao.length&&t!==0&&t<Ao[n].priority;n++);Ao.splice(n,0,e),n===0&&d2(e)}};var XE=AO.version;if(XE!=="19.2.0")throw Error(j(527,XE,"19.2.0"));_e.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(j(188)):(e=Object.keys(e).join(","),Error(j(268,e)));return e=Cz(t),e=e!==null?_O(e):null,e=e===null?null:e.stateNode,e};var G4={bundleType:0,version:"19.2.0",rendererPackageName:"react-dom",currentDispatcherRef:ee,reconcilerVersion:"19.2.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Id=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Id.isDisabled&&Id.supportsFiber)try{Pf=Id.inject(G4),Xn=Id}catch{}}Im.createRoot=function(e,t){if(!kO(e))throw Error(j(299));var n=!1,r="",i=ik,o=ok,s=sk;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(o=t.onCaughtError),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=a2(e,1,!1,null,null,n,r,null,i,o,s,h2),e[ac]=t.current,J1(e),new ix(t)};Im.hydrateRoot=function(e,t,n){if(!kO(e))throw Error(j(299));var r=!1,i="",o=ik,s=ok,a=sk,l=null;return n!=null&&(n.unstable_strictMode===!0&&(r=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onUncaughtError!==void 0&&(o=n.onUncaughtError),n.onCaughtError!==void 0&&(s=n.onCaughtError),n.onRecoverableError!==void 0&&(a=n.onRecoverableError),n.formState!==void 0&&(l=n.formState)),t=a2(e,1,!0,t,n??null,r,i,l,o,s,a,h2),t.context=l2(null),n=t.current,r=Jn(),r=d1(r),i=Fo(r),i.callback=null,qo(n,i,r),n=r,t.current.lanes=n,Hf(t,n),xi(t),e[ac]=t.current,J1(e),new eg(t)};Im.version="19.2.0";function p2(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(p2)}catch(e){console.error(e)}}p2(),hO.exports=Im;var X4=hO.exports;function Ah(e){const t={version:1,project:e.project,slices:e.slices,layers:e.layers,tasks:e.tasks};return JSON.stringify(t,null,2)}function Q4(e){const t=JSON.parse(e);if(t.version!==1)throw new Error(`Unsupported file version: ${t.version}`);if(!t.project||!t.slices||!t.layers||!t.tasks)throw new Error("Invalid .vertical file: missing required fields");return{project:t.project,slices:t.slices,layers:t.layers,tasks:t.tasks.map(n=>({...n,notesHtml:n.notesHtml??null}))}}async function m2(){const e=await fetch("/api/project");if(!e.ok)throw new Error(`Failed to load project: ${e.statusText}`);const t=await e.text();return Q4(t)}async function QE(e){const t=await fetch("/api/project",{method:"POST",headers:{"Content-Type":"application/json"},body:Ah(e)});if(!t.ok)throw new Error(`Failed to save project: ${t.statusText}`)}function J4(e){fetch("/api/dirty",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({dirty:e})})}function Z4(e,t){const n=new EventSource("/api/events");return n.onmessage=r=>{r.data==="file-changed"&&e()},n.onerror=()=>{n.close(),t()},()=>n.close()}function eP(e,t){switch(t.type){case"RENAME_PROJECT":return{...e,project:{...e.project,name:t.name}};case"CREATE_TASK":return{...e,tasks:[...e.tasks,{id:t.id,projectId:e.project.id,layerId:t.layerId,name:t.name,sorting:t.sorting,done:!1,notesHtml:null}]};case"CREATE_TASK_AFTER":{const n=e.tasks.find(o=>o.id===t.afterTaskId);if(!n)return e;const r=e.tasks.filter(o=>o.layerId===n.layerId&&o.sorting>n.sorting).sort((o,s)=>o.sorting-s.sorting)[0],i=r?(n.sorting+r.sorting)/2:n.sorting+1;return{...e,tasks:[...e.tasks,{id:t.id,projectId:e.project.id,layerId:n.layerId,name:"",sorting:i,done:!1,notesHtml:null}]}}case"RENAME_TASK":return{...e,tasks:e.tasks.map(n=>n.id===t.taskId?{...n,name:t.name}:n)};case"DELETE_TASK":return{...e,tasks:e.tasks.filter(n=>n.id!==t.taskId)};case"SET_TASK_DONE":return{...e,tasks:e.tasks.map(n=>n.id===t.taskId?{...n,done:t.done}:n)};case"MOVE_TASK":return{...e,tasks:e.tasks.map(n=>n.id===t.taskId?{...n,layerId:t.layerId,sorting:t.sorting}:n)};case"RENAME_LAYER":return{...e,layers:e.layers.map(n=>n.id===t.layerId?{...n,name:t.name}:n)};case"UNNAME_LAYER":return{...e,layers:e.layers.map(n=>n.id===t.layerId?{...n,name:null}:n)};case"SET_LAYER_STATUS":return{...e,layers:e.layers.map(n=>n.id===t.layerId?{...n,status:t.status}:n)};case"SPLIT_LAYER":{const n={id:t.newLayerId,sliceId:t.sliceId,name:null,sorting:t.newLayerSorting,status:null};return{...e,layers:[...e.layers,n],tasks:e.tasks.map(r=>r.layerId===t.currentLayerId&&r.sorting>t.taskSorting?{...r,layerId:t.newLayerId}:r)}}case"UNSPLIT_LAYER":{const n=e.layers.find(a=>a.id===t.layerId);if(!n)return e;const r=e.layers.filter(a=>a.sliceId===n.sliceId&&a.sorting>n.sorting).sort((a,l)=>a.sorting-l.sorting)[0];if(!r)return e;const i=Math.max(0,...e.tasks.filter(a=>a.layerId===n.id).map(a=>a.sorting)),o=e.tasks.filter(a=>a.layerId===r.id).sort((a,l)=>a.sorting-l.sorting),s=e.tasks.map(a=>{if(a.layerId!==r.id)return a;const l=o.findIndex(c=>c.id===a.id);return{...a,layerId:n.id,sorting:i+l+1}});return{...e,layers:e.layers.filter(a=>a.id!==r.id),tasks:s}}case"SET_TASK_NOTES":return{...e,tasks:e.tasks.map(n=>n.id===t.taskId?{...n,notesHtml:t.notesHtml}:n)};case"RENAME_SLICE":return{...e,slices:e.slices.map(n=>n.id===t.sliceId?{...n,name:t.name}:n)};case"UNNAME_SLICE":return{...e,slices:e.slices.map(n=>n.id===t.sliceId?{...n,name:null}:n)};case"SORT_SLICES":{const n=new Map(t.slices.map(r=>[r.id,r.boxNumber]));return{...e,slices:e.slices.map(r=>({...r,boxNumber:n.get(r.id)??r.boxNumber}))}}case"LOAD_STATE":return t.state}}const Gf=S.createContext(void 0);function tP({initialState:e,children:t}){const[n,r]=S.useReducer(eP,e),[i,o]=S.useState(()=>Ah(e)),s=S.useCallback(u=>{r(u),u.type==="LOAD_STATE"&&o(Ah(u.state))},[]),a=S.useMemo(()=>Ah(n),[n]),l=S.useCallback(()=>a!==i,[a,i]),c=S.useCallback(()=>{o(a)},[a]);return w.jsx(Gf.Provider,{value:{state:n,dispatch:s,isDirty:l,markClean:c},children:t})}function pc(){const e=S.useContext(Gf);if(!e)throw new Error("useBoardState must be used within BoardProvider");return e.state}function ir(){const e=S.useContext(Gf);if(!e)throw new Error("useBoardDispatch must be used within BoardProvider");return e.dispatch}function g2(){const e=S.useContext(Gf);if(!e)throw new Error("useIsDirty must be used within BoardProvider");return e.isDirty}function nP(){const e=S.useContext(Gf);if(!e)throw new Error("useMarkClean must be used within BoardProvider");return e.markClean}var rP=Symbol.for("preact-signals");function tg(){if(Fi>1)Fi--;else{var e,t=!1;for(function(){var i=Ep;for(Ep=void 0;i!==void 0;)i.S.v===i.v&&(i.S.i=i.i),i=i.o}();Du!==void 0;){var n=Du;for(Du=void 0,wp++;n!==void 0;){var r=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&y2(n))try{n.c()}catch(i){t||(e=i,t=!0)}n=r}}if(wp=0,Fi--,t)throw e}}function mt(e){if(Fi>0)return e();j0=++iP,Fi++;try{return e()}finally{tg()}}var Re=void 0;function Ue(e){var t=Re;Re=void 0;try{return e()}finally{Re=t}}var Du=void 0,Fi=0,wp=0,iP=0,j0=0,Ep=void 0,Cp=0;function v2(e){if(Re!==void 0){var t=e.n;if(t===void 0||t.t!==Re)return t={i:0,S:e,p:Re.s,n:void 0,t:Re,e:void 0,x:void 0,r:t},Re.s!==void 0&&(Re.s.n=t),Re.s=t,e.n=t,32&Re.f&&e.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=Re.s,t.n=void 0,Re.s.n=t,Re.s=t),t}}function Sn(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=t==null?void 0:t.watched,this.Z=t==null?void 0:t.unwatched,this.name=t==null?void 0:t.name}Sn.prototype.brand=rP;Sn.prototype.h=function(){return!0};Sn.prototype.S=function(e){var t=this,n=this.t;n!==e&&e.e===void 0&&(e.x=n,this.t=e,n!==void 0?n.e=e:Ue(function(){var r;(r=t.W)==null||r.call(t)}))};Sn.prototype.U=function(e){var t=this;if(this.t!==void 0){var n=e.e,r=e.x;n!==void 0&&(n.x=r,e.e=void 0),r!==void 0&&(r.e=n,e.x=void 0),e===this.t&&(this.t=r,r===void 0&&Ue(function(){var i;(i=t.Z)==null||i.call(t)}))}};Sn.prototype.subscribe=function(e){var t=this;return Bn(function(){var n=t.value,r=Re;Re=void 0;try{e(n)}finally{Re=r}},{name:"sub"})};Sn.prototype.valueOf=function(){return this.value};Sn.prototype.toString=function(){return this.value+""};Sn.prototype.toJSON=function(){return this.value};Sn.prototype.peek=function(){var e=Re;Re=void 0;try{return this.value}finally{Re=e}};Object.defineProperty(Sn.prototype,"value",{get:function(){var e=v2(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(wp>100)throw new Error("Cycle detected");(function(n){Fi!==0&&wp===0&&n.l!==j0&&(n.l=j0,Ep={S:n,v:n.v,i:n.i,o:Ep})})(this),this.v=e,this.i++,Cp++,Fi++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{tg()}}}});function Xf(e,t){return new Sn(e,t)}function y2(e){for(var t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function b2(e){for(var t=e.s;t!==void 0;t=t.n){var n=t.S.n;if(n!==void 0&&(t.r=n),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function x2(e){for(var t=e.s,n=void 0;t!==void 0;){var r=t.p;t.i===-1?(t.S.U(t),r!==void 0&&(r.n=t.n),t.n!==void 0&&(t.n.p=r)):n=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=r}e.s=n}function Oa(e,t){Sn.call(this,void 0),this.x=e,this.s=void 0,this.g=Cp-1,this.f=4,this.W=t==null?void 0:t.watched,this.Z=t==null?void 0:t.unwatched,this.name=t==null?void 0:t.name}Oa.prototype=new Sn;Oa.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Cp))return!0;if(this.g=Cp,this.f|=1,this.i>0&&!y2(this))return this.f&=-2,!0;var e=Re;try{b2(this),Re=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(n){this.v=n,this.f|=16,this.i++}return Re=e,x2(this),this.f&=-2,!0};Oa.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(var t=this.s;t!==void 0;t=t.n)t.S.S(t)}Sn.prototype.S.call(this,e)};Oa.prototype.U=function(e){if(this.t!==void 0&&(Sn.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(var t=this.s;t!==void 0;t=t.n)t.S.U(t)}};Oa.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;e!==void 0;e=e.x)e.t.N()}};Object.defineProperty(Oa.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=v2(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function JE(e,t){return new Oa(e,t)}function S2(e){var t=e.m;if(e.m=void 0,typeof t=="function"){Fi++;var n=Re;Re=void 0;try{t()}catch(r){throw e.f&=-2,e.f|=8,ox(e),r}finally{Re=n,tg()}}}function ox(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,S2(e)}function oP(e){if(Re!==this)throw new Error("Out-of-order effect");x2(this),Re=e,this.f&=-2,8&this.f&&ox(this),tg()}function mc(e,t){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=t==null?void 0:t.name}mc.prototype.c=function(){var e=this.S();try{if(8&this.f||this.x===void 0)return;var t=this.x();typeof t=="function"&&(this.m=t)}finally{e()}};mc.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,S2(this),b2(this),Fi++;var e=Re;return Re=this,oP.bind(this,e)};mc.prototype.N=function(){2&this.f||(this.f|=2,this.u=Du,Du=this)};mc.prototype.d=function(){this.f|=8,1&this.f||ox(this)};mc.prototype.dispose=function(){this.d()};function Bn(e,t){var n=new mc(e,t);try{n.c()}catch(i){throw n.d(),i}var r=n.d.bind(n);return r[Symbol.dispose]=r,r}var sP=Object.create,sx=Object.defineProperty,aP=Object.defineProperties,lP=Object.getOwnPropertyDescriptor,cP=Object.getOwnPropertyDescriptors,ZE=Object.getOwnPropertySymbols,uP=Object.prototype.hasOwnProperty,fP=Object.prototype.propertyIsEnumerable,dP=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),gc=e=>{throw TypeError(e)},z0=(e,t,n)=>t in e?sx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,hP=(e,t)=>{for(var n in t||(t={}))uP.call(t,n)&&z0(e,n,t[n]);if(ZE)for(var n of ZE(t))fP.call(t,n)&&z0(e,n,t[n]);return e},pP=(e,t)=>aP(e,cP(t)),eC=(e,t)=>sx(e,"name",{value:t,configurable:!0}),mP=e=>{var t;return[,,,sP((t=void 0)!=null?t:null)]},w2=["class","method","getter","setter","accessor","field","value","get","set"],Wc=e=>e!==void 0&&typeof e!="function"?gc("Function expected"):e,gP=(e,t,n,r,i)=>({kind:w2[e],name:t,metadata:r,addInitializer:o=>n._?gc("Already initialized"):i.push(Wc(o||null))}),E2=(e,t)=>z0(t,dP("metadata"),e[3]),Ms=(e,t,n,r)=>{for(var i=0,o=e[t>>1],s=o&&o.length;i<s;i++)t&1?o[i].call(n):r=o[i].call(n,r);return r},vc=(e,t,n,r,i,o)=>{var s,a,l,c,u,f=t&7,d=!!(t&8),h=!!(t&16),p=f>3?e.length+1:f?d?1:2:0,g=w2[f+5],y=f>3&&(e[p-1]=[]),v=e[p]||(e[p]=[]),b=f&&(!h&&!d&&(i=i.prototype),f<5&&(f>3||!h)&&lP(f<4?i:{get[n](){return gr(this,o)},set[n](m){return So(this,o,m)}},n));f?h&&f<4&&eC(o,(f>2?"set ":f>1?"get ":"")+n):eC(i,n);for(var x=r.length-1;x>=0;x--)c=gP(f,n,l={},e[3],v),f&&(c.static=d,c.private=h,u=c.access={has:h?m=>vP(i,m):m=>n in m},f^3&&(u.get=h?m=>(f^1?gr:yP)(m,i,f^4?o:b.get):m=>m[n]),f>2&&(u.set=h?(m,E)=>So(m,i,E,f^4?o:b.set):(m,E)=>m[n]=E)),a=(0,r[x])(f?f<4?h?o:b[g]:f>4?void 0:{get:b.get,set:b.set}:i,c),l._=1,f^4||a===void 0?Wc(a)&&(f>4?y.unshift(a):f?h?o=a:b[g]=a:i=a):typeof a!="object"||a===null?gc("Object expected"):(Wc(s=a.get)&&(b.get=s),Wc(s=a.set)&&(b.set=s),Wc(s=a.init)&&y.unshift(s));return f||E2(e,i),b&&sx(i,n,b),h?f^4?o:b:i},ax=(e,t,n)=>t.has(e)||gc("Cannot "+n),vP=(e,t)=>Object(t)!==t?gc('Cannot use the "in" operator on this value'):e.has(t),gr=(e,t,n)=>(ax(e,t,"read from private field"),n?n.call(e):t.get(e)),Yc=(e,t,n)=>t.has(e)?gc("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),So=(e,t,n,r)=>(ax(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),yP=(e,t,n)=>(ax(e,t,"access private method"),n);function uf(e,t){if(t){let n;return JE(()=>{const r=e();return r&&n&&t(n,r)?n:(n=r,r)})}return JE(e)}function qi(e,t){if(Object.is(e,t))return!0;if(e===null||t===null)return!1;if(typeof e=="function"&&typeof t=="function")return e===t;if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:!e.some((r,i)=>!qi(r,t[i]));if(typeof e=="object"&&typeof t=="object"){const n=Object.keys(e),r=Object.keys(t);return n.length!==r.length?!1:!n.some(o=>!qi(e[o],t[o]))}return!1}function Me({get:e},t){return{init(n){return Xf(n)},get(){return e.call(this).value},set(n){const r=e.call(this);r.peek()!==n&&(r.value=n)}}}function kt(e,t){const n=new WeakMap;return function(){let r=n.get(this);return r||(r=uf(e.bind(this)),n.set(this,r)),r.value}}function _v(e=!0){return function(t,n){n.addInitializer(function(){const r=n.kind==="field"?this:n.static?this:Object.getPrototypeOf(this),i=Object.getOwnPropertyDescriptor(r,n.name);i&&Object.defineProperty(r,n.name,pP(hP({},i),{enumerable:e}))})}}function Qf(...e){const t=e.map(Bn);return()=>t.forEach(n=>n())}var C2,T2,M2,O2,A2,k2,mn,lx,Rv,I0,P0,rn,cx,Lv,D2,B0,ux,jv,H0,$0;k2=[Me],A2=[Me],O2=[Me],M2=[_v()],T2=[_v()],C2=[_v()];var Aa=class{constructor(e,t=Object.is){this.defaultValue=e,this.equals=t,Ms(mn,5,this),Yc(this,rn),Yc(this,lx,Ms(mn,8,this)),Ms(mn,11,this),Yc(this,cx,Ms(mn,12,this)),Ms(mn,15,this),Yc(this,ux,Ms(mn,16,this)),Ms(mn,19,this),this.reset=this.reset.bind(this),this.reset()}get current(){return gr(this,rn,H0)}get initial(){return gr(this,rn,I0)}get previous(){return gr(this,rn,D2)}set current(e){const t=Ue(()=>gr(this,rn,H0));e&&t&&this.equals(t,e)||mt(()=>{gr(this,rn,I0)||So(this,rn,e,P0),So(this,rn,t,B0),So(this,rn,e,$0)})}reset(e=this.defaultValue){mt(()=>{So(this,rn,void 0,B0),So(this,rn,e,P0),So(this,rn,e,$0)})}};mn=mP();lx=new WeakMap;rn=new WeakSet;cx=new WeakMap;ux=new WeakMap;Rv=vc(mn,20,"#initial",k2,rn,lx),I0=Rv.get,P0=Rv.set;Lv=vc(mn,20,"#previous",A2,rn,cx),D2=Lv.get,B0=Lv.set;jv=vc(mn,20,"#current",O2,rn,ux),H0=jv.get,$0=jv.set;vc(mn,2,"current",M2,Aa);vc(mn,2,"initial",T2,Aa);vc(mn,2,"previous",C2,Aa);E2(mn,Aa);function zv(e){return Ue(()=>{const t={};for(const n in e)t[n]=e[n];return t})}var Ls,bP=class{constructor(){Yc(this,Ls,new WeakMap)}get(e,t){var n;return e?(n=gr(this,Ls).get(e))==null?void 0:n.get(t):void 0}set(e,t,n){var r;if(e)return gr(this,Ls).has(e)||gr(this,Ls).set(e,new Map),(r=gr(this,Ls).get(e))==null?void 0:r.set(t,n)}clear(e){var t;return e?(t=gr(this,Ls).get(e))==null?void 0:t.clear():void 0}};Ls=new WeakMap;var xP=Object.create,N2=Object.defineProperty,SP=Object.getOwnPropertyDescriptor,tC=Object.getOwnPropertySymbols,wP=Object.prototype.hasOwnProperty,EP=Object.prototype.propertyIsEnumerable,_2=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),ng=e=>{throw TypeError(e)},nC=Math.pow,U0=(e,t,n)=>t in e?N2(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,CP=(e,t)=>{for(var n in t||(t={}))wP.call(t,n)&&U0(e,n,t[n]);if(tC)for(var n of tC(t))EP.call(t,n)&&U0(e,n,t[n]);return e},TP=e=>{var t;return[,,,xP((t=e==null?void 0:e[_2("metadata")])!=null?t:null)]},R2=["class","method","getter","setter","accessor","field","value","get","set"],L2=e=>e!==void 0&&typeof e!="function"?ng("Function expected"):e,MP=(e,t,n,r,i)=>({kind:R2[e],name:t,metadata:r,addInitializer:o=>n._?ng("Already initialized"):i.push(L2(o||null))}),OP=(e,t)=>U0(t,_2("metadata"),e[3]),AP=(e,t,n,r)=>{for(var i=0,o=e[t>>1],s=o&&o.length;i<s;i++)o[i].call(n);return r},j2=(e,t,n,r,i,o)=>{for(var s,a,l,c,u=t&7,f=!1,d=!1,h=2,p=R2[u+5],g=e[h]||(e[h]=[]),y=(i=i.prototype,SP(i,n)),v=r.length-1;v>=0;v--)l=MP(u,n,a={},e[3],g),l.static=f,l.private=d,c=l.access={has:b=>n in b},c.get=b=>b[n],s=(0,r[v])(y[p],l),a._=1,L2(s)&&(y[p]=s);return y&&N2(i,n,y),i},z2=(e,t,n)=>t.has(e)||ng("Cannot "+n),kP=(e,t,n)=>(z2(e,t,"read from private field"),t.get(e)),DP=(e,t,n)=>t.has(e)?ng("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),NP=(e,t,n,r)=>(z2(e,t,"write to private field"),t.set(e,n),n),Kn=class V0{constructor(t,n){this.x=t,this.y=n}static delta(t,n){return new V0(t.x-n.x,t.y-n.y)}static distance(t,n){return Math.hypot(t.x-n.x,t.y-n.y)}static equals(t,n){return t.x===n.x&&t.y===n.y}static from({x:t,y:n}){return new V0(t,n)}},eo=class js{constructor(t,n,r,i){this.left=t,this.top=n,this.width=r,this.height=i,this.scale={x:1,y:1}}get inverseScale(){return{x:1/this.scale.x,y:1/this.scale.y}}translate(t,n){const{top:r,left:i,width:o,height:s,scale:a}=this,l=new js(i+t,r+n,o,s);return l.scale=CP({},a),l}get boundingRectangle(){const{width:t,height:n,left:r,top:i,right:o,bottom:s}=this;return{width:t,height:n,left:r,top:i,right:o,bottom:s}}get center(){const{left:t,top:n,right:r,bottom:i}=this;return new Kn((t+r)/2,(n+i)/2)}get area(){const{width:t,height:n}=this;return t*n}equals(t){if(!(t instanceof js))return!1;const{left:n,top:r,width:i,height:o}=this;return n===t.left&&r===t.top&&i===t.width&&o===t.height}containsPoint(t){const{top:n,left:r,bottom:i,right:o}=this;return n<=t.y&&t.y<=i&&r<=t.x&&t.x<=o}intersectionArea(t){return t instanceof js?_P(this,t):0}intersectionRatio(t){const{area:n}=this,r=this.intersectionArea(t);return r/(t.area+n-r)}get bottom(){const{top:t,height:n}=this;return t+n}get right(){const{left:t,width:n}=this;return t+n}get aspectRatio(){const{width:t,height:n}=this;return t/n}get corners(){return[{x:this.left,y:this.top},{x:this.right,y:this.top},{x:this.left,y:this.bottom},{x:this.right,y:this.bottom}]}static from({top:t,left:n,width:r,height:i}){return new js(n,t,r,i)}static delta(t,n,r={x:"center",y:"center"}){const i=(o,s)=>{const a=r[s],l=s==="x"?o.left:o.top,c=s==="x"?o.width:o.height;return a=="start"?l:a=="end"?l+c:l+c/2};return Kn.delta({x:i(t,"x"),y:i(t,"y")},{x:i(n,"x"),y:i(n,"y")})}static intersectionRatio(t,n){return js.from(t).intersectionRatio(js.from(n))}};function _P(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),o=Math.min(t.top+t.height,e.top+e.height),s=i-r,a=o-n;return r<i&&n<o?s*a:0}var I2,P2,F0,kh,Jf,rg=class extends(F0=Aa,P2=[kt],I2=[kt],F0){constructor(t){const n=Kn.from(t);super(n,(r,i)=>Kn.equals(r,i)),AP(Jf,5,this),DP(this,kh,0),this.velocity={x:0,y:0}}get delta(){return Kn.delta(this.current,this.initial)}get direction(){const{current:t,previous:n}=this;if(!n)return null;const r={x:t.x-n.x,y:t.y-n.y};return!r.x&&!r.y?null:Math.abs(r.x)>Math.abs(r.y)?r.x>0?"right":"left":r.y>0?"down":"up"}get current(){return super.current}set current(t){const{current:n}=this,r=Kn.from(t),i={x:r.x-n.x,y:r.y-n.y},o=Date.now(),s=o-kP(this,kh),a=l=>Math.round(l/s*100);mt(()=>{NP(this,kh,o),this.velocity={x:a(i.x),y:a(i.y)},super.current=r})}reset(t=this.defaultValue){super.reset(Kn.from(t)),this.velocity={x:0,y:0}}};Jf=TP(F0);kh=new WeakMap;j2(Jf,2,"delta",P2,rg);j2(Jf,2,"direction",I2,rg);OP(Jf,rg);function Iv({x:e,y:t},n){const r=Math.abs(e),i=Math.abs(t);return typeof n=="number"?Math.sqrt(nC(r,2)+nC(i,2))>n:"x"in n&&"y"in n?r>n.x&&i>n.y:"x"in n?r>n.x:"y"in n?i>n.y:!1}var B2=(e=>(e.Horizontal="x",e.Vertical="y",e))(B2||{}),H2=Object.values(B2),RP=Object.create,fx=Object.defineProperty,LP=Object.defineProperties,jP=Object.getOwnPropertyDescriptor,zP=Object.getOwnPropertyDescriptors,Tp=Object.getOwnPropertySymbols,$2=Object.prototype.hasOwnProperty,U2=Object.prototype.propertyIsEnumerable,V2=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),yc=e=>{throw TypeError(e)},q0=(e,t,n)=>t in e?fx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,F2=(e,t)=>{for(var n in t||(t={}))$2.call(t,n)&&q0(e,n,t[n]);if(Tp)for(var n of Tp(t))U2.call(t,n)&&q0(e,n,t[n]);return e},q2=(e,t)=>LP(e,zP(t)),rC=(e,t)=>fx(e,"name",{value:t,configurable:!0}),K2=(e,t)=>{var n={};for(var r in e)$2.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Tp)for(var r of Tp(e))t.indexOf(r)<0&&U2.call(e,r)&&(n[r]=e[r]);return n},bc=e=>{var t;return[,,,RP((t=e==null?void 0:e[V2("metadata")])!=null?t:null)]},W2=["class","method","getter","setter","accessor","field","value","get","set"],Gc=e=>e!==void 0&&typeof e!="function"?yc("Function expected"):e,IP=(e,t,n,r,i)=>({kind:W2[e],name:t,metadata:r,addInitializer:o=>n._?yc("Already initialized"):i.push(Gc(o||null))}),ka=(e,t)=>q0(t,V2("metadata"),e[3]),oe=(e,t,n,r)=>{for(var i=0,o=e[t>>1],s=o&&o.length;i<s;i++)t&1?o[i].call(n):r=o[i].call(n,r);return r},Oe=(e,t,n,r,i,o)=>{var s,a,l,c,u,f=t&7,d=!!(t&8),h=!!(t&16),p=f>3?e.length+1:f?d?1:2:0,g=W2[f+5],y=f>3&&(e[p-1]=[]),v=e[p]||(e[p]=[]),b=f&&(!h&&!d&&(i=i.prototype),f<5&&(f>3||!h)&&jP(f<4?i:{get[n](){return $t(this,o)},set[n](m){return Ir(this,o,m)}},n));f?h&&f<4&&rC(o,(f>2?"set ":f>1?"get ":"")+n):rC(i,n);for(var x=r.length-1;x>=0;x--)c=IP(f,n,l={},e[3],v),f&&(c.static=d,c.private=h,u=c.access={has:h?m=>PP(i,m):m=>n in m},f^3&&(u.get=h?m=>(f^1?$t:BP)(m,i,f^4?o:b.get):m=>m[n]),f>2&&(u.set=h?(m,E)=>Ir(m,i,E,f^4?o:b.set):(m,E)=>m[n]=E)),a=(0,r[x])(f?f<4?h?o:b[g]:f>4?void 0:{get:b.get,set:b.set}:i,c),l._=1,f^4||a===void 0?Gc(a)&&(f>4?y.unshift(a):f?h?o=a:b[g]=a:i=a):typeof a!="object"||a===null?yc("Object expected"):(Gc(s=a.get)&&(b.get=s),Gc(s=a.set)&&(b.set=s),Gc(s=a.init)&&y.unshift(s));return f||ka(e,i),b&&fx(i,n,b),h?f^4?o:b:i},dx=(e,t,n)=>t.has(e)||yc("Cannot "+n),PP=(e,t)=>Object(t)!==t?yc('Cannot use the "in" operator on this value'):e.has(t),$t=(e,t,n)=>(dx(e,t,"read from private field"),n?n.call(e):t.get(e)),Ve=(e,t,n)=>t.has(e)?yc("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Ir=(e,t,n,r)=>(dx(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),BP=(e,t,n)=>(dx(e,t,"access private method"),n);function Y2(e,t){return{plugin:e,options:t}}function hx(e){return t=>Y2(e,t)}function px(e){return typeof e=="function"?{plugin:e,options:void 0}:e}var G2,ff,mx,Dh;G2=[Me];var an=class{constructor(t,n){this.manager=t,this.options=n,Ve(this,mx,oe(ff,8,this,!1)),oe(ff,11,this),Ve(this,Dh,new Set)}enable(){this.disabled=!1}disable(){this.disabled=!0}isDisabled(){return Ue(()=>this.disabled)}configure(t){this.options=t}registerEffect(t){const n=Bn(t.bind(this));return $t(this,Dh).add(n),n}destroy(){$t(this,Dh).forEach(t=>t())}static configure(t){return Y2(this,t)}};ff=bc(null);mx=new WeakMap;Dh=new WeakMap;Oe(ff,4,"disabled",G2,an,mx);ka(ff,an);var ig=class extends an{},Nh,Pv=class{constructor(e){this.manager=e,this.instances=new Map,Ve(this,Nh,[])}get values(){return Array.from(this.instances.values())}set values(e){const t=e.map(px).reduceRight((r,i)=>r.some(({plugin:o})=>o===i.plugin)?r:[i,...r],[]),n=t.map(({plugin:r})=>r);for(const r of $t(this,Nh))if(!n.includes(r)){if(r.prototype instanceof ig)continue;this.unregister(r)}for(const{plugin:r,options:i}of t)this.register(r,i);Ir(this,Nh,n)}get(e){return this.instances.get(e)}register(e,t){const n=this.instances.get(e);if(n)return n.options!==t&&(n.options=t),n;const r=new e(this.manager,t);return this.instances.set(e,r),r}unregister(e){const t=this.instances.get(e);t&&(t.destroy(),this.instances.delete(e))}destroy(){for(const e of this.instances.values())e.destroy();this.instances.clear()}};Nh=new WeakMap;function HP(e,t){return e.priority===t.priority?e.type===t.type?t.value-e.value:t.type-e.type:t.priority-e.priority}var Pd=[],Ga,Xa,$P=class extends an{constructor(e){super(e),Ve(this,Ga),Ve(this,Xa),this.computeCollisions=this.computeCollisions.bind(this),Ir(this,Xa,Xf(Pd)),this.destroy=Qf(()=>{const t=this.computeCollisions(),n=Ue(()=>this.manager.dragOperation.position.current);if(t!==Pd){const r=$t(this,Ga);if(Ir(this,Ga,n),r&&n.x==r.x&&n.y==r.y)return}else Ir(this,Ga,void 0);$t(this,Xa).value=t},()=>{const{dragOperation:t}=this.manager;t.status.initialized&&this.forceUpdate()})}forceUpdate(e=!0){Ue(()=>{e?$t(this,Xa).value=this.computeCollisions():Ir(this,Ga,void 0)})}computeCollisions(e,t){const{registry:n,dragOperation:r}=this.manager,{source:i,shape:o,status:s}=r;if(!s.initialized||!o)return Pd;const a=[],l=[];for(const c of e??n.droppables){if(c.disabled||i&&!c.accepts(i))continue;const u=t??c.collisionDetector;if(!u)continue;l.push(c),c.shape;const f=Ue(()=>u({droppable:c,dragOperation:r}));f&&(c.collisionPriority!=null&&(f.priority=c.collisionPriority),a.push(f))}return l.length===0?Pd:(a.sort(HP),a)}get collisions(){return $t(this,Xa).value}};Ga=new WeakMap;Xa=new WeakMap;var UP=class{constructor(){this.registry=new Map}addEventListener(e,t){const{registry:n}=this,r=new Set(n.get(e));return r.add(t),n.set(e,r),()=>this.removeEventListener(e,t)}removeEventListener(e,t){const{registry:n}=this,r=new Set(n.get(e));r.delete(t),n.set(e,r)}dispatch(e,...t){const{registry:n}=this,r=n.get(e);if(r)for(const i of r)i(...t)}},VP=class extends UP{constructor(e){super(),this.manager=e}dispatch(e,t){const n=[t,this.manager];super.dispatch(e,...n)}};function _h(e,t=!0){let n=!1;return q2(F2({},e),{cancelable:t,get defaultPrevented(){return n},preventDefault(){t&&(n=!0)}})}var FP=class extends ig{constructor(e){super(e);const t=(r,i)=>r.map(({id:o})=>o).join("")===i.map(({id:o})=>o).join("");let n=[];this.destroy=Qf(()=>{const{dragOperation:r,collisionObserver:i}=e;r.status.initializing&&(n=[],i.enable())},()=>{const{collisionObserver:r,monitor:i}=e,{collisions:o}=r;if(r.isDisabled())return;const s=_h({collisions:o});if(i.dispatch("collision",s),s.defaultPrevented||t(o,n))return;n=o;const[a]=o;Ue(()=>{var l;(a==null?void 0:a.id)!==((l=e.dragOperation.target)==null?void 0:l.id)&&(r.disable(),e.actions.setDropTarget(a==null?void 0:a.id).then(()=>{r.enable()}))})})}},Da=(e=>(e[e.Lowest=0]="Lowest",e[e.Low=1]="Low",e[e.Normal=2]="Normal",e[e.High=3]="High",e[e.Highest=4]="Highest",e))(Da||{}),Na=(e=>(e[e.Collision=0]="Collision",e[e.ShapeIntersection=1]="ShapeIntersection",e[e.PointerIntersection=2]="PointerIntersection",e))(Na||{}),X2,Q2,J2,Z2,eD,tD,nD,Sr,gx;nD=[Me],tD=[kt],eD=[kt],Z2=[kt],J2=[kt],Q2=[kt],X2=[kt];var oo=class{constructor(){oe(Sr,5,this),Ve(this,gx,oe(Sr,8,this,"idle")),oe(Sr,11,this)}get current(){return this.value}get idle(){return this.value==="idle"}get initializing(){return this.value==="initializing"}get initialized(){const{value:e}=this;return e!=="idle"&&e!=="initialization-pending"}get dragging(){return this.value==="dragging"}get dropped(){return this.value==="dropped"}set(e){this.value=e}};Sr=bc(null);gx=new WeakMap;Oe(Sr,4,"value",nD,oo,gx);Oe(Sr,2,"current",tD,oo);Oe(Sr,2,"idle",eD,oo);Oe(Sr,2,"initializing",Z2,oo);Oe(Sr,2,"initialized",J2,oo);Oe(Sr,2,"dragging",Q2,oo);Oe(Sr,2,"dropped",X2,oo);ka(Sr,oo);var qP=class{constructor(e){this.manager=e}setDragSource(e){const{dragOperation:t}=this.manager;t.sourceIdentifier=typeof e=="string"||typeof e=="number"?e:e.id}setDropTarget(e){return Ue(()=>{const{dragOperation:t}=this.manager,n=e??null;if(t.targetIdentifier===n)return Promise.resolve(!1);t.targetIdentifier=n;const r=_h({operation:t.snapshot()});return t.status.dragging&&this.manager.monitor.dispatch("dragover",r),this.manager.renderer.rendering.then(()=>r.defaultPrevented)})}start(e){return Ue(()=>{const{dragOperation:t}=this.manager;if(e.source!=null&&this.setDragSource(e.source),!t.source)throw new Error("Cannot start a drag operation without a drag source");if(!t.status.idle)throw new Error("Cannot start a drag operation while another is active");const r=new AbortController,{event:i,coordinates:o}=e;mt(()=>{t.status.set("initialization-pending"),t.shape=null,t.canceled=!1,t.activatorEvent=i??null,t.position.reset(o)});const s=_h({operation:t.snapshot()});return this.manager.monitor.dispatch("beforedragstart",s),s.defaultPrevented?(t.reset(),r.abort(),r):(t.status.set("initializing"),t.controller=r,this.manager.renderer.rendering.then(()=>{if(r.signal.aborted)return;const{status:a}=t;a.current==="initializing"&&(t.status.set("dragging"),this.manager.monitor.dispatch("dragstart",{nativeEvent:i,operation:t.snapshot(),cancelable:!1}))}),r)})}move(e){return Ue(()=>{var t,n;const{dragOperation:r}=this.manager,{status:i,controller:o}=r;if(!i.dragging||!o||o.signal.aborted)return;const s=_h({nativeEvent:e.event,operation:r.snapshot(),by:e.by,to:e.to},(t=e.cancelable)!=null?t:!0);((n=e.propagate)==null||n)&&this.manager.monitor.dispatch("dragmove",s),queueMicrotask(()=>{var a,l,c,u,f;if(s.defaultPrevented)return;const d=(f=e.to)!=null?f:{x:r.position.current.x+((l=(a=e.by)==null?void 0:a.x)!=null?l:0),y:r.position.current.y+((u=(c=e.by)==null?void 0:c.y)!=null?u:0)};r.position.current=d})})}stop(e={}){return Ue(()=>{var t,n;const{dragOperation:r}=this.manager,{controller:i}=r;if(!i||i.signal.aborted)return;let o;const s=()=>{const l={resume:()=>{},abort:()=>{}};return o=new Promise((c,u)=>{l.resume=c,l.abort=u}),l};i.abort();const a=()=>{this.manager.renderer.rendering.then(()=>{r.status.set("dropped");const l=Ue(()=>{var u;return((u=r.source)==null?void 0:u.status)==="dropping"}),c=()=>{r.controller===i&&(r.controller=void 0),r.reset()};if(l){const{source:u}=r,f=Bn(()=>{(u==null?void 0:u.status)==="idle"&&(f(),c())})}else this.manager.renderer.rendering.then(c)})};r.canceled=(t=e.canceled)!=null?t:!1,this.manager.monitor.dispatch("dragend",{nativeEvent:e.event,operation:r.snapshot(),canceled:(n=e.canceled)!=null?n:!1,suspend:s}),o?o.then(a).catch(()=>r.reset()):a()})}},rD,iD,oD,sD,Dn,vx,yx,bx,xx;sD=[Me],oD=[Me],iD=[Me],rD=[Me];var ps=class{constructor(e,t){Ve(this,vx,oe(Dn,8,this)),oe(Dn,11,this),Ve(this,yx,oe(Dn,12,this)),oe(Dn,15,this),Ve(this,bx,oe(Dn,16,this)),oe(Dn,19,this),Ve(this,xx,oe(Dn,20,this)),oe(Dn,23,this);const{effects:n,id:r,data:i={},disabled:o=!1,register:s=!0}=e;let a=r;this.manager=t,this.id=r,this.data=i,this.disabled=o,this.effects=()=>{var l;return[()=>{const{id:c,manager:u}=this;if(c!==a)return u==null||u.registry.register(this),()=>u==null?void 0:u.registry.unregister(this)},...(l=n==null?void 0:n())!=null?l:[]]},this.register=this.register.bind(this),this.unregister=this.unregister.bind(this),this.destroy=this.destroy.bind(this),t&&s&&queueMicrotask(this.register)}register(){var e;return(e=this.manager)==null?void 0:e.registry.register(this)}unregister(){var e;(e=this.manager)==null||e.registry.unregister(this)}destroy(){var e;(e=this.manager)==null||e.registry.unregister(this)}};Dn=bc(null);vx=new WeakMap;yx=new WeakMap;bx=new WeakMap;xx=new WeakMap;Oe(Dn,4,"manager",sD,ps,vx);Oe(Dn,4,"id",oD,ps,yx);Oe(Dn,4,"data",iD,ps,bx);Oe(Dn,4,"disabled",rD,ps,xx);ka(Dn,ps);var iC=class{constructor(){this.map=Xf(new Map),this.cleanupFunctions=new WeakMap,this.register=(e,t)=>{const n=this.map.peek(),r=n.get(e),i=()=>this.unregister(e,t);if(r===t)return i;if(r){const a=this.cleanupFunctions.get(r);a==null||a(),this.cleanupFunctions.delete(r)}const o=new Map(n);o.set(e,t),this.map.value=o;const s=Qf(...t.effects());return this.cleanupFunctions.set(t,s),i},this.unregister=(e,t)=>{const n=this.map.peek();if(n.get(e)!==t)return;const r=this.cleanupFunctions.get(t);r==null||r(),this.cleanupFunctions.delete(t);const i=new Map(n);i.delete(e),this.map.value=i}}[Symbol.iterator](){return this.map.peek().values()}get value(){return this.map.value.values()}has(e){return this.map.value.has(e)}get(e){return this.map.value.get(e)}destroy(){for(const e of this){const t=this.cleanupFunctions.get(e);t==null||t(),e.destroy()}this.map.value=new Map}},aD,lD,cD,uD,fD,dD,K0,gn,Sx,wx,Ex,di=class extends(K0=ps,dD=[Me],fD=[Me],uD=[Me],cD=[kt],lD=[kt],aD=[kt],K0){constructor(t,n){var r=t,{modifiers:i,type:o,sensors:s}=r,a=K2(r,["modifiers","type","sensors"]);super(a,n),oe(gn,5,this),Ve(this,Sx,oe(gn,8,this)),oe(gn,11,this),Ve(this,wx,oe(gn,12,this)),oe(gn,15,this),Ve(this,Ex,oe(gn,16,this,this.isDragSource?"dragging":"idle")),oe(gn,19,this),this.type=o,this.sensors=s,this.modifiers=i,this.alignment=a.alignment}get isDropping(){return this.status==="dropping"&&this.isDragSource}get isDragging(){return this.status==="dragging"&&this.isDragSource}get isDragSource(){var t,n;return((n=(t=this.manager)==null?void 0:t.dragOperation.source)==null?void 0:n.id)===this.id}};gn=bc(K0);Sx=new WeakMap;wx=new WeakMap;Ex=new WeakMap;Oe(gn,4,"type",dD,di,Sx);Oe(gn,4,"modifiers",fD,di,wx);Oe(gn,4,"status",uD,di,Ex);Oe(gn,2,"isDropping",cD,di);Oe(gn,2,"isDragging",lD,di);Oe(gn,2,"isDragSource",aD,di);ka(gn,di);var hD,pD,mD,gD,vD,yD,W0,Ct,Cx,Tx,Mx,Ox,Ax,hi=class extends(W0=ps,yD=[Me],vD=[Me],gD=[Me],mD=[Me],pD=[Me],hD=[kt],W0){constructor(t,n){var r=t,{accept:i,collisionDetector:o,collisionPriority:s,type:a}=r,l=K2(r,["accept","collisionDetector","collisionPriority","type"]);super(l,n),oe(Ct,5,this),Ve(this,Cx,oe(Ct,8,this)),oe(Ct,11,this),Ve(this,Tx,oe(Ct,12,this)),oe(Ct,15,this),Ve(this,Mx,oe(Ct,16,this)),oe(Ct,19,this),Ve(this,Ox,oe(Ct,20,this)),oe(Ct,23,this),Ve(this,Ax,oe(Ct,24,this)),oe(Ct,27,this),this.accept=i,this.collisionDetector=o,this.collisionPriority=s,this.type=a}accepts(t){const{accept:n}=this;return n?typeof n=="function"?n(t):t.type?Array.isArray(n)?n.includes(t.type):t.type===n:!1:!0}get isDropTarget(){var t,n;return((n=(t=this.manager)==null?void 0:t.dragOperation.target)==null?void 0:n.id)===this.id}};Ct=bc(W0);Cx=new WeakMap;Tx=new WeakMap;Mx=new WeakMap;Ox=new WeakMap;Ax=new WeakMap;Oe(Ct,4,"accept",yD,hi,Cx);Oe(Ct,4,"type",vD,hi,Tx);Oe(Ct,4,"collisionDetector",gD,hi,Mx);Oe(Ct,4,"collisionPriority",mD,hi,Ox);Oe(Ct,4,"shape",pD,hi,Ax);Oe(Ct,2,"isDropTarget",hD,hi);ka(Ct,hi);var Fl=class extends an{constructor(e,t){super(e,t),this.manager=e,this.options=t}},oC=class extends an{constructor(e,t){super(e,t),this.manager=e,this.options=t}apply(e){return e.transform}},KP=class{constructor(e){this.draggables=new iC,this.droppables=new iC,this.plugins=new Pv(e),this.sensors=new Pv(e),this.modifiers=new Pv(e)}register(e,t){if(e instanceof di)return this.draggables.register(e.id,e);if(e instanceof hi)return this.droppables.register(e.id,e);if(e.prototype instanceof oC)return this.modifiers.register(e,t);if(e.prototype instanceof Fl)return this.sensors.register(e,t);if(e.prototype instanceof an)return this.plugins.register(e,t);throw new Error("Invalid instance type")}unregister(e){if(e instanceof ps)return e instanceof di?this.draggables.unregister(e.id,e):e instanceof hi?this.droppables.unregister(e.id,e):()=>{};if(e.prototype instanceof oC)return this.modifiers.unregister(e);if(e.prototype instanceof Fl)return this.sensors.unregister(e);if(e.prototype instanceof an)return this.plugins.unregister(e);throw new Error("Invalid instance type")}destroy(){this.draggables.destroy(),this.droppables.destroy(),this.plugins.destroy(),this.sensors.destroy(),this.modifiers.destroy()}},bD,xD,SD,wD,ED,CD,TD,MD,OD,Xc,Rh,Qa,at,kx,Dx,Nx,_x,Rx,Qc;OD=[kt],MD=[Me],TD=[Me],CD=[Me],ED=[Me],wD=[Me],SD=[kt],xD=[kt],bD=[kt];var qr=class{constructor(e){oe(at,5,this),Ve(this,Xc),Ve(this,Rh),Ve(this,Qa,new Aa(void 0,(t,n)=>t&&n?t.equals(n):t===n)),this.status=new oo,Ve(this,kx,oe(at,8,this,!1)),oe(at,11,this),Ve(this,Dx,oe(at,12,this,null)),oe(at,15,this),Ve(this,Nx,oe(at,16,this,null)),oe(at,19,this),Ve(this,_x,oe(at,20,this,null)),oe(at,23,this),Ve(this,Rx,oe(at,24,this,[])),oe(at,27,this),this.position=new rg({x:0,y:0}),Ve(this,Qc,{x:0,y:0}),Ir(this,Xc,e)}get shape(){const{current:e,initial:t,previous:n}=$t(this,Qa);return!e||!t?null:{current:e,initial:t,previous:n}}set shape(e){e?$t(this,Qa).current=e:$t(this,Qa).reset()}get source(){var e;const t=this.sourceIdentifier;if(t==null)return null;const n=$t(this,Xc).registry.draggables.get(t);return n&&Ir(this,Rh,n),(e=n??$t(this,Rh))!=null?e:null}get target(){var e;const t=this.targetIdentifier;return t!=null&&(e=$t(this,Xc).registry.droppables.get(t))!=null?e:null}get transform(){const{x:e,y:t}=this.position.delta;let n={x:e,y:t};for(const r of this.modifiers)n=r.apply(q2(F2({},this.snapshot()),{transform:n}));return Ir(this,Qc,n),n}snapshot(){return Ue(()=>({source:this.source,target:this.target,activatorEvent:this.activatorEvent,transform:$t(this,Qc),shape:this.shape?zv(this.shape):null,position:zv(this.position),status:zv(this.status),canceled:this.canceled}))}reset(){mt(()=>{this.status.set("idle"),this.sourceIdentifier=null,this.targetIdentifier=null,$t(this,Qa).reset(),this.position.reset({x:0,y:0}),Ir(this,Qc,{x:0,y:0}),this.modifiers=[]})}};at=bc(null);Xc=new WeakMap;Rh=new WeakMap;Qa=new WeakMap;kx=new WeakMap;Dx=new WeakMap;Nx=new WeakMap;_x=new WeakMap;Rx=new WeakMap;Qc=new WeakMap;Oe(at,2,"shape",OD,qr);Oe(at,4,"canceled",MD,qr,kx);Oe(at,4,"activatorEvent",TD,qr,Dx);Oe(at,4,"sourceIdentifier",CD,qr,Nx);Oe(at,4,"targetIdentifier",ED,qr,_x);Oe(at,4,"modifiers",wD,qr,Rx);Oe(at,2,"source",SD,qr);Oe(at,2,"target",xD,qr);Oe(at,2,"transform",bD,qr);ka(at,qr);var WP={get rendering(){return Promise.resolve()}},YP=class{constructor(t){this.destroy=()=>{this.dragOperation.status.idle||this.actions.stop({canceled:!0}),this.dragOperation.modifiers.forEach(u=>u.destroy()),this.registry.destroy(),this.collisionObserver.destroy()};const{plugins:n=[],sensors:r=[],modifiers:i=[],renderer:o=WP}=t??{},s=new VP(this),a=new KP(this);this.registry=a,this.monitor=s,this.renderer=o,this.actions=new qP(this),this.dragOperation=new qr(this),this.collisionObserver=new $P(this),this.plugins=[FP,...n],this.modifiers=i,this.sensors=r;const{destroy:l}=this,c=Qf(()=>{var u,f,d;const h=Ue(()=>this.dragOperation.modifiers),p=this.modifiers;h!==p&&h.forEach(g=>g.destroy()),this.dragOperation.modifiers=(d=(f=(u=this.dragOperation.source)==null?void 0:u.modifiers)==null?void 0:f.map(g=>{const{plugin:y,options:v}=px(g);return new y(this,v)}))!=null?d:p});this.destroy=()=>{c(),l()}}get plugins(){return this.registry.plugins.values}set plugins(t){this.registry.plugins.values=t}get modifiers(){return this.registry.modifiers.values}set modifiers(t){this.registry.modifiers.values=t}get sensors(){return this.registry.sensors.values}set sensors(t){this.registry.sensors.values=t}},AD=e=>{throw TypeError(e)},Lx=(e,t,n)=>t.has(e)||AD("Cannot "+n),de=(e,t,n)=>(Lx(e,t,"read from private field"),t.get(e)),kn=(e,t,n)=>t.has(e)?AD("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Un=(e,t,n,r)=>(Lx(e,t,"write to private field"),t.set(e,n),n),kD=(e,t,n)=>(Lx(e,t,"access private method"),n);function og(e){return e?e instanceof KeyframeEffect?!0:"getKeyframes"in e&&typeof e.getKeyframes=="function":!1}function DD(e,t){const n=e.getAnimations();if(n.length>0)for(const r of n){if(r.playState!=="running")continue;const{effect:i}=r,s=(og(i)?i.getKeyframes():[]).filter(t);if(s.length>0)return[s[s.length-1],r]}return null}function sg(e){const{width:t,height:n,top:r,left:i,bottom:o,right:s}=e.getBoundingClientRect();return{width:t,height:n,top:r,left:i,bottom:o,right:s}}var ND=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function jx(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function zx(e){return"nodeType"in e}function so(e){var t,n,r;return e?jx(e)?e:zx(e)?"defaultView"in e?(t=e.defaultView)!=null?t:window:(r=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?r:window:window:window}function _D(e){const{Document:t}=so(e);return e instanceof t||"nodeType"in e&&e.nodeType===Node.DOCUMENT_NODE}function ua(e){return!e||jx(e)?!1:e instanceof so(e).HTMLElement||"namespaceURI"in e&&typeof e.namespaceURI=="string"&&e.namespaceURI.endsWith("html")}function RD(e){return e instanceof so(e).SVGElement||"namespaceURI"in e&&typeof e.namespaceURI=="string"&&e.namespaceURI.endsWith("svg")}function pi(e){return e?jx(e)?e.document:zx(e)?_D(e)?e:ua(e)||RD(e)?e.ownerDocument:document:document:document}function GP(e){const{documentElement:t}=pi(e),n=t.clientWidth,r=t.clientHeight;return{top:0,left:0,right:n,bottom:r,width:n,height:r}}function XP(e,t){if(QP(e)&&e.open===!1)return!1;const{overflow:n,overflowX:r,overflowY:i}=getComputedStyle(e);return n==="visible"&&r==="visible"&&i==="visible"}function QP(e){return e.tagName==="DETAILS"}function df(e,t=e.getBoundingClientRect(),n=0){var r;let i=t;const{ownerDocument:o}=e,s=(r=o.defaultView)!=null?r:window;let a=e.parentElement;for(;a&&a!==o.documentElement;){if(!XP(a)){const d=a.getBoundingClientRect(),h=n*(d.bottom-d.top),p=n*(d.right-d.left),g=n*(d.bottom-d.top),y=n*(d.right-d.left);i={top:Math.max(i.top,d.top-h),right:Math.min(i.right,d.right+p),bottom:Math.min(i.bottom,d.bottom+g),left:Math.max(i.left,d.left-y),width:0,height:0},i.width=i.right-i.left,i.height=i.bottom-i.top}a=a.parentElement}const l=s.innerWidth,c=s.innerHeight,u=n*c,f=n*l;return i={top:Math.max(i.top,0-u),right:Math.min(i.right,l+f),bottom:Math.min(i.bottom,c+u),left:Math.max(i.left,0-f),width:0,height:0},i.width=i.right-i.left,i.height=i.bottom-i.top,i.width<0&&(i.width=0),i.height<0&&(i.height=0),i}function LD(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function JP(e){const t="input, textarea, select, canvas, [contenteditable]",n=e.cloneNode(!0),r=Array.from(e.querySelectorAll(t));return Array.from(n.querySelectorAll(t)).forEach((o,s)=>{const a=r[s];if(sC(o)&&sC(a)&&(o.type!=="file"&&(o.value=a.value),o.type==="radio"&&o.name&&(o.name=`Cloned__${o.name}`)),aC(o)&&aC(a)&&a.width>0&&a.height>0){const l=o.getContext("2d");l==null||l.drawImage(a,0,0)}}),n}function sC(e){return"value"in e}function aC(e){return e.tagName==="CANVAS"}function jD(e,{x:t,y:n}){const r=e.elementFromPoint(t,n);if(ZP(r)){const{contentDocument:i}=r;if(i){const{left:o,top:s}=r.getBoundingClientRect();return jD(i,{x:t-o,y:n-s})}}return r}function ZP(e){return(e==null?void 0:e.tagName)==="IFRAME"}var Y0=new WeakMap,zD=class{constructor(){this.entries=new Set,this.clear=()=>{for(const e of this.entries){const[t,{type:n,listener:r,options:i}]=e;t.removeEventListener(n,r,i)}this.entries.clear()}}bind(e,t){const n=Array.isArray(t)?t:[t],r=[];for(const i of n){const{type:o,listener:s,options:a}=i,l=[e,i];e.addEventListener(o,s,a),this.entries.add(l),r.push(l)}return function(){for(const[o,{type:s,listener:a,options:l}]of r)o.removeEventListener(s,a,l)}}};function ql(e){const t=e==null?void 0:e.ownerDocument.defaultView;if(t&&t.self!==t.parent)return t.frameElement}function eB(e){const t=new Set;let n=ql(e);for(;n;)t.add(n),n=ql(n);return t}function tB(e,t){const n=setTimeout(e,t);return()=>clearTimeout(n)}function ID(e,t){const n=()=>performance.now();let r,i;return function(...o){const s=this;i?(r==null||r(),r=tB(()=>{e.apply(s,o),i=n()},t-(n()-i))):(e.apply(s,o),i=n())}}function nB(e,t){return e===t?!0:!e||!t?!1:e.top==t.top&&e.left==t.left&&e.right==t.right&&e.bottom==t.bottom}function rB(e,t=e.getBoundingClientRect()){const{width:n,height:r}=df(e,t);return n>0&&r>0}var iB=ND?ResizeObserver:class{observe(){}unobserve(){}disconnect(){}},Lh,oB=class extends iB{constructor(e){super(t=>{if(!de(this,Lh)){Un(this,Lh,!0);return}e(t,this)}),kn(this,Lh,!1)}};Lh=new WeakMap;var lC=Array.from({length:100},(e,t)=>t/100),PD=75,zs,Mp,mo,Is,Jc,Ht,Nu,Zc,Op,BD,HD,$D=class{constructor(e,t,n={debug:!1,skipInitial:!1}){this.element=e,this.callback=t,kn(this,Op),this.disconnect=()=>{var o,s,a;Un(this,Nu,!0),(o=de(this,mo))==null||o.disconnect(),(s=de(this,Is))==null||s.disconnect(),de(this,Jc).disconnect(),(a=de(this,Ht))==null||a.remove()},kn(this,zs,!0),kn(this,Mp),kn(this,mo),kn(this,Is),kn(this,Jc),kn(this,Ht),kn(this,Nu,!1),kn(this,Zc,ID(()=>{var o,s,a;const{element:l}=this;if((o=de(this,Is))==null||o.disconnect(),de(this,Nu)||!de(this,zs)||!l.isConnected)return;const c=(s=l.ownerDocument)!=null?s:document,{innerHeight:u,innerWidth:f}=(a=c.defaultView)!=null?a:window,d=l.getBoundingClientRect(),h=df(l,d),{top:p,left:g,bottom:y,right:v}=h,b=-Math.floor(p),x=-Math.floor(g),m=-Math.floor(f-v),E=-Math.floor(u-y),T=`${b}px ${m}px ${E}px ${x}px`;this.boundingClientRect=d,Un(this,Is,new IntersectionObserver(C=>{const[O]=C,{intersectionRect:A}=O;(O.intersectionRatio!==1?O.intersectionRatio:eo.intersectionRatio(A,df(l)))!==1&&de(this,Zc).call(this)},{threshold:lC,rootMargin:T,root:c})),de(this,Is).observe(l),kD(this,Op,BD).call(this)},PD)),this.boundingClientRect=e.getBoundingClientRect(),Un(this,zs,rB(e,this.boundingClientRect));let r=!0;this.callback=o=>{r&&(r=!1,n.skipInitial)||t(o)};const i=e.ownerDocument;n!=null&&n.debug&&(Un(this,Ht,document.createElement("div")),de(this,Ht).style.background="rgba(0,0,0,0.15)",de(this,Ht).style.position="fixed",de(this,Ht).style.pointerEvents="none",i.body.appendChild(de(this,Ht))),Un(this,Jc,new IntersectionObserver(o=>{var s,a;const l=o[o.length-1],{boundingClientRect:c,isIntersecting:u}=l,{width:f,height:d}=c,h=de(this,zs);Un(this,zs,u),!(!f&&!d)&&(h&&!u?((s=de(this,Is))==null||s.disconnect(),this.callback(null),(a=de(this,mo))==null||a.disconnect(),Un(this,mo,void 0),de(this,Ht)&&(de(this,Ht).style.visibility="hidden")):de(this,Zc).call(this),u&&!de(this,mo)&&(Un(this,mo,new oB(de(this,Zc))),de(this,mo).observe(e)))},{threshold:lC,root:i})),de(this,zs)&&!n.skipInitial&&this.callback(this.boundingClientRect),de(this,Jc).observe(e)}};zs=new WeakMap;Mp=new WeakMap;mo=new WeakMap;Is=new WeakMap;Jc=new WeakMap;Ht=new WeakMap;Nu=new WeakMap;Zc=new WeakMap;Op=new WeakSet;BD=function(){de(this,Nu)||(kD(this,Op,HD).call(this),!nB(this.boundingClientRect,de(this,Mp))&&(this.callback(this.boundingClientRect),Un(this,Mp,this.boundingClientRect)))};HD=function(){if(de(this,Ht)){const{top:e,left:t,width:n,height:r}=df(this.element);de(this,Ht).style.overflow="hidden",de(this,Ht).style.visibility="visible",de(this,Ht).style.top=`${Math.floor(e)}px`,de(this,Ht).style.left=`${Math.floor(t)}px`,de(this,Ht).style.width=`${Math.floor(n)}px`,de(this,Ht).style.height=`${Math.floor(r)}px`}};var Bd=new WeakMap,Hd=new WeakMap;function sB(e,t){let n=Bd.get(e);return n||(n={disconnect:new $D(e,i=>{const o=Bd.get(e);o&&o.callbacks.forEach(s=>s(i))},{skipInitial:!0}).disconnect,callbacks:new Set}),n.callbacks.add(t),Bd.set(e,n),()=>{n.callbacks.delete(t),n.callbacks.size===0&&(Bd.delete(e),n.disconnect())}}function aB(e,t){const n=new Set;for(const r of e){const i=sB(r,t);n.add(i)}return()=>n.forEach(r=>r())}function lB(e,t){var n;const r=e.ownerDocument;if(!Hd.has(r)){const s=new AbortController,a=new Set;document.addEventListener("scroll",l=>a.forEach(c=>c(l)),{capture:!0,passive:!0,signal:s.signal}),Hd.set(r,{disconnect:()=>s.abort(),listeners:a})}const{listeners:i,disconnect:o}=(n=Hd.get(r))!=null?n:{};return!i||!o?()=>{}:(i.add(t),()=>{i.delete(t),i.size===0&&(o(),Hd.delete(r))})}var eu,tu,jh,G0,cB=class{constructor(e,t,n){this.callback=t,kn(this,eu),kn(this,tu,!1),kn(this,jh),kn(this,G0,ID(s=>{if(!de(this,tu)&&s.target&&"contains"in s.target&&typeof s.target.contains=="function"){for(const a of de(this,jh))if(s.target.contains(a)){this.callback(de(this,eu).boundingClientRect);break}}},PD));const r=eB(e),i=aB(r,t),o=lB(e,de(this,G0));Un(this,jh,r),Un(this,eu,new $D(e,t,n)),this.disconnect=()=>{de(this,tu)||(Un(this,tu,!0),i(),o(),de(this,eu).disconnect())}}};eu=new WeakMap;tu=new WeakMap;jh=new WeakMap;G0=new WeakMap;function X0(e){return"showPopover"in e&&"hidePopover"in e&&typeof e.showPopover=="function"&&typeof e.hidePopover=="function"}function nu(e){try{X0(e)&&e.isConnected&&e.hasAttribute("popover")&&!e.matches(":popover-open")&&e.showPopover()}catch{}}function cC(e){return!ND||!e?!1:e===pi(e).scrollingElement}function UD(e){const t=so(e),n=cC(e)?GP(e):sg(e),r=cC(e)?{height:t.innerHeight,width:t.innerWidth}:{height:e.clientHeight,width:e.clientWidth},i={current:{x:e.scrollLeft,y:e.scrollTop},max:{x:e.scrollWidth-r.width,y:e.scrollHeight-r.height}},o=i.current.y<=0,s=i.current.x<=0,a=i.current.y>=i.max.y,l=i.current.x>=i.max.x;return{rect:n,position:i,isTop:o,isLeft:s,isBottom:a,isRight:l}}function uB(e,t){const{isTop:n,isBottom:r,isLeft:i,isRight:o,position:s}=UD(e),{x:a,y:l}=t??{x:0,y:0},c=!n&&s.current.y+l>0,u=!r&&s.current.y+l<s.max.y,f=!i&&s.current.x+a>0,d=!o&&s.current.x+a<s.max.x;return{top:c,bottom:u,left:f,right:d,x:f||d,y:c||u}}var Ix=class{constructor(t){this.scheduler=t,this.pending=!1,this.tasks=new Set,this.resolvers=new Set,this.flush=()=>{const{tasks:n,resolvers:r}=this;this.pending=!1,this.tasks=new Set,this.resolvers=new Set;for(const i of n)i();for(const i of r)i()}}schedule(t){return this.tasks.add(t),this.pending||(this.pending=!0,this.scheduler(this.flush)),new Promise(n=>this.resolvers.add(n))}},Ap=new Ix(e=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(e):e()}),fB=new Ix(e=>setTimeout(e,50)),kp=new Map,dB=kp.clear.bind(kp);function $r(e,t=!1){if(!t)return uC(e);let n=kp.get(e);return n||(n=uC(e),kp.set(e,n),fB.schedule(dB),n)}function uC(e){return so(e).getComputedStyle(e)}function hB(e,t=$r(e,!0)){return t.position==="fixed"||t.position==="sticky"}function pB(e,t=$r(e,!0)){const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(i=>{const o=t[i];return typeof o=="string"?n.test(o):!1})}var mB={excludeElement:!0};function Q0(e,t=mB){const{limit:n,excludeElement:r}=t,i=new Set;function o(s){if(n!=null&&i.size>=n||!s)return i;if(_D(s)&&s.scrollingElement!=null&&!i.has(s.scrollingElement))return i.add(s.scrollingElement),i;if(!ua(s))return RD(s)?o(s.parentElement):i;if(i.has(s))return i;const a=$r(s,!0);if(r&&s===e||pB(s,a)&&i.add(s),hB(s,a)){const{scrollingElement:l}=s.ownerDocument;return l&&i.add(l),i}return o(s.parentNode)}return e?o(e):i}function gB(e){const[t]=Q0(e,{limit:1});return t??null}function Kl(e,t=window.frameElement){const n={x:0,y:0,scaleX:1,scaleY:1};if(!e)return n;let r=ql(e);for(;r;){if(r===t)return n;const i=sg(r),{x:o,y:s}=vB(r,i);n.x=n.x+i.left,n.y=n.y+i.top,n.scaleX=n.scaleX*o,n.scaleY=n.scaleY*s,r=ql(r)}return n}function vB(e,t=sg(e)){const n=Math.round(t.width),r=Math.round(t.height);if(ua(e))return{x:n/e.offsetWidth,y:r/e.offsetHeight};const i=$r(e,!0);return{x:(parseFloat(i.width)||n)/n,y:(parseFloat(i.height)||r)/r}}function yB(e){if(e==="none")return null;const t=e.split(" "),n=parseFloat(t[0]),r=parseFloat(t[1]);return isNaN(n)&&isNaN(r)?null:{x:isNaN(n)?r:n,y:isNaN(r)?n:r}}function hf(e){if(e==="none")return null;const[t,n,r="0"]=e.split(" "),i={x:parseFloat(t),y:parseFloat(n),z:parseInt(r,10)};return isNaN(i.x)&&isNaN(i.y)?null:{x:isNaN(i.x)?0:i.x,y:isNaN(i.y)?0:i.y,z:isNaN(i.z)?0:i.z}}function Px(e){var t,n,r,i,o,s,a,l,c;const{scale:u,transform:f,translate:d}=e,h=yB(u),p=hf(d),g=bB(f);if(!g&&!h&&!p)return null;const y={x:(t=h==null?void 0:h.x)!=null?t:1,y:(n=h==null?void 0:h.y)!=null?n:1},v={x:(r=p==null?void 0:p.x)!=null?r:0,y:(i=p==null?void 0:p.y)!=null?i:0},b={x:(o=g==null?void 0:g.x)!=null?o:0,y:(s=g==null?void 0:g.y)!=null?s:0,scaleX:(a=g==null?void 0:g.scaleX)!=null?a:1,scaleY:(l=g==null?void 0:g.scaleY)!=null?l:1};return{x:v.x+b.x,y:v.y+b.y,z:(c=p==null?void 0:p.z)!=null?c:0,scaleX:y.x*b.scaleX,scaleY:y.y*b.scaleY}}function bB(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}var yr=(e=>(e[e.Idle=0]="Idle",e[e.Forward=1]="Forward",e[e.Reverse=-1]="Reverse",e))(yr||{}),xB={x:.2,y:.2},SB={x:10,y:10};function wB(e,t,n,r=25,i=xB,o=SB){const{x:s,y:a}=t,{rect:l,isTop:c,isBottom:u,isLeft:f,isRight:d}=UD(e),h=Kl(e),p=$r(e,!0),g=Px(p),y=g!==null?(g==null?void 0:g.scaleX)<0:!1,v=g!==null?(g==null?void 0:g.scaleY)<0:!1,b=new eo(l.left*h.scaleX+h.x,l.top*h.scaleY+h.y,l.width*h.scaleX,l.height*h.scaleY),x={x:0,y:0},m={x:0,y:0},E={height:b.height*i.y,width:b.width*i.x};return(!c||v&&!u)&&a<=b.top+E.height&&(n==null?void 0:n.y)!==1&&s>=b.left-o.x&&s<=b.right+o.x?(x.y=v?1:-1,m.y=r*Math.abs((b.top+E.height-a)/E.height)):(!u||v&&!c)&&a>=b.bottom-E.height&&(n==null?void 0:n.y)!==-1&&s>=b.left-o.x&&s<=b.right+o.x&&(x.y=v?-1:1,m.y=r*Math.abs((b.bottom-E.height-a)/E.height)),(!d||y&&!f)&&s>=b.right-E.width&&(n==null?void 0:n.x)!==-1&&a>=b.top-o.y&&a<=b.bottom+o.y?(x.x=y?-1:1,m.x=r*Math.abs((b.right-E.width-s)/E.width)):(!f||y&&!d)&&s<=b.left+E.width&&(n==null?void 0:n.x)!==1&&a>=b.top-o.y&&a<=b.bottom+o.y&&(x.x=y?1:-1,m.x=r*Math.abs((b.left+E.width-s)/E.width)),{direction:x,speed:m}}function EB(e){return"scrollIntoViewIfNeeded"in e&&typeof e.scrollIntoViewIfNeeded=="function"}function VD(e,t=!1){if(EB(e)){e.scrollIntoViewIfNeeded(t);return}if(!ua(e))return e.scrollIntoView();var n=gB(e);if(!ua(n))return;const r=$r(n,!0),i=parseInt(r.getPropertyValue("border-top-width")),o=parseInt(r.getPropertyValue("border-left-width")),s=e.offsetTop-n.offsetTop<n.scrollTop,a=e.offsetTop-n.offsetTop+e.clientHeight-i>n.scrollTop+n.clientHeight,l=e.offsetLeft-n.offsetLeft<n.scrollLeft,c=e.offsetLeft-n.offsetLeft+e.clientWidth-o>n.scrollLeft+n.clientWidth,u=s&&!a;(s||a)&&t&&(n.scrollTop=e.offsetTop-n.offsetTop-n.clientHeight/2-i+e.clientHeight/2),(l||c)&&t&&(n.scrollLeft=e.offsetLeft-n.offsetLeft-n.clientWidth/2-o+e.clientWidth/2),(s||a||l||c)&&!t&&e.scrollIntoView(u)}function CB(e,t,n){const{scaleX:r,scaleY:i,x:o,y:s}=t,a=e.left+o+(1-r)*parseFloat(n),l=e.top+s+(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),c=r?e.width*r:e.width,u=i?e.height*i:e.height;return{width:c,height:u,top:l,right:a+c,bottom:l+u,left:a}}function TB(e,t,n){const{scaleX:r,scaleY:i,x:o,y:s}=t,a=e.left-o-(1-r)*parseFloat(n),l=e.top-s-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),c=r?e.width/r:e.width,u=i?e.height/i:e.height;return{width:c,height:u,top:l,right:a+c,bottom:l+u,left:a}}function FD({element:e,keyframes:t,options:n}){return e.animate(t,n).finished}function fC(e,t=$r(e).translate,n=!0){if(n){const r=DD(e,i=>"translate"in i);if(r){const{translate:i=""}=r[0];if(typeof i=="string"){const o=hf(i);if(o)return o}}}if(t){const r=hf(t);if(r)return r}return{x:0,y:0,z:0}}var MB=new Ix(e=>setTimeout(e,0)),_u=new Map,OB=_u.clear.bind(_u);function AB(e){const t=e.ownerDocument;let n=_u.get(t);if(n)return n;n=t.getAnimations(),_u.set(t,n),MB.schedule(OB);const r=n.filter(i=>og(i.effect)&&i.effect.target===e);return _u.set(e,r),n}function kB(e,t){const n=AB(e).filter(r=>{var i,o;if(og(r.effect)){const{target:s}=r.effect;if((o=s&&((i=t.isValidTarget)==null?void 0:i.call(t,s)))!=null?o:!0)return r.effect.getKeyframes().some(l=>{for(const c of t.properties)if(l[c])return!0})}}).map(r=>{const{effect:i,currentTime:o}=r,s=i==null?void 0:i.getComputedTiming().duration;if(!(r.pending||r.playState==="finished")&&typeof s=="number"&&typeof o=="number"&&o<s)return r.currentTime=s,()=>{r.currentTime=o}});if(n.length>0)return()=>n.forEach(r=>r==null?void 0:r())}var Lr=class extends eo{constructor(e,t={}){var n,r,i,o;const{frameTransform:s=Kl(e),ignoreTransforms:a,getBoundingClientRect:l=sg}=t,c=kB(e,{properties:["transform","translate","scale","width","height"],isValidTarget:E=>(E!==e||LD())&&E.contains(e)}),u=l(e);let{top:f,left:d,width:h,height:p}=u,g;const y=$r(e),v=Px(y),b={x:(n=v==null?void 0:v.scaleX)!=null?n:1,y:(r=v==null?void 0:v.scaleY)!=null?r:1},x=DB(e,y);c==null||c(),v&&(g=TB(u,v,y.transformOrigin),(a||x)&&(f=g.top,d=g.left,h=g.width,p=g.height));const m={width:(i=g==null?void 0:g.width)!=null?i:h,height:(o=g==null?void 0:g.height)!=null?o:p};if(x&&!a&&g){const E=CB(g,x,y.transformOrigin);f=E.top,d=E.left,h=E.width,p=E.height,b.x=x.scaleX,b.y=x.scaleY}s&&(a||(d*=s.scaleX,h*=s.scaleX,f*=s.scaleY,p*=s.scaleY),d+=s.x,f+=s.y),super(d,f,h,p),this.scale=b,this.intrinsicWidth=m.width,this.intrinsicHeight=m.height}};function DB(e,t){var n;const r=e.getAnimations();let i=null;if(!r.length)return null;for(const o of r){if(o.playState!=="running")continue;const s=og(o.effect)?o.effect.getKeyframes():[],a=s[s.length-1];if(!a)continue;const{transform:l,translate:c,scale:u}=a;if(l||c||u){const f=Px({transform:typeof l=="string"&&l?l:t.transform,translate:typeof c=="string"&&c?c:t.translate,scale:typeof u=="string"&&u?u:t.scale});f&&(i=i?{x:i.x+f.x,y:i.y+f.y,z:(n=i.z)!=null?n:f.z,scaleX:i.scaleX*f.scaleX,scaleY:i.scaleY*f.scaleY}:f)}}return i}function Ru(e){return"style"in e&&typeof e.style=="object"&&e.style!==null&&"setProperty"in e.style&&"removeProperty"in e.style&&typeof e.style.setProperty=="function"&&typeof e.style.removeProperty=="function"}var NB=class{constructor(e){this.element=e,this.initial=new Map}set(e,t=""){const{element:n}=this;if(Ru(n))for(const[r,i]of Object.entries(e)){const o=`${t}${r}`;this.initial.has(o)||this.initial.set(o,n.style.getPropertyValue(o)),n.style.setProperty(o,typeof i=="string"?i:`${i}px`)}}remove(e,t=""){const{element:n}=this;if(Ru(n))for(const r of e){const i=`${t}${r}`;n.style.removeProperty(i)}}reset(){const{element:e}=this;if(Ru(e)){for(const[t,n]of this.initial)e.style.setProperty(t,n);e.getAttribute("style")===""&&e.removeAttribute("style")}}};function Zf(e){return e?e instanceof so(e).Element||zx(e)&&e.nodeType===Node.ELEMENT_NODE:!1}function pf(e){if(!e)return!1;const{KeyboardEvent:t}=so(e.target);return e instanceof t}function _B(e){if(!e)return!1;const{PointerEvent:t}=so(e.target);return e instanceof t}function RB(e){if(!Zf(e))return!1;const{tagName:t}=e;return t==="INPUT"||t==="TEXTAREA"||LB(e)}function LB(e){return e.hasAttribute("contenteditable")&&e.getAttribute("contenteditable")!=="false"}var Bv={};function J0(e){const t=Bv[e]==null?0:Bv[e]+1;return Bv[e]=t,`${e}-${t}`}var jB=({dragOperation:e,droppable:t})=>{const n=e.position.current;if(!n)return null;const{id:r}=t;if(!t.shape)return null;if(t.shape.containsPoint(n)){const i=Kn.distance(t.shape.center,n);return{id:r,value:1/i,type:Na.PointerIntersection,priority:Da.High}}return null},zB=({dragOperation:e,droppable:t})=>{const{shape:n}=e;if(!t.shape||!(n!=null&&n.current))return null;const r=n.current.intersectionArea(t.shape);if(r){const{position:i}=e,o=Kn.distance(t.shape.center,i.current),a=r/(n.current.area+t.shape.area-r)/o;return{id:t.id,value:a,type:Na.ShapeIntersection,priority:Da.Normal}}return null},Bx=e=>{var t;return(t=jB(e))!=null?t:zB(e)},IB=e=>{const{dragOperation:t,droppable:n}=e,{shape:r,position:i}=t;if(!n.shape)return null;const o=r?eo.from(r.current.boundingRectangle).corners:void 0,a=eo.from(n.shape.boundingRectangle).corners.reduce((l,c,u)=>{var f;return l+Kn.distance(Kn.from(c),(f=o==null?void 0:o[u])!=null?f:i.current)},0)/4;return{id:n.id,value:1/a,type:Na.Collision,priority:Da.Normal}},PB=e=>{var t;const{dragOperation:n,droppable:r}=e,{shape:i,position:o}=n;if(!r.shape)return null;const s=Bx(e);if(s)return s;const l=1/Kn.distance(r.shape.center,(t=i==null?void 0:i.current.center)!=null?t:o.current);return{id:r.id,value:l,type:Na.Collision,priority:Da.Normal}},BB=Object.create,Hx=Object.defineProperty,HB=Object.defineProperties,$B=Object.getOwnPropertyDescriptor,UB=Object.getOwnPropertyDescriptors,Dp=Object.getOwnPropertySymbols,qD=Object.prototype.hasOwnProperty,KD=Object.prototype.propertyIsEnumerable,WD=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),xc=e=>{throw TypeError(e)},Z0=(e,t,n)=>t in e?Hx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,mf=(e,t)=>{for(var n in t||(t={}))qD.call(t,n)&&Z0(e,n,t[n]);if(Dp)for(var n of Dp(t))KD.call(t,n)&&Z0(e,n,t[n]);return e},$x=(e,t)=>HB(e,UB(t)),dC=(e,t)=>Hx(e,"name",{value:t,configurable:!0}),YD=(e,t)=>{var n={};for(var r in e)qD.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Dp)for(var r of Dp(e))t.indexOf(r)<0&&KD.call(e,r)&&(n[r]=e[r]);return n},ed=e=>{var t;return[,,,BB((t=e==null?void 0:e[WD("metadata")])!=null?t:null)]},GD=["class","method","getter","setter","accessor","field","value","get","set"],ru=e=>e!==void 0&&typeof e!="function"?xc("Function expected"):e,VB=(e,t,n,r,i)=>({kind:GD[e],name:t,metadata:r,addInitializer:o=>n._?xc("Already initialized"):i.push(ru(o||null))}),Sc=(e,t)=>Z0(t,WD("metadata"),e[3]),Dt=(e,t,n,r)=>{for(var i=0,o=e[t>>1],s=o&&o.length;i<s;i++)t&1?o[i].call(n):r=o[i].call(n,r);return r},ao=(e,t,n,r,i,o)=>{var s,a,l,c,u,f=t&7,d=!!(t&8),h=!!(t&16),p=f>3?e.length+1:f?d?1:2:0,g=GD[f+5],y=f>3&&(e[p-1]=[]),v=e[p]||(e[p]=[]),b=f&&(!h&&!d&&(i=i.prototype),f<5&&(f>3||!h)&&$B(f<4?i:{get[n](){return Vt(this,o)},set[n](m){return Hr(this,o,m)}},n));f?h&&f<4&&dC(o,(f>2?"set ":f>1?"get ":"")+n):dC(i,n);for(var x=r.length-1;x>=0;x--)c=VB(f,n,l={},e[3],v),f&&(c.static=d,c.private=h,u=c.access={has:h?m=>FB(i,m):m=>n in m},f^3&&(u.get=h?m=>(f^1?Vt:eb)(m,i,f^4?o:b.get):m=>m[n]),f>2&&(u.set=h?(m,E)=>Hr(m,i,E,f^4?o:b.set):(m,E)=>m[n]=E)),a=(0,r[x])(f?f<4?h?o:b[g]:f>4?void 0:{get:b.get,set:b.set}:i,c),l._=1,f^4||a===void 0?ru(a)&&(f>4?y.unshift(a):f?h?o=a:b[g]=a:i=a):typeof a!="object"||a===null?xc("Object expected"):(ru(s=a.get)&&(b.get=s),ru(s=a.set)&&(b.set=s),ru(s=a.init)&&y.unshift(s));return f||Sc(e,i),b&&Hx(i,n,b),h?f^4?o:b:i},Ux=(e,t,n)=>t.has(e)||xc("Cannot "+n),FB=(e,t)=>Object(t)!==t?xc('Cannot use the "in" operator on this value'):e.has(t),Vt=(e,t,n)=>(Ux(e,t,"read from private field"),n?n.call(e):t.get(e)),Jt=(e,t,n)=>t.has(e)?xc("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Hr=(e,t,n,r)=>(Ux(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),eb=(e,t,n)=>(Ux(e,t,"access private method"),n),hC={role:"button",roleDescription:"draggable"},qB="dnd-kit-description",KB="dnd-kit-announcement",WB={draggable:"To pick up a draggable item, press the space bar. While dragging, use the arrow keys to move the item in a given direction. Press space again to drop the item in its new position, or press escape to cancel."},YB={dragstart({operation:{source:e}}){if(e)return`Picked up draggable item ${e.id}.`},dragover({operation:{source:e,target:t}}){if(!(!e||e.id===(t==null?void 0:t.id)))return t?`Draggable item ${e.id} was moved over droppable target ${t.id}.`:`Draggable item ${e.id} is no longer over a droppable target.`},dragend({operation:{source:e,target:t},canceled:n}){if(e)return n?`Dragging was cancelled. Draggable item ${e.id} was dropped.`:t?`Draggable item ${e.id} was dropped over droppable target ${t.id}`:`Draggable item ${e.id} was dropped.`}};function GB(e){const t=e.tagName.toLowerCase();return["input","select","textarea","a","button"].includes(t)}function XB(e,t){const n=document.createElement("div");return n.id=e,n.style.setProperty("display","none"),n.textContent=t,n}function QB(e){const t=document.createElement("div");return t.id=e,t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-atomic","true"),t.style.setProperty("position","fixed"),t.style.setProperty("width","1px"),t.style.setProperty("height","1px"),t.style.setProperty("margin","-1px"),t.style.setProperty("border","0"),t.style.setProperty("padding","0"),t.style.setProperty("overflow","hidden"),t.style.setProperty("clip","rect(0 0 0 0)"),t.style.setProperty("clip-path","inset(100%)"),t.style.setProperty("white-space","nowrap"),t}var JB=["dragover","dragmove"],ZB=class extends an{constructor(e,t){super(e);const{id:n,idPrefix:{description:r=qB,announcement:i=KB}={},announcements:o=YB,screenReaderInstructions:s=WB,debounce:a=500}=t??{},l=n?`${r}-${n}`:J0(r),c=n?`${i}-${n}`:J0(i);let u,f,d,h;const p=(E=h)=>{!d||!E||(d==null?void 0:d.nodeValue)!==E&&(d.nodeValue=E)},g=()=>Ap.schedule(p),y=e5(g,a),v=Object.entries(o).map(([E,T])=>this.manager.monitor.addEventListener(E,(C,O)=>{const A=d;if(!A)return;const k=T==null?void 0:T(C,O);k&&A.nodeValue!==k&&(h=k,JB.includes(E)?y():(g(),y.cancel()))})),b=()=>{let E=[];u!=null&&u.isConnected||(u=XB(l,s.draggable),E.push(u)),f!=null&&f.isConnected||(f=QB(c),d=document.createTextNode(""),f.appendChild(d),E.push(f)),E.length>0&&document.body.append(...E)},x=new Set;function m(){for(const E of x)E()}this.registerEffect(()=>{var E;x.clear();for(const T of this.manager.registry.draggables.value){const C=(E=T.handle)!=null?E:T.element;if(C){(!u||!f)&&x.add(b),(!GB(C)||LD())&&!C.hasAttribute("tabindex")&&x.add(()=>C.setAttribute("tabindex","0")),!C.hasAttribute("role")&&C.tagName.toLowerCase()!=="button"&&x.add(()=>C.setAttribute("role",hC.role)),C.hasAttribute("aria-roledescription")||x.add(()=>C.setAttribute("aria-roledescription",hC.roleDescription)),C.hasAttribute("aria-describedby")||x.add(()=>C.setAttribute("aria-describedby",l));for(const A of["aria-pressed","aria-grabbed"]){const k=String(T.isDragging);C.getAttribute(A)!==k&&x.add(()=>C.setAttribute(A,k))}const O=String(T.disabled);C.getAttribute("aria-disabled")!==O&&x.add(()=>C.setAttribute("aria-disabled",O))}}x.size>0&&Ap.schedule(m)}),this.destroy=()=>{super.destroy(),u==null||u.remove(),f==null||f.remove(),v.forEach(E=>E())}}};function e5(e,t){let n;const r=()=>{clearTimeout(n),n=setTimeout(e,t)};return r.cancel=()=>clearTimeout(n),r}var t5=class extends an{constructor(e,t){super(e,t),this.manager=e;const n=uf(()=>{var r;return pi((r=this.manager.dragOperation.source)==null?void 0:r.element)});this.destroy=Bn(()=>{var r;const{dragOperation:i}=this.manager,{cursor:o="grabbing",nonce:s}=(r=this.options)!=null?r:{};if(i.status.initialized){const a=n.value,l=a.createElement("style");return s&&l.setAttribute("nonce",s),l.textContent=`* { cursor: ${o} !important; }`,a.head.appendChild(l),()=>l.remove()}})}},td="data-dnd-",tb=`${td}dropping`,on="--dnd-",Zr=`${td}dragging`,Np=`${td}placeholder`,n5=[Zr,Np,"popover","aria-pressed","aria-grabbing"],r5=["view-transition-name"],i5=`
50
+ :root [${Zr}] {
51
+ position: fixed !important;
52
+ pointer-events: none !important;
53
+ touch-action: none;
54
+ z-index: calc(infinity);
55
+ will-change: translate;
56
+ top: var(${on}top, 0px) !important;
57
+ left: var(${on}left, 0px) !important;
58
+ right: unset !important;
59
+ bottom: unset !important;
60
+ width: var(${on}width, auto);
61
+ max-width: var(${on}width, auto);
62
+ height: var(${on}height, auto);
63
+ max-height: var(${on}height, auto);
64
+ transition: var(${on}transition) !important;
65
+ }
66
+
67
+ :root [${Np}] {
68
+ transition: none;
69
+ }
70
+
71
+ :root [${Np}='hidden'] {
72
+ visibility: hidden;
73
+ }
74
+
75
+ [${Zr}] * {
76
+ pointer-events: none !important;
77
+ }
78
+
79
+ [${Zr}]:not([${tb}]) {
80
+ translate: var(${on}translate) !important;
81
+ }
82
+
83
+ [${Zr}][style*='${on}scale'] {
84
+ scale: var(${on}scale) !important;
85
+ transform-origin: var(${on}transform-origin) !important;
86
+ }
87
+
88
+ @layer {
89
+ :where([${Zr}][popover]) {
90
+ overflow: visible;
91
+ background: unset;
92
+ border: unset;
93
+ margin: unset;
94
+ padding: unset;
95
+ color: inherit;
96
+
97
+ &:is(input, button) {
98
+ border: revert;
99
+ background: revert;
100
+ }
101
+ }
102
+ }
103
+ [${Zr}]::backdrop, [${td}overlay]:not([${Zr}]) {
104
+ display: none;
105
+ visibility: hidden;
106
+ }
107
+ `.replace(/\n+/g," ").replace(/\s+/g," ").trim();function o5(e,t="hidden"){return Ue(()=>{const{element:n,manager:r}=e;if(!n||!r)return;const i=s5(n,r.registry.droppables),o=[],s=JP(n),{remove:a}=s;return a5(i,s,o),l5(s,t),s.remove=()=>{o.forEach(l=>l()),a.call(s)},s})}function s5(e,t){const n=new Map;for(const r of t)if(r.element&&(e===r.element||e.contains(r.element))){const i=`${td}${J0("dom-id")}`;r.element.setAttribute(i,""),n.set(r,i)}return n}function a5(e,t,n){for(const[r,i]of e){if(!r.element)continue;const o=`[${i}]`,s=t.matches(o)?t:t.querySelector(o);if(r.element.removeAttribute(i),!s)continue;const a=r.element;r.proxy=s,s.removeAttribute(i),Y0.set(a,s),n.push(()=>{Y0.delete(a),r.proxy=void 0})}}function l5(e,t="hidden"){e.setAttribute("inert","true"),e.setAttribute("tab-index","-1"),e.setAttribute("aria-hidden","true"),e.setAttribute(Np,t)}function pC(e,t){return e===t?!0:ql(e)===ql(t)}function mC(e){const{target:t}=e;"newState"in e&&e.newState==="closed"&&Zf(t)&&t.hasAttribute("popover")&&requestAnimationFrame(()=>nu(t))}function gC(e){return e.tagName==="TR"}var _p=new Map,XD,nb,gf,Vx,zh,QD,JD,vf=class extends(nb=an,XD=[Me],nb){constructor(t,n){super(t,n),Jt(this,zh),Jt(this,Vx,Dt(gf,8,this)),Dt(gf,11,this),this.state={initial:{},current:{}},this.registerEffect(eb(this,zh,JD)),this.registerEffect(eb(this,zh,QD))}destroy(){super.destroy();for(const[t,n]of _p.entries())n.instances.has(this)&&(n.instances.delete(this),n.instances.size===0&&(n.cleanup(),_p.delete(t)))}};gf=ed(nb);Vx=new WeakMap;zh=new WeakSet;QD=function(){var e,t,n;const{state:r,manager:i,options:o}=this,{dragOperation:s}=i,{position:a,source:l,status:c}=s;if(c.idle){r.current={},r.initial={};return}if(!l)return;const{element:u,feedback:f}=l;if(!u||f==="none"||!c.initialized||c.initializing)return;const{initial:d}=r,h=(e=this.overlay)!=null?e:u,p=Kl(h),g=Kl(u),y=!pC(u,h),v=new Lr(u,{frameTransform:y?g:null,ignoreTransforms:!y}),b={x:g.scaleX/p.scaleX,y:g.scaleY/p.scaleY};let{width:x,height:m,top:E,left:T}=v;y&&(x=x/b.x,m=m/b.y);let C,O;const A=new NB(h),{transition:k,translate:z,boxSizing:_,paddingBlockStart:H,paddingBlockEnd:U,paddingInlineStart:V,paddingInlineEnd:D,borderInlineStartWidth:I,borderInlineEndWidth:N,borderBlockStartWidth:L,borderBlockEndWidth:F}=$r(u),te=f==="clone",ae=_==="content-box",Ee=ae?parseInt(V)+parseInt(D)+parseInt(I)+parseInt(N):0,ge=ae?parseInt(H)+parseInt(U)+parseInt(L)+parseInt(F):0,X=f!=="move"&&!this.overlay?o5(l,te?"clone":"hidden"):null,De=Ue(()=>pf(i.dragOperation.activatorEvent));if(z!=="none"){const ue=hf(z);ue&&!d.translate&&(d.translate=ue)}if(!d.transformOrigin){const ue=Ue(()=>a.current);d.transformOrigin={x:(ue.x-T*p.scaleX-p.x)/(x*p.scaleX),y:(ue.y-E*p.scaleY-p.y)/(m*p.scaleY)}}const{transformOrigin:Y}=d,re=E*p.scaleY+p.y,pe=T*p.scaleX+p.x;if(!d.coordinates&&(d.coordinates={x:pe,y:re},b.x!==1||b.y!==1)){const{scaleX:ue,scaleY:Ke}=g,{x:ht,y:yt}=Y;d.coordinates.x+=(x*ue-x)*ht,d.coordinates.y+=(m*Ke-m)*yt}d.dimensions||(d.dimensions={width:x,height:m}),d.frameTransform||(d.frameTransform=p);const Z={x:d.coordinates.x-pe,y:d.coordinates.y-re},le={width:(d.dimensions.width*d.frameTransform.scaleX-x*p.scaleX)*Y.x,height:(d.dimensions.height*d.frameTransform.scaleY-m*p.scaleY)*Y.y},ce={x:Z.x/p.scaleX+le.width,y:Z.y/p.scaleY+le.height},Xe={left:T+ce.x,top:E+ce.y};h.setAttribute(Zr,"true");const dt=Ue(()=>s.transform),Zt=(t=d.translate)!=null?t:{x:0,y:0},en=dt.x*p.scaleX+Zt.x,tn=dt.y*p.scaleY+Zt.y,kr=`${en}px ${tn}px 0`,En=k?`${k}, translate 0ms linear`:"";A.set({width:x-Ee,height:m-ge,top:Xe.top,left:Xe.left,translate:kr,transition:En,scale:y?`${b.x} ${b.y}`:"","transform-origin":`${Y.x*100}% ${Y.y*100}%`},on),X&&(u.insertAdjacentElement("afterend",X),o!=null&&o.rootElement&&(typeof o.rootElement=="function"?o.rootElement(l):o.rootElement).appendChild(u)),X0(h)&&(h.hasAttribute("popover")||h.setAttribute("popover","manual"),nu(h),h.addEventListener("beforetoggle",mC));const Cn=new ResizeObserver(()=>{if(!X)return;const ue=new Lr(X,{frameTransform:p,ignoreTransforms:!0}),Ke=Y??{x:1,y:1},ht=(x-ue.width)*Ke.x+ce.x,yt=(m-ue.height)*Ke.y+ce.y;if(A.set({width:ue.width-Ee,height:ue.height-ge,top:E+yt,left:T+ht},on),C==null||C.takeRecords(),gC(u)&&gC(X)){const nn=Array.from(u.cells),zt=Array.from(X.cells);for(const[M,R]of nn.entries()){const P=zt[M];R.style.width=`${P.offsetWidth}px`}}s.shape=new Lr(h)}),fn=new Lr(h);Ue(()=>s.shape=fn);const Dr=so(h),dn=ue=>{this.manager.actions.stop({event:ue})};De&&Dr.addEventListener("resize",dn),Ue(()=>l.status)==="idle"&&requestAnimationFrame(()=>l.status="dragging"),X&&(Cn.observe(X),C=new MutationObserver(ue=>{let Ke=!1;for(const ht of ue){if(ht.target!==u){Ke=!0;continue}if(ht.type!=="attributes")continue;const yt=ht.attributeName;if(yt.startsWith("aria-")||n5.includes(yt))continue;const nn=u.getAttribute(yt);if(yt==="style"){if(Ru(u)&&Ru(X)){const zt=u.style;for(const M of Array.from(X.style))zt.getPropertyValue(M)===""&&X.style.removeProperty(M);for(const M of Array.from(zt)){if(r5.includes(M)||M.startsWith(on))continue;const R=zt.getPropertyValue(M);X.style.setProperty(M,R)}}}else nn!==null?X.setAttribute(yt,nn):X.removeAttribute(yt)}Ke&&te&&(X.innerHTML=u.innerHTML)}),C.observe(u,{attributes:!0,subtree:!0,childList:!0}),O=new MutationObserver(ue=>{for(const Ke of ue)if(Ke.addedNodes.length!==0)for(const ht of Array.from(Ke.addedNodes)){if(ht.contains(u)&&u.nextElementSibling!==X){u.insertAdjacentElement("afterend",X),nu(h);return}if(ht.contains(X)&&X.previousElementSibling!==u){X.insertAdjacentElement("beforebegin",u),nu(h);return}}}),O.observe(u.ownerDocument.body,{childList:!0,subtree:!0}));const Yr=(n=i.dragOperation.source)==null?void 0:n.id,uo=()=>{var ue;if(!De||Yr==null)return;const Ke=i.registry.draggables.get(Yr),ht=(ue=Ke==null?void 0:Ke.handle)!=null?ue:Ke==null?void 0:Ke.element;ua(ht)&&ht.focus()},Gr=()=>{C==null||C.disconnect(),O==null||O.disconnect(),Cn.disconnect(),Dr.removeEventListener("resize",dn),X0(h)&&(h.removeEventListener("beforetoggle",mC),h.removeAttribute("popover")),h.removeAttribute(Zr),A.reset(),l.status="idle";const ue=r.current.translate!=null;X&&(ue||X.parentElement!==h.parentElement)&&h.isConnected&&X.replaceWith(h),X==null||X.remove()},fo=Qf(()=>{var ue;const{transform:Ke,status:ht}=s;if(!(!Ke.x&&!Ke.y&&!r.current.translate)&&ht.dragging){const yt=(ue=d.translate)!=null?ue:{x:0,y:0},nn={x:Ke.x/p.scaleX+yt.x,y:Ke.y/p.scaleY+yt.y},zt=r.current.translate,M=Ue(()=>s.modifiers),R=Ue(()=>{var K;return(K=s.shape)==null?void 0:K.current}),P=De?"250ms cubic-bezier(0.25, 1, 0.5, 1)":"0ms linear";if(A.set({transition:`${k}, translate ${P}`,translate:`${nn.x}px ${nn.y}px 0`},on),C==null||C.takeRecords(),R&&R!==fn&&zt&&!M.length){const K=Kn.delta(nn,zt);s.shape=eo.from(R.boundingRectangle).translate(K.x*p.scaleX,K.y*p.scaleY)}else s.shape=new Lr(h);r.current.translate=nn}},function(){if(s.status.dropped){this.dispose(),l.status="dropping";let ue=r.current.translate;const Ke=ue!=null;if(!ue&&u!==h&&(ue={x:0,y:0}),!ue){Gr();return}const ht=()=>{var yt,nn;{nu(h);const[,zt]=(yt=DD(h,It=>"translate"in It))!=null?yt:[];zt==null||zt.pause();const M=X??u,R={frameTransform:pC(h,M)?null:void 0},P=new Lr(h,R),K=(nn=hf($r(h).translate))!=null?nn:ue,q=new Lr(M,R),we=eo.delta(P,q,l.alignment),Pe={x:K.x-we.x,y:K.y-we.y},hn=Math.round(P.intrinsicHeight)!==Math.round(q.intrinsicHeight)?{minHeight:[`${P.intrinsicHeight}px`,`${q.intrinsicHeight}px`],maxHeight:[`${P.intrinsicHeight}px`,`${q.intrinsicHeight}px`]}:{},ws=Math.round(P.intrinsicWidth)!==Math.round(q.intrinsicWidth)?{minWidth:[`${P.intrinsicWidth}px`,`${q.intrinsicWidth}px`],maxWidth:[`${P.intrinsicWidth}px`,`${q.intrinsicWidth}px`]}:{};A.set({transition:k},on),h.setAttribute(tb,""),C==null||C.takeRecords(),FD({element:h,keyframes:$x(mf(mf({},hn),ws),{translate:[`${K.x}px ${K.y}px 0`,`${Pe.x}px ${Pe.y}px 0`]}),options:{duration:Ke||h!==u?250:0,easing:"ease"}}).then(()=>{h.removeAttribute(tb),zt==null||zt.finish(),Gr(),requestAnimationFrame(uo)})}};i.renderer.rendering.then(ht)}});return()=>{Gr(),fo()}};JD=function(){var e,t,n;const{status:r,source:i,target:o}=this.manager.dragOperation,{nonce:s}=(e=this.options)!=null?e:{};if(r.initializing){const a=pi((t=i==null?void 0:i.element)!=null?t:null),l=pi((n=o==null?void 0:o.element)!=null?n:null),c=new Set([a,l]);for(const u of c){let f=_p.get(u);if(!f){const d=document.createElement("style");d.textContent=i5,s&&d.setAttribute("nonce",s),u.head.prepend(d);const h=new MutationObserver(p=>{for(const g of p)if(g.type==="childList"){const y=Array.from(g.removedNodes);y.length>0&&y.includes(d)&&u.head.prepend(d)}});h.observe(u.head,{childList:!0}),f={cleanup:()=>{h.disconnect(),d.remove()},instances:new Set},_p.set(u,f)}f.instances.add(this)}}};ao(gf,4,"overlay",XD,vf,Vx);Sc(gf,vf);vf.configure=hx(vf);var ZD=vf,Ic=!0,c5=!1,eN,tN,nN,rN,zo,Fx,qx;rN=(nN=[Me],yr.Forward),tN=(eN=[Me],yr.Reverse);var yf=class{constructor(){Jt(this,Fx,Dt(zo,8,this,Ic)),Dt(zo,11,this),Jt(this,qx,Dt(zo,12,this,Ic)),Dt(zo,15,this)}isLocked(e){return e===yr.Idle?!1:e==null?this[yr.Forward]===Ic&&this[yr.Reverse]===Ic:this[e]===Ic}unlock(e){e!==yr.Idle&&(this[e]=c5)}};zo=ed(null);Fx=new WeakMap;qx=new WeakMap;ao(zo,4,rN,nN,yf,Fx);ao(zo,4,tN,eN,yf,qx);Sc(zo,yf);var u5=[yr.Forward,yr.Reverse],vC=class{constructor(){this.x=new yf,this.y=new yf}isLocked(){return this.x.isLocked()&&this.y.isLocked()}},f5=class extends an{constructor(e){super(e);const t=Xf(new vC);let n=null;this.signal=t,Bn(()=>{const{status:r}=e.dragOperation;if(!r.initialized){n=null,t.value=new vC;return}const{delta:i}=e.dragOperation.position;if(n){const o={x:yC(i.x,n.x),y:yC(i.y,n.y)},s=t.peek();mt(()=>{for(const a of H2)for(const l of u5)o[a]===l&&s[a].unlock(l);t.value=s})}n=i})}get current(){return this.signal.peek()}};function yC(e,t){return Math.sign(e-t)}var iN,rb,bf,Kx,go,ib,nd=class extends(rb=ig,iN=[Me],rb){constructor(e){super(e),Jt(this,Kx,Dt(bf,8,this,!1)),Dt(bf,11,this),Jt(this,go),Jt(this,ib,()=>{if(!Vt(this,go))return;const{element:o,by:s}=Vt(this,go);s.y&&(o.scrollTop+=s.y),s.x&&(o.scrollLeft+=s.x)}),this.scroll=o=>{var s;if(this.disabled)return!1;const a=this.getScrollableElements();if(!a)return Hr(this,go,void 0),!1;const{position:l}=this.manager.dragOperation,c=l==null?void 0:l.current;if(c){const{by:u}=o??{},f=u?{x:bC(u.x),y:bC(u.y)}:void 0,d=f?void 0:this.scrollIntentTracker.current;if(d!=null&&d.isLocked())return!1;for(const h of a){const p=uB(h,u);if(p.x||p.y){const{speed:g,direction:y}=wB(h,c,f);if(d)for(const v of H2)d[v].isLocked(y[v])&&(g[v]=0,y[v]=0);if(y.x||y.y){const{x:v,y:b}=u??y,x=v*g.x,m=b*g.y;if(x||m){const E=(s=Vt(this,go))==null?void 0:s.by;if(this.autoScrolling&&E&&(E.x&&!x||E.y&&!m))continue;return Hr(this,go,{element:h,by:{x,y:m}}),Ap.schedule(Vt(this,ib)),!0}}}}}return Hr(this,go,void 0),!1};let t=null,n=null;const r=uf(()=>{const{position:o,source:s}=e.dragOperation;if(!o)return null;const a=jD(pi(s==null?void 0:s.element),o.current);return a&&(t=a),a??t}),i=uf(()=>{const o=r.value,{documentElement:s}=pi(o);if(!o||o===s){const{target:a}=e.dragOperation,l=a==null?void 0:a.element;if(l){const c=Q0(l,{excludeElement:!1});return n=c,c}}if(o){const a=Q0(o,{excludeElement:!1});return this.autoScrolling&&n&&a.size<(n==null?void 0:n.size)?n:(n=a,a)}return n=null,null},qi);this.getScrollableElements=()=>i.value,this.scrollIntentTracker=new f5(e),this.destroy=e.monitor.addEventListener("dragmove",o=>{this.disabled||o.defaultPrevented||!pf(e.dragOperation.activatorEvent)||!o.by||this.scroll({by:o.by})&&o.preventDefault()})}};bf=ed(rb);Kx=new WeakMap;go=new WeakMap;ib=new WeakMap;ao(bf,4,"autoScrolling",iN,nd,Kx);Sc(bf,nd);function bC(e){return e>0?yr.Forward:e<0?yr.Reverse:yr.Idle}var d5=class{constructor(e){this.scheduler=e,this.pending=!1,this.tasks=new Set,this.resolvers=new Set,this.flush=()=>{const{tasks:t,resolvers:n}=this;this.pending=!1,this.tasks=new Set,this.resolvers=new Set;for(const r of t)r();for(const r of n)r()}}schedule(e){return this.tasks.add(e),this.pending||(this.pending=!0,this.scheduler(this.flush)),new Promise(t=>this.resolvers.add(t))}},h5=new d5(e=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(e):e()}),p5=10,oN=class extends an{constructor(e,t){super(e);const n=e.registry.plugins.get(nd);if(!n)throw new Error("AutoScroller plugin depends on Scroller plugin");this.destroy=Bn(()=>{if(this.disabled)return;const{position:r,status:i}=e.dragOperation;if(i.dragging)if(n.scroll()){n.autoScrolling=!0;const s=setInterval(()=>h5.schedule(n.scroll),p5);return()=>{clearInterval(s)}}else n.autoScrolling=!1})}},xC={capture:!0,passive:!0},iu,m5=class extends ig{constructor(e){super(e),Jt(this,iu),this.handleScroll=()=>{Vt(this,iu)==null&&Hr(this,iu,setTimeout(()=>{this.manager.collisionObserver.forceUpdate(!1),Hr(this,iu,void 0)},50))};const{dragOperation:t}=this.manager;this.destroy=Bn(()=>{var n,r,i;if(t.status.dragging){const s=(i=(r=(n=t.source)==null?void 0:n.element)==null?void 0:r.ownerDocument)!=null?i:document;return s.addEventListener("scroll",this.handleScroll,xC),()=>{s.removeEventListener("scroll",this.handleScroll,xC)}}})}};iu=new WeakMap;var g5=class extends an{constructor(e,t){super(e,t),this.manager=e,this.destroy=Bn(()=>{var n;const{dragOperation:r}=this.manager,{nonce:i}=(n=this.options)!=null?n:{};if(r.status.initialized){const o=document.createElement("style");return i&&o.setAttribute("nonce",i),o.textContent="* { user-select: none !important; -webkit-user-select: none !important; }",document.head.appendChild(o),Hv(),document.addEventListener("selectionchange",Hv,{capture:!0}),()=>{document.removeEventListener("selectionchange",Hv,{capture:!0}),o.remove()}}})}};function Hv(){var e;(e=document.getSelection())==null||e.removeAllRanges()}var ou=Object.freeze({offset:10,keyboardCodes:{start:["Space","Enter"],cancel:["Escape"],end:["Space","Enter","Tab"],up:["ArrowUp"],down:["ArrowDown"],left:["ArrowLeft"],right:["ArrowRight"]},shouldActivate(e){var t;const{event:n,source:r}=e,i=(t=r.handle)!=null?t:r.element;return n.target===i}}),Ja,Rp=class extends Fl{constructor(t,n){super(t),this.manager=t,this.options=n,Jt(this,Ja,[]),this.listeners=new zD,this.handleSourceKeyDown=(r,i,o)=>{if(this.disabled||r.defaultPrevented||!Zf(r.target)||i.disabled)return;const{keyboardCodes:s=ou.keyboardCodes,shouldActivate:a=ou.shouldActivate}=o??{};s.start.includes(r.code)&&this.manager.dragOperation.status.idle&&a({event:r,source:i,manager:this.manager})&&this.handleStart(r,i,o)}}bind(t,n=this.options){return Bn(()=>{var i;const o=(i=t.handle)!=null?i:t.element,s=a=>{pf(a)&&this.handleSourceKeyDown(a,t,n)};if(o)return o.addEventListener("keydown",s),()=>{o.removeEventListener("keydown",s)}})}handleStart(t,n,r){const{element:i}=n;if(!i)throw new Error("Source draggable does not have an associated element");t.preventDefault(),t.stopImmediatePropagation(),VD(i);const{center:o}=new Lr(i);if(this.manager.actions.start({event:t,coordinates:{x:o.x,y:o.y},source:n}).signal.aborted)return this.cleanup();this.sideEffects();const a=pi(i),l=[this.listeners.bind(a,[{type:"keydown",listener:c=>this.handleKeyDown(c,n,r),options:{capture:!0}}])];Vt(this,Ja).push(...l)}handleKeyDown(t,n,r){const{keyboardCodes:i=ou.keyboardCodes}=r??{};if(Ba(t,[...i.end,...i.cancel])){t.preventDefault();const o=Ba(t,i.cancel);this.handleEnd(t,o);return}Ba(t,i.up)?this.handleMove("up",t):Ba(t,i.down)&&this.handleMove("down",t),Ba(t,i.left)?this.handleMove("left",t):Ba(t,i.right)&&this.handleMove("right",t)}handleEnd(t,n){this.manager.actions.stop({event:t,canceled:n}),this.cleanup()}handleMove(t,n){var r,i;const{shape:o}=this.manager.dragOperation,s=n.shiftKey?5:1;let a={x:0,y:0},l=(i=(r=this.options)==null?void 0:r.offset)!=null?i:ou.offset;if(typeof l=="number"&&(l={x:l,y:l}),!!o){switch(t){case"up":a={x:0,y:-l.y*s};break;case"down":a={x:0,y:l.y*s};break;case"left":a={x:-l.x*s,y:0};break;case"right":a={x:l.x*s,y:0};break}(a.x||a.y)&&(n.preventDefault(),this.manager.actions.move({event:n,by:a}))}}sideEffects(){const t=this.manager.registry.plugins.get(oN);(t==null?void 0:t.disabled)===!1&&(t.disable(),Vt(this,Ja).push(()=>{t.enable()}))}cleanup(){Vt(this,Ja).forEach(t=>t()),Hr(this,Ja,[])}destroy(){this.cleanup(),this.listeners.clear()}};Ja=new WeakMap;Rp.configure=hx(Rp);Rp.defaults=ou;var Wx=Rp;function Ba(e,t){return t.includes(e.code)}var sN=Object.freeze({activationConstraints(e,t){var n;const{pointerType:r,target:i}=e;if(!(r==="mouse"&&Zf(i)&&(t.handle===i||(n=t.handle)!=null&&n.contains(i))))return r==="touch"?{delay:{value:250,tolerance:5}}:RB(i)&&!e.defaultPrevented?{delay:{value:200,tolerance:0}}:{delay:{value:200,tolerance:10},distance:{value:5}}}}),Za,el,Lp=class extends Fl{constructor(t,n){super(t),this.manager=t,this.options=n,Jt(this,Za,new Set),Jt(this,el),this.listeners=new zD,this.latest={event:void 0,coordinates:void 0},this.handleMove=()=>{const{event:r,coordinates:i}=this.latest;!r||!i||this.manager.actions.move({event:r,to:i})},this.handleCancel=this.handleCancel.bind(this),this.handlePointerUp=this.handlePointerUp.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this)}activationConstraints(t,n){var r;const{activationConstraints:i=sN.activationConstraints}=(r=this.options)!=null?r:{};return typeof i=="function"?i(t,n):i}bind(t,n=this.options){return Bn(()=>{var i;const o=new AbortController,{signal:s}=o,a=c=>{_B(c)&&this.handlePointerDown(c,t,n)};let l=[(i=t.handle)!=null?i:t.element];n!=null&&n.activatorElements&&(Array.isArray(n.activatorElements)?l=n.activatorElements:l=n.activatorElements(t));for(const c of l)c&&(b5(c.ownerDocument.defaultView),c.addEventListener("pointerdown",a,{signal:s}));return()=>o.abort()})}handlePointerDown(t,n,r={}){if(this.disabled||!t.isPrimary||t.button!==0||!Zf(t.target)||n.disabled||v5(t)||!this.manager.dragOperation.status.idle)return;const{target:i}=t,o=ua(i)&&i.draggable&&i.getAttribute("draggable")==="true",s=Kl(n.element);this.initialCoordinates={x:t.clientX*s.scaleX+s.x,y:t.clientY*s.scaleY+s.y};const a=this.activationConstraints(t,n);if(t.sensor=this,!(a!=null&&a.delay)&&!(a!=null&&a.distance))this.handleStart(n,t);else{const{delay:f}=a;if(f){const d=setTimeout(()=>this.handleStart(n,t),f.value);Hr(this,el,()=>{clearTimeout(d),Hr(this,el,void 0)})}}const l=pi(t.target),c=this.listeners.bind(l,[{type:"pointermove",listener:f=>this.handlePointerMove(f,n)},{type:"pointerup",listener:this.handlePointerUp,options:{capture:!0}},{type:"dragstart",listener:o?this.handleCancel:$d,options:{capture:!0}}]),u=()=>{var f;c(),(f=Vt(this,el))==null||f.call(this),this.initialCoordinates=void 0};Vt(this,Za).add(u)}handlePointerMove(t,n){const r={x:t.clientX,y:t.clientY},i=Kl(n.element);if(r.x=r.x*i.scaleX+i.x,r.y=r.y*i.scaleY+i.y,this.manager.dragOperation.status.dragging){t.preventDefault(),t.stopPropagation(),this.latest.event=t,this.latest.coordinates=r,Ap.schedule(this.handleMove);return}if(!this.initialCoordinates)return;const o={x:r.x-this.initialCoordinates.x,y:r.y-this.initialCoordinates.y},s=this.activationConstraints(t,n),{distance:a,delay:l}=s??{};if(a){if(a.tolerance!=null&&Iv(o,a.tolerance))return this.handleCancel(t);if(Iv(o,a.value))return this.handleStart(n,t)}if(l&&Iv(o,l.tolerance))return this.handleCancel(t)}handlePointerUp(t){const{status:n}=this.manager.dragOperation;if(!n.idle){t.preventDefault(),t.stopPropagation();const r=!n.initialized;this.manager.actions.stop({event:t,canceled:r})}this.cleanup()}handleKeyDown(t){t.key==="Escape"&&(t.preventDefault(),this.handleCancel(t))}handleStart(t,n){var r;const{manager:i,initialCoordinates:o}=this;if((r=Vt(this,el))==null||r.call(this),!o||!i.dragOperation.status.idle||n.defaultPrevented)return;if(i.actions.start({coordinates:o,event:n,source:t}).signal.aborted)return this.cleanup();n.preventDefault();const a=pi(n.target),l=a.body;l.setPointerCapture(n.pointerId);const c=this.listeners.bind(a,[{type:"touchmove",listener:$d,options:{passive:!1}},{type:"click",listener:$d},{type:"contextmenu",listener:$d},{type:"keydown",listener:this.handleKeyDown},{type:"lostpointercapture",listener:u=>{u.target===l&&this.handlePointerUp(u)}}]);Vt(this,Za).add(c)}handleCancel(t){const{dragOperation:n}=this.manager;n.status.initialized&&this.manager.actions.stop({event:t,canceled:!0}),this.cleanup()}cleanup(){this.latest={event:void 0,coordinates:void 0},Vt(this,Za).forEach(t=>t()),Vt(this,Za).clear()}destroy(){this.cleanup(),this.listeners.clear()}};Za=new WeakMap;el=new WeakMap;Lp.configure=hx(Lp);Lp.defaults=sN;var Yx=Lp;function v5(e){return"sensor"in e}function $d(e){e.preventDefault()}function y5(){}var SC=new WeakSet;function b5(e){!e||SC.has(e)||(e.addEventListener("touchmove",y5,{capture:!1,passive:!1}),SC.add(e))}var Lu={modifiers:[],plugins:[ZB,oN,t5,ZD,g5],sensors:[Yx,Wx]},aN=class extends YP{constructor(e={}){const{plugins:t=Lu.plugins,sensors:n=Lu.sensors,modifiers:r=[]}=e;super($x(mf({},e),{plugins:[m5,nd,...t],sensors:n,modifiers:r}))}},lN,cN,uN,ob,jr,Gx,Xx,Qx,wc=class extends(ob=di,uN=[Me],cN=[Me],lN=[Me],ob){constructor(e,t){var n=e,{element:r,effects:i=()=>[],handle:o,feedback:s="default"}=n,a=YD(n,["element","effects","handle","feedback"]);super(mf({effects:()=>[...i(),()=>{var l,c;const{manager:u}=this;if(!u)return;const d=((c=(l=this.sensors)==null?void 0:l.map(px))!=null?c:[...u.sensors]).map(h=>{const p=h instanceof Fl?h:u.registry.register(h.plugin),g=h instanceof Fl?void 0:h.options;return p.bind(this,g)});return function(){d.forEach(p=>p())}}]},a),t),Jt(this,Gx,Dt(jr,8,this)),Dt(jr,11,this),Jt(this,Xx,Dt(jr,12,this)),Dt(jr,15,this),Jt(this,Qx,Dt(jr,16,this)),Dt(jr,19,this),this.element=r,this.handle=o,this.feedback=s}};jr=ed(ob);Gx=new WeakMap;Xx=new WeakMap;Qx=new WeakMap;ao(jr,4,"handle",uN,wc,Gx);ao(jr,4,"element",cN,wc,Xx);ao(jr,4,"feedback",lN,wc,Qx);Sc(jr,wc);var fN,dN,sb,Io,Jx,$v,hN,pN,ju,Zx,ag=class extends(sb=hi,dN=[Me],fN=[Me],sb){constructor(e,t){var n=e,{element:r,effects:i=()=>[]}=n,o=YD(n,["element","effects"]);const{collisionDetector:s=Bx}=o,a=c=>{const{manager:u,element:f}=this;if(!f||c===null){this.shape=void 0;return}if(!u)return;const d=new Lr(f),h=Ue(()=>this.shape);return d&&(h!=null&&h.equals(d))?h:(this.shape=d,d)},l=Xf(!1);super($x(mf({},o),{collisionDetector:s,effects:()=>[...i(),()=>{const{element:c,manager:u}=this;if(!u)return;const{dragOperation:f}=u,{source:d}=f;l.value=!!(d&&f.status.initialized&&c&&!this.disabled&&this.accepts(d))},()=>{const{element:c}=this;if(l.value&&c){const u=new cB(c,a);return()=>{u.disconnect(),this.shape=void 0}}},()=>{var c;if((c=this.manager)!=null&&c.dragOperation.status.initialized)return()=>{this.shape=void 0}}]}),t),Jt(this,ju),Jt(this,Jx,Dt(Io,8,this)),Dt(Io,11,this),Jt(this,Zx,Dt(Io,12,this)),Dt(Io,15,this),this.element=r,this.refreshShape=()=>a()}set element(e){Hr(this,ju,e,pN)}get element(){var e;return(e=this.proxy)!=null?e:Vt(this,ju,hN)}};Io=ed(sb);Jx=new WeakMap;ju=new WeakSet;Zx=new WeakMap;$v=ao(Io,20,"#element",dN,ju,Jx),hN=$v.get,pN=$v.set;ao(Io,4,"proxy",fN,ag,Zx);Sc(Io,ag);function x5(e){return e!=null&&typeof e=="object"&&"current"in e}function Qo(e){var t;if(e!=null)return x5(e)?(t=e.current)!=null?t:void 0:e}var S5=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",_a=S5?S.useLayoutEffect:S.useEffect;function mN(){const e=S.useState(0)[1];return S.useCallback(()=>{e(t=>t+1)},[e])}function w5(e,t=!1){const n=S.useRef(e.peek()),r=S.useRef(!1),i=mN();return _a(()=>Bn(()=>{const o=n.current,s=e.value;if(o!==s){if(n.current=s,!r.current)return;t?ke.flushSync(i):i()}}),[e,t,i]),{get value(){return r.current=!0,e.peek()}}}function E5(e,t=[],n=!1){const r=S.useRef(e);return r.current=e,w5(S.useMemo(()=>uf(()=>r.current()),t),n)}function lg(e,t){const n=S.useRef(new Map),r=mN();return _a(()=>{if(!e){n.current.clear();return}return Bn(()=>{var i;let o=!1,s=!1;for(const a of n.current){const[l]=a,c=Ue(()=>a[1]),u=e[l];c!==u&&(o=!0,n.current.set(l,u),s=(i=t==null?void 0:t(l,c,u))!=null?i:!1)}o&&(s?ke.flushSync(r):r())})},[e]),S.useMemo(()=>e&&new Proxy(e,{get(i,o){const s=i[o];return n.current.set(o,s),s}}),[e])}function C5(e,t){e()}function Ha(e){const t=S.useRef(e);return _a(()=>{t.current=e},[e]),t}function je(e,t,n=S.useEffect,r=Object.is){const i=S.useRef(e);n(()=>{const o=i.current;r(e,o)||(i.current=e,t(e,o))},[t,e])}function Al(e,t){const n=S.useRef(Qo(e));_a(()=>{const r=Qo(e);r!==n.current&&(n.current=r,t(r))})}var T5=Object.defineProperty,M5=Object.defineProperties,O5=Object.getOwnPropertyDescriptors,jp=Object.getOwnPropertySymbols,gN=Object.prototype.hasOwnProperty,vN=Object.prototype.propertyIsEnumerable,wC=(e,t,n)=>t in e?T5(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,yN=(e,t)=>{for(var n in t||(t={}))gN.call(t,n)&&wC(e,n,t[n]);if(jp)for(var n of jp(t))vN.call(t,n)&&wC(e,n,t[n]);return e},bN=(e,t)=>M5(e,O5(t)),A5=(e,t)=>{var n={};for(var r in e)gN.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&jp)for(var r of jp(e))t.indexOf(r)<0&&vN.call(e,r)&&(n[r]=e[r]);return n},k5=new aN,eS=S.createContext(k5),D5=S.memo(S.forwardRef(({children:e},t)=>{const[n,r]=S.useState(0),i=S.useRef(null),o=S.useRef(null),s=S.useMemo(()=>({renderer:{get rendering(){var a;return(a=i.current)!=null?a:Promise.resolve()}},trackRendering(a){i.current||(i.current=new Promise(l=>{o.current=l})),S.startTransition(()=>{a(),r(l=>l+1)})}}),[]);return _a(()=>{var a;(a=o.current)==null||a.call(o),i.current=null},[e,n]),S.useImperativeHandle(t,()=>s),null})),Uv=[void 0,qi];function xN(e){var t=e,{children:n,onCollision:r,onBeforeDragStart:i,onDragStart:o,onDragMove:s,onDragOver:a,onDragEnd:l}=t,c=A5(t,["children","onCollision","onBeforeDragStart","onDragStart","onDragMove","onDragOver","onDragEnd"]),u;const f=S.useRef(null),[d,h]=S.useState((u=c.manager)!=null?u:null),{plugins:p,modifiers:g,sensors:y}=c,v=Ha(i),b=Ha(o),x=Ha(a),m=Ha(s),E=Ha(l),T=Ha(r);return S.useEffect(()=>{var C;if(!f.current)throw new Error("Renderer not found");const{renderer:O,trackRendering:A}=f.current,k=(C=c.manager)!=null?C:new aN(c);return k.renderer=O,k.monitor.addEventListener("beforedragstart",z=>{const _=v.current;_&&A(()=>_(z,k))}),k.monitor.addEventListener("dragstart",z=>{var _;return(_=b.current)==null?void 0:_.call(b,z,k)}),k.monitor.addEventListener("dragover",z=>{const _=x.current;_&&A(()=>_(z,k))}),k.monitor.addEventListener("dragmove",z=>{const _=m.current;_&&A(()=>_(z,k))}),k.monitor.addEventListener("dragend",z=>{const _=E.current;_&&A(()=>_(z,k))}),k.monitor.addEventListener("collision",z=>{var _;return(_=T.current)==null?void 0:_.call(T,z,k)}),S.startTransition(()=>h(k)),k.destroy},[c.manager]),je(p,()=>d&&(d.plugins=p??Lu.plugins),...Uv),je(y,()=>d&&(d.sensors=y??Lu.sensors),...Uv),je(g,()=>d&&(d.modifiers=g??Lu.modifiers),...Uv),w.jsxs(eS.Provider,{value:d,children:[w.jsx(D5,{ref:f,children:n}),n]})}function SN(){return S.useContext(eS)}function tS(e){var t;const n=(t=SN())!=null?t:void 0,[r]=S.useState(()=>e(n));return r.manager!==n&&(r.manager=n),_a(r.register,[n,r]),r}function N5(e){const{disabled:t,data:n,element:r,handle:i,id:o,modifiers:s,sensors:a}=e,l=tS(u=>new wc(bN(yN({},e),{register:!1,handle:Qo(i),element:Qo(r)}),u)),c=lg(l,_5);return je(o,()=>l.id=o),Al(i,u=>l.handle=u),Al(r,u=>l.element=u),je(n,()=>n&&(l.data=n)),je(t,()=>l.disabled=t===!0),je(a,()=>l.sensors=a),je(s,()=>l.modifiers=s,void 0,qi),je(e.feedback,()=>{var u;return l.feedback=(u=e.feedback)!=null?u:"default"}),je(e.alignment,()=>l.alignment=e.alignment),{draggable:c,get isDragging(){return c.isDragging},get isDropping(){return c.isDropping},get isDragSource(){return c.isDragSource},handleRef:S.useCallback(u=>{l.handle=u??void 0},[l]),ref:S.useCallback(u=>{var f,d;!u&&((f=l.element)!=null&&f.isConnected)&&!((d=l.manager)!=null&&d.dragOperation.status.idle)||(l.element=u??void 0)},[l])}}function _5(e,t,n){return!!(e==="isDragSource"&&!n&&t)}function R5({children:e,className:t,style:n,tag:r,disabled:i}){var o;const s=S.useRef(null),a=SN(),l=(o=E5(()=>a==null?void 0:a.dragOperation.source,[a]).value)!=null?o:null,c=typeof i=="function"?i(l):i;S.useEffect(()=>{if(!s.current||!a||c)return;const d=a.plugins.find(h=>h instanceof ZD);if(d)return d.overlay=s.current,()=>{d.overlay=void 0}},[a,c]);const u=S.useMemo(()=>{if(!a)return null;const d=new Proxy(a.registry,{get(h,p){return p==="register"||p==="unregister"?L5:h[p]}});return new Proxy(a,{get(h,p){return p==="registry"?d:h[p]}})},[a]);return w.jsx(eS.Provider,{value:u,children:S.createElement(r||"div",{ref:s,className:t,style:n,"data-dnd-overlay":!0},f())});function f(){return!l||c?null:typeof e=="function"?w.jsx(j5,{source:l,children:e}):e}}function L5(){return()=>{}}function j5({children:e,source:t}){return e(lg(t))}var z5=Object.create,wN=Object.defineProperty,I5=Object.getOwnPropertyDescriptor,EN=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),cg=e=>{throw TypeError(e)},P5=(e,t,n)=>t in e?wN(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,B5=e=>{var t;return[,,,z5((t=e==null?void 0:e[EN("metadata")])!=null?t:null)]},CN=["class","method","getter","setter","accessor","field","value","get","set"],TN=e=>e!==void 0&&typeof e!="function"?cg("Function expected"):e,H5=(e,t,n,r,i)=>({kind:CN[e],name:t,metadata:r,addInitializer:o=>n._?cg("Already initialized"):i.push(TN(o||null))}),$5=(e,t)=>P5(t,EN("metadata"),e[3]),U5=(e,t,n,r)=>{for(var i=0,o=e[t>>1],s=o&&o.length;i<s;i++)o[i].call(n);return r},MN=(e,t,n,r,i,o)=>{for(var s,a,l,c,u=t&7,f=!1,d=!1,h=2,p=CN[u+5],g=e[h]||(e[h]=[]),y=(i=i.prototype,I5(i,n)),v=r.length-1;v>=0;v--)l=H5(u,n,a={},e[3],g),l.static=f,l.private=d,c=l.access={has:b=>n in b},c.get=b=>b[n],s=(0,r[v])(y[p],l),a._=1,TN(s)&&(y[p]=s);return y&&wN(i,n,y),i},ON=(e,t,n)=>t.has(e)||cg("Cannot "+n),V5=(e,t,n)=>(ON(e,t,"read from private field"),t.get(e)),F5=(e,t,n)=>t.has(e)?cg("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),q5=(e,t,n,r)=>(ON(e,t,"write to private field"),t.set(e,n),n),$s=class ab{constructor(t,n){this.x=t,this.y=n}static delta(t,n){return new ab(t.x-n.x,t.y-n.y)}static distance(t,n){return Math.hypot(t.x-n.x,t.y-n.y)}static equals(t,n){return t.x===n.x&&t.y===n.y}static from({x:t,y:n}){return new ab(t,n)}},AN,kN,lb,Ih,rd,nS=class extends(lb=Aa,kN=[kt],AN=[kt],lb){constructor(e){const t=$s.from(e);super(t,(n,r)=>$s.equals(n,r)),U5(rd,5,this),F5(this,Ih,0),this.velocity={x:0,y:0}}get delta(){return $s.delta(this.current,this.initial)}get direction(){const{current:e,previous:t}=this;if(!t)return null;const n={x:e.x-t.x,y:e.y-t.y};return!n.x&&!n.y?null:Math.abs(n.x)>Math.abs(n.y)?n.x>0?"right":"left":n.y>0?"down":"up"}get current(){return super.current}set current(e){const{current:t}=this,n=$s.from(e),r={x:n.x-t.x,y:n.y-t.y},i=Date.now(),o=i-V5(this,Ih),s=a=>Math.round(a/o*100);mt(()=>{q5(this,Ih,i),this.velocity={x:s(r.x),y:s(r.y)},super.current=n})}reset(e=this.defaultValue){super.reset($s.from(e)),this.velocity={x:0,y:0}}};rd=B5(lb);Ih=new WeakMap;MN(rd,2,"delta",kN,nS);MN(rd,2,"direction",AN,nS);$5(rd,nS);var DN=(e=>(e.Horizontal="x",e.Vertical="y",e))(DN||{});Object.values(DN);var K5=({dragOperation:e,droppable:t})=>{const n=e.position.current;if(!n)return null;const{id:r}=t;if(!t.shape)return null;if(t.shape.containsPoint(n)){const i=$s.distance(t.shape.center,n);return{id:r,value:1/i,type:Na.PointerIntersection,priority:Da.High}}return null},W5=({dragOperation:e,droppable:t})=>{const{shape:n}=e;if(!t.shape||!(n!=null&&n.current))return null;const r=n.current.intersectionArea(t.shape);if(r){const{position:i}=e,o=$s.distance(t.shape.center,i.current),a=r/(n.current.area+t.shape.area-r)/o;return{id:t.id,value:a,type:Na.ShapeIntersection,priority:Da.Normal}}return null},Y5=e=>{var t;return(t=K5(e))!=null?t:W5(e)};function NN(e){const{collisionDetector:t,data:n,disabled:r,element:i,id:o,accept:s,type:a}=e,l=tS(u=>new ag(bN(yN({},e),{register:!1,element:Qo(i)}),u)),c=lg(l);return je(o,()=>l.id=o),Al(i,u=>l.element=u),je(s,()=>l.accept=s,void 0,qi),je(t,()=>l.collisionDetector=t??Y5),je(n,()=>n&&(l.data=n)),je(r,()=>l.disabled=r===!0),je(a,()=>l.type=a),{droppable:c,get isDropTarget(){return c.isDropTarget},ref:S.useCallback(u=>{var f,d;!u&&((f=l.element)!=null&&f.isConnected)&&!((d=l.manager)!=null&&d.dragOperation.status.idle)||(l.element=u??void 0)},[l])}}function Te(...e){return e.flat().filter(t=>typeof t=="string").join(" ")}function ug(){const e=S.useRef(null);function t(r){var a;if(!(r.detail>0)){e.current=((a=r.currentTarget.textContent)==null?void 0:a.length)||0;return}const o=document.caretPositionFromPoint?document.caretPositionFromPoint(r.clientX,r.clientY):null,s=document.caretRangeFromPoint?document.caretRangeFromPoint(r.clientX,r.clientY):null;if(o||s){const l=document.createRange();l.selectNodeContents(r.currentTarget);const c=o?o.offsetNode:s==null?void 0:s.startContainer,u=o?o.offset:s==null?void 0:s.startOffset;c!=null&&u!=null&&l.setEnd(c,u),e.current=l.toString().length}}function n(r){e.current!==null&&(r.target.setSelectionRange(e.current,e.current),e.current=null)}return{handleClick:t,handleFocus:n}}function Wl(e,t){const n=Array.isArray(t)?t:[t];return[...e].sort((r,i)=>{for(const o of n){const s=r[o],a=i[o];if(s<a)return-1;if(s>a)return 1}return 0})}function _N({children:e}){const[t,n]=S.useState(!1);return S.useEffect(()=>{n(!0)},[]),t?ke.createPortal(w.jsx(R5,{children:e}),document.body):null}function RN({tasksBeforeDrag:e,draggingTask:t}){const n=new Map(e.map(r=>[r.id,r]));return t&&n.set(t.id,t),Wl(Array.from(n.values()),["layerId","sorting"])}function LN(e,t){const n=e.find(({id:r})=>r===t);if(!n)throw new Error("Layer not found");return n}function G5(e,t){const n=e.filter(i=>i.sliceId===t),r=n[n.length-1];if(!r)throw new Error("Last layer not found");return r}function X5(e,t,n){const r=e.filter(i=>i.layerId===t&&i.id!==n);return r.length>0?r[r.length-1].sorting+1:1}function Q5(e,t,n){const r=e.filter(o=>o.layerId===t&&o.id!==n);return r.length===0?1:Math.min(...r.map(o=>o.sorting))/2}function J5(e,t,n){const r=e.filter(l=>l.layerId===t.layerId&&l.id!==n.id),i=t.sorting>n.sorting,o=r.findIndex(({id:l})=>l===t.id),s=r[o-1],a=r[o+1];return i?a?t.sorting+(a.sorting-t.sorting)/2:r.length>0?r[r.length-1].sorting+1:1:s?s.sorting+(t.sorting-s.sorting)/2:t.sorting/2}function Z5(e,t,n,r){return i=>{if(!e)return;const o=G5(n,i.sliceId),s=X5(r,o.id,e.id);t({...e,sliceId:o.sliceId,layerId:o.id,sorting:s})}}function eH(e,t,n,r){return i=>{if(!e||i.task.id===e.id)return;const o=LN(n,i.task.layerId),s=J5(r,i.task,e);t({...e,sliceId:o.sliceId,layerId:o.id,sorting:s})}}function tH(e,t,n){return r=>{if(!e)return;const i=r.layer,o=Q5(n,i.id,e.id);t({...e,sliceId:i.sliceId,layerId:i.id,sorting:o})}}function nH(e,t,n,r){const i=Z5(e,t,n,r),o=tH(e,t,r),s=eH(e,t,n,r);return a=>{if(a.elementType==="droppableSlice"){i(a);return}if(a.elementType==="sortableLayer"){o(a);return}s(a)}}function rH({slices:e,draggingSlice:t,overSliceId:n,setOverSliceId:r}){return i=>{if(t&&i.elementType==="droppableSlice"&&i.sliceId&&i.sliceId!==t.id){if(i.sliceId===n){const o=e.findIndex(({id:x})=>x===t.id),s=e.findIndex(({id:x})=>x===n);if(o===-1||s===-1)return;const a=Math.floor(o/3),l=o%3,c=Math.floor(s/3),u=s%3,f=c-a,d=u-l,h=c+Math.sign(f),p=u+Math.sign(d),g=Math.floor((t.boxNumber-1)/3),y=(t.boxNumber-1)%3;if(h===g&&p===y){r(void 0);return}if(h<0||h>2||p<0||p>2){if(c===g&&u===y){r(void 0);return}const x=e[s],m=Math.floor((x.boxNumber-1)/3),E=(x.boxNumber-1)%3,T=m+Math.sign(f),C=E+Math.sign(d);if(T>=0&&T<=2&&C>=0&&C<=2){const O=T*3+C+1,A=e.find(k=>k.boxNumber===O);if(A&&A.id!==t.id){r(A.id);return}}return}const v=h*3+p,b=e[v];b&&b.id!==t.id&&r(b.id);return}r(i.sliceId)}}}function iH(e,t){const n=document.querySelector(`#${t}-${e}`);return n==null?void 0:n.offsetHeight}function oH(e){return e.length>0?e[e.length-1].sorting+1:1}function id(e){return w.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:350,height:316.47,viewBox:"0 0 349.998 316.472",...e,children:w.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M350 30.638c-1.206 16.571-7.785 33.329-23.315 49.27l-2.392 2.393-136 140.59c-29.532 28.75-53.44 52.919-73.773 69.194-21.265 15.715-34.673 24.392-43.015 24.392-9.049 0-19.735-4.06-32.809-12.216-13.517-9.086-21.45-16.609-25.248-25.25-4.022-8.38-6.33-22.532-9.198-45.918C1.23 208.924.004 184.307.004 156.973c0-15.082 6.295-28.563 18.919-41.187 12.513-12.774 26.554-18.957 41.82-18.957 14.116-.014 23.166 13.11 25.959 39.363 0 2.348.465 5.362.639 6.816 1.813 19.7 5.102 34.336 8.154 42.306 2.28 7.038 7.262 11.992 12.587 11.992 2.121 0 6.255-2.35 12.254-7.04 5.622-4.88 13.218-11.172 21.598-19.328l139.65-136.15c10.984-11.878 22.232-20.11 31.467-25.956 9.162-6.367 17.056-8.826 23.536-8.826 4.358-.014 8.268 1.78 10.354 5.4 1.87 3.016 3.054 9.645 3.054 18.135v7.114",clipRule:"evenodd"})})}const Yl=S.forwardRef(({className:e,...t},n)=>w.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 25 25",ref:n,className:Te("-ml-1 h-5 w-5 shrink-0 cursor-move rounded border-2 border-transparent text-base-content/70 focus:border-neutral-content focus:outline-hidden active:border-transparent",e),...t,children:w.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M9.5 8a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Zm0 6a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Zm1.5 4.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0ZM15.5 8a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Zm1.5 4.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0ZM15.5 20a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z",clipRule:"evenodd"})}));/**
108
+ * @license lucide-react v0.483.0 - ISC
109
+ *
110
+ * This source code is licensed under the ISC license.
111
+ * See the LICENSE file in the root directory of this source tree.
112
+ */const sH=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),jN=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
113
+ * @license lucide-react v0.483.0 - ISC
114
+ *
115
+ * This source code is licensed under the ISC license.
116
+ * See the LICENSE file in the root directory of this source tree.
117
+ */var aH={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
118
+ * @license lucide-react v0.483.0 - ISC
119
+ *
120
+ * This source code is licensed under the ISC license.
121
+ * See the LICENSE file in the root directory of this source tree.
122
+ */const lH=S.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:o,iconNode:s,...a},l)=>S.createElement("svg",{ref:l,...aH,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:jN("lucide",i),...a},[...s.map(([c,u])=>S.createElement(c,u)),...Array.isArray(o)?o:[o]]));/**
123
+ * @license lucide-react v0.483.0 - ISC
124
+ *
125
+ * This source code is licensed under the ISC license.
126
+ * See the LICENSE file in the root directory of this source tree.
127
+ */const Ae=(e,t)=>{const n=S.forwardRef(({className:r,...i},o)=>S.createElement(lH,{ref:o,iconNode:t,className:jN(`lucide-${sH(e)}`,r),...i}));return n.displayName=`${e}`,n};/**
128
+ * @license lucide-react v0.483.0 - ISC
129
+ *
130
+ * This source code is licensed under the ISC license.
131
+ * See the LICENSE file in the root directory of this source tree.
132
+ */const cH=[["path",{d:"M17 12H7",key:"16if0g"}],["path",{d:"M19 18H5",key:"18s9l3"}],["path",{d:"M21 6H3",key:"1jwq7v"}]],uH=Ae("AlignCenter",cH);/**
133
+ * @license lucide-react v0.483.0 - ISC
134
+ *
135
+ * This source code is licensed under the ISC license.
136
+ * See the LICENSE file in the root directory of this source tree.
137
+ */const fH=[["path",{d:"M3 12h18",key:"1i2n21"}],["path",{d:"M3 18h18",key:"1h113x"}],["path",{d:"M3 6h18",key:"d0wm0j"}]],dH=Ae("AlignJustify",fH);/**
138
+ * @license lucide-react v0.483.0 - ISC
139
+ *
140
+ * This source code is licensed under the ISC license.
141
+ * See the LICENSE file in the root directory of this source tree.
142
+ */const hH=[["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M17 18H3",key:"1amg6g"}],["path",{d:"M21 6H3",key:"1jwq7v"}]],pH=Ae("AlignLeft",hH);/**
143
+ * @license lucide-react v0.483.0 - ISC
144
+ *
145
+ * This source code is licensed under the ISC license.
146
+ * See the LICENSE file in the root directory of this source tree.
147
+ */const mH=[["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M21 18H7",key:"1ygte8"}],["path",{d:"M21 6H3",key:"1jwq7v"}]],gH=Ae("AlignRight",mH);/**
148
+ * @license lucide-react v0.483.0 - ISC
149
+ *
150
+ * This source code is licensed under the ISC license.
151
+ * See the LICENSE file in the root directory of this source tree.
152
+ */const vH=[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]],yH=Ae("Bold",vH);/**
153
+ * @license lucide-react v0.483.0 - ISC
154
+ *
155
+ * This source code is licensed under the ISC license.
156
+ * See the LICENSE file in the root directory of this source tree.
157
+ */const bH=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],xH=Ae("ChevronDown",bH);/**
158
+ * @license lucide-react v0.483.0 - ISC
159
+ *
160
+ * This source code is licensed under the ISC license.
161
+ * See the LICENSE file in the root directory of this source tree.
162
+ */const SH=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],EC=Ae("ChevronRight",SH);/**
163
+ * @license lucide-react v0.483.0 - ISC
164
+ *
165
+ * This source code is licensed under the ISC license.
166
+ * See the LICENSE file in the root directory of this source tree.
167
+ */const wH=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}]],EH=Ae("Clipboard",wH);/**
168
+ * @license lucide-react v0.483.0 - ISC
169
+ *
170
+ * This source code is licensed under the ISC license.
171
+ * See the LICENSE file in the root directory of this source tree.
172
+ */const CH=[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]],TH=Ae("Code",CH);/**
173
+ * @license lucide-react v0.483.0 - ISC
174
+ *
175
+ * This source code is licensed under the ISC license.
176
+ * See the LICENSE file in the root directory of this source tree.
177
+ */const MH=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],OH=Ae("Copy",MH);/**
178
+ * @license lucide-react v0.483.0 - ISC
179
+ *
180
+ * This source code is licensed under the ISC license.
181
+ * See the LICENSE file in the root directory of this source tree.
182
+ */const AH=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],zN=Ae("EllipsisVertical",AH);/**
183
+ * @license lucide-react v0.483.0 - ISC
184
+ *
185
+ * This source code is licensed under the ISC license.
186
+ * See the LICENSE file in the root directory of this source tree.
187
+ */const kH=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],DH=Ae("Ellipsis",kH);/**
188
+ * @license lucide-react v0.483.0 - ISC
189
+ *
190
+ * This source code is licensed under the ISC license.
191
+ * See the LICENSE file in the root directory of this source tree.
192
+ */const NH=[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"m17 12 3-2v8",key:"1hhhft"}]],_H=Ae("Heading1",NH);/**
193
+ * @license lucide-react v0.483.0 - ISC
194
+ *
195
+ * This source code is licensed under the ISC license.
196
+ * See the LICENSE file in the root directory of this source tree.
197
+ */const RH=[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1",key:"9jr5yi"}]],LH=Ae("Heading2",RH);/**
198
+ * @license lucide-react v0.483.0 - ISC
199
+ *
200
+ * This source code is licensed under the ISC license.
201
+ * See the LICENSE file in the root directory of this source tree.
202
+ */const jH=[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2",key:"68ncm8"}],["path",{d:"M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2",key:"1ejuhz"}]],zH=Ae("Heading3",jH);/**
203
+ * @license lucide-react v0.483.0 - ISC
204
+ *
205
+ * This source code is licensed under the ISC license.
206
+ * See the LICENSE file in the root directory of this source tree.
207
+ */const IH=[["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17 10v3a1 1 0 0 0 1 1h3",key:"tj5zdr"}],["path",{d:"M21 10v8",key:"1kdml4"}],["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}]],PH=Ae("Heading4",IH);/**
208
+ * @license lucide-react v0.483.0 - ISC
209
+ *
210
+ * This source code is licensed under the ISC license.
211
+ * See the LICENSE file in the root directory of this source tree.
212
+ */const BH=[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["circle",{cx:"19",cy:"16",r:"2",key:"15mx69"}],["path",{d:"M20 10c-2 2-3 3.5-3 6",key:"f35dl0"}]],HH=Ae("Heading6",BH);/**
213
+ * @license lucide-react v0.483.0 - ISC
214
+ *
215
+ * This source code is licensed under the ISC license.
216
+ * See the LICENSE file in the root directory of this source tree.
217
+ */const $H=[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17 13v-3h4",key:"1nvgqp"}],["path",{d:"M17 17.7c.4.2.8.3 1.3.3 1.5 0 2.7-1.1 2.7-2.5S19.8 13 18.3 13H17",key:"2nebdn"}]],UH=Ae("Heading5",$H);/**
218
+ * @license lucide-react v0.483.0 - ISC
219
+ *
220
+ * This source code is licensed under the ISC license.
221
+ * See the LICENSE file in the root directory of this source tree.
222
+ */const VH=[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]],FH=Ae("Italic",VH);/**
223
+ * @license lucide-react v0.483.0 - ISC
224
+ *
225
+ * This source code is licensed under the ISC license.
226
+ * See the LICENSE file in the root directory of this source tree.
227
+ */const qH=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],KH=Ae("Link",qH);/**
228
+ * @license lucide-react v0.483.0 - ISC
229
+ *
230
+ * This source code is licensed under the ISC license.
231
+ * See the LICENSE file in the root directory of this source tree.
232
+ */const WH=[["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]],YH=Ae("ListOrdered",WH);/**
233
+ * @license lucide-react v0.483.0 - ISC
234
+ *
235
+ * This source code is licensed under the ISC license.
236
+ * See the LICENSE file in the root directory of this source tree.
237
+ */const GH=[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]],XH=Ae("List",GH);/**
238
+ * @license lucide-react v0.483.0 - ISC
239
+ *
240
+ * This source code is licensed under the ISC license.
241
+ * See the LICENSE file in the root directory of this source tree.
242
+ */const QH=[["path",{d:"M5 12h14",key:"1ays0h"}]],JH=Ae("Minus",QH);/**
243
+ * @license lucide-react v0.483.0 - ISC
244
+ *
245
+ * This source code is licensed under the ISC license.
246
+ * See the LICENSE file in the root directory of this source tree.
247
+ */const ZH=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],e$=Ae("Pen",ZH);/**
248
+ * @license lucide-react v0.483.0 - ISC
249
+ *
250
+ * This source code is licensed under the ISC license.
251
+ * See the LICENSE file in the root directory of this source tree.
252
+ */const t$=[["path",{d:"M13 4v16",key:"8vvj80"}],["path",{d:"M17 4v16",key:"7dpous"}],["path",{d:"M19 4H9.5a4.5 4.5 0 0 0 0 9H13",key:"sh4n9v"}]],n$=Ae("Pilcrow",t$);/**
253
+ * @license lucide-react v0.483.0 - ISC
254
+ *
255
+ * This source code is licensed under the ISC license.
256
+ * See the LICENSE file in the root directory of this source tree.
257
+ */const r$=[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]],i$=Ae("Quote",r$);/**
258
+ * @license lucide-react v0.483.0 - ISC
259
+ *
260
+ * This source code is licensed under the ISC license.
261
+ * See the LICENSE file in the root directory of this source tree.
262
+ */const o$=[["path",{d:"M4 7V4h16v3",key:"9msm58"}],["path",{d:"M5 20h6",key:"1h6pxn"}],["path",{d:"M13 4 8 20",key:"kqq6aj"}],["path",{d:"m15 15 5 5",key:"me55sn"}],["path",{d:"m20 15-5 5",key:"11p7ol"}]],s$=Ae("RemoveFormatting",o$);/**
263
+ * @license lucide-react v0.483.0 - ISC
264
+ *
265
+ * This source code is licensed under the ISC license.
266
+ * See the LICENSE file in the root directory of this source tree.
267
+ */const a$=[["path",{d:"M16 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8Z",key:"qazsjp"}],["path",{d:"M15 3v4a2 2 0 0 0 2 2h4",key:"40519r"}]],CC=Ae("StickyNote",a$);/**
268
+ * @license lucide-react v0.483.0 - ISC
269
+ *
270
+ * This source code is licensed under the ISC license.
271
+ * See the LICENSE file in the root directory of this source tree.
272
+ */const l$=[["path",{d:"M16 4H9a3 3 0 0 0-2.83 4",key:"43sutm"}],["path",{d:"M14 12a4 4 0 0 1 0 8H6",key:"nlfj13"}],["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}]],c$=Ae("Strikethrough",l$);/**
273
+ * @license lucide-react v0.483.0 - ISC
274
+ *
275
+ * This source code is licensed under the ISC license.
276
+ * See the LICENSE file in the root directory of this source tree.
277
+ */const u$=[["path",{d:"m4 5 8 8",key:"1eunvl"}],["path",{d:"m12 5-8 8",key:"1ah0jp"}],["path",{d:"M20 19h-4c0-1.5.44-2 1.5-2.5S20 15.33 20 14c0-.47-.17-.93-.48-1.29a2.11 2.11 0 0 0-2.62-.44c-.42.24-.74.62-.9 1.07",key:"e8ta8j"}]],f$=Ae("Subscript",u$);/**
278
+ * @license lucide-react v0.483.0 - ISC
279
+ *
280
+ * This source code is licensed under the ISC license.
281
+ * See the LICENSE file in the root directory of this source tree.
282
+ */const d$=[["path",{d:"m4 19 8-8",key:"hr47gm"}],["path",{d:"m12 19-8-8",key:"1dhhmo"}],["path",{d:"M20 12h-4c0-1.5.442-2 1.5-2.5S20 8.334 20 7.002c0-.472-.17-.93-.484-1.29a2.105 2.105 0 0 0-2.617-.436c-.42.239-.738.614-.899 1.06",key:"1dfcux"}]],h$=Ae("Superscript",d$);/**
283
+ * @license lucide-react v0.483.0 - ISC
284
+ *
285
+ * This source code is licensed under the ISC license.
286
+ * See the LICENSE file in the root directory of this source tree.
287
+ */const p$=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]],IN=Ae("Trash2",p$);/**
288
+ * @license lucide-react v0.483.0 - ISC
289
+ *
290
+ * This source code is licensed under the ISC license.
291
+ * See the LICENSE file in the root directory of this source tree.
292
+ */const m$=[["path",{d:"M6 4v6a6 6 0 0 0 12 0V4",key:"9kb039"}],["line",{x1:"4",x2:"20",y1:"20",y2:"20",key:"nun2al"}]],g$=Ae("Underline",m$);function TC({id:e,name:t,placeholder:n="Then",suffix:r}){const i=ir(),[o,s]=S.useState(!1),[a,l]=S.useState(16),c=S.useRef(null),u=S.useRef(null),{handleClick:f,handleFocus:d}=ug(),h=()=>{if(!c.current)return;const g=c.current.value.trim();if(!g){i({type:"UNNAME_LAYER",layerId:e});return}g!==t&&i({type:"RENAME_LAYER",layerId:e,name:g})};if(o)return w.jsx("form",{className:"flex-1",style:{height:a},onSubmit:g=>{var y;g.preventDefault(),h(),ke.flushSync(()=>{s(!1)}),(y=u.current)==null||y.focus()},children:w.jsx("textarea",{className:"w-full resize-none overflow-hidden break-words border border-transparent bg-transparent px-1 py-0.5 text-[12px] uppercase leading-[16px] outline-hidden placeholder:text-base-content/40 focus:border-gray-100 focus:shadow-md focus:outline-hidden focus:ring-2 focus:ring-indigo-600",style:{height:a},ref:c,"aria-label":t??"",name:"name",placeholder:n,defaultValue:t??"",onFocus:d,onKeyDown:g=>{var y,v;g.key==="Escape"?(g.stopPropagation(),ke.flushSync(()=>{s(!1)}),(y=u.current)==null||y.focus()):g.key==="Enter"&&(g.preventDefault(),h(),ke.flushSync(()=>{s(!1)}),(v=u.current)==null||v.focus())},onChange:g=>{const y=g.target.scrollHeight+2;a!==y&&l(y)},onBlur:()=>{h(),s(!1)}})});const p=t??n;return w.jsxs("button",{tabIndex:0,className:"flex flex-1 cursor-text break-words border border-transparent px-1 py-0.5 text-left text-[12px] text-base-content/60 uppercase leading-[16px] focus:border-neutral-content focus:outline-hidden active:border-transparent","aria-label":t??n,type:"button",ref:u,onClick:g=>{var v;const y=((v=u.current)==null?void 0:v.offsetHeight)??16;f(g),ke.flushSync(()=>{l(y)}),ke.flushSync(()=>{s(!0)}),c.current&&c.current.focus()},children:[p,r&&w.jsxs("span",{className:"normal-case",children:[" ",r]})]})}function MC(e,[t,n]){return Math.min(n,Math.max(t,e))}function Q(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function v$(e,t){const n=S.createContext(t),r=o=>{const{children:s,...a}=o,l=S.useMemo(()=>a,Object.values(a));return w.jsx(n.Provider,{value:l,children:s})};r.displayName=e+"Provider";function i(o){const s=S.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,i]}function ms(e,t=[]){let n=[];function r(o,s){const a=S.createContext(s),l=n.length;n=[...n,s];const c=f=>{var v;const{scope:d,children:h,...p}=f,g=((v=d==null?void 0:d[e])==null?void 0:v[l])||a,y=S.useMemo(()=>p,Object.values(p));return w.jsx(g.Provider,{value:y,children:h})};c.displayName=o+"Provider";function u(f,d){var g;const h=((g=d==null?void 0:d[e])==null?void 0:g[l])||a,p=S.useContext(h);if(p)return p;if(s!==void 0)return s;throw new Error(`\`${f}\` must be used within \`${o}\``)}return[c,u]}const i=()=>{const o=n.map(s=>S.createContext(s));return function(a){const l=(a==null?void 0:a[e])||o;return S.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return i.scopeName=e,[r,y$(i,...t)]}function y$(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const s=r.reduce((a,{useScope:l,scopeName:c})=>{const f=l(o)[`__scope${c}`];return{...a,...f}},{});return S.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function OC(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function fg(...e){return t=>{let n=!1;const r=e.map(i=>{const o=OC(i,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i<r.length;i++){const o=r[i];typeof o=="function"?o():OC(e[i],null)}}}}function Ie(...e){return S.useCallback(fg(...e),e)}function fa(e){const t=b$(e),n=S.forwardRef((r,i)=>{const{children:o,...s}=r,a=S.Children.toArray(o),l=a.find(S$);if(l){const c=l.props.children,u=a.map(f=>f===l?S.Children.count(c)>1?S.Children.only(null):S.isValidElement(c)?c.props.children:null:f);return w.jsx(t,{...s,ref:i,children:S.isValidElement(c)?S.cloneElement(c,void 0,u):null})}return w.jsx(t,{...s,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}function b$(e){const t=S.forwardRef((n,r)=>{const{children:i,...o}=n;if(S.isValidElement(i)){const s=E$(i),a=w$(o,i.props);return i.type!==S.Fragment&&(a.ref=r?fg(r,s):s),S.cloneElement(i,a)}return S.Children.count(i)>1?S.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var x$=Symbol("radix.slottable");function S$(e){return S.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===x$}function w$(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...a)=>{const l=o(...a);return i(...a),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function E$(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function rS(e){const t=e+"CollectionProvider",[n,r]=ms(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=g=>{const{scope:y,children:v}=g,b=Ce.useRef(null),x=Ce.useRef(new Map).current;return w.jsx(i,{scope:y,itemMap:x,collectionRef:b,children:v})};s.displayName=t;const a=e+"CollectionSlot",l=fa(a),c=Ce.forwardRef((g,y)=>{const{scope:v,children:b}=g,x=o(a,v),m=Ie(y,x.collectionRef);return w.jsx(l,{ref:m,children:b})});c.displayName=a;const u=e+"CollectionItemSlot",f="data-radix-collection-item",d=fa(u),h=Ce.forwardRef((g,y)=>{const{scope:v,children:b,...x}=g,m=Ce.useRef(null),E=Ie(y,m),T=o(u,v);return Ce.useEffect(()=>(T.itemMap.set(m,{ref:m,...x}),()=>void T.itemMap.delete(m))),w.jsx(d,{[f]:"",ref:E,children:b})});h.displayName=u;function p(g){const y=o(e+"CollectionConsumer",g);return Ce.useCallback(()=>{const b=y.collectionRef.current;if(!b)return[];const x=Array.from(b.querySelectorAll(`[${f}]`));return Array.from(y.itemMap.values()).sort((T,C)=>x.indexOf(T.ref.current)-x.indexOf(C.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:s,Slot:c,ItemSlot:h},p,r]}var C$=S.createContext(void 0);function iS(e){const t=S.useContext(C$);return e||t||"ltr"}var T$=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],xe=T$.reduce((e,t)=>{const n=fa(`Primitive.${t}`),r=S.forwardRef((i,o)=>{const{asChild:s,...a}=i,l=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),w.jsx(l,{...a,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function PN(e,t){e&&ke.flushSync(()=>e.dispatchEvent(t))}function mi(e){const t=S.useRef(e);return S.useEffect(()=>{t.current=e}),S.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function M$(e,t=globalThis==null?void 0:globalThis.document){const n=mi(e);S.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var O$="DismissableLayer",cb="dismissableLayer.update",A$="dismissableLayer.pointerDownOutside",k$="dismissableLayer.focusOutside",AC,BN=S.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),od=S.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:s,onDismiss:a,...l}=e,c=S.useContext(BN),[u,f]=S.useState(null),d=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=S.useState({}),p=Ie(t,C=>f(C)),g=Array.from(c.layers),[y]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),v=g.indexOf(y),b=u?g.indexOf(u):-1,x=c.layersWithOutsidePointerEventsDisabled.size>0,m=b>=v,E=_$(C=>{const O=C.target,A=[...c.branches].some(k=>k.contains(O));!m||A||(i==null||i(C),s==null||s(C),C.defaultPrevented||a==null||a())},d),T=R$(C=>{const O=C.target;[...c.branches].some(k=>k.contains(O))||(o==null||o(C),s==null||s(C),C.defaultPrevented||a==null||a())},d);return M$(C=>{b===c.layers.size-1&&(r==null||r(C),!C.defaultPrevented&&a&&(C.preventDefault(),a()))},d),S.useEffect(()=>{if(u)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(AC=d.body.style.pointerEvents,d.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),kC(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(d.body.style.pointerEvents=AC)}},[u,d,n,c]),S.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),kC())},[u,c]),S.useEffect(()=>{const C=()=>h({});return document.addEventListener(cb,C),()=>document.removeEventListener(cb,C)},[]),w.jsx(xe.div,{...l,ref:p,style:{pointerEvents:x?m?"auto":"none":void 0,...e.style},onFocusCapture:Q(e.onFocusCapture,T.onFocusCapture),onBlurCapture:Q(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:Q(e.onPointerDownCapture,E.onPointerDownCapture)})});od.displayName=O$;var D$="DismissableLayerBranch",N$=S.forwardRef((e,t)=>{const n=S.useContext(BN),r=S.useRef(null),i=Ie(t,r);return S.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),w.jsx(xe.div,{...e,ref:i})});N$.displayName=D$;function _$(e,t=globalThis==null?void 0:globalThis.document){const n=mi(e),r=S.useRef(!1),i=S.useRef(()=>{});return S.useEffect(()=>{const o=a=>{if(a.target&&!r.current){let l=function(){HN(A$,n,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=l,t.addEventListener("click",i.current,{once:!0})):l()}else t.removeEventListener("click",i.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function R$(e,t=globalThis==null?void 0:globalThis.document){const n=mi(e),r=S.useRef(!1);return S.useEffect(()=>{const i=o=>{o.target&&!r.current&&HN(k$,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function kC(){const e=new CustomEvent(cb);document.dispatchEvent(e)}function HN(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?PN(i,o):i.dispatchEvent(o)}var Vv=0;function dg(){S.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??DC()),document.body.insertAdjacentElement("beforeend",e[1]??DC()),Vv++,()=>{Vv===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Vv--}},[])}function DC(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Fv="focusScope.autoFocusOnMount",qv="focusScope.autoFocusOnUnmount",NC={bubbles:!1,cancelable:!0},L$="FocusScope",sd=S.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...s}=e,[a,l]=S.useState(null),c=mi(i),u=mi(o),f=S.useRef(null),d=Ie(t,g=>l(g)),h=S.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;S.useEffect(()=>{if(r){let g=function(x){if(h.paused||!a)return;const m=x.target;a.contains(m)?f.current=m:vo(f.current,{select:!0})},y=function(x){if(h.paused||!a)return;const m=x.relatedTarget;m!==null&&(a.contains(m)||vo(f.current,{select:!0}))},v=function(x){if(document.activeElement===document.body)for(const E of x)E.removedNodes.length>0&&vo(a)};document.addEventListener("focusin",g),document.addEventListener("focusout",y);const b=new MutationObserver(v);return a&&b.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",y),b.disconnect()}}},[r,a,h.paused]),S.useEffect(()=>{if(a){RC.add(h);const g=document.activeElement;if(!a.contains(g)){const v=new CustomEvent(Fv,NC);a.addEventListener(Fv,c),a.dispatchEvent(v),v.defaultPrevented||(j$(H$($N(a)),{select:!0}),document.activeElement===g&&vo(a))}return()=>{a.removeEventListener(Fv,c),setTimeout(()=>{const v=new CustomEvent(qv,NC);a.addEventListener(qv,u),a.dispatchEvent(v),v.defaultPrevented||vo(g??document.body,{select:!0}),a.removeEventListener(qv,u),RC.remove(h)},0)}}},[a,c,u,h]);const p=S.useCallback(g=>{if(!n&&!r||h.paused)return;const y=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,v=document.activeElement;if(y&&v){const b=g.currentTarget,[x,m]=z$(b);x&&m?!g.shiftKey&&v===m?(g.preventDefault(),n&&vo(x,{select:!0})):g.shiftKey&&v===x&&(g.preventDefault(),n&&vo(m,{select:!0})):v===b&&g.preventDefault()}},[n,r,h.paused]);return w.jsx(xe.div,{tabIndex:-1,...s,ref:d,onKeyDown:p})});sd.displayName=L$;function j$(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(vo(r,{select:t}),document.activeElement!==n)return}function z$(e){const t=$N(e),n=_C(t,e),r=_C(t.reverse(),e);return[n,r]}function $N(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function _C(e,t){for(const n of e)if(!I$(n,{upTo:t}))return n}function I$(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function P$(e){return e instanceof HTMLInputElement&&"select"in e}function vo(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&P$(e)&&t&&e.select()}}var RC=B$();function B$(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=LC(e,t),e.unshift(t)},remove(t){var n;e=LC(e,t),(n=e[0])==null||n.resume()}}}function LC(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function H$(e){return e.filter(t=>t.tagName!=="A")}var ln=globalThis!=null&&globalThis.document?S.useLayoutEffect:()=>{},$$=EO[" useId ".trim().toString()]||(()=>{}),U$=0;function ci(e){const[t,n]=S.useState($$());return ln(()=>{n(r=>r??String(U$++))},[e]),e||(t?`radix-${t}`:"")}const V$=["top","right","bottom","left"],ls=Math.min,Fn=Math.max,zp=Math.round,Ud=Math.floor,ui=e=>({x:e,y:e}),F$={left:"right",right:"left",bottom:"top",top:"bottom"};function ub(e,t,n){return Fn(e,ls(t,n))}function to(e,t){return typeof e=="function"?e(t):e}function no(e){return e.split("-")[0]}function Ec(e){return e.split("-")[1]}function oS(e){return e==="x"?"y":"x"}function sS(e){return e==="y"?"height":"width"}function si(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function aS(e){return oS(si(e))}function q$(e,t,n){n===void 0&&(n=!1);const r=Ec(e),i=aS(e),o=sS(i);let s=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(s=Ip(s)),[s,Ip(s)]}function K$(e){const t=Ip(e);return[fb(e),t,fb(t)]}function fb(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const jC=["left","right"],zC=["right","left"],W$=["top","bottom"],Y$=["bottom","top"];function G$(e,t,n){switch(e){case"top":case"bottom":return n?t?zC:jC:t?jC:zC;case"left":case"right":return t?W$:Y$;default:return[]}}function X$(e,t,n,r){const i=Ec(e);let o=G$(no(e),n==="start",r);return i&&(o=o.map(s=>s+"-"+i),t&&(o=o.concat(o.map(fb)))),o}function Ip(e){const t=no(e);return F$[t]+e.slice(t.length)}function Q$(e){return{top:0,right:0,bottom:0,left:0,...e}}function UN(e){return typeof e!="number"?Q$(e):{top:e,right:e,bottom:e,left:e}}function Pp(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function IC(e,t,n){let{reference:r,floating:i}=e;const o=si(t),s=aS(t),a=sS(s),l=no(t),c=o==="y",u=r.x+r.width/2-i.width/2,f=r.y+r.height/2-i.height/2,d=r[a]/2-i[a]/2;let h;switch(l){case"top":h={x:u,y:r.y-i.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:f};break;case"left":h={x:r.x-i.width,y:f};break;default:h={x:r.x,y:r.y}}switch(Ec(t)){case"start":h[s]-=d*(n&&c?-1:1);break;case"end":h[s]+=d*(n&&c?-1:1);break}return h}async function J$(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:d=!1,padding:h=0}=to(t,e),p=UN(h),y=a[d?f==="floating"?"reference":"floating":f],v=Pp(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(y)))==null||n?y:y.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),b=f==="floating"?{x:r,y:i,width:s.floating.width,height:s.floating.height}:s.reference,x=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),m=await(o.isElement==null?void 0:o.isElement(x))?await(o.getScale==null?void 0:o.getScale(x))||{x:1,y:1}:{x:1,y:1},E=Pp(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:x,strategy:l}):b);return{top:(v.top-E.top+p.top)/m.y,bottom:(E.bottom-v.bottom+p.bottom)/m.y,left:(v.left-E.left+p.left)/m.x,right:(E.right-v.right+p.right)/m.x}}const Z$=50,e6=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=n,a=s.detectOverflow?s:{...s,detectOverflow:J$},l=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:f}=IC(c,r,l),d=r,h=0;const p={};for(let g=0;g<o.length;g++){const y=o[g];if(!y)continue;const{name:v,fn:b}=y,{x,y:m,data:E,reset:T}=await b({x:u,y:f,initialPlacement:r,placement:d,strategy:i,middlewareData:p,rects:c,platform:a,elements:{reference:e,floating:t}});u=x??u,f=m??f,p[v]={...p[v],...E},T&&h<Z$&&(h++,typeof T=="object"&&(T.placement&&(d=T.placement),T.rects&&(c=T.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:i}):T.rects),{x:u,y:f}=IC(c,d,l)),g=-1)}return{x:u,y:f,placement:d,strategy:i,middlewareData:p}},t6=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=to(e,t)||{};if(c==null)return{};const f=UN(u),d={x:n,y:r},h=aS(i),p=sS(h),g=await s.getDimensions(c),y=h==="y",v=y?"top":"left",b=y?"bottom":"right",x=y?"clientHeight":"clientWidth",m=o.reference[p]+o.reference[h]-d[h]-o.floating[p],E=d[h]-o.reference[h],T=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let C=T?T[x]:0;(!C||!await(s.isElement==null?void 0:s.isElement(T)))&&(C=a.floating[x]||o.floating[p]);const O=m/2-E/2,A=C/2-g[p]/2-1,k=ls(f[v],A),z=ls(f[b],A),_=k,H=C-g[p]-z,U=C/2-g[p]/2+O,V=ub(_,U,H),D=!l.arrow&&Ec(i)!=null&&U!==V&&o.reference[p]/2-(U<_?k:z)-g[p]/2<0,I=D?U<_?U-_:U-H:0;return{[h]:d[h]+I,data:{[h]:V,centerOffset:U-V-I,...D&&{alignmentOffset:I}},reset:D}}}),n6=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:o,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:g=!0,...y}=to(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const v=no(i),b=si(a),x=no(a)===a,m=await(l.isRTL==null?void 0:l.isRTL(c.floating)),E=d||(x||!g?[Ip(a)]:K$(a)),T=p!=="none";!d&&T&&E.push(...X$(a,g,p,m));const C=[a,...E],O=await l.detectOverflow(t,y),A=[];let k=((r=o.flip)==null?void 0:r.overflows)||[];if(u&&A.push(O[v]),f){const U=q$(i,s,m);A.push(O[U[0]],O[U[1]])}if(k=[...k,{placement:i,overflows:A}],!A.every(U=>U<=0)){var z,_;const U=(((z=o.flip)==null?void 0:z.index)||0)+1,V=C[U];if(V&&(!(f==="alignment"?b!==si(V):!1)||k.every(N=>si(N.placement)===b?N.overflows[0]>0:!0)))return{data:{index:U,overflows:k},reset:{placement:V}};let D=(_=k.filter(I=>I.overflows[0]<=0).sort((I,N)=>I.overflows[1]-N.overflows[1])[0])==null?void 0:_.placement;if(!D)switch(h){case"bestFit":{var H;const I=(H=k.filter(N=>{if(T){const L=si(N.placement);return L===b||L==="y"}return!0}).map(N=>[N.placement,N.overflows.filter(L=>L>0).reduce((L,F)=>L+F,0)]).sort((N,L)=>N[1]-L[1])[0])==null?void 0:H[0];I&&(D=I);break}case"initialPlacement":D=a;break}if(i!==D)return{reset:{placement:D}}}return{}}}};function PC(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function BC(e){return V$.some(t=>e[t]>=0)}const r6=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:i="referenceHidden",...o}=to(e,t);switch(i){case"referenceHidden":{const s=await r.detectOverflow(t,{...o,elementContext:"reference"}),a=PC(s,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:BC(a)}}}case"escaped":{const s=await r.detectOverflow(t,{...o,altBoundary:!0}),a=PC(s,n.floating);return{data:{escapedOffsets:a,escaped:BC(a)}}}default:return{}}}}},VN=new Set(["left","top"]);async function i6(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=no(n),a=Ec(n),l=si(n)==="y",c=VN.has(s)?-1:1,u=o&&l?-1:1,f=to(t,e);let{mainAxis:d,crossAxis:h,alignmentAxis:p}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof p=="number"&&(h=a==="end"?p*-1:p),l?{x:h*u,y:d*c}:{x:d*c,y:h*u}}const o6=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:s,middlewareData:a}=t,l=await i6(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:o+l.y,data:{...l,placement:s}}}}},s6=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i,platform:o}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:l={fn:v=>{let{x:b,y:x}=v;return{x:b,y:x}}},...c}=to(e,t),u={x:n,y:r},f=await o.detectOverflow(t,c),d=si(no(i)),h=oS(d);let p=u[h],g=u[d];if(s){const v=h==="y"?"top":"left",b=h==="y"?"bottom":"right",x=p+f[v],m=p-f[b];p=ub(x,p,m)}if(a){const v=d==="y"?"top":"left",b=d==="y"?"bottom":"right",x=g+f[v],m=g-f[b];g=ub(x,g,m)}const y=l.fn({...t,[h]:p,[d]:g});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[h]:s,[d]:a}}}}}},a6=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:s}=t,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=to(e,t),u={x:n,y:r},f=si(i),d=oS(f);let h=u[d],p=u[f];const g=to(a,t),y=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(l){const x=d==="y"?"height":"width",m=o.reference[d]-o.floating[x]+y.mainAxis,E=o.reference[d]+o.reference[x]-y.mainAxis;h<m?h=m:h>E&&(h=E)}if(c){var v,b;const x=d==="y"?"width":"height",m=VN.has(no(i)),E=o.reference[f]-o.floating[x]+(m&&((v=s.offset)==null?void 0:v[f])||0)+(m?0:y.crossAxis),T=o.reference[f]+o.reference[x]+(m?0:((b=s.offset)==null?void 0:b[f])||0)-(m?y.crossAxis:0);p<E?p=E:p>T&&(p=T)}return{[d]:h,[f]:p}}}},l6=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:o,platform:s,elements:a}=t,{apply:l=()=>{},...c}=to(e,t),u=await s.detectOverflow(t,c),f=no(i),d=Ec(i),h=si(i)==="y",{width:p,height:g}=o.floating;let y,v;f==="top"||f==="bottom"?(y=f,v=d===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(v=f,y=d==="end"?"top":"bottom");const b=g-u.top-u.bottom,x=p-u.left-u.right,m=ls(g-u[y],b),E=ls(p-u[v],x),T=!t.middlewareData.shift;let C=m,O=E;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(O=x),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=b),T&&!d){const k=Fn(u.left,0),z=Fn(u.right,0),_=Fn(u.top,0),H=Fn(u.bottom,0);h?O=p-2*(k!==0||z!==0?k+z:Fn(u.left,u.right)):C=g-2*(_!==0||H!==0?_+H:Fn(u.top,u.bottom))}await l({...t,availableWidth:O,availableHeight:C});const A=await s.getDimensions(a.floating);return p!==A.width||g!==A.height?{reset:{rects:!0}}:{}}}};function hg(){return typeof window<"u"}function Cc(e){return FN(e)?(e.nodeName||"").toLowerCase():"#document"}function Zn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Si(e){var t;return(t=(FN(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function FN(e){return hg()?e instanceof Node||e instanceof Zn(e).Node:!1}function Ur(e){return hg()?e instanceof Element||e instanceof Zn(e).Element:!1}function lo(e){return hg()?e instanceof HTMLElement||e instanceof Zn(e).HTMLElement:!1}function HC(e){return!hg()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Zn(e).ShadowRoot}function ad(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Vr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!=="inline"&&i!=="contents"}function c6(e){return/^(table|td|th)$/.test(Cc(e))}function pg(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const u6=/transform|translate|scale|rotate|perspective|filter/,f6=/paint|layout|strict|content/,Os=e=>!!e&&e!=="none";let Kv;function lS(e){const t=Ur(e)?Vr(e):e;return Os(t.transform)||Os(t.translate)||Os(t.scale)||Os(t.rotate)||Os(t.perspective)||!cS()&&(Os(t.backdropFilter)||Os(t.filter))||u6.test(t.willChange||"")||f6.test(t.contain||"")}function d6(e){let t=cs(e);for(;lo(t)&&!Gl(t);){if(lS(t))return t;if(pg(t))return null;t=cs(t)}return null}function cS(){return Kv==null&&(Kv=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Kv}function Gl(e){return/^(html|body|#document)$/.test(Cc(e))}function Vr(e){return Zn(e).getComputedStyle(e)}function mg(e){return Ur(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function cs(e){if(Cc(e)==="html")return e;const t=e.assignedSlot||e.parentNode||HC(e)&&e.host||Si(e);return HC(t)?t.host:t}function qN(e){const t=cs(e);return Gl(t)?e.ownerDocument?e.ownerDocument.body:e.body:lo(t)&&ad(t)?t:qN(t)}function xf(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=qN(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),s=Zn(i);if(o){const a=db(s);return t.concat(s,s.visualViewport||[],ad(i)?i:[],a&&n?xf(a):[])}else return t.concat(i,xf(i,[],n))}function db(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function KN(e){const t=Vr(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=lo(e),o=i?e.offsetWidth:n,s=i?e.offsetHeight:r,a=zp(n)!==o||zp(r)!==s;return a&&(n=o,r=s),{width:n,height:r,$:a}}function uS(e){return Ur(e)?e:e.contextElement}function kl(e){const t=uS(e);if(!lo(t))return ui(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=KN(t);let s=(o?zp(n.width):n.width)/r,a=(o?zp(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const h6=ui(0);function WN(e){const t=Zn(e);return!cS()||!t.visualViewport?h6:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function p6(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Zn(e)?!1:t}function da(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=uS(e);let s=ui(1);t&&(r?Ur(r)&&(s=kl(r)):s=kl(e));const a=p6(o,n,r)?WN(o):ui(0);let l=(i.left+a.x)/s.x,c=(i.top+a.y)/s.y,u=i.width/s.x,f=i.height/s.y;if(o){const d=Zn(o),h=r&&Ur(r)?Zn(r):r;let p=d,g=db(p);for(;g&&r&&h!==p;){const y=kl(g),v=g.getBoundingClientRect(),b=Vr(g),x=v.left+(g.clientLeft+parseFloat(b.paddingLeft))*y.x,m=v.top+(g.clientTop+parseFloat(b.paddingTop))*y.y;l*=y.x,c*=y.y,u*=y.x,f*=y.y,l+=x,c+=m,p=Zn(g),g=db(p)}}return Pp({width:u,height:f,x:l,y:c})}function gg(e,t){const n=mg(e).scrollLeft;return t?t.left+n:da(Si(e)).left+n}function YN(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-gg(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function m6(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",s=Si(r),a=t?pg(t.floating):!1;if(r===s||a&&o)return n;let l={scrollLeft:0,scrollTop:0},c=ui(1);const u=ui(0),f=lo(r);if((f||!f&&!o)&&((Cc(r)!=="body"||ad(s))&&(l=mg(r)),f)){const h=da(r);c=kl(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}const d=s&&!f&&!o?YN(s,l):ui(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+d.x,y:n.y*c.y-l.scrollTop*c.y+u.y+d.y}}function g6(e){return Array.from(e.getClientRects())}function v6(e){const t=Si(e),n=mg(e),r=e.ownerDocument.body,i=Fn(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=Fn(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+gg(e);const a=-n.scrollTop;return Vr(r).direction==="rtl"&&(s+=Fn(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:a}}const $C=25;function y6(e,t){const n=Zn(e),r=Si(e),i=n.visualViewport;let o=r.clientWidth,s=r.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;const u=cS();(!u||u&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}const c=gg(r);if(c<=0){const u=r.ownerDocument,f=u.body,d=getComputedStyle(f),h=u.compatMode==="CSS1Compat"&&parseFloat(d.marginLeft)+parseFloat(d.marginRight)||0,p=Math.abs(r.clientWidth-f.clientWidth-h);p<=$C&&(o-=p)}else c<=$C&&(o+=c);return{width:o,height:s,x:a,y:l}}function b6(e,t){const n=da(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=lo(e)?kl(e):ui(1),s=e.clientWidth*o.x,a=e.clientHeight*o.y,l=i*o.x,c=r*o.y;return{width:s,height:a,x:l,y:c}}function UC(e,t,n){let r;if(t==="viewport")r=y6(e,n);else if(t==="document")r=v6(Si(e));else if(Ur(t))r=b6(t,n);else{const i=WN(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Pp(r)}function GN(e,t){const n=cs(e);return n===t||!Ur(n)||Gl(n)?!1:Vr(n).position==="fixed"||GN(n,t)}function x6(e,t){const n=t.get(e);if(n)return n;let r=xf(e,[],!1).filter(a=>Ur(a)&&Cc(a)!=="body"),i=null;const o=Vr(e).position==="fixed";let s=o?cs(e):e;for(;Ur(s)&&!Gl(s);){const a=Vr(s),l=lS(s);!l&&a.position==="fixed"&&(i=null),(o?!l&&!i:!l&&a.position==="static"&&!!i&&(i.position==="absolute"||i.position==="fixed")||ad(s)&&!l&&GN(e,s))?r=r.filter(u=>u!==s):i=a,s=cs(s)}return t.set(e,r),r}function S6(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const s=[...n==="clippingAncestors"?pg(t)?[]:x6(t,this._c):[].concat(n),r],a=UC(t,s[0],i);let l=a.top,c=a.right,u=a.bottom,f=a.left;for(let d=1;d<s.length;d++){const h=UC(t,s[d],i);l=Fn(h.top,l),c=ls(h.right,c),u=ls(h.bottom,u),f=Fn(h.left,f)}return{width:c-f,height:u-l,x:f,y:l}}function w6(e){const{width:t,height:n}=KN(e);return{width:t,height:n}}function E6(e,t,n){const r=lo(t),i=Si(t),o=n==="fixed",s=da(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const l=ui(0);function c(){l.x=gg(i)}if(r||!r&&!o)if((Cc(t)!=="body"||ad(i))&&(a=mg(t)),r){const h=da(t,!0,o,t);l.x=h.x+t.clientLeft,l.y=h.y+t.clientTop}else i&&c();o&&!r&&i&&c();const u=i&&!r&&!o?YN(i,a):ui(0),f=s.left+a.scrollLeft-l.x-u.x,d=s.top+a.scrollTop-l.y-u.y;return{x:f,y:d,width:s.width,height:s.height}}function Wv(e){return Vr(e).position==="static"}function VC(e,t){if(!lo(e)||Vr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Si(e)===n&&(n=n.ownerDocument.body),n}function XN(e,t){const n=Zn(e);if(pg(e))return n;if(!lo(e)){let i=cs(e);for(;i&&!Gl(i);){if(Ur(i)&&!Wv(i))return i;i=cs(i)}return n}let r=VC(e,t);for(;r&&c6(r)&&Wv(r);)r=VC(r,t);return r&&Gl(r)&&Wv(r)&&!lS(r)?n:r||d6(e)||n}const C6=async function(e){const t=this.getOffsetParent||XN,n=this.getDimensions,r=await n(e.floating);return{reference:E6(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function T6(e){return Vr(e).direction==="rtl"}const M6={convertOffsetParentRelativeRectToViewportRelativeRect:m6,getDocumentElement:Si,getClippingRect:S6,getOffsetParent:XN,getElementRects:C6,getClientRects:g6,getDimensions:w6,getScale:kl,isElement:Ur,isRTL:T6};function QN(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function O6(e,t){let n=null,r;const i=Si(e);function o(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),o();const c=e.getBoundingClientRect(),{left:u,top:f,width:d,height:h}=c;if(a||t(),!d||!h)return;const p=Ud(f),g=Ud(i.clientWidth-(u+d)),y=Ud(i.clientHeight-(f+h)),v=Ud(u),x={rootMargin:-p+"px "+-g+"px "+-y+"px "+-v+"px",threshold:Fn(0,ls(1,l))||1};let m=!0;function E(T){const C=T[0].intersectionRatio;if(C!==l){if(!m)return s();C?s(!1,C):r=setTimeout(()=>{s(!1,1e-7)},1e3)}C===1&&!QN(c,e.getBoundingClientRect())&&s(),m=!1}try{n=new IntersectionObserver(E,{...x,root:i.ownerDocument})}catch{n=new IntersectionObserver(E,x)}n.observe(e)}return s(!0),o}function A6(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=uS(e),u=i||o?[...c?xf(c):[],...t?xf(t):[]]:[];u.forEach(v=>{i&&v.addEventListener("scroll",n,{passive:!0}),o&&v.addEventListener("resize",n)});const f=c&&a?O6(c,n):null;let d=-1,h=null;s&&(h=new ResizeObserver(v=>{let[b]=v;b&&b.target===c&&h&&t&&(h.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var x;(x=h)==null||x.observe(t)})),n()}),c&&!l&&h.observe(c),t&&h.observe(t));let p,g=l?da(e):null;l&&y();function y(){const v=da(e);g&&!QN(g,v)&&n(),g=v,p=requestAnimationFrame(y)}return n(),()=>{var v;u.forEach(b=>{i&&b.removeEventListener("scroll",n),o&&b.removeEventListener("resize",n)}),f==null||f(),(v=h)==null||v.disconnect(),h=null,l&&cancelAnimationFrame(p)}}const k6=o6,D6=s6,N6=n6,_6=l6,R6=r6,FC=t6,L6=a6,j6=(e,t,n)=>{const r=new Map,i={platform:M6,...n},o={...i.platform,_c:r};return e6(e,t,{...i,platform:o})};var z6=typeof document<"u",I6=function(){},Ph=z6?S.useLayoutEffect:I6;function Bp(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Bp(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!Bp(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function JN(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function qC(e,t){const n=JN(e);return Math.round(t*n)/n}function Yv(e){const t=S.useRef(e);return Ph(()=>{t.current=e}),t}function P6(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[u,f]=S.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[d,h]=S.useState(r);Bp(d,r)||h(r);const[p,g]=S.useState(null),[y,v]=S.useState(null),b=S.useCallback(N=>{N!==T.current&&(T.current=N,g(N))},[]),x=S.useCallback(N=>{N!==C.current&&(C.current=N,v(N))},[]),m=o||p,E=s||y,T=S.useRef(null),C=S.useRef(null),O=S.useRef(u),A=l!=null,k=Yv(l),z=Yv(i),_=Yv(c),H=S.useCallback(()=>{if(!T.current||!C.current)return;const N={placement:t,strategy:n,middleware:d};z.current&&(N.platform=z.current),j6(T.current,C.current,N).then(L=>{const F={...L,isPositioned:_.current!==!1};U.current&&!Bp(O.current,F)&&(O.current=F,ke.flushSync(()=>{f(F)}))})},[d,t,n,z,_]);Ph(()=>{c===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,f(N=>({...N,isPositioned:!1})))},[c]);const U=S.useRef(!1);Ph(()=>(U.current=!0,()=>{U.current=!1}),[]),Ph(()=>{if(m&&(T.current=m),E&&(C.current=E),m&&E){if(k.current)return k.current(m,E,H);H()}},[m,E,H,k,A]);const V=S.useMemo(()=>({reference:T,floating:C,setReference:b,setFloating:x}),[b,x]),D=S.useMemo(()=>({reference:m,floating:E}),[m,E]),I=S.useMemo(()=>{const N={position:n,left:0,top:0};if(!D.floating)return N;const L=qC(D.floating,u.x),F=qC(D.floating,u.y);return a?{...N,transform:"translate("+L+"px, "+F+"px)",...JN(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:L,top:F}},[n,a,D.floating,u.x,u.y]);return S.useMemo(()=>({...u,update:H,refs:V,elements:D,floatingStyles:I}),[u,H,V,D,I])}const B6=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?FC({element:r.current,padding:i}).fn(n):{}:r?FC({element:r,padding:i}).fn(n):{}}}},H6=(e,t)=>{const n=k6(e);return{name:n.name,fn:n.fn,options:[e,t]}},$6=(e,t)=>{const n=D6(e);return{name:n.name,fn:n.fn,options:[e,t]}},U6=(e,t)=>({fn:L6(e).fn,options:[e,t]}),V6=(e,t)=>{const n=N6(e);return{name:n.name,fn:n.fn,options:[e,t]}},F6=(e,t)=>{const n=_6(e);return{name:n.name,fn:n.fn,options:[e,t]}},q6=(e,t)=>{const n=R6(e);return{name:n.name,fn:n.fn,options:[e,t]}},K6=(e,t)=>{const n=B6(e);return{name:n.name,fn:n.fn,options:[e,t]}};var W6="Arrow",ZN=S.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...o}=e;return w.jsx(xe.svg,{...o,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:w.jsx("polygon",{points:"0,0 30,0 15,10"})})});ZN.displayName=W6;var Y6=ZN;function G6(e){const[t,n]=S.useState(void 0);return ln(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let s,a;if("borderBoxSize"in o){const l=o.borderBoxSize,c=Array.isArray(l)?l[0]:l;s=c.inlineSize,a=c.blockSize}else s=e.offsetWidth,a=e.offsetHeight;n({width:s,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var fS="Popper",[e_,Tc]=ms(fS),[X6,t_]=e_(fS),n_=e=>{const{__scopePopper:t,children:n}=e,[r,i]=S.useState(null);return w.jsx(X6,{scope:t,anchor:r,onAnchorChange:i,children:n})};n_.displayName=fS;var r_="PopperAnchor",i_=S.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=t_(r_,n),s=S.useRef(null),a=Ie(t,s),l=S.useRef(null);return S.useEffect(()=>{const c=l.current;l.current=(r==null?void 0:r.current)||s.current,c!==l.current&&o.onAnchorChange(l.current)}),r?null:w.jsx(xe.div,{...i,ref:a})});i_.displayName=r_;var dS="PopperContent",[Q6,J6]=e_(dS),o_=S.forwardRef((e,t)=>{var Y,re,pe,Z,le,ce;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:o="center",alignOffset:s=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:u=0,sticky:f="partial",hideWhenDetached:d=!1,updatePositionStrategy:h="optimized",onPlaced:p,...g}=e,y=t_(dS,n),[v,b]=S.useState(null),x=Ie(t,Xe=>b(Xe)),[m,E]=S.useState(null),T=G6(m),C=(T==null?void 0:T.width)??0,O=(T==null?void 0:T.height)??0,A=r+(o!=="center"?"-"+o:""),k=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},z=Array.isArray(c)?c:[c],_=z.length>0,H={padding:k,boundary:z.filter(eU),altBoundary:_},{refs:U,floatingStyles:V,placement:D,isPositioned:I,middlewareData:N}=P6({strategy:"fixed",placement:A,whileElementsMounted:(...Xe)=>A6(...Xe,{animationFrame:h==="always"}),elements:{reference:y.anchor},middleware:[H6({mainAxis:i+O,alignmentAxis:s}),l&&$6({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?U6():void 0,...H}),l&&V6({...H}),F6({...H,apply:({elements:Xe,rects:dt,availableWidth:Zt,availableHeight:en})=>{const{width:tn,height:kr}=dt.reference,En=Xe.floating.style;En.setProperty("--radix-popper-available-width",`${Zt}px`),En.setProperty("--radix-popper-available-height",`${en}px`),En.setProperty("--radix-popper-anchor-width",`${tn}px`),En.setProperty("--radix-popper-anchor-height",`${kr}px`)}}),m&&K6({element:m,padding:a}),tU({arrowWidth:C,arrowHeight:O}),d&&q6({strategy:"referenceHidden",...H})]}),[L,F]=l_(D),te=mi(p);ln(()=>{I&&(te==null||te())},[I,te]);const ae=(Y=N.arrow)==null?void 0:Y.x,Ee=(re=N.arrow)==null?void 0:re.y,ge=((pe=N.arrow)==null?void 0:pe.centerOffset)!==0,[X,De]=S.useState();return ln(()=>{v&&De(window.getComputedStyle(v).zIndex)},[v]),w.jsx("div",{ref:U.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:I?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:X,"--radix-popper-transform-origin":[(Z=N.transformOrigin)==null?void 0:Z.x,(le=N.transformOrigin)==null?void 0:le.y].join(" "),...((ce=N.hide)==null?void 0:ce.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:w.jsx(Q6,{scope:n,placedSide:L,onArrowChange:E,arrowX:ae,arrowY:Ee,shouldHideArrow:ge,children:w.jsx(xe.div,{"data-side":L,"data-align":F,...g,ref:x,style:{...g.style,animation:I?void 0:"none"}})})})});o_.displayName=dS;var s_="PopperArrow",Z6={top:"bottom",right:"left",bottom:"top",left:"right"},a_=S.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,o=J6(s_,r),s=Z6[o.placedSide];return w.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:w.jsx(Y6,{...i,ref:n,style:{...i.style,display:"block"}})})});a_.displayName=s_;function eU(e){return e!==null}var tU=e=>({name:"transformOrigin",options:e,fn(t){var y,v,b;const{placement:n,rects:r,middlewareData:i}=t,s=((y=i.arrow)==null?void 0:y.centerOffset)!==0,a=s?0:e.arrowWidth,l=s?0:e.arrowHeight,[c,u]=l_(n),f={start:"0%",center:"50%",end:"100%"}[u],d=(((v=i.arrow)==null?void 0:v.x)??0)+a/2,h=(((b=i.arrow)==null?void 0:b.y)??0)+l/2;let p="",g="";return c==="bottom"?(p=s?f:`${d}px`,g=`${-l}px`):c==="top"?(p=s?f:`${d}px`,g=`${r.floating.height+l}px`):c==="right"?(p=`${-l}px`,g=s?f:`${h}px`):c==="left"&&(p=`${r.floating.width+l}px`,g=s?f:`${h}px`),{data:{x:p,y:g}}}});function l_(e){const[t,n="center"]=e.split("-");return[t,n]}var hS=n_,vg=i_,pS=o_,mS=a_,nU="Portal",yg=S.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[i,o]=S.useState(!1);ln(()=>o(!0),[]);const s=n||i&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return s?OO.createPortal(w.jsx(xe.div,{...r,ref:t}),s):null});yg.displayName=nU;var rU=EO[" useInsertionEffect ".trim().toString()]||ln;function Xl({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,o,s]=iU({defaultProp:t,onChange:n}),a=e!==void 0,l=a?e:i;{const u=S.useRef(e!==void 0);S.useEffect(()=>{const f=u.current;f!==a&&console.warn(`${r} is changing from ${f?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=a},[a,r])}const c=S.useCallback(u=>{var f;if(a){const d=oU(u)?u(e):u;d!==e&&((f=s.current)==null||f.call(s,d))}else o(u)},[a,e,o,s]);return[l,c]}function iU({defaultProp:e,onChange:t}){const[n,r]=S.useState(e),i=S.useRef(n),o=S.useRef(t);return rU(()=>{o.current=t},[t]),S.useEffect(()=>{var s;i.current!==n&&((s=o.current)==null||s.call(o,n),i.current=n)},[n,i]),[n,r,o]}function oU(e){return typeof e=="function"}function sU(e){const t=S.useRef({value:e,previous:e});return S.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var c_=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),aU="VisuallyHidden",lU=S.forwardRef((e,t)=>w.jsx(xe.span,{...e,ref:t,style:{...c_,...e.style}}));lU.displayName=aU;var cU=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},$a=new WeakMap,Vd=new WeakMap,Fd={},Gv=0,u_=function(e){return e&&(e.host||u_(e.parentNode))},uU=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=u_(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},fU=function(e,t,n,r){var i=uU(t,Array.isArray(e)?e:[e]);Fd[n]||(Fd[n]=new WeakMap);var o=Fd[n],s=[],a=new Set,l=new Set(i),c=function(f){!f||a.has(f)||(a.add(f),c(f.parentNode))};i.forEach(c);var u=function(f){!f||l.has(f)||Array.prototype.forEach.call(f.children,function(d){if(a.has(d))u(d);else try{var h=d.getAttribute(r),p=h!==null&&h!=="false",g=($a.get(d)||0)+1,y=(o.get(d)||0)+1;$a.set(d,g),o.set(d,y),s.push(d),g===1&&p&&Vd.set(d,!0),y===1&&d.setAttribute(n,"true"),p||d.setAttribute(r,"true")}catch(v){console.error("aria-hidden: cannot operate on ",d,v)}})};return u(t),a.clear(),Gv++,function(){s.forEach(function(f){var d=$a.get(f)-1,h=o.get(f)-1;$a.set(f,d),o.set(f,h),d||(Vd.has(f)||f.removeAttribute(r),Vd.delete(f)),h||f.removeAttribute(n)}),Gv--,Gv||($a=new WeakMap,$a=new WeakMap,Vd=new WeakMap,Fd={})}},bg=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=cU(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),fU(r,i,n,"aria-hidden")):function(){return null}},ni=function(){return ni=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},ni.apply(this,arguments)};function f_(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function dU(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var Bh="right-scroll-bar-position",Hh="width-before-scroll-bar",hU="with-scroll-bars-hidden",pU="--removed-body-scroll-bar-size";function Xv(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function mU(e,t){var n=S.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var gU=typeof window<"u"?S.useLayoutEffect:S.useEffect,KC=new WeakMap;function vU(e,t){var n=mU(null,function(r){return e.forEach(function(i){return Xv(i,r)})});return gU(function(){var r=KC.get(n);if(r){var i=new Set(r),o=new Set(e),s=n.current;i.forEach(function(a){o.has(a)||Xv(a,null)}),o.forEach(function(a){i.has(a)||Xv(a,s)})}KC.set(n,e)},[e]),n}function yU(e){return e}function bU(e,t){t===void 0&&(t=yU);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var s=t(o,r);return n.push(s),function(){n=n.filter(function(a){return a!==s})}},assignSyncMedium:function(o){for(r=!0;n.length;){var s=n;n=[],s.forEach(o)}n={push:function(a){return o(a)},filter:function(){return n}}},assignMedium:function(o){r=!0;var s=[];if(n.length){var a=n;n=[],a.forEach(o),s=n}var l=function(){var u=s;s=[],u.forEach(o)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(u){s.push(u),c()},filter:function(u){return s=s.filter(u),n}}}};return i}function xU(e){e===void 0&&(e={});var t=bU(null);return t.options=ni({async:!0,ssr:!1},e),t}var d_=function(e){var t=e.sideCar,n=f_(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return S.createElement(r,ni({},n))};d_.isSideCarExport=!0;function SU(e,t){return e.useMedium(t),d_}var h_=xU(),Qv=function(){},xg=S.forwardRef(function(e,t){var n=S.useRef(null),r=S.useState({onScrollCapture:Qv,onWheelCapture:Qv,onTouchMoveCapture:Qv}),i=r[0],o=r[1],s=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,f=e.shards,d=e.sideCar,h=e.noRelative,p=e.noIsolation,g=e.inert,y=e.allowPinchZoom,v=e.as,b=v===void 0?"div":v,x=e.gapMode,m=f_(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=d,T=vU([n,t]),C=ni(ni({},m),i);return S.createElement(S.Fragment,null,u&&S.createElement(E,{sideCar:h_,removeScrollBar:c,shards:f,noRelative:h,noIsolation:p,inert:g,setCallbacks:o,allowPinchZoom:!!y,lockRef:n,gapMode:x}),s?S.cloneElement(S.Children.only(a),ni(ni({},C),{ref:T})):S.createElement(b,ni({},C,{className:l,ref:T}),a))});xg.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};xg.classNames={fullWidth:Hh,zeroRight:Bh};var wU=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function EU(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=wU();return t&&e.setAttribute("nonce",t),e}function CU(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function TU(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var MU=function(){var e=0,t=null;return{add:function(n){e==0&&(t=EU())&&(CU(t,n),TU(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},OU=function(){var e=MU();return function(t,n){S.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},p_=function(){var e=OU(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},AU={left:0,top:0,right:0,gap:0},Jv=function(e){return parseInt(e||"",10)||0},kU=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[Jv(n),Jv(r),Jv(i)]},DU=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return AU;var t=kU(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},NU=p_(),Dl="data-scroll-locked",_U=function(e,t,n,r){var i=e.left,o=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),`
293
+ .`.concat(hU,` {
294
+ overflow: hidden `).concat(r,`;
295
+ padding-right: `).concat(a,"px ").concat(r,`;
296
+ }
297
+ body[`).concat(Dl,`] {
298
+ overflow: hidden `).concat(r,`;
299
+ overscroll-behavior: contain;
300
+ `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
301
+ padding-left: `.concat(i,`px;
302
+ padding-top: `).concat(o,`px;
303
+ padding-right: `).concat(s,`px;
304
+ margin-left:0;
305
+ margin-top:0;
306
+ margin-right: `).concat(a,"px ").concat(r,`;
307
+ `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
308
+ }
309
+
310
+ .`).concat(Bh,` {
311
+ right: `).concat(a,"px ").concat(r,`;
312
+ }
313
+
314
+ .`).concat(Hh,` {
315
+ margin-right: `).concat(a,"px ").concat(r,`;
316
+ }
317
+
318
+ .`).concat(Bh," .").concat(Bh,` {
319
+ right: 0 `).concat(r,`;
320
+ }
321
+
322
+ .`).concat(Hh," .").concat(Hh,` {
323
+ margin-right: 0 `).concat(r,`;
324
+ }
325
+
326
+ body[`).concat(Dl,`] {
327
+ `).concat(pU,": ").concat(a,`px;
328
+ }
329
+ `)},WC=function(){var e=parseInt(document.body.getAttribute(Dl)||"0",10);return isFinite(e)?e:0},RU=function(){S.useEffect(function(){return document.body.setAttribute(Dl,(WC()+1).toString()),function(){var e=WC()-1;e<=0?document.body.removeAttribute(Dl):document.body.setAttribute(Dl,e.toString())}},[])},LU=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;RU();var o=S.useMemo(function(){return DU(i)},[i]);return S.createElement(NU,{styles:_U(o,!t,i,n?"":"!important")})},hb=!1;if(typeof window<"u")try{var qd=Object.defineProperty({},"passive",{get:function(){return hb=!0,!0}});window.addEventListener("test",qd,qd),window.removeEventListener("test",qd,qd)}catch{hb=!1}var Ua=hb?{passive:!1}:!1,jU=function(e){return e.tagName==="TEXTAREA"},m_=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!jU(e)&&n[t]==="visible")},zU=function(e){return m_(e,"overflowY")},IU=function(e){return m_(e,"overflowX")},YC=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=g_(e,r);if(i){var o=v_(e,r),s=o[1],a=o[2];if(s>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},PU=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},BU=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},g_=function(e,t){return e==="v"?zU(t):IU(t)},v_=function(e,t){return e==="v"?PU(t):BU(t)},HU=function(e,t){return e==="h"&&t==="rtl"?-1:1},$U=function(e,t,n,r,i){var o=HU(e,window.getComputedStyle(t).direction),s=o*r,a=n.target,l=t.contains(a),c=!1,u=s>0,f=0,d=0;do{if(!a)break;var h=v_(e,a),p=h[0],g=h[1],y=h[2],v=g-y-o*p;(p||v)&&g_(e,a)&&(f+=v,d+=p);var b=a.parentNode;a=b&&b.nodeType===Node.DOCUMENT_FRAGMENT_NODE?b.host:b}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(u&&Math.abs(f)<1||!u&&Math.abs(d)<1)&&(c=!0),c},Kd=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},GC=function(e){return[e.deltaX,e.deltaY]},XC=function(e){return e&&"current"in e?e.current:e},UU=function(e,t){return e[0]===t[0]&&e[1]===t[1]},VU=function(e){return`
330
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
331
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
332
+ `)},FU=0,Va=[];function qU(e){var t=S.useRef([]),n=S.useRef([0,0]),r=S.useRef(),i=S.useState(FU++)[0],o=S.useState(p_)[0],s=S.useRef(e);S.useEffect(function(){s.current=e},[e]),S.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var g=dU([e.lockRef.current],(e.shards||[]).map(XC),!0).filter(Boolean);return g.forEach(function(y){return y.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),g.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var a=S.useCallback(function(g,y){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!s.current.allowPinchZoom;var v=Kd(g),b=n.current,x="deltaX"in g?g.deltaX:b[0]-v[0],m="deltaY"in g?g.deltaY:b[1]-v[1],E,T=g.target,C=Math.abs(x)>Math.abs(m)?"h":"v";if("touches"in g&&C==="h"&&T.type==="range")return!1;var O=window.getSelection(),A=O&&O.anchorNode,k=A?A===T||A.contains(T):!1;if(k)return!1;var z=YC(C,T);if(!z)return!0;if(z?E=C:(E=C==="v"?"h":"v",z=YC(C,T)),!z)return!1;if(!r.current&&"changedTouches"in g&&(x||m)&&(r.current=E),!E)return!0;var _=r.current||E;return $U(_,y,g,_==="h"?x:m)},[]),l=S.useCallback(function(g){var y=g;if(!(!Va.length||Va[Va.length-1]!==o)){var v="deltaY"in y?GC(y):Kd(y),b=t.current.filter(function(E){return E.name===y.type&&(E.target===y.target||y.target===E.shadowParent)&&UU(E.delta,v)})[0];if(b&&b.should){y.cancelable&&y.preventDefault();return}if(!b){var x=(s.current.shards||[]).map(XC).filter(Boolean).filter(function(E){return E.contains(y.target)}),m=x.length>0?a(y,x[0]):!s.current.noIsolation;m&&y.cancelable&&y.preventDefault()}}},[]),c=S.useCallback(function(g,y,v,b){var x={name:g,delta:y,target:v,should:b,shadowParent:KU(v)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(m){return m!==x})},1)},[]),u=S.useCallback(function(g){n.current=Kd(g),r.current=void 0},[]),f=S.useCallback(function(g){c(g.type,GC(g),g.target,a(g,e.lockRef.current))},[]),d=S.useCallback(function(g){c(g.type,Kd(g),g.target,a(g,e.lockRef.current))},[]);S.useEffect(function(){return Va.push(o),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:d}),document.addEventListener("wheel",l,Ua),document.addEventListener("touchmove",l,Ua),document.addEventListener("touchstart",u,Ua),function(){Va=Va.filter(function(g){return g!==o}),document.removeEventListener("wheel",l,Ua),document.removeEventListener("touchmove",l,Ua),document.removeEventListener("touchstart",u,Ua)}},[]);var h=e.removeScrollBar,p=e.inert;return S.createElement(S.Fragment,null,p?S.createElement(o,{styles:VU(i)}):null,h?S.createElement(LU,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function KU(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const WU=SU(h_,qU);var ld=S.forwardRef(function(e,t){return S.createElement(xg,ni({},e,{ref:t,sideCar:WU}))});ld.classNames=xg.classNames;var YU=[" ","Enter","ArrowUp","ArrowDown"],GU=[" ","Enter"],ha="Select",[Sg,wg,XU]=rS(ha),[Mc]=ms(ha,[XU,Tc]),Eg=Tc(),[QU,gs]=Mc(ha),[JU,ZU]=Mc(ha),y_=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:o,value:s,defaultValue:a,onValueChange:l,dir:c,name:u,autoComplete:f,disabled:d,required:h,form:p}=e,g=Eg(t),[y,v]=S.useState(null),[b,x]=S.useState(null),[m,E]=S.useState(!1),T=iS(c),[C,O]=Xl({prop:r,defaultProp:i??!1,onChange:o,caller:ha}),[A,k]=Xl({prop:s,defaultProp:a,onChange:l,caller:ha}),z=S.useRef(null),_=y?p||!!y.closest("form"):!0,[H,U]=S.useState(new Set),V=Array.from(H).map(D=>D.props.value).join(";");return w.jsx(hS,{...g,children:w.jsxs(QU,{required:h,scope:t,trigger:y,onTriggerChange:v,valueNode:b,onValueNodeChange:x,valueNodeHasChildren:m,onValueNodeHasChildrenChange:E,contentId:ci(),value:A,onValueChange:k,open:C,onOpenChange:O,dir:T,triggerPointerDownPosRef:z,disabled:d,children:[w.jsx(Sg.Provider,{scope:t,children:w.jsx(JU,{scope:e.__scopeSelect,onNativeOptionAdd:S.useCallback(D=>{U(I=>new Set(I).add(D))},[]),onNativeOptionRemove:S.useCallback(D=>{U(I=>{const N=new Set(I);return N.delete(D),N})},[]),children:n})}),_?w.jsxs(I_,{"aria-hidden":!0,required:h,tabIndex:-1,name:u,autoComplete:f,value:A,onChange:D=>k(D.target.value),disabled:d,form:p,children:[A===void 0?w.jsx("option",{value:""}):null,Array.from(H)]},V):null]})})};y_.displayName=ha;var b_="SelectTrigger",x_=S.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,o=Eg(n),s=gs(b_,n),a=s.disabled||r,l=Ie(t,s.onTriggerChange),c=wg(n),u=S.useRef("touch"),[f,d,h]=B_(g=>{const y=c().filter(x=>!x.disabled),v=y.find(x=>x.value===s.value),b=H_(y,g,v);b!==void 0&&s.onValueChange(b.value)}),p=g=>{a||(s.onOpenChange(!0),h()),g&&(s.triggerPointerDownPosRef.current={x:Math.round(g.pageX),y:Math.round(g.pageY)})};return w.jsx(vg,{asChild:!0,...o,children:w.jsx(xe.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":P_(s.value)?"":void 0,...i,ref:l,onClick:Q(i.onClick,g=>{g.currentTarget.focus(),u.current!=="mouse"&&p(g)}),onPointerDown:Q(i.onPointerDown,g=>{u.current=g.pointerType;const y=g.target;y.hasPointerCapture(g.pointerId)&&y.releasePointerCapture(g.pointerId),g.button===0&&g.ctrlKey===!1&&g.pointerType==="mouse"&&(p(g),g.preventDefault())}),onKeyDown:Q(i.onKeyDown,g=>{const y=f.current!=="";!(g.ctrlKey||g.altKey||g.metaKey)&&g.key.length===1&&d(g.key),!(y&&g.key===" ")&&YU.includes(g.key)&&(p(),g.preventDefault())})})})});x_.displayName=b_;var S_="SelectValue",w_=S.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:s="",...a}=e,l=gs(S_,n),{onValueNodeHasChildrenChange:c}=l,u=o!==void 0,f=Ie(t,l.onValueNodeChange);return ln(()=>{c(u)},[c,u]),w.jsx(xe.span,{...a,ref:f,style:{pointerEvents:"none"},children:P_(l.value)?w.jsx(w.Fragment,{children:s}):o})});w_.displayName=S_;var e8="SelectIcon",t8=S.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return w.jsx(xe.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});t8.displayName=e8;var n8="SelectPortal",E_=e=>w.jsx(yg,{asChild:!0,...e});E_.displayName=n8;var pa="SelectContent",C_=S.forwardRef((e,t)=>{const n=gs(pa,e.__scopeSelect),[r,i]=S.useState();if(ln(()=>{i(new DocumentFragment)},[]),!n.open){const o=r;return o?ke.createPortal(w.jsx(T_,{scope:e.__scopeSelect,children:w.jsx(Sg.Slot,{scope:e.__scopeSelect,children:w.jsx("div",{children:e.children})})}),o):null}return w.jsx(M_,{...e,ref:t})});C_.displayName=pa;var _r=10,[T_,vs]=Mc(pa),r8="SelectContentImpl",i8=fa("SelectContent.RemoveScroll"),M_=S.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:s,side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:f,collisionBoundary:d,collisionPadding:h,sticky:p,hideWhenDetached:g,avoidCollisions:y,...v}=e,b=gs(pa,n),[x,m]=S.useState(null),[E,T]=S.useState(null),C=Ie(t,Y=>m(Y)),[O,A]=S.useState(null),[k,z]=S.useState(null),_=wg(n),[H,U]=S.useState(!1),V=S.useRef(!1);S.useEffect(()=>{if(x)return bg(x)},[x]),dg();const D=S.useCallback(Y=>{const[re,...pe]=_().map(ce=>ce.ref.current),[Z]=pe.slice(-1),le=document.activeElement;for(const ce of Y)if(ce===le||(ce==null||ce.scrollIntoView({block:"nearest"}),ce===re&&E&&(E.scrollTop=0),ce===Z&&E&&(E.scrollTop=E.scrollHeight),ce==null||ce.focus(),document.activeElement!==le))return},[_,E]),I=S.useCallback(()=>D([O,x]),[D,O,x]);S.useEffect(()=>{H&&I()},[H,I]);const{onOpenChange:N,triggerPointerDownPosRef:L}=b;S.useEffect(()=>{if(x){let Y={x:0,y:0};const re=Z=>{var le,ce;Y={x:Math.abs(Math.round(Z.pageX)-(((le=L.current)==null?void 0:le.x)??0)),y:Math.abs(Math.round(Z.pageY)-(((ce=L.current)==null?void 0:ce.y)??0))}},pe=Z=>{Y.x<=10&&Y.y<=10?Z.preventDefault():x.contains(Z.target)||N(!1),document.removeEventListener("pointermove",re),L.current=null};return L.current!==null&&(document.addEventListener("pointermove",re),document.addEventListener("pointerup",pe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",re),document.removeEventListener("pointerup",pe,{capture:!0})}}},[x,N,L]),S.useEffect(()=>{const Y=()=>N(!1);return window.addEventListener("blur",Y),window.addEventListener("resize",Y),()=>{window.removeEventListener("blur",Y),window.removeEventListener("resize",Y)}},[N]);const[F,te]=B_(Y=>{const re=_().filter(le=>!le.disabled),pe=re.find(le=>le.ref.current===document.activeElement),Z=H_(re,Y,pe);Z&&setTimeout(()=>Z.ref.current.focus())}),ae=S.useCallback((Y,re,pe)=>{const Z=!V.current&&!pe;(b.value!==void 0&&b.value===re||Z)&&(A(Y),Z&&(V.current=!0))},[b.value]),Ee=S.useCallback(()=>x==null?void 0:x.focus(),[x]),ge=S.useCallback((Y,re,pe)=>{const Z=!V.current&&!pe;(b.value!==void 0&&b.value===re||Z)&&z(Y)},[b.value]),X=r==="popper"?pb:O_,De=X===pb?{side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:f,collisionBoundary:d,collisionPadding:h,sticky:p,hideWhenDetached:g,avoidCollisions:y}:{};return w.jsx(T_,{scope:n,content:x,viewport:E,onViewportChange:T,itemRefCallback:ae,selectedItem:O,onItemLeave:Ee,itemTextRefCallback:ge,focusSelectedItem:I,selectedItemText:k,position:r,isPositioned:H,searchRef:F,children:w.jsx(ld,{as:i8,allowPinchZoom:!0,children:w.jsx(sd,{asChild:!0,trapped:b.open,onMountAutoFocus:Y=>{Y.preventDefault()},onUnmountAutoFocus:Q(i,Y=>{var re;(re=b.trigger)==null||re.focus({preventScroll:!0}),Y.preventDefault()}),children:w.jsx(od,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:Y=>Y.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:w.jsx(X,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:Y=>Y.preventDefault(),...v,...De,onPlaced:()=>U(!0),ref:C,style:{display:"flex",flexDirection:"column",outline:"none",...v.style},onKeyDown:Q(v.onKeyDown,Y=>{const re=Y.ctrlKey||Y.altKey||Y.metaKey;if(Y.key==="Tab"&&Y.preventDefault(),!re&&Y.key.length===1&&te(Y.key),["ArrowUp","ArrowDown","Home","End"].includes(Y.key)){let Z=_().filter(le=>!le.disabled).map(le=>le.ref.current);if(["ArrowUp","End"].includes(Y.key)&&(Z=Z.slice().reverse()),["ArrowUp","ArrowDown"].includes(Y.key)){const le=Y.target,ce=Z.indexOf(le);Z=Z.slice(ce+1)}setTimeout(()=>D(Z)),Y.preventDefault()}})})})})})})});M_.displayName=r8;var o8="SelectItemAlignedPosition",O_=S.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,o=gs(pa,n),s=vs(pa,n),[a,l]=S.useState(null),[c,u]=S.useState(null),f=Ie(t,C=>u(C)),d=wg(n),h=S.useRef(!1),p=S.useRef(!0),{viewport:g,selectedItem:y,selectedItemText:v,focusSelectedItem:b}=s,x=S.useCallback(()=>{if(o.trigger&&o.valueNode&&a&&c&&g&&y&&v){const C=o.trigger.getBoundingClientRect(),O=c.getBoundingClientRect(),A=o.valueNode.getBoundingClientRect(),k=v.getBoundingClientRect();if(o.dir!=="rtl"){const le=k.left-O.left,ce=A.left-le,Xe=C.left-ce,dt=C.width+Xe,Zt=Math.max(dt,O.width),en=window.innerWidth-_r,tn=MC(ce,[_r,Math.max(_r,en-Zt)]);a.style.minWidth=dt+"px",a.style.left=tn+"px"}else{const le=O.right-k.right,ce=window.innerWidth-A.right-le,Xe=window.innerWidth-C.right-ce,dt=C.width+Xe,Zt=Math.max(dt,O.width),en=window.innerWidth-_r,tn=MC(ce,[_r,Math.max(_r,en-Zt)]);a.style.minWidth=dt+"px",a.style.right=tn+"px"}const z=d(),_=window.innerHeight-_r*2,H=g.scrollHeight,U=window.getComputedStyle(c),V=parseInt(U.borderTopWidth,10),D=parseInt(U.paddingTop,10),I=parseInt(U.borderBottomWidth,10),N=parseInt(U.paddingBottom,10),L=V+D+H+N+I,F=Math.min(y.offsetHeight*5,L),te=window.getComputedStyle(g),ae=parseInt(te.paddingTop,10),Ee=parseInt(te.paddingBottom,10),ge=C.top+C.height/2-_r,X=_-ge,De=y.offsetHeight/2,Y=y.offsetTop+De,re=V+D+Y,pe=L-re;if(re<=ge){const le=z.length>0&&y===z[z.length-1].ref.current;a.style.bottom="0px";const ce=c.clientHeight-g.offsetTop-g.offsetHeight,Xe=Math.max(X,De+(le?Ee:0)+ce+I),dt=re+Xe;a.style.height=dt+"px"}else{const le=z.length>0&&y===z[0].ref.current;a.style.top="0px";const Xe=Math.max(ge,V+g.offsetTop+(le?ae:0)+De)+pe;a.style.height=Xe+"px",g.scrollTop=re-ge+g.offsetTop}a.style.margin=`${_r}px 0`,a.style.minHeight=F+"px",a.style.maxHeight=_+"px",r==null||r(),requestAnimationFrame(()=>h.current=!0)}},[d,o.trigger,o.valueNode,a,c,g,y,v,o.dir,r]);ln(()=>x(),[x]);const[m,E]=S.useState();ln(()=>{c&&E(window.getComputedStyle(c).zIndex)},[c]);const T=S.useCallback(C=>{C&&p.current===!0&&(x(),b==null||b(),p.current=!1)},[x,b]);return w.jsx(a8,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:h,onScrollButtonChange:T,children:w.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:m},children:w.jsx(xe.div,{...i,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});O_.displayName=o8;var s8="SelectPopperPosition",pb=S.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=_r,...o}=e,s=Eg(n);return w.jsx(pS,{...s,...o,ref:t,align:r,collisionPadding:i,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});pb.displayName=s8;var[a8,gS]=Mc(pa,{}),mb="SelectViewport",A_=S.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,o=vs(mb,n),s=gS(mb,n),a=Ie(t,o.onViewportChange),l=S.useRef(0);return w.jsxs(w.Fragment,{children:[w.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),w.jsx(Sg.Slot,{scope:n,children:w.jsx(xe.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:Q(i.onScroll,c=>{const u=c.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:d}=s;if(d!=null&&d.current&&f){const h=Math.abs(l.current-u.scrollTop);if(h>0){const p=window.innerHeight-_r*2,g=parseFloat(f.style.minHeight),y=parseFloat(f.style.height),v=Math.max(g,y);if(v<p){const b=v+h,x=Math.min(p,b),m=b-x;f.style.height=x+"px",f.style.bottom==="0px"&&(u.scrollTop=m>0?m:0,f.style.justifyContent="flex-end")}}}l.current=u.scrollTop})})})]})});A_.displayName=mb;var k_="SelectGroup",[l8,c8]=Mc(k_),u8=S.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=ci();return w.jsx(l8,{scope:n,id:i,children:w.jsx(xe.div,{role:"group","aria-labelledby":i,...r,ref:t})})});u8.displayName=k_;var D_="SelectLabel",f8=S.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=c8(D_,n);return w.jsx(xe.div,{id:i.id,...r,ref:t})});f8.displayName=D_;var Hp="SelectItem",[d8,N_]=Mc(Hp),__=S.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...s}=e,a=gs(Hp,n),l=vs(Hp,n),c=a.value===r,[u,f]=S.useState(o??""),[d,h]=S.useState(!1),p=Ie(t,b=>{var x;return(x=l.itemRefCallback)==null?void 0:x.call(l,b,r,i)}),g=ci(),y=S.useRef("touch"),v=()=>{i||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return w.jsx(d8,{scope:n,value:r,disabled:i,textId:g,isSelected:c,onItemTextChange:S.useCallback(b=>{f(x=>x||((b==null?void 0:b.textContent)??"").trim())},[]),children:w.jsx(Sg.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:w.jsx(xe.div,{role:"option","aria-labelledby":g,"data-highlighted":d?"":void 0,"aria-selected":c&&d,"data-state":c?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...s,ref:p,onFocus:Q(s.onFocus,()=>h(!0)),onBlur:Q(s.onBlur,()=>h(!1)),onClick:Q(s.onClick,()=>{y.current!=="mouse"&&v()}),onPointerUp:Q(s.onPointerUp,()=>{y.current==="mouse"&&v()}),onPointerDown:Q(s.onPointerDown,b=>{y.current=b.pointerType}),onPointerMove:Q(s.onPointerMove,b=>{var x;y.current=b.pointerType,i?(x=l.onItemLeave)==null||x.call(l):y.current==="mouse"&&b.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Q(s.onPointerLeave,b=>{var x;b.currentTarget===document.activeElement&&((x=l.onItemLeave)==null||x.call(l))}),onKeyDown:Q(s.onKeyDown,b=>{var m;((m=l.searchRef)==null?void 0:m.current)!==""&&b.key===" "||(GU.includes(b.key)&&v(),b.key===" "&&b.preventDefault())})})})})});__.displayName=Hp;var su="SelectItemText",R_=S.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...o}=e,s=gs(su,n),a=vs(su,n),l=N_(su,n),c=ZU(su,n),[u,f]=S.useState(null),d=Ie(t,v=>f(v),l.onItemTextChange,v=>{var b;return(b=a.itemTextRefCallback)==null?void 0:b.call(a,v,l.value,l.disabled)}),h=u==null?void 0:u.textContent,p=S.useMemo(()=>w.jsx("option",{value:l.value,disabled:l.disabled,children:h},l.value),[l.disabled,l.value,h]),{onNativeOptionAdd:g,onNativeOptionRemove:y}=c;return ln(()=>(g(p),()=>y(p)),[g,y,p]),w.jsxs(w.Fragment,{children:[w.jsx(xe.span,{id:l.textId,...o,ref:d}),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?ke.createPortal(o.children,s.valueNode):null]})});R_.displayName=su;var L_="SelectItemIndicator",j_=S.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return N_(L_,n).isSelected?w.jsx(xe.span,{"aria-hidden":!0,...r,ref:t}):null});j_.displayName=L_;var gb="SelectScrollUpButton",h8=S.forwardRef((e,t)=>{const n=vs(gb,e.__scopeSelect),r=gS(gb,e.__scopeSelect),[i,o]=S.useState(!1),s=Ie(t,r.onScrollButtonChange);return ln(()=>{if(n.viewport&&n.isPositioned){let a=function(){const c=l.scrollTop>0;o(c)};const l=n.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),i?w.jsx(z_,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}}):null});h8.displayName=gb;var vb="SelectScrollDownButton",p8=S.forwardRef((e,t)=>{const n=vs(vb,e.__scopeSelect),r=gS(vb,e.__scopeSelect),[i,o]=S.useState(!1),s=Ie(t,r.onScrollButtonChange);return ln(()=>{if(n.viewport&&n.isPositioned){let a=function(){const c=l.scrollHeight-l.clientHeight,u=Math.ceil(l.scrollTop)<c;o(u)};const l=n.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),i?w.jsx(z_,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}}):null});p8.displayName=vb;var z_=S.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,o=vs("SelectScrollButton",n),s=S.useRef(null),a=wg(n),l=S.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return S.useEffect(()=>()=>l(),[l]),ln(()=>{var u;const c=a().find(f=>f.ref.current===document.activeElement);(u=c==null?void 0:c.ref.current)==null||u.scrollIntoView({block:"nearest"})},[a]),w.jsx(xe.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:Q(i.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:Q(i.onPointerMove,()=>{var c;(c=o.onItemLeave)==null||c.call(o),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:Q(i.onPointerLeave,()=>{l()})})}),m8="SelectSeparator",g8=S.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return w.jsx(xe.div,{"aria-hidden":!0,...r,ref:t})});g8.displayName=m8;var yb="SelectArrow",v8=S.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Eg(n),o=gs(yb,n),s=vs(yb,n);return o.open&&s.position==="popper"?w.jsx(mS,{...i,...r,ref:t}):null});v8.displayName=yb;var y8="SelectBubbleInput",I_=S.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const i=S.useRef(null),o=Ie(r,i),s=sU(t);return S.useEffect(()=>{const a=i.current;if(!a)return;const l=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(s!==t&&u){const f=new Event("change",{bubbles:!0});u.call(a,t),a.dispatchEvent(f)}},[s,t]),w.jsx(xe.select,{...n,style:{...c_,...n.style},ref:o,defaultValue:t})});I_.displayName=y8;function P_(e){return e===""||e===void 0}function B_(e){const t=mi(e),n=S.useRef(""),r=S.useRef(0),i=S.useCallback(s=>{const a=n.current+s;t(a),function l(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(a)},[t]),o=S.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return S.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}function H_(e,t,n){const i=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let s=b8(e,Math.max(o,0));i.length===1&&(s=s.filter(c=>c!==n));const l=s.find(c=>c.textValue.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function b8(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var x8=y_,S8=x_,w8=w_,E8=E_,C8=C_,T8=A_,QC=__,JC=R_,ZC=j_;const M8=["done"];function vS({layer:e,className:t}){const n=ir();function r(i){const o=i==="—"?null:i;n({type:"SET_LAYER_STATUS",layerId:e.id,status:o})}return w.jsxs(x8,{value:e.status||"-",onValueChange:r,children:[w.jsx(S8,{tabIndex:0,className:Te("inline-flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-full border-2 border-transparent bg-transparent text-base-content/60 opacity-0 transition-opacity focus:border-black/10 focus:opacity-100 focus:outline-hidden active:border-transparent group-hover:opacity-100 data-[state=open]:opacity-100",t),"aria-label":"Select status",onPointerDown:i=>{i.preventDefault()},onClick:i=>{i.stopPropagation()},children:w.jsx(w8,{children:w.jsx(DH,{className:"h-4 w-4"})})}),w.jsx(E8,{children:w.jsx(C8,{position:"popper",className:"z-10 w-40 rounded bg-base-100 shadow-xs focus:outline-hidden",children:w.jsxs(T8,{children:[w.jsxs(QC,{value:"—",className:"relative flex cursor-pointer justify-between gap-1 px-2 py-0.5 first:rounded-t last:rounded-b focus:outline-hidden data-[highlighted]:bg-base-200",children:[w.jsx(JC,{children:"—"}),w.jsx(ZC,{children:w.jsx("span",{"aria-hidden":!0,children:" ✓"})})]}),M8.map(i=>w.jsxs(QC,{value:i,className:"relative flex cursor-pointer justify-between gap-1 px-2 py-0.5 first:rounded-t last:rounded-b focus:outline-hidden data-[highlighted]:bg-base-200",children:[w.jsx(JC,{children:i.charAt(0).toUpperCase()+i.slice(1)}),w.jsx(ZC,{children:w.jsx("span",{"aria-hidden":!0,children:" ✓"})})]},i))]})})})]})}function O8({layer:e,tasks:t,variant:n}){const r=S.useRef(null),i=ir(),o=oH(t),s="opacity-[var(--idle-opacity)] group-hover:opacity-[var(--hover-opacity)]";return w.jsx("div",{className:"flex gap-1",children:w.jsxs("form",{className:"flex w-full items-start gap-1",onSubmit:a=>{if(a.preventDefault(),!(r!=null&&r.current))return;const l=r.current.value.trim();l&&(i({type:"CREATE_TASK",id:crypto.randomUUID(),layerId:e.id,name:l,sorting:o}),r.current.value="",r.current.focus())},children:[n==="mobile"&&w.jsx(Yl,{className:Te("pointer-events-none opacity-0",s)}),w.jsx("button",{type:"button",tabIndex:-1,className:Te("pointer-events-none h-4 w-4 flex-none translate-y-0.5 rounded-full border border-base-content/30 shadow-inner",s),"aria-hidden":"true"}),w.jsx("input",{ref:r,"data-task-input":!0,"data-1p-ignore":!0,"data-lpignore":!0,"data-form-type":"other",name:"name",placeholder:" ",autoComplete:"off",className:Te("w-1/2 translate-x-1 resize-none border-0 border-base-content/20 border-b bg-transparent p-0.5 pb-0 text-[12px] text-base-content/60 leading-[16px] transition-all focus:w-full focus:border-0 focus:shadow-md focus:ring-1 focus:ring-indigo-600",s)}),w.jsx("button",{type:"submit",className:"hidden"})]})})}var A8=Object.create,$_=Object.defineProperty,k8=Object.defineProperties,D8=Object.getOwnPropertyDescriptor,N8=Object.getOwnPropertyDescriptors,$p=Object.getOwnPropertySymbols,U_=Object.prototype.hasOwnProperty,V_=Object.prototype.propertyIsEnumerable,_8=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),cd=e=>{throw TypeError(e)},bb=(e,t,n)=>t in e?$_(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,R8=(e,t)=>{for(var n in t||(t={}))U_.call(t,n)&&bb(e,n,t[n]);if($p)for(var n of $p(t))V_.call(t,n)&&bb(e,n,t[n]);return e},L8=(e,t)=>k8(e,N8(t)),j8=(e,t)=>{var n={};for(var r in e)U_.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&$p)for(var r of $p(e))t.indexOf(r)<0&&V_.call(e,r)&&(n[r]=e[r]);return n},z8=e=>{var t;return[,,,A8((t=void 0)!=null?t:null)]},F_=["class","method","getter","setter","accessor","field","value","get","set"],au=e=>e!==void 0&&typeof e!="function"?cd("Function expected"):e,I8=(e,t,n,r,i)=>({kind:F_[e],name:t,metadata:r,addInitializer:o=>n._?cd("Already initialized"):i.push(au(o||null))}),P8=(e,t)=>bb(t,_8("metadata"),e[3]),Wd=(e,t,n,r)=>{for(var i=0,o=e[t>>1],s=o&&o.length;i<s;i++)t&1?o[i].call(n):r=o[i].call(n,r);return r},q_=(e,t,n,r,i,o)=>{for(var s,a,l,c,u,f=t&7,d=!1,h=!1,p=e.length+1,g=F_[f+5],y=e[p-1]=[],v=e[p]||(e[p]=[]),b=(i=i.prototype,D8({get[n](){return lu(this,o)},set[n](m){return Ps(this,o,m)}},n)),x=r.length-1;x>=0;x--)c=I8(f,n,l={},e[3],v),c.static=d,c.private=h,u=c.access={has:m=>n in m},u.get=m=>m[n],u.set=(m,E)=>m[n]=E,a=(0,r[x])({get:b.get,set:b.set},c),l._=1,a===void 0?au(a)&&(b[g]=a):typeof a!="object"||a===null?cd("Object expected"):(au(s=a.get)&&(b.get=s),au(s=a.set)&&(b.set=s),au(s=a.init)&&y.unshift(s));return b&&$_(i,n,b),i},K_=(e,t,n)=>t.has(e)||cd("Cannot "+n),lu=(e,t,n)=>(K_(e,t,"read from private field"),t.get(e)),Pc=(e,t,n)=>t.has(e)?cd("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Ps=(e,t,n,r)=>(K_(e,t,"write to private field"),t.set(e,n),n);function Fs(e){return e instanceof xS||e instanceof X_}var Yd=10,B8=class extends an{constructor(e){super(e);const t=Bn(()=>{const{dragOperation:r}=e;if(pf(r.activatorEvent)&&Fs(r.source)&&r.status.initialized){const i=e.registry.plugins.get(nd);if(i)return i.disable(),()=>i.enable()}}),n=e.monitor.addEventListener("dragmove",(r,i)=>{queueMicrotask(()=>{if(this.disabled||r.defaultPrevented||!r.nativeEvent)return;const{dragOperation:o}=i;if(!pf(r.nativeEvent)||!Fs(o.source)||!o.shape)return;const{actions:s,collisionObserver:a,registry:l}=i,{by:c}=r;if(!c)return;const u=H8(c),{source:f,target:d}=o,{center:h}=o.shape.current,p=[],g=[];mt(()=>{for(const E of l.droppables){const{id:T}=E;if(!E.accepts(f)||T===(d==null?void 0:d.id)&&Fs(E)||!E.element)continue;let C=E.shape;const O=new Lr(E.element,{getBoundingClientRect:A=>df(A,void 0,.2)});!O.height||!O.width||(u=="down"&&h.y+Yd<O.center.y||u=="up"&&h.y-Yd>O.center.y||u=="left"&&h.x-Yd>O.center.x||u=="right"&&h.x+Yd<O.center.x)&&(p.push(E),E.shape=O,g.push(()=>E.shape=C))}}),r.preventDefault(),a.disable();const y=a.computeCollisions(p,IB);mt(()=>g.forEach(E=>E()));const[v]=y;if(!v)return;const{id:b}=v,{index:x,group:m}=f.sortable;s.setDropTarget(b).then(()=>{const{source:E,target:T,shape:C}=o;if(!E||!Fs(E)||!C)return;const{index:O,group:A,target:k}=E.sortable,z=x!==O||m!==A,_=z?k:T==null?void 0:T.element;if(!_)return;VD(_);const H=new Lr(_);if(!H)return;const U=eo.delta(H,eo.from(C.current.boundingRectangle),E.alignment);s.move({by:U}),z?s.setDropTarget(E.id).then(()=>a.enable()):a.enable()})})});this.destroy=()=>{n(),t()}}};function H8(e){const{x:t,y:n}=e;if(t>0)return"right";if(t<0)return"left";if(n>0)return"down";if(n<0)return"up"}var $8=Object.defineProperty,U8=Object.defineProperties,V8=Object.getOwnPropertyDescriptors,eT=Object.getOwnPropertySymbols,F8=Object.prototype.hasOwnProperty,q8=Object.prototype.propertyIsEnumerable,tT=(e,t,n)=>t in e?$8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,nT=(e,t)=>{for(var n in t||(t={}))F8.call(t,n)&&tT(e,n,t[n]);if(eT)for(var n of eT(t))q8.call(t,n)&&tT(e,n,t[n]);return e},rT=(e,t)=>U8(e,V8(t));function K8(e,t,n){if(t===n)return e;const r=e.slice();return r.splice(n,0,r.splice(t,1)[0]),r}function W8(e,t,n){var r,i;const{source:o,target:s,canceled:a}=t.operation;if(!o||!s||a)return"preventDefault"in t&&t.preventDefault(),e;const l=(x,m)=>x===m||typeof x=="object"&&"id"in x&&x.id===m;if(Array.isArray(e)){const x=e.findIndex(E=>l(E,o.id)),m=e.findIndex(E=>l(E,s.id));if(x===-1||m===-1)return e;if(!a&&"index"in o&&typeof o.index=="number"){const E=o.index;if(E!==x)return n(e,x,E)}return n(e,x,m)}const c=Object.entries(e);let u=-1,f,d=-1,h;for(const[x,m]of c)if(u===-1&&(u=m.findIndex(E=>l(E,o.id)),u!==-1&&(f=x)),d===-1&&(d=m.findIndex(E=>l(E,s.id)),d!==-1&&(h=x)),u!==-1&&d!==-1)break;if(!o.manager)return e;const{dragOperation:p}=o.manager,g=(i=(r=p.shape)==null?void 0:r.current.center)!=null?i:p.position.current;if(h==null&&s.id in e){const x=s.shape&&g.y>s.shape.center.y?e[s.id].length:0;h=s.id,d=x}if(f==null||h==null||f===h&&u===d)return"preventDefault"in t&&t.preventDefault(),e;if(f===h)return rT(nT({},e),{[f]:n(e[f],u,d)});const v=s.shape&&Math.round(g.y)>Math.round(s.shape.center.y)?1:0,b=e[f][u];return rT(nT({},e),{[f]:[...e[f].slice(0,u),...e[f].slice(u+1)],[h]:[...e[h].slice(0,d+v),b,...e[h].slice(d+v)]})}function Y8(e,t){return W8(e,t,K8)}var iT="__default__",G8=class extends an{constructor(e){super(e);const t=()=>{const r=new Map;for(const i of e.registry.droppables)if(i instanceof xS){const{sortable:o}=i,{group:s}=o;let a=r.get(s);a||(a=new Set,r.set(s,a)),a.add(o)}for(const[i,o]of r)r.set(i,new Set(Gd(o)));return r},n=[e.monitor.addEventListener("dragover",(r,i)=>{if(this.disabled)return;const{dragOperation:o}=i,{source:s,target:a}=o;if(!Fs(s)||!Fs(a)||s.sortable===a.sortable)return;const l=t(),c=s.sortable.group===a.sortable.group,u=l.get(s.sortable.group),f=c?u:l.get(a.sortable.group);!u||!f||queueMicrotask(()=>{r.defaultPrevented||i.renderer.rendering.then(()=>{var d,h,p;const g=t();for(const[k,z]of l.entries()){const _=Array.from(z).entries();for(const[H,U]of _)if(U.index!==H||U.group!==k||!((d=g.get(k))!=null&&d.has(U)))return}const y=s.sortable.element,v=a.sortable.element;if(!v||!y||!c&&a.id===s.sortable.group)return;const b=Gd(u),x=c?b:Gd(f),m=(h=s.sortable.group)!=null?h:iT,E=(p=a.sortable.group)!=null?p:iT,T={[m]:b,[E]:x},C=Y8(T,r);if(T===C)return;const O=C[E].indexOf(s.sortable),A=C[E].indexOf(a.sortable);i.collisionObserver.disable(),oT(y,O,v,A),mt(()=>{for(const[k,z]of C[m].entries())z.index=k;if(!c)for(const[k,z]of C[E].entries())z.group=a.sortable.group,z.index=k}),i.actions.setDropTarget(s.id).then(()=>i.collisionObserver.enable())})})}),e.monitor.addEventListener("dragend",(r,i)=>{if(!r.canceled)return;const{dragOperation:o}=i,{source:s}=o;Fs(s)&&(s.sortable.initialIndex===s.sortable.index&&s.sortable.initialGroup===s.sortable.group||queueMicrotask(()=>{const a=t(),l=a.get(s.sortable.initialGroup);l&&i.renderer.rendering.then(()=>{for(const[h,p]of a.entries()){const g=Array.from(p).entries();for(const[y,v]of g)if(v.index!==y||v.group!==h)return}const c=Gd(l),u=s.sortable.element,f=c[s.sortable.initialIndex],d=f==null?void 0:f.element;!f||!d||!u||(oT(u,f.index,d,s.index),mt(()=>{for(const[h,p]of a.entries()){const g=Array.from(p).values();for(const y of g)y.index=y.initialIndex,y.group=y.initialGroup}}))})}))})];this.destroy=()=>{for(const r of n)r()}}};function oT(e,t,n,r){const i=r<t?"afterend":"beforebegin";n.insertAdjacentElement(i,e)}function X8(e,t){return e.index-t.index}function Gd(e){return Array.from(e).sort(X8)}var Q8=[B8,G8],W_={duration:250,easing:"cubic-bezier(0.25, 1, 0.5, 1)",idle:!1},Xd=new bP,Y_,G_,Po,yS,cu,uu,bS,tl;G_=[Me],Y_=[Me];var Cg=class{constructor(e,t){Pc(this,yS,Wd(Po,8,this)),Wd(Po,11,this),Pc(this,cu),Pc(this,uu),Pc(this,bS,Wd(Po,12,this)),Wd(Po,15,this),Pc(this,tl),this.register=()=>(mt(()=>{var f,d;(f=this.manager)==null||f.registry.register(this.droppable),(d=this.manager)==null||d.registry.register(this.draggable)}),()=>this.unregister()),this.unregister=()=>{mt(()=>{var f,d;(f=this.manager)==null||f.registry.unregister(this.droppable),(d=this.manager)==null||d.registry.unregister(this.draggable)})},this.destroy=()=>{mt(()=>{this.droppable.destroy(),this.draggable.destroy()})};var n=e,{effects:r=()=>[],group:i,index:o,sensors:s,type:a,transition:l=W_,plugins:c=Q8}=n,u=j8(n,["effects","group","index","sensors","type","transition","plugins"]);this.droppable=new xS(u,t,this),this.draggable=new X_(L8(R8({},u),{effects:()=>[()=>{var f,d,h;const p=(f=this.manager)==null?void 0:f.dragOperation.status;p!=null&&p.initializing&&this.id===((h=(d=this.manager)==null?void 0:d.dragOperation.source)==null?void 0:h.id)&&Xd.clear(this.manager),p!=null&&p.dragging&&Xd.set(this.manager,this.id,Ue(()=>({initialIndex:this.index,initialGroup:this.group})))},()=>{const{index:f,group:d,manager:h}=this,p=lu(this,uu),g=lu(this,cu);(f!==p||d!==g)&&(Ps(this,uu,f),Ps(this,cu,d),this.animate())},()=>{const{target:f}=this,{feedback:d,isDragSource:h}=this.draggable;d=="move"&&h&&(this.droppable.disabled=!f)},()=>{const{manager:f}=this;for(const d of c)f==null||f.registry.register(d)},...r()],type:a,sensors:s}),t,this),Ps(this,tl,u.element),this.manager=t,this.index=o,Ps(this,uu,o),this.group=i,Ps(this,cu,i),this.type=a,this.transition=l}get initialIndex(){var e,t;return(t=(e=Xd.get(this.manager,this.id))==null?void 0:e.initialIndex)!=null?t:this.index}get initialGroup(){var e,t;return(t=(e=Xd.get(this.manager,this.id))==null?void 0:e.initialGroup)!=null?t:this.group}animate(){Ue(()=>{const{manager:e,transition:t}=this,{shape:n}=this.droppable;if(!e)return;const{idle:r}=e.dragOperation.status;!n||!t||r&&!t.idle||e.renderer.rendering.then(()=>{const{element:i}=this;if(!i)return;const o=this.refreshShape();if(!o)return;const s={x:n.boundingRectangle.left-o.boundingRectangle.left,y:n.boundingRectangle.top-o.boundingRectangle.top},{translate:a}=$r(i),l=fC(i,a,!1),c=fC(i,a);(s.x||s.y)&&FD({element:i,keyframes:{translate:[`${l.x+s.x}px ${l.y+s.y}px ${l.z}`,`${c.x}px ${c.y}px ${c.z}`]},options:t}).then(()=>{e.dragOperation.status.dragging||(this.droppable.shape=void 0)})})})}get manager(){return this.draggable.manager}set manager(e){mt(()=>{this.draggable.manager=e,this.droppable.manager=e})}set element(e){mt(()=>{const t=lu(this,tl),n=this.droppable.element,r=this.draggable.element;(!n||n===t)&&(this.droppable.element=e),(!r||r===t)&&(this.draggable.element=e),Ps(this,tl,e)})}get element(){var e,t;const n=lu(this,tl);if(n)return(t=(e=Y0.get(n))!=null?e:n)!=null?t:this.droppable.element}set target(e){this.droppable.element=e}get target(){return this.droppable.element}set source(e){this.draggable.element=e}get source(){return this.draggable.element}get disabled(){return this.draggable.disabled&&this.droppable.disabled}set feedback(e){this.draggable.feedback=e}set disabled(e){mt(()=>{this.droppable.disabled=e,this.draggable.disabled=e})}set data(e){mt(()=>{this.droppable.data=e,this.draggable.data=e})}set handle(e){this.draggable.handle=e}set id(e){mt(()=>{this.droppable.id=e,this.draggable.id=e})}get id(){return this.droppable.id}set sensors(e){this.draggable.sensors=e}set modifiers(e){this.draggable.modifiers=e}set collisionPriority(e){this.droppable.collisionPriority=e}set collisionDetector(e){this.droppable.collisionDetector=e??Bx}set alignment(e){this.draggable.alignment=e}get alignment(){return this.draggable.alignment}set type(e){mt(()=>{this.droppable.type=e,this.draggable.type=e})}get type(){return this.draggable.type}set accept(e){this.droppable.accept=e}get accept(){return this.droppable.accept}get isDropTarget(){return this.droppable.isDropTarget}get isDragSource(){return this.draggable.isDragSource}get isDragging(){return this.draggable.isDragging}get isDropping(){return this.draggable.isDropping}get status(){return this.draggable.status}refreshShape(){return this.droppable.refreshShape()}accepts(e){return this.droppable.accepts(e)}};Po=z8();yS=new WeakMap;cu=new WeakMap;uu=new WeakMap;bS=new WeakMap;tl=new WeakMap;q_(Po,4,"index",G_,Cg,yS);q_(Po,4,"group",Y_,Cg,bS);P8(Po,Cg);var X_=class extends wc{constructor(e,t,n){super(e,t),this.sortable=n}get index(){return this.sortable.index}},xS=class extends ag{constructor(e,t,n){super(e,t),this.sortable=n}},J8=Object.defineProperty,Z8=Object.defineProperties,eV=Object.getOwnPropertyDescriptors,sT=Object.getOwnPropertySymbols,tV=Object.prototype.hasOwnProperty,nV=Object.prototype.propertyIsEnumerable,aT=(e,t,n)=>t in e?J8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Zv=(e,t)=>{for(var n in t||(t={}))tV.call(t,n)&&aT(e,n,t[n]);if(sT)for(var n of sT(t))nV.call(t,n)&&aT(e,n,t[n]);return e},rV=(e,t)=>Z8(e,eV(t));function iV(e){const{accept:t,collisionDetector:n,collisionPriority:r,id:i,data:o,element:s,handle:a,index:l,group:c,disabled:u,feedback:f,modifiers:d,sensors:h,target:p,type:g}=e,y=Zv(Zv({},W_),e.transition),v=tS(x=>new Cg(rV(Zv({},e),{transition:y,register:!1,handle:Qo(a),element:Qo(s),target:Qo(p),feedback:f}),x)),b=lg(v,oV);return je(i,()=>v.id=i),_a(()=>{mt(()=>{v.group=c,v.index=l})},[v,c,l]),je(g,()=>v.type=g),je(t,()=>v.accept=t,void 0,qi),je(o,()=>o&&(v.data=o)),je(l,()=>{var x;(x=v.manager)!=null&&x.dragOperation.status.idle&&(y!=null&&y.idle)&&v.refreshShape()},C5),Al(a,x=>v.handle=x),Al(s,x=>v.element=x),Al(p,x=>v.target=x),je(u,()=>v.disabled=u===!0),je(h,()=>v.sensors=h),je(n,()=>v.collisionDetector=n),je(r,()=>v.collisionPriority=r),je(f,()=>v.feedback=f??"default"),je(y,()=>v.transition=y,void 0,qi),je(d,()=>v.modifiers=d,void 0,qi),je(e.alignment,()=>v.alignment=e.alignment),{sortable:b,get isDragging(){return b.isDragging},get isDropping(){return b.isDropping},get isDragSource(){return b.isDragSource},get isDropTarget(){return b.isDropTarget},handleRef:S.useCallback(x=>{v.handle=x??void 0},[v]),ref:S.useCallback(x=>{var m,E;!x&&((m=v.element)!=null&&m.isConnected)&&!((E=v.manager)!=null&&E.dragOperation.status.idle)||(v.element=x??void 0)},[v]),sourceRef:S.useCallback(x=>{var m,E;!x&&((m=v.source)!=null&&m.isConnected)&&!((E=v.manager)!=null&&E.dragOperation.status.idle)||(v.source=x??void 0)},[v]),targetRef:S.useCallback(x=>{var m,E;!x&&((m=v.target)!=null&&m.isConnected)&&!((E=v.manager)!=null&&E.dragOperation.status.idle)||(v.target=x??void 0)},[v])}}function oV(e,t,n){return!!(e==="isDragSource"&&!n&&t)}const Q_=S.createContext(void 0);function sV({children:e}){const[t,n]=S.useState("default");return w.jsx(Q_.Provider,{value:{projectMode:t,setProjectMode:n},children:e})}function ud(){const e=S.useContext(Q_);if(!e)throw new Error("useProjectMode must be used within ProjectModeProvider");return e}function aV(e,t){return S.useReducer((n,r)=>t[n][r]??n,e)}var co=e=>{const{present:t,children:n}=e,r=lV(t),i=typeof n=="function"?n({present:r.isPresent}):S.Children.only(n),o=Ie(r.ref,cV(i));return typeof n=="function"||r.isPresent?S.cloneElement(i,{ref:o}):null};co.displayName="Presence";function lV(e){const[t,n]=S.useState(),r=S.useRef(null),i=S.useRef(e),o=S.useRef("none"),s=e?"mounted":"unmounted",[a,l]=aV(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return S.useEffect(()=>{const c=Qd(r.current);o.current=a==="mounted"?c:"none"},[a]),ln(()=>{const c=r.current,u=i.current;if(u!==e){const d=o.current,h=Qd(c);e?l("MOUNT"):h==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&d!==h?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),ln(()=>{if(t){let c;const u=t.ownerDocument.defaultView??window,f=h=>{const g=Qd(r.current).includes(CSS.escape(h.animationName));if(h.target===t&&g&&(l("ANIMATION_END"),!i.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",c=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},d=h=>{h.target===t&&(o.current=Qd(r.current))};return t.addEventListener("animationstart",d),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{u.clearTimeout(c),t.removeEventListener("animationstart",d),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:S.useCallback(c=>{r.current=c?getComputedStyle(c):null,n(c)},[])}}function Qd(e){return(e==null?void 0:e.animationName)||"none"}function cV(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Tg="Dialog",[J_]=ms(Tg),[uV,Kr]=J_(Tg),Z_=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:s=!0}=e,a=S.useRef(null),l=S.useRef(null),[c,u]=Xl({prop:r,defaultProp:i??!1,onChange:o,caller:Tg});return w.jsx(uV,{scope:t,triggerRef:a,contentRef:l,contentId:ci(),titleId:ci(),descriptionId:ci(),open:c,onOpenChange:u,onOpenToggle:S.useCallback(()=>u(f=>!f),[u]),modal:s,children:n})};Z_.displayName=Tg;var eR="DialogTrigger",fV=S.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Kr(eR,n),o=Ie(t,i.triggerRef);return w.jsx(xe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":ES(i.open),...r,ref:o,onClick:Q(e.onClick,i.onOpenToggle)})});fV.displayName=eR;var SS="DialogPortal",[dV,tR]=J_(SS,{forceMount:void 0}),nR=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,o=Kr(SS,t);return w.jsx(dV,{scope:t,forceMount:n,children:S.Children.map(r,s=>w.jsx(co,{present:n||o.open,children:w.jsx(yg,{asChild:!0,container:i,children:s})}))})};nR.displayName=SS;var Up="DialogOverlay",rR=S.forwardRef((e,t)=>{const n=tR(Up,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=Kr(Up,e.__scopeDialog);return o.modal?w.jsx(co,{present:r||o.open,children:w.jsx(pV,{...i,ref:t})}):null});rR.displayName=Up;var hV=fa("DialogOverlay.RemoveScroll"),pV=S.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Kr(Up,n);return w.jsx(ld,{as:hV,allowPinchZoom:!0,shards:[i.contentRef],children:w.jsx(xe.div,{"data-state":ES(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),ma="DialogContent",iR=S.forwardRef((e,t)=>{const n=tR(ma,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=Kr(ma,e.__scopeDialog);return w.jsx(co,{present:r||o.open,children:o.modal?w.jsx(mV,{...i,ref:t}):w.jsx(gV,{...i,ref:t})})});iR.displayName=ma;var mV=S.forwardRef((e,t)=>{const n=Kr(ma,e.__scopeDialog),r=S.useRef(null),i=Ie(t,n.contentRef,r);return S.useEffect(()=>{const o=r.current;if(o)return bg(o)},[]),w.jsx(oR,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Q(e.onCloseAutoFocus,o=>{var s;o.preventDefault(),(s=n.triggerRef.current)==null||s.focus()}),onPointerDownOutside:Q(e.onPointerDownOutside,o=>{const s=o.detail.originalEvent,a=s.button===0&&s.ctrlKey===!0;(s.button===2||a)&&o.preventDefault()}),onFocusOutside:Q(e.onFocusOutside,o=>o.preventDefault())})}),gV=S.forwardRef((e,t)=>{const n=Kr(ma,e.__scopeDialog),r=S.useRef(!1),i=S.useRef(!1);return w.jsx(oR,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var s,a;(s=e.onCloseAutoFocus)==null||s.call(e,o),o.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),o.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:o=>{var l,c;(l=e.onInteractOutside)==null||l.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const s=o.target;((c=n.triggerRef.current)==null?void 0:c.contains(s))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),oR=S.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...s}=e,a=Kr(ma,n),l=S.useRef(null),c=Ie(t,l);return dg(),w.jsxs(w.Fragment,{children:[w.jsx(sd,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:w.jsx(od,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":ES(a.open),...s,ref:c,onDismiss:()=>a.onOpenChange(!1)})}),w.jsxs(w.Fragment,{children:[w.jsx(yV,{titleId:a.titleId}),w.jsx(xV,{contentRef:l,descriptionId:a.descriptionId})]})]})}),wS="DialogTitle",sR=S.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Kr(wS,n);return w.jsx(xe.h2,{id:i.titleId,...r,ref:t})});sR.displayName=wS;var aR="DialogDescription",lR=S.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Kr(aR,n);return w.jsx(xe.p,{id:i.descriptionId,...r,ref:t})});lR.displayName=aR;var cR="DialogClose",vV=S.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Kr(cR,n);return w.jsx(xe.button,{type:"button",...r,ref:t,onClick:Q(e.onClick,()=>i.onOpenChange(!1))})});vV.displayName=cR;function ES(e){return e?"open":"closed"}var uR="DialogTitleWarning",[ree,fR]=v$(uR,{contentName:ma,titleName:wS,docsSlug:"dialog"}),yV=({titleId:e})=>{const t=fR(uR),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
333
+
334
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
335
+
336
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return S.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},bV="DialogDescriptionWarning",xV=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${fR(bV).contentName}}.`;return S.useEffect(()=>{var o;const i=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},SV=Z_,wV=nR,EV=rR,CV=iR,TV=sR,MV=lR;function Pt(e){this.content=e}Pt.prototype={constructor:Pt,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),o=r.content.slice();return i==-1?o.push(n||e,t):(o[i+1]=t,n&&(o[i]=n)),new Pt(o)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new Pt(n)},addToStart:function(e,t){return new Pt([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new Pt(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),o=r.find(e);return i.splice(o==-1?i.length:o,0,t,n),new Pt(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=Pt.from(e),e.size?new Pt(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=Pt.from(e),e.size?new Pt(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=Pt.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}};Pt.from=function(e){if(e instanceof Pt)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new Pt(t)};function dR(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),o=t.child(r);if(i==o){n+=i.nodeSize;continue}if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let s=0;i.text[s]==o.text[s];s++)n++;return n}if(i.content.size||o.content.size){let s=dR(i.content,o.content,n+1);if(s!=null)return s}n+=i.nodeSize}}function hR(e,t,n,r){for(let i=e.childCount,o=t.childCount;;){if(i==0||o==0)return i==o?null:{a:n,b:r};let s=e.child(--i),a=t.child(--o),l=s.nodeSize;if(s==a){n-=l,r-=l;continue}if(!s.sameMarkup(a))return{a:n,b:r};if(s.isText&&s.text!=a.text){let c=0,u=Math.min(s.text.length,a.text.length);for(;c<u&&s.text[s.text.length-c-1]==a.text[a.text.length-c-1];)c++,n--,r--;return{a:n,b:r}}if(s.content.size||a.content.size){let c=hR(s.content,a.content,n-1,r-1);if(c)return c}n-=l,r-=l}}class B{constructor(t,n){if(this.content=t,this.size=n||0,n==null)for(let r=0;r<t.length;r++)this.size+=t[r].nodeSize}nodesBetween(t,n,r,i=0,o){for(let s=0,a=0;a<n;s++){let l=this.content[s],c=a+l.nodeSize;if(c>t&&r(l,i+a,o||null,s)!==!1&&l.content.size){let u=a+1;l.nodesBetween(Math.max(0,t-u),Math.min(l.content.size,n-u),r,i+u)}a=c}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,n,r,i){let o="",s=!0;return this.nodesBetween(t,n,(a,l)=>{let c=a.isText?a.text.slice(Math.max(t,l)-l,n-l):a.isLeaf?i?typeof i=="function"?i(a):i:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&c||a.isTextblock)&&r&&(s?s=!1:o+=r),o+=c},0),o}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),o=1);o<t.content.length;o++)i.push(t.content[o]);return new B(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let o=0,s=0;s<n;o++){let a=this.content[o],l=s+a.nodeSize;l>t&&((s<t||l>n)&&(a.isText?a=a.cut(Math.max(0,t-s),Math.min(a.text.length,n-s)):a=a.cut(Math.max(0,t-s-1),Math.min(a.content.size,n-s-1))),r.push(a),i+=a.nodeSize),s=l}return new B(r,i)}cutByIndex(t,n){return t==n?B.empty:t==0&&n==this.content.length?this:new B(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new B(i,o)}addToStart(t){return new B([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new B(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(t.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(t){let n=this.content[t];if(!n)throw new RangeError("Index "+t+" out of range for "+this);return n}maybeChild(t){return this.content[t]||null}forEach(t){for(let n=0,r=0;n<this.content.length;n++){let i=this.content[n];t(i,r,n),r+=i.nodeSize}}findDiffStart(t,n=0){return dR(this,t,n)}findDiffEnd(t,n=this.size,r=t.size){return hR(this,t,n,r)}findIndex(t){if(t==0)return Jd(0,t);if(t==this.size)return Jd(this.content.length,t);if(t>this.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=this.child(n),o=r+i.nodeSize;if(o>=t)return o==t?Jd(n+1,o):Jd(n,r);r=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,n){if(!n)return B.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new B(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return B.empty;let n,r=0;for(let i=0;i<t.length;i++){let o=t[i];r+=o.nodeSize,i&&o.isText&&t[i-1].sameMarkup(o)?(n||(n=t.slice(0,i)),n[n.length-1]=o.withText(n[n.length-1].text+o.text)):n&&n.push(o)}return new B(n||t,r)}static from(t){if(!t)return B.empty;if(t instanceof B)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new B([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}B.empty=new B([],0);const ey={index:0,offset:0};function Jd(e,t){return ey.index=e,ey.offset=t,ey}function Vp(e,t){if(e===t)return!0;if(!(e&&typeof e=="object")||!(t&&typeof t=="object"))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!Vp(e[r],t[r]))return!1}else{for(let r in e)if(!(r in t)||!Vp(e[r],t[r]))return!1;for(let r in t)if(!(r in e))return!1}return!0}let Fe=class xb{constructor(t,n){this.type=t,this.attrs=n}addToSet(t){let n,r=!1;for(let i=0;i<t.length;i++){let o=t[i];if(this.eq(o))return t;if(this.type.excludes(o.type))n||(n=t.slice(0,i));else{if(o.type.excludes(this.type))return t;!r&&o.type.rank>this.type.rank&&(n||(n=t.slice(0,i)),n.push(this),r=!0),n&&n.push(o)}}return n||(n=t.slice()),r||n.push(this),n}removeFromSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return t.slice(0,n).concat(t.slice(n+1));return t}isInSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return!0;return!1}eq(t){return this==t||this.type==t.type&&Vp(this.attrs,t.attrs)}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=t.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let i=r.create(n.attrs);return r.checkAttrs(i.attrs),i}static sameSet(t,n){if(t==n)return!0;if(t.length!=n.length)return!1;for(let r=0;r<t.length;r++)if(!t[r].eq(n[r]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return xb.none;if(t instanceof xb)return[t];let n=t.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};Fe.none=[];class Fp extends Error{}class W{constructor(t,n,r){this.content=t,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=mR(this.content,t+this.openStart,n);return r&&new W(r,this.openStart,this.openEnd)}removeBetween(t,n){return new W(pR(this.content,t+this.openStart,n+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,n){if(!n)return W.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new W(B.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let o=t.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=t.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)i++;return new W(t,r,i)}}W.empty=new W(B.empty,0,0);function pR(e,t,n){let{index:r,offset:i}=e.findIndex(t),o=e.maybeChild(r),{index:s,offset:a}=e.findIndex(n);if(i==t||o.isText){if(a!=n&&!e.child(s).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return e.replaceChild(r,o.copy(pR(o.content,t-i-1,n-i-1)))}function mR(e,t,n,r){let{index:i,offset:o}=e.findIndex(t),s=e.maybeChild(i);if(o==t||s.isText)return r&&!r.canReplace(i,i,n)?null:e.cut(0,t).append(n).append(e.cut(t));let a=mR(s.content,t-o-1,n,s);return a&&e.replaceChild(i,s.copy(a))}function OV(e,t,n){if(n.openStart>e.depth)throw new Fp("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new Fp("Inconsistent open depths");return gR(e,t,n,0)}function gR(e,t,n,r){let i=e.index(r),o=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let s=gR(e,t,n,r+1);return o.copy(o.content.replaceChild(i,s))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let s=e.parent,a=s.content;return ea(s,a.cut(0,e.parentOffset).append(n.content).append(a.cut(t.parentOffset)))}else{let{start:s,end:a}=AV(n,e);return ea(o,yR(e,s,a,t,r))}else return ea(o,qp(e,t,r))}function vR(e,t){if(!t.type.compatibleContent(e.type))throw new Fp("Cannot join "+t.type.name+" onto "+e.type.name)}function Sb(e,t,n){let r=e.node(n);return vR(r,t.node(n)),r}function Zs(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function zu(e,t,n,r){let i=(t||e).node(n),o=0,s=t?t.index(n):i.childCount;e&&(o=e.index(n),e.depth>n?o++:e.textOffset&&(Zs(e.nodeAfter,r),o++));for(let a=o;a<s;a++)Zs(i.child(a),r);t&&t.depth==n&&t.textOffset&&Zs(t.nodeBefore,r)}function ea(e,t){return e.type.checkContent(t),e.copy(t)}function yR(e,t,n,r,i){let o=e.depth>i&&Sb(e,t,i+1),s=r.depth>i&&Sb(n,r,i+1),a=[];return zu(null,e,i,a),o&&s&&t.index(i)==n.index(i)?(vR(o,s),Zs(ea(o,yR(e,t,n,r,i+1)),a)):(o&&Zs(ea(o,qp(e,t,i+1)),a),zu(t,n,i,a),s&&Zs(ea(s,qp(n,r,i+1)),a)),zu(r,null,i,a),new B(a)}function qp(e,t,n){let r=[];if(zu(null,e,n,r),e.depth>n){let i=Sb(e,t,n+1);Zs(ea(i,qp(e,t,n+1)),r)}return zu(t,null,n,r),new B(r)}function AV(e,t){let n=t.depth-e.openStart,i=t.node(n).copy(e.content);for(let o=n-1;o>=0;o--)i=t.node(o).copy(B.from(i));return{start:i.resolveNoCache(e.openStart+n),end:i.resolveNoCache(i.content.size-e.openEnd-n)}}class Sf{constructor(t,n,r){this.pos=t,this.path=n,this.parentOffset=r,this.depth=n.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,n=this.index(this.depth);if(n==t.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=t.child(n);return r?t.child(n).cut(r):i}get nodeBefore(){let t=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(t).cut(0,n):t==0?null:this.parent.child(t-1)}posAtIndex(t,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let o=0;o<t;o++)i+=r.child(o).nodeSize;return i}marks(){let t=this.parent,n=this.index();if(t.content.size==0)return Fe.none;if(this.textOffset)return t.child(n).marks;let r=t.maybeChild(n-1),i=t.maybeChild(n);if(!r){let a=r;r=i,i=a}let o=r.marks;for(var s=0;s<o.length;s++)o[s].type.spec.inclusive===!1&&(!i||!o[s].isInSet(i.marks))&&(o=o[s--].removeFromSet(o));return o}marksAcross(t){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=t.parent.maybeChild(t.index());for(var o=0;o<r.length;o++)r[o].type.spec.inclusive===!1&&(!i||!r[o].isInSet(i.marks))&&(r=r[o--].removeFromSet(r));return r}sharedDepth(t){for(let n=this.depth;n>0;n--)if(this.start(n)<=t&&this.end(n)>=t)return n;return 0}blockRange(t=this,n){if(t.pos<this.pos)return t.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);r>=0;r--)if(t.pos<=this.end(r)&&(!n||n(this.node(r))))return new Kp(this,t,r);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 n=1;n<=this.depth;n++)t+=(t?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return t+":"+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,o=n;for(let s=t;;){let{index:a,offset:l}=s.content.findIndex(o),c=o-l;if(r.push(s,a,i+l),!c||(s=s.child(a),s.isText))break;o=c-1,i+=l+1}return new Sf(n,r,o)}static resolveCached(t,n){let r=lT.get(t);if(r)for(let o=0;o<r.elts.length;o++){let s=r.elts[o];if(s.pos==n)return s}else lT.set(t,r=new kV);let i=r.elts[r.i]=Sf.resolve(t,n);return r.i=(r.i+1)%DV,i}}class kV{constructor(){this.elts=[],this.i=0}}const DV=12,lT=new WeakMap;class Kp{constructor(t,n,r){this.$from=t,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const NV=Object.create(null);let Jo=class wb{constructor(t,n,r,i=Fe.none){this.type=t,this.attrs=n,this.marks=i,this.content=r||B.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,n,r,i=0){this.content.nodesBetween(t,n,r,i,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,n,r,i){return this.content.textBetween(t,n,r,i)}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,n,r){return this.type==t&&Vp(this.attrs,n||t.defaultAttrs||NV)&&Fe.sameSet(this.marks,r||Fe.none)}copy(t=null){return t==this.content?this:new wb(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new wb(this.type,this.attrs,this.content,t)}cut(t,n=this.content.size){return t==0&&n==this.content.size?this:this.copy(this.content.cut(t,n))}slice(t,n=this.content.size,r=!1){if(t==n)return W.empty;let i=this.resolve(t),o=this.resolve(n),s=r?0:i.sharedDepth(n),a=i.start(s),c=i.node(s).content.cut(i.pos-a,o.pos-a);return new W(c,i.depth-s,o.depth-s)}replace(t,n,r){return OV(this.resolve(t),this.resolve(n),r)}nodeAt(t){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(t);if(n=n.maybeChild(r),!n)return null;if(i==t||n.isText)return n;t-=i+1}}childAfter(t){let{index:n,offset:r}=this.content.findIndex(t);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(t){if(t==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(t);if(r<t)return{node:this.content.child(n),index:n,offset:r};let i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}resolve(t){return Sf.resolveCached(this,t)}resolveNoCache(t){return Sf.resolve(this,t)}rangeHasMark(t,n,r){let i=!1;return n>t&&this.nodesBetween(t,n,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),bR(this.marks,t)}contentMatchAt(t){let n=this.type.contentMatch.matchFragment(this.content,0,t);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(t,n,r=B.empty,i=0,o=r.childCount){let s=this.contentMatchAt(t).matchFragment(r,i,o),a=s&&s.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let l=i;l<o;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(t,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(t).matchType(r),s=o&&o.matchFragment(this.content,n);return s?s.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),this.type.checkAttrs(this.attrs);let t=Fe.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),t=r.addToSet(t)}if(!Fe.sameSet(t,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let t={type:this.type.name};for(let n 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(n=>n.toJSON())),t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(t.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return t.text(n.text,r)}let i=B.fromJSON(t,n.content),o=t.nodeType(n.type).create(n.attrs,i,r);return o.type.checkAttrs(o.attrs),o}};Jo.prototype.text=void 0;class Wp extends Jo{constructor(t,n,r,i){if(super(t,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):bR(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,n){return this.text.slice(t,n)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new Wp(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new Wp(this.type,this.attrs,t,this.marks)}cut(t=0,n=this.text.length){return t==0&&n==this.text.length?this:this.withText(this.text.slice(t,n))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function bR(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class ga{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new _V(t,n);if(r.next==null)return ga.empty;let i=xR(r);r.next&&r.err("Unexpected trailing text");let o=BV(PV(i));return HV(o,r),o}matchType(t){for(let n=0;n<this.next.length;n++)if(this.next[n].type==t)return this.next[n].next;return null}matchFragment(t,n=0,r=t.childCount){let i=this;for(let o=n;i&&o<r;o++)i=i.matchType(t.child(o).type);return i}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:n}=this.next[t];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(t){for(let n=0;n<this.next.length;n++)for(let r=0;r<t.next.length;r++)if(this.next[n].type==t.next[r].type)return!0;return!1}fillBefore(t,n=!1,r=0){let i=[this];function o(s,a){let l=s.matchFragment(t,r);if(l&&(!n||l.validEnd))return B.from(a.map(c=>c.createAndFill()));for(let c=0;c<s.next.length;c++){let{type:u,next:f}=s.next[c];if(!(u.isText||u.hasRequiredAttrs())&&i.indexOf(f)==-1){i.push(f);let d=o(f,a.concat(u));if(d)return d}}return null}return o(this,[])}findWrapping(t){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==t)return this.wrapCache[r+1];let n=this.computeWrapping(t);return this.wrapCache.push(t,n),n}computeWrapping(t){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),o=i.match;if(o.matchType(t)){let s=[];for(let a=i;a.type;a=a.via)s.push(a.type);return s.reverse()}for(let s=0;s<o.next.length;s++){let{type:a,next:l}=o.next[s];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in n)&&(!i.type||l.validEnd)&&(r.push({match:a.contentMatch,type:a,via:i}),n[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(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 n(r){t.push(r);for(let i=0;i<r.next.length;i++)t.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return n(this),t.map((r,i)=>{let o=i+(r.validEnd?"*":" ")+" ";for(let s=0;s<r.next.length;s++)o+=(s?", ":"")+r.next[s].type.name+"->"+t.indexOf(r.next[s].next);return o}).join(`
337
+ `)}}ga.empty=new ga(!0);class _V{constructor(t,n){this.string=t,this.nodeTypes=n,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 xR(e){let t=[];do t.push(RV(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function RV(e){let t=[];do t.push(LV(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function LV(e){let t=IV(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else if(e.eat("{"))t=jV(e,t);else break;return t}function cT(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function jV(e,t){let n=cT(e),r=n;return e.eat(",")&&(e.next!="}"?r=cT(e):r=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function zV(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let o in n){let s=n[o];s.isInGroup(t)&&i.push(s)}return i.length==0&&e.err("No node type or group '"+t+"' found"),i}function IV(e){if(e.eat("(")){let t=xR(e);return e.eat(")")||e.err("Missing closing paren"),t}else if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{let t=zV(e,e.next).map(n=>(e.inline==null?e.inline=n.isInline:e.inline!=n.isInline&&e.err("Mixing inline and block content"),{type:"name",value:n}));return e.pos++,t.length==1?t[0]:{type:"choice",exprs:t}}}function PV(e){let t=[[]];return i(o(e,0),n()),t;function n(){return t.push([])-1}function r(s,a,l){let c={term:l,to:a};return t[s].push(c),c}function i(s,a){s.forEach(l=>l.to=a)}function o(s,a){if(s.type=="choice")return s.exprs.reduce((l,c)=>l.concat(o(c,a)),[]);if(s.type=="seq")for(let l=0;;l++){let c=o(s.exprs[l],a);if(l==s.exprs.length-1)return c;i(c,a=n())}else if(s.type=="star"){let l=n();return r(a,l),i(o(s.expr,l),l),[r(l)]}else if(s.type=="plus"){let l=n();return i(o(s.expr,a),l),i(o(s.expr,l),l),[r(l)]}else{if(s.type=="opt")return[r(a)].concat(o(s.expr,a));if(s.type=="range"){let l=a;for(let c=0;c<s.min;c++){let u=n();i(o(s.expr,l),u),l=u}if(s.max==-1)i(o(s.expr,l),l);else for(let c=s.min;c<s.max;c++){let u=n();r(l,u),i(o(s.expr,l),u),l=u}return[r(l)]}else{if(s.type=="name")return[r(a,void 0,s.value)];throw new Error("Unknown expr type")}}}}function SR(e,t){return t-e}function uT(e,t){let n=[];return r(t),n.sort(SR);function r(i){let o=e[i];if(o.length==1&&!o[0].term)return r(o[0].to);n.push(i);for(let s=0;s<o.length;s++){let{term:a,to:l}=o[s];!a&&n.indexOf(l)==-1&&r(l)}}}function BV(e){let t=Object.create(null);return n(uT(e,0));function n(r){let i=[];r.forEach(s=>{e[s].forEach(({term:a,to:l})=>{if(!a)return;let c;for(let u=0;u<i.length;u++)i[u][0]==a&&(c=i[u][1]);uT(e,l).forEach(u=>{c||i.push([a,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let o=t[r.join(",")]=new ga(r.indexOf(e.length-1)>-1);for(let s=0;s<i.length;s++){let a=i[s][1].sort(SR);o.next.push({type:i[s][0],next:t[a.join(",")]||n(a)})}return o}}function HV(e,t){for(let n=0,r=[e];n<r.length;n++){let i=r[n],o=!i.validEnd,s=[];for(let a=0;a<i.next.length;a++){let{type:l,next:c}=i.next[a];s.push(l.name),o&&!(l.isText||l.hasRequiredAttrs())&&(o=!1),r.indexOf(c)==-1&&r.push(c)}o&&t.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function wR(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function ER(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(i===void 0){let o=e[r];if(o.hasDefault)i=o.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function CR(e,t,n,r){for(let i in t)if(!(i in e))throw new RangeError(`Unsupported attribute ${i} for ${n} of type ${i}`);for(let i in e){let o=e[i];o.validate&&o.validate(t[i])}}function TR(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new UV(e,r,t[r]);return n}let fT=class MR{constructor(t,n,r){this.name=t,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=TR(t,r.attrs),this.defaultAttrs=wR(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||t=="text"),this.isText=t=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==ga.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:ER(this.attrs,t)}create(t=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Jo(this,this.computeAttrs(t),B.from(n),Fe.setFrom(r))}createChecked(t=null,n,r){return n=B.from(n),this.checkContent(n),new Jo(this,this.computeAttrs(t),n,Fe.setFrom(r))}createAndFill(t=null,n,r){if(t=this.computeAttrs(t),n=B.from(n),n.size){let s=this.contentMatch.fillBefore(n);if(!s)return null;n=s.append(n)}let i=this.contentMatch.matchFragment(n),o=i&&i.fillBefore(B.empty,!0);return o?new Jo(this,t,n.append(o),Fe.setFrom(r)):null}validContent(t){let n=this.contentMatch.matchFragment(t);if(!n||!n.validEnd)return!1;for(let r=0;r<t.childCount;r++)if(!this.allowsMarks(t.child(r).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){CR(this.attrs,t,"node",this.name)}allowsMarkType(t){return this.markSet==null||this.markSet.indexOf(t)>-1}allowsMarks(t){if(this.markSet==null)return!0;for(let n=0;n<t.length;n++)if(!this.allowsMarkType(t[n].type))return!1;return!0}allowedMarks(t){if(this.markSet==null)return t;let n;for(let r=0;r<t.length;r++)this.allowsMarkType(t[r].type)?n&&n.push(t[r]):n||(n=t.slice(0,r));return n?n.length?n:Fe.none:t}static compile(t,n){let r=Object.create(null);t.forEach((o,s)=>r[o]=new MR(o,n,s));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function $V(e,t,n){let r=n.split("|");return i=>{let o=i===null?"null":typeof i;if(r.indexOf(o)<0)throw new RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${o}`)}}class UV{constructor(t,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?$V(t,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class Mg{constructor(t,n,r,i){this.name=t,this.rank=n,this.schema=r,this.spec=i,this.attrs=TR(t,i.attrs),this.excluded=null;let o=wR(this.attrs);this.instance=o?new Fe(this,o):null}create(t=null){return!t&&this.instance?this.instance:new Fe(this,ER(this.attrs,t))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((o,s)=>r[o]=new Mg(o,i++,n,s)),r}removeFromSet(t){for(var n=0;n<t.length;n++)t[n].type==this&&(t=t.slice(0,n).concat(t.slice(n+1)),n--);return t}isInSet(t){for(let n=0;n<t.length;n++)if(t[n].type==this)return t[n]}checkAttrs(t){CR(this.attrs,t,"mark",this.name)}excludes(t){return this.excluded.indexOf(t)>-1}}class OR{constructor(t){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let i in t)n[i]=t[i];n.nodes=Pt.from(t.nodes),n.marks=Pt.from(t.marks||{}),this.nodes=fT.compile(this.spec.nodes,this),this.marks=Mg.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let o=this.nodes[i],s=o.spec.content||"",a=o.spec.marks;if(o.contentMatch=r[s]||(r[s]=ga.parse(s,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!o.isInline||!o.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=o}o.markSet=a=="_"?null:a?dT(this,a.split(" ")):a==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],s=o.spec.excludes;o.excluded=s==null?[o]:s==""?[]:dT(this,s.split(" "))}this.nodeFromJSON=i=>Jo.fromJSON(this,i),this.markFromJSON=i=>Fe.fromJSON(this,i),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,n=null,r,i){if(typeof t=="string")t=this.nodeType(t);else if(t instanceof fT){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(n,r,i)}text(t,n){let r=this.nodes.text;return new Wp(r,r.defaultAttrs,t,Fe.setFrom(n))}mark(t,n){return typeof t=="string"&&(t=this.marks[t]),t.create(n)}nodeType(t){let n=this.nodes[t];if(!n)throw new RangeError("Unknown node type: "+t);return n}}function dT(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],o=e.marks[i],s=o;if(o)n.push(o);else for(let a in e.marks){let l=e.marks[a];(i=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(i)>-1)&&n.push(s=l)}if(!s)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}function VV(e){return e.tag!=null}function FV(e){return e.style!=null}class Zo{constructor(t,n){this.schema=t,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(VV(i))this.tags.push(i);else if(FV(i)){let o=/[^=]*/.exec(i.style)[0];r.indexOf(o)<0&&r.push(o),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let o=t.nodes[i.node];return o.contentMatch.matchType(o)})}parse(t,n={}){let r=new pT(this,n,!1);return r.addAll(t,Fe.none,n.from,n.to),r.finish()}parseSlice(t,n={}){let r=new pT(this,n,!0);return r.addAll(t,Fe.none,n.from,n.to),W.maxOpen(r.finish())}matchTag(t,n,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let o=this.tags[i];if(WV(t,o.tag)&&(o.namespace===void 0||t.namespaceURI==o.namespace)&&(!o.context||n.matchesContext(o.context))){if(o.getAttrs){let s=o.getAttrs(t);if(s===!1)continue;o.attrs=s||void 0}return o}}}matchStyle(t,n,r,i){for(let o=i?this.styles.indexOf(i)+1:0;o<this.styles.length;o++){let s=this.styles[o],a=s.style;if(!(a.indexOf(t)!=0||s.context&&!r.matchesContext(s.context)||a.length>t.length&&(a.charCodeAt(t.length)!=61||a.slice(t.length+1)!=n))){if(s.getAttrs){let l=s.getAttrs(n);if(l===!1)continue;s.attrs=l||void 0}return s}}}static schemaRules(t){let n=[];function r(i){let o=i.priority==null?50:i.priority,s=0;for(;s<n.length;s++){let a=n[s];if((a.priority==null?50:a.priority)<o)break}n.splice(s,0,i)}for(let i in t.marks){let o=t.marks[i].spec.parseDOM;o&&o.forEach(s=>{r(s=mT(s)),s.mark||s.ignore||s.clearMark||(s.mark=i)})}for(let i in t.nodes){let o=t.nodes[i].spec.parseDOM;o&&o.forEach(s=>{r(s=mT(s)),s.node||s.ignore||s.mark||(s.node=i)})}return n}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new Zo(t,Zo.schemaRules(t)))}}const AR={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},qV={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},kR={ol:!0,ul:!0},wf=1,Eb=2,Iu=4;function hT(e,t,n){return t!=null?(t?wf:0)|(t==="full"?Eb:0):e&&e.whitespace=="pre"?wf|Eb:n&~Iu}class Zd{constructor(t,n,r,i,o,s){this.type=t,this.attrs=n,this.marks=r,this.solid=i,this.options=s,this.content=[],this.activeMarks=Fe.none,this.match=o||(s&Iu?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(B.from(t));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(t.type))?(this.match=r,i):null}}return this.match.findWrapping(t.type)}finish(t){if(!(this.options&wf)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let n=B.from(this.content);return!t&&this.match&&(n=n.append(this.match.fillBefore(B.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!AR.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class pT{constructor(t,n,r){this.parser=t,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let i=n.topNode,o,s=hT(null,n.preserveWhitespace,0)|(r?Iu:0);i?o=new Zd(i.type,i.attrs,Fe.none,!0,n.topMatch||i.type.contentMatch,s):r?o=new Zd(null,null,Fe.none,!0,null,s):o=new Zd(t.schema.topNodeType,null,Fe.none,!0,null,s),this.nodes=[o],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t,n){t.nodeType==3?this.addTextNode(t,n):t.nodeType==1&&this.addElement(t,n)}addTextNode(t,n){let r=t.nodeValue,i=this.top,o=i.options&Eb?"full":this.localPreserveWS||(i.options&wf)>0,{schema:s}=this.parser;if(o==="full"||i.inlineContext(t)||/[^ \t\r\n\u000c]/.test(r)){if(o)if(o==="full")r=r.replace(/\r\n?/g,`
338
+ `);else if(s.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(s.linebreakReplacement.create())){let a=r.split(/\r?\n|\r/);for(let l=0;l<a.length;l++)l&&this.insertNode(s.linebreakReplacement.create(),n,!0),a[l]&&this.insertNode(s.text(a[l]),n,!/\S/.test(a[l]));r=""}else r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let a=i.content[i.content.length-1],l=t.previousSibling;(!a||l&&l.nodeName=="BR"||a.isText&&/[ \t\r\n\u000c]$/.test(a.text))&&(r=r.slice(1))}r&&this.insertNode(s.text(r),n,!/\S/.test(r)),this.findInText(t)}else this.findInside(t)}addElement(t,n,r){let i=this.localPreserveWS,o=this.top;(t.tagName=="PRE"||/pre/.test(t.style&&t.style.whiteSpace))&&(this.localPreserveWS=!0);let s=t.nodeName.toLowerCase(),a;kR.hasOwnProperty(s)&&this.parser.normalizeLists&&KV(t);let l=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(a=this.parser.matchTag(t,this,r));e:if(l?l.ignore:qV.hasOwnProperty(s))this.findInside(t),this.ignoreFallback(t,n);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(t=l.skip);let c,u=this.needsBlock;if(AR.hasOwnProperty(s))o.content.length&&o.content[0].isInline&&this.open&&(this.open--,o=this.top),c=!0,o.type||(this.needsBlock=!0);else if(!t.firstChild){this.leafFallback(t,n);break e}let f=l&&l.skip?n:this.readStyles(t,n);f&&this.addAll(t,f),c&&this.sync(o),this.needsBlock=u}else{let c=this.readStyles(t,n);c&&this.addElementByRule(t,l,c,l.consuming===!1?a:void 0)}this.localPreserveWS=i}leafFallback(t,n){t.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode(`
339
+ `),n)}ignoreFallback(t,n){t.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(t,n){let r=t.style;if(r&&r.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let o=this.parser.matchedStyles[i],s=r.getPropertyValue(o);if(s)for(let a=void 0;;){let l=this.parser.matchStyle(o,s,this,a);if(!l)break;if(l.ignore)return null;if(l.clearMark?n=n.filter(c=>!l.clearMark(c)):n=n.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)a=l;else break}}return n}addElementByRule(t,n,r,i){let o,s;if(n.node)if(s=this.parser.schema.nodes[n.node],s.isLeaf)this.insertNode(s.create(n.attrs),r,t.nodeName=="BR")||this.leafFallback(t,r);else{let l=this.enter(s,n.attrs||null,r,n.preserveWhitespace);l&&(o=!0,r=l)}else{let l=this.parser.schema.marks[n.mark];r=r.concat(l.create(n.attrs))}let a=this.top;if(s&&s.isLeaf)this.findInside(t);else if(i)this.addElement(t,r,i);else if(n.getContent)this.findInside(t),n.getContent(t,this.parser.schema).forEach(l=>this.insertNode(l,r,!1));else{let l=t;typeof n.contentElement=="string"?l=t.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(t):n.contentElement&&(l=n.contentElement),this.findAround(t,l,!0),this.addAll(l,r),this.findAround(t,l,!1)}o&&this.sync(a)&&this.open--}addAll(t,n,r,i){let o=r||0;for(let s=r?t.childNodes[r]:t.firstChild,a=i==null?null:t.childNodes[i];s!=a;s=s.nextSibling,++o)this.findAtPoint(t,o),this.addDOM(s,n);this.findAtPoint(t,o)}findPlace(t,n,r){let i,o;for(let s=this.open,a=0;s>=0;s--){let l=this.nodes[s],c=l.findWrapping(t);if(c&&(!i||i.length>c.length+a)&&(i=c,o=l,!c.length))break;if(l.solid){if(r)break;a+=2}}if(!i)return null;this.sync(o);for(let s=0;s<i.length;s++)n=this.enterInner(i[s],null,n,!1);return n}insertNode(t,n,r){if(t.isInline&&this.needsBlock&&!this.top.type){let o=this.textblockFromContext();o&&(n=this.enterInner(o,null,n))}let i=this.findPlace(t,n,r);if(i){this.closeExtra();let o=this.top;o.match&&(o.match=o.match.matchType(t.type));let s=Fe.none;for(let a of i.concat(t.marks))(o.type?o.type.allowsMarkType(a.type):gT(a.type,t.type))&&(s=a.addToSet(s));return o.content.push(t.mark(s)),!0}return!1}enter(t,n,r,i){let o=this.findPlace(t.create(n),r,!1);return o&&(o=this.enterInner(t,n,r,!0,i)),o}enterInner(t,n,r,i=!1,o){this.closeExtra();let s=this.top;s.match=s.match&&s.match.matchType(t);let a=hT(t,o,s.options);s.options&Iu&&s.content.length==0&&(a|=Iu);let l=Fe.none;return r=r.filter(c=>(s.type?s.type.allowsMarkType(c.type):gT(c.type,t))?(l=c.addToSet(l),!1):!0),this.nodes.push(new Zd(t,n,l,i,null,a)),this.open++,r}closeExtra(t=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(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 n=this.open;n>=0;n--){if(this.nodes[n]==t)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=wf)}return!1}get currentPos(){this.closeExtra();let t=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)t+=r[i].nodeSize;n&&t++}return t}findAtPoint(t,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==t&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&t.nodeType==1&&t.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(t,n,r){if(t!=n&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&t.nodeType==1&&t.contains(this.find[i].node)&&n.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==t&&(this.find[n].pos=this.currentPos-(t.nodeValue.length-this.find[n].offset))}matchesContext(t){if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let n=t.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),s=(a,l)=>{for(;a>=0;a--){let c=n[a];if(c==""){if(a==n.length-1||a==0)continue;for(;l>=o;l--)if(s(a-1,l))return!0;return!1}else{let u=l>0||l==0&&i?this.nodes[l].type:r&&l>=o?r.node(l-o).type:null;if(!u||u.name!=c&&!u.isInGroup(c))return!1;l--}}return!0};return s(n.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}}function KV(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let r=t.nodeType==1?t.nodeName.toLowerCase():null;r&&kR.hasOwnProperty(r)&&n?(n.appendChild(t),t=n):r=="li"?n=t:r&&(n=null)}}function WV(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function mT(e){let t={};for(let n in e)t[n]=e[n];return t}function gT(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let o=[],s=a=>{o.push(a);for(let l=0;l<a.edgeCount;l++){let{type:c,next:u}=a.edge(l);if(c==t||o.indexOf(u)<0&&s(u))return!0}};if(s(i.contentMatch))return!0}}class Ra{constructor(t,n){this.nodes=t,this.marks=n}serializeFragment(t,n={},r){r||(r=ty(n).createDocumentFragment());let i=r,o=[];return t.forEach(s=>{if(o.length||s.marks.length){let a=0,l=0;for(;a<o.length&&l<s.marks.length;){let c=s.marks[l];if(!this.marks[c.type.name]){l++;continue}if(!c.eq(o[a][0])||c.type.spec.spanning===!1)break;a++,l++}for(;a<o.length;)i=o.pop()[1];for(;l<s.marks.length;){let c=s.marks[l++],u=this.serializeMark(c,s.isInline,n);u&&(o.push([c,i]),i.appendChild(u.dom),i=u.contentDOM||u.dom)}}i.appendChild(this.serializeNodeInner(s,n))}),r}serializeNodeInner(t,n){let{dom:r,contentDOM:i}=$h(ty(n),this.nodes[t.type.name](t),null,t.attrs);if(i){if(t.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(t.content,n,i)}return r}serializeNode(t,n={}){let r=this.serializeNodeInner(t,n);for(let i=t.marks.length-1;i>=0;i--){let o=this.serializeMark(t.marks[i],t.isInline,n);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(t,n,r={}){let i=this.marks[t.type.name];return i&&$h(ty(r),i(t,n),null,t.attrs)}static renderSpec(t,n,r=null,i){return $h(t,n,r,i)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new Ra(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let n=vT(t.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(t){return vT(t.marks)}}function vT(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function ty(e){return e.document||window.document}const yT=new WeakMap;function YV(e){let t=yT.get(e);return t===void 0&&yT.set(e,t=GV(e)),t}function GV(e){let t=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")t||(t=[]),t.push(r);else for(let i=0;i<r.length;i++)n(r[i]);else for(let i in r)n(r[i])}return n(e),t}function $h(e,t,n,r){if(typeof t=="string")return{dom:e.createTextNode(t)};if(t.nodeType!=null)return{dom:t};if(t.dom&&t.dom.nodeType!=null)return t;let i=t[0],o;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(o=YV(r))&&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 s=i.indexOf(" ");s>0&&(n=i.slice(0,s),i=i.slice(s+1));let a,l=n?e.createElementNS(n,i):e.createElement(i),c=t[1],u=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){u=2;for(let f in c)if(c[f]!=null){let d=f.indexOf(" ");d>0?l.setAttributeNS(f.slice(0,d),f.slice(d+1),c[f]):f=="style"&&l.style?l.style.cssText=c[f]:l.setAttribute(f,c[f])}}for(let f=u;f<t.length;f++){let d=t[f];if(d===0){if(f<t.length-1||f>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:h,contentDOM:p}=$h(e,d,n,r);if(l.appendChild(h),p){if(a)throw new RangeError("Multiple content holes");a=p}}}return{dom:l,contentDOM:a}}const DR=65535,NR=Math.pow(2,16);function XV(e,t){return e+t*NR}function bT(e){return e&DR}function QV(e){return(e-(e&DR))/NR}const _R=1,RR=2,Uh=4,LR=8;class Cb{constructor(t,n,r){this.pos=t,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&LR)>0}get deletedBefore(){return(this.delInfo&(_R|Uh))>0}get deletedAfter(){return(this.delInfo&(RR|Uh))>0}get deletedAcross(){return(this.delInfo&Uh)>0}}class Wn{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&Wn.empty)return Wn.empty}recover(t){let n=0,r=bT(t);if(!this.inverted)for(let i=0;i<r;i++)n+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+n+QV(t)}mapResult(t,n=1){return this._map(t,n,!1)}map(t,n=1){return this._map(t,n,!0)}_map(t,n,r){let i=0,o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?i:0);if(l>t)break;let c=this.ranges[a+o],u=this.ranges[a+s],f=l+c;if(t<=f){let d=c?t==l?-1:t==f?1:n:n,h=l+i+(d<0?0:u);if(r)return h;let p=t==(n<0?l:f)?null:XV(a/3,t-l),g=t==l?RR:t==f?_R:Uh;return(n<0?t!=l:t!=f)&&(g|=LR),new Cb(h,g,p)}i+=u-c}return r?t+i:new Cb(t+i,0,null)}touches(t,n){let r=0,i=bT(n),o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?r:0);if(l>t)break;let c=this.ranges[a+o],u=l+c;if(t<=u&&a==i*3)return!0;r+=this.ranges[a+s]-c}return!1}forEach(t){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let s=this.ranges[i],a=s-(this.inverted?o:0),l=s+(this.inverted?0:o),c=this.ranges[i+n],u=this.ranges[i+r];t(a,a+c,l,l+u),o+=u-c}}invert(){return new Wn(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return t==0?Wn.empty:new Wn(t<0?[0,-t,0]:[0,0,t])}}Wn.empty=new Wn([]);class Ef{constructor(t,n,r=0,i=t?t.length:0){this.mirror=n,this.from=r,this.to=i,this._maps=t||[],this.ownData=!(t||n)}get maps(){return this._maps}slice(t=0,n=this.maps.length){return new Ef(this._maps,this.mirror,t,n)}appendMap(t,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(t),n!=null&&this.setMirror(this._maps.length-1,n)}appendMapping(t){for(let n=0,r=this._maps.length;n<t._maps.length;n++){let i=t.getMirror(n);this.appendMap(t._maps[n],i!=null&&i<n?r+i:void 0)}}getMirror(t){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==t)return this.mirror[n+(n%2?-1:1)]}}setMirror(t,n){this.mirror||(this.mirror=[]),this.mirror.push(t,n)}appendMappingInverted(t){for(let n=t.maps.length-1,r=this._maps.length+t._maps.length;n>=0;n--){let i=t.getMirror(n);this.appendMap(t._maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let t=new Ef;return t.appendMappingInverted(this),t}map(t,n=1){if(this.mirror)return this._map(t,n,!0);for(let r=this.from;r<this.to;r++)t=this._maps[r].map(t,n);return t}mapResult(t,n=1){return this._map(t,n,!1)}_map(t,n,r){let i=0;for(let o=this.from;o<this.to;o++){let s=this._maps[o],a=s.mapResult(t,n);if(a.recover!=null){let l=this.getMirror(o);if(l!=null&&l>o&&l<this.to){o=l,t=this._maps[l].recover(a.recover);continue}}i|=a.delInfo,t=a.pos}return r?t:new Cb(t,i,null)}}const ny=Object.create(null);class un{getMap(){return Wn.empty}merge(t){return null}static fromJSON(t,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=ny[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in ny)throw new RangeError("Duplicate use of step JSON ID "+t);return ny[t]=n,n.prototype.jsonID=t,n}}class Et{constructor(t,n){this.doc=t,this.failed=n}static ok(t){return new Et(t,null)}static fail(t){return new Et(null,t)}static fromReplace(t,n,r,i){try{return Et.ok(t.replace(n,r,i))}catch(o){if(o instanceof Fp)return Et.fail(o.message);throw o}}}function CS(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let o=e.child(i);o.content.size&&(o=o.copy(CS(o.content,t,o))),o.isInline&&(o=t(o,n,i)),r.push(o)}return B.fromArray(r)}class Bo extends un{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=t.resolve(this.from),i=r.node(r.sharedDepth(this.to)),o=new W(CS(n.content,(s,a)=>!s.isAtom||!a.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),i),n.openStart,n.openEnd);return Et.fromReplace(t,this.from,this.to,o)}invert(){return new ai(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Bo(n.pos,r.pos,this.mark)}merge(t){return t instanceof Bo&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Bo(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,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Bo(n.from,n.to,t.markFromJSON(n.mark))}}un.jsonID("addMark",Bo);class ai extends un{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=new W(CS(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),t),n.openStart,n.openEnd);return Et.fromReplace(t,this.from,this.to,r)}invert(){return new Bo(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new ai(n.pos,r.pos,this.mark)}merge(t){return t instanceof ai&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new ai(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,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new ai(n.from,n.to,t.markFromJSON(n.mark))}}un.jsonID("removeMark",ai);class Ho extends un{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return Et.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Et.fromReplace(t,this.pos,this.pos+1,new W(B.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;i<n.marks.length;i++)if(!n.marks[i].isInSet(r))return new Ho(this.pos,n.marks[i]);return new Ho(this.pos,this.mark)}}return new va(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Ho(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Ho(n.pos,t.markFromJSON(n.mark))}}un.jsonID("addNodeMark",Ho);class va extends un{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return Et.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Et.fromReplace(t,this.pos,this.pos+1,new W(B.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new Ho(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new va(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new va(n.pos,t.markFromJSON(n.mark))}}un.jsonID("removeNodeMark",va);class Nt extends un{constructor(t,n,r,i=!1){super(),this.from=t,this.to=n,this.slice=r,this.structure=i}apply(t){return this.structure&&Tb(t,this.from,this.to)?Et.fail("Structure replace would overwrite content"):Et.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new Wn([this.from,this.to-this.from,this.slice.size])}invert(t){return new Nt(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new Nt(n.pos,Math.max(n.pos,r.pos),this.slice,this.structure)}merge(t){if(!(t instanceof Nt)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?W.empty:new W(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new Nt(this.from,this.to+(t.to-t.from),n,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?W.empty:new W(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new Nt(t.from,this.to,n,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,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Nt(n.from,n.to,W.fromJSON(t,n.slice),!!n.structure)}}un.jsonID("replace",Nt);class Rt extends un{constructor(t,n,r,i,o,s,a=!1){super(),this.from=t,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=s,this.structure=a}apply(t){if(this.structure&&(Tb(t,this.from,this.gapFrom)||Tb(t,this.gapTo,this.to)))return Et.fail("Structure gap-replace would overwrite content");let n=t.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Et.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?Et.fromReplace(t,this.from,this.to,r):Et.fail("Content does not fit in gap")}getMap(){return new Wn([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new Rt(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:t.map(this.gapFrom,-1),o=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||o>r.pos?null:new Rt(n.pos,r.pos,i,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,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Rt(n.from,n.to,n.gapFrom,n.gapTo,W.fromJSON(t,n.slice),n.insert,!!n.structure)}}un.jsonID("replaceAround",Rt);function Tb(e,t,n){let r=e.resolve(t),i=n-t,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let s=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}}return!1}function JV(e,t,n,r){let i=[],o=[],s,a;e.doc.nodesBetween(t,n,(l,c,u)=>{if(!l.isInline)return;let f=l.marks;if(!r.isInSet(f)&&u.type.allowsMarkType(r.type)){let d=Math.max(c,t),h=Math.min(c+l.nodeSize,n),p=r.addToSet(f);for(let g=0;g<f.length;g++)f[g].isInSet(p)||(s&&s.to==d&&s.mark.eq(f[g])?s.to=h:i.push(s=new ai(d,h,f[g])));a&&a.to==d?a.to=h:o.push(a=new Bo(d,h,r))}}),i.forEach(l=>e.step(l)),o.forEach(l=>e.step(l))}function ZV(e,t,n,r){let i=[],o=0;e.doc.nodesBetween(t,n,(s,a)=>{if(!s.isInline)return;o++;let l=null;if(r instanceof Mg){let c=s.marks,u;for(;u=r.isInSet(c);)(l||(l=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(s.marks)&&(l=[r]):l=s.marks;if(l&&l.length){let c=Math.min(a+s.nodeSize,n);for(let u=0;u<l.length;u++){let f=l[u],d;for(let h=0;h<i.length;h++){let p=i[h];p.step==o-1&&f.eq(i[h].style)&&(d=p)}d?(d.to=c,d.step=o):i.push({style:f,from:Math.max(a,t),to:c,step:o})}}}),i.forEach(s=>e.step(new ai(s.from,s.to,s.style)))}function TS(e,t,n,r=n.contentMatch,i=!0){let o=e.doc.nodeAt(t),s=[],a=t+1;for(let l=0;l<o.childCount;l++){let c=o.child(l),u=a+c.nodeSize,f=r.matchType(c.type);if(!f)s.push(new Nt(a,u,W.empty));else{r=f;for(let d=0;d<c.marks.length;d++)n.allowsMarkType(c.marks[d].type)||e.step(new ai(a,u,c.marks[d]));if(i&&c.isText&&n.whitespace!="pre"){let d,h=/\r?\n|\r/g,p;for(;d=h.exec(c.text);)p||(p=new W(B.from(n.schema.text(" ",n.allowedMarks(c.marks))),0,0)),s.push(new Nt(a+d.index,a+d.index+d[0].length,p))}}a=u}if(!r.validEnd){let l=r.fillBefore(B.empty,!0);e.replace(a,a,new W(l,0,0))}for(let l=s.length-1;l>=0;l--)e.step(s[l])}function e9(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function Oc(e){let n=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let r=e.depth,i=0,o=0;;--r){let s=e.$from.node(r),a=e.$from.index(r)+i,l=e.$to.indexAfter(r)-o;if(r<e.depth&&s.canReplace(a,l,n))return r;if(r==0||s.type.spec.isolating||!e9(s,a,l))break;a&&(i=1),l<s.childCount&&(o=1)}return null}function t9(e,t,n){let{$from:r,$to:i,depth:o}=t,s=r.before(o+1),a=i.after(o+1),l=s,c=a,u=B.empty,f=0;for(let p=o,g=!1;p>n;p--)g||r.index(p)>0?(g=!0,u=B.from(r.node(p).copy(u)),f++):l--;let d=B.empty,h=0;for(let p=o,g=!1;p>n;p--)g||i.after(p+1)<i.end(p)?(g=!0,d=B.from(i.node(p).copy(d)),h++):c++;e.step(new Rt(l,c,s,a,new W(u.append(d),f,h),u.size-f,!0))}function MS(e,t,n=null,r=e){let i=n9(e,t),o=i&&r9(r,t);return o?i.map(xT).concat({type:t,attrs:n}).concat(o.map(xT)):null}function xT(e){return{type:e,attrs:null}}function n9(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.contentMatchAt(r).findWrapping(t);if(!o)return null;let s=o.length?o[0]:t;return n.canReplaceWith(r,i,s)?o:null}function r9(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.child(r),s=t.contentMatch.findWrapping(o.type);if(!s)return null;let l=(s.length?s[s.length-1]:t).contentMatch;for(let c=r;l&&c<i;c++)l=l.matchType(n.child(c).type);return!l||!l.validEnd?null:s}function i9(e,t,n){let r=B.empty;for(let s=n.length-1;s>=0;s--){if(r.size){let a=n[s].type.contentMatch.matchFragment(r);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=B.from(n[s].type.create(n[s].attrs,r))}let i=t.start,o=t.end;e.step(new Rt(i,o,i,o,new W(r,0,0),n.length,!0))}function o9(e,t,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=e.steps.length;e.doc.nodesBetween(t,n,(s,a)=>{let l=typeof i=="function"?i(s):i;if(s.isTextblock&&!s.hasMarkup(r,l)&&s9(e.doc,e.mapping.slice(o).map(a),r)){let c=null;if(r.schema.linebreakReplacement){let h=r.whitespace=="pre",p=!!r.contentMatch.matchType(r.schema.linebreakReplacement);h&&!p?c=!1:!h&&p&&(c=!0)}c===!1&&zR(e,s,a,o),TS(e,e.mapping.slice(o).map(a,1),r,void 0,c===null);let u=e.mapping.slice(o),f=u.map(a,1),d=u.map(a+s.nodeSize,1);return e.step(new Rt(f,d,f+1,d-1,new W(B.from(r.create(l,null,s.marks)),0,0),1,!0)),c===!0&&jR(e,s,a,o),!1}})}function jR(e,t,n,r){t.forEach((i,o)=>{if(i.isText){let s,a=/\r?\n|\r/g;for(;s=a.exec(i.text);){let l=e.mapping.slice(r).map(n+1+o+s.index);e.replaceWith(l,l+1,t.type.schema.linebreakReplacement.create())}}})}function zR(e,t,n,r){t.forEach((i,o)=>{if(i.type==i.type.schema.linebreakReplacement){let s=e.mapping.slice(r).map(n+1+o);e.replaceWith(s,s+1,t.type.schema.text(`
340
+ `))}})}function s9(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function a9(e,t,n,r,i){let o=e.doc.nodeAt(t);if(!o)throw new RangeError("No node at given position");n||(n=o.type);let s=n.create(r,null,i||o.marks);if(o.isLeaf)return e.replaceWith(t,t+o.nodeSize,s);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new Rt(t,t+o.nodeSize,t+1,t+o.nodeSize-1,new W(B.from(s),0,0),1,!0))}function Ki(e,t,n=1,r){let i=e.resolve(t),o=i.depth-n,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let c=i.depth-1,u=n-2;c>o;c--,u--){let f=i.node(c),d=i.index(c);if(f.type.spec.isolating)return!1;let h=f.content.cutByIndex(d,f.childCount),p=r&&r[u+1];p&&(h=h.replaceChild(0,p.type.create(p.attrs)));let g=r&&r[u]||f;if(!f.canReplace(d+1,f.childCount)||!g.type.validContent(h))return!1}let a=i.indexAfter(o),l=r&&r[0];return i.node(o).canReplaceWith(a,a,l?l.type:i.node(o+1).type)}function l9(e,t,n=1,r){let i=e.doc.resolve(t),o=B.empty,s=B.empty;for(let a=i.depth,l=i.depth-n,c=n-1;a>l;a--,c--){o=B.from(i.node(a).copy(o));let u=r&&r[c];s=B.from(u?u.type.create(u.attrs,s):i.node(a).copy(s))}e.step(new Nt(t,t,new W(o.append(s),n,n),!0))}function ys(e,t){let n=e.resolve(t),r=n.index();return IR(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function c9(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:r}=e.type.schema;for(let i=0;i<t.childCount;i++){let o=t.child(i),s=o.type==r?e.type.schema.nodes.text:o.type;if(n=n.matchType(s),!n||!e.type.allowsMarks(o.marks))return!1}return n.validEnd}function IR(e,t){return!!(e&&t&&!e.isLeaf&&c9(e,t))}function Og(e,t,n=-1){let r=e.resolve(t);for(let i=r.depth;;i--){let o,s,a=r.index(i);if(i==r.depth?(o=r.nodeBefore,s=r.nodeAfter):n>0?(o=r.node(i+1),a++,s=r.node(i).maybeChild(a)):(o=r.node(i).maybeChild(a-1),s=r.node(i+1)),o&&!o.isTextblock&&IR(o,s)&&r.node(i).canReplace(a,a+1))return t;if(i==0)break;t=n<0?r.before(i):r.after(i)}}function u9(e,t,n){let r=null,{linebreakReplacement:i}=e.doc.type.schema,o=e.doc.resolve(t-n),s=o.node().type;if(i&&s.inlineContent){let u=s.whitespace=="pre",f=!!s.contentMatch.matchType(i);u&&!f?r=!1:!u&&f&&(r=!0)}let a=e.steps.length;if(r===!1){let u=e.doc.resolve(t+n);zR(e,u.node(),u.before(),a)}s.inlineContent&&TS(e,t+n-1,s,o.node().contentMatchAt(o.index()),r==null);let l=e.mapping.slice(a),c=l.map(t-n);if(e.step(new Nt(c,l.map(t+n,-1),W.empty,!0)),r===!0){let u=e.doc.resolve(c);jR(e,u.node(),u.before(),e.steps.length)}return e}function f9(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let o=r.index(i);if(r.node(i).canReplaceWith(o,o,n))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let o=r.indexAfter(i);if(r.node(i).canReplaceWith(o,o,n))return r.after(i+1);if(o<r.node(i).childCount)return null}return null}function PR(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let o=0;o<n.openStart;o++)i=i.firstChild.content;for(let o=1;o<=(n.openStart==0&&n.size?2:1);o++)for(let s=r.depth;s>=0;s--){let a=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,l=r.index(s)+(a>0?1:0),c=r.node(s),u=!1;if(o==1)u=c.canReplace(l,l,i);else{let f=c.contentMatchAt(l).findWrapping(i.firstChild.type);u=f&&c.canReplaceWith(l,l,f[0])}if(u)return a==0?r.pos:a<0?r.before(s+1):r.after(s+1)}return null}function Ag(e,t,n=t,r=W.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),o=e.resolve(n);return BR(i,o,r)?new Nt(t,n,r):new d9(i,o,r).fit()}function BR(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}class d9{constructor(t,n,r){this.$from=t,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=B.empty;for(let i=0;i<=t.depth;i++){let o=t.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(t.indexAfter(i))})}for(let i=t.depth;i>0;i--)this.placed=B.from(t.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(t<0?this.$to:r.doc.resolve(t));if(!i)return null;let o=this.placed,s=r.depth,a=i.depth;for(;s&&a&&o.childCount==1;)o=o.firstChild.content,s--,a--;let l=new W(o,s,a);return t>-1?new Rt(r.pos,t,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new Nt(r.pos,i.pos,l):null}findFittable(){let t=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<t;r++){let o=n.firstChild;if(n.childCount>1&&(i=0),o.type.spec.isolating&&i<=r){t=r;break}n=o.content}for(let n=1;n<=2;n++)for(let r=n==1?t:this.unplaced.openStart;r>=0;r--){let i,o=null;r?(o=ry(this.unplaced.content,r-1).firstChild,i=o.content):i=this.unplaced.content;let s=i.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:c}=this.frontier[a],u,f=null;if(n==1&&(s?c.matchType(s.type)||(f=c.fillBefore(B.from(s),!1)):o&&l.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:a,parent:o,inject:f};if(n==2&&s&&(u=c.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:a,parent:o,wrap:u};if(o&&c.matchType(o.type))break}}}openMore(){let{content:t,openStart:n,openEnd:r}=this.unplaced,i=ry(t,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new W(t,n+1,Math.max(r,i.size+n>=t.size-r?n+1:0)),!0)}dropNode(){let{content:t,openStart:n,openEnd:r}=this.unplaced,i=ry(t,n);if(i.childCount<=1&&n>0){let o=t.size-n<=n+i.size;this.unplaced=new W(fu(t,n-1,1),n-1,o?n-1:r)}else this.unplaced=new W(fu(t,n,1),n,r)}placeNodes({sliceDepth:t,frontierDepth:n,parent:r,inject:i,wrap:o}){for(;this.depth>n;)this.closeFrontierNode();if(o)for(let g=0;g<o.length;g++)this.openFrontierNode(o[g]);let s=this.unplaced,a=r?r.content:s.content,l=s.openStart-t,c=0,u=[],{match:f,type:d}=this.frontier[n];if(i){for(let g=0;g<i.childCount;g++)u.push(i.child(g));f=f.matchFragment(i)}let h=a.size+t-(s.content.size-s.openEnd);for(;c<a.childCount;){let g=a.child(c),y=f.matchType(g.type);if(!y)break;c++,(c>1||l==0||g.content.size)&&(f=y,u.push(HR(g.mark(d.allowedMarks(g.marks)),c==1?l:0,c==a.childCount?h:-1)))}let p=c==a.childCount;p||(h=-1),this.placed=du(this.placed,n,B.from(u)),this.frontier[n].match=f,p&&h<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,y=a;g<h;g++){let v=y.lastChild;this.frontier.push({type:v.type,match:v.contentMatchAt(v.childCount)}),y=v.content}this.unplaced=p?t==0?W.empty:new W(fu(s.content,t-1,1),t-1,h<0?s.openEnd:t-1):new W(fu(s.content,t,c),s.openStart,s.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let t=this.frontier[this.depth],n;if(!t.type.isTextblock||!iy(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,i=this.$to.after(r);for(;r>1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(t){e:for(let n=Math.min(this.depth,t.depth);n>=0;n--){let{match:r,type:i}=this.frontier[n],o=n<t.depth&&t.end(n+1)==t.pos+(t.depth-(n+1)),s=iy(t,n,i,r,o);if(s){for(let a=n-1;a>=0;a--){let{match:l,type:c}=this.frontier[a],u=iy(t,a,c,l,!0);if(!u||u.childCount)continue e}return{depth:n,fit:s,move:o?t.doc.resolve(t.after(n+1)):t}}}}close(t){let n=this.findCloseLevel(t);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=du(this.placed,n.depth,n.fit)),t=n.move;for(let r=n.depth+1;r<=t.depth;r++){let i=t.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,t.index(r));this.openFrontierNode(i.type,i.attrs,o)}return t}openFrontierNode(t,n=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(t),this.placed=du(this.placed,this.depth,B.from(t.create(n,r))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(B.empty,!0);n.childCount&&(this.placed=du(this.placed,this.frontier.length,n))}}function fu(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(fu(e.firstChild.content,t-1,n)))}function du(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(du(e.lastChild.content,t-1,n)))}function ry(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function HR(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,HR(r.firstChild,t-1,r.childCount==1?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(B.empty,!0)))),e.copy(r)}function iy(e,t,n,r,i){let o=e.node(t),s=i?e.indexAfter(t):e.index(t);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let a=r.fillBefore(o.content,!0,s);return a&&!h9(n,o.content,s)?a:null}function h9(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}function p9(e){return e.spec.defining||e.spec.definingForContent}function m9(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),o=e.doc.resolve(n);if(BR(i,o,r))return e.step(new Nt(t,n,r));let s=UR(i,o);s[s.length-1]==0&&s.pop();let a=-(i.depth+1);s.unshift(a);for(let d=i.depth,h=i.pos-1;d>0;d--,h--){let p=i.node(d).type.spec;if(p.defining||p.definingAsContext||p.isolating)break;s.indexOf(d)>-1?a=d:i.before(d)==h&&s.splice(1,0,-d)}let l=s.indexOf(a),c=[],u=r.openStart;for(let d=r.content,h=0;;h++){let p=d.firstChild;if(c.push(p),h==r.openStart)break;d=p.content}for(let d=u-1;d>=0;d--){let h=c[d],p=p9(h.type);if(p&&!h.sameMarkup(i.node(Math.abs(a)-1)))u=d;else if(p||!h.type.isTextblock)break}for(let d=r.openStart;d>=0;d--){let h=(d+u+1)%(r.openStart+1),p=c[h];if(p)for(let g=0;g<s.length;g++){let y=s[(g+l)%s.length],v=!0;y<0&&(v=!1,y=-y);let b=i.node(y-1),x=i.index(y-1);if(b.canReplaceWith(x,x,p.type,p.marks))return e.replace(i.before(y),v?o.after(y):n,new W($R(r.content,0,r.openStart,h),h,r.openEnd))}}let f=e.steps.length;for(let d=s.length-1;d>=0&&(e.replace(t,n,r),!(e.steps.length>f));d--){let h=s[d];h<0||(t=i.before(h),n=o.after(h))}}function $R(e,t,n,r,i){if(t<n){let o=e.firstChild;e=e.replaceChild(0,o.copy($R(o.content,t+1,n,r,o)))}if(t>r){let o=i.contentMatchAt(0),s=o.fillBefore(e).append(e);e=s.append(o.matchFragment(s).fillBefore(B.empty,!0))}return e}function g9(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let i=f9(e.doc,t,r.type);i!=null&&(t=n=i)}e.replaceRange(t,n,new W(B.from(r),0,0))}function v9(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n),o=UR(r,i);for(let s=0;s<o.length;s++){let a=o[s],l=s==o.length-1;if(l&&a==0||r.node(a).type.contentMatch.validEnd)return e.delete(r.start(a),i.end(a));if(a>0&&(l||r.node(a-1).canReplace(r.index(a-1),i.indexAfter(a-1))))return e.delete(r.before(a),i.after(a))}for(let s=1;s<=r.depth&&s<=i.depth;s++)if(t-r.start(s)==r.depth-s&&n>r.end(s)&&i.end(s)-n!=i.depth-s&&r.start(s-1)==i.start(s-1)&&r.node(s-1).canReplace(r.index(s-1),i.index(s-1)))return e.delete(r.before(s),n);e.delete(t,n)}function UR(e,t){let n=[],r=Math.min(e.depth,t.depth);for(let i=r;i>=0;i--){let o=e.start(i);if(o<e.pos-(e.depth-i)||t.end(i)>t.pos+(t.depth-i)||e.node(i).type.spec.isolating||t.node(i).type.spec.isolating)break;(o==t.start(i)||i==e.depth&&i==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&i&&t.start(i-1)==o-1)&&n.push(i)}return n}class Nl extends un{constructor(t,n,r){super(),this.pos=t,this.attr=n,this.value=r}apply(t){let n=t.nodeAt(this.pos);if(!n)return Et.fail("No node at attribute step's position");let r=Object.create(null);for(let o in n.attrs)r[o]=n.attrs[o];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return Et.fromReplace(t,this.pos,this.pos+1,new W(B.from(i),0,n.isLeaf?0:1))}getMap(){return Wn.empty}invert(t){return new Nl(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Nl(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Nl(n.pos,n.attr,n.value)}}un.jsonID("attr",Nl);class Cf extends un{constructor(t,n){super(),this.attr=t,this.value=n}apply(t){let n=Object.create(null);for(let i in t.attrs)n[i]=t.attrs[i];n[this.attr]=this.value;let r=t.type.create(n,t.content,t.marks);return Et.ok(r)}getMap(){return Wn.empty}invert(t){return new Cf(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Cf(n.attr,n.value)}}un.jsonID("docAttr",Cf);let Ql=class extends Error{};Ql=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n};Ql.prototype=Object.create(Error.prototype);Ql.prototype.constructor=Ql;Ql.prototype.name="TransformError";class VR{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new Ef}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let n=this.maybeStep(t);if(n.failed)throw new Ql(n.failed);return this}maybeStep(t){let n=t.apply(this.doc);return n.failed||this.addStep(t,n.doc),n}get docChanged(){return this.steps.length>0}changedRange(){let t=1e9,n=-1e9;for(let r=0;r<this.mapping.maps.length;r++){let i=this.mapping.maps[r];r&&(t=i.map(t,1),n=i.map(n,-1)),i.forEach((o,s,a,l)=>{t=Math.min(t,a),n=Math.max(n,l)})}return t==1e9?null:{from:t,to:n}}addStep(t,n){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=n}replace(t,n=t,r=W.empty){let i=Ag(this.doc,t,n,r);return i&&this.step(i),this}replaceWith(t,n,r){return this.replace(t,n,new W(B.from(r),0,0))}delete(t,n){return this.replace(t,n,W.empty)}insert(t,n){return this.replaceWith(t,t,n)}replaceRange(t,n,r){return m9(this,t,n,r),this}replaceRangeWith(t,n,r){return g9(this,t,n,r),this}deleteRange(t,n){return v9(this,t,n),this}lift(t,n){return t9(this,t,n),this}join(t,n=1){return u9(this,t,n),this}wrap(t,n){return i9(this,t,n),this}setBlockType(t,n=t,r,i=null){return o9(this,t,n,r,i),this}setNodeMarkup(t,n,r=null,i){return a9(this,t,n,r,i),this}setNodeAttribute(t,n,r){return this.step(new Nl(t,n,r)),this}setDocAttribute(t,n){return this.step(new Cf(t,n)),this}addNodeMark(t,n){return this.step(new Ho(t,n)),this}removeNodeMark(t,n){let r=this.doc.nodeAt(t);if(!r)throw new RangeError("No node at position "+t);if(n instanceof Fe)n.isInSet(r.marks)&&this.step(new va(t,n));else{let i=r.marks,o,s=[];for(;o=n.isInSet(i);)s.push(new va(t,o)),i=o.removeFromSet(i);for(let a=s.length-1;a>=0;a--)this.step(s[a])}return this}split(t,n=1,r){return l9(this,t,n,r),this}addMark(t,n,r){return JV(this,t,n,r),this}removeMark(t,n,r){return ZV(this,t,n,r),this}clearIncompatible(t,n,r){return TS(this,t,n,r),this}}const oy=Object.create(null);let he=class{constructor(t,n,r){this.$anchor=t,this.$head=n,this.ranges=r||[new y9(t.min(n),t.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let n=0;n<t.length;n++)if(t[n].$from.pos!=t[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(t,n=W.empty){let r=n.content.lastChild,i=null;for(let a=0;a<n.openEnd;a++)i=r,r=r.lastChild;let o=t.steps.length,s=this.ranges;for(let a=0;a<s.length;a++){let{$from:l,$to:c}=s[a],u=t.mapping.slice(o);t.replaceRange(u.map(l.pos),u.map(c.pos),a?W.empty:n),a==0&&ET(t,o,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(t,n){let r=t.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){let{$from:s,$to:a}=i[o],l=t.mapping.slice(r),c=l.map(s.pos),u=l.map(a.pos);o?t.deleteRange(c,u):(t.replaceRangeWith(c,u,n),ET(t,r,n.isInline?-1:1))}}static findFrom(t,n,r=!1){let i=t.parent.inlineContent?new ne(t):nl(t.node(0),t.parent,t.pos,t.index(),n,r);if(i)return i;for(let o=t.depth-1;o>=0;o--){let s=n<0?nl(t.node(0),t.node(o),t.before(o+1),t.index(o),n,r):nl(t.node(0),t.node(o),t.after(o+1),t.index(o)+1,n,r);if(s)return s}return null}static near(t,n=1){return this.findFrom(t,n)||this.findFrom(t,-n)||new er(t.node(0))}static atStart(t){return nl(t,t,0,0,1)||new er(t)}static atEnd(t){return nl(t,t,t.content.size,t.childCount,-1)||new er(t)}static fromJSON(t,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=oy[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in oy)throw new RangeError("Duplicate use of selection JSON ID "+t);return oy[t]=n,n.prototype.jsonID=t,n}getBookmark(){return ne.between(this.$anchor,this.$head).getBookmark()}};he.prototype.visible=!0;class y9{constructor(t,n){this.$from=t,this.$to=n}}let ST=!1;function wT(e){!ST&&!e.parent.inlineContent&&(ST=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class ne extends he{constructor(t,n=t){wT(t),wT(n),super(t,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let r=t.resolve(n.map(this.head));if(!r.parent.inlineContent)return he.near(r);let i=t.resolve(n.map(this.anchor));return new ne(i.parent.inlineContent?i:r,r)}replace(t,n=W.empty){if(super.replace(t,n),n==W.empty){let r=this.$from.marksAcross(this.$to);r&&t.ensureMarks(r)}}eq(t){return t instanceof ne&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new kg(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new ne(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,r=n){let i=t.resolve(n);return new this(i,r==n?i:t.resolve(r))}static between(t,n,r){let i=t.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let o=he.findFrom(n,r,!0)||he.findFrom(n,-r,!0);if(o)n=o.$head;else return he.near(n,r)}return t.parent.inlineContent||(i==0?t=n:(t=(he.findFrom(t,-r,!0)||he.findFrom(t,r,!0)).$anchor,t.pos<n.pos!=i<0&&(t=n))),new ne(t,n)}}he.jsonID("text",ne);class kg{constructor(t,n){this.anchor=t,this.head=n}map(t){return new kg(t.map(this.anchor),t.map(this.head))}resolve(t){return ne.between(t.resolve(this.anchor),t.resolve(this.head))}}class J extends he{constructor(t){let n=t.nodeAfter,r=t.node(0).resolve(t.pos+n.nodeSize);super(t,r),this.node=n}map(t,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),o=t.resolve(i);return r?he.near(o):new J(o)}content(){return new W(B.from(this.node),0,0)}eq(t){return t instanceof J&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new OS(this.anchor)}static fromJSON(t,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new J(t.resolve(n.anchor))}static create(t,n){return new J(t.resolve(n))}static isSelectable(t){return!t.isText&&t.type.spec.selectable!==!1}}J.prototype.visible=!1;he.jsonID("node",J);class OS{constructor(t){this.anchor=t}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new kg(r,r):new OS(r)}resolve(t){let n=t.resolve(this.anchor),r=n.nodeAfter;return r&&J.isSelectable(r)?new J(n):he.near(n)}}class er extends he{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t,n=W.empty){if(n==W.empty){t.delete(0,t.doc.content.size);let r=he.atStart(t.doc);r.eq(t.selection)||t.setSelection(r)}else super.replace(t,n)}toJSON(){return{type:"all"}}static fromJSON(t){return new er(t)}map(t){return new er(t)}eq(t){return t instanceof er}getBookmark(){return b9}}he.jsonID("all",er);const b9={map(){return this},resolve(e){return new er(e)}};function nl(e,t,n,r,i,o=!1){if(t.inlineContent)return ne.create(e,n);for(let s=r-(i>0?0:1);i>0?s<t.childCount:s>=0;s+=i){let a=t.child(s);if(a.isAtom){if(!o&&J.isSelectable(a))return J.create(e,n-(i<0?a.nodeSize:0))}else{let l=nl(e,a,n+i,i<0?a.childCount:0,i,o);if(l)return l}n+=a.nodeSize*i}return null}function ET(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof Nt||i instanceof Rt))return;let o=e.mapping.maps[r],s;o.forEach((a,l,c,u)=>{s==null&&(s=u)}),e.setSelection(he.near(e.doc.resolve(s),n))}const CT=1,eh=2,TT=4;class x9 extends VR{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|CT)&~eh,this.storedMarks=null,this}get selectionSet(){return(this.updated&CT)>0}setStoredMarks(t){return this.storedMarks=t,this.updated|=eh,this}ensureMarks(t){return Fe.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&eh)>0}addStep(t,n){super.addStep(t,n),this.updated=this.updated&~eh,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t,n=!0){let r=this.selection;return n&&(t=t.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||Fe.none))),r.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,n,r){let i=this.doc.type.schema;if(n==null)return t?this.replaceSelectionWith(i.text(t),!0):this.deleteSelection();{if(r==null&&(r=n),!t)return this.deleteRange(n,r);let o=this.storedMarks;if(!o){let s=this.doc.resolve(n);o=r==n?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,i.text(t,o)),!this.selection.empty&&this.selection.to==n+t.length&&this.setSelection(he.near(this.selection.$to)),this}}setMeta(t,n){return this.meta[typeof t=="string"?t:t.key]=n,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|=TT,this}get scrolledIntoView(){return(this.updated&TT)>0}}function MT(e,t){return!t||!e?e:e.bind(t)}class hu{constructor(t,n,r){this.name=t,this.init=MT(n.init,r),this.apply=MT(n.apply,r)}}const S9=[new hu("doc",{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new hu("selection",{init(e,t){return e.selection||he.atStart(t.doc)},apply(e){return e.selection}}),new hu("storedMarks",{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new hu("scrollToSelection",{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})];class sy{constructor(t,n){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=S9.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new hu(r.key,r.spec.state,r))})}}class bl{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,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let i=this.config.plugins[r];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,t,this))return!1}return!0}applyTransaction(t){if(!this.filterTransaction(t))return{state:this,transactions:[]};let n=[t],r=this.applyInner(t),i=null;for(;;){let o=!1;for(let s=0;s<this.config.plugins.length;s++){let a=this.config.plugins[s];if(a.spec.appendTransaction){let l=i?i[s].n:0,c=i?i[s].state:this,u=l<n.length&&a.spec.appendTransaction.call(a,l?n.slice(l):n,c,r);if(u&&r.filterTransaction(u,s)){if(u.setMeta("appendedTransaction",t),!i){i=[];for(let f=0;f<this.config.plugins.length;f++)i.push(f<s?{state:r,n:n.length}:{state:this,n:0})}n.push(u),r=r.applyInner(u),o=!0}i&&(i[s]={state:r,n:n.length})}}if(!o)return{state:r,transactions:n}}}applyInner(t){if(!t.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new bl(this.config),r=this.config.fields;for(let i=0;i<r.length;i++){let o=r[i];n[o.name]=o.apply(t,this[o.name],this,n)}return n}get tr(){return new x9(this)}static create(t){let n=new sy(t.doc?t.doc.type.schema:t.schema,t.plugins),r=new bl(n);for(let i=0;i<n.fields.length;i++)r[n.fields[i].name]=n.fields[i].init(t,r);return r}reconfigure(t){let n=new sy(this.schema,t.plugins),r=n.fields,i=new bl(n);for(let o=0;o<r.length;o++){let s=r[o].name;i[s]=this.hasOwnProperty(s)?this[s]:r[o].init(t,i)}return i}toJSON(t){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),t&&typeof t=="object")for(let r in t){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=t[r],o=i.spec.state;o&&o.toJSON&&(n[r]=o.toJSON.call(i,this[i.key]))}return n}static fromJSON(t,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");let i=new sy(t.schema,t.plugins),o=new bl(i);return i.fields.forEach(s=>{if(s.name=="doc")o.doc=Jo.fromJSON(t.schema,n.doc);else if(s.name=="selection")o.selection=he.fromJSON(o.doc,n.selection);else if(s.name=="storedMarks")n.storedMarks&&(o.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(r)for(let a in r){let l=r[a],c=l.spec.state;if(l.key==s.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(n,a)){o[s.name]=c.fromJSON.call(l,t,n[a],o);return}}o[s.name]=s.init(t,o)}}),o}}function FR(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):r=="handleDOMEvents"&&(i=FR(i,t,{})),n[r]=i}return n}class Ge{constructor(t){this.spec=t,this.props={},t.props&&FR(t.props,this,this.props),this.key=t.key?t.key.key:qR("plugin")}getState(t){return t[this.key]}}const ay=Object.create(null);function qR(e){return e in ay?e+"$"+ ++ay[e]:(ay[e]=0,e+"$")}class ut{constructor(t="key"){this.key=qR(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}const Ft=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},Jl=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t};let Mb=null;const Ri=function(e,t,n){let r=Mb||(Mb=document.createRange());return r.setEnd(e,n??e.nodeValue.length),r.setStart(e,t||0),r},w9=function(){Mb=null},ya=function(e,t,n,r){return n&&(OT(e,t,n,r,-1)||OT(e,t,n,r,1))},E9=/^(img|br|input|textarea|hr)$/i;function OT(e,t,n,r,i){for(var o;;){if(e==n&&t==r)return!0;if(t==(i<0?0:vr(e))){let s=e.parentNode;if(!s||s.nodeType!=1||fd(e)||E9.test(e.nodeName)||e.contentEditable=="false")return!1;t=Ft(e)+(i<0?0:1),e=s}else if(e.nodeType==1){let s=e.childNodes[t+(i<0?-1:0)];if(s.nodeType==1&&s.contentEditable=="false")if(!((o=s.pmViewDesc)===null||o===void 0)&&o.ignoreForSelection)t+=i;else return!1;else e=s,t=i<0?vr(e):0}else return!1}}function vr(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function C9(e,t){for(;;){if(e.nodeType==3&&t)return e;if(e.nodeType==1&&t>0){if(e.contentEditable=="false")return null;e=e.childNodes[t-1],t=vr(e)}else if(e.parentNode&&!fd(e))t=Ft(e),e=e.parentNode;else return null}}function T9(e,t){for(;;){if(e.nodeType==3&&t<e.nodeValue.length)return e;if(e.nodeType==1&&t<e.childNodes.length){if(e.contentEditable=="false")return null;e=e.childNodes[t],t=0}else if(e.parentNode&&!fd(e))t=Ft(e)+1,e=e.parentNode;else return null}}function M9(e,t,n){for(let r=t==0,i=t==vr(e);r||i;){if(e==n)return!0;let o=Ft(e);if(e=e.parentNode,!e)return!1;r=r&&o==0,i=i&&o==vr(e)}}function fd(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}const Dg=function(e){return e.focusNode&&ya(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function Us(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function O9(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function A9(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:Math.min(vr(r.offsetNode),r.offset)}}catch{}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:Math.min(vr(r.startContainer),r.startOffset)}}}const gi=typeof navigator<"u"?navigator:null,AT=typeof document<"u"?document:null,bs=gi&&gi.userAgent||"",Ob=/Edge\/(\d+)/.exec(bs),KR=/MSIE \d/.exec(bs),Ab=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(bs),Rn=!!(KR||Ab||Ob),es=KR?document.documentMode:Ab?+Ab[1]:Ob?+Ob[1]:0,wr=!Rn&&/gecko\/(\d+)/i.test(bs);wr&&+(/Firefox\/(\d+)/.exec(bs)||[0,0])[1];const kb=!Rn&&/Chrome\/(\d+)/.exec(bs),Gt=!!kb,WR=kb?+kb[1]:0,cn=!Rn&&!!gi&&/Apple Computer/.test(gi.vendor),Zl=cn&&(/Mobile\/\w+/.test(bs)||!!gi&&gi.maxTouchPoints>2),cr=Zl||(gi?/Mac/.test(gi.platform):!1),YR=gi?/Win/.test(gi.platform):!1,Bi=/Android \d/.test(bs),dd=!!AT&&"webkitFontSmoothing"in AT.documentElement.style,k9=dd?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function D9(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function Ai(e,t){return typeof e=="number"?e:e[t]}function N9(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function kT(e,t,n){let r=e.someProp("scrollThreshold")||0,i=e.someProp("scrollMargin")||5,o=e.dom.ownerDocument;for(let s=n||e.dom;s;){if(s.nodeType!=1){s=Jl(s);continue}let a=s,l=a==o.body,c=l?D9(o):N9(a),u=0,f=0;if(t.top<c.top+Ai(r,"top")?f=-(c.top-t.top+Ai(i,"top")):t.bottom>c.bottom-Ai(r,"bottom")&&(f=t.bottom-t.top>c.bottom-c.top?t.top+Ai(i,"top")-c.top:t.bottom-c.bottom+Ai(i,"bottom")),t.left<c.left+Ai(r,"left")?u=-(c.left-t.left+Ai(i,"left")):t.right>c.right-Ai(r,"right")&&(u=t.right-c.right+Ai(i,"right")),u||f)if(l)o.defaultView.scrollBy(u,f);else{let h=a.scrollLeft,p=a.scrollTop;f&&(a.scrollTop+=f),u&&(a.scrollLeft+=u);let g=a.scrollLeft-h,y=a.scrollTop-p;t={left:t.left-g,top:t.top-y,right:t.right-g,bottom:t.bottom-y}}let d=l?"fixed":getComputedStyle(s).position;if(/^(fixed|sticky)$/.test(d))break;s=d=="absolute"?s.offsetParent:Jl(s)}}function _9(e){let t=e.dom.getBoundingClientRect(),n=Math.max(0,t.top),r,i;for(let o=(t.left+t.right)/2,s=n+1;s<Math.min(innerHeight,t.bottom);s+=5){let a=e.root.elementFromPoint(o,s);if(!a||a==e.dom||!e.dom.contains(a))continue;let l=a.getBoundingClientRect();if(l.top>=n-20){r=a,i=l.top;break}}return{refDOM:r,refTop:i,stack:GR(e.dom)}}function GR(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=Jl(r));return t}function R9({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;XR(n,r==0?0:r-t)}function XR(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:i,left:o}=e[n];r.scrollTop!=i+t&&(r.scrollTop=i+t),r.scrollLeft!=o&&(r.scrollLeft=o)}}let Fa=null;function L9(e){if(e.setActive)return e.setActive();if(Fa)return e.focus(Fa);let t=GR(e);e.focus(Fa==null?{get preventScroll(){return Fa={preventScroll:!0},!0}}:void 0),Fa||(Fa=!1,XR(t,0))}function QR(e,t){let n,r=2e8,i,o=0,s=t.top,a=t.top,l,c;for(let u=e.firstChild,f=0;u;u=u.nextSibling,f++){let d;if(u.nodeType==1)d=u.getClientRects();else if(u.nodeType==3)d=Ri(u).getClientRects();else continue;for(let h=0;h<d.length;h++){let p=d[h];if(p.top<=s&&p.bottom>=a){s=Math.max(p.bottom,s),a=Math.min(p.top,a);let g=p.left>t.left?p.left-t.left:p.right<t.left?t.left-p.right:0;if(g<r){n=u,r=g,i=g&&n.nodeType==3?{left:p.right<t.left?p.right:p.left,top:t.top}:t,u.nodeType==1&&g&&(o=f+(t.left>=(p.left+p.right)/2?1:0));continue}}else p.top>t.top&&!l&&p.left<=t.left&&p.right>=t.left&&(l=u,c={left:Math.max(p.left,Math.min(p.right,t.left)),top:p.top});!n&&(t.left>=p.right&&t.top>=p.top||t.left>=p.left&&t.top>=p.bottom)&&(o=f+1)}}return!n&&l&&(n=l,i=c,r=0),n&&n.nodeType==3?j9(n,i):!n||r&&n.nodeType==1?{node:e,offset:o}:QR(n,i)}function j9(e,t){let n=e.nodeValue.length,r=document.createRange(),i;for(let o=0;o<n;o++){r.setEnd(e,o+1),r.setStart(e,o);let s=yo(r,1);if(s.top!=s.bottom&&AS(t,s)){i={node:e,offset:o+(t.left>=(s.left+s.right)/2?1:0)};break}}return r.detach(),i||{node:e,offset:0}}function AS(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function z9(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}function I9(e,t,n){let{node:r,offset:i}=QR(t,n),o=-1;if(r.nodeType==1&&!r.firstChild){let s=r.getBoundingClientRect();o=s.left!=s.right&&n.left>(s.left+s.right)/2?1:-1}return e.docView.posFromDOM(r,i,o)}function P9(e,t,n,r){let i=-1;for(let o=t,s=!1;o!=e.dom;){let a=e.docView.nearestDesc(o,!0),l;if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent||!a.contentDOM)&&((l=a.dom.getBoundingClientRect()).width||l.height)&&(a.node.isBlock&&a.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(a.dom.nodeName)&&(!s&&l.left>r.left||l.top>r.top?i=a.posBefore:(!s&&l.right<r.left||l.bottom<r.top)&&(i=a.posAfter),s=!0),!a.contentDOM&&i<0&&!a.node.isText))return(a.node.isBlock?r.top<(l.top+l.bottom)/2:r.left<(l.left+l.right)/2)?a.posBefore:a.posAfter;o=a.dom.parentNode}return i>-1?i:e.docView.posFromDOM(t,n,-1)}function JR(e,t,n){let r=e.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),o=i;;){let s=e.childNodes[o];if(s.nodeType==1){let a=s.getClientRects();for(let l=0;l<a.length;l++){let c=a[l];if(AS(t,c))return JR(s,t,c)}}if((o=(o+1)%r)==i)break}return e}function B9(e,t){let n=e.dom.ownerDocument,r,i=0,o=A9(n,t.left,t.top);o&&({node:r,offset:i}=o);let s=(e.root.elementFromPoint?e.root:n).elementFromPoint(t.left,t.top),a;if(!s||!e.dom.contains(s.nodeType!=1?s.parentNode:s)){let c=e.dom.getBoundingClientRect();if(!AS(t,c)||(s=JR(e.dom,t,c),!s))return null}if(cn)for(let c=s;r&&c;c=Jl(c))c.draggable&&(r=void 0);if(s=z9(s,t),r){if(wr&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let u=r.childNodes[i],f;u.nodeName=="IMG"&&(f=u.getBoundingClientRect()).right<=t.left&&f.bottom>t.top&&i++}let c;dd&&i&&r.nodeType==1&&(c=r.childNodes[i-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=t.top&&i--,r==e.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&t.top>r.lastChild.getBoundingClientRect().bottom?a=e.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(a=P9(e,r,i,t))}a==null&&(a=I9(e,s,t));let l=e.docView.nearestDesc(s,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function DT(e){return e.top<e.bottom||e.left<e.right}function yo(e,t){let n=e.getClientRects();if(n.length){let r=n[t<0?0:n.length-1];if(DT(r))return r}return Array.prototype.find.call(n,DT)||e.getBoundingClientRect()}const H9=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function ZR(e,t,n){let{node:r,offset:i,atom:o}=e.docView.domFromPos(t,n<0?-1:1),s=dd||wr;if(r.nodeType==3)if(s&&(H9.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let l=yo(Ri(r,i,i),n);if(wr&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let c=yo(Ri(r,i-1,i-1),-1);if(c.top==l.top){let u=yo(Ri(r,i,i+1),-1);if(u.top!=l.top)return Bc(u,u.left<c.left)}}return l}else{let l=i,c=i,u=n<0?1:-1;return n<0&&!i?(c++,u=-1):n>=0&&i==r.nodeValue.length?(l--,u=1):n<0?l--:c++,Bc(yo(Ri(r,l,c),u),u<0)}if(!e.state.doc.resolve(t-(o||0)).parent.inlineContent){if(o==null&&i&&(n<0||i==vr(r))){let l=r.childNodes[i-1];if(l.nodeType==1)return ly(l.getBoundingClientRect(),!1)}if(o==null&&i<vr(r)){let l=r.childNodes[i];if(l.nodeType==1)return ly(l.getBoundingClientRect(),!0)}return ly(r.getBoundingClientRect(),n>=0)}if(o==null&&i&&(n<0||i==vr(r))){let l=r.childNodes[i-1],c=l.nodeType==3?Ri(l,vr(l)-(s?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(c)return Bc(yo(c,1),!1)}if(o==null&&i<vr(r)){let l=r.childNodes[i];for(;l.pmViewDesc&&l.pmViewDesc.ignoreForCoords;)l=l.nextSibling;let c=l?l.nodeType==3?Ri(l,0,s?0:1):l.nodeType==1?l:null:null;if(c)return Bc(yo(c,-1),!0)}return Bc(yo(r.nodeType==3?Ri(r):r,-n),n>=0)}function Bc(e,t){if(e.width==0)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function ly(e,t){if(e.height==0)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function e3(e,t,n){let r=e.state,i=e.root.activeElement;r!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),i!=e.dom&&i&&i.focus()}}function $9(e,t,n){let r=t.selection,i=n=="up"?r.$from:r.$to;return e3(e,t,()=>{let{node:o}=e.docView.domFromPos(i.pos,n=="up"?-1:1);for(;;){let a=e.docView.nearestDesc(o,!0);if(!a)break;if(a.node.isBlock){o=a.contentDOM||a.dom;break}o=a.dom.parentNode}let s=ZR(e,i.pos,1);for(let a=o.firstChild;a;a=a.nextSibling){let l;if(a.nodeType==1)l=a.getClientRects();else if(a.nodeType==3)l=Ri(a,0,a.nodeValue.length).getClientRects();else continue;for(let c=0;c<l.length;c++){let u=l[c];if(u.bottom>u.top+1&&(n=="up"?s.top-u.top>(u.bottom-s.top)*2:u.bottom-s.bottom>(s.bottom-u.top)*2))return!1}}return!0})}const U9=/[\u0590-\u08ac]/;function V9(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,s=i==r.parent.content.size,a=e.domSelection();return a?!U9.test(r.parent.textContent)||!a.modify?n=="left"||n=="backward"?o:s:e3(e,t,()=>{let{focusNode:l,focusOffset:c,anchorNode:u,anchorOffset:f}=e.domSelectionRange(),d=a.caretBidiLevel;a.modify("move",n,"character");let h=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:p,focusOffset:g}=e.domSelectionRange(),y=p&&!h.contains(p.nodeType==1?p:p.parentNode)||l==p&&c==g;try{a.collapse(u,f),l&&(l!=u||c!=f)&&a.extend&&a.extend(l,c)}catch{}return d!=null&&(a.caretBidiLevel=d),y}):r.pos==r.start()||r.pos==r.end()}let NT=null,_T=null,RT=!1;function F9(e,t,n){return NT==t&&_T==n?RT:(NT=t,_T=n,RT=n=="up"||n=="down"?$9(e,t,n):V9(e,t,n))}const Er=0,LT=1,qs=2,vi=3;class hd{constructor(t,n,r,i){this.parent=t,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=Er,r.pmViewDesc=this}matchesWidget(t){return!1}matchesMark(t){return!1}matchesNode(t,n,r){return!1}matchesHack(t){return!1}parseRule(){return null}stopEvent(t){return!1}get size(){let t=0;for(let n=0;n<this.children.length;n++)t+=this.children[n].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 n=0,r=this.posAtStart;;n++){let i=this.children[n];if(i==t)return r;r+=i.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(t,n,r){if(this.contentDOM&&this.contentDOM.contains(t.nodeType==1?t:t.parentNode))if(r<0){let o,s;if(t==this.contentDOM)o=t.childNodes[n-1];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;o=t.previousSibling}for(;o&&!((s=o.pmViewDesc)&&s.parent==this);)o=o.previousSibling;return o?this.posBeforeChild(s)+s.size:this.posAtStart}else{let o,s;if(t==this.contentDOM)o=t.childNodes[n];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;o=t.nextSibling}for(;o&&!((s=o.pmViewDesc)&&s.parent==this);)o=o.nextSibling;return o?this.posBeforeChild(s):this.posAtEnd}let i;if(t==this.dom&&this.contentDOM)i=n>Ft(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=t.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let o=t;;o=o.parentNode){if(o==this.dom){i=!1;break}if(o.previousSibling)break}if(i==null&&n==t.childNodes.length)for(let o=t;;o=o.parentNode){if(o==this.dom){i=!0;break}if(o.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(t,n=!1){for(let r=!0,i=t;i;i=i.parentNode){let o=this.getDesc(i),s;if(o&&(!n||o.node))if(r&&(s=o.nodeDOM)&&!(s.nodeType==1?s.contains(t.nodeType==1?t:t.parentNode):s==t))r=!1;else return o}}getDesc(t){let n=t.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(t,n,r){for(let i=t;i;i=i.parentNode){let o=this.getDesc(i);if(o)return o.localPosFromDOM(t,n,r)}return-1}descAt(t){for(let n=0,r=0;n<this.children.length;n++){let i=this.children[n],o=r+i.size;if(r==t&&o!=r){for(;!i.border&&i.children.length;)for(let s=0;s<i.children.length;s++){let a=i.children[s];if(a.size){i=a;break}}return i}if(t<o)return i.descAt(t-r-i.border);r=o}}domFromPos(t,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:t+1};let r=0,i=0;for(let o=0;r<this.children.length;r++){let s=this.children[r],a=o+s.size;if(a>t||s instanceof n3){i=t-o;break}o=a}if(i)return this.children[r].domFromPos(i-this.children[r].border,n);for(let o;r&&!(o=this.children[r-1]).size&&o instanceof t3&&o.side>=0;r--);if(n<=0){let o,s=!0;for(;o=r?this.children[r-1]:null,!(!o||o.dom.parentNode==this.contentDOM);r--,s=!1);return o&&n&&s&&!o.border&&!o.domAtom?o.domFromPos(o.size,n):{node:this.contentDOM,offset:o?Ft(o.dom)+1:0}}else{let o,s=!0;for(;o=r<this.children.length?this.children[r]:null,!(!o||o.dom.parentNode==this.contentDOM);r++,s=!1);return o&&s&&!o.border&&!o.domAtom?o.domFromPos(0,n):{node:this.contentDOM,offset:o?Ft(o.dom):this.contentDOM.childNodes.length}}}parseRange(t,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:t,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,o=-1;for(let s=r,a=0;;a++){let l=this.children[a],c=s+l.size;if(i==-1&&t<=c){let u=s+l.border;if(t>=u&&n<=c-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(t,n,u);t=s;for(let f=a;f>0;f--){let d=this.children[f-1];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(1)){i=Ft(d.dom)+1;break}t-=d.size}i==-1&&(i=0)}if(i>-1&&(c>n||a==this.children.length-1)){n=c;for(let u=a+1;u<this.children.length;u++){let f=this.children[u];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(-1)){o=Ft(f.dom);break}n+=f.size}o==-1&&(o=this.contentDOM.childNodes.length);break}s=c}return{node:this.contentDOM,from:t,to:n,fromOffset:i,toOffset:o}}emptyChildAt(t){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[t<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(t)}domAfterPos(t){let{node:n,offset:r}=this.domFromPos(t,0);if(n.nodeType!=1||r==n.childNodes.length)throw new RangeError("No node after pos "+t);return n.childNodes[r]}setSelection(t,n,r,i=!1){let o=Math.min(t,n),s=Math.max(t,n);for(let h=0,p=0;h<this.children.length;h++){let g=this.children[h],y=p+g.size;if(o>p&&s<y)return g.setSelection(t-p-g.border,n-p-g.border,r,i);p=y}let a=this.domFromPos(t,t?-1:1),l=n==t?a:this.domFromPos(n,n?-1:1),c=r.root.getSelection(),u=r.domSelectionRange(),f=!1;if((wr||cn)&&t==n){let{node:h,offset:p}=a;if(h.nodeType==3){if(f=!!(p&&h.nodeValue[p-1]==`
341
+ `),f&&p==h.nodeValue.length)for(let g=h,y;g;g=g.parentNode){if(y=g.nextSibling){y.nodeName=="BR"&&(a=l={node:y.parentNode,offset:Ft(y)+1});break}let v=g.pmViewDesc;if(v&&v.node&&v.node.isBlock)break}}else{let g=h.childNodes[p-1];f=g&&(g.nodeName=="BR"||g.contentEditable=="false")}}if(wr&&u.focusNode&&u.focusNode!=l.node&&u.focusNode.nodeType==1){let h=u.focusNode.childNodes[u.focusOffset];h&&h.contentEditable=="false"&&(i=!0)}if(!(i||f&&cn)&&ya(a.node,a.offset,u.anchorNode,u.anchorOffset)&&ya(l.node,l.offset,u.focusNode,u.focusOffset))return;let d=!1;if((c.extend||t==n)&&!(f&&wr)){c.collapse(a.node,a.offset);try{t!=n&&c.extend(l.node,l.offset),d=!0}catch{}}if(!d){if(t>n){let p=a;a=l,l=p}let h=document.createRange();h.setEnd(l.node,l.offset),h.setStart(a.node,a.offset),c.removeAllRanges(),c.addRange(h)}}ignoreMutation(t){return!this.contentDOM&&t.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(t,n){for(let r=0,i=0;i<this.children.length;i++){let o=this.children[i],s=r+o.size;if(r==s?t<=s&&n>=r:t<s&&n>r){let a=r+o.border,l=s-o.border;if(t>=a&&n<=l){this.dirty=t==r||n==s?qs:LT,t==a&&n==l&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=vi:o.markDirty(t-a,n-a);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?qs:vi}r=s}this.dirty=qs}markParentsDirty(){let t=1;for(let n=this.parent;n;n=n.parent,t++){let r=t==1?qs:LT;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(t){return!1}}class t3 extends hd{constructor(t,n,r,i){let o,s=n.type.toDOM;if(typeof s=="function"&&(s=s(r,()=>{if(!o)return i;if(o.parent)return o.parent.posBeforeChild(o)})),!n.type.spec.raw){if(s.nodeType!=1){let a=document.createElement("span");a.appendChild(s),s=a}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(t,[],s,null),this.widget=n,this.widget=n,o=this}matchesWidget(t){return this.dirty==Er&&t.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(t){let n=this.widget.spec.stopEvent;return n?n(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 q9 extends hd{constructor(t,n,r,i){super(t,[],n,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(t,n){return t!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(t){return{node:this.textDOM,offset:t}}ignoreMutation(t){return t.type==="characterData"&&t.target.nodeValue==t.oldValue}}class ba extends hd{constructor(t,n,r,i,o){super(t,[],r,i),this.mark=n,this.spec=o}static create(t,n,r,i){let o=i.nodeViews[n.type.name],s=o&&o(n,i,r);return(!s||!s.dom)&&(s=Ra.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new ba(t,n,s.dom,s.contentDOM||s.dom,s)}parseRule(){return this.dirty&vi||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(t){return this.dirty!=vi&&this.mark.eq(t)}markDirty(t,n){if(super.markDirty(t,n),this.dirty!=Er){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=Er}}slice(t,n,r){let i=ba.create(this.parent,this.mark,!0,r),o=this.children,s=this.size;n<s&&(o=Nb(o,n,s,r)),t>0&&(o=Nb(o,0,t,r));for(let a=0;a<o.length;a++)o[a].parent=i;return i.children=o,i}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class ts extends hd{constructor(t,n,r,i,o,s,a,l,c){super(t,[],o,s),this.node=n,this.outerDeco=r,this.innerDeco=i,this.nodeDOM=a}static create(t,n,r,i,o,s){let a=o.nodeViews[n.type.name],l,c=a&&a(n,o,()=>{if(!l)return s;if(l.parent)return l.parent.posBeforeChild(l)},r,i),u=c&&c.dom,f=c&&c.contentDOM;if(n.isText){if(!u)u=document.createTextNode(n.text);else if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:f}=Ra.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!f&&!n.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),n.type.spec.draggable&&(u.draggable=!0));let d=u;return u=o3(u,r,n),c?l=new K9(t,n,r,i,u,f||null,d,c,o,s+1):n.isText?new Ng(t,n,r,i,u,d,o):new ts(t,n,r,i,u,f||null,d,o,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(t.preserveWhitespace="full"),!this.contentDOM)t.getContent=()=>this.node.content;else if(!this.contentLost)t.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){t.contentElement=r.dom.parentNode;break}}t.contentElement||(t.getContent=()=>B.empty)}return t}matchesNode(t,n,r){return this.dirty==Er&&t.eq(this.node)&&Yp(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(t,n){let r=this.node.inlineContent,i=n,o=t.composing?this.localCompositionInfo(t,n):null,s=o&&o.pos>-1?o:null,a=o&&o.pos<0,l=new Y9(this,s&&s.node,t);Q9(this.node,this.innerDeco,(c,u,f)=>{c.spec.marks?l.syncToMarks(c.spec.marks,r,t,u):c.type.side>=0&&!f&&l.syncToMarks(u==this.node.childCount?Fe.none:this.node.child(u).marks,r,t,u),l.placeWidget(c,t,i)},(c,u,f,d)=>{l.syncToMarks(c.marks,r,t,d);let h;l.findNodeMatch(c,u,f,d)||a&&t.state.selection.from>i&&t.state.selection.to<i+c.nodeSize&&(h=l.findIndexWithChild(o.node))>-1&&l.updateNodeAt(c,u,f,h,t)||l.updateNextNode(c,u,f,t,d,i)||l.addNode(c,u,f,t,i),i+=c.nodeSize}),l.syncToMarks([],r,t,0),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==qs)&&(s&&this.protectLocalComposition(t,s),r3(this.contentDOM,this.children,t),Zl&&J9(this.dom))}localCompositionInfo(t,n){let{from:r,to:i}=t.state.selection;if(!(t.state.selection instanceof ne)||r<n||i>n+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 s=o.nodeValue,a=Z9(this.node.content,s,r-n,i-n);return a<0?null:{node:o,pos:a,text:s}}else return{node:o,pos:-1,text:""}}protectLocalComposition(t,{node:n,pos:r,text:i}){if(this.getDesc(n))return;let o=n;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let s=new q9(this,o,n,i);t.input.compositionNodes.push(s),this.children=Nb(this.children,r,r+i.length,t,s)}update(t,n,r,i){return this.dirty==vi||!t.sameMarkup(this.node)?!1:(this.updateInner(t,n,r,i),!0)}updateInner(t,n,r,i){this.updateOuterDeco(n),this.node=t,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=Er}updateOuterDeco(t){if(Yp(t,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=i3(this.dom,this.nodeDOM,Db(this.outerDeco,this.node,n),Db(t,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=t}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function jT(e,t,n,r,i){o3(r,t,e);let o=new ts(void 0,e,t,n,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}class Ng extends ts{constructor(t,n,r,i,o,s,a){super(t,n,r,i,o,null,s,a,0)}parseRule(){let t=this.nodeDOM.parentNode;for(;t&&t!=this.dom&&!t.pmIsDeco;)t=t.parentNode;return{skip:t||!0}}update(t,n,r,i){return this.dirty==vi||this.dirty!=Er&&!this.inParent()||!t.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=Er||t.text!=this.node.text)&&t.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=t.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=t,this.dirty=Er,!0)}inParent(){let t=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==t)return!0;return!1}domFromPos(t){return{node:this.nodeDOM,offset:t}}localPosFromDOM(t,n,r){return t==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(t,n,r)}ignoreMutation(t){return t.type!="characterData"&&t.type!="selection"}slice(t,n,r){let i=this.node.cut(t,n),o=document.createTextNode(i.text);return new Ng(this.parent,i,this.outerDeco,this.innerDeco,o,o,r)}markDirty(t,n){super.markDirty(t,n),this.dom!=this.nodeDOM&&(t==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=vi)}get domAtom(){return!1}isText(t){return this.node.text==t}}class n3 extends hd{parseRule(){return{ignore:!0}}matchesHack(t){return this.dirty==Er&&this.dom.nodeName==t}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class K9 extends ts{constructor(t,n,r,i,o,s,a,l,c,u){super(t,n,r,i,o,s,a,c,u),this.spec=l}update(t,n,r,i){if(this.dirty==vi)return!1;if(this.spec.update&&(this.node.type==t.type||this.spec.multiType)){let o=this.spec.update(t,n,r);return o&&this.updateInner(t,n,r,i),o}else return!this.contentDOM&&!t.isLeaf?!1:super.update(t,n,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(t,n,r,i){this.spec.setSelection?this.spec.setSelection(t,n,r.root):super.setSelection(t,n,r,i)}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 r3(e,t,n){let r=e.firstChild,i=!1;for(let o=0;o<t.length;o++){let s=t[o],a=s.dom;if(a.parentNode==e){for(;a!=r;)r=zT(r),i=!0;r=r.nextSibling}else i=!0,e.insertBefore(a,r);if(s instanceof ba){let l=r?r.previousSibling:e.lastChild;r3(s.contentDOM,s.children,n),r=l?l.nextSibling:e.firstChild}}for(;r;)r=zT(r),i=!0;i&&n.trackWrites==e&&(n.trackWrites=null)}const Pu=function(e){e&&(this.nodeName=e)};Pu.prototype=Object.create(null);const Ks=[new Pu];function Db(e,t,n){if(e.length==0)return Ks;let r=n?Ks[0]:new Pu,i=[r];for(let o=0;o<e.length;o++){let s=e[o].type.attrs;if(s){s.nodeName&&i.push(r=new Pu(s.nodeName));for(let a in s){let l=s[a];l!=null&&(n&&i.length==1&&i.push(r=new Pu(t.isInline?"span":"div")),a=="class"?r.class=(r.class?r.class+" ":"")+l:a=="style"?r.style=(r.style?r.style+";":"")+l:a!="nodeName"&&(r[a]=l))}}}return i}function i3(e,t,n,r){if(n==Ks&&r==Ks)return t;let i=t;for(let o=0;o<r.length;o++){let s=r[o],a=n[o];if(o){let l;a&&a.nodeName==s.nodeName&&i!=e&&(l=i.parentNode)&&l.nodeName.toLowerCase()==s.nodeName||(l=document.createElement(s.nodeName),l.pmIsDeco=!0,l.appendChild(i),a=Ks[0]),i=l}W9(i,a||Ks[0],s)}return i}function W9(e,t,n){for(let r in t)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&e.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=t[r]&&e.setAttribute(r,n[r]);if(t.class!=n.class){let r=t.class?t.class.split(" ").filter(Boolean):[],i=n.class?n.class.split(" ").filter(Boolean):[];for(let o=0;o<r.length;o++)i.indexOf(r[o])==-1&&e.classList.remove(r[o]);for(let o=0;o<i.length;o++)r.indexOf(i[o])==-1&&e.classList.add(i[o]);e.classList.length==0&&e.removeAttribute("class")}if(t.style!=n.style){if(t.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,i;for(;i=r.exec(t.style);)e.style.removeProperty(i[1])}n.style&&(e.style.cssText+=n.style)}}function o3(e,t,n){return i3(e,e,Ks,Db(t,n,e.nodeType!=1))}function Yp(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function zT(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class Y9{constructor(t,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=t,this.preMatch=G9(t.node.content,t)}destroyBetween(t,n){if(t!=n){for(let r=t;r<n;r++)this.top.children[r].destroy();this.top.children.splice(t,n-t),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(t,n,r,i){let o=0,s=this.stack.length>>1,a=Math.min(s,t.length);for(;o<a&&(o==s-1?this.top:this.stack[o+1<<1]).matchesMark(t[o])&&t[o].type.spec.spanning!==!1;)o++;for(;o<s;)this.destroyRest(),this.top.dirty=Er,this.index=this.stack.pop(),this.top=this.stack.pop(),s--;for(;s<t.length;){this.stack.push(this.top,this.index+1);let l=-1,c=this.top.children.length;i<this.preMatch.index&&(c=Math.min(this.index+3,c));for(let u=this.index;u<c;u++){let f=this.top.children[u];if(f.matchesMark(t[s])&&!this.isLocked(f.dom)){l=u;break}}if(l>-1)l>this.index&&(this.changed=!0,this.destroyBetween(this.index,l)),this.top=this.top.children[this.index];else{let u=ba.create(this.top,t[s],n,r);this.top.children.splice(this.index,0,u),this.top=u,this.changed=!0}this.index=0,s++}}findNodeMatch(t,n,r,i){let o=-1,s;if(i>=this.preMatch.index&&(s=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&s.matchesNode(t,n,r))o=this.top.children.indexOf(s,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a<l;a++){let c=this.top.children[a];if(c.matchesNode(t,n,r)&&!this.preMatch.matched.has(c)){o=a;break}}return o<0?!1:(this.destroyBetween(this.index,o),this.index++,!0)}updateNodeAt(t,n,r,i,o){let s=this.top.children[i];return s.dirty==vi&&s.dom==s.contentDOM&&(s.dirty=qs),s.update(t,n,r,o)?(this.destroyBetween(this.index,i),this.index++,!0):!1}findIndexWithChild(t){for(;;){let n=t.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=t.pmViewDesc;if(r){for(let i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==r)return i}return-1}t=n}}updateNextNode(t,n,r,i,o,s){for(let a=this.index;a<this.top.children.length;a++){let l=this.top.children[a];if(l instanceof ts){let c=this.preMatch.matched.get(l);if(c!=null&&c!=o)return!1;let u=l.dom,f,d=this.isLocked(u)&&!(t.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==t.text&&l.dirty!=vi&&Yp(n,l.outerDeco));if(!d&&l.update(t,n,r,i))return this.destroyBetween(this.index,a),l.dom!=u&&(this.changed=!0),this.index++,!0;if(!d&&(f=this.recreateWrapper(l,t,n,r,i,s)))return this.destroyBetween(this.index,a),this.top.children[this.index]=f,f.contentDOM&&(f.dirty=qs,f.updateChildren(i,s+1),f.dirty=Er),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(t,n,r,i,o,s){if(t.dirty||n.isAtom||!t.children.length||!t.node.content.eq(n.content)||!Yp(r,t.outerDeco)||!i.eq(t.innerDeco))return null;let a=ts.create(this.top,n,r,i,o,s);if(a.contentDOM){a.children=t.children,t.children=[];for(let l of a.children)l.parent=a}return t.destroy(),a}addNode(t,n,r,i,o){let s=ts.create(this.top,t,n,r,i,o);s.contentDOM&&s.updateChildren(i,o+1),this.top.children.splice(this.index++,0,s),this.changed=!0}placeWidget(t,n,r){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(i&&i.matchesWidget(t)&&(t==i.widget||!i.widget.type.toDOM.parentNode))this.index++;else{let o=new t3(this.top,t,n,r);this.top.children.splice(this.index++,0,o),this.changed=!0}}addTextblockHacks(){let t=this.top.children[this.index-1],n=this.top;for(;t instanceof ba;)n=t,t=n.children[n.children.length-1];(!t||!(t instanceof Ng)||/\n$/.test(t.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(t.node.text))&&((cn||Gt)&&t&&t.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(t,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(t))this.index++;else{let r=document.createElement(t);t=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),t=="BR"&&(r.className="ProseMirror-trailingBreak");let i=new n3(this.top,[],r,null);n!=this.top?n.children.push(i):n.children.splice(this.index++,0,i),this.changed=!0}}isLocked(t){return this.lock&&(t==this.lock||t.nodeType==1&&t.contains(this.lock.parentNode))}}function G9(e,t){let n=t,r=n.children.length,i=e.childCount,o=new Map,s=[];e:for(;i>0;){let a;for(;;)if(r){let c=n.children[r-1];if(c instanceof ba)n=c,r=c.children.length;else{a=c,r--;break}}else{if(n==t)break e;r=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=e.child(i-1))break;--i,o.set(a,i),s.push(a)}}return{index:i,matched:o,matches:s.reverse()}}function X9(e,t){return e.type.side-t.type.side}function Q9(e,t,n,r){let i=t.locals(e),o=0;if(i.length==0){for(let c=0;c<e.childCount;c++){let u=e.child(c);r(u,i,t.forChild(o,u),c),o+=u.nodeSize}return}let s=0,a=[],l=null;for(let c=0;;){let u,f;for(;s<i.length&&i[s].to==o;){let y=i[s++];y.widget&&(u?(f||(f=[u])).push(y):u=y)}if(u)if(f){f.sort(X9);for(let y=0;y<f.length;y++)n(f[y],c,!!l)}else n(u,c,!!l);let d,h;if(l)h=-1,d=l,l=null;else if(c<e.childCount)h=c,d=e.child(c++);else break;for(let y=0;y<a.length;y++)a[y].to<=o&&a.splice(y--,1);for(;s<i.length&&i[s].from<=o&&i[s].to>o;)a.push(i[s++]);let p=o+d.nodeSize;if(d.isText){let y=p;s<i.length&&i[s].from<y&&(y=i[s].from);for(let v=0;v<a.length;v++)a[v].to<y&&(y=a[v].to);y<p&&(l=d.cut(y-o),d=d.cut(0,y-o),p=y,h=-1)}else for(;s<i.length&&i[s].to<p;)s++;let g=d.isInline&&!d.isLeaf?a.filter(y=>!y.inline):a.slice();r(d,g,t.forChild(o,d),h),o=p}}function J9(e){if(e.nodeName=="UL"||e.nodeName=="OL"){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}function Z9(e,t,n,r){for(let i=0,o=0;i<e.childCount&&o<=r;){let s=e.child(i++),a=o;if(o+=s.nodeSize,!s.isText)continue;let l=s.text;for(;i<e.childCount;){let c=e.child(i++);if(o+=c.nodeSize,!c.isText)break;l+=c.text}if(o>=n){if(o>=r&&l.slice(r-t.length-a,r-a)==t)return r-t.length;let c=a<r?l.lastIndexOf(t,r-a-1):-1;if(c>=0&&c+t.length+a>=n)return a+c;if(n==r&&l.length>=r+t.length-a&&l.slice(r-a,r-a+t.length)==t)return r}}return-1}function Nb(e,t,n,r,i){let o=[];for(let s=0,a=0;s<e.length;s++){let l=e[s],c=a,u=a+=l.size;c>=n||u<=t?o.push(l):(c<t&&o.push(l.slice(0,t-c,r)),i&&(o.push(i),i=void 0),u>n&&o.push(l.slice(n-c,l.size,r)))}return o}function kS(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),o=i&&i.size==0,s=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a=r.resolve(s),l,c;if(Dg(n)){for(l=s;i&&!i.node;)i=i.parent;let f=i.node;if(i&&f.isAtom&&J.isSelectable(f)&&i.parent&&!(f.isInline&&M9(n.focusNode,n.focusOffset,i.dom))){let d=i.posBefore;c=new J(s==d?a:r.resolve(d))}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let f=s,d=s;for(let h=0;h<n.rangeCount;h++){let p=n.getRangeAt(h);f=Math.min(f,e.docView.posFromDOM(p.startContainer,p.startOffset,1)),d=Math.max(d,e.docView.posFromDOM(p.endContainer,p.endOffset,-1))}if(f<0)return null;[l,s]=d==e.state.selection.anchor?[d,f]:[f,d],a=r.resolve(s)}else l=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(l<0)return null}let u=r.resolve(l);if(!c){let f=t=="pointer"||e.state.selection.head<a.pos&&!o?1:-1;c=DS(e,u,a,f)}return c}function s3(e){return e.editable?e.hasFocus():l3(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function Wi(e,t=!1){let n=e.state.selection;if(a3(e,n),!!s3(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&Gt){let r=e.domSelectionRange(),i=e.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&ya(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){e.input.mouseDown.delayedSelectionSync=!0,e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)t7(e);else{let{anchor:r,head:i}=n,o,s;IT&&!(n instanceof ne)&&(n.$from.parent.inlineContent||(o=PT(e,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(s=PT(e,n.to))),e.docView.setSelection(r,i,e,t),IT&&(o&&BT(o),s&&BT(s)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&e7(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const IT=cn||Gt&&WR<63;function PT(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=r<n.childNodes.length?n.childNodes[r]:null,o=r?n.childNodes[r-1]:null;if(cn&&i&&i.contentEditable=="false")return cy(i);if((!i||i.contentEditable=="false")&&(!o||o.contentEditable=="false")){if(i)return cy(i);if(o)return cy(o)}}function cy(e){return e.contentEditable="true",cn&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function BT(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function e7(e){let t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.input.hideSelectionGuard);let n=e.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=i)&&(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout(()=>{(!s3(e)||e.state.selection.visible)&&e.dom.classList.remove("ProseMirror-hideselection")},20))})}function t7(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,r=n.nodeName=="IMG";r?t.collapse(n.parentNode,Ft(n)+1):t.collapse(n,0),!r&&!e.state.selection.visible&&Rn&&es<=11&&(n.disabled=!0,n.disabled=!1)}function a3(e,t){if(t instanceof J){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(HT(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else HT(e)}function HT(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function DS(e,t,n,r){return e.someProp("createSelectionBetween",i=>i(e,t,n))||ne.between(t,n,r)}function $T(e){return e.editable&&!e.hasFocus()?!1:l3(e)}function l3(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(t.anchorNode.nodeType==3?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(t.focusNode.nodeType==3?t.focusNode.parentNode:t.focusNode))}catch{return!1}}function n7(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return ya(t.node,t.offset,n.anchorNode,n.anchorOffset)}function _b(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return o&&he.findFrom(o,t)}function wo(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function UT(e,t,n){let r=e.state.selection;if(r instanceof ne)if(n.indexOf("s")>-1){let{$head:i}=r,o=i.textOffset?null:t<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let s=e.state.doc.resolve(i.pos+o.nodeSize*(t<0?-1:1));return wo(e,new ne(r.$anchor,s))}else if(r.empty){if(e.endOfTextblock(t>0?"forward":"backward")){let i=_b(e.state,t);return i&&i instanceof J?wo(e,i):!1}else if(!(cr&&n.indexOf("m")>-1)){let i=r.$head,o=i.textOffset?null:t<0?i.nodeBefore:i.nodeAfter,s;if(!o||o.isText)return!1;let a=t<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(s=e.docView.descAt(a))&&!s.contentDOM?J.isSelectable(o)?wo(e,new J(t<0?e.state.doc.resolve(i.pos-o.nodeSize):i)):dd?wo(e,new ne(e.state.doc.resolve(t<0?a:a+o.nodeSize))):!1:!1}}else return!1;else{if(r instanceof J&&r.node.isInline)return wo(e,new ne(t>0?r.$to:r.$from));{let i=_b(e.state,t);return i?wo(e,i):!1}}}function Gp(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function Bu(e,t){let n=e.pmViewDesc;return n&&n.size==0&&(t<0||e.nextSibling||e.nodeName!="BR")}function qa(e,t){return t<0?r7(e):i7(e)}function r7(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,s=!1;for(wr&&n.nodeType==1&&r<Gp(n)&&Bu(n.childNodes[r],-1)&&(s=!0);;)if(r>0){if(n.nodeType!=1)break;{let a=n.childNodes[r-1];if(Bu(a,-1))i=n,o=--r;else if(a.nodeType==3)n=a,r=n.nodeValue.length;else break}}else{if(c3(n))break;{let a=n.previousSibling;for(;a&&Bu(a,-1);)i=n.parentNode,o=Ft(a),a=a.previousSibling;if(a)n=a,r=Gp(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}s?Rb(e,n,r):i&&Rb(e,i,o)}function i7(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i=Gp(n),o,s;for(;;)if(r<i){if(n.nodeType!=1)break;let a=n.childNodes[r];if(Bu(a,1))o=n,s=++r;else break}else{if(c3(n))break;{let a=n.nextSibling;for(;a&&Bu(a,1);)o=a.parentNode,s=Ft(a)+1,a=a.nextSibling;if(a)n=a,r=0,i=Gp(n);else{if(n=n.parentNode,n==e.dom)break;r=i=0}}}o&&Rb(e,o,s)}function c3(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function o7(e,t){for(;e&&t==e.childNodes.length&&!fd(e);)t=Ft(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;e=n,t=0}}function s7(e,t){for(;e&&!t&&!fd(e);)t=Ft(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;e=n,t=e.childNodes.length}}function Rb(e,t,n){if(t.nodeType!=3){let o,s;(s=o7(t,n))?(t=s,n=0):(o=s7(t,n))&&(t=o,n=o.nodeValue.length)}let r=e.domSelection();if(!r)return;if(Dg(r)){let o=document.createRange();o.setEnd(t,n),o.setStart(t,n),r.removeAllRanges(),r.addRange(o)}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:i}=e;setTimeout(()=>{e.state==i&&Wi(e)},50)}function VT(e,t){let n=e.state.doc.resolve(t);if(!(Gt||YR)&&n.parent.inlineContent){let i=e.coordsAtPos(t);if(t>n.start()){let o=e.coordsAtPos(t-1),s=(o.top+o.bottom)/2;if(s>i.top&&s<i.bottom&&Math.abs(o.left-i.left)>1)return o.left<i.left?"ltr":"rtl"}if(t<n.end()){let o=e.coordsAtPos(t+1),s=(o.top+o.bottom)/2;if(s>i.top&&s<i.bottom&&Math.abs(o.left-i.left)>1)return o.left>i.left?"ltr":"rtl"}}return getComputedStyle(e.dom).direction=="rtl"?"rtl":"ltr"}function FT(e,t,n){let r=e.state.selection;if(r instanceof ne&&!r.empty||n.indexOf("s")>-1||cr&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let s=_b(e.state,t);if(s&&s instanceof J)return wo(e,s)}if(!i.parent.inlineContent){let s=t<0?i:o,a=r instanceof er?he.near(s,t):he.findFrom(s,t);return a?wo(e,a):!1}return!1}function qT(e,t){if(!(e.state.selection instanceof ne))return!0;let{$head:n,$anchor:r,empty:i}=e.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let o=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let s=e.state.tr;return t<0?s.delete(n.pos-o.nodeSize,n.pos):s.delete(n.pos,n.pos+o.nodeSize),e.dispatch(s),!0}return!1}function KT(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function a7(e){if(!cn||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&t.nodeType==1&&n==0&&t.firstChild&&t.firstChild.contentEditable=="false"){let r=t.firstChild;KT(e,r,"true"),setTimeout(()=>KT(e,r,"false"),20)}return!1}function l7(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}function c7(e,t){let n=t.keyCode,r=l7(t);if(n==8||cr&&n==72&&r=="c")return qT(e,-1)||qa(e,-1);if(n==46&&!t.shiftKey||cr&&n==68&&r=="c")return qT(e,1)||qa(e,1);if(n==13||n==27)return!0;if(n==37||cr&&n==66&&r=="c"){let i=n==37?VT(e,e.state.selection.from)=="ltr"?-1:1:-1;return UT(e,i,r)||qa(e,i)}else if(n==39||cr&&n==70&&r=="c"){let i=n==39?VT(e,e.state.selection.from)=="ltr"?1:-1:1;return UT(e,i,r)||qa(e,i)}else{if(n==38||cr&&n==80&&r=="c")return FT(e,-1,r)||qa(e,-1);if(n==40||cr&&n==78&&r=="c")return a7(e)||FT(e,1,r)||qa(e,1);if(r==(cr?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function NS(e,t){e.someProp("transformCopied",h=>{t=h(t,e)});let n=[],{content:r,openStart:i,openEnd:o}=t;for(;i>1&&o>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,o--;let h=r.firstChild;n.push(h.type.name,h.attrs!=h.type.defaultAttrs?h.attrs:null),r=h.content}let s=e.someProp("clipboardSerializer")||Ra.fromSchema(e.state.schema),a=m3(),l=a.createElement("div");l.appendChild(s.serializeFragment(r,{document:a}));let c=l.firstChild,u,f=0;for(;c&&c.nodeType==1&&(u=p3[c.nodeName.toLowerCase()]);){for(let h=u.length-1;h>=0;h--){let p=a.createElement(u[h]);for(;l.firstChild;)p.appendChild(l.firstChild);l.appendChild(p),f++}c=l.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${i} ${o}${f?` -${f}`:""} ${JSON.stringify(n)}`);let d=e.someProp("clipboardTextSerializer",h=>h(t,e))||t.content.textBetween(0,t.content.size,`
342
+
343
+ `);return{dom:l,text:d,slice:t}}function u3(e,t,n,r,i){let o=i.parent.type.spec.code,s,a;if(!n&&!t)return null;let l=!!t&&(r||o||!n);if(l){if(e.someProp("transformPastedText",d=>{t=d(t,o||r,e)}),o)return a=new W(B.from(e.state.schema.text(t.replace(/\r\n?/g,`
344
+ `))),0,0),e.someProp("transformPasted",d=>{a=d(a,e,!0)}),a;let f=e.someProp("clipboardTextParser",d=>d(t,i,r,e));if(f)a=f;else{let d=i.marks(),{schema:h}=e.state,p=Ra.fromSchema(h);s=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(g=>{let y=s.appendChild(document.createElement("p"));g&&y.appendChild(p.serializeNode(h.text(g,d)))})}}else e.someProp("transformPastedHTML",f=>{n=f(n,e)}),s=h7(n),dd&&p7(s);let c=s&&s.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let f=+u[3];f>0;f--){let d=s.firstChild;for(;d&&d.nodeType!=1;)d=d.nextSibling;if(!d)break;s=d}if(a||(a=(e.someProp("clipboardParser")||e.someProp("domParser")||Zo.fromSchema(e.state.schema)).parseSlice(s,{preserveWhitespace:!!(l||u),context:i,ruleFromNode(d){return d.nodeName=="BR"&&!d.nextSibling&&d.parentNode&&!u7.test(d.parentNode.nodeName)?{ignore:!0}:null}})),u)a=m7(WT(a,+u[1],+u[2]),u[4]);else if(a=W.maxOpen(f7(a.content,i),!0),a.openStart||a.openEnd){let f=0,d=0;for(let h=a.content.firstChild;f<a.openStart&&!h.type.spec.isolating;f++,h=h.firstChild);for(let h=a.content.lastChild;d<a.openEnd&&!h.type.spec.isolating;d++,h=h.lastChild);a=WT(a,f,d)}return e.someProp("transformPasted",f=>{a=f(a,e,l)}),a}const u7=/^(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 f7(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let i=t.node(n).contentMatchAt(t.index(n)),o,s=[];if(e.forEach(a=>{if(!s)return;let l=i.findWrapping(a.type),c;if(!l)return s=null;if(c=s.length&&o.length&&d3(l,o,a,s[s.length-1],0))s[s.length-1]=c;else{s.length&&(s[s.length-1]=h3(s[s.length-1],o.length));let u=f3(a,l);s.push(u),i=i.matchType(u.type),o=l}}),s)return B.from(s)}return e}function f3(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,B.from(e));return e}function d3(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let o=d3(e,t,n,r.lastChild,i+1);if(o)return r.copy(r.content.replaceChild(r.childCount-1,o));if(r.contentMatchAt(r.childCount).matchType(i==e.length-1?n.type:e[i+1]))return r.copy(r.content.append(B.from(f3(n,e,i+1))))}}function h3(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,h3(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(B.empty,!0);return e.copy(n.append(r))}function Lb(e,t,n,r,i,o){let s=t<0?e.firstChild:e.lastChild,a=s.content;return e.childCount>1&&(o=0),i<r-1&&(a=Lb(a,t,n,r,i+1,o)),i>=n&&(a=t<0?s.contentMatchAt(0).fillBefore(a,o<=i).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(B.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,s.copy(a))}function WT(e,t,n){return t<e.openStart&&(e=new W(Lb(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new W(Lb(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const p3={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let YT=null;function m3(){return YT||(YT=document.implementation.createHTMLDocument("title"))}let uy=null;function d7(e){let t=window.trustedTypes;return t?(uy||(uy=t.defaultPolicy||t.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),uy.createHTML(e)):e}function h7(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=m3().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(e),i;if((i=r&&p3[r[1].toLowerCase()])&&(e=i.map(o=>"<"+o+">").join("")+e+i.map(o=>"</"+o+">").reverse().join("")),n.innerHTML=d7(e),i)for(let o=0;o<i.length;o++)n=n.querySelector(i[o])||n;return n}function p7(e){let t=e.querySelectorAll(Gt?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let r=t[n];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}function m7(e,t){if(!e.size)return e;let n=e.content.firstChild.type.schema,r;try{r=JSON.parse(t)}catch{return e}let{content:i,openStart:o,openEnd:s}=e;for(let a=r.length-2;a>=0;a-=2){let l=n.nodes[r[a]];if(!l||l.hasRequiredAttrs())break;i=B.from(l.create(r[a+1],i)),o++,s++}return new W(i,o,s)}const yn={},bn={},g7={touchstart:!0,touchmove:!0};class v7{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 y7(e){for(let t in yn){let n=yn[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=r=>{x7(e,r)&&!_S(e,r)&&(e.editable||!(r.type in bn))&&n(e,r)},g7[t]?{passive:!0}:void 0)}cn&&e.dom.addEventListener("input",()=>null),jb(e)}function $o(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function b7(e){e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}function jb(e){e.someProp("handleDOMEvents",t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=r=>_S(e,r))})}function _S(e,t){return e.someProp("handleDOMEvents",n=>{let r=n[t.type];return r?r(e,t)||t.defaultPrevented:!1})}function x7(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function S7(e,t){!_S(e,t)&&yn[t.type]&&(e.editable||!(t.type in bn))&&yn[t.type](e,t)}bn.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!v3(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(Bi&&Gt&&n.keyCode==13)))if(n.keyCode!=229&&e.domObserver.forceFlush(),Zl&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();e.input.lastIOSEnter=r,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==r&&(e.someProp("handleKeyDown",i=>i(e,Us(13,"Enter"))),e.input.lastIOSEnter=0)},200)}else e.someProp("handleKeyDown",r=>r(e,n))||c7(e,n)?n.preventDefault():$o(e,"key")};bn.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)};bn.keypress=(e,t)=>{let n=t;if(v3(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||cr&&n.metaKey)return;if(e.someProp("handleKeyPress",i=>i(e,n))){n.preventDefault();return}let r=e.state.selection;if(!(r instanceof ne)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode),o=()=>e.state.tr.insertText(i).scrollIntoView();!/[\r\n]/.test(i)&&!e.someProp("handleTextInput",s=>s(e,r.$from.pos,r.$to.pos,i,o))&&e.dispatch(o()),n.preventDefault()}};function _g(e){return{left:e.clientX,top:e.clientY}}function w7(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function RS(e,t,n,r,i){if(r==-1)return!1;let o=e.state.doc.resolve(r);for(let s=o.depth+1;s>0;s--)if(e.someProp(t,a=>s>o.depth?a(e,n,o.nodeAfter,o.before(s),i,!0):a(e,n,o.node(s),o.before(s),i,!1)))return!0;return!1}function _l(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);r.setMeta("pointer",!0),e.dispatch(r)}function E7(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return r&&r.isAtom&&J.isSelectable(r)?(_l(e,new J(n)),!0):!1}function C7(e,t){if(t==-1)return!1;let n=e.state.selection,r,i;n instanceof J&&(r=n.node);let o=e.state.doc.resolve(t);for(let s=o.depth+1;s>0;s--){let a=s>o.depth?o.nodeAfter:o.node(s);if(J.isSelectable(a)){r&&n.$from.depth>0&&s>=n.$from.depth&&o.before(n.$from.depth+1)==n.$from.pos?i=o.before(n.$from.depth):i=o.before(s);break}}return i!=null?(_l(e,J.create(e.state.doc,i)),!0):!1}function T7(e,t,n,r,i){return RS(e,"handleClickOn",t,n,r)||e.someProp("handleClick",o=>o(e,t,r))||(i?C7(e,n):E7(e,n))}function M7(e,t,n,r){return RS(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",i=>i(e,t,r))}function O7(e,t,n,r){return RS(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",i=>i(e,t,r))||A7(e,n,r)}function A7(e,t,n){if(n.button!=0)return!1;let r=e.state.doc;if(t==-1)return r.inlineContent?(_l(e,ne.create(r,0,r.content.size)),!0):!1;let i=r.resolve(t);for(let o=i.depth+1;o>0;o--){let s=o>i.depth?i.nodeAfter:i.node(o),a=i.before(o);if(s.inlineContent)_l(e,ne.create(r,a+1,a+1+s.content.size));else if(J.isSelectable(s))_l(e,J.create(r,a));else continue;return!0}}function LS(e){return Xp(e)}const g3=cr?"metaKey":"ctrlKey";yn.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=LS(e),i=Date.now(),o="singleClick";i-e.input.lastClick.time<500&&w7(n,e.input.lastClick)&&!n[g3]&&e.input.lastClick.button==n.button&&(e.input.lastClick.type=="singleClick"?o="doubleClick":e.input.lastClick.type=="doubleClick"&&(o="tripleClick")),e.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o,button:n.button};let s=e.posAtCoords(_g(n));s&&(o=="singleClick"?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new k7(e,s,n,!!r)):(o=="doubleClick"?M7:O7)(e,s.pos,s.inside,n)?n.preventDefault():$o(e,"pointer"))};class k7{constructor(t,n,r,i){this.view=t,this.pos=n,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=t.state.doc,this.selectNode=!!r[g3],this.allowDefault=r.shiftKey;let o,s;if(n.inside>-1)o=t.state.doc.nodeAt(n.inside),s=n.inside;else{let u=t.state.doc.resolve(n.pos);o=u.parent,s=u.depth?u.before():0}const a=i?null:r.target,l=a?t.docView.nearestDesc(a,!0):null;this.target=l&&l.nodeDOM.nodeType==1?l.nodeDOM:null;let{selection:c}=t.state;(r.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||c instanceof J&&c.from<=s&&c.to>s)&&(this.mightDrag={node:o,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&wr&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),$o(t,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>Wi(this.view)),this.view.input.mouseDown=null}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(_g(t))),this.updateAllowDefault(t),this.allowDefault||!n?$o(this.view,"pointer"):T7(this.view,n.pos,n.inside,t,this.selectNode)?t.preventDefault():t.button==0&&(this.flushed||cn&&this.mightDrag&&!this.mightDrag.node.isAtom||Gt&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(_l(this.view,he.near(this.view.state.doc.resolve(n.pos))),t.preventDefault()):$o(this.view,"pointer")}move(t){this.updateAllowDefault(t),$o(this.view,"pointer"),t.buttons==0&&this.done()}updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}}yn.touchstart=e=>{e.input.lastTouch=Date.now(),LS(e),$o(e,"pointer")};yn.touchmove=e=>{e.input.lastTouch=Date.now(),$o(e,"pointer")};yn.contextmenu=e=>LS(e);function v3(e,t){return e.composing?!0:cn&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}const D7=Bi?5e3:-1;bn.compositionstart=bn.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof ne&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)||Gt&&YR&&N7(e)))e.markCursor=e.state.storedMarks||n.marks(),Xp(e,!0),e.markCursor=null;else if(Xp(e,!t.selection.empty),wr&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=e.domSelectionRange();for(let i=r.focusNode,o=r.focusOffset;i&&i.nodeType==1&&o!=0;){let s=o<0?i.lastChild:i.childNodes[o-1];if(!s)break;if(s.nodeType==3){let a=e.domSelection();a&&a.collapse(s,s.nodeValue.length);break}else i=s,o=-1}}e.input.composing=!0}y3(e,D7)};function N7(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||t.nodeType!=1||n>=t.childNodes.length)return!1;let r=t.childNodes[n];return r.nodeType==1&&r.contentEditable=="false"}bn.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.badSafariComposition?e.domObserver.forceFlush():e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,y3(e,20))};function y3(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>Xp(e),t))}function b3(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=R7());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function _7(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=C9(t.focusNode,t.focusOffset),r=T9(t.focusNode,t.focusOffset);if(n&&r&&n!=r){let i=r.pmViewDesc,o=e.domObserver.lastChangedTextNode;if(n==o||r==o)return o;if(!i||!i.isText(r.nodeValue))return r;if(e.input.compositionNode==r){let s=n.pmViewDesc;if(!(!s||!s.isText(n.nodeValue)))return r}}return n||r}function R7(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}function Xp(e,t=!1){if(!(Bi&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),b3(e),t||e.docView&&e.docView.dirty){let n=kS(e),r=e.state.selection;return n&&!n.eq(r)?e.dispatch(e.state.tr.setSelection(n)):(e.markCursor||t)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0}return!1}}function L7(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}const Tf=Rn&&es<15||Zl&&k9<604;yn.copy=bn.cut=(e,t)=>{let n=t,r=e.state.selection,i=n.type=="cut";if(r.empty)return;let o=Tf?null:n.clipboardData,s=r.content(),{dom:a,text:l}=NS(e,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",a.innerHTML),o.setData("text/plain",l)):L7(e,a),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function j7(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function z7(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=e.input.shiftKey&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Mf(e,r.value,null,i,t):Mf(e,r.textContent,r.innerHTML,i,t)},50)}function Mf(e,t,n,r,i){let o=u3(e,t,n,r,e.state.selection.$from);if(e.someProp("handlePaste",l=>l(e,i,o||W.empty)))return!0;if(!o)return!1;let s=j7(o),a=s?e.state.tr.replaceSelectionWith(s,r):e.state.tr.replaceSelection(o);return e.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function x3(e){let t=e.getData("text/plain")||e.getData("Text");if(t)return t;let n=e.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}bn.paste=(e,t)=>{let n=t;if(e.composing&&!Bi)return;let r=Tf?null:n.clipboardData,i=e.input.shiftKey&&e.input.lastKeyCode!=45;r&&Mf(e,x3(r),r.getData("text/html"),i,n)?n.preventDefault():z7(e,n)};class S3{constructor(t,n,r){this.slice=t,this.move=n,this.node=r}}const I7=cr?"altKey":"ctrlKey";function w3(e,t){let n=e.someProp("dragCopies",r=>!r(t));return n??!t[I7]}yn.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=e.state.selection,o=i.empty?null:e.posAtCoords(_g(n)),s;if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof J?i.to-1:i.to))){if(r&&r.mightDrag)s=J.create(e.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let f=e.docView.nearestDesc(n.target,!0);f&&f.node.type.spec.draggable&&f!=e.docView&&(s=J.create(e.state.doc,f.posBefore))}}let a=(s||e.state.selection).content(),{dom:l,text:c,slice:u}=NS(e,a);(!n.dataTransfer.files.length||!Gt||WR>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(Tf?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",Tf||n.dataTransfer.setData("text/plain",c),e.dragging=new S3(u,w3(e,n),s)};yn.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)};bn.dragover=bn.dragenter=(e,t)=>t.preventDefault();bn.drop=(e,t)=>{try{P7(e,t,e.dragging)}finally{e.dragging=null}};function P7(e,t,n){if(!t.dataTransfer)return;let r=e.posAtCoords(_g(t));if(!r)return;let i=e.state.doc.resolve(r.pos),o=n&&n.slice;o?e.someProp("transformPasted",h=>{o=h(o,e,!1)}):o=u3(e,x3(t.dataTransfer),Tf?null:t.dataTransfer.getData("text/html"),!1,i);let s=!!(n&&w3(e,t));if(e.someProp("handleDrop",h=>h(e,t,o||W.empty,s))){t.preventDefault();return}if(!o)return;t.preventDefault();let a=o?PR(e.state.doc,i.pos,o):i.pos;a==null&&(a=i.pos);let l=e.state.tr;if(s){let{node:h}=n;h?h.replace(l):l.deleteSelection()}let c=l.mapping.map(a),u=o.openStart==0&&o.openEnd==0&&o.content.childCount==1,f=l.doc;if(u?l.replaceRangeWith(c,c,o.content.firstChild):l.replaceRange(c,c,o),l.doc.eq(f))return;let d=l.doc.resolve(c);if(u&&J.isSelectable(o.content.firstChild)&&d.nodeAfter&&d.nodeAfter.sameMarkup(o.content.firstChild))l.setSelection(new J(d));else{let h=l.mapping.map(a);l.mapping.maps[l.mapping.maps.length-1].forEach((p,g,y,v)=>h=v),l.setSelection(DS(e,d,l.doc.resolve(h)))}e.focus(),e.dispatch(l.setMeta("uiEvent","drop"))}yn.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&Wi(e)},20))};yn.blur=(e,t)=>{let n=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)};yn.beforeinput=(e,t)=>{if(Gt&&Bi&&t.inputType=="deleteContentBackward"){e.domObserver.flushSoon();let{domChangeCount:r}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=r||(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",o=>o(e,Us(8,"Backspace")))))return;let{$cursor:i}=e.state.selection;i&&i.pos>0&&e.dispatch(e.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let e in bn)yn[e]=bn[e];function Of(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}class Qp{constructor(t,n){this.toDOM=t,this.spec=n||ta,this.side=this.spec.side||0}map(t,n,r,i){let{pos:o,deleted:s}=t.mapResult(n.from+i,this.side<0?-1:1);return s?null:new Xt(o-r,o-r,this)}valid(){return!0}eq(t){return this==t||t instanceof Qp&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&Of(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class ns{constructor(t,n){this.attrs=t,this.spec=n||ta}map(t,n,r,i){let o=t.map(n.from+i,this.spec.inclusiveStart?-1:1)-r,s=t.map(n.to+i,this.spec.inclusiveEnd?1:-1)-r;return o>=s?null:new Xt(o,s,this)}valid(t,n){return n.from<n.to}eq(t){return this==t||t instanceof ns&&Of(this.attrs,t.attrs)&&Of(this.spec,t.spec)}static is(t){return t.type instanceof ns}destroy(){}}class jS{constructor(t,n){this.attrs=t,this.spec=n||ta}map(t,n,r,i){let o=t.mapResult(n.from+i,1);if(o.deleted)return null;let s=t.mapResult(n.to+i,-1);return s.deleted||s.pos<=o.pos?null:new Xt(o.pos-r,s.pos-r,this)}valid(t,n){let{index:r,offset:i}=t.content.findIndex(n.from),o;return i==n.from&&!(o=t.child(r)).isText&&i+o.nodeSize==n.to}eq(t){return this==t||t instanceof jS&&Of(this.attrs,t.attrs)&&Of(this.spec,t.spec)}destroy(){}}class Xt{constructor(t,n,r){this.from=t,this.to=n,this.type=r}copy(t,n){return new Xt(t,n,this.type)}eq(t,n=0){return this.type.eq(t.type)&&this.from+n==t.from&&this.to+n==t.to}map(t,n,r){return this.type.map(t,this,n,r)}static widget(t,n,r){return new Xt(t,t,new Qp(n,r))}static inline(t,n,r,i){return new Xt(t,n,new ns(r,i))}static node(t,n,r,i){return new Xt(t,n,new jS(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof ns}get widget(){return this.type instanceof Qp}}const rl=[],ta={};class et{constructor(t,n){this.local=t.length?t:rl,this.children=n.length?n:rl}static create(t,n){return n.length?Jp(n,t,0,ta):sn}find(t,n,r){let i=[];return this.findInner(t??0,n??1e9,i,0,r),i}findInner(t,n,r,i,o){for(let s=0;s<this.local.length;s++){let a=this.local[s];a.from<=n&&a.to>=t&&(!o||o(a.spec))&&r.push(a.copy(a.from+i,a.to+i))}for(let s=0;s<this.children.length;s+=3)if(this.children[s]<n&&this.children[s+1]>t){let a=this.children[s]+1;this.children[s+2].findInner(t-a,n-a,r,i+a,o)}}map(t,n,r){return this==sn||t.maps.length==0?this:this.mapInner(t,n,0,0,r||ta)}mapInner(t,n,r,i,o){let s;for(let a=0;a<this.local.length;a++){let l=this.local[a].map(t,r,i);l&&l.type.valid(n,l)?(s||(s=[])).push(l):o.onRemove&&o.onRemove(this.local[a].spec)}return this.children.length?B7(this.children,s||[],t,n,r,i,o):s?new et(s.sort(na),rl):sn}add(t,n){return n.length?this==sn?et.create(t,n):this.addInner(t,n,0):this}addInner(t,n,r){let i,o=0;t.forEach((a,l)=>{let c=l+r,u;if(u=C3(n,a,c)){for(i||(i=this.children.slice());o<i.length&&i[o]<l;)o+=3;i[o]==l?i[o+2]=i[o+2].addInner(a,u,c+1):i.splice(o,0,l,l+a.nodeSize,Jp(u,a,c+1,ta)),o+=3}});let s=E3(o?T3(n):n,-r);for(let a=0;a<s.length;a++)s[a].type.valid(t,s[a])||s.splice(a--,1);return new et(s.length?this.local.concat(s).sort(na):this.local,i||this.children)}remove(t){return t.length==0||this==sn?this:this.removeInner(t,0)}removeInner(t,n){let r=this.children,i=this.local;for(let o=0;o<r.length;o+=3){let s,a=r[o]+n,l=r[o+1]+n;for(let u=0,f;u<t.length;u++)(f=t[u])&&f.from>a&&f.to<l&&(t[u]=null,(s||(s=[])).push(f));if(!s)continue;r==this.children&&(r=this.children.slice());let c=r[o+2].removeInner(s,a+1);c!=sn?r[o+2]=c:(r.splice(o,3),o-=3)}if(i.length){for(let o=0,s;o<t.length;o++)if(s=t[o])for(let a=0;a<i.length;a++)i[a].eq(s,n)&&(i==this.local&&(i=this.local.slice()),i.splice(a--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new et(i,r):sn}forChild(t,n){if(this==sn)return this;if(n.isLeaf)return et.empty;let r,i;for(let a=0;a<this.children.length;a+=3)if(this.children[a]>=t){this.children[a]==t&&(r=this.children[a+2]);break}let o=t+1,s=o+n.content.size;for(let a=0;a<this.local.length;a++){let l=this.local[a];if(l.from<s&&l.to>o&&l.type instanceof ns){let c=Math.max(o,l.from)-o,u=Math.min(s,l.to)-o;c<u&&(i||(i=[])).push(l.copy(c,u))}}if(i){let a=new et(i.sort(na),rl);return r?new ko([a,r]):a}return r||sn}eq(t){if(this==t)return!0;if(!(t instanceof et)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(t.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=t.children[n]||this.children[n+1]!=t.children[n+1]||!this.children[n+2].eq(t.children[n+2]))return!1;return!0}locals(t){return zS(this.localsInner(t))}localsInner(t){if(this==sn)return rl;if(t.inlineContent||!this.local.some(ns.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof ns||n.push(this.local[r]);return n}forEachSet(t){t(this)}}et.empty=new et([],[]);et.removeOverlap=zS;const sn=et.empty;class ko{constructor(t){this.members=t}map(t,n){const r=this.members.map(i=>i.map(t,n,ta));return ko.from(r)}forChild(t,n){if(n.isLeaf)return et.empty;let r=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(t,n);o!=sn&&(o instanceof ko?r=r.concat(o.members):r.push(o))}return ko.from(r)}eq(t){if(!(t instanceof ko)||t.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(t.members[n]))return!1;return!0}locals(t){let n,r=!0;for(let i=0;i<this.members.length;i++){let o=this.members[i].localsInner(t);if(o.length)if(!n)n=o;else{r&&(n=n.slice(),r=!1);for(let s=0;s<o.length;s++)n.push(o[s])}}return n?zS(r?n:n.sort(na)):rl}static from(t){switch(t.length){case 0:return sn;case 1:return t[0];default:return new ko(t.every(n=>n instanceof et)?t:t.reduce((n,r)=>n.concat(r instanceof et?r:r.members),[]))}}forEachSet(t){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(t)}}function B7(e,t,n,r,i,o,s){let a=e.slice();for(let c=0,u=o;c<n.maps.length;c++){let f=0;n.maps[c].forEach((d,h,p,g)=>{let y=g-p-(h-d);for(let v=0;v<a.length;v+=3){let b=a[v+1];if(b<0||d>b+u-f)continue;let x=a[v]+u-f;h>=x?a[v+1]=d<=x?-2:-1:d>=u&&y&&(a[v]+=y,a[v+1]+=y)}f+=y}),u=n.maps[c].map(u,-1)}let l=!1;for(let c=0;c<a.length;c+=3)if(a[c+1]<0){if(a[c+1]==-2){l=!0,a[c+1]=-1;continue}let u=n.map(e[c]+o),f=u-i;if(f<0||f>=r.content.size){l=!0;continue}let d=n.map(e[c+1]+o,-1),h=d-i,{index:p,offset:g}=r.content.findIndex(f),y=r.maybeChild(p);if(y&&g==f&&g+y.nodeSize==h){let v=a[c+2].mapInner(n,y,u+1,e[c]+o+1,s);v!=sn?(a[c]=f,a[c+1]=h,a[c+2]=v):(a[c+1]=-2,l=!0)}else l=!0}if(l){let c=H7(a,e,t,n,i,o,s),u=Jp(c,r,0,s);t=u.local;for(let f=0;f<a.length;f+=3)a[f+1]<0&&(a.splice(f,3),f-=3);for(let f=0,d=0;f<u.children.length;f+=3){let h=u.children[f];for(;d<a.length&&a[d]<h;)d+=3;a.splice(d,0,u.children[f],u.children[f+1],u.children[f+2])}}return new et(t.sort(na),a)}function E3(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let i=e[r];n.push(new Xt(i.from+t,i.to+t,i.type))}return n}function H7(e,t,n,r,i,o,s){function a(l,c){for(let u=0;u<l.local.length;u++){let f=l.local[u].map(r,i,c);f?n.push(f):s.onRemove&&s.onRemove(l.local[u].spec)}for(let u=0;u<l.children.length;u+=3)a(l.children[u+2],l.children[u]+c+1)}for(let l=0;l<e.length;l+=3)e[l+1]==-1&&a(e[l+2],t[l]+o+1);return n}function C3(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,i=null;for(let o=0,s;o<e.length;o++)(s=e[o])&&s.from>n&&s.to<r&&((i||(i=[])).push(s),e[o]=null);return i}function T3(e){let t=[];for(let n=0;n<e.length;n++)e[n]!=null&&t.push(e[n]);return t}function Jp(e,t,n,r){let i=[],o=!1;t.forEach((a,l)=>{let c=C3(e,a,l+n);if(c){o=!0;let u=Jp(c,a,n+l+1,r);u!=sn&&i.push(l,l+a.nodeSize,u)}});let s=E3(o?T3(e):e,-n).sort(na);for(let a=0;a<s.length;a++)s[a].type.valid(t,s[a])||(r.onRemove&&r.onRemove(s[a].spec),s.splice(a--,1));return s.length||i.length?new et(s,i):sn}function na(e,t){return e.from-t.from||e.to-t.to}function zS(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let i=n+1;i<t.length;i++){let o=t[i];if(o.from==r.from){o.to!=r.to&&(t==e&&(t=e.slice()),t[i]=o.copy(o.from,r.to),GT(t,i+1,o.copy(r.to,o.to)));continue}else{o.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,o.from),GT(t,i,r.copy(o.from,r.to)));break}}}return t}function GT(e,t,n){for(;t<e.length&&na(n,e[t])>0;)t++;e.splice(t,0,n)}function fy(e){let t=[];return e.someProp("decorations",n=>{let r=n(e.state);r&&r!=sn&&t.push(r)}),e.cursorWrapper&&t.push(et.create(e.state.doc,[e.cursorWrapper.deco])),ko.from(t)}const $7={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},U7=Rn&&es<=11;class V7{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 F7{constructor(t,n){this.view=t,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new V7,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;i<r.length;i++)this.queue.push(r[i]);Rn&&es<=11&&r.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():cn&&t.composing&&r.some(i=>i.type=="childList"&&i.target.nodeName=="TR")?(t.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),U7&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,$7)),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 n=0;n<t.length;n++)this.queue.push(t[n]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if($T(this.view)){if(this.suppressingSelectionUpdates)return Wi(this.view);if(Rn&&es<=11&&!this.view.state.selection.empty){let t=this.view.domSelectionRange();if(t.focusNode&&ya(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 n=new Set,r;for(let o=t.focusNode;o;o=Jl(o))n.add(o);for(let o=t.anchorNode;o;o=Jl(o))if(n.has(o)){r=o;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let 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 n=this.pendingRecords();n.length&&(this.queue=[]);let r=t.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&$T(t)&&!this.ignoreSelectionChange(r),o=-1,s=-1,a=!1,l=[];if(t.editable)for(let u=0;u<n.length;u++){let f=this.registerMutation(n[u],l);f&&(o=o<0?f.from:Math.min(f.from,o),s=s<0?f.to:Math.max(f.to,s),f.typeOver&&(a=!0))}if(l.some(u=>u.nodeName=="BR")&&(t.input.lastKeyCode==8||t.input.lastKeyCode==46)){for(let u of l)if(u.nodeName=="BR"&&u.parentNode){let f=u.nextSibling;f&&f.nodeType==1&&f.contentEditable=="false"&&u.parentNode.removeChild(u)}}else if(wr&&l.length){let u=l.filter(f=>f.nodeName=="BR");if(u.length==2){let[f,d]=u;f.parentNode&&f.parentNode.parentNode==d.parentNode?d.remove():f.remove()}else{let{focusNode:f}=this.currentSelection;for(let d of u){let h=d.parentNode;h&&h.nodeName=="LI"&&(!f||W7(t,f)!=h)&&d.remove()}}}let c=null;o<0&&i&&t.input.lastFocus>Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)<Date.now()-300&&Dg(r)&&(c=kS(t))&&c.eq(he.near(t.state.doc.resolve(0),1))?(t.input.lastFocus=0,Wi(t),this.currentSelection.set(r),t.scrollToSelection()):(o>-1||i)&&(o>-1&&(t.docView.markDirty(o,s),q7(t)),t.input.badSafariComposition&&(t.input.badSafariComposition=!1,Y7(t,l)),this.handleDOMChange(o,s,a,l),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(r)||Wi(t),this.currentSelection.set(r))}registerMutation(t,n){if(n.indexOf(t.target)>-1)return null;let r=this.view.docView.nearestDesc(t.target);if(t.type=="attributes"&&(r==this.view.docView||t.attributeName=="contenteditable"||t.attributeName=="style"&&!t.oldValue&&!t.target.getAttribute("style"))||!r||r.ignoreMutation(t))return null;if(t.type=="childList"){for(let u=0;u<t.addedNodes.length;u++){let f=t.addedNodes[u];n.push(f),f.nodeType==3&&(this.lastChangedTextNode=f)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(t.target))return{from:r.posBefore,to:r.posAfter};let i=t.previousSibling,o=t.nextSibling;if(Rn&&es<=11&&t.addedNodes.length)for(let u=0;u<t.addedNodes.length;u++){let{previousSibling:f,nextSibling:d}=t.addedNodes[u];(!f||Array.prototype.indexOf.call(t.addedNodes,f)<0)&&(i=f),(!d||Array.prototype.indexOf.call(t.addedNodes,d)<0)&&(o=d)}let s=i&&i.parentNode==t.target?Ft(i)+1:0,a=r.localPosFromDOM(t.target,s,-1),l=o&&o.parentNode==t.target?Ft(o):t.target.childNodes.length,c=r.localPosFromDOM(t.target,l,1);return{from:a,to:c}}else return t.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:(this.lastChangedTextNode=t.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:t.target.nodeValue==t.oldValue})}}let XT=new WeakMap,QT=!1;function q7(e){if(!XT.has(e)&&(XT.set(e,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace)!==-1)){if(e.requiresGeckoHackNode=wr,QT)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."),QT=!0}}function JT(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,o=t.endOffset,s=e.domAtPos(e.state.selection.anchor);return ya(s.node,s.offset,i,o)&&([n,r,i,o]=[i,o,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}}function K7(e,t){if(t.getComposedRanges){let i=t.getComposedRanges(e.root)[0];if(i)return JT(e,i)}let n;function r(i){i.preventDefault(),i.stopImmediatePropagation(),n=i.getTargetRanges()[0]}return e.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),e.dom.removeEventListener("beforeinput",r,!0),n?JT(e,n):null}function W7(e,t){for(let n=t.parentNode;n&&n!=e.dom;n=n.parentNode){let r=e.docView.nearestDesc(n,!0);if(r&&r.node.isBlock)return n}return null}function Y7(e,t){var n;let{focusNode:r,focusOffset:i}=e.domSelectionRange();for(let o of t)if(((n=o.parentNode)===null||n===void 0?void 0:n.nodeName)=="TR"){let s=o.nextSibling;for(;s&&s.nodeName!="TD"&&s.nodeName!="TH";)s=s.nextSibling;if(s){let a=s;for(;;){let l=a.firstChild;if(!l||l.nodeType!=1||l.contentEditable=="false"||/^(BR|IMG)$/.test(l.nodeName))break;a=l}a.insertBefore(o,a.firstChild),r==o&&e.domSelection().collapse(o,i)}else o.parentNode.removeChild(o)}}function G7(e,t,n){let{node:r,fromOffset:i,toOffset:o,from:s,to:a}=e.docView.parseRange(t,n),l=e.domSelectionRange(),c,u=l.anchorNode;if(u&&e.dom.contains(u.nodeType==1?u:u.parentNode)&&(c=[{node:u,offset:l.anchorOffset}],Dg(l)||c.push({node:l.focusNode,offset:l.focusOffset})),Gt&&e.input.lastKeyCode===8)for(let y=o;y>i;y--){let v=r.childNodes[y-1],b=v.pmViewDesc;if(v.nodeName=="BR"&&!b){o=y;break}if(!b||b.size)break}let f=e.state.doc,d=e.someProp("domParser")||Zo.fromSchema(e.state.schema),h=f.resolve(s),p=null,g=d.parse(r,{topNode:h.parent,topMatch:h.parent.contentMatchAt(h.index()),topOpen:!0,from:i,to:o,preserveWhitespace:h.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:X7,context:h});if(c&&c[0].pos!=null){let y=c[0].pos,v=c[1]&&c[1].pos;v==null&&(v=y),p={anchor:y+s,head:v+s}}return{doc:g,sel:p,from:s,to:a}}function X7(e){let t=e.pmViewDesc;if(t)return t.parseRule();if(e.nodeName=="BR"&&e.parentNode){if(cn&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(e.parentNode.lastChild==e||cn&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName=="IMG"&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}const Q7=/^(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 J7(e,t,n,r,i){let o=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let C=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,O=kS(e,C);if(O&&!e.state.selection.eq(O)){if(Gt&&Bi&&e.input.lastKeyCode===13&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp("handleKeyDown",k=>k(e,Us(13,"Enter"))))return;let A=e.state.tr.setSelection(O);C=="pointer"?A.setMeta("pointer",!0):C=="key"&&A.scrollIntoView(),o&&A.setMeta("composition",o),e.dispatch(A)}return}let s=e.state.doc.resolve(t),a=s.sharedDepth(n);t=s.before(a+1),n=e.state.doc.resolve(n).after(a+1);let l=e.state.selection,c=G7(e,t,n),u=e.state.doc,f=u.slice(c.from,c.to),d,h;e.input.lastKeyCode===8&&Date.now()-100<e.input.lastKeyCodeTime?(d=e.state.selection.to,h="end"):(d=e.state.selection.from,h="start"),e.input.lastKeyCode=null;let p=tF(f.content,c.doc.content,c.from,d,h);if(p&&e.input.domChangeCount++,(Zl&&e.input.lastIOSEnter>Date.now()-225||Bi)&&i.some(C=>C.nodeType==1&&!Q7.test(C.nodeName))&&(!p||p.endA>=p.endB)&&e.someProp("handleKeyDown",C=>C(e,Us(13,"Enter")))){e.input.lastIOSEnter=0;return}if(!p)if(r&&l instanceof ne&&!l.empty&&l.$head.sameParent(l.$anchor)&&!e.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))p={start:l.from,endA:l.to,endB:l.to};else{if(c.sel){let C=ZT(e,e.state.doc,c.sel);if(C&&!C.eq(e.state.selection)){let O=e.state.tr.setSelection(C);o&&O.setMeta("composition",o),e.dispatch(O)}}return}e.state.selection.from<e.state.selection.to&&p.start==p.endB&&e.state.selection instanceof ne&&(p.start>e.state.selection.from&&p.start<=e.state.selection.from+2&&e.state.selection.from>=c.from?p.start=e.state.selection.from:p.endA<e.state.selection.to&&p.endA>=e.state.selection.to-2&&e.state.selection.to<=c.to&&(p.endB+=e.state.selection.to-p.endA,p.endA=e.state.selection.to)),Rn&&es<=11&&p.endB==p.start+1&&p.endA==p.start&&p.start>c.from&&c.doc.textBetween(p.start-c.from-1,p.start-c.from+1)=="  "&&(p.start--,p.endA--,p.endB--);let g=c.doc.resolveNoCache(p.start-c.from),y=c.doc.resolveNoCache(p.endB-c.from),v=u.resolve(p.start),b=g.sameParent(y)&&g.parent.inlineContent&&v.end()>=p.endA;if((Zl&&e.input.lastIOSEnter>Date.now()-225&&(!b||i.some(C=>C.nodeName=="DIV"||C.nodeName=="P"))||!b&&g.pos<c.doc.content.size&&(!g.sameParent(y)||!g.parent.inlineContent)&&g.pos<y.pos&&!/\S/.test(c.doc.textBetween(g.pos,y.pos,"","")))&&e.someProp("handleKeyDown",C=>C(e,Us(13,"Enter")))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>p.start&&eF(u,p.start,p.endA,g,y)&&e.someProp("handleKeyDown",C=>C(e,Us(8,"Backspace")))){Bi&&Gt&&e.domObserver.suppressSelectionUpdates();return}Gt&&p.endB==p.start&&(e.input.lastChromeDelete=Date.now()),Bi&&!b&&g.start()!=y.start()&&y.parentOffset==0&&g.depth==y.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==p.endA&&(p.endB-=2,y=c.doc.resolveNoCache(p.endB-c.from),setTimeout(()=>{e.someProp("handleKeyDown",function(C){return C(e,Us(13,"Enter"))})},20));let x=p.start,m=p.endA,E=C=>{let O=C||e.state.tr.replace(x,m,c.doc.slice(p.start-c.from,p.endB-c.from));if(c.sel){let A=ZT(e,O.doc,c.sel);A&&!(Gt&&e.composing&&A.empty&&(p.start!=p.endB||e.input.lastChromeDelete<Date.now()-100)&&(A.head==x||A.head==O.mapping.map(m)-1)||Rn&&A.empty&&A.head==x)&&O.setSelection(A)}return o&&O.setMeta("composition",o),O.scrollIntoView()},T;if(b)if(g.pos==y.pos){Rn&&es<=11&&g.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>Wi(e),20));let C=E(e.state.tr.delete(x,m)),O=u.resolve(p.start).marksAcross(u.resolve(p.endA));O&&C.ensureMarks(O),e.dispatch(C)}else if(p.endA==p.endB&&(T=Z7(g.parent.content.cut(g.parentOffset,y.parentOffset),v.parent.content.cut(v.parentOffset,p.endA-v.start())))){let C=E(e.state.tr);T.type=="add"?C.addMark(x,m,T.mark):C.removeMark(x,m,T.mark),e.dispatch(C)}else if(g.parent.child(g.index()).isText&&g.index()==y.index()-(y.textOffset?0:1)){let C=g.parent.textBetween(g.parentOffset,y.parentOffset),O=()=>E(e.state.tr.insertText(C,x,m));e.someProp("handleTextInput",A=>A(e,x,m,C,O))||e.dispatch(O())}else e.dispatch(E());else e.dispatch(E())}function ZT(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:DS(e,t.resolve(n.anchor),t.resolve(n.head))}function Z7(e,t){let n=e.firstChild.marks,r=t.firstChild.marks,i=n,o=r,s,a,l;for(let u=0;u<r.length;u++)i=r[u].removeFromSet(i);for(let u=0;u<n.length;u++)o=n[u].removeFromSet(o);if(i.length==1&&o.length==0)a=i[0],s="add",l=u=>u.mark(a.addToSet(u.marks));else if(i.length==0&&o.length==1)a=o[0],s="remove",l=u=>u.mark(a.removeFromSet(u.marks));else return null;let c=[];for(let u=0;u<t.childCount;u++)c.push(l(t.child(u)));if(B.from(c).eq(e))return{mark:a,type:s}}function eF(e,t,n,r,i){if(n-t<=i.pos-r.pos||dy(r,!0,!1)<i.pos)return!1;let o=e.resolve(t);if(!r.parent.isTextblock){let a=o.nodeAfter;return a!=null&&n==t+a.nodeSize}if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;let s=e.resolve(dy(o,!0,!0));return!s.parent.isTextblock||s.pos>n||dy(s,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(s.parent.content)}function dy(e,t,n){let r=e.depth,i=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,i++,t=!1;if(n){let o=e.node(r).maybeChild(e.indexAfter(r));for(;o&&!o.isLeaf;)o=o.firstChild,i++}return i}function tF(e,t,n,r,i){let o=e.findDiffStart(t,n);if(o==null)return null;let{a:s,b:a}=e.findDiffEnd(t,n+e.size,n+t.size);if(i=="end"){let l=Math.max(0,o-Math.min(s,a));r-=s+l-o}if(s<o&&e.size<t.size){let l=r<=o&&r>=s?o-r:0;o-=l,o&&o<t.size&&eM(t.textBetween(o-1,o+1))&&(o+=l?1:-1),a=o+(a-s),s=o}else if(a<o){let l=r<=o&&r>=a?o-r:0;o-=l,o&&o<e.size&&eM(e.textBetween(o-1,o+1))&&(o+=l?1:-1),s=o+(s-a),a=o}return{start:o,endA:s,endB:a}}function eM(e){if(e.length!=2)return!1;let t=e.charCodeAt(0),n=e.charCodeAt(1);return t>=56320&&t<=57343&&n>=55296&&n<=56319}class M3{constructor(t,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new v7,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(oM),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=rM(this),nM(this),this.nodeViews=iM(this),this.docView=jT(this.state.doc,tM(this),fy(this),this.dom,this),this.domObserver=new F7(this,(r,i,o,s)=>J7(this,r,i,o,s)),this.domObserver.start(),y7(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 n in t)this._props[n]=t[n];this._props.state=this.state}return this._props}update(t){t.handleDOMEvents!=this._props.handleDOMEvents&&jb(this);let n=this._props;this._props=t,t.plugins&&(t.plugins.forEach(oM),this.directPlugins=t.plugins),this.updateStateInner(t.state,n)}setProps(t){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in t)n[r]=t[r];this.update(n)}updateState(t){this.updateStateInner(t,this._props)}updateStateInner(t,n){var r;let i=this.state,o=!1,s=!1;t.storedMarks&&this.composing&&(b3(this),s=!0),this.state=t;let a=i.plugins!=t.plugins||this._props.plugins!=n.plugins;if(a||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let h=iM(this);rF(h,this.nodeViews)&&(this.nodeViews=h,o=!0)}(a||n.handleDOMEvents!=this._props.handleDOMEvents)&&jb(this),this.editable=rM(this),nM(this);let l=fy(this),c=tM(this),u=i.plugins!=t.plugins&&!i.doc.eq(t.doc)?"reset":t.scrollToSelection>i.scrollToSelection?"to selection":"preserve",f=o||!this.docView.matchesNode(t.doc,c,l);(f||!t.selection.eq(i.selection))&&(s=!0);let d=u=="preserve"&&s&&this.dom.style.overflowAnchor==null&&_9(this);if(s){this.domObserver.stop();let h=f&&(Rn||Gt)&&!this.composing&&!i.selection.empty&&!t.selection.empty&&nF(i.selection,t.selection);if(f){let p=Gt?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=_7(this)),(o||!this.docView.update(t.doc,c,l,this))&&(this.docView.updateOuterDeco(c),this.docView.destroy(),this.docView=jT(t.doc,c,l,this.dom,this)),p&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(h=!0)}h||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&n7(this))?Wi(this,h):(a3(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((r=this.dragging)===null||r===void 0)&&r.node&&!i.doc.eq(t.doc)&&this.updateDraggedNode(this.dragging,i),u=="reset"?this.dom.scrollTop=0:u=="to selection"?this.scrollToSelection():d&&R9(d)}scrollToSelection(){let t=this.domSelectionRange().focusNode;if(!(!t||!this.dom.contains(t.nodeType==1?t:t.parentNode))){if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof J){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&kT(this,n.getBoundingClientRect(),t)}else kT(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 n=0;n<this.directPlugins.length;n++){let r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let r=this.state.plugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,t)}}updateDraggedNode(t,n){let r=t.node,i=-1;if(this.state.doc.nodeAt(r.from)==r.node)i=r.from;else{let o=r.from+(this.state.doc.content.size-n.doc.content.size);(o>0&&this.state.doc.nodeAt(o))==r.node&&(i=o)}this.dragging=new S3(t.slice,t.move,i<0?void 0:J.create(this.state.doc,i))}someProp(t,n){let r=this._props&&this._props[t],i;if(r!=null&&(i=n?n(r):r))return i;for(let s=0;s<this.directPlugins.length;s++){let a=this.directPlugins[s].props[t];if(a!=null&&(i=n?n(a):a))return i}let o=this.state.plugins;if(o)for(let s=0;s<o.length;s++){let a=o[s].props[t];if(a!=null&&(i=n?n(a):a))return i}}hasFocus(){if(Rn){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&&L9(this.dom),Wi(this),this.domObserver.start()}get root(){let t=this._root;if(t==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return t||document}updateRoot(){this._root=null}posAtCoords(t){return B9(this,t)}coordsAtPos(t,n=1){return ZR(this,t,n)}domAtPos(t,n=0){return this.docView.domFromPos(t,n)}nodeDOM(t){let n=this.docView.descAt(t);return n?n.nodeDOM:null}posAtDOM(t,n,r=-1){let i=this.docView.posFromDOM(t,n,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(t,n){return F9(this,n||this.state,t)}pasteHTML(t,n){return Mf(this,"",t,!1,n||new ClipboardEvent("paste"))}pasteText(t,n){return Mf(this,t,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(t){return NS(this,t)}destroy(){this.docView&&(b7(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],fy(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,w9())}get isDestroyed(){return this.docView==null}dispatchEvent(t){return S7(this,t)}domSelectionRange(){let t=this.domSelection();return t?cn&&this.root.nodeType===11&&O9(this.dom.ownerDocument)==this.dom&&K7(this,t)||t:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}M3.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};function tM(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),e.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(e.state)),n)for(let r in n)r=="class"?t.class+=" "+n[r]:r=="style"?t.style=(t.style?t.style+";":"")+n[r]:!t[r]&&r!="contenteditable"&&r!="nodeName"&&(t[r]=String(n[r]))}),t.translate||(t.translate="no"),[Xt.node(0,e.state.doc.content.size,t)]}function nM(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:Xt.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function rM(e){return!e.someProp("editable",t=>t(e.state)===!1)}function nF(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}function iM(e){let t=Object.create(null);function n(r){for(let i in r)Object.prototype.hasOwnProperty.call(t,i)||(t[i]=r[i])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function rF(e,t){let n=0,r=0;for(let i in e){if(e[i]!=t[i])return!0;n++}for(let i in t)r++;return n!=r}function oM(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var us={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:"'"},Zp={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},iF=typeof navigator<"u"&&/Mac/.test(navigator.platform),oF=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var qt=0;qt<10;qt++)us[48+qt]=us[96+qt]=String(qt);for(var qt=1;qt<=24;qt++)us[qt+111]="F"+qt;for(var qt=65;qt<=90;qt++)us[qt]=String.fromCharCode(qt+32),Zp[qt]=String.fromCharCode(qt);for(var hy in us)Zp.hasOwnProperty(hy)||(Zp[hy]=us[hy]);function sF(e){var t=iF&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||oF&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",n=!t&&e.key||(e.shiftKey?Zp:us)[e.keyCode]||e.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const aF=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),lF=typeof navigator<"u"&&/Win/.test(navigator.platform);function cF(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n=="Space"&&(n=" ");let r,i,o,s;for(let a=0;a<t.length-1;a++){let l=t[a];if(/^(cmd|meta|m)$/i.test(l))s=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))i=!0;else if(/^s(hift)?$/i.test(l))o=!0;else if(/^mod$/i.test(l))aF?s=!0:i=!0;else throw new Error("Unrecognized modifier name: "+l)}return r&&(n="Alt-"+n),i&&(n="Ctrl-"+n),s&&(n="Meta-"+n),o&&(n="Shift-"+n),n}function uF(e){let t=Object.create(null);for(let n in e)t[cF(n)]=e[n];return t}function py(e,t,n=!0){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),n&&t.shiftKey&&(e="Shift-"+e),e}function fF(e){return new Ge({props:{handleKeyDown:O3(e)}})}function O3(e){let t=uF(e);return function(n,r){let i=sF(r),o,s=t[py(i,r)];if(s&&s(n.state,n.dispatch,n))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let a=t[py(i,r,!1)];if(a&&a(n.state,n.dispatch,n))return!0}if((r.altKey||r.metaKey||r.ctrlKey)&&!(lF&&r.ctrlKey&&r.altKey)&&(o=us[r.keyCode])&&o!=i){let a=t[py(o,r)];if(a&&a(n.state,n.dispatch,n))return!0}}return!1}}const IS=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function A3(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("backward",e):n.parentOffset>0)?null:n}const k3=(e,t,n)=>{let r=A3(e,n);if(!r)return!1;let i=PS(r);if(!i){let s=r.blockRange(),a=s&&Oc(s);return a==null?!1:(t&&t(e.tr.lift(s,a).scrollIntoView()),!0)}let o=i.nodeBefore;if(P3(e,i,t,-1))return!0;if(r.parent.content.size==0&&(ec(o,"end")||J.isSelectable(o)))for(let s=r.depth;;s--){let a=Ag(e.doc,r.before(s),r.after(s),W.empty);if(a&&a.slice.size<a.to-a.from){if(t){let l=e.tr.step(a);l.setSelection(ec(o,"end")?he.findFrom(l.doc.resolve(l.mapping.map(i.pos,-1)),-1):J.create(l.doc,i.pos-o.nodeSize)),t(l.scrollIntoView())}return!0}if(s==1||r.node(s-1).childCount>1)break}return o.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0):!1},dF=(e,t,n)=>{let r=A3(e,n);if(!r)return!1;let i=PS(r);return i?D3(e,i,t):!1},hF=(e,t,n)=>{let r=_3(e,n);if(!r)return!1;let i=BS(r);return i?D3(e,i,t):!1};function D3(e,t,n){let r=t.nodeBefore,i=r,o=t.pos-1;for(;!i.isTextblock;o--){if(i.type.spec.isolating)return!1;let u=i.lastChild;if(!u)return!1;i=u}let s=t.nodeAfter,a=s,l=t.pos+1;for(;!a.isTextblock;l++){if(a.type.spec.isolating)return!1;let u=a.firstChild;if(!u)return!1;a=u}let c=Ag(e.doc,o,l,W.empty);if(!c||c.from!=o||c instanceof Nt&&c.slice.size>=l-o)return!1;if(n){let u=e.tr.step(c);u.setSelection(ne.create(u.doc,o)),n(u.scrollIntoView())}return!0}function ec(e,t,n=!1){for(let r=e;r;r=t=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const N3=(e,t,n)=>{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;o=PS(r)}let s=o&&o.nodeBefore;return!s||!J.isSelectable(s)?!1:(t&&t(e.tr.setSelection(J.create(e.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)};function PS(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function _3(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("forward",e):n.parentOffset<n.parent.content.size)?null:n}const R3=(e,t,n)=>{let r=_3(e,n);if(!r)return!1;let i=BS(r);if(!i)return!1;let o=i.nodeAfter;if(P3(e,i,t,1))return!0;if(r.parent.content.size==0&&(ec(o,"start")||J.isSelectable(o))){let s=Ag(e.doc,r.before(),r.after(),W.empty);if(s&&s.slice.size<s.to-s.from){if(t){let a=e.tr.step(s);a.setSelection(ec(o,"start")?he.findFrom(a.doc.resolve(a.mapping.map(i.pos)),1):J.create(a.doc,a.mapping.map(i.pos))),t(a.scrollIntoView())}return!0}}return o.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),!0):!1},L3=(e,t,n)=>{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size)return!1;o=BS(r)}let s=o&&o.nodeAfter;return!s||!J.isSelectable(s)?!1:(t&&t(e.tr.setSelection(J.create(e.doc,o.pos)).scrollIntoView()),!0)};function BS(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}const pF=(e,t)=>{let n=e.selection,r=n instanceof J,i;if(r){if(n.node.isTextblock||!ys(e.doc,n.from))return!1;i=n.from}else if(i=Og(e.doc,n.from,-1),i==null)return!1;if(t){let o=e.tr.join(i);r&&o.setSelection(J.create(o.doc,i-e.doc.resolve(i).nodeBefore.nodeSize)),t(o.scrollIntoView())}return!0},mF=(e,t)=>{let n=e.selection,r;if(n instanceof J){if(n.node.isTextblock||!ys(e.doc,n.to))return!1;r=n.to}else if(r=Og(e.doc,n.to,1),r==null)return!1;return t&&t(e.tr.join(r).scrollIntoView()),!0},gF=(e,t)=>{let{$from:n,$to:r}=e.selection,i=n.blockRange(r),o=i&&Oc(i);return o==null?!1:(t&&t(e.tr.lift(i,o).scrollIntoView()),!0)},j3=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(t&&t(e.tr.insertText(`
345
+ `).scrollIntoView()),!0)};function HS(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const vF=(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),s=HS(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(t){let a=n.after(),l=e.tr.replaceWith(a,a,s.createAndFill());l.setSelection(he.near(l.doc.resolve(a),1)),t(l.scrollIntoView())}return!0},z3=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof er||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=HS(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(t){let s=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,a=e.tr.insert(s,o.createAndFill());a.setSelection(ne.create(a.doc,s+1)),t(a.scrollIntoView())}return!0},I3=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let o=n.before();if(Ki(e.doc,o))return t&&t(e.tr.split(o).scrollIntoView()),!0}let r=n.blockRange(),i=r&&Oc(r);return i==null?!1:(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)};function yF(e){return(t,n)=>{let{$from:r,$to:i}=t.selection;if(t.selection instanceof J&&t.selection.node.isBlock)return!r.parentOffset||!Ki(t.doc,r.pos)?!1:(n&&n(t.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let o=[],s,a,l=!1,c=!1;for(let h=r.depth;;h--)if(r.node(h).isBlock){l=r.end(h)==r.pos+(r.depth-h),c=r.start(h)==r.pos-(r.depth-h),a=HS(r.node(h-1).contentMatchAt(r.indexAfter(h-1))),o.unshift(l&&a?{type:a}:null),s=h;break}else{if(h==1)return!1;o.unshift(null)}let u=t.tr;(t.selection instanceof ne||t.selection instanceof er)&&u.deleteSelection();let f=u.mapping.map(r.pos),d=Ki(u.doc,f,o.length,o);if(d||(o[0]=a?{type:a}:null,d=Ki(u.doc,f,o.length,o)),!d)return!1;if(u.split(f,o.length,o),!l&&c&&r.node(s).type!=a){let h=u.mapping.map(r.before(s)),p=u.doc.resolve(h);a&&r.node(s-1).canReplaceWith(p.index(),p.index()+1,a)&&u.setNodeMarkup(u.mapping.map(r.before(s)),a)}return n&&n(u.scrollIntoView()),!0}}const bF=yF(),xF=(e,t)=>{let{$from:n,to:r}=e.selection,i,o=n.sharedDepth(r);return o==0?!1:(i=n.before(o),t&&t(e.tr.setSelection(J.create(e.doc,i))),!0)};function SF(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,o=t.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&t.parent.canReplace(o-1,o)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(o,o+1)||!(i.isTextblock||ys(e.doc,t.pos))?!1:(n&&n(e.tr.join(t.pos).scrollIntoView()),!0)}function P3(e,t,n,r){let i=t.nodeBefore,o=t.nodeAfter,s,a,l=i.type.spec.isolating||o.type.spec.isolating;if(!l&&SF(e,t,n))return!0;let c=!l&&t.parent.canReplace(t.index(),t.index()+1);if(c&&(s=(a=i.contentMatchAt(i.childCount)).findWrapping(o.type))&&a.matchType(s[0]||o.type).validEnd){if(n){let h=t.pos+o.nodeSize,p=B.empty;for(let v=s.length-1;v>=0;v--)p=B.from(s[v].create(null,p));p=B.from(i.copy(p));let g=e.tr.step(new Rt(t.pos-1,h,t.pos,h,new W(p,1,0),s.length,!0)),y=g.doc.resolve(h+2*s.length);y.nodeAfter&&y.nodeAfter.type==i.type&&ys(g.doc,y.pos)&&g.join(y.pos),n(g.scrollIntoView())}return!0}let u=o.type.spec.isolating||r>0&&l?null:he.findFrom(t,1),f=u&&u.$from.blockRange(u.$to),d=f&&Oc(f);if(d!=null&&d>=t.depth)return n&&n(e.tr.lift(f,d).scrollIntoView()),!0;if(c&&ec(o,"start",!0)&&ec(i,"end")){let h=i,p=[];for(;p.push(h),!h.isTextblock;)h=h.lastChild;let g=o,y=1;for(;!g.isTextblock;g=g.firstChild)y++;if(h.canReplace(h.childCount,h.childCount,g.content)){if(n){let v=B.empty;for(let x=p.length-1;x>=0;x--)v=B.from(p[x].copy(v));let b=e.tr.step(new Rt(t.pos-p.length,t.pos+o.nodeSize,t.pos+y,t.pos+o.nodeSize-y,new W(v,p.length,0),0,!0));n(b.scrollIntoView())}return!0}}return!1}function B3(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return i.node(o).isTextblock?(n&&n(t.tr.setSelection(ne.create(t.doc,e<0?i.start(o):i.end(o)))),!0):!1}}const wF=B3(-1),EF=B3(1);function CF(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),a=s&&MS(s,e,t);return a?(r&&r(n.tr.wrap(s,a).scrollIntoView()),!0):!1}}function sM(e,t=null){return function(n,r){let i=!1;for(let o=0;o<n.selection.ranges.length&&!i;o++){let{$from:{pos:s},$to:{pos:a}}=n.selection.ranges[o];n.doc.nodesBetween(s,a,(l,c)=>{if(i)return!1;if(!(!l.isTextblock||l.hasMarkup(e,t)))if(l.type==e)i=!0;else{let u=n.doc.resolve(c),f=u.index();i=u.parent.canReplaceWith(f,f+1,e)}})}if(!i)return!1;if(r){let o=n.tr;for(let s=0;s<n.selection.ranges.length;s++){let{$from:{pos:a},$to:{pos:l}}=n.selection.ranges[s];o.setBlockType(a,l,e,t)}r(o.scrollIntoView())}return!0}}function $S(...e){return function(t,n,r){for(let i=0;i<e.length;i++)if(e[i](t,n,r))return!0;return!1}}$S(IS,k3,N3);$S(IS,R3,L3);$S(j3,z3,I3,bF);typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function TF(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o);if(!s)return!1;let a=r?n.tr:null;return MF(a,s,e,t)?(r&&r(a.scrollIntoView()),!0):!1}}function MF(e,t,n,r=null){let i=!1,o=t,s=t.$from.doc;if(t.depth>=2&&t.$from.node(t.depth-1).type.compatibleContent(n)&&t.startIndex==0){if(t.$from.index(t.depth-1)==0)return!1;let l=s.resolve(t.start-2);o=new Kp(l,l,t.depth),t.endIndex<t.parent.childCount&&(t=new Kp(t.$from,s.resolve(t.$to.end(t.depth)),t.depth)),i=!0}let a=MS(o,n,r,t);return a?(e&&OF(e,t,a,i,n),!0):!1}function OF(e,t,n,r,i){let o=B.empty;for(let u=n.length-1;u>=0;u--)o=B.from(n[u].type.create(n[u].attrs,o));e.step(new Rt(t.start-(r?2:0),t.end,t.start,t.end,new W(o,0,0),n.length,!0));let s=0;for(let u=0;u<n.length;u++)n[u].type==i&&(s=u+1);let a=n.length-s,l=t.start+n.length-(r?2:0),c=t.parent;for(let u=t.startIndex,f=t.endIndex,d=!0;u<f;u++,d=!1)!d&&Ki(e.doc,l,a)&&(e.split(l,a),l+=2*a),l+=c.child(u).nodeSize;return e}function AF(e){return function(t,n){let{$from:r,$to:i}=t.selection,o=r.blockRange(i,s=>s.childCount>0&&s.firstChild.type==e);return o?n?r.node(o.depth-1).type==e?kF(t,n,e,o):DF(t,n,o):!0:!1}}function kF(e,t,n,r){let i=e.tr,o=r.end,s=r.$to.end(r.depth);o<s&&(i.step(new Rt(o-1,s,o,s,new W(B.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Kp(i.doc.resolve(r.$from.pos),i.doc.resolve(s),r.depth));const a=Oc(r);if(a==null)return!1;i.lift(r,a);let l=i.doc.resolve(i.mapping.map(o,-1)-1);return ys(i.doc,l.pos)&&l.nodeBefore.type==l.nodeAfter.type&&i.join(l.pos),t(i.scrollIntoView()),!0}function DF(e,t,n){let r=e.tr,i=n.parent;for(let h=n.end,p=n.endIndex-1,g=n.startIndex;p>g;p--)h-=i.child(p).nodeSize,r.delete(h-1,h+1);let o=r.doc.resolve(n.start),s=o.nodeAfter;if(r.mapping.map(n.end)!=n.start+o.nodeAfter.nodeSize)return!1;let a=n.startIndex==0,l=n.endIndex==i.childCount,c=o.node(-1),u=o.index(-1);if(!c.canReplace(u+(a?0:1),u+1,s.content.append(l?B.empty:B.from(i))))return!1;let f=o.pos,d=f+s.nodeSize;return r.step(new Rt(f-(a?1:0),d+(l?1:0),f+1,d-1,new W((a?B.empty:B.from(i.copy(B.empty))).append(l?B.empty:B.from(i.copy(B.empty))),a?0:1,l?0:1),a?0:1)),t(r.scrollIntoView()),!0}function NF(e){return function(t,n){let{$from:r,$to:i}=t.selection,o=r.blockRange(i,c=>c.childCount>0&&c.firstChild.type==e);if(!o)return!1;let s=o.startIndex;if(s==0)return!1;let a=o.parent,l=a.child(s-1);if(l.type!=e)return!1;if(n){let c=l.lastChild&&l.lastChild.type==a.type,u=B.from(c?e.create():null),f=new W(B.from(e.create(null,B.from(a.type.create(null,u)))),c?3:1,0),d=o.start,h=o.end;n(t.tr.step(new Rt(d-(c?3:1),h,d,h,f,1,!0)).scrollIntoView())}return!0}}function Rg(e){const{state:t,transaction:n}=e;let{selection:r}=n,{doc:i}=n,{storedMarks:o}=n;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 r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,o=n.storedMarks,n}}}class Lg{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:n,state:r}=this,{view:i}=n,{tr:o}=r,s=this.buildProps(o);return Object.fromEntries(Object.entries(t).map(([a,l])=>[a,(...u)=>{const f=l(...u)(s);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(o),f}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,n=!0){const{rawCommands:r,editor:i,state:o}=this,{view:s}=i,a=[],l=!!t,c=t||o.tr,u=()=>(!l&&n&&!c.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(c),a.every(d=>d===!0)),f={...Object.fromEntries(Object.entries(r).map(([d,h])=>[d,(...g)=>{const y=this.buildProps(c,n),v=h(...g)(y);return a.push(v),f}])),run:u};return f}createCan(t){const{rawCommands:n,state:r}=this,i=!1,o=t||r.tr,s=this.buildProps(o,i);return{...Object.fromEntries(Object.entries(n).map(([l,c])=>[l,(...u)=>c(...u)({...s,dispatch:void 0})])),chain:()=>this.createChain(o,i)}}buildProps(t,n=!0){const{rawCommands:r,editor:i,state:o}=this,{view:s}=i,a={tr:t,editor:i,view:s,state:Rg({state:o,transaction:t}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(t,n),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(r).map(([l,c])=>[l,(...u)=>c(...u)(a)]))}};return a}}class _F{constructor(){this.callbacks={}}on(t,n){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(n),this}emit(t,...n){const r=this.callbacks[t];return r&&r.forEach(i=>i.apply(this,n)),this}off(t,n){const r=this.callbacks[t];return r&&(n?this.callbacks[t]=r.filter(i=>i!==n):delete this.callbacks[t]),this}once(t,n){const r=(...i)=>{this.off(t,r),n.apply(this,i)};return this.on(t,r)}removeAllListeners(){this.callbacks={}}}function G(e,t,n){return e.config[t]===void 0&&e.parent?G(e.parent,t,n):typeof e.config[t]=="function"?e.config[t].bind({...n,parent:e.parent?G(e.parent,t,n):null}):e.config[t]}function jg(e){const t=e.filter(i=>i.type==="extension"),n=e.filter(i=>i.type==="node"),r=e.filter(i=>i.type==="mark");return{baseExtensions:t,nodeExtensions:n,markExtensions:r}}function H3(e){const t=[],{nodeExtensions:n,markExtensions:r}=jg(e),i=[...n,...r],o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return e.forEach(s=>{const a={name:s.name,options:s.options,storage:s.storage,extensions:i},l=G(s,"addGlobalAttributes",a);if(!l)return;l().forEach(u=>{u.types.forEach(f=>{Object.entries(u.attributes).forEach(([d,h])=>{t.push({type:f,name:d,attribute:{...o,...h}})})})})}),i.forEach(s=>{const a={name:s.name,options:s.options,storage:s.storage},l=G(s,"addAttributes",a);if(!l)return;const c=l();Object.entries(c).forEach(([u,f])=>{const d={...o,...f};typeof(d==null?void 0:d.default)=="function"&&(d.default=d.default()),d!=null&&d.isRequired&&(d==null?void 0:d.default)===void 0&&delete d.default,t.push({type:s.name,name:u,attribute:d})})}),t}function jt(e,t){if(typeof e=="string"){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}function it(...e){return e.filter(t=>!!t).reduce((t,n)=>{const r={...t};return Object.entries(n).forEach(([i,o])=>{if(!r[i]){r[i]=o;return}if(i==="class"){const a=o?String(o).split(" "):[],l=r[i]?r[i].split(" "):[],c=a.filter(u=>!l.includes(u));r[i]=[...l,...c].join(" ")}else if(i==="style"){const a=o?o.split(";").map(u=>u.trim()).filter(Boolean):[],l=r[i]?r[i].split(";").map(u=>u.trim()).filter(Boolean):[],c=new Map;l.forEach(u=>{const[f,d]=u.split(":").map(h=>h.trim());c.set(f,d)}),a.forEach(u=>{const[f,d]=u.split(":").map(h=>h.trim());c.set(f,d)}),r[i]=Array.from(c.entries()).map(([u,f])=>`${u}: ${f}`).join("; ")}else r[i]=o}),r},{})}function zb(e,t){return t.filter(n=>n.type===e.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(e.attrs)||{}:{[n.name]:e.attrs[n.name]}).reduce((n,r)=>it(n,r),{})}function $3(e){return typeof e=="function"}function me(e,t=void 0,...n){return $3(e)?t?e.bind(t)(...n):e(...n):e}function RF(e={}){return Object.keys(e).length===0&&e.constructor===Object}function LF(e){return typeof e!="string"?e:e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):e==="true"?!0:e==="false"?!1:e}function aM(e,t){return"style"in e?e:{...e,getAttrs:n=>{const r=e.getAttrs?e.getAttrs(n):e.attrs;if(r===!1)return!1;const i=t.reduce((o,s)=>{const a=s.attribute.parseHTML?s.attribute.parseHTML(n):LF(n.getAttribute(s.name));return a==null?o:{...o,[s.name]:a}},{});return{...r,...i}}}}function lM(e){return Object.fromEntries(Object.entries(e).filter(([t,n])=>t==="attrs"&&RF(n)?!1:n!=null))}function jF(e,t){var n;const r=H3(e),{nodeExtensions:i,markExtensions:o}=jg(e),s=(n=i.find(c=>G(c,"topNode")))===null||n===void 0?void 0:n.name,a=Object.fromEntries(i.map(c=>{const u=r.filter(v=>v.type===c.name),f={name:c.name,options:c.options,storage:c.storage,editor:t},d=e.reduce((v,b)=>{const x=G(b,"extendNodeSchema",f);return{...v,...x?x(c):{}}},{}),h=lM({...d,content:me(G(c,"content",f)),marks:me(G(c,"marks",f)),group:me(G(c,"group",f)),inline:me(G(c,"inline",f)),atom:me(G(c,"atom",f)),selectable:me(G(c,"selectable",f)),draggable:me(G(c,"draggable",f)),code:me(G(c,"code",f)),whitespace:me(G(c,"whitespace",f)),linebreakReplacement:me(G(c,"linebreakReplacement",f)),defining:me(G(c,"defining",f)),isolating:me(G(c,"isolating",f)),attrs:Object.fromEntries(u.map(v=>{var b;return[v.name,{default:(b=v==null?void 0:v.attribute)===null||b===void 0?void 0:b.default}]}))}),p=me(G(c,"parseHTML",f));p&&(h.parseDOM=p.map(v=>aM(v,u)));const g=G(c,"renderHTML",f);g&&(h.toDOM=v=>g({node:v,HTMLAttributes:zb(v,u)}));const y=G(c,"renderText",f);return y&&(h.toText=y),[c.name,h]})),l=Object.fromEntries(o.map(c=>{const u=r.filter(y=>y.type===c.name),f={name:c.name,options:c.options,storage:c.storage,editor:t},d=e.reduce((y,v)=>{const b=G(v,"extendMarkSchema",f);return{...y,...b?b(c):{}}},{}),h=lM({...d,inclusive:me(G(c,"inclusive",f)),excludes:me(G(c,"excludes",f)),group:me(G(c,"group",f)),spanning:me(G(c,"spanning",f)),code:me(G(c,"code",f)),attrs:Object.fromEntries(u.map(y=>{var v;return[y.name,{default:(v=y==null?void 0:y.attribute)===null||v===void 0?void 0:v.default}]}))}),p=me(G(c,"parseHTML",f));p&&(h.parseDOM=p.map(y=>aM(y,u)));const g=G(c,"renderHTML",f);return g&&(h.toDOM=y=>g({mark:y,HTMLAttributes:zb(y,u)})),[c.name,h]}));return new OR({topNode:s,nodes:a,marks:l})}function my(e,t){return t.nodes[e]||t.marks[e]||null}function cM(e,t){return Array.isArray(t)?t.some(n=>(typeof n=="string"?n:n.name)===e.name):t}function US(e,t){const n=Ra.fromSchema(t).serializeFragment(e),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(n),i.innerHTML}const zF=(e,t=500)=>{let n="";const r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(i,o,s,a)=>{var l,c;const u=((c=(l=i.type.spec).toText)===null||c===void 0?void 0:c.call(l,{node:i,pos:o,parent:s,index:a}))||i.textContent||"%leaf%";n+=i.isAtom&&!i.isText?u:u.slice(0,Math.max(0,r-o))}),n};function VS(e){return Object.prototype.toString.call(e)==="[object RegExp]"}class pd{constructor(t){this.find=t.find,this.handler=t.handler}}const IF=(e,t)=>{if(VS(t))return t.exec(e);const n=t(e);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function th(e){var t;const{editor:n,from:r,to:i,text:o,rules:s,plugin:a}=e,{view:l}=n;if(l.composing)return!1;const c=l.state.doc.resolve(r);if(c.parent.type.spec.code||!((t=c.nodeBefore||c.nodeAfter)===null||t===void 0)&&t.marks.find(d=>d.type.spec.code))return!1;let u=!1;const f=zF(c)+o;return s.forEach(d=>{if(u)return;const h=IF(f,d.find);if(!h)return;const p=l.state.tr,g=Rg({state:l.state,transaction:p}),y={from:r-(h[0].length-o.length),to:i},{commands:v,chain:b,can:x}=new Lg({editor:n,state:g});d.handler({state:g,range:y,match:h,commands:v,chain:b,can:x})===null||!p.steps.length||(p.setMeta(a,{transform:p,from:r,to:i,text:o}),l.dispatch(p),u=!0)}),u}function PF(e){const{editor:t,rules:n}=e,r=new Ge({state:{init(){return null},apply(i,o,s){const a=i.getMeta(r);if(a)return a;const l=i.getMeta("applyInputRules");return!!l&&setTimeout(()=>{let{text:u}=l;typeof u=="string"?u=u:u=US(B.from(u),s.schema);const{from:f}=l,d=f+u.length;th({editor:t,from:f,to:d,text:u,rules:n,plugin:r})}),i.selectionSet||i.docChanged?null:o}},props:{handleTextInput(i,o,s,a){return th({editor:t,from:o,to:s,text:a,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:o}=i.state.selection;o&&th({editor:t,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(i,o){if(o.key!=="Enter")return!1;const{$cursor:s}=i.state.selection;return s?th({editor:t,from:s.pos,to:s.pos,text:`
346
+ `,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function BF(e){return Object.prototype.toString.call(e).slice(8,-1)}function nh(e){return BF(e)!=="Object"?!1:e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function zg(e,t){const n={...e};return nh(e)&&nh(t)&&Object.keys(t).forEach(r=>{nh(t[r])&&nh(e[r])?n[r]=zg(e[r],t[r]):n[r]=t[r]}),n}class In{constructor(t={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=me(G(this,"addOptions",{name:this.name}))),this.storage=me(G(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new In(t)}configure(t={}){const n=this.extend({...this.config,addOptions:()=>zg(this.options,t)});return n.name=this.name,n.parent=this.parent,n}extend(t={}){const n=new In(t);return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=me(G(n,"addOptions",{name:n.name})),n.storage=me(G(n,"addStorage",{name:n.name,options:n.options})),n}static handleExit({editor:t,mark:n}){const{tr:r}=t.state,i=t.state.selection.$from;if(i.pos===i.end()){const s=i.marks();if(!!!s.find(c=>(c==null?void 0:c.type.name)===n.name))return!1;const l=s.find(c=>(c==null?void 0:c.type.name)===n.name);return l&&r.removeStoredMark(l),r.insertText(" ",i.pos),t.view.dispatch(r),!0}return!1}}function HF(e){return typeof e=="number"}class $F{constructor(t){this.find=t.find,this.handler=t.handler}}const UF=(e,t,n)=>{if(VS(t))return[...e.matchAll(t)];const r=t(e,n);return r?r.map(i=>{const o=[i.text];return o.index=i.index,o.input=e,o.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),o.push(i.replaceWith)),o}):[]};function VF(e){const{editor:t,state:n,from:r,to:i,rule:o,pasteEvent:s,dropEvent:a}=e,{commands:l,chain:c,can:u}=new Lg({editor:t,state:n}),f=[];return n.doc.nodesBetween(r,i,(h,p)=>{if(!h.isTextblock||h.type.spec.code)return;const g=Math.max(r,p),y=Math.min(i,p+h.content.size),v=h.textBetween(g-p,y-p,void 0,"");UF(v,o.find,s).forEach(x=>{if(x.index===void 0)return;const m=g+x.index+1,E=m+x[0].length,T={from:n.tr.mapping.map(m),to:n.tr.mapping.map(E)},C=o.handler({state:n,range:T,match:x,commands:l,chain:c,can:u,pasteEvent:s,dropEvent:a});f.push(C)})}),f.every(h=>h!==null)}let rh=null;const FF=e=>{var t;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(t=n.clipboardData)===null||t===void 0||t.setData("text/html",e),n};function qF(e){const{editor:t,rules:n}=e;let r=null,i=!1,o=!1,s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,a;try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}const l=({state:u,from:f,to:d,rule:h,pasteEvt:p})=>{const g=u.tr,y=Rg({state:u,transaction:g});if(!(!VF({editor:t,state:y,from:Math.max(f-1,0),to:d.b-1,rule:h,pasteEvent:p,dropEvent:a})||!g.steps.length)){try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}return s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,g}};return n.map(u=>new Ge({view(f){const d=p=>{var g;r=!((g=f.dom.parentElement)===null||g===void 0)&&g.contains(p.target)?f.dom.parentElement:null,r&&(rh=t)},h=()=>{rh&&(rh=null)};return window.addEventListener("dragstart",d),window.addEventListener("dragend",h),{destroy(){window.removeEventListener("dragstart",d),window.removeEventListener("dragend",h)}}},props:{handleDOMEvents:{drop:(f,d)=>{if(o=r===f.dom.parentElement,a=d,!o){const h=rh;h!=null&&h.isEditable&&setTimeout(()=>{const p=h.state.selection;p&&h.commands.deleteRange({from:p.from,to:p.to})},10)}return!1},paste:(f,d)=>{var h;const p=(h=d.clipboardData)===null||h===void 0?void 0:h.getData("text/html");return s=d,i=!!(p!=null&&p.includes("data-pm-slice")),!1}}},appendTransaction:(f,d,h)=>{const p=f[0],g=p.getMeta("uiEvent")==="paste"&&!i,y=p.getMeta("uiEvent")==="drop"&&!o,v=p.getMeta("applyPasteRules"),b=!!v;if(!g&&!y&&!b)return;if(b){let{text:E}=v;typeof E=="string"?E=E:E=US(B.from(E),h.schema);const{from:T}=v,C=T+E.length,O=FF(E);return l({rule:u,state:h,from:T,to:{b:C},pasteEvt:O})}const x=d.doc.content.findDiffStart(h.doc.content),m=d.doc.content.findDiffEnd(h.doc.content);if(!(!HF(x)||!m||x===m.b))return l({rule:u,state:h,from:x,to:m,pasteEvt:s})}}))}function KF(e){const t=e.filter((n,r)=>e.indexOf(n)!==r);return Array.from(new Set(t))}class xl{constructor(t,n){this.splittableMarks=[],this.editor=n,this.extensions=xl.resolve(t),this.schema=jF(this.extensions,n),this.setupExtensions()}static resolve(t){const n=xl.sort(xl.flatten(t)),r=KF(n.map(i=>i.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(i=>`'${i}'`).join(", ")}]. This can lead to issues.`),n}static flatten(t){return t.map(n=>{const r={name:n.name,options:n.options,storage:n.storage},i=G(n,"addExtensions",r);return i?[n,...this.flatten(i())]:n}).flat(10)}static sort(t){return t.sort((r,i)=>{const o=G(r,"priority")||100,s=G(i,"priority")||100;return o>s?-1:o<s?1:0})}get commands(){return this.extensions.reduce((t,n)=>{const r={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:my(n.name,this.schema)},i=G(n,"addCommands",r);return i?{...t,...i()}:t},{})}get plugins(){const{editor:t}=this,n=xl.sort([...this.extensions].reverse()),r=[],i=[],o=n.map(s=>{const a={name:s.name,options:s.options,storage:s.storage,editor:t,type:my(s.name,this.schema)},l=[],c=G(s,"addKeyboardShortcuts",a);let u={};if(s.type==="mark"&&G(s,"exitable",a)&&(u.ArrowRight=()=>In.handleExit({editor:t,mark:s})),c){const g=Object.fromEntries(Object.entries(c()).map(([y,v])=>[y,()=>v({editor:t})]));u={...u,...g}}const f=fF(u);l.push(f);const d=G(s,"addInputRules",a);cM(s,t.options.enableInputRules)&&d&&r.push(...d());const h=G(s,"addPasteRules",a);cM(s,t.options.enablePasteRules)&&h&&i.push(...h());const p=G(s,"addProseMirrorPlugins",a);if(p){const g=p();l.push(...g)}return l}).flat();return[PF({editor:t,rules:r}),...qF({editor:t,rules:i}),...o]}get attributes(){return H3(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:n}=jg(this.extensions);return Object.fromEntries(n.filter(r=>!!G(r,"addNodeView")).map(r=>{const i=this.attributes.filter(l=>l.type===r.name),o={name:r.name,options:r.options,storage:r.storage,editor:t,type:jt(r.name,this.schema)},s=G(r,"addNodeView",o);if(!s)return[];const a=(l,c,u,f,d)=>{const h=zb(l,i);return s()({node:l,view:c,getPos:u,decorations:f,innerDecorations:d,editor:t,extension:r,HTMLAttributes:h})};return[r.name,a]}))}setupExtensions(){this.extensions.forEach(t=>{var n;this.editor.extensionStorage[t.name]=t.storage;const r={name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:my(t.name,this.schema)};t.type==="mark"&&(!((n=me(G(t,"keepOnSplit",r)))!==null&&n!==void 0)||n)&&this.splittableMarks.push(t.name);const i=G(t,"onBeforeCreate",r),o=G(t,"onCreate",r),s=G(t,"onUpdate",r),a=G(t,"onSelectionUpdate",r),l=G(t,"onTransaction",r),c=G(t,"onFocus",r),u=G(t,"onBlur",r),f=G(t,"onDestroy",r);i&&this.editor.on("beforeCreate",i),o&&this.editor.on("create",o),s&&this.editor.on("update",s),a&&this.editor.on("selectionUpdate",a),l&&this.editor.on("transaction",l),c&&this.editor.on("focus",c),u&&this.editor.on("blur",u),f&&this.editor.on("destroy",f)})}}class Ye{constructor(t={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=me(G(this,"addOptions",{name:this.name}))),this.storage=me(G(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new Ye(t)}configure(t={}){const n=this.extend({...this.config,addOptions:()=>zg(this.options,t)});return n.name=this.name,n.parent=this.parent,n}extend(t={}){const n=new Ye({...this.config,...t});return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=me(G(n,"addOptions",{name:n.name})),n.storage=me(G(n,"addStorage",{name:n.name,options:n.options})),n}}function U3(e,t,n){const{from:r,to:i}=t,{blockSeparator:o=`
347
+
348
+ `,textSerializers:s={}}=n||{};let a="";return e.nodesBetween(r,i,(l,c,u,f)=>{var d;l.isBlock&&c>r&&(a+=o);const h=s==null?void 0:s[l.type.name];if(h)return u&&(a+=h({node:l,pos:c,parent:u,index:f,range:t})),!1;l.isText&&(a+=(d=l==null?void 0:l.text)===null||d===void 0?void 0:d.slice(Math.max(r,c)-c,i-c))}),a}function V3(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,t])=>t.spec.toText).map(([t,n])=>[t,n.spec.toText]))}const WF=Ye.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Ge({key:new ut("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,{ranges:o}=i,s=Math.min(...o.map(u=>u.$from.pos)),a=Math.max(...o.map(u=>u.$to.pos)),l=V3(n);return U3(r,{from:s,to:a},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}}),YF=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),(n=window==null?void 0:window.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),GF=(e=!1)=>({commands:t})=>t.setContent("",e),XF=()=>({state:e,tr:t,dispatch:n})=>{const{selection:r}=t,{ranges:i}=r;return n&&i.forEach(({$from:o,$to:s})=>{e.doc.nodesBetween(o.pos,s.pos,(a,l)=>{if(a.type.isText)return;const{doc:c,mapping:u}=t,f=c.resolve(u.map(l)),d=c.resolve(u.map(l+a.nodeSize)),h=f.blockRange(d);if(!h)return;const p=Oc(h);if(a.type.isTextblock){const{defaultType:g}=f.parent.contentMatchAt(f.index());t.setNodeMarkup(h.start,g)}(p||p===0)&&t.lift(h,p)})}),!0},QF=e=>t=>e(t),JF=()=>({state:e,dispatch:t})=>z3(e,t),ZF=(e,t)=>({editor:n,tr:r})=>{const{state:i}=n,o=i.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);const s=r.mapping.map(t);return r.insert(s,o.content),r.setSelection(new ne(r.doc.resolve(Math.max(s-1,0)))),!0},eq=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;const i=e.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===r.type){if(t){const a=i.before(o),l=i.after(o);e.delete(a,l).scrollIntoView()}return!0}return!1},tq=e=>({tr:t,state:n,dispatch:r})=>{const i=jt(e,n.schema),o=t.selection.$anchor;for(let s=o.depth;s>0;s-=1)if(o.node(s).type===i){if(r){const l=o.before(s),c=o.after(s);t.delete(l,c).scrollIntoView()}return!0}return!1},nq=e=>({tr:t,dispatch:n})=>{const{from:r,to:i}=e;return n&&t.delete(r,i),!0},rq=()=>({state:e,dispatch:t})=>IS(e,t),iq=()=>({commands:e})=>e.keyboardShortcut("Enter"),oq=()=>({state:e,dispatch:t})=>vF(e,t);function em(e,t,n={strict:!0}){const r=Object.keys(t);return r.length?r.every(i=>n.strict?t[i]===e[i]:VS(t[i])?t[i].test(e[i]):t[i]===e[i]):!0}function F3(e,t,n={}){return e.find(r=>r.type===t&&em(Object.fromEntries(Object.keys(n).map(i=>[i,r.attrs[i]])),n))}function uM(e,t,n={}){return!!F3(e,t,n)}function FS(e,t,n){var r;if(!e||!t)return;let i=e.parent.childAfter(e.parentOffset);if((!i.node||!i.node.marks.some(u=>u.type===t))&&(i=e.parent.childBefore(e.parentOffset)),!i.node||!i.node.marks.some(u=>u.type===t)||(n=n||((r=i.node.marks[0])===null||r===void 0?void 0:r.attrs),!F3([...i.node.marks],t,n)))return;let s=i.index,a=e.start()+i.offset,l=s+1,c=a+i.node.nodeSize;for(;s>0&&uM([...e.parent.child(s-1).marks],t,n);)s-=1,a-=e.parent.child(s).nodeSize;for(;l<e.parent.childCount&&uM([...e.parent.child(l).marks],t,n);)c+=e.parent.child(l).nodeSize,l+=1;return{from:a,to:c}}function xs(e,t){if(typeof e=="string"){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}const sq=(e,t={})=>({tr:n,state:r,dispatch:i})=>{const o=xs(e,r.schema),{doc:s,selection:a}=n,{$from:l,from:c,to:u}=a;if(i){const f=FS(l,o,t);if(f&&f.from<=c&&f.to>=u){const d=ne.create(s,f.from,f.to);n.setSelection(d)}}return!0},aq=e=>t=>{const n=typeof e=="function"?e(t):e;for(let r=0;r<n.length;r+=1)if(n[r](t))return!0;return!1};function Ig(e){return e instanceof ne}function Hi(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function q3(e,t=null){if(!t)return null;const n=he.atStart(e),r=he.atEnd(e);if(t==="start"||t===!0)return n;if(t==="end")return r;const i=n.from,o=r.to;return t==="all"?ne.create(e,Hi(0,i,o),Hi(e.content.size,i,o)):ne.create(e,Hi(t,i,o),Hi(t,i,o))}function fM(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function tm(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function lq(){return typeof navigator<"u"?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}const cq=(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:o})=>{t={scrollIntoView:!0,...t};const s=()=>{(tm()||fM())&&r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),lq()&&!tm()&&!fM()&&r.dom.focus({preventScroll:!0}))})};if(r.hasFocus()&&e===null||e===!1)return!0;if(o&&e===null&&!Ig(n.state.selection))return s(),!0;const a=q3(i.doc,e)||n.state.selection,l=n.state.selection.eq(a);return o&&(l||i.setSelection(a),l&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0},uq=(e,t)=>n=>e.every((r,i)=>t(r,{...n,index:i})),fq=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),K3=e=>{const t=e.childNodes;for(let n=t.length-1;n>=0;n-=1){const r=t[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):r.nodeType===1&&K3(r)}return e};function ih(e){const t=`<body>${e}</body>`,n=new window.DOMParser().parseFromString(t,"text/html").body;return K3(n)}function Af(e,t,n){if(e instanceof Jo||e instanceof B)return e;n={slice:!0,parseOptions:{},...n};const r=typeof e=="object"&&e!==null,i=typeof e=="string";if(r)try{if(Array.isArray(e)&&e.length>0)return B.fromArray(e.map(a=>t.nodeFromJSON(a)));const s=t.nodeFromJSON(e);return n.errorOnInvalidContent&&s.check(),s}catch(o){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:o});return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",o),Af("",t,n)}if(i){if(n.errorOnInvalidContent){let s=!1,a="";const l=new OR({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:c=>(s=!0,a=typeof c=="string"?c:c.outerHTML,null)}]}})});if(n.slice?Zo.fromSchema(l).parseSlice(ih(e),n.parseOptions):Zo.fromSchema(l).parse(ih(e),n.parseOptions),n.errorOnInvalidContent&&s)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${a}`)})}const o=Zo.fromSchema(t);return n.slice?o.parseSlice(ih(e),n.parseOptions).content:o.parse(ih(e),n.parseOptions)}return Af("",t,n)}function dq(e,t,n){const r=e.steps.length-1;if(r<t)return;const i=e.steps[r];if(!(i instanceof Nt||i instanceof Rt))return;const o=e.mapping.maps[r];let s=0;o.forEach((a,l,c,u)=>{s===0&&(s=u)}),e.setSelection(he.near(e.doc.resolve(s),n))}const hq=e=>!("type"in e),pq=(e,t,n)=>({tr:r,dispatch:i,editor:o})=>{var s;if(i){n={parseOptions:o.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let a;const l=y=>{o.emit("contentError",{editor:o,error:y,disableCollaboration:()=>{o.storage.collaboration&&(o.storage.collaboration.isDisabled=!0)}})},c={preserveWhitespace:"full",...n.parseOptions};if(!n.errorOnInvalidContent&&!o.options.enableContentCheck&&o.options.emitContentError)try{Af(t,o.schema,{parseOptions:c,errorOnInvalidContent:!0})}catch(y){l(y)}try{a=Af(t,o.schema,{parseOptions:c,errorOnInvalidContent:(s=n.errorOnInvalidContent)!==null&&s!==void 0?s:o.options.enableContentCheck})}catch(y){return l(y),!1}let{from:u,to:f}=typeof e=="number"?{from:e,to:e}:{from:e.from,to:e.to},d=!0,h=!0;if((hq(a)?a:[a]).forEach(y=>{y.check(),d=d?y.isText&&y.marks.length===0:!1,h=h?y.isBlock:!1}),u===f&&h){const{parent:y}=r.doc.resolve(u);y.isTextblock&&!y.type.spec.code&&!y.childCount&&(u-=1,f+=1)}let g;if(d){if(Array.isArray(t))g=t.map(y=>y.text||"").join("");else if(t instanceof B){let y="";t.forEach(v=>{v.text&&(y+=v.text)}),g=y}else typeof t=="object"&&t&&t.text?g=t.text:g=t;r.insertText(g,u,f)}else g=a,r.replaceWith(u,f,g);n.updateSelection&&dq(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:u,text:g}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:u,text:g})}return!0},mq=()=>({state:e,dispatch:t})=>pF(e,t),gq=()=>({state:e,dispatch:t})=>mF(e,t),vq=()=>({state:e,dispatch:t})=>k3(e,t),yq=()=>({state:e,dispatch:t})=>R3(e,t),bq=()=>({state:e,dispatch:t,tr:n})=>{try{const r=Og(e.doc,e.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},xq=()=>({state:e,dispatch:t,tr:n})=>{try{const r=Og(e.doc,e.selection.$from.pos,1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},Sq=()=>({state:e,dispatch:t})=>dF(e,t),wq=()=>({state:e,dispatch:t})=>hF(e,t);function W3(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function Eq(e){const t=e.split(/-(?!$)/);let n=t[t.length-1];n==="Space"&&(n=" ");let r,i,o,s;for(let a=0;a<t.length-1;a+=1){const l=t[a];if(/^(cmd|meta|m)$/i.test(l))s=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))i=!0;else if(/^s(hift)?$/i.test(l))o=!0;else if(/^mod$/i.test(l))tm()||W3()?s=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${l}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),s&&(n=`Meta-${n}`),o&&(n=`Shift-${n}`),n}const Cq=e=>({editor:t,view:n,tr:r,dispatch:i})=>{const o=Eq(e).split(/-(?!$)/),s=o.find(c=>!["Alt","Ctrl","Meta","Shift"].includes(c)),a=new KeyboardEvent("keydown",{key:s==="Space"?" ":s,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),l=t.captureTransaction(()=>{n.someProp("handleKeyDown",c=>c(n,a))});return l==null||l.steps.forEach(c=>{const u=c.map(r.mapping);u&&i&&r.maybeStep(u)}),!0};function kf(e,t,n={}){const{from:r,to:i,empty:o}=e.selection,s=t?jt(t,e.schema):null,a=[];e.doc.nodesBetween(r,i,(f,d)=>{if(f.isText)return;const h=Math.max(r,d),p=Math.min(i,d+f.nodeSize);a.push({node:f,from:h,to:p})});const l=i-r,c=a.filter(f=>s?s.name===f.node.type.name:!0).filter(f=>em(f.node.attrs,n,{strict:!1}));return o?!!c.length:c.reduce((f,d)=>f+d.to-d.from,0)>=l}const Tq=(e,t={})=>({state:n,dispatch:r})=>{const i=jt(e,n.schema);return kf(n,i,t)?gF(n,r):!1},Mq=()=>({state:e,dispatch:t})=>I3(e,t),Oq=e=>({state:t,dispatch:n})=>{const r=jt(e,t.schema);return AF(r)(t,n)},Aq=()=>({state:e,dispatch:t})=>j3(e,t);function Pg(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function dM(e,t){const n=typeof t=="string"?[t]:t;return Object.keys(e).reduce((r,i)=>(n.includes(i)||(r[i]=e[i]),r),{})}const kq=(e,t)=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const a=Pg(typeof e=="string"?e:e.name,r.schema);return a?(a==="node"&&(o=jt(e,r.schema)),a==="mark"&&(s=xs(e,r.schema)),i&&n.selection.ranges.forEach(l=>{r.doc.nodesBetween(l.$from.pos,l.$to.pos,(c,u)=>{o&&o===c.type&&n.setNodeMarkup(u,void 0,dM(c.attrs,t)),s&&c.marks.length&&c.marks.forEach(f=>{s===f.type&&n.addMark(u,u+c.nodeSize,s.create(dM(f.attrs,t)))})})}),!0):!1},Dq=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),Nq=()=>({tr:e,dispatch:t})=>{if(t){const n=new er(e.doc);e.setSelection(n)}return!0},_q=()=>({state:e,dispatch:t})=>N3(e,t),Rq=()=>({state:e,dispatch:t})=>L3(e,t),Lq=()=>({state:e,dispatch:t})=>xF(e,t),jq=()=>({state:e,dispatch:t})=>EF(e,t),zq=()=>({state:e,dispatch:t})=>wF(e,t);function Ib(e,t,n={},r={}){return Af(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}const Iq=(e,t=!1,n={},r={})=>({editor:i,tr:o,dispatch:s,commands:a})=>{var l,c;const{doc:u}=o;if(n.preserveWhitespace!=="full"){const f=Ib(e,i.schema,n,{errorOnInvalidContent:(l=r.errorOnInvalidContent)!==null&&l!==void 0?l:i.options.enableContentCheck});return s&&o.replaceWith(0,u.content.size,f).setMeta("preventUpdate",!t),!0}return s&&o.setMeta("preventUpdate",!t),a.insertContentAt({from:0,to:u.content.size},e,{parseOptions:n,errorOnInvalidContent:(c=r.errorOnInvalidContent)!==null&&c!==void 0?c:i.options.enableContentCheck})};function Y3(e,t){const n=xs(t,e.schema),{from:r,to:i,empty:o}=e.selection,s=[];o?(e.storedMarks&&s.push(...e.storedMarks),s.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,i,l=>{s.push(...l.marks)});const a=s.find(l=>l.type.name===n.name);return a?{...a.attrs}:{}}function Pq(e,t){const n=new VR(e);return t.forEach(r=>{r.steps.forEach(i=>{n.step(i)})}),n}function Bq(e){for(let t=0;t<e.edgeCount;t+=1){const{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function Hq(e,t,n){const r=[];return e.nodesBetween(t.from,t.to,(i,o)=>{n(i)&&r.push({node:i,pos:o})}),r}function $q(e,t){for(let n=e.depth;n>0;n-=1){const r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}function qS(e){return t=>$q(t.$from,e)}function Uq(e,t){const n={from:0,to:e.content.size};return U3(e,n,t)}function Vq(e,t){const n=jt(t,e.schema),{from:r,to:i}=e.selection,o=[];e.doc.nodesBetween(r,i,a=>{o.push(a)});const s=o.reverse().find(a=>a.type.name===n.name);return s?{...s.attrs}:{}}function G3(e,t){const n=Pg(typeof t=="string"?t:t.name,e.schema);return n==="node"?Vq(e,t):n==="mark"?Y3(e,t):{}}function Fq(e,t=JSON.stringify){const n={};return e.filter(r=>{const i=t(r);return Object.prototype.hasOwnProperty.call(n,i)?!1:n[i]=!0})}function qq(e){const t=Fq(e);return t.length===1?t:t.filter((n,r)=>!t.filter((o,s)=>s!==r).some(o=>n.oldRange.from>=o.oldRange.from&&n.oldRange.to<=o.oldRange.to&&n.newRange.from>=o.newRange.from&&n.newRange.to<=o.newRange.to))}function Kq(e){const{mapping:t,steps:n}=e,r=[];return t.maps.forEach((i,o)=>{const s=[];if(i.ranges.length)i.forEach((a,l)=>{s.push({from:a,to:l})});else{const{from:a,to:l}=n[o];if(a===void 0||l===void 0)return;s.push({from:a,to:l})}s.forEach(({from:a,to:l})=>{const c=t.slice(o).map(a,-1),u=t.slice(o).map(l),f=t.invert().map(c,-1),d=t.invert().map(u);r.push({oldRange:{from:f,to:d},newRange:{from:c,to:u}})})}),qq(r)}function KS(e,t,n){const r=[];return e===t?n.resolve(e).marks().forEach(i=>{const o=n.resolve(e),s=FS(o,i.type);s&&r.push({mark:i,...s})}):n.nodesBetween(e,t,(i,o)=>{!i||(i==null?void 0:i.nodeSize)===void 0||r.push(...i.marks.map(s=>({from:o,to:o+i.nodeSize,mark:s})))}),r}function Vh(e,t,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const i=e.find(o=>o.type===t&&o.name===r);return i?i.attribute.keepOnSplit:!1}))}function Pb(e,t,n={}){const{empty:r,ranges:i}=e.selection,o=t?xs(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(f=>o?o.name===f.type.name:!0).find(f=>em(f.attrs,n,{strict:!1}));let s=0;const a=[];if(i.forEach(({$from:f,$to:d})=>{const h=f.pos,p=d.pos;e.doc.nodesBetween(h,p,(g,y)=>{if(!g.isText&&!g.marks.length)return;const v=Math.max(h,y),b=Math.min(p,y+g.nodeSize),x=b-v;s+=x,a.push(...g.marks.map(m=>({mark:m,from:v,to:b})))})}),s===0)return!1;const l=a.filter(f=>o?o.name===f.mark.type.name:!0).filter(f=>em(f.mark.attrs,n,{strict:!1})).reduce((f,d)=>f+d.to-d.from,0),c=a.filter(f=>o?f.mark.type!==o&&f.mark.type.excludes(o):!0).reduce((f,d)=>f+d.to-d.from,0);return(l>0?l+c:l)>=s}function Wq(e,t,n={}){if(!t)return kf(e,null,n)||Pb(e,null,n);const r=Pg(t,e.schema);return r==="node"?kf(e,t,n):r==="mark"?Pb(e,t,n):!1}function hM(e,t){const{nodeExtensions:n}=jg(t),r=n.find(s=>s.name===e);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},o=me(G(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function Bg(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(e.type.name==="hardBreak")return!0;if(e.isText)return/^\s*$/m.test((r=e.text)!==null&&r!==void 0?r:"")}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(e.content.childCount===0)return!0;if(t){let i=!0;return e.content.forEach(o=>{i!==!1&&(Bg(o,{ignoreWhitespace:n,checkChildren:t})||(i=!1))}),i}return!1}function X3(e){return e instanceof J}function Yq(e,t,n){const i=e.state.doc.content.size,o=Hi(t,0,i),s=Hi(n,0,i),a=e.coordsAtPos(o),l=e.coordsAtPos(s,-1),c=Math.min(a.top,l.top),u=Math.max(a.bottom,l.bottom),f=Math.min(a.left,l.left),d=Math.max(a.right,l.right),h=d-f,p=u-c,v={top:c,bottom:u,left:f,right:d,width:h,height:p,x:f,y:c};return{...v,toJSON:()=>v}}function Gq(e,t,n){var r;const{selection:i}=t;let o=null;if(Ig(i)&&(o=i.$cursor),o){const a=(r=e.storedMarks)!==null&&r!==void 0?r:o.marks();return!!n.isInSet(a)||!a.some(l=>l.type.excludes(n))}const{ranges:s}=i;return s.some(({$from:a,$to:l})=>{let c=a.depth===0?e.doc.inlineContent&&e.doc.type.allowsMarkType(n):!1;return e.doc.nodesBetween(a.pos,l.pos,(u,f,d)=>{if(c)return!1;if(u.isInline){const h=!d||d.type.allowsMarkType(n),p=!!n.isInSet(u.marks)||!u.marks.some(g=>g.type.excludes(n));c=h&&p}return!c}),c})}const Xq=(e,t={})=>({tr:n,state:r,dispatch:i})=>{const{selection:o}=n,{empty:s,ranges:a}=o,l=xs(e,r.schema);if(i)if(s){const c=Y3(r,l);n.addStoredMark(l.create({...c,...t}))}else a.forEach(c=>{const u=c.$from.pos,f=c.$to.pos;r.doc.nodesBetween(u,f,(d,h)=>{const p=Math.max(h,u),g=Math.min(h+d.nodeSize,f);d.marks.find(v=>v.type===l)?d.marks.forEach(v=>{l===v.type&&n.addMark(p,g,l.create({...v.attrs,...t}))}):n.addMark(p,g,l.create(t))})});return Gq(r,n,l)},Qq=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),Jq=(e,t={})=>({state:n,dispatch:r,chain:i})=>{const o=jt(e,n.schema);let s;return n.selection.$anchor.sameParent(n.selection.$head)&&(s=n.selection.$anchor.parent.attrs),o.isTextblock?i().command(({commands:a})=>sM(o,{...s,...t})(n)?!0:a.clearNodes()).command(({state:a})=>sM(o,{...s,...t})(a,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},Zq=e=>({tr:t,dispatch:n})=>{if(n){const{doc:r}=t,i=Hi(e,0,r.content.size),o=J.create(r,i);t.setSelection(o)}return!0},eK=e=>({tr:t,dispatch:n})=>{if(n){const{doc:r}=t,{from:i,to:o}=typeof e=="number"?{from:e,to:e}:e,s=ne.atStart(r).from,a=ne.atEnd(r).to,l=Hi(i,s,a),c=Hi(o,s,a),u=ne.create(r,l,c);t.setSelection(u)}return!0},tK=e=>({state:t,dispatch:n})=>{const r=jt(e,t.schema);return NF(r)(t,n)};function pM(e,t){const n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){const r=n.filter(i=>t==null?void 0:t.includes(i.type.name));e.tr.ensureMarks(r)}}const nK=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{const{selection:o,doc:s}=t,{$from:a,$to:l}=o,c=i.extensionManager.attributes,u=Vh(c,a.node().type.name,a.node().attrs);if(o instanceof J&&o.node.isBlock)return!a.parentOffset||!Ki(s,a.pos)?!1:(r&&(e&&pM(n,i.extensionManager.splittableMarks),t.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;const f=l.parentOffset===l.parent.content.size,d=a.depth===0?void 0:Bq(a.node(-1).contentMatchAt(a.indexAfter(-1)));let h=f&&d?[{type:d,attrs:u}]:void 0,p=Ki(t.doc,t.mapping.map(a.pos),1,h);if(!h&&!p&&Ki(t.doc,t.mapping.map(a.pos),1,d?[{type:d}]:void 0)&&(p=!0,h=d?[{type:d,attrs:u}]:void 0),r){if(p&&(o instanceof ne&&t.deleteSelection(),t.split(t.mapping.map(a.pos),1,h),d&&!f&&!a.parentOffset&&a.parent.type!==d)){const g=t.mapping.map(a.before()),y=t.doc.resolve(g);a.node(-1).canReplaceWith(y.index(),y.index()+1,d)&&t.setNodeMarkup(t.mapping.map(a.before()),d)}e&&pM(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return p},rK=(e,t={})=>({tr:n,state:r,dispatch:i,editor:o})=>{var s;const a=jt(e,r.schema),{$from:l,$to:c}=r.selection,u=r.selection.node;if(u&&u.isBlock||l.depth<2||!l.sameParent(c))return!1;const f=l.node(-1);if(f.type!==a)return!1;const d=o.extensionManager.attributes;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==a||l.index(-2)!==l.node(-2).childCount-1)return!1;if(i){let v=B.empty;const b=l.index(-1)?1:l.index(-2)?2:3;for(let O=l.depth-b;O>=l.depth-3;O-=1)v=B.from(l.node(O).copy(v));const x=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3,m={...Vh(d,l.node().type.name,l.node().attrs),...t},E=((s=a.contentMatch.defaultType)===null||s===void 0?void 0:s.createAndFill(m))||void 0;v=v.append(B.from(a.createAndFill(null,E)||void 0));const T=l.before(l.depth-(b-1));n.replace(T,l.after(-x),new W(v,4-b,0));let C=-1;n.doc.nodesBetween(T,n.doc.content.size,(O,A)=>{if(C>-1)return!1;O.isTextblock&&O.content.size===0&&(C=A+1)}),C>-1&&n.setSelection(ne.near(n.doc.resolve(C))),n.scrollIntoView()}return!0}const h=c.pos===l.end()?f.contentMatchAt(0).defaultType:null,p={...Vh(d,f.type.name,f.attrs),...t},g={...Vh(d,l.node().type.name,l.node().attrs),...t};n.delete(l.pos,c.pos);const y=h?[{type:a,attrs:p},{type:h,attrs:g}]:[{type:a,attrs:p}];if(!Ki(n.doc,l.pos,2))return!1;if(i){const{selection:v,storedMarks:b}=r,{splittableMarks:x}=o.extensionManager,m=b||v.$to.parentOffset&&v.$from.marks();if(n.split(l.pos,2,y).scrollIntoView(),!m||!i)return!0;const E=m.filter(T=>x.includes(T.type.name));n.ensureMarks(E)}return!0},gy=(e,t)=>{const n=qS(s=>s.type===t)(e.selection);if(!n)return!0;const r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const i=e.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&ys(e.doc,n.pos)&&e.join(n.pos),!0},vy=(e,t)=>{const n=qS(s=>s.type===t)(e.selection);if(!n)return!0;const r=e.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const i=e.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&ys(e.doc,r)&&e.join(r),!0},iK=(e,t,n,r={})=>({editor:i,tr:o,state:s,dispatch:a,chain:l,commands:c,can:u})=>{const{extensions:f,splittableMarks:d}=i.extensionManager,h=jt(e,s.schema),p=jt(t,s.schema),{selection:g,storedMarks:y}=s,{$from:v,$to:b}=g,x=v.blockRange(b),m=y||g.$to.parentOffset&&g.$from.marks();if(!x)return!1;const E=qS(T=>hM(T.type.name,f))(g);if(x.depth>=1&&E&&x.depth-E.depth<=1){if(E.node.type===h)return c.liftListItem(p);if(hM(E.node.type.name,f)&&h.validContent(E.node.content)&&a)return l().command(()=>(o.setNodeMarkup(E.pos,h),!0)).command(()=>gy(o,h)).command(()=>vy(o,h)).run()}return!n||!m||!a?l().command(()=>u().wrapInList(h,r)?!0:c.clearNodes()).wrapInList(h,r).command(()=>gy(o,h)).command(()=>vy(o,h)).run():l().command(()=>{const T=u().wrapInList(h,r),C=m.filter(O=>d.includes(O.type.name));return o.ensureMarks(C),T?!0:c.clearNodes()}).wrapInList(h,r).command(()=>gy(o,h)).command(()=>vy(o,h)).run()},oK=(e,t={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=n,s=xs(e,r.schema);return Pb(r,s,t)?i.unsetMark(s,{extendEmptyMarkRange:o}):i.setMark(s,t)},sK=(e,t,n={})=>({state:r,commands:i})=>{const o=jt(e,r.schema),s=jt(t,r.schema),a=kf(r,o,n);let l;return r.selection.$anchor.sameParent(r.selection.$head)&&(l=r.selection.$anchor.parent.attrs),a?i.setNode(s,l):i.setNode(o,{...l,...n})},aK=(e,t={})=>({state:n,commands:r})=>{const i=jt(e,n.schema);return kf(n,i,t)?r.lift(i):r.wrapIn(i,t)},lK=()=>({state:e,dispatch:t})=>{const n=e.plugins;for(let r=0;r<n.length;r+=1){const i=n[r];let o;if(i.spec.isInputRules&&(o=i.getState(e))){if(t){const s=e.tr,a=o.transform;for(let l=a.steps.length-1;l>=0;l-=1)s.step(a.steps[l].invert(a.docs[l]));if(o.text){const l=s.doc.resolve(o.from).marks();s.replaceWith(o.from,o.to,e.schema.text(o.text,l))}else s.delete(o.from,o.to)}return!0}}return!1},cK=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,{empty:r,ranges:i}=n;return r||t&&i.forEach(o=>{e.removeMark(o.$from.pos,o.$to.pos)}),!0},uK=(e,t={})=>({tr:n,state:r,dispatch:i})=>{var o;const{extendEmptyMarkRange:s=!1}=t,{selection:a}=n,l=xs(e,r.schema),{$from:c,empty:u,ranges:f}=a;if(!i)return!0;if(u&&s){let{from:d,to:h}=a;const p=(o=c.marks().find(y=>y.type===l))===null||o===void 0?void 0:o.attrs,g=FS(c,l,p);g&&(d=g.from,h=g.to),n.removeMark(d,h,l)}else f.forEach(d=>{n.removeMark(d.$from.pos,d.$to.pos,l)});return n.removeStoredMark(l),!0},fK=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const a=Pg(typeof e=="string"?e:e.name,r.schema);return a?(a==="node"&&(o=jt(e,r.schema)),a==="mark"&&(s=xs(e,r.schema)),i&&n.selection.ranges.forEach(l=>{const c=l.$from.pos,u=l.$to.pos;let f,d,h,p;n.selection.empty?r.doc.nodesBetween(c,u,(g,y)=>{o&&o===g.type&&(h=Math.max(y,c),p=Math.min(y+g.nodeSize,u),f=y,d=g)}):r.doc.nodesBetween(c,u,(g,y)=>{y<c&&o&&o===g.type&&(h=Math.max(y,c),p=Math.min(y+g.nodeSize,u),f=y,d=g),y>=c&&y<=u&&(o&&o===g.type&&n.setNodeMarkup(y,void 0,{...g.attrs,...t}),s&&g.marks.length&&g.marks.forEach(v=>{if(s===v.type){const b=Math.max(y,c),x=Math.min(y+g.nodeSize,u);n.addMark(b,x,s.create({...v.attrs,...t}))}}))}),d&&(f!==void 0&&n.setNodeMarkup(f,void 0,{...d.attrs,...t}),s&&d.marks.length&&d.marks.forEach(g=>{s===g.type&&n.addMark(h,p,s.create({...g.attrs,...t}))}))}),!0):!1},dK=(e,t={})=>({state:n,dispatch:r})=>{const i=jt(e,n.schema);return CF(i,t)(n,r)},hK=(e,t={})=>({state:n,dispatch:r})=>{const i=jt(e,n.schema);return TF(i,t)(n,r)};var pK=Object.freeze({__proto__:null,blur:YF,clearContent:GF,clearNodes:XF,command:QF,createParagraphNear:JF,cut:ZF,deleteCurrentNode:eq,deleteNode:tq,deleteRange:nq,deleteSelection:rq,enter:iq,exitCode:oq,extendMarkRange:sq,first:aq,focus:cq,forEach:uq,insertContent:fq,insertContentAt:pq,joinBackward:vq,joinDown:gq,joinForward:yq,joinItemBackward:bq,joinItemForward:xq,joinTextblockBackward:Sq,joinTextblockForward:wq,joinUp:mq,keyboardShortcut:Cq,lift:Tq,liftEmptyBlock:Mq,liftListItem:Oq,newlineInCode:Aq,resetAttributes:kq,scrollIntoView:Dq,selectAll:Nq,selectNodeBackward:_q,selectNodeForward:Rq,selectParentNode:Lq,selectTextblockEnd:jq,selectTextblockStart:zq,setContent:Iq,setMark:Xq,setMeta:Qq,setNode:Jq,setNodeSelection:Zq,setTextSelection:eK,sinkListItem:tK,splitBlock:nK,splitListItem:rK,toggleList:iK,toggleMark:oK,toggleNode:sK,toggleWrap:aK,undoInputRule:lK,unsetAllMarks:cK,unsetMark:uK,updateAttributes:fK,wrapIn:dK,wrapInList:hK});const mK=Ye.create({name:"commands",addCommands(){return{...pK}}}),gK=Ye.create({name:"drop",addProseMirrorPlugins(){return[new Ge({key:new ut("tiptapDrop"),props:{handleDrop:(e,t,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),vK=Ye.create({name:"editable",addProseMirrorPlugins(){return[new Ge({key:new ut("editable"),props:{editable:()=>this.editor.options.editable}})]}}),yK=new ut("focusEvents"),bK=Ye.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new Ge({key:yK,props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;const r=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;const r=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1}}}})]}}),xK=Ye.create({name:"keymap",addKeyboardShortcuts(){const e=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:a})=>{const{selection:l,doc:c}=a,{empty:u,$anchor:f}=l,{pos:d,parent:h}=f,p=f.parent.isTextblock&&d>0?a.doc.resolve(d-1):f,g=p.parent.type.spec.isolating,y=f.pos-f.parentOffset,v=g&&p.parent.childCount===1?y===f.pos:he.atStart(c).from===d;return!u||!h.type.isTextblock||h.textContent.length||!v||v&&f.parent.type.name==="paragraph"?!1:s.clearNodes()}),()=>s.deleteSelection(),()=>s.joinBackward(),()=>s.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:s})=>[()=>s.deleteSelection(),()=>s.deleteCurrentNode(),()=>s.joinForward(),()=>s.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:s})=>[()=>s.newlineInCode(),()=>s.createParagraphNear(),()=>s.liftEmptyBlock(),()=>s.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},o={...r,"Ctrl-h":e,"Alt-Backspace":e,"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 tm()||W3()?o:i},addProseMirrorPlugins(){return[new Ge({key:new ut("clearDocument"),appendTransaction:(e,t,n)=>{if(e.some(g=>g.getMeta("composition")))return;const r=e.some(g=>g.docChanged)&&!t.doc.eq(n.doc),i=e.some(g=>g.getMeta("preventClearDocument"));if(!r||i)return;const{empty:o,from:s,to:a}=t.selection,l=he.atStart(t.doc).from,c=he.atEnd(t.doc).to;if(o||!(s===l&&a===c)||!Bg(n.doc))return;const d=n.tr,h=Rg({state:n,transaction:d}),{commands:p}=new Lg({editor:this.editor,state:h});if(p.clearNodes(),!!d.steps.length)return d}})]}}),SK=Ye.create({name:"paste",addProseMirrorPlugins(){return[new Ge({key:new ut("tiptapPaste"),props:{handlePaste:(e,t,n)=>{this.editor.emit("paste",{editor:this.editor,event:t,slice:n})}}})]}}),wK=Ye.create({name:"tabindex",addProseMirrorPlugins(){return[new Ge({key:new ut("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});class Vs{get name(){return this.node.type.name}constructor(t,n,r=!1,i=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=t,this.editor=n,this.currentNode=i}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 n=this.from,r=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}n=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:n,to:r},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),n=this.resolvedPos.doc.resolve(t);return new Vs(n,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 Vs(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 Vs(t,this.editor)}get children(){const t=[];return this.node.content.forEach((n,r)=>{const i=n.isBlock&&!n.isTextblock,o=n.isAtom&&!n.isText,s=this.pos+r+(o?0:1);if(s<0||s>this.resolvedPos.doc.nodeSize-2)return;const a=this.resolvedPos.doc.resolve(s);if(!i&&a.depth<=this.depth)return;const l=new Vs(a,this.editor,i,i?n:null);i&&(l.actualDepth=this.depth+1),t.push(new Vs(a,this.editor,i,i?n:null))}),t}get firstChild(){return this.children[0]||null}get lastChild(){const t=this.children;return t[t.length-1]||null}closest(t,n={}){let r=null,i=this.parent;for(;i&&!r;){if(i.node.type.name===t)if(Object.keys(n).length>0){const o=i.node.attrs,s=Object.keys(n);for(let a=0;a<s.length;a+=1){const l=s[a];if(o[l]!==n[l])break}}else r=i;i=i.parent}return r}querySelector(t,n={}){return this.querySelectorAll(t,n,!0)[0]||null}querySelectorAll(t,n={},r=!1){let i=[];if(!this.children||this.children.length===0)return i;const o=Object.keys(n);return this.children.forEach(s=>{r&&i.length>0||(s.node.type.name===t&&o.every(l=>n[l]===s.node.attrs[l])&&i.push(s),!(r&&i.length>0)&&(i=i.concat(s.querySelectorAll(t,n,r))))}),i}setAttribute(t){const{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...t}),this.editor.view.dispatch(n)}}const EK=`.ProseMirror {
349
+ position: relative;
350
+ }
351
+
352
+ .ProseMirror {
353
+ word-wrap: break-word;
354
+ white-space: pre-wrap;
355
+ white-space: break-spaces;
356
+ -webkit-font-variant-ligatures: none;
357
+ font-variant-ligatures: none;
358
+ font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
359
+ }
360
+
361
+ .ProseMirror [contenteditable="false"] {
362
+ white-space: normal;
363
+ }
364
+
365
+ .ProseMirror [contenteditable="false"] [contenteditable="true"] {
366
+ white-space: pre-wrap;
367
+ }
368
+
369
+ .ProseMirror pre {
370
+ white-space: pre-wrap;
371
+ }
372
+
373
+ img.ProseMirror-separator {
374
+ display: inline !important;
375
+ border: none !important;
376
+ margin: 0 !important;
377
+ width: 0 !important;
378
+ height: 0 !important;
379
+ }
380
+
381
+ .ProseMirror-gapcursor {
382
+ display: none;
383
+ pointer-events: none;
384
+ position: absolute;
385
+ margin: 0;
386
+ }
387
+
388
+ .ProseMirror-gapcursor:after {
389
+ content: "";
390
+ display: block;
391
+ position: absolute;
392
+ top: -2px;
393
+ width: 20px;
394
+ border-top: 1px solid black;
395
+ animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
396
+ }
397
+
398
+ @keyframes ProseMirror-cursor-blink {
399
+ to {
400
+ visibility: hidden;
401
+ }
402
+ }
403
+
404
+ .ProseMirror-hideselection *::selection {
405
+ background: transparent;
406
+ }
407
+
408
+ .ProseMirror-hideselection *::-moz-selection {
409
+ background: transparent;
410
+ }
411
+
412
+ .ProseMirror-hideselection * {
413
+ caret-color: transparent;
414
+ }
415
+
416
+ .ProseMirror-focused .ProseMirror-gapcursor {
417
+ display: block;
418
+ }
419
+
420
+ .tippy-box[data-animation=fade][data-state=hidden] {
421
+ opacity: 0
422
+ }`;function CK(e,t,n){const r=document.querySelector("style[data-tiptap-style]");if(r!==null)return r;const i=document.createElement("style");return t&&i.setAttribute("nonce",t),i.setAttribute("data-tiptap-style",""),i.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(i),i}class TK extends _F{constructor(t={}){super(),this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:n})=>{throw n},onPaste:()=>null,onDrop:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(t),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("contentError",this.options.onContentError),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:n,slice:r,moved:i})=>this.options.onDrop(n,r,i)),this.on("paste",({event:n,slice:r})=>this.options.onPaste(n,r)),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=CK(EK,this.options.injectNonce))}setOptions(t={}){this.options={...this.options,...t},!(!this.view||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(t,n=!0){this.setOptions({editable:t}),n&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(t,n){const r=$3(n)?n(t,[...this.state.plugins]):[...this.state.plugins,t],i=this.state.reconfigure({plugins:r});return this.view.updateState(i),i}unregisterPlugin(t){if(this.isDestroyed)return;const n=this.state.plugins;let r=n;if([].concat(t).forEach(o=>{const s=typeof o=="string"?`${o}$`:o.key;r=r.filter(a=>!a.key.startsWith(s))}),n.length===r.length)return;const i=this.state.reconfigure({plugins:r});return this.view.updateState(i),i}createExtensionManager(){var t,n;const i=[...this.options.enableCoreExtensions?[vK,WF.configure({blockSeparator:(n=(t=this.options.coreExtensionOptions)===null||t===void 0?void 0:t.clipboardTextSerializer)===null||n===void 0?void 0:n.blockSeparator}),mK,bK,xK,wK,gK,SK].filter(o=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[o.name]!==!1:!0):[],...this.options.extensions].filter(o=>["extension","node","mark"].includes(o==null?void 0:o.type));this.extensionManager=new xl(i,this)}createCommandManager(){this.commandManager=new Lg({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){var t;let n;try{n=Ib(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(s){if(!(s instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(s.message))throw s;this.emit("contentError",{editor:this,error:s,disableCollaboration:()=>{this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(a=>a.name!=="collaboration"),this.createExtensionManager()}}),n=Ib(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}const r=q3(n,this.options.autofocus);this.view=new M3(this.options.element,{...this.options.editorProps,attributes:{role:"textbox",...(t=this.options.editorProps)===null||t===void 0?void 0:t.attributes},dispatchTransaction:this.dispatchTransaction.bind(this),state:bl.create({doc:n,selection:r||void 0})});const i=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(i),this.createNodeViews(),this.prependClass();const o=this.view.dom;o.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(t){this.isCapturingTransaction=!0,t(),this.isCapturingTransaction=!1;const n=this.capturedTransaction;return this.capturedTransaction=null,n}dispatchTransaction(t){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=t;return}t.steps.forEach(s=>{var a;return(a=this.capturedTransaction)===null||a===void 0?void 0:a.step(s)});return}const n=this.state.apply(t),r=!this.state.selection.eq(n.selection);this.emit("beforeTransaction",{editor:this,transaction:t,nextState:n}),this.view.updateState(n),this.emit("transaction",{editor:this,transaction:t}),r&&this.emit("selectionUpdate",{editor:this,transaction:t});const i=t.getMeta("focus"),o=t.getMeta("blur");i&&this.emit("focus",{editor:this,event:i.event,transaction:t}),o&&this.emit("blur",{editor:this,event:o.event,transaction:t}),!(!t.docChanged||t.getMeta("preventUpdate"))&&this.emit("update",{editor:this,transaction:t})}getAttributes(t){return G3(this.state,t)}isActive(t,n){const r=typeof t=="string"?t:null,i=typeof t=="string"?n:t;return Wq(this.state,r,i)}getJSON(){return this.state.doc.toJSON()}getHTML(){return US(this.state.doc.content,this.schema)}getText(t){const{blockSeparator:n=`
423
+
424
+ `,textSerializers:r={}}=t||{};return Uq(this.state.doc,{blockSeparator:n,textSerializers:{...V3(this.schema),...r}})}get isEmpty(){return Bg(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){if(this.emit("destroy"),this.view){const t=this.view.dom;t&&t.editor&&delete t.editor,this.view.destroy()}this.removeAllListeners()}get isDestroyed(){var t;return!(!((t=this.view)===null||t===void 0)&&t.docView)}$node(t,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelector(t,n))||null}$nodes(t,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelectorAll(t,n))||null}$pos(t){const n=this.state.doc.resolve(t);return new Vs(n,this)}get $doc(){return this.$pos(0)}}function xa(e){return new pd({find:e.find,handler:({state:t,range:n,match:r})=>{const i=me(e.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:o}=t,s=r[r.length-1],a=r[0];if(s){const l=a.search(/\S/),c=n.from+a.indexOf(s),u=c+s.length;if(KS(n.from,n.to,t.doc).filter(h=>h.mark.type.excluded.find(g=>g===e.type&&g!==h.mark.type)).filter(h=>h.to>c).length)return null;u<n.to&&o.delete(u,n.to),c>n.from&&o.delete(n.from+l,c);const d=n.from+l+s.length;o.addMark(n.from+l,d,e.type.create(i||{})),o.removeStoredMark(e.type)}}})}function MK(e){return new pd({find:e.find,handler:({state:t,range:n,match:r})=>{const i=me(e.getAttributes,void 0,r)||{},{tr:o}=t,s=n.from;let a=n.to;const l=e.type.create(i);if(r[1]){const c=r[0].lastIndexOf(r[1]);let u=s+c;u>a?u=a:a=u+r[1].length;const f=r[0][r[0].length-1];o.insertText(f,s+r[0].length-1),o.replaceWith(u,a,l)}else if(r[0]){const c=e.type.isInline?s:s-1;o.insert(c,e.type.create(i)).delete(o.mapping.map(s),o.mapping.map(a))}o.scrollIntoView()}})}function Bb(e){return new pd({find:e.find,handler:({state:t,range:n,match:r})=>{const i=t.doc.resolve(n.from),o=me(e.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,o)}})}function ft(e){return new pd({find:e.find,handler:({state:t,range:n,match:r})=>{let i=e.replace,o=n.from;const s=n.to;if(r[1]){const a=r[0].lastIndexOf(r[1]);i+=r[0].slice(a+r[1].length),o+=a;const l=o-s;l>0&&(i=r[0].slice(a-l,a)+i,o=s)}t.tr.insertText(i,o,s)}})}function Df(e){return new pd({find:e.find,handler:({state:t,range:n,match:r,chain:i})=>{const o=me(e.getAttributes,void 0,r)||{},s=t.tr.delete(n.from,n.to),l=s.doc.resolve(n.from).blockRange(),c=l&&MS(l,e.type,o);if(!c)return null;if(s.wrap(l,c),e.keepMarks&&e.editor){const{selection:f,storedMarks:d}=t,{splittableMarks:h}=e.editor.extensionManager,p=d||f.$to.parentOffset&&f.$from.marks();if(p){const g=p.filter(y=>h.includes(y.type.name));s.ensureMarks(g)}}if(e.keepAttributes){const f=e.type.name==="bulletList"||e.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(f,o).run()}const u=s.doc.resolve(n.from-1).nodeBefore;u&&u.type===e.type&&ys(s.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,u))&&s.join(n.from-1)}})}let Wr=class Hb{constructor(t={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=me(G(this,"addOptions",{name:this.name}))),this.storage=me(G(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new Hb(t)}configure(t={}){const n=this.extend({...this.config,addOptions:()=>zg(this.options,t)});return n.name=this.name,n.parent=this.parent,n}extend(t={}){const n=new Hb(t);return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=me(G(n,"addOptions",{name:n.name})),n.storage=me(G(n,"addStorage",{name:n.name,options:n.options})),n}};function fs(e){return new $F({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:i})=>{const o=me(e.getAttributes,void 0,r,i);if(o===!1||o===null)return null;const{tr:s}=t,a=r[r.length-1],l=r[0];let c=n.to;if(a){const u=l.search(/\S/),f=n.from+l.indexOf(a),d=f+a.length;if(KS(n.from,n.to,t.doc).filter(p=>p.mark.type.excluded.find(y=>y===e.type&&y!==p.mark.type)).filter(p=>p.to>f).length)return null;d<n.to&&s.delete(d,n.to),f>n.from&&s.delete(n.from+u,f),c=n.from+u+a.length,s.addMark(n.from+u,c,e.type.create(o||{})),s.removeStoredMark(e.type)}}})}function OK(e,t){const{selection:n}=e,{$from:r}=n;if(n instanceof J){const o=r.index();return r.parent.canReplaceWith(o,o+1,t)}let i=r.depth;for(;i>=0;){const o=r.index(i);if(r.node(i).contentMatchAt(o).matchType(t))return!0;i-=1}return!1}function AK(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}var Ln="top",Or="bottom",Ar="right",jn="left",WS="auto",md=[Ln,Or,Ar,jn],tc="start",Nf="end",kK="clippingParents",Q3="viewport",Hc="popper",DK="reference",mM=md.reduce(function(e,t){return e.concat([t+"-"+tc,t+"-"+Nf])},[]),J3=[].concat(md,[WS]).reduce(function(e,t){return e.concat([t,t+"-"+tc,t+"-"+Nf])},[]),NK="beforeRead",_K="read",RK="afterRead",LK="beforeMain",jK="main",zK="afterMain",IK="beforeWrite",PK="write",BK="afterWrite",HK=[NK,_K,RK,LK,jK,zK,IK,PK,BK];function yi(e){return e?(e.nodeName||"").toLowerCase():null}function rr(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Sa(e){var t=rr(e).Element;return e instanceof t||e instanceof Element}function Cr(e){var t=rr(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function YS(e){if(typeof ShadowRoot>"u")return!1;var t=rr(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function $K(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},i=t.attributes[n]||{},o=t.elements[n];!Cr(o)||!yi(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(s){var a=i[s];a===!1?o.removeAttribute(s):o.setAttribute(s,a===!0?"":a)}))})}function UK(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var i=t.elements[r],o=t.attributes[r]||{},s=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),a=s.reduce(function(l,c){return l[c]="",l},{});!Cr(i)||!yi(i)||(Object.assign(i.style,a),Object.keys(o).forEach(function(l){i.removeAttribute(l)}))})}}const GS={name:"applyStyles",enabled:!0,phase:"write",fn:$K,effect:UK,requires:["computeStyles"]};function fi(e){return e.split("-")[0]}var ra=Math.max,nm=Math.min,nc=Math.round;function $b(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function Z3(){return!/^((?!chrome|android).)*safari/i.test($b())}function rc(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),i=1,o=1;t&&Cr(e)&&(i=e.offsetWidth>0&&nc(r.width)/e.offsetWidth||1,o=e.offsetHeight>0&&nc(r.height)/e.offsetHeight||1);var s=Sa(e)?rr(e):window,a=s.visualViewport,l=!Z3()&&n,c=(r.left+(l&&a?a.offsetLeft:0))/i,u=(r.top+(l&&a?a.offsetTop:0))/o,f=r.width/i,d=r.height/o;return{width:f,height:d,top:u,right:c+f,bottom:u+d,left:c,x:c,y:u}}function XS(e){var t=rc(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function eL(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&YS(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function ro(e){return rr(e).getComputedStyle(e)}function VK(e){return["table","td","th"].indexOf(yi(e))>=0}function Ss(e){return((Sa(e)?e.ownerDocument:e.document)||window.document).documentElement}function Hg(e){return yi(e)==="html"?e:e.assignedSlot||e.parentNode||(YS(e)?e.host:null)||Ss(e)}function gM(e){return!Cr(e)||ro(e).position==="fixed"?null:e.offsetParent}function FK(e){var t=/firefox/i.test($b()),n=/Trident/i.test($b());if(n&&Cr(e)){var r=ro(e);if(r.position==="fixed")return null}var i=Hg(e);for(YS(i)&&(i=i.host);Cr(i)&&["html","body"].indexOf(yi(i))<0;){var o=ro(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||t&&o.willChange==="filter"||t&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function gd(e){for(var t=rr(e),n=gM(e);n&&VK(n)&&ro(n).position==="static";)n=gM(n);return n&&(yi(n)==="html"||yi(n)==="body"&&ro(n).position==="static")?t:n||FK(e)||t}function QS(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Hu(e,t,n){return ra(e,nm(t,n))}function qK(e,t,n){var r=Hu(e,t,n);return r>n?n:r}function tL(){return{top:0,right:0,bottom:0,left:0}}function nL(e){return Object.assign({},tL(),e)}function rL(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var KK=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,nL(typeof t!="number"?t:rL(t,md))};function WK(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,a=fi(n.placement),l=QS(a),c=[jn,Ar].indexOf(a)>=0,u=c?"height":"width";if(!(!o||!s)){var f=KK(i.padding,n),d=XS(o),h=l==="y"?Ln:jn,p=l==="y"?Or:Ar,g=n.rects.reference[u]+n.rects.reference[l]-s[l]-n.rects.popper[u],y=s[l]-n.rects.reference[l],v=gd(o),b=v?l==="y"?v.clientHeight||0:v.clientWidth||0:0,x=g/2-y/2,m=f[h],E=b-d[u]-f[p],T=b/2-d[u]/2+x,C=Hu(m,T,E),O=l;n.modifiersData[r]=(t={},t[O]=C,t.centerOffset=C-T,t)}}function YK(e){var t=e.state,n=e.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=t.elements.popper.querySelector(i),!i)||eL(t.elements.popper,i)&&(t.elements.arrow=i))}const GK={name:"arrow",enabled:!0,phase:"main",fn:WK,effect:YK,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function ic(e){return e.split("-")[1]}var XK={top:"auto",right:"auto",bottom:"auto",left:"auto"};function QK(e,t){var n=e.x,r=e.y,i=t.devicePixelRatio||1;return{x:nc(n*i)/i||0,y:nc(r*i)/i||0}}function vM(e){var t,n=e.popper,r=e.popperRect,i=e.placement,o=e.variation,s=e.offsets,a=e.position,l=e.gpuAcceleration,c=e.adaptive,u=e.roundOffsets,f=e.isFixed,d=s.x,h=d===void 0?0:d,p=s.y,g=p===void 0?0:p,y=typeof u=="function"?u({x:h,y:g}):{x:h,y:g};h=y.x,g=y.y;var v=s.hasOwnProperty("x"),b=s.hasOwnProperty("y"),x=jn,m=Ln,E=window;if(c){var T=gd(n),C="clientHeight",O="clientWidth";if(T===rr(n)&&(T=Ss(n),ro(T).position!=="static"&&a==="absolute"&&(C="scrollHeight",O="scrollWidth")),T=T,i===Ln||(i===jn||i===Ar)&&o===Nf){m=Or;var A=f&&T===E&&E.visualViewport?E.visualViewport.height:T[C];g-=A-r.height,g*=l?1:-1}if(i===jn||(i===Ln||i===Or)&&o===Nf){x=Ar;var k=f&&T===E&&E.visualViewport?E.visualViewport.width:T[O];h-=k-r.width,h*=l?1:-1}}var z=Object.assign({position:a},c&&XK),_=u===!0?QK({x:h,y:g},rr(n)):{x:h,y:g};if(h=_.x,g=_.y,l){var H;return Object.assign({},z,(H={},H[m]=b?"0":"",H[x]=v?"0":"",H.transform=(E.devicePixelRatio||1)<=1?"translate("+h+"px, "+g+"px)":"translate3d("+h+"px, "+g+"px, 0)",H))}return Object.assign({},z,(t={},t[m]=b?g+"px":"",t[x]=v?h+"px":"",t.transform="",t))}function JK(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,s=o===void 0?!0:o,a=n.roundOffsets,l=a===void 0?!0:a,c={placement:fi(t.placement),variation:ic(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,vM(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,vM(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const ZK={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:JK,data:{}};var oh={passive:!0};function eW(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,o=i===void 0?!0:i,s=r.resize,a=s===void 0?!0:s,l=rr(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&c.forEach(function(u){u.addEventListener("scroll",n.update,oh)}),a&&l.addEventListener("resize",n.update,oh),function(){o&&c.forEach(function(u){u.removeEventListener("scroll",n.update,oh)}),a&&l.removeEventListener("resize",n.update,oh)}}const tW={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:eW,data:{}};var nW={left:"right",right:"left",bottom:"top",top:"bottom"};function Fh(e){return e.replace(/left|right|bottom|top/g,function(t){return nW[t]})}var rW={start:"end",end:"start"};function yM(e){return e.replace(/start|end/g,function(t){return rW[t]})}function JS(e){var t=rr(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function ZS(e){return rc(Ss(e)).left+JS(e).scrollLeft}function iW(e,t){var n=rr(e),r=Ss(e),i=n.visualViewport,o=r.clientWidth,s=r.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;var c=Z3();(c||!c&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:o,height:s,x:a+ZS(e),y:l}}function oW(e){var t,n=Ss(e),r=JS(e),i=(t=e.ownerDocument)==null?void 0:t.body,o=ra(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=ra(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),a=-r.scrollLeft+ZS(e),l=-r.scrollTop;return ro(i||n).direction==="rtl"&&(a+=ra(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:a,y:l}}function ew(e){var t=ro(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function iL(e){return["html","body","#document"].indexOf(yi(e))>=0?e.ownerDocument.body:Cr(e)&&ew(e)?e:iL(Hg(e))}function $u(e,t){var n;t===void 0&&(t=[]);var r=iL(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=rr(r),s=i?[o].concat(o.visualViewport||[],ew(r)?r:[]):r,a=t.concat(s);return i?a:a.concat($u(Hg(s)))}function Ub(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function sW(e,t){var n=rc(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function bM(e,t,n){return t===Q3?Ub(iW(e,n)):Sa(t)?sW(t,n):Ub(oW(Ss(e)))}function aW(e){var t=$u(Hg(e)),n=["absolute","fixed"].indexOf(ro(e).position)>=0,r=n&&Cr(e)?gd(e):e;return Sa(r)?t.filter(function(i){return Sa(i)&&eL(i,r)&&yi(i)!=="body"}):[]}function lW(e,t,n,r){var i=t==="clippingParents"?aW(e):[].concat(t),o=[].concat(i,[n]),s=o[0],a=o.reduce(function(l,c){var u=bM(e,c,r);return l.top=ra(u.top,l.top),l.right=nm(u.right,l.right),l.bottom=nm(u.bottom,l.bottom),l.left=ra(u.left,l.left),l},bM(e,s,r));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function oL(e){var t=e.reference,n=e.element,r=e.placement,i=r?fi(r):null,o=r?ic(r):null,s=t.x+t.width/2-n.width/2,a=t.y+t.height/2-n.height/2,l;switch(i){case Ln:l={x:s,y:t.y-n.height};break;case Or:l={x:s,y:t.y+t.height};break;case Ar:l={x:t.x+t.width,y:a};break;case jn:l={x:t.x-n.width,y:a};break;default:l={x:t.x,y:t.y}}var c=i?QS(i):null;if(c!=null){var u=c==="y"?"height":"width";switch(o){case tc:l[c]=l[c]-(t[u]/2-n[u]/2);break;case Nf:l[c]=l[c]+(t[u]/2-n[u]/2);break}}return l}function _f(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=r===void 0?e.placement:r,o=n.strategy,s=o===void 0?e.strategy:o,a=n.boundary,l=a===void 0?kK:a,c=n.rootBoundary,u=c===void 0?Q3:c,f=n.elementContext,d=f===void 0?Hc:f,h=n.altBoundary,p=h===void 0?!1:h,g=n.padding,y=g===void 0?0:g,v=nL(typeof y!="number"?y:rL(y,md)),b=d===Hc?DK:Hc,x=e.rects.popper,m=e.elements[p?b:d],E=lW(Sa(m)?m:m.contextElement||Ss(e.elements.popper),l,u,s),T=rc(e.elements.reference),C=oL({reference:T,element:x,placement:i}),O=Ub(Object.assign({},x,C)),A=d===Hc?O:T,k={top:E.top-A.top+v.top,bottom:A.bottom-E.bottom+v.bottom,left:E.left-A.left+v.left,right:A.right-E.right+v.right},z=e.modifiersData.offset;if(d===Hc&&z){var _=z[i];Object.keys(k).forEach(function(H){var U=[Ar,Or].indexOf(H)>=0?1:-1,V=[Ln,Or].indexOf(H)>=0?"y":"x";k[H]+=_[V]*U})}return k}function cW(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,s=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,c=l===void 0?J3:l,u=ic(r),f=u?a?mM:mM.filter(function(p){return ic(p)===u}):md,d=f.filter(function(p){return c.indexOf(p)>=0});d.length===0&&(d=f);var h=d.reduce(function(p,g){return p[g]=_f(e,{placement:g,boundary:i,rootBoundary:o,padding:s})[fi(g)],p},{});return Object.keys(h).sort(function(p,g){return h[p]-h[g]})}function uW(e){if(fi(e)===WS)return[];var t=Fh(e);return[yM(e),t,yM(t)]}function fW(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,a=s===void 0?!0:s,l=n.fallbackPlacements,c=n.padding,u=n.boundary,f=n.rootBoundary,d=n.altBoundary,h=n.flipVariations,p=h===void 0?!0:h,g=n.allowedAutoPlacements,y=t.options.placement,v=fi(y),b=v===y,x=l||(b||!p?[Fh(y)]:uW(y)),m=[y].concat(x).reduce(function(ge,X){return ge.concat(fi(X)===WS?cW(t,{placement:X,boundary:u,rootBoundary:f,padding:c,flipVariations:p,allowedAutoPlacements:g}):X)},[]),E=t.rects.reference,T=t.rects.popper,C=new Map,O=!0,A=m[0],k=0;k<m.length;k++){var z=m[k],_=fi(z),H=ic(z)===tc,U=[Ln,Or].indexOf(_)>=0,V=U?"width":"height",D=_f(t,{placement:z,boundary:u,rootBoundary:f,altBoundary:d,padding:c}),I=U?H?Ar:jn:H?Or:Ln;E[V]>T[V]&&(I=Fh(I));var N=Fh(I),L=[];if(o&&L.push(D[_]<=0),a&&L.push(D[I]<=0,D[N]<=0),L.every(function(ge){return ge})){A=z,O=!1;break}C.set(z,L)}if(O)for(var F=p?3:1,te=function(X){var De=m.find(function(Y){var re=C.get(Y);if(re)return re.slice(0,X).every(function(pe){return pe})});if(De)return A=De,"break"},ae=F;ae>0;ae--){var Ee=te(ae);if(Ee==="break")break}t.placement!==A&&(t.modifiersData[r]._skip=!0,t.placement=A,t.reset=!0)}}const dW={name:"flip",enabled:!0,phase:"main",fn:fW,requiresIfExists:["offset"],data:{_skip:!1}};function xM(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function SM(e){return[Ln,Ar,Or,jn].some(function(t){return e[t]>=0})}function hW(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,s=_f(t,{elementContext:"reference"}),a=_f(t,{altBoundary:!0}),l=xM(s,r),c=xM(a,i,o),u=SM(l),f=SM(c);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:f},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":f})}const pW={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:hW};function mW(e,t,n){var r=fi(e),i=[jn,Ln].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,s=o[0],a=o[1];return s=s||0,a=(a||0)*i,[jn,Ar].indexOf(r)>=0?{x:a,y:s}:{x:s,y:a}}function gW(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=i===void 0?[0,0]:i,s=J3.reduce(function(u,f){return u[f]=mW(f,t.rects,o),u},{}),a=s[t.placement],l=a.x,c=a.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[r]=s}const vW={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:gW};function yW(e){var t=e.state,n=e.name;t.modifiersData[n]=oL({reference:t.rects.reference,element:t.rects.popper,placement:t.placement})}const bW={name:"popperOffsets",enabled:!0,phase:"read",fn:yW,data:{}};function xW(e){return e==="x"?"y":"x"}function SW(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,a=s===void 0?!1:s,l=n.boundary,c=n.rootBoundary,u=n.altBoundary,f=n.padding,d=n.tether,h=d===void 0?!0:d,p=n.tetherOffset,g=p===void 0?0:p,y=_f(t,{boundary:l,rootBoundary:c,padding:f,altBoundary:u}),v=fi(t.placement),b=ic(t.placement),x=!b,m=QS(v),E=xW(m),T=t.modifiersData.popperOffsets,C=t.rects.reference,O=t.rects.popper,A=typeof g=="function"?g(Object.assign({},t.rects,{placement:t.placement})):g,k=typeof A=="number"?{mainAxis:A,altAxis:A}:Object.assign({mainAxis:0,altAxis:0},A),z=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,_={x:0,y:0};if(T){if(o){var H,U=m==="y"?Ln:jn,V=m==="y"?Or:Ar,D=m==="y"?"height":"width",I=T[m],N=I+y[U],L=I-y[V],F=h?-O[D]/2:0,te=b===tc?C[D]:O[D],ae=b===tc?-O[D]:-C[D],Ee=t.elements.arrow,ge=h&&Ee?XS(Ee):{width:0,height:0},X=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:tL(),De=X[U],Y=X[V],re=Hu(0,C[D],ge[D]),pe=x?C[D]/2-F-re-De-k.mainAxis:te-re-De-k.mainAxis,Z=x?-C[D]/2+F+re+Y+k.mainAxis:ae+re+Y+k.mainAxis,le=t.elements.arrow&&gd(t.elements.arrow),ce=le?m==="y"?le.clientTop||0:le.clientLeft||0:0,Xe=(H=z==null?void 0:z[m])!=null?H:0,dt=I+pe-Xe-ce,Zt=I+Z-Xe,en=Hu(h?nm(N,dt):N,I,h?ra(L,Zt):L);T[m]=en,_[m]=en-I}if(a){var tn,kr=m==="x"?Ln:jn,En=m==="x"?Or:Ar,Cn=T[E],fn=E==="y"?"height":"width",Dr=Cn+y[kr],dn=Cn-y[En],Yr=[Ln,jn].indexOf(v)!==-1,uo=(tn=z==null?void 0:z[E])!=null?tn:0,Gr=Yr?Dr:Cn-C[fn]-O[fn]-uo+k.altAxis,fo=Yr?Cn+C[fn]+O[fn]-uo-k.altAxis:dn,ue=h&&Yr?qK(Gr,Cn,fo):Hu(h?Gr:Dr,Cn,h?fo:dn);T[E]=ue,_[E]=ue-Cn}t.modifiersData[r]=_}}const wW={name:"preventOverflow",enabled:!0,phase:"main",fn:SW,requiresIfExists:["offset"]};function EW(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function CW(e){return e===rr(e)||!Cr(e)?JS(e):EW(e)}function TW(e){var t=e.getBoundingClientRect(),n=nc(t.width)/e.offsetWidth||1,r=nc(t.height)/e.offsetHeight||1;return n!==1||r!==1}function MW(e,t,n){n===void 0&&(n=!1);var r=Cr(t),i=Cr(t)&&TW(t),o=Ss(t),s=rc(e,i,n),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((yi(t)!=="body"||ew(o))&&(a=CW(t)),Cr(t)?(l=rc(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):o&&(l.x=ZS(o))),{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function OW(e){var t=new Map,n=new Set,r=[];e.forEach(function(o){t.set(o.name,o)});function i(o){n.add(o.name);var s=[].concat(o.requires||[],o.requiresIfExists||[]);s.forEach(function(a){if(!n.has(a)){var l=t.get(a);l&&i(l)}}),r.push(o)}return e.forEach(function(o){n.has(o.name)||i(o)}),r}function AW(e){var t=OW(e);return HK.reduce(function(n,r){return n.concat(t.filter(function(i){return i.phase===r}))},[])}function kW(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function DW(e){var t=e.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var wM={placement:"bottom",modifiers:[],strategy:"absolute"};function EM(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function NW(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,i=t.defaultOptions,o=i===void 0?wM:i;return function(a,l,c){c===void 0&&(c=o);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},wM,o),modifiersData:{},elements:{reference:a,popper:l},attributes:{},styles:{}},f=[],d=!1,h={state:u,setOptions:function(v){var b=typeof v=="function"?v(u.options):v;g(),u.options=Object.assign({},o,u.options,b),u.scrollParents={reference:Sa(a)?$u(a):a.contextElement?$u(a.contextElement):[],popper:$u(l)};var x=AW(DW([].concat(r,u.options.modifiers)));return u.orderedModifiers=x.filter(function(m){return m.enabled}),p(),h.update()},forceUpdate:function(){if(!d){var v=u.elements,b=v.reference,x=v.popper;if(EM(b,x)){u.rects={reference:MW(b,gd(x),u.options.strategy==="fixed"),popper:XS(x)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(k){return u.modifiersData[k.name]=Object.assign({},k.data)});for(var m=0;m<u.orderedModifiers.length;m++){if(u.reset===!0){u.reset=!1,m=-1;continue}var E=u.orderedModifiers[m],T=E.fn,C=E.options,O=C===void 0?{}:C,A=E.name;typeof T=="function"&&(u=T({state:u,options:O,name:A,instance:h})||u)}}}},update:kW(function(){return new Promise(function(y){h.forceUpdate(),y(u)})}),destroy:function(){g(),d=!0}};if(!EM(a,l))return h;h.setOptions(c).then(function(y){!d&&c.onFirstUpdate&&c.onFirstUpdate(y)});function p(){u.orderedModifiers.forEach(function(y){var v=y.name,b=y.options,x=b===void 0?{}:b,m=y.effect;if(typeof m=="function"){var E=m({state:u,name:v,instance:h,options:x}),T=function(){};f.push(E||T)}})}function g(){f.forEach(function(y){return y()}),f=[]}return h}}var _W=[tW,bW,ZK,GS,vW,dW,wW,GK,pW],sL=NW({defaultModifiers:_W}),RW="tippy-box",aL="tippy-content",LW="tippy-backdrop",lL="tippy-arrow",cL="tippy-svg-arrow",Bs={passive:!0,capture:!0},uL=function(){return document.body};function yy(e,t,n){if(Array.isArray(e)){var r=e[t];return r??(Array.isArray(n)?n[t]:n)}return e}function tw(e,t){var n={}.toString.call(e);return n.indexOf("[object")===0&&n.indexOf(t+"]")>-1}function fL(e,t){return typeof e=="function"?e.apply(void 0,t):e}function CM(e,t){if(t===0)return e;var n;return function(r){clearTimeout(n),n=setTimeout(function(){e(r)},t)}}function jW(e){return e.split(/\s+/).filter(Boolean)}function il(e){return[].concat(e)}function TM(e,t){e.indexOf(t)===-1&&e.push(t)}function zW(e){return e.filter(function(t,n){return e.indexOf(t)===n})}function IW(e){return e.split("-")[0]}function rm(e){return[].slice.call(e)}function MM(e){return Object.keys(e).reduce(function(t,n){return e[n]!==void 0&&(t[n]=e[n]),t},{})}function Uu(){return document.createElement("div")}function $g(e){return["Element","Fragment"].some(function(t){return tw(e,t)})}function PW(e){return tw(e,"NodeList")}function BW(e){return tw(e,"MouseEvent")}function HW(e){return!!(e&&e._tippy&&e._tippy.reference===e)}function $W(e){return $g(e)?[e]:PW(e)?rm(e):Array.isArray(e)?e:rm(document.querySelectorAll(e))}function by(e,t){e.forEach(function(n){n&&(n.style.transitionDuration=t+"ms")})}function OM(e,t){e.forEach(function(n){n&&n.setAttribute("data-state",t)})}function UW(e){var t,n=il(e),r=n[0];return r!=null&&(t=r.ownerDocument)!=null&&t.body?r.ownerDocument:document}function VW(e,t){var n=t.clientX,r=t.clientY;return e.every(function(i){var o=i.popperRect,s=i.popperState,a=i.props,l=a.interactiveBorder,c=IW(s.placement),u=s.modifiersData.offset;if(!u)return!0;var f=c==="bottom"?u.top.y:0,d=c==="top"?u.bottom.y:0,h=c==="right"?u.left.x:0,p=c==="left"?u.right.x:0,g=o.top-r+f>l,y=r-o.bottom-d>l,v=o.left-n+h>l,b=n-o.right-p>l;return g||y||v||b})}function xy(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){e[r](i,n)})}function AM(e,t){for(var n=t;n;){var r;if(e.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var ei={isTouch:!1},kM=0;function FW(){ei.isTouch||(ei.isTouch=!0,window.performance&&document.addEventListener("mousemove",dL))}function dL(){var e=performance.now();e-kM<20&&(ei.isTouch=!1,document.removeEventListener("mousemove",dL)),kM=e}function qW(){var e=document.activeElement;if(HW(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}function KW(){document.addEventListener("touchstart",FW,Bs),window.addEventListener("blur",qW)}var WW=typeof window<"u"&&typeof document<"u",YW=WW?!!window.msCrypto:!1,GW={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},XW={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Pr=Object.assign({appendTo:uL,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},GW,XW),QW=Object.keys(Pr),JW=function(t){var n=Object.keys(t);n.forEach(function(r){Pr[r]=t[r]})};function hL(e){var t=e.plugins||[],n=t.reduce(function(r,i){var o=i.name,s=i.defaultValue;if(o){var a;r[o]=e[o]!==void 0?e[o]:(a=Pr[o])!=null?a:s}return r},{});return Object.assign({},e,n)}function ZW(e,t){var n=t?Object.keys(hL(Object.assign({},Pr,{plugins:t}))):QW,r=n.reduce(function(i,o){var s=(e.getAttribute("data-tippy-"+o)||"").trim();if(!s)return i;if(o==="content")i[o]=s;else try{i[o]=JSON.parse(s)}catch{i[o]=s}return i},{});return r}function DM(e,t){var n=Object.assign({},t,{content:fL(t.content,[e])},t.ignoreAttributes?{}:ZW(e,t.plugins));return n.aria=Object.assign({},Pr.aria,n.aria),n.aria={expanded:n.aria.expanded==="auto"?t.interactive:n.aria.expanded,content:n.aria.content==="auto"?t.interactive?null:"describedby":n.aria.content},n}var eY=function(){return"innerHTML"};function Vb(e,t){e[eY()]=t}function NM(e){var t=Uu();return e===!0?t.className=lL:(t.className=cL,$g(e)?t.appendChild(e):Vb(t,e)),t}function _M(e,t){$g(t.content)?(Vb(e,""),e.appendChild(t.content)):typeof t.content!="function"&&(t.allowHTML?Vb(e,t.content):e.textContent=t.content)}function Fb(e){var t=e.firstElementChild,n=rm(t.children);return{box:t,content:n.find(function(r){return r.classList.contains(aL)}),arrow:n.find(function(r){return r.classList.contains(lL)||r.classList.contains(cL)}),backdrop:n.find(function(r){return r.classList.contains(LW)})}}function pL(e){var t=Uu(),n=Uu();n.className=RW,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=Uu();r.className=aL,r.setAttribute("data-state","hidden"),_M(r,e.props),t.appendChild(n),n.appendChild(r),i(e.props,e.props);function i(o,s){var a=Fb(t),l=a.box,c=a.content,u=a.arrow;s.theme?l.setAttribute("data-theme",s.theme):l.removeAttribute("data-theme"),typeof s.animation=="string"?l.setAttribute("data-animation",s.animation):l.removeAttribute("data-animation"),s.inertia?l.setAttribute("data-inertia",""):l.removeAttribute("data-inertia"),l.style.maxWidth=typeof s.maxWidth=="number"?s.maxWidth+"px":s.maxWidth,s.role?l.setAttribute("role",s.role):l.removeAttribute("role"),(o.content!==s.content||o.allowHTML!==s.allowHTML)&&_M(c,e.props),s.arrow?u?o.arrow!==s.arrow&&(l.removeChild(u),l.appendChild(NM(s.arrow))):l.appendChild(NM(s.arrow)):u&&l.removeChild(u)}return{popper:t,onUpdate:i}}pL.$$tippy=!0;var tY=1,sh=[],Sy=[];function nY(e,t){var n=DM(e,Object.assign({},Pr,hL(MM(t)))),r,i,o,s=!1,a=!1,l=!1,c=!1,u,f,d,h=[],p=CM(dt,n.interactiveDebounce),g,y=tY++,v=null,b=zW(n.plugins),x={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},m={id:y,reference:e,popper:Uu(),popperInstance:v,props:n,state:x,plugins:b,clearDelayTimeouts:Gr,setProps:fo,setContent:ue,show:Ke,hide:ht,hideWithInteractivity:yt,enable:Yr,disable:uo,unmount:nn,destroy:zt};if(!n.render)return m;var E=n.render(m),T=E.popper,C=E.onUpdate;T.setAttribute("data-tippy-root",""),T.id="tippy-"+m.id,m.popper=T,e._tippy=m,T._tippy=m;var O=b.map(function(M){return M.fn(m)}),A=e.hasAttribute("aria-expanded");return le(),F(),I(),N("onCreate",[m]),n.showOnCreate&&Dr(),T.addEventListener("mouseenter",function(){m.props.interactive&&m.state.isVisible&&m.clearDelayTimeouts()}),T.addEventListener("mouseleave",function(){m.props.interactive&&m.props.trigger.indexOf("mouseenter")>=0&&U().addEventListener("mousemove",p)}),m;function k(){var M=m.props.touch;return Array.isArray(M)?M:[M,0]}function z(){return k()[0]==="hold"}function _(){var M;return!!((M=m.props.render)!=null&&M.$$tippy)}function H(){return g||e}function U(){var M=H().parentNode;return M?UW(M):document}function V(){return Fb(T)}function D(M){return m.state.isMounted&&!m.state.isVisible||ei.isTouch||u&&u.type==="focus"?0:yy(m.props.delay,M?0:1,Pr.delay)}function I(M){M===void 0&&(M=!1),T.style.pointerEvents=m.props.interactive&&!M?"":"none",T.style.zIndex=""+m.props.zIndex}function N(M,R,P){if(P===void 0&&(P=!0),O.forEach(function(q){q[M]&&q[M].apply(q,R)}),P){var K;(K=m.props)[M].apply(K,R)}}function L(){var M=m.props.aria;if(M.content){var R="aria-"+M.content,P=T.id,K=il(m.props.triggerTarget||e);K.forEach(function(q){var we=q.getAttribute(R);if(m.state.isVisible)q.setAttribute(R,we?we+" "+P:P);else{var Pe=we&&we.replace(P,"").trim();Pe?q.setAttribute(R,Pe):q.removeAttribute(R)}})}}function F(){if(!(A||!m.props.aria.expanded)){var M=il(m.props.triggerTarget||e);M.forEach(function(R){m.props.interactive?R.setAttribute("aria-expanded",m.state.isVisible&&R===H()?"true":"false"):R.removeAttribute("aria-expanded")})}}function te(){U().removeEventListener("mousemove",p),sh=sh.filter(function(M){return M!==p})}function ae(M){if(!(ei.isTouch&&(l||M.type==="mousedown"))){var R=M.composedPath&&M.composedPath()[0]||M.target;if(!(m.props.interactive&&AM(T,R))){if(il(m.props.triggerTarget||e).some(function(P){return AM(P,R)})){if(ei.isTouch||m.state.isVisible&&m.props.trigger.indexOf("click")>=0)return}else N("onClickOutside",[m,M]);m.props.hideOnClick===!0&&(m.clearDelayTimeouts(),m.hide(),a=!0,setTimeout(function(){a=!1}),m.state.isMounted||De())}}}function Ee(){l=!0}function ge(){l=!1}function X(){var M=U();M.addEventListener("mousedown",ae,!0),M.addEventListener("touchend",ae,Bs),M.addEventListener("touchstart",ge,Bs),M.addEventListener("touchmove",Ee,Bs)}function De(){var M=U();M.removeEventListener("mousedown",ae,!0),M.removeEventListener("touchend",ae,Bs),M.removeEventListener("touchstart",ge,Bs),M.removeEventListener("touchmove",Ee,Bs)}function Y(M,R){pe(M,function(){!m.state.isVisible&&T.parentNode&&T.parentNode.contains(T)&&R()})}function re(M,R){pe(M,R)}function pe(M,R){var P=V().box;function K(q){q.target===P&&(xy(P,"remove",K),R())}if(M===0)return R();xy(P,"remove",f),xy(P,"add",K),f=K}function Z(M,R,P){P===void 0&&(P=!1);var K=il(m.props.triggerTarget||e);K.forEach(function(q){q.addEventListener(M,R,P),h.push({node:q,eventType:M,handler:R,options:P})})}function le(){z()&&(Z("touchstart",Xe,{passive:!0}),Z("touchend",Zt,{passive:!0})),jW(m.props.trigger).forEach(function(M){if(M!=="manual")switch(Z(M,Xe),M){case"mouseenter":Z("mouseleave",Zt);break;case"focus":Z(YW?"focusout":"blur",en);break;case"focusin":Z("focusout",en);break}})}function ce(){h.forEach(function(M){var R=M.node,P=M.eventType,K=M.handler,q=M.options;R.removeEventListener(P,K,q)}),h=[]}function Xe(M){var R,P=!1;if(!(!m.state.isEnabled||tn(M)||a)){var K=((R=u)==null?void 0:R.type)==="focus";u=M,g=M.currentTarget,F(),!m.state.isVisible&&BW(M)&&sh.forEach(function(q){return q(M)}),M.type==="click"&&(m.props.trigger.indexOf("mouseenter")<0||s)&&m.props.hideOnClick!==!1&&m.state.isVisible?P=!0:Dr(M),M.type==="click"&&(s=!P),P&&!K&&dn(M)}}function dt(M){var R=M.target,P=H().contains(R)||T.contains(R);if(!(M.type==="mousemove"&&P)){var K=fn().concat(T).map(function(q){var we,Pe=q._tippy,hn=(we=Pe.popperInstance)==null?void 0:we.state;return hn?{popperRect:q.getBoundingClientRect(),popperState:hn,props:n}:null}).filter(Boolean);VW(K,M)&&(te(),dn(M))}}function Zt(M){var R=tn(M)||m.props.trigger.indexOf("click")>=0&&s;if(!R){if(m.props.interactive){m.hideWithInteractivity(M);return}dn(M)}}function en(M){m.props.trigger.indexOf("focusin")<0&&M.target!==H()||m.props.interactive&&M.relatedTarget&&T.contains(M.relatedTarget)||dn(M)}function tn(M){return ei.isTouch?z()!==M.type.indexOf("touch")>=0:!1}function kr(){En();var M=m.props,R=M.popperOptions,P=M.placement,K=M.offset,q=M.getReferenceClientRect,we=M.moveTransition,Pe=_()?Fb(T).arrow:null,hn=q?{getBoundingClientRect:q,contextElement:q.contextElement||H()}:e,ws={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(wi){var Hn=wi.state;if(_()){var Yg=V(),Cs=Yg.box;["placement","reference-hidden","escaped"].forEach(function(Ei){Ei==="placement"?Cs.setAttribute("data-placement",Hn.placement):Hn.attributes.popper["data-popper-"+Ei]?Cs.setAttribute("data-"+Ei,""):Cs.removeAttribute("data-"+Ei)}),Hn.attributes.popper={}}}},It=[{name:"offset",options:{offset:K}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!we}},ws];_()&&Pe&&It.push({name:"arrow",options:{element:Pe,padding:3}}),It.push.apply(It,(R==null?void 0:R.modifiers)||[]),m.popperInstance=sL(hn,T,Object.assign({},R,{placement:P,onFirstUpdate:d,modifiers:It}))}function En(){m.popperInstance&&(m.popperInstance.destroy(),m.popperInstance=null)}function Cn(){var M=m.props.appendTo,R,P=H();m.props.interactive&&M===uL||M==="parent"?R=P.parentNode:R=fL(M,[P]),R.contains(T)||R.appendChild(T),m.state.isMounted=!0,kr()}function fn(){return rm(T.querySelectorAll("[data-tippy-root]"))}function Dr(M){m.clearDelayTimeouts(),M&&N("onTrigger",[m,M]),X();var R=D(!0),P=k(),K=P[0],q=P[1];ei.isTouch&&K==="hold"&&q&&(R=q),R?r=setTimeout(function(){m.show()},R):m.show()}function dn(M){if(m.clearDelayTimeouts(),N("onUntrigger",[m,M]),!m.state.isVisible){De();return}if(!(m.props.trigger.indexOf("mouseenter")>=0&&m.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(M.type)>=0&&s)){var R=D(!1);R?i=setTimeout(function(){m.state.isVisible&&m.hide()},R):o=requestAnimationFrame(function(){m.hide()})}}function Yr(){m.state.isEnabled=!0}function uo(){m.hide(),m.state.isEnabled=!1}function Gr(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(o)}function fo(M){if(!m.state.isDestroyed){N("onBeforeUpdate",[m,M]),ce();var R=m.props,P=DM(e,Object.assign({},R,MM(M),{ignoreAttributes:!0}));m.props=P,le(),R.interactiveDebounce!==P.interactiveDebounce&&(te(),p=CM(dt,P.interactiveDebounce)),R.triggerTarget&&!P.triggerTarget?il(R.triggerTarget).forEach(function(K){K.removeAttribute("aria-expanded")}):P.triggerTarget&&e.removeAttribute("aria-expanded"),F(),I(),C&&C(R,P),m.popperInstance&&(kr(),fn().forEach(function(K){requestAnimationFrame(K._tippy.popperInstance.forceUpdate)})),N("onAfterUpdate",[m,M])}}function ue(M){m.setProps({content:M})}function Ke(){var M=m.state.isVisible,R=m.state.isDestroyed,P=!m.state.isEnabled,K=ei.isTouch&&!m.props.touch,q=yy(m.props.duration,0,Pr.duration);if(!(M||R||P||K)&&!H().hasAttribute("disabled")&&(N("onShow",[m],!1),m.props.onShow(m)!==!1)){if(m.state.isVisible=!0,_()&&(T.style.visibility="visible"),I(),X(),m.state.isMounted||(T.style.transition="none"),_()){var we=V(),Pe=we.box,hn=we.content;by([Pe,hn],0)}d=function(){var It;if(!(!m.state.isVisible||c)){if(c=!0,T.offsetHeight,T.style.transition=m.props.moveTransition,_()&&m.props.animation){var Es=V(),wi=Es.box,Hn=Es.content;by([wi,Hn],q),OM([wi,Hn],"visible")}L(),F(),TM(Sy,m),(It=m.popperInstance)==null||It.forceUpdate(),N("onMount",[m]),m.props.animation&&_()&&re(q,function(){m.state.isShown=!0,N("onShown",[m])})}},Cn()}}function ht(){var M=!m.state.isVisible,R=m.state.isDestroyed,P=!m.state.isEnabled,K=yy(m.props.duration,1,Pr.duration);if(!(M||R||P)&&(N("onHide",[m],!1),m.props.onHide(m)!==!1)){if(m.state.isVisible=!1,m.state.isShown=!1,c=!1,s=!1,_()&&(T.style.visibility="hidden"),te(),De(),I(!0),_()){var q=V(),we=q.box,Pe=q.content;m.props.animation&&(by([we,Pe],K),OM([we,Pe],"hidden"))}L(),F(),m.props.animation?_()&&Y(K,m.unmount):m.unmount()}}function yt(M){U().addEventListener("mousemove",p),TM(sh,p),p(M)}function nn(){m.state.isVisible&&m.hide(),m.state.isMounted&&(En(),fn().forEach(function(M){M._tippy.unmount()}),T.parentNode&&T.parentNode.removeChild(T),Sy=Sy.filter(function(M){return M!==m}),m.state.isMounted=!1,N("onHidden",[m]))}function zt(){m.state.isDestroyed||(m.clearDelayTimeouts(),m.unmount(),ce(),delete e._tippy,m.state.isDestroyed=!0,N("onDestroy",[m]))}}function Ac(e,t){t===void 0&&(t={});var n=Pr.plugins.concat(t.plugins||[]);KW();var r=Object.assign({},t,{plugins:n}),i=$W(e),o=i.reduce(function(s,a){var l=a&&nY(a,r);return l&&s.push(l),s},[]);return $g(e)?o[0]:o}Ac.defaultProps=Pr;Ac.setDefaultProps=JW;Ac.currentInput=ei;Object.assign({},GS,{effect:function(t){var n=t.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow)}});Ac.setDefaultProps({render:pL});class rY{constructor({editor:t,element:n,view:r,tippyOptions:i={},updateDelay:o=250,shouldShow:s}){this.preventHide=!1,this.shouldShow=({view:a,state:l,from:c,to:u})=>{const{doc:f,selection:d}=l,{empty:h}=d,p=!f.textBetween(c,u).length&&Ig(l.selection),g=this.element.contains(document.activeElement);return!(!(a.hasFocus()||g)||h||p||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:a})=>{var l;if(this.preventHide){this.preventHide=!1;return}a!=null&&a.relatedTarget&&(!((l=this.element.parentNode)===null||l===void 0)&&l.contains(a.relatedTarget))||(a==null?void 0:a.relatedTarget)!==this.editor.view.dom&&this.hide()},this.tippyBlurHandler=a=>{this.blurHandler({event:a})},this.handleDebouncedUpdate=(a,l)=>{const c=!(l!=null&&l.selection.eq(a.state.selection)),u=!(l!=null&&l.doc.eq(a.state.doc));!c&&!u||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(a,c,u,l)},this.updateDelay))},this.updateHandler=(a,l,c,u)=>{var f,d,h;const{state:p,composing:g}=a,{selection:y}=p;if(g||!l&&!c)return;this.createTooltip();const{ranges:b}=y,x=Math.min(...b.map(T=>T.$from.pos)),m=Math.max(...b.map(T=>T.$to.pos));if(!((f=this.shouldShow)===null||f===void 0?void 0:f.call(this,{editor:this.editor,element:this.element,view:a,state:p,oldState:u,from:x,to:m}))){this.hide();return}(d=this.tippy)===null||d===void 0||d.setProps({getReferenceClientRect:((h=this.tippyOptions)===null||h===void 0?void 0:h.getReferenceClientRect)||(()=>{if(X3(p.selection)){let T=a.nodeDOM(x);if(T){const C=T.dataset.nodeViewWrapper?T:T.querySelector("[data-node-view-wrapper]");if(C&&(T=C.firstChild),T)return T.getBoundingClientRect()}}return Yq(a,x,m)})}),this.show()},this.editor=t,this.element=n,this.view=r,this.updateDelay=o,s&&(this.shouldShow=s),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:t}=this.editor.options,n=!!t.parentElement;this.element.tabIndex=0,!(this.tippy||!n)&&(this.tippy=Ac(t,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(t,n){const{state:r}=t,i=r.selection.from!==r.selection.to;if(this.updateDelay>0&&i){this.handleDebouncedUpdate(t,n);return}const o=!(n!=null&&n.selection.eq(t.state.selection)),s=!(n!=null&&n.doc.eq(t.state.doc));this.updateHandler(t,o,s,n)}show(){var t;(t=this.tippy)===null||t===void 0||t.show()}hide(){var t;(t=this.tippy)===null||t===void 0||t.hide()}destroy(){var t,n;!((t=this.tippy)===null||t===void 0)&&t.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(n=this.tippy)===null||n===void 0||n.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const mL=e=>new Ge({key:typeof e.pluginKey=="string"?new ut(e.pluginKey):e.pluginKey,view:t=>new rY({view:t,...e})});Ye.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[mL({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});function iY(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var gL={exports:{}},wy={};/**
425
+ * @license React
426
+ * use-sync-external-store-shim.production.min.js
427
+ *
428
+ * Copyright (c) Facebook, Inc. and its affiliates.
429
+ *
430
+ * This source code is licensed under the MIT license found in the
431
+ * LICENSE file in the root directory of this source tree.
432
+ */var RM;function oY(){if(RM)return wy;RM=1;var e=Ce;function t(f,d){return f===d&&(f!==0||1/f===1/d)||f!==f&&d!==d}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,o=e.useLayoutEffect,s=e.useDebugValue;function a(f,d){var h=d(),p=r({inst:{value:h,getSnapshot:d}}),g=p[0].inst,y=p[1];return o(function(){g.value=h,g.getSnapshot=d,l(g)&&y({inst:g})},[f,h,d]),i(function(){return l(g)&&y({inst:g}),f(function(){l(g)&&y({inst:g})})},[f]),s(h),h}function l(f){var d=f.getSnapshot;f=f.value;try{var h=d();return!n(f,h)}catch{return!0}}function c(f,d){return d()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:a;return wy.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u,wy}gL.exports=oY();var nw=gL.exports;const sY=(...e)=>t=>{e.forEach(n=>{typeof n=="function"?n(t):n&&(n.current=t)})},aY=({contentComponent:e})=>{const t=nw.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getServerSnapshot);return Ce.createElement(Ce.Fragment,null,Object.values(t))};function lY(){const e=new Set;let t={};return{subscribe(n){return e.add(n),()=>{e.delete(n)}},getSnapshot(){return t},getServerSnapshot(){return t},setRenderer(n,r){t={...t,[n]:OO.createPortal(r.reactElement,r.element,n)},e.forEach(i=>i())},removeRenderer(n){const r={...t};delete r[n],t=r,e.forEach(i=>i())}}}class cY extends Ce.Component{constructor(t){var n;super(t),this.editorContentRef=Ce.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:!!(!((n=t.editor)===null||n===void 0)&&n.contentComponent)}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){const t=this.props.editor;if(t&&!t.isDestroyed&&t.options.element){if(t.contentComponent)return;const n=this.editorContentRef.current;n.append(...t.options.element.childNodes),t.setOptions({element:n}),t.contentComponent=lY(),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=t.contentComponent.subscribe(()=>{this.setState(r=>r.hasContentComponentInitialized?r:{hasContentComponentInitialized:!0}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()})),t.createNodeViews(),this.initialized=!0}}componentWillUnmount(){const t=this.props.editor;if(!t||(this.initialized=!1,t.isDestroyed||t.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),t.contentComponent=null,!t.options.element.firstChild))return;const n=document.createElement("div");n.append(...t.options.element.childNodes),t.setOptions({element:n})}render(){const{editor:t,innerRef:n,...r}=this.props;return Ce.createElement(Ce.Fragment,null,Ce.createElement("div",{ref:sY(n,this.editorContentRef),...r}),(t==null?void 0:t.contentComponent)&&Ce.createElement(aY,{contentComponent:t.contentComponent}))}}const uY=S.forwardRef((e,t)=>{const n=Ce.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[e.editor]);return Ce.createElement(cY,{key:n,innerRef:t,...e})}),fY=Ce.memo(uY);var dY=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var r,i,o;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!e(t[i],n[i]))return!1;return!0}if(t instanceof Map&&n instanceof Map){if(t.size!==n.size)return!1;for(i of t.entries())if(!n.has(i[0]))return!1;for(i of t.entries())if(!e(i[1],n.get(i[0])))return!1;return!0}if(t instanceof Set&&n instanceof Set){if(t.size!==n.size)return!1;for(i of t.entries())if(!n.has(i[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(n)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(t[i]!==n[i])return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(o=Object.keys(t),r=o.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,o[i]))return!1;for(i=r;i--!==0;){var s=o[i];if(!(s==="_owner"&&t.$$typeof)&&!e(t[s],n[s]))return!1}return!0}return t!==t&&n!==n},hY=iY(dY),vL={exports:{}},Ey={};/**
433
+ * @license React
434
+ * use-sync-external-store-shim/with-selector.production.min.js
435
+ *
436
+ * Copyright (c) Facebook, Inc. and its affiliates.
437
+ *
438
+ * This source code is licensed under the MIT license found in the
439
+ * LICENSE file in the root directory of this source tree.
440
+ */var LM;function pY(){if(LM)return Ey;LM=1;var e=Ce,t=nw;function n(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,s=e.useEffect,a=e.useMemo,l=e.useDebugValue;return Ey.useSyncExternalStoreWithSelector=function(c,u,f,d,h){var p=o(null);if(p.current===null){var g={hasValue:!1,value:null};p.current=g}else g=p.current;p=a(function(){function v(T){if(!b){if(b=!0,x=T,T=d(T),h!==void 0&&g.hasValue){var C=g.value;if(h(C,T))return m=C}return m=T}if(C=m,r(x,T))return C;var O=d(T);return h!==void 0&&h(C,O)?C:(x=T,m=O)}var b=!1,x,m,E=f===void 0?null:f;return[function(){return v(u())},E===null?void 0:function(){return v(E())}]},[u,f,d,h]);var y=i(c,p[0],p[1]);return s(function(){g.hasValue=!0,g.value=y},[y]),l(y),y},Ey}vL.exports=pY();var mY=vL.exports;const gY=typeof window<"u"?S.useLayoutEffect:S.useEffect;class vY{constructor(t){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=t,this.lastSnapshot={editor:t,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(t){return this.subscribers.add(t),()=>{this.subscribers.delete(t)}}watch(t){if(this.editor=t,this.editor){const n=()=>{this.transactionNumber+=1,this.subscribers.forEach(i=>i())},r=this.editor;return r.on("transaction",n),()=>{r.off("transaction",n)}}}}function Ug(e){var t;const[n]=S.useState(()=>new vY(e.editor)),r=mY.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getServerSnapshot,e.selector,(t=e.equalityFn)!==null&&t!==void 0?t:hY);return gY(()=>n.watch(e.editor),[e.editor,n]),S.useDebugValue(r),r}const yY=!1,qb=typeof window>"u",bY=qb||!!(typeof window<"u"&&window.next);class rw{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(n=>n())}getInitialEditor(){return this.options.current.immediatelyRender===void 0?qb||bY?null:this.createEditor():(this.options.current.immediatelyRender,this.options.current.immediatelyRender?this.createEditor():null)}createEditor(){const t={...this.options.current,onBeforeCreate:(...r)=>{var i,o;return(o=(i=this.options.current).onBeforeCreate)===null||o===void 0?void 0:o.call(i,...r)},onBlur:(...r)=>{var i,o;return(o=(i=this.options.current).onBlur)===null||o===void 0?void 0:o.call(i,...r)},onCreate:(...r)=>{var i,o;return(o=(i=this.options.current).onCreate)===null||o===void 0?void 0:o.call(i,...r)},onDestroy:(...r)=>{var i,o;return(o=(i=this.options.current).onDestroy)===null||o===void 0?void 0:o.call(i,...r)},onFocus:(...r)=>{var i,o;return(o=(i=this.options.current).onFocus)===null||o===void 0?void 0:o.call(i,...r)},onSelectionUpdate:(...r)=>{var i,o;return(o=(i=this.options.current).onSelectionUpdate)===null||o===void 0?void 0:o.call(i,...r)},onTransaction:(...r)=>{var i,o;return(o=(i=this.options.current).onTransaction)===null||o===void 0?void 0:o.call(i,...r)},onUpdate:(...r)=>{var i,o;return(o=(i=this.options.current).onUpdate)===null||o===void 0?void 0:o.call(i,...r)},onContentError:(...r)=>{var i,o;return(o=(i=this.options.current).onContentError)===null||o===void 0?void 0:o.call(i,...r)},onDrop:(...r)=>{var i,o;return(o=(i=this.options.current).onDrop)===null||o===void 0?void 0:o.call(i,...r)},onPaste:(...r)=>{var i,o;return(o=(i=this.options.current).onPaste)===null||o===void 0?void 0:o.call(i,...r)}};return new TK(t)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(t){return this.subscriptions.add(t),()=>{this.subscriptions.delete(t)}}static compareOptions(t,n){return Object.keys(t).every(r=>["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(r)?!0:r==="extensions"&&t.extensions&&n.extensions?t.extensions.length!==n.extensions.length?!1:t.extensions.every((i,o)=>{var s;return i===((s=n.extensions)===null||s===void 0?void 0:s[o])}):t[r]===n[r])}onRender(t){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&t.length===0?rw.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((r,i)=>r===t[i]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=t}scheduleDestroy(){const t=this.instanceId,n=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===t){n&&n.setOptions(this.options.current);return}n&&!n.isDestroyed&&(n.destroy(),this.instanceId===t&&this.setEditor(null))},1)}}function xY(e={},t=[]){const n=S.useRef(e);n.current=e;const[r]=S.useState(()=>new rw(n)),i=nw.useSyncExternalStore(r.subscribe,r.getEditor,r.getServerSnapshot);return S.useDebugValue(i),S.useEffect(r.onRender(t)),Ug({editor:i,selector:({transactionNumber:o})=>e.shouldRerenderOnTransaction===!1?null:e.immediatelyRender&&o===0?0:o+1}),i}const yL=S.createContext({editor:null});yL.Consumer;const SY=()=>S.useContext(yL),bL=e=>{const[t,n]=S.useState(null),{editor:r}=SY();return S.useEffect(()=>{var i;if(!t||!((i=e.editor)===null||i===void 0)&&i.isDestroyed||r!=null&&r.isDestroyed)return;const{pluginKey:o="bubbleMenu",editor:s,tippyOptions:a={},updateDelay:l,shouldShow:c=null}=e,u=s||r;if(!u){console.warn("BubbleMenu component is not rendered inside of an editor component or does not have editor prop.");return}const f=mL({updateDelay:l,editor:u,element:t,pluginKey:o,shouldShow:c,tippyOptions:a});return u.registerPlugin(f),()=>{u.unregisterPlugin(o)}},[e.editor,r,t]),Ce.createElement("div",{ref:n,className:e.className,style:{visibility:"hidden"}},e.children)},wY=S.createContext({onDragStart:void 0}),EY=()=>S.useContext(wY);Ce.forwardRef((e,t)=>{const{onDragStart:n}=EY(),r=e.as||"div";return Ce.createElement(r,{...e,ref:t,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...e.style}})});function jM(e){return!!(typeof e=="function"&&e.prototype&&e.prototype.isReactComponent)}function zM(e){return!!(typeof e=="object"&&e.$$typeof&&(e.$$typeof.toString()==="Symbol(react.forward_ref)"||e.$$typeof.description==="react.forward_ref"))}function CY(e){return!!(typeof e=="object"&&e.$$typeof&&(e.$$typeof.toString()==="Symbol(react.memo)"||e.$$typeof.description==="react.memo"))}function TY(e){if(jM(e)||zM(e))return!0;if(CY(e)){const t=e.type;if(t)return jM(t)||zM(t)}return!1}function MY(){try{if(S.version)return parseInt(S.version.split(".")[0],10)>=19}catch{}return!1}class OY{constructor(t,{editor:n,props:r={},as:i="div",className:o=""}){this.ref=null,this.id=Math.floor(Math.random()*4294967295).toString(),this.component=t,this.editor=n,this.props=r,this.element=document.createElement(i),this.element.classList.add("react-renderer"),o&&this.element.classList.add(...o.split(" ")),this.editor.isInitialized?ke.flushSync(()=>{this.render()}):queueMicrotask(()=>{this.render()})}render(){var t;const n=this.component,r=this.props,i=this.editor,o=MY(),s=TY(n),a={...r};a.ref&&!(o||s)&&delete a.ref,!a.ref&&(o||s)&&(a.ref=l=>{this.ref=l}),this.reactElement=Ce.createElement(n,{...a}),(t=i==null?void 0:i.contentComponent)===null||t===void 0||t.setRenderer(this.id,this)}updateProps(t={}){this.props={...this.props,...t},this.render()}destroy(){var t;const n=this.editor;(t=n==null?void 0:n.contentComponent)===null||t===void 0||t.removeRenderer(this.id)}updateAttributes(t){Object.keys(t).forEach(n=>{this.element.setAttribute(n,t[n])})}}var Cy="rovingFocusGroup.onEntryFocus",AY={bubbles:!1,cancelable:!0},vd="RovingFocusGroup",[Kb,xL,kY]=rS(vd),[DY,SL]=ms(vd,[kY]),[NY,_Y]=DY(vd),wL=S.forwardRef((e,t)=>w.jsx(Kb.Provider,{scope:e.__scopeRovingFocusGroup,children:w.jsx(Kb.Slot,{scope:e.__scopeRovingFocusGroup,children:w.jsx(RY,{...e,ref:t})})}));wL.displayName=vd;var RY=S.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...f}=e,d=S.useRef(null),h=Ie(t,d),p=iS(o),[g,y]=Xl({prop:s,defaultProp:a??null,onChange:l,caller:vd}),[v,b]=S.useState(!1),x=mi(c),m=xL(n),E=S.useRef(!1),[T,C]=S.useState(0);return S.useEffect(()=>{const O=d.current;if(O)return O.addEventListener(Cy,x),()=>O.removeEventListener(Cy,x)},[x]),w.jsx(NY,{scope:n,orientation:r,dir:p,loop:i,currentTabStopId:g,onItemFocus:S.useCallback(O=>y(O),[y]),onItemShiftTab:S.useCallback(()=>b(!0),[]),onFocusableItemAdd:S.useCallback(()=>C(O=>O+1),[]),onFocusableItemRemove:S.useCallback(()=>C(O=>O-1),[]),children:w.jsx(xe.div,{tabIndex:v||T===0?-1:0,"data-orientation":r,...f,ref:h,style:{outline:"none",...e.style},onMouseDown:Q(e.onMouseDown,()=>{E.current=!0}),onFocus:Q(e.onFocus,O=>{const A=!E.current;if(O.target===O.currentTarget&&A&&!v){const k=new CustomEvent(Cy,AY);if(O.currentTarget.dispatchEvent(k),!k.defaultPrevented){const z=m().filter(D=>D.focusable),_=z.find(D=>D.active),H=z.find(D=>D.id===g),V=[_,H,...z].filter(Boolean).map(D=>D.ref.current);TL(V,u)}}E.current=!1}),onBlur:Q(e.onBlur,()=>b(!1))})})}),EL="RovingFocusGroupItem",CL=S.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:o,children:s,...a}=e,l=ci(),c=o||l,u=_Y(EL,n),f=u.currentTabStopId===c,d=xL(n),{onFocusableItemAdd:h,onFocusableItemRemove:p,currentTabStopId:g}=u;return S.useEffect(()=>{if(r)return h(),()=>p()},[r,h,p]),w.jsx(Kb.ItemSlot,{scope:n,id:c,focusable:r,active:i,children:w.jsx(xe.span,{tabIndex:f?0:-1,"data-orientation":u.orientation,...a,ref:t,onMouseDown:Q(e.onMouseDown,y=>{r?u.onItemFocus(c):y.preventDefault()}),onFocus:Q(e.onFocus,()=>u.onItemFocus(c)),onKeyDown:Q(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){u.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const v=zY(y,u.orientation,u.dir);if(v!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let x=d().filter(m=>m.focusable).map(m=>m.ref.current);if(v==="last")x.reverse();else if(v==="prev"||v==="next"){v==="prev"&&x.reverse();const m=x.indexOf(y.currentTarget);x=u.loop?IY(x,m+1):x.slice(m+1)}setTimeout(()=>TL(x))}}),children:typeof s=="function"?s({isCurrentTabStop:f,hasTabStop:g!=null}):s})})});CL.displayName=EL;var LY={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function jY(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function zY(e,t,n){const r=jY(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return LY[r]}function TL(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function IY(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var PY=wL,BY=CL,Wb=["Enter"," "],HY=["ArrowDown","PageUp","Home"],ML=["ArrowUp","PageDown","End"],$Y=[...HY,...ML],UY={ltr:[...Wb,"ArrowRight"],rtl:[...Wb,"ArrowLeft"]},VY={ltr:["ArrowLeft"],rtl:["ArrowRight"]},yd="Menu",[Rf,FY,qY]=rS(yd),[La,OL]=ms(yd,[qY,Tc,SL]),Vg=Tc(),AL=SL(),[KY,ja]=La(yd),[WY,bd]=La(yd),kL=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:o,modal:s=!0}=e,a=Vg(t),[l,c]=S.useState(null),u=S.useRef(!1),f=mi(o),d=iS(i);return S.useEffect(()=>{const h=()=>{u.current=!0,document.addEventListener("pointerdown",p,{capture:!0,once:!0}),document.addEventListener("pointermove",p,{capture:!0,once:!0})},p=()=>u.current=!1;return document.addEventListener("keydown",h,{capture:!0}),()=>{document.removeEventListener("keydown",h,{capture:!0}),document.removeEventListener("pointerdown",p,{capture:!0}),document.removeEventListener("pointermove",p,{capture:!0})}},[]),w.jsx(hS,{...a,children:w.jsx(KY,{scope:t,open:n,onOpenChange:f,content:l,onContentChange:c,children:w.jsx(WY,{scope:t,onClose:S.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:u,dir:d,modal:s,children:r})})})};kL.displayName=yd;var YY="MenuAnchor",iw=S.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=Vg(n);return w.jsx(vg,{...i,...r,ref:t})});iw.displayName=YY;var ow="MenuPortal",[GY,DL]=La(ow,{forceMount:void 0}),NL=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:i}=e,o=ja(ow,t);return w.jsx(GY,{scope:t,forceMount:n,children:w.jsx(co,{present:n||o.open,children:w.jsx(yg,{asChild:!0,container:i,children:r})})})};NL.displayName=ow;var Tr="MenuContent",[XY,sw]=La(Tr),_L=S.forwardRef((e,t)=>{const n=DL(Tr,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=ja(Tr,e.__scopeMenu),s=bd(Tr,e.__scopeMenu);return w.jsx(Rf.Provider,{scope:e.__scopeMenu,children:w.jsx(co,{present:r||o.open,children:w.jsx(Rf.Slot,{scope:e.__scopeMenu,children:s.modal?w.jsx(QY,{...i,ref:t}):w.jsx(JY,{...i,ref:t})})})})}),QY=S.forwardRef((e,t)=>{const n=ja(Tr,e.__scopeMenu),r=S.useRef(null),i=Ie(t,r);return S.useEffect(()=>{const o=r.current;if(o)return bg(o)},[]),w.jsx(aw,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Q(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),JY=S.forwardRef((e,t)=>{const n=ja(Tr,e.__scopeMenu);return w.jsx(aw,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),ZY=fa("MenuContent.ScrollLock"),aw=S.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:f,onInteractOutside:d,onDismiss:h,disableOutsideScroll:p,...g}=e,y=ja(Tr,n),v=bd(Tr,n),b=Vg(n),x=AL(n),m=FY(n),[E,T]=S.useState(null),C=S.useRef(null),O=Ie(t,C,y.onContentChange),A=S.useRef(0),k=S.useRef(""),z=S.useRef(0),_=S.useRef(null),H=S.useRef("right"),U=S.useRef(0),V=p?ld:S.Fragment,D=p?{as:ZY,allowPinchZoom:!0}:void 0,I=L=>{var Y,re;const F=k.current+L,te=m().filter(pe=>!pe.disabled),ae=document.activeElement,Ee=(Y=te.find(pe=>pe.ref.current===ae))==null?void 0:Y.textValue,ge=te.map(pe=>pe.textValue),X=fG(ge,F,Ee),De=(re=te.find(pe=>pe.textValue===X))==null?void 0:re.ref.current;(function pe(Z){k.current=Z,window.clearTimeout(A.current),Z!==""&&(A.current=window.setTimeout(()=>pe(""),1e3))})(F),De&&setTimeout(()=>De.focus())};S.useEffect(()=>()=>window.clearTimeout(A.current),[]),dg();const N=S.useCallback(L=>{var te,ae;return H.current===((te=_.current)==null?void 0:te.side)&&hG(L,(ae=_.current)==null?void 0:ae.area)},[]);return w.jsx(XY,{scope:n,searchRef:k,onItemEnter:S.useCallback(L=>{N(L)&&L.preventDefault()},[N]),onItemLeave:S.useCallback(L=>{var F;N(L)||((F=C.current)==null||F.focus(),T(null))},[N]),onTriggerLeave:S.useCallback(L=>{N(L)&&L.preventDefault()},[N]),pointerGraceTimerRef:z,onPointerGraceIntentChange:S.useCallback(L=>{_.current=L},[]),children:w.jsx(V,{...D,children:w.jsx(sd,{asChild:!0,trapped:i,onMountAutoFocus:Q(o,L=>{var F;L.preventDefault(),(F=C.current)==null||F.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:w.jsx(od,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:f,onInteractOutside:d,onDismiss:h,children:w.jsx(PY,{asChild:!0,...x,dir:v.dir,orientation:"vertical",loop:r,currentTabStopId:E,onCurrentTabStopIdChange:T,onEntryFocus:Q(l,L=>{v.isUsingKeyboardRef.current||L.preventDefault()}),preventScrollOnEntryFocus:!0,children:w.jsx(pS,{role:"menu","aria-orientation":"vertical","data-state":YL(y.open),"data-radix-menu-content":"",dir:v.dir,...b,...g,ref:O,style:{outline:"none",...g.style},onKeyDown:Q(g.onKeyDown,L=>{const te=L.target.closest("[data-radix-menu-content]")===L.currentTarget,ae=L.ctrlKey||L.altKey||L.metaKey,Ee=L.key.length===1;te&&(L.key==="Tab"&&L.preventDefault(),!ae&&Ee&&I(L.key));const ge=C.current;if(L.target!==ge||!$Y.includes(L.key))return;L.preventDefault();const De=m().filter(Y=>!Y.disabled).map(Y=>Y.ref.current);ML.includes(L.key)&&De.reverse(),cG(De)}),onBlur:Q(e.onBlur,L=>{L.currentTarget.contains(L.target)||(window.clearTimeout(A.current),k.current="")}),onPointerMove:Q(e.onPointerMove,Lf(L=>{const F=L.target,te=U.current!==L.clientX;if(L.currentTarget.contains(F)&&te){const ae=L.clientX>U.current?"right":"left";H.current=ae,U.current=L.clientX}}))})})})})})})});_L.displayName=Tr;var eG="MenuGroup",lw=S.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return w.jsx(xe.div,{role:"group",...r,ref:t})});lw.displayName=eG;var tG="MenuLabel",RL=S.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return w.jsx(xe.div,{...r,ref:t})});RL.displayName=tG;var im="MenuItem",IM="menu.itemSelect",Fg=S.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,o=S.useRef(null),s=bd(im,e.__scopeMenu),a=sw(im,e.__scopeMenu),l=Ie(t,o),c=S.useRef(!1),u=()=>{const f=o.current;if(!n&&f){const d=new CustomEvent(IM,{bubbles:!0,cancelable:!0});f.addEventListener(IM,h=>r==null?void 0:r(h),{once:!0}),PN(f,d),d.defaultPrevented?c.current=!1:s.onClose()}};return w.jsx(LL,{...i,ref:l,disabled:n,onClick:Q(e.onClick,u),onPointerDown:f=>{var d;(d=e.onPointerDown)==null||d.call(e,f),c.current=!0},onPointerUp:Q(e.onPointerUp,f=>{var d;c.current||(d=f.currentTarget)==null||d.click()}),onKeyDown:Q(e.onKeyDown,f=>{const d=a.searchRef.current!=="";n||d&&f.key===" "||Wb.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})});Fg.displayName=im;var LL=S.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...o}=e,s=sw(im,n),a=AL(n),l=S.useRef(null),c=Ie(t,l),[u,f]=S.useState(!1),[d,h]=S.useState("");return S.useEffect(()=>{const p=l.current;p&&h((p.textContent??"").trim())},[o.children]),w.jsx(Rf.ItemSlot,{scope:n,disabled:r,textValue:i??d,children:w.jsx(BY,{asChild:!0,...a,focusable:!r,children:w.jsx(xe.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...o,ref:c,onPointerMove:Q(e.onPointerMove,Lf(p=>{r?s.onItemLeave(p):(s.onItemEnter(p),p.defaultPrevented||p.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Q(e.onPointerLeave,Lf(p=>s.onItemLeave(p))),onFocus:Q(e.onFocus,()=>f(!0)),onBlur:Q(e.onBlur,()=>f(!1))})})})}),nG="MenuCheckboxItem",jL=S.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...i}=e;return w.jsx(HL,{scope:e.__scopeMenu,checked:n,children:w.jsx(Fg,{role:"menuitemcheckbox","aria-checked":om(n)?"mixed":n,...i,ref:t,"data-state":uw(n),onSelect:Q(i.onSelect,()=>r==null?void 0:r(om(n)?!0:!n),{checkForDefaultPrevented:!1})})})});jL.displayName=nG;var zL="MenuRadioGroup",[rG,iG]=La(zL,{value:void 0,onValueChange:()=>{}}),IL=S.forwardRef((e,t)=>{const{value:n,onValueChange:r,...i}=e,o=mi(r);return w.jsx(rG,{scope:e.__scopeMenu,value:n,onValueChange:o,children:w.jsx(lw,{...i,ref:t})})});IL.displayName=zL;var PL="MenuRadioItem",BL=S.forwardRef((e,t)=>{const{value:n,...r}=e,i=iG(PL,e.__scopeMenu),o=n===i.value;return w.jsx(HL,{scope:e.__scopeMenu,checked:o,children:w.jsx(Fg,{role:"menuitemradio","aria-checked":o,...r,ref:t,"data-state":uw(o),onSelect:Q(r.onSelect,()=>{var s;return(s=i.onValueChange)==null?void 0:s.call(i,n)},{checkForDefaultPrevented:!1})})})});BL.displayName=PL;var cw="MenuItemIndicator",[HL,oG]=La(cw,{checked:!1}),$L=S.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...i}=e,o=oG(cw,n);return w.jsx(co,{present:r||om(o.checked)||o.checked===!0,children:w.jsx(xe.span,{...i,ref:t,"data-state":uw(o.checked)})})});$L.displayName=cw;var sG="MenuSeparator",UL=S.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return w.jsx(xe.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});UL.displayName=sG;var aG="MenuArrow",VL=S.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=Vg(n);return w.jsx(mS,{...i,...r,ref:t})});VL.displayName=aG;var lG="MenuSub",[oee,FL]=La(lG),pu="MenuSubTrigger",qL=S.forwardRef((e,t)=>{const n=ja(pu,e.__scopeMenu),r=bd(pu,e.__scopeMenu),i=FL(pu,e.__scopeMenu),o=sw(pu,e.__scopeMenu),s=S.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=o,c={__scopeMenu:e.__scopeMenu},u=S.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return S.useEffect(()=>u,[u]),S.useEffect(()=>{const f=a.current;return()=>{window.clearTimeout(f),l(null)}},[a,l]),w.jsx(iw,{asChild:!0,...c,children:w.jsx(LL,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":YL(n.open),...e,ref:fg(t,i.onTriggerChange),onClick:f=>{var d;(d=e.onClick)==null||d.call(e,f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Q(e.onPointerMove,Lf(f=>{o.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!n.open&&!s.current&&(o.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:Q(e.onPointerLeave,Lf(f=>{var h,p;u();const d=(h=n.content)==null?void 0:h.getBoundingClientRect();if(d){const g=(p=n.content)==null?void 0:p.dataset.side,y=g==="right",v=y?-5:5,b=d[y?"left":"right"],x=d[y?"right":"left"];o.onPointerGraceIntentChange({area:[{x:f.clientX+v,y:f.clientY},{x:b,y:d.top},{x,y:d.top},{x,y:d.bottom},{x:b,y:d.bottom}],side:g}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(f),f.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:Q(e.onKeyDown,f=>{var h;const d=o.searchRef.current!=="";e.disabled||d&&f.key===" "||UY[r.dir].includes(f.key)&&(n.onOpenChange(!0),(h=n.content)==null||h.focus(),f.preventDefault())})})})});qL.displayName=pu;var KL="MenuSubContent",WL=S.forwardRef((e,t)=>{const n=DL(Tr,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=ja(Tr,e.__scopeMenu),s=bd(Tr,e.__scopeMenu),a=FL(KL,e.__scopeMenu),l=S.useRef(null),c=Ie(t,l);return w.jsx(Rf.Provider,{scope:e.__scopeMenu,children:w.jsx(co,{present:r||o.open,children:w.jsx(Rf.Slot,{scope:e.__scopeMenu,children:w.jsx(aw,{id:a.contentId,"aria-labelledby":a.triggerId,...i,ref:c,align:"start",side:s.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{var f;s.isUsingKeyboardRef.current&&((f=l.current)==null||f.focus()),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:Q(e.onFocusOutside,u=>{u.target!==a.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:Q(e.onEscapeKeyDown,u=>{s.onClose(),u.preventDefault()}),onKeyDown:Q(e.onKeyDown,u=>{var h;const f=u.currentTarget.contains(u.target),d=VY[s.dir].includes(u.key);f&&d&&(o.onOpenChange(!1),(h=a.trigger)==null||h.focus(),u.preventDefault())})})})})})});WL.displayName=KL;function YL(e){return e?"open":"closed"}function om(e){return e==="indeterminate"}function uw(e){return om(e)?"indeterminate":e?"checked":"unchecked"}function cG(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function uG(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function fG(e,t,n){const i=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let s=uG(e,Math.max(o,0));i.length===1&&(s=s.filter(c=>c!==n));const l=s.find(c=>c.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function dG(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,s=t.length-1;o<t.length;s=o++){const a=t[o],l=t[s],c=a.x,u=a.y,f=l.x,d=l.y;u>r!=d>r&&n<(f-c)*(r-u)/(d-u)+c&&(i=!i)}return i}function hG(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return dG(n,t)}function Lf(e){return t=>t.pointerType==="mouse"?e(t):void 0}var pG=kL,mG=iw,gG=NL,vG=_L,yG=lw,bG=RL,xG=Fg,SG=jL,wG=IL,EG=BL,CG=$L,TG=UL,MG=VL,OG=qL,AG=WL,qg="DropdownMenu",[kG]=ms(qg,[OL]),wn=OL(),[DG,GL]=kG(qg),XL=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:o,onOpenChange:s,modal:a=!0}=e,l=wn(t),c=S.useRef(null),[u,f]=Xl({prop:i,defaultProp:o??!1,onChange:s,caller:qg});return w.jsx(DG,{scope:t,triggerId:ci(),triggerRef:c,contentId:ci(),open:u,onOpenChange:f,onOpenToggle:S.useCallback(()=>f(d=>!d),[f]),modal:a,children:w.jsx(pG,{...l,open:u,onOpenChange:f,dir:r,modal:a,children:n})})};XL.displayName=qg;var QL="DropdownMenuTrigger",JL=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,o=GL(QL,n),s=wn(n);return w.jsx(mG,{asChild:!0,...s,children:w.jsx(xe.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...i,ref:fg(t,o.triggerRef),onPointerDown:Q(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(o.onOpenToggle(),o.open||a.preventDefault())}),onKeyDown:Q(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&o.onOpenToggle(),a.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});JL.displayName=QL;var NG="DropdownMenuPortal",ZL=e=>{const{__scopeDropdownMenu:t,...n}=e,r=wn(t);return w.jsx(gG,{...r,...n})};ZL.displayName=NG;var ej="DropdownMenuContent",tj=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=GL(ej,n),o=wn(n),s=S.useRef(!1);return w.jsx(vG,{id:i.contentId,"aria-labelledby":i.triggerId,...o,...r,ref:t,onCloseAutoFocus:Q(e.onCloseAutoFocus,a=>{var l;s.current||(l=i.triggerRef.current)==null||l.focus(),s.current=!1,a.preventDefault()}),onInteractOutside:Q(e.onInteractOutside,a=>{const l=a.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,u=l.button===2||c;(!i.modal||u)&&(s.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});tj.displayName=ej;var _G="DropdownMenuGroup",RG=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=wn(n);return w.jsx(yG,{...i,...r,ref:t})});RG.displayName=_G;var LG="DropdownMenuLabel",jG=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=wn(n);return w.jsx(bG,{...i,...r,ref:t})});jG.displayName=LG;var zG="DropdownMenuItem",nj=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=wn(n);return w.jsx(xG,{...i,...r,ref:t})});nj.displayName=zG;var IG="DropdownMenuCheckboxItem",PG=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=wn(n);return w.jsx(SG,{...i,...r,ref:t})});PG.displayName=IG;var BG="DropdownMenuRadioGroup",HG=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=wn(n);return w.jsx(wG,{...i,...r,ref:t})});HG.displayName=BG;var $G="DropdownMenuRadioItem",UG=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=wn(n);return w.jsx(EG,{...i,...r,ref:t})});UG.displayName=$G;var VG="DropdownMenuItemIndicator",FG=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=wn(n);return w.jsx(CG,{...i,...r,ref:t})});FG.displayName=VG;var qG="DropdownMenuSeparator",KG=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=wn(n);return w.jsx(TG,{...i,...r,ref:t})});KG.displayName=qG;var WG="DropdownMenuArrow",YG=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=wn(n);return w.jsx(MG,{...i,...r,ref:t})});YG.displayName=WG;var GG="DropdownMenuSubTrigger",XG=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=wn(n);return w.jsx(OG,{...i,...r,ref:t})});XG.displayName=GG;var QG="DropdownMenuSubContent",JG=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=wn(n);return w.jsx(AG,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});JG.displayName=QG;var rj=XL,ij=JL,ZG=ZL,oj=tj,ah=nj;const eX=["horizontalRule"],tX=["horizontalRule"];function nX({wrapper:e,editor:t}){const[n,r]=S.useState(),[i,o]=S.useState(),s=()=>{try{if(!n)return{from:0,to:0,node:null};const{view:g,state:y}=t,v=g.posAtDOM(n,0),b=y.doc.resolve(v);let x=b.depth;for(;x>0&&!b.node(x).type.isBlock;)x--;let m,E,T;if(x>0)T=b.node(x),m=b.start(x),E=b.end(x);else{const C=b.index();T=y.doc.child(C);let O=0;for(let A=0;A<C;A++)O+=y.doc.child(A).nodeSize;m=O,E=m+T.nodeSize}return{from:m,to:E,node:T}}catch{return{from:0,to:0,node:null}}},a=()=>{if(!n)return;o(void 0);const{node:g,from:y,to:v}=s();g&&t.chain().deleteRange({from:y,to:v}).focus().run()},l=()=>{if(!n)return;o(void 0);const{view:g}=t,{from:y,to:v}=s();t.chain().focus().setNodeSelection(y).setParagraph().clearNodes().run(),t.commands.command(({tr:b})=>(b.removeMark(y,v),g.dispatch(b),!0))},c=()=>{if(!n)return;o(void 0);const{to:g,node:y}=s();y&&t.commands.insertContentAt(g,y.copy(y.content))},u=async()=>{if(!n)return;const{from:g}=s();t.chain().setNodeSelection(g).run(),document.execCommand("copy")};function f(){const g=document.querySelector(".ProseMirror .hovered-node");if(!g||!e.current)return;const y=e.current.getBoundingClientRect(),v=g.getBoundingClientRect();r(g),o(v.top-y.top+e.current.scrollTop)}if(S.useEffect(()=>(t.on("transaction",f),()=>{t.off("transaction",f)}),[t]),S.useEffect(()=>{if(e.current)return e.current.addEventListener("mousemove",f),()=>{var g;(g=e.current)==null||g.removeEventListener("mousemove",f)}},[e.current]),i===void 0)return null;const d=s().node,h=d&&!eX.includes(d.type.name),p=d&&!tX.includes(d.type.name);return w.jsxs(rj,{children:[w.jsx(ij,{asChild:!0,children:w.jsx("button",{style:{top:i},className:"btn btn-sm btn-square -translate-y-0.5 absolute top-0 left-2 h-6 w-6 opacity-0 group-hover:opacity-100",title:"Block options",children:w.jsx(zN,{className:"size-6"})})}),w.jsx(ZG,{children:w.jsxs(oj,{side:"bottom",sideOffset:5,className:"z-40 mr-2 flex flex-col gap-2 rounded bg-base-300 p-4",children:[h&&w.jsx(ah,{asChild:!0,children:w.jsxs("button",{className:"btn btn-sm btn-ghost justify-start",onClick:l,children:[w.jsx(s$,{className:"size-4"}),"Clear formatting"]})}),p&&w.jsx(ah,{asChild:!0,children:w.jsxs("button",{className:"btn btn-sm btn-ghost justify-start",onClick:u,children:[w.jsx(EH,{className:"size-4"}),"Copy to clipboard"]})}),w.jsx(ah,{asChild:!0,children:w.jsxs("button",{className:"btn btn-sm btn-ghost justify-start",onClick:c,children:[w.jsx(OH,{className:"size-4"}),"Duplicate"]})}),w.jsx("hr",{className:"border-neutral"}),w.jsx(ah,{asChild:!0,children:w.jsxs("button",{className:"btn btn-sm btn-ghost justify-start text-red-500",onClick:a,children:[w.jsx(IN,{className:"size-4"}),"Delete"]})})]})})]})}const rX="listItem",PM="textStyle",BM=/^\s*([-+*])\s$/,iX=Wr.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:e}){return["ul",it(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(rX,this.editor.getAttributes(PM)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=Df({find:BM,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=Df({find:BM,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(PM),editor:this.editor})),[e]}}),oX=Ye.create({name:"characterCount",addOptions(){return{limit:null,mode:"textSize",textCounter:e=>e.length,wordCounter:e=>e.split(" ").filter(t=>t!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=e=>{const t=(e==null?void 0:e.node)||this.editor.state.doc;if(((e==null?void 0:e.mode)||this.options.mode)==="textSize"){const r=t.textBetween(0,t.content.size,void 0," ");return this.options.textCounter(r)}return t.nodeSize},this.storage.words=e=>{const t=(e==null?void 0:e.node)||this.editor.state.doc,n=t.textBetween(0,t.content.size," "," ");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let e=!1;return[new Ge({key:new ut("characterCount"),appendTransaction:(t,n,r)=>{if(e)return;const i=this.options.limit;if(i==null||i===0){e=!0;return}const o=this.storage.characters({node:r.doc});if(o>i){const s=o-i,a=0,l=s;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);const c=r.tr.deleteRange(a,l);return e=!0,c}e=!0},filterTransaction:(t,n)=>{const r=this.options.limit;if(!t.docChanged||r===0||r===null||r===void 0)return!0;const i=this.storage.characters({node:n.doc}),o=this.storage.characters({node:t.doc});if(o<=r||i>r&&o>r&&o<=i)return!0;if(i>r&&o>r&&o>i||!t.getMeta("paste"))return!1;const a=t.selection.$head.pos,l=o-r,c=a-l,u=a;return t.deleteRange(c,u),!(this.storage.characters({node:t.doc})>r)}})]}}),sX=e=>{if(!e.children.length)return;const t=e.querySelectorAll("span");t&&t.forEach(n=>{var r,i;const o=n.getAttribute("style"),s=(i=(r=n.parentElement)===null||r===void 0?void 0:r.closest("span"))===null||i===void 0?void 0:i.getAttribute("style");n.setAttribute("style",`${s};${o}`)})},aX=In.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{},mergeNestedSpanStyles:!1}},parseHTML(){return[{tag:"span",getAttrs:e=>e.hasAttribute("style")?(this.options.mergeNestedSpanStyles&&sX(e),{}):!1}]},renderHTML({HTMLAttributes:e}){return["span",it(this.options.HTMLAttributes,e),0]},addCommands(){return{removeEmptyTextStyle:()=>({tr:e})=>{const{selection:t}=e;return e.doc.nodesBetween(t.from,t.to,(n,r)=>{if(n.isTextblock)return!0;n.marks.filter(i=>i.type===this.type).some(i=>Object.values(i.attrs).some(o=>!!o))||e.removeMark(r,r+n.nodeSize,this.type)}),!0}}}}),lX=Ye.create({name:"color",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:e=>{var t;return(t=e.style.color)===null||t===void 0?void 0:t.replace(/['"]+/g,"")},renderHTML:e=>e.color?{style:`color: ${e.color}`}:{}}}}]},addCommands(){return{setColor:e=>({chain:t})=>t().setMark("textStyle",{color:e}).run(),unsetColor:()=>({chain:e})=>e().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}}),cX=Ye.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new Ge({key:new ut("focus"),props:{decorations:({doc:e,selection:t})=>{const{isEditable:n,isFocused:r}=this.editor,{anchor:i}=t,o=[];if(!n||!r)return et.create(e,[]);let s=0;this.options.mode==="deepest"&&e.descendants((l,c)=>{if(l.isText)return;if(!(i>=c&&i<=c+l.nodeSize-1))return!1;s+=1});let a=0;return e.descendants((l,c)=>{if(l.isText||!(i>=c&&i<=c+l.nodeSize-1))return!1;if(a+=1,this.options.mode==="deepest"&&s-a>0||this.options.mode==="shallowest"&&a>1)return this.options.mode==="deepest";o.push(Xt.node(c,c+l.nodeSize,{class:this.options.className}))}),et.create(e,o)}}})]}}),uX=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,fX=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,dX=In.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:e=>e.getAttribute("data-color")||e.style.backgroundColor,renderHTML:e=>e.color?{"data-color":e.color,style:`background-color: ${e.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:e}){return["mark",it(this.options.HTMLAttributes,e),0]},addCommands(){return{setHighlight:e=>({commands:t})=>t.setMark(this.name,e),toggleHighlight:e=>({commands:t})=>t.toggleMark(this.name,e),unsetHighlight:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[xa({find:uX,type:this.type})]},addPasteRules(){return[fs({find:fX,type:this.type})]}}),hX="listItem",HM="textStyle",$M=/^(\d+)\.\s$/,pX=Wr.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:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1},type:{default:null,parseHTML:e=>e.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:e}){const{start:t,...n}=e;return t===1?["ol",it(this.options.HTMLAttributes,n),0]:["ol",it(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(hX,this.editor.getAttributes(HM)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=Df({find:$M,type:this.type,getAttributes:t=>({start:+t[1]}),joinPredicate:(t,n)=>n.childCount+n.attrs.start===+t[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(e=Df({find:$M,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:t=>({start:+t[1],...this.editor.getAttributes(HM)}),joinPredicate:(t,n)=>n.childCount+n.attrs.start===+t[1],editor:this.editor})),[e]}}),mX=Ye.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new Ge({key:new ut("placeholder"),props:{decorations:({doc:e,selection:t})=>{const n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=t,i=[];if(!n)return null;const o=this.editor.isEmpty;return e.descendants((s,a)=>{const l=r>=a&&r<=a+s.nodeSize,c=!s.isLeaf&&Bg(s);if((l||!this.options.showOnlyCurrent)&&c){const u=[this.options.emptyNodeClass];o&&u.push(this.options.emptyEditorClass);const f=Xt.node(a,a+s.nodeSize,{class:u.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:s,pos:a,hasAnchor:l}):this.options.placeholder});i.push(f)}return this.options.includeChildren}),et.create(e,i)}}})]}}),gX=/^\s*>\s$/,vX=Wr.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:e}){return["blockquote",it(this.options.HTMLAttributes,e),0]},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn(this.name),toggleBlockquote:()=>({commands:e})=>e.toggleWrap(this.name),unsetBlockquote:()=>({commands:e})=>e.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[Df({find:gX,type:this.type})]}}),yX=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,bX=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,xX=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,SX=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,wX=In.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:e=>e.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:e=>e.type.name===this.name},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}]},renderHTML({HTMLAttributes:e}){return["strong",it(this.options.HTMLAttributes,e),0]},addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[xa({find:yX,type:this.type}),xa({find:xX,type:this.type})]},addPasteRules(){return[fs({find:bX,type:this.type}),fs({find:SX,type:this.type})]}}),EX=/(^|[^`])`([^`]+)`(?!`)/,CX=/(^|[^`])`([^`]+)`(?!`)/g,TX=In.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:e}){return["code",it(this.options.HTMLAttributes,e),0]},addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[xa({find:EX,type:this.type})]},addPasteRules(){return[fs({find:CX,type:this.type})]}}),MX=/^```([a-z]+)?[\s\n]$/,OX=/^~~~([a-z]+)?[\s\n]$/,AX=Wr.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:e=>{var t;const{languageClassPrefix:n}=this.options,o=[...((t=e.firstElementChild)===null||t===void 0?void 0:t.classList)||[]].filter(s=>s.startsWith(n)).map(s=>s.replace(n,""))[0];return o||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:e,HTMLAttributes:t}){return["pre",it(this.options.HTMLAttributes,t),["code",{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:e,$anchor:t}=this.editor.state.selection,n=t.pos===1;return!e||t.parent.type.name!==this.name?!1:n||!t.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:t}=e,{selection:n}=t,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;const o=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith(`
441
+
442
+ `);return!o||!s?!1:e.chain().command(({tr:a})=>(a.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;const{state:t}=e,{selection:n,doc:r}=t,{$from:i,empty:o}=n;if(!o||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;const a=i.after();return a===void 0?!1:r.nodeAt(a)?e.commands.command(({tr:c})=>(c.setSelection(he.near(r.resolve(a))),!0)):e.commands.exitCode()}}},addInputRules(){return[Bb({find:MX,type:this.type,getAttributes:e=>({language:e[1]})}),Bb({find:OX,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new Ge({key:new ut("codeBlockVSCodeHandler"),props:{handlePaste:(e,t)=>{if(!t.clipboardData||this.editor.isActive(this.type.name))return!1;const n=t.clipboardData.getData("text/plain"),r=t.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,o=i==null?void 0:i.mode;if(!n||!o)return!1;const{tr:s,schema:a}=e.state,l=a.text(n.replace(/\r\n?/g,`
443
+ `));return s.replaceSelectionWith(this.type.create({language:o},l)),s.selection.$from.parent.type!==this.type&&s.setSelection(ne.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.setMeta("paste",!0),e.dispatch(s),!0}}})]}}),kX=Wr.create({name:"doc",topNode:!0,content:"block+"});function DX(e={}){return new Ge({view(t){return new NX(t,e)}})}class NX{constructor(t,n){var r;this.editorView=t,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let o=s=>{this[i](s)};return t.dom.addEventListener(i,o),{name:i,handler:o}})}destroy(){this.handlers.forEach(({name:t,handler:n})=>this.editorView.dom.removeEventListener(t,n))}update(t,n){this.cursorPos!=null&&n.doc!=t.state.doc&&(this.cursorPos>t.state.doc.content.size?this.setCursor(null):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),n=!t.parent.inlineContent,r,i=this.editorView.dom,o=i.getBoundingClientRect(),s=o.width/i.offsetWidth,a=o.height/i.offsetHeight;if(n){let f=t.nodeBefore,d=t.nodeAfter;if(f||d){let h=this.editorView.nodeDOM(this.cursorPos-(f?f.nodeSize:0));if(h){let p=h.getBoundingClientRect(),g=f?p.bottom:p.top;f&&d&&(g=(g+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let y=this.width/2*a;r={left:p.left,right:p.right,top:g-y,bottom:g+y}}}}if(!r){let f=this.editorView.coordsAtPos(this.cursorPos),d=this.width/2*s;r={left:f.left-d,right:f.left+d,top:f.top,bottom:f.bottom}}let l=this.editorView.dom.offsetParent;this.element||(this.element=l.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let c,u;if(!l||l==document.body&&getComputedStyle(l).position=="static")c=-pageXOffset,u=-pageYOffset;else{let f=l.getBoundingClientRect(),d=f.width/l.offsetWidth,h=f.height/l.offsetHeight;c=f.left-l.scrollLeft*d,u=f.top-l.scrollTop*h}this.element.style.left=(r.left-c)/s+"px",this.element.style.top=(r.top-u)/a+"px",this.element.style.width=(r.right-r.left)/s+"px",this.element.style.height=(r.bottom-r.top)/a+"px"}scheduleRemoval(t){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),t)}dragover(t){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:t.clientX,top:t.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),i=r&&r.type.spec.disableDropCursor,o=typeof i=="function"?i(this.editorView,n,t):i;if(n&&!o){let s=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=PR(this.editorView.state.doc,s,this.editorView.dragging.slice);a!=null&&(s=a)}this.setCursor(s),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(t){this.editorView.dom.contains(t.relatedTarget)||this.setCursor(null)}}const _X=Ye.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[DX(this.options)]}});class lt extends he{constructor(t){super(t,t)}map(t,n){let r=t.resolve(n.map(this.head));return lt.valid(r)?new lt(r):he.near(r)}content(){return W.empty}eq(t){return t instanceof lt&&t.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new lt(t.resolve(n.pos))}getBookmark(){return new fw(this.anchor)}static valid(t){let n=t.parent;if(n.inlineContent||!RX(t)||!LX(t))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let i=n.contentMatchAt(t.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(t,n,r=!1){e:for(;;){if(!r&&lt.valid(t))return t;let i=t.pos,o=null;for(let s=t.depth;;s--){let a=t.node(s);if(n>0?t.indexAfter(s)<a.childCount:t.index(s)>0){o=a.child(n>0?t.indexAfter(s):t.index(s)-1);break}else if(s==0)return null;i+=n;let l=t.doc.resolve(i);if(lt.valid(l))return l}for(;;){let s=n>0?o.firstChild:o.lastChild;if(!s){if(o.isAtom&&!o.isText&&!J.isSelectable(o)){t=t.doc.resolve(i+o.nodeSize*n),r=!1;continue e}break}o=s,i+=n;let a=t.doc.resolve(i);if(lt.valid(a))return a}return null}}}lt.prototype.visible=!1;lt.findFrom=lt.findGapCursorFrom;he.jsonID("gapcursor",lt);class fw{constructor(t){this.pos=t}map(t){return new fw(t.map(this.pos))}resolve(t){let n=t.resolve(this.pos);return lt.valid(n)?new lt(n):he.near(n)}}function sj(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}function RX(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||sj(i.type))return!0;if(i.inlineContent)return!1}}return!0}function LX(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||sj(i.type))return!0;if(i.inlineContent)return!1}}return!0}function jX(){return new Ge({props:{decorations:BX,createSelectionBetween(e,t,n){return t.pos==n.pos&&lt.valid(n)?new lt(n):null},handleClick:IX,handleKeyDown:zX,handleDOMEvents:{beforeinput:PX}}})}const zX=O3({ArrowLeft:lh("horiz",-1),ArrowRight:lh("horiz",1),ArrowUp:lh("vert",-1),ArrowDown:lh("vert",1)});function lh(e,t){const n=e=="vert"?t>0?"down":"up":t>0?"right":"left";return function(r,i,o){let s=r.selection,a=t>0?s.$to:s.$from,l=s.empty;if(s instanceof ne){if(!o.endOfTextblock(n)||a.depth==0)return!1;l=!1,a=r.doc.resolve(t>0?a.after():a.before())}let c=lt.findGapCursorFrom(a,t,l);return c?(i&&i(r.tr.setSelection(new lt(c))),!0):!1}}function IX(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!lt.valid(r))return!1;let i=e.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&J.isSelectable(e.state.doc.nodeAt(i.inside))?!1:(e.dispatch(e.state.tr.setSelection(new lt(r))),!0)}function PX(e,t){if(t.inputType!="insertCompositionText"||!(e.state.selection instanceof lt))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let i=B.empty;for(let s=r.length-1;s>=0;s--)i=B.from(r[s].createAndFill(null,i));let o=e.state.tr.replace(n.pos,n.pos,new W(i,0,0));return o.setSelection(ne.near(o.doc.resolve(n.pos+1))),e.dispatch(o),!1}function BX(e){if(!(e.selection instanceof lt))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",et.create(e.doc,[Xt.widget(e.selection.head,t,{key:"gapcursor"})])}const HX=Ye.create({name:"gapCursor",addProseMirrorPlugins(){return[jX()]},extendNodeSchema(e){var t;const n={name:e.name,options:e.options,storage:e.storage};return{allowGapCursor:(t=me(G(e,"allowGapCursor",n)))!==null&&t!==void 0?t:null}}}),$X=Wr.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:e}){return["br",it(this.options.HTMLAttributes,e)]},renderText(){return`
444
+ `},addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{const{selection:i,storedMarks:o}=n;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:s}=this.options,{splittableMarks:a}=r.extensionManager,l=o||i.$to.parentOffset&&i.$from.marks();return t().insertContent({type:this.name}).command(({tr:c,dispatch:u})=>{if(u&&l&&s){const f=l.filter(d=>a.includes(d.type.name));c.ensureMarks(f)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),UX=Wr.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(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,it(this.options.HTMLAttributes,t),0]},addCommands(){return{setHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.setNode(this.name,e):!1,toggleHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.toggleNode(this.name,"paragraph",e):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(e=>Bb({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}});var sm=200,Lt=function(){};Lt.prototype.append=function(t){return t.length?(t=Lt.from(t),!this.length&&t||t.length<sm&&this.leafAppend(t)||this.length<sm&&t.leafPrepend(this)||this.appendInner(t)):this};Lt.prototype.prepend=function(t){return t.length?Lt.from(t).append(this):this};Lt.prototype.appendInner=function(t){return new VX(this,t)};Lt.prototype.slice=function(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.length),t>=n?Lt.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,n))};Lt.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)};Lt.prototype.forEach=function(t,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(t,n,r,0):this.forEachInvertedInner(t,n,r,0)};Lt.prototype.map=function(t,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(o,s){return i.push(t(o,s))},n,r),i};Lt.from=function(t){return t instanceof Lt?t:t&&t.length?new aj(t):Lt.empty};var aj=function(e){function t(r){e.call(this),this.values=r}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(i,o){return i==0&&o==this.length?this:new t(this.values.slice(i,o))},t.prototype.getInner=function(i){return this.values[i]},t.prototype.forEachInner=function(i,o,s,a){for(var l=o;l<s;l++)if(i(this.values[l],a+l)===!1)return!1},t.prototype.forEachInvertedInner=function(i,o,s,a){for(var l=o-1;l>=s;l--)if(i(this.values[l],a+l)===!1)return!1},t.prototype.leafAppend=function(i){if(this.length+i.length<=sm)return new t(this.values.concat(i.flatten()))},t.prototype.leafPrepend=function(i){if(this.length+i.length<=sm)return new t(i.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(Lt);Lt.empty=new aj([]);var VX=function(e){function t(n,r){e.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},t.prototype.forEachInner=function(r,i,o,s){var a=this.left.length;if(i<a&&this.left.forEachInner(r,i,Math.min(o,a),s)===!1||o>a&&this.right.forEachInner(r,Math.max(i-a,0),Math.min(this.length,o)-a,s+a)===!1)return!1},t.prototype.forEachInvertedInner=function(r,i,o,s){var a=this.left.length;if(i>a&&this.right.forEachInvertedInner(r,i-a,Math.max(o,a)-a,s+a)===!1||o<a&&this.left.forEachInvertedInner(r,Math.min(i,a),o,s)===!1)return!1},t.prototype.sliceInner=function(r,i){if(r==0&&i==this.length)return this;var o=this.left.length;return i<=o?this.left.slice(r,i):r>=o?this.right.slice(r-o,i-o):this.left.slice(r,o).append(this.right.slice(0,i-o))},t.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new t(this.left,i)},t.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new t(i,this.right)},t.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new t(this.left,new t(this.right,r)):new t(this,r)},t}(Lt);const FX=500;class zr{constructor(t,n){this.items=t,this.eventCount=n}popEvent(t,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;n&&(i=this.remapping(r,this.items.length),o=i.maps.length);let s=t.tr,a,l,c=[],u=[];return this.items.forEach((f,d)=>{if(!f.step){i||(i=this.remapping(r,d+1),o=i.maps.length),o--,u.push(f);return}if(i){u.push(new Xr(f.map));let h=f.step.map(i.slice(o)),p;h&&s.maybeStep(h).doc&&(p=s.mapping.maps[s.mapping.maps.length-1],c.push(new Xr(p,void 0,void 0,c.length+u.length))),o--,p&&i.appendMap(p,o)}else s.maybeStep(f.step);if(f.selection)return a=i?f.selection.map(i.slice(o)):f.selection,l=new zr(this.items.slice(0,r).append(u.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:s,selection:a}}addTransform(t,n,r,i){let o=[],s=this.eventCount,a=this.items,l=!i&&a.length?a.get(a.length-1):null;for(let u=0;u<t.steps.length;u++){let f=t.steps[u].invert(t.docs[u]),d=new Xr(t.mapping.maps[u],f,n),h;(h=l&&l.merge(d))&&(d=h,u?o.pop():a=a.slice(0,a.length-1)),o.push(d),n&&(s++,n=void 0),i||(l=d)}let c=s-r.depth;return c>KX&&(a=qX(a,c),s-=c),new zr(a.append(o),s)}remapping(t,n){let r=new Ef;return this.items.forEach((i,o)=>{let s=i.mirrorOffset!=null&&o-i.mirrorOffset>=t?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,s)},t,n),r}addMaps(t){return this.eventCount==0?this:new zr(this.items.append(t.map(n=>new Xr(n))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),o=t.mapping,s=t.steps.length,a=this.eventCount;this.items.forEach(d=>{d.selection&&a--},i);let l=n;this.items.forEach(d=>{let h=o.getMirror(--l);if(h==null)return;s=Math.min(s,h);let p=o.maps[h];if(d.step){let g=t.steps[h].invert(t.docs[h]),y=d.selection&&d.selection.map(o.slice(l+1,h));y&&a++,r.push(new Xr(p,g,y))}else r.push(new Xr(p))},i);let c=[];for(let d=n;d<s;d++)c.push(new Xr(o.maps[d]));let u=this.items.slice(0,i).append(c).append(r),f=new zr(u,a);return f.emptyItemCount()>FX&&(f=f.compress(this.items.length-r.length)),f}emptyItemCount(){let t=0;return this.items.forEach(n=>{n.step||t++}),t}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,i=[],o=0;return this.items.forEach((s,a)=>{if(a>=t)i.push(s),s.selection&&o++;else if(s.step){let l=s.step.map(n.slice(r)),c=l&&l.getMap();if(r--,c&&n.appendMap(c,r),l){let u=s.selection&&s.selection.map(n.slice(r));u&&o++;let f=new Xr(c.invert(),l,u),d,h=i.length-1;(d=i.length&&i[h].merge(f))?i[h]=d:i.push(f)}}else s.map&&r--},this.items.length,0),new zr(Lt.from(i.reverse()),o)}}zr.empty=new zr(Lt.empty,0);function qX(e,t){let n;return e.forEach((r,i)=>{if(r.selection&&t--==0)return n=i,!1}),e.slice(n)}class Xr{constructor(t,n,r,i){this.map=t,this.step=n,this.selection=r,this.mirrorOffset=i}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new Xr(n.getMap().invert(),n,this.selection)}}}class Eo{constructor(t,n,r,i,o){this.done=t,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}const KX=20;function WX(e,t,n,r){let i=n.getMeta(ia),o;if(i)return i.historyState;n.getMeta(XX)&&(e=new Eo(e.done,e.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(n.steps.length==0)return e;if(s&&s.getMeta(ia))return s.getMeta(ia).redo?new Eo(e.done.addTransform(n,void 0,r,qh(t)),e.undone,UM(n.mapping.maps),e.prevTime,e.prevComposition):new Eo(e.done,e.undone.addTransform(n,void 0,r,qh(t)),null,e.prevTime,e.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let a=n.getMeta("composition"),l=e.prevTime==0||!s&&e.prevComposition!=a&&(e.prevTime<(n.time||0)-r.newGroupDelay||!YX(n,e.prevRanges)),c=s?Ty(e.prevRanges,n.mapping):UM(n.mapping.maps);return new Eo(e.done.addTransform(n,l?t.selection.getBookmark():void 0,r,qh(t)),zr.empty,c,n.time,a??e.prevComposition)}else return(o=n.getMeta("rebased"))?new Eo(e.done.rebased(n,o),e.undone.rebased(n,o),Ty(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new Eo(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),Ty(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function YX(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((r,i)=>{for(let o=0;o<t.length;o+=2)r<=t[o+1]&&i>=t[o]&&(n=!0)}),n}function UM(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((r,i,o,s)=>t.push(o,s));return t}function Ty(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),o=t.map(e[r+1],-1);i<=o&&n.push(i,o)}return n}function GX(e,t,n){let r=qh(t),i=ia.get(t).spec.config,o=(n?e.undone:e.done).popEvent(t,r);if(!o)return null;let s=o.selection.resolve(o.transform.doc),a=(n?e.done:e.undone).addTransform(o.transform,t.selection.getBookmark(),i,r),l=new Eo(n?a:o.remaining,n?o.remaining:a,null,0,-1);return o.transform.setSelection(s).setMeta(ia,{redo:n,historyState:l})}let My=!1,VM=null;function qh(e){let t=e.plugins;if(VM!=t){My=!1,VM=t;for(let n=0;n<t.length;n++)if(t[n].spec.historyPreserveItems){My=!0;break}}return My}const ia=new ut("history"),XX=new ut("closeHistory");function QX(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new Ge({key:ia,state:{init(){return new Eo(zr.empty,zr.empty,null,0,-1)},apply(t,n,r){return WX(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(t,n){let r=n.inputType,i=r=="historyUndo"?cj:r=="historyRedo"?uj:null;return!i||!t.editable?!1:(n.preventDefault(),i(t.state,t.dispatch))}}}})}function lj(e,t){return(n,r)=>{let i=ia.getState(n);if(!i||(e?i.undone:i.done).eventCount==0)return!1;if(r){let o=GX(i,n,e);o&&r(t?o.scrollIntoView():o)}return!0}}const cj=lj(!1,!0),uj=lj(!0,!0),JX=Ye.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>cj(e,t),redo:()=>({state:e,dispatch:t})=>uj(e,t)}},addProseMirrorPlugins(){return[QX(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()}}}),ZX=Wr.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:e}){return["hr",it(this.options.HTMLAttributes,e)]},addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{if(!OK(t,t.schema.nodes[this.name]))return!1;const{selection:n}=t,{$from:r,$to:i}=n,o=e();return r.parentOffset===0?o.insertContentAt({from:Math.max(r.pos-1,0),to:i.pos},{type:this.name}):X3(n)?o.insertContentAt(i.pos,{type:this.name}):o.insertContent({type:this.name}),o.command(({tr:s,dispatch:a})=>{var l;if(a){const{$to:c}=s.selection,u=c.end();if(c.nodeAfter)c.nodeAfter.isTextblock?s.setSelection(ne.create(s.doc,c.pos+1)):c.nodeAfter.isBlock?s.setSelection(J.create(s.doc,c.pos)):s.setSelection(ne.create(s.doc,c.pos));else{const f=(l=c.parent.type.contentMatch.defaultType)===null||l===void 0?void 0:l.create();f&&(s.insert(u,f),s.setSelection(ne.create(s.doc,u+1)))}s.scrollIntoView()}return!0}).run()}}},addInputRules(){return[MK({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),eQ=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,tQ=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,nQ=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,rQ=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,iQ=In.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:e=>e.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:e=>e.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:e}){return["em",it(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[xa({find:eQ,type:this.type}),xa({find:nQ,type:this.type})]},addPasteRules(){return[fs({find:tQ,type:this.type}),fs({find:rQ,type:this.type})]}}),oQ=Wr.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:e}){return["li",it(this.options.HTMLAttributes,e),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),sQ=Wr.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:e}){return["p",it(this.options.HTMLAttributes,e),0]},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),aQ=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,lQ=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,cQ=In.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:e=>e.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:e}){return["s",it(this.options.HTMLAttributes,e),0]},addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[xa({find:aQ,type:this.type})]},addPasteRules(){return[fs({find:lQ,type:this.type})]}}),uQ=Wr.create({name:"text",group:"inline"}),fQ=Ye.create({name:"starterKit",addExtensions(){const e=[];return this.options.bold!==!1&&e.push(wX.configure(this.options.bold)),this.options.blockquote!==!1&&e.push(vX.configure(this.options.blockquote)),this.options.bulletList!==!1&&e.push(iX.configure(this.options.bulletList)),this.options.code!==!1&&e.push(TX.configure(this.options.code)),this.options.codeBlock!==!1&&e.push(AX.configure(this.options.codeBlock)),this.options.document!==!1&&e.push(kX.configure(this.options.document)),this.options.dropcursor!==!1&&e.push(_X.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&e.push(HX.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&e.push($X.configure(this.options.hardBreak)),this.options.heading!==!1&&e.push(UX.configure(this.options.heading)),this.options.history!==!1&&e.push(JX.configure(this.options.history)),this.options.horizontalRule!==!1&&e.push(ZX.configure(this.options.horizontalRule)),this.options.italic!==!1&&e.push(iQ.configure(this.options.italic)),this.options.listItem!==!1&&e.push(oQ.configure(this.options.listItem)),this.options.orderedList!==!1&&e.push(pX.configure(this.options.orderedList)),this.options.paragraph!==!1&&e.push(sQ.configure(this.options.paragraph)),this.options.strike!==!1&&e.push(cQ.configure(this.options.strike)),this.options.text!==!1&&e.push(uQ.configure(this.options.text)),e}}),dQ=In.create({name:"subscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sub"},{style:"vertical-align",getAttrs(e){return e!=="sub"?!1:null}}]},renderHTML({HTMLAttributes:e}){return["sub",it(this.options.HTMLAttributes,e),0]},addCommands(){return{setSubscript:()=>({commands:e})=>e.setMark(this.name),toggleSubscript:()=>({commands:e})=>e.toggleMark(this.name),unsetSubscript:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-,":()=>this.editor.commands.toggleSubscript()}}}),hQ=In.create({name:"superscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sup"},{style:"vertical-align",getAttrs(e){return e!=="super"?!1:null}}]},renderHTML({HTMLAttributes:e}){return["sup",it(this.options.HTMLAttributes,e),0]},addCommands(){return{setSuperscript:()=>({commands:e})=>e.setMark(this.name),toggleSuperscript:()=>({commands:e})=>e.toggleMark(this.name),unsetSuperscript:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}}),pQ=Ye.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:e=>{const t=e.style.textAlign;return this.options.alignments.includes(t)?t:this.options.defaultAlignment},renderHTML:e=>e.textAlign?{style:`text-align: ${e.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:e=>({commands:t})=>this.options.alignments.includes(e)?this.options.types.map(n=>t.updateAttributes(n,{textAlign:e})).every(n=>n):!1,unsetTextAlign:()=>({commands:e})=>this.options.types.map(t=>e.resetAttributes(t,"textAlign")).every(t=>t),toggleTextAlign:e=>({editor:t,commands:n})=>this.options.alignments.includes(e)?t.isActive({textAlign:e})?n.unsetTextAlign():n.setTextAlign(e):!1}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),mQ=e=>ft({find:/--$/,replace:e??"—"}),gQ=e=>ft({find:/\.\.\.$/,replace:e??"…"}),vQ=e=>ft({find:/(?:^|[\s{[(<'"\u2018\u201C])(")$/,replace:e??"“"}),yQ=e=>ft({find:/"$/,replace:e??"”"}),bQ=e=>ft({find:/(?:^|[\s{[(<'"\u2018\u201C])(')$/,replace:e??"‘"}),xQ=e=>ft({find:/'$/,replace:e??"’"}),SQ=e=>ft({find:/<-$/,replace:e??"←"}),wQ=e=>ft({find:/->$/,replace:e??"→"}),EQ=e=>ft({find:/\(c\)$/,replace:e??"©"}),CQ=e=>ft({find:/\(tm\)$/,replace:e??"™"}),TQ=e=>ft({find:/\(sm\)$/,replace:e??"℠"}),MQ=e=>ft({find:/\(r\)$/,replace:e??"®"}),OQ=e=>ft({find:/(?:^|\s)(1\/2)\s$/,replace:e??"½"}),AQ=e=>ft({find:/\+\/-$/,replace:e??"±"}),kQ=e=>ft({find:/!=$/,replace:e??"≠"}),DQ=e=>ft({find:/<<$/,replace:e??"«"}),NQ=e=>ft({find:/>>$/,replace:e??"»"}),_Q=e=>ft({find:/\d+\s?([*x])\s?\d+$/,replace:e??"×"}),RQ=e=>ft({find:/\^2$/,replace:e??"²"}),LQ=e=>ft({find:/\^3$/,replace:e??"³"}),jQ=e=>ft({find:/(?:^|\s)(1\/4)\s$/,replace:e??"¼"}),zQ=e=>ft({find:/(?:^|\s)(3\/4)\s$/,replace:e??"¾"}),IQ=Ye.create({name:"typography",addOptions(){return{closeDoubleQuote:"”",closeSingleQuote:"’",copyright:"©",ellipsis:"…",emDash:"—",laquo:"«",leftArrow:"←",multiplication:"×",notEqual:"≠",oneHalf:"½",oneQuarter:"¼",openDoubleQuote:"“",openSingleQuote:"‘",plusMinus:"±",raquo:"»",registeredTrademark:"®",rightArrow:"→",servicemark:"℠",superscriptThree:"³",superscriptTwo:"²",threeQuarters:"¾",trademark:"™"}},addInputRules(){const e=[];return this.options.emDash!==!1&&e.push(mQ(this.options.emDash)),this.options.ellipsis!==!1&&e.push(gQ(this.options.ellipsis)),this.options.openDoubleQuote!==!1&&e.push(vQ(this.options.openDoubleQuote)),this.options.closeDoubleQuote!==!1&&e.push(yQ(this.options.closeDoubleQuote)),this.options.openSingleQuote!==!1&&e.push(bQ(this.options.openSingleQuote)),this.options.closeSingleQuote!==!1&&e.push(xQ(this.options.closeSingleQuote)),this.options.leftArrow!==!1&&e.push(SQ(this.options.leftArrow)),this.options.rightArrow!==!1&&e.push(wQ(this.options.rightArrow)),this.options.copyright!==!1&&e.push(EQ(this.options.copyright)),this.options.trademark!==!1&&e.push(CQ(this.options.trademark)),this.options.servicemark!==!1&&e.push(TQ(this.options.servicemark)),this.options.registeredTrademark!==!1&&e.push(MQ(this.options.registeredTrademark)),this.options.oneHalf!==!1&&e.push(OQ(this.options.oneHalf)),this.options.plusMinus!==!1&&e.push(AQ(this.options.plusMinus)),this.options.notEqual!==!1&&e.push(kQ(this.options.notEqual)),this.options.laquo!==!1&&e.push(DQ(this.options.laquo)),this.options.raquo!==!1&&e.push(NQ(this.options.raquo)),this.options.multiplication!==!1&&e.push(_Q(this.options.multiplication)),this.options.superscriptTwo!==!1&&e.push(RQ(this.options.superscriptTwo)),this.options.superscriptThree!==!1&&e.push(LQ(this.options.superscriptThree)),this.options.oneQuarter!==!1&&e.push(jQ(this.options.oneQuarter)),this.options.threeQuarters!==!1&&e.push(zQ(this.options.threeQuarters)),e}}),PQ=In.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:e=>e.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:e}){return["u",it(this.options.HTMLAttributes,e),0]},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),BQ=Ye.create({name:"hoveredNode",addProseMirrorPlugins(){let e=null;return[new Ge({key:new ut("hoveredNode"),props:{handleDOMEvents:{mousemove(t,n){const r={left:n.clientX,top:n.clientY},i=t.posAtCoords(r);if(!i)return e=null,t.dispatch(t.state.tr),!1;const o=t.state.doc.resolve(i.pos),s=o.node(o.depth);if(!s||!s.isBlock)return e=null,t.dispatch(t.state.tr),!1;let a;return o.depth>0?a=o.before(o.depth):a=o.pos,e!==a&&(e=a,t.dispatch(t.state.tr)),!1},mouseleave(t){return e=null,t.dispatch(t.state.tr),!1}},decorations(t){if(e===null||e<0||e>t.doc.content.size)return null;let n;try{n=t.doc.resolve(e)}catch{return null}const r=n.nodeAfter||n.nodeBefore;return!r||!r.isBlock?null:et.create(t.doc,[Xt.node(e,e+r.nodeSize,{class:"hovered-node"})])}}})]}}),HQ="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",$Q="ελ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",Yb="numeric",Gb="ascii",Xb="alpha",Vu="asciinumeric",mu="alphanumeric",Qb="domain",fj="emoji",UQ="scheme",VQ="slashscheme",Oy="whitespace";function FQ(e,t){return e in t||(t[e]=[]),t[e]}function Ws(e,t,n){t[Yb]&&(t[Vu]=!0,t[mu]=!0),t[Gb]&&(t[Vu]=!0,t[Xb]=!0),t[Vu]&&(t[mu]=!0),t[Xb]&&(t[mu]=!0),t[mu]&&(t[Qb]=!0),t[fj]&&(t[Qb]=!0);for(const r in t){const i=FQ(r,n);i.indexOf(e)<0&&i.push(e)}}function qQ(e,t){const n={};for(const r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}function Nn(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}Nn.groups={};Nn.prototype={accepts(){return!!this.t},go(e){const t=this,n=t.j[e];if(n)return n;for(let r=0;r<t.jr.length;r++){const i=t.jr[r][0],o=t.jr[r][1];if(o&&i.test(e))return o}return t.jd},has(e,t=!1){return t?e in this.j:!!this.go(e)},ta(e,t,n,r){for(let i=0;i<e.length;i++)this.tt(e[i],t,n,r)},tr(e,t,n,r){r=r||Nn.groups;let i;return t&&t.j?i=t:(i=new Nn(t),n&&r&&Ws(t,n,r)),this.jr.push([e,i]),i},ts(e,t,n,r){let i=this;const o=e.length;if(!o)return i;for(let s=0;s<o-1;s++)i=i.tt(e[s]);return i.tt(e[o-1],t,n,r)},tt(e,t,n,r){r=r||Nn.groups;const i=this;if(t&&t.j)return i.j[e]=t,t;const o=t;let s,a=i.go(e);if(a?(s=new Nn,Object.assign(s.j,a.j),s.jr.push.apply(s.jr,a.jr),s.jd=a.jd,s.t=a.t):s=new Nn,o){if(r)if(s.t&&typeof s.t=="string"){const l=Object.assign(qQ(s.t,r),n);Ws(o,l,r)}else n&&Ws(o,n,r);s.t=o}return i.j[e]=s,s}};const fe=(e,t,n,r,i)=>e.ta(t,n,r,i),ot=(e,t,n,r,i)=>e.tr(t,n,r,i),FM=(e,t,n,r,i)=>e.ts(t,n,r,i),$=(e,t,n,r,i)=>e.tt(t,n,r,i),_i="WORD",Jb="UWORD",dj="ASCIINUMERICAL",hj="ALPHANUMERICAL",jf="LOCALHOST",Zb="TLD",e1="UTLD",Kh="SCHEME",ol="SLASH_SCHEME",dw="NUM",t1="WS",hw="NL",Fu="OPENBRACE",qu="CLOSEBRACE",am="OPENBRACKET",lm="CLOSEBRACKET",cm="OPENPAREN",um="CLOSEPAREN",fm="OPENANGLEBRACKET",dm="CLOSEANGLEBRACKET",hm="FULLWIDTHLEFTPAREN",pm="FULLWIDTHRIGHTPAREN",mm="LEFTCORNERBRACKET",gm="RIGHTCORNERBRACKET",vm="LEFTWHITECORNERBRACKET",ym="RIGHTWHITECORNERBRACKET",bm="FULLWIDTHLESSTHAN",xm="FULLWIDTHGREATERTHAN",Sm="AMPERSAND",wm="APOSTROPHE",Em="ASTERISK",Co="AT",Cm="BACKSLASH",Tm="BACKTICK",Mm="CARET",Do="COLON",pw="COMMA",Om="DOLLAR",Qr="DOT",Am="EQUALS",mw="EXCLAMATION",ar="HYPHEN",Ku="PERCENT",km="PIPE",Dm="PLUS",Nm="POUND",Wu="QUERY",gw="QUOTE",pj="FULLWIDTHMIDDLEDOT",vw="SEMI",Jr="SLASH",Yu="TILDE",_m="UNDERSCORE",mj="EMOJI",Rm="SYM";var gj=Object.freeze({__proto__:null,ALPHANUMERICAL:hj,AMPERSAND:Sm,APOSTROPHE:wm,ASCIINUMERICAL:dj,ASTERISK:Em,AT:Co,BACKSLASH:Cm,BACKTICK:Tm,CARET:Mm,CLOSEANGLEBRACKET:dm,CLOSEBRACE:qu,CLOSEBRACKET:lm,CLOSEPAREN:um,COLON:Do,COMMA:pw,DOLLAR:Om,DOT:Qr,EMOJI:mj,EQUALS:Am,EXCLAMATION:mw,FULLWIDTHGREATERTHAN:xm,FULLWIDTHLEFTPAREN:hm,FULLWIDTHLESSTHAN:bm,FULLWIDTHMIDDLEDOT:pj,FULLWIDTHRIGHTPAREN:pm,HYPHEN:ar,LEFTCORNERBRACKET:mm,LEFTWHITECORNERBRACKET:vm,LOCALHOST:jf,NL:hw,NUM:dw,OPENANGLEBRACKET:fm,OPENBRACE:Fu,OPENBRACKET:am,OPENPAREN:cm,PERCENT:Ku,PIPE:km,PLUS:Dm,POUND:Nm,QUERY:Wu,QUOTE:gw,RIGHTCORNERBRACKET:gm,RIGHTWHITECORNERBRACKET:ym,SCHEME:Kh,SEMI:vw,SLASH:Jr,SLASH_SCHEME:ol,SYM:Rm,TILDE:Yu,TLD:Zb,UNDERSCORE:_m,UTLD:e1,UWORD:Jb,WORD:_i,WS:t1});const ki=/[a-z]/,$c=new RegExp("\\p{L}","u"),Ay=new RegExp("\\p{Emoji}","u"),Di=/\d/,ky=/\s/,qM="\r",Dy=`
445
+ `,KQ="️",WQ="‍",Ny="";let ch=null,uh=null;function YQ(e=[]){const t={};Nn.groups=t;const n=new Nn;ch==null&&(ch=KM(HQ)),uh==null&&(uh=KM($Q)),$(n,"'",wm),$(n,"{",Fu),$(n,"}",qu),$(n,"[",am),$(n,"]",lm),$(n,"(",cm),$(n,")",um),$(n,"<",fm),$(n,">",dm),$(n,"(",hm),$(n,")",pm),$(n,"「",mm),$(n,"」",gm),$(n,"『",vm),$(n,"』",ym),$(n,"<",bm),$(n,">",xm),$(n,"&",Sm),$(n,"*",Em),$(n,"@",Co),$(n,"`",Tm),$(n,"^",Mm),$(n,":",Do),$(n,",",pw),$(n,"$",Om),$(n,".",Qr),$(n,"=",Am),$(n,"!",mw),$(n,"-",ar),$(n,"%",Ku),$(n,"|",km),$(n,"+",Dm),$(n,"#",Nm),$(n,"?",Wu),$(n,'"',gw),$(n,"/",Jr),$(n,";",vw),$(n,"~",Yu),$(n,"_",_m),$(n,"\\",Cm),$(n,"・",pj);const r=ot(n,Di,dw,{[Yb]:!0});ot(r,Di,r);const i=ot(r,ki,dj,{[Vu]:!0}),o=ot(r,$c,hj,{[mu]:!0}),s=ot(n,ki,_i,{[Gb]:!0});ot(s,Di,i),ot(s,ki,s),ot(i,Di,i),ot(i,ki,i);const a=ot(n,$c,Jb,{[Xb]:!0});ot(a,ki),ot(a,Di,o),ot(a,$c,a),ot(o,Di,o),ot(o,ki),ot(o,$c,o);const l=$(n,Dy,hw,{[Oy]:!0}),c=$(n,qM,t1,{[Oy]:!0}),u=ot(n,ky,t1,{[Oy]:!0});$(n,Ny,u),$(c,Dy,l),$(c,Ny,u),ot(c,ky,u),$(u,qM),$(u,Dy),ot(u,ky,u),$(u,Ny,u);const f=ot(n,Ay,mj,{[fj]:!0});$(f,"#"),ot(f,Ay,f),$(f,KQ,f);const d=$(f,WQ);$(d,"#"),ot(d,Ay,f);const h=[[ki,s],[Di,i]],p=[[ki,null],[$c,a],[Di,o]];for(let g=0;g<ch.length;g++)po(n,ch[g],Zb,_i,h);for(let g=0;g<uh.length;g++)po(n,uh[g],e1,Jb,p);Ws(Zb,{tld:!0,ascii:!0},t),Ws(e1,{utld:!0,alpha:!0},t),po(n,"file",Kh,_i,h),po(n,"mailto",Kh,_i,h),po(n,"http",ol,_i,h),po(n,"https",ol,_i,h),po(n,"ftp",ol,_i,h),po(n,"ftps",ol,_i,h),Ws(Kh,{scheme:!0,ascii:!0},t),Ws(ol,{slashscheme:!0,ascii:!0},t),e=e.sort((g,y)=>g[0]>y[0]?1:-1);for(let g=0;g<e.length;g++){const y=e[g][0],b=e[g][1]?{[UQ]:!0}:{[VQ]:!0};y.indexOf("-")>=0?b[Qb]=!0:ki.test(y)?Di.test(y)?b[Vu]=!0:b[Gb]=!0:b[Yb]=!0,FM(n,y,y,b)}return FM(n,"localhost",jf,{ascii:!0}),n.jd=new Nn(Rm),{start:n,tokens:Object.assign({groups:t},gj)}}function vj(e,t){const n=GQ(t.replace(/[A-Z]/g,a=>a.toLowerCase())),r=n.length,i=[];let o=0,s=0;for(;s<r;){let a=e,l=null,c=0,u=null,f=-1,d=-1;for(;s<r&&(l=a.go(n[s]));)a=l,a.accepts()?(f=0,d=0,u=a):f>=0&&(f+=n[s].length,d++),c+=n[s].length,o+=n[s].length,s++;o-=f,s-=d,c-=f,i.push({t:u.t,v:t.slice(o-c,o),s:o-c,e:o})}return i}function GQ(e){const t=[],n=e.length;let r=0;for(;r<n;){let i=e.charCodeAt(r),o,s=i<55296||i>56319||r+1===n||(o=e.charCodeAt(r+1))<56320||o>57343?e[r]:e.slice(r,r+2);t.push(s),r+=s.length}return t}function po(e,t,n,r,i){let o;const s=t.length;for(let a=0;a<s-1;a++){const l=t[a];e.j[l]?o=e.j[l]:(o=new Nn(r),o.jr=i.slice(),e.j[l]=o),e=o}return o=new Nn(n),o.jr=i.slice(),e.j[t[s-1]]=o,o}function KM(e){const t=[],n=[];let r=0,i="0123456789";for(;r<e.length;){let o=0;for(;i.indexOf(e[r+o])>=0;)o++;if(o>0){t.push(n.join(""));for(let s=parseInt(e.substring(r,r+o),10);s>0;s--)n.pop();r+=o}else n.push(e[r]),r++}return t}const zf={defaultProtocol:"http",events:null,format:WM,formatHref:WM,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function yw(e,t=null){let n=Object.assign({},zf);e&&(n=Object.assign(n,e instanceof yw?e.o:e));const r=n.ignoreTags,i=[];for(let o=0;o<r.length;o++)i.push(r[o].toUpperCase());this.o=n,t&&(this.defaultRender=t),this.ignoreTags=i}yw.prototype={o:zf,ignoreTags:[],defaultRender(e){return e},check(e){return this.get("validate",e.toString(),e)},get(e,t,n){const r=t!=null;let i=this.o[e];return i&&(typeof i=="object"?(i=n.t in i?i[n.t]:zf[e],typeof i=="function"&&r&&(i=i(t,n))):typeof i=="function"&&r&&(i=i(t,n.t,n)),i)},getObj(e,t,n){let r=this.o[e];return typeof r=="function"&&t!=null&&(r=r(t,n.t,n)),r},render(e){const t=e.render(this);return(this.get("render",null,e)||this.defaultRender)(t,e.t,e)}};function WM(e){return e}function yj(e,t){this.t="token",this.v=e,this.tk=t}yj.prototype={isLink:!1,toString(){return this.v},toHref(e){return this.toString()},toFormattedString(e){const t=this.toString(),n=e.get("truncate",t,this),r=e.get("format",t,this);return n&&r.length>n?r.substring(0,n)+"…":r},toFormattedHref(e){return e.get("formatHref",this.toHref(e.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(e=zf.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate(e){return e.get("validate",this.toString(),this)},render(e){const t=this,n=this.toHref(e.get("defaultProtocol")),r=e.get("formatHref",n,this),i=e.get("tagName",n,t),o=this.toFormattedString(e),s={},a=e.get("className",n,t),l=e.get("target",n,t),c=e.get("rel",n,t),u=e.getObj("attributes",n,t),f=e.getObj("events",n,t);return s.href=r,a&&(s.class=a),l&&(s.target=l),c&&(s.rel=c),u&&Object.assign(s,u),{tagName:i,attributes:s,content:o,eventListeners:f}}};function Kg(e,t){class n extends yj{constructor(i,o){super(i,o),this.t=e}}for(const r in t)n.prototype[r]=t[r];return n.t=e,n}const YM=Kg("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),GM=Kg("text"),XQ=Kg("nl"),fh=Kg("url",{isLink:!0,toHref(e=zf.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){const e=this.tk;return e.length>=2&&e[0].t!==jf&&e[1].t===Do}}),or=e=>new Nn(e);function QQ({groups:e}){const t=e.domain.concat([Sm,Em,Co,Cm,Tm,Mm,Om,Am,ar,dw,Ku,km,Dm,Nm,Jr,Rm,Yu,_m]),n=[wm,Do,pw,Qr,mw,Ku,Wu,gw,vw,fm,dm,Fu,qu,lm,am,cm,um,hm,pm,mm,gm,vm,ym,bm,xm],r=[Sm,wm,Em,Cm,Tm,Mm,Om,Am,ar,Fu,qu,Ku,km,Dm,Nm,Wu,Jr,Rm,Yu,_m],i=or(),o=$(i,Yu);fe(o,r,o),fe(o,e.domain,o);const s=or(),a=or(),l=or();fe(i,e.domain,s),fe(i,e.scheme,a),fe(i,e.slashscheme,l),fe(s,r,o),fe(s,e.domain,s);const c=$(s,Co);$(o,Co,c),$(a,Co,c),$(l,Co,c);const u=$(o,Qr);fe(u,r,o),fe(u,e.domain,o);const f=or();fe(c,e.domain,f),fe(f,e.domain,f);const d=$(f,Qr);fe(d,e.domain,f);const h=or(YM);fe(d,e.tld,h),fe(d,e.utld,h),$(c,jf,h);const p=$(f,ar);$(p,ar,p),fe(p,e.domain,f),fe(h,e.domain,f),$(h,Qr,d),$(h,ar,p);const g=$(h,Do);fe(g,e.numeric,YM);const y=$(s,ar),v=$(s,Qr);$(y,ar,y),fe(y,e.domain,s),fe(v,r,o),fe(v,e.domain,s);const b=or(fh);fe(v,e.tld,b),fe(v,e.utld,b),fe(b,e.domain,s),fe(b,r,o),$(b,Qr,v),$(b,ar,y),$(b,Co,c);const x=$(b,Do),m=or(fh);fe(x,e.numeric,m);const E=or(fh),T=or();fe(E,t,E),fe(E,n,T),fe(T,t,E),fe(T,n,T),$(b,Jr,E),$(m,Jr,E);const C=$(a,Do),O=$(l,Do),A=$(O,Jr),k=$(A,Jr);fe(a,e.domain,s),$(a,Qr,v),$(a,ar,y),fe(l,e.domain,s),$(l,Qr,v),$(l,ar,y),fe(C,e.domain,E),$(C,Jr,E),$(C,Wu,E),fe(k,e.domain,E),fe(k,t,E),$(k,Jr,E);const z=[[Fu,qu],[am,lm],[cm,um],[fm,dm],[hm,pm],[mm,gm],[vm,ym],[bm,xm]];for(let _=0;_<z.length;_++){const[H,U]=z[_],V=$(E,H);$(T,H,V),$(V,U,E);const D=or(fh);fe(V,t,D);const I=or();fe(V,n),fe(D,t,D),fe(D,n,I),fe(I,t,D),fe(I,n,I),$(D,U,E),$(I,U,E)}return $(i,jf,b),$(i,hw,XQ),{start:i,tokens:gj}}function JQ(e,t,n){let r=n.length,i=0,o=[],s=[];for(;i<r;){let a=e,l=null,c=null,u=0,f=null,d=-1;for(;i<r&&!(l=a.go(n[i].t));)s.push(n[i++]);for(;i<r&&(c=l||a.go(n[i].t));)l=null,a=c,a.accepts()?(d=0,f=a):d>=0&&d++,i++,u++;if(d<0)i-=u,i<r&&(s.push(n[i]),i++);else{s.length>0&&(o.push(_y(GM,t,s)),s=[]),i-=d,u-=d;const h=f.t,p=n.slice(i-u,i);o.push(_y(h,t,p))}}return s.length>0&&o.push(_y(GM,t,s)),o}function _y(e,t,n){const r=n[0].s,i=n[n.length-1].e,o=t.slice(r,i);return new e(o,n)}const ZQ=typeof console<"u"&&console&&console.warn||(()=>{}),eJ="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",Je={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function tJ(){return Nn.groups={},Je.scanner=null,Je.parser=null,Je.tokenQueue=[],Je.pluginQueue=[],Je.customSchemes=[],Je.initialized=!1,Je}function XM(e,t=!1){if(Je.initialized&&ZQ(`linkifyjs: already initialized - will not register custom scheme "${e}" ${eJ}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw new Error(`linkifyjs: incorrect scheme format.
446
+ 1. Must only contain digits, lowercase ASCII letters or "-"
447
+ 2. Cannot start or end with "-"
448
+ 3. "-" cannot repeat`);Je.customSchemes.push([e,t])}function nJ(){Je.scanner=YQ(Je.customSchemes);for(let e=0;e<Je.tokenQueue.length;e++)Je.tokenQueue[e][1]({scanner:Je.scanner});Je.parser=QQ(Je.scanner.tokens);for(let e=0;e<Je.pluginQueue.length;e++)Je.pluginQueue[e][1]({scanner:Je.scanner,parser:Je.parser});return Je.initialized=!0,Je}function bw(e){return Je.initialized||nJ(),JQ(Je.parser.start,e,vj(Je.scanner.start,e))}bw.scan=vj;function bj(e,t=null,n=null){if(t&&typeof t=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);n=t,t=null}const r=new yw(n),i=bw(e),o=[];for(let s=0;s<i.length;s++){const a=i[s];a.isLink&&(!t||a.t===t)&&r.check(a)&&o.push(a.toFormattedObject(r))}return o}const xw="[\0-   ᠎ -\u2029  ]",rJ=new RegExp(xw),iJ=new RegExp(`${xw}$`),oJ=new RegExp(xw,"g");function sJ(e){return e.length===1?e[0].isLink:e.length===3&&e[1].isLink?["()","[]"].includes(e[0].value+e[2].value):!1}function aJ(e){return new Ge({key:new ut("autolink"),appendTransaction:(t,n,r)=>{const i=t.some(c=>c.docChanged)&&!n.doc.eq(r.doc),o=t.some(c=>c.getMeta("preventAutolink"));if(!i||o)return;const{tr:s}=r,a=Pq(n.doc,[...t]);if(Kq(a).forEach(({newRange:c})=>{const u=Hq(r.doc,c,h=>h.isTextblock);let f,d;if(u.length>1)f=u[0],d=r.doc.textBetween(f.pos,f.pos+f.node.nodeSize,void 0," ");else if(u.length){const h=r.doc.textBetween(c.from,c.to," "," ");if(!iJ.test(h))return;f=u[0],d=r.doc.textBetween(f.pos,c.to,void 0," ")}if(f&&d){const h=d.split(rJ).filter(Boolean);if(h.length<=0)return!1;const p=h[h.length-1],g=f.pos+d.lastIndexOf(p);if(!p)return!1;const y=bw(p).map(v=>v.toObject(e.defaultProtocol));if(!sJ(y))return!1;y.filter(v=>v.isLink).map(v=>({...v,from:g+v.start+1,to:g+v.end+1})).filter(v=>r.schema.marks.code?!r.doc.rangeHasMark(v.from,v.to,r.schema.marks.code):!0).filter(v=>e.validate(v.value)).filter(v=>e.shouldAutoLink(v.value)).forEach(v=>{KS(v.from,v.to,r.doc).some(b=>b.mark.type===e.type)||s.addMark(v.from,v.to,e.type.create({href:v.href}))})}}),!!s.steps.length)return s}})}function lJ(e){return new Ge({key:new ut("handleClickLink"),props:{handleClick:(t,n,r)=>{var i,o;if(r.button!==0||!t.editable)return!1;let s=r.target;const a=[];for(;s.nodeName!=="DIV";)a.push(s),s=s.parentNode;if(!a.find(d=>d.nodeName==="A"))return!1;const l=G3(t.state,e.type.name),c=r.target,u=(i=c==null?void 0:c.href)!==null&&i!==void 0?i:l.href,f=(o=c==null?void 0:c.target)!==null&&o!==void 0?o:l.target;return c&&u?(window.open(u,f),!0):!1}}})}function cJ(e){return new Ge({key:new ut("handlePasteLink"),props:{handlePaste:(t,n,r)=>{const{state:i}=t,{selection:o}=i,{empty:s}=o;if(s)return!1;let a="";r.content.forEach(c=>{a+=c.textContent});const l=bj(a,{defaultProtocol:e.defaultProtocol}).find(c=>c.isLink&&c.value===a);return!a||!l?!1:e.editor.commands.setMark(e.type,{href:l.href})}}})}function As(e,t){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return t&&t.forEach(r=>{const i=typeof r=="string"?r:r.scheme;i&&n.push(i)}),!e||e.replace(oJ,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}const uJ=In.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(e=>{if(typeof e=="string"){XM(e);return}XM(e.scheme,e.optionalSlashes)})},onDestroy(){tJ()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(e,t)=>!!As(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>!!e}},addAttributes(){return{href:{default:null,parseHTML(e){return e.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:e=>{const t=e.getAttribute("href");return!t||!this.options.isAllowedUri(t,{defaultValidate:n=>!!As(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:t=>!!As(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",it(this.options.HTMLAttributes,e),0]:["a",it(this.options.HTMLAttributes,{...e,href:""}),0]},addCommands(){return{setLink:e=>({chain:t})=>{const{href:n}=e;return this.options.isAllowedUri(n,{defaultValidate:r=>!!As(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?t().setMark(this.name,e).setMeta("preventAutolink",!0).run():!1},toggleLink:e=>({chain:t})=>{const{href:n}=e;return this.options.isAllowedUri(n,{defaultValidate:r=>!!As(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run():!1},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[fs({find:e=>{const t=[];if(e){const{protocols:n,defaultProtocol:r}=this.options,i=bj(e).filter(o=>o.isLink&&this.options.isAllowedUri(o.value,{defaultValidate:s=>!!As(s,n),protocols:n,defaultProtocol:r}));i.length&&i.forEach(o=>t.push({text:o.value,data:{href:o.href},index:o.start}))}return t},type:this.type,getAttributes:e=>{var t;return{href:(t=e.data)===null||t===void 0?void 0:t.href}}})]},addProseMirrorPlugins(){const e=[],{protocols:t,defaultProtocol:n}=this.options;return this.options.autolink&&e.push(aJ({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:i=>!!As(i,t),protocols:t,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&e.push(lJ({type:this.type})),this.options.linkOnPaste&&e.push(cJ({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),e}}),xj=uJ.extend({inclusive:!1,parseHTML(){return[{tag:'a[href]:not([data-type="button"]):not([href *= "javascript:" i])',getAttrs:e=>{var t;return(t=e.getAttribute("href"))!=null&&t.toLowerCase().startsWith("javascript:")?!1:null}}]},renderHTML({HTMLAttributes:e}){var t;return(t=e.href)!=null&&t.toLowerCase().startsWith("javascript:")?["a",it(this.options.HTMLAttributes,{...e,href:""}),0]:["a",it(this.options.HTMLAttributes,e),0]},addProseMirrorPlugins(){var t;const{editor:e}=this;return[...((t=this.parent)==null?void 0:t.call(this))||[],new Ge({props:{handleKeyDown:(n,r)=>{const{selection:i}=e.state;return r.key==="Escape"&&i.empty!==!0&&e.commands.focus(i.to,{scrollIntoView:!1}),!1}}})]}}),fJ=Ye.create({name:"selection",addProseMirrorPlugins(){const{editor:e}=this;return[new Ge({key:new ut("selection"),props:{decorations(t){return t.selection.empty||e.isFocused===!0?null:et.create(t.doc,[Xt.inline(t.selection.from,t.selection.to,{class:"selection"})])}}})]}});function dJ(e){var t;const{char:n,allowSpaces:r,allowToIncludeChar:i,allowedPrefixes:o,startOfLine:s,$position:a}=e,l=r&&!i,c=AK(n),u=new RegExp(`\\s${c}$`),f=s?"^":"",d=i?"":c,h=l?new RegExp(`${f}${c}.*?(?=\\s${d}|$)`,"gm"):new RegExp(`${f}(?:^)?${c}[^\\s${d}]*`,"gm"),p=((t=a.nodeBefore)===null||t===void 0?void 0:t.isText)&&a.nodeBefore.text;if(!p)return null;const g=a.pos-p.length,y=Array.from(p.matchAll(h)).pop();if(!y||y.input===void 0||y.index===void 0)return null;const v=y.input.slice(Math.max(0,y.index-1),y.index),b=new RegExp(`^[${o==null?void 0:o.join("")}\0]?$`).test(v);if(o!==null&&!b)return null;const x=g+y.index;let m=x+y[0].length;return l&&u.test(p.slice(m-1,m+1))&&(y[0]+=" ",m+=1),x<a.pos&&m>=a.pos?{range:{from:x,to:m},query:y[0].slice(n.length),text:y[0]}:null}const hJ=new ut("suggestion");function pJ({pluginKey:e=hJ,editor:t,char:n="@",allowSpaces:r=!1,allowToIncludeChar:i=!1,allowedPrefixes:o=[" "],startOfLine:s=!1,decorationTag:a="span",decorationClass:l="suggestion",decorationContent:c="",decorationEmptyClass:u="is-empty",command:f=()=>null,items:d=()=>[],render:h=()=>({}),allow:p=()=>!0,findSuggestionMatch:g=dJ}){let y;const v=h==null?void 0:h(),b=new Ge({key:e,view(){return{update:async(x,m)=>{var E,T,C,O,A,k,z;const _=(E=this.key)===null||E===void 0?void 0:E.getState(m),H=(T=this.key)===null||T===void 0?void 0:T.getState(x.state),U=_.active&&H.active&&_.range.from!==H.range.from,V=!_.active&&H.active,D=_.active&&!H.active,I=!V&&!D&&_.query!==H.query,N=V||U&&I,L=I||U,F=D||U&&I;if(!N&&!L&&!F)return;const te=F&&!N?_:H,ae=x.dom.querySelector(`[data-decoration-id="${te.decorationId}"]`);y={editor:t,range:te.range,query:te.query,text:te.text,items:[],command:Ee=>f({editor:t,range:te.range,props:Ee}),decorationNode:ae,clientRect:ae?()=>{var Ee;const{decorationId:ge}=(Ee=this.key)===null||Ee===void 0?void 0:Ee.getState(t.state),X=x.dom.querySelector(`[data-decoration-id="${ge}"]`);return(X==null?void 0:X.getBoundingClientRect())||null}:null},N&&((C=v==null?void 0:v.onBeforeStart)===null||C===void 0||C.call(v,y)),L&&((O=v==null?void 0:v.onBeforeUpdate)===null||O===void 0||O.call(v,y)),(L||N)&&(y.items=await d({editor:t,query:te.query})),F&&((A=v==null?void 0:v.onExit)===null||A===void 0||A.call(v,y)),L&&((k=v==null?void 0:v.onUpdate)===null||k===void 0||k.call(v,y)),N&&((z=v==null?void 0:v.onStart)===null||z===void 0||z.call(v,y))},destroy:()=>{var x;y&&((x=v==null?void 0:v.onExit)===null||x===void 0||x.call(v,y))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(x,m,E,T){const{isEditable:C}=t,{composing:O}=t.view,{selection:A}=x,{empty:k,from:z}=A,_={...m};if(_.composing=O,C&&(k||t.view.composing)){(z<m.range.from||z>m.range.to)&&!O&&!m.composing&&(_.active=!1);const H=g({char:n,allowSpaces:r,allowToIncludeChar:i,allowedPrefixes:o,startOfLine:s,$position:A.$from}),U=`id_${Math.floor(Math.random()*4294967295)}`;H&&p({editor:t,state:T,range:H.range,isActive:m.active})?(_.active=!0,_.decorationId=m.decorationId?m.decorationId:U,_.range=H.range,_.query=H.query,_.text=H.text):_.active=!1}else _.active=!1;return _.active||(_.decorationId=null,_.range={from:0,to:0},_.query=null,_.text=null),_}},props:{handleKeyDown(x,m){var E;const{active:T,range:C}=b.getState(x.state);return T&&((E=v==null?void 0:v.onKeyDown)===null||E===void 0?void 0:E.call(v,{view:x,event:m,range:C}))||!1},decorations(x){const{active:m,range:E,decorationId:T,query:C}=b.getState(x);if(!m)return null;const O=!(C!=null&&C.length),A=[l];return O&&A.push(u),et.create(x.doc,[Xt.inline(E.from,E.to,{nodeName:a,class:A.join(" "),"data-decoration-id":T,"data-decoration-content":c})])}}});return b}const mJ=[{name:"format",title:"Format",commands:[{name:"heading1",label:"Heading 1",iconName:"Heading1",description:"High priority section title",aliases:["h1"],action:e=>{e.chain().focus().setHeading({level:1}).run()}},{name:"heading2",label:"Heading 2",iconName:"Heading2",description:"Medium priority section title",aliases:["h2"],action:e=>{e.chain().focus().setHeading({level:2}).run()}},{name:"heading3",label:"Heading 3",iconName:"Heading3",description:"Low priority section title",aliases:["h3"],action:e=>{e.chain().focus().setHeading({level:3}).run()}},{name:"heading4",label:"Heading 4",iconName:"Heading4",description:"Low priority section title",aliases:["h4"],action:e=>{e.chain().focus().setHeading({level:4}).run()}},{name:"heading5",label:"Heading 5",iconName:"Heading5",description:"Low priority section title",aliases:["h5"],action:e=>{e.chain().focus().setHeading({level:5}).run()}},{name:"heading6",label:"Heading 6",iconName:"Heading6",description:"Low priority section title",aliases:["h6"],action:e=>{e.chain().focus().setHeading({level:6}).run()}},{name:"bulletList",label:"Bullet List",iconName:"List",description:"Unordered list of items",aliases:["ul"],action:e=>{e.chain().focus().toggleBulletList().run()}},{name:"numberedList",label:"Numbered List",iconName:"ListOrdered",description:"Ordered list of items",aliases:["ol"],action:e=>{e.chain().focus().toggleOrderedList().run()}},{name:"blockquote",label:"Blockquote",iconName:"Quote",description:"Element for quoting",action:e=>{e.chain().focus().setBlockquote().run()}}]},{name:"insert",title:"Insert",commands:[{name:"horizontalRule",label:"Horizontal Rule",iconName:"Minus",description:"Insert a horizontal divider",aliases:["hr"],action:e=>{e.chain().focus().setHorizontalRule().run()}}]}],gJ=({children:e})=>w.jsx("div",{className:"mb-1 px-1.5 font-semibold text-[.65rem] text-neutral-500 uppercase dark:text-neutral-400",children:e}),Sj=Ce.forwardRef(function({children:t,isActive:n,onClick:r,disabled:i,className:o},s){const a=Ut("flex items-center gap-2 p-1.5 text-sm font-medium text-neutral-500 dark:text-neutral-400 text-left bg-transparent w-full rounded",!n&&!i,"hover:bg-neutral-50 dark:hover:bg-neutral-900",n&&!i&&"bg-neutral-100 text-neutral-800 dark:bg-neutral-800 dark:text-neutral-200",i&&"text-neutral-400 cursor-not-allowed dark:text-neutral-600",o);return w.jsx("button",{className:a,disabled:i,onClick:r,ref:s,children:t})}),vJ={AlignCenter:uH,AlignJustify:dH,AlignLeft:pH,AlignRight:gH,Bold:yH,ChevronDown:xH,Code:TH,EllipsisVertical:zN,Heading1:_H,Heading2:LH,Heading3:zH,Heading4:PH,Heading5:UH,Heading6:HH,Italic:FH,Link:KH,List:XH,ListOrdered:YH,Minus:JH,Pen:e$,Pilcrow:n$,Quote:i$,Strikethrough:c$,Subscript:f$,Superscript:h$,Trash2:IN,Underline:g$},pt=S.memo(({name:e,className:t,strokeWidth:n})=>{const r=vJ[e];return r?w.jsx(r,{className:Ut("h-4 w-4",t),strokeWidth:n||2.5}):null});pt.displayName="Icon";const kc=S.forwardRef(({children:e,className:t,withShadow:n=!0,withBorder:r=!0,...i},o)=>{const s=Ut(t,"bg-white rounded-lg dark:bg-black",n?"shadow-xs":"",r?"border border-neutral-200 dark:border-neutral-800":"");return w.jsx("div",{className:s,...i,ref:o,children:e})});kc.displayName="Surface";const wj=Ce.forwardRef((e,t)=>{const n=S.useRef(null),r=S.useRef(null),[i,o]=S.useState(0),[s,a]=S.useState(0);S.useEffect(()=>{o(0),a(0)},[e.items]);const l=S.useCallback((u,f)=>{const d=e.items[u].commands[f];e.command(d)},[e]);Ce.useImperativeHandle(t,()=>({onKeyDown:({event:u})=>{var f;if(u.key==="ArrowDown"){if(!e.items.length)return!1;const d=e.items[i].commands;let h=s+1,p=i;return d.length-1<h&&(h=0,p=i+1),e.items.length-1<p&&(p=0),a(h),o(p),!0}if(u.key==="ArrowUp"){if(!e.items.length)return!1;let d=s-1,h=i;return d<0&&(h=i-1,d=((f=e.items[h])==null?void 0:f.commands.length)-1||0),h<0&&(h=e.items.length-1,d=e.items[h].commands.length-1),a(d),o(h),!0}return u.key==="Enter"?!e.items.length||i===-1||s===-1?!1:(l(i,s),!0):!1}})),S.useEffect(()=>{if(r.current&&n.current){const u=r.current.offsetTop,f=r.current.offsetHeight;n.current.scrollTop=u-f}},[s,i]);const c=S.useCallback((u,f)=>()=>{l(u,f)},[l]);return e.items.length?w.jsx(kc,{ref:n,className:"mb-8 max-h-[min(80vh,24rem)] flex-wrap overflow-auto p-2 text-black",children:w.jsx("div",{className:"grid grid-cols-1 gap-0.5",children:e.items.map((u,f)=>w.jsxs(Ce.Fragment,{children:[w.jsx("div",{className:"col-[1/-1] mx-2 mt-4 select-none font-semibold text-[0.65rem] text-neutral-500 uppercase tracking-wider first:mt-0.5",children:u.title},`${u.title}`),u.commands.map((d,h)=>w.jsxs(Sj,{ref:i===f&&s===h?r:null,isActive:i===f&&s===h,onClick:c(f,h),children:[w.jsx(pt,{name:d.iconName,className:"mr-1"}),d.label]},`${d.label}`))]},`${u.title}-wrapper`))})}):null});wj.displayName="MenuList";function Ry(e){return e.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"")}const ks="slashCommand";let Be;const yJ=Ye.create({name:ks,priority:200,onCreate(){Be=Ac("body",{interactive:!0,trigger:"manual",placement:"bottom-start",theme:"slash-command",maxWidth:"16rem",offset:[16,8],popperOptions:{strategy:"fixed",modifiers:[{name:"flip",enabled:!1}]}})},addProseMirrorPlugins(){return[pJ({editor:this.editor,char:"/",allowSpaces:!0,startOfLine:!0,pluginKey:new ut(ks),allow:({state:e,range:t})=>{var c,u,f;const n=e.doc.resolve(t.from),r=n.depth===1,i=n.parent.type.name==="paragraph",o=((c=n.parent.textContent)==null?void 0:c.charAt(0))==="/",s=this.editor.isActive("column"),a=(f=n.parent.textContent)==null?void 0:f.substring((u=n.parent.textContent)==null?void 0:u.indexOf("/")),l=!(a!=null&&a.endsWith(" "));return(r&&i&&o||s&&i&&o)&&l},command:({editor:e,props:t})=>{var c,u;const{view:n,state:r}=e,{$head:i,$from:o}=n.state.selection,s=o.pos,a=i!=null&&i.nodeBefore?s-(((u=i.nodeBefore.text)==null?void 0:u.substring((c=i.nodeBefore.text)==null?void 0:c.indexOf("/")).length)??0):o.start(),l=r.tr.deleteRange(a,s);n.dispatch(l),t.action(e),n.focus()},items:({query:e})=>mJ.map(i=>({...i,commands:i.commands.filter(o=>{const s=Ry(o.label).trim(),a=Ry(e).trim();if(o.aliases){const l=o.aliases.map(c=>Ry(c).trim());return s.includes(a)||l.includes(a)}return s.includes(a)}).filter(o=>o.shouldBeHidden?!o.shouldBeHidden(this.editor):!0)})).filter(i=>i.commands.length>0).map(i=>({...i,commands:i.commands.map(o=>({...o,isEnabled:!0}))})),render:()=>{let e,t=null;return{onStart:n=>{var o;e=new OY(wj,{props:n,editor:n.editor});const{view:r}=n.editor,i=()=>{if(!n.clientRect)return n.editor.storage[ks].rect;const s=n.clientRect();if(!s)return n.editor.storage[ks].rect;let a=s.y;if(s.top+e.element.offsetHeight+40>window.innerHeight){const l=s.top+e.element.offsetHeight-window.innerHeight+40;a=s.y-l}return new DOMRect(s.x,a,s.width,s.height)};t=()=>{Be==null||Be[0].setProps({getReferenceClientRect:i})},(o=r.dom.parentElement)==null||o.addEventListener("scroll",t),Be==null||Be[0].setProps({getReferenceClientRect:i,appendTo:()=>document.querySelector("[role=dialog]")??document.body,content:e.element}),Be==null||Be[0].show()},onUpdate(n){var s;e.updateProps(n);const{view:r}=n.editor,i=()=>{if(!n.clientRect)return n.editor.storage[ks].rect;const a=n.clientRect();if(!a)return n.editor.storage[ks].rect;let l=a.y;if(a.top+e.element.offsetHeight+40>window.innerHeight){const c=a.top+e.element.offsetHeight-window.innerHeight+40;l=a.y-c}return new DOMRect(a.x,l,a.width,a.height)},o=()=>{Be==null||Be[0].setProps({getReferenceClientRect:i})};(s=r.dom.parentElement)==null||s.addEventListener("scroll",o),n.editor.storage[ks].rect=n.clientRect?i():{width:0,height:0,left:0,top:0,right:0,bottom:0},Be==null||Be[0].setProps({getReferenceClientRect:i})},onKeyDown(n){var r;return n.event.key==="Escape"?(Be==null||Be[0].hide(),!0):(Be!=null&&Be[0].state.isShown||Be==null||Be[0].show(),(r=e.ref)==null?void 0:r.onKeyDown(n))},onExit(n){var r;if(Be==null||Be[0].hide(),t){const{view:i}=n.editor;(r=i.dom.parentElement)==null||r.removeEventListener("scroll",t)}e.destroy()}}}})]},addStorage(){return{rect:{width:0,height:0,left:0,top:0,right:0,bottom:0}}}});function QM({types:e,node:t}){return Array.isArray(e)&&t&&e.includes(t.type)||(t==null?void 0:t.type)===e}const bJ=Ye.create({name:"trailingNode",addOptions(){return{node:"paragraph",notAfter:["paragraph"]}},addProseMirrorPlugins(){const e=new ut(this.name),t=Object.entries(this.editor.schema.nodes).map(([,n])=>n).filter(n=>this.options.notAfter.includes(n.name));return[new Ge({key:e,appendTransaction:(n,r,i)=>{const{doc:o,tr:s,schema:a}=i,l=e.getState(i),c=o.content.size,u=a.nodes[this.options.node];if(l)return s.insert(c,u.create())},state:{init:(n,r)=>{const i=r.tr.doc.lastChild;return!QM({node:i,types:t})},apply:(n,r)=>{if(!n.docChanged)return r;const i=n.doc.lastChild;return!QM({node:i,types:t})}}})]}}),xJ=e=>e.isActive(xj.name),SJ=({editor:e})=>{const{state:{doc:t,selection:n,selection:{empty:r,from:i,to:o}}}=e,s=!t.textBetween(i,o).length&&Ig(n);return!(r||s)};function Ut(...e){return Te(e)}const Sw=Ce.forwardRef(({active:e,buttonSize:t="medium",children:n,disabled:r,variant:i="primary",className:o,activeClassname:s,...a},l)=>{const c=Ut("flex group items-center justify-center border border-transparent gap-2 text-sm font-semibold rounded-md disabled:opacity-50 whitespace-nowrap",i==="primary"&&Ut("text-white bg-black border-black dark:text-black dark:bg-white dark:border-white",!r&&!e&&"hover:bg-neutral-800 active:bg-neutral-900 dark:hover:bg-neutral-200 dark:active:bg-neutral-300",e&&Ut("bg-neutral-900 dark:bg-neutral-300",s)),i==="secondary"&&Ut("text-neutral-900 dark:text-white",!r&&!e&&"hover:bg-neutral-100 active:bg-neutral-200 dark:hover:bg-neutral-900 dark:active:bg-neutral-800",e&&"bg-neutral-200 dark:bg-neutral-800"),i==="tertiary"&&Ut("bg-neutral-50 text-neutral-900 dark:bg-neutral-900 dark:text-white dark:border-neutral-900",!r&&!e&&"hover:bg-neutral-100 active:bg-neutral-200 dark:hover:bg-neutral-800 dark:active:bg-neutral-700",e&&Ut("bg-neutral-200 dark:bg-neutral-800",s)),i==="ghost"&&Ut("bg-transparent border-transparent text-neutral-500 dark:text-neutral-400",!r&&!e&&"hover:bg-black/5 hover:text-neutral-700 active:bg-black/10 active:text-neutral-800 dark:hover:bg-white/10 dark:hover:text-neutral-300 dark:active:text-neutral-200",e&&Ut("bg-black/10 text-neutral-800 dark:bg-white/20 dark:text-neutral-200",s)),t==="medium"&&"py-2 px-3",t==="small"&&"py-1 px-2",t==="icon"&&"w-8 h-8",t==="iconSmall"&&"w-6 h-6",o);return w.jsx("button",{ref:l,type:"button",disabled:r,className:c,...a,children:n})});Sw.displayName="Button";const wJ=({onChange:e,active:t=!1,size:n="large"})=>{const r=t?"checked":"unchecked",i=t?"on":"off",o=Ut("inline-flex cursor-pointer items-center rounded-full border-transparent transition-colors",t?"bg-black":"bg-neutral-200 hover:bg-neutral-300",t?"dark:bg-white":"dark:bg-neutral-800 dark:hover:bg-neutral-700",n==="small"&&"h-3 w-6 px-0.5",n==="large"&&"h-5 w-9 px-0.5"),s=Ut("rounded-full pointer-events-none block transition-transform","bg-white dark:bg-black",n==="small"&&"h-2 w-2",n==="large"&&"h-4 w-4",t?Ut(n==="small"?"translate-x-3":"",n==="large"?"translate-x-4":""):"translate-x-0"),a=S.useCallback(()=>{e(!t)},[t,e]);return w.jsx("button",{className:o,type:"button",role:"switch","aria-checked":t,"data-state":r,value:i,onClick:a,children:w.jsx("span",{className:s,"data-state":r})})},EJ=({initialUrl:e,initialOpenInNewTab:t,onSetLink:n})=>{const[r,i]=S.useState(e||""),[o,s]=S.useState(t||!1),a=S.useCallback(u=>{i(u.target.value)},[]),l=S.useMemo(()=>/^(\S+):(\/\/)?\S+$/.test(r),[r]),c=S.useCallback(u=>{u.preventDefault(),l&&n(r,o)},[r,l,o,n]);return{url:r,setUrl:i,openInNewTab:o,setOpenInNewTab:s,onChange:a,handleSubmit:c,isValidUrl:l}},Ej=({onSetLink:e,initialOpenInNewTab:t,initialUrl:n})=>{const r=EJ({onSetLink:e,initialOpenInNewTab:t,initialUrl:n});return w.jsxs(kc,{className:"p-2",children:[w.jsxs("form",{onSubmit:r.handleSubmit,className:"flex items-center gap-2",children:[w.jsxs("label",{className:"flex cursor-text items-center gap-2 rounded-lg bg-neutral-100 p-2 dark:bg-neutral-900",children:[w.jsx(pt,{name:"Link",className:"flex-none text-black dark:text-white"}),w.jsx("input",{type:"url",className:"min-w-[12rem] flex-1 bg-transparent text-black text-sm outline-hidden dark:text-white",placeholder:"Enter URL",value:r.url,onChange:r.onChange})]}),w.jsx(Sw,{variant:"primary",buttonSize:"small",type:"submit",disabled:!r.isValidUrl,children:"Set Link"})]}),w.jsx("div",{className:"mt-3",children:w.jsxs("label",{className:"flex cursor-pointer select-none items-center justify-start gap-2 font-semibold text-neutral-500 text-sm dark:text-neutral-400",children:["Open in new tab",w.jsx(wJ,{active:r.openInNewTab,onChange:r.setOpenInNewTab})]})})]})};var CJ="tippy-content",TJ="tippy-backdrop",MJ="tippy-arrow",OJ="tippy-svg-arrow",Hs={passive:!0,capture:!0},Cj=function(){return document.body};function Ly(e,t,n){if(Array.isArray(e)){var r=e[t];return r??(Array.isArray(n)?n[t]:n)}return e}function ww(e,t){var n={}.toString.call(e);return n.indexOf("[object")===0&&n.indexOf(t+"]")>-1}function Tj(e,t){return typeof e=="function"?e.apply(void 0,t):e}function JM(e,t){if(t===0)return e;var n;return function(r){clearTimeout(n),n=setTimeout(function(){e(r)},t)}}function AJ(e){return e.split(/\s+/).filter(Boolean)}function sl(e){return[].concat(e)}function ZM(e,t){e.indexOf(t)===-1&&e.push(t)}function kJ(e){return e.filter(function(t,n){return e.indexOf(t)===n})}function DJ(e){return e.split("-")[0]}function Lm(e){return[].slice.call(e)}function eO(e){return Object.keys(e).reduce(function(t,n){return e[n]!==void 0&&(t[n]=e[n]),t},{})}function NJ(){return document.createElement("div")}function Mj(e){return["Element","Fragment"].some(function(t){return ww(e,t)})}function _J(e){return ww(e,"NodeList")}function RJ(e){return ww(e,"MouseEvent")}function LJ(e){return!!(e&&e._tippy&&e._tippy.reference===e)}function jJ(e){return Mj(e)?[e]:_J(e)?Lm(e):Array.isArray(e)?e:Lm(document.querySelectorAll(e))}function jy(e,t){e.forEach(function(n){n&&(n.style.transitionDuration=t+"ms")})}function tO(e,t){e.forEach(function(n){n&&n.setAttribute("data-state",t)})}function zJ(e){var t,n=sl(e),r=n[0];return r!=null&&(t=r.ownerDocument)!=null&&t.body?r.ownerDocument:document}function IJ(e,t){var n=t.clientX,r=t.clientY;return e.every(function(i){var o=i.popperRect,s=i.popperState,a=i.props,l=a.interactiveBorder,c=DJ(s.placement),u=s.modifiersData.offset;if(!u)return!0;var f=c==="bottom"?u.top.y:0,d=c==="top"?u.bottom.y:0,h=c==="right"?u.left.x:0,p=c==="left"?u.right.x:0,g=o.top-r+f>l,y=r-o.bottom-d>l,v=o.left-n+h>l,b=n-o.right-p>l;return g||y||v||b})}function zy(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){e[r](i,n)})}function nO(e,t){for(var n=t;n;){var r;if(e.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var ti={isTouch:!1},rO=0;function PJ(){ti.isTouch||(ti.isTouch=!0,window.performance&&document.addEventListener("mousemove",Oj))}function Oj(){var e=performance.now();e-rO<20&&(ti.isTouch=!1,document.removeEventListener("mousemove",Oj)),rO=e}function BJ(){var e=document.activeElement;if(LJ(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}function HJ(){document.addEventListener("touchstart",PJ,Hs),window.addEventListener("blur",BJ)}var $J=typeof window<"u"&&typeof document<"u",UJ=$J?!!window.msCrypto:!1,VJ={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},FJ={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Br=Object.assign({appendTo:Cj,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},VJ,FJ),qJ=Object.keys(Br),KJ=function(t){var n=Object.keys(t);n.forEach(function(r){Br[r]=t[r]})};function Aj(e){var t=e.plugins||[],n=t.reduce(function(r,i){var o=i.name,s=i.defaultValue;if(o){var a;r[o]=e[o]!==void 0?e[o]:(a=Br[o])!=null?a:s}return r},{});return Object.assign({},e,n)}function WJ(e,t){var n=t?Object.keys(Aj(Object.assign({},Br,{plugins:t}))):qJ,r=n.reduce(function(i,o){var s=(e.getAttribute("data-tippy-"+o)||"").trim();if(!s)return i;if(o==="content")i[o]=s;else try{i[o]=JSON.parse(s)}catch{i[o]=s}return i},{});return r}function iO(e,t){var n=Object.assign({},t,{content:Tj(t.content,[e])},t.ignoreAttributes?{}:WJ(e,t.plugins));return n.aria=Object.assign({},Br.aria,n.aria),n.aria={expanded:n.aria.expanded==="auto"?t.interactive:n.aria.expanded,content:n.aria.content==="auto"?t.interactive?null:"describedby":n.aria.content},n}function oO(e){var t=e.firstElementChild,n=Lm(t.children);return{box:t,content:n.find(function(r){return r.classList.contains(CJ)}),arrow:n.find(function(r){return r.classList.contains(MJ)||r.classList.contains(OJ)}),backdrop:n.find(function(r){return r.classList.contains(TJ)})}}var YJ=1,dh=[],Iy=[];function GJ(e,t){var n=iO(e,Object.assign({},Br,Aj(eO(t)))),r,i,o,s=!1,a=!1,l=!1,c=!1,u,f,d,h=[],p=JM(dt,n.interactiveDebounce),g,y=YJ++,v=null,b=kJ(n.plugins),x={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},m={id:y,reference:e,popper:NJ(),popperInstance:v,props:n,state:x,plugins:b,clearDelayTimeouts:Gr,setProps:fo,setContent:ue,show:Ke,hide:ht,hideWithInteractivity:yt,enable:Yr,disable:uo,unmount:nn,destroy:zt};if(!n.render)return m;var E=n.render(m),T=E.popper,C=E.onUpdate;T.setAttribute("data-tippy-root",""),T.id="tippy-"+m.id,m.popper=T,e._tippy=m,T._tippy=m;var O=b.map(function(M){return M.fn(m)}),A=e.hasAttribute("aria-expanded");return le(),F(),I(),N("onCreate",[m]),n.showOnCreate&&Dr(),T.addEventListener("mouseenter",function(){m.props.interactive&&m.state.isVisible&&m.clearDelayTimeouts()}),T.addEventListener("mouseleave",function(){m.props.interactive&&m.props.trigger.indexOf("mouseenter")>=0&&U().addEventListener("mousemove",p)}),m;function k(){var M=m.props.touch;return Array.isArray(M)?M:[M,0]}function z(){return k()[0]==="hold"}function _(){var M;return!!((M=m.props.render)!=null&&M.$$tippy)}function H(){return g||e}function U(){var M=H().parentNode;return M?zJ(M):document}function V(){return oO(T)}function D(M){return m.state.isMounted&&!m.state.isVisible||ti.isTouch||u&&u.type==="focus"?0:Ly(m.props.delay,M?0:1,Br.delay)}function I(M){M===void 0&&(M=!1),T.style.pointerEvents=m.props.interactive&&!M?"":"none",T.style.zIndex=""+m.props.zIndex}function N(M,R,P){if(P===void 0&&(P=!0),O.forEach(function(q){q[M]&&q[M].apply(q,R)}),P){var K;(K=m.props)[M].apply(K,R)}}function L(){var M=m.props.aria;if(M.content){var R="aria-"+M.content,P=T.id,K=sl(m.props.triggerTarget||e);K.forEach(function(q){var we=q.getAttribute(R);if(m.state.isVisible)q.setAttribute(R,we?we+" "+P:P);else{var Pe=we&&we.replace(P,"").trim();Pe?q.setAttribute(R,Pe):q.removeAttribute(R)}})}}function F(){if(!(A||!m.props.aria.expanded)){var M=sl(m.props.triggerTarget||e);M.forEach(function(R){m.props.interactive?R.setAttribute("aria-expanded",m.state.isVisible&&R===H()?"true":"false"):R.removeAttribute("aria-expanded")})}}function te(){U().removeEventListener("mousemove",p),dh=dh.filter(function(M){return M!==p})}function ae(M){if(!(ti.isTouch&&(l||M.type==="mousedown"))){var R=M.composedPath&&M.composedPath()[0]||M.target;if(!(m.props.interactive&&nO(T,R))){if(sl(m.props.triggerTarget||e).some(function(P){return nO(P,R)})){if(ti.isTouch||m.state.isVisible&&m.props.trigger.indexOf("click")>=0)return}else N("onClickOutside",[m,M]);m.props.hideOnClick===!0&&(m.clearDelayTimeouts(),m.hide(),a=!0,setTimeout(function(){a=!1}),m.state.isMounted||De())}}}function Ee(){l=!0}function ge(){l=!1}function X(){var M=U();M.addEventListener("mousedown",ae,!0),M.addEventListener("touchend",ae,Hs),M.addEventListener("touchstart",ge,Hs),M.addEventListener("touchmove",Ee,Hs)}function De(){var M=U();M.removeEventListener("mousedown",ae,!0),M.removeEventListener("touchend",ae,Hs),M.removeEventListener("touchstart",ge,Hs),M.removeEventListener("touchmove",Ee,Hs)}function Y(M,R){pe(M,function(){!m.state.isVisible&&T.parentNode&&T.parentNode.contains(T)&&R()})}function re(M,R){pe(M,R)}function pe(M,R){var P=V().box;function K(q){q.target===P&&(zy(P,"remove",K),R())}if(M===0)return R();zy(P,"remove",f),zy(P,"add",K),f=K}function Z(M,R,P){P===void 0&&(P=!1);var K=sl(m.props.triggerTarget||e);K.forEach(function(q){q.addEventListener(M,R,P),h.push({node:q,eventType:M,handler:R,options:P})})}function le(){z()&&(Z("touchstart",Xe,{passive:!0}),Z("touchend",Zt,{passive:!0})),AJ(m.props.trigger).forEach(function(M){if(M!=="manual")switch(Z(M,Xe),M){case"mouseenter":Z("mouseleave",Zt);break;case"focus":Z(UJ?"focusout":"blur",en);break;case"focusin":Z("focusout",en);break}})}function ce(){h.forEach(function(M){var R=M.node,P=M.eventType,K=M.handler,q=M.options;R.removeEventListener(P,K,q)}),h=[]}function Xe(M){var R,P=!1;if(!(!m.state.isEnabled||tn(M)||a)){var K=((R=u)==null?void 0:R.type)==="focus";u=M,g=M.currentTarget,F(),!m.state.isVisible&&RJ(M)&&dh.forEach(function(q){return q(M)}),M.type==="click"&&(m.props.trigger.indexOf("mouseenter")<0||s)&&m.props.hideOnClick!==!1&&m.state.isVisible?P=!0:Dr(M),M.type==="click"&&(s=!P),P&&!K&&dn(M)}}function dt(M){var R=M.target,P=H().contains(R)||T.contains(R);if(!(M.type==="mousemove"&&P)){var K=fn().concat(T).map(function(q){var we,Pe=q._tippy,hn=(we=Pe.popperInstance)==null?void 0:we.state;return hn?{popperRect:q.getBoundingClientRect(),popperState:hn,props:n}:null}).filter(Boolean);IJ(K,M)&&(te(),dn(M))}}function Zt(M){var R=tn(M)||m.props.trigger.indexOf("click")>=0&&s;if(!R){if(m.props.interactive){m.hideWithInteractivity(M);return}dn(M)}}function en(M){m.props.trigger.indexOf("focusin")<0&&M.target!==H()||m.props.interactive&&M.relatedTarget&&T.contains(M.relatedTarget)||dn(M)}function tn(M){return ti.isTouch?z()!==M.type.indexOf("touch")>=0:!1}function kr(){En();var M=m.props,R=M.popperOptions,P=M.placement,K=M.offset,q=M.getReferenceClientRect,we=M.moveTransition,Pe=_()?oO(T).arrow:null,hn=q?{getBoundingClientRect:q,contextElement:q.contextElement||H()}:e,ws={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(wi){var Hn=wi.state;if(_()){var Yg=V(),Cs=Yg.box;["placement","reference-hidden","escaped"].forEach(function(Ei){Ei==="placement"?Cs.setAttribute("data-placement",Hn.placement):Hn.attributes.popper["data-popper-"+Ei]?Cs.setAttribute("data-"+Ei,""):Cs.removeAttribute("data-"+Ei)}),Hn.attributes.popper={}}}},It=[{name:"offset",options:{offset:K}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!we}},ws];_()&&Pe&&It.push({name:"arrow",options:{element:Pe,padding:3}}),It.push.apply(It,(R==null?void 0:R.modifiers)||[]),m.popperInstance=sL(hn,T,Object.assign({},R,{placement:P,onFirstUpdate:d,modifiers:It}))}function En(){m.popperInstance&&(m.popperInstance.destroy(),m.popperInstance=null)}function Cn(){var M=m.props.appendTo,R,P=H();m.props.interactive&&M===Cj||M==="parent"?R=P.parentNode:R=Tj(M,[P]),R.contains(T)||R.appendChild(T),m.state.isMounted=!0,kr()}function fn(){return Lm(T.querySelectorAll("[data-tippy-root]"))}function Dr(M){m.clearDelayTimeouts(),M&&N("onTrigger",[m,M]),X();var R=D(!0),P=k(),K=P[0],q=P[1];ti.isTouch&&K==="hold"&&q&&(R=q),R?r=setTimeout(function(){m.show()},R):m.show()}function dn(M){if(m.clearDelayTimeouts(),N("onUntrigger",[m,M]),!m.state.isVisible){De();return}if(!(m.props.trigger.indexOf("mouseenter")>=0&&m.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(M.type)>=0&&s)){var R=D(!1);R?i=setTimeout(function(){m.state.isVisible&&m.hide()},R):o=requestAnimationFrame(function(){m.hide()})}}function Yr(){m.state.isEnabled=!0}function uo(){m.hide(),m.state.isEnabled=!1}function Gr(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(o)}function fo(M){if(!m.state.isDestroyed){N("onBeforeUpdate",[m,M]),ce();var R=m.props,P=iO(e,Object.assign({},R,eO(M),{ignoreAttributes:!0}));m.props=P,le(),R.interactiveDebounce!==P.interactiveDebounce&&(te(),p=JM(dt,P.interactiveDebounce)),R.triggerTarget&&!P.triggerTarget?sl(R.triggerTarget).forEach(function(K){K.removeAttribute("aria-expanded")}):P.triggerTarget&&e.removeAttribute("aria-expanded"),F(),I(),C&&C(R,P),m.popperInstance&&(kr(),fn().forEach(function(K){requestAnimationFrame(K._tippy.popperInstance.forceUpdate)})),N("onAfterUpdate",[m,M])}}function ue(M){m.setProps({content:M})}function Ke(){var M=m.state.isVisible,R=m.state.isDestroyed,P=!m.state.isEnabled,K=ti.isTouch&&!m.props.touch,q=Ly(m.props.duration,0,Br.duration);if(!(M||R||P||K)&&!H().hasAttribute("disabled")&&(N("onShow",[m],!1),m.props.onShow(m)!==!1)){if(m.state.isVisible=!0,_()&&(T.style.visibility="visible"),I(),X(),m.state.isMounted||(T.style.transition="none"),_()){var we=V(),Pe=we.box,hn=we.content;jy([Pe,hn],0)}d=function(){var It;if(!(!m.state.isVisible||c)){if(c=!0,T.offsetHeight,T.style.transition=m.props.moveTransition,_()&&m.props.animation){var Es=V(),wi=Es.box,Hn=Es.content;jy([wi,Hn],q),tO([wi,Hn],"visible")}L(),F(),ZM(Iy,m),(It=m.popperInstance)==null||It.forceUpdate(),N("onMount",[m]),m.props.animation&&_()&&re(q,function(){m.state.isShown=!0,N("onShown",[m])})}},Cn()}}function ht(){var M=!m.state.isVisible,R=m.state.isDestroyed,P=!m.state.isEnabled,K=Ly(m.props.duration,1,Br.duration);if(!(M||R||P)&&(N("onHide",[m],!1),m.props.onHide(m)!==!1)){if(m.state.isVisible=!1,m.state.isShown=!1,c=!1,s=!1,_()&&(T.style.visibility="hidden"),te(),De(),I(!0),_()){var q=V(),we=q.box,Pe=q.content;m.props.animation&&(jy([we,Pe],K),tO([we,Pe],"hidden"))}L(),F(),m.props.animation?_()&&Y(K,m.unmount):m.unmount()}}function yt(M){U().addEventListener("mousemove",p),ZM(dh,p),p(M)}function nn(){m.state.isVisible&&m.hide(),m.state.isMounted&&(En(),fn().forEach(function(M){M._tippy.unmount()}),T.parentNode&&T.parentNode.removeChild(T),Iy=Iy.filter(function(M){return M!==m}),m.state.isMounted=!1,N("onHidden",[m]))}function zt(){m.state.isDestroyed||(m.clearDelayTimeouts(),m.unmount(),ce(),delete e._tippy,m.state.isDestroyed=!0,N("onDestroy",[m]))}}function xd(e,t){t===void 0&&(t={});var n=Br.plugins.concat(t.plugins||[]);HJ();var r=Object.assign({},t,{plugins:n}),i=jJ(e),o=i.reduce(function(s,a){var l=a&&GJ(a,r);return l&&s.push(l),s},[]);return Mj(e)?o[0]:o}xd.defaultProps=Br;xd.setDefaultProps=KJ;xd.currentInput=ti;Object.assign({},GS,{effect:function(t){var n=t.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow)}});xd.setDefaultProps({animation:!1});function kj(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var Dj=typeof window<"u"&&typeof document<"u";function n1(e,t){e&&(typeof e=="function"&&e(t),{}.hasOwnProperty.call(e,"current")&&(e.current=t))}function sO(){return Dj&&document.createElement("div")}function XJ(e){var t={"data-placement":e.placement};return e.referenceHidden&&(t["data-reference-hidden"]=""),e.escaped&&(t["data-escaped"]=""),t}function Nj(e,t){if(e===t)return!0;if(typeof e=="object"&&e!=null&&typeof t=="object"&&t!=null){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(t.hasOwnProperty(n)){if(!Nj(e[n],t[n]))return!1}else return!1;return!0}else return!1}function QJ(e){var t=[];return e.forEach(function(n){t.find(function(r){return Nj(n,r)})||t.push(n)}),t}function JJ(e,t){var n,r;return Object.assign({},t,{popperOptions:Object.assign({},e.popperOptions,t.popperOptions,{modifiers:QJ([].concat(((n=e.popperOptions)==null?void 0:n.modifiers)||[],((r=t.popperOptions)==null?void 0:r.modifiers)||[]))})})}var Py=Dj?S.useLayoutEffect:S.useEffect;function ZJ(e){var t=S.useRef();return t.current||(t.current=typeof e=="function"?e():e),t.current}function aO(e,t,n){n.split(/\s+/).forEach(function(r){r&&e.classList[t](r)})}var eZ={name:"className",defaultValue:"",fn:function(t){var n=t.popper.firstElementChild,r=function(){var a;return!!((a=t.props.render)!=null&&a.$$tippy)};function i(){t.props.className&&!r()||aO(n,"add",t.props.className)}function o(){r()&&aO(n,"remove",t.props.className)}return{onCreate:i,onBeforeUpdate:o,onAfterUpdate:i}}};function tZ(e){function t(n){var r=n.children,i=n.content,o=n.visible,s=n.singleton,a=n.render,l=n.reference,c=n.disabled,u=c===void 0?!1:c,f=n.ignoreAttributes,d=f===void 0?!0:f;n.__source,n.__self;var h=kj(n,["children","content","visible","singleton","render","reference","disabled","ignoreAttributes","__source","__self"]),p=o!==void 0,g=s!==void 0,y=S.useState(!1),v=y[0],b=y[1],x=S.useState({}),m=x[0],E=x[1],T=S.useState(),C=T[0],O=T[1],A=ZJ(function(){return{container:sO(),renders:1}}),k=Object.assign({ignoreAttributes:d},h,{content:A.container});p&&(k.trigger="manual",k.hideOnClick=!1),g&&(u=!0);var z=k,_=k.plugins||[];a&&(z=Object.assign({},k,{plugins:g&&s.data!=null?[].concat(_,[{fn:function(){return{onTrigger:function(D,I){var N=s.data.children.find(function(L){var F=L.instance;return F.reference===I.currentTarget});D.state.$$activeSingletonInstance=N.instance,O(N.content)}}}}]):_,render:function(){return{popper:A.container}}}));var H=[l].concat(r?[r.type]:[]);return Py(function(){var U=l;l&&l.hasOwnProperty("current")&&(U=l.current);var V=e(U||A.ref||sO(),Object.assign({},z,{plugins:[eZ].concat(k.plugins||[])}));return A.instance=V,u&&V.disable(),o&&V.show(),g&&s.hook({instance:V,content:i,props:z,setSingletonContent:O}),b(!0),function(){V.destroy(),s==null||s.cleanup(V)}},H),Py(function(){var U;if(A.renders===1){A.renders++;return}var V=A.instance;V.setProps(JJ(V.props,z)),(U=V.popperInstance)==null||U.forceUpdate(),u?V.disable():V.enable(),p&&(o?V.show():V.hide()),g&&s.hook({instance:V,content:i,props:z,setSingletonContent:O})}),Py(function(){var U;if(a){var V=A.instance;V.setProps({popperOptions:Object.assign({},V.props.popperOptions,{modifiers:[].concat((((U=V.props.popperOptions)==null?void 0:U.modifiers)||[]).filter(function(D){var I=D.name;return I!=="$$tippyReact"}),[{name:"$$tippyReact",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(I){var N,L=I.state,F=(N=L.modifiersData)==null?void 0:N.hide;(m.placement!==L.placement||m.referenceHidden!==(F==null?void 0:F.isReferenceHidden)||m.escaped!==(F==null?void 0:F.hasPopperEscaped))&&E({placement:L.placement,referenceHidden:F==null?void 0:F.isReferenceHidden,escaped:F==null?void 0:F.hasPopperEscaped}),L.attributes.popper={}}}])})})}},[m.placement,m.referenceHidden,m.escaped].concat(H)),Ce.createElement(Ce.Fragment,null,r?S.cloneElement(r,{ref:function(V){A.ref=V,n1(r.ref,V)}}):null,v&&ke.createPortal(a?a(XJ(m),C,A.instance):i,A.container))}return t}var nZ=function(e,t){return S.forwardRef(function(r,i){var o=r.children,s=kj(r,["children"]);return Ce.createElement(e,Object.assign({},t,s),o?S.cloneElement(o,{ref:function(l){n1(i,l),n1(o.ref,l)}}):null)})},rZ=nZ(tZ(xd),{render:function(){return""}});const lO=typeof window<"u"?navigator.platform.toUpperCase().indexOf("MAC")>=0:!1,iZ=({children:e})=>{const t="inline-flex items-center justify-center w-5 h-5 p-1 text-[0.625rem] rounded font-semibold leading-none border border-neutral-200 text-neutral-500 border-b-2";return e==="Mod"?w.jsx("kbd",{className:t,children:lO?"⌘":"Ctrl"}):e==="Shift"?w.jsx("kbd",{className:t,children:"⇧"}):e==="Alt"?w.jsx("kbd",{className:t,children:lO?"⌥":"Alt"}):w.jsx("kbd",{className:t,children:e})},r1=({children:e,enabled:t=!0,title:n,shortcut:r,tippyOptions:i={}})=>{const o=S.useCallback(s=>w.jsxs("span",{className:"z-[999] flex items-center gap-2 rounded-lg border border-neutral-100 bg-white px-2.5 py-1 shadow-xs",tabIndex:-1,"data-placement":s["data-placement"],"data-reference-hidden":s["data-reference-hidden"],"data-escaped":s["data-escaped"],children:[n&&w.jsx("span",{className:"font-medium text-neutral-500 text-xs",children:n}),r&&w.jsx("span",{className:"flex items-center gap-0.5",children:r.map(a=>w.jsx(iZ,{children:a},a))})]}),[r,n]);return t?w.jsx(rZ,{delay:500,offset:[0,8],touch:!1,zIndex:99999,appendTo:document.body,...i,render:o,children:w.jsx("span",{children:e})}):w.jsx(w.Fragment,{children:e})},_j=S.forwardRef(({shouldShowContent:e=!0,children:t,isVertical:n=!1,className:r,...i},o)=>{const s=Ut("text-black inline-flex h-full leading-none gap-0.5",n?"flex-col p-2":"flex-row p-1 items-center",r);return e&&w.jsx(kc,{className:s,...i,ref:o,children:t})});_j.displayName="Toolbar";const Rj=S.forwardRef(({horizontal:e,className:t,...n},r)=>{const i=Ut("bg-neutral-200 dark:bg-neutral-800",e?"w-full min-w-[1.5rem] h-[1px] my-1 first:mt-0 last:mt-0":"h-full min-h-[1.5rem] w-[1px] mx-1 first:ml-0 last:mr-0",t);return w.jsx("div",{className:i,ref:r,...n})});Rj.displayName="Toolbar.Divider";const Lj=S.forwardRef(({children:e,buttonSize:t="icon",variant:n="ghost",className:r,tooltip:i,tooltipShortcut:o,activeClassname:s,...a},l)=>{const c=Ut("gap-1 min-w-[2rem] px-2 w-auto mx-auto",r),u=w.jsx(Sw,{activeClassname:s,className:c,variant:n,buttonSize:t,ref:l,...a,children:e});return i?w.jsx(r1,{title:i,shortcut:o,children:u}):u});Lj.displayName="ToolbarButton";const Yi={Wrapper:_j,Divider:Rj,Button:Lj},oZ=({onClear:e,onEdit:t,url:n})=>{const r=n!=null&&n.startsWith("javascript:")?"":n;return w.jsxs(kc,{className:"flex items-center gap-2 p-2",children:[w.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"break-all text-sm underline",children:n}),w.jsx(Yi.Divider,{}),w.jsx(r1,{title:"Edit link",children:w.jsx(Yi.Button,{onClick:t,children:w.jsx(pt,{name:"Pen"})})}),w.jsx(r1,{title:"Remove link",children:w.jsx(Yi.Button,{onClick:e,children:w.jsx(pt,{name:"Trash2"})})})]})},sZ=({editor:e,appendTo:t})=>{const[n,r]=S.useState(!1),{link:i,target:o}=Ug({editor:e,selector:u=>{const f=u.editor.getAttributes("link");return{link:f.href,target:f.target}}}),s=S.useCallback(()=>e.isActive("link"),[e]),a=S.useCallback(()=>{r(!0)},[]),l=S.useCallback((u,f)=>{e.chain().focus().extendMarkRange("link").setLink({href:u,target:f?"_blank":""}).run(),r(!1)},[e]),c=S.useCallback(()=>(e.chain().focus().extendMarkRange("link").unsetLink().run(),r(!1),null),[e]);return w.jsx(bL,{editor:e,pluginKey:"textMenu",shouldShow:s,updateDelay:0,tippyOptions:{popperOptions:{modifiers:[{name:"flip",enabled:!1}]},appendTo:()=>t==null?void 0:t.current,onHidden:()=>{r(!1)}},children:n?w.jsx(Ej,{initialUrl:i,initialOpenInNewTab:o==="_blank",onSetLink:l}):w.jsx(oZ,{url:i,onClear:c,onEdit:a})})};var Wg="Popover",[jj]=ms(Wg,[Tc]),Sd=Tc(),[aZ,za]=jj(Wg),zj=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:s=!1}=e,a=Sd(t),l=S.useRef(null),[c,u]=S.useState(!1),[f,d]=Xl({prop:r,defaultProp:i??!1,onChange:o,caller:Wg});return w.jsx(hS,{...a,children:w.jsx(aZ,{scope:t,contentId:ci(),triggerRef:l,open:f,onOpenChange:d,onOpenToggle:S.useCallback(()=>d(h=>!h),[d]),hasCustomAnchor:c,onCustomAnchorAdd:S.useCallback(()=>u(!0),[]),onCustomAnchorRemove:S.useCallback(()=>u(!1),[]),modal:s,children:n})})};zj.displayName=Wg;var Ij="PopoverAnchor",lZ=S.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=za(Ij,n),o=Sd(n),{onCustomAnchorAdd:s,onCustomAnchorRemove:a}=i;return S.useEffect(()=>(s(),()=>a()),[s,a]),w.jsx(vg,{...o,...r,ref:t})});lZ.displayName=Ij;var Pj="PopoverTrigger",Bj=S.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=za(Pj,n),o=Sd(n),s=Ie(t,i.triggerRef),a=w.jsx(xe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Vj(i.open),...r,ref:s,onClick:Q(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?a:w.jsx(vg,{asChild:!0,...o,children:a})});Bj.displayName=Pj;var cZ="PopoverPortal",[see,uZ]=jj(cZ,{forceMount:void 0}),oc="PopoverContent",Hj=S.forwardRef((e,t)=>{const n=uZ(oc,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,o=za(oc,e.__scopePopover);return w.jsx(co,{present:r||o.open,children:o.modal?w.jsx(dZ,{...i,ref:t}):w.jsx(hZ,{...i,ref:t})})});Hj.displayName=oc;var fZ=fa("PopoverContent.RemoveScroll"),dZ=S.forwardRef((e,t)=>{const n=za(oc,e.__scopePopover),r=S.useRef(null),i=Ie(t,r),o=S.useRef(!1);return S.useEffect(()=>{const s=r.current;if(s)return bg(s)},[]),w.jsx(ld,{as:fZ,allowPinchZoom:!0,children:w.jsx($j,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Q(e.onCloseAutoFocus,s=>{var a;s.preventDefault(),o.current||(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:Q(e.onPointerDownOutside,s=>{const a=s.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0,c=a.button===2||l;o.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:Q(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),hZ=S.forwardRef((e,t)=>{const n=za(oc,e.__scopePopover),r=S.useRef(!1),i=S.useRef(!1);return w.jsx($j,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var s,a;(s=e.onCloseAutoFocus)==null||s.call(e,o),o.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),o.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:o=>{var l,c;(l=e.onInteractOutside)==null||l.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const s=o.target;((c=n.triggerRef.current)==null?void 0:c.contains(s))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),$j=S.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:u,...f}=e,d=za(oc,n),h=Sd(n);return dg(),w.jsx(sd,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:w.jsx(od,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:u,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>d.onOpenChange(!1),children:w.jsx(pS,{"data-state":Vj(d.open),role:"dialog",id:d.contentId,...h,...f,ref:t,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),Uj="PopoverClose",pZ=S.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=za(Uj,n);return w.jsx(xe.button,{type:"button",...r,ref:t,onClick:Q(e.onClick,()=>i.onOpenChange(!1))})});pZ.displayName=Uj;var mZ="PopoverArrow",gZ=S.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=Sd(n);return w.jsx(mS,{...i,...r,ref:t})});gZ.displayName=mZ;function Vj(e){return e?"open":"closed"}var Fj=zj,qj=Bj,Kj=Hj;const vZ=e=>e.type==="option",yZ=e=>e.type==="category",bZ=({options:e})=>{const t=S.useMemo(()=>e.find(n=>n.type==="option"&&n.isActive()),[e]);return w.jsxs(rj,{children:[w.jsx(ij,{asChild:!0,children:w.jsxs(Yi.Button,{active:(t==null?void 0:t.id)!=="paragraph"&&!!(t!=null&&t.type),children:[w.jsx(pt,{name:(t==null?void 0:t.type)==="option"&&t.icon||"Pilcrow"}),w.jsx(pt,{name:"ChevronDown",className:"h-2 w-2"})]})}),w.jsx(oj,{asChild:!0,children:w.jsx(kc,{className:"flex flex-col gap-1 px-2 py-4",children:e.map(n=>{if(vZ(n))return w.jsxs(Sj,{onClick:n.onClick,isActive:n.isActive(),children:[w.jsx(pt,{name:n.icon,className:"mr-1 h-4 w-4"}),n.label]},n.id);if(yZ(n))return w.jsx("div",{className:"mt-2 first:mt-0",children:w.jsx(gJ,{children:n.label},n.id)},n.id)})})})]})},xZ=({onSetLink:e})=>w.jsxs(Fj,{children:[w.jsx(qj,{asChild:!0,children:w.jsx(Yi.Button,{tooltip:"Set Link",children:w.jsx(pt,{name:"Link"})})}),w.jsx(Kj,{children:w.jsx(Ej,{onSetLink:e})})]}),SZ=e=>{const t=S.useCallback(()=>e.chain().focus().toggleBold().run(),[e]),n=S.useCallback(()=>e.chain().focus().toggleItalic().run(),[e]),r=S.useCallback(()=>e.chain().focus().toggleStrike().run(),[e]),i=S.useCallback(()=>e.chain().focus().toggleUnderline().run(),[e]),o=S.useCallback(()=>e.chain().focus().toggleCode().run(),[e]),s=S.useCallback(()=>e.chain().focus().toggleSubscript().run(),[e]),a=S.useCallback(()=>e.chain().focus().toggleSuperscript().run(),[e]),l=S.useCallback(()=>e.chain().focus().setTextAlign("left").run(),[e]),c=S.useCallback(()=>e.chain().focus().setTextAlign("center").run(),[e]),u=S.useCallback(()=>e.chain().focus().setTextAlign("right").run(),[e]),f=S.useCallback(()=>e.chain().focus().setTextAlign("justify").run(),[e]),d=S.useCallback((h,p)=>e.chain().focus().setLink({href:h,target:p?"_blank":""}).run(),[e]);return{onBold:t,onItalic:n,onStrike:r,onUnderline:i,onCode:o,onSubscript:s,onSuperscript:a,onAlignLeft:l,onAlignCenter:c,onAlignRight:u,onAlignJustify:f,onLink:d}},wZ=e=>Ug({editor:e,selector:t=>[{type:"category",label:"Turn into",id:"turninto"},{icon:"Pilcrow",onClick:()=>t.editor.chain().focus().liftListItem("listItem").setParagraph().run(),id:"paragraph",disabled:()=>!t.editor.can().setParagraph(),isActive:()=>t.editor.isActive("paragraph")&&!t.editor.isActive("orderedList")&&!t.editor.isActive("bulletList"),label:"Paragraph",type:"option"},{icon:"Heading1",onClick:()=>t.editor.chain().focus().liftListItem("listItem").setHeading({level:1}).run(),id:"heading1",disabled:()=>!t.editor.can().setHeading({level:1}),isActive:()=>t.editor.isActive("heading",{level:1}),label:"Heading 1",type:"option"},{icon:"Heading2",onClick:()=>t.editor.chain().focus().liftListItem("listItem").setHeading({level:2}).run(),id:"heading2",disabled:()=>!t.editor.can().setHeading({level:2}),isActive:()=>t.editor.isActive("heading",{level:2}),label:"Heading 2",type:"option"},{icon:"Heading3",onClick:()=>t.editor.chain().focus().liftListItem("listItem").setHeading({level:3}).run(),id:"heading3",disabled:()=>!t.editor.can().setHeading({level:3}),isActive:()=>t.editor.isActive("heading",{level:3}),label:"Heading 3",type:"option"},{icon:"Heading4",onClick:()=>t.editor.chain().focus().liftListItem("listItem").setHeading({level:4}).run(),id:"heading4",disabled:()=>!t.editor.can().setHeading({level:4}),isActive:()=>t.editor.isActive("heading",{level:4}),label:"Heading 4",type:"option"},{icon:"Heading5",onClick:()=>t.editor.chain().focus().liftListItem("listItem").setHeading({level:5}).run(),id:"heading5",disabled:()=>!t.editor.can().setHeading({level:5}),isActive:()=>t.editor.isActive("heading",{level:5}),label:"Heading 5",type:"option"},{icon:"Heading6",onClick:()=>t.editor.chain().focus().liftListItem("listItem").setHeading({level:6}).run(),id:"heading6",disabled:()=>!t.editor.can().setHeading({level:6}),isActive:()=>t.editor.isActive("heading",{level:6}),label:"Heading 6",type:"option"},{icon:"Quote",onClick:()=>t.editor.chain().focus().liftListItem("listItem").toggleBlockquote().run(),id:"blockquote",disabled:()=>!t.editor.can().toggleBlockquote(),isActive:()=>t.editor.isActive("blockquote"),label:"Blockquote",type:"option"},{icon:"List",onClick:()=>t.editor.chain().focus().toggleBulletList().run(),id:"bulletList",disabled:()=>!t.editor.can().toggleBulletList(),isActive:()=>t.editor.isActive("bulletList"),label:"Bullet list",type:"option"},{icon:"ListOrdered",onClick:()=>t.editor.chain().focus().toggleOrderedList().run(),id:"orderedList",disabled:()=>!t.editor.can().toggleOrderedList(),isActive:()=>t.editor.isActive("orderedList"),label:"Numbered list",type:"option"}]}),EZ=e=>{const t=Ug({editor:e,selector:r=>({isBold:r.editor.isActive("bold"),isItalic:r.editor.isActive("italic"),isStrike:r.editor.isActive("strike"),isUnderline:r.editor.isActive("underline"),isCode:r.editor.isActive("code"),isSubscript:r.editor.isActive("subscript"),isSuperscript:r.editor.isActive("superscript"),isAlignLeft:r.editor.isActive({textAlign:"left"}),isAlignCenter:r.editor.isActive({textAlign:"center"}),isAlignRight:r.editor.isActive({textAlign:"right"}),isAlignJustify:r.editor.isActive({textAlign:"justify"})})});return{shouldShow:S.useCallback(({view:r})=>!r||e.view.dragging||xJ(e)?!1:SJ({editor:e}),[e]),...t}},sr=S.memo(Yi.Button),CZ=S.memo(bZ),TZ=({editor:e,appendTo:t})=>{const[n,r]=S.useState(!1),i=SZ(e),o=EZ(e),s=wZ(e);return S.useEffect(()=>{let a;const l=()=>{r(!0),a&&window.clearTimeout(a),a=window.setTimeout(()=>r(!1),500)};return e.on("selectionUpdate",l),()=>{e.off("selectionUpdate",l)}},[]),w.jsx(bL,{className:n?"invisible opacity-0":"",tippyOptions:{popperOptions:{placement:"top-start",modifiers:[{name:"preventOverflow",options:{padding:64}},{name:"flip",options:{fallbackPlacements:["bottom-start","top-end","bottom-end"]}}]},appendTo:()=>t==null?void 0:t.current,offset:[0,8],maxWidth:"calc(100vw - 16px)"},editor:e,pluginKey:"textMenu",shouldShow:o.shouldShow,updateDelay:0,children:w.jsx(Yi.Wrapper,{isVertical:!0,children:w.jsxs("div",{className:"grid grid-cols-4 gap-y-1 sm:flex sm:gap-x-1",children:[w.jsx(CZ,{options:s}),w.jsx(sr,{tooltip:"Bold",tooltipShortcut:["Mod","B"],onClick:i.onBold,active:o.isBold,children:w.jsx(pt,{name:"Bold"})}),w.jsx(sr,{tooltip:"Italic",tooltipShortcut:["Mod","I"],onClick:i.onItalic,active:o.isItalic,children:w.jsx(pt,{name:"Italic"})}),w.jsx(sr,{tooltip:"Underline",tooltipShortcut:["Mod","U"],onClick:i.onUnderline,active:o.isUnderline,children:w.jsx(pt,{name:"Underline"})}),w.jsx(sr,{tooltip:"Strikehrough",tooltipShortcut:["Mod","Shift","S"],onClick:i.onStrike,active:o.isStrike,children:w.jsx(pt,{name:"Strikethrough"})}),w.jsx(sr,{tooltip:"Code",tooltipShortcut:["Mod","E"],onClick:i.onCode,active:o.isCode,children:w.jsx(pt,{name:"Code"})}),w.jsx(xZ,{onSetLink:i.onLink}),w.jsxs(Fj,{children:[w.jsx(qj,{asChild:!0,children:w.jsx(sr,{tooltip:"More options",children:w.jsx(pt,{name:"EllipsisVertical"})})}),w.jsx(Kj,{side:"top",asChild:!0,children:w.jsxs(Yi.Wrapper,{children:[w.jsx(sr,{tooltip:"Subscript",tooltipShortcut:["Mod","."],onClick:i.onSubscript,active:o.isSubscript,children:w.jsx(pt,{name:"Subscript"})}),w.jsx(sr,{tooltip:"Superscript",tooltipShortcut:["Mod",","],onClick:i.onSuperscript,active:o.isSuperscript,children:w.jsx(pt,{name:"Superscript"})}),w.jsx(Yi.Divider,{}),w.jsx(sr,{tooltip:"Align left",tooltipShortcut:["Shift","Mod","L"],onClick:i.onAlignLeft,active:o.isAlignLeft,children:w.jsx(pt,{name:"AlignLeft"})}),w.jsx(sr,{tooltip:"Align center",tooltipShortcut:["Shift","Mod","E"],onClick:i.onAlignCenter,active:o.isAlignCenter,children:w.jsx(pt,{name:"AlignCenter"})}),w.jsx(sr,{tooltip:"Align right",tooltipShortcut:["Shift","Mod","R"],onClick:i.onAlignRight,active:o.isAlignRight,children:w.jsx(pt,{name:"AlignRight"})}),w.jsx(sr,{tooltip:"Justify",tooltipShortcut:["Shift","Mod","J"],onClick:i.onAlignJustify,active:o.isAlignJustify,children:w.jsx(pt,{name:"AlignJustify"})})]})})]})]})})})};function MZ({editor:e}){const[t,n]=S.useState({characters:0,words:0}),r=e.storage;return S.useEffect(()=>{const i=()=>{n({characters:r.characterCount.characters(),words:r.characterCount.words()})};return e.on("transaction",i),()=>{e.off("transaction",i)}},[e]),!e||t.characters===0?w.jsx("div",{}):w.jsxs("div",{className:"mx-1 mt-2 flex justify-end gap-1 text-sm",children:[w.jsxs("span",{children:["Characters: ",t.characters]}),"/",w.jsxs("span",{children:["Words: ",t.words]})]})}const OZ=()=>[fJ,BQ,fQ.configure({codeBlock:!1}),oX,aX,lX,bJ,xj.configure({openOnClick:!1}),dX.configure({multicolor:!0}),PQ,pQ.extend({addKeyboardShortcuts(){return{}}}).configure({types:["heading","paragraph"]}),dQ,hQ,IQ,mX.configure({includeChildren:!0,showOnlyCurrent:!1,placeholder:()=>""}),yJ,cX],AZ=({initialContent:e="",...t})=>({editor:xY({...t,immediatelyRender:!0,shouldRerenderOnTransaction:!1,autofocus:!0,onCreate:r=>{r.editor.isEmpty&&(r.editor.commands.setContent(e),r.editor.commands.focus("start",{scrollIntoView:!0}))},extensions:OZ(),editorProps:{attributes:{autocomplete:"off",autocorrect:"off",autocapitalize:"off",class:"min-h-full prose"}}},[])});function kZ({initialContent:e,onChange:t,className:n}){const r=S.useRef(null),i=S.useRef(null),{editor:o}=AZ({initialContent:e,onUpdate:({editor:s})=>{const a=s.getHTML();t==null||t(a.replace(/<p><\/p>$/,""))}});return o?w.jsxs("div",{className:"relative flex flex-1 flex-col",ref:r,children:[w.jsxs("div",{className:Te("group relative overflow-y-auto bg-base-200 px-8 py-6",n),ref:i,onFocus:()=>{document.documentElement.dataset.editingRichText="true"},onBlur:()=>{delete document.documentElement.dataset.editingRichText},children:[w.jsx(fY,{editor:o,className:"flex-1"}),w.jsx(nX,{editor:o,wrapper:i})]}),w.jsx(MZ,{editor:o}),w.jsx(sZ,{editor:o,appendTo:r}),w.jsx(TZ,{editor:o,appendTo:r})]}):null}const Wj=S.createContext(void 0);function DZ({children:e}){const[t,n]=S.useState(null),r=S.useCallback(o=>{n(o)},[]),i=S.useCallback(()=>{n(null)},[]);return w.jsxs(Wj.Provider,{value:{openTaskId:t,openNotes:r,closeNotes:i},children:[e,w.jsx(NZ,{})]})}function Yj(){const e=S.useContext(Wj);if(!e)throw new Error("useTaskNotes must be used within TaskNotesProvider");return e}function NZ(){const{openTaskId:e,closeNotes:t}=Yj(),n=pc(),r=ir(),i=g2(),o=S.useRef(null),[s,a]=S.useState("editing"),l=e?n.tasks.find(u=>u.id===e):null;S.useEffect(()=>{l&&a("editing")},[l==null?void 0:l.id]),S.useEffect(()=>{o.current&&s==="closing"&&Promise.allSettled(o.current.getAnimations().map(({finished:u})=>u)).then(()=>t())},[s]);const c=()=>{a("closing")};return l?w.jsx(SV,{open:s!=="closing",onOpenChange:()=>{document.querySelector("html[data-editing-rich-text]")||c()},children:w.jsxs(wV,{children:[w.jsx(EV,{className:Te("fixed inset-0 isolate z-40 bg-base-300/75","data-[state=closed]:animate-fade-out data-[state=open]:animate-fade-in")}),w.jsx(CV,{ref:o,className:Te("fixed top-0 right-0 isolate z-40 flex h-full w-full flex-col overflow-y-auto bg-base-100 p-6 shadow-xl","data-[state=closed]:animate-slide-out-right data-[state=open]:animate-slide-in-right","md:w-3/4 md:max-w-3xl lg:w-2/3"),children:w.jsxs("div",{className:"relative flex flex-col gap-4",children:[w.jsx(TV,{className:"h1",children:l.name}),w.jsx("button",{className:"btn btn-ghost btn-sm btn-square absolute top-0 right-0",onClick:c,children:"✕"}),w.jsx(MV,{className:"sr-only",children:"Task notes"}),w.jsx("div",{className:"flex h-[85vh] flex-col",children:w.jsxs("div",{className:"flex flex-1 flex-col gap-6",children:[w.jsx(kZ,{initialContent:l.notesHtml??"",onChange:u=>{r({type:"SET_TASK_NOTES",taskId:l.id,notesHtml:u})},className:"max-h-[74vh]"},l.id),i()&&w.jsx("div",{className:"ml-auto flex items-center gap-1 text-base-content/60 text-xs",children:"Saving..."})]})})]})})]})}):null}function jm({task:e,hideForDragging:t,className:n}){const r=ir(),{projectMode:i}=ud();return w.jsx("button",{tabIndex:0,"aria-label":e.done?"Done":"Not done",type:"button",onClick:o=>{i!=="split"&&(o.stopPropagation(),r({type:"SET_TASK_DONE",taskId:e.id,done:!e.done}))},onKeyDown:o=>{o.stopPropagation()},className:Te("h-4 w-4 flex-none translate-y-0.5 items-center justify-center rounded-full border border-base-content/60 shadow-inner outline-hidden focus:border-2 focus:border-neutral-content focus:ring-0 active:border-2",t&&"!opacity-0",n),children:e.done?w.jsx(id,{className:"h-2.5 w-2.5 translate-x-1 text-gray-400"}):""})}function _Z({task:e,onDeleted:t,onTaskCreatedAfter:n,index:r,variant:i}){const o=ir(),{openNotes:s}=Yj(),[a,l]=S.useState(!1),[c,u]=S.useState(16),f=S.useRef(null),d=S.useRef(null),h=S.useRef(null),{handleClick:p,handleFocus:g}=ug(),{projectMode:y}=ud(),{ref:v,handleRef:b,isDragging:x}=iV({id:`task:${e.id}`,index:r,data:{elementType:"sortableTask",task:e}}),m=()=>{if(!f.current)return;if(f.current.value===""){o({type:"DELETE_TASK",taskId:e.id}),t(r);return}const E=f.current.value.trim();E&&E!==e.name&&o({type:"RENAME_TASK",taskId:e.id,name:E})};return a?w.jsx("form",{style:{height:c},className:"h-5 w-full",onSubmit:E=>{var T;E.preventDefault(),m(),ke.flushSync(()=>{l(!1)}),(T=d.current)==null||T.focus()},children:w.jsxs("div",{className:"flex w-full items-start gap-1",children:[i==="mobile"&&w.jsx(Yl,{}),w.jsx(jm,{task:e}),w.jsx("textarea",{className:"min-w-0 flex-1 translate-x-1 resize-none overflow-hidden border-0 bg-transparent p-0.5 pb-0 text-[12px] text-base-content/60 leading-[16px] placeholder:text-base-content/60 focus:shadow-md focus:ring-1 focus:ring-indigo-600",style:{height:c},ref:f,"aria-label":e.name,name:"name",defaultValue:e.name,onFocus:g,onKeyDown:E=>{var T,C;if(E.stopPropagation(),E.key==="Escape")ke.flushSync(()=>{l(!1)}),(T=d.current)==null||T.focus();else if(E.key==="Enter"){E.preventDefault();const O=f.current,A=O&&O.selectionStart===O.value.length&&O.selectionEnd===O.value.length;E.shiftKey&&A?(m(),o({type:"CREATE_TASK_AFTER",id:crypto.randomUUID(),afterTaskId:e.id}),ke.flushSync(()=>{l(!1)}),n(r)):E.shiftKey||(m(),ke.flushSync(()=>{l(!1)}),(C=d.current)==null||C.focus())}},onClick:E=>E.stopPropagation(),onChange:E=>{const T=E.target.scrollHeight;c!==T&&u(T)},onBlur:()=>{m(),l(!1)}}),w.jsx("button",{type:"button",className:Te("mt-0.5 flex-none rounded p-0.5 hover:bg-base-300",e.notesHtml?"text-base-content/40":"text-base-content/20"),title:"Notes",onClick:E=>{E.stopPropagation(),s(e.id)},children:w.jsx(CC,{className:"size-3"})})]})}):w.jsxs("div",{ref:E=>{v(E),h.current=E},...i==="desktop"?{tabIndex:-1}:{},className:Te("group/task flex w-full items-start gap-1 rounded",i==="desktop"&&"touch-none",x&&"bg-neutral-content/50 pb-1 text-transparent blur-xs"),children:[i==="mobile"&&w.jsx(Yl,{ref:b,onClick:E=>{E.stopPropagation()},className:Te("touch-none",x&&"focus:border-transparent"),tabIndex:-1}),w.jsx(jm,{className:Te(i==="desktop"&&"opacity-[var(--idle-opacity)] group-hover:opacity-[var(--hover-opacity)]"),hideForDragging:x,task:e}),w.jsx("button",{tabIndex:0,className:Te("flex-grow cursor-text break-words border-2 border-transparent px-1 text-left text-[12px] text-base-content/60 leading-[16px] outline-hidden focus:border-gray-100 focus:ring-0 active:border-transparent",x?"text-transparent focus:border-transparent":"focus:border-neutral-content",e.done&&"line-through"),ref:d,"aria-label":e.name,type:"button","data-task-index":r,onKeyDown:E=>{["Backspace","Delete"].includes(E.key)&&(E.stopPropagation(),o({type:"DELETE_TASK",taskId:e.id}),t(r))},onClick:E=>{var C,O;if(y==="split")return;E.stopPropagation();const T=((C=h.current)==null?void 0:C.offsetHeight)??16;p(E),ke.flushSync(()=>{u(T)}),ke.flushSync(()=>{l(!0)}),(O=f.current)==null||O.focus()},children:e.name}),w.jsx("button",{type:"button",className:Te("mt-0.5 flex-none rounded p-0.5 hover:bg-base-300",e.notesHtml?"text-base-content/40":"text-base-content/20 opacity-0 group-hover/task:opacity-100",x&&"invisible"),title:"Notes",onClick:E=>{E.stopPropagation(),s(e.id)},children:w.jsx(CC,{className:"size-3"})})]})}function RZ({task:e,index:t,variant:n,onDeleted:r,onTaskCreatedAfter:i}){const[o,s]=S.useState(!1),{projectMode:a,setProjectMode:l}=ud(),c=ir(),{layers:u}=pc();return w.jsxs("div",{...a==="split"?{onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1)}:{},onClick:f=>{if(a!=="split")return;f.stopPropagation(),l("default");const d=u.find(g=>g.id===e.layerId);if(!d)return;const h=u.filter(g=>g.sliceId===d.sliceId&&g.sorting>d.sorting).sort((g,y)=>g.sorting-y.sorting)[0],p=h?(d.sorting+h.sorting)/2:d.sorting+1;c({type:"SPLIT_LAYER",taskId:e.id,newLayerId:crypto.randomUUID(),currentLayerId:e.layerId,sliceId:d.sliceId,taskSorting:e.sorting,newLayerSorting:p})},children:[w.jsx("div",{className:Te("flex gap-1",n==="desktop"&&"group/task"),children:w.jsx(_Z,{variant:n,index:t,onDeleted:r,onTaskCreatedAfter:i,task:e})}),a==="split"&&o&&w.jsx("hr",{className:"-ml-4 -mr-16 my-4 border-base-content/10 border-dashed"})]})}function LZ({tasks:e,layer:t,variant:n}){const r=S.useRef(null);function i(s){var c;const a=u=>{var f;return(f=r.current)==null?void 0:f.querySelector(`[data-task-index="${u}"]`)},l=a(s+1)??a(s-1)??((c=r.current)==null?void 0:c.querySelector("input"));l==null||l.focus()}function o(s){setTimeout(()=>{var l;const a=(l=r.current)==null?void 0:l.querySelector(`[data-task-index="${s+1}"]`);a==null||a.click()},0)}return w.jsxs("div",{className:"relative flex flex-1 flex-col px-4",ref:r,children:[e.map((s,a)=>w.jsx(RZ,{task:s,index:a,variant:n,onDeleted:i,onTaskCreatedAfter:o},s.id)),w.jsx(O8,{layer:t,tasks:e,variant:n})]})}function jZ({layer:e,tasks:t,layerIndex:n,totalLayers:r,variant:i,allLayersDone:o}){const{status:s}=e,[a,l]=S.useState(s!=="done"),{ref:c}=NN({id:`droppable-layer:${e.id}`,data:{elementType:"sortableLayer",layer:e}});S.useEffect(()=>{l(s!=="done")},[s]);const u=t.filter(({layerId:p})=>p===e.id),f=s==="done",d=f&&!o,h=n===0?"First":"Then";return w.jsxs("div",{ref:c,className:"group relative isolate flex gap-2",children:[w.jsxs("div",{className:Te("flex w-full flex-col",f&&"group"),children:[a&&(r>1||f)&&w.jsxs("div",{className:"flex items-start gap-1 px-4",children:[f?w.jsx("button",{type:"button",onClick:()=>l(!a),className:"flex size-4 shrink-0 translate-y-0.5 items-center justify-center rounded-sm opacity-0 transition-opacity hover:bg-base-content/10 group-hover:opacity-100",children:w.jsx(EC,{className:"size-3 rotate-90 text-base-content/60"})}):w.jsx("div",{className:"size-4 shrink-0"}),r>1?w.jsx(TC,{id:e.id,name:e.name,placeholder:h}):w.jsxs("span",{className:"p-0.5 font-normal text-base-content/60 text-xs leading-4",children:["(",u.length," ",u.length===1?"task":"tasks",")"]})]}),a?w.jsx(LZ,{variant:i,layer:e,tasks:u}):w.jsx("div",{className:"flex flex-1 flex-col",children:w.jsxs("div",{className:"flex items-start gap-1 px-4",children:[f&&w.jsx("button",{type:"button",onClick:()=>l(!a),className:"flex size-4 shrink-0 translate-y-0.5 items-center justify-center rounded-sm opacity-0 transition-opacity hover:bg-base-content/10 group-hover:opacity-100",children:w.jsx(EC,{className:"size-3 text-base-content/60"})}),w.jsx("div",{className:"flex gap-1 font-normal text-base-content/60 text-xs leading-4",children:r>1?w.jsx(TC,{id:e.id,name:e.name,placeholder:h,suffix:`(${u.length} ${u.length===1?"task":"tasks"})`}):w.jsxs("span",{className:"p-0.5",children:["(",u.length," ",u.length===1?"task":"tasks",")"]})})]})})]}),r>1&&w.jsx("div",{className:"mr-4 flex flex-col items-end gap-2",children:w.jsx(vS,{layer:e})}),d&&w.jsx("div",{className:"-z-10 absolute inset-0 flex items-center justify-center",children:w.jsx(id,{className:"h-10 w-10 text-gray-300 opacity-60"})})]})}function zZ({layer:e}){const t=ir(),n=r=>{(r.key==="Delete"||r.key==="Backspace")&&(r.preventDefault(),r.stopPropagation(),t({type:"UNSPLIT_LAYER",layerId:e.id}))};return w.jsx("button",{type:"button",className:"group cursor-pointer px-6 py-3",onKeyDown:n,tabIndex:0,children:w.jsx("div",{children:w.jsx("hr",{className:"border-base-content/20 border-t-2 border-dashed group-focus:border-primary"})})})}function Gj({layers:e,tasks:t,variant:n,allLayersDone:r}){return w.jsx("div",{className:Te("flex flex-col pt-1",n==="desktop"&&"flex-1",n==="mobile"&&"pb-8"),children:e.map((i,o)=>w.jsxs(w.Fragment,{children:[w.jsx(jZ,{layer:i,tasks:t,layerIndex:o,totalLayers:e.length,variant:n,allLayersDone:r}),o<e.length-1&&w.jsx(zZ,{layer:i})]},i.id))})}const Xj=S.forwardRef(({children:e,slice:t,layers:n,...r},i)=>{const o=n.filter(a=>a.sliceId===(t==null?void 0:t.id)),s=o.length>0&&o.every(a=>a.status==="done");return w.jsxs("div",{...r,"data-slice-wrapper":t==null?void 0:t.id,ref:i,className:Te("relative isolate flex min-h-[calc((100dvh-112px)/3)] flex-1 flex-col gap-1 bg-white py-3 transition-all duration-200",s&&"border-transparent",r.className),children:[e,s&&w.jsx("div",{className:"-z-10 absolute inset-0 flex items-center justify-center",children:w.jsx(id,{className:"h-36 w-36 text-gray-300 opacity-60"})})]})});function IZ({slice:e,variant:t,selectedSliceId:n,layers:r,tasks:i}){const o=r.filter(({sliceId:l})=>l===e.id),s=o[0],a=o.length>0&&o.every(l=>l.status==="done");return t==="mobile"?w.jsxs("div",{className:Te("flex h-[10vh] items-center justify-center overflow-hidden border border-base-content/10 text-center font-bold text-xs sm:hidden",n===e.id?"bg-base-100":"bg-zinc-300"),children:[a&&w.jsx("div",{className:"absolute inset-0 z-10 flex items-center justify-center",children:w.jsx(id,{className:"size-12 text-gray-300"})}),w.jsx("span",{className:"line-clamp-3 overflow-hidden text-ellipsis",children:e.name??" "})]}):w.jsxs(Xj,{slice:e,layers:r,style:{height:e.height},className:"bg-base-100/90",children:[w.jsxs("div",{className:"flex items-center gap-1 px-4",children:[w.jsx("div",{className:"mt-0.5 flex flex-1",children:w.jsx("span",{className:Te("flex flex-1 break-words border border-transparent p-0.5 text-left font-bold text-[16px] leading-[18px]",e.name?"text-black":"border-b-neutral-content text-transparent"),children:e.name??"Untitled"})}),o.length===1&&s&&w.jsx(vS,{layer:s}),w.jsx(Yl,{})]}),w.jsx(Gj,{layers:o,tasks:i,variant:"desktop",allLayersDone:a})]})}function Qj({task:e,variant:t}){return w.jsxs("div",{className:Te("flex items-start gap-2 rounded-md bg-base-100 p-1 text-left text-[12px] text-base-content/60 leading-[16px] shadow-md",e.done&&"line-through"),children:[t==="mobile"&&w.jsxs("div",{className:"flex gap-1",children:[w.jsx(Yl,{}),w.jsx(jm,{task:e})]}),t==="desktop"&&w.jsx(jm,{task:e}),e.name]})}function PZ({id:e,name:t}){const n=ir(),[r,i]=S.useState(!1),[o,s]=S.useState(18),a=S.useRef(null),l=S.useRef(null),{handleClick:c,handleFocus:u}=ug(),f=()=>{if(!a.current)return;const h=a.current.value.trim();if(!h){n({type:"UNNAME_SLICE",sliceId:e});return}h!==t&&n({type:"RENAME_SLICE",sliceId:e,name:h})};if(r)return w.jsx("form",{className:"flex-1",style:{height:o},onSubmit:h=>{var p;h.preventDefault(),f(),ke.flushSync(()=>{i(!1)}),(p=document.querySelector(`[data-slice-wrapper='${e}'] [data-task-input]`))==null||p.focus()},children:w.jsx("textarea",{className:"w-full resize-none overflow-hidden break-words border border-transparent bg-transparent p-0.5 font-bold text-[16px] leading-[18px] outline-hidden placeholder:font-bold focus:border-gray-100 focus:shadow-md focus:outline-hidden focus:ring-2 focus:ring-indigo-600",style:{height:o},ref:a,"aria-label":t??"",name:"name",defaultValue:t??"",onFocus:u,onKeyDown:h=>{var p,g;h.key==="Escape"?(h.stopPropagation(),ke.flushSync(()=>{i(!1)}),(p=l.current)==null||p.focus()):h.key==="Enter"&&(h.preventDefault(),f(),ke.flushSync(()=>{i(!1)}),(g=l.current)==null||g.focus())},onChange:h=>{const p=h.target.scrollHeight+2;o!==p&&s(p)},onBlur:()=>{f(),i(!1)}})});const d=t??"Untitled";return w.jsx("button",{tabIndex:0,className:Te("flex flex-1 cursor-text break-words border border-transparent p-0.5 text-left font-bold text-[16px] leading-[18px] focus:border-neutral-content focus:outline-hidden active:border-transparent",t?"text-black":"border-b-neutral-content text-transparent active:border-b-neutral-content"),"aria-label":d,type:"button",ref:l,onClick:h=>{var g;const p=((g=l.current)==null?void 0:g.offsetHeight)??18;c(h),ke.flushSync(()=>{s(p)}),ke.flushSync(()=>{i(!0)}),a.current&&a.current.focus()},children:d})}function Jj(e){const{slice:t,layers:n,tasks:r,variant:i}=e,{ref:o,handleRef:s,isDragging:a}=N5({id:`draggable-slice:${t.id}`,data:{elementType:"draggableSlice",slice:t}}),{ref:l}=NN({id:`droppable-slice:${t.id}`,data:{elementType:"droppableSlice",sliceId:t.id},collisionDetector:PB}),c=i==="desktop"?e.selected:!1,u=i==="desktop"?e.selectSlice:()=>{},f="opacity-[var(--idle-opacity)] group-hover:opacity-[var(--hover-opacity)] transition-all duration-300",d=n.filter(y=>y.sliceId===t.id),h=d[0],p=d.length===1&&h,g=d.length>0&&d.every(y=>y.status==="done");return w.jsxs(Xj,{slice:t,layers:n,ref:y=>{o(y),l(y)},id:Te(i==="desktop"&&`slice-wrapper-${t.id}`,i==="mobile"&&`mobile-slice-wrapper-${t.id}`),style:{"--hover-opacity":1,"--idle-opacity":c?1:0},className:Te("group duration-200",c&&"z-[1] shadow-xl ring-2 ring-base-content/40",a&&i==="desktop"&&"opacity-40"),...i==="desktop"?{onClick:y=>{y.stopPropagation(),u(c?void 0:t.id)},onFocusCapture:()=>u(t.id)}:{},children:[w.jsxs("div",{className:"flex items-center gap-1 px-4",children:[w.jsx("div",{onClick:y=>y.stopPropagation(),className:Te(!t.name&&f,"mt-0.5 flex flex-1"),children:w.jsx(PZ,{id:t.id,name:t.name})}),p&&w.jsx(vS,{layer:h,className:Te(h.status===null&&"opacity-[var(--idle-opacity)] group-hover:opacity-[var(--hover-opacity)]")}),i==="desktop"&&w.jsx(Yl,{ref:s,onClick:y=>{y.stopPropagation()},className:Te("touch-none",a&&"focus:border-transparent",f)})]}),w.jsx(Gj,{layers:n,tasks:r,variant:i,allLayersDone:g})]})}function BZ(e,t,n){if(t===n)return e;const r=e.slice();return r.splice(n,0,r.splice(t,1)[0]),r}function Zj({variant:e,layers:t,tasks:n,dispatch:r}){const{slices:i}=pc(),o=Wl(i,"boxNumber"),[s,a]=S.useState(),[l,c]=S.useState(),[u,f]=S.useState(),d=(()=>{if(!(l&&u!==void 0)||u===l.id)return o;const x=o.findIndex(({boxNumber:E})=>E===l.boxNumber),m=o.findIndex(({id:E})=>E===u);return BZ(o,x,m)})(),h=()=>{a(void 0),c(void 0),f(void 0)},p=nH(s,a,t,n),g=rH({slices:d,draggingSlice:l,overSliceId:u,setOverSliceId:f});return{slices:d,draggingTask:s,draggingSlice:l,handleDragStart:x=>{var T;const m=(T=x.operation.source)==null?void 0:T.data;if(!m)return;if(m.elementType==="draggableSlice"){const C=e==="desktop"?"slice-wrapper":"mobile-box-wrapper",O=iH(m.slice.id,C);c({...m.slice,height:O});return}const E=LN(t,m.task.layerId);a({...m.task,sliceId:E.sliceId})},handleDragEnd:()=>{s&&r({type:"MOVE_TASK",taskId:s.id,layerId:s.layerId,sorting:s.sorting}),l&&u!==void 0&&r({type:"SORT_SLICES",slices:d.map((x,m)=>({id:x.id,boxNumber:m+1}))}),h()},handleDragCancel:h,handleDragOver:x=>{var E;const m=(E=x.operation.target)==null?void 0:E.data;if(m){if(s){p(m);return}if(l){g(m);return}}}}}function HZ(){const e=ir(),{layers:t,tasks:n}=pc(),[r,i]=S.useState(),{projectMode:o,setProjectMode:s}=ud(),a=Wl(t,["sliceId","sorting"]),l=Wl(n,["layerId","sorting"]),{slices:c,draggingTask:u,draggingSlice:f,handleDragStart:d,handleDragEnd:h,handleDragCancel:p,handleDragOver:g}=Zj({variant:"desktop",layers:a,tasks:l,dispatch:e}),y=RN({tasksBeforeDrag:l,draggingTask:u});return S.useEffect(()=>{const v=()=>{i(void 0)},b=x=>{if(x.key==="Escape"){i(void 0),s("default");return}if(x.key==="s"||x.key==="S"){if(x.ctrlKey||x.metaKey||x.altKey)return;const m=document.activeElement;if(m instanceof HTMLInputElement||m instanceof HTMLTextAreaElement||m instanceof HTMLElement&&m.isContentEditable)return;s(o==="split"?"default":"split")}};return window.addEventListener("click",v),window.addEventListener("keydown",b),()=>{window.removeEventListener("click",v),window.removeEventListener("keydown",b)}},[o,s]),w.jsxs(xN,{sensors:[Yx,Wx],onDragStart:d,onDragEnd:(v,b)=>{if(v.canceled){p();return}h(v,b)},onDragOver:g,children:[w.jsxs(_N,{children:[u&&w.jsx(Qj,{task:u,variant:"desktop",selectedSliceId:r,layers:a}),f&&w.jsx(IZ,{slice:f,variant:"desktop",selectedSliceId:r,layers:a,tasks:y})]}),w.jsx("div",{className:"hidden flex-1 flex-col bg-gray-200 sm:flex sm:overflow-y-auto",children:w.jsx("div",{className:"relative grid w-full flex-1 auto-rows-max gap-3 p-3 sm:grid-cols-3 xl:overflow-y-auto",children:c.map(v=>w.jsx(Jj,{variant:"desktop",slice:v,layers:a.filter(({sliceId:b})=>b===v.id),tasks:y,selected:r===v.id,selectSlice:i},v.id))})})]})}function $Z({slice:e,selectedSliceId:t,setSelectedSliceId:n,layers:r}){const i=t===e.id,o=r.filter(({sliceId:a})=>a===e.id),s=o.length>0&&o.every(a=>a.status==="done");return w.jsxs("div",{id:`mobile-box-wrapper-${e.id}`,className:Te("relative isolate flex h-[10vh] touch-none items-center justify-center overflow-hidden text-center font-bold text-xs shadow-[0_0_0_0.3px_black] sm:hidden",i?"border border-black bg-base-100":"bg-base-200"),onClick:a=>{a.stopPropagation(),!i&&n(e.id)},children:[s&&w.jsx("div",{className:"absolute inset-0 z-10 flex items-center justify-center",children:w.jsx(id,{className:"size-12 text-gray-300"})}),w.jsx("span",{className:"z-20 line-clamp-3 overflow-hidden text-ellipsis",children:e.name??" "})]})}function UZ(){var y;const e=ir(),{layers:t,tasks:n}=pc(),r=S.useRef(null),i=Wl(t,["sliceId","sorting"]),o=Wl(n,["layerId","sorting"]),{slices:s,draggingTask:a,handleDragStart:l,handleDragEnd:c,handleDragCancel:u,handleDragOver:f}=Zj({variant:"mobile",layers:i,tasks:o,dispatch:e}),d=RN({tasksBeforeDrag:o,draggingTask:a}),[h,p]=S.useState(((y=s[0])==null?void 0:y.id)||""),g=s.find(v=>v.id===h);return w.jsxs(xN,{sensors:[Yx,Wx],onDragStart:l,onDragEnd:(v,b)=>{if(v.canceled){u();return}c(v,b)},onDragOver:f,children:[w.jsx(_N,{children:a&&w.jsx(Qj,{task:a,variant:"mobile",selectedSliceId:h,layers:i})}),w.jsx("div",{className:"grid grid-cols-3 border-black border-b-2 sm:hidden",children:s.map(v=>w.jsx($Z,{slice:v,selectedSliceId:h,setSelectedSliceId:p,layers:i},v.id))}),w.jsx("div",{className:"flex-1 overflow-y-auto bg-base-100 sm:hidden",ref:r,children:g&&w.jsx(Jj,{variant:"mobile",slice:g,layers:i.filter(({sliceId:v})=>v===g.id),tasks:d})})]})}function VZ(){return w.jsxs(w.Fragment,{children:[w.jsx(UZ,{}),w.jsx(HZ,{})]})}const cO="/assets/logo-B8C4aIsj.png";function FZ({name:e}){const t=ir(),[n,r]=S.useState(!1),[i,o]=S.useState(18),s=S.useRef(null),a=S.useRef(null),{handleClick:l,handleFocus:c}=ug(),u=()=>{if(!s.current)return;const f=s.current.value.trim();f&&f!==e&&t({type:"RENAME_PROJECT",name:f})};return n?w.jsx("form",{className:"flex-1",style:{height:i},onSubmit:f=>{f.preventDefault(),u(),ke.flushSync(()=>{r(!1)})},children:w.jsx("textarea",{className:"w-full resize-none overflow-hidden break-words border border-transparent bg-transparent p-0.5 font-bold text-[14px] text-white leading-[16px] outline-hidden placeholder:font-bold focus:border-gray-100 focus:shadow-md focus:outline-hidden focus:ring-2 focus:ring-indigo-600",style:{height:i},ref:s,"aria-label":e,name:"name",defaultValue:e,onFocus:c,onKeyDown:f=>{var d,h;f.key==="Escape"?(f.stopPropagation(),ke.flushSync(()=>{r(!1)}),(d=a.current)==null||d.focus()):f.key==="Enter"&&(f.preventDefault(),u(),ke.flushSync(()=>{r(!1)}),(h=a.current)==null||h.focus())},onChange:f=>{const d=f.target.scrollHeight+2;i!==d&&o(d)},onBlur:()=>{u(),r(!1)}})}):w.jsx("button",{tabIndex:0,className:"flex flex-1 cursor-text break-words border border-transparent p-0.5 text-left font-bold text-[14px] text-white leading-[16px] focus:border-neutral-content focus:outline-hidden active:border-transparent","aria-label":e,type:"button",ref:a,onClick:f=>{var h;const d=((h=a.current)==null?void 0:h.offsetHeight)??18;l(f),ke.flushSync(()=>{o(d)}),ke.flushSync(()=>{r(!0)}),s.current&&s.current.focus()},children:e})}function qZ({children:e}){const t=pc(),n=ir(),r=g2(),i=nP(),{projectMode:o,setProjectMode:s}=ud(),[a,l]=S.useState(!1),c=S.useRef(!1),u=async()=>{await QE(t),i()};S.useEffect(()=>{const d=h=>{(h.metaKey||h.ctrlKey)&&h.key==="s"&&(h.preventDefault(),u())};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[t]);const f=r();return c.current=f,S.useEffect(()=>{J4(f)},[f]),S.useEffect(()=>{if(!f)return;const d=setTimeout(()=>{QE(t).then(i)},1e3);return()=>clearTimeout(d)},[f,t]),S.useEffect(()=>Z4(async()=>{if(c.current)return;const d=await m2();n({type:"LOAD_STATE",state:d})},()=>l(!0)),[]),S.useEffect(()=>{const d=h=>{f&&h.preventDefault()};return window.addEventListener("beforeunload",d),()=>window.removeEventListener("beforeunload",d)},[f]),a?w.jsxs("div",{"data-theme":"dark",className:"flex h-[100dvh] flex-col items-center justify-center gap-4 bg-(--dark-bg) text-white",children:[w.jsx("img",{src:cO,alt:"Vertical",className:"max-w-12"}),w.jsx("h1",{className:"font-bold text-xl",children:"Disconnected"}),w.jsx("p",{className:"text-base-content/50",children:"The Vertical server has stopped."}),f&&w.jsx("p",{className:"text-sm text-warning",children:"You have unsaved changes that may be lost."})]}):w.jsxs("div",{className:Te("flex h-[100dvh] flex-col lg:overflow-hidden",o==="split"&&"split-mode-cursor"),children:[w.jsx("title",{children:t.project.name}),w.jsxs("div",{"data-theme":"dark",className:"navbar sticky top-0 z-10 gap-2 bg-(--dark-bg) px-4 lg:px-6",children:[w.jsx("div",{className:"flex shrink-0 items-center",children:w.jsx("img",{src:cO,alt:"Vertical",className:"max-w-8"})}),w.jsx(FZ,{name:t.project.name}),w.jsx("span",{className:Te("flex items-center gap-1 text-accent text-xs",!f&&"invisible"),children:"● Saving..."}),w.jsx("ul",{className:"menu menu-horizontal ml-auto shrink-0 flex-nowrap gap-1 px-1",children:w.jsx("li",{children:w.jsx("button",{className:Te("btn btn-neutral btn-sm hidden sm:inline-flex",o==="split"&&"ring-2 ring-accent"),onClick:()=>s(o==="split"?"default":"split"),children:w.jsx("span",{className:"text-2xl",children:"✂"})})})})]}),e]})}function KZ(){const[e,t]=S.useState(null),[n,r]=S.useState(null);return S.useEffect(()=>{m2().then(t).catch(i=>r(i.message))},[]),n?w.jsx("div",{className:"flex h-[100dvh] items-center justify-center bg-gray-200",children:w.jsx("div",{className:"rounded-lg bg-white p-8 shadow-md",children:w.jsx("p",{className:"text-red-600",children:n})})}):e?w.jsx(tP,{initialState:e,children:w.jsx(sV,{children:w.jsx(DZ,{children:w.jsx(qZ,{children:w.jsx(VZ,{})})})})}):w.jsx("div",{className:"flex h-[100dvh] items-center justify-center bg-gray-200",children:w.jsx("span",{className:"loading loading-spinner loading-lg"})})}X4.createRoot(document.getElementById("root")).render(w.jsx(KZ,{}));