datool 0.0.4 → 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.
- package/client-dist/assets/index-DUkIilaZ.css +1 -0
- package/client-dist/assets/index-OdNyDkx7.js +164 -0
- package/client-dist/index.html +2 -2
- package/package.json +1 -1
- package/src/client/App.tsx +146 -6
- package/src/client/components/data-table.tsx +3 -0
- package/src/client/components/viewer-settings.tsx +67 -0
- package/src/client/index.css +3 -0
- package/src/client/lib/datool-url-state.ts +29 -2
- package/client-dist/assets/index-B5MN-j1l.js +0 -164
- package/client-dist/assets/index-BkIiz0aS.css +0 -1
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
function mO(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const o in r)if(o!=="default"&&!(o in t)){const l=Object.getOwnPropertyDescriptor(r,o);l&&Object.defineProperty(t,o,l.get?l:{enumerable:!0,get:()=>r[o]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const l of o)if(l.type==="childList")for(const a of l.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(o){const l={};return o.integrity&&(l.integrity=o.integrity),o.referrerPolicy&&(l.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?l.credentials="include":o.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function r(o){if(o.ep)return;o.ep=!0;const l=n(o);fetch(o.href,l)}})();function c1(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Vh={exports:{}},Fl={};var Sb;function gO(){if(Sb)return Fl;Sb=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(r,o,l){var a=null;if(l!==void 0&&(a=""+l),o.key!==void 0&&(a=""+o.key),"key"in o){l={};for(var c in o)c!=="key"&&(l[c]=o[c])}else l=o;return o=l.ref,{$$typeof:t,type:r,key:a,ref:o!==void 0?o:null,props:l}}return Fl.Fragment=e,Fl.jsx=n,Fl.jsxs=n,Fl}var xb;function yO(){return xb||(xb=1,Vh.exports=gO()),Vh.exports}var T=yO(),Fh={exports:{}},Te={};var wb;function vO(){if(wb)return Te;wb=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),a=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),b=Symbol.iterator;function v(N){return N===null||typeof N!="object"?null:(N=b&&N[b]||N["@@iterator"],typeof N=="function"?N:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,C={};function E(N,V,X){this.props=N,this.context=V,this.refs=C,this.updater=X||S}E.prototype.isReactComponent={},E.prototype.setState=function(N,V){if(typeof N!="object"&&typeof N!="function"&&N!=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,N,V,"setState")},E.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function A(){}A.prototype=E.prototype;function k(N,V,X){this.props=N,this.context=V,this.refs=C,this.updater=X||S}var D=k.prototype=new A;D.constructor=k,x(D,E.prototype),D.isPureReactComponent=!0;var L=Array.isArray;function H(){}var z={H:null,A:null,T:null,S:null},j=Object.prototype.hasOwnProperty;function J(N,V,X){var ee=X.ref;return{$$typeof:t,type:N,key:V,ref:ee!==void 0?ee:null,props:X}}function le(N,V){return J(N.type,V,N.props)}function ce(N){return typeof N=="object"&&N!==null&&N.$$typeof===t}function se(N){var V={"=":"=0",":":"=2"};return"$"+N.replace(/[=:]/g,function(X){return V[X]})}var Se=/\/+/g;function ne(N,V){return typeof N=="object"&&N!==null&&N.key!=null?se(""+N.key):V.toString(36)}function me(N){switch(N.status){case"fulfilled":return N.value;case"rejected":throw N.reason;default:switch(typeof N.status=="string"?N.then(H,H):(N.status="pending",N.then(function(V){N.status==="pending"&&(N.status="fulfilled",N.value=V)},function(V){N.status==="pending"&&(N.status="rejected",N.reason=V)})),N.status){case"fulfilled":return N.value;case"rejected":throw N.reason}}throw N}function I(N,V,X,ee,re){var ae=typeof N;(ae==="undefined"||ae==="boolean")&&(N=null);var de=!1;if(N===null)de=!0;else switch(ae){case"bigint":case"string":case"number":de=!0;break;case"object":switch(N.$$typeof){case t:case e:de=!0;break;case p:return de=N._init,I(de(N._payload),V,X,ee,re)}}if(de)return re=re(N),de=ee===""?"."+ne(N,0):ee,L(re)?(X="",de!=null&&(X=de.replace(Se,"$&/")+"/"),I(re,V,X,"",function(Ft){return Ft})):re!=null&&(ce(re)&&(re=le(re,X+(re.key==null||N&&N.key===re.key?"":(""+re.key).replace(Se,"$&/")+"/")+de)),V.push(re)),1;de=0;var De=ee===""?".":ee+":";if(L(N))for(var xe=0;xe<N.length;xe++)ee=N[xe],ae=De+ne(ee,xe),de+=I(ee,V,X,ae,re);else if(xe=v(N),typeof xe=="function")for(N=xe.call(N),xe=0;!(ee=N.next()).done;)ee=ee.value,ae=De+ne(ee,xe++),de+=I(ee,V,X,ae,re);else if(ae==="object"){if(typeof N.then=="function")return I(me(N),V,X,ee,re);throw V=String(N),Error("Objects are not valid as a React child (found: "+(V==="[object Object]"?"object with keys {"+Object.keys(N).join(", ")+"}":V)+"). If you meant to render a collection of children, use an array instead.")}return de}function Q(N,V,X){if(N==null)return N;var ee=[],re=0;return I(N,ee,"","",function(ae){return V.call(X,ae,re++)}),ee}function U(N){if(N._status===-1){var V=N._result;V=V(),V.then(function(X){(N._status===0||N._status===-1)&&(N._status=1,N._result=X)},function(X){(N._status===0||N._status===-1)&&(N._status=2,N._result=X)}),N._status===-1&&(N._status=0,N._result=V)}if(N._status===1)return N._result.default;throw N._result}var K=typeof reportError=="function"?reportError:function(N){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var V=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof N=="object"&&N!==null&&typeof N.message=="string"?String(N.message):String(N),error:N});if(!window.dispatchEvent(V))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",N);return}console.error(N)},G={map:Q,forEach:function(N,V,X){Q(N,function(){V.apply(this,arguments)},X)},count:function(N){var V=0;return Q(N,function(){V++}),V},toArray:function(N){return Q(N,function(V){return V})||[]},only:function(N){if(!ce(N))throw Error("React.Children.only expected to receive a single React element child.");return N}};return Te.Activity=g,Te.Children=G,Te.Component=E,Te.Fragment=n,Te.Profiler=o,Te.PureComponent=k,Te.StrictMode=r,Te.Suspense=d,Te.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=z,Te.__COMPILER_RUNTIME={__proto__:null,c:function(N){return z.H.useMemoCache(N)}},Te.cache=function(N){return function(){return N.apply(null,arguments)}},Te.cacheSignal=function(){return null},Te.cloneElement=function(N,V,X){if(N==null)throw Error("The argument must be a React element, but you passed "+N+".");var ee=x({},N.props),re=N.key;if(V!=null)for(ae in V.key!==void 0&&(re=""+V.key),V)!j.call(V,ae)||ae==="key"||ae==="__self"||ae==="__source"||ae==="ref"&&V.ref===void 0||(ee[ae]=V[ae]);var ae=arguments.length-2;if(ae===1)ee.children=X;else if(1<ae){for(var de=Array(ae),De=0;De<ae;De++)de[De]=arguments[De+2];ee.children=de}return J(N.type,re,ee)},Te.createContext=function(N){return N={$$typeof:a,_currentValue:N,_currentValue2:N,_threadCount:0,Provider:null,Consumer:null},N.Provider=N,N.Consumer={$$typeof:l,_context:N},N},Te.createElement=function(N,V,X){var ee,re={},ae=null;if(V!=null)for(ee in V.key!==void 0&&(ae=""+V.key),V)j.call(V,ee)&&ee!=="key"&&ee!=="__self"&&ee!=="__source"&&(re[ee]=V[ee]);var de=arguments.length-2;if(de===1)re.children=X;else if(1<de){for(var De=Array(de),xe=0;xe<de;xe++)De[xe]=arguments[xe+2];re.children=De}if(N&&N.defaultProps)for(ee in de=N.defaultProps,de)re[ee]===void 0&&(re[ee]=de[ee]);return J(N,ae,re)},Te.createRef=function(){return{current:null}},Te.forwardRef=function(N){return{$$typeof:c,render:N}},Te.isValidElement=ce,Te.lazy=function(N){return{$$typeof:p,_payload:{_status:-1,_result:N},_init:U}},Te.memo=function(N,V){return{$$typeof:h,type:N,compare:V===void 0?null:V}},Te.startTransition=function(N){var V=z.T,X={};z.T=X;try{var ee=N(),re=z.S;re!==null&&re(X,ee),typeof ee=="object"&&ee!==null&&typeof ee.then=="function"&&ee.then(H,K)}catch(ae){K(ae)}finally{V!==null&&X.types!==null&&(V.types=X.types),z.T=V}},Te.unstable_useCacheRefresh=function(){return z.H.useCacheRefresh()},Te.use=function(N){return z.H.use(N)},Te.useActionState=function(N,V,X){return z.H.useActionState(N,V,X)},Te.useCallback=function(N,V){return z.H.useCallback(N,V)},Te.useContext=function(N){return z.H.useContext(N)},Te.useDebugValue=function(){},Te.useDeferredValue=function(N,V){return z.H.useDeferredValue(N,V)},Te.useEffect=function(N,V){return z.H.useEffect(N,V)},Te.useEffectEvent=function(N){return z.H.useEffectEvent(N)},Te.useId=function(){return z.H.useId()},Te.useImperativeHandle=function(N,V,X){return z.H.useImperativeHandle(N,V,X)},Te.useInsertionEffect=function(N,V){return z.H.useInsertionEffect(N,V)},Te.useLayoutEffect=function(N,V){return z.H.useLayoutEffect(N,V)},Te.useMemo=function(N,V){return z.H.useMemo(N,V)},Te.useOptimistic=function(N,V){return z.H.useOptimistic(N,V)},Te.useReducer=function(N,V,X){return z.H.useReducer(N,V,X)},Te.useRef=function(N){return z.H.useRef(N)},Te.useState=function(N){return z.H.useState(N)},Te.useSyncExternalStore=function(N,V,X){return z.H.useSyncExternalStore(N,V,X)},Te.useTransition=function(){return z.H.useTransition()},Te.version="19.2.4",Te}var Cb;function ba(){return Cb||(Cb=1,Fh.exports=vO()),Fh.exports}var M=ba();const tn=c1(M),f1=mO({__proto__:null,default:tn},[M]);var Ph={exports:{}},Pl={},$h={exports:{}},Hh={};var Mb;function bO(){return Mb||(Mb=1,(function(t){function e(I,Q){var U=I.length;I.push(Q);e:for(;0<U;){var K=U-1>>>1,G=I[K];if(0<o(G,Q))I[K]=Q,I[U]=G,U=K;else break e}}function n(I){return I.length===0?null:I[0]}function r(I){if(I.length===0)return null;var Q=I[0],U=I.pop();if(U!==Q){I[0]=U;e:for(var K=0,G=I.length,N=G>>>1;K<N;){var V=2*(K+1)-1,X=I[V],ee=V+1,re=I[ee];if(0>o(X,U))ee<G&&0>o(re,X)?(I[K]=re,I[ee]=U,K=ee):(I[K]=X,I[V]=U,K=V);else if(ee<G&&0>o(re,U))I[K]=re,I[ee]=U,K=ee;else break e}}return Q}function o(I,Q){var U=I.sortIndex-Q.sortIndex;return U!==0?U:I.id-Q.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;t.unstable_now=function(){return l.now()}}else{var a=Date,c=a.now();t.unstable_now=function(){return a.now()-c}}var d=[],h=[],p=1,g=null,b=3,v=!1,S=!1,x=!1,C=!1,E=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;function D(I){for(var Q=n(h);Q!==null;){if(Q.callback===null)r(h);else if(Q.startTime<=I)r(h),Q.sortIndex=Q.expirationTime,e(d,Q);else break;Q=n(h)}}function L(I){if(x=!1,D(I),!S)if(n(d)!==null)S=!0,H||(H=!0,se());else{var Q=n(h);Q!==null&&me(L,Q.startTime-I)}}var H=!1,z=-1,j=5,J=-1;function le(){return C?!0:!(t.unstable_now()-J<j)}function ce(){if(C=!1,H){var I=t.unstable_now();J=I;var Q=!0;try{e:{S=!1,x&&(x=!1,A(z),z=-1),v=!0;var U=b;try{t:{for(D(I),g=n(d);g!==null&&!(g.expirationTime>I&&le());){var K=g.callback;if(typeof K=="function"){g.callback=null,b=g.priorityLevel;var G=K(g.expirationTime<=I);if(I=t.unstable_now(),typeof G=="function"){g.callback=G,D(I),Q=!0;break t}g===n(d)&&r(d),D(I)}else r(d);g=n(d)}if(g!==null)Q=!0;else{var N=n(h);N!==null&&me(L,N.startTime-I),Q=!1}}break e}finally{g=null,b=U,v=!1}Q=void 0}}finally{Q?se():H=!1}}}var se;if(typeof k=="function")se=function(){k(ce)};else if(typeof MessageChannel<"u"){var Se=new MessageChannel,ne=Se.port2;Se.port1.onmessage=ce,se=function(){ne.postMessage(null)}}else se=function(){E(ce,0)};function me(I,Q){z=E(function(){I(t.unstable_now())},Q)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(I){I.callback=null},t.unstable_forceFrameRate=function(I){0>I||125<I?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):j=0<I?Math.floor(1e3/I):5},t.unstable_getCurrentPriorityLevel=function(){return b},t.unstable_next=function(I){switch(b){case 1:case 2:case 3:var Q=3;break;default:Q=b}var U=b;b=Q;try{return I()}finally{b=U}},t.unstable_requestPaint=function(){C=!0},t.unstable_runWithPriority=function(I,Q){switch(I){case 1:case 2:case 3:case 4:case 5:break;default:I=3}var U=b;b=I;try{return Q()}finally{b=U}},t.unstable_scheduleCallback=function(I,Q,U){var K=t.unstable_now();switch(typeof U=="object"&&U!==null?(U=U.delay,U=typeof U=="number"&&0<U?K+U:K):U=K,I){case 1:var G=-1;break;case 2:G=250;break;case 5:G=1073741823;break;case 4:G=1e4;break;default:G=5e3}return G=U+G,I={id:p++,callback:Q,priorityLevel:I,startTime:U,expirationTime:G,sortIndex:-1},U>K?(I.sortIndex=U,e(h,I),n(d)===null&&I===n(h)&&(x?(A(z),z=-1):x=!0,me(L,U-K))):(I.sortIndex=G,e(d,I),S||v||(S=!0,H||(H=!0,se()))),I},t.unstable_shouldYield=le,t.unstable_wrapCallback=function(I){var Q=b;return function(){var U=b;b=Q;try{return I.apply(this,arguments)}finally{b=U}}}})(Hh)),Hh}var Eb;function SO(){return Eb||(Eb=1,$h.exports=bO()),$h.exports}var Uh={exports:{}},Pt={};var Rb;function xO(){if(Rb)return Pt;Rb=1;var t=ba();function e(d){var h="https://react.dev/errors/"+d;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)h+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+d+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(e(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},o=Symbol.for("react.portal");function l(d,h,p){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:g==null?null:""+g,children:d,containerInfo:h,implementation:p}}var a=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(d,h){if(d==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return Pt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Pt.createPortal=function(d,h){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(e(299));return l(d,h,null,p)},Pt.flushSync=function(d){var h=a.T,p=r.p;try{if(a.T=null,r.p=2,d)return d()}finally{a.T=h,r.p=p,r.d.f()}},Pt.preconnect=function(d,h){typeof d=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,r.d.C(d,h))},Pt.prefetchDNS=function(d){typeof d=="string"&&r.d.D(d)},Pt.preinit=function(d,h){if(typeof d=="string"&&h&&typeof h.as=="string"){var p=h.as,g=c(p,h.crossOrigin),b=typeof h.integrity=="string"?h.integrity:void 0,v=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;p==="style"?r.d.S(d,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:g,integrity:b,fetchPriority:v}):p==="script"&&r.d.X(d,{crossOrigin:g,integrity:b,fetchPriority:v,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Pt.preinitModule=function(d,h){if(typeof d=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var p=c(h.as,h.crossOrigin);r.d.M(d,{crossOrigin:p,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&r.d.M(d)},Pt.preload=function(d,h){if(typeof d=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var p=h.as,g=c(p,h.crossOrigin);r.d.L(d,p,{crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},Pt.preloadModule=function(d,h){if(typeof d=="string")if(h){var p=c(h.as,h.crossOrigin);r.d.m(d,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:p,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else r.d.m(d)},Pt.requestFormReset=function(d){r.d.r(d)},Pt.unstable_batchedUpdates=function(d,h){return d(h)},Pt.useFormState=function(d,h,p){return a.H.useFormState(d,h,p)},Pt.useFormStatus=function(){return a.H.useHostTransitionStatus()},Pt.version="19.2.4",Pt}var Tb;function d1(){if(Tb)return Uh.exports;Tb=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),Uh.exports=xO(),Uh.exports}var Ab;function wO(){if(Ab)return Pl;Ab=1;var t=SO(),e=ba(),n=d1();function r(i){var s="https://react.dev/errors/"+i;if(1<arguments.length){s+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)s+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+i+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function l(i){var s=i,u=i;if(i.alternate)for(;s.return;)s=s.return;else{i=s;do s=i,(s.flags&4098)!==0&&(u=s.return),i=s.return;while(i)}return s.tag===3?u:null}function a(i){if(i.tag===13){var s=i.memoizedState;if(s===null&&(i=i.alternate,i!==null&&(s=i.memoizedState)),s!==null)return s.dehydrated}return null}function c(i){if(i.tag===31){var s=i.memoizedState;if(s===null&&(i=i.alternate,i!==null&&(s=i.memoizedState)),s!==null)return s.dehydrated}return null}function d(i){if(l(i)!==i)throw Error(r(188))}function h(i){var s=i.alternate;if(!s){if(s=l(i),s===null)throw Error(r(188));return s!==i?null:i}for(var u=i,f=s;;){var m=u.return;if(m===null)break;var y=m.alternate;if(y===null){if(f=m.return,f!==null){u=f;continue}break}if(m.child===y.child){for(y=m.child;y;){if(y===u)return d(m),i;if(y===f)return d(m),s;y=y.sibling}throw Error(r(188))}if(u.return!==f.return)u=m,f=y;else{for(var w=!1,R=m.child;R;){if(R===u){w=!0,u=m,f=y;break}if(R===f){w=!0,f=m,u=y;break}R=R.sibling}if(!w){for(R=y.child;R;){if(R===u){w=!0,u=y,f=m;break}if(R===f){w=!0,f=y,u=m;break}R=R.sibling}if(!w)throw Error(r(189))}}if(u.alternate!==f)throw Error(r(190))}if(u.tag!==3)throw Error(r(188));return u.stateNode.current===u?i:s}function p(i){var s=i.tag;if(s===5||s===26||s===27||s===6)return i;for(i=i.child;i!==null;){if(s=p(i),s!==null)return s;i=i.sibling}return null}var g=Object.assign,b=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),A=Symbol.for("react.consumer"),k=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),H=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),J=Symbol.for("react.activity"),le=Symbol.for("react.memo_cache_sentinel"),ce=Symbol.iterator;function se(i){return i===null||typeof i!="object"?null:(i=ce&&i[ce]||i["@@iterator"],typeof i=="function"?i:null)}var Se=Symbol.for("react.client.reference");function ne(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===Se?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case x:return"Fragment";case E:return"Profiler";case C:return"StrictMode";case L:return"Suspense";case H:return"SuspenseList";case J:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case S:return"Portal";case k:return i.displayName||"Context";case A:return(i._context.displayName||"Context")+".Consumer";case D:var s=i.render;return i=i.displayName,i||(i=s.displayName||s.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case z:return s=i.displayName||null,s!==null?s:ne(i.type)||"Memo";case j:s=i._payload,i=i._init;try{return ne(i(s))}catch{}}return null}var me=Array.isArray,I=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Q=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,U={pending:!1,data:null,method:null,action:null},K=[],G=-1;function N(i){return{current:i}}function V(i){0>G||(i.current=K[G],K[G]=null,G--)}function X(i,s){G++,K[G]=i.current,i.current=s}var ee=N(null),re=N(null),ae=N(null),de=N(null);function De(i,s){switch(X(ae,s),X(re,i),X(ee,null),s.nodeType){case 9:case 11:i=(i=s.documentElement)&&(i=i.namespaceURI)?Hv(i):0;break;default:if(i=s.tagName,s=s.namespaceURI)s=Hv(s),i=Uv(s,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}V(ee),X(ee,i)}function xe(){V(ee),V(re),V(ae)}function Ft(i){i.memoizedState!==null&&X(de,i);var s=ee.current,u=Uv(s,i.type);s!==u&&(X(re,i),X(ee,u))}function Qt(i){re.current===i&&(V(ee),V(re)),de.current===i&&(V(de),Ll._currentValue=U)}var xt,ht;function kt(i){if(xt===void 0)try{throw Error()}catch(u){var s=u.stack.trim().match(/\n( *(at )?)/);xt=s&&s[1]||"",ht=-1<u.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+xt+i+ht}var Pi=!1;function hr(i,s){if(!i||Pi)return"";Pi=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var f={DetermineComponentFrameRoot:function(){try{if(s){var W=function(){throw Error()};if(Object.defineProperty(W.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(W,[])}catch(q){var $=q}Reflect.construct(i,[],W)}else{try{W.call()}catch(q){$=q}i.call(W.prototype)}}else{try{throw Error()}catch(q){$=q}(W=i())&&typeof W.catch=="function"&&W.catch(function(){})}}catch(q){if(q&&$&&typeof q.stack=="string")return[q.stack,$.stack]}return[null,null]}};f.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var m=Object.getOwnPropertyDescriptor(f.DetermineComponentFrameRoot,"name");m&&m.configurable&&Object.defineProperty(f.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var y=f.DetermineComponentFrameRoot(),w=y[0],R=y[1];if(w&&R){var O=w.split(`
|
|
4
|
+
`),P=R.split(`
|
|
5
|
+
`);for(m=f=0;f<O.length&&!O[f].includes("DetermineComponentFrameRoot");)f++;for(;m<P.length&&!P[m].includes("DetermineComponentFrameRoot");)m++;if(f===O.length||m===P.length)for(f=O.length-1,m=P.length-1;1<=f&&0<=m&&O[f]!==P[m];)m--;for(;1<=f&&0<=m;f--,m--)if(O[f]!==P[m]){if(f!==1||m!==1)do if(f--,m--,0>m||O[f]!==P[m]){var Y=`
|
|
6
|
+
`+O[f].replace(" at new "," at ");return i.displayName&&Y.includes("<anonymous>")&&(Y=Y.replace("<anonymous>",i.displayName)),Y}while(1<=f&&0<=m);break}}}finally{Pi=!1,Error.prepareStackTrace=u}return(u=i?i.displayName||i.name:"")?kt(u):""}function Tf(i,s){switch(i.tag){case 26:case 27:case 5:return kt(i.type);case 16:return kt("Lazy");case 13:return i.child!==s&&s!==null?kt("Suspense Fallback"):kt("Suspense");case 19:return kt("SuspenseList");case 0:case 15:return hr(i.type,!1);case 11:return hr(i.type.render,!1);case 1:return hr(i.type,!0);case 31:return kt("Activity");default:return""}}function No(i){try{var s="",u=null;do s+=Tf(i,u),u=i,i=i.return;while(i);return s}catch(f){return`
|
|
7
|
+
Error generating stack: `+f.message+`
|
|
8
|
+
`+f.stack}}var Tn=Object.prototype.hasOwnProperty,Do=t.unstable_scheduleCallback,_o=t.unstable_cancelCallback,ka=t.unstable_shouldYield,Na=t.unstable_requestPaint,Zt=t.unstable_now,Da=t.unstable_getCurrentPriorityLevel,_a=t.unstable_ImmediatePriority,za=t.unstable_UserBlockingPriority,zo=t.unstable_NormalPriority,pr=t.unstable_LowPriority,tr=t.unstable_IdlePriority,Js=t.log,ja=t.unstable_setDisableYieldValue,Ur=null,We=null;function pn(i){if(typeof Js=="function"&&ja(i),We&&typeof We.setStrictMode=="function")try{We.setStrictMode(Ur,i)}catch{}}var Wt=Math.clz32?Math.clz32:La,Af=Math.log,$i=Math.LN2;function La(i){return i>>>=0,i===0?32:31-(Af(i)/$i|0)|0}var qr=256,Un=262144,Hi=4194304;function An(i){var s=i&42;if(s!==0)return s;switch(i&-i){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 i&261888;case 262144:case 524288:case 1048576:case 2097152:return i&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function jo(i,s,u){var f=i.pendingLanes;if(f===0)return 0;var m=0,y=i.suspendedLanes,w=i.pingedLanes;i=i.warmLanes;var R=f&134217727;return R!==0?(f=R&~y,f!==0?m=An(f):(w&=R,w!==0?m=An(w):u||(u=R&~i,u!==0&&(m=An(u))))):(R=f&~y,R!==0?m=An(R):w!==0?m=An(w):u||(u=f&~i,u!==0&&(m=An(u)))),m===0?0:s!==0&&s!==m&&(s&y)===0&&(y=m&-m,u=s&-s,y>=u||y===32&&(u&4194048)!==0)?s:m}function Ui(i,s){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&s)===0}function Of(i,s){switch(i){case 1:case 2:case 4:case 8:case 64:return s+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 s+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 ie(){var i=Hi;return Hi<<=1,(Hi&62914560)===0&&(Hi=4194304),i}function oe(i){for(var s=[],u=0;31>u;u++)s.push(i);return s}function Ce(i,s){i.pendingLanes|=s,s!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function Le(i,s,u,f,m,y){var w=i.pendingLanes;i.pendingLanes=u,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=u,i.entangledLanes&=u,i.errorRecoveryDisabledLanes&=u,i.shellSuspendCounter=0;var R=i.entanglements,O=i.expirationTimes,P=i.hiddenUpdates;for(u=w&~u;0<u;){var Y=31-Wt(u),W=1<<Y;R[Y]=0,O[Y]=-1;var $=P[Y];if($!==null)for(P[Y]=null,Y=0;Y<$.length;Y++){var q=$[Y];q!==null&&(q.lane&=-536870913)}u&=~W}f!==0&&et(i,f,0),y!==0&&m===0&&i.tag!==0&&(i.suspendedLanes|=y&~(w&~s))}function et(i,s,u){i.pendingLanes|=s,i.suspendedLanes&=~s;var f=31-Wt(s);i.entangledLanes|=s,i.entanglements[f]=i.entanglements[f]|1073741824|u&261930}function Re(i,s){var u=i.entangledLanes|=s;for(i=i.entanglements;u;){var f=31-Wt(u),m=1<<f;m&s|i[f]&s&&(i[f]|=s),u&=~m}}function ut(i,s){var u=s&-s;return u=(u&42)!==0?1:ct(u),(u&(i.suspendedLanes|s))!==0?0:u}function ct(i){switch(i){case 2:i=1;break;case 8:i=4;break;case 32:i=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:i=128;break;case 268435456:i=134217728;break;default:i=0}return i}function Gr(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function Lo(){var i=Q.p;return i!==0?i:(i=window.event,i===void 0?32:hb(i.type))}function Ba(i,s){var u=Q.p;try{return Q.p=i,s()}finally{Q.p=u}}var Kr=Math.random().toString(36).slice(2),Nt="__reactFiber$"+Kr,on="__reactProps$"+Kr,Bo="__reactContainer$"+Kr,kf="__reactEvents$"+Kr,iT="__reactListeners$"+Kr,oT="__reactHandles$"+Kr,kg="__reactResources$"+Kr,Qs="__reactMarker$"+Kr;function Nf(i){delete i[Nt],delete i[on],delete i[kf],delete i[iT],delete i[oT]}function Io(i){var s=i[Nt];if(s)return s;for(var u=i.parentNode;u;){if(s=u[Bo]||u[Nt]){if(u=s.alternate,s.child!==null||u!==null&&u.child!==null)for(i=Qv(i);i!==null;){if(u=i[Nt])return u;i=Qv(i)}return s}i=u,u=i.parentNode}return null}function Vo(i){if(i=i[Nt]||i[Bo]){var s=i.tag;if(s===5||s===6||s===13||s===31||s===26||s===27||s===3)return i}return null}function Zs(i){var s=i.tag;if(s===5||s===26||s===27||s===6)return i.stateNode;throw Error(r(33))}function Fo(i){var s=i[kg];return s||(s=i[kg]={hoistableStyles:new Map,hoistableScripts:new Map}),s}function Mt(i){i[Qs]=!0}var Ng=new Set,Dg={};function qi(i,s){Po(i,s),Po(i+"Capture",s)}function Po(i,s){for(Dg[i]=s,i=0;i<s.length;i++)Ng.add(s[i])}var sT=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]*$"),_g={},zg={};function lT(i){return Tn.call(zg,i)?!0:Tn.call(_g,i)?!1:sT.test(i)?zg[i]=!0:(_g[i]=!0,!1)}function Ia(i,s,u){if(lT(s))if(u===null)i.removeAttribute(s);else{switch(typeof u){case"undefined":case"function":case"symbol":i.removeAttribute(s);return;case"boolean":var f=s.toLowerCase().slice(0,5);if(f!=="data-"&&f!=="aria-"){i.removeAttribute(s);return}}i.setAttribute(s,""+u)}}function Va(i,s,u){if(u===null)i.removeAttribute(s);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(s);return}i.setAttribute(s,""+u)}}function mr(i,s,u,f){if(f===null)i.removeAttribute(u);else{switch(typeof f){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(u);return}i.setAttributeNS(s,u,""+f)}}function On(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function jg(i){var s=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function aT(i,s,u){var f=Object.getOwnPropertyDescriptor(i.constructor.prototype,s);if(!i.hasOwnProperty(s)&&typeof f<"u"&&typeof f.get=="function"&&typeof f.set=="function"){var m=f.get,y=f.set;return Object.defineProperty(i,s,{configurable:!0,get:function(){return m.call(this)},set:function(w){u=""+w,y.call(this,w)}}),Object.defineProperty(i,s,{enumerable:f.enumerable}),{getValue:function(){return u},setValue:function(w){u=""+w},stopTracking:function(){i._valueTracker=null,delete i[s]}}}}function Df(i){if(!i._valueTracker){var s=jg(i)?"checked":"value";i._valueTracker=aT(i,s,""+i[s])}}function Lg(i){if(!i)return!1;var s=i._valueTracker;if(!s)return!0;var u=s.getValue(),f="";return i&&(f=jg(i)?i.checked?"true":"false":i.value),i=f,i!==u?(s.setValue(i),!0):!1}function Fa(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}var uT=/[\n"\\]/g;function kn(i){return i.replace(uT,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function _f(i,s,u,f,m,y,w,R){i.name="",w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?i.type=w:i.removeAttribute("type"),s!=null?w==="number"?(s===0&&i.value===""||i.value!=s)&&(i.value=""+On(s)):i.value!==""+On(s)&&(i.value=""+On(s)):w!=="submit"&&w!=="reset"||i.removeAttribute("value"),s!=null?zf(i,w,On(s)):u!=null?zf(i,w,On(u)):f!=null&&i.removeAttribute("value"),m==null&&y!=null&&(i.defaultChecked=!!y),m!=null&&(i.checked=m&&typeof m!="function"&&typeof m!="symbol"),R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"?i.name=""+On(R):i.removeAttribute("name")}function Bg(i,s,u,f,m,y,w,R){if(y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(i.type=y),s!=null||u!=null){if(!(y!=="submit"&&y!=="reset"||s!=null)){Df(i);return}u=u!=null?""+On(u):"",s=s!=null?""+On(s):u,R||s===i.value||(i.value=s),i.defaultValue=s}f=f??m,f=typeof f!="function"&&typeof f!="symbol"&&!!f,i.checked=R?i.checked:!!f,i.defaultChecked=!!f,w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(i.name=w),Df(i)}function zf(i,s,u){s==="number"&&Fa(i.ownerDocument)===i||i.defaultValue===""+u||(i.defaultValue=""+u)}function $o(i,s,u,f){if(i=i.options,s){s={};for(var m=0;m<u.length;m++)s["$"+u[m]]=!0;for(u=0;u<i.length;u++)m=s.hasOwnProperty("$"+i[u].value),i[u].selected!==m&&(i[u].selected=m),m&&f&&(i[u].defaultSelected=!0)}else{for(u=""+On(u),s=null,m=0;m<i.length;m++){if(i[m].value===u){i[m].selected=!0,f&&(i[m].defaultSelected=!0);return}s!==null||i[m].disabled||(s=i[m])}s!==null&&(s.selected=!0)}}function Ig(i,s,u){if(s!=null&&(s=""+On(s),s!==i.value&&(i.value=s),u==null)){i.defaultValue!==s&&(i.defaultValue=s);return}i.defaultValue=u!=null?""+On(u):""}function Vg(i,s,u,f){if(s==null){if(f!=null){if(u!=null)throw Error(r(92));if(me(f)){if(1<f.length)throw Error(r(93));f=f[0]}u=f}u==null&&(u=""),s=u}u=On(s),i.defaultValue=u,f=i.textContent,f===u&&f!==""&&f!==null&&(i.value=f),Df(i)}function Ho(i,s){if(s){var u=i.firstChild;if(u&&u===i.lastChild&&u.nodeType===3){u.nodeValue=s;return}}i.textContent=s}var cT=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 Fg(i,s,u){var f=s.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?f?i.setProperty(s,""):s==="float"?i.cssFloat="":i[s]="":f?i.setProperty(s,u):typeof u!="number"||u===0||cT.has(s)?s==="float"?i.cssFloat=u:i[s]=(""+u).trim():i[s]=u+"px"}function Pg(i,s,u){if(s!=null&&typeof s!="object")throw Error(r(62));if(i=i.style,u!=null){for(var f in u)!u.hasOwnProperty(f)||s!=null&&s.hasOwnProperty(f)||(f.indexOf("--")===0?i.setProperty(f,""):f==="float"?i.cssFloat="":i[f]="");for(var m in s)f=s[m],s.hasOwnProperty(m)&&u[m]!==f&&Fg(i,m,f)}else for(var y in s)s.hasOwnProperty(y)&&Fg(i,y,s[y])}function jf(i){if(i.indexOf("-")===-1)return!1;switch(i){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 fT=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"]]),dT=/^[\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 Pa(i){return dT.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function gr(){}var Lf=null;function Bf(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var Uo=null,qo=null;function $g(i){var s=Vo(i);if(s&&(i=s.stateNode)){var u=i[on]||null;e:switch(i=s.stateNode,s.type){case"input":if(_f(i,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name),s=u.name,u.type==="radio"&&s!=null){for(u=i;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll('input[name="'+kn(""+s)+'"][type="radio"]'),s=0;s<u.length;s++){var f=u[s];if(f!==i&&f.form===i.form){var m=f[on]||null;if(!m)throw Error(r(90));_f(f,m.value,m.defaultValue,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name)}}for(s=0;s<u.length;s++)f=u[s],f.form===i.form&&Lg(f)}break e;case"textarea":Ig(i,u.value,u.defaultValue);break e;case"select":s=u.value,s!=null&&$o(i,!!u.multiple,s,!1)}}}var If=!1;function Hg(i,s,u){if(If)return i(s,u);If=!0;try{var f=i(s);return f}finally{if(If=!1,(Uo!==null||qo!==null)&&(Au(),Uo&&(s=Uo,i=qo,qo=Uo=null,$g(s),i)))for(s=0;s<i.length;s++)$g(i[s])}}function Ws(i,s){var u=i.stateNode;if(u===null)return null;var f=u[on]||null;if(f===null)return null;u=f[s];e:switch(s){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(f=!f.disabled)||(i=i.type,f=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!f;break e;default:i=!1}if(i)return null;if(u&&typeof u!="function")throw Error(r(231,s,typeof u));return u}var yr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Vf=!1;if(yr)try{var el={};Object.defineProperty(el,"passive",{get:function(){Vf=!0}}),window.addEventListener("test",el,el),window.removeEventListener("test",el,el)}catch{Vf=!1}var Yr=null,Ff=null,$a=null;function Ug(){if($a)return $a;var i,s=Ff,u=s.length,f,m="value"in Yr?Yr.value:Yr.textContent,y=m.length;for(i=0;i<u&&s[i]===m[i];i++);var w=u-i;for(f=1;f<=w&&s[u-f]===m[y-f];f++);return $a=m.slice(i,1<f?1-f:void 0)}function Ha(i){var s=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&s===13&&(i=13)):i=s,i===10&&(i=13),32<=i||i===13?i:0}function Ua(){return!0}function qg(){return!1}function sn(i){function s(u,f,m,y,w){this._reactName=u,this._targetInst=m,this.type=f,this.nativeEvent=y,this.target=w,this.currentTarget=null;for(var R in i)i.hasOwnProperty(R)&&(u=i[R],this[R]=u?u(y):y[R]);return this.isDefaultPrevented=(y.defaultPrevented!=null?y.defaultPrevented:y.returnValue===!1)?Ua:qg,this.isPropagationStopped=qg,this}return g(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=Ua)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=Ua)},persist:function(){},isPersistent:Ua}),s}var Gi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},qa=sn(Gi),tl=g({},Gi,{view:0,detail:0}),hT=sn(tl),Pf,$f,nl,Ga=g({},tl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Uf,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==nl&&(nl&&i.type==="mousemove"?(Pf=i.screenX-nl.screenX,$f=i.screenY-nl.screenY):$f=Pf=0,nl=i),Pf)},movementY:function(i){return"movementY"in i?i.movementY:$f}}),Gg=sn(Ga),pT=g({},Ga,{dataTransfer:0}),mT=sn(pT),gT=g({},tl,{relatedTarget:0}),Hf=sn(gT),yT=g({},Gi,{animationName:0,elapsedTime:0,pseudoElement:0}),vT=sn(yT),bT=g({},Gi,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),ST=sn(bT),xT=g({},Gi,{data:0}),Kg=sn(xT),wT={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},CT={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"},MT={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ET(i){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(i):(i=MT[i])?!!s[i]:!1}function Uf(){return ET}var RT=g({},tl,{key:function(i){if(i.key){var s=wT[i.key]||i.key;if(s!=="Unidentified")return s}return i.type==="keypress"?(i=Ha(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?CT[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Uf,charCode:function(i){return i.type==="keypress"?Ha(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?Ha(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),TT=sn(RT),AT=g({},Ga,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Yg=sn(AT),OT=g({},tl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Uf}),kT=sn(OT),NT=g({},Gi,{propertyName:0,elapsedTime:0,pseudoElement:0}),DT=sn(NT),_T=g({},Ga,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),zT=sn(_T),jT=g({},Gi,{newState:0,oldState:0}),LT=sn(jT),BT=[9,13,27,32],qf=yr&&"CompositionEvent"in window,rl=null;yr&&"documentMode"in document&&(rl=document.documentMode);var IT=yr&&"TextEvent"in window&&!rl,Xg=yr&&(!qf||rl&&8<rl&&11>=rl),Jg=" ",Qg=!1;function Zg(i,s){switch(i){case"keyup":return BT.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Wg(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var Go=!1;function VT(i,s){switch(i){case"compositionend":return Wg(s);case"keypress":return s.which!==32?null:(Qg=!0,Jg);case"textInput":return i=s.data,i===Jg&&Qg?null:i;default:return null}}function FT(i,s){if(Go)return i==="compositionend"||!qf&&Zg(i,s)?(i=Ug(),$a=Ff=Yr=null,Go=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return Xg&&s.locale!=="ko"?null:s.data;default:return null}}var PT={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 ey(i){var s=i&&i.nodeName&&i.nodeName.toLowerCase();return s==="input"?!!PT[i.type]:s==="textarea"}function ty(i,s,u,f){Uo?qo?qo.push(f):qo=[f]:Uo=f,s=ju(s,"onChange"),0<s.length&&(u=new qa("onChange","change",null,u,f),i.push({event:u,listeners:s}))}var il=null,ol=null;function $T(i){Bv(i,0)}function Ka(i){var s=Zs(i);if(Lg(s))return i}function ny(i,s){if(i==="change")return s}var ry=!1;if(yr){var Gf;if(yr){var Kf="oninput"in document;if(!Kf){var iy=document.createElement("div");iy.setAttribute("oninput","return;"),Kf=typeof iy.oninput=="function"}Gf=Kf}else Gf=!1;ry=Gf&&(!document.documentMode||9<document.documentMode)}function oy(){il&&(il.detachEvent("onpropertychange",sy),ol=il=null)}function sy(i){if(i.propertyName==="value"&&Ka(ol)){var s=[];ty(s,ol,i,Bf(i)),Hg($T,s)}}function HT(i,s,u){i==="focusin"?(oy(),il=s,ol=u,il.attachEvent("onpropertychange",sy)):i==="focusout"&&oy()}function UT(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return Ka(ol)}function qT(i,s){if(i==="click")return Ka(s)}function GT(i,s){if(i==="input"||i==="change")return Ka(s)}function KT(i,s){return i===s&&(i!==0||1/i===1/s)||i!==i&&s!==s}var mn=typeof Object.is=="function"?Object.is:KT;function sl(i,s){if(mn(i,s))return!0;if(typeof i!="object"||i===null||typeof s!="object"||s===null)return!1;var u=Object.keys(i),f=Object.keys(s);if(u.length!==f.length)return!1;for(f=0;f<u.length;f++){var m=u[f];if(!Tn.call(s,m)||!mn(i[m],s[m]))return!1}return!0}function ly(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function ay(i,s){var u=ly(i);i=0;for(var f;u;){if(u.nodeType===3){if(f=i+u.textContent.length,i<=s&&f>=s)return{node:u,offset:s-i};i=f}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=ly(u)}}function uy(i,s){return i&&s?i===s?!0:i&&i.nodeType===3?!1:s&&s.nodeType===3?uy(i,s.parentNode):"contains"in i?i.contains(s):i.compareDocumentPosition?!!(i.compareDocumentPosition(s)&16):!1:!1}function cy(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var s=Fa(i.document);s instanceof i.HTMLIFrameElement;){try{var u=typeof s.contentWindow.location.href=="string"}catch{u=!1}if(u)i=s.contentWindow;else break;s=Fa(i.document)}return s}function Yf(i){var s=i&&i.nodeName&&i.nodeName.toLowerCase();return s&&(s==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||s==="textarea"||i.contentEditable==="true")}var YT=yr&&"documentMode"in document&&11>=document.documentMode,Ko=null,Xf=null,ll=null,Jf=!1;function fy(i,s,u){var f=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;Jf||Ko==null||Ko!==Fa(f)||(f=Ko,"selectionStart"in f&&Yf(f)?f={start:f.selectionStart,end:f.selectionEnd}:(f=(f.ownerDocument&&f.ownerDocument.defaultView||window).getSelection(),f={anchorNode:f.anchorNode,anchorOffset:f.anchorOffset,focusNode:f.focusNode,focusOffset:f.focusOffset}),ll&&sl(ll,f)||(ll=f,f=ju(Xf,"onSelect"),0<f.length&&(s=new qa("onSelect","select",null,s,u),i.push({event:s,listeners:f}),s.target=Ko)))}function Ki(i,s){var u={};return u[i.toLowerCase()]=s.toLowerCase(),u["Webkit"+i]="webkit"+s,u["Moz"+i]="moz"+s,u}var Yo={animationend:Ki("Animation","AnimationEnd"),animationiteration:Ki("Animation","AnimationIteration"),animationstart:Ki("Animation","AnimationStart"),transitionrun:Ki("Transition","TransitionRun"),transitionstart:Ki("Transition","TransitionStart"),transitioncancel:Ki("Transition","TransitionCancel"),transitionend:Ki("Transition","TransitionEnd")},Qf={},dy={};yr&&(dy=document.createElement("div").style,"AnimationEvent"in window||(delete Yo.animationend.animation,delete Yo.animationiteration.animation,delete Yo.animationstart.animation),"TransitionEvent"in window||delete Yo.transitionend.transition);function Yi(i){if(Qf[i])return Qf[i];if(!Yo[i])return i;var s=Yo[i],u;for(u in s)if(s.hasOwnProperty(u)&&u in dy)return Qf[i]=s[u];return i}var hy=Yi("animationend"),py=Yi("animationiteration"),my=Yi("animationstart"),XT=Yi("transitionrun"),JT=Yi("transitionstart"),QT=Yi("transitioncancel"),gy=Yi("transitionend"),yy=new Map,Zf="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(" ");Zf.push("scrollEnd");function qn(i,s){yy.set(i,s),qi(s,[i])}var Ya=typeof reportError=="function"?reportError:function(i){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var s=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof i=="object"&&i!==null&&typeof i.message=="string"?String(i.message):String(i),error:i});if(!window.dispatchEvent(s))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",i);return}console.error(i)},Nn=[],Xo=0,Wf=0;function Xa(){for(var i=Xo,s=Wf=Xo=0;s<i;){var u=Nn[s];Nn[s++]=null;var f=Nn[s];Nn[s++]=null;var m=Nn[s];Nn[s++]=null;var y=Nn[s];if(Nn[s++]=null,f!==null&&m!==null){var w=f.pending;w===null?m.next=m:(m.next=w.next,w.next=m),f.pending=m}y!==0&&vy(u,m,y)}}function Ja(i,s,u,f){Nn[Xo++]=i,Nn[Xo++]=s,Nn[Xo++]=u,Nn[Xo++]=f,Wf|=f,i.lanes|=f,i=i.alternate,i!==null&&(i.lanes|=f)}function ed(i,s,u,f){return Ja(i,s,u,f),Qa(i)}function Xi(i,s){return Ja(i,null,null,s),Qa(i)}function vy(i,s,u){i.lanes|=u;var f=i.alternate;f!==null&&(f.lanes|=u);for(var m=!1,y=i.return;y!==null;)y.childLanes|=u,f=y.alternate,f!==null&&(f.childLanes|=u),y.tag===22&&(i=y.stateNode,i===null||i._visibility&1||(m=!0)),i=y,y=y.return;return i.tag===3?(y=i.stateNode,m&&s!==null&&(m=31-Wt(u),i=y.hiddenUpdates,f=i[m],f===null?i[m]=[s]:f.push(s),s.lane=u|536870912),y):null}function Qa(i){if(50<Ol)throw Ol=0,uh=null,Error(r(185));for(var s=i.return;s!==null;)i=s,s=i.return;return i.tag===3?i.stateNode:null}var Jo={};function ZT(i,s,u,f){this.tag=i,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=f,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function gn(i,s,u,f){return new ZT(i,s,u,f)}function td(i){return i=i.prototype,!(!i||!i.isReactComponent)}function vr(i,s){var u=i.alternate;return u===null?(u=gn(i.tag,s,i.key,i.mode),u.elementType=i.elementType,u.type=i.type,u.stateNode=i.stateNode,u.alternate=i,i.alternate=u):(u.pendingProps=s,u.type=i.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=i.flags&65011712,u.childLanes=i.childLanes,u.lanes=i.lanes,u.child=i.child,u.memoizedProps=i.memoizedProps,u.memoizedState=i.memoizedState,u.updateQueue=i.updateQueue,s=i.dependencies,u.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},u.sibling=i.sibling,u.index=i.index,u.ref=i.ref,u.refCleanup=i.refCleanup,u}function by(i,s){i.flags&=65011714;var u=i.alternate;return u===null?(i.childLanes=0,i.lanes=s,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=u.childLanes,i.lanes=u.lanes,i.child=u.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=u.memoizedProps,i.memoizedState=u.memoizedState,i.updateQueue=u.updateQueue,i.type=u.type,s=u.dependencies,i.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),i}function Za(i,s,u,f,m,y){var w=0;if(f=i,typeof i=="function")td(i)&&(w=1);else if(typeof i=="string")w=rO(i,u,ee.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case J:return i=gn(31,u,s,m),i.elementType=J,i.lanes=y,i;case x:return Ji(u.children,m,y,s);case C:w=8,m|=24;break;case E:return i=gn(12,u,s,m|2),i.elementType=E,i.lanes=y,i;case L:return i=gn(13,u,s,m),i.elementType=L,i.lanes=y,i;case H:return i=gn(19,u,s,m),i.elementType=H,i.lanes=y,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case k:w=10;break e;case A:w=9;break e;case D:w=11;break e;case z:w=14;break e;case j:w=16,f=null;break e}w=29,u=Error(r(130,i===null?"null":typeof i,"")),f=null}return s=gn(w,u,s,m),s.elementType=i,s.type=f,s.lanes=y,s}function Ji(i,s,u,f){return i=gn(7,i,f,s),i.lanes=u,i}function nd(i,s,u){return i=gn(6,i,null,s),i.lanes=u,i}function Sy(i){var s=gn(18,null,null,0);return s.stateNode=i,s}function rd(i,s,u){return s=gn(4,i.children!==null?i.children:[],i.key,s),s.lanes=u,s.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},s}var xy=new WeakMap;function Dn(i,s){if(typeof i=="object"&&i!==null){var u=xy.get(i);return u!==void 0?u:(s={value:i,source:s,stack:No(s)},xy.set(i,s),s)}return{value:i,source:s,stack:No(s)}}var Qo=[],Zo=0,Wa=null,al=0,_n=[],zn=0,Xr=null,nr=1,rr="";function br(i,s){Qo[Zo++]=al,Qo[Zo++]=Wa,Wa=i,al=s}function wy(i,s,u){_n[zn++]=nr,_n[zn++]=rr,_n[zn++]=Xr,Xr=i;var f=nr;i=rr;var m=32-Wt(f)-1;f&=~(1<<m),u+=1;var y=32-Wt(s)+m;if(30<y){var w=m-m%5;y=(f&(1<<w)-1).toString(32),f>>=w,m-=w,nr=1<<32-Wt(s)+m|u<<m|f,rr=y+i}else nr=1<<y|u<<m|f,rr=i}function id(i){i.return!==null&&(br(i,1),wy(i,1,0))}function od(i){for(;i===Wa;)Wa=Qo[--Zo],Qo[Zo]=null,al=Qo[--Zo],Qo[Zo]=null;for(;i===Xr;)Xr=_n[--zn],_n[zn]=null,rr=_n[--zn],_n[zn]=null,nr=_n[--zn],_n[zn]=null}function Cy(i,s){_n[zn++]=nr,_n[zn++]=rr,_n[zn++]=Xr,nr=s.id,rr=s.overflow,Xr=i}var Dt=null,tt=null,Pe=!1,Jr=null,jn=!1,sd=Error(r(519));function Qr(i){var s=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ul(Dn(s,i)),sd}function My(i){var s=i.stateNode,u=i.type,f=i.memoizedProps;switch(s[Nt]=i,s[on]=f,u){case"dialog":Ie("cancel",s),Ie("close",s);break;case"iframe":case"object":case"embed":Ie("load",s);break;case"video":case"audio":for(u=0;u<Nl.length;u++)Ie(Nl[u],s);break;case"source":Ie("error",s);break;case"img":case"image":case"link":Ie("error",s),Ie("load",s);break;case"details":Ie("toggle",s);break;case"input":Ie("invalid",s),Bg(s,f.value,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name,!0);break;case"select":Ie("invalid",s);break;case"textarea":Ie("invalid",s),Vg(s,f.value,f.defaultValue,f.children)}u=f.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||s.textContent===""+u||f.suppressHydrationWarning===!0||Pv(s.textContent,u)?(f.popover!=null&&(Ie("beforetoggle",s),Ie("toggle",s)),f.onScroll!=null&&Ie("scroll",s),f.onScrollEnd!=null&&Ie("scrollend",s),f.onClick!=null&&(s.onclick=gr),s=!0):s=!1,s||Qr(i,!0)}function Ey(i){for(Dt=i.return;Dt;)switch(Dt.tag){case 5:case 31:case 13:jn=!1;return;case 27:case 3:jn=!0;return;default:Dt=Dt.return}}function Wo(i){if(i!==Dt)return!1;if(!Pe)return Ey(i),Pe=!0,!1;var s=i.tag,u;if((u=s!==3&&s!==27)&&((u=s===5)&&(u=i.type,u=!(u!=="form"&&u!=="button")||Mh(i.type,i.memoizedProps)),u=!u),u&&tt&&Qr(i),Ey(i),s===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));tt=Jv(i)}else if(s===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));tt=Jv(i)}else s===27?(s=tt,fi(i.type)?(i=Oh,Oh=null,tt=i):tt=s):tt=Dt?Bn(i.stateNode.nextSibling):null;return!0}function Qi(){tt=Dt=null,Pe=!1}function ld(){var i=Jr;return i!==null&&(cn===null?cn=i:cn.push.apply(cn,i),Jr=null),i}function ul(i){Jr===null?Jr=[i]:Jr.push(i)}var ad=N(null),Zi=null,Sr=null;function Zr(i,s,u){X(ad,s._currentValue),s._currentValue=u}function xr(i){i._currentValue=ad.current,V(ad)}function ud(i,s,u){for(;i!==null;){var f=i.alternate;if((i.childLanes&s)!==s?(i.childLanes|=s,f!==null&&(f.childLanes|=s)):f!==null&&(f.childLanes&s)!==s&&(f.childLanes|=s),i===u)break;i=i.return}}function cd(i,s,u,f){var m=i.child;for(m!==null&&(m.return=i);m!==null;){var y=m.dependencies;if(y!==null){var w=m.child;y=y.firstContext;e:for(;y!==null;){var R=y;y=m;for(var O=0;O<s.length;O++)if(R.context===s[O]){y.lanes|=u,R=y.alternate,R!==null&&(R.lanes|=u),ud(y.return,u,i),f||(w=null);break e}y=R.next}}else if(m.tag===18){if(w=m.return,w===null)throw Error(r(341));w.lanes|=u,y=w.alternate,y!==null&&(y.lanes|=u),ud(w,u,i),w=null}else w=m.child;if(w!==null)w.return=m;else for(w=m;w!==null;){if(w===i){w=null;break}if(m=w.sibling,m!==null){m.return=w.return,w=m;break}w=w.return}m=w}}function es(i,s,u,f){i=null;for(var m=s,y=!1;m!==null;){if(!y){if((m.flags&524288)!==0)y=!0;else if((m.flags&262144)!==0)break}if(m.tag===10){var w=m.alternate;if(w===null)throw Error(r(387));if(w=w.memoizedProps,w!==null){var R=m.type;mn(m.pendingProps.value,w.value)||(i!==null?i.push(R):i=[R])}}else if(m===de.current){if(w=m.alternate,w===null)throw Error(r(387));w.memoizedState.memoizedState!==m.memoizedState.memoizedState&&(i!==null?i.push(Ll):i=[Ll])}m=m.return}i!==null&&cd(s,i,u,f),s.flags|=262144}function eu(i){for(i=i.firstContext;i!==null;){if(!mn(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function Wi(i){Zi=i,Sr=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function _t(i){return Ry(Zi,i)}function tu(i,s){return Zi===null&&Wi(i),Ry(i,s)}function Ry(i,s){var u=s._currentValue;if(s={context:s,memoizedValue:u,next:null},Sr===null){if(i===null)throw Error(r(308));Sr=s,i.dependencies={lanes:0,firstContext:s},i.flags|=524288}else Sr=Sr.next=s;return u}var WT=typeof AbortController<"u"?AbortController:function(){var i=[],s=this.signal={aborted:!1,addEventListener:function(u,f){i.push(f)}};this.abort=function(){s.aborted=!0,i.forEach(function(u){return u()})}},eA=t.unstable_scheduleCallback,tA=t.unstable_NormalPriority,pt={$$typeof:k,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function fd(){return{controller:new WT,data:new Map,refCount:0}}function cl(i){i.refCount--,i.refCount===0&&eA(tA,function(){i.controller.abort()})}var fl=null,dd=0,ts=0,ns=null;function nA(i,s){if(fl===null){var u=fl=[];dd=0,ts=mh(),ns={status:"pending",value:void 0,then:function(f){u.push(f)}}}return dd++,s.then(Ty,Ty),s}function Ty(){if(--dd===0&&fl!==null){ns!==null&&(ns.status="fulfilled");var i=fl;fl=null,ts=0,ns=null;for(var s=0;s<i.length;s++)(0,i[s])()}}function rA(i,s){var u=[],f={status:"pending",value:null,reason:null,then:function(m){u.push(m)}};return i.then(function(){f.status="fulfilled",f.value=s;for(var m=0;m<u.length;m++)(0,u[m])(s)},function(m){for(f.status="rejected",f.reason=m,m=0;m<u.length;m++)(0,u[m])(void 0)}),f}var Ay=I.S;I.S=function(i,s){fv=Zt(),typeof s=="object"&&s!==null&&typeof s.then=="function"&&nA(i,s),Ay!==null&&Ay(i,s)};var eo=N(null);function hd(){var i=eo.current;return i!==null?i:Qe.pooledCache}function nu(i,s){s===null?X(eo,eo.current):X(eo,s.pool)}function Oy(){var i=hd();return i===null?null:{parent:pt._currentValue,pool:i}}var rs=Error(r(460)),pd=Error(r(474)),ru=Error(r(542)),iu={then:function(){}};function ky(i){return i=i.status,i==="fulfilled"||i==="rejected"}function Ny(i,s,u){switch(u=i[u],u===void 0?i.push(s):u!==s&&(s.then(gr,gr),s=u),s.status){case"fulfilled":return s.value;case"rejected":throw i=s.reason,_y(i),i;default:if(typeof s.status=="string")s.then(gr,gr);else{if(i=Qe,i!==null&&100<i.shellSuspendCounter)throw Error(r(482));i=s,i.status="pending",i.then(function(f){if(s.status==="pending"){var m=s;m.status="fulfilled",m.value=f}},function(f){if(s.status==="pending"){var m=s;m.status="rejected",m.reason=f}})}switch(s.status){case"fulfilled":return s.value;case"rejected":throw i=s.reason,_y(i),i}throw no=s,rs}}function to(i){try{var s=i._init;return s(i._payload)}catch(u){throw u!==null&&typeof u=="object"&&typeof u.then=="function"?(no=u,rs):u}}var no=null;function Dy(){if(no===null)throw Error(r(459));var i=no;return no=null,i}function _y(i){if(i===rs||i===ru)throw Error(r(483))}var is=null,dl=0;function ou(i){var s=dl;return dl+=1,is===null&&(is=[]),Ny(is,i,s)}function hl(i,s){s=s.props.ref,i.ref=s!==void 0?s:null}function su(i,s){throw s.$$typeof===b?Error(r(525)):(i=Object.prototype.toString.call(s),Error(r(31,i==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":i)))}function zy(i){function s(B,_){if(i){var F=B.deletions;F===null?(B.deletions=[_],B.flags|=16):F.push(_)}}function u(B,_){if(!i)return null;for(;_!==null;)s(B,_),_=_.sibling;return null}function f(B){for(var _=new Map;B!==null;)B.key!==null?_.set(B.key,B):_.set(B.index,B),B=B.sibling;return _}function m(B,_){return B=vr(B,_),B.index=0,B.sibling=null,B}function y(B,_,F){return B.index=F,i?(F=B.alternate,F!==null?(F=F.index,F<_?(B.flags|=67108866,_):F):(B.flags|=67108866,_)):(B.flags|=1048576,_)}function w(B){return i&&B.alternate===null&&(B.flags|=67108866),B}function R(B,_,F,Z){return _===null||_.tag!==6?(_=nd(F,B.mode,Z),_.return=B,_):(_=m(_,F),_.return=B,_)}function O(B,_,F,Z){var ve=F.type;return ve===x?Y(B,_,F.props.children,Z,F.key):_!==null&&(_.elementType===ve||typeof ve=="object"&&ve!==null&&ve.$$typeof===j&&to(ve)===_.type)?(_=m(_,F.props),hl(_,F),_.return=B,_):(_=Za(F.type,F.key,F.props,null,B.mode,Z),hl(_,F),_.return=B,_)}function P(B,_,F,Z){return _===null||_.tag!==4||_.stateNode.containerInfo!==F.containerInfo||_.stateNode.implementation!==F.implementation?(_=rd(F,B.mode,Z),_.return=B,_):(_=m(_,F.children||[]),_.return=B,_)}function Y(B,_,F,Z,ve){return _===null||_.tag!==7?(_=Ji(F,B.mode,Z,ve),_.return=B,_):(_=m(_,F),_.return=B,_)}function W(B,_,F){if(typeof _=="string"&&_!==""||typeof _=="number"||typeof _=="bigint")return _=nd(""+_,B.mode,F),_.return=B,_;if(typeof _=="object"&&_!==null){switch(_.$$typeof){case v:return F=Za(_.type,_.key,_.props,null,B.mode,F),hl(F,_),F.return=B,F;case S:return _=rd(_,B.mode,F),_.return=B,_;case j:return _=to(_),W(B,_,F)}if(me(_)||se(_))return _=Ji(_,B.mode,F,null),_.return=B,_;if(typeof _.then=="function")return W(B,ou(_),F);if(_.$$typeof===k)return W(B,tu(B,_),F);su(B,_)}return null}function $(B,_,F,Z){var ve=_!==null?_.key:null;if(typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint")return ve!==null?null:R(B,_,""+F,Z);if(typeof F=="object"&&F!==null){switch(F.$$typeof){case v:return F.key===ve?O(B,_,F,Z):null;case S:return F.key===ve?P(B,_,F,Z):null;case j:return F=to(F),$(B,_,F,Z)}if(me(F)||se(F))return ve!==null?null:Y(B,_,F,Z,null);if(typeof F.then=="function")return $(B,_,ou(F),Z);if(F.$$typeof===k)return $(B,_,tu(B,F),Z);su(B,F)}return null}function q(B,_,F,Z,ve){if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return B=B.get(F)||null,R(_,B,""+Z,ve);if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case v:return B=B.get(Z.key===null?F:Z.key)||null,O(_,B,Z,ve);case S:return B=B.get(Z.key===null?F:Z.key)||null,P(_,B,Z,ve);case j:return Z=to(Z),q(B,_,F,Z,ve)}if(me(Z)||se(Z))return B=B.get(F)||null,Y(_,B,Z,ve,null);if(typeof Z.then=="function")return q(B,_,F,ou(Z),ve);if(Z.$$typeof===k)return q(B,_,F,tu(_,Z),ve);su(_,Z)}return null}function fe(B,_,F,Z){for(var ve=null,$e=null,ge=_,ke=_=0,Fe=null;ge!==null&&ke<F.length;ke++){ge.index>ke?(Fe=ge,ge=null):Fe=ge.sibling;var He=$(B,ge,F[ke],Z);if(He===null){ge===null&&(ge=Fe);break}i&&ge&&He.alternate===null&&s(B,ge),_=y(He,_,ke),$e===null?ve=He:$e.sibling=He,$e=He,ge=Fe}if(ke===F.length)return u(B,ge),Pe&&br(B,ke),ve;if(ge===null){for(;ke<F.length;ke++)ge=W(B,F[ke],Z),ge!==null&&(_=y(ge,_,ke),$e===null?ve=ge:$e.sibling=ge,$e=ge);return Pe&&br(B,ke),ve}for(ge=f(ge);ke<F.length;ke++)Fe=q(ge,B,ke,F[ke],Z),Fe!==null&&(i&&Fe.alternate!==null&&ge.delete(Fe.key===null?ke:Fe.key),_=y(Fe,_,ke),$e===null?ve=Fe:$e.sibling=Fe,$e=Fe);return i&&ge.forEach(function(gi){return s(B,gi)}),Pe&&br(B,ke),ve}function we(B,_,F,Z){if(F==null)throw Error(r(151));for(var ve=null,$e=null,ge=_,ke=_=0,Fe=null,He=F.next();ge!==null&&!He.done;ke++,He=F.next()){ge.index>ke?(Fe=ge,ge=null):Fe=ge.sibling;var gi=$(B,ge,He.value,Z);if(gi===null){ge===null&&(ge=Fe);break}i&&ge&&gi.alternate===null&&s(B,ge),_=y(gi,_,ke),$e===null?ve=gi:$e.sibling=gi,$e=gi,ge=Fe}if(He.done)return u(B,ge),Pe&&br(B,ke),ve;if(ge===null){for(;!He.done;ke++,He=F.next())He=W(B,He.value,Z),He!==null&&(_=y(He,_,ke),$e===null?ve=He:$e.sibling=He,$e=He);return Pe&&br(B,ke),ve}for(ge=f(ge);!He.done;ke++,He=F.next())He=q(ge,B,ke,He.value,Z),He!==null&&(i&&He.alternate!==null&&ge.delete(He.key===null?ke:He.key),_=y(He,_,ke),$e===null?ve=He:$e.sibling=He,$e=He);return i&&ge.forEach(function(pO){return s(B,pO)}),Pe&&br(B,ke),ve}function Je(B,_,F,Z){if(typeof F=="object"&&F!==null&&F.type===x&&F.key===null&&(F=F.props.children),typeof F=="object"&&F!==null){switch(F.$$typeof){case v:e:{for(var ve=F.key;_!==null;){if(_.key===ve){if(ve=F.type,ve===x){if(_.tag===7){u(B,_.sibling),Z=m(_,F.props.children),Z.return=B,B=Z;break e}}else if(_.elementType===ve||typeof ve=="object"&&ve!==null&&ve.$$typeof===j&&to(ve)===_.type){u(B,_.sibling),Z=m(_,F.props),hl(Z,F),Z.return=B,B=Z;break e}u(B,_);break}else s(B,_);_=_.sibling}F.type===x?(Z=Ji(F.props.children,B.mode,Z,F.key),Z.return=B,B=Z):(Z=Za(F.type,F.key,F.props,null,B.mode,Z),hl(Z,F),Z.return=B,B=Z)}return w(B);case S:e:{for(ve=F.key;_!==null;){if(_.key===ve)if(_.tag===4&&_.stateNode.containerInfo===F.containerInfo&&_.stateNode.implementation===F.implementation){u(B,_.sibling),Z=m(_,F.children||[]),Z.return=B,B=Z;break e}else{u(B,_);break}else s(B,_);_=_.sibling}Z=rd(F,B.mode,Z),Z.return=B,B=Z}return w(B);case j:return F=to(F),Je(B,_,F,Z)}if(me(F))return fe(B,_,F,Z);if(se(F)){if(ve=se(F),typeof ve!="function")throw Error(r(150));return F=ve.call(F),we(B,_,F,Z)}if(typeof F.then=="function")return Je(B,_,ou(F),Z);if(F.$$typeof===k)return Je(B,_,tu(B,F),Z);su(B,F)}return typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint"?(F=""+F,_!==null&&_.tag===6?(u(B,_.sibling),Z=m(_,F),Z.return=B,B=Z):(u(B,_),Z=nd(F,B.mode,Z),Z.return=B,B=Z),w(B)):u(B,_)}return function(B,_,F,Z){try{dl=0;var ve=Je(B,_,F,Z);return is=null,ve}catch(ge){if(ge===rs||ge===ru)throw ge;var $e=gn(29,ge,null,B.mode);return $e.lanes=Z,$e.return=B,$e}}}var ro=zy(!0),jy=zy(!1),Wr=!1;function md(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function gd(i,s){i=i.updateQueue,s.updateQueue===i&&(s.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function ei(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function ti(i,s,u){var f=i.updateQueue;if(f===null)return null;if(f=f.shared,(qe&2)!==0){var m=f.pending;return m===null?s.next=s:(s.next=m.next,m.next=s),f.pending=s,s=Qa(i),vy(i,null,u),s}return Ja(i,f,s,u),Qa(i)}function pl(i,s,u){if(s=s.updateQueue,s!==null&&(s=s.shared,(u&4194048)!==0)){var f=s.lanes;f&=i.pendingLanes,u|=f,s.lanes=u,Re(i,u)}}function yd(i,s){var u=i.updateQueue,f=i.alternate;if(f!==null&&(f=f.updateQueue,u===f)){var m=null,y=null;if(u=u.firstBaseUpdate,u!==null){do{var w={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};y===null?m=y=w:y=y.next=w,u=u.next}while(u!==null);y===null?m=y=s:y=y.next=s}else m=y=s;u={baseState:f.baseState,firstBaseUpdate:m,lastBaseUpdate:y,shared:f.shared,callbacks:f.callbacks},i.updateQueue=u;return}i=u.lastBaseUpdate,i===null?u.firstBaseUpdate=s:i.next=s,u.lastBaseUpdate=s}var vd=!1;function ml(){if(vd){var i=ns;if(i!==null)throw i}}function gl(i,s,u,f){vd=!1;var m=i.updateQueue;Wr=!1;var y=m.firstBaseUpdate,w=m.lastBaseUpdate,R=m.shared.pending;if(R!==null){m.shared.pending=null;var O=R,P=O.next;O.next=null,w===null?y=P:w.next=P,w=O;var Y=i.alternate;Y!==null&&(Y=Y.updateQueue,R=Y.lastBaseUpdate,R!==w&&(R===null?Y.firstBaseUpdate=P:R.next=P,Y.lastBaseUpdate=O))}if(y!==null){var W=m.baseState;w=0,Y=P=O=null,R=y;do{var $=R.lane&-536870913,q=$!==R.lane;if(q?(Ve&$)===$:(f&$)===$){$!==0&&$===ts&&(vd=!0),Y!==null&&(Y=Y.next={lane:0,tag:R.tag,payload:R.payload,callback:null,next:null});e:{var fe=i,we=R;$=s;var Je=u;switch(we.tag){case 1:if(fe=we.payload,typeof fe=="function"){W=fe.call(Je,W,$);break e}W=fe;break e;case 3:fe.flags=fe.flags&-65537|128;case 0:if(fe=we.payload,$=typeof fe=="function"?fe.call(Je,W,$):fe,$==null)break e;W=g({},W,$);break e;case 2:Wr=!0}}$=R.callback,$!==null&&(i.flags|=64,q&&(i.flags|=8192),q=m.callbacks,q===null?m.callbacks=[$]:q.push($))}else q={lane:$,tag:R.tag,payload:R.payload,callback:R.callback,next:null},Y===null?(P=Y=q,O=W):Y=Y.next=q,w|=$;if(R=R.next,R===null){if(R=m.shared.pending,R===null)break;q=R,R=q.next,q.next=null,m.lastBaseUpdate=q,m.shared.pending=null}}while(!0);Y===null&&(O=W),m.baseState=O,m.firstBaseUpdate=P,m.lastBaseUpdate=Y,y===null&&(m.shared.lanes=0),si|=w,i.lanes=w,i.memoizedState=W}}function Ly(i,s){if(typeof i!="function")throw Error(r(191,i));i.call(s)}function By(i,s){var u=i.callbacks;if(u!==null)for(i.callbacks=null,i=0;i<u.length;i++)Ly(u[i],s)}var ss=N(null),lu=N(0);function Iy(i,s){i=kr,X(lu,i),X(ss,s),kr=i|s.baseLanes}function bd(){X(lu,kr),X(ss,ss.current)}function Sd(){kr=lu.current,V(ss),V(lu)}var yn=N(null),Ln=null;function ni(i){var s=i.alternate;X(ft,ft.current&1),X(yn,i),Ln===null&&(s===null||ss.current!==null||s.memoizedState!==null)&&(Ln=i)}function xd(i){X(ft,ft.current),X(yn,i),Ln===null&&(Ln=i)}function Vy(i){i.tag===22?(X(ft,ft.current),X(yn,i),Ln===null&&(Ln=i)):ri()}function ri(){X(ft,ft.current),X(yn,yn.current)}function vn(i){V(yn),Ln===i&&(Ln=null),V(ft)}var ft=N(0);function au(i){for(var s=i;s!==null;){if(s.tag===13){var u=s.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||Th(u)||Ah(u)))return s}else if(s.tag===19&&(s.memoizedProps.revealOrder==="forwards"||s.memoizedProps.revealOrder==="backwards"||s.memoizedProps.revealOrder==="unstable_legacy-backwards"||s.memoizedProps.revealOrder==="together")){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===i)break;for(;s.sibling===null;){if(s.return===null||s.return===i)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var wr=0,Ae=null,Ye=null,mt=null,uu=!1,ls=!1,io=!1,cu=0,yl=0,as=null,iA=0;function st(){throw Error(r(321))}function wd(i,s){if(s===null)return!1;for(var u=0;u<s.length&&u<i.length;u++)if(!mn(i[u],s[u]))return!1;return!0}function Cd(i,s,u,f,m,y){return wr=y,Ae=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,I.H=i===null||i.memoizedState===null?w0:Id,io=!1,y=u(f,m),io=!1,ls&&(y=Py(s,u,f,m)),Fy(i),y}function Fy(i){I.H=Sl;var s=Ye!==null&&Ye.next!==null;if(wr=0,mt=Ye=Ae=null,uu=!1,yl=0,as=null,s)throw Error(r(300));i===null||gt||(i=i.dependencies,i!==null&&eu(i)&&(gt=!0))}function Py(i,s,u,f){Ae=i;var m=0;do{if(ls&&(as=null),yl=0,ls=!1,25<=m)throw Error(r(301));if(m+=1,mt=Ye=null,i.updateQueue!=null){var y=i.updateQueue;y.lastEffect=null,y.events=null,y.stores=null,y.memoCache!=null&&(y.memoCache.index=0)}I.H=C0,y=s(u,f)}while(ls);return y}function oA(){var i=I.H,s=i.useState()[0];return s=typeof s.then=="function"?vl(s):s,i=i.useState()[0],(Ye!==null?Ye.memoizedState:null)!==i&&(Ae.flags|=1024),s}function Md(){var i=cu!==0;return cu=0,i}function Ed(i,s,u){s.updateQueue=i.updateQueue,s.flags&=-2053,i.lanes&=~u}function Rd(i){if(uu){for(i=i.memoizedState;i!==null;){var s=i.queue;s!==null&&(s.pending=null),i=i.next}uu=!1}wr=0,mt=Ye=Ae=null,ls=!1,yl=cu=0,as=null}function en(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return mt===null?Ae.memoizedState=mt=i:mt=mt.next=i,mt}function dt(){if(Ye===null){var i=Ae.alternate;i=i!==null?i.memoizedState:null}else i=Ye.next;var s=mt===null?Ae.memoizedState:mt.next;if(s!==null)mt=s,Ye=i;else{if(i===null)throw Ae.alternate===null?Error(r(467)):Error(r(310));Ye=i,i={memoizedState:Ye.memoizedState,baseState:Ye.baseState,baseQueue:Ye.baseQueue,queue:Ye.queue,next:null},mt===null?Ae.memoizedState=mt=i:mt=mt.next=i}return mt}function fu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function vl(i){var s=yl;return yl+=1,as===null&&(as=[]),i=Ny(as,i,s),s=Ae,(mt===null?s.memoizedState:mt.next)===null&&(s=s.alternate,I.H=s===null||s.memoizedState===null?w0:Id),i}function du(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return vl(i);if(i.$$typeof===k)return _t(i)}throw Error(r(438,String(i)))}function Td(i){var s=null,u=Ae.updateQueue;if(u!==null&&(s=u.memoCache),s==null){var f=Ae.alternate;f!==null&&(f=f.updateQueue,f!==null&&(f=f.memoCache,f!=null&&(s={data:f.data.map(function(m){return m.slice()}),index:0})))}if(s==null&&(s={data:[],index:0}),u===null&&(u=fu(),Ae.updateQueue=u),u.memoCache=s,u=s.data[s.index],u===void 0)for(u=s.data[s.index]=Array(i),f=0;f<i;f++)u[f]=le;return s.index++,u}function Cr(i,s){return typeof s=="function"?s(i):s}function hu(i){var s=dt();return Ad(s,Ye,i)}function Ad(i,s,u){var f=i.queue;if(f===null)throw Error(r(311));f.lastRenderedReducer=u;var m=i.baseQueue,y=f.pending;if(y!==null){if(m!==null){var w=m.next;m.next=y.next,y.next=w}s.baseQueue=m=y,f.pending=null}if(y=i.baseState,m===null)i.memoizedState=y;else{s=m.next;var R=w=null,O=null,P=s,Y=!1;do{var W=P.lane&-536870913;if(W!==P.lane?(Ve&W)===W:(wr&W)===W){var $=P.revertLane;if($===0)O!==null&&(O=O.next={lane:0,revertLane:0,gesture:null,action:P.action,hasEagerState:P.hasEagerState,eagerState:P.eagerState,next:null}),W===ts&&(Y=!0);else if((wr&$)===$){P=P.next,$===ts&&(Y=!0);continue}else W={lane:0,revertLane:P.revertLane,gesture:null,action:P.action,hasEagerState:P.hasEagerState,eagerState:P.eagerState,next:null},O===null?(R=O=W,w=y):O=O.next=W,Ae.lanes|=$,si|=$;W=P.action,io&&u(y,W),y=P.hasEagerState?P.eagerState:u(y,W)}else $={lane:W,revertLane:P.revertLane,gesture:P.gesture,action:P.action,hasEagerState:P.hasEagerState,eagerState:P.eagerState,next:null},O===null?(R=O=$,w=y):O=O.next=$,Ae.lanes|=W,si|=W;P=P.next}while(P!==null&&P!==s);if(O===null?w=y:O.next=R,!mn(y,i.memoizedState)&&(gt=!0,Y&&(u=ns,u!==null)))throw u;i.memoizedState=y,i.baseState=w,i.baseQueue=O,f.lastRenderedState=y}return m===null&&(f.lanes=0),[i.memoizedState,f.dispatch]}function Od(i){var s=dt(),u=s.queue;if(u===null)throw Error(r(311));u.lastRenderedReducer=i;var f=u.dispatch,m=u.pending,y=s.memoizedState;if(m!==null){u.pending=null;var w=m=m.next;do y=i(y,w.action),w=w.next;while(w!==m);mn(y,s.memoizedState)||(gt=!0),s.memoizedState=y,s.baseQueue===null&&(s.baseState=y),u.lastRenderedState=y}return[y,f]}function $y(i,s,u){var f=Ae,m=dt(),y=Pe;if(y){if(u===void 0)throw Error(r(407));u=u()}else u=s();var w=!mn((Ye||m).memoizedState,u);if(w&&(m.memoizedState=u,gt=!0),m=m.queue,Dd(qy.bind(null,f,m,i),[i]),m.getSnapshot!==s||w||mt!==null&&mt.memoizedState.tag&1){if(f.flags|=2048,us(9,{destroy:void 0},Uy.bind(null,f,m,u,s),null),Qe===null)throw Error(r(349));y||(wr&127)!==0||Hy(f,s,u)}return u}function Hy(i,s,u){i.flags|=16384,i={getSnapshot:s,value:u},s=Ae.updateQueue,s===null?(s=fu(),Ae.updateQueue=s,s.stores=[i]):(u=s.stores,u===null?s.stores=[i]:u.push(i))}function Uy(i,s,u,f){s.value=u,s.getSnapshot=f,Gy(s)&&Ky(i)}function qy(i,s,u){return u(function(){Gy(s)&&Ky(i)})}function Gy(i){var s=i.getSnapshot;i=i.value;try{var u=s();return!mn(i,u)}catch{return!0}}function Ky(i){var s=Xi(i,2);s!==null&&fn(s,i,2)}function kd(i){var s=en();if(typeof i=="function"){var u=i;if(i=u(),io){pn(!0);try{u()}finally{pn(!1)}}}return s.memoizedState=s.baseState=i,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Cr,lastRenderedState:i},s}function Yy(i,s,u,f){return i.baseState=u,Ad(i,Ye,typeof f=="function"?f:Cr)}function sA(i,s,u,f,m){if(gu(i))throw Error(r(485));if(i=s.action,i!==null){var y={payload:m,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(w){y.listeners.push(w)}};I.T!==null?u(!0):y.isTransition=!1,f(y),u=s.pending,u===null?(y.next=s.pending=y,Xy(s,y)):(y.next=u.next,s.pending=u.next=y)}}function Xy(i,s){var u=s.action,f=s.payload,m=i.state;if(s.isTransition){var y=I.T,w={};I.T=w;try{var R=u(m,f),O=I.S;O!==null&&O(w,R),Jy(i,s,R)}catch(P){Nd(i,s,P)}finally{y!==null&&w.types!==null&&(y.types=w.types),I.T=y}}else try{y=u(m,f),Jy(i,s,y)}catch(P){Nd(i,s,P)}}function Jy(i,s,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(f){Qy(i,s,f)},function(f){return Nd(i,s,f)}):Qy(i,s,u)}function Qy(i,s,u){s.status="fulfilled",s.value=u,Zy(s),i.state=u,s=i.pending,s!==null&&(u=s.next,u===s?i.pending=null:(u=u.next,s.next=u,Xy(i,u)))}function Nd(i,s,u){var f=i.pending;if(i.pending=null,f!==null){f=f.next;do s.status="rejected",s.reason=u,Zy(s),s=s.next;while(s!==f)}i.action=null}function Zy(i){i=i.listeners;for(var s=0;s<i.length;s++)(0,i[s])()}function Wy(i,s){return s}function e0(i,s){if(Pe){var u=Qe.formState;if(u!==null){e:{var f=Ae;if(Pe){if(tt){t:{for(var m=tt,y=jn;m.nodeType!==8;){if(!y){m=null;break t}if(m=Bn(m.nextSibling),m===null){m=null;break t}}y=m.data,m=y==="F!"||y==="F"?m:null}if(m){tt=Bn(m.nextSibling),f=m.data==="F!";break e}}Qr(f)}f=!1}f&&(s=u[0])}}return u=en(),u.memoizedState=u.baseState=s,f={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wy,lastRenderedState:s},u.queue=f,u=b0.bind(null,Ae,f),f.dispatch=u,f=kd(!1),y=Bd.bind(null,Ae,!1,f.queue),f=en(),m={state:s,dispatch:null,action:i,pending:null},f.queue=m,u=sA.bind(null,Ae,m,y,u),m.dispatch=u,f.memoizedState=i,[s,u,!1]}function t0(i){var s=dt();return n0(s,Ye,i)}function n0(i,s,u){if(s=Ad(i,s,Wy)[0],i=hu(Cr)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var f=vl(s)}catch(w){throw w===rs?ru:w}else f=s;s=dt();var m=s.queue,y=m.dispatch;return u!==s.memoizedState&&(Ae.flags|=2048,us(9,{destroy:void 0},lA.bind(null,m,u),null)),[f,y,i]}function lA(i,s){i.action=s}function r0(i){var s=dt(),u=Ye;if(u!==null)return n0(s,u,i);dt(),s=s.memoizedState,u=dt();var f=u.queue.dispatch;return u.memoizedState=i,[s,f,!1]}function us(i,s,u,f){return i={tag:i,create:u,deps:f,inst:s,next:null},s=Ae.updateQueue,s===null&&(s=fu(),Ae.updateQueue=s),u=s.lastEffect,u===null?s.lastEffect=i.next=i:(f=u.next,u.next=i,i.next=f,s.lastEffect=i),i}function i0(){return dt().memoizedState}function pu(i,s,u,f){var m=en();Ae.flags|=i,m.memoizedState=us(1|s,{destroy:void 0},u,f===void 0?null:f)}function mu(i,s,u,f){var m=dt();f=f===void 0?null:f;var y=m.memoizedState.inst;Ye!==null&&f!==null&&wd(f,Ye.memoizedState.deps)?m.memoizedState=us(s,y,u,f):(Ae.flags|=i,m.memoizedState=us(1|s,y,u,f))}function o0(i,s){pu(8390656,8,i,s)}function Dd(i,s){mu(2048,8,i,s)}function aA(i){Ae.flags|=4;var s=Ae.updateQueue;if(s===null)s=fu(),Ae.updateQueue=s,s.events=[i];else{var u=s.events;u===null?s.events=[i]:u.push(i)}}function s0(i){var s=dt().memoizedState;return aA({ref:s,nextImpl:i}),function(){if((qe&2)!==0)throw Error(r(440));return s.impl.apply(void 0,arguments)}}function l0(i,s){return mu(4,2,i,s)}function a0(i,s){return mu(4,4,i,s)}function u0(i,s){if(typeof s=="function"){i=i();var u=s(i);return function(){typeof u=="function"?u():s(null)}}if(s!=null)return i=i(),s.current=i,function(){s.current=null}}function c0(i,s,u){u=u!=null?u.concat([i]):null,mu(4,4,u0.bind(null,s,i),u)}function _d(){}function f0(i,s){var u=dt();s=s===void 0?null:s;var f=u.memoizedState;return s!==null&&wd(s,f[1])?f[0]:(u.memoizedState=[i,s],i)}function d0(i,s){var u=dt();s=s===void 0?null:s;var f=u.memoizedState;if(s!==null&&wd(s,f[1]))return f[0];if(f=i(),io){pn(!0);try{i()}finally{pn(!1)}}return u.memoizedState=[f,s],f}function zd(i,s,u){return u===void 0||(wr&1073741824)!==0&&(Ve&261930)===0?i.memoizedState=s:(i.memoizedState=u,i=hv(),Ae.lanes|=i,si|=i,u)}function h0(i,s,u,f){return mn(u,s)?u:ss.current!==null?(i=zd(i,u,f),mn(i,s)||(gt=!0),i):(wr&42)===0||(wr&1073741824)!==0&&(Ve&261930)===0?(gt=!0,i.memoizedState=u):(i=hv(),Ae.lanes|=i,si|=i,s)}function p0(i,s,u,f,m){var y=Q.p;Q.p=y!==0&&8>y?y:8;var w=I.T,R={};I.T=R,Bd(i,!1,s,u);try{var O=m(),P=I.S;if(P!==null&&P(R,O),O!==null&&typeof O=="object"&&typeof O.then=="function"){var Y=rA(O,f);bl(i,s,Y,xn(i))}else bl(i,s,f,xn(i))}catch(W){bl(i,s,{then:function(){},status:"rejected",reason:W},xn())}finally{Q.p=y,w!==null&&R.types!==null&&(w.types=R.types),I.T=w}}function uA(){}function jd(i,s,u,f){if(i.tag!==5)throw Error(r(476));var m=m0(i).queue;p0(i,m,s,U,u===null?uA:function(){return g0(i),u(f)})}function m0(i){var s=i.memoizedState;if(s!==null)return s;s={memoizedState:U,baseState:U,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Cr,lastRenderedState:U},next:null};var u={};return s.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Cr,lastRenderedState:u},next:null},i.memoizedState=s,i=i.alternate,i!==null&&(i.memoizedState=s),s}function g0(i){var s=m0(i);s.next===null&&(s=i.alternate.memoizedState),bl(i,s.next.queue,{},xn())}function Ld(){return _t(Ll)}function y0(){return dt().memoizedState}function v0(){return dt().memoizedState}function cA(i){for(var s=i.return;s!==null;){switch(s.tag){case 24:case 3:var u=xn();i=ei(u);var f=ti(s,i,u);f!==null&&(fn(f,s,u),pl(f,s,u)),s={cache:fd()},i.payload=s;return}s=s.return}}function fA(i,s,u){var f=xn();u={lane:f,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},gu(i)?S0(s,u):(u=ed(i,s,u,f),u!==null&&(fn(u,i,f),x0(u,s,f)))}function b0(i,s,u){var f=xn();bl(i,s,u,f)}function bl(i,s,u,f){var m={lane:f,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(gu(i))S0(s,m);else{var y=i.alternate;if(i.lanes===0&&(y===null||y.lanes===0)&&(y=s.lastRenderedReducer,y!==null))try{var w=s.lastRenderedState,R=y(w,u);if(m.hasEagerState=!0,m.eagerState=R,mn(R,w))return Ja(i,s,m,0),Qe===null&&Xa(),!1}catch{}if(u=ed(i,s,m,f),u!==null)return fn(u,i,f),x0(u,s,f),!0}return!1}function Bd(i,s,u,f){if(f={lane:2,revertLane:mh(),gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null},gu(i)){if(s)throw Error(r(479))}else s=ed(i,u,f,2),s!==null&&fn(s,i,2)}function gu(i){var s=i.alternate;return i===Ae||s!==null&&s===Ae}function S0(i,s){ls=uu=!0;var u=i.pending;u===null?s.next=s:(s.next=u.next,u.next=s),i.pending=s}function x0(i,s,u){if((u&4194048)!==0){var f=s.lanes;f&=i.pendingLanes,u|=f,s.lanes=u,Re(i,u)}}var Sl={readContext:_t,use:du,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};Sl.useEffectEvent=st;var w0={readContext:_t,use:du,useCallback:function(i,s){return en().memoizedState=[i,s===void 0?null:s],i},useContext:_t,useEffect:o0,useImperativeHandle:function(i,s,u){u=u!=null?u.concat([i]):null,pu(4194308,4,u0.bind(null,s,i),u)},useLayoutEffect:function(i,s){return pu(4194308,4,i,s)},useInsertionEffect:function(i,s){pu(4,2,i,s)},useMemo:function(i,s){var u=en();s=s===void 0?null:s;var f=i();if(io){pn(!0);try{i()}finally{pn(!1)}}return u.memoizedState=[f,s],f},useReducer:function(i,s,u){var f=en();if(u!==void 0){var m=u(s);if(io){pn(!0);try{u(s)}finally{pn(!1)}}}else m=s;return f.memoizedState=f.baseState=m,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:m},f.queue=i,i=i.dispatch=fA.bind(null,Ae,i),[f.memoizedState,i]},useRef:function(i){var s=en();return i={current:i},s.memoizedState=i},useState:function(i){i=kd(i);var s=i.queue,u=b0.bind(null,Ae,s);return s.dispatch=u,[i.memoizedState,u]},useDebugValue:_d,useDeferredValue:function(i,s){var u=en();return zd(u,i,s)},useTransition:function(){var i=kd(!1);return i=p0.bind(null,Ae,i.queue,!0,!1),en().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,s,u){var f=Ae,m=en();if(Pe){if(u===void 0)throw Error(r(407));u=u()}else{if(u=s(),Qe===null)throw Error(r(349));(Ve&127)!==0||Hy(f,s,u)}m.memoizedState=u;var y={value:u,getSnapshot:s};return m.queue=y,o0(qy.bind(null,f,y,i),[i]),f.flags|=2048,us(9,{destroy:void 0},Uy.bind(null,f,y,u,s),null),u},useId:function(){var i=en(),s=Qe.identifierPrefix;if(Pe){var u=rr,f=nr;u=(f&~(1<<32-Wt(f)-1)).toString(32)+u,s="_"+s+"R_"+u,u=cu++,0<u&&(s+="H"+u.toString(32)),s+="_"}else u=iA++,s="_"+s+"r_"+u.toString(32)+"_";return i.memoizedState=s},useHostTransitionStatus:Ld,useFormState:e0,useActionState:e0,useOptimistic:function(i){var s=en();s.memoizedState=s.baseState=i;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return s.queue=u,s=Bd.bind(null,Ae,!0,u),u.dispatch=s,[i,s]},useMemoCache:Td,useCacheRefresh:function(){return en().memoizedState=cA.bind(null,Ae)},useEffectEvent:function(i){var s=en(),u={impl:i};return s.memoizedState=u,function(){if((qe&2)!==0)throw Error(r(440));return u.impl.apply(void 0,arguments)}}},Id={readContext:_t,use:du,useCallback:f0,useContext:_t,useEffect:Dd,useImperativeHandle:c0,useInsertionEffect:l0,useLayoutEffect:a0,useMemo:d0,useReducer:hu,useRef:i0,useState:function(){return hu(Cr)},useDebugValue:_d,useDeferredValue:function(i,s){var u=dt();return h0(u,Ye.memoizedState,i,s)},useTransition:function(){var i=hu(Cr)[0],s=dt().memoizedState;return[typeof i=="boolean"?i:vl(i),s]},useSyncExternalStore:$y,useId:y0,useHostTransitionStatus:Ld,useFormState:t0,useActionState:t0,useOptimistic:function(i,s){var u=dt();return Yy(u,Ye,i,s)},useMemoCache:Td,useCacheRefresh:v0};Id.useEffectEvent=s0;var C0={readContext:_t,use:du,useCallback:f0,useContext:_t,useEffect:Dd,useImperativeHandle:c0,useInsertionEffect:l0,useLayoutEffect:a0,useMemo:d0,useReducer:Od,useRef:i0,useState:function(){return Od(Cr)},useDebugValue:_d,useDeferredValue:function(i,s){var u=dt();return Ye===null?zd(u,i,s):h0(u,Ye.memoizedState,i,s)},useTransition:function(){var i=Od(Cr)[0],s=dt().memoizedState;return[typeof i=="boolean"?i:vl(i),s]},useSyncExternalStore:$y,useId:y0,useHostTransitionStatus:Ld,useFormState:r0,useActionState:r0,useOptimistic:function(i,s){var u=dt();return Ye!==null?Yy(u,Ye,i,s):(u.baseState=i,[i,u.queue.dispatch])},useMemoCache:Td,useCacheRefresh:v0};C0.useEffectEvent=s0;function Vd(i,s,u,f){s=i.memoizedState,u=u(f,s),u=u==null?s:g({},s,u),i.memoizedState=u,i.lanes===0&&(i.updateQueue.baseState=u)}var Fd={enqueueSetState:function(i,s,u){i=i._reactInternals;var f=xn(),m=ei(f);m.payload=s,u!=null&&(m.callback=u),s=ti(i,m,f),s!==null&&(fn(s,i,f),pl(s,i,f))},enqueueReplaceState:function(i,s,u){i=i._reactInternals;var f=xn(),m=ei(f);m.tag=1,m.payload=s,u!=null&&(m.callback=u),s=ti(i,m,f),s!==null&&(fn(s,i,f),pl(s,i,f))},enqueueForceUpdate:function(i,s){i=i._reactInternals;var u=xn(),f=ei(u);f.tag=2,s!=null&&(f.callback=s),s=ti(i,f,u),s!==null&&(fn(s,i,u),pl(s,i,u))}};function M0(i,s,u,f,m,y,w){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(f,y,w):s.prototype&&s.prototype.isPureReactComponent?!sl(u,f)||!sl(m,y):!0}function E0(i,s,u,f){i=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(u,f),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(u,f),s.state!==i&&Fd.enqueueReplaceState(s,s.state,null)}function oo(i,s){var u=s;if("ref"in s){u={};for(var f in s)f!=="ref"&&(u[f]=s[f])}if(i=i.defaultProps){u===s&&(u=g({},u));for(var m in i)u[m]===void 0&&(u[m]=i[m])}return u}function R0(i){Ya(i)}function T0(i){console.error(i)}function A0(i){Ya(i)}function yu(i,s){try{var u=i.onUncaughtError;u(s.value,{componentStack:s.stack})}catch(f){setTimeout(function(){throw f})}}function O0(i,s,u){try{var f=i.onCaughtError;f(u.value,{componentStack:u.stack,errorBoundary:s.tag===1?s.stateNode:null})}catch(m){setTimeout(function(){throw m})}}function Pd(i,s,u){return u=ei(u),u.tag=3,u.payload={element:null},u.callback=function(){yu(i,s)},u}function k0(i){return i=ei(i),i.tag=3,i}function N0(i,s,u,f){var m=u.type.getDerivedStateFromError;if(typeof m=="function"){var y=f.value;i.payload=function(){return m(y)},i.callback=function(){O0(s,u,f)}}var w=u.stateNode;w!==null&&typeof w.componentDidCatch=="function"&&(i.callback=function(){O0(s,u,f),typeof m!="function"&&(li===null?li=new Set([this]):li.add(this));var R=f.stack;this.componentDidCatch(f.value,{componentStack:R!==null?R:""})})}function dA(i,s,u,f,m){if(u.flags|=32768,f!==null&&typeof f=="object"&&typeof f.then=="function"){if(s=u.alternate,s!==null&&es(s,u,m,!0),u=yn.current,u!==null){switch(u.tag){case 31:case 13:return Ln===null?Ou():u.alternate===null&<===0&&(lt=3),u.flags&=-257,u.flags|=65536,u.lanes=m,f===iu?u.flags|=16384:(s=u.updateQueue,s===null?u.updateQueue=new Set([f]):s.add(f),dh(i,f,m)),!1;case 22:return u.flags|=65536,f===iu?u.flags|=16384:(s=u.updateQueue,s===null?(s={transitions:null,markerInstances:null,retryQueue:new Set([f])},u.updateQueue=s):(u=s.retryQueue,u===null?s.retryQueue=new Set([f]):u.add(f)),dh(i,f,m)),!1}throw Error(r(435,u.tag))}return dh(i,f,m),Ou(),!1}if(Pe)return s=yn.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=m,f!==sd&&(i=Error(r(422),{cause:f}),ul(Dn(i,u)))):(f!==sd&&(s=Error(r(423),{cause:f}),ul(Dn(s,u))),i=i.current.alternate,i.flags|=65536,m&=-m,i.lanes|=m,f=Dn(f,u),m=Pd(i.stateNode,f,m),yd(i,m),lt!==4&&(lt=2)),!1;var y=Error(r(520),{cause:f});if(y=Dn(y,u),Al===null?Al=[y]:Al.push(y),lt!==4&&(lt=2),s===null)return!0;f=Dn(f,u),u=s;do{switch(u.tag){case 3:return u.flags|=65536,i=m&-m,u.lanes|=i,i=Pd(u.stateNode,f,i),yd(u,i),!1;case 1:if(s=u.type,y=u.stateNode,(u.flags&128)===0&&(typeof s.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(li===null||!li.has(y))))return u.flags|=65536,m&=-m,u.lanes|=m,m=k0(m),N0(m,i,u,f),yd(u,m),!1}u=u.return}while(u!==null);return!1}var $d=Error(r(461)),gt=!1;function zt(i,s,u,f){s.child=i===null?jy(s,null,u,f):ro(s,i.child,u,f)}function D0(i,s,u,f,m){u=u.render;var y=s.ref;if("ref"in f){var w={};for(var R in f)R!=="ref"&&(w[R]=f[R])}else w=f;return Wi(s),f=Cd(i,s,u,w,y,m),R=Md(),i!==null&&!gt?(Ed(i,s,m),Mr(i,s,m)):(Pe&&R&&id(s),s.flags|=1,zt(i,s,f,m),s.child)}function _0(i,s,u,f,m){if(i===null){var y=u.type;return typeof y=="function"&&!td(y)&&y.defaultProps===void 0&&u.compare===null?(s.tag=15,s.type=y,z0(i,s,y,f,m)):(i=Za(u.type,null,f,s,s.mode,m),i.ref=s.ref,i.return=s,s.child=i)}if(y=i.child,!Jd(i,m)){var w=y.memoizedProps;if(u=u.compare,u=u!==null?u:sl,u(w,f)&&i.ref===s.ref)return Mr(i,s,m)}return s.flags|=1,i=vr(y,f),i.ref=s.ref,i.return=s,s.child=i}function z0(i,s,u,f,m){if(i!==null){var y=i.memoizedProps;if(sl(y,f)&&i.ref===s.ref)if(gt=!1,s.pendingProps=f=y,Jd(i,m))(i.flags&131072)!==0&&(gt=!0);else return s.lanes=i.lanes,Mr(i,s,m)}return Hd(i,s,u,f,m)}function j0(i,s,u,f){var m=f.children,y=i!==null?i.memoizedState:null;if(i===null&&s.stateNode===null&&(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),f.mode==="hidden"){if((s.flags&128)!==0){if(y=y!==null?y.baseLanes|u:u,i!==null){for(f=s.child=i.child,m=0;f!==null;)m=m|f.lanes|f.childLanes,f=f.sibling;f=m&~y}else f=0,s.child=null;return L0(i,s,y,u,f)}if((u&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},i!==null&&nu(s,y!==null?y.cachePool:null),y!==null?Iy(s,y):bd(),Vy(s);else return f=s.lanes=536870912,L0(i,s,y!==null?y.baseLanes|u:u,u,f)}else y!==null?(nu(s,y.cachePool),Iy(s,y),ri(),s.memoizedState=null):(i!==null&&nu(s,null),bd(),ri());return zt(i,s,m,u),s.child}function xl(i,s){return i!==null&&i.tag===22||s.stateNode!==null||(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.sibling}function L0(i,s,u,f,m){var y=hd();return y=y===null?null:{parent:pt._currentValue,pool:y},s.memoizedState={baseLanes:u,cachePool:y},i!==null&&nu(s,null),bd(),Vy(s),i!==null&&es(i,s,f,!0),s.childLanes=m,null}function vu(i,s){return s=Su({mode:s.mode,children:s.children},i.mode),s.ref=i.ref,i.child=s,s.return=i,s}function B0(i,s,u){return ro(s,i.child,null,u),i=vu(s,s.pendingProps),i.flags|=2,vn(s),s.memoizedState=null,i}function hA(i,s,u){var f=s.pendingProps,m=(s.flags&128)!==0;if(s.flags&=-129,i===null){if(Pe){if(f.mode==="hidden")return i=vu(s,f),s.lanes=536870912,xl(null,i);if(xd(s),(i=tt)?(i=Xv(i,jn),i=i!==null&&i.data==="&"?i:null,i!==null&&(s.memoizedState={dehydrated:i,treeContext:Xr!==null?{id:nr,overflow:rr}:null,retryLane:536870912,hydrationErrors:null},u=Sy(i),u.return=s,s.child=u,Dt=s,tt=null)):i=null,i===null)throw Qr(s);return s.lanes=536870912,null}return vu(s,f)}var y=i.memoizedState;if(y!==null){var w=y.dehydrated;if(xd(s),m)if(s.flags&256)s.flags&=-257,s=B0(i,s,u);else if(s.memoizedState!==null)s.child=i.child,s.flags|=128,s=null;else throw Error(r(558));else if(gt||es(i,s,u,!1),m=(u&i.childLanes)!==0,gt||m){if(f=Qe,f!==null&&(w=ut(f,u),w!==0&&w!==y.retryLane))throw y.retryLane=w,Xi(i,w),fn(f,i,w),$d;Ou(),s=B0(i,s,u)}else i=y.treeContext,tt=Bn(w.nextSibling),Dt=s,Pe=!0,Jr=null,jn=!1,i!==null&&Cy(s,i),s=vu(s,f),s.flags|=4096;return s}return i=vr(i.child,{mode:f.mode,children:f.children}),i.ref=s.ref,s.child=i,i.return=s,i}function bu(i,s){var u=s.ref;if(u===null)i!==null&&i.ref!==null&&(s.flags|=4194816);else{if(typeof u!="function"&&typeof u!="object")throw Error(r(284));(i===null||i.ref!==u)&&(s.flags|=4194816)}}function Hd(i,s,u,f,m){return Wi(s),u=Cd(i,s,u,f,void 0,m),f=Md(),i!==null&&!gt?(Ed(i,s,m),Mr(i,s,m)):(Pe&&f&&id(s),s.flags|=1,zt(i,s,u,m),s.child)}function I0(i,s,u,f,m,y){return Wi(s),s.updateQueue=null,u=Py(s,f,u,m),Fy(i),f=Md(),i!==null&&!gt?(Ed(i,s,y),Mr(i,s,y)):(Pe&&f&&id(s),s.flags|=1,zt(i,s,u,y),s.child)}function V0(i,s,u,f,m){if(Wi(s),s.stateNode===null){var y=Jo,w=u.contextType;typeof w=="object"&&w!==null&&(y=_t(w)),y=new u(f,y),s.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,y.updater=Fd,s.stateNode=y,y._reactInternals=s,y=s.stateNode,y.props=f,y.state=s.memoizedState,y.refs={},md(s),w=u.contextType,y.context=typeof w=="object"&&w!==null?_t(w):Jo,y.state=s.memoizedState,w=u.getDerivedStateFromProps,typeof w=="function"&&(Vd(s,u,w,f),y.state=s.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof y.getSnapshotBeforeUpdate=="function"||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(w=y.state,typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount(),w!==y.state&&Fd.enqueueReplaceState(y,y.state,null),gl(s,f,y,m),ml(),y.state=s.memoizedState),typeof y.componentDidMount=="function"&&(s.flags|=4194308),f=!0}else if(i===null){y=s.stateNode;var R=s.memoizedProps,O=oo(u,R);y.props=O;var P=y.context,Y=u.contextType;w=Jo,typeof Y=="object"&&Y!==null&&(w=_t(Y));var W=u.getDerivedStateFromProps;Y=typeof W=="function"||typeof y.getSnapshotBeforeUpdate=="function",R=s.pendingProps!==R,Y||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(R||P!==w)&&E0(s,y,f,w),Wr=!1;var $=s.memoizedState;y.state=$,gl(s,f,y,m),ml(),P=s.memoizedState,R||$!==P||Wr?(typeof W=="function"&&(Vd(s,u,W,f),P=s.memoizedState),(O=Wr||M0(s,u,O,f,$,P,w))?(Y||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount()),typeof y.componentDidMount=="function"&&(s.flags|=4194308)):(typeof y.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=f,s.memoizedState=P),y.props=f,y.state=P,y.context=w,f=O):(typeof y.componentDidMount=="function"&&(s.flags|=4194308),f=!1)}else{y=s.stateNode,gd(i,s),w=s.memoizedProps,Y=oo(u,w),y.props=Y,W=s.pendingProps,$=y.context,P=u.contextType,O=Jo,typeof P=="object"&&P!==null&&(O=_t(P)),R=u.getDerivedStateFromProps,(P=typeof R=="function"||typeof y.getSnapshotBeforeUpdate=="function")||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(w!==W||$!==O)&&E0(s,y,f,O),Wr=!1,$=s.memoizedState,y.state=$,gl(s,f,y,m),ml();var q=s.memoizedState;w!==W||$!==q||Wr||i!==null&&i.dependencies!==null&&eu(i.dependencies)?(typeof R=="function"&&(Vd(s,u,R,f),q=s.memoizedState),(Y=Wr||M0(s,u,Y,f,$,q,O)||i!==null&&i.dependencies!==null&&eu(i.dependencies))?(P||typeof y.UNSAFE_componentWillUpdate!="function"&&typeof y.componentWillUpdate!="function"||(typeof y.componentWillUpdate=="function"&&y.componentWillUpdate(f,q,O),typeof y.UNSAFE_componentWillUpdate=="function"&&y.UNSAFE_componentWillUpdate(f,q,O)),typeof y.componentDidUpdate=="function"&&(s.flags|=4),typeof y.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof y.componentDidUpdate!="function"||w===i.memoizedProps&&$===i.memoizedState||(s.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||w===i.memoizedProps&&$===i.memoizedState||(s.flags|=1024),s.memoizedProps=f,s.memoizedState=q),y.props=f,y.state=q,y.context=O,f=Y):(typeof y.componentDidUpdate!="function"||w===i.memoizedProps&&$===i.memoizedState||(s.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||w===i.memoizedProps&&$===i.memoizedState||(s.flags|=1024),f=!1)}return y=f,bu(i,s),f=(s.flags&128)!==0,y||f?(y=s.stateNode,u=f&&typeof u.getDerivedStateFromError!="function"?null:y.render(),s.flags|=1,i!==null&&f?(s.child=ro(s,i.child,null,m),s.child=ro(s,null,u,m)):zt(i,s,u,m),s.memoizedState=y.state,i=s.child):i=Mr(i,s,m),i}function F0(i,s,u,f){return Qi(),s.flags|=256,zt(i,s,u,f),s.child}var Ud={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function qd(i){return{baseLanes:i,cachePool:Oy()}}function Gd(i,s,u){return i=i!==null?i.childLanes&~u:0,s&&(i|=Sn),i}function P0(i,s,u){var f=s.pendingProps,m=!1,y=(s.flags&128)!==0,w;if((w=y)||(w=i!==null&&i.memoizedState===null?!1:(ft.current&2)!==0),w&&(m=!0,s.flags&=-129),w=(s.flags&32)!==0,s.flags&=-33,i===null){if(Pe){if(m?ni(s):ri(),(i=tt)?(i=Xv(i,jn),i=i!==null&&i.data!=="&"?i:null,i!==null&&(s.memoizedState={dehydrated:i,treeContext:Xr!==null?{id:nr,overflow:rr}:null,retryLane:536870912,hydrationErrors:null},u=Sy(i),u.return=s,s.child=u,Dt=s,tt=null)):i=null,i===null)throw Qr(s);return Ah(i)?s.lanes=32:s.lanes=536870912,null}var R=f.children;return f=f.fallback,m?(ri(),m=s.mode,R=Su({mode:"hidden",children:R},m),f=Ji(f,m,u,null),R.return=s,f.return=s,R.sibling=f,s.child=R,f=s.child,f.memoizedState=qd(u),f.childLanes=Gd(i,w,u),s.memoizedState=Ud,xl(null,f)):(ni(s),Kd(s,R))}var O=i.memoizedState;if(O!==null&&(R=O.dehydrated,R!==null)){if(y)s.flags&256?(ni(s),s.flags&=-257,s=Yd(i,s,u)):s.memoizedState!==null?(ri(),s.child=i.child,s.flags|=128,s=null):(ri(),R=f.fallback,m=s.mode,f=Su({mode:"visible",children:f.children},m),R=Ji(R,m,u,null),R.flags|=2,f.return=s,R.return=s,f.sibling=R,s.child=f,ro(s,i.child,null,u),f=s.child,f.memoizedState=qd(u),f.childLanes=Gd(i,w,u),s.memoizedState=Ud,s=xl(null,f));else if(ni(s),Ah(R)){if(w=R.nextSibling&&R.nextSibling.dataset,w)var P=w.dgst;w=P,f=Error(r(419)),f.stack="",f.digest=w,ul({value:f,source:null,stack:null}),s=Yd(i,s,u)}else if(gt||es(i,s,u,!1),w=(u&i.childLanes)!==0,gt||w){if(w=Qe,w!==null&&(f=ut(w,u),f!==0&&f!==O.retryLane))throw O.retryLane=f,Xi(i,f),fn(w,i,f),$d;Th(R)||Ou(),s=Yd(i,s,u)}else Th(R)?(s.flags|=192,s.child=i.child,s=null):(i=O.treeContext,tt=Bn(R.nextSibling),Dt=s,Pe=!0,Jr=null,jn=!1,i!==null&&Cy(s,i),s=Kd(s,f.children),s.flags|=4096);return s}return m?(ri(),R=f.fallback,m=s.mode,O=i.child,P=O.sibling,f=vr(O,{mode:"hidden",children:f.children}),f.subtreeFlags=O.subtreeFlags&65011712,P!==null?R=vr(P,R):(R=Ji(R,m,u,null),R.flags|=2),R.return=s,f.return=s,f.sibling=R,s.child=f,xl(null,f),f=s.child,R=i.child.memoizedState,R===null?R=qd(u):(m=R.cachePool,m!==null?(O=pt._currentValue,m=m.parent!==O?{parent:O,pool:O}:m):m=Oy(),R={baseLanes:R.baseLanes|u,cachePool:m}),f.memoizedState=R,f.childLanes=Gd(i,w,u),s.memoizedState=Ud,xl(i.child,f)):(ni(s),u=i.child,i=u.sibling,u=vr(u,{mode:"visible",children:f.children}),u.return=s,u.sibling=null,i!==null&&(w=s.deletions,w===null?(s.deletions=[i],s.flags|=16):w.push(i)),s.child=u,s.memoizedState=null,u)}function Kd(i,s){return s=Su({mode:"visible",children:s},i.mode),s.return=i,i.child=s}function Su(i,s){return i=gn(22,i,null,s),i.lanes=0,i}function Yd(i,s,u){return ro(s,i.child,null,u),i=Kd(s,s.pendingProps.children),i.flags|=2,s.memoizedState=null,i}function $0(i,s,u){i.lanes|=s;var f=i.alternate;f!==null&&(f.lanes|=s),ud(i.return,s,u)}function Xd(i,s,u,f,m,y){var w=i.memoizedState;w===null?i.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:f,tail:u,tailMode:m,treeForkCount:y}:(w.isBackwards=s,w.rendering=null,w.renderingStartTime=0,w.last=f,w.tail=u,w.tailMode=m,w.treeForkCount=y)}function H0(i,s,u){var f=s.pendingProps,m=f.revealOrder,y=f.tail;f=f.children;var w=ft.current,R=(w&2)!==0;if(R?(w=w&1|2,s.flags|=128):w&=1,X(ft,w),zt(i,s,f,u),f=Pe?al:0,!R&&i!==null&&(i.flags&128)!==0)e:for(i=s.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&$0(i,u,s);else if(i.tag===19)$0(i,u,s);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===s)break e;for(;i.sibling===null;){if(i.return===null||i.return===s)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}switch(m){case"forwards":for(u=s.child,m=null;u!==null;)i=u.alternate,i!==null&&au(i)===null&&(m=u),u=u.sibling;u=m,u===null?(m=s.child,s.child=null):(m=u.sibling,u.sibling=null),Xd(s,!1,m,u,y,f);break;case"backwards":case"unstable_legacy-backwards":for(u=null,m=s.child,s.child=null;m!==null;){if(i=m.alternate,i!==null&&au(i)===null){s.child=m;break}i=m.sibling,m.sibling=u,u=m,m=i}Xd(s,!0,u,null,y,f);break;case"together":Xd(s,!1,null,null,void 0,f);break;default:s.memoizedState=null}return s.child}function Mr(i,s,u){if(i!==null&&(s.dependencies=i.dependencies),si|=s.lanes,(u&s.childLanes)===0)if(i!==null){if(es(i,s,u,!1),(u&s.childLanes)===0)return null}else return null;if(i!==null&&s.child!==i.child)throw Error(r(153));if(s.child!==null){for(i=s.child,u=vr(i,i.pendingProps),s.child=u,u.return=s;i.sibling!==null;)i=i.sibling,u=u.sibling=vr(i,i.pendingProps),u.return=s;u.sibling=null}return s.child}function Jd(i,s){return(i.lanes&s)!==0?!0:(i=i.dependencies,!!(i!==null&&eu(i)))}function pA(i,s,u){switch(s.tag){case 3:De(s,s.stateNode.containerInfo),Zr(s,pt,i.memoizedState.cache),Qi();break;case 27:case 5:Ft(s);break;case 4:De(s,s.stateNode.containerInfo);break;case 10:Zr(s,s.type,s.memoizedProps.value);break;case 31:if(s.memoizedState!==null)return s.flags|=128,xd(s),null;break;case 13:var f=s.memoizedState;if(f!==null)return f.dehydrated!==null?(ni(s),s.flags|=128,null):(u&s.child.childLanes)!==0?P0(i,s,u):(ni(s),i=Mr(i,s,u),i!==null?i.sibling:null);ni(s);break;case 19:var m=(i.flags&128)!==0;if(f=(u&s.childLanes)!==0,f||(es(i,s,u,!1),f=(u&s.childLanes)!==0),m){if(f)return H0(i,s,u);s.flags|=128}if(m=s.memoizedState,m!==null&&(m.rendering=null,m.tail=null,m.lastEffect=null),X(ft,ft.current),f)break;return null;case 22:return s.lanes=0,j0(i,s,u,s.pendingProps);case 24:Zr(s,pt,i.memoizedState.cache)}return Mr(i,s,u)}function U0(i,s,u){if(i!==null)if(i.memoizedProps!==s.pendingProps)gt=!0;else{if(!Jd(i,u)&&(s.flags&128)===0)return gt=!1,pA(i,s,u);gt=(i.flags&131072)!==0}else gt=!1,Pe&&(s.flags&1048576)!==0&&wy(s,al,s.index);switch(s.lanes=0,s.tag){case 16:e:{var f=s.pendingProps;if(i=to(s.elementType),s.type=i,typeof i=="function")td(i)?(f=oo(i,f),s.tag=1,s=V0(null,s,i,f,u)):(s.tag=0,s=Hd(null,s,i,f,u));else{if(i!=null){var m=i.$$typeof;if(m===D){s.tag=11,s=D0(null,s,i,f,u);break e}else if(m===z){s.tag=14,s=_0(null,s,i,f,u);break e}}throw s=ne(i)||i,Error(r(306,s,""))}}return s;case 0:return Hd(i,s,s.type,s.pendingProps,u);case 1:return f=s.type,m=oo(f,s.pendingProps),V0(i,s,f,m,u);case 3:e:{if(De(s,s.stateNode.containerInfo),i===null)throw Error(r(387));f=s.pendingProps;var y=s.memoizedState;m=y.element,gd(i,s),gl(s,f,null,u);var w=s.memoizedState;if(f=w.cache,Zr(s,pt,f),f!==y.cache&&cd(s,[pt],u,!0),ml(),f=w.element,y.isDehydrated)if(y={element:f,isDehydrated:!1,cache:w.cache},s.updateQueue.baseState=y,s.memoizedState=y,s.flags&256){s=F0(i,s,f,u);break e}else if(f!==m){m=Dn(Error(r(424)),s),ul(m),s=F0(i,s,f,u);break e}else for(i=s.stateNode.containerInfo,i.nodeType===9?i=i.body:i=i.nodeName==="HTML"?i.ownerDocument.body:i,tt=Bn(i.firstChild),Dt=s,Pe=!0,Jr=null,jn=!0,u=jy(s,null,f,u),s.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling;else{if(Qi(),f===m){s=Mr(i,s,u);break e}zt(i,s,f,u)}s=s.child}return s;case 26:return bu(i,s),i===null?(u=tb(s.type,null,s.pendingProps,null))?s.memoizedState=u:Pe||(u=s.type,i=s.pendingProps,f=Lu(ae.current).createElement(u),f[Nt]=s,f[on]=i,jt(f,u,i),Mt(f),s.stateNode=f):s.memoizedState=tb(s.type,i.memoizedProps,s.pendingProps,i.memoizedState),null;case 27:return Ft(s),i===null&&Pe&&(f=s.stateNode=Zv(s.type,s.pendingProps,ae.current),Dt=s,jn=!0,m=tt,fi(s.type)?(Oh=m,tt=Bn(f.firstChild)):tt=m),zt(i,s,s.pendingProps.children,u),bu(i,s),i===null&&(s.flags|=4194304),s.child;case 5:return i===null&&Pe&&((m=f=tt)&&(f=UA(f,s.type,s.pendingProps,jn),f!==null?(s.stateNode=f,Dt=s,tt=Bn(f.firstChild),jn=!1,m=!0):m=!1),m||Qr(s)),Ft(s),m=s.type,y=s.pendingProps,w=i!==null?i.memoizedProps:null,f=y.children,Mh(m,y)?f=null:w!==null&&Mh(m,w)&&(s.flags|=32),s.memoizedState!==null&&(m=Cd(i,s,oA,null,null,u),Ll._currentValue=m),bu(i,s),zt(i,s,f,u),s.child;case 6:return i===null&&Pe&&((i=u=tt)&&(u=qA(u,s.pendingProps,jn),u!==null?(s.stateNode=u,Dt=s,tt=null,i=!0):i=!1),i||Qr(s)),null;case 13:return P0(i,s,u);case 4:return De(s,s.stateNode.containerInfo),f=s.pendingProps,i===null?s.child=ro(s,null,f,u):zt(i,s,f,u),s.child;case 11:return D0(i,s,s.type,s.pendingProps,u);case 7:return zt(i,s,s.pendingProps,u),s.child;case 8:return zt(i,s,s.pendingProps.children,u),s.child;case 12:return zt(i,s,s.pendingProps.children,u),s.child;case 10:return f=s.pendingProps,Zr(s,s.type,f.value),zt(i,s,f.children,u),s.child;case 9:return m=s.type._context,f=s.pendingProps.children,Wi(s),m=_t(m),f=f(m),s.flags|=1,zt(i,s,f,u),s.child;case 14:return _0(i,s,s.type,s.pendingProps,u);case 15:return z0(i,s,s.type,s.pendingProps,u);case 19:return H0(i,s,u);case 31:return hA(i,s,u);case 22:return j0(i,s,u,s.pendingProps);case 24:return Wi(s),f=_t(pt),i===null?(m=hd(),m===null&&(m=Qe,y=fd(),m.pooledCache=y,y.refCount++,y!==null&&(m.pooledCacheLanes|=u),m=y),s.memoizedState={parent:f,cache:m},md(s),Zr(s,pt,m)):((i.lanes&u)!==0&&(gd(i,s),gl(s,null,null,u),ml()),m=i.memoizedState,y=s.memoizedState,m.parent!==f?(m={parent:f,cache:f},s.memoizedState=m,s.lanes===0&&(s.memoizedState=s.updateQueue.baseState=m),Zr(s,pt,f)):(f=y.cache,Zr(s,pt,f),f!==m.cache&&cd(s,[pt],u,!0))),zt(i,s,s.pendingProps.children,u),s.child;case 29:throw s.pendingProps}throw Error(r(156,s.tag))}function Er(i){i.flags|=4}function Qd(i,s,u,f,m){if((s=(i.mode&32)!==0)&&(s=!1),s){if(i.flags|=16777216,(m&335544128)===m)if(i.stateNode.complete)i.flags|=8192;else if(yv())i.flags|=8192;else throw no=iu,pd}else i.flags&=-16777217}function q0(i,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!sb(s))if(yv())i.flags|=8192;else throw no=iu,pd}function xu(i,s){s!==null&&(i.flags|=4),i.flags&16384&&(s=i.tag!==22?ie():536870912,i.lanes|=s,hs|=s)}function wl(i,s){if(!Pe)switch(i.tailMode){case"hidden":s=i.tail;for(var u=null;s!==null;)s.alternate!==null&&(u=s),s=s.sibling;u===null?i.tail=null:u.sibling=null;break;case"collapsed":u=i.tail;for(var f=null;u!==null;)u.alternate!==null&&(f=u),u=u.sibling;f===null?s||i.tail===null?i.tail=null:i.tail.sibling=null:f.sibling=null}}function nt(i){var s=i.alternate!==null&&i.alternate.child===i.child,u=0,f=0;if(s)for(var m=i.child;m!==null;)u|=m.lanes|m.childLanes,f|=m.subtreeFlags&65011712,f|=m.flags&65011712,m.return=i,m=m.sibling;else for(m=i.child;m!==null;)u|=m.lanes|m.childLanes,f|=m.subtreeFlags,f|=m.flags,m.return=i,m=m.sibling;return i.subtreeFlags|=f,i.childLanes=u,s}function mA(i,s,u){var f=s.pendingProps;switch(od(s),s.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return nt(s),null;case 1:return nt(s),null;case 3:return u=s.stateNode,f=null,i!==null&&(f=i.memoizedState.cache),s.memoizedState.cache!==f&&(s.flags|=2048),xr(pt),xe(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(i===null||i.child===null)&&(Wo(s)?Er(s):i===null||i.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,ld())),nt(s),null;case 26:var m=s.type,y=s.memoizedState;return i===null?(Er(s),y!==null?(nt(s),q0(s,y)):(nt(s),Qd(s,m,null,f,u))):y?y!==i.memoizedState?(Er(s),nt(s),q0(s,y)):(nt(s),s.flags&=-16777217):(i=i.memoizedProps,i!==f&&Er(s),nt(s),Qd(s,m,i,f,u)),null;case 27:if(Qt(s),u=ae.current,m=s.type,i!==null&&s.stateNode!=null)i.memoizedProps!==f&&Er(s);else{if(!f){if(s.stateNode===null)throw Error(r(166));return nt(s),null}i=ee.current,Wo(s)?My(s):(i=Zv(m,f,u),s.stateNode=i,Er(s))}return nt(s),null;case 5:if(Qt(s),m=s.type,i!==null&&s.stateNode!=null)i.memoizedProps!==f&&Er(s);else{if(!f){if(s.stateNode===null)throw Error(r(166));return nt(s),null}if(y=ee.current,Wo(s))My(s);else{var w=Lu(ae.current);switch(y){case 1:y=w.createElementNS("http://www.w3.org/2000/svg",m);break;case 2:y=w.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;default:switch(m){case"svg":y=w.createElementNS("http://www.w3.org/2000/svg",m);break;case"math":y=w.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;case"script":y=w.createElement("div"),y.innerHTML="<script><\/script>",y=y.removeChild(y.firstChild);break;case"select":y=typeof f.is=="string"?w.createElement("select",{is:f.is}):w.createElement("select"),f.multiple?y.multiple=!0:f.size&&(y.size=f.size);break;default:y=typeof f.is=="string"?w.createElement(m,{is:f.is}):w.createElement(m)}}y[Nt]=s,y[on]=f;e:for(w=s.child;w!==null;){if(w.tag===5||w.tag===6)y.appendChild(w.stateNode);else if(w.tag!==4&&w.tag!==27&&w.child!==null){w.child.return=w,w=w.child;continue}if(w===s)break e;for(;w.sibling===null;){if(w.return===null||w.return===s)break e;w=w.return}w.sibling.return=w.return,w=w.sibling}s.stateNode=y;e:switch(jt(y,m,f),m){case"button":case"input":case"select":case"textarea":f=!!f.autoFocus;break e;case"img":f=!0;break e;default:f=!1}f&&Er(s)}}return nt(s),Qd(s,s.type,i===null?null:i.memoizedProps,s.pendingProps,u),null;case 6:if(i&&s.stateNode!=null)i.memoizedProps!==f&&Er(s);else{if(typeof f!="string"&&s.stateNode===null)throw Error(r(166));if(i=ae.current,Wo(s)){if(i=s.stateNode,u=s.memoizedProps,f=null,m=Dt,m!==null)switch(m.tag){case 27:case 5:f=m.memoizedProps}i[Nt]=s,i=!!(i.nodeValue===u||f!==null&&f.suppressHydrationWarning===!0||Pv(i.nodeValue,u)),i||Qr(s,!0)}else i=Lu(i).createTextNode(f),i[Nt]=s,s.stateNode=i}return nt(s),null;case 31:if(u=s.memoizedState,i===null||i.memoizedState!==null){if(f=Wo(s),u!==null){if(i===null){if(!f)throw Error(r(318));if(i=s.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(557));i[Nt]=s}else Qi(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;nt(s),i=!1}else u=ld(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=u),i=!0;if(!i)return s.flags&256?(vn(s),s):(vn(s),null);if((s.flags&128)!==0)throw Error(r(558))}return nt(s),null;case 13:if(f=s.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(m=Wo(s),f!==null&&f.dehydrated!==null){if(i===null){if(!m)throw Error(r(318));if(m=s.memoizedState,m=m!==null?m.dehydrated:null,!m)throw Error(r(317));m[Nt]=s}else Qi(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;nt(s),m=!1}else m=ld(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=m),m=!0;if(!m)return s.flags&256?(vn(s),s):(vn(s),null)}return vn(s),(s.flags&128)!==0?(s.lanes=u,s):(u=f!==null,i=i!==null&&i.memoizedState!==null,u&&(f=s.child,m=null,f.alternate!==null&&f.alternate.memoizedState!==null&&f.alternate.memoizedState.cachePool!==null&&(m=f.alternate.memoizedState.cachePool.pool),y=null,f.memoizedState!==null&&f.memoizedState.cachePool!==null&&(y=f.memoizedState.cachePool.pool),y!==m&&(f.flags|=2048)),u!==i&&u&&(s.child.flags|=8192),xu(s,s.updateQueue),nt(s),null);case 4:return xe(),i===null&&bh(s.stateNode.containerInfo),nt(s),null;case 10:return xr(s.type),nt(s),null;case 19:if(V(ft),f=s.memoizedState,f===null)return nt(s),null;if(m=(s.flags&128)!==0,y=f.rendering,y===null)if(m)wl(f,!1);else{if(lt!==0||i!==null&&(i.flags&128)!==0)for(i=s.child;i!==null;){if(y=au(i),y!==null){for(s.flags|=128,wl(f,!1),i=y.updateQueue,s.updateQueue=i,xu(s,i),s.subtreeFlags=0,i=u,u=s.child;u!==null;)by(u,i),u=u.sibling;return X(ft,ft.current&1|2),Pe&&br(s,f.treeForkCount),s.child}i=i.sibling}f.tail!==null&&Zt()>Ru&&(s.flags|=128,m=!0,wl(f,!1),s.lanes=4194304)}else{if(!m)if(i=au(y),i!==null){if(s.flags|=128,m=!0,i=i.updateQueue,s.updateQueue=i,xu(s,i),wl(f,!0),f.tail===null&&f.tailMode==="hidden"&&!y.alternate&&!Pe)return nt(s),null}else 2*Zt()-f.renderingStartTime>Ru&&u!==536870912&&(s.flags|=128,m=!0,wl(f,!1),s.lanes=4194304);f.isBackwards?(y.sibling=s.child,s.child=y):(i=f.last,i!==null?i.sibling=y:s.child=y,f.last=y)}return f.tail!==null?(i=f.tail,f.rendering=i,f.tail=i.sibling,f.renderingStartTime=Zt(),i.sibling=null,u=ft.current,X(ft,m?u&1|2:u&1),Pe&&br(s,f.treeForkCount),i):(nt(s),null);case 22:case 23:return vn(s),Sd(),f=s.memoizedState!==null,i!==null?i.memoizedState!==null!==f&&(s.flags|=8192):f&&(s.flags|=8192),f?(u&536870912)!==0&&(s.flags&128)===0&&(nt(s),s.subtreeFlags&6&&(s.flags|=8192)):nt(s),u=s.updateQueue,u!==null&&xu(s,u.retryQueue),u=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(u=i.memoizedState.cachePool.pool),f=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(f=s.memoizedState.cachePool.pool),f!==u&&(s.flags|=2048),i!==null&&V(eo),null;case 24:return u=null,i!==null&&(u=i.memoizedState.cache),s.memoizedState.cache!==u&&(s.flags|=2048),xr(pt),nt(s),null;case 25:return null;case 30:return null}throw Error(r(156,s.tag))}function gA(i,s){switch(od(s),s.tag){case 1:return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 3:return xr(pt),xe(),i=s.flags,(i&65536)!==0&&(i&128)===0?(s.flags=i&-65537|128,s):null;case 26:case 27:case 5:return Qt(s),null;case 31:if(s.memoizedState!==null){if(vn(s),s.alternate===null)throw Error(r(340));Qi()}return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 13:if(vn(s),i=s.memoizedState,i!==null&&i.dehydrated!==null){if(s.alternate===null)throw Error(r(340));Qi()}return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 19:return V(ft),null;case 4:return xe(),null;case 10:return xr(s.type),null;case 22:case 23:return vn(s),Sd(),i!==null&&V(eo),i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 24:return xr(pt),null;case 25:return null;default:return null}}function G0(i,s){switch(od(s),s.tag){case 3:xr(pt),xe();break;case 26:case 27:case 5:Qt(s);break;case 4:xe();break;case 31:s.memoizedState!==null&&vn(s);break;case 13:vn(s);break;case 19:V(ft);break;case 10:xr(s.type);break;case 22:case 23:vn(s),Sd(),i!==null&&V(eo);break;case 24:xr(pt)}}function Cl(i,s){try{var u=s.updateQueue,f=u!==null?u.lastEffect:null;if(f!==null){var m=f.next;u=m;do{if((u.tag&i)===i){f=void 0;var y=u.create,w=u.inst;f=y(),w.destroy=f}u=u.next}while(u!==m)}}catch(R){Ke(s,s.return,R)}}function ii(i,s,u){try{var f=s.updateQueue,m=f!==null?f.lastEffect:null;if(m!==null){var y=m.next;f=y;do{if((f.tag&i)===i){var w=f.inst,R=w.destroy;if(R!==void 0){w.destroy=void 0,m=s;var O=u,P=R;try{P()}catch(Y){Ke(m,O,Y)}}}f=f.next}while(f!==y)}}catch(Y){Ke(s,s.return,Y)}}function K0(i){var s=i.updateQueue;if(s!==null){var u=i.stateNode;try{By(s,u)}catch(f){Ke(i,i.return,f)}}}function Y0(i,s,u){u.props=oo(i.type,i.memoizedProps),u.state=i.memoizedState;try{u.componentWillUnmount()}catch(f){Ke(i,s,f)}}function Ml(i,s){try{var u=i.ref;if(u!==null){switch(i.tag){case 26:case 27:case 5:var f=i.stateNode;break;case 30:f=i.stateNode;break;default:f=i.stateNode}typeof u=="function"?i.refCleanup=u(f):u.current=f}}catch(m){Ke(i,s,m)}}function ir(i,s){var u=i.ref,f=i.refCleanup;if(u!==null)if(typeof f=="function")try{f()}catch(m){Ke(i,s,m)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(m){Ke(i,s,m)}else u.current=null}function X0(i){var s=i.type,u=i.memoizedProps,f=i.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":u.autoFocus&&f.focus();break e;case"img":u.src?f.src=u.src:u.srcSet&&(f.srcset=u.srcSet)}}catch(m){Ke(i,i.return,m)}}function Zd(i,s,u){try{var f=i.stateNode;IA(f,i.type,u,s),f[on]=s}catch(m){Ke(i,i.return,m)}}function J0(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&fi(i.type)||i.tag===4}function Wd(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||J0(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.tag===27&&fi(i.type)||i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function eh(i,s,u){var f=i.tag;if(f===5||f===6)i=i.stateNode,s?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(i,s):(s=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,s.appendChild(i),u=u._reactRootContainer,u!=null||s.onclick!==null||(s.onclick=gr));else if(f!==4&&(f===27&&fi(i.type)&&(u=i.stateNode,s=null),i=i.child,i!==null))for(eh(i,s,u),i=i.sibling;i!==null;)eh(i,s,u),i=i.sibling}function wu(i,s,u){var f=i.tag;if(f===5||f===6)i=i.stateNode,s?u.insertBefore(i,s):u.appendChild(i);else if(f!==4&&(f===27&&fi(i.type)&&(u=i.stateNode),i=i.child,i!==null))for(wu(i,s,u),i=i.sibling;i!==null;)wu(i,s,u),i=i.sibling}function Q0(i){var s=i.stateNode,u=i.memoizedProps;try{for(var f=i.type,m=s.attributes;m.length;)s.removeAttributeNode(m[0]);jt(s,f,u),s[Nt]=i,s[on]=u}catch(y){Ke(i,i.return,y)}}var Rr=!1,yt=!1,th=!1,Z0=typeof WeakSet=="function"?WeakSet:Set,Et=null;function yA(i,s){if(i=i.containerInfo,wh=Hu,i=cy(i),Yf(i)){if("selectionStart"in i)var u={start:i.selectionStart,end:i.selectionEnd};else e:{u=(u=i.ownerDocument)&&u.defaultView||window;var f=u.getSelection&&u.getSelection();if(f&&f.rangeCount!==0){u=f.anchorNode;var m=f.anchorOffset,y=f.focusNode;f=f.focusOffset;try{u.nodeType,y.nodeType}catch{u=null;break e}var w=0,R=-1,O=-1,P=0,Y=0,W=i,$=null;t:for(;;){for(var q;W!==u||m!==0&&W.nodeType!==3||(R=w+m),W!==y||f!==0&&W.nodeType!==3||(O=w+f),W.nodeType===3&&(w+=W.nodeValue.length),(q=W.firstChild)!==null;)$=W,W=q;for(;;){if(W===i)break t;if($===u&&++P===m&&(R=w),$===y&&++Y===f&&(O=w),(q=W.nextSibling)!==null)break;W=$,$=W.parentNode}W=q}u=R===-1||O===-1?null:{start:R,end:O}}else u=null}u=u||{start:0,end:0}}else u=null;for(Ch={focusedElem:i,selectionRange:u},Hu=!1,Et=s;Et!==null;)if(s=Et,i=s.child,(s.subtreeFlags&1028)!==0&&i!==null)i.return=s,Et=i;else for(;Et!==null;){switch(s=Et,y=s.alternate,i=s.flags,s.tag){case 0:if((i&4)!==0&&(i=s.updateQueue,i=i!==null?i.events:null,i!==null))for(u=0;u<i.length;u++)m=i[u],m.ref.impl=m.nextImpl;break;case 11:case 15:break;case 1:if((i&1024)!==0&&y!==null){i=void 0,u=s,m=y.memoizedProps,y=y.memoizedState,f=u.stateNode;try{var fe=oo(u.type,m);i=f.getSnapshotBeforeUpdate(fe,y),f.__reactInternalSnapshotBeforeUpdate=i}catch(we){Ke(u,u.return,we)}}break;case 3:if((i&1024)!==0){if(i=s.stateNode.containerInfo,u=i.nodeType,u===9)Rh(i);else if(u===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":Rh(i);break;default:i.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((i&1024)!==0)throw Error(r(163))}if(i=s.sibling,i!==null){i.return=s.return,Et=i;break}Et=s.return}}function W0(i,s,u){var f=u.flags;switch(u.tag){case 0:case 11:case 15:Ar(i,u),f&4&&Cl(5,u);break;case 1:if(Ar(i,u),f&4)if(i=u.stateNode,s===null)try{i.componentDidMount()}catch(w){Ke(u,u.return,w)}else{var m=oo(u.type,s.memoizedProps);s=s.memoizedState;try{i.componentDidUpdate(m,s,i.__reactInternalSnapshotBeforeUpdate)}catch(w){Ke(u,u.return,w)}}f&64&&K0(u),f&512&&Ml(u,u.return);break;case 3:if(Ar(i,u),f&64&&(i=u.updateQueue,i!==null)){if(s=null,u.child!==null)switch(u.child.tag){case 27:case 5:s=u.child.stateNode;break;case 1:s=u.child.stateNode}try{By(i,s)}catch(w){Ke(u,u.return,w)}}break;case 27:s===null&&f&4&&Q0(u);case 26:case 5:Ar(i,u),s===null&&f&4&&X0(u),f&512&&Ml(u,u.return);break;case 12:Ar(i,u);break;case 31:Ar(i,u),f&4&&nv(i,u);break;case 13:Ar(i,u),f&4&&rv(i,u),f&64&&(i=u.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(u=RA.bind(null,u),GA(i,u))));break;case 22:if(f=u.memoizedState!==null||Rr,!f){s=s!==null&&s.memoizedState!==null||yt,m=Rr;var y=yt;Rr=f,(yt=s)&&!y?Or(i,u,(u.subtreeFlags&8772)!==0):Ar(i,u),Rr=m,yt=y}break;case 30:break;default:Ar(i,u)}}function ev(i){var s=i.alternate;s!==null&&(i.alternate=null,ev(s)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(s=i.stateNode,s!==null&&Nf(s)),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}var rt=null,ln=!1;function Tr(i,s,u){for(u=u.child;u!==null;)tv(i,s,u),u=u.sibling}function tv(i,s,u){if(We&&typeof We.onCommitFiberUnmount=="function")try{We.onCommitFiberUnmount(Ur,u)}catch{}switch(u.tag){case 26:yt||ir(u,s),Tr(i,s,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:yt||ir(u,s);var f=rt,m=ln;fi(u.type)&&(rt=u.stateNode,ln=!1),Tr(i,s,u),_l(u.stateNode),rt=f,ln=m;break;case 5:yt||ir(u,s);case 6:if(f=rt,m=ln,rt=null,Tr(i,s,u),rt=f,ln=m,rt!==null)if(ln)try{(rt.nodeType===9?rt.body:rt.nodeName==="HTML"?rt.ownerDocument.body:rt).removeChild(u.stateNode)}catch(y){Ke(u,s,y)}else try{rt.removeChild(u.stateNode)}catch(y){Ke(u,s,y)}break;case 18:rt!==null&&(ln?(i=rt,Kv(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,u.stateNode),xs(i)):Kv(rt,u.stateNode));break;case 4:f=rt,m=ln,rt=u.stateNode.containerInfo,ln=!0,Tr(i,s,u),rt=f,ln=m;break;case 0:case 11:case 14:case 15:ii(2,u,s),yt||ii(4,u,s),Tr(i,s,u);break;case 1:yt||(ir(u,s),f=u.stateNode,typeof f.componentWillUnmount=="function"&&Y0(u,s,f)),Tr(i,s,u);break;case 21:Tr(i,s,u);break;case 22:yt=(f=yt)||u.memoizedState!==null,Tr(i,s,u),yt=f;break;default:Tr(i,s,u)}}function nv(i,s){if(s.memoizedState===null&&(i=s.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{xs(i)}catch(u){Ke(s,s.return,u)}}}function rv(i,s){if(s.memoizedState===null&&(i=s.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{xs(i)}catch(u){Ke(s,s.return,u)}}function vA(i){switch(i.tag){case 31:case 13:case 19:var s=i.stateNode;return s===null&&(s=i.stateNode=new Z0),s;case 22:return i=i.stateNode,s=i._retryCache,s===null&&(s=i._retryCache=new Z0),s;default:throw Error(r(435,i.tag))}}function Cu(i,s){var u=vA(i);s.forEach(function(f){if(!u.has(f)){u.add(f);var m=TA.bind(null,i,f);f.then(m,m)}})}function an(i,s){var u=s.deletions;if(u!==null)for(var f=0;f<u.length;f++){var m=u[f],y=i,w=s,R=w;e:for(;R!==null;){switch(R.tag){case 27:if(fi(R.type)){rt=R.stateNode,ln=!1;break e}break;case 5:rt=R.stateNode,ln=!1;break e;case 3:case 4:rt=R.stateNode.containerInfo,ln=!0;break e}R=R.return}if(rt===null)throw Error(r(160));tv(y,w,m),rt=null,ln=!1,y=m.alternate,y!==null&&(y.return=null),m.return=null}if(s.subtreeFlags&13886)for(s=s.child;s!==null;)iv(s,i),s=s.sibling}var Gn=null;function iv(i,s){var u=i.alternate,f=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:an(s,i),un(i),f&4&&(ii(3,i,i.return),Cl(3,i),ii(5,i,i.return));break;case 1:an(s,i),un(i),f&512&&(yt||u===null||ir(u,u.return)),f&64&&Rr&&(i=i.updateQueue,i!==null&&(f=i.callbacks,f!==null&&(u=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=u===null?f:u.concat(f))));break;case 26:var m=Gn;if(an(s,i),un(i),f&512&&(yt||u===null||ir(u,u.return)),f&4){var y=u!==null?u.memoizedState:null;if(f=i.memoizedState,u===null)if(f===null)if(i.stateNode===null){e:{f=i.type,u=i.memoizedProps,m=m.ownerDocument||m;t:switch(f){case"title":y=m.getElementsByTagName("title")[0],(!y||y[Qs]||y[Nt]||y.namespaceURI==="http://www.w3.org/2000/svg"||y.hasAttribute("itemprop"))&&(y=m.createElement(f),m.head.insertBefore(y,m.querySelector("head > title"))),jt(y,f,u),y[Nt]=i,Mt(y),f=y;break e;case"link":var w=ib("link","href",m).get(f+(u.href||""));if(w){for(var R=0;R<w.length;R++)if(y=w[R],y.getAttribute("href")===(u.href==null||u.href===""?null:u.href)&&y.getAttribute("rel")===(u.rel==null?null:u.rel)&&y.getAttribute("title")===(u.title==null?null:u.title)&&y.getAttribute("crossorigin")===(u.crossOrigin==null?null:u.crossOrigin)){w.splice(R,1);break t}}y=m.createElement(f),jt(y,f,u),m.head.appendChild(y);break;case"meta":if(w=ib("meta","content",m).get(f+(u.content||""))){for(R=0;R<w.length;R++)if(y=w[R],y.getAttribute("content")===(u.content==null?null:""+u.content)&&y.getAttribute("name")===(u.name==null?null:u.name)&&y.getAttribute("property")===(u.property==null?null:u.property)&&y.getAttribute("http-equiv")===(u.httpEquiv==null?null:u.httpEquiv)&&y.getAttribute("charset")===(u.charSet==null?null:u.charSet)){w.splice(R,1);break t}}y=m.createElement(f),jt(y,f,u),m.head.appendChild(y);break;default:throw Error(r(468,f))}y[Nt]=i,Mt(y),f=y}i.stateNode=f}else ob(m,i.type,i.stateNode);else i.stateNode=rb(m,f,i.memoizedProps);else y!==f?(y===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):y.count--,f===null?ob(m,i.type,i.stateNode):rb(m,f,i.memoizedProps)):f===null&&i.stateNode!==null&&Zd(i,i.memoizedProps,u.memoizedProps)}break;case 27:an(s,i),un(i),f&512&&(yt||u===null||ir(u,u.return)),u!==null&&f&4&&Zd(i,i.memoizedProps,u.memoizedProps);break;case 5:if(an(s,i),un(i),f&512&&(yt||u===null||ir(u,u.return)),i.flags&32){m=i.stateNode;try{Ho(m,"")}catch(fe){Ke(i,i.return,fe)}}f&4&&i.stateNode!=null&&(m=i.memoizedProps,Zd(i,m,u!==null?u.memoizedProps:m)),f&1024&&(th=!0);break;case 6:if(an(s,i),un(i),f&4){if(i.stateNode===null)throw Error(r(162));f=i.memoizedProps,u=i.stateNode;try{u.nodeValue=f}catch(fe){Ke(i,i.return,fe)}}break;case 3:if(Vu=null,m=Gn,Gn=Bu(s.containerInfo),an(s,i),Gn=m,un(i),f&4&&u!==null&&u.memoizedState.isDehydrated)try{xs(s.containerInfo)}catch(fe){Ke(i,i.return,fe)}th&&(th=!1,ov(i));break;case 4:f=Gn,Gn=Bu(i.stateNode.containerInfo),an(s,i),un(i),Gn=f;break;case 12:an(s,i),un(i);break;case 31:an(s,i),un(i),f&4&&(f=i.updateQueue,f!==null&&(i.updateQueue=null,Cu(i,f)));break;case 13:an(s,i),un(i),i.child.flags&8192&&i.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(Eu=Zt()),f&4&&(f=i.updateQueue,f!==null&&(i.updateQueue=null,Cu(i,f)));break;case 22:m=i.memoizedState!==null;var O=u!==null&&u.memoizedState!==null,P=Rr,Y=yt;if(Rr=P||m,yt=Y||O,an(s,i),yt=Y,Rr=P,un(i),f&8192)e:for(s=i.stateNode,s._visibility=m?s._visibility&-2:s._visibility|1,m&&(u===null||O||Rr||yt||so(i)),u=null,s=i;;){if(s.tag===5||s.tag===26){if(u===null){O=u=s;try{if(y=O.stateNode,m)w=y.style,typeof w.setProperty=="function"?w.setProperty("display","none","important"):w.display="none";else{R=O.stateNode;var W=O.memoizedProps.style,$=W!=null&&W.hasOwnProperty("display")?W.display:null;R.style.display=$==null||typeof $=="boolean"?"":(""+$).trim()}}catch(fe){Ke(O,O.return,fe)}}}else if(s.tag===6){if(u===null){O=s;try{O.stateNode.nodeValue=m?"":O.memoizedProps}catch(fe){Ke(O,O.return,fe)}}}else if(s.tag===18){if(u===null){O=s;try{var q=O.stateNode;m?Yv(q,!0):Yv(O.stateNode,!1)}catch(fe){Ke(O,O.return,fe)}}}else if((s.tag!==22&&s.tag!==23||s.memoizedState===null||s===i)&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===i)break e;for(;s.sibling===null;){if(s.return===null||s.return===i)break e;u===s&&(u=null),s=s.return}u===s&&(u=null),s.sibling.return=s.return,s=s.sibling}f&4&&(f=i.updateQueue,f!==null&&(u=f.retryQueue,u!==null&&(f.retryQueue=null,Cu(i,u))));break;case 19:an(s,i),un(i),f&4&&(f=i.updateQueue,f!==null&&(i.updateQueue=null,Cu(i,f)));break;case 30:break;case 21:break;default:an(s,i),un(i)}}function un(i){var s=i.flags;if(s&2){try{for(var u,f=i.return;f!==null;){if(J0(f)){u=f;break}f=f.return}if(u==null)throw Error(r(160));switch(u.tag){case 27:var m=u.stateNode,y=Wd(i);wu(i,y,m);break;case 5:var w=u.stateNode;u.flags&32&&(Ho(w,""),u.flags&=-33);var R=Wd(i);wu(i,R,w);break;case 3:case 4:var O=u.stateNode.containerInfo,P=Wd(i);eh(i,P,O);break;default:throw Error(r(161))}}catch(Y){Ke(i,i.return,Y)}i.flags&=-3}s&4096&&(i.flags&=-4097)}function ov(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var s=i;ov(s),s.tag===5&&s.flags&1024&&s.stateNode.reset(),i=i.sibling}}function Ar(i,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)W0(i,s.alternate,s),s=s.sibling}function so(i){for(i=i.child;i!==null;){var s=i;switch(s.tag){case 0:case 11:case 14:case 15:ii(4,s,s.return),so(s);break;case 1:ir(s,s.return);var u=s.stateNode;typeof u.componentWillUnmount=="function"&&Y0(s,s.return,u),so(s);break;case 27:_l(s.stateNode);case 26:case 5:ir(s,s.return),so(s);break;case 22:s.memoizedState===null&&so(s);break;case 30:so(s);break;default:so(s)}i=i.sibling}}function Or(i,s,u){for(u=u&&(s.subtreeFlags&8772)!==0,s=s.child;s!==null;){var f=s.alternate,m=i,y=s,w=y.flags;switch(y.tag){case 0:case 11:case 15:Or(m,y,u),Cl(4,y);break;case 1:if(Or(m,y,u),f=y,m=f.stateNode,typeof m.componentDidMount=="function")try{m.componentDidMount()}catch(P){Ke(f,f.return,P)}if(f=y,m=f.updateQueue,m!==null){var R=f.stateNode;try{var O=m.shared.hiddenCallbacks;if(O!==null)for(m.shared.hiddenCallbacks=null,m=0;m<O.length;m++)Ly(O[m],R)}catch(P){Ke(f,f.return,P)}}u&&w&64&&K0(y),Ml(y,y.return);break;case 27:Q0(y);case 26:case 5:Or(m,y,u),u&&f===null&&w&4&&X0(y),Ml(y,y.return);break;case 12:Or(m,y,u);break;case 31:Or(m,y,u),u&&w&4&&nv(m,y);break;case 13:Or(m,y,u),u&&w&4&&rv(m,y);break;case 22:y.memoizedState===null&&Or(m,y,u),Ml(y,y.return);break;case 30:break;default:Or(m,y,u)}s=s.sibling}}function nh(i,s){var u=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(u=i.memoizedState.cachePool.pool),i=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(i=s.memoizedState.cachePool.pool),i!==u&&(i!=null&&i.refCount++,u!=null&&cl(u))}function rh(i,s){i=null,s.alternate!==null&&(i=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==i&&(s.refCount++,i!=null&&cl(i))}function Kn(i,s,u,f){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)sv(i,s,u,f),s=s.sibling}function sv(i,s,u,f){var m=s.flags;switch(s.tag){case 0:case 11:case 15:Kn(i,s,u,f),m&2048&&Cl(9,s);break;case 1:Kn(i,s,u,f);break;case 3:Kn(i,s,u,f),m&2048&&(i=null,s.alternate!==null&&(i=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==i&&(s.refCount++,i!=null&&cl(i)));break;case 12:if(m&2048){Kn(i,s,u,f),i=s.stateNode;try{var y=s.memoizedProps,w=y.id,R=y.onPostCommit;typeof R=="function"&&R(w,s.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(O){Ke(s,s.return,O)}}else Kn(i,s,u,f);break;case 31:Kn(i,s,u,f);break;case 13:Kn(i,s,u,f);break;case 23:break;case 22:y=s.stateNode,w=s.alternate,s.memoizedState!==null?y._visibility&2?Kn(i,s,u,f):El(i,s):y._visibility&2?Kn(i,s,u,f):(y._visibility|=2,cs(i,s,u,f,(s.subtreeFlags&10256)!==0||!1)),m&2048&&nh(w,s);break;case 24:Kn(i,s,u,f),m&2048&&rh(s.alternate,s);break;default:Kn(i,s,u,f)}}function cs(i,s,u,f,m){for(m=m&&((s.subtreeFlags&10256)!==0||!1),s=s.child;s!==null;){var y=i,w=s,R=u,O=f,P=w.flags;switch(w.tag){case 0:case 11:case 15:cs(y,w,R,O,m),Cl(8,w);break;case 23:break;case 22:var Y=w.stateNode;w.memoizedState!==null?Y._visibility&2?cs(y,w,R,O,m):El(y,w):(Y._visibility|=2,cs(y,w,R,O,m)),m&&P&2048&&nh(w.alternate,w);break;case 24:cs(y,w,R,O,m),m&&P&2048&&rh(w.alternate,w);break;default:cs(y,w,R,O,m)}s=s.sibling}}function El(i,s){if(s.subtreeFlags&10256)for(s=s.child;s!==null;){var u=i,f=s,m=f.flags;switch(f.tag){case 22:El(u,f),m&2048&&nh(f.alternate,f);break;case 24:El(u,f),m&2048&&rh(f.alternate,f);break;default:El(u,f)}s=s.sibling}}var Rl=8192;function fs(i,s,u){if(i.subtreeFlags&Rl)for(i=i.child;i!==null;)lv(i,s,u),i=i.sibling}function lv(i,s,u){switch(i.tag){case 26:fs(i,s,u),i.flags&Rl&&i.memoizedState!==null&&iO(u,Gn,i.memoizedState,i.memoizedProps);break;case 5:fs(i,s,u);break;case 3:case 4:var f=Gn;Gn=Bu(i.stateNode.containerInfo),fs(i,s,u),Gn=f;break;case 22:i.memoizedState===null&&(f=i.alternate,f!==null&&f.memoizedState!==null?(f=Rl,Rl=16777216,fs(i,s,u),Rl=f):fs(i,s,u));break;default:fs(i,s,u)}}function av(i){var s=i.alternate;if(s!==null&&(i=s.child,i!==null)){s.child=null;do s=i.sibling,i.sibling=null,i=s;while(i!==null)}}function Tl(i){var s=i.deletions;if((i.flags&16)!==0){if(s!==null)for(var u=0;u<s.length;u++){var f=s[u];Et=f,cv(f,i)}av(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)uv(i),i=i.sibling}function uv(i){switch(i.tag){case 0:case 11:case 15:Tl(i),i.flags&2048&&ii(9,i,i.return);break;case 3:Tl(i);break;case 12:Tl(i);break;case 22:var s=i.stateNode;i.memoizedState!==null&&s._visibility&2&&(i.return===null||i.return.tag!==13)?(s._visibility&=-3,Mu(i)):Tl(i);break;default:Tl(i)}}function Mu(i){var s=i.deletions;if((i.flags&16)!==0){if(s!==null)for(var u=0;u<s.length;u++){var f=s[u];Et=f,cv(f,i)}av(i)}for(i=i.child;i!==null;){switch(s=i,s.tag){case 0:case 11:case 15:ii(8,s,s.return),Mu(s);break;case 22:u=s.stateNode,u._visibility&2&&(u._visibility&=-3,Mu(s));break;default:Mu(s)}i=i.sibling}}function cv(i,s){for(;Et!==null;){var u=Et;switch(u.tag){case 0:case 11:case 15:ii(8,u,s);break;case 23:case 22:if(u.memoizedState!==null&&u.memoizedState.cachePool!==null){var f=u.memoizedState.cachePool.pool;f!=null&&f.refCount++}break;case 24:cl(u.memoizedState.cache)}if(f=u.child,f!==null)f.return=u,Et=f;else e:for(u=i;Et!==null;){f=Et;var m=f.sibling,y=f.return;if(ev(f),f===u){Et=null;break e}if(m!==null){m.return=y,Et=m;break e}Et=y}}}var bA={getCacheForType:function(i){var s=_t(pt),u=s.data.get(i);return u===void 0&&(u=i(),s.data.set(i,u)),u},cacheSignal:function(){return _t(pt).controller.signal}},SA=typeof WeakMap=="function"?WeakMap:Map,qe=0,Qe=null,Be=null,Ve=0,Ge=0,bn=null,oi=!1,ds=!1,ih=!1,kr=0,lt=0,si=0,lo=0,oh=0,Sn=0,hs=0,Al=null,cn=null,sh=!1,Eu=0,fv=0,Ru=1/0,Tu=null,li=null,wt=0,ai=null,ps=null,Nr=0,lh=0,ah=null,dv=null,Ol=0,uh=null;function xn(){return(qe&2)!==0&&Ve!==0?Ve&-Ve:I.T!==null?mh():Lo()}function hv(){if(Sn===0)if((Ve&536870912)===0||Pe){var i=Un;Un<<=1,(Un&3932160)===0&&(Un=262144),Sn=i}else Sn=536870912;return i=yn.current,i!==null&&(i.flags|=32),Sn}function fn(i,s,u){(i===Qe&&(Ge===2||Ge===9)||i.cancelPendingCommit!==null)&&(ms(i,0),ui(i,Ve,Sn,!1)),Ce(i,u),((qe&2)===0||i!==Qe)&&(i===Qe&&((qe&2)===0&&(lo|=u),lt===4&&ui(i,Ve,Sn,!1)),or(i))}function pv(i,s,u){if((qe&6)!==0)throw Error(r(327));var f=!u&&(s&127)===0&&(s&i.expiredLanes)===0||Ui(i,s),m=f?CA(i,s):fh(i,s,!0),y=f;do{if(m===0){ds&&!f&&ui(i,s,0,!1);break}else{if(u=i.current.alternate,y&&!xA(u)){m=fh(i,s,!1),y=!1;continue}if(m===2){if(y=s,i.errorRecoveryDisabledLanes&y)var w=0;else w=i.pendingLanes&-536870913,w=w!==0?w:w&536870912?536870912:0;if(w!==0){s=w;e:{var R=i;m=Al;var O=R.current.memoizedState.isDehydrated;if(O&&(ms(R,w).flags|=256),w=fh(R,w,!1),w!==2){if(ih&&!O){R.errorRecoveryDisabledLanes|=y,lo|=y,m=4;break e}y=cn,cn=m,y!==null&&(cn===null?cn=y:cn.push.apply(cn,y))}m=w}if(y=!1,m!==2)continue}}if(m===1){ms(i,0),ui(i,s,0,!0);break}e:{switch(f=i,y=m,y){case 0:case 1:throw Error(r(345));case 4:if((s&4194048)!==s)break;case 6:ui(f,s,Sn,!oi);break e;case 2:cn=null;break;case 3:case 5:break;default:throw Error(r(329))}if((s&62914560)===s&&(m=Eu+300-Zt(),10<m)){if(ui(f,s,Sn,!oi),jo(f,0,!0)!==0)break e;Nr=s,f.timeoutHandle=qv(mv.bind(null,f,u,cn,Tu,sh,s,Sn,lo,hs,oi,y,"Throttled",-0,0),m);break e}mv(f,u,cn,Tu,sh,s,Sn,lo,hs,oi,y,null,-0,0)}}break}while(!0);or(i)}function mv(i,s,u,f,m,y,w,R,O,P,Y,W,$,q){if(i.timeoutHandle=-1,W=s.subtreeFlags,W&8192||(W&16785408)===16785408){W={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:gr},lv(s,y,W);var fe=(y&62914560)===y?Eu-Zt():(y&4194048)===y?fv-Zt():0;if(fe=oO(W,fe),fe!==null){Nr=y,i.cancelPendingCommit=fe(Cv.bind(null,i,s,y,u,f,m,w,R,O,Y,W,null,$,q)),ui(i,y,w,!P);return}}Cv(i,s,y,u,f,m,w,R,O)}function xA(i){for(var s=i;;){var u=s.tag;if((u===0||u===11||u===15)&&s.flags&16384&&(u=s.updateQueue,u!==null&&(u=u.stores,u!==null)))for(var f=0;f<u.length;f++){var m=u[f],y=m.getSnapshot;m=m.value;try{if(!mn(y(),m))return!1}catch{return!1}}if(u=s.child,s.subtreeFlags&16384&&u!==null)u.return=s,s=u;else{if(s===i)break;for(;s.sibling===null;){if(s.return===null||s.return===i)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function ui(i,s,u,f){s&=~oh,s&=~lo,i.suspendedLanes|=s,i.pingedLanes&=~s,f&&(i.warmLanes|=s),f=i.expirationTimes;for(var m=s;0<m;){var y=31-Wt(m),w=1<<y;f[y]=-1,m&=~w}u!==0&&et(i,u,s)}function Au(){return(qe&6)===0?(kl(0),!1):!0}function ch(){if(Be!==null){if(Ge===0)var i=Be.return;else i=Be,Sr=Zi=null,Rd(i),is=null,dl=0,i=Be;for(;i!==null;)G0(i.alternate,i),i=i.return;Be=null}}function ms(i,s){var u=i.timeoutHandle;u!==-1&&(i.timeoutHandle=-1,PA(u)),u=i.cancelPendingCommit,u!==null&&(i.cancelPendingCommit=null,u()),Nr=0,ch(),Qe=i,Be=u=vr(i.current,null),Ve=s,Ge=0,bn=null,oi=!1,ds=Ui(i,s),ih=!1,hs=Sn=oh=lo=si=lt=0,cn=Al=null,sh=!1,(s&8)!==0&&(s|=s&32);var f=i.entangledLanes;if(f!==0)for(i=i.entanglements,f&=s;0<f;){var m=31-Wt(f),y=1<<m;s|=i[m],f&=~y}return kr=s,Xa(),u}function gv(i,s){Ae=null,I.H=Sl,s===rs||s===ru?(s=Dy(),Ge=3):s===pd?(s=Dy(),Ge=4):Ge=s===$d?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,bn=s,Be===null&&(lt=1,yu(i,Dn(s,i.current)))}function yv(){var i=yn.current;return i===null?!0:(Ve&4194048)===Ve?Ln===null:(Ve&62914560)===Ve||(Ve&536870912)!==0?i===Ln:!1}function vv(){var i=I.H;return I.H=Sl,i===null?Sl:i}function bv(){var i=I.A;return I.A=bA,i}function Ou(){lt=4,oi||(Ve&4194048)!==Ve&&yn.current!==null||(ds=!0),(si&134217727)===0&&(lo&134217727)===0||Qe===null||ui(Qe,Ve,Sn,!1)}function fh(i,s,u){var f=qe;qe|=2;var m=vv(),y=bv();(Qe!==i||Ve!==s)&&(Tu=null,ms(i,s)),s=!1;var w=lt;e:do try{if(Ge!==0&&Be!==null){var R=Be,O=bn;switch(Ge){case 8:ch(),w=6;break e;case 3:case 2:case 9:case 6:yn.current===null&&(s=!0);var P=Ge;if(Ge=0,bn=null,gs(i,R,O,P),u&&ds){w=0;break e}break;default:P=Ge,Ge=0,bn=null,gs(i,R,O,P)}}wA(),w=lt;break}catch(Y){gv(i,Y)}while(!0);return s&&i.shellSuspendCounter++,Sr=Zi=null,qe=f,I.H=m,I.A=y,Be===null&&(Qe=null,Ve=0,Xa()),w}function wA(){for(;Be!==null;)Sv(Be)}function CA(i,s){var u=qe;qe|=2;var f=vv(),m=bv();Qe!==i||Ve!==s?(Tu=null,Ru=Zt()+500,ms(i,s)):ds=Ui(i,s);e:do try{if(Ge!==0&&Be!==null){s=Be;var y=bn;t:switch(Ge){case 1:Ge=0,bn=null,gs(i,s,y,1);break;case 2:case 9:if(ky(y)){Ge=0,bn=null,xv(s);break}s=function(){Ge!==2&&Ge!==9||Qe!==i||(Ge=7),or(i)},y.then(s,s);break e;case 3:Ge=7;break e;case 4:Ge=5;break e;case 7:ky(y)?(Ge=0,bn=null,xv(s)):(Ge=0,bn=null,gs(i,s,y,7));break;case 5:var w=null;switch(Be.tag){case 26:w=Be.memoizedState;case 5:case 27:var R=Be;if(w?sb(w):R.stateNode.complete){Ge=0,bn=null;var O=R.sibling;if(O!==null)Be=O;else{var P=R.return;P!==null?(Be=P,ku(P)):Be=null}break t}}Ge=0,bn=null,gs(i,s,y,5);break;case 6:Ge=0,bn=null,gs(i,s,y,6);break;case 8:ch(),lt=6;break e;default:throw Error(r(462))}}MA();break}catch(Y){gv(i,Y)}while(!0);return Sr=Zi=null,I.H=f,I.A=m,qe=u,Be!==null?0:(Qe=null,Ve=0,Xa(),lt)}function MA(){for(;Be!==null&&!ka();)Sv(Be)}function Sv(i){var s=U0(i.alternate,i,kr);i.memoizedProps=i.pendingProps,s===null?ku(i):Be=s}function xv(i){var s=i,u=s.alternate;switch(s.tag){case 15:case 0:s=I0(u,s,s.pendingProps,s.type,void 0,Ve);break;case 11:s=I0(u,s,s.pendingProps,s.type.render,s.ref,Ve);break;case 5:Rd(s);default:G0(u,s),s=Be=by(s,kr),s=U0(u,s,kr)}i.memoizedProps=i.pendingProps,s===null?ku(i):Be=s}function gs(i,s,u,f){Sr=Zi=null,Rd(s),is=null,dl=0;var m=s.return;try{if(dA(i,m,s,u,Ve)){lt=1,yu(i,Dn(u,i.current)),Be=null;return}}catch(y){if(m!==null)throw Be=m,y;lt=1,yu(i,Dn(u,i.current)),Be=null;return}s.flags&32768?(Pe||f===1?i=!0:ds||(Ve&536870912)!==0?i=!1:(oi=i=!0,(f===2||f===9||f===3||f===6)&&(f=yn.current,f!==null&&f.tag===13&&(f.flags|=16384))),wv(s,i)):ku(s)}function ku(i){var s=i;do{if((s.flags&32768)!==0){wv(s,oi);return}i=s.return;var u=mA(s.alternate,s,kr);if(u!==null){Be=u;return}if(s=s.sibling,s!==null){Be=s;return}Be=s=i}while(s!==null);lt===0&&(lt=5)}function wv(i,s){do{var u=gA(i.alternate,i);if(u!==null){u.flags&=32767,Be=u;return}if(u=i.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!s&&(i=i.sibling,i!==null)){Be=i;return}Be=i=u}while(i!==null);lt=6,Be=null}function Cv(i,s,u,f,m,y,w,R,O){i.cancelPendingCommit=null;do Nu();while(wt!==0);if((qe&6)!==0)throw Error(r(327));if(s!==null){if(s===i.current)throw Error(r(177));if(y=s.lanes|s.childLanes,y|=Wf,Le(i,u,y,w,R,O),i===Qe&&(Be=Qe=null,Ve=0),ps=s,ai=i,Nr=u,lh=y,ah=m,dv=f,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,AA(zo,function(){return Av(),null})):(i.callbackNode=null,i.callbackPriority=0),f=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||f){f=I.T,I.T=null,m=Q.p,Q.p=2,w=qe,qe|=4;try{yA(i,s,u)}finally{qe=w,Q.p=m,I.T=f}}wt=1,Mv(),Ev(),Rv()}}function Mv(){if(wt===1){wt=0;var i=ai,s=ps,u=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||u){u=I.T,I.T=null;var f=Q.p;Q.p=2;var m=qe;qe|=4;try{iv(s,i);var y=Ch,w=cy(i.containerInfo),R=y.focusedElem,O=y.selectionRange;if(w!==R&&R&&R.ownerDocument&&uy(R.ownerDocument.documentElement,R)){if(O!==null&&Yf(R)){var P=O.start,Y=O.end;if(Y===void 0&&(Y=P),"selectionStart"in R)R.selectionStart=P,R.selectionEnd=Math.min(Y,R.value.length);else{var W=R.ownerDocument||document,$=W&&W.defaultView||window;if($.getSelection){var q=$.getSelection(),fe=R.textContent.length,we=Math.min(O.start,fe),Je=O.end===void 0?we:Math.min(O.end,fe);!q.extend&&we>Je&&(w=Je,Je=we,we=w);var B=ay(R,we),_=ay(R,Je);if(B&&_&&(q.rangeCount!==1||q.anchorNode!==B.node||q.anchorOffset!==B.offset||q.focusNode!==_.node||q.focusOffset!==_.offset)){var F=W.createRange();F.setStart(B.node,B.offset),q.removeAllRanges(),we>Je?(q.addRange(F),q.extend(_.node,_.offset)):(F.setEnd(_.node,_.offset),q.addRange(F))}}}}for(W=[],q=R;q=q.parentNode;)q.nodeType===1&&W.push({element:q,left:q.scrollLeft,top:q.scrollTop});for(typeof R.focus=="function"&&R.focus(),R=0;R<W.length;R++){var Z=W[R];Z.element.scrollLeft=Z.left,Z.element.scrollTop=Z.top}}Hu=!!wh,Ch=wh=null}finally{qe=m,Q.p=f,I.T=u}}i.current=s,wt=2}}function Ev(){if(wt===2){wt=0;var i=ai,s=ps,u=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||u){u=I.T,I.T=null;var f=Q.p;Q.p=2;var m=qe;qe|=4;try{W0(i,s.alternate,s)}finally{qe=m,Q.p=f,I.T=u}}wt=3}}function Rv(){if(wt===4||wt===3){wt=0,Na();var i=ai,s=ps,u=Nr,f=dv;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?wt=5:(wt=0,ps=ai=null,Tv(i,i.pendingLanes));var m=i.pendingLanes;if(m===0&&(li=null),Gr(u),s=s.stateNode,We&&typeof We.onCommitFiberRoot=="function")try{We.onCommitFiberRoot(Ur,s,void 0,(s.current.flags&128)===128)}catch{}if(f!==null){s=I.T,m=Q.p,Q.p=2,I.T=null;try{for(var y=i.onRecoverableError,w=0;w<f.length;w++){var R=f[w];y(R.value,{componentStack:R.stack})}}finally{I.T=s,Q.p=m}}(Nr&3)!==0&&Nu(),or(i),m=i.pendingLanes,(u&261930)!==0&&(m&42)!==0?i===uh?Ol++:(Ol=0,uh=i):Ol=0,kl(0)}}function Tv(i,s){(i.pooledCacheLanes&=s)===0&&(s=i.pooledCache,s!=null&&(i.pooledCache=null,cl(s)))}function Nu(){return Mv(),Ev(),Rv(),Av()}function Av(){if(wt!==5)return!1;var i=ai,s=lh;lh=0;var u=Gr(Nr),f=I.T,m=Q.p;try{Q.p=32>u?32:u,I.T=null,u=ah,ah=null;var y=ai,w=Nr;if(wt=0,ps=ai=null,Nr=0,(qe&6)!==0)throw Error(r(331));var R=qe;if(qe|=4,uv(y.current),sv(y,y.current,w,u),qe=R,kl(0,!1),We&&typeof We.onPostCommitFiberRoot=="function")try{We.onPostCommitFiberRoot(Ur,y)}catch{}return!0}finally{Q.p=m,I.T=f,Tv(i,s)}}function Ov(i,s,u){s=Dn(u,s),s=Pd(i.stateNode,s,2),i=ti(i,s,2),i!==null&&(Ce(i,2),or(i))}function Ke(i,s,u){if(i.tag===3)Ov(i,i,u);else for(;s!==null;){if(s.tag===3){Ov(s,i,u);break}else if(s.tag===1){var f=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof f.componentDidCatch=="function"&&(li===null||!li.has(f))){i=Dn(u,i),u=k0(2),f=ti(s,u,2),f!==null&&(N0(u,f,s,i),Ce(f,2),or(f));break}}s=s.return}}function dh(i,s,u){var f=i.pingCache;if(f===null){f=i.pingCache=new SA;var m=new Set;f.set(s,m)}else m=f.get(s),m===void 0&&(m=new Set,f.set(s,m));m.has(u)||(ih=!0,m.add(u),i=EA.bind(null,i,s,u),s.then(i,i))}function EA(i,s,u){var f=i.pingCache;f!==null&&f.delete(s),i.pingedLanes|=i.suspendedLanes&u,i.warmLanes&=~u,Qe===i&&(Ve&u)===u&&(lt===4||lt===3&&(Ve&62914560)===Ve&&300>Zt()-Eu?(qe&2)===0&&ms(i,0):oh|=u,hs===Ve&&(hs=0)),or(i)}function kv(i,s){s===0&&(s=ie()),i=Xi(i,s),i!==null&&(Ce(i,s),or(i))}function RA(i){var s=i.memoizedState,u=0;s!==null&&(u=s.retryLane),kv(i,u)}function TA(i,s){var u=0;switch(i.tag){case 31:case 13:var f=i.stateNode,m=i.memoizedState;m!==null&&(u=m.retryLane);break;case 19:f=i.stateNode;break;case 22:f=i.stateNode._retryCache;break;default:throw Error(r(314))}f!==null&&f.delete(s),kv(i,u)}function AA(i,s){return Do(i,s)}var Du=null,ys=null,hh=!1,_u=!1,ph=!1,ci=0;function or(i){i!==ys&&i.next===null&&(ys===null?Du=ys=i:ys=ys.next=i),_u=!0,hh||(hh=!0,kA())}function kl(i,s){if(!ph&&_u){ph=!0;do for(var u=!1,f=Du;f!==null;){if(i!==0){var m=f.pendingLanes;if(m===0)var y=0;else{var w=f.suspendedLanes,R=f.pingedLanes;y=(1<<31-Wt(42|i)+1)-1,y&=m&~(w&~R),y=y&201326741?y&201326741|1:y?y|2:0}y!==0&&(u=!0,zv(f,y))}else y=Ve,y=jo(f,f===Qe?y:0,f.cancelPendingCommit!==null||f.timeoutHandle!==-1),(y&3)===0||Ui(f,y)||(u=!0,zv(f,y));f=f.next}while(u);ph=!1}}function OA(){Nv()}function Nv(){_u=hh=!1;var i=0;ci!==0&&FA()&&(i=ci);for(var s=Zt(),u=null,f=Du;f!==null;){var m=f.next,y=Dv(f,s);y===0?(f.next=null,u===null?Du=m:u.next=m,m===null&&(ys=u)):(u=f,(i!==0||(y&3)!==0)&&(_u=!0)),f=m}wt!==0&&wt!==5||kl(i),ci!==0&&(ci=0)}function Dv(i,s){for(var u=i.suspendedLanes,f=i.pingedLanes,m=i.expirationTimes,y=i.pendingLanes&-62914561;0<y;){var w=31-Wt(y),R=1<<w,O=m[w];O===-1?((R&u)===0||(R&f)!==0)&&(m[w]=Of(R,s)):O<=s&&(i.expiredLanes|=R),y&=~R}if(s=Qe,u=Ve,u=jo(i,i===s?u:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),f=i.callbackNode,u===0||i===s&&(Ge===2||Ge===9)||i.cancelPendingCommit!==null)return f!==null&&f!==null&&_o(f),i.callbackNode=null,i.callbackPriority=0;if((u&3)===0||Ui(i,u)){if(s=u&-u,s===i.callbackPriority)return s;switch(f!==null&&_o(f),Gr(u)){case 2:case 8:u=za;break;case 32:u=zo;break;case 268435456:u=tr;break;default:u=zo}return f=_v.bind(null,i),u=Do(u,f),i.callbackPriority=s,i.callbackNode=u,s}return f!==null&&f!==null&&_o(f),i.callbackPriority=2,i.callbackNode=null,2}function _v(i,s){if(wt!==0&&wt!==5)return i.callbackNode=null,i.callbackPriority=0,null;var u=i.callbackNode;if(Nu()&&i.callbackNode!==u)return null;var f=Ve;return f=jo(i,i===Qe?f:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),f===0?null:(pv(i,f,s),Dv(i,Zt()),i.callbackNode!=null&&i.callbackNode===u?_v.bind(null,i):null)}function zv(i,s){if(Nu())return null;pv(i,s,!0)}function kA(){$A(function(){(qe&6)!==0?Do(_a,OA):Nv()})}function mh(){if(ci===0){var i=ts;i===0&&(i=qr,qr<<=1,(qr&261888)===0&&(qr=256)),ci=i}return ci}function jv(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:Pa(""+i)}function Lv(i,s){var u=s.ownerDocument.createElement("input");return u.name=s.name,u.value=s.value,i.id&&u.setAttribute("form",i.id),s.parentNode.insertBefore(u,s),i=new FormData(i),u.parentNode.removeChild(u),i}function NA(i,s,u,f,m){if(s==="submit"&&u&&u.stateNode===m){var y=jv((m[on]||null).action),w=f.submitter;w&&(s=(s=w[on]||null)?jv(s.formAction):w.getAttribute("formAction"),s!==null&&(y=s,w=null));var R=new qa("action","action",null,f,m);i.push({event:R,listeners:[{instance:null,listener:function(){if(f.defaultPrevented){if(ci!==0){var O=w?Lv(m,w):new FormData(m);jd(u,{pending:!0,data:O,method:m.method,action:y},null,O)}}else typeof y=="function"&&(R.preventDefault(),O=w?Lv(m,w):new FormData(m),jd(u,{pending:!0,data:O,method:m.method,action:y},y,O))},currentTarget:m}]})}}for(var gh=0;gh<Zf.length;gh++){var yh=Zf[gh],DA=yh.toLowerCase(),_A=yh[0].toUpperCase()+yh.slice(1);qn(DA,"on"+_A)}qn(hy,"onAnimationEnd"),qn(py,"onAnimationIteration"),qn(my,"onAnimationStart"),qn("dblclick","onDoubleClick"),qn("focusin","onFocus"),qn("focusout","onBlur"),qn(XT,"onTransitionRun"),qn(JT,"onTransitionStart"),qn(QT,"onTransitionCancel"),qn(gy,"onTransitionEnd"),Po("onMouseEnter",["mouseout","mouseover"]),Po("onMouseLeave",["mouseout","mouseover"]),Po("onPointerEnter",["pointerout","pointerover"]),Po("onPointerLeave",["pointerout","pointerover"]),qi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),qi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),qi("onBeforeInput",["compositionend","keypress","textInput","paste"]),qi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),qi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),qi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Nl="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),zA=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Nl));function Bv(i,s){s=(s&4)!==0;for(var u=0;u<i.length;u++){var f=i[u],m=f.event;f=f.listeners;e:{var y=void 0;if(s)for(var w=f.length-1;0<=w;w--){var R=f[w],O=R.instance,P=R.currentTarget;if(R=R.listener,O!==y&&m.isPropagationStopped())break e;y=R,m.currentTarget=P;try{y(m)}catch(Y){Ya(Y)}m.currentTarget=null,y=O}else for(w=0;w<f.length;w++){if(R=f[w],O=R.instance,P=R.currentTarget,R=R.listener,O!==y&&m.isPropagationStopped())break e;y=R,m.currentTarget=P;try{y(m)}catch(Y){Ya(Y)}m.currentTarget=null,y=O}}}}function Ie(i,s){var u=s[kf];u===void 0&&(u=s[kf]=new Set);var f=i+"__bubble";u.has(f)||(Iv(s,i,2,!1),u.add(f))}function vh(i,s,u){var f=0;s&&(f|=4),Iv(u,i,f,s)}var zu="_reactListening"+Math.random().toString(36).slice(2);function bh(i){if(!i[zu]){i[zu]=!0,Ng.forEach(function(u){u!=="selectionchange"&&(zA.has(u)||vh(u,!1,i),vh(u,!0,i))});var s=i.nodeType===9?i:i.ownerDocument;s===null||s[zu]||(s[zu]=!0,vh("selectionchange",!1,s))}}function Iv(i,s,u,f){switch(hb(s)){case 2:var m=aO;break;case 8:m=uO;break;default:m=zh}u=m.bind(null,s,u,i),m=void 0,!Vf||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(m=!0),f?m!==void 0?i.addEventListener(s,u,{capture:!0,passive:m}):i.addEventListener(s,u,!0):m!==void 0?i.addEventListener(s,u,{passive:m}):i.addEventListener(s,u,!1)}function Sh(i,s,u,f,m){var y=f;if((s&1)===0&&(s&2)===0&&f!==null)e:for(;;){if(f===null)return;var w=f.tag;if(w===3||w===4){var R=f.stateNode.containerInfo;if(R===m)break;if(w===4)for(w=f.return;w!==null;){var O=w.tag;if((O===3||O===4)&&w.stateNode.containerInfo===m)return;w=w.return}for(;R!==null;){if(w=Io(R),w===null)return;if(O=w.tag,O===5||O===6||O===26||O===27){f=y=w;continue e}R=R.parentNode}}f=f.return}Hg(function(){var P=y,Y=Bf(u),W=[];e:{var $=yy.get(i);if($!==void 0){var q=qa,fe=i;switch(i){case"keypress":if(Ha(u)===0)break e;case"keydown":case"keyup":q=TT;break;case"focusin":fe="focus",q=Hf;break;case"focusout":fe="blur",q=Hf;break;case"beforeblur":case"afterblur":q=Hf;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":q=Gg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":q=mT;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":q=kT;break;case hy:case py:case my:q=vT;break;case gy:q=DT;break;case"scroll":case"scrollend":q=hT;break;case"wheel":q=zT;break;case"copy":case"cut":case"paste":q=ST;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":q=Yg;break;case"toggle":case"beforetoggle":q=LT}var we=(s&4)!==0,Je=!we&&(i==="scroll"||i==="scrollend"),B=we?$!==null?$+"Capture":null:$;we=[];for(var _=P,F;_!==null;){var Z=_;if(F=Z.stateNode,Z=Z.tag,Z!==5&&Z!==26&&Z!==27||F===null||B===null||(Z=Ws(_,B),Z!=null&&we.push(Dl(_,Z,F))),Je)break;_=_.return}0<we.length&&($=new q($,fe,null,u,Y),W.push({event:$,listeners:we}))}}if((s&7)===0){e:{if($=i==="mouseover"||i==="pointerover",q=i==="mouseout"||i==="pointerout",$&&u!==Lf&&(fe=u.relatedTarget||u.fromElement)&&(Io(fe)||fe[Bo]))break e;if((q||$)&&($=Y.window===Y?Y:($=Y.ownerDocument)?$.defaultView||$.parentWindow:window,q?(fe=u.relatedTarget||u.toElement,q=P,fe=fe?Io(fe):null,fe!==null&&(Je=l(fe),we=fe.tag,fe!==Je||we!==5&&we!==27&&we!==6)&&(fe=null)):(q=null,fe=P),q!==fe)){if(we=Gg,Z="onMouseLeave",B="onMouseEnter",_="mouse",(i==="pointerout"||i==="pointerover")&&(we=Yg,Z="onPointerLeave",B="onPointerEnter",_="pointer"),Je=q==null?$:Zs(q),F=fe==null?$:Zs(fe),$=new we(Z,_+"leave",q,u,Y),$.target=Je,$.relatedTarget=F,Z=null,Io(Y)===P&&(we=new we(B,_+"enter",fe,u,Y),we.target=F,we.relatedTarget=Je,Z=we),Je=Z,q&&fe)t:{for(we=jA,B=q,_=fe,F=0,Z=B;Z;Z=we(Z))F++;Z=0;for(var ve=_;ve;ve=we(ve))Z++;for(;0<F-Z;)B=we(B),F--;for(;0<Z-F;)_=we(_),Z--;for(;F--;){if(B===_||_!==null&&B===_.alternate){we=B;break t}B=we(B),_=we(_)}we=null}else we=null;q!==null&&Vv(W,$,q,we,!1),fe!==null&&Je!==null&&Vv(W,Je,fe,we,!0)}}e:{if($=P?Zs(P):window,q=$.nodeName&&$.nodeName.toLowerCase(),q==="select"||q==="input"&&$.type==="file")var $e=ny;else if(ey($))if(ry)$e=GT;else{$e=UT;var ge=HT}else q=$.nodeName,!q||q.toLowerCase()!=="input"||$.type!=="checkbox"&&$.type!=="radio"?P&&jf(P.elementType)&&($e=ny):$e=qT;if($e&&($e=$e(i,P))){ty(W,$e,u,Y);break e}ge&&ge(i,$,P),i==="focusout"&&P&&$.type==="number"&&P.memoizedProps.value!=null&&zf($,"number",$.value)}switch(ge=P?Zs(P):window,i){case"focusin":(ey(ge)||ge.contentEditable==="true")&&(Ko=ge,Xf=P,ll=null);break;case"focusout":ll=Xf=Ko=null;break;case"mousedown":Jf=!0;break;case"contextmenu":case"mouseup":case"dragend":Jf=!1,fy(W,u,Y);break;case"selectionchange":if(YT)break;case"keydown":case"keyup":fy(W,u,Y)}var ke;if(qf)e:{switch(i){case"compositionstart":var Fe="onCompositionStart";break e;case"compositionend":Fe="onCompositionEnd";break e;case"compositionupdate":Fe="onCompositionUpdate";break e}Fe=void 0}else Go?Zg(i,u)&&(Fe="onCompositionEnd"):i==="keydown"&&u.keyCode===229&&(Fe="onCompositionStart");Fe&&(Xg&&u.locale!=="ko"&&(Go||Fe!=="onCompositionStart"?Fe==="onCompositionEnd"&&Go&&(ke=Ug()):(Yr=Y,Ff="value"in Yr?Yr.value:Yr.textContent,Go=!0)),ge=ju(P,Fe),0<ge.length&&(Fe=new Kg(Fe,i,null,u,Y),W.push({event:Fe,listeners:ge}),ke?Fe.data=ke:(ke=Wg(u),ke!==null&&(Fe.data=ke)))),(ke=IT?VT(i,u):FT(i,u))&&(Fe=ju(P,"onBeforeInput"),0<Fe.length&&(ge=new Kg("onBeforeInput","beforeinput",null,u,Y),W.push({event:ge,listeners:Fe}),ge.data=ke)),NA(W,i,P,u,Y)}Bv(W,s)})}function Dl(i,s,u){return{instance:i,listener:s,currentTarget:u}}function ju(i,s){for(var u=s+"Capture",f=[];i!==null;){var m=i,y=m.stateNode;if(m=m.tag,m!==5&&m!==26&&m!==27||y===null||(m=Ws(i,u),m!=null&&f.unshift(Dl(i,m,y)),m=Ws(i,s),m!=null&&f.push(Dl(i,m,y))),i.tag===3)return f;i=i.return}return[]}function jA(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function Vv(i,s,u,f,m){for(var y=s._reactName,w=[];u!==null&&u!==f;){var R=u,O=R.alternate,P=R.stateNode;if(R=R.tag,O!==null&&O===f)break;R!==5&&R!==26&&R!==27||P===null||(O=P,m?(P=Ws(u,y),P!=null&&w.unshift(Dl(u,P,O))):m||(P=Ws(u,y),P!=null&&w.push(Dl(u,P,O)))),u=u.return}w.length!==0&&i.push({event:s,listeners:w})}var LA=/\r\n?/g,BA=/\u0000|\uFFFD/g;function Fv(i){return(typeof i=="string"?i:""+i).replace(LA,`
|
|
9
|
+
`).replace(BA,"")}function Pv(i,s){return s=Fv(s),Fv(i)===s}function Xe(i,s,u,f,m,y){switch(u){case"children":typeof f=="string"?s==="body"||s==="textarea"&&f===""||Ho(i,f):(typeof f=="number"||typeof f=="bigint")&&s!=="body"&&Ho(i,""+f);break;case"className":Va(i,"class",f);break;case"tabIndex":Va(i,"tabindex",f);break;case"dir":case"role":case"viewBox":case"width":case"height":Va(i,u,f);break;case"style":Pg(i,f,y);break;case"data":if(s!=="object"){Va(i,"data",f);break}case"src":case"href":if(f===""&&(s!=="a"||u!=="href")){i.removeAttribute(u);break}if(f==null||typeof f=="function"||typeof f=="symbol"||typeof f=="boolean"){i.removeAttribute(u);break}f=Pa(""+f),i.setAttribute(u,f);break;case"action":case"formAction":if(typeof f=="function"){i.setAttribute(u,"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 y=="function"&&(u==="formAction"?(s!=="input"&&Xe(i,s,"name",m.name,m,null),Xe(i,s,"formEncType",m.formEncType,m,null),Xe(i,s,"formMethod",m.formMethod,m,null),Xe(i,s,"formTarget",m.formTarget,m,null)):(Xe(i,s,"encType",m.encType,m,null),Xe(i,s,"method",m.method,m,null),Xe(i,s,"target",m.target,m,null)));if(f==null||typeof f=="symbol"||typeof f=="boolean"){i.removeAttribute(u);break}f=Pa(""+f),i.setAttribute(u,f);break;case"onClick":f!=null&&(i.onclick=gr);break;case"onScroll":f!=null&&Ie("scroll",i);break;case"onScrollEnd":f!=null&&Ie("scrollend",i);break;case"dangerouslySetInnerHTML":if(f!=null){if(typeof f!="object"||!("__html"in f))throw Error(r(61));if(u=f.__html,u!=null){if(m.children!=null)throw Error(r(60));i.innerHTML=u}}break;case"multiple":i.multiple=f&&typeof f!="function"&&typeof f!="symbol";break;case"muted":i.muted=f&&typeof f!="function"&&typeof f!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(f==null||typeof f=="function"||typeof f=="boolean"||typeof f=="symbol"){i.removeAttribute("xlink:href");break}u=Pa(""+f),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",u);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":f!=null&&typeof f!="function"&&typeof f!="symbol"?i.setAttribute(u,""+f):i.removeAttribute(u);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":f&&typeof f!="function"&&typeof f!="symbol"?i.setAttribute(u,""):i.removeAttribute(u);break;case"capture":case"download":f===!0?i.setAttribute(u,""):f!==!1&&f!=null&&typeof f!="function"&&typeof f!="symbol"?i.setAttribute(u,f):i.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":f!=null&&typeof f!="function"&&typeof f!="symbol"&&!isNaN(f)&&1<=f?i.setAttribute(u,f):i.removeAttribute(u);break;case"rowSpan":case"start":f==null||typeof f=="function"||typeof f=="symbol"||isNaN(f)?i.removeAttribute(u):i.setAttribute(u,f);break;case"popover":Ie("beforetoggle",i),Ie("toggle",i),Ia(i,"popover",f);break;case"xlinkActuate":mr(i,"http://www.w3.org/1999/xlink","xlink:actuate",f);break;case"xlinkArcrole":mr(i,"http://www.w3.org/1999/xlink","xlink:arcrole",f);break;case"xlinkRole":mr(i,"http://www.w3.org/1999/xlink","xlink:role",f);break;case"xlinkShow":mr(i,"http://www.w3.org/1999/xlink","xlink:show",f);break;case"xlinkTitle":mr(i,"http://www.w3.org/1999/xlink","xlink:title",f);break;case"xlinkType":mr(i,"http://www.w3.org/1999/xlink","xlink:type",f);break;case"xmlBase":mr(i,"http://www.w3.org/XML/1998/namespace","xml:base",f);break;case"xmlLang":mr(i,"http://www.w3.org/XML/1998/namespace","xml:lang",f);break;case"xmlSpace":mr(i,"http://www.w3.org/XML/1998/namespace","xml:space",f);break;case"is":Ia(i,"is",f);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=fT.get(u)||u,Ia(i,u,f))}}function xh(i,s,u,f,m,y){switch(u){case"style":Pg(i,f,y);break;case"dangerouslySetInnerHTML":if(f!=null){if(typeof f!="object"||!("__html"in f))throw Error(r(61));if(u=f.__html,u!=null){if(m.children!=null)throw Error(r(60));i.innerHTML=u}}break;case"children":typeof f=="string"?Ho(i,f):(typeof f=="number"||typeof f=="bigint")&&Ho(i,""+f);break;case"onScroll":f!=null&&Ie("scroll",i);break;case"onScrollEnd":f!=null&&Ie("scrollend",i);break;case"onClick":f!=null&&(i.onclick=gr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Dg.hasOwnProperty(u))e:{if(u[0]==="o"&&u[1]==="n"&&(m=u.endsWith("Capture"),s=u.slice(2,m?u.length-7:void 0),y=i[on]||null,y=y!=null?y[u]:null,typeof y=="function"&&i.removeEventListener(s,y,m),typeof f=="function")){typeof y!="function"&&y!==null&&(u in i?i[u]=null:i.hasAttribute(u)&&i.removeAttribute(u)),i.addEventListener(s,f,m);break e}u in i?i[u]=f:f===!0?i.setAttribute(u,""):Ia(i,u,f)}}}function jt(i,s,u){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ie("error",i),Ie("load",i);var f=!1,m=!1,y;for(y in u)if(u.hasOwnProperty(y)){var w=u[y];if(w!=null)switch(y){case"src":f=!0;break;case"srcSet":m=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:Xe(i,s,y,w,u,null)}}m&&Xe(i,s,"srcSet",u.srcSet,u,null),f&&Xe(i,s,"src",u.src,u,null);return;case"input":Ie("invalid",i);var R=y=w=m=null,O=null,P=null;for(f in u)if(u.hasOwnProperty(f)){var Y=u[f];if(Y!=null)switch(f){case"name":m=Y;break;case"type":w=Y;break;case"checked":O=Y;break;case"defaultChecked":P=Y;break;case"value":y=Y;break;case"defaultValue":R=Y;break;case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(r(137,s));break;default:Xe(i,s,f,Y,u,null)}}Bg(i,y,R,O,P,w,m,!1);return;case"select":Ie("invalid",i),f=w=y=null;for(m in u)if(u.hasOwnProperty(m)&&(R=u[m],R!=null))switch(m){case"value":y=R;break;case"defaultValue":w=R;break;case"multiple":f=R;default:Xe(i,s,m,R,u,null)}s=y,u=w,i.multiple=!!f,s!=null?$o(i,!!f,s,!1):u!=null&&$o(i,!!f,u,!0);return;case"textarea":Ie("invalid",i),y=m=f=null;for(w in u)if(u.hasOwnProperty(w)&&(R=u[w],R!=null))switch(w){case"value":f=R;break;case"defaultValue":m=R;break;case"children":y=R;break;case"dangerouslySetInnerHTML":if(R!=null)throw Error(r(91));break;default:Xe(i,s,w,R,u,null)}Vg(i,f,m,y);return;case"option":for(O in u)u.hasOwnProperty(O)&&(f=u[O],f!=null)&&(O==="selected"?i.selected=f&&typeof f!="function"&&typeof f!="symbol":Xe(i,s,O,f,u,null));return;case"dialog":Ie("beforetoggle",i),Ie("toggle",i),Ie("cancel",i),Ie("close",i);break;case"iframe":case"object":Ie("load",i);break;case"video":case"audio":for(f=0;f<Nl.length;f++)Ie(Nl[f],i);break;case"image":Ie("error",i),Ie("load",i);break;case"details":Ie("toggle",i);break;case"embed":case"source":case"link":Ie("error",i),Ie("load",i);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(P in u)if(u.hasOwnProperty(P)&&(f=u[P],f!=null))switch(P){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:Xe(i,s,P,f,u,null)}return;default:if(jf(s)){for(Y in u)u.hasOwnProperty(Y)&&(f=u[Y],f!==void 0&&xh(i,s,Y,f,u,void 0));return}}for(R in u)u.hasOwnProperty(R)&&(f=u[R],f!=null&&Xe(i,s,R,f,u,null))}function IA(i,s,u,f){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var m=null,y=null,w=null,R=null,O=null,P=null,Y=null;for(q in u){var W=u[q];if(u.hasOwnProperty(q)&&W!=null)switch(q){case"checked":break;case"value":break;case"defaultValue":O=W;default:f.hasOwnProperty(q)||Xe(i,s,q,null,f,W)}}for(var $ in f){var q=f[$];if(W=u[$],f.hasOwnProperty($)&&(q!=null||W!=null))switch($){case"type":y=q;break;case"name":m=q;break;case"checked":P=q;break;case"defaultChecked":Y=q;break;case"value":w=q;break;case"defaultValue":R=q;break;case"children":case"dangerouslySetInnerHTML":if(q!=null)throw Error(r(137,s));break;default:q!==W&&Xe(i,s,$,q,f,W)}}_f(i,w,R,O,P,Y,y,m);return;case"select":q=w=R=$=null;for(y in u)if(O=u[y],u.hasOwnProperty(y)&&O!=null)switch(y){case"value":break;case"multiple":q=O;default:f.hasOwnProperty(y)||Xe(i,s,y,null,f,O)}for(m in f)if(y=f[m],O=u[m],f.hasOwnProperty(m)&&(y!=null||O!=null))switch(m){case"value":$=y;break;case"defaultValue":R=y;break;case"multiple":w=y;default:y!==O&&Xe(i,s,m,y,f,O)}s=R,u=w,f=q,$!=null?$o(i,!!u,$,!1):!!f!=!!u&&(s!=null?$o(i,!!u,s,!0):$o(i,!!u,u?[]:"",!1));return;case"textarea":q=$=null;for(R in u)if(m=u[R],u.hasOwnProperty(R)&&m!=null&&!f.hasOwnProperty(R))switch(R){case"value":break;case"children":break;default:Xe(i,s,R,null,f,m)}for(w in f)if(m=f[w],y=u[w],f.hasOwnProperty(w)&&(m!=null||y!=null))switch(w){case"value":$=m;break;case"defaultValue":q=m;break;case"children":break;case"dangerouslySetInnerHTML":if(m!=null)throw Error(r(91));break;default:m!==y&&Xe(i,s,w,m,f,y)}Ig(i,$,q);return;case"option":for(var fe in u)$=u[fe],u.hasOwnProperty(fe)&&$!=null&&!f.hasOwnProperty(fe)&&(fe==="selected"?i.selected=!1:Xe(i,s,fe,null,f,$));for(O in f)$=f[O],q=u[O],f.hasOwnProperty(O)&&$!==q&&($!=null||q!=null)&&(O==="selected"?i.selected=$&&typeof $!="function"&&typeof $!="symbol":Xe(i,s,O,$,f,q));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 we in u)$=u[we],u.hasOwnProperty(we)&&$!=null&&!f.hasOwnProperty(we)&&Xe(i,s,we,null,f,$);for(P in f)if($=f[P],q=u[P],f.hasOwnProperty(P)&&$!==q&&($!=null||q!=null))switch(P){case"children":case"dangerouslySetInnerHTML":if($!=null)throw Error(r(137,s));break;default:Xe(i,s,P,$,f,q)}return;default:if(jf(s)){for(var Je in u)$=u[Je],u.hasOwnProperty(Je)&&$!==void 0&&!f.hasOwnProperty(Je)&&xh(i,s,Je,void 0,f,$);for(Y in f)$=f[Y],q=u[Y],!f.hasOwnProperty(Y)||$===q||$===void 0&&q===void 0||xh(i,s,Y,$,f,q);return}}for(var B in u)$=u[B],u.hasOwnProperty(B)&&$!=null&&!f.hasOwnProperty(B)&&Xe(i,s,B,null,f,$);for(W in f)$=f[W],q=u[W],!f.hasOwnProperty(W)||$===q||$==null&&q==null||Xe(i,s,W,$,f,q)}function $v(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function VA(){if(typeof performance.getEntriesByType=="function"){for(var i=0,s=0,u=performance.getEntriesByType("resource"),f=0;f<u.length;f++){var m=u[f],y=m.transferSize,w=m.initiatorType,R=m.duration;if(y&&R&&$v(w)){for(w=0,R=m.responseEnd,f+=1;f<u.length;f++){var O=u[f],P=O.startTime;if(P>R)break;var Y=O.transferSize,W=O.initiatorType;Y&&$v(W)&&(O=O.responseEnd,w+=Y*(O<R?1:(R-P)/(O-P)))}if(--f,s+=8*(y+w)/(m.duration/1e3),i++,10<i)break}}if(0<i)return s/i/1e6}return navigator.connection&&(i=navigator.connection.downlink,typeof i=="number")?i:5}var wh=null,Ch=null;function Lu(i){return i.nodeType===9?i:i.ownerDocument}function Hv(i){switch(i){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Uv(i,s){if(i===0)switch(s){case"svg":return 1;case"math":return 2;default:return 0}return i===1&&s==="foreignObject"?0:i}function Mh(i,s){return i==="textarea"||i==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.children=="bigint"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var Eh=null;function FA(){var i=window.event;return i&&i.type==="popstate"?i===Eh?!1:(Eh=i,!0):(Eh=null,!1)}var qv=typeof setTimeout=="function"?setTimeout:void 0,PA=typeof clearTimeout=="function"?clearTimeout:void 0,Gv=typeof Promise=="function"?Promise:void 0,$A=typeof queueMicrotask=="function"?queueMicrotask:typeof Gv<"u"?function(i){return Gv.resolve(null).then(i).catch(HA)}:qv;function HA(i){setTimeout(function(){throw i})}function fi(i){return i==="head"}function Kv(i,s){var u=s,f=0;do{var m=u.nextSibling;if(i.removeChild(u),m&&m.nodeType===8)if(u=m.data,u==="/$"||u==="/&"){if(f===0){i.removeChild(m),xs(s);return}f--}else if(u==="$"||u==="$?"||u==="$~"||u==="$!"||u==="&")f++;else if(u==="html")_l(i.ownerDocument.documentElement);else if(u==="head"){u=i.ownerDocument.head,_l(u);for(var y=u.firstChild;y;){var w=y.nextSibling,R=y.nodeName;y[Qs]||R==="SCRIPT"||R==="STYLE"||R==="LINK"&&y.rel.toLowerCase()==="stylesheet"||u.removeChild(y),y=w}}else u==="body"&&_l(i.ownerDocument.body);u=m}while(u);xs(s)}function Yv(i,s){var u=i;i=0;do{var f=u.nextSibling;if(u.nodeType===1?s?(u._stashedDisplay=u.style.display,u.style.display="none"):(u.style.display=u._stashedDisplay||"",u.getAttribute("style")===""&&u.removeAttribute("style")):u.nodeType===3&&(s?(u._stashedText=u.nodeValue,u.nodeValue=""):u.nodeValue=u._stashedText||""),f&&f.nodeType===8)if(u=f.data,u==="/$"){if(i===0)break;i--}else u!=="$"&&u!=="$?"&&u!=="$~"&&u!=="$!"||i++;u=f}while(u)}function Rh(i){var s=i.firstChild;for(s&&s.nodeType===10&&(s=s.nextSibling);s;){var u=s;switch(s=s.nextSibling,u.nodeName){case"HTML":case"HEAD":case"BODY":Rh(u),Nf(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}i.removeChild(u)}}function UA(i,s,u,f){for(;i.nodeType===1;){var m=u;if(i.nodeName.toLowerCase()!==s.toLowerCase()){if(!f&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(f){if(!i[Qs])switch(s){case"meta":if(!i.hasAttribute("itemprop"))break;return i;case"link":if(y=i.getAttribute("rel"),y==="stylesheet"&&i.hasAttribute("data-precedence"))break;if(y!==m.rel||i.getAttribute("href")!==(m.href==null||m.href===""?null:m.href)||i.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin)||i.getAttribute("title")!==(m.title==null?null:m.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(y=i.getAttribute("src"),(y!==(m.src==null?null:m.src)||i.getAttribute("type")!==(m.type==null?null:m.type)||i.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin))&&y&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(s==="input"&&i.type==="hidden"){var y=m.name==null?null:""+m.name;if(m.type==="hidden"&&i.getAttribute("name")===y)return i}else return i;if(i=Bn(i.nextSibling),i===null)break}return null}function qA(i,s,u){if(s==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!u||(i=Bn(i.nextSibling),i===null))return null;return i}function Xv(i,s){for(;i.nodeType!==8;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!s||(i=Bn(i.nextSibling),i===null))return null;return i}function Th(i){return i.data==="$?"||i.data==="$~"}function Ah(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function GA(i,s){var u=i.ownerDocument;if(i.data==="$~")i._reactRetry=s;else if(i.data!=="$?"||u.readyState!=="loading")s();else{var f=function(){s(),u.removeEventListener("DOMContentLoaded",f)};u.addEventListener("DOMContentLoaded",f),i._reactRetry=f}}function Bn(i){for(;i!=null;i=i.nextSibling){var s=i.nodeType;if(s===1||s===3)break;if(s===8){if(s=i.data,s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"||s==="F!"||s==="F")break;if(s==="/$"||s==="/&")return null}}return i}var Oh=null;function Jv(i){i=i.nextSibling;for(var s=0;i;){if(i.nodeType===8){var u=i.data;if(u==="/$"||u==="/&"){if(s===0)return Bn(i.nextSibling);s--}else u!=="$"&&u!=="$!"&&u!=="$?"&&u!=="$~"&&u!=="&"||s++}i=i.nextSibling}return null}function Qv(i){i=i.previousSibling;for(var s=0;i;){if(i.nodeType===8){var u=i.data;if(u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"){if(s===0)return i;s--}else u!=="/$"&&u!=="/&"||s++}i=i.previousSibling}return null}function Zv(i,s,u){switch(s=Lu(u),i){case"html":if(i=s.documentElement,!i)throw Error(r(452));return i;case"head":if(i=s.head,!i)throw Error(r(453));return i;case"body":if(i=s.body,!i)throw Error(r(454));return i;default:throw Error(r(451))}}function _l(i){for(var s=i.attributes;s.length;)i.removeAttributeNode(s[0]);Nf(i)}var In=new Map,Wv=new Set;function Bu(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var Dr=Q.d;Q.d={f:KA,r:YA,D:XA,C:JA,L:QA,m:ZA,X:eO,S:WA,M:tO};function KA(){var i=Dr.f(),s=Au();return i||s}function YA(i){var s=Vo(i);s!==null&&s.tag===5&&s.type==="form"?g0(s):Dr.r(i)}var vs=typeof document>"u"?null:document;function eb(i,s,u){var f=vs;if(f&&typeof s=="string"&&s){var m=kn(s);m='link[rel="'+i+'"][href="'+m+'"]',typeof u=="string"&&(m+='[crossorigin="'+u+'"]'),Wv.has(m)||(Wv.add(m),i={rel:i,crossOrigin:u,href:s},f.querySelector(m)===null&&(s=f.createElement("link"),jt(s,"link",i),Mt(s),f.head.appendChild(s)))}}function XA(i){Dr.D(i),eb("dns-prefetch",i,null)}function JA(i,s){Dr.C(i,s),eb("preconnect",i,s)}function QA(i,s,u){Dr.L(i,s,u);var f=vs;if(f&&i&&s){var m='link[rel="preload"][as="'+kn(s)+'"]';s==="image"&&u&&u.imageSrcSet?(m+='[imagesrcset="'+kn(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(m+='[imagesizes="'+kn(u.imageSizes)+'"]')):m+='[href="'+kn(i)+'"]';var y=m;switch(s){case"style":y=bs(i);break;case"script":y=Ss(i)}In.has(y)||(i=g({rel:"preload",href:s==="image"&&u&&u.imageSrcSet?void 0:i,as:s},u),In.set(y,i),f.querySelector(m)!==null||s==="style"&&f.querySelector(zl(y))||s==="script"&&f.querySelector(jl(y))||(s=f.createElement("link"),jt(s,"link",i),Mt(s),f.head.appendChild(s)))}}function ZA(i,s){Dr.m(i,s);var u=vs;if(u&&i){var f=s&&typeof s.as=="string"?s.as:"script",m='link[rel="modulepreload"][as="'+kn(f)+'"][href="'+kn(i)+'"]',y=m;switch(f){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":y=Ss(i)}if(!In.has(y)&&(i=g({rel:"modulepreload",href:i},s),In.set(y,i),u.querySelector(m)===null)){switch(f){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(jl(y)))return}f=u.createElement("link"),jt(f,"link",i),Mt(f),u.head.appendChild(f)}}}function WA(i,s,u){Dr.S(i,s,u);var f=vs;if(f&&i){var m=Fo(f).hoistableStyles,y=bs(i);s=s||"default";var w=m.get(y);if(!w){var R={loading:0,preload:null};if(w=f.querySelector(zl(y)))R.loading=5;else{i=g({rel:"stylesheet",href:i,"data-precedence":s},u),(u=In.get(y))&&kh(i,u);var O=w=f.createElement("link");Mt(O),jt(O,"link",i),O._p=new Promise(function(P,Y){O.onload=P,O.onerror=Y}),O.addEventListener("load",function(){R.loading|=1}),O.addEventListener("error",function(){R.loading|=2}),R.loading|=4,Iu(w,s,f)}w={type:"stylesheet",instance:w,count:1,state:R},m.set(y,w)}}}function eO(i,s){Dr.X(i,s);var u=vs;if(u&&i){var f=Fo(u).hoistableScripts,m=Ss(i),y=f.get(m);y||(y=u.querySelector(jl(m)),y||(i=g({src:i,async:!0},s),(s=In.get(m))&&Nh(i,s),y=u.createElement("script"),Mt(y),jt(y,"link",i),u.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},f.set(m,y))}}function tO(i,s){Dr.M(i,s);var u=vs;if(u&&i){var f=Fo(u).hoistableScripts,m=Ss(i),y=f.get(m);y||(y=u.querySelector(jl(m)),y||(i=g({src:i,async:!0,type:"module"},s),(s=In.get(m))&&Nh(i,s),y=u.createElement("script"),Mt(y),jt(y,"link",i),u.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},f.set(m,y))}}function tb(i,s,u,f){var m=(m=ae.current)?Bu(m):null;if(!m)throw Error(r(446));switch(i){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(s=bs(u.href),u=Fo(m).hoistableStyles,f=u.get(s),f||(f={type:"style",instance:null,count:0,state:null},u.set(s,f)),f):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){i=bs(u.href);var y=Fo(m).hoistableStyles,w=y.get(i);if(w||(m=m.ownerDocument||m,w={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},y.set(i,w),(y=m.querySelector(zl(i)))&&!y._p&&(w.instance=y,w.state.loading=5),In.has(i)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},In.set(i,u),y||nO(m,i,u,w.state))),s&&f===null)throw Error(r(528,""));return w}if(s&&f!==null)throw Error(r(529,""));return null;case"script":return s=u.async,u=u.src,typeof u=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=Ss(u),u=Fo(m).hoistableScripts,f=u.get(s),f||(f={type:"script",instance:null,count:0,state:null},u.set(s,f)),f):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,i))}}function bs(i){return'href="'+kn(i)+'"'}function zl(i){return'link[rel="stylesheet"]['+i+"]"}function nb(i){return g({},i,{"data-precedence":i.precedence,precedence:null})}function nO(i,s,u,f){i.querySelector('link[rel="preload"][as="style"]['+s+"]")?f.loading=1:(s=i.createElement("link"),f.preload=s,s.addEventListener("load",function(){return f.loading|=1}),s.addEventListener("error",function(){return f.loading|=2}),jt(s,"link",u),Mt(s),i.head.appendChild(s))}function Ss(i){return'[src="'+kn(i)+'"]'}function jl(i){return"script[async]"+i}function rb(i,s,u){if(s.count++,s.instance===null)switch(s.type){case"style":var f=i.querySelector('style[data-href~="'+kn(u.href)+'"]');if(f)return s.instance=f,Mt(f),f;var m=g({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return f=(i.ownerDocument||i).createElement("style"),Mt(f),jt(f,"style",m),Iu(f,u.precedence,i),s.instance=f;case"stylesheet":m=bs(u.href);var y=i.querySelector(zl(m));if(y)return s.state.loading|=4,s.instance=y,Mt(y),y;f=nb(u),(m=In.get(m))&&kh(f,m),y=(i.ownerDocument||i).createElement("link"),Mt(y);var w=y;return w._p=new Promise(function(R,O){w.onload=R,w.onerror=O}),jt(y,"link",f),s.state.loading|=4,Iu(y,u.precedence,i),s.instance=y;case"script":return y=Ss(u.src),(m=i.querySelector(jl(y)))?(s.instance=m,Mt(m),m):(f=u,(m=In.get(y))&&(f=g({},u),Nh(f,m)),i=i.ownerDocument||i,m=i.createElement("script"),Mt(m),jt(m,"link",f),i.head.appendChild(m),s.instance=m);case"void":return null;default:throw Error(r(443,s.type))}else s.type==="stylesheet"&&(s.state.loading&4)===0&&(f=s.instance,s.state.loading|=4,Iu(f,u.precedence,i));return s.instance}function Iu(i,s,u){for(var f=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),m=f.length?f[f.length-1]:null,y=m,w=0;w<f.length;w++){var R=f[w];if(R.dataset.precedence===s)y=R;else if(y!==m)break}y?y.parentNode.insertBefore(i,y.nextSibling):(s=u.nodeType===9?u.head:u,s.insertBefore(i,s.firstChild))}function kh(i,s){i.crossOrigin==null&&(i.crossOrigin=s.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=s.referrerPolicy),i.title==null&&(i.title=s.title)}function Nh(i,s){i.crossOrigin==null&&(i.crossOrigin=s.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=s.referrerPolicy),i.integrity==null&&(i.integrity=s.integrity)}var Vu=null;function ib(i,s,u){if(Vu===null){var f=new Map,m=Vu=new Map;m.set(u,f)}else m=Vu,f=m.get(u),f||(f=new Map,m.set(u,f));if(f.has(i))return f;for(f.set(i,null),u=u.getElementsByTagName(i),m=0;m<u.length;m++){var y=u[m];if(!(y[Qs]||y[Nt]||i==="link"&&y.getAttribute("rel")==="stylesheet")&&y.namespaceURI!=="http://www.w3.org/2000/svg"){var w=y.getAttribute(s)||"";w=i+w;var R=f.get(w);R?R.push(y):f.set(w,[y])}}return f}function ob(i,s,u){i=i.ownerDocument||i,i.head.insertBefore(u,s==="title"?i.querySelector("head > title"):null)}function rO(i,s,u){if(u===1||s.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof s.precedence!="string"||typeof s.href!="string"||s.href==="")break;return!0;case"link":if(typeof s.rel!="string"||typeof s.href!="string"||s.href===""||s.onLoad||s.onError)break;return s.rel==="stylesheet"?(i=s.disabled,typeof s.precedence=="string"&&i==null):!0;case"script":if(s.async&&typeof s.async!="function"&&typeof s.async!="symbol"&&!s.onLoad&&!s.onError&&s.src&&typeof s.src=="string")return!0}return!1}function sb(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function iO(i,s,u,f){if(u.type==="stylesheet"&&(typeof f.media!="string"||matchMedia(f.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var m=bs(f.href),y=s.querySelector(zl(m));if(y){s=y._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(i.count++,i=Fu.bind(i),s.then(i,i)),u.state.loading|=4,u.instance=y,Mt(y);return}y=s.ownerDocument||s,f=nb(f),(m=In.get(m))&&kh(f,m),y=y.createElement("link"),Mt(y);var w=y;w._p=new Promise(function(R,O){w.onload=R,w.onerror=O}),jt(y,"link",f),u.instance=y}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(u,s),(s=u.state.preload)&&(u.state.loading&3)===0&&(i.count++,u=Fu.bind(i),s.addEventListener("load",u),s.addEventListener("error",u))}}var Dh=0;function oO(i,s){return i.stylesheets&&i.count===0&&$u(i,i.stylesheets),0<i.count||0<i.imgCount?function(u){var f=setTimeout(function(){if(i.stylesheets&&$u(i,i.stylesheets),i.unsuspend){var y=i.unsuspend;i.unsuspend=null,y()}},6e4+s);0<i.imgBytes&&Dh===0&&(Dh=62500*VA());var m=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&$u(i,i.stylesheets),i.unsuspend)){var y=i.unsuspend;i.unsuspend=null,y()}},(i.imgBytes>Dh?50:800)+s);return i.unsuspend=u,function(){i.unsuspend=null,clearTimeout(f),clearTimeout(m)}}:null}function Fu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)$u(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var Pu=null;function $u(i,s){i.stylesheets=null,i.unsuspend!==null&&(i.count++,Pu=new Map,s.forEach(sO,i),Pu=null,Fu.call(i))}function sO(i,s){if(!(s.state.loading&4)){var u=Pu.get(i);if(u)var f=u.get(null);else{u=new Map,Pu.set(i,u);for(var m=i.querySelectorAll("link[data-precedence],style[data-precedence]"),y=0;y<m.length;y++){var w=m[y];(w.nodeName==="LINK"||w.getAttribute("media")!=="not all")&&(u.set(w.dataset.precedence,w),f=w)}f&&u.set(null,f)}m=s.instance,w=m.getAttribute("data-precedence"),y=u.get(w)||f,y===f&&u.set(null,m),u.set(w,m),this.count++,f=Fu.bind(this),m.addEventListener("load",f),m.addEventListener("error",f),y?y.parentNode.insertBefore(m,y.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(m,i.firstChild)),s.state.loading|=4}}var Ll={$$typeof:k,Provider:null,Consumer:null,_currentValue:U,_currentValue2:U,_threadCount:0};function lO(i,s,u,f,m,y,w,R,O){this.tag=1,this.containerInfo=i,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=oe(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=oe(0),this.hiddenUpdates=oe(null),this.identifierPrefix=f,this.onUncaughtError=m,this.onCaughtError=y,this.onRecoverableError=w,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=O,this.incompleteTransitions=new Map}function lb(i,s,u,f,m,y,w,R,O,P,Y,W){return i=new lO(i,s,u,w,O,P,Y,W,R),s=1,y===!0&&(s|=24),y=gn(3,null,null,s),i.current=y,y.stateNode=i,s=fd(),s.refCount++,i.pooledCache=s,s.refCount++,y.memoizedState={element:f,isDehydrated:u,cache:s},md(y),i}function ab(i){return i?(i=Jo,i):Jo}function ub(i,s,u,f,m,y){m=ab(m),f.context===null?f.context=m:f.pendingContext=m,f=ei(s),f.payload={element:u},y=y===void 0?null:y,y!==null&&(f.callback=y),u=ti(i,f,s),u!==null&&(fn(u,i,s),pl(u,i,s))}function cb(i,s){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var u=i.retryLane;i.retryLane=u!==0&&u<s?u:s}}function _h(i,s){cb(i,s),(i=i.alternate)&&cb(i,s)}function fb(i){if(i.tag===13||i.tag===31){var s=Xi(i,67108864);s!==null&&fn(s,i,67108864),_h(i,67108864)}}function db(i){if(i.tag===13||i.tag===31){var s=xn();s=ct(s);var u=Xi(i,s);u!==null&&fn(u,i,s),_h(i,s)}}var Hu=!0;function aO(i,s,u,f){var m=I.T;I.T=null;var y=Q.p;try{Q.p=2,zh(i,s,u,f)}finally{Q.p=y,I.T=m}}function uO(i,s,u,f){var m=I.T;I.T=null;var y=Q.p;try{Q.p=8,zh(i,s,u,f)}finally{Q.p=y,I.T=m}}function zh(i,s,u,f){if(Hu){var m=jh(f);if(m===null)Sh(i,s,f,Uu,u),pb(i,f);else if(fO(m,i,s,u,f))f.stopPropagation();else if(pb(i,f),s&4&&-1<cO.indexOf(i)){for(;m!==null;){var y=Vo(m);if(y!==null)switch(y.tag){case 3:if(y=y.stateNode,y.current.memoizedState.isDehydrated){var w=An(y.pendingLanes);if(w!==0){var R=y;for(R.pendingLanes|=2,R.entangledLanes|=2;w;){var O=1<<31-Wt(w);R.entanglements[1]|=O,w&=~O}or(y),(qe&6)===0&&(Ru=Zt()+500,kl(0))}}break;case 31:case 13:R=Xi(y,2),R!==null&&fn(R,y,2),Au(),_h(y,2)}if(y=jh(f),y===null&&Sh(i,s,f,Uu,u),y===m)break;m=y}m!==null&&f.stopPropagation()}else Sh(i,s,f,null,u)}}function jh(i){return i=Bf(i),Lh(i)}var Uu=null;function Lh(i){if(Uu=null,i=Io(i),i!==null){var s=l(i);if(s===null)i=null;else{var u=s.tag;if(u===13){if(i=a(s),i!==null)return i;i=null}else if(u===31){if(i=c(s),i!==null)return i;i=null}else if(u===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;i=null}else s!==i&&(i=null)}}return Uu=i,null}function hb(i){switch(i){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(Da()){case _a:return 2;case za:return 8;case zo:case pr:return 32;case tr:return 268435456;default:return 32}default:return 32}}var Bh=!1,di=null,hi=null,pi=null,Bl=new Map,Il=new Map,mi=[],cO="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 pb(i,s){switch(i){case"focusin":case"focusout":di=null;break;case"dragenter":case"dragleave":hi=null;break;case"mouseover":case"mouseout":pi=null;break;case"pointerover":case"pointerout":Bl.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":Il.delete(s.pointerId)}}function Vl(i,s,u,f,m,y){return i===null||i.nativeEvent!==y?(i={blockedOn:s,domEventName:u,eventSystemFlags:f,nativeEvent:y,targetContainers:[m]},s!==null&&(s=Vo(s),s!==null&&fb(s)),i):(i.eventSystemFlags|=f,s=i.targetContainers,m!==null&&s.indexOf(m)===-1&&s.push(m),i)}function fO(i,s,u,f,m){switch(s){case"focusin":return di=Vl(di,i,s,u,f,m),!0;case"dragenter":return hi=Vl(hi,i,s,u,f,m),!0;case"mouseover":return pi=Vl(pi,i,s,u,f,m),!0;case"pointerover":var y=m.pointerId;return Bl.set(y,Vl(Bl.get(y)||null,i,s,u,f,m)),!0;case"gotpointercapture":return y=m.pointerId,Il.set(y,Vl(Il.get(y)||null,i,s,u,f,m)),!0}return!1}function mb(i){var s=Io(i.target);if(s!==null){var u=l(s);if(u!==null){if(s=u.tag,s===13){if(s=a(u),s!==null){i.blockedOn=s,Ba(i.priority,function(){db(u)});return}}else if(s===31){if(s=c(u),s!==null){i.blockedOn=s,Ba(i.priority,function(){db(u)});return}}else if(s===3&&u.stateNode.current.memoizedState.isDehydrated){i.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}i.blockedOn=null}function qu(i){if(i.blockedOn!==null)return!1;for(var s=i.targetContainers;0<s.length;){var u=jh(i.nativeEvent);if(u===null){u=i.nativeEvent;var f=new u.constructor(u.type,u);Lf=f,u.target.dispatchEvent(f),Lf=null}else return s=Vo(u),s!==null&&fb(s),i.blockedOn=u,!1;s.shift()}return!0}function gb(i,s,u){qu(i)&&u.delete(s)}function dO(){Bh=!1,di!==null&&qu(di)&&(di=null),hi!==null&&qu(hi)&&(hi=null),pi!==null&&qu(pi)&&(pi=null),Bl.forEach(gb),Il.forEach(gb)}function Gu(i,s){i.blockedOn===s&&(i.blockedOn=null,Bh||(Bh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,dO)))}var Ku=null;function yb(i){Ku!==i&&(Ku=i,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Ku===i&&(Ku=null);for(var s=0;s<i.length;s+=3){var u=i[s],f=i[s+1],m=i[s+2];if(typeof f!="function"){if(Lh(f||u)===null)continue;break}var y=Vo(u);y!==null&&(i.splice(s,3),s-=3,jd(y,{pending:!0,data:m,method:u.method,action:f},f,m))}}))}function xs(i){function s(O){return Gu(O,i)}di!==null&&Gu(di,i),hi!==null&&Gu(hi,i),pi!==null&&Gu(pi,i),Bl.forEach(s),Il.forEach(s);for(var u=0;u<mi.length;u++){var f=mi[u];f.blockedOn===i&&(f.blockedOn=null)}for(;0<mi.length&&(u=mi[0],u.blockedOn===null);)mb(u),u.blockedOn===null&&mi.shift();if(u=(i.ownerDocument||i).$$reactFormReplay,u!=null)for(f=0;f<u.length;f+=3){var m=u[f],y=u[f+1],w=m[on]||null;if(typeof y=="function")w||yb(u);else if(w){var R=null;if(y&&y.hasAttribute("formAction")){if(m=y,w=y[on]||null)R=w.formAction;else if(Lh(m)!==null)continue}else R=w.action;typeof R=="function"?u[f+1]=R:(u.splice(f,3),f-=3),yb(u)}}}function vb(){function i(y){y.canIntercept&&y.info==="react-transition"&&y.intercept({handler:function(){return new Promise(function(w){return m=w})},focusReset:"manual",scroll:"manual"})}function s(){m!==null&&(m(),m=null),f||setTimeout(u,20)}function u(){if(!f&&!navigation.transition){var y=navigation.currentEntry;y&&y.url!=null&&navigation.navigate(y.url,{state:y.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var f=!1,m=null;return navigation.addEventListener("navigate",i),navigation.addEventListener("navigatesuccess",s),navigation.addEventListener("navigateerror",s),setTimeout(u,100),function(){f=!0,navigation.removeEventListener("navigate",i),navigation.removeEventListener("navigatesuccess",s),navigation.removeEventListener("navigateerror",s),m!==null&&(m(),m=null)}}}function Ih(i){this._internalRoot=i}Yu.prototype.render=Ih.prototype.render=function(i){var s=this._internalRoot;if(s===null)throw Error(r(409));var u=s.current,f=xn();ub(u,f,i,s,null,null)},Yu.prototype.unmount=Ih.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var s=i.containerInfo;ub(i.current,2,null,i,null,null),Au(),s[Bo]=null}};function Yu(i){this._internalRoot=i}Yu.prototype.unstable_scheduleHydration=function(i){if(i){var s=Lo();i={blockedOn:null,target:i,priority:s};for(var u=0;u<mi.length&&s!==0&&s<mi[u].priority;u++);mi.splice(u,0,i),u===0&&mb(i)}};var bb=e.version;if(bb!=="19.2.4")throw Error(r(527,bb,"19.2.4"));Q.findDOMNode=function(i){var s=i._reactInternals;if(s===void 0)throw typeof i.render=="function"?Error(r(188)):(i=Object.keys(i).join(","),Error(r(268,i)));return i=h(s),i=i!==null?p(i):null,i=i===null?null:i.stateNode,i};var hO={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:I,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Xu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Xu.isDisabled&&Xu.supportsFiber)try{Ur=Xu.inject(hO),We=Xu}catch{}}return Pl.createRoot=function(i,s){if(!o(i))throw Error(r(299));var u=!1,f="",m=R0,y=T0,w=A0;return s!=null&&(s.unstable_strictMode===!0&&(u=!0),s.identifierPrefix!==void 0&&(f=s.identifierPrefix),s.onUncaughtError!==void 0&&(m=s.onUncaughtError),s.onCaughtError!==void 0&&(y=s.onCaughtError),s.onRecoverableError!==void 0&&(w=s.onRecoverableError)),s=lb(i,1,!1,null,null,u,f,null,m,y,w,vb),i[Bo]=s.current,bh(i),new Ih(s)},Pl.hydrateRoot=function(i,s,u){if(!o(i))throw Error(r(299));var f=!1,m="",y=R0,w=T0,R=A0,O=null;return u!=null&&(u.unstable_strictMode===!0&&(f=!0),u.identifierPrefix!==void 0&&(m=u.identifierPrefix),u.onUncaughtError!==void 0&&(y=u.onUncaughtError),u.onCaughtError!==void 0&&(w=u.onCaughtError),u.onRecoverableError!==void 0&&(R=u.onRecoverableError),u.formState!==void 0&&(O=u.formState)),s=lb(i,1,!0,s,u??null,f,m,O,y,w,R,vb),s.context=ab(null),u=s.current,f=xn(),f=ct(f),m=ei(f),m.callback=null,ti(u,m,f),u=f,s.current.lanes=u,Ce(s,u),or(s),i[Bo]=s.current,bh(i),new Yu(s)},Pl.version="19.2.4",Pl}var Ob;function CO(){if(Ob)return Ph.exports;Ob=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),Ph.exports=wO(),Ph.exports}var MO=CO();const h1=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim();const EO=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const RO=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,r)=>r?r.toUpperCase():n.toLowerCase());const kb=t=>{const e=RO(t);return e.charAt(0).toUpperCase()+e.slice(1)};var TO={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"};const AO=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1};const OO=M.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:l,iconNode:a,...c},d)=>M.createElement("svg",{ref:d,...TO,width:e,height:e,stroke:t,strokeWidth:r?Number(n)*24/Number(e):n,className:h1("lucide",o),...!l&&!AO(c)&&{"aria-hidden":"true"},...c},[...a.map(([h,p])=>M.createElement(h,p)),...Array.isArray(l)?l:[l]]));const Ue=(t,e)=>{const n=M.forwardRef(({className:r,...o},l)=>M.createElement(OO,{ref:l,iconNode:e,className:h1(`lucide-${EO(kb(t))}`,`lucide-${t}`,r),...o}));return n.displayName=kb(t),n};const kO=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],NO=Ue("arrow-down",kO);const DO=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],_O=Ue("arrow-up",DO);const zO=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}]],jO=Ue("ban",zO);const LO=[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]],BO=Ue("braces",LO);const IO=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]],VO=Ue("calendar-days",IO);const FO=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],qs=Ue("check",FO);const PO=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],$O=Ue("chevron-down",PO);const HO=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],p1=Ue("chevron-right",HO);const UO=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Em=Ue("circle-alert",UO);const qO=[["path",{d:"M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z",key:"kmsa83"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],GO=Ue("circle-play",qO);const KO=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]],YO=Ue("circle-stop",KO);const XO=[["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"}]],m1=Ue("copy",XO);const JO=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],$p=Ue("download",JO);const QO=[["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"}]],ZO=Ue("ellipsis",QO);const WO=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],ek=Ue("external-link",WO);const tk=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],g1=Ue("funnel",tk);const nk=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],rk=Ue("hash",nk);const ik=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],ok=Ue("info",ik);const sk=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]],lk=Ue("layout-grid",sk);const ak=[["path",{d:"M2 5h20",key:"1fs1ex"}],["path",{d:"M6 12h12",key:"8npq4p"}],["path",{d:"M9 19h6",key:"456am0"}]],uk=Ue("list-filter",ak);const ck=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],ef=Ue("loader-circle",ck);const fk=[["path",{d:"M5 12h14",key:"1ays0h"}]],dk=Ue("minus",fk);const hk=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],y1=Ue("moon",hk);const pk=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],mk=Ue("play",pk);const gk=[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]],yk=Ue("refresh-ccw",gk);const vk=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Rm=Ue("search",vk);const bk=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],v1=Ue("settings-2",bk);const Sk=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Nb=Ue("square-check",Sk);const xk=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],b1=Ue("sun",xk);const wk=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Ck=Ue("trash-2",wk);const Mk=[["path",{d:"M12 4v16",key:"1654pz"}],["path",{d:"M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2",key:"e0r10z"}],["path",{d:"M9 20h6",key:"s66wpe"}]],Ek=Ue("type",Mk);const Rk=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Tm=Ue("x",Rk);function Xn(t,e){return typeof t=="function"?t(e):t}function Rn(t,e){return n=>{e.setState(r=>({...r,[t]:Xn(n,r[t])}))}}function tf(t){return t instanceof Function}function Tk(t){return Array.isArray(t)&&t.every(e=>typeof e=="number")}function Ak(t,e){const n=[],r=o=>{o.forEach(l=>{n.push(l);const a=e(l);a!=null&&a.length&&r(a)})};return r(t),n}function Me(t,e,n){let r=[],o;return l=>{let a;n.key&&n.debug&&(a=Date.now());const c=t(l);if(!(c.length!==r.length||c.some((p,g)=>r[g]!==p)))return o;r=c;let h;if(n.key&&n.debug&&(h=Date.now()),o=e(...c),n==null||n.onChange==null||n.onChange(o),n.key&&n.debug&&n!=null&&n.debug()){const p=Math.round((Date.now()-a)*100)/100,g=Math.round((Date.now()-h)*100)/100,b=g/16,v=(S,x)=>{for(S=String(S);S.length<x;)S=" "+S;return S};console.info(`%c⏱ ${v(g,5)} /${v(p,5)} ms`,`
|
|
10
|
+
font-size: .6rem;
|
|
11
|
+
font-weight: bold;
|
|
12
|
+
color: hsl(${Math.max(0,Math.min(120-120*b,120))}deg 100% 31%);`,n?.key)}return o}}function Ee(t,e,n,r){return{debug:()=>{var o;return(o=t?.debugAll)!=null?o:t[e]},key:!1,onChange:r}}function Ok(t,e,n,r){const o=()=>{var a;return(a=l.getValue())!=null?a:t.options.renderFallbackValue},l={id:`${e.id}_${n.id}`,row:e,column:n,getValue:()=>e.getValue(r),renderValue:o,getContext:Me(()=>[t,n,e,l],(a,c,d,h)=>({table:a,column:c,row:d,cell:h,getValue:h.getValue,renderValue:h.renderValue}),Ee(t.options,"debugCells"))};return t._features.forEach(a=>{a.createCell==null||a.createCell(l,n,e,t)},{}),l}function kk(t,e,n,r){var o,l;const c={...t._getDefaultColumnDef(),...e},d=c.accessorKey;let h=(o=(l=c.id)!=null?l:d?typeof String.prototype.replaceAll=="function"?d.replaceAll(".","_"):d.replace(/\./g,"_"):void 0)!=null?o:typeof c.header=="string"?c.header:void 0,p;if(c.accessorFn?p=c.accessorFn:d&&(d.includes(".")?p=b=>{let v=b;for(const x of d.split(".")){var S;v=(S=v)==null?void 0:S[x]}return v}:p=b=>b[c.accessorKey]),!h)throw new Error;let g={id:`${String(h)}`,accessorFn:p,parent:r,depth:n,columnDef:c,columns:[],getFlatColumns:Me(()=>[!0],()=>{var b;return[g,...(b=g.columns)==null?void 0:b.flatMap(v=>v.getFlatColumns())]},Ee(t.options,"debugColumns")),getLeafColumns:Me(()=>[t._getOrderColumnsFn()],b=>{var v;if((v=g.columns)!=null&&v.length){let S=g.columns.flatMap(x=>x.getLeafColumns());return b(S)}return[g]},Ee(t.options,"debugColumns"))};for(const b of t._features)b.createColumn==null||b.createColumn(g,t);return g}const $t="debugHeaders";function Db(t,e,n){var r;let l={id:(r=n.id)!=null?r:e.id,column:e,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const a=[],c=d=>{d.subHeaders&&d.subHeaders.length&&d.subHeaders.map(c),a.push(d)};return c(l),a},getContext:()=>({table:t,header:l,column:e})};return t._features.forEach(a=>{a.createHeader==null||a.createHeader(l,t)}),l}const Nk={createTable:t=>{t.getHeaderGroups=Me(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,n,r,o)=>{var l,a;const c=(l=r?.map(g=>n.find(b=>b.id===g)).filter(Boolean))!=null?l:[],d=(a=o?.map(g=>n.find(b=>b.id===g)).filter(Boolean))!=null?a:[],h=n.filter(g=>!(r!=null&&r.includes(g.id))&&!(o!=null&&o.includes(g.id)));return Ju(e,[...c,...h,...d],t)},Ee(t.options,$t)),t.getCenterHeaderGroups=Me(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,n,r,o)=>(n=n.filter(l=>!(r!=null&&r.includes(l.id))&&!(o!=null&&o.includes(l.id))),Ju(e,n,t,"center")),Ee(t.options,$t)),t.getLeftHeaderGroups=Me(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left],(e,n,r)=>{var o;const l=(o=r?.map(a=>n.find(c=>c.id===a)).filter(Boolean))!=null?o:[];return Ju(e,l,t,"left")},Ee(t.options,$t)),t.getRightHeaderGroups=Me(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.right],(e,n,r)=>{var o;const l=(o=r?.map(a=>n.find(c=>c.id===a)).filter(Boolean))!=null?o:[];return Ju(e,l,t,"right")},Ee(t.options,$t)),t.getFooterGroups=Me(()=>[t.getHeaderGroups()],e=>[...e].reverse(),Ee(t.options,$t)),t.getLeftFooterGroups=Me(()=>[t.getLeftHeaderGroups()],e=>[...e].reverse(),Ee(t.options,$t)),t.getCenterFooterGroups=Me(()=>[t.getCenterHeaderGroups()],e=>[...e].reverse(),Ee(t.options,$t)),t.getRightFooterGroups=Me(()=>[t.getRightHeaderGroups()],e=>[...e].reverse(),Ee(t.options,$t)),t.getFlatHeaders=Me(()=>[t.getHeaderGroups()],e=>e.map(n=>n.headers).flat(),Ee(t.options,$t)),t.getLeftFlatHeaders=Me(()=>[t.getLeftHeaderGroups()],e=>e.map(n=>n.headers).flat(),Ee(t.options,$t)),t.getCenterFlatHeaders=Me(()=>[t.getCenterHeaderGroups()],e=>e.map(n=>n.headers).flat(),Ee(t.options,$t)),t.getRightFlatHeaders=Me(()=>[t.getRightHeaderGroups()],e=>e.map(n=>n.headers).flat(),Ee(t.options,$t)),t.getCenterLeafHeaders=Me(()=>[t.getCenterFlatHeaders()],e=>e.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Ee(t.options,$t)),t.getLeftLeafHeaders=Me(()=>[t.getLeftFlatHeaders()],e=>e.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Ee(t.options,$t)),t.getRightLeafHeaders=Me(()=>[t.getRightFlatHeaders()],e=>e.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Ee(t.options,$t)),t.getLeafHeaders=Me(()=>[t.getLeftHeaderGroups(),t.getCenterHeaderGroups(),t.getRightHeaderGroups()],(e,n,r)=>{var o,l,a,c,d,h;return[...(o=(l=e[0])==null?void 0:l.headers)!=null?o:[],...(a=(c=n[0])==null?void 0:c.headers)!=null?a:[],...(d=(h=r[0])==null?void 0:h.headers)!=null?d:[]].map(p=>p.getLeafHeaders()).flat()},Ee(t.options,$t))}};function Ju(t,e,n,r){var o,l;let a=0;const c=function(b,v){v===void 0&&(v=1),a=Math.max(a,v),b.filter(S=>S.getIsVisible()).forEach(S=>{var x;(x=S.columns)!=null&&x.length&&c(S.columns,v+1)},0)};c(t);let d=[];const h=(b,v)=>{const S={depth:v,id:[r,`${v}`].filter(Boolean).join("_"),headers:[]},x=[];b.forEach(C=>{const E=[...x].reverse()[0],A=C.column.depth===S.depth;let k,D=!1;if(A&&C.column.parent?k=C.column.parent:(k=C.column,D=!0),E&&E?.column===k)E.subHeaders.push(C);else{const L=Db(n,k,{id:[r,v,k.id,C?.id].filter(Boolean).join("_"),isPlaceholder:D,placeholderId:D?`${x.filter(H=>H.column===k).length}`:void 0,depth:v,index:x.length});L.subHeaders.push(C),x.push(L)}S.headers.push(C),C.headerGroup=S}),d.push(S),v>0&&h(x,v-1)},p=e.map((b,v)=>Db(n,b,{depth:a,index:v}));h(p,a-1),d.reverse();const g=b=>b.filter(S=>S.column.getIsVisible()).map(S=>{let x=0,C=0,E=[0];S.subHeaders&&S.subHeaders.length?(E=[],g(S.subHeaders).forEach(k=>{let{colSpan:D,rowSpan:L}=k;x+=D,E.push(L)})):x=1;const A=Math.min(...E);return C=C+A,S.colSpan=x,S.rowSpan=C,{colSpan:x,rowSpan:C}});return g((o=(l=d[0])==null?void 0:l.headers)!=null?o:[]),d}const Am=(t,e,n,r,o,l,a)=>{let c={id:e,index:r,original:n,depth:o,parentId:a,_valuesCache:{},_uniqueValuesCache:{},getValue:d=>{if(c._valuesCache.hasOwnProperty(d))return c._valuesCache[d];const h=t.getColumn(d);if(h!=null&&h.accessorFn)return c._valuesCache[d]=h.accessorFn(c.original,r),c._valuesCache[d]},getUniqueValues:d=>{if(c._uniqueValuesCache.hasOwnProperty(d))return c._uniqueValuesCache[d];const h=t.getColumn(d);if(h!=null&&h.accessorFn)return h.columnDef.getUniqueValues?(c._uniqueValuesCache[d]=h.columnDef.getUniqueValues(c.original,r),c._uniqueValuesCache[d]):(c._uniqueValuesCache[d]=[c.getValue(d)],c._uniqueValuesCache[d])},renderValue:d=>{var h;return(h=c.getValue(d))!=null?h:t.options.renderFallbackValue},subRows:[],getLeafRows:()=>Ak(c.subRows,d=>d.subRows),getParentRow:()=>c.parentId?t.getRow(c.parentId,!0):void 0,getParentRows:()=>{let d=[],h=c;for(;;){const p=h.getParentRow();if(!p)break;d.push(p),h=p}return d.reverse()},getAllCells:Me(()=>[t.getAllLeafColumns()],d=>d.map(h=>Ok(t,c,h,h.id)),Ee(t.options,"debugRows")),_getAllCellsByColumnId:Me(()=>[c.getAllCells()],d=>d.reduce((h,p)=>(h[p.column.id]=p,h),{}),Ee(t.options,"debugRows"))};for(let d=0;d<t._features.length;d++){const h=t._features[d];h==null||h.createRow==null||h.createRow(c,t)}return c},Dk={createColumn:(t,e)=>{t._getFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,t.id),t.getFacetedRowModel=()=>t._getFacetedRowModel?t._getFacetedRowModel():e.getPreFilteredRowModel(),t._getFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,t.id),t.getFacetedUniqueValues=()=>t._getFacetedUniqueValues?t._getFacetedUniqueValues():new Map,t._getFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,t.id),t.getFacetedMinMaxValues=()=>{if(t._getFacetedMinMaxValues)return t._getFacetedMinMaxValues()}}},S1=(t,e,n)=>{var r,o;const l=n==null||(r=n.toString())==null?void 0:r.toLowerCase();return!!(!((o=t.getValue(e))==null||(o=o.toString())==null||(o=o.toLowerCase())==null)&&o.includes(l))};S1.autoRemove=t=>Qn(t);const x1=(t,e,n)=>{var r;return!!(!((r=t.getValue(e))==null||(r=r.toString())==null)&&r.includes(n))};x1.autoRemove=t=>Qn(t);const w1=(t,e,n)=>{var r;return((r=t.getValue(e))==null||(r=r.toString())==null?void 0:r.toLowerCase())===n?.toLowerCase()};w1.autoRemove=t=>Qn(t);const C1=(t,e,n)=>{var r;return(r=t.getValue(e))==null?void 0:r.includes(n)};C1.autoRemove=t=>Qn(t);const M1=(t,e,n)=>!n.some(r=>{var o;return!((o=t.getValue(e))!=null&&o.includes(r))});M1.autoRemove=t=>Qn(t)||!(t!=null&&t.length);const E1=(t,e,n)=>n.some(r=>{var o;return(o=t.getValue(e))==null?void 0:o.includes(r)});E1.autoRemove=t=>Qn(t)||!(t!=null&&t.length);const R1=(t,e,n)=>t.getValue(e)===n;R1.autoRemove=t=>Qn(t);const T1=(t,e,n)=>t.getValue(e)==n;T1.autoRemove=t=>Qn(t);const Om=(t,e,n)=>{let[r,o]=n;const l=t.getValue(e);return l>=r&&l<=o};Om.resolveFilterValue=t=>{let[e,n]=t,r=typeof e!="number"?parseFloat(e):e,o=typeof n!="number"?parseFloat(n):n,l=e===null||Number.isNaN(r)?-1/0:r,a=n===null||Number.isNaN(o)?1/0:o;if(l>a){const c=l;l=a,a=c}return[l,a]};Om.autoRemove=t=>Qn(t)||Qn(t[0])&&Qn(t[1]);const jr={includesString:S1,includesStringSensitive:x1,equalsString:w1,arrIncludes:C1,arrIncludesAll:M1,arrIncludesSome:E1,equals:R1,weakEquals:T1,inNumberRange:Om};function Qn(t){return t==null||t===""}const _k={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:t=>({columnFilters:[],...t}),getDefaultOptions:t=>({onColumnFiltersChange:Rn("columnFilters",t),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(t,e)=>{t.getAutoFilterFn=()=>{const n=e.getCoreRowModel().flatRows[0],r=n?.getValue(t.id);return typeof r=="string"?jr.includesString:typeof r=="number"?jr.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?jr.equals:Array.isArray(r)?jr.arrIncludes:jr.weakEquals},t.getFilterFn=()=>{var n,r;return tf(t.columnDef.filterFn)?t.columnDef.filterFn:t.columnDef.filterFn==="auto"?t.getAutoFilterFn():(n=(r=e.options.filterFns)==null?void 0:r[t.columnDef.filterFn])!=null?n:jr[t.columnDef.filterFn]},t.getCanFilter=()=>{var n,r,o;return((n=t.columnDef.enableColumnFilter)!=null?n:!0)&&((r=e.options.enableColumnFilters)!=null?r:!0)&&((o=e.options.enableFilters)!=null?o:!0)&&!!t.accessorFn},t.getIsFiltered=()=>t.getFilterIndex()>-1,t.getFilterValue=()=>{var n;return(n=e.getState().columnFilters)==null||(n=n.find(r=>r.id===t.id))==null?void 0:n.value},t.getFilterIndex=()=>{var n,r;return(n=(r=e.getState().columnFilters)==null?void 0:r.findIndex(o=>o.id===t.id))!=null?n:-1},t.setFilterValue=n=>{e.setColumnFilters(r=>{const o=t.getFilterFn(),l=r?.find(p=>p.id===t.id),a=Xn(n,l?l.value:void 0);if(_b(o,a,t)){var c;return(c=r?.filter(p=>p.id!==t.id))!=null?c:[]}const d={id:t.id,value:a};if(l){var h;return(h=r?.map(p=>p.id===t.id?d:p))!=null?h:[]}return r!=null&&r.length?[...r,d]:[d]})}},createRow:(t,e)=>{t.columnFilters={},t.columnFiltersMeta={}},createTable:t=>{t.setColumnFilters=e=>{const n=t.getAllLeafColumns(),r=o=>{var l;return(l=Xn(e,o))==null?void 0:l.filter(a=>{const c=n.find(d=>d.id===a.id);if(c){const d=c.getFilterFn();if(_b(d,a.value,c))return!1}return!0})};t.options.onColumnFiltersChange==null||t.options.onColumnFiltersChange(r)},t.resetColumnFilters=e=>{var n,r;t.setColumnFilters(e?[]:(n=(r=t.initialState)==null?void 0:r.columnFilters)!=null?n:[])},t.getPreFilteredRowModel=()=>t.getCoreRowModel(),t.getFilteredRowModel=()=>(!t._getFilteredRowModel&&t.options.getFilteredRowModel&&(t._getFilteredRowModel=t.options.getFilteredRowModel(t)),t.options.manualFiltering||!t._getFilteredRowModel?t.getPreFilteredRowModel():t._getFilteredRowModel())}};function _b(t,e,n){return(t&&t.autoRemove?t.autoRemove(e,n):!1)||typeof e>"u"||typeof e=="string"&&!e}const zk=(t,e,n)=>n.reduce((r,o)=>{const l=o.getValue(t);return r+(typeof l=="number"?l:0)},0),jk=(t,e,n)=>{let r;return n.forEach(o=>{const l=o.getValue(t);l!=null&&(r>l||r===void 0&&l>=l)&&(r=l)}),r},Lk=(t,e,n)=>{let r;return n.forEach(o=>{const l=o.getValue(t);l!=null&&(r<l||r===void 0&&l>=l)&&(r=l)}),r},Bk=(t,e,n)=>{let r,o;return n.forEach(l=>{const a=l.getValue(t);a!=null&&(r===void 0?a>=a&&(r=o=a):(r>a&&(r=a),o<a&&(o=a)))}),[r,o]},Ik=(t,e)=>{let n=0,r=0;if(e.forEach(o=>{let l=o.getValue(t);l!=null&&(l=+l)>=l&&(++n,r+=l)}),n)return r/n},Vk=(t,e)=>{if(!e.length)return;const n=e.map(l=>l.getValue(t));if(!Tk(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),o=n.sort((l,a)=>l-a);return n.length%2!==0?o[r]:(o[r-1]+o[r])/2},Fk=(t,e)=>Array.from(new Set(e.map(n=>n.getValue(t))).values()),Pk=(t,e)=>new Set(e.map(n=>n.getValue(t))).size,$k=(t,e)=>e.length,qh={sum:zk,min:jk,max:Lk,extent:Bk,mean:Ik,median:Vk,unique:Fk,uniqueCount:Pk,count:$k},Hk={getDefaultColumnDef:()=>({aggregatedCell:t=>{var e,n;return(e=(n=t.getValue())==null||n.toString==null?void 0:n.toString())!=null?e:null},aggregationFn:"auto"}),getInitialState:t=>({grouping:[],...t}),getDefaultOptions:t=>({onGroupingChange:Rn("grouping",t),groupedColumnMode:"reorder"}),createColumn:(t,e)=>{t.toggleGrouping=()=>{e.setGrouping(n=>n!=null&&n.includes(t.id)?n.filter(r=>r!==t.id):[...n??[],t.id])},t.getCanGroup=()=>{var n,r;return((n=t.columnDef.enableGrouping)!=null?n:!0)&&((r=e.options.enableGrouping)!=null?r:!0)&&(!!t.accessorFn||!!t.columnDef.getGroupingValue)},t.getIsGrouped=()=>{var n;return(n=e.getState().grouping)==null?void 0:n.includes(t.id)},t.getGroupedIndex=()=>{var n;return(n=e.getState().grouping)==null?void 0:n.indexOf(t.id)},t.getToggleGroupingHandler=()=>{const n=t.getCanGroup();return()=>{n&&t.toggleGrouping()}},t.getAutoAggregationFn=()=>{const n=e.getCoreRowModel().flatRows[0],r=n?.getValue(t.id);if(typeof r=="number")return qh.sum;if(Object.prototype.toString.call(r)==="[object Date]")return qh.extent},t.getAggregationFn=()=>{var n,r;if(!t)throw new Error;return tf(t.columnDef.aggregationFn)?t.columnDef.aggregationFn:t.columnDef.aggregationFn==="auto"?t.getAutoAggregationFn():(n=(r=e.options.aggregationFns)==null?void 0:r[t.columnDef.aggregationFn])!=null?n:qh[t.columnDef.aggregationFn]}},createTable:t=>{t.setGrouping=e=>t.options.onGroupingChange==null?void 0:t.options.onGroupingChange(e),t.resetGrouping=e=>{var n,r;t.setGrouping(e?[]:(n=(r=t.initialState)==null?void 0:r.grouping)!=null?n:[])},t.getPreGroupedRowModel=()=>t.getFilteredRowModel(),t.getGroupedRowModel=()=>(!t._getGroupedRowModel&&t.options.getGroupedRowModel&&(t._getGroupedRowModel=t.options.getGroupedRowModel(t)),t.options.manualGrouping||!t._getGroupedRowModel?t.getPreGroupedRowModel():t._getGroupedRowModel())},createRow:(t,e)=>{t.getIsGrouped=()=>!!t.groupingColumnId,t.getGroupingValue=n=>{if(t._groupingValuesCache.hasOwnProperty(n))return t._groupingValuesCache[n];const r=e.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(t._groupingValuesCache[n]=r.columnDef.getGroupingValue(t.original),t._groupingValuesCache[n]):t.getValue(n)},t._groupingValuesCache={}},createCell:(t,e,n,r)=>{t.getIsGrouped=()=>e.getIsGrouped()&&e.id===n.groupingColumnId,t.getIsPlaceholder=()=>!t.getIsGrouped()&&e.getIsGrouped(),t.getIsAggregated=()=>{var o;return!t.getIsGrouped()&&!t.getIsPlaceholder()&&!!((o=n.subRows)!=null&&o.length)}}};function Uk(t,e,n){if(!(e!=null&&e.length)||!n)return t;const r=t.filter(l=>!e.includes(l.id));return n==="remove"?r:[...e.map(l=>t.find(a=>a.id===l)).filter(Boolean),...r]}const qk={getInitialState:t=>({columnOrder:[],...t}),getDefaultOptions:t=>({onColumnOrderChange:Rn("columnOrder",t)}),createColumn:(t,e)=>{t.getIndex=Me(n=>[Zl(e,n)],n=>n.findIndex(r=>r.id===t.id),Ee(e.options,"debugColumns")),t.getIsFirstColumn=n=>{var r;return((r=Zl(e,n)[0])==null?void 0:r.id)===t.id},t.getIsLastColumn=n=>{var r;const o=Zl(e,n);return((r=o[o.length-1])==null?void 0:r.id)===t.id}},createTable:t=>{t.setColumnOrder=e=>t.options.onColumnOrderChange==null?void 0:t.options.onColumnOrderChange(e),t.resetColumnOrder=e=>{var n;t.setColumnOrder(e?[]:(n=t.initialState.columnOrder)!=null?n:[])},t._getOrderColumnsFn=Me(()=>[t.getState().columnOrder,t.getState().grouping,t.options.groupedColumnMode],(e,n,r)=>o=>{let l=[];if(!(e!=null&&e.length))l=o;else{const a=[...e],c=[...o];for(;c.length&&a.length;){const d=a.shift(),h=c.findIndex(p=>p.id===d);h>-1&&l.push(c.splice(h,1)[0])}l=[...l,...c]}return Uk(l,n,r)},Ee(t.options,"debugTable"))}},Gh=()=>({left:[],right:[]}),Gk={getInitialState:t=>({columnPinning:Gh(),...t}),getDefaultOptions:t=>({onColumnPinningChange:Rn("columnPinning",t)}),createColumn:(t,e)=>{t.pin=n=>{const r=t.getLeafColumns().map(o=>o.id).filter(Boolean);e.setColumnPinning(o=>{var l,a;if(n==="right"){var c,d;return{left:((c=o?.left)!=null?c:[]).filter(g=>!(r!=null&&r.includes(g))),right:[...((d=o?.right)!=null?d:[]).filter(g=>!(r!=null&&r.includes(g))),...r]}}if(n==="left"){var h,p;return{left:[...((h=o?.left)!=null?h:[]).filter(g=>!(r!=null&&r.includes(g))),...r],right:((p=o?.right)!=null?p:[]).filter(g=>!(r!=null&&r.includes(g)))}}return{left:((l=o?.left)!=null?l:[]).filter(g=>!(r!=null&&r.includes(g))),right:((a=o?.right)!=null?a:[]).filter(g=>!(r!=null&&r.includes(g)))}})},t.getCanPin=()=>t.getLeafColumns().some(r=>{var o,l,a;return((o=r.columnDef.enablePinning)!=null?o:!0)&&((l=(a=e.options.enableColumnPinning)!=null?a:e.options.enablePinning)!=null?l:!0)}),t.getIsPinned=()=>{const n=t.getLeafColumns().map(c=>c.id),{left:r,right:o}=e.getState().columnPinning,l=n.some(c=>r?.includes(c)),a=n.some(c=>o?.includes(c));return l?"left":a?"right":!1},t.getPinnedIndex=()=>{var n,r;const o=t.getIsPinned();return o?(n=(r=e.getState().columnPinning)==null||(r=r[o])==null?void 0:r.indexOf(t.id))!=null?n:-1:0}},createRow:(t,e)=>{t.getCenterVisibleCells=Me(()=>[t._getAllVisibleCells(),e.getState().columnPinning.left,e.getState().columnPinning.right],(n,r,o)=>{const l=[...r??[],...o??[]];return n.filter(a=>!l.includes(a.column.id))},Ee(e.options,"debugRows")),t.getLeftVisibleCells=Me(()=>[t._getAllVisibleCells(),e.getState().columnPinning.left],(n,r)=>(r??[]).map(l=>n.find(a=>a.column.id===l)).filter(Boolean).map(l=>({...l,position:"left"})),Ee(e.options,"debugRows")),t.getRightVisibleCells=Me(()=>[t._getAllVisibleCells(),e.getState().columnPinning.right],(n,r)=>(r??[]).map(l=>n.find(a=>a.column.id===l)).filter(Boolean).map(l=>({...l,position:"right"})),Ee(e.options,"debugRows"))},createTable:t=>{t.setColumnPinning=e=>t.options.onColumnPinningChange==null?void 0:t.options.onColumnPinningChange(e),t.resetColumnPinning=e=>{var n,r;return t.setColumnPinning(e?Gh():(n=(r=t.initialState)==null?void 0:r.columnPinning)!=null?n:Gh())},t.getIsSomeColumnsPinned=e=>{var n;const r=t.getState().columnPinning;if(!e){var o,l;return!!((o=r.left)!=null&&o.length||(l=r.right)!=null&&l.length)}return!!((n=r[e])!=null&&n.length)},t.getLeftLeafColumns=Me(()=>[t.getAllLeafColumns(),t.getState().columnPinning.left],(e,n)=>(n??[]).map(r=>e.find(o=>o.id===r)).filter(Boolean),Ee(t.options,"debugColumns")),t.getRightLeafColumns=Me(()=>[t.getAllLeafColumns(),t.getState().columnPinning.right],(e,n)=>(n??[]).map(r=>e.find(o=>o.id===r)).filter(Boolean),Ee(t.options,"debugColumns")),t.getCenterLeafColumns=Me(()=>[t.getAllLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,n,r)=>{const o=[...n??[],...r??[]];return e.filter(l=>!o.includes(l.id))},Ee(t.options,"debugColumns"))}};function Kk(t){return t||(typeof document<"u"?document:null)}const Qu={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Kh=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),Yk={getDefaultColumnDef:()=>Qu,getInitialState:t=>({columnSizing:{},columnSizingInfo:Kh(),...t}),getDefaultOptions:t=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Rn("columnSizing",t),onColumnSizingInfoChange:Rn("columnSizingInfo",t)}),createColumn:(t,e)=>{t.getSize=()=>{var n,r,o;const l=e.getState().columnSizing[t.id];return Math.min(Math.max((n=t.columnDef.minSize)!=null?n:Qu.minSize,(r=l??t.columnDef.size)!=null?r:Qu.size),(o=t.columnDef.maxSize)!=null?o:Qu.maxSize)},t.getStart=Me(n=>[n,Zl(e,n),e.getState().columnSizing],(n,r)=>r.slice(0,t.getIndex(n)).reduce((o,l)=>o+l.getSize(),0),Ee(e.options,"debugColumns")),t.getAfter=Me(n=>[n,Zl(e,n),e.getState().columnSizing],(n,r)=>r.slice(t.getIndex(n)+1).reduce((o,l)=>o+l.getSize(),0),Ee(e.options,"debugColumns")),t.resetSize=()=>{e.setColumnSizing(n=>{let{[t.id]:r,...o}=n;return o})},t.getCanResize=()=>{var n,r;return((n=t.columnDef.enableResizing)!=null?n:!0)&&((r=e.options.enableColumnResizing)!=null?r:!0)},t.getIsResizing=()=>e.getState().columnSizingInfo.isResizingColumn===t.id},createHeader:(t,e)=>{t.getSize=()=>{let n=0;const r=o=>{if(o.subHeaders.length)o.subHeaders.forEach(r);else{var l;n+=(l=o.column.getSize())!=null?l:0}};return r(t),n},t.getStart=()=>{if(t.index>0){const n=t.headerGroup.headers[t.index-1];return n.getStart()+n.getSize()}return 0},t.getResizeHandler=n=>{const r=e.getColumn(t.column.id),o=r?.getCanResize();return l=>{if(!r||!o||(l.persist==null||l.persist(),Yh(l)&&l.touches&&l.touches.length>1))return;const a=t.getSize(),c=t?t.getLeafHeaders().map(E=>[E.column.id,E.column.getSize()]):[[r.id,r.getSize()]],d=Yh(l)?Math.round(l.touches[0].clientX):l.clientX,h={},p=(E,A)=>{typeof A=="number"&&(e.setColumnSizingInfo(k=>{var D,L;const H=e.options.columnResizeDirection==="rtl"?-1:1,z=(A-((D=k?.startOffset)!=null?D:0))*H,j=Math.max(z/((L=k?.startSize)!=null?L:0),-.999999);return k.columnSizingStart.forEach(J=>{let[le,ce]=J;h[le]=Math.round(Math.max(ce+ce*j,0)*100)/100}),{...k,deltaOffset:z,deltaPercentage:j}}),(e.options.columnResizeMode==="onChange"||E==="end")&&e.setColumnSizing(k=>({...k,...h})))},g=E=>p("move",E),b=E=>{p("end",E),e.setColumnSizingInfo(A=>({...A,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},v=Kk(n),S={moveHandler:E=>g(E.clientX),upHandler:E=>{v?.removeEventListener("mousemove",S.moveHandler),v?.removeEventListener("mouseup",S.upHandler),b(E.clientX)}},x={moveHandler:E=>(E.cancelable&&(E.preventDefault(),E.stopPropagation()),g(E.touches[0].clientX),!1),upHandler:E=>{var A;v?.removeEventListener("touchmove",x.moveHandler),v?.removeEventListener("touchend",x.upHandler),E.cancelable&&(E.preventDefault(),E.stopPropagation()),b((A=E.touches[0])==null?void 0:A.clientX)}},C=Xk()?{passive:!1}:!1;Yh(l)?(v?.addEventListener("touchmove",x.moveHandler,C),v?.addEventListener("touchend",x.upHandler,C)):(v?.addEventListener("mousemove",S.moveHandler,C),v?.addEventListener("mouseup",S.upHandler,C)),e.setColumnSizingInfo(E=>({...E,startOffset:d,startSize:a,deltaOffset:0,deltaPercentage:0,columnSizingStart:c,isResizingColumn:r.id}))}}},createTable:t=>{t.setColumnSizing=e=>t.options.onColumnSizingChange==null?void 0:t.options.onColumnSizingChange(e),t.setColumnSizingInfo=e=>t.options.onColumnSizingInfoChange==null?void 0:t.options.onColumnSizingInfoChange(e),t.resetColumnSizing=e=>{var n;t.setColumnSizing(e?{}:(n=t.initialState.columnSizing)!=null?n:{})},t.resetHeaderSizeInfo=e=>{var n;t.setColumnSizingInfo(e?Kh():(n=t.initialState.columnSizingInfo)!=null?n:Kh())},t.getTotalSize=()=>{var e,n;return(e=(n=t.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?e:0},t.getLeftTotalSize=()=>{var e,n;return(e=(n=t.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?e:0},t.getCenterTotalSize=()=>{var e,n;return(e=(n=t.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?e:0},t.getRightTotalSize=()=>{var e,n;return(e=(n=t.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?e:0}}};let Zu=null;function Xk(){if(typeof Zu=="boolean")return Zu;let t=!1;try{const e={get passive(){return t=!0,!1}},n=()=>{};window.addEventListener("test",n,e),window.removeEventListener("test",n)}catch{t=!1}return Zu=t,Zu}function Yh(t){return t.type==="touchstart"}const Jk={getInitialState:t=>({columnVisibility:{},...t}),getDefaultOptions:t=>({onColumnVisibilityChange:Rn("columnVisibility",t)}),createColumn:(t,e)=>{t.toggleVisibility=n=>{t.getCanHide()&&e.setColumnVisibility(r=>({...r,[t.id]:n??!t.getIsVisible()}))},t.getIsVisible=()=>{var n,r;const o=t.columns;return(n=o.length?o.some(l=>l.getIsVisible()):(r=e.getState().columnVisibility)==null?void 0:r[t.id])!=null?n:!0},t.getCanHide=()=>{var n,r;return((n=t.columnDef.enableHiding)!=null?n:!0)&&((r=e.options.enableHiding)!=null?r:!0)},t.getToggleVisibilityHandler=()=>n=>{t.toggleVisibility==null||t.toggleVisibility(n.target.checked)}},createRow:(t,e)=>{t._getAllVisibleCells=Me(()=>[t.getAllCells(),e.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),Ee(e.options,"debugRows")),t.getVisibleCells=Me(()=>[t.getLeftVisibleCells(),t.getCenterVisibleCells(),t.getRightVisibleCells()],(n,r,o)=>[...n,...r,...o],Ee(e.options,"debugRows"))},createTable:t=>{const e=(n,r)=>Me(()=>[r(),r().filter(o=>o.getIsVisible()).map(o=>o.id).join("_")],o=>o.filter(l=>l.getIsVisible==null?void 0:l.getIsVisible()),Ee(t.options,"debugColumns"));t.getVisibleFlatColumns=e("getVisibleFlatColumns",()=>t.getAllFlatColumns()),t.getVisibleLeafColumns=e("getVisibleLeafColumns",()=>t.getAllLeafColumns()),t.getLeftVisibleLeafColumns=e("getLeftVisibleLeafColumns",()=>t.getLeftLeafColumns()),t.getRightVisibleLeafColumns=e("getRightVisibleLeafColumns",()=>t.getRightLeafColumns()),t.getCenterVisibleLeafColumns=e("getCenterVisibleLeafColumns",()=>t.getCenterLeafColumns()),t.setColumnVisibility=n=>t.options.onColumnVisibilityChange==null?void 0:t.options.onColumnVisibilityChange(n),t.resetColumnVisibility=n=>{var r;t.setColumnVisibility(n?{}:(r=t.initialState.columnVisibility)!=null?r:{})},t.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!t.getIsAllColumnsVisible(),t.setColumnVisibility(t.getAllLeafColumns().reduce((o,l)=>({...o,[l.id]:n||!(l.getCanHide!=null&&l.getCanHide())}),{}))},t.getIsAllColumnsVisible=()=>!t.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),t.getIsSomeColumnsVisible=()=>t.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),t.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;t.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}};function Zl(t,e){return e?e==="center"?t.getCenterVisibleLeafColumns():e==="left"?t.getLeftVisibleLeafColumns():t.getRightVisibleLeafColumns():t.getVisibleLeafColumns()}const Qk={createTable:t=>{t._getGlobalFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,"__global__"),t.getGlobalFacetedRowModel=()=>t.options.manualFiltering||!t._getGlobalFacetedRowModel?t.getPreFilteredRowModel():t._getGlobalFacetedRowModel(),t._getGlobalFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,"__global__"),t.getGlobalFacetedUniqueValues=()=>t._getGlobalFacetedUniqueValues?t._getGlobalFacetedUniqueValues():new Map,t._getGlobalFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,"__global__"),t.getGlobalFacetedMinMaxValues=()=>{if(t._getGlobalFacetedMinMaxValues)return t._getGlobalFacetedMinMaxValues()}}},Zk={getInitialState:t=>({globalFilter:void 0,...t}),getDefaultOptions:t=>({onGlobalFilterChange:Rn("globalFilter",t),globalFilterFn:"auto",getColumnCanGlobalFilter:e=>{var n;const r=(n=t.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[e.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(t,e)=>{t.getCanGlobalFilter=()=>{var n,r,o,l;return((n=t.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=e.options.enableGlobalFilter)!=null?r:!0)&&((o=e.options.enableFilters)!=null?o:!0)&&((l=e.options.getColumnCanGlobalFilter==null?void 0:e.options.getColumnCanGlobalFilter(t))!=null?l:!0)&&!!t.accessorFn}},createTable:t=>{t.getGlobalAutoFilterFn=()=>jr.includesString,t.getGlobalFilterFn=()=>{var e,n;const{globalFilterFn:r}=t.options;return tf(r)?r:r==="auto"?t.getGlobalAutoFilterFn():(e=(n=t.options.filterFns)==null?void 0:n[r])!=null?e:jr[r]},t.setGlobalFilter=e=>{t.options.onGlobalFilterChange==null||t.options.onGlobalFilterChange(e)},t.resetGlobalFilter=e=>{t.setGlobalFilter(e?void 0:t.initialState.globalFilter)}}},Wk={getInitialState:t=>({expanded:{},...t}),getDefaultOptions:t=>({onExpandedChange:Rn("expanded",t),paginateExpandedRows:!0}),createTable:t=>{let e=!1,n=!1;t._autoResetExpanded=()=>{var r,o;if(!e){t._queue(()=>{e=!0});return}if((r=(o=t.options.autoResetAll)!=null?o:t.options.autoResetExpanded)!=null?r:!t.options.manualExpanding){if(n)return;n=!0,t._queue(()=>{t.resetExpanded(),n=!1})}},t.setExpanded=r=>t.options.onExpandedChange==null?void 0:t.options.onExpandedChange(r),t.toggleAllRowsExpanded=r=>{r??!t.getIsAllRowsExpanded()?t.setExpanded(!0):t.setExpanded({})},t.resetExpanded=r=>{var o,l;t.setExpanded(r?{}:(o=(l=t.initialState)==null?void 0:l.expanded)!=null?o:{})},t.getCanSomeRowsExpand=()=>t.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),t.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),t.toggleAllRowsExpanded()},t.getIsSomeRowsExpanded=()=>{const r=t.getState().expanded;return r===!0||Object.values(r).some(Boolean)},t.getIsAllRowsExpanded=()=>{const r=t.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||t.getRowModel().flatRows.some(o=>!o.getIsExpanded()))},t.getExpandedDepth=()=>{let r=0;return(t.getState().expanded===!0?Object.keys(t.getRowModel().rowsById):Object.keys(t.getState().expanded)).forEach(l=>{const a=l.split(".");r=Math.max(r,a.length)}),r},t.getPreExpandedRowModel=()=>t.getSortedRowModel(),t.getExpandedRowModel=()=>(!t._getExpandedRowModel&&t.options.getExpandedRowModel&&(t._getExpandedRowModel=t.options.getExpandedRowModel(t)),t.options.manualExpanding||!t._getExpandedRowModel?t.getPreExpandedRowModel():t._getExpandedRowModel())},createRow:(t,e)=>{t.toggleExpanded=n=>{e.setExpanded(r=>{var o;const l=r===!0?!0:!!(r!=null&&r[t.id]);let a={};if(r===!0?Object.keys(e.getRowModel().rowsById).forEach(c=>{a[c]=!0}):a=r,n=(o=n)!=null?o:!l,!l&&n)return{...a,[t.id]:!0};if(l&&!n){const{[t.id]:c,...d}=a;return d}return r})},t.getIsExpanded=()=>{var n;const r=e.getState().expanded;return!!((n=e.options.getIsRowExpanded==null?void 0:e.options.getIsRowExpanded(t))!=null?n:r===!0||r?.[t.id])},t.getCanExpand=()=>{var n,r,o;return(n=e.options.getRowCanExpand==null?void 0:e.options.getRowCanExpand(t))!=null?n:((r=e.options.enableExpanding)!=null?r:!0)&&!!((o=t.subRows)!=null&&o.length)},t.getIsAllParentsExpanded=()=>{let n=!0,r=t;for(;n&&r.parentId;)r=e.getRow(r.parentId,!0),n=r.getIsExpanded();return n},t.getToggleExpandedHandler=()=>{const n=t.getCanExpand();return()=>{n&&t.toggleExpanded()}}}},Hp=0,Up=10,Xh=()=>({pageIndex:Hp,pageSize:Up}),eN={getInitialState:t=>({...t,pagination:{...Xh(),...t?.pagination}}),getDefaultOptions:t=>({onPaginationChange:Rn("pagination",t)}),createTable:t=>{let e=!1,n=!1;t._autoResetPageIndex=()=>{var r,o;if(!e){t._queue(()=>{e=!0});return}if((r=(o=t.options.autoResetAll)!=null?o:t.options.autoResetPageIndex)!=null?r:!t.options.manualPagination){if(n)return;n=!0,t._queue(()=>{t.resetPageIndex(),n=!1})}},t.setPagination=r=>{const o=l=>Xn(r,l);return t.options.onPaginationChange==null?void 0:t.options.onPaginationChange(o)},t.resetPagination=r=>{var o;t.setPagination(r?Xh():(o=t.initialState.pagination)!=null?o:Xh())},t.setPageIndex=r=>{t.setPagination(o=>{let l=Xn(r,o.pageIndex);const a=typeof t.options.pageCount>"u"||t.options.pageCount===-1?Number.MAX_SAFE_INTEGER:t.options.pageCount-1;return l=Math.max(0,Math.min(l,a)),{...o,pageIndex:l}})},t.resetPageIndex=r=>{var o,l;t.setPageIndex(r?Hp:(o=(l=t.initialState)==null||(l=l.pagination)==null?void 0:l.pageIndex)!=null?o:Hp)},t.resetPageSize=r=>{var o,l;t.setPageSize(r?Up:(o=(l=t.initialState)==null||(l=l.pagination)==null?void 0:l.pageSize)!=null?o:Up)},t.setPageSize=r=>{t.setPagination(o=>{const l=Math.max(1,Xn(r,o.pageSize)),a=o.pageSize*o.pageIndex,c=Math.floor(a/l);return{...o,pageIndex:c,pageSize:l}})},t.setPageCount=r=>t.setPagination(o=>{var l;let a=Xn(r,(l=t.options.pageCount)!=null?l:-1);return typeof a=="number"&&(a=Math.max(-1,a)),{...o,pageCount:a}}),t.getPageOptions=Me(()=>[t.getPageCount()],r=>{let o=[];return r&&r>0&&(o=[...new Array(r)].fill(null).map((l,a)=>a)),o},Ee(t.options,"debugTable")),t.getCanPreviousPage=()=>t.getState().pagination.pageIndex>0,t.getCanNextPage=()=>{const{pageIndex:r}=t.getState().pagination,o=t.getPageCount();return o===-1?!0:o===0?!1:r<o-1},t.previousPage=()=>t.setPageIndex(r=>r-1),t.nextPage=()=>t.setPageIndex(r=>r+1),t.firstPage=()=>t.setPageIndex(0),t.lastPage=()=>t.setPageIndex(t.getPageCount()-1),t.getPrePaginationRowModel=()=>t.getExpandedRowModel(),t.getPaginationRowModel=()=>(!t._getPaginationRowModel&&t.options.getPaginationRowModel&&(t._getPaginationRowModel=t.options.getPaginationRowModel(t)),t.options.manualPagination||!t._getPaginationRowModel?t.getPrePaginationRowModel():t._getPaginationRowModel()),t.getPageCount=()=>{var r;return(r=t.options.pageCount)!=null?r:Math.ceil(t.getRowCount()/t.getState().pagination.pageSize)},t.getRowCount=()=>{var r;return(r=t.options.rowCount)!=null?r:t.getPrePaginationRowModel().rows.length}}},Jh=()=>({top:[],bottom:[]}),tN={getInitialState:t=>({rowPinning:Jh(),...t}),getDefaultOptions:t=>({onRowPinningChange:Rn("rowPinning",t)}),createRow:(t,e)=>{t.pin=(n,r,o)=>{const l=r?t.getLeafRows().map(d=>{let{id:h}=d;return h}):[],a=o?t.getParentRows().map(d=>{let{id:h}=d;return h}):[],c=new Set([...a,t.id,...l]);e.setRowPinning(d=>{var h,p;if(n==="bottom"){var g,b;return{top:((g=d?.top)!=null?g:[]).filter(x=>!(c!=null&&c.has(x))),bottom:[...((b=d?.bottom)!=null?b:[]).filter(x=>!(c!=null&&c.has(x))),...Array.from(c)]}}if(n==="top"){var v,S;return{top:[...((v=d?.top)!=null?v:[]).filter(x=>!(c!=null&&c.has(x))),...Array.from(c)],bottom:((S=d?.bottom)!=null?S:[]).filter(x=>!(c!=null&&c.has(x)))}}return{top:((h=d?.top)!=null?h:[]).filter(x=>!(c!=null&&c.has(x))),bottom:((p=d?.bottom)!=null?p:[]).filter(x=>!(c!=null&&c.has(x)))}})},t.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:o}=e.options;return typeof r=="function"?r(t):(n=r??o)!=null?n:!0},t.getIsPinned=()=>{const n=[t.id],{top:r,bottom:o}=e.getState().rowPinning,l=n.some(c=>r?.includes(c)),a=n.some(c=>o?.includes(c));return l?"top":a?"bottom":!1},t.getPinnedIndex=()=>{var n,r;const o=t.getIsPinned();if(!o)return-1;const l=(n=o==="top"?e.getTopRows():e.getBottomRows())==null?void 0:n.map(a=>{let{id:c}=a;return c});return(r=l?.indexOf(t.id))!=null?r:-1}},createTable:t=>{t.setRowPinning=e=>t.options.onRowPinningChange==null?void 0:t.options.onRowPinningChange(e),t.resetRowPinning=e=>{var n,r;return t.setRowPinning(e?Jh():(n=(r=t.initialState)==null?void 0:r.rowPinning)!=null?n:Jh())},t.getIsSomeRowsPinned=e=>{var n;const r=t.getState().rowPinning;if(!e){var o,l;return!!((o=r.top)!=null&&o.length||(l=r.bottom)!=null&&l.length)}return!!((n=r[e])!=null&&n.length)},t._getPinnedRows=(e,n,r)=>{var o;return((o=t.options.keepPinnedRows)==null||o?(n??[]).map(a=>{const c=t.getRow(a,!0);return c.getIsAllParentsExpanded()?c:null}):(n??[]).map(a=>e.find(c=>c.id===a))).filter(Boolean).map(a=>({...a,position:r}))},t.getTopRows=Me(()=>[t.getRowModel().rows,t.getState().rowPinning.top],(e,n)=>t._getPinnedRows(e,n,"top"),Ee(t.options,"debugRows")),t.getBottomRows=Me(()=>[t.getRowModel().rows,t.getState().rowPinning.bottom],(e,n)=>t._getPinnedRows(e,n,"bottom"),Ee(t.options,"debugRows")),t.getCenterRows=Me(()=>[t.getRowModel().rows,t.getState().rowPinning.top,t.getState().rowPinning.bottom],(e,n,r)=>{const o=new Set([...n??[],...r??[]]);return e.filter(l=>!o.has(l.id))},Ee(t.options,"debugRows"))}},nN={getInitialState:t=>({rowSelection:{},...t}),getDefaultOptions:t=>({onRowSelectionChange:Rn("rowSelection",t),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:t=>{t.setRowSelection=e=>t.options.onRowSelectionChange==null?void 0:t.options.onRowSelectionChange(e),t.resetRowSelection=e=>{var n;return t.setRowSelection(e?{}:(n=t.initialState.rowSelection)!=null?n:{})},t.toggleAllRowsSelected=e=>{t.setRowSelection(n=>{e=typeof e<"u"?e:!t.getIsAllRowsSelected();const r={...n},o=t.getPreGroupedRowModel().flatRows;return e?o.forEach(l=>{l.getCanSelect()&&(r[l.id]=!0)}):o.forEach(l=>{delete r[l.id]}),r})},t.toggleAllPageRowsSelected=e=>t.setRowSelection(n=>{const r=typeof e<"u"?e:!t.getIsAllPageRowsSelected(),o={...n};return t.getRowModel().rows.forEach(l=>{qp(o,l.id,r,!0,t)}),o}),t.getPreSelectedRowModel=()=>t.getCoreRowModel(),t.getSelectedRowModel=Me(()=>[t.getState().rowSelection,t.getCoreRowModel()],(e,n)=>Object.keys(e).length?Qh(t,n):{rows:[],flatRows:[],rowsById:{}},Ee(t.options,"debugTable")),t.getFilteredSelectedRowModel=Me(()=>[t.getState().rowSelection,t.getFilteredRowModel()],(e,n)=>Object.keys(e).length?Qh(t,n):{rows:[],flatRows:[],rowsById:{}},Ee(t.options,"debugTable")),t.getGroupedSelectedRowModel=Me(()=>[t.getState().rowSelection,t.getSortedRowModel()],(e,n)=>Object.keys(e).length?Qh(t,n):{rows:[],flatRows:[],rowsById:{}},Ee(t.options,"debugTable")),t.getIsAllRowsSelected=()=>{const e=t.getFilteredRowModel().flatRows,{rowSelection:n}=t.getState();let r=!!(e.length&&Object.keys(n).length);return r&&e.some(o=>o.getCanSelect()&&!n[o.id])&&(r=!1),r},t.getIsAllPageRowsSelected=()=>{const e=t.getPaginationRowModel().flatRows.filter(o=>o.getCanSelect()),{rowSelection:n}=t.getState();let r=!!e.length;return r&&e.some(o=>!n[o.id])&&(r=!1),r},t.getIsSomeRowsSelected=()=>{var e;const n=Object.keys((e=t.getState().rowSelection)!=null?e:{}).length;return n>0&&n<t.getFilteredRowModel().flatRows.length},t.getIsSomePageRowsSelected=()=>{const e=t.getPaginationRowModel().flatRows;return t.getIsAllPageRowsSelected()?!1:e.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},t.getToggleAllRowsSelectedHandler=()=>e=>{t.toggleAllRowsSelected(e.target.checked)},t.getToggleAllPageRowsSelectedHandler=()=>e=>{t.toggleAllPageRowsSelected(e.target.checked)}},createRow:(t,e)=>{t.toggleSelected=(n,r)=>{const o=t.getIsSelected();e.setRowSelection(l=>{var a;if(n=typeof n<"u"?n:!o,t.getCanSelect()&&o===n)return l;const c={...l};return qp(c,t.id,n,(a=r?.selectChildren)!=null?a:!0,e),c})},t.getIsSelected=()=>{const{rowSelection:n}=e.getState();return km(t,n)},t.getIsSomeSelected=()=>{const{rowSelection:n}=e.getState();return Gp(t,n)==="some"},t.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=e.getState();return Gp(t,n)==="all"},t.getCanSelect=()=>{var n;return typeof e.options.enableRowSelection=="function"?e.options.enableRowSelection(t):(n=e.options.enableRowSelection)!=null?n:!0},t.getCanSelectSubRows=()=>{var n;return typeof e.options.enableSubRowSelection=="function"?e.options.enableSubRowSelection(t):(n=e.options.enableSubRowSelection)!=null?n:!0},t.getCanMultiSelect=()=>{var n;return typeof e.options.enableMultiRowSelection=="function"?e.options.enableMultiRowSelection(t):(n=e.options.enableMultiRowSelection)!=null?n:!0},t.getToggleSelectedHandler=()=>{const n=t.getCanSelect();return r=>{var o;n&&t.toggleSelected((o=r.target)==null?void 0:o.checked)}}}},qp=(t,e,n,r,o)=>{var l;const a=o.getRow(e,!0);n?(a.getCanMultiSelect()||Object.keys(t).forEach(c=>delete t[c]),a.getCanSelect()&&(t[e]=!0)):delete t[e],r&&(l=a.subRows)!=null&&l.length&&a.getCanSelectSubRows()&&a.subRows.forEach(c=>qp(t,c.id,n,r,o))};function Qh(t,e){const n=t.getState().rowSelection,r=[],o={},l=function(a,c){return a.map(d=>{var h;const p=km(d,n);if(p&&(r.push(d),o[d.id]=d),(h=d.subRows)!=null&&h.length&&(d={...d,subRows:l(d.subRows)}),p)return d}).filter(Boolean)};return{rows:l(e.rows),flatRows:r,rowsById:o}}function km(t,e){var n;return(n=e[t.id])!=null?n:!1}function Gp(t,e,n){var r;if(!((r=t.subRows)!=null&&r.length))return!1;let o=!0,l=!1;return t.subRows.forEach(a=>{if(!(l&&!o)&&(a.getCanSelect()&&(km(a,e)?l=!0:o=!1),a.subRows&&a.subRows.length)){const c=Gp(a,e);c==="all"?l=!0:(c==="some"&&(l=!0),o=!1)}}),o?"all":l?"some":!1}const Kp=/([0-9]+)/gm,rN=(t,e,n)=>A1(Di(t.getValue(n)).toLowerCase(),Di(e.getValue(n)).toLowerCase()),iN=(t,e,n)=>A1(Di(t.getValue(n)),Di(e.getValue(n))),oN=(t,e,n)=>Nm(Di(t.getValue(n)).toLowerCase(),Di(e.getValue(n)).toLowerCase()),sN=(t,e,n)=>Nm(Di(t.getValue(n)),Di(e.getValue(n))),lN=(t,e,n)=>{const r=t.getValue(n),o=e.getValue(n);return r>o?1:r<o?-1:0},aN=(t,e,n)=>Nm(t.getValue(n),e.getValue(n));function Nm(t,e){return t===e?0:t>e?1:-1}function Di(t){return typeof t=="number"?isNaN(t)||t===1/0||t===-1/0?"":String(t):typeof t=="string"?t:""}function A1(t,e){const n=t.split(Kp).filter(Boolean),r=e.split(Kp).filter(Boolean);for(;n.length&&r.length;){const o=n.shift(),l=r.shift(),a=parseInt(o,10),c=parseInt(l,10),d=[a,c].sort();if(isNaN(d[0])){if(o>l)return 1;if(l>o)return-1;continue}if(isNaN(d[1]))return isNaN(a)?-1:1;if(a>c)return 1;if(c>a)return-1}return n.length-r.length}const $l={alphanumeric:rN,alphanumericCaseSensitive:iN,text:oN,textCaseSensitive:sN,datetime:lN,basic:aN},uN={getInitialState:t=>({sorting:[],...t}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:t=>({onSortingChange:Rn("sorting",t),isMultiSortEvent:e=>e.shiftKey}),createColumn:(t,e)=>{t.getAutoSortingFn=()=>{const n=e.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const o of n){const l=o?.getValue(t.id);if(Object.prototype.toString.call(l)==="[object Date]")return $l.datetime;if(typeof l=="string"&&(r=!0,l.split(Kp).length>1))return $l.alphanumeric}return r?$l.text:$l.basic},t.getAutoSortDir=()=>{const n=e.getFilteredRowModel().flatRows[0];return typeof n?.getValue(t.id)=="string"?"asc":"desc"},t.getSortingFn=()=>{var n,r;if(!t)throw new Error;return tf(t.columnDef.sortingFn)?t.columnDef.sortingFn:t.columnDef.sortingFn==="auto"?t.getAutoSortingFn():(n=(r=e.options.sortingFns)==null?void 0:r[t.columnDef.sortingFn])!=null?n:$l[t.columnDef.sortingFn]},t.toggleSorting=(n,r)=>{const o=t.getNextSortingOrder(),l=typeof n<"u"&&n!==null;e.setSorting(a=>{const c=a?.find(v=>v.id===t.id),d=a?.findIndex(v=>v.id===t.id);let h=[],p,g=l?n:o==="desc";if(a!=null&&a.length&&t.getCanMultiSort()&&r?c?p="toggle":p="add":a!=null&&a.length&&d!==a.length-1?p="replace":c?p="toggle":p="replace",p==="toggle"&&(l||o||(p="remove")),p==="add"){var b;h=[...a,{id:t.id,desc:g}],h.splice(0,h.length-((b=e.options.maxMultiSortColCount)!=null?b:Number.MAX_SAFE_INTEGER))}else p==="toggle"?h=a.map(v=>v.id===t.id?{...v,desc:g}:v):p==="remove"?h=a.filter(v=>v.id!==t.id):h=[{id:t.id,desc:g}];return h})},t.getFirstSortDir=()=>{var n,r;return((n=(r=t.columnDef.sortDescFirst)!=null?r:e.options.sortDescFirst)!=null?n:t.getAutoSortDir()==="desc")?"desc":"asc"},t.getNextSortingOrder=n=>{var r,o;const l=t.getFirstSortDir(),a=t.getIsSorted();return a?a!==l&&((r=e.options.enableSortingRemoval)==null||r)&&(!(n&&(o=e.options.enableMultiRemove)!=null)||o)?!1:a==="desc"?"asc":"desc":l},t.getCanSort=()=>{var n,r;return((n=t.columnDef.enableSorting)!=null?n:!0)&&((r=e.options.enableSorting)!=null?r:!0)&&!!t.accessorFn},t.getCanMultiSort=()=>{var n,r;return(n=(r=t.columnDef.enableMultiSort)!=null?r:e.options.enableMultiSort)!=null?n:!!t.accessorFn},t.getIsSorted=()=>{var n;const r=(n=e.getState().sorting)==null?void 0:n.find(o=>o.id===t.id);return r?r.desc?"desc":"asc":!1},t.getSortIndex=()=>{var n,r;return(n=(r=e.getState().sorting)==null?void 0:r.findIndex(o=>o.id===t.id))!=null?n:-1},t.clearSorting=()=>{e.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==t.id):[])},t.getToggleSortingHandler=()=>{const n=t.getCanSort();return r=>{n&&(r.persist==null||r.persist(),t.toggleSorting==null||t.toggleSorting(void 0,t.getCanMultiSort()?e.options.isMultiSortEvent==null?void 0:e.options.isMultiSortEvent(r):!1))}}},createTable:t=>{t.setSorting=e=>t.options.onSortingChange==null?void 0:t.options.onSortingChange(e),t.resetSorting=e=>{var n,r;t.setSorting(e?[]:(n=(r=t.initialState)==null?void 0:r.sorting)!=null?n:[])},t.getPreSortedRowModel=()=>t.getGroupedRowModel(),t.getSortedRowModel=()=>(!t._getSortedRowModel&&t.options.getSortedRowModel&&(t._getSortedRowModel=t.options.getSortedRowModel(t)),t.options.manualSorting||!t._getSortedRowModel?t.getPreSortedRowModel():t._getSortedRowModel())}},cN=[Nk,Jk,qk,Gk,Dk,_k,Qk,Zk,uN,Hk,Wk,eN,tN,nN,Yk];function fN(t){var e,n;const r=[...cN,...(e=t._features)!=null?e:[]];let o={_features:r};const l=o._features.reduce((b,v)=>Object.assign(b,v.getDefaultOptions==null?void 0:v.getDefaultOptions(o)),{}),a=b=>o.options.mergeOptions?o.options.mergeOptions(l,b):{...l,...b};let d={...{},...(n=t.initialState)!=null?n:{}};o._features.forEach(b=>{var v;d=(v=b.getInitialState==null?void 0:b.getInitialState(d))!=null?v:d});const h=[];let p=!1;const g={_features:r,options:{...l,...t},initialState:d,_queue:b=>{h.push(b),p||(p=!0,Promise.resolve().then(()=>{for(;h.length;)h.shift()();p=!1}).catch(v=>setTimeout(()=>{throw v})))},reset:()=>{o.setState(o.initialState)},setOptions:b=>{const v=Xn(b,o.options);o.options=a(v)},getState:()=>o.options.state,setState:b=>{o.options.onStateChange==null||o.options.onStateChange(b)},_getRowId:(b,v,S)=>{var x;return(x=o.options.getRowId==null?void 0:o.options.getRowId(b,v,S))!=null?x:`${S?[S.id,v].join("."):v}`},getCoreRowModel:()=>(o._getCoreRowModel||(o._getCoreRowModel=o.options.getCoreRowModel(o)),o._getCoreRowModel()),getRowModel:()=>o.getPaginationRowModel(),getRow:(b,v)=>{let S=(v?o.getPrePaginationRowModel():o.getRowModel()).rowsById[b];if(!S&&(S=o.getCoreRowModel().rowsById[b],!S))throw new Error;return S},_getDefaultColumnDef:Me(()=>[o.options.defaultColumn],b=>{var v;return b=(v=b)!=null?v:{},{header:S=>{const x=S.header.column.columnDef;return x.accessorKey?x.accessorKey:x.accessorFn?x.id:null},cell:S=>{var x,C;return(x=(C=S.renderValue())==null||C.toString==null?void 0:C.toString())!=null?x:null},...o._features.reduce((S,x)=>Object.assign(S,x.getDefaultColumnDef==null?void 0:x.getDefaultColumnDef()),{}),...b}},Ee(t,"debugColumns")),_getColumnDefs:()=>o.options.columns,getAllColumns:Me(()=>[o._getColumnDefs()],b=>{const v=function(S,x,C){return C===void 0&&(C=0),S.map(E=>{const A=kk(o,E,C,x),k=E;return A.columns=k.columns?v(k.columns,A,C+1):[],A})};return v(b)},Ee(t,"debugColumns")),getAllFlatColumns:Me(()=>[o.getAllColumns()],b=>b.flatMap(v=>v.getFlatColumns()),Ee(t,"debugColumns")),_getAllFlatColumnsById:Me(()=>[o.getAllFlatColumns()],b=>b.reduce((v,S)=>(v[S.id]=S,v),{}),Ee(t,"debugColumns")),getAllLeafColumns:Me(()=>[o.getAllColumns(),o._getOrderColumnsFn()],(b,v)=>{let S=b.flatMap(x=>x.getLeafColumns());return v(S)},Ee(t,"debugColumns")),getColumn:b=>o._getAllFlatColumnsById()[b]};Object.assign(o,g);for(let b=0;b<o._features.length;b++){const v=o._features[b];v==null||v.createTable==null||v.createTable(o)}return o}function dN(){return t=>Me(()=>[t.options.data],e=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(o,l,a){l===void 0&&(l=0);const c=[];for(let h=0;h<o.length;h++){const p=Am(t,t._getRowId(o[h],h,a),o[h],h,l,void 0,a?.id);if(n.flatRows.push(p),n.rowsById[p.id]=p,c.push(p),t.options.getSubRows){var d;p.originalSubRows=t.options.getSubRows(o[h],h),(d=p.originalSubRows)!=null&&d.length&&(p.subRows=r(p.originalSubRows,l+1,p))}}return c};return n.rows=r(e),n},Ee(t.options,"debugTable","getRowModel",()=>t._autoResetPageIndex()))}function hN(t,e,n){return n.options.filterFromLeafRows?pN(t,e,n):mN(t,e,n)}function pN(t,e,n){var r;const o=[],l={},a=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,c=function(d,h){h===void 0&&(h=0);const p=[];for(let b=0;b<d.length;b++){var g;let v=d[b];const S=Am(n,v.id,v.original,v.index,v.depth,void 0,v.parentId);if(S.columnFilters=v.columnFilters,(g=v.subRows)!=null&&g.length&&h<a){if(S.subRows=c(v.subRows,h+1),v=S,e(v)&&!S.subRows.length){p.push(v),l[v.id]=v,o.push(v);continue}if(e(v)||S.subRows.length){p.push(v),l[v.id]=v,o.push(v);continue}}else v=S,e(v)&&(p.push(v),l[v.id]=v,o.push(v))}return p};return{rows:c(t),flatRows:o,rowsById:l}}function mN(t,e,n){var r;const o=[],l={},a=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,c=function(d,h){h===void 0&&(h=0);const p=[];for(let b=0;b<d.length;b++){let v=d[b];if(e(v)){var g;if((g=v.subRows)!=null&&g.length&&h<a){const x=Am(n,v.id,v.original,v.index,v.depth,void 0,v.parentId);x.subRows=c(v.subRows,h+1),v=x}p.push(v),o.push(v),l[v.id]=v}}return p};return{rows:c(t),flatRows:o,rowsById:l}}function gN(){return t=>Me(()=>[t.getPreFilteredRowModel(),t.getState().columnFilters,t.getState().globalFilter],(e,n,r)=>{if(!e.rows.length||!(n!=null&&n.length)&&!r){for(let b=0;b<e.flatRows.length;b++)e.flatRows[b].columnFilters={},e.flatRows[b].columnFiltersMeta={};return e}const o=[],l=[];(n??[]).forEach(b=>{var v;const S=t.getColumn(b.id);if(!S)return;const x=S.getFilterFn();x&&o.push({id:b.id,filterFn:x,resolvedValue:(v=x.resolveFilterValue==null?void 0:x.resolveFilterValue(b.value))!=null?v:b.value})});const a=(n??[]).map(b=>b.id),c=t.getGlobalFilterFn(),d=t.getAllLeafColumns().filter(b=>b.getCanGlobalFilter());r&&c&&d.length&&(a.push("__global__"),d.forEach(b=>{var v;l.push({id:b.id,filterFn:c,resolvedValue:(v=c.resolveFilterValue==null?void 0:c.resolveFilterValue(r))!=null?v:r})}));let h,p;for(let b=0;b<e.flatRows.length;b++){const v=e.flatRows[b];if(v.columnFilters={},o.length)for(let S=0;S<o.length;S++){h=o[S];const x=h.id;v.columnFilters[x]=h.filterFn(v,x,h.resolvedValue,C=>{v.columnFiltersMeta[x]=C})}if(l.length){for(let S=0;S<l.length;S++){p=l[S];const x=p.id;if(p.filterFn(v,x,p.resolvedValue,C=>{v.columnFiltersMeta[x]=C})){v.columnFilters.__global__=!0;break}}v.columnFilters.__global__!==!0&&(v.columnFilters.__global__=!1)}}const g=b=>{for(let v=0;v<a.length;v++)if(b.columnFilters[a[v]]===!1)return!1;return!0};return hN(e.rows,g,t)},Ee(t.options,"debugTable","getFilteredRowModel",()=>t._autoResetPageIndex()))}function yN(){return t=>Me(()=>[t.getState().sorting,t.getPreSortedRowModel()],(e,n)=>{if(!n.rows.length||!(e!=null&&e.length))return n;const r=t.getState().sorting,o=[],l=r.filter(d=>{var h;return(h=t.getColumn(d.id))==null?void 0:h.getCanSort()}),a={};l.forEach(d=>{const h=t.getColumn(d.id);h&&(a[d.id]={sortUndefined:h.columnDef.sortUndefined,invertSorting:h.columnDef.invertSorting,sortingFn:h.getSortingFn()})});const c=d=>{const h=d.map(p=>({...p}));return h.sort((p,g)=>{for(let v=0;v<l.length;v+=1){var b;const S=l[v],x=a[S.id],C=x.sortUndefined,E=(b=S?.desc)!=null?b:!1;let A=0;if(C){const k=p.getValue(S.id),D=g.getValue(S.id),L=k===void 0,H=D===void 0;if(L||H){if(C==="first")return L?-1:1;if(C==="last")return L?1:-1;A=L&&H?0:L?C:-C}}if(A===0&&(A=x.sortingFn(p,g,S.id)),A!==0)return E&&(A*=-1),x.invertSorting&&(A*=-1),A}return p.index-g.index}),h.forEach(p=>{var g;o.push(p),(g=p.subRows)!=null&&g.length&&(p.subRows=c(p.subRows))}),h};return{rows:c(n.rows),flatRows:o,rowsById:n.rowsById}},Ee(t.options,"debugTable","getSortedRowModel",()=>t._autoResetPageIndex()))}function Yp(t,e){return t?vN(t)?M.createElement(t,e):t:null}function vN(t){return bN(t)||typeof t=="function"||SN(t)}function bN(t){return typeof t=="function"&&(()=>{const e=Object.getPrototypeOf(t);return e.prototype&&e.prototype.isReactComponent})()}function SN(t){return typeof t=="object"&&typeof t.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(t.$$typeof.description)}function xN(t){const e={state:{},onStateChange:()=>{},renderFallbackValue:null,...t},[n]=M.useState(()=>({current:fN(e)})),[r,o]=M.useState(()=>n.current.initialState);return n.current.setOptions(l=>({...l,...t,state:{...r,...t.state},onStateChange:a=>{o(a),t.onStateChange==null||t.onStateChange(a)}})),n.current}var Sa=d1();const O1=c1(Sa);function ws(t,e,n){let r=n.initialDeps??[],o,l=!0;function a(){var c,d,h;let p;n.key&&((c=n.debug)!=null&&c.call(n))&&(p=Date.now());const g=t();if(!(g.length!==r.length||g.some((S,x)=>r[x]!==S)))return o;r=g;let v;if(n.key&&((d=n.debug)!=null&&d.call(n))&&(v=Date.now()),o=e(...g),n.key&&((h=n.debug)!=null&&h.call(n))){const S=Math.round((Date.now()-p)*100)/100,x=Math.round((Date.now()-v)*100)/100,C=x/16,E=(A,k)=>{for(A=String(A);A.length<k;)A=" "+A;return A};console.info(`%c⏱ ${E(x,5)} /${E(S,5)} ms`,`
|
|
13
|
+
font-size: .6rem;
|
|
14
|
+
font-weight: bold;
|
|
15
|
+
color: hsl(${Math.max(0,Math.min(120-120*C,120))}deg 100% 31%);`,n?.key)}return n?.onChange&&!(l&&n.skipInitialOnChange)&&n.onChange(o),l=!1,o}return a.updateDeps=c=>{r=c},a}function zb(t,e){if(t===void 0)throw new Error("Unexpected undefined");return t}const wN=(t,e)=>Math.abs(t-e)<1.01,CN=(t,e,n)=>{let r;return function(...o){t.clearTimeout(r),r=t.setTimeout(()=>e.apply(this,o),n)}},jb=t=>{const{offsetWidth:e,offsetHeight:n}=t;return{width:e,height:n}},MN=t=>t,EN=t=>{const e=Math.max(t.startIndex-t.overscan,0),n=Math.min(t.endIndex+t.overscan,t.count-1),r=[];for(let o=e;o<=n;o++)r.push(o);return r},RN=(t,e)=>{const n=t.scrollElement;if(!n)return;const r=t.targetWindow;if(!r)return;const o=a=>{const{width:c,height:d}=a;e({width:Math.round(c),height:Math.round(d)})};if(o(jb(n)),!r.ResizeObserver)return()=>{};const l=new r.ResizeObserver(a=>{const c=()=>{const d=a[0];if(d?.borderBoxSize){const h=d.borderBoxSize[0];if(h){o({width:h.inlineSize,height:h.blockSize});return}}o(jb(n))};t.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(c):c()});return l.observe(n,{box:"border-box"}),()=>{l.unobserve(n)}},Lb={passive:!0},Bb=typeof window>"u"?!0:"onscrollend"in window,TN=(t,e)=>{const n=t.scrollElement;if(!n)return;const r=t.targetWindow;if(!r)return;let o=0;const l=t.options.useScrollendEvent&&Bb?()=>{}:CN(r,()=>{e(o,!1)},t.options.isScrollingResetDelay),a=p=>()=>{const{horizontal:g,isRtl:b}=t.options;o=g?n.scrollLeft*(b&&-1||1):n.scrollTop,l(),e(o,p)},c=a(!0),d=a(!1);n.addEventListener("scroll",c,Lb);const h=t.options.useScrollendEvent&&Bb;return h&&n.addEventListener("scrollend",d,Lb),()=>{n.removeEventListener("scroll",c),h&&n.removeEventListener("scrollend",d)}},AN=(t,e,n)=>{if(e?.borderBoxSize){const r=e.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}return t[n.options.horizontal?"offsetWidth":"offsetHeight"]},ON=(t,{adjustments:e=0,behavior:n},r)=>{var o,l;const a=t+e;(l=(o=r.scrollElement)==null?void 0:o.scrollTo)==null||l.call(o,{[r.options.horizontal?"left":"top"]:a,behavior:n})};class kN{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.now=()=>{var n,r,o;return((o=(r=(n=this.targetWindow)==null?void 0:n.performance)==null?void 0:r.now)==null?void 0:o.call(r))??Date.now()},this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(o=>{o.forEach(l=>{const a=()=>{const c=l.target,d=this.indexFromElement(c);if(!c.isConnected){this.observer.unobserve(c);return}this.shouldMeasureDuringScroll(d)&&this.resizeItem(d,this.options.measureElement(c,l,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()})}));return{disconnect:()=>{var o;(o=r())==null||o.disconnect(),n=null},observe:o=>{var l;return(l=r())==null?void 0:l.observe(o,{box:"border-box"})},unobserve:o=>{var l;return(l=r())==null?void 0:l.unobserve(o)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([r,o])=>{typeof o>"u"&&delete n[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:MN,rangeExtractor:EN,onChange:()=>{},measureElement:AN,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...n}},this.notify=n=>{var r,o;(o=(r=this.options).onChange)==null||o.call(r,this,n)},this.maybeNotify=ws(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(o=>{this.observer.observe(o)}),this.unsubs.push(this.options.observeElementRect(this,o=>{this.scrollRect=o,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(o,l)=>{this.scrollAdjustments=0,this.scrollDirection=l?this.getScrollOffset()<o?"forward":"backward":null,this.scrollOffset=o,this.isScrolling=l,this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,r)=>{const o=new Map,l=new Map;for(let a=r-1;a>=0;a--){const c=n[a];if(o.has(c.lane))continue;const d=l.get(c.lane);if(d==null||c.end>d.end?l.set(c.lane,c):c.end<d.end&&o.set(c.lane,!0),o.size===this.options.lanes)break}return l.size===this.options.lanes?Array.from(l.values()).sort((a,c)=>a.end===c.end?a.index-c.index:a.end-c.end)[0]:void 0},this.getMeasurementOptions=ws(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes],(n,r,o,l,a,c)=>(this.prevLanes!==void 0&&this.prevLanes!==c&&(this.lanesChangedFlag=!0),this.prevLanes=c,this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:r,scrollMargin:o,getItemKey:l,enabled:a,lanes:c}),{key:!1}),this.getMeasurements=ws(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:r,scrollMargin:o,getItemKey:l,enabled:a,lanes:c},d)=>{if(!a)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>n)for(const b of this.laneAssignments.keys())b>=n&&this.laneAssignments.delete(b);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(b=>{this.itemSizeCache.set(b.key,b.size)}));const h=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===n&&(this.lanesSettling=!1);const p=this.measurementsCache.slice(0,h),g=new Array(c).fill(void 0);for(let b=0;b<h;b++){const v=p[b];v&&(g[v.lane]=b)}for(let b=h;b<n;b++){const v=l(b),S=this.laneAssignments.get(b);let x,C;if(S!==void 0&&this.options.lanes>1){x=S;const D=g[x],L=D!==void 0?p[D]:void 0;C=L?L.end+this.options.gap:r+o}else{const D=this.options.lanes===1?p[b-1]:this.getFurthestMeasurement(p,b);C=D?D.end+this.options.gap:r+o,x=D?D.lane:b%this.options.lanes,this.options.lanes>1&&this.laneAssignments.set(b,x)}const E=d.get(v),A=typeof E=="number"?E:this.options.estimateSize(b),k=C+A;p[b]={index:b,start:C,size:A,end:k,key:v,lane:x},g[x]=b}return this.measurementsCache=p,p},{key:!1,debug:()=>this.options.debug}),this.calculateRange=ws(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,o,l)=>this.range=n.length>0&&r>0?NN({measurements:n,outerSize:r,scrollOffset:o,lanes:l}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=ws(()=>{let n=null,r=null;const o=this.calculateRange();return o&&(n=o.startIndex,r=o.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,r]},(n,r,o,l,a)=>l===null||a===null?[]:n({startIndex:l,endIndex:a,overscan:r,count:o}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,o=n.getAttribute(r);return o?parseInt(o,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=n=>{var r;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const o=this.scrollState.index??((r=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:r.index);if(o!==void 0&&this.range){const l=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),a=Math.max(0,o-l),c=Math.min(this.options.count-1,o+l);return n>=a&&n<=c}return!0},this.measureElement=n=>{if(!n){this.elementsCache.forEach((a,c)=>{a.isConnected||(this.observer.unobserve(a),this.elementsCache.delete(c))});return}const r=this.indexFromElement(n),o=this.options.getItemKey(r),l=this.elementsCache.get(o);l!==n&&(l&&this.observer.unobserve(l),this.observer.observe(n),this.elementsCache.set(o,n)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(r)&&this.resizeItem(r,this.options.measureElement(n,void 0,this))},this.resizeItem=(n,r)=>{var o;const l=this.measurementsCache[n];if(!l)return;const a=this.itemSizeCache.get(l.key)??l.size,c=r-a;c!==0&&(((o=this.scrollState)==null?void 0:o.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(l,c,this):l.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=c,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(l.index),this.itemSizeCache=new Map(this.itemSizeCache.set(l.key,r)),this.notify(!1))},this.getVirtualItems=ws(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,r)=>{const o=[];for(let l=0,a=n.length;l<a;l++){const c=n[l],d=r[c];o.push(d)}return o},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length!==0)return zb(r[k1(0,r.length-1,o=>zb(r[o]).start,n)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const n=this.scrollElement.document.documentElement;return this.options.horizontal?n.scrollWidth-this.scrollElement.innerWidth:n.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(n,r,o=0)=>{if(!this.scrollElement)return 0;const l=this.getSize(),a=this.getScrollOffset();r==="auto"&&(r=n>=a+l?"end":"start"),r==="center"?n+=(o-l)/2:r==="end"&&(n-=l);const c=this.getMaxScrollOffset();return Math.max(Math.min(c,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const o=this.getSize(),l=this.getScrollOffset(),a=this.measurementsCache[n];if(!a)return;if(r==="auto")if(a.end>=l+o-this.options.scrollPaddingEnd)r="end";else if(a.start<=l+this.options.scrollPaddingStart)r="start";else return[l,r];if(r==="end"&&n===this.options.count-1)return[this.getMaxScrollOffset(),r];const c=r==="end"?a.end+this.options.scrollPaddingEnd:a.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(c,r,a.size),r]},this.scrollToOffset=(n,{align:r="start",behavior:o="auto"}={})=>{const l=this.getOffsetForAlignment(n,r),a=this.now();this.scrollState={index:null,align:r,behavior:o,startedAt:a,lastTargetOffset:l,stableFrames:0},this._scrollToOffset(l,{adjustments:void 0,behavior:o}),this.scheduleScrollReconcile()},this.scrollToIndex=(n,{align:r="auto",behavior:o="auto"}={})=>{n=Math.max(0,Math.min(n,this.options.count-1));const l=this.getOffsetForIndex(n,r);if(!l)return;const[a,c]=l,d=this.now();this.scrollState={index:n,align:c,behavior:o,startedAt:d,lastTargetOffset:a,stableFrames:0},this._scrollToOffset(a,{adjustments:void 0,behavior:o}),this.scheduleScrollReconcile()},this.scrollBy=(n,{behavior:r="auto"}={})=>{const o=this.getScrollOffset()+n,l=this.now();this.scrollState={index:null,align:"start",behavior:r,startedAt:l,lastTargetOffset:o,stableFrames:0},this._scrollToOffset(o,{adjustments:void 0,behavior:r}),this.scheduleScrollReconcile()},this.getTotalSize=()=>{var n;const r=this.getMeasurements();let o;if(r.length===0)o=this.options.paddingStart;else if(this.options.lanes===1)o=((n=r[r.length-1])==null?void 0:n.end)??0;else{const l=Array(this.options.lanes).fill(null);let a=r.length-1;for(;a>=0&&l.some(c=>c===null);){const c=r[a];l[c.lane]===null&&(l[c.lane]=c.end),a--}o=Math.max(...l.filter(c=>c!==null))}return Math.max(o-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:r,behavior:o})=>{this.options.scrollToFn(n,{behavior:o,adjustments:r},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(e)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const r=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,o=r?r[0]:this.scrollState.lastTargetOffset,l=1,a=o!==this.scrollState.lastTargetOffset;if(!a&&wN(o,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=l){this.scrollState=null;return}}else this.scrollState.stableFrames=0,a&&(this.scrollState.lastTargetOffset=o,this.scrollState.behavior="auto",this._scrollToOffset(o,{adjustments:void 0,behavior:"auto"}));this.scheduleScrollReconcile()}}const k1=(t,e,n,r)=>{for(;t<=e;){const o=(t+e)/2|0,l=n(o);if(l<r)t=o+1;else if(l>r)e=o-1;else return o}return t>0?t-1:0};function NN({measurements:t,outerSize:e,scrollOffset:n,lanes:r}){const o=t.length-1,l=d=>t[d].start;if(t.length<=r)return{startIndex:0,endIndex:o};let a=k1(0,o,l,n),c=a;if(r===1)for(;c<o&&t[c].end<n+e;)c++;else if(r>1){const d=Array(r).fill(0);for(;c<o&&d.some(p=>p<n+e);){const p=t[c];d[p.lane]=p.end,c++}const h=Array(r).fill(n+e);for(;a>=0&&h.some(p=>p>=n);){const p=t[a];h[p.lane]=p.start,a--}a=Math.max(0,a-a%r),c=Math.min(o,c+(r-1-c%r))}return{startIndex:a,endIndex:c}}const Ib=typeof document<"u"?M.useLayoutEffect:M.useEffect;function DN({useFlushSync:t=!0,...e}){const n=M.useReducer(()=>({}),{})[1],r={...e,onChange:(l,a)=>{var c;t&&a?Sa.flushSync(n):n(),(c=e.onChange)==null||c.call(e,l,a)}},[o]=M.useState(()=>new kN(r));return o.setOptions(r),Ib(()=>o._didMount(),[]),Ib(()=>o._willUpdate()),o}function _N(t){return DN({observeElementRect:RN,observeElementOffset:TN,scrollToFn:ON,...t})}const yc=["emerald","purple","sky","pink","red","zinc","lime","violet","fuchsia","teal","amber","rose","orange","cyan","indigo","yellow","green","coral","blue","stone"];function N1(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var o=t.length;for(e=0;e<o;e++)t[e]&&(n=N1(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function D1(){for(var t,e,n=0,r="",o=arguments.length;n<o;n++)(t=arguments[n])&&(e=N1(t))&&(r&&(r+=" "),r+=e);return r}const zN=(t,e)=>{const n=new Array(t.length+e.length);for(let r=0;r<t.length;r++)n[r]=t[r];for(let r=0;r<e.length;r++)n[t.length+r]=e[r];return n},jN=(t,e)=>({classGroupId:t,validator:e}),_1=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),Ec="-",Vb=[],LN="arbitrary..",BN=t=>{const e=VN(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return IN(a);const c=a.split(Ec),d=c[0]===""&&c.length>1?1:0;return z1(c,d,e)},getConflictingClassGroupIds:(a,c)=>{if(c){const d=r[a],h=n[a];return d?h?zN(h,d):d:h||Vb}return n[a]||Vb}}},z1=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const o=t[e],l=n.nextPart.get(o);if(l){const h=z1(t,e+1,l);if(h)return h}const a=n.validators;if(a===null)return;const c=e===0?t.join(Ec):t.slice(e).join(Ec),d=a.length;for(let h=0;h<d;h++){const p=a[h];if(p.validator(c))return p.classGroupId}},IN=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=t.slice(1,-1),n=e.indexOf(":"),r=e.slice(0,n);return r?LN+r:void 0})(),VN=t=>{const{theme:e,classGroups:n}=t;return FN(n,e)},FN=(t,e)=>{const n=_1();for(const r in t){const o=t[r];Dm(o,n,r,e)}return n},Dm=(t,e,n,r)=>{const o=t.length;for(let l=0;l<o;l++){const a=t[l];PN(a,e,n,r)}},PN=(t,e,n,r)=>{if(typeof t=="string"){$N(t,e,n);return}if(typeof t=="function"){HN(t,e,n,r);return}UN(t,e,n,r)},$N=(t,e,n)=>{const r=t===""?e:j1(e,t);r.classGroupId=n},HN=(t,e,n,r)=>{if(qN(t)){Dm(t(r),e,n,r);return}e.validators===null&&(e.validators=[]),e.validators.push(jN(n,t))},UN=(t,e,n,r)=>{const o=Object.entries(t),l=o.length;for(let a=0;a<l;a++){const[c,d]=o[a];Dm(d,j1(e,c),n,r)}},j1=(t,e)=>{let n=t;const r=e.split(Ec),o=r.length;for(let l=0;l<o;l++){const a=r[l];let c=n.nextPart.get(a);c||(c=_1(),n.nextPart.set(a,c)),n=c}return n},qN=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,GN=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=Object.create(null),r=Object.create(null);const o=(l,a)=>{n[l]=a,e++,e>t&&(e=0,r=n,n=Object.create(null))};return{get(l){let a=n[l];if(a!==void 0)return a;if((a=r[l])!==void 0)return o(l,a),a},set(l,a){l in n?n[l]=a:o(l,a)}}},Xp="!",Fb=":",KN=[],Pb=(t,e,n,r,o)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:r,isExternal:o}),YN=t=>{const{prefix:e,experimentalParseClassName:n}=t;let r=o=>{const l=[];let a=0,c=0,d=0,h;const p=o.length;for(let x=0;x<p;x++){const C=o[x];if(a===0&&c===0){if(C===Fb){l.push(o.slice(d,x)),d=x+1;continue}if(C==="/"){h=x;continue}}C==="["?a++:C==="]"?a--:C==="("?c++:C===")"&&c--}const g=l.length===0?o:o.slice(d);let b=g,v=!1;g.endsWith(Xp)?(b=g.slice(0,-1),v=!0):g.startsWith(Xp)&&(b=g.slice(1),v=!0);const S=h&&h>d?h-d:void 0;return Pb(l,v,b,S)};if(e){const o=e+Fb,l=r;r=a=>a.startsWith(o)?l(a.slice(o.length)):Pb(KN,!1,a,void 0,!0)}if(n){const o=r;r=l=>n({className:l,parseClassName:o})}return r},XN=t=>{const e=new Map;return t.orderSensitiveModifiers.forEach((n,r)=>{e.set(n,1e6+r)}),n=>{const r=[];let o=[];for(let l=0;l<n.length;l++){const a=n[l],c=a[0]==="[",d=e.has(a);c||d?(o.length>0&&(o.sort(),r.push(...o),o=[]),r.push(a)):o.push(a)}return o.length>0&&(o.sort(),r.push(...o)),r}},JN=t=>({cache:GN(t.cacheSize),parseClassName:YN(t),sortModifiers:XN(t),...BN(t)}),QN=/\s+/,ZN=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:l}=e,a=[],c=t.trim().split(QN);let d="";for(let h=c.length-1;h>=0;h-=1){const p=c[h],{isExternal:g,modifiers:b,hasImportantModifier:v,baseClassName:S,maybePostfixModifierPosition:x}=n(p);if(g){d=p+(d.length>0?" "+d:d);continue}let C=!!x,E=r(C?S.substring(0,x):S);if(!E){if(!C){d=p+(d.length>0?" "+d:d);continue}if(E=r(S),!E){d=p+(d.length>0?" "+d:d);continue}C=!1}const A=b.length===0?"":b.length===1?b[0]:l(b).join(":"),k=v?A+Xp:A,D=k+E;if(a.indexOf(D)>-1)continue;a.push(D);const L=o(E,C);for(let H=0;H<L.length;++H){const z=L[H];a.push(k+z)}d=p+(d.length>0?" "+d:d)}return d},WN=(...t)=>{let e=0,n,r,o="";for(;e<t.length;)(n=t[e++])&&(r=L1(n))&&(o&&(o+=" "),o+=r);return o},L1=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=L1(t[r]))&&(n&&(n+=" "),n+=e);return n},eD=(t,...e)=>{let n,r,o,l;const a=d=>{const h=e.reduce((p,g)=>g(p),t());return n=JN(h),r=n.cache.get,o=n.cache.set,l=c,c(d)},c=d=>{const h=r(d);if(h)return h;const p=ZN(d,n);return o(d,p),p};return l=a,(...d)=>l(WN(...d))},tD=[],Ct=t=>{const e=n=>n[t]||tD;return e.isThemeGetter=!0,e},B1=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,I1=/^\((?:(\w[\w-]*):)?(.+)\)$/i,nD=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,rD=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,iD=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,oD=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,sD=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,lD=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,yi=t=>nD.test(t),_e=t=>!!t&&!Number.isNaN(Number(t)),vi=t=>!!t&&Number.isInteger(Number(t)),Zh=t=>t.endsWith("%")&&_e(t.slice(0,-1)),_r=t=>rD.test(t),V1=()=>!0,aD=t=>iD.test(t)&&!oD.test(t),_m=()=>!1,uD=t=>sD.test(t),cD=t=>lD.test(t),fD=t=>!he(t)&&!pe(t),dD=t=>Bi(t,$1,_m),he=t=>B1.test(t),ao=t=>Bi(t,H1,aD),$b=t=>Bi(t,SD,_e),hD=t=>Bi(t,q1,V1),pD=t=>Bi(t,U1,_m),Hb=t=>Bi(t,F1,_m),mD=t=>Bi(t,P1,cD),Wu=t=>Bi(t,G1,uD),pe=t=>I1.test(t),Hl=t=>Ro(t,H1),gD=t=>Ro(t,U1),Ub=t=>Ro(t,F1),yD=t=>Ro(t,$1),vD=t=>Ro(t,P1),ec=t=>Ro(t,G1,!0),bD=t=>Ro(t,q1,!0),Bi=(t,e,n)=>{const r=B1.exec(t);return r?r[1]?e(r[1]):n(r[2]):!1},Ro=(t,e,n=!1)=>{const r=I1.exec(t);return r?r[1]?e(r[1]):n:!1},F1=t=>t==="position"||t==="percentage",P1=t=>t==="image"||t==="url",$1=t=>t==="length"||t==="size"||t==="bg-size",H1=t=>t==="length",SD=t=>t==="number",U1=t=>t==="family-name",q1=t=>t==="number"||t==="weight",G1=t=>t==="shadow",xD=()=>{const t=Ct("color"),e=Ct("font"),n=Ct("text"),r=Ct("font-weight"),o=Ct("tracking"),l=Ct("leading"),a=Ct("breakpoint"),c=Ct("container"),d=Ct("spacing"),h=Ct("radius"),p=Ct("shadow"),g=Ct("inset-shadow"),b=Ct("text-shadow"),v=Ct("drop-shadow"),S=Ct("blur"),x=Ct("perspective"),C=Ct("aspect"),E=Ct("ease"),A=Ct("animate"),k=()=>["auto","avoid","all","avoid-page","page","left","right","column"],D=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],L=()=>[...D(),pe,he],H=()=>["auto","hidden","clip","visible","scroll"],z=()=>["auto","contain","none"],j=()=>[pe,he,d],J=()=>[yi,"full","auto",...j()],le=()=>[vi,"none","subgrid",pe,he],ce=()=>["auto",{span:["full",vi,pe,he]},vi,pe,he],se=()=>[vi,"auto",pe,he],Se=()=>["auto","min","max","fr",pe,he],ne=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],me=()=>["start","end","center","stretch","center-safe","end-safe"],I=()=>["auto",...j()],Q=()=>[yi,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...j()],U=()=>[yi,"screen","full","dvw","lvw","svw","min","max","fit",...j()],K=()=>[yi,"screen","full","lh","dvh","lvh","svh","min","max","fit",...j()],G=()=>[t,pe,he],N=()=>[...D(),Ub,Hb,{position:[pe,he]}],V=()=>["no-repeat",{repeat:["","x","y","space","round"]}],X=()=>["auto","cover","contain",yD,dD,{size:[pe,he]}],ee=()=>[Zh,Hl,ao],re=()=>["","none","full",h,pe,he],ae=()=>["",_e,Hl,ao],de=()=>["solid","dashed","dotted","double"],De=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],xe=()=>[_e,Zh,Ub,Hb],Ft=()=>["","none",S,pe,he],Qt=()=>["none",_e,pe,he],xt=()=>["none",_e,pe,he],ht=()=>[_e,pe,he],kt=()=>[yi,"full",...j()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[_r],breakpoint:[_r],color:[V1],container:[_r],"drop-shadow":[_r],ease:["in","out","in-out"],font:[fD],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[_r],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[_r],shadow:[_r],spacing:["px",_e],text:[_r],"text-shadow":[_r],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",yi,he,pe,C]}],container:["container"],columns:[{columns:[_e,he,pe,c]}],"break-after":[{"break-after":k()}],"break-before":[{"break-before":k()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:L()}],overflow:[{overflow:H()}],"overflow-x":[{"overflow-x":H()}],"overflow-y":[{"overflow-y":H()}],overscroll:[{overscroll:z()}],"overscroll-x":[{"overscroll-x":z()}],"overscroll-y":[{"overscroll-y":z()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:J()}],"inset-x":[{"inset-x":J()}],"inset-y":[{"inset-y":J()}],start:[{"inset-s":J(),start:J()}],end:[{"inset-e":J(),end:J()}],"inset-bs":[{"inset-bs":J()}],"inset-be":[{"inset-be":J()}],top:[{top:J()}],right:[{right:J()}],bottom:[{bottom:J()}],left:[{left:J()}],visibility:["visible","invisible","collapse"],z:[{z:[vi,"auto",pe,he]}],basis:[{basis:[yi,"full","auto",c,...j()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[_e,yi,"auto","initial","none",he]}],grow:[{grow:["",_e,pe,he]}],shrink:[{shrink:["",_e,pe,he]}],order:[{order:[vi,"first","last","none",pe,he]}],"grid-cols":[{"grid-cols":le()}],"col-start-end":[{col:ce()}],"col-start":[{"col-start":se()}],"col-end":[{"col-end":se()}],"grid-rows":[{"grid-rows":le()}],"row-start-end":[{row:ce()}],"row-start":[{"row-start":se()}],"row-end":[{"row-end":se()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Se()}],"auto-rows":[{"auto-rows":Se()}],gap:[{gap:j()}],"gap-x":[{"gap-x":j()}],"gap-y":[{"gap-y":j()}],"justify-content":[{justify:[...ne(),"normal"]}],"justify-items":[{"justify-items":[...me(),"normal"]}],"justify-self":[{"justify-self":["auto",...me()]}],"align-content":[{content:["normal",...ne()]}],"align-items":[{items:[...me(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...me(),{baseline:["","last"]}]}],"place-content":[{"place-content":ne()}],"place-items":[{"place-items":[...me(),"baseline"]}],"place-self":[{"place-self":["auto",...me()]}],p:[{p:j()}],px:[{px:j()}],py:[{py:j()}],ps:[{ps:j()}],pe:[{pe:j()}],pbs:[{pbs:j()}],pbe:[{pbe:j()}],pt:[{pt:j()}],pr:[{pr:j()}],pb:[{pb:j()}],pl:[{pl:j()}],m:[{m:I()}],mx:[{mx:I()}],my:[{my:I()}],ms:[{ms:I()}],me:[{me:I()}],mbs:[{mbs:I()}],mbe:[{mbe:I()}],mt:[{mt:I()}],mr:[{mr:I()}],mb:[{mb:I()}],ml:[{ml:I()}],"space-x":[{"space-x":j()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":j()}],"space-y-reverse":["space-y-reverse"],size:[{size:Q()}],"inline-size":[{inline:["auto",...U()]}],"min-inline-size":[{"min-inline":["auto",...U()]}],"max-inline-size":[{"max-inline":["none",...U()]}],"block-size":[{block:["auto",...K()]}],"min-block-size":[{"min-block":["auto",...K()]}],"max-block-size":[{"max-block":["none",...K()]}],w:[{w:[c,"screen",...Q()]}],"min-w":[{"min-w":[c,"screen","none",...Q()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[a]},...Q()]}],h:[{h:["screen","lh",...Q()]}],"min-h":[{"min-h":["screen","lh","none",...Q()]}],"max-h":[{"max-h":["screen","lh",...Q()]}],"font-size":[{text:["base",n,Hl,ao]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,bD,hD]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Zh,he]}],"font-family":[{font:[gD,pD,e]}],"font-features":[{"font-features":[he]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,pe,he]}],"line-clamp":[{"line-clamp":[_e,"none",pe,$b]}],leading:[{leading:[l,...j()]}],"list-image":[{"list-image":["none",pe,he]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",pe,he]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:G()}],"text-color":[{text:G()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...de(),"wavy"]}],"text-decoration-thickness":[{decoration:[_e,"from-font","auto",pe,ao]}],"text-decoration-color":[{decoration:G()}],"underline-offset":[{"underline-offset":[_e,"auto",pe,he]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:j()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",pe,he]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",pe,he]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:N()}],"bg-repeat":[{bg:V()}],"bg-size":[{bg:X()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},vi,pe,he],radial:["",pe,he],conic:[vi,pe,he]},vD,mD]}],"bg-color":[{bg:G()}],"gradient-from-pos":[{from:ee()}],"gradient-via-pos":[{via:ee()}],"gradient-to-pos":[{to:ee()}],"gradient-from":[{from:G()}],"gradient-via":[{via:G()}],"gradient-to":[{to:G()}],rounded:[{rounded:re()}],"rounded-s":[{"rounded-s":re()}],"rounded-e":[{"rounded-e":re()}],"rounded-t":[{"rounded-t":re()}],"rounded-r":[{"rounded-r":re()}],"rounded-b":[{"rounded-b":re()}],"rounded-l":[{"rounded-l":re()}],"rounded-ss":[{"rounded-ss":re()}],"rounded-se":[{"rounded-se":re()}],"rounded-ee":[{"rounded-ee":re()}],"rounded-es":[{"rounded-es":re()}],"rounded-tl":[{"rounded-tl":re()}],"rounded-tr":[{"rounded-tr":re()}],"rounded-br":[{"rounded-br":re()}],"rounded-bl":[{"rounded-bl":re()}],"border-w":[{border:ae()}],"border-w-x":[{"border-x":ae()}],"border-w-y":[{"border-y":ae()}],"border-w-s":[{"border-s":ae()}],"border-w-e":[{"border-e":ae()}],"border-w-bs":[{"border-bs":ae()}],"border-w-be":[{"border-be":ae()}],"border-w-t":[{"border-t":ae()}],"border-w-r":[{"border-r":ae()}],"border-w-b":[{"border-b":ae()}],"border-w-l":[{"border-l":ae()}],"divide-x":[{"divide-x":ae()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ae()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...de(),"hidden","none"]}],"divide-style":[{divide:[...de(),"hidden","none"]}],"border-color":[{border:G()}],"border-color-x":[{"border-x":G()}],"border-color-y":[{"border-y":G()}],"border-color-s":[{"border-s":G()}],"border-color-e":[{"border-e":G()}],"border-color-bs":[{"border-bs":G()}],"border-color-be":[{"border-be":G()}],"border-color-t":[{"border-t":G()}],"border-color-r":[{"border-r":G()}],"border-color-b":[{"border-b":G()}],"border-color-l":[{"border-l":G()}],"divide-color":[{divide:G()}],"outline-style":[{outline:[...de(),"none","hidden"]}],"outline-offset":[{"outline-offset":[_e,pe,he]}],"outline-w":[{outline:["",_e,Hl,ao]}],"outline-color":[{outline:G()}],shadow:[{shadow:["","none",p,ec,Wu]}],"shadow-color":[{shadow:G()}],"inset-shadow":[{"inset-shadow":["none",g,ec,Wu]}],"inset-shadow-color":[{"inset-shadow":G()}],"ring-w":[{ring:ae()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:G()}],"ring-offset-w":[{"ring-offset":[_e,ao]}],"ring-offset-color":[{"ring-offset":G()}],"inset-ring-w":[{"inset-ring":ae()}],"inset-ring-color":[{"inset-ring":G()}],"text-shadow":[{"text-shadow":["none",b,ec,Wu]}],"text-shadow-color":[{"text-shadow":G()}],opacity:[{opacity:[_e,pe,he]}],"mix-blend":[{"mix-blend":[...De(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":De()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[_e]}],"mask-image-linear-from-pos":[{"mask-linear-from":xe()}],"mask-image-linear-to-pos":[{"mask-linear-to":xe()}],"mask-image-linear-from-color":[{"mask-linear-from":G()}],"mask-image-linear-to-color":[{"mask-linear-to":G()}],"mask-image-t-from-pos":[{"mask-t-from":xe()}],"mask-image-t-to-pos":[{"mask-t-to":xe()}],"mask-image-t-from-color":[{"mask-t-from":G()}],"mask-image-t-to-color":[{"mask-t-to":G()}],"mask-image-r-from-pos":[{"mask-r-from":xe()}],"mask-image-r-to-pos":[{"mask-r-to":xe()}],"mask-image-r-from-color":[{"mask-r-from":G()}],"mask-image-r-to-color":[{"mask-r-to":G()}],"mask-image-b-from-pos":[{"mask-b-from":xe()}],"mask-image-b-to-pos":[{"mask-b-to":xe()}],"mask-image-b-from-color":[{"mask-b-from":G()}],"mask-image-b-to-color":[{"mask-b-to":G()}],"mask-image-l-from-pos":[{"mask-l-from":xe()}],"mask-image-l-to-pos":[{"mask-l-to":xe()}],"mask-image-l-from-color":[{"mask-l-from":G()}],"mask-image-l-to-color":[{"mask-l-to":G()}],"mask-image-x-from-pos":[{"mask-x-from":xe()}],"mask-image-x-to-pos":[{"mask-x-to":xe()}],"mask-image-x-from-color":[{"mask-x-from":G()}],"mask-image-x-to-color":[{"mask-x-to":G()}],"mask-image-y-from-pos":[{"mask-y-from":xe()}],"mask-image-y-to-pos":[{"mask-y-to":xe()}],"mask-image-y-from-color":[{"mask-y-from":G()}],"mask-image-y-to-color":[{"mask-y-to":G()}],"mask-image-radial":[{"mask-radial":[pe,he]}],"mask-image-radial-from-pos":[{"mask-radial-from":xe()}],"mask-image-radial-to-pos":[{"mask-radial-to":xe()}],"mask-image-radial-from-color":[{"mask-radial-from":G()}],"mask-image-radial-to-color":[{"mask-radial-to":G()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":D()}],"mask-image-conic-pos":[{"mask-conic":[_e]}],"mask-image-conic-from-pos":[{"mask-conic-from":xe()}],"mask-image-conic-to-pos":[{"mask-conic-to":xe()}],"mask-image-conic-from-color":[{"mask-conic-from":G()}],"mask-image-conic-to-color":[{"mask-conic-to":G()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:N()}],"mask-repeat":[{mask:V()}],"mask-size":[{mask:X()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",pe,he]}],filter:[{filter:["","none",pe,he]}],blur:[{blur:Ft()}],brightness:[{brightness:[_e,pe,he]}],contrast:[{contrast:[_e,pe,he]}],"drop-shadow":[{"drop-shadow":["","none",v,ec,Wu]}],"drop-shadow-color":[{"drop-shadow":G()}],grayscale:[{grayscale:["",_e,pe,he]}],"hue-rotate":[{"hue-rotate":[_e,pe,he]}],invert:[{invert:["",_e,pe,he]}],saturate:[{saturate:[_e,pe,he]}],sepia:[{sepia:["",_e,pe,he]}],"backdrop-filter":[{"backdrop-filter":["","none",pe,he]}],"backdrop-blur":[{"backdrop-blur":Ft()}],"backdrop-brightness":[{"backdrop-brightness":[_e,pe,he]}],"backdrop-contrast":[{"backdrop-contrast":[_e,pe,he]}],"backdrop-grayscale":[{"backdrop-grayscale":["",_e,pe,he]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[_e,pe,he]}],"backdrop-invert":[{"backdrop-invert":["",_e,pe,he]}],"backdrop-opacity":[{"backdrop-opacity":[_e,pe,he]}],"backdrop-saturate":[{"backdrop-saturate":[_e,pe,he]}],"backdrop-sepia":[{"backdrop-sepia":["",_e,pe,he]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":j()}],"border-spacing-x":[{"border-spacing-x":j()}],"border-spacing-y":[{"border-spacing-y":j()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",pe,he]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[_e,"initial",pe,he]}],ease:[{ease:["linear","initial",E,pe,he]}],delay:[{delay:[_e,pe,he]}],animate:[{animate:["none",A,pe,he]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[x,pe,he]}],"perspective-origin":[{"perspective-origin":L()}],rotate:[{rotate:Qt()}],"rotate-x":[{"rotate-x":Qt()}],"rotate-y":[{"rotate-y":Qt()}],"rotate-z":[{"rotate-z":Qt()}],scale:[{scale:xt()}],"scale-x":[{"scale-x":xt()}],"scale-y":[{"scale-y":xt()}],"scale-z":[{"scale-z":xt()}],"scale-3d":["scale-3d"],skew:[{skew:ht()}],"skew-x":[{"skew-x":ht()}],"skew-y":[{"skew-y":ht()}],transform:[{transform:[pe,he,"","none","gpu","cpu"]}],"transform-origin":[{origin:L()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:kt()}],"translate-x":[{"translate-x":kt()}],"translate-y":[{"translate-y":kt()}],"translate-z":[{"translate-z":kt()}],"translate-none":["translate-none"],accent:[{accent:G()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:G()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",pe,he]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mbs":[{"scroll-mbs":j()}],"scroll-mbe":[{"scroll-mbe":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pbs":[{"scroll-pbs":j()}],"scroll-pbe":[{"scroll-pbe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",pe,he]}],fill:[{fill:["none",...G()]}],"stroke-w":[{stroke:[_e,Hl,ao,$b]}],stroke:[{stroke:["none",...G()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},wD=eD(xD);function Ne(...t){return wD(D1(t))}const Wh={amber:"bg-amber-50/90 text-amber-700 dark:bg-amber-400/10 dark:text-amber-200",blue:"bg-blue-50/90 text-blue-700 dark:bg-blue-400/10 dark:text-blue-200",coral:"bg-rose-50/90 text-rose-700 dark:bg-rose-400/10 dark:text-rose-200",cyan:"bg-cyan-50/90 text-cyan-700 dark:bg-cyan-400/10 dark:text-cyan-200",emerald:"bg-emerald-50/90 text-emerald-700 dark:bg-emerald-400/10 dark:text-emerald-200",fuchsia:"bg-fuchsia-50/90 text-fuchsia-700 dark:bg-fuchsia-400/10 dark:text-fuchsia-200",green:"bg-green-50/90 text-green-700 dark:bg-green-400/10 dark:text-green-200",indigo:"bg-indigo-50/90 text-indigo-700 dark:bg-indigo-400/10 dark:text-indigo-200",lime:"bg-lime-50/90 text-lime-700 dark:bg-lime-400/10 dark:text-lime-200",orange:"bg-orange-50/90 text-orange-700 dark:bg-orange-400/10 dark:text-orange-200",pink:"bg-pink-50/90 text-pink-700 dark:bg-pink-400/10 dark:text-pink-200",purple:"bg-purple-50/90 text-purple-700 dark:bg-purple-400/10 dark:text-purple-200",red:"bg-red-50/90 text-red-700 dark:bg-red-400/10 dark:text-red-200",rose:"bg-rose-50/90 text-rose-700 dark:bg-rose-400/10 dark:text-rose-200",sky:"bg-sky-50/90 text-sky-700 dark:bg-sky-400/10 dark:text-sky-200",stone:"bg-stone-50/95 text-stone-700 dark:bg-white/5 dark:text-stone-100",teal:"bg-teal-50/90 text-teal-700 dark:bg-teal-400/10 dark:text-teal-200",violet:"bg-violet-50/90 text-violet-700 dark:bg-violet-400/10 dark:text-violet-200",yellow:"bg-yellow-50/90 text-yellow-700 dark:bg-yellow-400/10 dark:text-yellow-200",zinc:"bg-zinc-50/95 text-zinc-700 dark:bg-white/5 dark:text-zinc-100"};function Rc(t){return t.trim().toUpperCase()}function CD(t){let e=0;for(const n of t)e=e*31+n.charCodeAt(0)>>>0;return e%yc.length}function MD(t,e){if(!e)return null;const n=Rc(t);for(const[r,o]of Object.entries(e))if(o&&Rc(r)===n)return o;return null}function ED(t,e,n){const r=Rc(t),o=MD(t,n);if(o)return Wh[o];const l=e?.findIndex(a=>Rc(a)===r)??-1;return l>=0?Wh[yc[l%yc.length]]:Wh[yc[CD(r)]]}function RD({className:t,colors:e,options:n,value:r}){return T.jsx("span",{className:Ne("inline-flex max-w-full items-center rounded-md px-2 py-1 text-sm leading-none font-medium whitespace-nowrap shadow-[0_1px_2px_rgba(15,23,42,0.04)] dark:shadow-none",ED(r,n,e),t),title:r,children:T.jsx("span",{className:"truncate",children:r})})}function TD(t="left"){switch(t){case"center":return"justify-center text-center";case"right":return"justify-end text-right";default:return"justify-start text-left"}}function AD(t){const e=t instanceof Date?t:new Date(t);return Number.isNaN(e.getTime())?String(t):new Intl.DateTimeFormat(void 0,{dateStyle:"medium"}).format(e)}function OD(t){return new Intl.NumberFormat(void 0,{maximumFractionDigits:Number.isInteger(t)?0:2}).format(t)}function K1(t,e,n){return t==null||t===""?T.jsx("span",{className:"text-muted-foreground",children:"-"}):e==="enum"?T.jsx(RD,{colors:n?.enumColors,options:n?.enumOptions,value:String(t)}):e==="boolean"||typeof t=="boolean"?T.jsx("span",{className:Ne("inline-flex min-w-16 items-center justify-center rounded-full border px-2 py-1 text-[11px] font-medium",t?"border-border bg-accent text-accent-foreground":"border-border bg-muted text-muted-foreground"),children:t?"True":"False"}):e==="number"||typeof t=="number"?OD(Number(t)):e==="date"||t instanceof Date?AD(t):Array.isArray(t)||typeof t=="object"?T.jsx("code",{className:"rounded bg-muted px-1.5 py-1 font-mono text-[11px] text-muted-foreground",children:JSON.stringify(t)}):String(t)}function kD(t,e){const n=Array.from(new Set(e.map(l=>l.trim()).filter(Boolean))).sort((l,a)=>a.length-l.length);if(n.length===0)return[t];const r=new RegExp(`(${n.map(l=>l.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|")})`,"gi");return t.split(r).map((l,a)=>n.some(d=>l.toLowerCase()===d.toLowerCase())?T.jsx("mark",{className:"rounded-sm bg-primary/20 ring-2 ring-primary/20 dark:bg-primary/50 dark:text-white dark:ring-primary/80",children:l},`${l}-${a}`):T.jsx(M.Fragment,{children:l},`${l}-${a}`))}function ND(t,e,n){const r=kD(t,e);if(M.isValidElement(n)){const o=n;if(typeof o.props.children=="string")return M.cloneElement(o,void 0,r)}return T.jsx("span",{className:"whitespace-pre-wrap",children:r})}function qb({checked:t,indeterminate:e,onCheckedChange:n,ariaLabel:r}){const o=M.useRef(null);return M.useEffect(()=>{o.current&&(o.current.indeterminate=!!e&&!t)},[t,e]),T.jsxs("label",{className:"inline-flex cursor-pointer items-center justify-center",children:[T.jsx("input",{ref:o,"aria-label":r,checked:t,className:"peer sr-only",onChange:l=>n(l.target.checked),type:"checkbox"}),T.jsxs("span",{className:Ne("flex size-5 items-center justify-center rounded-[6px] border border-border bg-background text-primary-foreground shadow-xs transition-colors peer-focus-visible:ring-2 peer-focus-visible:ring-ring/50",(t||e)&&"border-primary bg-primary"),children:[e&&!t?T.jsx(dk,{className:"size-3.5"}):null,t?T.jsx(qs,{className:"size-3.5"}):null]})]})}function DD({cell:t,highlightTerms:e=[],paddingLeft:n,paddingRight:r}){const o=t.column.columnDef.meta??{},l=t.getValue(),a=Yp(t.column.columnDef.cell,t.getContext()),c=o.sticky==="left",d=o.kind==="selection",h=o.truncate??!0,g=o.kind==="text"&&o.highlightMatches!==!1&&typeof l=="string"&&e.length>0?ND(l,e,a):a??K1(l,o.kind,{enumColors:o.enumColors,enumOptions:o.enumOptions});return T.jsx("td",{"data-sticky-cell":c?"true":"false",className:Ne("flex shrink-0 border-b border-border px-2 py-1.5 align-middle text-sm text-foreground",TD(o.align),c&&"sticky left-0 z-10 border-r border-r-border bg-card",o.cellClassName),style:{paddingLeft:n,paddingRight:r,width:t.column.getSize()},children:T.jsx("div",{className:Ne(d?"flex w-full items-center justify-center":h?"min-w-0 truncate":"w-full min-w-0 break-words whitespace-normal"),children:g})})}const _D={text:Ek,enum:uk,number:rk,boolean:Nb,date:VO,json:BO,selection:Nb};function ia({kind:t,...e}){const n=_D[t];return T.jsx(n,{...e})}function zD(t){return/\d{4}-\d{2}-\d{2}/.test(t)?!Number.isNaN(Date.parse(t)):!1}function jD(t){const e=t.find(n=>n!=null);return e instanceof Date?"date":typeof e=="boolean"?"boolean":typeof e=="number"?"number":typeof e=="string"&&zD(e)?"date":e&&typeof e=="object"?"json":"text"}function LD(t="left"){switch(t){case"center":return"justify-center text-center";case"right":return"justify-end text-right";default:return"justify-start text-left"}}function BD({sorted:t}){return t==="asc"?T.jsx(_O,{className:"size-3.5 text-foreground"}):t==="desc"?T.jsx(NO,{className:"size-3.5 text-foreground"}):null}function ID({header:t,highlightEnabled:e=!1,onToggleHighlight:n,paddingLeft:r,paddingRight:o,scrollContainerRef:l}){const a=t.column.columnDef.meta??{},c=t.column.getIsSorted(),d=t.column.getCanSort(),h=LD(a.align),p=a.sticky==="left";return T.jsxs("th",{className:Ne("relative flex shrink-0 border-b border-gray-300 bg-background py-2 align-middle text-xs font-medium tracking-wide text-muted-foreground uppercase dark:border-border",p&&"sticky left-0 z-20 border-r border-r-border bg-background",a.headerClassName),style:{width:t.getSize()},children:[t.isPlaceholder?null:d?T.jsx("div",{className:"flex w-full min-w-0 items-center gap-2",children:T.jsxs("button",{className:Ne("flex min-w-0 flex-1 items-center gap-1.5 rounded-md px-2 py-1 transition-colors hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring/50 focus-visible:outline-none",h),onClick:t.column.getToggleSortingHandler(),style:{paddingLeft:r,paddingRight:o},type:"button",children:[a.kind&&a.kind!=="selection"?T.jsx(ia,{className:"size-3.5 shrink-0 text-muted-foreground",kind:a.kind}):null,T.jsx("span",{className:"truncate font-medium text-foreground normal-case",children:Yp(t.column.columnDef.header,t.getContext())}),T.jsx(BD,{sorted:c})]})}):T.jsxs("div",{className:Ne("flex w-full min-w-0 items-center gap-1 px-0.5 py-1",h),style:{paddingLeft:r,paddingRight:o},children:[a.kind&&a.kind!=="selection"?T.jsx(ia,{className:"size-3.5 shrink-0 text-muted-foreground",kind:a.kind}):null,T.jsx("span",{className:"truncate font-medium text-foreground normal-case",children:Yp(t.column.columnDef.header,t.getContext())}),a.kind==="text"&&n?T.jsx("button",{className:Ne("inline-flex size-5 items-center justify-center rounded-sm border",e?"border-border bg-accent text-accent-foreground":"border-transparent text-muted-foreground"),onClick:n,type:"button",children:T.jsx(Rm,{className:"size-3"})}):null]}),t.column.getCanResize()?T.jsx(VD,{header:t,scrollContainerRef:l}):null]})}function VD({header:t,scrollContainerRef:e}){const n=t.column.getIsResizing(),r=M.useRef(null),[o,l]=M.useState(null),a=n?`translateX(${t.getContext().table.getState().columnSizingInfo.deltaOffset??0}px)`:"";return M.useLayoutEffect(()=>{if(!n||!r.current||!e.current){l(null);return}const c=()=>{if(!r.current||!e.current)return;const d=r.current.getBoundingClientRect(),h=e.current.getBoundingClientRect();l({bottom:Math.max(window.innerHeight-h.bottom,0),left:d.left,top:h.top})};return c(),window.addEventListener("resize",c),()=>window.removeEventListener("resize",c)},[n,e]),T.jsxs(T.Fragment,{children:[n&&o?Sa.createPortal(T.jsx("div",{className:"pointer-events-none fixed z-[100] w-1 animate-in cursor-col-resize bg-border transition-colors duration-75 zoom-in-50",style:{bottom:o.bottom,left:o.left,top:o.top,transform:a}}),document.body):null,T.jsx("div",{ref:r,className:Ne("absolute top-0 right-[-2px] z-[100] h-full w-1 cursor-col-resize touch-none rounded-full bg-border opacity-0 transition-opacity select-none hover:opacity-100",n&&"opacity-100"),onMouseDown:t.getResizeHandler(),onTouchStart:t.getResizeHandler()})]})}const Gb=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,Kb=D1,zm=(t,e)=>n=>{var r;if(e?.variants==null)return Kb(t,n?.class,n?.className);const{variants:o,defaultVariants:l}=e,a=Object.keys(o).map(h=>{const p=n?.[h],g=l?.[h];if(p===null)return null;const b=Gb(p)||Gb(g);return o[h][b]}),c=n&&Object.entries(n).reduce((h,p)=>{let[g,b]=p;return b===void 0||(h[g]=b),h},{}),d=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((h,p)=>{let{class:g,className:b,...v}=p;return Object.entries(v).every(S=>{let[x,C]=S;return Array.isArray(C)?C.includes({...l,...c}[x]):{...l,...c}[x]===C})?[...h,g,b]:h},[]);return Kb(t,a,d,n?.class,n?.className)};function Yb(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function nf(...t){return e=>{let n=!1;const r=t.map(o=>{const l=Yb(o,e);return!n&&typeof l=="function"&&(n=!0),l});if(n)return()=>{for(let o=0;o<r.length;o++){const l=r[o];typeof l=="function"?l():Yb(t[o],null)}}}}function hn(...t){return M.useCallback(nf(...t),t)}function oa(t){const e=PD(t),n=M.forwardRef((r,o)=>{const{children:l,...a}=r,c=M.Children.toArray(l),d=c.find(HD);if(d){const h=d.props.children,p=c.map(g=>g===d?M.Children.count(h)>1?M.Children.only(null):M.isValidElement(h)?h.props.children:null:g);return T.jsx(e,{...a,ref:o,children:M.isValidElement(h)?M.cloneElement(h,void 0,p):null})}return T.jsx(e,{...a,ref:o,children:l})});return n.displayName=`${t}.Slot`,n}var FD=oa("Slot");function PD(t){const e=M.forwardRef((n,r)=>{const{children:o,...l}=n;if(M.isValidElement(o)){const a=qD(o),c=UD(l,o.props);return o.type!==M.Fragment&&(c.ref=r?nf(r,a):a),M.cloneElement(o,c)}return M.Children.count(o)>1?M.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var $D=Symbol("radix.slottable");function HD(t){return M.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===$D}function UD(t,e){const n={...e};for(const r in e){const o=t[r],l=e[r];/^on[A-Z]/.test(r)?o&&l?n[r]=(...c)=>{const d=l(...c);return o(...c),d}:o&&(n[r]=o):r==="style"?n[r]={...o,...l}:r==="className"&&(n[r]=[o,l].filter(Boolean).join(" "))}return{...t,...n}}function qD(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var GD=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Gt=GD.reduce((t,e)=>{const n=oa(`Primitive.${e}`),r=M.forwardRef((o,l)=>{const{asChild:a,...c}=o,d=a?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),T.jsx(d,{...c,ref:l})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function Y1(t,e){t&&Sa.flushSync(()=>t.dispatchEvent(e))}function Gs(t,e=[]){let n=[];function r(l,a){const c=M.createContext(a),d=n.length;n=[...n,a];const h=g=>{const{scope:b,children:v,...S}=g,x=b?.[t]?.[d]||c,C=M.useMemo(()=>S,Object.values(S));return T.jsx(x.Provider,{value:C,children:v})};h.displayName=l+"Provider";function p(g,b){const v=b?.[t]?.[d]||c,S=M.useContext(v);if(S)return S;if(a!==void 0)return a;throw new Error(`\`${g}\` must be used within \`${l}\``)}return[h,p]}const o=()=>{const l=n.map(a=>M.createContext(a));return function(c){const d=c?.[t]||l;return M.useMemo(()=>({[`__scope${t}`]:{...c,[t]:d}}),[c,d])}};return o.scopeName=t,[r,KD(o,...e)]}function KD(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(l){const a=r.reduce((c,{useScope:d,scopeName:h})=>{const g=d(l)[`__scope${h}`];return{...c,...g}},{});return M.useMemo(()=>({[`__scope${e.scopeName}`]:a}),[a])}};return n.scopeName=e.scopeName,n}function X1(t){const e=t+"CollectionProvider",[n,r]=Gs(e),[o,l]=n(e,{collectionRef:{current:null},itemMap:new Map}),a=x=>{const{scope:C,children:E}=x,A=tn.useRef(null),k=tn.useRef(new Map).current;return T.jsx(o,{scope:C,itemMap:k,collectionRef:A,children:E})};a.displayName=e;const c=t+"CollectionSlot",d=oa(c),h=tn.forwardRef((x,C)=>{const{scope:E,children:A}=x,k=l(c,E),D=hn(C,k.collectionRef);return T.jsx(d,{ref:D,children:A})});h.displayName=c;const p=t+"CollectionItemSlot",g="data-radix-collection-item",b=oa(p),v=tn.forwardRef((x,C)=>{const{scope:E,children:A,...k}=x,D=tn.useRef(null),L=hn(C,D),H=l(p,E);return tn.useEffect(()=>(H.itemMap.set(D,{ref:D,...k}),()=>{H.itemMap.delete(D)})),T.jsx(b,{[g]:"",ref:L,children:A})});v.displayName=p;function S(x){const C=l(t+"CollectionConsumer",x);return tn.useCallback(()=>{const A=C.collectionRef.current;if(!A)return[];const k=Array.from(A.querySelectorAll(`[${g}]`));return Array.from(C.itemMap.values()).sort((H,z)=>k.indexOf(H.ref.current)-k.indexOf(z.ref.current))},[C.collectionRef,C.itemMap])}return[{Provider:a,Slot:h,ItemSlot:v},S,r]}function je(t,e,{checkForDefaultPrevented:n=!0}={}){return function(o){if(t?.(o),n===!1||!o.defaultPrevented)return e?.(o)}}var _i=globalThis?.document?M.useLayoutEffect:()=>{},YD=f1[" useInsertionEffect ".trim().toString()]||_i;function rf({prop:t,defaultProp:e,onChange:n=()=>{},caller:r}){const[o,l,a]=XD({defaultProp:e,onChange:n}),c=t!==void 0,d=c?t:o;{const p=M.useRef(t!==void 0);M.useEffect(()=>{const g=p.current;g!==c&&console.warn(`${r} is changing from ${g?"controlled":"uncontrolled"} to ${c?"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.`),p.current=c},[c,r])}const h=M.useCallback(p=>{if(c){const g=JD(p)?p(t):p;g!==t&&a.current?.(g)}else l(p)},[c,t,l,a]);return[d,h]}function XD({defaultProp:t,onChange:e}){const[n,r]=M.useState(t),o=M.useRef(n),l=M.useRef(e);return YD(()=>{l.current=e},[e]),M.useEffect(()=>{o.current!==n&&(l.current?.(n),o.current=n)},[n,o]),[n,r,l]}function JD(t){return typeof t=="function"}function QD(t,e){return M.useReducer((n,r)=>e[n][r]??n,t)}var xa=t=>{const{present:e,children:n}=t,r=ZD(e),o=typeof n=="function"?n({present:r.isPresent}):M.Children.only(n),l=hn(r.ref,WD(o));return typeof n=="function"||r.isPresent?M.cloneElement(o,{ref:l}):null};xa.displayName="Presence";function ZD(t){const[e,n]=M.useState(),r=M.useRef(null),o=M.useRef(t),l=M.useRef("none"),a=t?"mounted":"unmounted",[c,d]=QD(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return M.useEffect(()=>{const h=tc(r.current);l.current=c==="mounted"?h:"none"},[c]),_i(()=>{const h=r.current,p=o.current;if(p!==t){const b=l.current,v=tc(h);t?d("MOUNT"):v==="none"||h?.display==="none"?d("UNMOUNT"):d(p&&b!==v?"ANIMATION_OUT":"UNMOUNT"),o.current=t}},[t,d]),_i(()=>{if(e){let h;const p=e.ownerDocument.defaultView??window,g=v=>{const x=tc(r.current).includes(CSS.escape(v.animationName));if(v.target===e&&x&&(d("ANIMATION_END"),!o.current)){const C=e.style.animationFillMode;e.style.animationFillMode="forwards",h=p.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=C)})}},b=v=>{v.target===e&&(l.current=tc(r.current))};return e.addEventListener("animationstart",b),e.addEventListener("animationcancel",g),e.addEventListener("animationend",g),()=>{p.clearTimeout(h),e.removeEventListener("animationstart",b),e.removeEventListener("animationcancel",g),e.removeEventListener("animationend",g)}}else d("ANIMATION_END")},[e,d]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:M.useCallback(h=>{r.current=h?getComputedStyle(h):null,n(h)},[])}}function tc(t){return t?.animationName||"none"}function WD(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var e_=f1[" useId ".trim().toString()]||(()=>{}),t_=0;function sa(t){const[e,n]=M.useState(e_());return _i(()=>{n(r=>r??String(t_++))},[t]),t||(e?`radix-${e}`:"")}var n_=M.createContext(void 0);function J1(t){const e=M.useContext(n_);return t||e||"ltr"}function Zn(t){const e=M.useRef(t);return M.useEffect(()=>{e.current=t}),M.useMemo(()=>(...n)=>e.current?.(...n),[])}function r_(t,e=globalThis?.document){const n=Zn(t);M.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return e.addEventListener("keydown",r,{capture:!0}),()=>e.removeEventListener("keydown",r,{capture:!0})},[n,e])}var i_="DismissableLayer",Jp="dismissableLayer.update",o_="dismissableLayer.pointerDownOutside",s_="dismissableLayer.focusOutside",Xb,Q1=M.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Z1=M.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:l,onInteractOutside:a,onDismiss:c,...d}=t,h=M.useContext(Q1),[p,g]=M.useState(null),b=p?.ownerDocument??globalThis?.document,[,v]=M.useState({}),S=hn(e,z=>g(z)),x=Array.from(h.layers),[C]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),E=x.indexOf(C),A=p?x.indexOf(p):-1,k=h.layersWithOutsidePointerEventsDisabled.size>0,D=A>=E,L=u_(z=>{const j=z.target,J=[...h.branches].some(le=>le.contains(j));!D||J||(o?.(z),a?.(z),z.defaultPrevented||c?.())},b),H=c_(z=>{const j=z.target;[...h.branches].some(le=>le.contains(j))||(l?.(z),a?.(z),z.defaultPrevented||c?.())},b);return r_(z=>{A===h.layers.size-1&&(r?.(z),!z.defaultPrevented&&c&&(z.preventDefault(),c()))},b),M.useEffect(()=>{if(p)return n&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(Xb=b.body.style.pointerEvents,b.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(p)),h.layers.add(p),Jb(),()=>{n&&h.layersWithOutsidePointerEventsDisabled.size===1&&(b.body.style.pointerEvents=Xb)}},[p,b,n,h]),M.useEffect(()=>()=>{p&&(h.layers.delete(p),h.layersWithOutsidePointerEventsDisabled.delete(p),Jb())},[p,h]),M.useEffect(()=>{const z=()=>v({});return document.addEventListener(Jp,z),()=>document.removeEventListener(Jp,z)},[]),T.jsx(Gt.div,{...d,ref:S,style:{pointerEvents:k?D?"auto":"none":void 0,...t.style},onFocusCapture:je(t.onFocusCapture,H.onFocusCapture),onBlurCapture:je(t.onBlurCapture,H.onBlurCapture),onPointerDownCapture:je(t.onPointerDownCapture,L.onPointerDownCapture)})});Z1.displayName=i_;var l_="DismissableLayerBranch",a_=M.forwardRef((t,e)=>{const n=M.useContext(Q1),r=M.useRef(null),o=hn(e,r);return M.useEffect(()=>{const l=r.current;if(l)return n.branches.add(l),()=>{n.branches.delete(l)}},[n.branches]),T.jsx(Gt.div,{...t,ref:o})});a_.displayName=l_;function u_(t,e=globalThis?.document){const n=Zn(t),r=M.useRef(!1),o=M.useRef(()=>{});return M.useEffect(()=>{const l=c=>{if(c.target&&!r.current){let d=function(){W1(o_,n,h,{discrete:!0})};const h={originalEvent:c};c.pointerType==="touch"?(e.removeEventListener("click",o.current),o.current=d,e.addEventListener("click",o.current,{once:!0})):d()}else e.removeEventListener("click",o.current);r.current=!1},a=window.setTimeout(()=>{e.addEventListener("pointerdown",l)},0);return()=>{window.clearTimeout(a),e.removeEventListener("pointerdown",l),e.removeEventListener("click",o.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function c_(t,e=globalThis?.document){const n=Zn(t),r=M.useRef(!1);return M.useEffect(()=>{const o=l=>{l.target&&!r.current&&W1(s_,n,{originalEvent:l},{discrete:!1})};return e.addEventListener("focusin",o),()=>e.removeEventListener("focusin",o)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Jb(){const t=new CustomEvent(Jp);document.dispatchEvent(t)}function W1(t,e,n,{discrete:r}){const o=n.originalEvent.target,l=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&o.addEventListener(t,e,{once:!0}),r?Y1(o,l):o.dispatchEvent(l)}var ep="focusScope.autoFocusOnMount",tp="focusScope.autoFocusOnUnmount",Qb={bubbles:!1,cancelable:!0},f_="FocusScope",ew=M.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:l,...a}=t,[c,d]=M.useState(null),h=Zn(o),p=Zn(l),g=M.useRef(null),b=hn(e,x=>d(x)),v=M.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;M.useEffect(()=>{if(r){let x=function(k){if(v.paused||!c)return;const D=k.target;c.contains(D)?g.current=D:bi(g.current,{select:!0})},C=function(k){if(v.paused||!c)return;const D=k.relatedTarget;D!==null&&(c.contains(D)||bi(g.current,{select:!0}))},E=function(k){if(document.activeElement===document.body)for(const L of k)L.removedNodes.length>0&&bi(c)};document.addEventListener("focusin",x),document.addEventListener("focusout",C);const A=new MutationObserver(E);return c&&A.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",x),document.removeEventListener("focusout",C),A.disconnect()}}},[r,c,v.paused]),M.useEffect(()=>{if(c){Wb.add(v);const x=document.activeElement;if(!c.contains(x)){const E=new CustomEvent(ep,Qb);c.addEventListener(ep,h),c.dispatchEvent(E),E.defaultPrevented||(d_(y_(tw(c)),{select:!0}),document.activeElement===x&&bi(c))}return()=>{c.removeEventListener(ep,h),setTimeout(()=>{const E=new CustomEvent(tp,Qb);c.addEventListener(tp,p),c.dispatchEvent(E),E.defaultPrevented||bi(x??document.body,{select:!0}),c.removeEventListener(tp,p),Wb.remove(v)},0)}}},[c,h,p,v]);const S=M.useCallback(x=>{if(!n&&!r||v.paused)return;const C=x.key==="Tab"&&!x.altKey&&!x.ctrlKey&&!x.metaKey,E=document.activeElement;if(C&&E){const A=x.currentTarget,[k,D]=h_(A);k&&D?!x.shiftKey&&E===D?(x.preventDefault(),n&&bi(k,{select:!0})):x.shiftKey&&E===k&&(x.preventDefault(),n&&bi(D,{select:!0})):E===A&&x.preventDefault()}},[n,r,v.paused]);return T.jsx(Gt.div,{tabIndex:-1,...a,ref:b,onKeyDown:S})});ew.displayName=f_;function d_(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(bi(r,{select:e}),document.activeElement!==n)return}function h_(t){const e=tw(t),n=Zb(e,t),r=Zb(e.reverse(),t);return[n,r]}function tw(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function Zb(t,e){for(const n of t)if(!p_(n,{upTo:e}))return n}function p_(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function m_(t){return t instanceof HTMLInputElement&&"select"in t}function bi(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&m_(t)&&e&&t.select()}}var Wb=g_();function g_(){let t=[];return{add(e){const n=t[0];e!==n&&n?.pause(),t=eS(t,e),t.unshift(e)},remove(e){t=eS(t,e),t[0]?.resume()}}}function eS(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function y_(t){return t.filter(e=>e.tagName!=="A")}var v_="Portal",nw=M.forwardRef((t,e)=>{const{container:n,...r}=t,[o,l]=M.useState(!1);_i(()=>l(!0),[]);const a=n||o&&globalThis?.document?.body;return a?O1.createPortal(T.jsx(Gt.div,{...r,ref:e}),a):null});nw.displayName=v_;var np=0;function b_(){M.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??tS()),document.body.insertAdjacentElement("beforeend",t[1]??tS()),np++,()=>{np===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),np--}},[])}function tS(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var lr=function(){return lr=Object.assign||function(e){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var l in n)Object.prototype.hasOwnProperty.call(n,l)&&(e[l]=n[l])}return e},lr.apply(this,arguments)};function rw(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]]);return n}function S_(t,e,n){if(n||arguments.length===2)for(var r=0,o=e.length,l;r<o;r++)(l||!(r in e))&&(l||(l=Array.prototype.slice.call(e,0,r)),l[r]=e[r]);return t.concat(l||Array.prototype.slice.call(e))}var vc="right-scroll-bar-position",bc="width-before-scroll-bar",x_="with-scroll-bars-hidden",w_="--removed-body-scroll-bar-size";function rp(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function C_(t,e){var n=M.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=e,n.facade}var M_=typeof window<"u"?M.useLayoutEffect:M.useEffect,nS=new WeakMap;function E_(t,e){var n=C_(null,function(r){return t.forEach(function(o){return rp(o,r)})});return M_(function(){var r=nS.get(n);if(r){var o=new Set(r),l=new Set(t),a=n.current;o.forEach(function(c){l.has(c)||rp(c,null)}),l.forEach(function(c){o.has(c)||rp(c,a)})}nS.set(n,t)},[t]),n}function R_(t){return t}function T_(t,e){e===void 0&&(e=R_);var n=[],r=!1,o={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]:t},useMedium:function(l){var a=e(l,r);return n.push(a),function(){n=n.filter(function(c){return c!==a})}},assignSyncMedium:function(l){for(r=!0;n.length;){var a=n;n=[],a.forEach(l)}n={push:function(c){return l(c)},filter:function(){return n}}},assignMedium:function(l){r=!0;var a=[];if(n.length){var c=n;n=[],c.forEach(l),a=n}var d=function(){var p=a;a=[],p.forEach(l)},h=function(){return Promise.resolve().then(d)};h(),n={push:function(p){a.push(p),h()},filter:function(p){return a=a.filter(p),n}}}};return o}function A_(t){t===void 0&&(t={});var e=T_(null);return e.options=lr({async:!0,ssr:!1},t),e}var iw=function(t){var e=t.sideCar,n=rw(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=e.read();if(!r)throw new Error("Sidecar medium not found");return M.createElement(r,lr({},n))};iw.isSideCarExport=!0;function O_(t,e){return t.useMedium(e),iw}var ow=A_(),ip=function(){},of=M.forwardRef(function(t,e){var n=M.useRef(null),r=M.useState({onScrollCapture:ip,onWheelCapture:ip,onTouchMoveCapture:ip}),o=r[0],l=r[1],a=t.forwardProps,c=t.children,d=t.className,h=t.removeScrollBar,p=t.enabled,g=t.shards,b=t.sideCar,v=t.noRelative,S=t.noIsolation,x=t.inert,C=t.allowPinchZoom,E=t.as,A=E===void 0?"div":E,k=t.gapMode,D=rw(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),L=b,H=E_([n,e]),z=lr(lr({},D),o);return M.createElement(M.Fragment,null,p&&M.createElement(L,{sideCar:ow,removeScrollBar:h,shards:g,noRelative:v,noIsolation:S,inert:x,setCallbacks:l,allowPinchZoom:!!C,lockRef:n,gapMode:k}),a?M.cloneElement(M.Children.only(c),lr(lr({},z),{ref:H})):M.createElement(A,lr({},z,{className:d,ref:H}),c))});of.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};of.classNames={fullWidth:bc,zeroRight:vc};var k_=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function N_(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=k_();return e&&t.setAttribute("nonce",e),t}function D_(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function __(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var z_=function(){var t=0,e=null;return{add:function(n){t==0&&(e=N_())&&(D_(e,n),__(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},j_=function(){var t=z_();return function(e,n){M.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},sw=function(){var t=j_(),e=function(n){var r=n.styles,o=n.dynamic;return t(r,o),null};return e},L_={left:0,top:0,right:0,gap:0},op=function(t){return parseInt(t||"",10)||0},B_=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],r=e[t==="padding"?"paddingTop":"marginTop"],o=e[t==="padding"?"paddingRight":"marginRight"];return[op(n),op(r),op(o)]},I_=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return L_;var e=B_(t),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-n+e[2]-e[0])}},V_=sw(),zs="data-scroll-locked",F_=function(t,e,n,r){var o=t.left,l=t.top,a=t.right,c=t.gap;return n===void 0&&(n="margin"),`
|
|
16
|
+
.`.concat(x_,` {
|
|
17
|
+
overflow: hidden `).concat(r,`;
|
|
18
|
+
padding-right: `).concat(c,"px ").concat(r,`;
|
|
19
|
+
}
|
|
20
|
+
body[`).concat(zs,`] {
|
|
21
|
+
overflow: hidden `).concat(r,`;
|
|
22
|
+
overscroll-behavior: contain;
|
|
23
|
+
`).concat([e&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
24
|
+
padding-left: `.concat(o,`px;
|
|
25
|
+
padding-top: `).concat(l,`px;
|
|
26
|
+
padding-right: `).concat(a,`px;
|
|
27
|
+
margin-left:0;
|
|
28
|
+
margin-top:0;
|
|
29
|
+
margin-right: `).concat(c,"px ").concat(r,`;
|
|
30
|
+
`),n==="padding"&&"padding-right: ".concat(c,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.`).concat(vc,` {
|
|
34
|
+
right: `).concat(c,"px ").concat(r,`;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.`).concat(bc,` {
|
|
38
|
+
margin-right: `).concat(c,"px ").concat(r,`;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.`).concat(vc," .").concat(vc,` {
|
|
42
|
+
right: 0 `).concat(r,`;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.`).concat(bc," .").concat(bc,` {
|
|
46
|
+
margin-right: 0 `).concat(r,`;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
body[`).concat(zs,`] {
|
|
50
|
+
`).concat(w_,": ").concat(c,`px;
|
|
51
|
+
}
|
|
52
|
+
`)},rS=function(){var t=parseInt(document.body.getAttribute(zs)||"0",10);return isFinite(t)?t:0},P_=function(){M.useEffect(function(){return document.body.setAttribute(zs,(rS()+1).toString()),function(){var t=rS()-1;t<=0?document.body.removeAttribute(zs):document.body.setAttribute(zs,t.toString())}},[])},$_=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,o=r===void 0?"margin":r;P_();var l=M.useMemo(function(){return I_(o)},[o]);return M.createElement(V_,{styles:F_(l,!e,o,n?"":"!important")})},Qp=!1;if(typeof window<"u")try{var nc=Object.defineProperty({},"passive",{get:function(){return Qp=!0,!0}});window.addEventListener("test",nc,nc),window.removeEventListener("test",nc,nc)}catch{Qp=!1}var Cs=Qp?{passive:!1}:!1,H_=function(t){return t.tagName==="TEXTAREA"},lw=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!H_(t)&&n[e]==="visible")},U_=function(t){return lw(t,"overflowY")},q_=function(t){return lw(t,"overflowX")},iS=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=aw(t,r);if(o){var l=uw(t,r),a=l[1],c=l[2];if(a>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},G_=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},K_=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},aw=function(t,e){return t==="v"?U_(e):q_(e)},uw=function(t,e){return t==="v"?G_(e):K_(e)},Y_=function(t,e){return t==="h"&&e==="rtl"?-1:1},X_=function(t,e,n,r,o){var l=Y_(t,window.getComputedStyle(e).direction),a=l*r,c=n.target,d=e.contains(c),h=!1,p=a>0,g=0,b=0;do{if(!c)break;var v=uw(t,c),S=v[0],x=v[1],C=v[2],E=x-C-l*S;(S||E)&&aw(t,c)&&(g+=E,b+=S);var A=c.parentNode;c=A&&A.nodeType===Node.DOCUMENT_FRAGMENT_NODE?A.host:A}while(!d&&c!==document.body||d&&(e.contains(c)||e===c));return(p&&Math.abs(g)<1||!p&&Math.abs(b)<1)&&(h=!0),h},rc=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},oS=function(t){return[t.deltaX,t.deltaY]},sS=function(t){return t&&"current"in t?t.current:t},J_=function(t,e){return t[0]===e[0]&&t[1]===e[1]},Q_=function(t){return`
|
|
53
|
+
.block-interactivity-`.concat(t,` {pointer-events: none;}
|
|
54
|
+
.allow-interactivity-`).concat(t,` {pointer-events: all;}
|
|
55
|
+
`)},Z_=0,Ms=[];function W_(t){var e=M.useRef([]),n=M.useRef([0,0]),r=M.useRef(),o=M.useState(Z_++)[0],l=M.useState(sw)[0],a=M.useRef(t);M.useEffect(function(){a.current=t},[t]),M.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(o));var x=S_([t.lockRef.current],(t.shards||[]).map(sS),!0).filter(Boolean);return x.forEach(function(C){return C.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),x.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(o))})}}},[t.inert,t.lockRef.current,t.shards]);var c=M.useCallback(function(x,C){if("touches"in x&&x.touches.length===2||x.type==="wheel"&&x.ctrlKey)return!a.current.allowPinchZoom;var E=rc(x),A=n.current,k="deltaX"in x?x.deltaX:A[0]-E[0],D="deltaY"in x?x.deltaY:A[1]-E[1],L,H=x.target,z=Math.abs(k)>Math.abs(D)?"h":"v";if("touches"in x&&z==="h"&&H.type==="range")return!1;var j=window.getSelection(),J=j&&j.anchorNode,le=J?J===H||J.contains(H):!1;if(le)return!1;var ce=iS(z,H);if(!ce)return!0;if(ce?L=z:(L=z==="v"?"h":"v",ce=iS(z,H)),!ce)return!1;if(!r.current&&"changedTouches"in x&&(k||D)&&(r.current=L),!L)return!0;var se=r.current||L;return X_(se,C,x,se==="h"?k:D)},[]),d=M.useCallback(function(x){var C=x;if(!(!Ms.length||Ms[Ms.length-1]!==l)){var E="deltaY"in C?oS(C):rc(C),A=e.current.filter(function(L){return L.name===C.type&&(L.target===C.target||C.target===L.shadowParent)&&J_(L.delta,E)})[0];if(A&&A.should){C.cancelable&&C.preventDefault();return}if(!A){var k=(a.current.shards||[]).map(sS).filter(Boolean).filter(function(L){return L.contains(C.target)}),D=k.length>0?c(C,k[0]):!a.current.noIsolation;D&&C.cancelable&&C.preventDefault()}}},[]),h=M.useCallback(function(x,C,E,A){var k={name:x,delta:C,target:E,should:A,shadowParent:e2(E)};e.current.push(k),setTimeout(function(){e.current=e.current.filter(function(D){return D!==k})},1)},[]),p=M.useCallback(function(x){n.current=rc(x),r.current=void 0},[]),g=M.useCallback(function(x){h(x.type,oS(x),x.target,c(x,t.lockRef.current))},[]),b=M.useCallback(function(x){h(x.type,rc(x),x.target,c(x,t.lockRef.current))},[]);M.useEffect(function(){return Ms.push(l),t.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:b}),document.addEventListener("wheel",d,Cs),document.addEventListener("touchmove",d,Cs),document.addEventListener("touchstart",p,Cs),function(){Ms=Ms.filter(function(x){return x!==l}),document.removeEventListener("wheel",d,Cs),document.removeEventListener("touchmove",d,Cs),document.removeEventListener("touchstart",p,Cs)}},[]);var v=t.removeScrollBar,S=t.inert;return M.createElement(M.Fragment,null,S?M.createElement(l,{styles:Q_(o)}):null,v?M.createElement($_,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function e2(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const t2=O_(ow,W_);var cw=M.forwardRef(function(t,e){return M.createElement(of,lr({},t,{ref:e,sideCar:t2}))});cw.classNames=of.classNames;var n2=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},Es=new WeakMap,ic=new WeakMap,oc={},sp=0,fw=function(t){return t&&(t.host||fw(t.parentNode))},r2=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=fw(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},i2=function(t,e,n,r){var o=r2(e,Array.isArray(t)?t:[t]);oc[n]||(oc[n]=new WeakMap);var l=oc[n],a=[],c=new Set,d=new Set(o),h=function(g){!g||c.has(g)||(c.add(g),h(g.parentNode))};o.forEach(h);var p=function(g){!g||d.has(g)||Array.prototype.forEach.call(g.children,function(b){if(c.has(b))p(b);else try{var v=b.getAttribute(r),S=v!==null&&v!=="false",x=(Es.get(b)||0)+1,C=(l.get(b)||0)+1;Es.set(b,x),l.set(b,C),a.push(b),x===1&&S&&ic.set(b,!0),C===1&&b.setAttribute(n,"true"),S||b.setAttribute(r,"true")}catch(E){console.error("aria-hidden: cannot operate on ",b,E)}})};return p(e),c.clear(),sp++,function(){a.forEach(function(g){var b=Es.get(g)-1,v=l.get(g)-1;Es.set(g,b),l.set(g,v),b||(ic.has(g)||g.removeAttribute(r),ic.delete(g)),v||g.removeAttribute(n)}),sp--,sp||(Es=new WeakMap,Es=new WeakMap,ic=new WeakMap,oc={})}},o2=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),o=n2(t);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),i2(r,o,n,"aria-hidden")):function(){return null}},lp={exports:{}},ap={};var lS;function s2(){if(lS)return ap;lS=1;var t=ba();function e(g,b){return g===b&&(g!==0||1/g===1/b)||g!==g&&b!==b}var n=typeof Object.is=="function"?Object.is:e,r=t.useState,o=t.useEffect,l=t.useLayoutEffect,a=t.useDebugValue;function c(g,b){var v=b(),S=r({inst:{value:v,getSnapshot:b}}),x=S[0].inst,C=S[1];return l(function(){x.value=v,x.getSnapshot=b,d(x)&&C({inst:x})},[g,v,b]),o(function(){return d(x)&&C({inst:x}),g(function(){d(x)&&C({inst:x})})},[g]),a(v),v}function d(g){var b=g.getSnapshot;g=g.value;try{var v=b();return!n(g,v)}catch{return!0}}function h(g,b){return b()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:c;return ap.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:p,ap}var aS;function dw(){return aS||(aS=1,lp.exports=s2()),lp.exports}var hw=dw();function l2(t){const[e,n]=M.useState(void 0);return _i(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const l=o[0];let a,c;if("borderBoxSize"in l){const d=l.borderBoxSize,h=Array.isArray(d)?d[0]:d;a=h.inlineSize,c=h.blockSize}else a=t.offsetWidth,c=t.offsetHeight;n({width:a,height:c})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}const a2=["top","right","bottom","left"],zi=Math.min,wn=Math.max,Tc=Math.round,sc=Math.floor,ur=t=>({x:t,y:t}),u2={left:"right",right:"left",bottom:"top",top:"bottom"};function Zp(t,e,n){return wn(t,zi(e,n))}function Fr(t,e){return typeof t=="function"?t(e):t}function Pr(t){return t.split("-")[0]}function Ks(t){return t.split("-")[1]}function jm(t){return t==="x"?"y":"x"}function Lm(t){return t==="y"?"height":"width"}function ar(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function Bm(t){return jm(ar(t))}function c2(t,e,n){n===void 0&&(n=!1);const r=Ks(t),o=Bm(t),l=Lm(o);let a=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[l]>e.floating[l]&&(a=Ac(a)),[a,Ac(a)]}function f2(t){const e=Ac(t);return[Wp(t),e,Wp(e)]}function Wp(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const uS=["left","right"],cS=["right","left"],d2=["top","bottom"],h2=["bottom","top"];function p2(t,e,n){switch(t){case"top":case"bottom":return n?e?cS:uS:e?uS:cS;case"left":case"right":return e?d2:h2;default:return[]}}function m2(t,e,n,r){const o=Ks(t);let l=p2(Pr(t),n==="start",r);return o&&(l=l.map(a=>a+"-"+o),e&&(l=l.concat(l.map(Wp)))),l}function Ac(t){const e=Pr(t);return u2[e]+t.slice(e.length)}function g2(t){return{top:0,right:0,bottom:0,left:0,...t}}function pw(t){return typeof t!="number"?g2(t):{top:t,right:t,bottom:t,left:t}}function Oc(t){const{x:e,y:n,width:r,height:o}=t;return{width:r,height:o,top:n,left:e,right:e+r,bottom:n+o,x:e,y:n}}function fS(t,e,n){let{reference:r,floating:o}=t;const l=ar(e),a=Bm(e),c=Lm(a),d=Pr(e),h=l==="y",p=r.x+r.width/2-o.width/2,g=r.y+r.height/2-o.height/2,b=r[c]/2-o[c]/2;let v;switch(d){case"top":v={x:p,y:r.y-o.height};break;case"bottom":v={x:p,y:r.y+r.height};break;case"right":v={x:r.x+r.width,y:g};break;case"left":v={x:r.x-o.width,y:g};break;default:v={x:r.x,y:r.y}}switch(Ks(e)){case"start":v[a]-=b*(n&&h?-1:1);break;case"end":v[a]+=b*(n&&h?-1:1);break}return v}async function y2(t,e){var n;e===void 0&&(e={});const{x:r,y:o,platform:l,rects:a,elements:c,strategy:d}=t,{boundary:h="clippingAncestors",rootBoundary:p="viewport",elementContext:g="floating",altBoundary:b=!1,padding:v=0}=Fr(e,t),S=pw(v),C=c[b?g==="floating"?"reference":"floating":g],E=Oc(await l.getClippingRect({element:(n=await(l.isElement==null?void 0:l.isElement(C)))==null||n?C:C.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(c.floating)),boundary:h,rootBoundary:p,strategy:d})),A=g==="floating"?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,k=await(l.getOffsetParent==null?void 0:l.getOffsetParent(c.floating)),D=await(l.isElement==null?void 0:l.isElement(k))?await(l.getScale==null?void 0:l.getScale(k))||{x:1,y:1}:{x:1,y:1},L=Oc(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:A,offsetParent:k,strategy:d}):A);return{top:(E.top-L.top+S.top)/D.y,bottom:(L.bottom-E.bottom+S.bottom)/D.y,left:(E.left-L.left+S.left)/D.x,right:(L.right-E.right+S.right)/D.x}}const v2=50,b2=async(t,e,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:l=[],platform:a}=n,c=a.detectOverflow?a:{...a,detectOverflow:y2},d=await(a.isRTL==null?void 0:a.isRTL(e));let h=await a.getElementRects({reference:t,floating:e,strategy:o}),{x:p,y:g}=fS(h,r,d),b=r,v=0;const S={};for(let x=0;x<l.length;x++){const C=l[x];if(!C)continue;const{name:E,fn:A}=C,{x:k,y:D,data:L,reset:H}=await A({x:p,y:g,initialPlacement:r,placement:b,strategy:o,middlewareData:S,rects:h,platform:c,elements:{reference:t,floating:e}});p=k??p,g=D??g,S[E]={...S[E],...L},H&&v<v2&&(v++,typeof H=="object"&&(H.placement&&(b=H.placement),H.rects&&(h=H.rects===!0?await a.getElementRects({reference:t,floating:e,strategy:o}):H.rects),{x:p,y:g}=fS(h,b,d)),x=-1)}return{x:p,y:g,placement:b,strategy:o,middlewareData:S}},S2=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:o,rects:l,platform:a,elements:c,middlewareData:d}=e,{element:h,padding:p=0}=Fr(t,e)||{};if(h==null)return{};const g=pw(p),b={x:n,y:r},v=Bm(o),S=Lm(v),x=await a.getDimensions(h),C=v==="y",E=C?"top":"left",A=C?"bottom":"right",k=C?"clientHeight":"clientWidth",D=l.reference[S]+l.reference[v]-b[v]-l.floating[S],L=b[v]-l.reference[v],H=await(a.getOffsetParent==null?void 0:a.getOffsetParent(h));let z=H?H[k]:0;(!z||!await(a.isElement==null?void 0:a.isElement(H)))&&(z=c.floating[k]||l.floating[S]);const j=D/2-L/2,J=z/2-x[S]/2-1,le=zi(g[E],J),ce=zi(g[A],J),se=le,Se=z-x[S]-ce,ne=z/2-x[S]/2+j,me=Zp(se,ne,Se),I=!d.arrow&&Ks(o)!=null&&ne!==me&&l.reference[S]/2-(ne<se?le:ce)-x[S]/2<0,Q=I?ne<se?ne-se:ne-Se:0;return{[v]:b[v]+Q,data:{[v]:me,centerOffset:ne-me-Q,...I&&{alignmentOffset:Q}},reset:I}}}),x2=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:o,middlewareData:l,rects:a,initialPlacement:c,platform:d,elements:h}=e,{mainAxis:p=!0,crossAxis:g=!0,fallbackPlacements:b,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:S="none",flipAlignment:x=!0,...C}=Fr(t,e);if((n=l.arrow)!=null&&n.alignmentOffset)return{};const E=Pr(o),A=ar(c),k=Pr(c)===c,D=await(d.isRTL==null?void 0:d.isRTL(h.floating)),L=b||(k||!x?[Ac(c)]:f2(c)),H=S!=="none";!b&&H&&L.push(...m2(c,x,S,D));const z=[c,...L],j=await d.detectOverflow(e,C),J=[];let le=((r=l.flip)==null?void 0:r.overflows)||[];if(p&&J.push(j[E]),g){const ne=c2(o,a,D);J.push(j[ne[0]],j[ne[1]])}if(le=[...le,{placement:o,overflows:J}],!J.every(ne=>ne<=0)){var ce,se;const ne=(((ce=l.flip)==null?void 0:ce.index)||0)+1,me=z[ne];if(me&&(!(g==="alignment"?A!==ar(me):!1)||le.every(U=>ar(U.placement)===A?U.overflows[0]>0:!0)))return{data:{index:ne,overflows:le},reset:{placement:me}};let I=(se=le.filter(Q=>Q.overflows[0]<=0).sort((Q,U)=>Q.overflows[1]-U.overflows[1])[0])==null?void 0:se.placement;if(!I)switch(v){case"bestFit":{var Se;const Q=(Se=le.filter(U=>{if(H){const K=ar(U.placement);return K===A||K==="y"}return!0}).map(U=>[U.placement,U.overflows.filter(K=>K>0).reduce((K,G)=>K+G,0)]).sort((U,K)=>U[1]-K[1])[0])==null?void 0:Se[0];Q&&(I=Q);break}case"initialPlacement":I=c;break}if(o!==I)return{reset:{placement:I}}}return{}}}};function dS(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function hS(t){return a2.some(e=>t[e]>=0)}const w2=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:r}=e,{strategy:o="referenceHidden",...l}=Fr(t,e);switch(o){case"referenceHidden":{const a=await r.detectOverflow(e,{...l,elementContext:"reference"}),c=dS(a,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:hS(c)}}}case"escaped":{const a=await r.detectOverflow(e,{...l,altBoundary:!0}),c=dS(a,n.floating);return{data:{escapedOffsets:c,escaped:hS(c)}}}default:return{}}}}},mw=new Set(["left","top"]);async function C2(t,e){const{placement:n,platform:r,elements:o}=t,l=await(r.isRTL==null?void 0:r.isRTL(o.floating)),a=Pr(n),c=Ks(n),d=ar(n)==="y",h=mw.has(a)?-1:1,p=l&&d?-1:1,g=Fr(e,t);let{mainAxis:b,crossAxis:v,alignmentAxis:S}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return c&&typeof S=="number"&&(v=c==="end"?S*-1:S),d?{x:v*p,y:b*h}:{x:b*h,y:v*p}}const M2=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:o,y:l,placement:a,middlewareData:c}=e,d=await C2(e,t);return a===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:o+d.x,y:l+d.y,data:{...d,placement:a}}}}},E2=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:o,platform:l}=e,{mainAxis:a=!0,crossAxis:c=!1,limiter:d={fn:E=>{let{x:A,y:k}=E;return{x:A,y:k}}},...h}=Fr(t,e),p={x:n,y:r},g=await l.detectOverflow(e,h),b=ar(Pr(o)),v=jm(b);let S=p[v],x=p[b];if(a){const E=v==="y"?"top":"left",A=v==="y"?"bottom":"right",k=S+g[E],D=S-g[A];S=Zp(k,S,D)}if(c){const E=b==="y"?"top":"left",A=b==="y"?"bottom":"right",k=x+g[E],D=x-g[A];x=Zp(k,x,D)}const C=d.fn({...e,[v]:S,[b]:x});return{...C,data:{x:C.x-n,y:C.y-r,enabled:{[v]:a,[b]:c}}}}}},R2=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:o,rects:l,middlewareData:a}=e,{offset:c=0,mainAxis:d=!0,crossAxis:h=!0}=Fr(t,e),p={x:n,y:r},g=ar(o),b=jm(g);let v=p[b],S=p[g];const x=Fr(c,e),C=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(d){const k=b==="y"?"height":"width",D=l.reference[b]-l.floating[k]+C.mainAxis,L=l.reference[b]+l.reference[k]-C.mainAxis;v<D?v=D:v>L&&(v=L)}if(h){var E,A;const k=b==="y"?"width":"height",D=mw.has(Pr(o)),L=l.reference[g]-l.floating[k]+(D&&((E=a.offset)==null?void 0:E[g])||0)+(D?0:C.crossAxis),H=l.reference[g]+l.reference[k]+(D?0:((A=a.offset)==null?void 0:A[g])||0)-(D?C.crossAxis:0);S<L?S=L:S>H&&(S=H)}return{[b]:v,[g]:S}}}},T2=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:o,rects:l,platform:a,elements:c}=e,{apply:d=()=>{},...h}=Fr(t,e),p=await a.detectOverflow(e,h),g=Pr(o),b=Ks(o),v=ar(o)==="y",{width:S,height:x}=l.floating;let C,E;g==="top"||g==="bottom"?(C=g,E=b===(await(a.isRTL==null?void 0:a.isRTL(c.floating))?"start":"end")?"left":"right"):(E=g,C=b==="end"?"top":"bottom");const A=x-p.top-p.bottom,k=S-p.left-p.right,D=zi(x-p[C],A),L=zi(S-p[E],k),H=!e.middlewareData.shift;let z=D,j=L;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(j=k),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(z=A),H&&!b){const le=wn(p.left,0),ce=wn(p.right,0),se=wn(p.top,0),Se=wn(p.bottom,0);v?j=S-2*(le!==0||ce!==0?le+ce:wn(p.left,p.right)):z=x-2*(se!==0||Se!==0?se+Se:wn(p.top,p.bottom))}await d({...e,availableWidth:j,availableHeight:z});const J=await a.getDimensions(c.floating);return S!==J.width||x!==J.height?{reset:{rects:!0}}:{}}}};function sf(){return typeof window<"u"}function Ys(t){return gw(t)?(t.nodeName||"").toLowerCase():"#document"}function Mn(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function dr(t){var e;return(e=(gw(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function gw(t){return sf()?t instanceof Node||t instanceof Mn(t).Node:!1}function Wn(t){return sf()?t instanceof Element||t instanceof Mn(t).Element:!1}function $r(t){return sf()?t instanceof HTMLElement||t instanceof Mn(t).HTMLElement:!1}function pS(t){return!sf()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Mn(t).ShadowRoot}function wa(t){const{overflow:e,overflowX:n,overflowY:r,display:o}=er(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&o!=="inline"&&o!=="contents"}function A2(t){return/^(table|td|th)$/.test(Ys(t))}function lf(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const O2=/transform|translate|scale|rotate|perspective|filter/,k2=/paint|layout|strict|content/,uo=t=>!!t&&t!=="none";let up;function Im(t){const e=Wn(t)?er(t):t;return uo(e.transform)||uo(e.translate)||uo(e.scale)||uo(e.rotate)||uo(e.perspective)||!Vm()&&(uo(e.backdropFilter)||uo(e.filter))||O2.test(e.willChange||"")||k2.test(e.contain||"")}function N2(t){let e=ji(t);for(;$r(e)&&!Vs(e);){if(Im(e))return e;if(lf(e))return null;e=ji(e)}return null}function Vm(){return up==null&&(up=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),up}function Vs(t){return/^(html|body|#document)$/.test(Ys(t))}function er(t){return Mn(t).getComputedStyle(t)}function af(t){return Wn(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function ji(t){if(Ys(t)==="html")return t;const e=t.assignedSlot||t.parentNode||pS(t)&&t.host||dr(t);return pS(e)?e.host:e}function yw(t){const e=ji(t);return Vs(e)?t.ownerDocument?t.ownerDocument.body:t.body:$r(e)&&wa(e)?e:yw(e)}function la(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const o=yw(t),l=o===((r=t.ownerDocument)==null?void 0:r.body),a=Mn(o);if(l){const c=em(a);return e.concat(a,a.visualViewport||[],wa(o)?o:[],c&&n?la(c):[])}else return e.concat(o,la(o,[],n))}function em(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function vw(t){const e=er(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const o=$r(t),l=o?t.offsetWidth:n,a=o?t.offsetHeight:r,c=Tc(n)!==l||Tc(r)!==a;return c&&(n=l,r=a),{width:n,height:r,$:c}}function Fm(t){return Wn(t)?t:t.contextElement}function js(t){const e=Fm(t);if(!$r(e))return ur(1);const n=e.getBoundingClientRect(),{width:r,height:o,$:l}=vw(e);let a=(l?Tc(n.width):n.width)/r,c=(l?Tc(n.height):n.height)/o;return(!a||!Number.isFinite(a))&&(a=1),(!c||!Number.isFinite(c))&&(c=1),{x:a,y:c}}const D2=ur(0);function bw(t){const e=Mn(t);return!Vm()||!e.visualViewport?D2:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function _2(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Mn(t)?!1:e}function xo(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const o=t.getBoundingClientRect(),l=Fm(t);let a=ur(1);e&&(r?Wn(r)&&(a=js(r)):a=js(t));const c=_2(l,n,r)?bw(l):ur(0);let d=(o.left+c.x)/a.x,h=(o.top+c.y)/a.y,p=o.width/a.x,g=o.height/a.y;if(l){const b=Mn(l),v=r&&Wn(r)?Mn(r):r;let S=b,x=em(S);for(;x&&r&&v!==S;){const C=js(x),E=x.getBoundingClientRect(),A=er(x),k=E.left+(x.clientLeft+parseFloat(A.paddingLeft))*C.x,D=E.top+(x.clientTop+parseFloat(A.paddingTop))*C.y;d*=C.x,h*=C.y,p*=C.x,g*=C.y,d+=k,h+=D,S=Mn(x),x=em(S)}}return Oc({width:p,height:g,x:d,y:h})}function uf(t,e){const n=af(t).scrollLeft;return e?e.left+n:xo(dr(t)).left+n}function Sw(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-uf(t,n),o=n.top+e.scrollTop;return{x:r,y:o}}function z2(t){let{elements:e,rect:n,offsetParent:r,strategy:o}=t;const l=o==="fixed",a=dr(r),c=e?lf(e.floating):!1;if(r===a||c&&l)return n;let d={scrollLeft:0,scrollTop:0},h=ur(1);const p=ur(0),g=$r(r);if((g||!g&&!l)&&((Ys(r)!=="body"||wa(a))&&(d=af(r)),g)){const v=xo(r);h=js(r),p.x=v.x+r.clientLeft,p.y=v.y+r.clientTop}const b=a&&!g&&!l?Sw(a,d):ur(0);return{width:n.width*h.x,height:n.height*h.y,x:n.x*h.x-d.scrollLeft*h.x+p.x+b.x,y:n.y*h.y-d.scrollTop*h.y+p.y+b.y}}function j2(t){return Array.from(t.getClientRects())}function L2(t){const e=dr(t),n=af(t),r=t.ownerDocument.body,o=wn(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),l=wn(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+uf(t);const c=-n.scrollTop;return er(r).direction==="rtl"&&(a+=wn(e.clientWidth,r.clientWidth)-o),{width:o,height:l,x:a,y:c}}const mS=25;function B2(t,e){const n=Mn(t),r=dr(t),o=n.visualViewport;let l=r.clientWidth,a=r.clientHeight,c=0,d=0;if(o){l=o.width,a=o.height;const p=Vm();(!p||p&&e==="fixed")&&(c=o.offsetLeft,d=o.offsetTop)}const h=uf(r);if(h<=0){const p=r.ownerDocument,g=p.body,b=getComputedStyle(g),v=p.compatMode==="CSS1Compat"&&parseFloat(b.marginLeft)+parseFloat(b.marginRight)||0,S=Math.abs(r.clientWidth-g.clientWidth-v);S<=mS&&(l-=S)}else h<=mS&&(l+=h);return{width:l,height:a,x:c,y:d}}function I2(t,e){const n=xo(t,!0,e==="fixed"),r=n.top+t.clientTop,o=n.left+t.clientLeft,l=$r(t)?js(t):ur(1),a=t.clientWidth*l.x,c=t.clientHeight*l.y,d=o*l.x,h=r*l.y;return{width:a,height:c,x:d,y:h}}function gS(t,e,n){let r;if(e==="viewport")r=B2(t,n);else if(e==="document")r=L2(dr(t));else if(Wn(e))r=I2(e,n);else{const o=bw(t);r={x:e.x-o.x,y:e.y-o.y,width:e.width,height:e.height}}return Oc(r)}function xw(t,e){const n=ji(t);return n===e||!Wn(n)||Vs(n)?!1:er(n).position==="fixed"||xw(n,e)}function V2(t,e){const n=e.get(t);if(n)return n;let r=la(t,[],!1).filter(c=>Wn(c)&&Ys(c)!=="body"),o=null;const l=er(t).position==="fixed";let a=l?ji(t):t;for(;Wn(a)&&!Vs(a);){const c=er(a),d=Im(a);!d&&c.position==="fixed"&&(o=null),(l?!d&&!o:!d&&c.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||wa(a)&&!d&&xw(t,a))?r=r.filter(p=>p!==a):o=c,a=ji(a)}return e.set(t,r),r}function F2(t){let{element:e,boundary:n,rootBoundary:r,strategy:o}=t;const a=[...n==="clippingAncestors"?lf(e)?[]:V2(e,this._c):[].concat(n),r],c=gS(e,a[0],o);let d=c.top,h=c.right,p=c.bottom,g=c.left;for(let b=1;b<a.length;b++){const v=gS(e,a[b],o);d=wn(v.top,d),h=zi(v.right,h),p=zi(v.bottom,p),g=wn(v.left,g)}return{width:h-g,height:p-d,x:g,y:d}}function P2(t){const{width:e,height:n}=vw(t);return{width:e,height:n}}function $2(t,e,n){const r=$r(e),o=dr(e),l=n==="fixed",a=xo(t,!0,l,e);let c={scrollLeft:0,scrollTop:0};const d=ur(0);function h(){d.x=uf(o)}if(r||!r&&!l)if((Ys(e)!=="body"||wa(o))&&(c=af(e)),r){const v=xo(e,!0,l,e);d.x=v.x+e.clientLeft,d.y=v.y+e.clientTop}else o&&h();l&&!r&&o&&h();const p=o&&!r&&!l?Sw(o,c):ur(0),g=a.left+c.scrollLeft-d.x-p.x,b=a.top+c.scrollTop-d.y-p.y;return{x:g,y:b,width:a.width,height:a.height}}function cp(t){return er(t).position==="static"}function yS(t,e){if(!$r(t)||er(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return dr(t)===n&&(n=n.ownerDocument.body),n}function ww(t,e){const n=Mn(t);if(lf(t))return n;if(!$r(t)){let o=ji(t);for(;o&&!Vs(o);){if(Wn(o)&&!cp(o))return o;o=ji(o)}return n}let r=yS(t,e);for(;r&&A2(r)&&cp(r);)r=yS(r,e);return r&&Vs(r)&&cp(r)&&!Im(r)?n:r||N2(t)||n}const H2=async function(t){const e=this.getOffsetParent||ww,n=this.getDimensions,r=await n(t.floating);return{reference:$2(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function U2(t){return er(t).direction==="rtl"}const q2={convertOffsetParentRelativeRectToViewportRelativeRect:z2,getDocumentElement:dr,getClippingRect:F2,getOffsetParent:ww,getElementRects:H2,getClientRects:j2,getDimensions:P2,getScale:js,isElement:Wn,isRTL:U2};function Cw(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function G2(t,e){let n=null,r;const o=dr(t);function l(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function a(c,d){c===void 0&&(c=!1),d===void 0&&(d=1),l();const h=t.getBoundingClientRect(),{left:p,top:g,width:b,height:v}=h;if(c||e(),!b||!v)return;const S=sc(g),x=sc(o.clientWidth-(p+b)),C=sc(o.clientHeight-(g+v)),E=sc(p),k={rootMargin:-S+"px "+-x+"px "+-C+"px "+-E+"px",threshold:wn(0,zi(1,d))||1};let D=!0;function L(H){const z=H[0].intersectionRatio;if(z!==d){if(!D)return a();z?a(!1,z):r=setTimeout(()=>{a(!1,1e-7)},1e3)}z===1&&!Cw(h,t.getBoundingClientRect())&&a(),D=!1}try{n=new IntersectionObserver(L,{...k,root:o.ownerDocument})}catch{n=new IntersectionObserver(L,k)}n.observe(t)}return a(!0),l}function K2(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:l=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:d=!1}=r,h=Fm(t),p=o||l?[...h?la(h):[],...e?la(e):[]]:[];p.forEach(E=>{o&&E.addEventListener("scroll",n,{passive:!0}),l&&E.addEventListener("resize",n)});const g=h&&c?G2(h,n):null;let b=-1,v=null;a&&(v=new ResizeObserver(E=>{let[A]=E;A&&A.target===h&&v&&e&&(v.unobserve(e),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var k;(k=v)==null||k.observe(e)})),n()}),h&&!d&&v.observe(h),e&&v.observe(e));let S,x=d?xo(t):null;d&&C();function C(){const E=xo(t);x&&!Cw(x,E)&&n(),x=E,S=requestAnimationFrame(C)}return n(),()=>{var E;p.forEach(A=>{o&&A.removeEventListener("scroll",n),l&&A.removeEventListener("resize",n)}),g?.(),(E=v)==null||E.disconnect(),v=null,d&&cancelAnimationFrame(S)}}const Y2=M2,X2=E2,J2=x2,Q2=T2,Z2=w2,vS=S2,W2=R2,ez=(t,e,n)=>{const r=new Map,o={platform:q2,...n},l={...o.platform,_c:r};return b2(t,e,{...o,platform:l})};var tz=typeof document<"u",nz=function(){},Sc=tz?M.useLayoutEffect:nz;function kc(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,o;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!kc(t[r],e[r]))return!1;return!0}if(o=Object.keys(t),n=o.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,o[r]))return!1;for(r=n;r--!==0;){const l=o[r];if(!(l==="_owner"&&t.$$typeof)&&!kc(t[l],e[l]))return!1}return!0}return t!==t&&e!==e}function Mw(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function bS(t,e){const n=Mw(t);return Math.round(e*n)/n}function fp(t){const e=M.useRef(t);return Sc(()=>{e.current=t}),e}function rz(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:l,floating:a}={},transform:c=!0,whileElementsMounted:d,open:h}=t,[p,g]=M.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[b,v]=M.useState(r);kc(b,r)||v(r);const[S,x]=M.useState(null),[C,E]=M.useState(null),A=M.useCallback(U=>{U!==H.current&&(H.current=U,x(U))},[]),k=M.useCallback(U=>{U!==z.current&&(z.current=U,E(U))},[]),D=l||S,L=a||C,H=M.useRef(null),z=M.useRef(null),j=M.useRef(p),J=d!=null,le=fp(d),ce=fp(o),se=fp(h),Se=M.useCallback(()=>{if(!H.current||!z.current)return;const U={placement:e,strategy:n,middleware:b};ce.current&&(U.platform=ce.current),ez(H.current,z.current,U).then(K=>{const G={...K,isPositioned:se.current!==!1};ne.current&&!kc(j.current,G)&&(j.current=G,Sa.flushSync(()=>{g(G)}))})},[b,e,n,ce,se]);Sc(()=>{h===!1&&j.current.isPositioned&&(j.current.isPositioned=!1,g(U=>({...U,isPositioned:!1})))},[h]);const ne=M.useRef(!1);Sc(()=>(ne.current=!0,()=>{ne.current=!1}),[]),Sc(()=>{if(D&&(H.current=D),L&&(z.current=L),D&&L){if(le.current)return le.current(D,L,Se);Se()}},[D,L,Se,le,J]);const me=M.useMemo(()=>({reference:H,floating:z,setReference:A,setFloating:k}),[A,k]),I=M.useMemo(()=>({reference:D,floating:L}),[D,L]),Q=M.useMemo(()=>{const U={position:n,left:0,top:0};if(!I.floating)return U;const K=bS(I.floating,p.x),G=bS(I.floating,p.y);return c?{...U,transform:"translate("+K+"px, "+G+"px)",...Mw(I.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:K,top:G}},[n,c,I.floating,p.x,p.y]);return M.useMemo(()=>({...p,update:Se,refs:me,elements:I,floatingStyles:Q}),[p,Se,me,I,Q])}const iz=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:o}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?vS({element:r.current,padding:o}).fn(n):{}:r?vS({element:r,padding:o}).fn(n):{}}}},oz=(t,e)=>{const n=Y2(t);return{name:n.name,fn:n.fn,options:[t,e]}},sz=(t,e)=>{const n=X2(t);return{name:n.name,fn:n.fn,options:[t,e]}},lz=(t,e)=>({fn:W2(t).fn,options:[t,e]}),az=(t,e)=>{const n=J2(t);return{name:n.name,fn:n.fn,options:[t,e]}},uz=(t,e)=>{const n=Q2(t);return{name:n.name,fn:n.fn,options:[t,e]}},cz=(t,e)=>{const n=Z2(t);return{name:n.name,fn:n.fn,options:[t,e]}},fz=(t,e)=>{const n=iz(t);return{name:n.name,fn:n.fn,options:[t,e]}};var dz="Arrow",Ew=M.forwardRef((t,e)=>{const{children:n,width:r=10,height:o=5,...l}=t;return T.jsx(Gt.svg,{...l,ref:e,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:T.jsx("polygon",{points:"0,0 30,0 15,10"})})});Ew.displayName=dz;var hz=Ew,Pm="Popper",[Rw,Tw]=Gs(Pm),[pz,Aw]=Rw(Pm),Ow=t=>{const{__scopePopper:e,children:n}=t,[r,o]=M.useState(null);return T.jsx(pz,{scope:e,anchor:r,onAnchorChange:o,children:n})};Ow.displayName=Pm;var kw="PopperAnchor",Nw=M.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...o}=t,l=Aw(kw,n),a=M.useRef(null),c=hn(e,a),d=M.useRef(null);return M.useEffect(()=>{const h=d.current;d.current=r?.current||a.current,h!==d.current&&l.onAnchorChange(d.current)}),r?null:T.jsx(Gt.div,{...o,ref:c})});Nw.displayName=kw;var $m="PopperContent",[mz,gz]=Rw($m),Dw=M.forwardRef((t,e)=>{const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:l="center",alignOffset:a=0,arrowPadding:c=0,avoidCollisions:d=!0,collisionBoundary:h=[],collisionPadding:p=0,sticky:g="partial",hideWhenDetached:b=!1,updatePositionStrategy:v="optimized",onPlaced:S,...x}=t,C=Aw($m,n),[E,A]=M.useState(null),k=hn(e,de=>A(de)),[D,L]=M.useState(null),H=l2(D),z=H?.width??0,j=H?.height??0,J=r+(l!=="center"?"-"+l:""),le=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},ce=Array.isArray(h)?h:[h],se=ce.length>0,Se={padding:le,boundary:ce.filter(vz),altBoundary:se},{refs:ne,floatingStyles:me,placement:I,isPositioned:Q,middlewareData:U}=rz({strategy:"fixed",placement:J,whileElementsMounted:(...de)=>K2(...de,{animationFrame:v==="always"}),elements:{reference:C.anchor},middleware:[oz({mainAxis:o+j,alignmentAxis:a}),d&&sz({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?lz():void 0,...Se}),d&&az({...Se}),uz({...Se,apply:({elements:de,rects:De,availableWidth:xe,availableHeight:Ft})=>{const{width:Qt,height:xt}=De.reference,ht=de.floating.style;ht.setProperty("--radix-popper-available-width",`${xe}px`),ht.setProperty("--radix-popper-available-height",`${Ft}px`),ht.setProperty("--radix-popper-anchor-width",`${Qt}px`),ht.setProperty("--radix-popper-anchor-height",`${xt}px`)}}),D&&fz({element:D,padding:c}),bz({arrowWidth:z,arrowHeight:j}),b&&cz({strategy:"referenceHidden",...Se})]}),[K,G]=jw(I),N=Zn(S);_i(()=>{Q&&N?.()},[Q,N]);const V=U.arrow?.x,X=U.arrow?.y,ee=U.arrow?.centerOffset!==0,[re,ae]=M.useState();return _i(()=>{E&&ae(window.getComputedStyle(E).zIndex)},[E]),T.jsx("div",{ref:ne.setFloating,"data-radix-popper-content-wrapper":"",style:{...me,transform:Q?me.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:re,"--radix-popper-transform-origin":[U.transformOrigin?.x,U.transformOrigin?.y].join(" "),...U.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:T.jsx(mz,{scope:n,placedSide:K,onArrowChange:L,arrowX:V,arrowY:X,shouldHideArrow:ee,children:T.jsx(Gt.div,{"data-side":K,"data-align":G,...x,ref:k,style:{...x.style,animation:Q?void 0:"none"}})})})});Dw.displayName=$m;var _w="PopperArrow",yz={top:"bottom",right:"left",bottom:"top",left:"right"},zw=M.forwardRef(function(e,n){const{__scopePopper:r,...o}=e,l=gz(_w,r),a=yz[l.placedSide];return T.jsx("span",{ref:l.onArrowChange,style:{position:"absolute",left:l.arrowX,top:l.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[l.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[l.placedSide],visibility:l.shouldHideArrow?"hidden":void 0},children:T.jsx(hz,{...o,ref:n,style:{...o.style,display:"block"}})})});zw.displayName=_w;function vz(t){return t!==null}var bz=t=>({name:"transformOrigin",options:t,fn(e){const{placement:n,rects:r,middlewareData:o}=e,a=o.arrow?.centerOffset!==0,c=a?0:t.arrowWidth,d=a?0:t.arrowHeight,[h,p]=jw(n),g={start:"0%",center:"50%",end:"100%"}[p],b=(o.arrow?.x??0)+c/2,v=(o.arrow?.y??0)+d/2;let S="",x="";return h==="bottom"?(S=a?g:`${b}px`,x=`${-d}px`):h==="top"?(S=a?g:`${b}px`,x=`${r.floating.height+d}px`):h==="right"?(S=`${-d}px`,x=a?g:`${v}px`):h==="left"&&(S=`${r.floating.width+d}px`,x=a?g:`${v}px`),{data:{x:S,y:x}}}});function jw(t){const[e,n="center"]=t.split("-");return[e,n]}var Lw=Ow,Sz=Nw,xz=Dw,wz=zw,dp="rovingFocusGroup.onEntryFocus",Cz={bubbles:!1,cancelable:!0},Ca="RovingFocusGroup",[tm,Bw,Mz]=X1(Ca),[Ez,Iw]=Gs(Ca,[Mz]),[Rz,Tz]=Ez(Ca),Vw=M.forwardRef((t,e)=>T.jsx(tm.Provider,{scope:t.__scopeRovingFocusGroup,children:T.jsx(tm.Slot,{scope:t.__scopeRovingFocusGroup,children:T.jsx(Az,{...t,ref:e})})}));Vw.displayName=Ca;var Az=M.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:l,currentTabStopId:a,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:d,onEntryFocus:h,preventScrollOnEntryFocus:p=!1,...g}=t,b=M.useRef(null),v=hn(e,b),S=J1(l),[x,C]=rf({prop:a,defaultProp:c??null,onChange:d,caller:Ca}),[E,A]=M.useState(!1),k=Zn(h),D=Bw(n),L=M.useRef(!1),[H,z]=M.useState(0);return M.useEffect(()=>{const j=b.current;if(j)return j.addEventListener(dp,k),()=>j.removeEventListener(dp,k)},[k]),T.jsx(Rz,{scope:n,orientation:r,dir:S,loop:o,currentTabStopId:x,onItemFocus:M.useCallback(j=>C(j),[C]),onItemShiftTab:M.useCallback(()=>A(!0),[]),onFocusableItemAdd:M.useCallback(()=>z(j=>j+1),[]),onFocusableItemRemove:M.useCallback(()=>z(j=>j-1),[]),children:T.jsx(Gt.div,{tabIndex:E||H===0?-1:0,"data-orientation":r,...g,ref:v,style:{outline:"none",...t.style},onMouseDown:je(t.onMouseDown,()=>{L.current=!0}),onFocus:je(t.onFocus,j=>{const J=!L.current;if(j.target===j.currentTarget&&J&&!E){const le=new CustomEvent(dp,Cz);if(j.currentTarget.dispatchEvent(le),!le.defaultPrevented){const ce=D().filter(I=>I.focusable),se=ce.find(I=>I.active),Se=ce.find(I=>I.id===x),me=[se,Se,...ce].filter(Boolean).map(I=>I.ref.current);$w(me,p)}}L.current=!1}),onBlur:je(t.onBlur,()=>A(!1))})})}),Fw="RovingFocusGroupItem",Pw=M.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:l,children:a,...c}=t,d=sa(),h=l||d,p=Tz(Fw,n),g=p.currentTabStopId===h,b=Bw(n),{onFocusableItemAdd:v,onFocusableItemRemove:S,currentTabStopId:x}=p;return M.useEffect(()=>{if(r)return v(),()=>S()},[r,v,S]),T.jsx(tm.ItemSlot,{scope:n,id:h,focusable:r,active:o,children:T.jsx(Gt.span,{tabIndex:g?0:-1,"data-orientation":p.orientation,...c,ref:e,onMouseDown:je(t.onMouseDown,C=>{r?p.onItemFocus(h):C.preventDefault()}),onFocus:je(t.onFocus,()=>p.onItemFocus(h)),onKeyDown:je(t.onKeyDown,C=>{if(C.key==="Tab"&&C.shiftKey){p.onItemShiftTab();return}if(C.target!==C.currentTarget)return;const E=Nz(C,p.orientation,p.dir);if(E!==void 0){if(C.metaKey||C.ctrlKey||C.altKey||C.shiftKey)return;C.preventDefault();let k=b().filter(D=>D.focusable).map(D=>D.ref.current);if(E==="last")k.reverse();else if(E==="prev"||E==="next"){E==="prev"&&k.reverse();const D=k.indexOf(C.currentTarget);k=p.loop?Dz(k,D+1):k.slice(D+1)}setTimeout(()=>$w(k))}}),children:typeof a=="function"?a({isCurrentTabStop:g,hasTabStop:x!=null}):a})})});Pw.displayName=Fw;var Oz={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function kz(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function Nz(t,e,n){const r=kz(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Oz[r]}function $w(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}function Dz(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var _z=Vw,zz=Pw,nm=["Enter"," "],jz=["ArrowDown","PageUp","Home"],Hw=["ArrowUp","PageDown","End"],Lz=[...jz,...Hw],Bz={ltr:[...nm,"ArrowRight"],rtl:[...nm,"ArrowLeft"]},Iz={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Ma="Menu",[aa,Vz,Fz]=X1(Ma),[To,cf]=Gs(Ma,[Fz,Tw,Iw]),Ea=Tw(),Uw=Iw(),[qw,Ii]=To(Ma),[Pz,Ra]=To(Ma),Gw=t=>{const{__scopeMenu:e,open:n=!1,children:r,dir:o,onOpenChange:l,modal:a=!0}=t,c=Ea(e),[d,h]=M.useState(null),p=M.useRef(!1),g=Zn(l),b=J1(o);return M.useEffect(()=>{const v=()=>{p.current=!0,document.addEventListener("pointerdown",S,{capture:!0,once:!0}),document.addEventListener("pointermove",S,{capture:!0,once:!0})},S=()=>p.current=!1;return document.addEventListener("keydown",v,{capture:!0}),()=>{document.removeEventListener("keydown",v,{capture:!0}),document.removeEventListener("pointerdown",S,{capture:!0}),document.removeEventListener("pointermove",S,{capture:!0})}},[]),T.jsx(Lw,{...c,children:T.jsx(qw,{scope:e,open:n,onOpenChange:g,content:d,onContentChange:h,children:T.jsx(Pz,{scope:e,onClose:M.useCallback(()=>g(!1),[g]),isUsingKeyboardRef:p,dir:b,modal:a,children:r})})})};Gw.displayName=Ma;var $z="MenuAnchor",Hm=M.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,o=Ea(n);return T.jsx(Sz,{...o,...r,ref:e})});Hm.displayName=$z;var Um="MenuPortal",[Hz,Kw]=To(Um,{forceMount:void 0}),Yw=t=>{const{__scopeMenu:e,forceMount:n,children:r,container:o}=t,l=Ii(Um,e);return T.jsx(Hz,{scope:e,forceMount:n,children:T.jsx(xa,{present:n||l.open,children:T.jsx(nw,{asChild:!0,container:o,children:r})})})};Yw.displayName=Um;var Pn="MenuContent",[Uz,qm]=To(Pn),Xw=M.forwardRef((t,e)=>{const n=Kw(Pn,t.__scopeMenu),{forceMount:r=n.forceMount,...o}=t,l=Ii(Pn,t.__scopeMenu),a=Ra(Pn,t.__scopeMenu);return T.jsx(aa.Provider,{scope:t.__scopeMenu,children:T.jsx(xa,{present:r||l.open,children:T.jsx(aa.Slot,{scope:t.__scopeMenu,children:a.modal?T.jsx(qz,{...o,ref:e}):T.jsx(Gz,{...o,ref:e})})})})}),qz=M.forwardRef((t,e)=>{const n=Ii(Pn,t.__scopeMenu),r=M.useRef(null),o=hn(e,r);return M.useEffect(()=>{const l=r.current;if(l)return o2(l)},[]),T.jsx(Gm,{...t,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:je(t.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Gz=M.forwardRef((t,e)=>{const n=Ii(Pn,t.__scopeMenu);return T.jsx(Gm,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Kz=oa("MenuContent.ScrollLock"),Gm=M.forwardRef((t,e)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:l,onCloseAutoFocus:a,disableOutsidePointerEvents:c,onEntryFocus:d,onEscapeKeyDown:h,onPointerDownOutside:p,onFocusOutside:g,onInteractOutside:b,onDismiss:v,disableOutsideScroll:S,...x}=t,C=Ii(Pn,n),E=Ra(Pn,n),A=Ea(n),k=Uw(n),D=Vz(n),[L,H]=M.useState(null),z=M.useRef(null),j=hn(e,z,C.onContentChange),J=M.useRef(0),le=M.useRef(""),ce=M.useRef(0),se=M.useRef(null),Se=M.useRef("right"),ne=M.useRef(0),me=S?cw:M.Fragment,I=S?{as:Kz,allowPinchZoom:!0}:void 0,Q=K=>{const G=le.current+K,N=D().filter(de=>!de.disabled),V=document.activeElement,X=N.find(de=>de.ref.current===V)?.textValue,ee=N.map(de=>de.textValue),re=oj(ee,G,X),ae=N.find(de=>de.textValue===re)?.ref.current;(function de(De){le.current=De,window.clearTimeout(J.current),De!==""&&(J.current=window.setTimeout(()=>de(""),1e3))})(G),ae&&setTimeout(()=>ae.focus())};M.useEffect(()=>()=>window.clearTimeout(J.current),[]),b_();const U=M.useCallback(K=>Se.current===se.current?.side&&lj(K,se.current?.area),[]);return T.jsx(Uz,{scope:n,searchRef:le,onItemEnter:M.useCallback(K=>{U(K)&&K.preventDefault()},[U]),onItemLeave:M.useCallback(K=>{U(K)||(z.current?.focus(),H(null))},[U]),onTriggerLeave:M.useCallback(K=>{U(K)&&K.preventDefault()},[U]),pointerGraceTimerRef:ce,onPointerGraceIntentChange:M.useCallback(K=>{se.current=K},[]),children:T.jsx(me,{...I,children:T.jsx(ew,{asChild:!0,trapped:o,onMountAutoFocus:je(l,K=>{K.preventDefault(),z.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:T.jsx(Z1,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:h,onPointerDownOutside:p,onFocusOutside:g,onInteractOutside:b,onDismiss:v,children:T.jsx(_z,{asChild:!0,...k,dir:E.dir,orientation:"vertical",loop:r,currentTabStopId:L,onCurrentTabStopIdChange:H,onEntryFocus:je(d,K=>{E.isUsingKeyboardRef.current||K.preventDefault()}),preventScrollOnEntryFocus:!0,children:T.jsx(xz,{role:"menu","aria-orientation":"vertical","data-state":dC(C.open),"data-radix-menu-content":"",dir:E.dir,...A,...x,ref:j,style:{outline:"none",...x.style},onKeyDown:je(x.onKeyDown,K=>{const N=K.target.closest("[data-radix-menu-content]")===K.currentTarget,V=K.ctrlKey||K.altKey||K.metaKey,X=K.key.length===1;N&&(K.key==="Tab"&&K.preventDefault(),!V&&X&&Q(K.key));const ee=z.current;if(K.target!==ee||!Lz.includes(K.key))return;K.preventDefault();const ae=D().filter(de=>!de.disabled).map(de=>de.ref.current);Hw.includes(K.key)&&ae.reverse(),rj(ae)}),onBlur:je(t.onBlur,K=>{K.currentTarget.contains(K.target)||(window.clearTimeout(J.current),le.current="")}),onPointerMove:je(t.onPointerMove,ua(K=>{const G=K.target,N=ne.current!==K.clientX;if(K.currentTarget.contains(G)&&N){const V=K.clientX>ne.current?"right":"left";Se.current=V,ne.current=K.clientX}}))})})})})})})});Xw.displayName=Pn;var Yz="MenuGroup",Km=M.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return T.jsx(Gt.div,{role:"group",...r,ref:e})});Km.displayName=Yz;var Xz="MenuLabel",Jw=M.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return T.jsx(Gt.div,{...r,ref:e})});Jw.displayName=Xz;var Nc="MenuItem",SS="menu.itemSelect",ff=M.forwardRef((t,e)=>{const{disabled:n=!1,onSelect:r,...o}=t,l=M.useRef(null),a=Ra(Nc,t.__scopeMenu),c=qm(Nc,t.__scopeMenu),d=hn(e,l),h=M.useRef(!1),p=()=>{const g=l.current;if(!n&&g){const b=new CustomEvent(SS,{bubbles:!0,cancelable:!0});g.addEventListener(SS,v=>r?.(v),{once:!0}),Y1(g,b),b.defaultPrevented?h.current=!1:a.onClose()}};return T.jsx(Qw,{...o,ref:d,disabled:n,onClick:je(t.onClick,p),onPointerDown:g=>{t.onPointerDown?.(g),h.current=!0},onPointerUp:je(t.onPointerUp,g=>{h.current||g.currentTarget?.click()}),onKeyDown:je(t.onKeyDown,g=>{const b=c.searchRef.current!=="";n||b&&g.key===" "||nm.includes(g.key)&&(g.currentTarget.click(),g.preventDefault())})})});ff.displayName=Nc;var Qw=M.forwardRef((t,e)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...l}=t,a=qm(Nc,n),c=Uw(n),d=M.useRef(null),h=hn(e,d),[p,g]=M.useState(!1),[b,v]=M.useState("");return M.useEffect(()=>{const S=d.current;S&&v((S.textContent??"").trim())},[l.children]),T.jsx(aa.ItemSlot,{scope:n,disabled:r,textValue:o??b,children:T.jsx(zz,{asChild:!0,...c,focusable:!r,children:T.jsx(Gt.div,{role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...l,ref:h,onPointerMove:je(t.onPointerMove,ua(S=>{r?a.onItemLeave(S):(a.onItemEnter(S),S.defaultPrevented||S.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:je(t.onPointerLeave,ua(S=>a.onItemLeave(S))),onFocus:je(t.onFocus,()=>g(!0)),onBlur:je(t.onBlur,()=>g(!1))})})})}),Jz="MenuCheckboxItem",Zw=M.forwardRef((t,e)=>{const{checked:n=!1,onCheckedChange:r,...o}=t;return T.jsx(rC,{scope:t.__scopeMenu,checked:n,children:T.jsx(ff,{role:"menuitemcheckbox","aria-checked":Dc(n)?"mixed":n,...o,ref:e,"data-state":Jm(n),onSelect:je(o.onSelect,()=>r?.(Dc(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Zw.displayName=Jz;var Ww="MenuRadioGroup",[Qz,Zz]=To(Ww,{value:void 0,onValueChange:()=>{}}),eC=M.forwardRef((t,e)=>{const{value:n,onValueChange:r,...o}=t,l=Zn(r);return T.jsx(Qz,{scope:t.__scopeMenu,value:n,onValueChange:l,children:T.jsx(Km,{...o,ref:e})})});eC.displayName=Ww;var tC="MenuRadioItem",nC=M.forwardRef((t,e)=>{const{value:n,...r}=t,o=Zz(tC,t.__scopeMenu),l=n===o.value;return T.jsx(rC,{scope:t.__scopeMenu,checked:l,children:T.jsx(ff,{role:"menuitemradio","aria-checked":l,...r,ref:e,"data-state":Jm(l),onSelect:je(r.onSelect,()=>o.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});nC.displayName=tC;var Ym="MenuItemIndicator",[rC,Wz]=To(Ym,{checked:!1}),iC=M.forwardRef((t,e)=>{const{__scopeMenu:n,forceMount:r,...o}=t,l=Wz(Ym,n);return T.jsx(xa,{present:r||Dc(l.checked)||l.checked===!0,children:T.jsx(Gt.span,{...o,ref:e,"data-state":Jm(l.checked)})})});iC.displayName=Ym;var ej="MenuSeparator",oC=M.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return T.jsx(Gt.div,{role:"separator","aria-orientation":"horizontal",...r,ref:e})});oC.displayName=ej;var tj="MenuArrow",sC=M.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,o=Ea(n);return T.jsx(wz,{...o,...r,ref:e})});sC.displayName=tj;var Xm="MenuSub",[nj,lC]=To(Xm),aC=t=>{const{__scopeMenu:e,children:n,open:r=!1,onOpenChange:o}=t,l=Ii(Xm,e),a=Ea(e),[c,d]=M.useState(null),[h,p]=M.useState(null),g=Zn(o);return M.useEffect(()=>(l.open===!1&&g(!1),()=>g(!1)),[l.open,g]),T.jsx(Lw,{...a,children:T.jsx(qw,{scope:e,open:r,onOpenChange:g,content:h,onContentChange:p,children:T.jsx(nj,{scope:e,contentId:sa(),triggerId:sa(),trigger:c,onTriggerChange:d,children:n})})})};aC.displayName=Xm;var Kl="MenuSubTrigger",uC=M.forwardRef((t,e)=>{const n=Ii(Kl,t.__scopeMenu),r=Ra(Kl,t.__scopeMenu),o=lC(Kl,t.__scopeMenu),l=qm(Kl,t.__scopeMenu),a=M.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:d}=l,h={__scopeMenu:t.__scopeMenu},p=M.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return M.useEffect(()=>p,[p]),M.useEffect(()=>{const g=c.current;return()=>{window.clearTimeout(g),d(null)}},[c,d]),T.jsx(Hm,{asChild:!0,...h,children:T.jsx(Qw,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":dC(n.open),...t,ref:nf(e,o.onTriggerChange),onClick:g=>{t.onClick?.(g),!(t.disabled||g.defaultPrevented)&&(g.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:je(t.onPointerMove,ua(g=>{l.onItemEnter(g),!g.defaultPrevented&&!t.disabled&&!n.open&&!a.current&&(l.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),p()},100))})),onPointerLeave:je(t.onPointerLeave,ua(g=>{p();const b=n.content?.getBoundingClientRect();if(b){const v=n.content?.dataset.side,S=v==="right",x=S?-5:5,C=b[S?"left":"right"],E=b[S?"right":"left"];l.onPointerGraceIntentChange({area:[{x:g.clientX+x,y:g.clientY},{x:C,y:b.top},{x:E,y:b.top},{x:E,y:b.bottom},{x:C,y:b.bottom}],side:v}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>l.onPointerGraceIntentChange(null),300)}else{if(l.onTriggerLeave(g),g.defaultPrevented)return;l.onPointerGraceIntentChange(null)}})),onKeyDown:je(t.onKeyDown,g=>{const b=l.searchRef.current!=="";t.disabled||b&&g.key===" "||Bz[r.dir].includes(g.key)&&(n.onOpenChange(!0),n.content?.focus(),g.preventDefault())})})})});uC.displayName=Kl;var cC="MenuSubContent",fC=M.forwardRef((t,e)=>{const n=Kw(Pn,t.__scopeMenu),{forceMount:r=n.forceMount,...o}=t,l=Ii(Pn,t.__scopeMenu),a=Ra(Pn,t.__scopeMenu),c=lC(cC,t.__scopeMenu),d=M.useRef(null),h=hn(e,d);return T.jsx(aa.Provider,{scope:t.__scopeMenu,children:T.jsx(xa,{present:r||l.open,children:T.jsx(aa.Slot,{scope:t.__scopeMenu,children:T.jsx(Gm,{id:c.contentId,"aria-labelledby":c.triggerId,...o,ref:h,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:p=>{a.isUsingKeyboardRef.current&&d.current?.focus(),p.preventDefault()},onCloseAutoFocus:p=>p.preventDefault(),onFocusOutside:je(t.onFocusOutside,p=>{p.target!==c.trigger&&l.onOpenChange(!1)}),onEscapeKeyDown:je(t.onEscapeKeyDown,p=>{a.onClose(),p.preventDefault()}),onKeyDown:je(t.onKeyDown,p=>{const g=p.currentTarget.contains(p.target),b=Iz[a.dir].includes(p.key);g&&b&&(l.onOpenChange(!1),c.trigger?.focus(),p.preventDefault())})})})})})});fC.displayName=cC;function dC(t){return t?"open":"closed"}function Dc(t){return t==="indeterminate"}function Jm(t){return Dc(t)?"indeterminate":t?"checked":"unchecked"}function rj(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function ij(t,e){return t.map((n,r)=>t[(e+r)%t.length])}function oj(t,e,n){const o=e.length>1&&Array.from(e).every(h=>h===e[0])?e[0]:e,l=n?t.indexOf(n):-1;let a=ij(t,Math.max(l,0));o.length===1&&(a=a.filter(h=>h!==n));const d=a.find(h=>h.toLowerCase().startsWith(o.toLowerCase()));return d!==n?d:void 0}function sj(t,e){const{x:n,y:r}=t;let o=!1;for(let l=0,a=e.length-1;l<e.length;a=l++){const c=e[l],d=e[a],h=c.x,p=c.y,g=d.x,b=d.y;p>r!=b>r&&n<(g-h)*(r-p)/(b-p)+h&&(o=!o)}return o}function lj(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return sj(n,e)}function ua(t){return e=>e.pointerType==="mouse"?t(e):void 0}var hC=Gw,pC=Hm,mC=Yw,gC=Xw,yC=Km,vC=Jw,bC=ff,SC=Zw,xC=eC,wC=nC,CC=iC,MC=oC,EC=sC,RC=aC,TC=uC,AC=fC,Qm="ContextMenu",[aj]=Gs(Qm,[cf]),Kt=cf(),[uj,OC]=aj(Qm),kC=t=>{const{__scopeContextMenu:e,children:n,onOpenChange:r,dir:o,modal:l=!0}=t,[a,c]=M.useState(!1),d=Kt(e),h=Zn(r),p=M.useCallback(g=>{c(g),h(g)},[h]);return T.jsx(uj,{scope:e,open:a,onOpenChange:p,modal:l,children:T.jsx(hC,{...d,dir:o,open:a,onOpenChange:p,modal:l,children:n})})};kC.displayName=Qm;var NC="ContextMenuTrigger",DC=M.forwardRef((t,e)=>{const{__scopeContextMenu:n,disabled:r=!1,...o}=t,l=OC(NC,n),a=Kt(n),c=M.useRef({x:0,y:0}),d=M.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...c.current})}),h=M.useRef(0),p=M.useCallback(()=>window.clearTimeout(h.current),[]),g=b=>{c.current={x:b.clientX,y:b.clientY},l.onOpenChange(!0)};return M.useEffect(()=>p,[p]),M.useEffect(()=>{r&&p()},[r,p]),T.jsxs(T.Fragment,{children:[T.jsx(pC,{...a,virtualRef:d}),T.jsx(Gt.span,{"data-state":l.open?"open":"closed","data-disabled":r?"":void 0,...o,ref:e,style:{WebkitTouchCallout:"none",...t.style},onContextMenu:r?t.onContextMenu:je(t.onContextMenu,b=>{p(),g(b),b.preventDefault()}),onPointerDown:r?t.onPointerDown:je(t.onPointerDown,lc(b=>{p(),h.current=window.setTimeout(()=>g(b),700)})),onPointerMove:r?t.onPointerMove:je(t.onPointerMove,lc(p)),onPointerCancel:r?t.onPointerCancel:je(t.onPointerCancel,lc(p)),onPointerUp:r?t.onPointerUp:je(t.onPointerUp,lc(p))})]})});DC.displayName=NC;var cj="ContextMenuPortal",_C=t=>{const{__scopeContextMenu:e,...n}=t,r=Kt(e);return T.jsx(mC,{...r,...n})};_C.displayName=cj;var zC="ContextMenuContent",jC=M.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=OC(zC,n),l=Kt(n),a=M.useRef(!1);return T.jsx(gC,{...l,...r,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:c=>{t.onCloseAutoFocus?.(c),!c.defaultPrevented&&a.current&&c.preventDefault(),a.current=!1},onInteractOutside:c=>{t.onInteractOutside?.(c),!c.defaultPrevented&&!o.modal&&(a.current=!0)},style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});jC.displayName=zC;var fj="ContextMenuGroup",dj=M.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=Kt(n);return T.jsx(yC,{...o,...r,ref:e})});dj.displayName=fj;var hj="ContextMenuLabel",LC=M.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=Kt(n);return T.jsx(vC,{...o,...r,ref:e})});LC.displayName=hj;var pj="ContextMenuItem",BC=M.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=Kt(n);return T.jsx(bC,{...o,...r,ref:e})});BC.displayName=pj;var mj="ContextMenuCheckboxItem",gj=M.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=Kt(n);return T.jsx(SC,{...o,...r,ref:e})});gj.displayName=mj;var yj="ContextMenuRadioGroup",vj=M.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=Kt(n);return T.jsx(xC,{...o,...r,ref:e})});vj.displayName=yj;var bj="ContextMenuRadioItem",Sj=M.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=Kt(n);return T.jsx(wC,{...o,...r,ref:e})});Sj.displayName=bj;var xj="ContextMenuItemIndicator",wj=M.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=Kt(n);return T.jsx(CC,{...o,...r,ref:e})});wj.displayName=xj;var Cj="ContextMenuSeparator",IC=M.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=Kt(n);return T.jsx(MC,{...o,...r,ref:e})});IC.displayName=Cj;var Mj="ContextMenuArrow",Ej=M.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=Kt(n);return T.jsx(EC,{...o,...r,ref:e})});Ej.displayName=Mj;var VC="ContextMenuSub",FC=t=>{const{__scopeContextMenu:e,children:n,onOpenChange:r,open:o,defaultOpen:l}=t,a=Kt(e),[c,d]=rf({prop:o,defaultProp:l??!1,onChange:r,caller:VC});return T.jsx(RC,{...a,open:c,onOpenChange:d,children:n})};FC.displayName=VC;var Rj="ContextMenuSubTrigger",PC=M.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=Kt(n);return T.jsx(TC,{...o,...r,ref:e})});PC.displayName=Rj;var Tj="ContextMenuSubContent",$C=M.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=Kt(n);return T.jsx(AC,{...o,...r,ref:e,style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});$C.displayName=Tj;function lc(t){return e=>e.pointerType!=="mouse"?t(e):void 0}var Aj=kC,Oj=DC,kj=_C,Nj=jC,Dj=LC,_j=BC,zj=IC,jj=FC,Lj=PC,Bj=$C,df="DropdownMenu",[Ij]=Gs(df,[cf]),Yt=cf(),[Vj,HC]=Ij(df),UC=t=>{const{__scopeDropdownMenu:e,children:n,dir:r,open:o,defaultOpen:l,onOpenChange:a,modal:c=!0}=t,d=Yt(e),h=M.useRef(null),[p,g]=rf({prop:o,defaultProp:l??!1,onChange:a,caller:df});return T.jsx(Vj,{scope:e,triggerId:sa(),triggerRef:h,contentId:sa(),open:p,onOpenChange:g,onOpenToggle:M.useCallback(()=>g(b=>!b),[g]),modal:c,children:T.jsx(hC,{...d,open:p,onOpenChange:g,dir:r,modal:c,children:n})})};UC.displayName=df;var qC="DropdownMenuTrigger",GC=M.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=t,l=HC(qC,n),a=Yt(n);return T.jsx(pC,{asChild:!0,...a,children:T.jsx(Gt.button,{type:"button",id:l.triggerId,"aria-haspopup":"menu","aria-expanded":l.open,"aria-controls":l.open?l.contentId:void 0,"data-state":l.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:nf(e,l.triggerRef),onPointerDown:je(t.onPointerDown,c=>{!r&&c.button===0&&c.ctrlKey===!1&&(l.onOpenToggle(),l.open||c.preventDefault())}),onKeyDown:je(t.onKeyDown,c=>{r||(["Enter"," "].includes(c.key)&&l.onOpenToggle(),c.key==="ArrowDown"&&l.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(c.key)&&c.preventDefault())})})})});GC.displayName=qC;var Fj="DropdownMenuPortal",KC=t=>{const{__scopeDropdownMenu:e,...n}=t,r=Yt(e);return T.jsx(mC,{...r,...n})};KC.displayName=Fj;var YC="DropdownMenuContent",XC=M.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=HC(YC,n),l=Yt(n),a=M.useRef(!1);return T.jsx(gC,{id:o.contentId,"aria-labelledby":o.triggerId,...l,...r,ref:e,onCloseAutoFocus:je(t.onCloseAutoFocus,c=>{a.current||o.triggerRef.current?.focus(),a.current=!1,c.preventDefault()}),onInteractOutside:je(t.onInteractOutside,c=>{const d=c.detail.originalEvent,h=d.button===0&&d.ctrlKey===!0,p=d.button===2||h;(!o.modal||p)&&(a.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});XC.displayName=YC;var Pj="DropdownMenuGroup",$j=M.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Yt(n);return T.jsx(yC,{...o,...r,ref:e})});$j.displayName=Pj;var Hj="DropdownMenuLabel",JC=M.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Yt(n);return T.jsx(vC,{...o,...r,ref:e})});JC.displayName=Hj;var Uj="DropdownMenuItem",QC=M.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Yt(n);return T.jsx(bC,{...o,...r,ref:e})});QC.displayName=Uj;var qj="DropdownMenuCheckboxItem",ZC=M.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Yt(n);return T.jsx(SC,{...o,...r,ref:e})});ZC.displayName=qj;var Gj="DropdownMenuRadioGroup",WC=M.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Yt(n);return T.jsx(xC,{...o,...r,ref:e})});WC.displayName=Gj;var Kj="DropdownMenuRadioItem",eM=M.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Yt(n);return T.jsx(wC,{...o,...r,ref:e})});eM.displayName=Kj;var Yj="DropdownMenuItemIndicator",tM=M.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Yt(n);return T.jsx(CC,{...o,...r,ref:e})});tM.displayName=Yj;var Xj="DropdownMenuSeparator",nM=M.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Yt(n);return T.jsx(MC,{...o,...r,ref:e})});nM.displayName=Xj;var Jj="DropdownMenuArrow",Qj=M.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Yt(n);return T.jsx(EC,{...o,...r,ref:e})});Qj.displayName=Jj;var Zj=t=>{const{__scopeDropdownMenu:e,children:n,open:r,onOpenChange:o,defaultOpen:l}=t,a=Yt(e),[c,d]=rf({prop:r,defaultProp:l??!1,onChange:o,caller:"DropdownMenuSub"});return T.jsx(RC,{...a,open:c,onOpenChange:d,children:n})},Wj="DropdownMenuSubTrigger",rM=M.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Yt(n);return T.jsx(TC,{...o,...r,ref:e})});rM.displayName=Wj;var e3="DropdownMenuSubContent",iM=M.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Yt(n);return T.jsx(AC,{...o,...r,ref:e,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});iM.displayName=e3;var t3=UC,n3=GC,r3=KC,i3=XC,o3=JC,s3=QC,l3=ZC,a3=WC,u3=eM,oM=tM,c3=nM,f3=Zj,d3=rM,h3=iM;const p3=zm("group/button inline-flex shrink-0 items-center justify-center rounded-md border border-transparent bg-clip-padding text-xs/relaxed font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 active:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-gray-900 text-white hover:bg-gray-800",outline:"border-border hover:bg-input/50 hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:bg-input/30",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-7 gap-1 px-2 text-xs/relaxed has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",xs:"h-5 gap-1 rounded-sm px-2 text-[0.625rem] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-2.5",sm:"h-6 gap-1 px-2 text-xs/relaxed has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",lg:"h-8 gap-1 px-2.5 text-xs/relaxed has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2 [&_svg:not([class*='size-'])]:size-4",xl:"h-10 gap-1 px-3 text-sm/relaxed has-data-[icon=inline-end]:pr-2.5 has-data-[icon=inline-start]:pl-2.5 [&_svg:not([class*='size-'])]:size-5",icon:"size-7 [&_svg:not([class*='size-'])]:size-3.5","icon-xs":"size-5 rounded-sm [&_svg:not([class*='size-'])]:size-2.5","icon-sm":"size-6 [&_svg:not([class*='size-'])]:size-3","icon-lg":"size-8 [&_svg:not([class*='size-'])]:size-4","icon-xl":"size-10 [&_svg:not([class*='size-'])]:size-5"}},defaultVariants:{variant:"default",size:"default"}});function Ls({className:t,variant:e="default",size:n="default",asChild:r=!1,...o}){const l=r?FD:"button";return T.jsx(l,{"data-slot":"button","data-variant":e,"data-size":n,className:Ne(p3({variant:e,size:n,className:t})),...o})}function m3({...t}){return T.jsx(Aj,{"data-slot":"context-menu",...t})}function g3({className:t,...e}){return T.jsx(Oj,{"data-slot":"context-menu-trigger",className:Ne("select-none",t),...e})}function y3({...t}){return T.jsx(jj,{"data-slot":"context-menu-sub",...t})}function v3({className:t,...e}){return T.jsx(kj,{children:T.jsx(Nj,{"data-slot":"context-menu-content",className:Ne("z-50 max-h-(--radix-context-menu-content-available-height) min-w-32 origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",t),...e})})}function b3({className:t,inset:e,variant:n="default",...r}){return T.jsx(_j,{"data-slot":"context-menu-item","data-inset":e,"data-variant":n,className:Ne("group/context-menu-item relative flex min-h-7 cursor-default items-center gap-2 rounded-md px-2 py-1 text-xs/relaxed outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7.5 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5 data-[variant=destructive]:*:[svg]:text-destructive",t),...r})}function S3({className:t,inset:e,children:n,...r}){return T.jsxs(Lj,{"data-slot":"context-menu-sub-trigger","data-inset":e,className:Ne("flex min-h-7 cursor-default items-center gap-2 rounded-md px-2 py-1 text-xs outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7.5 data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5",t),...r,children:[n,T.jsx(p1,{className:"ml-auto"})]})}function x3({className:t,...e}){return T.jsx(Bj,{"data-slot":"context-menu-sub-content",className:Ne("z-50 min-w-32 origin-(--radix-context-menu-content-transform-origin) overflow-hidden rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",t),...e})}function w3({className:t,inset:e,...n}){return T.jsx(Dj,{"data-slot":"context-menu-label","data-inset":e,className:Ne("px-2 py-1.5 text-xs text-muted-foreground data-inset:pl-7.5",t),...n})}function C3({className:t,...e}){return T.jsx(zj,{"data-slot":"context-menu-separator",className:Ne("-mx-1 my-1 h-px bg-border/50",t),...e})}function M3({className:t,...e}){return T.jsx("span",{"data-slot":"context-menu-shortcut",className:Ne("ml-auto text-[0.625rem] tracking-widest text-muted-foreground group-focus/context-menu-item:text-accent-foreground",t),...e})}function E3(t,e){return{...t,mode:e}}function sM(t,e){const n=t.match(/^([a-zA-Z0-9_.-]+)(:|>|<|\.)(.*)$/);if(!n)return null;const[,r,o,l]=n;return{field:e.find(a=>a.id===r),fieldId:r,fragment:l,operator:o}}function R3(t,e){switch(t.kind){case"date":case"number":return e===":"||e===">"||e==="<";case"json":return e===":"||e===".";default:return e===":"}}function lM(t){return t==null?"":t instanceof Date?t.toISOString():typeof t=="object"?JSON.stringify(t):String(t)}function Zm(t){const e=[];let n=-1,r=!1,o=!1;for(let l=0;l<t.length;l+=1){const a=t[l];if(n===-1){if(/\s/.test(a))continue;n=l}if(o){o=!1;continue}if(a==="\\"){o=!0;continue}if(a==='"'){r=!r;continue}!r&&/\s/.test(a)&&(e.push({end:l,start:n,token:t.slice(n,l)}),n=-1)}return n!==-1&&e.push({end:t.length,start:n,token:t.slice(n)}),e}function aM(t){return Zm(t).map(e=>e.token)}function xS(t){return t.replace(/\\(["\\])/g,"$1")}function uM(t){const e=t.trim();return e.length>=2&&e.startsWith('"')&&e.endsWith('"')?xS(e.slice(1,-1)):xS(e)}function cM(t){return!t||/[\s"]/u.test(t)?`"${t.replace(/["\\]/g,"\\$&")}"`:t}function wS(t){const e=t.trim().toLowerCase();if(!e)return null;if(e==="today"){const o=new Date;return new Date(o.getFullYear(),o.getMonth(),o.getDate())}const n=e.match(/^-(\d+)d$/);if(n){const o=Number(n[1]);return new Date(Date.now()-o*24*60*60*1e3)}const r=Date.parse(t);return Number.isNaN(r)?null:new Date(r)}function T3(t,e){return t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()&&t.getDate()===e.getDate()}function A3(t,e,n,r){const o=e.getValue(t),l=lM(o);if(!r.trim())return!0;if(e.kind==="enum")return l.toLowerCase()===r.trim().toLowerCase();if(e.kind==="number"){const a=Number(o),c=Number(r);return Number.isNaN(a)||Number.isNaN(c)?l.toLowerCase().includes(r.trim().toLowerCase()):n===">"?a>c:n==="<"?a<c:a===c}if(e.kind==="date"){const a=n===":"?r.match(/^([<>])(.*)$/):null,c=a?a[1]:n,d=a?a[2]:r,h=wS(l),p=wS(d);return!h||!p?l.toLowerCase().includes(r.trim().toLowerCase()):c===">"?h>p:c==="<"?h<p:T3(h,p)}return l.toLowerCase().includes(r.trim().toLowerCase())}function O3(t,e,n){return n.every(r=>A3(t,e,r.operator,r.value))}function CS(t){return t.flatMap(e=>{switch(e.kind){case"date":return[{id:`${e.id}-eq`,group:"filters",insertText:`${e.id}:`,keepOpen:!0,label:`${e.id}:`,mode:"append"},{id:`${e.id}-gt`,group:"filters",insertText:`${e.id}>`,keepOpen:!0,label:`${e.id}>`,mode:"append"},{id:`${e.id}-lt`,group:"filters",insertText:`${e.id}<`,keepOpen:!0,label:`${e.id}<`,mode:"append"}];case"number":return[{id:`${e.id}-eq`,group:"filters",insertText:`${e.id}:`,keepOpen:!0,label:`${e.id}:`,mode:"append"},{id:`${e.id}-gt`,group:"filters",insertText:`${e.id}>`,keepOpen:!0,label:`${e.id}>`,mode:"append"},{id:`${e.id}-lt`,group:"filters",insertText:`${e.id}<`,keepOpen:!0,label:`${e.id}<`,mode:"append"}];case"json":return[{id:`${e.id}-dot`,group:"filters",insertText:`${e.id}.`,keepOpen:!0,label:`${e.id}.`,mode:"append"},{id:`${e.id}-eq`,group:"filters",insertText:`${e.id}:`,keepOpen:!0,label:`${e.id}:`,mode:"append"}];default:return[{id:`${e.id}-eq`,group:"filters",insertText:`${e.id}:`,keepOpen:!0,label:`${e.id}:`,mode:"append"}]}})}function fM(t,e,n){const r=Zm(t).find(d=>e>=d.start&&e<=d.end),o=r?.start??e,l=r?.end??e,a=r?.token??"",c=sM(a,n);return c?{end:l,field:c.field,fragment:c.fragment,operator:c.operator,start:o,token:a}:{end:l,fragment:a,start:o,token:a}}function k3(t,e){const n=[];for(const{end:r,start:o,token:l}of Zm(t)){const a=sM(l,e);a?.field&&R3(a.field,a.operator)&&n.push({end:r,fieldId:a.field.id,operator:a.operator,start:o,token:l})}return n}function N3(t,e,n){const r=fM(t,e,n),o=r.fragment.trim().length>0,l=t?[{group:"input",id:"input-value",insertText:t,label:t,mode:"replace-whole"}]:[];if(!r.field||!r.operator){const c=CS(n),d=r.fragment.trim()?c.filter(h=>h.label.toLowerCase().includes(r.fragment.trim().toLowerCase())):c;return o?[...l,...d.map(h=>E3(h,"replace-token"))]:[...l,...d]}if(r.field.kind==="enum"&&r.operator===":"){const c=uM(r.fragment).toLowerCase();if(c&&(r.field.options??[]).some(h=>h.toLowerCase()===c))return l;const d=(r.field.options??[]).filter(h=>h.toLowerCase().includes(c)).map(h=>({group:"values",id:`${r.field?.id}-${h}`,insertText:`${r.field?.id}:${cM(h)}`,label:h,mode:"replace-token"}));return[...l,...d]}if(r.field.kind==="date"){const c=r.field.sample??new Date().toISOString(),d=[{group:"values",id:`${r.field.id}-today`,insertText:`${r.field.id}${r.operator}today`,label:"today",mode:"replace-token"},{group:"values",id:`${r.field.id}-7d`,insertText:`${r.field.id}${r.operator}-7d`,label:"-7d",mode:"replace-token"},{group:"values",id:`${r.field.id}-sample`,insertText:`${r.field.id}${r.operator}${c}`,label:c,mode:"replace-token"}];r.operator===":"&&(d[1]={group:"values",id:`${r.field.id}-7d`,insertText:`${r.field.id}:>-7d`,label:">-7d",mode:"replace-token"},d[2]={group:"values",id:`${r.field.id}-sample`,insertText:`${r.field.id}:>${c}`,label:`>${c}`,mode:"replace-token"});const h=r.fragment.trim()?d.filter(p=>p.label.toLowerCase().includes(r.fragment.trim().toLowerCase())):d;return[...l,...h]}const a=CS([r.field]).filter(c=>c.label.toLowerCase().includes(r.token.trim().toLowerCase()));return[...l,...a]}function D3(t,e,n,r){const o=fM(t,e,n),l=r.mode==="replace-whole"?r.insertText:r.mode==="append"?`${t.trimEnd()}${t.trim()?" ":""}${r.insertText}`:`${t.slice(0,o.start)}${r.insertText}${t.slice(o.end)}`,a=r.mode==="append"?l.length:r.mode==="replace-whole"?r.insertText.length:o.start+r.insertText.length;return{keepOpen:!!r.keepOpen,value:l,selectionStart:a}}function dM(t,e){const n=t.trim();if(!n)return{columnFilters:[],globalFilter:""};const r=aM(n),o=new Map,l=[];return r.forEach(a=>{const c=a.match(/^([a-zA-Z0-9_.-]+)(:|>|<)(.*)$/);if(!c){l.push(a);return}const[,d,h,p]=c,g=e.find(v=>v.id===d);if(!g){l.push(a);return}const b=o.get(g.id)??[];b.push({operator:h,value:uM(p)}),o.set(g.id,b)}),{columnFilters:Array.from(o.entries()).map(([a,c])=>({id:a,value:c})),globalFilter:l.join(" ")}}function _3(t,e,n){const r=dM(t,n),o=n.find(c=>c.id===e),l=r.globalFilter.split(/\s+/).filter(Boolean);if(!o||o.kind!=="text")return l;const a=r.columnFilters.find(c=>c.id===e)?.value.filter(c=>c.operator===":"&&c.value.trim()).map(c=>c.value.trim())??[];return[...l,...a]}function z3(t,e){return Array.from(new Set(t.map(n=>lM(e(n)).trim()).filter(Boolean)))}function j3(t){return t==null?new Date().toISOString():t instanceof Date?t.toISOString():typeof t=="object"?JSON.stringify(t):String(t)}function L3(t){return e=>{if(t.accessorFn)return t.accessorFn(e);if(t.accessorKey)return e[t.accessorKey]}}function B3(t){switch(t.kind){case"date":return"date";case"enum":return"enum";case"json":return"json";case"number":return"number";default:return"text"}}function hM(t,e){return t.id??t.accessorKey??(t.header?t.header.toLowerCase().replace(/\s+/g,"-"):`column-${e}`)}function I3(t,e,n={}){const r=e.at(-1);return t.map((o,l)=>{const a=hM(o,l),c=L3(o),d=B3(o);return d==="enum"?{getValue:c,id:a,kind:d,options:o.enumOptions??n.fieldOptions?.[a]??z3(e,c)}:d==="date"?{getValue:c,id:a,kind:d,sample:j3(r?c(r):new Date().toISOString())}:{getValue:c,id:a,kind:d}})}function V3(t,e){const n=new Map(e.map(r=>[r.id,r]));return t.map((r,o)=>{const l=hM(r,o),a=n.get(l);return!a||r.filterFn?r:{...r,filterFn:((c,d,h)=>{const p=Array.isArray(h)?h:[];return O3(c.original,a,p)})}})}function rm(t){return`${t}:search`}function im(t){return`${t}-search`}function MS(t,e){return typeof window>"u"?"":e==="url"?new URL(window.location.href).searchParams.get(im(t))??"":window.localStorage.getItem(rm(t))??""}function F3(t,e,n){if(!(typeof window>"u")){if(e==="url"){const r=new URL(window.location.href);n.trim()?r.searchParams.set(im(t),n):r.searchParams.delete(im(t)),window.history.replaceState(window.history.state,"",r);return}if(n){window.localStorage.setItem(rm(t),n);return}window.localStorage.removeItem(rm(t))}}const pM="datatable:",P3="datatable-",mM=M.createContext(null);function hf(){return M.useContext(mM)}function $3(){const t=hf();if(!t)throw new Error("useDataTableContext must be used inside DataTableProvider.");return t}function H3({children:t,columns:e,data:n,fieldOptions:r,id:o,onSearchChange:l,persistSearch:a=!1,search:c,searchPersistence:d,statePersistence:h,...p}){const g=d??(a?"localStorage":"none"),b=c!==void 0,[v,S]=M.useState(()=>g==="none"?"":MS(o,g)),x=c??v,C=M.useCallback(H=>{b||S(H),l?.(H)},[b,l]);M.useEffect(()=>{if(b||g==="none"){S("");return}S(MS(o,g))},[o,b,g]),M.useEffect(()=>{b||g==="none"||F3(o,g,v)},[o,b,g,v]);const E=M.useMemo(()=>I3(e,n,{fieldOptions:r}),[e,n,r]),A=M.useMemo(()=>dM(x,E),[x,E]),k=M.useMemo(()=>V3(e,E),[e,E]),D=M.useMemo(()=>({...p,columnFilters:A.columnFilters,columns:k,data:n,globalFilter:A.globalFilter,highlightQuery:x,id:o,resolveColumnHighlightTerms:(H,z)=>_3(z,H,E),statePersistence:h??(g==="none"?"none":g)}),[n,o,A.columnFilters,A.globalFilter,k,g,x,E,h,p]),L=M.useMemo(()=>({search:x,searchFields:E,setSearch:C,tableProps:D}),[C,x,D,E]);return T.jsx(mM.Provider,{value:L,children:t})}function ES(t){return t.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,e=>e.toUpperCase())}function U3(t){return t==null?"":t instanceof Date?t.toISOString():typeof t=="object"?JSON.stringify(t):String(t)}function om(t){return`${P3}${t}`}function q3(t){return(t.sorting?.length??0)===0&&(t.columnFilters?.length??0)===0&&Object.keys(t.highlightedColumns??{}).length===0&&Object.keys(t.columnVisibility??{}).length===0&&Object.keys(t.columnSizing??{}).length===0&&!t.globalFilter}function hp(t,e){if(typeof window>"u")return{};try{if(e==="none")return{};const n=e==="url"?new URL(window.location.href).searchParams.get(om(t)):window.localStorage.getItem(`${pM}${t}`);return n?JSON.parse(n):{}}catch{return{}}}function G3(t,e,n){if(!(typeof window>"u")&&e!=="none"){if(e==="url"){const r=new URL(window.location.href);q3(n)?r.searchParams.delete(om(t)):r.searchParams.set(om(t),JSON.stringify(n)),window.history.replaceState(window.history.state,"",r);return}window.localStorage.setItem(`${pM}${t}`,JSON.stringify(n))}}function K3(t){return t==="number"?"right":t==="boolean"||t==="selection"?"center":"left"}function RS(t){switch(t){case"boolean":case"selection":return 76;case"number":return 132;case"date":return 168;case"json":return 240;default:return 220}}function gM(t,e){return t.id??t.accessorKey??(t.header?t.header.toLowerCase().replace(/\s+/g,"-"):`column-${e}`)}function Y3(t,e,n,r,o){const l=Object.keys(t[0]??{}).map(h=>({accessorKey:h,header:ES(h)})),c=(e&&e.length>0?e:l).map((h,p)=>{const g=gM(h,p),b=t.slice(0,25).map(x=>h.accessorFn?h.accessorFn(x):h.accessorKey?x[h.accessorKey]:void 0),v=h.kind??jD(b),S={align:h.align??K3(v),cellClassName:h.cellClassName,enumColors:v==="enum"?h.enumColors:void 0,enumOptions:v==="enum"?h.enumOptions:void 0,headerClassName:h.headerClassName,highlightMatches:h.highlightMatches??v==="text",kind:v,truncate:h.truncate??!0};return{accessorFn:h.accessorFn,accessorKey:h.accessorKey,cell:({getValue:x,row:C})=>h.cell?h.cell({row:C.original,value:x()}):K1(x(),v,{enumColors:v==="enum"?h.enumColors:void 0,enumOptions:v==="enum"?h.enumOptions:void 0}),enableGlobalFilter:h.enableFiltering??!0,filterFn:h.filterFn,enableHiding:h.enableHiding??!0,enableResizing:h.enableResizing??!0,enableSorting:h.enableSorting??!0,header:h.header??ES(g),id:g,maxSize:h.maxWidth??420,meta:S,minSize:h.minWidth??Math.min(RS(v),120),size:h.width??RS(v)}});if(!n)return r?[...c,{cell:()=>null,enableGlobalFilter:!1,enableHiding:!1,enableResizing:!1,enableSorting:!1,header:"Actions",id:"__actions",maxSize:o??280,meta:{align:"right",truncate:!1},minSize:Math.min(o??180,180),size:o??220}]:c;const d=[{cell:({row:h})=>T.jsx("div",{className:"flex items-center justify-center",children:T.jsx(qb,{ariaLabel:`Select row ${h.index+1}`,checked:h.getIsSelected(),onCheckedChange:p=>h.toggleSelected(p)})}),enableGlobalFilter:!1,enableHiding:!1,enableResizing:!1,enableSorting:!1,header:({table:h})=>T.jsx("div",{className:"flex items-center justify-center",children:T.jsx(qb,{ariaLabel:"Select all visible rows",checked:h.getIsAllPageRowsSelected(),indeterminate:h.getIsSomePageRowsSelected(),onCheckedChange:p=>h.toggleAllPageRowsSelected(p)})}),id:"__select",maxSize:56,meta:{align:"center",kind:"selection",sticky:"left",truncate:!1},minSize:56,size:56},...c];return r?[...d,{cell:()=>null,enableGlobalFilter:!1,enableHiding:!1,enableResizing:!1,enableSorting:!1,header:"Actions",id:"__actions",maxSize:o??280,meta:{align:"right",truncate:!1},minSize:Math.min(o??180,180),size:o??220}]:d}const X3=(t,e,n)=>{const r=String(n??"").trim().toLowerCase();return r?U3(t.getValue(e)).toLowerCase().includes(r):!0};function TS(t){return t instanceof Element&&!!t.closest(["a","button","input","label","select","summary","textarea","[contenteditable=true]","[data-no-row-select=true]",'[role="button"]','[role="link"]','[role="menuitem"]'].join(","))}function J3(t,e,n){return t.scope==="selection"&&e.getIsSelected()?n.length>0?n.map(r=>r.original):[e.original]:[e.original]}function Q3(t,e,n){return t.scope==="selection"&&e.getIsSelected()?n.length>0?n.map(r=>r.id):[e.id]:[e.id]}function Z3(t,e,n){return{actionRowIds:Q3(t,e,n),actionRows:J3(t,e,n),anchorRow:e.original,anchorRowId:e.id,selectedRowIds:n.map(r=>r.id),selectedRows:n.map(r=>r.original)}}function Wm(t,e){return typeof t=="function"?t(e):!!t}function yM(t,e){return typeof t.label=="function"?t.label(e):t.label}function _c(t){return t.button===void 0||t.button===!1?null:t.button}function vM(t,e){return`${t.id}:${e.actionRowIds.join(",")}`}function bM(t){if(typeof t=="string")return t;if(t&&typeof t=="object"&&"message"in t&&(typeof t.message=="string"||t.message===void 0))return t.message}function SM(t){return t.some(e=>{if(e.scope==="selection")return!0;const n=Array.isArray(e.items)?e.items:void 0;return n?SM(n):!1})}function xM(t){return t.reduce((e,n)=>{const r=_c(n)!==null?e+1:e,o=Array.isArray(n.items)?n.items:void 0;return o?r+xM(o):r},0)}function W3(t,e,n,r){const o=typeof t.items=="function"?t.items(e):t.items;return wM(o??[],n,r)}function wM(t,e,n){return t.flatMap(r=>{const o=Z3(r,e,n);if(Wm(r.hidden,o))return[];const l=W3(r,o,e,n);return r.items&&l.length===0?[]:[{action:r,context:o,items:l}]})}function CM({resolvedAction:t,setStatus:e,statuses:n}){const{action:r,context:o,items:l}=t,a=yM(r,o),c=Wm(r.disabled,o),d=vM(r,o),h=n[d],p=_c(r),g=M.useCallback(async()=>{if(r.onSelect){e(d,{state:"loading"});try{const S=await r.onSelect(o);e(d,{message:bM(S),state:"success"},2500)}catch(S){e(d,{message:S instanceof Error?S.message:String(S),state:"error"},4e3)}}},[r,o,e,d]),b=h?.state==="loading"?ef:h?.state==="success"?qs:h?.state==="error"?Em:r.icon,v=h?.state==="loading";return l.length>0?T.jsxs(y3,{children:[T.jsxs(S3,{disabled:c||v,children:[b?T.jsx(b,{className:"size-3.5"}):null,T.jsx("span",{className:"truncate",children:a})]}),T.jsx(x3,{className:"w-72",children:l.map(S=>T.jsx(CM,{resolvedAction:S,setStatus:e,statuses:n},S.action.id))})]}):T.jsxs(b3,{disabled:c||v,onSelect:()=>{g()},title:h?.message,variant:r.variant??(p==="destructive"||typeof p=="object"&&p?.variant==="destructive"?"destructive":"default"),children:[b?T.jsx(b,{className:Ne("size-3.5",v&&"animate-spin")}):null,T.jsx("span",{className:"truncate",children:a}),r.shortcut?T.jsx(M3,{children:r.shortcut}):null]})}function eL({resolvedActions:t,setStatus:e,statuses:n}){const r=t.filter(o=>o.items.length===0&&_c(o.action)!==null);return r.length===0?null:T.jsx("div",{className:"flex w-full justify-end gap-1.5","data-no-row-select":"true",children:r.map(o=>{const{action:l,context:a}=o,c=_c(l),d=yM(l,a),h=vM(l,a),p=n[h],g=Wm(l.disabled,a)||p?.state==="loading",b=p?.state==="loading"?ef:p?.state==="success"?qs:p?.state==="error"?Em:l.icon,v=c&&typeof c=="object"&&c.label?c.label:d,S=p?.state==="error"?"destructive":typeof c=="string"?c:c&&typeof c=="object"?c.variant??"outline":"outline",x=c&&typeof c=="object"&&c.size?c.size:"sm",C=c&&typeof c=="object"?c.className:void 0;return T.jsxs(Ls,{"aria-busy":p?.state==="loading",className:C,disabled:g,onClick:()=>{const E=l.onSelect;E&&(async()=>{e(h,{state:"loading"});try{const A=await E(a);e(h,{message:bM(A),state:"success"},2500)}catch(A){e(h,{message:A instanceof Error?A.message:String(A),state:"error"},4e3)}})()},size:x,title:p?.message,type:"button",variant:S,children:[b?T.jsx(b,{className:Ne("size-3.5",p?.state==="loading"&&"animate-spin")}):null,v]},h)})})}function tL({autoScrollToBottom:t=!1,autoScrollToBottomThreshold:e=96,columnFilters:n,columnVisibility:r,columns:o,data:l,edgeHorizontalPadding:a="16px",enableRowSelection:c=!1,filterPlaceholder:d="Search across visible columns",globalFilter:h,getRowId:p,height:g=620,highlightQuery:b="",id:v,onColumnFiltersChange:S,onColumnVisibilityChange:x,onGlobalFilterChange:C,resolveColumnHighlightTerms:E,rowActions:A,rowClassName:k,rowStyle:D,rowHeight:L=48,statePersistence:H="localStorage"}){const z=hf(),j=M.useMemo(()=>hp(v,H),[v,H]),[J,le]=M.useState(()=>j.sorting??[]),[ce,se]=M.useState(()=>j.columnSizing??{}),[Se,ne]=M.useState(()=>j.columnVisibility??{}),[me,I]=M.useState(()=>j.highlightedColumns??{}),[Q,U]=M.useState(()=>j.columnFilters??[]),[K,G]=M.useState({}),[N,V]=M.useState({}),X=M.useRef({}),ee=M.useRef(null),re=M.useRef(null),ae=M.useRef(null),[de,De]=M.useState(!1),[xe,Ft]=M.useState(()=>j.globalFilter??""),Qt=M.useDeferredValue(xe),xt=n!==void 0,ht=r!==void 0,kt=h!==void 0,Pi=n??Q,hr=r??Se,Tf=A?SM(A):!1,No=A?xM(A):0,Tn=c||Tf,Do=c,_o=No>0,ka=M.useMemo(()=>Math.max(160,Math.min(320,No*96)),[No]),Na=M.useMemo(()=>{if(!o||o.length===0)return o;const ie=new Map((z?.searchFields??[]).filter(oe=>oe.kind==="enum").map(oe=>[oe.id,oe.options??[]]));return o.map((oe,Ce)=>{if(oe.kind!=="enum"||oe.enumOptions?.length)return oe;const Le=ie.get(gM(oe,Ce));return!Le||Le.length===0?oe:{...oe,enumOptions:Le}})},[o,z?.searchFields]),Zt=M.useMemo(()=>Y3(l,Na,Do,_o,ka),[Na,l,ka,_o,Do]),Da=M.useCallback((ie,oe,Ce)=>{const Le=X.current[ie];Le&&(window.clearTimeout(Le),delete X.current[ie]),V(et=>({...et,[ie]:oe})),Ce&&(X.current[ie]=window.setTimeout(()=>{V(et=>{const Re={...et};return delete Re[ie],Re}),delete X.current[ie]},Ce))},[]),_a=M.useCallback(ie=>{se(oe=>Xn(ie,oe))},[]),za=M.useCallback(ie=>{const oe=Xn(ie,Pi);xt||U(oe),S?.(oe)},[xt,S,Pi]),zo=M.useCallback(ie=>{const oe=Xn(ie,hr);ht||ne(oe),x?.(oe)},[ht,x,hr]),pr=xN({columnResizeMode:"onChange",columns:Zt,data:l,enableColumnResizing:!0,enableRowSelection:Tn,getCoreRowModel:dN(),getFilteredRowModel:gN(),getRowId:p,getSortedRowModel:yN(),globalFilterFn:X3,onColumnFiltersChange:za,onColumnSizingChange:_a,onColumnVisibilityChange:zo,onRowSelectionChange:G,onSortingChange:le,state:{columnFilters:Pi,columnSizing:ce,columnVisibility:hr,globalFilter:Qt.trim(),rowSelection:K,sorting:J}}),tr=M.useRef(null),Js=M.useRef(!0),ja=M.useRef(!1),Ur=M.useRef(0),We=pr.getRowModel().rows,pn=pr.getSelectedRowModel().rows,Wt=typeof g=="number"?g:0,Af=M.useRef(t?Math.max(We.length*L-Wt,0):0),$i=_N({count:We.length,estimateSize:()=>L,getScrollElement:()=>tr.current,initialOffset:Af.current,overscan:12}),La=$i.getVirtualItems();l.length,We.length,pn.length,M.useEffect(()=>()=>{for(const ie of Object.values(X.current))window.clearTimeout(ie)},[]),M.useEffect(()=>{if(xt)return;const ie=hp(v,H);le(ie.sorting??[]),se(ie.columnSizing??{}),ht||ne(ie.columnVisibility??{}),I(ie.highlightedColumns??{}),U(ie.columnFilters??[]),Ft(ie.globalFilter??""),G({}),re.current=null,ae.current=null,De(!1),ee.current=null;for(const oe of Object.values(X.current))window.clearTimeout(oe);X.current={},V({})},[v,xt,ht,H]),M.useEffect(()=>{xt&&U(n)},[n,xt]),M.useEffect(()=>{ht&&ne(r)},[r,ht]),M.useEffect(()=>{kt&&Ft(h)},[h,kt]),M.useEffect(()=>{if(typeof window>"u"||H!=="url")return;const ie=()=>{const oe=hp(v,"url");le(oe.sorting??[]),se(oe.columnSizing??{}),ht||ne(oe.columnVisibility??{}),I(oe.highlightedColumns??{}),U(oe.columnFilters??[]),Ft(oe.globalFilter??""),G({}),re.current=null,ae.current=null,De(!1),ee.current=null};return window.addEventListener("popstate",ie),()=>window.removeEventListener("popstate",ie)},[v,ht,H]),M.useEffect(()=>{kt||xt||G3(v,H,{columnFilters:Q,columnSizing:ce,highlightedColumns:me,columnVisibility:hr,globalFilter:Qt.trim(),sorting:J})},[Q,ce,Qt,me,v,xt,kt,hr,J,H]),M.useEffect(()=>{const ie=tr.current;if(!t||!ie)return;const oe=()=>{const Ce=ie.scrollHeight-ie.scrollTop-ie.clientHeight;Js.current=Ce<=e};return oe(),ie.addEventListener("scroll",oe,{passive:!0}),()=>{ie.removeEventListener("scroll",oe)}},[t,e]),M.useLayoutEffect(()=>{const ie=tr.current,oe=Ur.current;Ur.current=l.length;const Ce=()=>{We.length!==0&&($i.scrollToIndex(We.length-1,{align:"end"}),ie?.scrollTo({top:ie.scrollHeight}))},Le=()=>{const et=[],Re=ut=>{if(Ce(),ut<=0)return;const ct=window.requestAnimationFrame(()=>Re(ut-1));et.push(ct)};return Re(4),()=>{for(const ut of et)window.cancelAnimationFrame(ut)}};if(t&&ie&&!ja.current&&We.length>0)return ja.current=!0,Js.current=!0,Le();if(!(!t||!ie||l.length<=oe||!Js.current))return Le()},[t,l.length,$i,We.length]);const qr=M.useCallback((ie,oe)=>me[ie]??!!oe.highlightMatches,[me]),Un=M.useCallback((ie,oe,Ce={})=>{const Le=We.findIndex(ct=>ct.id===ie),et=We.findIndex(ct=>ct.id===oe);if(Le===-1||et===-1)return;const[Re,ut]=Le<=et?[Le,et]:[et,Le];G({...Ce,...Object.fromEntries(We.slice(Re,ut+1).map(ct=>[ct.id,!0]))})},[We]),Hi=M.useCallback(ie=>{ee.current=ie,G({[ie]:!0})},[]),An=M.useCallback((ie,oe)=>{if(!re.current)return;const Ce=tr.current;if(!Ce)return;const Le=document.elementFromPoint(ie,oe)?.closest("tr[data-row-id]"),et=Array.from(Ce.querySelectorAll("tr[data-row-id]")),Re=Le?.dataset.rowId??(oe<Ce.getBoundingClientRect().top?et[0]?.dataset.rowId:oe>Ce.getBoundingClientRect().bottom?et.at(-1)?.dataset.rowId:void 0);if(!Re)return;const{anchorId:ut,baseSelection:ct}=re.current;Un(ut,Re,ct)},[Un]),jo=M.useCallback((ie,oe)=>{if(ie.button!==0||!Tn||TS(ie.target))return;ie.preventDefault(),ae.current={clientX:ie.clientX,clientY:ie.clientY};const Ce=oe.id,Le=ie.metaKey||ie.ctrlKey,et=pr.getState().rowSelection;if(ie.shiftKey){const Re=ee.current??Ce;ee.current=Re,re.current={anchorId:Re,baseSelection:{}},De(!0),Un(Re,Ce);return}if(Le){const Re={...et};Re[Ce]?delete Re[Ce]:Re[Ce]=!0,ee.current=Ce,re.current={anchorId:Ce,baseSelection:Re},De(!0),G(Re);return}ee.current=Ce,re.current={anchorId:Ce,baseSelection:{}},De(!0),G({[Ce]:!0})},[Tn,Un,pr]),Ui=M.useCallback((ie,oe)=>{if(!Tn||ie.buttons!==1||TS(ie.target)||!re.current)return;const{anchorId:Ce,baseSelection:Le}=re.current;Un(Ce,oe.id,Le)},[Tn,Un]),Of=M.useCallback(ie=>{if(Tn){if(ie.getIsSelected()){ee.current=ie.id;return}Hi(ie.id)}},[Tn,Hi]);return M.useEffect(()=>{if(!de)return;const ie=Ce=>{ae.current={clientX:Ce.clientX,clientY:Ce.clientY},An(Ce.clientX,Ce.clientY)},oe=()=>{re.current=null,ae.current=null,De(!1)};return window.addEventListener("mousemove",ie),window.addEventListener("mouseup",oe),()=>{window.removeEventListener("mousemove",ie),window.removeEventListener("mouseup",oe)}},[de,An]),M.useEffect(()=>{if(!de)return;let ie=0;const oe=()=>{const Ce=tr.current,Le=ae.current;if(Ce&&Le){const{top:et,bottom:Re}=Ce.getBoundingClientRect(),ut=48;let ct=0;if(Le.clientY<et+ut?ct=-Math.ceil((et+ut-Le.clientY)/6):Le.clientY>Re-ut&&(ct=Math.ceil((Le.clientY-(Re-ut))/6)),ct!==0){const Lo=Math.max(-28,Math.min(28,ct));Ce.scrollTop+=Lo,An(Le.clientX,Le.clientY)}}ie=window.requestAnimationFrame(oe)};return ie=window.requestAnimationFrame(oe),()=>{window.cancelAnimationFrame(ie)}},[de,An]),T.jsx("section",{className:"flex min-h-0 flex-col overflow-hidden border-t border-border bg-card text-card-foreground shadow-sm",style:{height:g},children:T.jsx("div",{className:Ne("min-h-0 flex-1 overflow-auto pb-4",de&&"select-none"),ref:tr,style:{scrollbarGutter:"stable"},children:T.jsxs("table",{className:"grid w-full border-separate border-spacing-0",role:"grid",children:[T.jsx("thead",{className:"sticky top-0 z-20 grid",children:pr.getHeaderGroups().map(ie=>T.jsx("tr",{className:"flex w-full",style:{width:pr.getTotalSize()},children:ie.headers.map((oe,Ce)=>T.jsx(ID,{header:oe,highlightEnabled:qr(oe.column.id,oe.column.columnDef.meta??{}),onToggleHighlight:()=>I(Le=>({...Le,[oe.column.id]:!qr(oe.column.id,oe.column.columnDef.meta??{})})),paddingLeft:Ce===0?a:void 0,paddingRight:Ce===ie.headers.length-1?a:void 0,scrollContainerRef:tr},oe.id))},ie.id))}),T.jsx("tbody",{className:"relative grid",style:{height:$i.getTotalSize()},children:La.length===0?T.jsx("tr",{className:"absolute inset-x-0 top-0 flex h-full items-center justify-center",children:T.jsx("td",{className:"px-4 py-10 text-center text-sm text-muted-foreground",children:"No rows match the current filters."})}):La.map(ie=>{const oe=We[ie.index],Ce=wM(A??[],oe,pn),Le=oe.getIsSelected(),et=T.jsx("tr",{"aria-selected":Le,className:Ne("absolute left-0 flex w-full bg-card transition-colors",Tn&&"cursor-pointer",k?.(oe.original),Le&&"bg-primary/10 before:absolute before:-top-px before:left-0 before:h-px before:w-full before:bg-primary before:content-[''] after:absolute after:bottom-0 after:left-0 after:h-px after:w-full after:bg-primary after:content-['']"),"data-index":ie.index,"data-row-id":oe.id,"data-state":Le?"selected":void 0,onContextMenu:()=>Of(oe),onMouseDown:Re=>jo(Re,oe),onMouseEnter:Re=>Ui(Re,oe),ref:Re=>{Re&&$i.measureElement(Re)},style:{...D?.(oe.original),minHeight:L,transform:`translateY(${ie.start}px)`,width:pr.getTotalSize()},children:oe.getVisibleCells().map((Re,ut,ct)=>{const Gr=Re.column.columnDef.meta??{},Lo=Re.column.id==="__actions",Ba=Gr.kind==="text"&&E&&qr(Re.column.id,Gr)?E(Re.column.id,b):[];return Lo?T.jsx("td",{className:Ne("flex shrink-0 border-b border-border px-2 py-1.5 align-middle text-sm text-foreground justify-end text-right",Gr.cellClassName),style:{paddingLeft:ut===0?a:void 0,paddingRight:ut===ct.length-1?a:void 0,width:Re.column.getSize()},children:T.jsx("div",{className:"w-full min-w-0",children:T.jsx(eL,{resolvedActions:Ce,setStatus:Da,statuses:N})})},Re.id):T.jsx(DD,{cell:Re,highlightTerms:Ba,paddingLeft:ut===0?a:void 0,paddingRight:ut===ct.length-1?a:void 0},Re.id)})},oe.id);return Ce.length===0?et:T.jsxs(m3,{children:[T.jsx(g3,{asChild:!0,children:et}),T.jsxs(v3,{className:"w-64",children:[Ce.map(Re=>T.jsx(CM,{resolvedAction:Re,setStatus:Da,statuses:N},Re.action.id)),T.jsx(C3,{}),T.jsx(w3,{children:Le&&pn.length>1?`${pn.length} selected rows`:"Row actions"})]})]},oe.id)})})]})})})}function nL(t={}){const e=hf(),n=e?{...e.tableProps,...t}:t;if(n.data===void 0||n.id===void 0)throw new Error("DataTable must be used inside DataTableProvider or receive data and id props.");return T.jsx(tL,{...n})}function MM(t,e){return t.id??t.accessorKey??(t.header?t.header.toLowerCase().replace(/\s+/g,"-"):`column-${e}`)}function pf(t,e){return e.includes(".")?e.split(".").reduce((n,r)=>{if(!(n==null||typeof n!="object"))return n[r]},t):t[e]}function rL(t){return t.includes(".")}function Lt(t){this.content=t}Lt.prototype={constructor:Lt,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,o=r.find(t),l=r.content.slice();return o==-1?l.push(n||t,e):(l[o+1]=e,n&&(l[o]=n)),new Lt(l)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new Lt(n)},addToStart:function(t,e){return new Lt([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new Lt(n)},addBefore:function(t,e,n){var r=this.remove(e),o=r.content.slice(),l=r.find(t);return o.splice(l==-1?o.length:l,0,e,n),new Lt(o)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=Lt.from(t),t.size?new Lt(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=Lt.from(t),t.size?new Lt(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=Lt.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}};Lt.from=function(t){if(t instanceof Lt)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new Lt(e)};function EM(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let o=t.child(r),l=e.child(r);if(o==l){n+=o.nodeSize;continue}if(!o.sameMarkup(l))return n;if(o.isText&&o.text!=l.text){for(let a=0;o.text[a]==l.text[a];a++)n++;return n}if(o.content.size||l.content.size){let a=EM(o.content,l.content,n+1);if(a!=null)return a}n+=o.nodeSize}}function RM(t,e,n,r){for(let o=t.childCount,l=e.childCount;;){if(o==0||l==0)return o==l?null:{a:n,b:r};let a=t.child(--o),c=e.child(--l),d=a.nodeSize;if(a==c){n-=d,r-=d;continue}if(!a.sameMarkup(c))return{a:n,b:r};if(a.isText&&a.text!=c.text){let h=0,p=Math.min(a.text.length,c.text.length);for(;h<p&&a.text[a.text.length-h-1]==c.text[c.text.length-h-1];)h++,n--,r--;return{a:n,b:r}}if(a.content.size||c.content.size){let h=RM(a.content,c.content,n-1,r-1);if(h)return h}n-=d,r-=d}}class te{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,o=0,l){for(let a=0,c=0;c<n;a++){let d=this.content[a],h=c+d.nodeSize;if(h>e&&r(d,o+c,l||null,a)!==!1&&d.content.size){let p=c+1;d.nodesBetween(Math.max(0,e-p),Math.min(d.content.size,n-p),r,o+p)}c=h}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,o){let l="",a=!0;return this.nodesBetween(e,n,(c,d)=>{let h=c.isText?c.text.slice(Math.max(e,d)-d,n-d):c.isLeaf?o?typeof o=="function"?o(c):o:c.type.spec.leafText?c.type.spec.leafText(c):"":"";c.isBlock&&(c.isLeaf&&h||c.isTextblock)&&r&&(a?a=!1:l+=r),l+=h},0),l}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,o=this.content.slice(),l=0;for(n.isText&&n.sameMarkup(r)&&(o[o.length-1]=n.withText(n.text+r.text),l=1);l<e.content.length;l++)o.push(e.content[l]);return new te(o,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],o=0;if(n>e)for(let l=0,a=0;a<n;l++){let c=this.content[l],d=a+c.nodeSize;d>e&&((a<e||d>n)&&(c.isText?c=c.cut(Math.max(0,e-a),Math.min(c.text.length,n-a)):c=c.cut(Math.max(0,e-a-1),Math.min(c.content.size,n-a-1))),r.push(c),o+=c.nodeSize),a=d}return new te(r,o)}cutByIndex(e,n){return e==n?te.empty:e==0&&n==this.content.length?this:new te(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let o=this.content.slice(),l=this.size+n.nodeSize-r.nodeSize;return o[e]=n,new te(o,l)}addToStart(e){return new te([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new te(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let o=this.content[n];e(o,r,n),r+=o.nodeSize}}findDiffStart(e,n=0){return EM(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return RM(this,e,n,r)}findIndex(e){if(e==0)return ac(0,e);if(e==this.size)return ac(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let o=this.child(n),l=r+o.nodeSize;if(l>=e)return l==e?ac(n+1,l):ac(n,r);r=l}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return te.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new te(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return te.empty;let n,r=0;for(let o=0;o<e.length;o++){let l=e[o];r+=l.nodeSize,o&&l.isText&&e[o-1].sameMarkup(l)?(n||(n=e.slice(0,o)),n[n.length-1]=l.withText(n[n.length-1].text+l.text)):n&&n.push(l)}return new te(n||e,r)}static from(e){if(!e)return te.empty;if(e instanceof te)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new te([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}te.empty=new te([],0);const pp={index:0,offset:0};function ac(t,e){return pp.index=t,pp.offset=e,pp}function zc(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!zc(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!zc(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let Ze=class sm{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let o=0;o<e.length;o++){let l=e[o];if(this.eq(l))return e;if(this.type.excludes(l.type))n||(n=e.slice(0,o));else{if(l.type.excludes(this.type))return e;!r&&l.type.rank>this.type.rank&&(n||(n=e.slice(0,o)),n.push(this),r=!0),n&&n.push(l)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&zc(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let o=r.create(n.attrs);return r.checkAttrs(o.attrs),o}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return sm.none;if(e instanceof sm)return[e];let n=e.slice();return n.sort((r,o)=>r.type.rank-o.type.rank),n}};Ze.none=[];class jc extends Error{}class ue{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=AM(this.content,e+this.openStart,n);return r&&new ue(r,this.openStart,this.openEnd)}removeBetween(e,n){return new ue(TM(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return ue.empty;let r=n.openStart||0,o=n.openEnd||0;if(typeof r!="number"||typeof o!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new ue(te.fromJSON(e,n.content),r,o)}static maxOpen(e,n=!0){let r=0,o=0;for(let l=e.firstChild;l&&!l.isLeaf&&(n||!l.type.spec.isolating);l=l.firstChild)r++;for(let l=e.lastChild;l&&!l.isLeaf&&(n||!l.type.spec.isolating);l=l.lastChild)o++;return new ue(e,r,o)}}ue.empty=new ue(te.empty,0,0);function TM(t,e,n){let{index:r,offset:o}=t.findIndex(e),l=t.maybeChild(r),{index:a,offset:c}=t.findIndex(n);if(o==e||l.isText){if(c!=n&&!t.child(a).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=a)throw new RangeError("Removing non-flat range");return t.replaceChild(r,l.copy(TM(l.content,e-o-1,n-o-1)))}function AM(t,e,n,r){let{index:o,offset:l}=t.findIndex(e),a=t.maybeChild(o);if(l==e||a.isText)return r&&!r.canReplace(o,o,n)?null:t.cut(0,e).append(n).append(t.cut(e));let c=AM(a.content,e-l-1,n,a);return c&&t.replaceChild(o,a.copy(c))}function iL(t,e,n){if(n.openStart>t.depth)throw new jc("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new jc("Inconsistent open depths");return OM(t,e,n,0)}function OM(t,e,n,r){let o=t.index(r),l=t.node(r);if(o==e.index(r)&&r<t.depth-n.openStart){let a=OM(t,e,n,r+1);return l.copy(l.content.replaceChild(o,a))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let a=t.parent,c=a.content;return yo(a,c.cut(0,t.parentOffset).append(n.content).append(c.cut(e.parentOffset)))}else{let{start:a,end:c}=oL(n,t);return yo(l,NM(t,a,c,e,r))}else return yo(l,Lc(t,e,r))}function kM(t,e){if(!e.type.compatibleContent(t.type))throw new jc("Cannot join "+e.type.name+" onto "+t.type.name)}function lm(t,e,n){let r=t.node(n);return kM(r,e.node(n)),r}function go(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function Wl(t,e,n,r){let o=(e||t).node(n),l=0,a=e?e.index(n):o.childCount;t&&(l=t.index(n),t.depth>n?l++:t.textOffset&&(go(t.nodeAfter,r),l++));for(let c=l;c<a;c++)go(o.child(c),r);e&&e.depth==n&&e.textOffset&&go(e.nodeBefore,r)}function yo(t,e){return t.type.checkContent(e),t.copy(e)}function NM(t,e,n,r,o){let l=t.depth>o&&lm(t,e,o+1),a=r.depth>o&&lm(n,r,o+1),c=[];return Wl(null,t,o,c),l&&a&&e.index(o)==n.index(o)?(kM(l,a),go(yo(l,NM(t,e,n,r,o+1)),c)):(l&&go(yo(l,Lc(t,e,o+1)),c),Wl(e,n,o,c),a&&go(yo(a,Lc(n,r,o+1)),c)),Wl(r,null,o,c),new te(c)}function Lc(t,e,n){let r=[];if(Wl(null,t,n,r),t.depth>n){let o=lm(t,e,n+1);go(yo(o,Lc(t,e,n+1)),r)}return Wl(e,null,n,r),new te(r)}function oL(t,e){let n=e.depth-t.openStart,o=e.node(n).copy(t.content);for(let l=n-1;l>=0;l--)o=e.node(l).copy(te.from(o));return{start:o.resolveNoCache(t.openStart+n),end:o.resolveNoCache(o.content.size-t.openEnd-n)}}class ca{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],o=e.child(n);return r?e.child(n).cut(r):o}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],o=n==0?0:this.path[n*3-1]+1;for(let l=0;l<e;l++)o+=r.child(l).nodeSize;return o}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return Ze.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),o=e.maybeChild(n);if(!r){let c=r;r=o,o=c}let l=r.marks;for(var a=0;a<l.length;a++)l[a].type.spec.inclusive===!1&&(!o||!l[a].isInSet(o.marks))&&(l=l[a--].removeFromSet(l));return l}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,o=e.parent.maybeChild(e.index());for(var l=0;l<r.length;l++)r[l].type.spec.inclusive===!1&&(!o||!r[l].isInSet(o.marks))&&(r=r[l--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new Bc(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],o=0,l=n;for(let a=e;;){let{index:c,offset:d}=a.content.findIndex(l),h=l-d;if(r.push(a,c,o+d),!h||(a=a.child(c),a.isText))break;l=h-1,o+=d+1}return new ca(n,r,l)}static resolveCached(e,n){let r=AS.get(e);if(r)for(let l=0;l<r.elts.length;l++){let a=r.elts[l];if(a.pos==n)return a}else AS.set(e,r=new sL);let o=r.elts[r.i]=ca.resolve(e,n);return r.i=(r.i+1)%lL,o}}class sL{constructor(){this.elts=[],this.i=0}}const lL=12,AS=new WeakMap;class Bc{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const aL=Object.create(null);let Ti=class am{constructor(e,n,r,o=Ze.none){this.type=e,this.attrs=n,this.marks=o,this.content=r||te.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,o=0){this.content.nodesBetween(e,n,r,o,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,o){return this.content.textBetween(e,n,r,o)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&zc(this.attrs,n||e.defaultAttrs||aL)&&Ze.sameSet(this.marks,r||Ze.none)}copy(e=null){return e==this.content?this:new am(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new am(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return ue.empty;let o=this.resolve(e),l=this.resolve(n),a=r?0:o.sharedDepth(n),c=o.start(a),h=o.node(a).content.cut(o.pos-c,l.pos-c);return new ue(h,o.depth-a,l.depth-a)}replace(e,n,r){return iL(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:o}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(o==e||n.isText)return n;e-=o+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let o=this.content.child(n-1);return{node:o,index:n-1,offset:r-o.nodeSize}}resolve(e){return ca.resolveCached(this,e)}resolveNoCache(e){return ca.resolve(this,e)}rangeHasMark(e,n,r){let o=!1;return n>e&&this.nodesBetween(e,n,l=>(r.isInSet(l.marks)&&(o=!0),!o)),o}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),DM(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=te.empty,o=0,l=r.childCount){let a=this.contentMatchAt(e).matchFragment(r,o,l),c=a&&a.matchFragment(this.content,n);if(!c||!c.validEnd)return!1;for(let d=o;d<l;d++)if(!this.type.allowsMarks(r.child(d).marks))return!1;return!0}canReplaceWith(e,n,r,o){if(o&&!this.type.allowsMarks(o))return!1;let l=this.contentMatchAt(e).matchType(r),a=l&&l.matchFragment(this.content,n);return a?a.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=Ze.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!Ze.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let o=te.fromJSON(e,n.content),l=e.nodeType(n.type).create(n.attrs,o,r);return l.type.checkAttrs(l.attrs),l}};Ti.prototype.text=void 0;class Ic extends Ti{constructor(e,n,r,o){if(super(e,n,null,o),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):DM(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Ic(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Ic(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function DM(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class wo{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new uL(e,n);if(r.next==null)return wo.empty;let o=_M(r);r.next&&r.err("Unexpected trailing text");let l=gL(mL(o));return yL(l,r),l}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let o=this;for(let l=n;o&&l<r;l++)o=o.matchType(e.child(l).type);return o}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let o=[this];function l(a,c){let d=a.matchFragment(e,r);if(d&&(!n||d.validEnd))return te.from(c.map(h=>h.createAndFill()));for(let h=0;h<a.next.length;h++){let{type:p,next:g}=a.next[h];if(!(p.isText||p.hasRequiredAttrs())&&o.indexOf(g)==-1){o.push(g);let b=l(g,c.concat(p));if(b)return b}}return null}return l(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let o=r.shift(),l=o.match;if(l.matchType(e)){let a=[];for(let c=o;c.type;c=c.via)a.push(c.type);return a.reverse()}for(let a=0;a<l.next.length;a++){let{type:c,next:d}=l.next[a];!c.isLeaf&&!c.hasRequiredAttrs()&&!(c.name in n)&&(!o.type||d.validEnd)&&(r.push({match:c.contentMatch,type:c,via:o}),n[c.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let o=0;o<r.next.length;o++)e.indexOf(r.next[o].next)==-1&&n(r.next[o].next)}return n(this),e.map((r,o)=>{let l=o+(r.validEnd?"*":" ")+" ";for(let a=0;a<r.next.length;a++)l+=(a?", ":"")+r.next[a].type.name+"->"+e.indexOf(r.next[a].next);return l}).join(`
|
|
56
|
+
`)}}wo.empty=new wo(!0);class uL{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function _M(t){let e=[];do e.push(cL(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function cL(t){let e=[];do e.push(fL(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function fL(t){let e=pL(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=dL(t,e);else break;return e}function OS(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function dL(t,e){let n=OS(t),r=n;return t.eat(",")&&(t.next!="}"?r=OS(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function hL(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let o=[];for(let l in n){let a=n[l];a.isInGroup(e)&&o.push(a)}return o.length==0&&t.err("No node type or group '"+e+"' found"),o}function pL(t){if(t.eat("(")){let e=_M(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=hL(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function mL(t){let e=[[]];return o(l(t,0),n()),e;function n(){return e.push([])-1}function r(a,c,d){let h={term:d,to:c};return e[a].push(h),h}function o(a,c){a.forEach(d=>d.to=c)}function l(a,c){if(a.type=="choice")return a.exprs.reduce((d,h)=>d.concat(l(h,c)),[]);if(a.type=="seq")for(let d=0;;d++){let h=l(a.exprs[d],c);if(d==a.exprs.length-1)return h;o(h,c=n())}else if(a.type=="star"){let d=n();return r(c,d),o(l(a.expr,d),d),[r(d)]}else if(a.type=="plus"){let d=n();return o(l(a.expr,c),d),o(l(a.expr,d),d),[r(d)]}else{if(a.type=="opt")return[r(c)].concat(l(a.expr,c));if(a.type=="range"){let d=c;for(let h=0;h<a.min;h++){let p=n();o(l(a.expr,d),p),d=p}if(a.max==-1)o(l(a.expr,d),d);else for(let h=a.min;h<a.max;h++){let p=n();r(d,p),o(l(a.expr,d),p),d=p}return[r(d)]}else{if(a.type=="name")return[r(c,void 0,a.value)];throw new Error("Unknown expr type")}}}}function zM(t,e){return e-t}function kS(t,e){let n=[];return r(e),n.sort(zM);function r(o){let l=t[o];if(l.length==1&&!l[0].term)return r(l[0].to);n.push(o);for(let a=0;a<l.length;a++){let{term:c,to:d}=l[a];!c&&n.indexOf(d)==-1&&r(d)}}}function gL(t){let e=Object.create(null);return n(kS(t,0));function n(r){let o=[];r.forEach(a=>{t[a].forEach(({term:c,to:d})=>{if(!c)return;let h;for(let p=0;p<o.length;p++)o[p][0]==c&&(h=o[p][1]);kS(t,d).forEach(p=>{h||o.push([c,h=[]]),h.indexOf(p)==-1&&h.push(p)})})});let l=e[r.join(",")]=new wo(r.indexOf(t.length-1)>-1);for(let a=0;a<o.length;a++){let c=o[a][1].sort(zM);l.next.push({type:o[a][0],next:e[c.join(",")]||n(c)})}return l}}function yL(t,e){for(let n=0,r=[t];n<r.length;n++){let o=r[n],l=!o.validEnd,a=[];for(let c=0;c<o.next.length;c++){let{type:d,next:h}=o.next[c];a.push(d.name),l&&!(d.isText||d.hasRequiredAttrs())&&(l=!1),r.indexOf(h)==-1&&r.push(h)}l&&e.err("Only non-generatable nodes ("+a.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function jM(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function LM(t,e){let n=Object.create(null);for(let r in t){let o=e&&e[r];if(o===void 0){let l=t[r];if(l.hasDefault)o=l.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=o}return n}function BM(t,e,n,r){for(let o in e)if(!(o in t))throw new RangeError(`Unsupported attribute ${o} for ${n} of type ${o}`);for(let o in t){let l=t[o];l.validate&&l.validate(e[o])}}function IM(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new bL(t,r,e[r]);return n}let NS=class VM{constructor(e,n,r){this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=IM(e,r.attrs),this.defaultAttrs=jM(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==wo.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:LM(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Ti(this,this.computeAttrs(e),te.from(n),Ze.setFrom(r))}createChecked(e=null,n,r){return n=te.from(n),this.checkContent(n),new Ti(this,this.computeAttrs(e),n,Ze.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=te.from(n),n.size){let a=this.contentMatch.fillBefore(n);if(!a)return null;n=a.append(n)}let o=this.contentMatch.matchFragment(n),l=o&&o.fillBefore(te.empty,!0);return l?new Ti(this,e,n.append(l),Ze.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){BM(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?n&&n.push(e[r]):n||(n=e.slice(0,r));return n?n.length?n:Ze.none:e}static compile(e,n){let r=Object.create(null);e.forEach((l,a)=>r[l]=new VM(l,n,a));let o=n.spec.topNode||"doc";if(!r[o])throw new RangeError("Schema is missing its top node type ('"+o+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let l in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function vL(t,e,n){let r=n.split("|");return o=>{let l=o===null?"null":typeof o;if(r.indexOf(l)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${l}`)}}class bL{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?vL(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class mf{constructor(e,n,r,o){this.name=e,this.rank=n,this.schema=r,this.spec=o,this.attrs=IM(e,o.attrs),this.excluded=null;let l=jM(this.attrs);this.instance=l?new Ze(this,l):null}create(e=null){return!e&&this.instance?this.instance:new Ze(this,LM(this.attrs,e))}static compile(e,n){let r=Object.create(null),o=0;return e.forEach((l,a)=>r[l]=new mf(l,o++,n,a)),r}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}checkAttrs(e){BM(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class FM{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let o in e)n[o]=e[o];n.nodes=Lt.from(e.nodes),n.marks=Lt.from(e.marks||{}),this.nodes=NS.compile(this.spec.nodes,this),this.marks=mf.compile(this.spec.marks,this);let r=Object.create(null);for(let o in this.nodes){if(o in this.marks)throw new RangeError(o+" can not be both a node and a mark");let l=this.nodes[o],a=l.spec.content||"",c=l.spec.marks;if(l.contentMatch=r[a]||(r[a]=wo.parse(a,this.nodes)),l.inlineContent=l.contentMatch.inlineContent,l.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!l.isInline||!l.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=l}l.markSet=c=="_"?null:c?DS(this,c.split(" ")):c==""||!l.inlineContent?[]:null}for(let o in this.marks){let l=this.marks[o],a=l.spec.excludes;l.excluded=a==null?[l]:a==""?[]:DS(this,a.split(" "))}this.nodeFromJSON=o=>Ti.fromJSON(this,o),this.markFromJSON=o=>Ze.fromJSON(this,o),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,o){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof NS){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,o)}text(e,n){let r=this.nodes.text;return new Ic(r,r.defaultAttrs,e,Ze.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function DS(t,e){let n=[];for(let r=0;r<e.length;r++){let o=e[r],l=t.marks[o],a=l;if(l)n.push(l);else for(let c in t.marks){let d=t.marks[c];(o=="_"||d.spec.group&&d.spec.group.split(" ").indexOf(o)>-1)&&n.push(a=d)}if(!a)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function SL(t){return t.tag!=null}function xL(t){return t.style!=null}class Ai{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(o=>{if(SL(o))this.tags.push(o);else if(xL(o)){let l=/[^=]*/.exec(o.style)[0];r.indexOf(l)<0&&r.push(l),this.styles.push(o)}}),this.normalizeLists=!this.tags.some(o=>{if(!/^(ul|ol)\b/.test(o.tag)||!o.node)return!1;let l=e.nodes[o.node];return l.contentMatch.matchType(l)})}parse(e,n={}){let r=new zS(this,n,!1);return r.addAll(e,Ze.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new zS(this,n,!0);return r.addAll(e,Ze.none,n.from,n.to),ue.maxOpen(r.finish())}matchTag(e,n,r){for(let o=r?this.tags.indexOf(r)+1:0;o<this.tags.length;o++){let l=this.tags[o];if(ML(e,l.tag)&&(l.namespace===void 0||e.namespaceURI==l.namespace)&&(!l.context||n.matchesContext(l.context))){if(l.getAttrs){let a=l.getAttrs(e);if(a===!1)continue;l.attrs=a||void 0}return l}}}matchStyle(e,n,r,o){for(let l=o?this.styles.indexOf(o)+1:0;l<this.styles.length;l++){let a=this.styles[l],c=a.style;if(!(c.indexOf(e)!=0||a.context&&!r.matchesContext(a.context)||c.length>e.length&&(c.charCodeAt(e.length)!=61||c.slice(e.length+1)!=n))){if(a.getAttrs){let d=a.getAttrs(n);if(d===!1)continue;a.attrs=d||void 0}return a}}}static schemaRules(e){let n=[];function r(o){let l=o.priority==null?50:o.priority,a=0;for(;a<n.length;a++){let c=n[a];if((c.priority==null?50:c.priority)<l)break}n.splice(a,0,o)}for(let o in e.marks){let l=e.marks[o].spec.parseDOM;l&&l.forEach(a=>{r(a=jS(a)),a.mark||a.ignore||a.clearMark||(a.mark=o)})}for(let o in e.nodes){let l=e.nodes[o].spec.parseDOM;l&&l.forEach(a=>{r(a=jS(a)),a.node||a.ignore||a.mark||(a.node=o)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Ai(e,Ai.schemaRules(e)))}}const PM={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},wL={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},$M={ol:!0,ul:!0},fa=1,um=2,ea=4;function _S(t,e,n){return e!=null?(e?fa:0)|(e==="full"?um:0):t&&t.whitespace=="pre"?fa|um:n&~ea}class uc{constructor(e,n,r,o,l,a){this.type=e,this.attrs=n,this.marks=r,this.solid=o,this.options=a,this.content=[],this.activeMarks=Ze.none,this.match=l||(a&ea?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(te.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,o;return(o=r.findWrapping(e.type))?(this.match=r,o):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&fa)){let r=this.content[this.content.length-1],o;if(r&&r.isText&&(o=/[ \t\r\n\u000c]+$/.exec(r.text))){let l=r;r.text.length==o[0].length?this.content.pop():this.content[this.content.length-1]=l.withText(l.text.slice(0,l.text.length-o[0].length))}}let n=te.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(te.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!PM.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class zS{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let o=n.topNode,l,a=_S(null,n.preserveWhitespace,0)|(r?ea:0);o?l=new uc(o.type,o.attrs,Ze.none,!0,n.topMatch||o.type.contentMatch,a):r?l=new uc(null,null,Ze.none,!0,null,a):l=new uc(e.schema.topNodeType,null,Ze.none,!0,null,a),this.nodes=[l],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let r=e.nodeValue,o=this.top,l=o.options&um?"full":this.localPreserveWS||(o.options&fa)>0,{schema:a}=this.parser;if(l==="full"||o.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(l)if(l==="full")r=r.replace(/\r\n?/g,`
|
|
57
|
+
`);else if(a.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(a.linebreakReplacement.create())){let c=r.split(/\r?\n|\r/);for(let d=0;d<c.length;d++)d&&this.insertNode(a.linebreakReplacement.create(),n,!0),c[d]&&this.insertNode(a.text(c[d]),n,!/\S/.test(c[d]));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 c=o.content[o.content.length-1],d=e.previousSibling;(!c||d&&d.nodeName=="BR"||c.isText&&/[ \t\r\n\u000c]$/.test(c.text))&&(r=r.slice(1))}r&&this.insertNode(a.text(r),n,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let o=this.localPreserveWS,l=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let a=e.nodeName.toLowerCase(),c;$M.hasOwnProperty(a)&&this.parser.normalizeLists&&CL(e);let d=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(c=this.parser.matchTag(e,this,r));e:if(d?d.ignore:wL.hasOwnProperty(a))this.findInside(e),this.ignoreFallback(e,n);else if(!d||d.skip||d.closeParent){d&&d.closeParent?this.open=Math.max(0,this.open-1):d&&d.skip.nodeType&&(e=d.skip);let h,p=this.needsBlock;if(PM.hasOwnProperty(a))l.content.length&&l.content[0].isInline&&this.open&&(this.open--,l=this.top),h=!0,l.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);break e}let g=d&&d.skip?n:this.readStyles(e,n);g&&this.addAll(e,g),h&&this.sync(l),this.needsBlock=p}else{let h=this.readStyles(e,n);h&&this.addElementByRule(e,d,h,d.consuming===!1?c:void 0)}this.localPreserveWS=o}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
|
58
|
+
`),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let o=0;o<this.parser.matchedStyles.length;o++){let l=this.parser.matchedStyles[o],a=r.getPropertyValue(l);if(a)for(let c=void 0;;){let d=this.parser.matchStyle(l,a,this,c);if(!d)break;if(d.ignore)return null;if(d.clearMark?n=n.filter(h=>!d.clearMark(h)):n=n.concat(this.parser.schema.marks[d.mark].create(d.attrs)),d.consuming===!1)c=d;else break}}return n}addElementByRule(e,n,r,o){let l,a;if(n.node)if(a=this.parser.schema.nodes[n.node],a.isLeaf)this.insertNode(a.create(n.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let d=this.enter(a,n.attrs||null,r,n.preserveWhitespace);d&&(l=!0,r=d)}else{let d=this.parser.schema.marks[n.mark];r=r.concat(d.create(n.attrs))}let c=this.top;if(a&&a.isLeaf)this.findInside(e);else if(o)this.addElement(e,r,o);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(d=>this.insertNode(d,r,!1));else{let d=e;typeof n.contentElement=="string"?d=e.querySelector(n.contentElement):typeof n.contentElement=="function"?d=n.contentElement(e):n.contentElement&&(d=n.contentElement),this.findAround(e,d,!0),this.addAll(d,r),this.findAround(e,d,!1)}l&&this.sync(c)&&this.open--}addAll(e,n,r,o){let l=r||0;for(let a=r?e.childNodes[r]:e.firstChild,c=o==null?null:e.childNodes[o];a!=c;a=a.nextSibling,++l)this.findAtPoint(e,l),this.addDOM(a,n);this.findAtPoint(e,l)}findPlace(e,n,r){let o,l;for(let a=this.open,c=0;a>=0;a--){let d=this.nodes[a],h=d.findWrapping(e);if(h&&(!o||o.length>h.length+c)&&(o=h,l=d,!h.length))break;if(d.solid){if(r)break;c+=2}}if(!o)return null;this.sync(l);for(let a=0;a<o.length;a++)n=this.enterInner(o[a],null,n,!1);return n}insertNode(e,n,r){if(e.isInline&&this.needsBlock&&!this.top.type){let l=this.textblockFromContext();l&&(n=this.enterInner(l,null,n))}let o=this.findPlace(e,n,r);if(o){this.closeExtra();let l=this.top;l.match&&(l.match=l.match.matchType(e.type));let a=Ze.none;for(let c of o.concat(e.marks))(l.type?l.type.allowsMarkType(c.type):LS(c.type,e.type))&&(a=c.addToSet(a));return l.content.push(e.mark(a)),!0}return!1}enter(e,n,r,o){let l=this.findPlace(e.create(n),r,!1);return l&&(l=this.enterInner(e,n,r,!0,o)),l}enterInner(e,n,r,o=!1,l){this.closeExtra();let a=this.top;a.match=a.match&&a.match.matchType(e);let c=_S(e,l,a.options);a.options&ea&&a.content.length==0&&(c|=ea);let d=Ze.none;return r=r.filter(h=>(a.type?a.type.allowsMarkType(h.type):LS(h.type,e))?(d=h.addToSet(d),!1):!0),this.nodes.push(new uc(e,n,d,o,null,c)),this.open++,r}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let n=this.open;n>=0;n--){if(this.nodes[n]==e)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=fa)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let o=r.length-1;o>=0;o--)e+=r[o].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let o=0;o<this.find.length;o++)this.find[o].pos==null&&e.nodeType==1&&e.contains(this.find[o].node)&&n.compareDocumentPosition(this.find[o].node)&(r?2:4)&&(this.find[o].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,o=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),l=-(r?r.depth+1:0)+(o?0:1),a=(c,d)=>{for(;c>=0;c--){let h=n[c];if(h==""){if(c==n.length-1||c==0)continue;for(;d>=l;d--)if(a(c-1,d))return!0;return!1}else{let p=d>0||d==0&&o?this.nodes[d].type:r&&d>=l?r.node(d-l).type:null;if(!p||p.name!=h&&!p.isInGroup(h))return!1;d--}}return!0};return a(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}}function CL(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&$M.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function ML(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function jS(t){let e={};for(let n in t)e[n]=t[n];return e}function LS(t,e){let n=e.schema.nodes;for(let r in n){let o=n[r];if(!o.allowsMarkType(t))continue;let l=[],a=c=>{l.push(c);for(let d=0;d<c.edgeCount;d++){let{type:h,next:p}=c.edge(d);if(h==e||l.indexOf(p)<0&&a(p))return!0}};if(a(o.contentMatch))return!0}}class Ao{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=mp(n).createDocumentFragment());let o=r,l=[];return e.forEach(a=>{if(l.length||a.marks.length){let c=0,d=0;for(;c<l.length&&d<a.marks.length;){let h=a.marks[d];if(!this.marks[h.type.name]){d++;continue}if(!h.eq(l[c][0])||h.type.spec.spanning===!1)break;c++,d++}for(;c<l.length;)o=l.pop()[1];for(;d<a.marks.length;){let h=a.marks[d++],p=this.serializeMark(h,a.isInline,n);p&&(l.push([h,o]),o.appendChild(p.dom),o=p.contentDOM||p.dom)}}o.appendChild(this.serializeNodeInner(a,n))}),r}serializeNodeInner(e,n){let{dom:r,contentDOM:o}=xc(mp(n),this.nodes[e.type.name](e),null,e.attrs);if(o){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,o)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let o=e.marks.length-1;o>=0;o--){let l=this.serializeMark(e.marks[o],e.isInline,n);l&&((l.contentDOM||l.dom).appendChild(r),r=l.dom)}return r}serializeMark(e,n,r={}){let o=this.marks[e.type.name];return o&&xc(mp(r),o(e,n),null,e.attrs)}static renderSpec(e,n,r=null,o){return xc(e,n,r,o)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Ao(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=BS(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return BS(e.marks)}}function BS(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function mp(t){return t.document||window.document}const IS=new WeakMap;function EL(t){let e=IS.get(t);return e===void 0&&IS.set(t,e=RL(t)),e}function RL(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let o=0;o<r.length;o++)n(r[o]);else for(let o in r)n(r[o])}return n(t),e}function xc(t,e,n,r){if(typeof e=="string")return{dom:t.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let o=e[0],l;if(typeof o!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(l=EL(r))&&l.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let a=o.indexOf(" ");a>0&&(n=o.slice(0,a),o=o.slice(a+1));let c,d=n?t.createElementNS(n,o):t.createElement(o),h=e[1],p=1;if(h&&typeof h=="object"&&h.nodeType==null&&!Array.isArray(h)){p=2;for(let g in h)if(h[g]!=null){let b=g.indexOf(" ");b>0?d.setAttributeNS(g.slice(0,b),g.slice(b+1),h[g]):g=="style"&&d.style?d.style.cssText=h[g]:d.setAttribute(g,h[g])}}for(let g=p;g<e.length;g++){let b=e[g];if(b===0){if(g<e.length-1||g>p)throw new RangeError("Content hole must be the only child of its parent node");return{dom:d,contentDOM:d}}else{let{dom:v,contentDOM:S}=xc(t,b,n,r);if(d.appendChild(v),S){if(c)throw new RangeError("Multiple content holes");c=S}}}return{dom:d,contentDOM:c}}const HM=65535,UM=Math.pow(2,16);function TL(t,e){return t+e*UM}function VS(t){return t&HM}function AL(t){return(t-(t&HM))/UM}const qM=1,GM=2,wc=4,KM=8;class cm{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&KM)>0}get deletedBefore(){return(this.delInfo&(qM|wc))>0}get deletedAfter(){return(this.delInfo&(GM|wc))>0}get deletedAcross(){return(this.delInfo&wc)>0}}class Cn{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&Cn.empty)return Cn.empty}recover(e){let n=0,r=VS(e);if(!this.inverted)for(let o=0;o<r;o++)n+=this.ranges[o*3+2]-this.ranges[o*3+1];return this.ranges[r*3]+n+AL(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,r){let o=0,l=this.inverted?2:1,a=this.inverted?1:2;for(let c=0;c<this.ranges.length;c+=3){let d=this.ranges[c]-(this.inverted?o:0);if(d>e)break;let h=this.ranges[c+l],p=this.ranges[c+a],g=d+h;if(e<=g){let b=h?e==d?-1:e==g?1:n:n,v=d+o+(b<0?0:p);if(r)return v;let S=e==(n<0?d:g)?null:TL(c/3,e-d),x=e==d?GM:e==g?qM:wc;return(n<0?e!=d:e!=g)&&(x|=KM),new cm(v,x,S)}o+=p-h}return r?e+o:new cm(e+o,0,null)}touches(e,n){let r=0,o=VS(n),l=this.inverted?2:1,a=this.inverted?1:2;for(let c=0;c<this.ranges.length;c+=3){let d=this.ranges[c]-(this.inverted?r:0);if(d>e)break;let h=this.ranges[c+l],p=d+h;if(e<=p&&c==o*3)return!0;r+=this.ranges[c+a]-h}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let o=0,l=0;o<this.ranges.length;o+=3){let a=this.ranges[o],c=a-(this.inverted?l:0),d=a+(this.inverted?0:l),h=this.ranges[o+n],p=this.ranges[o+r];e(c,c+h,d,d+p),l+=p-h}}invert(){return new Cn(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Cn.empty:new Cn(e<0?[0,-e,0]:[0,0,e])}}Cn.empty=new Cn([]);class da{constructor(e,n,r=0,o=e?e.length:0){this.mirror=n,this.from=r,this.to=o,this._maps=e||[],this.ownData=!(e||n)}get maps(){return this._maps}slice(e=0,n=this.maps.length){return new da(this._maps,this.mirror,e,n)}appendMap(e,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),n!=null&&this.setMirror(this._maps.length-1,n)}appendMapping(e){for(let n=0,r=this._maps.length;n<e._maps.length;n++){let o=e.getMirror(n);this.appendMap(e._maps[n],o!=null&&o<n?r+o:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,r=this._maps.length+e._maps.length;n>=0;n--){let o=e.getMirror(n);this.appendMap(e._maps[n].invert(),o!=null&&o>n?r-o-1:void 0)}}invert(){let e=new da;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this._maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let o=0;for(let l=this.from;l<this.to;l++){let a=this._maps[l],c=a.mapResult(e,n);if(c.recover!=null){let d=this.getMirror(l);if(d!=null&&d>l&&d<this.to){l=d,e=this._maps[d].recover(c.recover);continue}}o|=c.delInfo,e=c.pos}return r?e:new cm(e,o,null)}}const gp=Object.create(null);class Xt{getMap(){return Cn.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=gp[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in gp)throw new RangeError("Duplicate use of step JSON ID "+e);return gp[e]=n,n.prototype.jsonID=e,n}}class vt{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new vt(e,null)}static fail(e){return new vt(null,e)}static fromReplace(e,n,r,o){try{return vt.ok(e.replace(n,r,o))}catch(l){if(l instanceof jc)return vt.fail(l.message);throw l}}}function eg(t,e,n){let r=[];for(let o=0;o<t.childCount;o++){let l=t.child(o);l.content.size&&(l=l.copy(eg(l.content,e,l))),l.isInline&&(l=e(l,n,o)),r.push(l)}return te.fromArray(r)}class Mi extends Xt{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=e.resolve(this.from),o=r.node(r.sharedDepth(this.to)),l=new ue(eg(n.content,(a,c)=>!a.isAtom||!c.type.allowsMarkType(this.mark.type)?a:a.mark(this.mark.addToSet(a.marks)),o),n.openStart,n.openEnd);return vt.fromReplace(e,this.from,this.to,l)}invert(){return new Jn(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Mi(n.pos,r.pos,this.mark)}merge(e){return e instanceof Mi&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Mi(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Mi(n.from,n.to,e.markFromJSON(n.mark))}}Xt.jsonID("addMark",Mi);class Jn extends Xt{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new ue(eg(n.content,o=>o.mark(this.mark.removeFromSet(o.marks)),e),n.openStart,n.openEnd);return vt.fromReplace(e,this.from,this.to,r)}invert(){return new Mi(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Jn(n.pos,r.pos,this.mark)}merge(e){return e instanceof Jn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Jn(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Jn(n.from,n.to,e.markFromJSON(n.mark))}}Xt.jsonID("removeMark",Jn);class Ei extends Xt{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return vt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return vt.fromReplace(e,this.pos,this.pos+1,new ue(te.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let o=0;o<n.marks.length;o++)if(!n.marks[o].isInSet(r))return new Ei(this.pos,n.marks[o]);return new Ei(this.pos,this.mark)}}return new Co(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Ei(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Ei(n.pos,e.markFromJSON(n.mark))}}Xt.jsonID("addNodeMark",Ei);class Co extends Xt{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return vt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return vt.fromReplace(e,this.pos,this.pos+1,new ue(te.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new Ei(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Co(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Co(n.pos,e.markFromJSON(n.mark))}}Xt.jsonID("removeNodeMark",Co);class Rt extends Xt{constructor(e,n,r,o=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=o}apply(e){return this.structure&&fm(e,this.from,this.to)?vt.fail("Structure replace would overwrite content"):vt.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Cn([this.from,this.to-this.from,this.slice.size])}invert(e){return new Rt(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new Rt(n.pos,Math.max(n.pos,r.pos),this.slice,this.structure)}merge(e){if(!(e instanceof Rt)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let n=this.slice.size+e.slice.size==0?ue.empty:new ue(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Rt(this.from,this.to+(e.to-e.from),n,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let n=this.slice.size+e.slice.size==0?ue.empty:new ue(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Rt(e.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Rt(n.from,n.to,ue.fromJSON(e,n.slice),!!n.structure)}}Xt.jsonID("replace",Rt);class Tt extends Xt{constructor(e,n,r,o,l,a,c=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=o,this.slice=l,this.insert=a,this.structure=c}apply(e){if(this.structure&&(fm(e,this.from,this.gapFrom)||fm(e,this.gapTo,this.to)))return vt.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return vt.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?vt.fromReplace(e,this.from,this.to,r):vt.fail("Content does not fit in gap")}getMap(){return new Cn([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let n=this.gapTo-this.gapFrom;return new Tt(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),o=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),l=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||o<n.pos||l>r.pos?null:new Tt(n.pos,r.pos,o,l,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Tt(n.from,n.to,n.gapFrom,n.gapTo,ue.fromJSON(e,n.slice),n.insert,!!n.structure)}}Xt.jsonID("replaceAround",Tt);function fm(t,e,n){let r=t.resolve(e),o=n-e,l=r.depth;for(;o>0&&l>0&&r.indexAfter(l)==r.node(l).childCount;)l--,o--;if(o>0){let a=r.node(l).maybeChild(r.indexAfter(l));for(;o>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,o--}}return!1}function OL(t,e,n,r){let o=[],l=[],a,c;t.doc.nodesBetween(e,n,(d,h,p)=>{if(!d.isInline)return;let g=d.marks;if(!r.isInSet(g)&&p.type.allowsMarkType(r.type)){let b=Math.max(h,e),v=Math.min(h+d.nodeSize,n),S=r.addToSet(g);for(let x=0;x<g.length;x++)g[x].isInSet(S)||(a&&a.to==b&&a.mark.eq(g[x])?a.to=v:o.push(a=new Jn(b,v,g[x])));c&&c.to==b?c.to=v:l.push(c=new Mi(b,v,r))}}),o.forEach(d=>t.step(d)),l.forEach(d=>t.step(d))}function kL(t,e,n,r){let o=[],l=0;t.doc.nodesBetween(e,n,(a,c)=>{if(!a.isInline)return;l++;let d=null;if(r instanceof mf){let h=a.marks,p;for(;p=r.isInSet(h);)(d||(d=[])).push(p),h=p.removeFromSet(h)}else r?r.isInSet(a.marks)&&(d=[r]):d=a.marks;if(d&&d.length){let h=Math.min(c+a.nodeSize,n);for(let p=0;p<d.length;p++){let g=d[p],b;for(let v=0;v<o.length;v++){let S=o[v];S.step==l-1&&g.eq(o[v].style)&&(b=S)}b?(b.to=h,b.step=l):o.push({style:g,from:Math.max(c,e),to:h,step:l})}}}),o.forEach(a=>t.step(new Jn(a.from,a.to,a.style)))}function tg(t,e,n,r=n.contentMatch,o=!0){let l=t.doc.nodeAt(e),a=[],c=e+1;for(let d=0;d<l.childCount;d++){let h=l.child(d),p=c+h.nodeSize,g=r.matchType(h.type);if(!g)a.push(new Rt(c,p,ue.empty));else{r=g;for(let b=0;b<h.marks.length;b++)n.allowsMarkType(h.marks[b].type)||t.step(new Jn(c,p,h.marks[b]));if(o&&h.isText&&n.whitespace!="pre"){let b,v=/\r?\n|\r/g,S;for(;b=v.exec(h.text);)S||(S=new ue(te.from(n.schema.text(" ",n.allowedMarks(h.marks))),0,0)),a.push(new Rt(c+b.index,c+b.index+b[0].length,S))}}c=p}if(!r.validEnd){let d=r.fillBefore(te.empty,!0);t.replace(c,c,new ue(d,0,0))}for(let d=a.length-1;d>=0;d--)t.step(a[d])}function NL(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Xs(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth,o=0,l=0;;--r){let a=t.$from.node(r),c=t.$from.index(r)+o,d=t.$to.indexAfter(r)-l;if(r<t.depth&&a.canReplace(c,d,n))return r;if(r==0||a.type.spec.isolating||!NL(a,c,d))break;c&&(o=1),d<a.childCount&&(l=1)}return null}function DL(t,e,n){let{$from:r,$to:o,depth:l}=e,a=r.before(l+1),c=o.after(l+1),d=a,h=c,p=te.empty,g=0;for(let S=l,x=!1;S>n;S--)x||r.index(S)>0?(x=!0,p=te.from(r.node(S).copy(p)),g++):d--;let b=te.empty,v=0;for(let S=l,x=!1;S>n;S--)x||o.after(S+1)<o.end(S)?(x=!0,b=te.from(o.node(S).copy(b)),v++):h++;t.step(new Tt(d,h,a,c,new ue(p.append(b),g,v),p.size-g,!0))}function YM(t,e,n=null,r=t){let o=_L(t,e),l=o&&zL(r,e);return l?o.map(FS).concat({type:e,attrs:n}).concat(l.map(FS)):null}function FS(t){return{type:t,attrs:null}}function _L(t,e){let{parent:n,startIndex:r,endIndex:o}=t,l=n.contentMatchAt(r).findWrapping(e);if(!l)return null;let a=l.length?l[0]:e;return n.canReplaceWith(r,o,a)?l:null}function zL(t,e){let{parent:n,startIndex:r,endIndex:o}=t,l=n.child(r),a=e.contentMatch.findWrapping(l.type);if(!a)return null;let d=(a.length?a[a.length-1]:e).contentMatch;for(let h=r;d&&h<o;h++)d=d.matchType(n.child(h).type);return!d||!d.validEnd?null:a}function jL(t,e,n){let r=te.empty;for(let a=n.length-1;a>=0;a--){if(r.size){let c=n[a].type.contentMatch.matchFragment(r);if(!c||!c.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=te.from(n[a].type.create(n[a].attrs,r))}let o=e.start,l=e.end;t.step(new Tt(o,l,o,l,new ue(r,0,0),n.length,!0))}function LL(t,e,n,r,o){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let l=t.steps.length;t.doc.nodesBetween(e,n,(a,c)=>{let d=typeof o=="function"?o(a):o;if(a.isTextblock&&!a.hasMarkup(r,d)&&BL(t.doc,t.mapping.slice(l).map(c),r)){let h=null;if(r.schema.linebreakReplacement){let v=r.whitespace=="pre",S=!!r.contentMatch.matchType(r.schema.linebreakReplacement);v&&!S?h=!1:!v&&S&&(h=!0)}h===!1&&JM(t,a,c,l),tg(t,t.mapping.slice(l).map(c,1),r,void 0,h===null);let p=t.mapping.slice(l),g=p.map(c,1),b=p.map(c+a.nodeSize,1);return t.step(new Tt(g,b,g+1,b-1,new ue(te.from(r.create(d,null,a.marks)),0,0),1,!0)),h===!0&&XM(t,a,c,l),!1}})}function XM(t,e,n,r){e.forEach((o,l)=>{if(o.isText){let a,c=/\r?\n|\r/g;for(;a=c.exec(o.text);){let d=t.mapping.slice(r).map(n+1+l+a.index);t.replaceWith(d,d+1,e.type.schema.linebreakReplacement.create())}}})}function JM(t,e,n,r){e.forEach((o,l)=>{if(o.type==o.type.schema.linebreakReplacement){let a=t.mapping.slice(r).map(n+1+l);t.replaceWith(a,a+1,e.type.schema.text(`
|
|
59
|
+
`))}})}function BL(t,e,n){let r=t.resolve(e),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}function IL(t,e,n,r,o){let l=t.doc.nodeAt(e);if(!l)throw new RangeError("No node at given position");n||(n=l.type);let a=n.create(r,null,o||l.marks);if(l.isLeaf)return t.replaceWith(e,e+l.nodeSize,a);if(!n.validContent(l.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new Tt(e,e+l.nodeSize,e+1,e+l.nodeSize-1,new ue(te.from(a),0,0),1,!0))}function Ir(t,e,n=1,r){let o=t.resolve(e),l=o.depth-n,a=r&&r[r.length-1]||o.parent;if(l<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!a.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let h=o.depth-1,p=n-2;h>l;h--,p--){let g=o.node(h),b=o.index(h);if(g.type.spec.isolating)return!1;let v=g.content.cutByIndex(b,g.childCount),S=r&&r[p+1];S&&(v=v.replaceChild(0,S.type.create(S.attrs)));let x=r&&r[p]||g;if(!g.canReplace(b+1,g.childCount)||!x.type.validContent(v))return!1}let c=o.indexAfter(l),d=r&&r[0];return o.node(l).canReplaceWith(c,c,d?d.type:o.node(l+1).type)}function VL(t,e,n=1,r){let o=t.doc.resolve(e),l=te.empty,a=te.empty;for(let c=o.depth,d=o.depth-n,h=n-1;c>d;c--,h--){l=te.from(o.node(c).copy(l));let p=r&&r[h];a=te.from(p?p.type.create(p.attrs,a):o.node(c).copy(a))}t.step(new Rt(e,e,new ue(l.append(a),n,n),!0))}function Oo(t,e){let n=t.resolve(e),r=n.index();return QM(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function FL(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let o=0;o<e.childCount;o++){let l=e.child(o),a=l.type==r?t.type.schema.nodes.text:l.type;if(n=n.matchType(a),!n||!t.type.allowsMarks(l.marks))return!1}return n.validEnd}function QM(t,e){return!!(t&&e&&!t.isLeaf&&FL(t,e))}function gf(t,e,n=-1){let r=t.resolve(e);for(let o=r.depth;;o--){let l,a,c=r.index(o);if(o==r.depth?(l=r.nodeBefore,a=r.nodeAfter):n>0?(l=r.node(o+1),c++,a=r.node(o).maybeChild(c)):(l=r.node(o).maybeChild(c-1),a=r.node(o+1)),l&&!l.isTextblock&&QM(l,a)&&r.node(o).canReplace(c,c+1))return e;if(o==0)break;e=n<0?r.before(o):r.after(o)}}function PL(t,e,n){let r=null,{linebreakReplacement:o}=t.doc.type.schema,l=t.doc.resolve(e-n),a=l.node().type;if(o&&a.inlineContent){let p=a.whitespace=="pre",g=!!a.contentMatch.matchType(o);p&&!g?r=!1:!p&&g&&(r=!0)}let c=t.steps.length;if(r===!1){let p=t.doc.resolve(e+n);JM(t,p.node(),p.before(),c)}a.inlineContent&&tg(t,e+n-1,a,l.node().contentMatchAt(l.index()),r==null);let d=t.mapping.slice(c),h=d.map(e-n);if(t.step(new Rt(h,d.map(e+n,-1),ue.empty,!0)),r===!0){let p=t.doc.resolve(h);XM(t,p.node(),p.before(),t.steps.length)}return t}function $L(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let o=r.depth-1;o>=0;o--){let l=r.index(o);if(r.node(o).canReplaceWith(l,l,n))return r.before(o+1);if(l>0)return null}if(r.parentOffset==r.parent.content.size)for(let o=r.depth-1;o>=0;o--){let l=r.indexAfter(o);if(r.node(o).canReplaceWith(l,l,n))return r.after(o+1);if(l<r.node(o).childCount)return null}return null}function ZM(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let o=n.content;for(let l=0;l<n.openStart;l++)o=o.firstChild.content;for(let l=1;l<=(n.openStart==0&&n.size?2:1);l++)for(let a=r.depth;a>=0;a--){let c=a==r.depth?0:r.pos<=(r.start(a+1)+r.end(a+1))/2?-1:1,d=r.index(a)+(c>0?1:0),h=r.node(a),p=!1;if(l==1)p=h.canReplace(d,d,o);else{let g=h.contentMatchAt(d).findWrapping(o.firstChild.type);p=g&&h.canReplaceWith(d,d,g[0])}if(p)return c==0?r.pos:c<0?r.before(a+1):r.after(a+1)}return null}function yf(t,e,n=e,r=ue.empty){if(e==n&&!r.size)return null;let o=t.resolve(e),l=t.resolve(n);return WM(o,l,r)?new Rt(e,n,r):new HL(o,l,r).fit()}function WM(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class HL{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=te.empty;for(let o=0;o<=e.depth;o++){let l=e.node(o);this.frontier.push({type:l.type,match:l.contentMatchAt(e.indexAfter(o))})}for(let o=e.depth;o>0;o--)this.placed=te.from(e.node(o).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let h=this.findFittable();h?this.placeNodes(h):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,o=this.close(e<0?this.$to:r.doc.resolve(e));if(!o)return null;let l=this.placed,a=r.depth,c=o.depth;for(;a&&c&&l.childCount==1;)l=l.firstChild.content,a--,c--;let d=new ue(l,a,c);return e>-1?new Tt(r.pos,e,this.$to.pos,this.$to.end(),d,n):d.size||r.pos!=this.$to.pos?new Rt(r.pos,o.pos,d):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,o=this.unplaced.openEnd;r<e;r++){let l=n.firstChild;if(n.childCount>1&&(o=0),l.type.spec.isolating&&o<=r){e=r;break}n=l.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let o,l=null;r?(l=yp(this.unplaced.content,r-1).firstChild,o=l.content):o=this.unplaced.content;let a=o.firstChild;for(let c=this.depth;c>=0;c--){let{type:d,match:h}=this.frontier[c],p,g=null;if(n==1&&(a?h.matchType(a.type)||(g=h.fillBefore(te.from(a),!1)):l&&d.compatibleContent(l.type)))return{sliceDepth:r,frontierDepth:c,parent:l,inject:g};if(n==2&&a&&(p=h.findWrapping(a.type)))return{sliceDepth:r,frontierDepth:c,parent:l,wrap:p};if(l&&h.matchType(l.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,o=yp(e,n);return!o.childCount||o.firstChild.isLeaf?!1:(this.unplaced=new ue(e,n+1,Math.max(r,o.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,o=yp(e,n);if(o.childCount<=1&&n>0){let l=e.size-n<=n+o.size;this.unplaced=new ue(Yl(e,n-1,1),n-1,l?n-1:r)}else this.unplaced=new ue(Yl(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:o,wrap:l}){for(;this.depth>n;)this.closeFrontierNode();if(l)for(let x=0;x<l.length;x++)this.openFrontierNode(l[x]);let a=this.unplaced,c=r?r.content:a.content,d=a.openStart-e,h=0,p=[],{match:g,type:b}=this.frontier[n];if(o){for(let x=0;x<o.childCount;x++)p.push(o.child(x));g=g.matchFragment(o)}let v=c.size+e-(a.content.size-a.openEnd);for(;h<c.childCount;){let x=c.child(h),C=g.matchType(x.type);if(!C)break;h++,(h>1||d==0||x.content.size)&&(g=C,p.push(eE(x.mark(b.allowedMarks(x.marks)),h==1?d:0,h==c.childCount?v:-1)))}let S=h==c.childCount;S||(v=-1),this.placed=Xl(this.placed,n,te.from(p)),this.frontier[n].match=g,S&&v<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let x=0,C=c;x<v;x++){let E=C.lastChild;this.frontier.push({type:E.type,match:E.contentMatchAt(E.childCount)}),C=E.content}this.unplaced=S?e==0?ue.empty:new ue(Yl(a.content,e-1,1),e-1,v<0?a.openEnd:e-1):new ue(Yl(a.content,e,h),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],n;if(!e.type.isTextblock||!vp(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,o=this.$to.after(r);for(;r>1&&o==this.$to.end(--r);)++o;return o}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:o}=this.frontier[n],l=n<e.depth&&e.end(n+1)==e.pos+(e.depth-(n+1)),a=vp(e,n,o,r,l);if(a){for(let c=n-1;c>=0;c--){let{match:d,type:h}=this.frontier[c],p=vp(e,c,h,d,!0);if(!p||p.childCount)continue e}return{depth:n,fit:a,move:l?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=Xl(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let o=e.node(r),l=o.type.contentMatch.fillBefore(o.content,!0,e.index(r));this.openFrontierNode(o.type,o.attrs,l)}return e}openFrontierNode(e,n=null,r){let o=this.frontier[this.depth];o.match=o.match.matchType(e),this.placed=Xl(this.placed,this.depth,te.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(te.empty,!0);n.childCount&&(this.placed=Xl(this.placed,this.frontier.length,n))}}function Yl(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Yl(t.firstChild.content,e-1,n)))}function Xl(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Xl(t.lastChild.content,e-1,n)))}function yp(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function eE(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,eE(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(te.empty,!0)))),t.copy(r)}function vp(t,e,n,r,o){let l=t.node(e),a=o?t.indexAfter(e):t.index(e);if(a==l.childCount&&!n.compatibleContent(l.type))return null;let c=r.fillBefore(l.content,!0,a);return c&&!UL(n,l.content,a)?c:null}function UL(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function qL(t){return t.spec.defining||t.spec.definingForContent}function GL(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let o=t.doc.resolve(e),l=t.doc.resolve(n);if(WM(o,l,r))return t.step(new Rt(e,n,r));let a=nE(o,l);a[a.length-1]==0&&a.pop();let c=-(o.depth+1);a.unshift(c);for(let b=o.depth,v=o.pos-1;b>0;b--,v--){let S=o.node(b).type.spec;if(S.defining||S.definingAsContext||S.isolating)break;a.indexOf(b)>-1?c=b:o.before(b)==v&&a.splice(1,0,-b)}let d=a.indexOf(c),h=[],p=r.openStart;for(let b=r.content,v=0;;v++){let S=b.firstChild;if(h.push(S),v==r.openStart)break;b=S.content}for(let b=p-1;b>=0;b--){let v=h[b],S=qL(v.type);if(S&&!v.sameMarkup(o.node(Math.abs(c)-1)))p=b;else if(S||!v.type.isTextblock)break}for(let b=r.openStart;b>=0;b--){let v=(b+p+1)%(r.openStart+1),S=h[v];if(S)for(let x=0;x<a.length;x++){let C=a[(x+d)%a.length],E=!0;C<0&&(E=!1,C=-C);let A=o.node(C-1),k=o.index(C-1);if(A.canReplaceWith(k,k,S.type,S.marks))return t.replace(o.before(C),E?l.after(C):n,new ue(tE(r.content,0,r.openStart,v),v,r.openEnd))}}let g=t.steps.length;for(let b=a.length-1;b>=0&&(t.replace(e,n,r),!(t.steps.length>g));b--){let v=a[b];v<0||(e=o.before(v),n=l.after(v))}}function tE(t,e,n,r,o){if(e<n){let l=t.firstChild;t=t.replaceChild(0,l.copy(tE(l.content,e+1,n,r,l)))}if(e>r){let l=o.contentMatchAt(0),a=l.fillBefore(t).append(t);t=a.append(l.matchFragment(a).fillBefore(te.empty,!0))}return t}function KL(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let o=$L(t.doc,e,r.type);o!=null&&(e=n=o)}t.replaceRange(e,n,new ue(te.from(r),0,0))}function YL(t,e,n){let r=t.doc.resolve(e),o=t.doc.resolve(n),l=nE(r,o);for(let a=0;a<l.length;a++){let c=l[a],d=a==l.length-1;if(d&&c==0||r.node(c).type.contentMatch.validEnd)return t.delete(r.start(c),o.end(c));if(c>0&&(d||r.node(c-1).canReplace(r.index(c-1),o.indexAfter(c-1))))return t.delete(r.before(c),o.after(c))}for(let a=1;a<=r.depth&&a<=o.depth;a++)if(e-r.start(a)==r.depth-a&&n>r.end(a)&&o.end(a)-n!=o.depth-a&&r.start(a-1)==o.start(a-1)&&r.node(a-1).canReplace(r.index(a-1),o.index(a-1)))return t.delete(r.before(a),n);t.delete(e,n)}function nE(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let o=r;o>=0;o--){let l=t.start(o);if(l<t.pos-(t.depth-o)||e.end(o)>e.pos+(e.depth-o)||t.node(o).type.spec.isolating||e.node(o).type.spec.isolating)break;(l==e.start(o)||o==t.depth&&o==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&o&&e.start(o-1)==l-1)&&n.push(o)}return n}class Bs extends Xt{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return vt.fail("No node at attribute step's position");let r=Object.create(null);for(let l in n.attrs)r[l]=n.attrs[l];r[this.attr]=this.value;let o=n.type.create(r,null,n.marks);return vt.fromReplace(e,this.pos,this.pos+1,new ue(te.from(o),0,n.isLeaf?0:1))}getMap(){return Cn.empty}invert(e){return new Bs(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Bs(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Bs(n.pos,n.attr,n.value)}}Xt.jsonID("attr",Bs);class ha extends Xt{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let o in e.attrs)n[o]=e.attrs[o];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return vt.ok(r)}getMap(){return Cn.empty}invert(e){return new ha(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new ha(n.attr,n.value)}}Xt.jsonID("docAttr",ha);let Fs=class extends Error{};Fs=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};Fs.prototype=Object.create(Error.prototype);Fs.prototype.constructor=Fs;Fs.prototype.name="TransformError";class rE{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new da}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new Fs(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,n=-1e9;for(let r=0;r<this.mapping.maps.length;r++){let o=this.mapping.maps[r];r&&(e=o.map(e,1),n=o.map(n,-1)),o.forEach((l,a,c,d)=>{e=Math.min(e,c),n=Math.max(n,d)})}return e==1e9?null:{from:e,to:n}}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=ue.empty){let o=yf(this.doc,e,n,r);return o&&this.step(o),this}replaceWith(e,n,r){return this.replace(e,n,new ue(te.from(r),0,0))}delete(e,n){return this.replace(e,n,ue.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return GL(this,e,n,r),this}replaceRangeWith(e,n,r){return KL(this,e,n,r),this}deleteRange(e,n){return YL(this,e,n),this}lift(e,n){return DL(this,e,n),this}join(e,n=1){return PL(this,e,n),this}wrap(e,n){return jL(this,e,n),this}setBlockType(e,n=e,r,o=null){return LL(this,e,n,r,o),this}setNodeMarkup(e,n,r=null,o){return IL(this,e,n,r,o),this}setNodeAttribute(e,n,r){return this.step(new Bs(e,n,r)),this}setDocAttribute(e,n){return this.step(new ha(e,n)),this}addNodeMark(e,n){return this.step(new Ei(e,n)),this}removeNodeMark(e,n){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n instanceof Ze)n.isInSet(r.marks)&&this.step(new Co(e,n));else{let o=r.marks,l,a=[];for(;l=n.isInSet(o);)a.push(new Co(e,l)),o=l.removeFromSet(o);for(let c=a.length-1;c>=0;c--)this.step(a[c])}return this}split(e,n=1,r){return VL(this,e,n,r),this}addMark(e,n,r){return OL(this,e,n,r),this}removeMark(e,n,r){return kL(this,e,n,r),this}clearIncompatible(e,n,r){return tg(this,e,n,r),this}}const bp=Object.create(null);class ze{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new XL(e.min(n),e.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let n=0;n<e.length;n++)if(e[n].$from.pos!=e[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,n=ue.empty){let r=n.content.lastChild,o=null;for(let c=0;c<n.openEnd;c++)o=r,r=r.lastChild;let l=e.steps.length,a=this.ranges;for(let c=0;c<a.length;c++){let{$from:d,$to:h}=a[c],p=e.mapping.slice(l);e.replaceRange(p.map(d.pos),p.map(h.pos),c?ue.empty:n),c==0&&HS(e,l,(r?r.isInline:o&&o.isTextblock)?-1:1)}}replaceWith(e,n){let r=e.steps.length,o=this.ranges;for(let l=0;l<o.length;l++){let{$from:a,$to:c}=o[l],d=e.mapping.slice(r),h=d.map(a.pos),p=d.map(c.pos);l?e.deleteRange(h,p):(e.replaceRangeWith(h,p,n),HS(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let o=e.parent.inlineContent?new Oe(e):Os(e.node(0),e.parent,e.pos,e.index(),n,r);if(o)return o;for(let l=e.depth-1;l>=0;l--){let a=n<0?Os(e.node(0),e.node(l),e.before(l+1),e.index(l),n,r):Os(e.node(0),e.node(l),e.after(l+1),e.index(l)+1,n,r);if(a)return a}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new En(e.node(0))}static atStart(e){return Os(e,e,0,0,1)||new En(e)}static atEnd(e){return Os(e,e,e.content.size,e.childCount,-1)||new En(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=bp[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in bp)throw new RangeError("Duplicate use of selection JSON ID "+e);return bp[e]=n,n.prototype.jsonID=e,n}getBookmark(){return Oe.between(this.$anchor,this.$head).getBookmark()}}ze.prototype.visible=!0;class XL{constructor(e,n){this.$from=e,this.$to=n}}let PS=!1;function $S(t){!PS&&!t.parent.inlineContent&&(PS=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class Oe extends ze{constructor(e,n=e){$S(e),$S(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return ze.near(r);let o=e.resolve(n.map(this.anchor));return new Oe(o.parent.inlineContent?o:r,r)}replace(e,n=ue.empty){if(super.replace(e,n),n==ue.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof Oe&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new vf(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new Oe(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let o=e.resolve(n);return new this(o,r==n?o:e.resolve(r))}static between(e,n,r){let o=e.pos-n.pos;if((!r||o)&&(r=o>=0?1:-1),!n.parent.inlineContent){let l=ze.findFrom(n,r,!0)||ze.findFrom(n,-r,!0);if(l)n=l.$head;else return ze.near(n,r)}return e.parent.inlineContent||(o==0?e=n:(e=(ze.findFrom(e,-r,!0)||ze.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=o<0&&(e=n))),new Oe(e,n)}}ze.jsonID("text",Oe);class vf{constructor(e,n){this.anchor=e,this.head=n}map(e){return new vf(e.map(this.anchor),e.map(this.head))}resolve(e){return Oe.between(e.resolve(this.anchor),e.resolve(this.head))}}class be extends ze{constructor(e){let n=e.nodeAfter,r=e.node(0).resolve(e.pos+n.nodeSize);super(e,r),this.node=n}map(e,n){let{deleted:r,pos:o}=n.mapResult(this.anchor),l=e.resolve(o);return r?ze.near(l):new be(l)}content(){return new ue(te.from(this.node),0,0)}eq(e){return e instanceof be&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new ng(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new be(e.resolve(n.anchor))}static create(e,n){return new be(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}be.prototype.visible=!1;ze.jsonID("node",be);class ng{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new vf(r,r):new ng(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&be.isSelectable(r)?new be(n):ze.near(n)}}class En extends ze{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=ue.empty){if(n==ue.empty){e.delete(0,e.doc.content.size);let r=ze.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new En(e)}map(e){return new En(e)}eq(e){return e instanceof En}getBookmark(){return JL}}ze.jsonID("all",En);const JL={map(){return this},resolve(t){return new En(t)}};function Os(t,e,n,r,o,l=!1){if(e.inlineContent)return Oe.create(t,n);for(let a=r-(o>0?0:1);o>0?a<e.childCount:a>=0;a+=o){let c=e.child(a);if(c.isAtom){if(!l&&be.isSelectable(c))return be.create(t,n-(o<0?c.nodeSize:0))}else{let d=Os(t,c,n+o,o<0?c.childCount:0,o,l);if(d)return d}n+=c.nodeSize*o}return null}function HS(t,e,n){let r=t.steps.length-1;if(r<e)return;let o=t.steps[r];if(!(o instanceof Rt||o instanceof Tt))return;let l=t.mapping.maps[r],a;l.forEach((c,d,h,p)=>{a==null&&(a=p)}),t.setSelection(ze.near(t.doc.resolve(a),n))}const US=1,cc=2,qS=4;class QL extends rE{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|US)&~cc,this.storedMarks=null,this}get selectionSet(){return(this.updated&US)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=cc,this}ensureMarks(e){return Ze.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&cc)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~cc,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||Ze.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let o=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(o.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),!e)return this.deleteRange(n,r);let l=this.storedMarks;if(!l){let a=this.doc.resolve(n);l=r==n?a.marks():a.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,o.text(e,l)),!this.selection.empty&&this.selection.to==n+e.length&&this.setSelection(ze.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=qS,this}get scrolledIntoView(){return(this.updated&qS)>0}}function GS(t,e){return!e||!t?t:t.bind(e)}class Jl{constructor(e,n,r){this.name=e,this.init=GS(n.init,r),this.apply=GS(n.apply,r)}}const ZL=[new Jl("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new Jl("selection",{init(t,e){return t.selection||ze.atStart(e.doc)},apply(t){return t.selection}}),new Jl("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new Jl("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class Sp{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=ZL.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 Jl(r.key,r.spec.state,r))})}}class Ds{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let o=this.config.plugins[r];if(o.spec.filterTransaction&&!o.spec.filterTransaction.call(o,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let n=[e],r=this.applyInner(e),o=null;for(;;){let l=!1;for(let a=0;a<this.config.plugins.length;a++){let c=this.config.plugins[a];if(c.spec.appendTransaction){let d=o?o[a].n:0,h=o?o[a].state:this,p=d<n.length&&c.spec.appendTransaction.call(c,d?n.slice(d):n,h,r);if(p&&r.filterTransaction(p,a)){if(p.setMeta("appendedTransaction",e),!o){o=[];for(let g=0;g<this.config.plugins.length;g++)o.push(g<a?{state:r,n:n.length}:{state:this,n:0})}n.push(p),r=r.applyInner(p),l=!0}o&&(o[a]={state:r,n:n.length})}}if(!l)return{state:r,transactions:n}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new Ds(this.config),r=this.config.fields;for(let o=0;o<r.length;o++){let l=r[o];n[l.name]=l.apply(e,this[l.name],this,n)}return n}get tr(){return new QL(this)}static create(e){let n=new Sp(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new Ds(n);for(let o=0;o<n.fields.length;o++)r[n.fields[o].name]=n.fields[o].init(e,r);return r}reconfigure(e){let n=new Sp(this.schema,e.plugins),r=n.fields,o=new Ds(n);for(let l=0;l<r.length;l++){let a=r[l].name;o[a]=this.hasOwnProperty(a)?this[a]:r[l].init(e,o)}return o}toJSON(e){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let o=e[r],l=o.spec.state;l&&l.toJSON&&(n[r]=l.toJSON.call(o,this[o.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let o=new Sp(e.schema,e.plugins),l=new Ds(o);return o.fields.forEach(a=>{if(a.name=="doc")l.doc=Ti.fromJSON(e.schema,n.doc);else if(a.name=="selection")l.selection=ze.fromJSON(l.doc,n.selection);else if(a.name=="storedMarks")n.storedMarks&&(l.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let c in r){let d=r[c],h=d.spec.state;if(d.key==a.name&&h&&h.fromJSON&&Object.prototype.hasOwnProperty.call(n,c)){l[a.name]=h.fromJSON.call(d,e,n[c],l);return}}l[a.name]=a.init(e,l)}}),l}}function iE(t,e,n){for(let r in t){let o=t[r];o instanceof Function?o=o.bind(e):r=="handleDOMEvents"&&(o=iE(o,e,{})),n[r]=o}return n}class bt{constructor(e){this.spec=e,this.props={},e.props&&iE(e.props,this,this.props),this.key=e.key?e.key.key:oE("plugin")}getState(e){return e[this.key]}}const xp=Object.create(null);function oE(t){return t in xp?t+"$"+ ++xp[t]:(xp[t]=0,t+"$")}class Jt{constructor(e="key"){this.key=oE(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const rg=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function sE(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const lE=(t,e,n)=>{let r=sE(t,n);if(!r)return!1;let o=ig(r);if(!o){let a=r.blockRange(),c=a&&Xs(a);return c==null?!1:(e&&e(t.tr.lift(a,c).scrollIntoView()),!0)}let l=o.nodeBefore;if(gE(t,o,e,-1))return!0;if(r.parent.content.size==0&&(Ps(l,"end")||be.isSelectable(l)))for(let a=r.depth;;a--){let c=yf(t.doc,r.before(a),r.after(a),ue.empty);if(c&&c.slice.size<c.to-c.from){if(e){let d=t.tr.step(c);d.setSelection(Ps(l,"end")?ze.findFrom(d.doc.resolve(d.mapping.map(o.pos,-1)),-1):be.create(d.doc,o.pos-l.nodeSize)),e(d.scrollIntoView())}return!0}if(a==1||r.node(a-1).childCount>1)break}return l.isAtom&&o.depth==r.depth-1?(e&&e(t.tr.delete(o.pos-l.nodeSize,o.pos).scrollIntoView()),!0):!1},WL=(t,e,n)=>{let r=sE(t,n);if(!r)return!1;let o=ig(r);return o?aE(t,o,e):!1},eB=(t,e,n)=>{let r=cE(t,n);if(!r)return!1;let o=og(r);return o?aE(t,o,e):!1};function aE(t,e,n){let r=e.nodeBefore,o=r,l=e.pos-1;for(;!o.isTextblock;l--){if(o.type.spec.isolating)return!1;let p=o.lastChild;if(!p)return!1;o=p}let a=e.nodeAfter,c=a,d=e.pos+1;for(;!c.isTextblock;d++){if(c.type.spec.isolating)return!1;let p=c.firstChild;if(!p)return!1;c=p}let h=yf(t.doc,l,d,ue.empty);if(!h||h.from!=l||h instanceof Rt&&h.slice.size>=d-l)return!1;if(n){let p=t.tr.step(h);p.setSelection(Oe.create(p.doc,l)),n(p.scrollIntoView())}return!0}function Ps(t,e,n=!1){for(let r=t;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const uE=(t,e,n)=>{let{$head:r,empty:o}=t.selection,l=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;l=ig(r)}let a=l&&l.nodeBefore;return!a||!be.isSelectable(a)?!1:(e&&e(t.tr.setSelection(be.create(t.doc,l.pos-a.nodeSize)).scrollIntoView()),!0)};function ig(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function cE(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const fE=(t,e,n)=>{let r=cE(t,n);if(!r)return!1;let o=og(r);if(!o)return!1;let l=o.nodeAfter;if(gE(t,o,e,1))return!0;if(r.parent.content.size==0&&(Ps(l,"start")||be.isSelectable(l))){let a=yf(t.doc,r.before(),r.after(),ue.empty);if(a&&a.slice.size<a.to-a.from){if(e){let c=t.tr.step(a);c.setSelection(Ps(l,"start")?ze.findFrom(c.doc.resolve(c.mapping.map(o.pos)),1):be.create(c.doc,c.mapping.map(o.pos))),e(c.scrollIntoView())}return!0}}return l.isAtom&&o.depth==r.depth-1?(e&&e(t.tr.delete(o.pos,o.pos+l.nodeSize).scrollIntoView()),!0):!1},dE=(t,e,n)=>{let{$head:r,empty:o}=t.selection,l=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;l=og(r)}let a=l&&l.nodeAfter;return!a||!be.isSelectable(a)?!1:(e&&e(t.tr.setSelection(be.create(t.doc,l.pos)).scrollIntoView()),!0)};function og(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}const tB=(t,e)=>{let n=t.selection,r=n instanceof be,o;if(r){if(n.node.isTextblock||!Oo(t.doc,n.from))return!1;o=n.from}else if(o=gf(t.doc,n.from,-1),o==null)return!1;if(e){let l=t.tr.join(o);r&&l.setSelection(be.create(l.doc,o-t.doc.resolve(o).nodeBefore.nodeSize)),e(l.scrollIntoView())}return!0},nB=(t,e)=>{let n=t.selection,r;if(n instanceof be){if(n.node.isTextblock||!Oo(t.doc,n.to))return!1;r=n.to}else if(r=gf(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},rB=(t,e)=>{let{$from:n,$to:r}=t.selection,o=n.blockRange(r),l=o&&Xs(o);return l==null?!1:(e&&e(t.tr.lift(o,l).scrollIntoView()),!0)},hE=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(`
|
|
60
|
+
`).scrollIntoView()),!0)};function sg(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const iB=(t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let o=n.node(-1),l=n.indexAfter(-1),a=sg(o.contentMatchAt(l));if(!a||!o.canReplaceWith(l,l,a))return!1;if(e){let c=n.after(),d=t.tr.replaceWith(c,c,a.createAndFill());d.setSelection(ze.near(d.doc.resolve(c),1)),e(d.scrollIntoView())}return!0},pE=(t,e)=>{let n=t.selection,{$from:r,$to:o}=n;if(n instanceof En||r.parent.inlineContent||o.parent.inlineContent)return!1;let l=sg(o.parent.contentMatchAt(o.indexAfter()));if(!l||!l.isTextblock)return!1;if(e){let a=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,c=t.tr.insert(a,l.createAndFill());c.setSelection(Oe.create(c.doc,a+1)),e(c.scrollIntoView())}return!0},mE=(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let l=n.before();if(Ir(t.doc,l))return e&&e(t.tr.split(l).scrollIntoView()),!0}let r=n.blockRange(),o=r&&Xs(r);return o==null?!1:(e&&e(t.tr.lift(r,o).scrollIntoView()),!0)};function oB(t){return(e,n)=>{let{$from:r,$to:o}=e.selection;if(e.selection instanceof be&&e.selection.node.isBlock)return!r.parentOffset||!Ir(e.doc,r.pos)?!1:(n&&n(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let l=[],a,c,d=!1,h=!1;for(let v=r.depth;;v--)if(r.node(v).isBlock){d=r.end(v)==r.pos+(r.depth-v),h=r.start(v)==r.pos-(r.depth-v),c=sg(r.node(v-1).contentMatchAt(r.indexAfter(v-1))),l.unshift(d&&c?{type:c}:null),a=v;break}else{if(v==1)return!1;l.unshift(null)}let p=e.tr;(e.selection instanceof Oe||e.selection instanceof En)&&p.deleteSelection();let g=p.mapping.map(r.pos),b=Ir(p.doc,g,l.length,l);if(b||(l[0]=c?{type:c}:null,b=Ir(p.doc,g,l.length,l)),!b)return!1;if(p.split(g,l.length,l),!d&&h&&r.node(a).type!=c){let v=p.mapping.map(r.before(a)),S=p.doc.resolve(v);c&&r.node(a-1).canReplaceWith(S.index(),S.index()+1,c)&&p.setNodeMarkup(p.mapping.map(r.before(a)),c)}return n&&n(p.scrollIntoView()),!0}}const sB=oB(),lB=(t,e)=>{let{$from:n,to:r}=t.selection,o,l=n.sharedDepth(r);return l==0?!1:(o=n.before(l),e&&e(t.tr.setSelection(be.create(t.doc,o))),!0)};function aB(t,e,n){let r=e.nodeBefore,o=e.nodeAfter,l=e.index();return!r||!o||!r.type.compatibleContent(o.type)?!1:!r.content.size&&e.parent.canReplace(l-1,l)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(l,l+1)||!(o.isTextblock||Oo(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function gE(t,e,n,r){let o=e.nodeBefore,l=e.nodeAfter,a,c,d=o.type.spec.isolating||l.type.spec.isolating;if(!d&&aB(t,e,n))return!0;let h=!d&&e.parent.canReplace(e.index(),e.index()+1);if(h&&(a=(c=o.contentMatchAt(o.childCount)).findWrapping(l.type))&&c.matchType(a[0]||l.type).validEnd){if(n){let v=e.pos+l.nodeSize,S=te.empty;for(let E=a.length-1;E>=0;E--)S=te.from(a[E].create(null,S));S=te.from(o.copy(S));let x=t.tr.step(new Tt(e.pos-1,v,e.pos,v,new ue(S,1,0),a.length,!0)),C=x.doc.resolve(v+2*a.length);C.nodeAfter&&C.nodeAfter.type==o.type&&Oo(x.doc,C.pos)&&x.join(C.pos),n(x.scrollIntoView())}return!0}let p=l.type.spec.isolating||r>0&&d?null:ze.findFrom(e,1),g=p&&p.$from.blockRange(p.$to),b=g&&Xs(g);if(b!=null&&b>=e.depth)return n&&n(t.tr.lift(g,b).scrollIntoView()),!0;if(h&&Ps(l,"start",!0)&&Ps(o,"end")){let v=o,S=[];for(;S.push(v),!v.isTextblock;)v=v.lastChild;let x=l,C=1;for(;!x.isTextblock;x=x.firstChild)C++;if(v.canReplace(v.childCount,v.childCount,x.content)){if(n){let E=te.empty;for(let k=S.length-1;k>=0;k--)E=te.from(S[k].copy(E));let A=t.tr.step(new Tt(e.pos-S.length,e.pos+l.nodeSize,e.pos+C,e.pos+l.nodeSize-C,new ue(E,S.length,0),0,!0));n(A.scrollIntoView())}return!0}}return!1}function yE(t){return function(e,n){let r=e.selection,o=t<0?r.$from:r.$to,l=o.depth;for(;o.node(l).isInline;){if(!l)return!1;l--}return o.node(l).isTextblock?(n&&n(e.tr.setSelection(Oe.create(e.doc,t<0?o.start(l):o.end(l)))),!0):!1}}const uB=yE(-1),cB=yE(1);function fB(t,e=null){return function(n,r){let{$from:o,$to:l}=n.selection,a=o.blockRange(l),c=a&&YM(a,t,e);return c?(r&&r(n.tr.wrap(a,c).scrollIntoView()),!0):!1}}function KS(t,e=null){return function(n,r){let o=!1;for(let l=0;l<n.selection.ranges.length&&!o;l++){let{$from:{pos:a},$to:{pos:c}}=n.selection.ranges[l];n.doc.nodesBetween(a,c,(d,h)=>{if(o)return!1;if(!(!d.isTextblock||d.hasMarkup(t,e)))if(d.type==t)o=!0;else{let p=n.doc.resolve(h),g=p.index();o=p.parent.canReplaceWith(g,g+1,t)}})}if(!o)return!1;if(r){let l=n.tr;for(let a=0;a<n.selection.ranges.length;a++){let{$from:{pos:c},$to:{pos:d}}=n.selection.ranges[a];l.setBlockType(c,d,t,e)}r(l.scrollIntoView())}return!0}}function lg(...t){return function(e,n,r){for(let o=0;o<t.length;o++)if(t[o](e,n,r))return!0;return!1}}lg(rg,lE,uE);lg(rg,fE,dE);lg(hE,pE,mE,sB);typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function dB(t,e=null){return function(n,r){let{$from:o,$to:l}=n.selection,a=o.blockRange(l);if(!a)return!1;let c=r?n.tr:null;return hB(c,a,t,e)?(r&&r(c.scrollIntoView()),!0):!1}}function hB(t,e,n,r=null){let o=!1,l=e,a=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(n)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let d=a.resolve(e.start-2);l=new Bc(d,d,e.depth),e.endIndex<e.parent.childCount&&(e=new Bc(e.$from,a.resolve(e.$to.end(e.depth)),e.depth)),o=!0}let c=YM(l,n,r,e);return c?(t&&pB(t,e,c,o,n),!0):!1}function pB(t,e,n,r,o){let l=te.empty;for(let p=n.length-1;p>=0;p--)l=te.from(n[p].type.create(n[p].attrs,l));t.step(new Tt(e.start-(r?2:0),e.end,e.start,e.end,new ue(l,0,0),n.length,!0));let a=0;for(let p=0;p<n.length;p++)n[p].type==o&&(a=p+1);let c=n.length-a,d=e.start+n.length-(r?2:0),h=e.parent;for(let p=e.startIndex,g=e.endIndex,b=!0;p<g;p++,b=!1)!b&&Ir(t.doc,d,c)&&(t.split(d,c),d+=2*c),d+=h.child(p).nodeSize;return t}function mB(t){return function(e,n){let{$from:r,$to:o}=e.selection,l=r.blockRange(o,a=>a.childCount>0&&a.firstChild.type==t);return l?n?r.node(l.depth-1).type==t?gB(e,n,t,l):yB(e,n,l):!0:!1}}function gB(t,e,n,r){let o=t.tr,l=r.end,a=r.$to.end(r.depth);l<a&&(o.step(new Tt(l-1,a,l,a,new ue(te.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Bc(o.doc.resolve(r.$from.pos),o.doc.resolve(a),r.depth));const c=Xs(r);if(c==null)return!1;o.lift(r,c);let d=o.doc.resolve(o.mapping.map(l,-1)-1);return Oo(o.doc,d.pos)&&d.nodeBefore.type==d.nodeAfter.type&&o.join(d.pos),e(o.scrollIntoView()),!0}function yB(t,e,n){let r=t.tr,o=n.parent;for(let v=n.end,S=n.endIndex-1,x=n.startIndex;S>x;S--)v-=o.child(S).nodeSize,r.delete(v-1,v+1);let l=r.doc.resolve(n.start),a=l.nodeAfter;if(r.mapping.map(n.end)!=n.start+l.nodeAfter.nodeSize)return!1;let c=n.startIndex==0,d=n.endIndex==o.childCount,h=l.node(-1),p=l.index(-1);if(!h.canReplace(p+(c?0:1),p+1,a.content.append(d?te.empty:te.from(o))))return!1;let g=l.pos,b=g+a.nodeSize;return r.step(new Tt(g-(c?1:0),b+(d?1:0),g+1,b-1,new ue((c?te.empty:te.from(o.copy(te.empty))).append(d?te.empty:te.from(o.copy(te.empty))),c?0:1,d?0:1),c?0:1)),e(r.scrollIntoView()),!0}function vB(t){return function(e,n){let{$from:r,$to:o}=e.selection,l=r.blockRange(o,h=>h.childCount>0&&h.firstChild.type==t);if(!l)return!1;let a=l.startIndex;if(a==0)return!1;let c=l.parent,d=c.child(a-1);if(d.type!=t)return!1;if(n){let h=d.lastChild&&d.lastChild.type==c.type,p=te.from(h?t.create():null),g=new ue(te.from(t.create(null,te.from(c.type.create(null,p)))),h?3:1,0),b=l.start,v=l.end;n(e.tr.step(new Tt(b-(h?3:1),v,b,v,g,1,!0)).scrollIntoView())}return!0}}const Bt=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},$s=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let dm=null;const Lr=function(t,e,n){let r=dm||(dm=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},bB=function(){dm=null},Mo=function(t,e,n,r){return n&&(YS(t,e,n,r,-1)||YS(t,e,n,r,1))},SB=/^(img|br|input|textarea|hr)$/i;function YS(t,e,n,r,o){for(var l;;){if(t==n&&e==r)return!0;if(e==(o<0?0:Fn(t))){let a=t.parentNode;if(!a||a.nodeType!=1||Ta(t)||SB.test(t.nodeName)||t.contentEditable=="false")return!1;e=Bt(t)+(o<0?0:1),t=a}else if(t.nodeType==1){let a=t.childNodes[e+(o<0?-1:0)];if(a.nodeType==1&&a.contentEditable=="false")if(!((l=a.pmViewDesc)===null||l===void 0)&&l.ignoreForSelection)e+=o;else return!1;else t=a,e=o<0?Fn(t):0}else return!1}}function Fn(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function xB(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=Fn(t)}else if(t.parentNode&&!Ta(t))e=Bt(t),t=t.parentNode;else return null}}function wB(t,e){for(;;){if(t.nodeType==3&&e<t.nodeValue.length)return t;if(t.nodeType==1&&e<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[e],e=0}else if(t.parentNode&&!Ta(t))e=Bt(t)+1,t=t.parentNode;else return null}}function CB(t,e,n){for(let r=e==0,o=e==Fn(t);r||o;){if(t==n)return!0;let l=Bt(t);if(t=t.parentNode,!t)return!1;r=r&&l==0,o=o&&l==Fn(t)}}function Ta(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const bf=function(t){return t.focusNode&&Mo(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function co(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function MB(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function EB(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:Math.min(Fn(r.offsetNode),r.offset)}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:Math.min(Fn(r.startContainer),r.startOffset)}}}const cr=typeof navigator<"u"?navigator:null,XS=typeof document<"u"?document:null,Vi=cr&&cr.userAgent||"",hm=/Edge\/(\d+)/.exec(Vi),vE=/MSIE \d/.exec(Vi),pm=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Vi),dn=!!(vE||pm||hm),Oi=vE?document.documentMode:pm?+pm[1]:hm?+hm[1]:0,$n=!dn&&/gecko\/(\d+)/i.test(Vi);$n&&+(/Firefox\/(\d+)/.exec(Vi)||[0,0])[1];const mm=!dn&&/Chrome\/(\d+)/.exec(Vi),Vt=!!mm,bE=mm?+mm[1]:0,qt=!dn&&!!cr&&/Apple Computer/.test(cr.vendor),Hs=qt&&(/Mobile\/\w+/.test(Vi)||!!cr&&cr.maxTouchPoints>2),Vn=Hs||(cr?/Mac/.test(cr.platform):!1),SE=cr?/Win/.test(cr.platform):!1,Br=/Android \d/.test(Vi),Aa=!!XS&&"webkitFontSmoothing"in XS.documentElement.style,RB=Aa?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function TB(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function zr(t,e){return typeof t=="number"?t:t[e]}function AB(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function JS(t,e,n){let r=t.someProp("scrollThreshold")||0,o=t.someProp("scrollMargin")||5,l=t.dom.ownerDocument;for(let a=n||t.dom;a;){if(a.nodeType!=1){a=$s(a);continue}let c=a,d=c==l.body,h=d?TB(l):AB(c),p=0,g=0;if(e.top<h.top+zr(r,"top")?g=-(h.top-e.top+zr(o,"top")):e.bottom>h.bottom-zr(r,"bottom")&&(g=e.bottom-e.top>h.bottom-h.top?e.top+zr(o,"top")-h.top:e.bottom-h.bottom+zr(o,"bottom")),e.left<h.left+zr(r,"left")?p=-(h.left-e.left+zr(o,"left")):e.right>h.right-zr(r,"right")&&(p=e.right-h.right+zr(o,"right")),p||g)if(d)l.defaultView.scrollBy(p,g);else{let v=c.scrollLeft,S=c.scrollTop;g&&(c.scrollTop+=g),p&&(c.scrollLeft+=p);let x=c.scrollLeft-v,C=c.scrollTop-S;e={left:e.left-x,top:e.top-C,right:e.right-x,bottom:e.bottom-C}}let b=d?"fixed":getComputedStyle(a).position;if(/^(fixed|sticky)$/.test(b))break;a=b=="absolute"?a.offsetParent:$s(a)}}function OB(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,o;for(let l=(e.left+e.right)/2,a=n+1;a<Math.min(innerHeight,e.bottom);a+=5){let c=t.root.elementFromPoint(l,a);if(!c||c==t.dom||!t.dom.contains(c))continue;let d=c.getBoundingClientRect();if(d.top>=n-20){r=c,o=d.top;break}}return{refDOM:r,refTop:o,stack:xE(t.dom)}}function xE(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=$s(r));return e}function kB({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;wE(n,r==0?0:r-e)}function wE(t,e){for(let n=0;n<t.length;n++){let{dom:r,top:o,left:l}=t[n];r.scrollTop!=o+e&&(r.scrollTop=o+e),r.scrollLeft!=l&&(r.scrollLeft=l)}}let Rs=null;function NB(t){if(t.setActive)return t.setActive();if(Rs)return t.focus(Rs);let e=xE(t);t.focus(Rs==null?{get preventScroll(){return Rs={preventScroll:!0},!0}}:void 0),Rs||(Rs=!1,wE(e,0))}function CE(t,e){let n,r=2e8,o,l=0,a=e.top,c=e.top,d,h;for(let p=t.firstChild,g=0;p;p=p.nextSibling,g++){let b;if(p.nodeType==1)b=p.getClientRects();else if(p.nodeType==3)b=Lr(p).getClientRects();else continue;for(let v=0;v<b.length;v++){let S=b[v];if(S.top<=a&&S.bottom>=c){a=Math.max(S.bottom,a),c=Math.min(S.top,c);let x=S.left>e.left?S.left-e.left:S.right<e.left?e.left-S.right:0;if(x<r){n=p,r=x,o=x&&n.nodeType==3?{left:S.right<e.left?S.right:S.left,top:e.top}:e,p.nodeType==1&&x&&(l=g+(e.left>=(S.left+S.right)/2?1:0));continue}}else S.top>e.top&&!d&&S.left<=e.left&&S.right>=e.left&&(d=p,h={left:Math.max(S.left,Math.min(S.right,e.left)),top:S.top});!n&&(e.left>=S.right&&e.top>=S.top||e.left>=S.left&&e.top>=S.bottom)&&(l=g+1)}}return!n&&d&&(n=d,o=h,r=0),n&&n.nodeType==3?DB(n,o):!n||r&&n.nodeType==1?{node:t,offset:l}:CE(n,o)}function DB(t,e){let n=t.nodeValue.length,r=document.createRange(),o;for(let l=0;l<n;l++){r.setEnd(t,l+1),r.setStart(t,l);let a=Si(r,1);if(a.top!=a.bottom&&ag(e,a)){o={node:t,offset:l+(e.left>=(a.left+a.right)/2?1:0)};break}}return r.detach(),o||{node:t,offset:0}}function ag(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function _B(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function zB(t,e,n){let{node:r,offset:o}=CE(e,n),l=-1;if(r.nodeType==1&&!r.firstChild){let a=r.getBoundingClientRect();l=a.left!=a.right&&n.left>(a.left+a.right)/2?1:-1}return t.docView.posFromDOM(r,o,l)}function jB(t,e,n,r){let o=-1;for(let l=e,a=!1;l!=t.dom;){let c=t.docView.nearestDesc(l,!0),d;if(!c)return null;if(c.dom.nodeType==1&&(c.node.isBlock&&c.parent||!c.contentDOM)&&((d=c.dom.getBoundingClientRect()).width||d.height)&&(c.node.isBlock&&c.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(c.dom.nodeName)&&(!a&&d.left>r.left||d.top>r.top?o=c.posBefore:(!a&&d.right<r.left||d.bottom<r.top)&&(o=c.posAfter),a=!0),!c.contentDOM&&o<0&&!c.node.isText))return(c.node.isBlock?r.top<(d.top+d.bottom)/2:r.left<(d.left+d.right)/2)?c.posBefore:c.posAfter;l=c.dom.parentNode}return o>-1?o:t.docView.posFromDOM(e,n,-1)}function ME(t,e,n){let r=t.childNodes.length;if(r&&n.top<n.bottom)for(let o=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-n.top)/(n.bottom-n.top))-2)),l=o;;){let a=t.childNodes[l];if(a.nodeType==1){let c=a.getClientRects();for(let d=0;d<c.length;d++){let h=c[d];if(ag(e,h))return ME(a,e,h)}}if((l=(l+1)%r)==o)break}return t}function LB(t,e){let n=t.dom.ownerDocument,r,o=0,l=EB(n,e.left,e.top);l&&({node:r,offset:o}=l);let a=(t.root.elementFromPoint?t.root:n).elementFromPoint(e.left,e.top),c;if(!a||!t.dom.contains(a.nodeType!=1?a.parentNode:a)){let h=t.dom.getBoundingClientRect();if(!ag(e,h)||(a=ME(t.dom,e,h),!a))return null}if(qt)for(let h=a;r&&h;h=$s(h))h.draggable&&(r=void 0);if(a=_B(a,e),r){if($n&&r.nodeType==1&&(o=Math.min(o,r.childNodes.length),o<r.childNodes.length)){let p=r.childNodes[o],g;p.nodeName=="IMG"&&(g=p.getBoundingClientRect()).right<=e.left&&g.bottom>e.top&&o++}let h;Aa&&o&&r.nodeType==1&&(h=r.childNodes[o-1]).nodeType==1&&h.contentEditable=="false"&&h.getBoundingClientRect().top>=e.top&&o--,r==t.dom&&o==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?c=t.state.doc.content.size:(o==0||r.nodeType!=1||r.childNodes[o-1].nodeName!="BR")&&(c=jB(t,r,o,e))}c==null&&(c=zB(t,a,e));let d=t.docView.nearestDesc(a,!0);return{pos:c,inside:d?d.posAtStart-d.border:-1}}function QS(t){return t.top<t.bottom||t.left<t.right}function Si(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(QS(r))return r}return Array.prototype.find.call(n,QS)||t.getBoundingClientRect()}const BB=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function EE(t,e,n){let{node:r,offset:o,atom:l}=t.docView.domFromPos(e,n<0?-1:1),a=Aa||$n;if(r.nodeType==3)if(a&&(BB.test(r.nodeValue)||(n<0?!o:o==r.nodeValue.length))){let d=Si(Lr(r,o,o),n);if($n&&o&&/\s/.test(r.nodeValue[o-1])&&o<r.nodeValue.length){let h=Si(Lr(r,o-1,o-1),-1);if(h.top==d.top){let p=Si(Lr(r,o,o+1),-1);if(p.top!=d.top)return Ul(p,p.left<h.left)}}return d}else{let d=o,h=o,p=n<0?1:-1;return n<0&&!o?(h++,p=-1):n>=0&&o==r.nodeValue.length?(d--,p=1):n<0?d--:h++,Ul(Si(Lr(r,d,h),p),p<0)}if(!t.state.doc.resolve(e-(l||0)).parent.inlineContent){if(l==null&&o&&(n<0||o==Fn(r))){let d=r.childNodes[o-1];if(d.nodeType==1)return wp(d.getBoundingClientRect(),!1)}if(l==null&&o<Fn(r)){let d=r.childNodes[o];if(d.nodeType==1)return wp(d.getBoundingClientRect(),!0)}return wp(r.getBoundingClientRect(),n>=0)}if(l==null&&o&&(n<0||o==Fn(r))){let d=r.childNodes[o-1],h=d.nodeType==3?Lr(d,Fn(d)-(a?0:1)):d.nodeType==1&&(d.nodeName!="BR"||!d.nextSibling)?d:null;if(h)return Ul(Si(h,1),!1)}if(l==null&&o<Fn(r)){let d=r.childNodes[o];for(;d.pmViewDesc&&d.pmViewDesc.ignoreForCoords;)d=d.nextSibling;let h=d?d.nodeType==3?Lr(d,0,a?0:1):d.nodeType==1?d:null:null;if(h)return Ul(Si(h,-1),!0)}return Ul(Si(r.nodeType==3?Lr(r):r,-n),n>=0)}function Ul(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function wp(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function RE(t,e,n){let r=t.state,o=t.root.activeElement;r!=e&&t.updateState(e),o!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),o!=t.dom&&o&&o.focus()}}function IB(t,e,n){let r=e.selection,o=n=="up"?r.$from:r.$to;return RE(t,e,()=>{let{node:l}=t.docView.domFromPos(o.pos,n=="up"?-1:1);for(;;){let c=t.docView.nearestDesc(l,!0);if(!c)break;if(c.node.isBlock){l=c.contentDOM||c.dom;break}l=c.dom.parentNode}let a=EE(t,o.pos,1);for(let c=l.firstChild;c;c=c.nextSibling){let d;if(c.nodeType==1)d=c.getClientRects();else if(c.nodeType==3)d=Lr(c,0,c.nodeValue.length).getClientRects();else continue;for(let h=0;h<d.length;h++){let p=d[h];if(p.bottom>p.top+1&&(n=="up"?a.top-p.top>(p.bottom-a.top)*2:p.bottom-a.bottom>(a.bottom-p.top)*2))return!1}}return!0})}const VB=/[\u0590-\u08ac]/;function FB(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let o=r.parentOffset,l=!o,a=o==r.parent.content.size,c=t.domSelection();return c?!VB.test(r.parent.textContent)||!c.modify?n=="left"||n=="backward"?l:a:RE(t,e,()=>{let{focusNode:d,focusOffset:h,anchorNode:p,anchorOffset:g}=t.domSelectionRange(),b=c.caretBidiLevel;c.modify("move",n,"character");let v=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:S,focusOffset:x}=t.domSelectionRange(),C=S&&!v.contains(S.nodeType==1?S:S.parentNode)||d==S&&h==x;try{c.collapse(p,g),d&&(d!=p||h!=g)&&c.extend&&c.extend(d,h)}catch{}return b!=null&&(c.caretBidiLevel=b),C}):r.pos==r.start()||r.pos==r.end()}let ZS=null,WS=null,ex=!1;function PB(t,e,n){return ZS==e&&WS==n?ex:(ZS=e,WS=n,ex=n=="up"||n=="down"?IB(t,e,n):FB(t,e,n))}const Hn=0,tx=1,ho=2,fr=3;class Oa{constructor(e,n,r,o){this.parent=e,this.children=n,this.dom=r,this.contentDOM=o,this.dirty=Hn,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;n<this.children.length;n++)e+=this.children[n].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let n=0,r=this.posAtStart;;n++){let o=this.children[n];if(o==e)return r;r+=o.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,n,r){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(r<0){let l,a;if(e==this.contentDOM)l=e.childNodes[n-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;l=e.previousSibling}for(;l&&!((a=l.pmViewDesc)&&a.parent==this);)l=l.previousSibling;return l?this.posBeforeChild(a)+a.size:this.posAtStart}else{let l,a;if(e==this.contentDOM)l=e.childNodes[n];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;l=e.nextSibling}for(;l&&!((a=l.pmViewDesc)&&a.parent==this);)l=l.nextSibling;return l?this.posBeforeChild(a):this.posAtEnd}let o;if(e==this.dom&&this.contentDOM)o=n>Bt(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))o=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let l=e;;l=l.parentNode){if(l==this.dom){o=!1;break}if(l.previousSibling)break}if(o==null&&n==e.childNodes.length)for(let l=e;;l=l.parentNode){if(l==this.dom){o=!0;break}if(l.nextSibling)break}}return o??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,o=e;o;o=o.parentNode){let l=this.getDesc(o),a;if(l&&(!n||l.node))if(r&&(a=l.nodeDOM)&&!(a.nodeType==1?a.contains(e.nodeType==1?e:e.parentNode):a==e))r=!1;else return l}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let o=e;o;o=o.parentNode){let l=this.getDesc(o);if(l)return l.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;n<this.children.length;n++){let o=this.children[n],l=r+o.size;if(r==e&&l!=r){for(;!o.border&&o.children.length;)for(let a=0;a<o.children.length;a++){let c=o.children[a];if(c.size){o=c;break}}return o}if(e<l)return o.descAt(e-r-o.border);r=l}}domFromPos(e,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,o=0;for(let l=0;r<this.children.length;r++){let a=this.children[r],c=l+a.size;if(c>e||a instanceof AE){o=e-l;break}l=c}if(o)return this.children[r].domFromPos(o-this.children[r].border,n);for(let l;r&&!(l=this.children[r-1]).size&&l instanceof TE&&l.side>=0;r--);if(n<=0){let l,a=!0;for(;l=r?this.children[r-1]:null,!(!l||l.dom.parentNode==this.contentDOM);r--,a=!1);return l&&n&&a&&!l.border&&!l.domAtom?l.domFromPos(l.size,n):{node:this.contentDOM,offset:l?Bt(l.dom)+1:0}}else{let l,a=!0;for(;l=r<this.children.length?this.children[r]:null,!(!l||l.dom.parentNode==this.contentDOM);r++,a=!1);return l&&a&&!l.border&&!l.domAtom?l.domFromPos(0,n):{node:this.contentDOM,offset:l?Bt(l.dom):this.contentDOM.childNodes.length}}}parseRange(e,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let o=-1,l=-1;for(let a=r,c=0;;c++){let d=this.children[c],h=a+d.size;if(o==-1&&e<=h){let p=a+d.border;if(e>=p&&n<=h-d.border&&d.node&&d.contentDOM&&this.contentDOM.contains(d.contentDOM))return d.parseRange(e,n,p);e=a;for(let g=c;g>0;g--){let b=this.children[g-1];if(b.size&&b.dom.parentNode==this.contentDOM&&!b.emptyChildAt(1)){o=Bt(b.dom)+1;break}e-=b.size}o==-1&&(o=0)}if(o>-1&&(h>n||c==this.children.length-1)){n=h;for(let p=c+1;p<this.children.length;p++){let g=this.children[p];if(g.size&&g.dom.parentNode==this.contentDOM&&!g.emptyChildAt(-1)){l=Bt(g.dom);break}n+=g.size}l==-1&&(l=this.contentDOM.childNodes.length);break}a=h}return{node:this.contentDOM,from:e,to:n,fromOffset:o,toOffset:l}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[e<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(e)}domAfterPos(e){let{node:n,offset:r}=this.domFromPos(e,0);if(n.nodeType!=1||r==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[r]}setSelection(e,n,r,o=!1){let l=Math.min(e,n),a=Math.max(e,n);for(let v=0,S=0;v<this.children.length;v++){let x=this.children[v],C=S+x.size;if(l>S&&a<C)return x.setSelection(e-S-x.border,n-S-x.border,r,o);S=C}let c=this.domFromPos(e,e?-1:1),d=n==e?c:this.domFromPos(n,n?-1:1),h=r.root.getSelection(),p=r.domSelectionRange(),g=!1;if(($n||qt)&&e==n){let{node:v,offset:S}=c;if(v.nodeType==3){if(g=!!(S&&v.nodeValue[S-1]==`
|
|
61
|
+
`),g&&S==v.nodeValue.length)for(let x=v,C;x;x=x.parentNode){if(C=x.nextSibling){C.nodeName=="BR"&&(c=d={node:C.parentNode,offset:Bt(C)+1});break}let E=x.pmViewDesc;if(E&&E.node&&E.node.isBlock)break}}else{let x=v.childNodes[S-1];g=x&&(x.nodeName=="BR"||x.contentEditable=="false")}}if($n&&p.focusNode&&p.focusNode!=d.node&&p.focusNode.nodeType==1){let v=p.focusNode.childNodes[p.focusOffset];v&&v.contentEditable=="false"&&(o=!0)}if(!(o||g&&qt)&&Mo(c.node,c.offset,p.anchorNode,p.anchorOffset)&&Mo(d.node,d.offset,p.focusNode,p.focusOffset))return;let b=!1;if((h.extend||e==n)&&!(g&&$n)){h.collapse(c.node,c.offset);try{e!=n&&h.extend(d.node,d.offset),b=!0}catch{}}if(!b){if(e>n){let S=c;c=d,d=S}let v=document.createRange();v.setEnd(d.node,d.offset),v.setStart(c.node,c.offset),h.removeAllRanges(),h.addRange(v)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,o=0;o<this.children.length;o++){let l=this.children[o],a=r+l.size;if(r==a?e<=a&&n>=r:e<a&&n>r){let c=r+l.border,d=a-l.border;if(e>=c&&n<=d){this.dirty=e==r||n==a?ho:tx,e==c&&n==d&&(l.contentLost||l.dom.parentNode!=this.contentDOM)?l.dirty=fr:l.markDirty(e-c,n-c);return}else l.dirty=l.dom==l.contentDOM&&l.dom.parentNode==this.contentDOM&&!l.children.length?ho:fr}r=a}this.dirty=ho}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?ho:tx;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class TE extends Oa{constructor(e,n,r,o){let l,a=n.type.toDOM;if(typeof a=="function"&&(a=a(r,()=>{if(!l)return o;if(l.parent)return l.parent.posBeforeChild(l)})),!n.type.spec.raw){if(a.nodeType!=1){let c=document.createElement("span");c.appendChild(a),a=c}a.contentEditable="false",a.classList.add("ProseMirror-widget")}super(e,[],a,null),this.widget=n,this.widget=n,l=this}matchesWidget(e){return this.dirty==Hn&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class $B extends Oa{constructor(e,n,r,o){super(e,[],n,null),this.textDOM=r,this.text=o}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class Eo extends Oa{constructor(e,n,r,o,l){super(e,[],r,o),this.mark=n,this.spec=l}static create(e,n,r,o){let l=o.nodeViews[n.type.name],a=l&&l(n,o,r);return(!a||!a.dom)&&(a=Ao.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new Eo(e,n,a.dom,a.contentDOM||a.dom,a)}parseRule(){return this.dirty&fr||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=fr&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=Hn){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=Hn}}slice(e,n,r){let o=Eo.create(this.parent,this.mark,!0,r),l=this.children,a=this.size;n<a&&(l=ym(l,n,a,r)),e>0&&(l=ym(l,0,e,r));for(let c=0;c<l.length;c++)l[c].parent=o;return o.children=l,o}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class ki extends Oa{constructor(e,n,r,o,l,a,c,d,h){super(e,[],l,a),this.node=n,this.outerDeco=r,this.innerDeco=o,this.nodeDOM=c}static create(e,n,r,o,l,a){let c=l.nodeViews[n.type.name],d,h=c&&c(n,l,()=>{if(!d)return a;if(d.parent)return d.parent.posBeforeChild(d)},r,o),p=h&&h.dom,g=h&&h.contentDOM;if(n.isText){if(!p)p=document.createTextNode(n.text);else if(p.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else p||({dom:p,contentDOM:g}=Ao.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!g&&!n.isText&&p.nodeName!="BR"&&(p.hasAttribute("contenteditable")||(p.contentEditable="false"),n.type.spec.draggable&&(p.draggable=!0));let b=p;return p=NE(p,r,n),h?d=new HB(e,n,r,o,p,g||null,b,h,l,a+1):n.isText?new Sf(e,n,r,o,p,b,l):new ki(e,n,r,o,p,g||null,b,l,a+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>te.empty)}return e}matchesNode(e,n,r){return this.dirty==Hn&&e.eq(this.node)&&Vc(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,o=n,l=e.composing?this.localCompositionInfo(e,n):null,a=l&&l.pos>-1?l:null,c=l&&l.pos<0,d=new qB(this,a&&a.node,e);YB(this.node,this.innerDeco,(h,p,g)=>{h.spec.marks?d.syncToMarks(h.spec.marks,r,e,p):h.type.side>=0&&!g&&d.syncToMarks(p==this.node.childCount?Ze.none:this.node.child(p).marks,r,e,p),d.placeWidget(h,e,o)},(h,p,g,b)=>{d.syncToMarks(h.marks,r,e,b);let v;d.findNodeMatch(h,p,g,b)||c&&e.state.selection.from>o&&e.state.selection.to<o+h.nodeSize&&(v=d.findIndexWithChild(l.node))>-1&&d.updateNodeAt(h,p,g,v,e)||d.updateNextNode(h,p,g,e,b,o)||d.addNode(h,p,g,e,o),o+=h.nodeSize}),d.syncToMarks([],r,e,0),this.node.isTextblock&&d.addTextblockHacks(),d.destroyRest(),(d.changed||this.dirty==ho)&&(a&&this.protectLocalComposition(e,a),OE(this.contentDOM,this.children,e),Hs&&XB(this.dom))}localCompositionInfo(e,n){let{from:r,to:o}=e.state.selection;if(!(e.state.selection instanceof Oe)||r<n||o>n+this.node.content.size)return null;let l=e.input.compositionNode;if(!l||!this.dom.contains(l.parentNode))return null;if(this.node.inlineContent){let a=l.nodeValue,c=JB(this.node.content,a,r-n,o-n);return c<0?null:{node:l,pos:c,text:a}}else return{node:l,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:o}){if(this.getDesc(n))return;let l=n;for(;l.parentNode!=this.contentDOM;l=l.parentNode){for(;l.previousSibling;)l.parentNode.removeChild(l.previousSibling);for(;l.nextSibling;)l.parentNode.removeChild(l.nextSibling);l.pmViewDesc&&(l.pmViewDesc=void 0)}let a=new $B(this,l,n,o);e.input.compositionNodes.push(a),this.children=ym(this.children,r,r+o.length,e,a)}update(e,n,r,o){return this.dirty==fr||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,o),!0)}updateInner(e,n,r,o){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(o,this.posAtStart),this.dirty=Hn}updateOuterDeco(e){if(Vc(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=kE(this.dom,this.nodeDOM,gm(this.outerDeco,this.node,n),gm(e,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.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 nx(t,e,n,r,o){NE(r,e,t);let l=new ki(void 0,t,e,n,r,r,r,o,0);return l.contentDOM&&l.updateChildren(o,0),l}class Sf extends ki{constructor(e,n,r,o,l,a,c){super(e,n,r,o,l,null,a,c,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,r,o){return this.dirty==fr||this.dirty!=Hn&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=Hn||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,o.trackWrites==this.nodeDOM&&(o.trackWrites=null)),this.node=e,this.dirty=Hn,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let o=this.node.cut(e,n),l=document.createTextNode(o.text);return new Sf(this.parent,o,this.outerDeco,this.innerDeco,l,l,r)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=fr)}get domAtom(){return!1}isText(e){return this.node.text==e}}class AE extends Oa{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Hn&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class HB extends ki{constructor(e,n,r,o,l,a,c,d,h,p){super(e,n,r,o,l,a,c,h,p),this.spec=d}update(e,n,r,o){if(this.dirty==fr)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let l=this.spec.update(e,n,r);return l&&this.updateInner(e,n,r,o),l}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,o)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,o){this.spec.setSelection?this.spec.setSelection(e,n,r.root):super.setSelection(e,n,r,o)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function OE(t,e,n){let r=t.firstChild,o=!1;for(let l=0;l<e.length;l++){let a=e[l],c=a.dom;if(c.parentNode==t){for(;c!=r;)r=rx(r),o=!0;r=r.nextSibling}else o=!0,t.insertBefore(c,r);if(a instanceof Eo){let d=r?r.previousSibling:t.lastChild;OE(a.contentDOM,a.children,n),r=d?d.nextSibling:t.firstChild}}for(;r;)r=rx(r),o=!0;o&&n.trackWrites==t&&(n.trackWrites=null)}const ta=function(t){t&&(this.nodeName=t)};ta.prototype=Object.create(null);const po=[new ta];function gm(t,e,n){if(t.length==0)return po;let r=n?po[0]:new ta,o=[r];for(let l=0;l<t.length;l++){let a=t[l].type.attrs;if(a){a.nodeName&&o.push(r=new ta(a.nodeName));for(let c in a){let d=a[c];d!=null&&(n&&o.length==1&&o.push(r=new ta(e.isInline?"span":"div")),c=="class"?r.class=(r.class?r.class+" ":"")+d:c=="style"?r.style=(r.style?r.style+";":"")+d:c!="nodeName"&&(r[c]=d))}}}return o}function kE(t,e,n,r){if(n==po&&r==po)return e;let o=e;for(let l=0;l<r.length;l++){let a=r[l],c=n[l];if(l){let d;c&&c.nodeName==a.nodeName&&o!=t&&(d=o.parentNode)&&d.nodeName.toLowerCase()==a.nodeName||(d=document.createElement(a.nodeName),d.pmIsDeco=!0,d.appendChild(o),c=po[0]),o=d}UB(o,c||po[0],a)}return o}function UB(t,e,n){for(let r in e)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&t.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=e[r]&&t.setAttribute(r,n[r]);if(e.class!=n.class){let r=e.class?e.class.split(" ").filter(Boolean):[],o=n.class?n.class.split(" ").filter(Boolean):[];for(let l=0;l<r.length;l++)o.indexOf(r[l])==-1&&t.classList.remove(r[l]);for(let l=0;l<o.length;l++)r.indexOf(o[l])==-1&&t.classList.add(o[l]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,o;for(;o=r.exec(e.style);)t.style.removeProperty(o[1])}n.style&&(t.style.cssText+=n.style)}}function NE(t,e,n){return kE(t,t,po,gm(e,n,t.nodeType!=1))}function Vc(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function rx(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class qB{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=GB(e.node.content,e)}destroyBetween(e,n){if(e!=n){for(let r=e;r<n;r++)this.top.children[r].destroy();this.top.children.splice(e,n-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,n,r,o){let l=0,a=this.stack.length>>1,c=Math.min(a,e.length);for(;l<c&&(l==a-1?this.top:this.stack[l+1<<1]).matchesMark(e[l])&&e[l].type.spec.spanning!==!1;)l++;for(;l<a;)this.destroyRest(),this.top.dirty=Hn,this.index=this.stack.pop(),this.top=this.stack.pop(),a--;for(;a<e.length;){this.stack.push(this.top,this.index+1);let d=-1,h=this.top.children.length;o<this.preMatch.index&&(h=Math.min(this.index+3,h));for(let p=this.index;p<h;p++){let g=this.top.children[p];if(g.matchesMark(e[a])&&!this.isLocked(g.dom)){d=p;break}}if(d>-1)d>this.index&&(this.changed=!0,this.destroyBetween(this.index,d)),this.top=this.top.children[this.index];else{let p=Eo.create(this.top,e[a],n,r);this.top.children.splice(this.index,0,p),this.top=p,this.changed=!0}this.index=0,a++}}findNodeMatch(e,n,r,o){let l=-1,a;if(o>=this.preMatch.index&&(a=this.preMatch.matches[o-this.preMatch.index]).parent==this.top&&a.matchesNode(e,n,r))l=this.top.children.indexOf(a,this.index);else for(let c=this.index,d=Math.min(this.top.children.length,c+5);c<d;c++){let h=this.top.children[c];if(h.matchesNode(e,n,r)&&!this.preMatch.matched.has(h)){l=c;break}}return l<0?!1:(this.destroyBetween(this.index,l),this.index++,!0)}updateNodeAt(e,n,r,o,l){let a=this.top.children[o];return a.dirty==fr&&a.dom==a.contentDOM&&(a.dirty=ho),a.update(e,n,r,l)?(this.destroyBetween(this.index,o),this.index++,!0):!1}findIndexWithChild(e){for(;;){let n=e.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=e.pmViewDesc;if(r){for(let o=this.index;o<this.top.children.length;o++)if(this.top.children[o]==r)return o}return-1}e=n}}updateNextNode(e,n,r,o,l,a){for(let c=this.index;c<this.top.children.length;c++){let d=this.top.children[c];if(d instanceof ki){let h=this.preMatch.matched.get(d);if(h!=null&&h!=l)return!1;let p=d.dom,g,b=this.isLocked(p)&&!(e.isText&&d.node&&d.node.isText&&d.nodeDOM.nodeValue==e.text&&d.dirty!=fr&&Vc(n,d.outerDeco));if(!b&&d.update(e,n,r,o))return this.destroyBetween(this.index,c),d.dom!=p&&(this.changed=!0),this.index++,!0;if(!b&&(g=this.recreateWrapper(d,e,n,r,o,a)))return this.destroyBetween(this.index,c),this.top.children[this.index]=g,g.contentDOM&&(g.dirty=ho,g.updateChildren(o,a+1),g.dirty=Hn),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,n,r,o,l,a){if(e.dirty||n.isAtom||!e.children.length||!e.node.content.eq(n.content)||!Vc(r,e.outerDeco)||!o.eq(e.innerDeco))return null;let c=ki.create(this.top,n,r,o,l,a);if(c.contentDOM){c.children=e.children,e.children=[];for(let d of c.children)d.parent=c}return e.destroy(),c}addNode(e,n,r,o,l){let a=ki.create(this.top,e,n,r,o,l);a.contentDOM&&a.updateChildren(o,l+1),this.top.children.splice(this.index++,0,a),this.changed=!0}placeWidget(e,n,r){let o=this.index<this.top.children.length?this.top.children[this.index]:null;if(o&&o.matchesWidget(e)&&(e==o.widget||!o.widget.type.toDOM.parentNode))this.index++;else{let l=new TE(this.top,e,n,r);this.top.children.splice(this.index++,0,l),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],n=this.top;for(;e instanceof Eo;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof Sf)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((qt||Vt)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(e,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(e))this.index++;else{let r=document.createElement(e);e=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),e=="BR"&&(r.className="ProseMirror-trailingBreak");let o=new AE(this.top,[],r,null);n!=this.top?n.children.push(o):n.children.splice(this.index++,0,o),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function GB(t,e){let n=e,r=n.children.length,o=t.childCount,l=new Map,a=[];e:for(;o>0;){let c;for(;;)if(r){let h=n.children[r-1];if(h instanceof Eo)n=h,r=h.children.length;else{c=h,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let d=c.node;if(d){if(d!=t.child(o-1))break;--o,l.set(c,o),a.push(c)}}return{index:o,matched:l,matches:a.reverse()}}function KB(t,e){return t.type.side-e.type.side}function YB(t,e,n,r){let o=e.locals(t),l=0;if(o.length==0){for(let h=0;h<t.childCount;h++){let p=t.child(h);r(p,o,e.forChild(l,p),h),l+=p.nodeSize}return}let a=0,c=[],d=null;for(let h=0;;){let p,g;for(;a<o.length&&o[a].to==l;){let C=o[a++];C.widget&&(p?(g||(g=[p])).push(C):p=C)}if(p)if(g){g.sort(KB);for(let C=0;C<g.length;C++)n(g[C],h,!!d)}else n(p,h,!!d);let b,v;if(d)v=-1,b=d,d=null;else if(h<t.childCount)v=h,b=t.child(h++);else break;for(let C=0;C<c.length;C++)c[C].to<=l&&c.splice(C--,1);for(;a<o.length&&o[a].from<=l&&o[a].to>l;)c.push(o[a++]);let S=l+b.nodeSize;if(b.isText){let C=S;a<o.length&&o[a].from<C&&(C=o[a].from);for(let E=0;E<c.length;E++)c[E].to<C&&(C=c[E].to);C<S&&(d=b.cut(C-l),b=b.cut(0,C-l),S=C,v=-1)}else for(;a<o.length&&o[a].to<S;)a++;let x=b.isInline&&!b.isLeaf?c.filter(C=>!C.inline):c.slice();r(b,x,e.forChild(l,b),v),l=S}}function XB(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function JB(t,e,n,r){for(let o=0,l=0;o<t.childCount&&l<=r;){let a=t.child(o++),c=l;if(l+=a.nodeSize,!a.isText)continue;let d=a.text;for(;o<t.childCount;){let h=t.child(o++);if(l+=h.nodeSize,!h.isText)break;d+=h.text}if(l>=n){if(l>=r&&d.slice(r-e.length-c,r-c)==e)return r-e.length;let h=c<r?d.lastIndexOf(e,r-c-1):-1;if(h>=0&&h+e.length+c>=n)return c+h;if(n==r&&d.length>=r+e.length-c&&d.slice(r-c,r-c+e.length)==e)return r}}return-1}function ym(t,e,n,r,o){let l=[];for(let a=0,c=0;a<t.length;a++){let d=t[a],h=c,p=c+=d.size;h>=n||p<=e?l.push(d):(h<e&&l.push(d.slice(0,e-h,r)),o&&(l.push(o),o=void 0),p>n&&l.push(d.slice(n-h,d.size,r)))}return l}function ug(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let o=t.docView.nearestDesc(n.focusNode),l=o&&o.size==0,a=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(a<0)return null;let c=r.resolve(a),d,h;if(bf(n)){for(d=a;o&&!o.node;)o=o.parent;let g=o.node;if(o&&g.isAtom&&be.isSelectable(g)&&o.parent&&!(g.isInline&&CB(n.focusNode,n.focusOffset,o.dom))){let b=o.posBefore;h=new be(a==b?c:r.resolve(b))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let g=a,b=a;for(let v=0;v<n.rangeCount;v++){let S=n.getRangeAt(v);g=Math.min(g,t.docView.posFromDOM(S.startContainer,S.startOffset,1)),b=Math.max(b,t.docView.posFromDOM(S.endContainer,S.endOffset,-1))}if(g<0)return null;[d,a]=b==t.state.selection.anchor?[b,g]:[g,b],c=r.resolve(a)}else d=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(d<0)return null}let p=r.resolve(d);if(!h){let g=e=="pointer"||t.state.selection.head<c.pos&&!l?1:-1;h=cg(t,p,c,g)}return h}function DE(t){return t.editable?t.hasFocus():zE(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function Vr(t,e=!1){let n=t.state.selection;if(_E(t,n),!!DE(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&Vt){let r=t.domSelectionRange(),o=t.domObserver.currentSelection;if(r.anchorNode&&o.anchorNode&&Mo(r.anchorNode,r.anchorOffset,o.anchorNode,o.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)ZB(t);else{let{anchor:r,head:o}=n,l,a;ix&&!(n instanceof Oe)&&(n.$from.parent.inlineContent||(l=ox(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(a=ox(t,n.to))),t.docView.setSelection(r,o,t,e),ix&&(l&&sx(l),a&&sx(a)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&QB(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const ix=qt||Vt&&bE<63;function ox(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),o=r<n.childNodes.length?n.childNodes[r]:null,l=r?n.childNodes[r-1]:null;if(qt&&o&&o.contentEditable=="false")return Cp(o);if((!o||o.contentEditable=="false")&&(!l||l.contentEditable=="false")){if(o)return Cp(o);if(l)return Cp(l)}}function Cp(t){return t.contentEditable="true",qt&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function sx(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function QB(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let n=t.domSelectionRange(),r=n.anchorNode,o=n.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=o)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!DE(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function ZB(t){let e=t.domSelection();if(!e)return;let n=t.cursorWrapper.dom,r=n.nodeName=="IMG";r?e.collapse(n.parentNode,Bt(n)+1):e.collapse(n,0),!r&&!t.state.selection.visible&&dn&&Oi<=11&&(n.disabled=!0,n.disabled=!1)}function _E(t,e){if(e instanceof be){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(lx(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else lx(t)}function lx(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function cg(t,e,n,r){return t.someProp("createSelectionBetween",o=>o(t,e,n))||Oe.between(e,n,r)}function ax(t){return t.editable&&!t.hasFocus()?!1:zE(t)}function zE(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function WB(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return Mo(e.node,e.offset,n.anchorNode,n.anchorOffset)}function vm(t,e){let{$anchor:n,$head:r}=t.selection,o=e>0?n.max(r):n.min(r),l=o.parent.inlineContent?o.depth?t.doc.resolve(e>0?o.after():o.before()):null:o;return l&&ze.findFrom(l,e)}function xi(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function ux(t,e,n){let r=t.state.selection;if(r instanceof Oe)if(n.indexOf("s")>-1){let{$head:o}=r,l=o.textOffset?null:e<0?o.nodeBefore:o.nodeAfter;if(!l||l.isText||!l.isLeaf)return!1;let a=t.state.doc.resolve(o.pos+l.nodeSize*(e<0?-1:1));return xi(t,new Oe(r.$anchor,a))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let o=vm(t.state,e);return o&&o instanceof be?xi(t,o):!1}else if(!(Vn&&n.indexOf("m")>-1)){let o=r.$head,l=o.textOffset?null:e<0?o.nodeBefore:o.nodeAfter,a;if(!l||l.isText)return!1;let c=e<0?o.pos-l.nodeSize:o.pos;return l.isAtom||(a=t.docView.descAt(c))&&!a.contentDOM?be.isSelectable(l)?xi(t,new be(e<0?t.state.doc.resolve(o.pos-l.nodeSize):o)):Aa?xi(t,new Oe(t.state.doc.resolve(e<0?c:c+l.nodeSize))):!1:!1}}else return!1;else{if(r instanceof be&&r.node.isInline)return xi(t,new Oe(e>0?r.$to:r.$from));{let o=vm(t.state,e);return o?xi(t,o):!1}}}function Fc(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function na(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function Ts(t,e){return e<0?eI(t):tI(t)}function eI(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o,l,a=!1;for($n&&n.nodeType==1&&r<Fc(n)&&na(n.childNodes[r],-1)&&(a=!0);;)if(r>0){if(n.nodeType!=1)break;{let c=n.childNodes[r-1];if(na(c,-1))o=n,l=--r;else if(c.nodeType==3)n=c,r=n.nodeValue.length;else break}}else{if(jE(n))break;{let c=n.previousSibling;for(;c&&na(c,-1);)o=n.parentNode,l=Bt(c),c=c.previousSibling;if(c)n=c,r=Fc(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}a?bm(t,n,r):o&&bm(t,o,l)}function tI(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o=Fc(n),l,a;for(;;)if(r<o){if(n.nodeType!=1)break;let c=n.childNodes[r];if(na(c,1))l=n,a=++r;else break}else{if(jE(n))break;{let c=n.nextSibling;for(;c&&na(c,1);)l=c.parentNode,a=Bt(c)+1,c=c.nextSibling;if(c)n=c,r=0,o=Fc(n);else{if(n=n.parentNode,n==t.dom)break;r=o=0}}}l&&bm(t,l,a)}function jE(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function nI(t,e){for(;t&&e==t.childNodes.length&&!Ta(t);)e=Bt(t)+1,t=t.parentNode;for(;t&&e<t.childNodes.length;){let n=t.childNodes[e];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=0}}function rI(t,e){for(;t&&!e&&!Ta(t);)e=Bt(t),t=t.parentNode;for(;t&&e;){let n=t.childNodes[e-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=t.childNodes.length}}function bm(t,e,n){if(e.nodeType!=3){let l,a;(a=nI(e,n))?(e=a,n=0):(l=rI(e,n))&&(e=l,n=l.nodeValue.length)}let r=t.domSelection();if(!r)return;if(bf(r)){let l=document.createRange();l.setEnd(e,n),l.setStart(e,n),r.removeAllRanges(),r.addRange(l)}else r.extend&&r.extend(e,n);t.domObserver.setCurSelection();let{state:o}=t;setTimeout(()=>{t.state==o&&Vr(t)},50)}function cx(t,e){let n=t.state.doc.resolve(e);if(!(Vt||SE)&&n.parent.inlineContent){let o=t.coordsAtPos(e);if(e>n.start()){let l=t.coordsAtPos(e-1),a=(l.top+l.bottom)/2;if(a>o.top&&a<o.bottom&&Math.abs(l.left-o.left)>1)return l.left<o.left?"ltr":"rtl"}if(e<n.end()){let l=t.coordsAtPos(e+1),a=(l.top+l.bottom)/2;if(a>o.top&&a<o.bottom&&Math.abs(l.left-o.left)>1)return l.left>o.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function fx(t,e,n){let r=t.state.selection;if(r instanceof Oe&&!r.empty||n.indexOf("s")>-1||Vn&&n.indexOf("m")>-1)return!1;let{$from:o,$to:l}=r;if(!o.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let a=vm(t.state,e);if(a&&a instanceof be)return xi(t,a)}if(!o.parent.inlineContent){let a=e<0?o:l,c=r instanceof En?ze.near(a,e):ze.findFrom(a,e);return c?xi(t,c):!1}return!1}function dx(t,e){if(!(t.state.selection instanceof Oe))return!0;let{$head:n,$anchor:r,empty:o}=t.state.selection;if(!n.sameParent(r))return!0;if(!o)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let l=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(l&&!l.isText){let a=t.state.tr;return e<0?a.delete(n.pos-l.nodeSize,n.pos):a.delete(n.pos,n.pos+l.nodeSize),t.dispatch(a),!0}return!1}function hx(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function iI(t){if(!qt||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&e.nodeType==1&&n==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;hx(t,r,"true"),setTimeout(()=>hx(t,r,"false"),20)}return!1}function oI(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function sI(t,e){let n=e.keyCode,r=oI(e);if(n==8||Vn&&n==72&&r=="c")return dx(t,-1)||Ts(t,-1);if(n==46&&!e.shiftKey||Vn&&n==68&&r=="c")return dx(t,1)||Ts(t,1);if(n==13||n==27)return!0;if(n==37||Vn&&n==66&&r=="c"){let o=n==37?cx(t,t.state.selection.from)=="ltr"?-1:1:-1;return ux(t,o,r)||Ts(t,o)}else if(n==39||Vn&&n==70&&r=="c"){let o=n==39?cx(t,t.state.selection.from)=="ltr"?1:-1:1;return ux(t,o,r)||Ts(t,o)}else{if(n==38||Vn&&n==80&&r=="c")return fx(t,-1,r)||Ts(t,-1);if(n==40||Vn&&n==78&&r=="c")return iI(t)||fx(t,1,r)||Ts(t,1);if(r==(Vn?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function fg(t,e){t.someProp("transformCopied",v=>{e=v(e,t)});let n=[],{content:r,openStart:o,openEnd:l}=e;for(;o>1&&l>1&&r.childCount==1&&r.firstChild.childCount==1;){o--,l--;let v=r.firstChild;n.push(v.type.name,v.attrs!=v.type.defaultAttrs?v.attrs:null),r=v.content}let a=t.someProp("clipboardSerializer")||Ao.fromSchema(t.state.schema),c=PE(),d=c.createElement("div");d.appendChild(a.serializeFragment(r,{document:c}));let h=d.firstChild,p,g=0;for(;h&&h.nodeType==1&&(p=FE[h.nodeName.toLowerCase()]);){for(let v=p.length-1;v>=0;v--){let S=c.createElement(p[v]);for(;d.firstChild;)S.appendChild(d.firstChild);d.appendChild(S),g++}h=d.firstChild}h&&h.nodeType==1&&h.setAttribute("data-pm-slice",`${o} ${l}${g?` -${g}`:""} ${JSON.stringify(n)}`);let b=t.someProp("clipboardTextSerializer",v=>v(e,t))||e.content.textBetween(0,e.content.size,`
|
|
62
|
+
|
|
63
|
+
`);return{dom:d,text:b,slice:e}}function LE(t,e,n,r,o){let l=o.parent.type.spec.code,a,c;if(!n&&!e)return null;let d=!!e&&(r||l||!n);if(d){if(t.someProp("transformPastedText",b=>{e=b(e,l||r,t)}),l)return c=new ue(te.from(t.state.schema.text(e.replace(/\r\n?/g,`
|
|
64
|
+
`))),0,0),t.someProp("transformPasted",b=>{c=b(c,t,!0)}),c;let g=t.someProp("clipboardTextParser",b=>b(e,o,r,t));if(g)c=g;else{let b=o.marks(),{schema:v}=t.state,S=Ao.fromSchema(v);a=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(x=>{let C=a.appendChild(document.createElement("p"));x&&C.appendChild(S.serializeNode(v.text(x,b)))})}}else t.someProp("transformPastedHTML",g=>{n=g(n,t)}),a=cI(n),Aa&&fI(a);let h=a&&a.querySelector("[data-pm-slice]"),p=h&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(h.getAttribute("data-pm-slice")||"");if(p&&p[3])for(let g=+p[3];g>0;g--){let b=a.firstChild;for(;b&&b.nodeType!=1;)b=b.nextSibling;if(!b)break;a=b}if(c||(c=(t.someProp("clipboardParser")||t.someProp("domParser")||Ai.fromSchema(t.state.schema)).parseSlice(a,{preserveWhitespace:!!(d||p),context:o,ruleFromNode(b){return b.nodeName=="BR"&&!b.nextSibling&&b.parentNode&&!lI.test(b.parentNode.nodeName)?{ignore:!0}:null}})),p)c=dI(px(c,+p[1],+p[2]),p[4]);else if(c=ue.maxOpen(aI(c.content,o),!0),c.openStart||c.openEnd){let g=0,b=0;for(let v=c.content.firstChild;g<c.openStart&&!v.type.spec.isolating;g++,v=v.firstChild);for(let v=c.content.lastChild;b<c.openEnd&&!v.type.spec.isolating;b++,v=v.lastChild);c=px(c,g,b)}return t.someProp("transformPasted",g=>{c=g(c,t,d)}),c}const lI=/^(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 aI(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let o=e.node(n).contentMatchAt(e.index(n)),l,a=[];if(t.forEach(c=>{if(!a)return;let d=o.findWrapping(c.type),h;if(!d)return a=null;if(h=a.length&&l.length&&IE(d,l,c,a[a.length-1],0))a[a.length-1]=h;else{a.length&&(a[a.length-1]=VE(a[a.length-1],l.length));let p=BE(c,d);a.push(p),o=o.matchType(p.type),l=d}}),a)return te.from(a)}return t}function BE(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,te.from(t));return t}function IE(t,e,n,r,o){if(o<t.length&&o<e.length&&t[o]==e[o]){let l=IE(t,e,n,r.lastChild,o+1);if(l)return r.copy(r.content.replaceChild(r.childCount-1,l));if(r.contentMatchAt(r.childCount).matchType(o==t.length-1?n.type:t[o+1]))return r.copy(r.content.append(te.from(BE(n,t,o+1))))}}function VE(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,VE(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(te.empty,!0);return t.copy(n.append(r))}function Sm(t,e,n,r,o,l){let a=e<0?t.firstChild:t.lastChild,c=a.content;return t.childCount>1&&(l=0),o<r-1&&(c=Sm(c,e,n,r,o+1,l)),o>=n&&(c=e<0?a.contentMatchAt(0).fillBefore(c,l<=o).append(c):c.append(a.contentMatchAt(a.childCount).fillBefore(te.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,a.copy(c))}function px(t,e,n){return e<t.openStart&&(t=new ue(Sm(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new ue(Sm(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const FE={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 mx=null;function PE(){return mx||(mx=document.implementation.createHTMLDocument("title"))}let Mp=null;function uI(t){let e=window.trustedTypes;return e?(Mp||(Mp=e.defaultPolicy||e.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),Mp.createHTML(t)):t}function cI(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=PE().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),o;if((o=r&&FE[r[1].toLowerCase()])&&(t=o.map(l=>"<"+l+">").join("")+t+o.map(l=>"</"+l+">").reverse().join("")),n.innerHTML=uI(t),o)for(let l=0;l<o.length;l++)n=n.querySelector(o[l])||n;return n}function fI(t){let e=t.querySelectorAll(Vt?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<e.length;n++){let r=e[n];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),r)}}function dI(t,e){if(!t.size)return t;let n=t.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return t}let{content:o,openStart:l,openEnd:a}=t;for(let c=r.length-2;c>=0;c-=2){let d=n.nodes[r[c]];if(!d||d.hasRequiredAttrs())break;o=te.from(d.create(r[c+1],o)),l++,a++}return new ue(o,l,a)}const nn={},rn={},hI={touchstart:!0,touchmove:!0};class pI{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 mI(t){for(let e in nn){let n=nn[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{yI(t,r)&&!dg(t,r)&&(t.editable||!(r.type in rn))&&n(t,r)},hI[e]?{passive:!0}:void 0)}qt&&t.dom.addEventListener("input",()=>null),xm(t)}function Ri(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function gI(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function xm(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>dg(t,r))})}function dg(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function yI(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function vI(t,e){!dg(t,e)&&nn[e.type]&&(t.editable||!(e.type in rn))&&nn[e.type](t,e)}rn.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!HE(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(Br&&Vt&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),Hs&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",o=>o(t,co(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||sI(t,n)?n.preventDefault():Ri(t,"key")};rn.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};rn.keypress=(t,e)=>{let n=e;if(HE(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||Vn&&n.metaKey)return;if(t.someProp("handleKeyPress",o=>o(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof Oe)||!r.$from.sameParent(r.$to)){let o=String.fromCharCode(n.charCode),l=()=>t.state.tr.insertText(o).scrollIntoView();!/[\r\n]/.test(o)&&!t.someProp("handleTextInput",a=>a(t,r.$from.pos,r.$to.pos,o,l))&&t.dispatch(l()),n.preventDefault()}};function xf(t){return{left:t.clientX,top:t.clientY}}function bI(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function hg(t,e,n,r,o){if(r==-1)return!1;let l=t.state.doc.resolve(r);for(let a=l.depth+1;a>0;a--)if(t.someProp(e,c=>a>l.depth?c(t,n,l.nodeAfter,l.before(a),o,!0):c(t,n,l.node(a),l.before(a),o,!1)))return!0;return!1}function Is(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let r=t.state.tr.setSelection(e);r.setMeta("pointer",!0),t.dispatch(r)}function SI(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&be.isSelectable(r)?(Is(t,new be(n)),!0):!1}function xI(t,e){if(e==-1)return!1;let n=t.state.selection,r,o;n instanceof be&&(r=n.node);let l=t.state.doc.resolve(e);for(let a=l.depth+1;a>0;a--){let c=a>l.depth?l.nodeAfter:l.node(a);if(be.isSelectable(c)){r&&n.$from.depth>0&&a>=n.$from.depth&&l.before(n.$from.depth+1)==n.$from.pos?o=l.before(n.$from.depth):o=l.before(a);break}}return o!=null?(Is(t,be.create(t.state.doc,o)),!0):!1}function wI(t,e,n,r,o){return hg(t,"handleClickOn",e,n,r)||t.someProp("handleClick",l=>l(t,e,r))||(o?xI(t,n):SI(t,n))}function CI(t,e,n,r){return hg(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",o=>o(t,e,r))}function MI(t,e,n,r){return hg(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",o=>o(t,e,r))||EI(t,n,r)}function EI(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(Is(t,Oe.create(r,0,r.content.size)),!0):!1;let o=r.resolve(e);for(let l=o.depth+1;l>0;l--){let a=l>o.depth?o.nodeAfter:o.node(l),c=o.before(l);if(a.inlineContent)Is(t,Oe.create(r,c+1,c+1+a.content.size));else if(be.isSelectable(a))Is(t,be.create(r,c));else continue;return!0}}function pg(t){return Pc(t)}const $E=Vn?"metaKey":"ctrlKey";nn.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=pg(t),o=Date.now(),l="singleClick";o-t.input.lastClick.time<500&&bI(n,t.input.lastClick)&&!n[$E]&&t.input.lastClick.button==n.button&&(t.input.lastClick.type=="singleClick"?l="doubleClick":t.input.lastClick.type=="doubleClick"&&(l="tripleClick")),t.input.lastClick={time:o,x:n.clientX,y:n.clientY,type:l,button:n.button};let a=t.posAtCoords(xf(n));a&&(l=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new RI(t,a,n,!!r)):(l=="doubleClick"?CI:MI)(t,a.pos,a.inside,n)?n.preventDefault():Ri(t,"pointer"))};class RI{constructor(e,n,r,o){this.view=e,this.pos=n,this.event=r,this.flushed=o,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[$E],this.allowDefault=r.shiftKey;let l,a;if(n.inside>-1)l=e.state.doc.nodeAt(n.inside),a=n.inside;else{let p=e.state.doc.resolve(n.pos);l=p.parent,a=p.depth?p.before():0}const c=o?null:r.target,d=c?e.docView.nearestDesc(c,!0):null;this.target=d&&d.nodeDOM.nodeType==1?d.nodeDOM:null;let{selection:h}=e.state;(r.button==0&&l.type.spec.draggable&&l.type.spec.selectable!==!1||h instanceof be&&h.from<=a&&h.to>a)&&(this.mightDrag={node:l,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&$n&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),Ri(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>Vr(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(xf(e))),this.updateAllowDefault(e),this.allowDefault||!n?Ri(this.view,"pointer"):wI(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||qt&&this.mightDrag&&!this.mightDrag.node.isAtom||Vt&&!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)?(Is(this.view,ze.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):Ri(this.view,"pointer")}move(e){this.updateAllowDefault(e),Ri(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}nn.touchstart=t=>{t.input.lastTouch=Date.now(),pg(t),Ri(t,"pointer")};nn.touchmove=t=>{t.input.lastTouch=Date.now(),Ri(t,"pointer")};nn.contextmenu=t=>pg(t);function HE(t,e){return t.composing?!0:qt&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const TI=Br?5e3:-1;rn.compositionstart=rn.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof Oe&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)||Vt&&SE&&AI(t)))t.markCursor=t.state.storedMarks||n.marks(),Pc(t,!0),t.markCursor=null;else if(Pc(t,!e.selection.empty),$n&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let o=r.focusNode,l=r.focusOffset;o&&o.nodeType==1&&l!=0;){let a=l<0?o.lastChild:o.childNodes[l-1];if(!a)break;if(a.nodeType==3){let c=t.domSelection();c&&c.collapse(a,a.nodeValue.length);break}else o=a,l=-1}}t.input.composing=!0}UE(t,TI)};function AI(t){let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(!e||e.nodeType!=1||n>=e.childNodes.length)return!1;let r=e.childNodes[n];return r.nodeType==1&&r.contentEditable=="false"}rn.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.badSafariComposition?t.domObserver.forceFlush():t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,UE(t,20))};function UE(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>Pc(t),e))}function qE(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=kI());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function OI(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=xB(e.focusNode,e.focusOffset),r=wB(e.focusNode,e.focusOffset);if(n&&r&&n!=r){let o=r.pmViewDesc,l=t.domObserver.lastChangedTextNode;if(n==l||r==l)return l;if(!o||!o.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let a=n.pmViewDesc;if(!(!a||!a.isText(n.nodeValue)))return r}}return n||r}function kI(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function Pc(t,e=!1){if(!(Br&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),qE(t),e||t.docView&&t.docView.dirty){let n=ug(t),r=t.state.selection;return n&&!n.eq(r)?t.dispatch(t.state.tr.setSelection(n)):(t.markCursor||e)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function NI(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),o=document.createRange();o.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}const pa=dn&&Oi<15||Hs&&RB<604;nn.copy=rn.cut=(t,e)=>{let n=e,r=t.state.selection,o=n.type=="cut";if(r.empty)return;let l=pa?null:n.clipboardData,a=r.content(),{dom:c,text:d}=fg(t,a);l?(n.preventDefault(),l.clearData(),l.setData("text/html",c.innerHTML),l.setData("text/plain",d)):NI(t,c),o&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function DI(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function _I(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let o=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?ma(t,r.value,null,o,e):ma(t,r.textContent,r.innerHTML,o,e)},50)}function ma(t,e,n,r,o){let l=LE(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",d=>d(t,o,l||ue.empty)))return!0;if(!l)return!1;let a=DI(l),c=a?t.state.tr.replaceSelectionWith(a,r):t.state.tr.replaceSelection(l);return t.dispatch(c.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function GE(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}rn.paste=(t,e)=>{let n=e;if(t.composing&&!Br)return;let r=pa?null:n.clipboardData,o=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&ma(t,GE(r),r.getData("text/html"),o,n)?n.preventDefault():_I(t,n)};class KE{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const zI=Vn?"altKey":"ctrlKey";function YE(t,e){let n=t.someProp("dragCopies",r=>!r(e));return n??!e[zI]}nn.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let o=t.state.selection,l=o.empty?null:t.posAtCoords(xf(n)),a;if(!(l&&l.pos>=o.from&&l.pos<=(o instanceof be?o.to-1:o.to))){if(r&&r.mightDrag)a=be.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let g=t.docView.nearestDesc(n.target,!0);g&&g.node.type.spec.draggable&&g!=t.docView&&(a=be.create(t.state.doc,g.posBefore))}}let c=(a||t.state.selection).content(),{dom:d,text:h,slice:p}=fg(t,c);(!n.dataTransfer.files.length||!Vt||bE>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(pa?"Text":"text/html",d.innerHTML),n.dataTransfer.effectAllowed="copyMove",pa||n.dataTransfer.setData("text/plain",h),t.dragging=new KE(p,YE(t,n),a)};nn.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};rn.dragover=rn.dragenter=(t,e)=>e.preventDefault();rn.drop=(t,e)=>{try{jI(t,e,t.dragging)}finally{t.dragging=null}};function jI(t,e,n){if(!e.dataTransfer)return;let r=t.posAtCoords(xf(e));if(!r)return;let o=t.state.doc.resolve(r.pos),l=n&&n.slice;l?t.someProp("transformPasted",v=>{l=v(l,t,!1)}):l=LE(t,GE(e.dataTransfer),pa?null:e.dataTransfer.getData("text/html"),!1,o);let a=!!(n&&YE(t,e));if(t.someProp("handleDrop",v=>v(t,e,l||ue.empty,a))){e.preventDefault();return}if(!l)return;e.preventDefault();let c=l?ZM(t.state.doc,o.pos,l):o.pos;c==null&&(c=o.pos);let d=t.state.tr;if(a){let{node:v}=n;v?v.replace(d):d.deleteSelection()}let h=d.mapping.map(c),p=l.openStart==0&&l.openEnd==0&&l.content.childCount==1,g=d.doc;if(p?d.replaceRangeWith(h,h,l.content.firstChild):d.replaceRange(h,h,l),d.doc.eq(g))return;let b=d.doc.resolve(h);if(p&&be.isSelectable(l.content.firstChild)&&b.nodeAfter&&b.nodeAfter.sameMarkup(l.content.firstChild))d.setSelection(new be(b));else{let v=d.mapping.map(c);d.mapping.maps[d.mapping.maps.length-1].forEach((S,x,C,E)=>v=E),d.setSelection(cg(t,b,d.doc.resolve(v)))}t.focus(),t.dispatch(d.setMeta("uiEvent","drop"))}nn.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&Vr(t)},20))};nn.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)};nn.beforeinput=(t,e)=>{if(Vt&&Br&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",l=>l(t,co(8,"Backspace")))))return;let{$cursor:o}=t.state.selection;o&&o.pos>0&&t.dispatch(t.state.tr.delete(o.pos-1,o.pos).scrollIntoView())},50)}};for(let t in rn)nn[t]=rn[t];function ga(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class $c{constructor(e,n){this.toDOM=e,this.spec=n||vo,this.side=this.spec.side||0}map(e,n,r,o){let{pos:l,deleted:a}=e.mapResult(n.from+o,this.side<0?-1:1);return a?null:new Ut(l-r,l-r,this)}valid(){return!0}eq(e){return this==e||e instanceof $c&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&ga(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Ni{constructor(e,n){this.attrs=e,this.spec=n||vo}map(e,n,r,o){let l=e.map(n.from+o,this.spec.inclusiveStart?-1:1)-r,a=e.map(n.to+o,this.spec.inclusiveEnd?1:-1)-r;return l>=a?null:new Ut(l,a,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof Ni&&ga(this.attrs,e.attrs)&&ga(this.spec,e.spec)}static is(e){return e.type instanceof Ni}destroy(){}}class mg{constructor(e,n){this.attrs=e,this.spec=n||vo}map(e,n,r,o){let l=e.mapResult(n.from+o,1);if(l.deleted)return null;let a=e.mapResult(n.to+o,-1);return a.deleted||a.pos<=l.pos?null:new Ut(l.pos-r,a.pos-r,this)}valid(e,n){let{index:r,offset:o}=e.content.findIndex(n.from),l;return o==n.from&&!(l=e.child(r)).isText&&o+l.nodeSize==n.to}eq(e){return this==e||e instanceof mg&&ga(this.attrs,e.attrs)&&ga(this.spec,e.spec)}destroy(){}}class Ut{constructor(e,n,r){this.from=e,this.to=n,this.type=r}copy(e,n){return new Ut(e,n,this.type)}eq(e,n=0){return this.type.eq(e.type)&&this.from+n==e.from&&this.to+n==e.to}map(e,n,r){return this.type.map(e,this,n,r)}static widget(e,n,r){return new Ut(e,e,new $c(n,r))}static inline(e,n,r,o){return new Ut(e,n,new Ni(r,o))}static node(e,n,r,o){return new Ut(e,n,new mg(r,o))}get spec(){return this.type.spec}get inline(){return this.type instanceof Ni}get widget(){return this.type instanceof $c}}const ks=[],vo={};class ot{constructor(e,n){this.local=e.length?e:ks,this.children=n.length?n:ks}static create(e,n){return n.length?Hc(n,e,0,vo):Ht}find(e,n,r){let o=[];return this.findInner(e??0,n??1e9,o,0,r),o}findInner(e,n,r,o,l){for(let a=0;a<this.local.length;a++){let c=this.local[a];c.from<=n&&c.to>=e&&(!l||l(c.spec))&&r.push(c.copy(c.from+o,c.to+o))}for(let a=0;a<this.children.length;a+=3)if(this.children[a]<n&&this.children[a+1]>e){let c=this.children[a]+1;this.children[a+2].findInner(e-c,n-c,r,o+c,l)}}map(e,n,r){return this==Ht||e.maps.length==0?this:this.mapInner(e,n,0,0,r||vo)}mapInner(e,n,r,o,l){let a;for(let c=0;c<this.local.length;c++){let d=this.local[c].map(e,r,o);d&&d.type.valid(n,d)?(a||(a=[])).push(d):l.onRemove&&l.onRemove(this.local[c].spec)}return this.children.length?LI(this.children,a||[],e,n,r,o,l):a?new ot(a.sort(bo),ks):Ht}add(e,n){return n.length?this==Ht?ot.create(e,n):this.addInner(e,n,0):this}addInner(e,n,r){let o,l=0;e.forEach((c,d)=>{let h=d+r,p;if(p=JE(n,c,h)){for(o||(o=this.children.slice());l<o.length&&o[l]<d;)l+=3;o[l]==d?o[l+2]=o[l+2].addInner(c,p,h+1):o.splice(l,0,d,d+c.nodeSize,Hc(p,c,h+1,vo)),l+=3}});let a=XE(l?QE(n):n,-r);for(let c=0;c<a.length;c++)a[c].type.valid(e,a[c])||a.splice(c--,1);return new ot(a.length?this.local.concat(a).sort(bo):this.local,o||this.children)}remove(e){return e.length==0||this==Ht?this:this.removeInner(e,0)}removeInner(e,n){let r=this.children,o=this.local;for(let l=0;l<r.length;l+=3){let a,c=r[l]+n,d=r[l+1]+n;for(let p=0,g;p<e.length;p++)(g=e[p])&&g.from>c&&g.to<d&&(e[p]=null,(a||(a=[])).push(g));if(!a)continue;r==this.children&&(r=this.children.slice());let h=r[l+2].removeInner(a,c+1);h!=Ht?r[l+2]=h:(r.splice(l,3),l-=3)}if(o.length){for(let l=0,a;l<e.length;l++)if(a=e[l])for(let c=0;c<o.length;c++)o[c].eq(a,n)&&(o==this.local&&(o=this.local.slice()),o.splice(c--,1))}return r==this.children&&o==this.local?this:o.length||r.length?new ot(o,r):Ht}forChild(e,n){if(this==Ht)return this;if(n.isLeaf)return ot.empty;let r,o;for(let c=0;c<this.children.length;c+=3)if(this.children[c]>=e){this.children[c]==e&&(r=this.children[c+2]);break}let l=e+1,a=l+n.content.size;for(let c=0;c<this.local.length;c++){let d=this.local[c];if(d.from<a&&d.to>l&&d.type instanceof Ni){let h=Math.max(l,d.from)-l,p=Math.min(a,d.to)-l;h<p&&(o||(o=[])).push(d.copy(h,p))}}if(o){let c=new ot(o.sort(bo),ks);return r?new Ci([c,r]):c}return r||Ht}eq(e){if(this==e)return!0;if(!(e instanceof ot)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(e.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=e.children[n]||this.children[n+1]!=e.children[n+1]||!this.children[n+2].eq(e.children[n+2]))return!1;return!0}locals(e){return gg(this.localsInner(e))}localsInner(e){if(this==Ht)return ks;if(e.inlineContent||!this.local.some(Ni.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof Ni||n.push(this.local[r]);return n}forEachSet(e){e(this)}}ot.empty=new ot([],[]);ot.removeOverlap=gg;const Ht=ot.empty;class Ci{constructor(e){this.members=e}map(e,n){const r=this.members.map(o=>o.map(e,n,vo));return Ci.from(r)}forChild(e,n){if(n.isLeaf)return ot.empty;let r=[];for(let o=0;o<this.members.length;o++){let l=this.members[o].forChild(e,n);l!=Ht&&(l instanceof Ci?r=r.concat(l.members):r.push(l))}return Ci.from(r)}eq(e){if(!(e instanceof Ci)||e.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(e.members[n]))return!1;return!0}locals(e){let n,r=!0;for(let o=0;o<this.members.length;o++){let l=this.members[o].localsInner(e);if(l.length)if(!n)n=l;else{r&&(n=n.slice(),r=!1);for(let a=0;a<l.length;a++)n.push(l[a])}}return n?gg(r?n:n.sort(bo)):ks}static from(e){switch(e.length){case 0:return Ht;case 1:return e[0];default:return new Ci(e.every(n=>n instanceof ot)?e:e.reduce((n,r)=>n.concat(r instanceof ot?r:r.members),[]))}}forEachSet(e){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(e)}}function LI(t,e,n,r,o,l,a){let c=t.slice();for(let h=0,p=l;h<n.maps.length;h++){let g=0;n.maps[h].forEach((b,v,S,x)=>{let C=x-S-(v-b);for(let E=0;E<c.length;E+=3){let A=c[E+1];if(A<0||b>A+p-g)continue;let k=c[E]+p-g;v>=k?c[E+1]=b<=k?-2:-1:b>=p&&C&&(c[E]+=C,c[E+1]+=C)}g+=C}),p=n.maps[h].map(p,-1)}let d=!1;for(let h=0;h<c.length;h+=3)if(c[h+1]<0){if(c[h+1]==-2){d=!0,c[h+1]=-1;continue}let p=n.map(t[h]+l),g=p-o;if(g<0||g>=r.content.size){d=!0;continue}let b=n.map(t[h+1]+l,-1),v=b-o,{index:S,offset:x}=r.content.findIndex(g),C=r.maybeChild(S);if(C&&x==g&&x+C.nodeSize==v){let E=c[h+2].mapInner(n,C,p+1,t[h]+l+1,a);E!=Ht?(c[h]=g,c[h+1]=v,c[h+2]=E):(c[h+1]=-2,d=!0)}else d=!0}if(d){let h=BI(c,t,e,n,o,l,a),p=Hc(h,r,0,a);e=p.local;for(let g=0;g<c.length;g+=3)c[g+1]<0&&(c.splice(g,3),g-=3);for(let g=0,b=0;g<p.children.length;g+=3){let v=p.children[g];for(;b<c.length&&c[b]<v;)b+=3;c.splice(b,0,p.children[g],p.children[g+1],p.children[g+2])}}return new ot(e.sort(bo),c)}function XE(t,e){if(!e||!t.length)return t;let n=[];for(let r=0;r<t.length;r++){let o=t[r];n.push(new Ut(o.from+e,o.to+e,o.type))}return n}function BI(t,e,n,r,o,l,a){function c(d,h){for(let p=0;p<d.local.length;p++){let g=d.local[p].map(r,o,h);g?n.push(g):a.onRemove&&a.onRemove(d.local[p].spec)}for(let p=0;p<d.children.length;p+=3)c(d.children[p+2],d.children[p]+h+1)}for(let d=0;d<t.length;d+=3)t[d+1]==-1&&c(t[d+2],e[d]+l+1);return n}function JE(t,e,n){if(e.isLeaf)return null;let r=n+e.nodeSize,o=null;for(let l=0,a;l<t.length;l++)(a=t[l])&&a.from>n&&a.to<r&&((o||(o=[])).push(a),t[l]=null);return o}function QE(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function Hc(t,e,n,r){let o=[],l=!1;e.forEach((c,d)=>{let h=JE(t,c,d+n);if(h){l=!0;let p=Hc(h,c,n+d+1,r);p!=Ht&&o.push(d,d+c.nodeSize,p)}});let a=XE(l?QE(t):t,-n).sort(bo);for(let c=0;c<a.length;c++)a[c].type.valid(e,a[c])||(r.onRemove&&r.onRemove(a[c].spec),a.splice(c--,1));return a.length||o.length?new ot(a,o):Ht}function bo(t,e){return t.from-e.from||t.to-e.to}function gg(t){let e=t;for(let n=0;n<e.length-1;n++){let r=e[n];if(r.from!=r.to)for(let o=n+1;o<e.length;o++){let l=e[o];if(l.from==r.from){l.to!=r.to&&(e==t&&(e=t.slice()),e[o]=l.copy(l.from,r.to),gx(e,o+1,l.copy(r.to,l.to)));continue}else{l.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,l.from),gx(e,o,r.copy(l.from,r.to)));break}}}return e}function gx(t,e,n){for(;e<t.length&&bo(n,t[e])>0;)e++;t.splice(e,0,n)}function Ep(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=Ht&&e.push(r)}),t.cursorWrapper&&e.push(ot.create(t.state.doc,[t.cursorWrapper.deco])),Ci.from(e)}const II={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},VI=dn&&Oi<=11;class FI{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class PI{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new FI,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let o=0;o<r.length;o++)this.queue.push(r[o]);dn&&Oi<=11&&r.some(o=>o.type=="childList"&&o.removedNodes.length||o.type=="characterData"&&o.oldValue.length>o.target.nodeValue.length)?this.flushSoon():qt&&e.composing&&r.some(o=>o.type=="childList"&&o.target.nodeName=="TR")?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),VI&&(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,II)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let n=0;n<e.length;n++)this.queue.push(e[n]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(ax(this.view)){if(this.suppressingSelectionUpdates)return Vr(this.view);if(dn&&Oi<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Mo(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let n=new Set,r;for(let l=e.focusNode;l;l=$s(l))n.add(l);for(let l=e.anchorNode;l;l=$s(l))if(n.has(l)){r=l;break}let o=r&&this.view.docView.nearestDesc(r);if(o&&o.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=e.domSelectionRange(),o=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&ax(e)&&!this.ignoreSelectionChange(r),l=-1,a=-1,c=!1,d=[];if(e.editable)for(let p=0;p<n.length;p++){let g=this.registerMutation(n[p],d);g&&(l=l<0?g.from:Math.min(g.from,l),a=a<0?g.to:Math.max(g.to,a),g.typeOver&&(c=!0))}if(d.some(p=>p.nodeName=="BR")&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46)){for(let p of d)if(p.nodeName=="BR"&&p.parentNode){let g=p.nextSibling;for(;g&&g.nodeType==1;){if(g.contentEditable=="false"){p.parentNode.removeChild(p);break}g=g.firstChild}}}else if($n&&d.length){let p=d.filter(g=>g.nodeName=="BR");if(p.length==2){let[g,b]=p;g.parentNode&&g.parentNode.parentNode==b.parentNode?b.remove():g.remove()}else{let{focusNode:g}=this.currentSelection;for(let b of p){let v=b.parentNode;v&&v.nodeName=="LI"&&(!g||UI(e,g)!=v)&&b.remove()}}}let h=null;l<0&&o&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&bf(r)&&(h=ug(e))&&h.eq(ze.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Vr(e),this.currentSelection.set(r),e.scrollToSelection()):(l>-1||o)&&(l>-1&&(e.docView.markDirty(l,a),$I(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,qI(e,d)),this.handleDOMChange(l,a,c,d),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||Vr(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let p=0;p<e.addedNodes.length;p++){let g=e.addedNodes[p];n.push(g),g.nodeType==3&&(this.lastChangedTextNode=g)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return{from:r.posBefore,to:r.posAfter};let o=e.previousSibling,l=e.nextSibling;if(dn&&Oi<=11&&e.addedNodes.length)for(let p=0;p<e.addedNodes.length;p++){let{previousSibling:g,nextSibling:b}=e.addedNodes[p];(!g||Array.prototype.indexOf.call(e.addedNodes,g)<0)&&(o=g),(!b||Array.prototype.indexOf.call(e.addedNodes,b)<0)&&(l=b)}let a=o&&o.parentNode==e.target?Bt(o)+1:0,c=r.localPosFromDOM(e.target,a,-1),d=l&&l.parentNode==e.target?Bt(l):e.target.childNodes.length,h=r.localPosFromDOM(e.target,d,1);return{from:c,to:h}}else return e.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:(this.lastChangedTextNode=e.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let yx=new WeakMap,vx=!1;function $I(t){if(!yx.has(t)&&(yx.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=$n,vx)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."),vx=!0}}function bx(t,e){let n=e.startContainer,r=e.startOffset,o=e.endContainer,l=e.endOffset,a=t.domAtPos(t.state.selection.anchor);return Mo(a.node,a.offset,o,l)&&([n,r,o,l]=[o,l,n,r]),{anchorNode:n,anchorOffset:r,focusNode:o,focusOffset:l}}function HI(t,e){if(e.getComposedRanges){let o=e.getComposedRanges(t.root)[0];if(o)return bx(t,o)}let n;function r(o){o.preventDefault(),o.stopImmediatePropagation(),n=o.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",r,!0),n?bx(t,n):null}function UI(t,e){for(let n=e.parentNode;n&&n!=t.dom;n=n.parentNode){let r=t.docView.nearestDesc(n,!0);if(r&&r.node.isBlock)return n}return null}function qI(t,e){var n;let{focusNode:r,focusOffset:o}=t.domSelectionRange();for(let l of e)if(((n=l.parentNode)===null||n===void 0?void 0:n.nodeName)=="TR"){let a=l.nextSibling;for(;a&&a.nodeName!="TD"&&a.nodeName!="TH";)a=a.nextSibling;if(a){let c=a;for(;;){let d=c.firstChild;if(!d||d.nodeType!=1||d.contentEditable=="false"||/^(BR|IMG)$/.test(d.nodeName))break;c=d}c.insertBefore(l,c.firstChild),r==l&&t.domSelection().collapse(l,o)}else l.parentNode.removeChild(l)}}function GI(t,e,n){let{node:r,fromOffset:o,toOffset:l,from:a,to:c}=t.docView.parseRange(e,n),d=t.domSelectionRange(),h,p=d.anchorNode;if(p&&t.dom.contains(p.nodeType==1?p:p.parentNode)&&(h=[{node:p,offset:d.anchorOffset}],bf(d)||h.push({node:d.focusNode,offset:d.focusOffset})),Vt&&t.input.lastKeyCode===8)for(let C=l;C>o;C--){let E=r.childNodes[C-1],A=E.pmViewDesc;if(E.nodeName=="BR"&&!A){l=C;break}if(!A||A.size)break}let g=t.state.doc,b=t.someProp("domParser")||Ai.fromSchema(t.state.schema),v=g.resolve(a),S=null,x=b.parse(r,{topNode:v.parent,topMatch:v.parent.contentMatchAt(v.index()),topOpen:!0,from:o,to:l,preserveWhitespace:v.parent.type.whitespace=="pre"?"full":!0,findPositions:h,ruleFromNode:KI,context:v});if(h&&h[0].pos!=null){let C=h[0].pos,E=h[1]&&h[1].pos;E==null&&(E=C),S={anchor:C+a,head:E+a}}return{doc:x,sel:S,from:a,to:c}}function KI(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(qt&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(t.parentNode.lastChild==t||qt&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}const YI=/^(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 XI(t,e,n,r,o){let l=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let z=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,j=ug(t,z);if(j&&!t.state.selection.eq(j)){if(Vt&&Br&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",le=>le(t,co(13,"Enter"))))return;let J=t.state.tr.setSelection(j);z=="pointer"?J.setMeta("pointer",!0):z=="key"&&J.scrollIntoView(),l&&J.setMeta("composition",l),t.dispatch(J)}return}let a=t.state.doc.resolve(e),c=a.sharedDepth(n);e=a.before(c+1),n=t.state.doc.resolve(n).after(c+1);let d=t.state.selection,h=GI(t,e,n),p=t.state.doc,g=p.slice(h.from,h.to),b,v;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(b=t.state.selection.to,v="end"):(b=t.state.selection.from,v="start"),t.input.lastKeyCode=null;let S=ZI(g.content,h.doc.content,h.from,b,v);if(S&&t.input.domChangeCount++,(Hs&&t.input.lastIOSEnter>Date.now()-225||Br)&&o.some(z=>z.nodeType==1&&!YI.test(z.nodeName))&&(!S||S.endA>=S.endB)&&t.someProp("handleKeyDown",z=>z(t,co(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!S)if(r&&d instanceof Oe&&!d.empty&&d.$head.sameParent(d.$anchor)&&!t.composing&&!(h.sel&&h.sel.anchor!=h.sel.head))S={start:d.from,endA:d.to,endB:d.to};else{if(h.sel){let z=Sx(t,t.state.doc,h.sel);if(z&&!z.eq(t.state.selection)){let j=t.state.tr.setSelection(z);l&&j.setMeta("composition",l),t.dispatch(j)}}return}t.state.selection.from<t.state.selection.to&&S.start==S.endB&&t.state.selection instanceof Oe&&(S.start>t.state.selection.from&&S.start<=t.state.selection.from+2&&t.state.selection.from>=h.from?S.start=t.state.selection.from:S.endA<t.state.selection.to&&S.endA>=t.state.selection.to-2&&t.state.selection.to<=h.to&&(S.endB+=t.state.selection.to-S.endA,S.endA=t.state.selection.to)),dn&&Oi<=11&&S.endB==S.start+1&&S.endA==S.start&&S.start>h.from&&h.doc.textBetween(S.start-h.from-1,S.start-h.from+1)==" "&&(S.start--,S.endA--,S.endB--);let x=h.doc.resolveNoCache(S.start-h.from),C=h.doc.resolveNoCache(S.endB-h.from),E=p.resolve(S.start),A=x.sameParent(C)&&x.parent.inlineContent&&E.end()>=S.endA;if((Hs&&t.input.lastIOSEnter>Date.now()-225&&(!A||o.some(z=>z.nodeName=="DIV"||z.nodeName=="P"))||!A&&x.pos<h.doc.content.size&&(!x.sameParent(C)||!x.parent.inlineContent)&&x.pos<C.pos&&!/\S/.test(h.doc.textBetween(x.pos,C.pos,"","")))&&t.someProp("handleKeyDown",z=>z(t,co(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>S.start&&QI(p,S.start,S.endA,x,C)&&t.someProp("handleKeyDown",z=>z(t,co(8,"Backspace")))){Br&&Vt&&t.domObserver.suppressSelectionUpdates();return}Vt&&S.endB==S.start&&(t.input.lastChromeDelete=Date.now()),Br&&!A&&x.start()!=C.start()&&C.parentOffset==0&&x.depth==C.depth&&h.sel&&h.sel.anchor==h.sel.head&&h.sel.head==S.endA&&(S.endB-=2,C=h.doc.resolveNoCache(S.endB-h.from),setTimeout(()=>{t.someProp("handleKeyDown",function(z){return z(t,co(13,"Enter"))})},20));let k=S.start,D=S.endA,L=z=>{let j=z||t.state.tr.replace(k,D,h.doc.slice(S.start-h.from,S.endB-h.from));if(h.sel){let J=Sx(t,j.doc,h.sel);J&&!(Vt&&t.composing&&J.empty&&(S.start!=S.endB||t.input.lastChromeDelete<Date.now()-100)&&(J.head==k||J.head==j.mapping.map(D)-1)||dn&&J.empty&&J.head==k)&&j.setSelection(J)}return l&&j.setMeta("composition",l),j.scrollIntoView()},H;if(A)if(x.pos==C.pos){dn&&Oi<=11&&x.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Vr(t),20));let z=L(t.state.tr.delete(k,D)),j=p.resolve(S.start).marksAcross(p.resolve(S.endA));j&&z.ensureMarks(j),t.dispatch(z)}else if(S.endA==S.endB&&(H=JI(x.parent.content.cut(x.parentOffset,C.parentOffset),E.parent.content.cut(E.parentOffset,S.endA-E.start())))){let z=L(t.state.tr);H.type=="add"?z.addMark(k,D,H.mark):z.removeMark(k,D,H.mark),t.dispatch(z)}else if(x.parent.child(x.index()).isText&&x.index()==C.index()-(C.textOffset?0:1)){let z=x.parent.textBetween(x.parentOffset,C.parentOffset),j=()=>L(t.state.tr.insertText(z,k,D));t.someProp("handleTextInput",J=>J(t,k,D,z,j))||t.dispatch(j())}else t.dispatch(L());else t.dispatch(L())}function Sx(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:cg(t,e.resolve(n.anchor),e.resolve(n.head))}function JI(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,o=n,l=r,a,c,d;for(let p=0;p<r.length;p++)o=r[p].removeFromSet(o);for(let p=0;p<n.length;p++)l=n[p].removeFromSet(l);if(o.length==1&&l.length==0)c=o[0],a="add",d=p=>p.mark(c.addToSet(p.marks));else if(o.length==0&&l.length==1)c=l[0],a="remove",d=p=>p.mark(c.removeFromSet(p.marks));else return null;let h=[];for(let p=0;p<e.childCount;p++)h.push(d(e.child(p)));if(te.from(h).eq(t))return{mark:c,type:a}}function QI(t,e,n,r,o){if(n-e<=o.pos-r.pos||Rp(r,!0,!1)<o.pos)return!1;let l=t.resolve(e);if(!r.parent.isTextblock){let c=l.nodeAfter;return c!=null&&n==e+c.nodeSize}if(l.parentOffset<l.parent.content.size||!l.parent.isTextblock)return!1;let a=t.resolve(Rp(l,!0,!0));return!a.parent.isTextblock||a.pos>n||Rp(a,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(a.parent.content)}function Rp(t,e,n){let r=t.depth,o=e?t.end():t.pos;for(;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,o++,e=!1;if(n){let l=t.node(r).maybeChild(t.indexAfter(r));for(;l&&!l.isLeaf;)l=l.firstChild,o++}return o}function ZI(t,e,n,r,o){let l=t.findDiffStart(e,n);if(l==null)return null;let{a,b:c}=t.findDiffEnd(e,n+t.size,n+e.size);if(o=="end"){let d=Math.max(0,l-Math.min(a,c));r-=a+d-l}if(a<l&&t.size<e.size){let d=r<=l&&r>=a?l-r:0;l-=d,l&&l<e.size&&xx(e.textBetween(l-1,l+1))&&(l+=d?1:-1),c=l+(c-a),a=l}else if(c<l){let d=r<=l&&r>=c?l-r:0;l-=d,l&&l<t.size&&xx(t.textBetween(l-1,l+1))&&(l+=d?1:-1),a=l+(a-c),c=l}return{start:l,endA:a,endB:c}}function xx(t){if(t.length!=2)return!1;let e=t.charCodeAt(0),n=t.charCodeAt(1);return e>=56320&&e<=57343&&n>=55296&&n<=56319}class ZE{constructor(e,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new pI,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(Rx),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=Mx(this),Cx(this),this.nodeViews=Ex(this),this.docView=nx(this.state.doc,wx(this),Ep(this),this.dom,this),this.domObserver=new PI(this,(r,o,l,a)=>XI(this,r,o,l,a)),this.domObserver.start(),mI(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&xm(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Rx),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in e)n[r]=e[r];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){var r;let o=this.state,l=!1,a=!1;e.storedMarks&&this.composing&&(qE(this),a=!0),this.state=e;let c=o.plugins!=e.plugins||this._props.plugins!=n.plugins;if(c||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let v=Ex(this);eV(v,this.nodeViews)&&(this.nodeViews=v,l=!0)}(c||n.handleDOMEvents!=this._props.handleDOMEvents)&&xm(this),this.editable=Mx(this),Cx(this);let d=Ep(this),h=wx(this),p=o.plugins!=e.plugins&&!o.doc.eq(e.doc)?"reset":e.scrollToSelection>o.scrollToSelection?"to selection":"preserve",g=l||!this.docView.matchesNode(e.doc,h,d);(g||!e.selection.eq(o.selection))&&(a=!0);let b=p=="preserve"&&a&&this.dom.style.overflowAnchor==null&&OB(this);if(a){this.domObserver.stop();let v=g&&(dn||Vt)&&!this.composing&&!o.selection.empty&&!e.selection.empty&&WI(o.selection,e.selection);if(g){let S=Vt?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=OI(this)),(l||!this.docView.update(e.doc,h,d,this))&&(this.docView.updateOuterDeco(h),this.docView.destroy(),this.docView=nx(e.doc,h,d,this.dom,this)),S&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(v=!0)}v||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&WB(this))?Vr(this,v):(_E(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(o),!((r=this.dragging)===null||r===void 0)&&r.node&&!o.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,o),p=="reset"?this.dom.scrollTop=0:p=="to selection"?this.scrollToSelection():b&&kB(b)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))){if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof be){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&JS(this,n.getBoundingClientRect(),e)}else JS(this,this.coordsAtPos(this.state.selection.head,1),e)}}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let r=this.state.plugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,e)}}updateDraggedNode(e,n){let r=e.node,o=-1;if(r.from<this.state.doc.content.size&&this.state.doc.nodeAt(r.from)==r.node)o=r.from;else{let l=r.from+(this.state.doc.content.size-n.doc.content.size);(l>0&&l<this.state.doc.content.size&&this.state.doc.nodeAt(l))==r.node&&(o=l)}this.dragging=new KE(e.slice,e.move,o<0?void 0:be.create(this.state.doc,o))}someProp(e,n){let r=this._props&&this._props[e],o;if(r!=null&&(o=n?n(r):r))return o;for(let a=0;a<this.directPlugins.length;a++){let c=this.directPlugins[a].props[e];if(c!=null&&(o=n?n(c):c))return o}let l=this.state.plugins;if(l)for(let a=0;a<l.length;a++){let c=l[a].props[e];if(c!=null&&(o=n?n(c):c))return o}}hasFocus(){if(dn){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&NB(this.dom),Vr(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return e||document}updateRoot(){this._root=null}posAtCoords(e){return LB(this,e)}coordsAtPos(e,n=1){return EE(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,r=-1){let o=this.docView.posFromDOM(e,n,r);if(o==null)throw new RangeError("DOM position not inside the editor");return o}endOfTextblock(e,n){return PB(this,n||this.state,e)}pasteHTML(e,n){return ma(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return ma(this,e,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(e){return fg(this,e)}destroy(){this.docView&&(gI(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Ep(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,bB())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return vI(this,e)}domSelectionRange(){let e=this.domSelection();return e?qt&&this.root.nodeType===11&&MB(this.dom.ownerDocument)==this.dom&&HI(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}ZE.prototype.dispatch=function(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))};function wx(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let r in n)r=="class"?e.class+=" "+n[r]:r=="style"?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(n[r]))}),e.translate||(e.translate="no"),[Ut.node(0,t.state.doc.content.size,e)]}function Cx(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:Ut.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function Mx(t){return!t.someProp("editable",e=>e(t.state)===!1)}function WI(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function Ex(t){let e=Object.create(null);function n(r){for(let o in r)Object.prototype.hasOwnProperty.call(e,o)||(e[o]=r[o])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function eV(t,e){let n=0,r=0;for(let o in t){if(t[o]!=e[o])return!0;n++}for(let o in e)r++;return n!=r}function Rx(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var Li={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Uc={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},tV=typeof navigator<"u"&&/Mac/.test(navigator.platform),nV=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var It=0;It<10;It++)Li[48+It]=Li[96+It]=String(It);for(var It=1;It<=24;It++)Li[It+111]="F"+It;for(var It=65;It<=90;It++)Li[It]=String.fromCharCode(It+32),Uc[It]=String.fromCharCode(It);for(var Tp in Li)Uc.hasOwnProperty(Tp)||(Uc[Tp]=Li[Tp]);function rV(t){var e=tV&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||nV&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Uc:Li)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const iV=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),oV=typeof navigator<"u"&&/Win/.test(navigator.platform);function sV(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,o,l,a;for(let c=0;c<e.length-1;c++){let d=e[c];if(/^(cmd|meta|m)$/i.test(d))a=!0;else if(/^a(lt)?$/i.test(d))r=!0;else if(/^(c|ctrl|control)$/i.test(d))o=!0;else if(/^s(hift)?$/i.test(d))l=!0;else if(/^mod$/i.test(d))iV?a=!0:o=!0;else throw new Error("Unrecognized modifier name: "+d)}return r&&(n="Alt-"+n),o&&(n="Ctrl-"+n),a&&(n="Meta-"+n),l&&(n="Shift-"+n),n}function lV(t){let e=Object.create(null);for(let n in t)e[sV(n)]=t[n];return e}function Ap(t,e,n=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n&&e.shiftKey&&(t="Shift-"+t),t}function aV(t){return new bt({props:{handleKeyDown:WE(t)}})}function WE(t){let e=lV(t);return function(n,r){let o=rV(r),l,a=e[Ap(o,r)];if(a&&a(n.state,n.dispatch,n))return!0;if(o.length==1&&o!=" "){if(r.shiftKey){let c=e[Ap(o,r,!1)];if(c&&c(n.state,n.dispatch,n))return!0}if((r.altKey||r.metaKey||r.ctrlKey)&&!(oV&&r.ctrlKey&&r.altKey)&&(l=Li[r.keyCode])&&l!=o){let c=e[Ap(l,r)];if(c&&c(n.state,n.dispatch,n))return!0}}return!1}}var uV=Object.defineProperty,yg=(t,e)=>{for(var n in e)uV(t,n,{get:e[n],enumerable:!0})};function wf(t){const{state:e,transaction:n}=t;let{selection:r}=n,{doc:o}=n,{storedMarks:l}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return l},get selection(){return r},get doc(){return o},get tr(){return r=n.selection,o=n.doc,l=n.storedMarks,n}}}var Cf=class{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:t,editor:e,state:n}=this,{view:r}=e,{tr:o}=n,l=this.buildProps(o);return Object.fromEntries(Object.entries(t).map(([a,c])=>[a,(...h)=>{const p=c(...h)(l);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&r.dispatch(o),p}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,e=!0){const{rawCommands:n,editor:r,state:o}=this,{view:l}=r,a=[],c=!!t,d=t||o.tr,h=()=>(!c&&e&&!d.getMeta("preventDispatch")&&!this.hasCustomState&&l.dispatch(d),a.every(g=>g===!0)),p={...Object.fromEntries(Object.entries(n).map(([g,b])=>[g,(...S)=>{const x=this.buildProps(d,e),C=b(...S)(x);return a.push(C),p}])),run:h};return p}createCan(t){const{rawCommands:e,state:n}=this,r=!1,o=t||n.tr,l=this.buildProps(o,r);return{...Object.fromEntries(Object.entries(e).map(([c,d])=>[c,(...h)=>d(...h)({...l,dispatch:void 0})])),chain:()=>this.createChain(o,r)}}buildProps(t,e=!0){const{rawCommands:n,editor:r,state:o}=this,{view:l}=r,a={tr:t,editor:r,view:l,state:wf({state:o,transaction:t}),dispatch:e?()=>{}:void 0,chain:()=>this.createChain(t,e),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(n).map(([c,d])=>[c,(...h)=>d(...h)(a)]))}};return a}},eR={};yg(eR,{blur:()=>cV,clearContent:()=>fV,clearNodes:()=>dV,command:()=>hV,createParagraphNear:()=>pV,cut:()=>mV,deleteCurrentNode:()=>gV,deleteNode:()=>yV,deleteRange:()=>vV,deleteSelection:()=>bV,enter:()=>SV,exitCode:()=>xV,extendMarkRange:()=>wV,first:()=>CV,focus:()=>EV,forEach:()=>RV,insertContent:()=>TV,insertContentAt:()=>kV,joinBackward:()=>_V,joinDown:()=>DV,joinForward:()=>zV,joinItemBackward:()=>jV,joinItemForward:()=>LV,joinTextblockBackward:()=>BV,joinTextblockForward:()=>IV,joinUp:()=>NV,keyboardShortcut:()=>FV,lift:()=>PV,liftEmptyBlock:()=>$V,liftListItem:()=>HV,newlineInCode:()=>UV,resetAttributes:()=>qV,scrollIntoView:()=>GV,selectAll:()=>KV,selectNodeBackward:()=>YV,selectNodeForward:()=>XV,selectParentNode:()=>JV,selectTextblockEnd:()=>QV,selectTextblockStart:()=>ZV,setContent:()=>WV,setMark:()=>S4,setMeta:()=>x4,setNode:()=>w4,setNodeSelection:()=>C4,setTextDirection:()=>M4,setTextSelection:()=>E4,sinkListItem:()=>R4,splitBlock:()=>T4,splitListItem:()=>A4,toggleList:()=>O4,toggleMark:()=>k4,toggleNode:()=>N4,toggleWrap:()=>D4,undoInputRule:()=>_4,unsetAllMarks:()=>z4,unsetMark:()=>j4,unsetTextDirection:()=>L4,updateAttributes:()=>B4,wrapIn:()=>I4,wrapInList:()=>V4});var cV=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window?.getSelection())==null||n.removeAllRanges())}),!0),fV=(t=!0)=>({commands:e})=>e.setContent("",{emitUpdate:t}),dV=()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:o}=r;return n&&o.forEach(({$from:l,$to:a})=>{t.doc.nodesBetween(l.pos,a.pos,(c,d)=>{if(c.type.isText)return;const{doc:h,mapping:p}=e,g=h.resolve(p.map(d)),b=h.resolve(p.map(d+c.nodeSize)),v=g.blockRange(b);if(!v)return;const S=Xs(v);if(c.type.isTextblock){const{defaultType:x}=g.parent.contentMatchAt(g.index());e.setNodeMarkup(v.start,x)}(S||S===0)&&e.lift(v,S)})}),!0},hV=t=>e=>t(e),pV=()=>({state:t,dispatch:e})=>pE(t,e),mV=(t,e)=>({editor:n,tr:r})=>{const{state:o}=n,l=o.doc.slice(t.from,t.to);r.deleteRange(t.from,t.to);const a=r.mapping.map(e);return r.insert(a,l.content),r.setSelection(new Oe(r.doc.resolve(Math.max(a-1,0)))),!0},gV=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;const o=t.selection.$anchor;for(let l=o.depth;l>0;l-=1)if(o.node(l).type===r.type){if(e){const c=o.before(l),d=o.after(l);t.delete(c,d).scrollIntoView()}return!0}return!1};function Ot(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}var yV=t=>({tr:e,state:n,dispatch:r})=>{const o=Ot(t,n.schema),l=e.selection.$anchor;for(let a=l.depth;a>0;a-=1)if(l.node(a).type===o){if(r){const d=l.before(a),h=l.after(a);e.delete(d,h).scrollIntoView()}return!0}return!1},vV=t=>({tr:e,dispatch:n})=>{const{from:r,to:o}=t;return n&&e.delete(r,o),!0},bV=()=>({state:t,dispatch:e})=>rg(t,e),SV=()=>({commands:t})=>t.keyboardShortcut("Enter"),xV=()=>({state:t,dispatch:e})=>iB(t,e);function vg(t){return Object.prototype.toString.call(t)==="[object RegExp]"}function qc(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(o=>n.strict?e[o]===t[o]:vg(e[o])?e[o].test(t[o]):e[o]===t[o]):!0}function tR(t,e,n={}){return t.find(r=>r.type===e&&qc(Object.fromEntries(Object.keys(n).map(o=>[o,r.attrs[o]])),n))}function Tx(t,e,n={}){return!!tR(t,e,n)}function nR(t,e,n){var r;if(!t||!e)return;let o=t.parent.childAfter(t.parentOffset);if((!o.node||!o.node.marks.some(p=>p.type===e))&&(o=t.parent.childBefore(t.parentOffset)),!o.node||!o.node.marks.some(p=>p.type===e)||(n=n||((r=o.node.marks[0])==null?void 0:r.attrs),!tR([...o.node.marks],e,n)))return;let a=o.index,c=t.start()+o.offset,d=a+1,h=c+o.node.nodeSize;for(;a>0&&Tx([...t.parent.child(a-1).marks],e,n);)a-=1,c-=t.parent.child(a).nodeSize;for(;d<t.parent.childCount&&Tx([...t.parent.child(d).marks],e,n);)h+=t.parent.child(d).nodeSize,d+=1;return{from:c,to:h}}function Hr(t,e){if(typeof t=="string"){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}var wV=(t,e={})=>({tr:n,state:r,dispatch:o})=>{const l=Hr(t,r.schema),{doc:a,selection:c}=n,{$from:d,from:h,to:p}=c;if(o){const g=nR(d,l,e);if(g&&g.from<=h&&g.to>=p){const b=Oe.create(a,g.from,g.to);n.setSelection(b)}}return!0},CV=t=>e=>{const n=typeof t=="function"?t(e):t;for(let r=0;r<n.length;r+=1)if(n[r](e))return!0;return!1};function rR(t){return t instanceof Oe}function mo(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function iR(t,e=null){if(!e)return null;const n=ze.atStart(t),r=ze.atEnd(t);if(e==="start"||e===!0)return n;if(e==="end")return r;const o=n.from,l=r.to;return e==="all"?Oe.create(t,mo(0,o,l),mo(t.content.size,o,l)):Oe.create(t,mo(e,o,l),mo(e,o,l))}function Ax(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function Gc(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function MV(){return typeof navigator<"u"?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}var EV=(t=null,e={})=>({editor:n,view:r,tr:o,dispatch:l})=>{e={scrollIntoView:!0,...e};const a=()=>{(Gc()||Ax())&&r.dom.focus(),MV()&&!Gc()&&!Ax()&&r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),e?.scrollIntoView&&n.commands.scrollIntoView())})};try{if(r.hasFocus()&&t===null||t===!1)return!0}catch{return!1}if(l&&t===null&&!rR(n.state.selection))return a(),!0;const c=iR(o.doc,t)||n.state.selection,d=n.state.selection.eq(c);return l&&(d||o.setSelection(c),d&&o.storedMarks&&o.setStoredMarks(o.storedMarks),a()),!0},RV=(t,e)=>n=>t.every((r,o)=>e(r,{...n,index:o})),TV=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),oR=t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const r=e[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?t.removeChild(r):r.nodeType===1&&oR(r)}return t};function fc(t){if(typeof window>"u")throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const e=`<body>${t}</body>`,n=new window.DOMParser().parseFromString(e,"text/html").body;return oR(n)}function ya(t,e,n){if(t instanceof Ti||t instanceof te)return t;n={slice:!0,parseOptions:{},...n};const r=typeof t=="object"&&t!==null,o=typeof t=="string";if(r)try{if(Array.isArray(t)&&t.length>0)return te.fromArray(t.map(c=>e.nodeFromJSON(c)));const a=e.nodeFromJSON(t);return n.errorOnInvalidContent&&a.check(),a}catch(l){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:l});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",l),ya("",e,n)}if(o){if(n.errorOnInvalidContent){let a=!1,c="";const d=new FM({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:h=>(a=!0,c=typeof h=="string"?h:h.outerHTML,null)}]}})});if(n.slice?Ai.fromSchema(d).parseSlice(fc(t),n.parseOptions):Ai.fromSchema(d).parse(fc(t),n.parseOptions),n.errorOnInvalidContent&&a)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${c}`)})}const l=Ai.fromSchema(e);return n.slice?l.parseSlice(fc(t),n.parseOptions).content:l.parse(fc(t),n.parseOptions)}return ya("",e,n)}function AV(t,e,n){const r=t.steps.length-1;if(r<e)return;const o=t.steps[r];if(!(o instanceof Rt||o instanceof Tt))return;const l=t.mapping.maps[r];let a=0;l.forEach((c,d,h,p)=>{a===0&&(a=p)}),t.setSelection(ze.near(t.doc.resolve(a),n))}var OV=t=>!("type"in t),kV=(t,e,n)=>({tr:r,dispatch:o,editor:l})=>{var a;if(o){n={parseOptions:l.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let c;const d=C=>{l.emit("contentError",{editor:l,error:C,disableCollaboration:()=>{"collaboration"in l.storage&&typeof l.storage.collaboration=="object"&&l.storage.collaboration&&(l.storage.collaboration.isDisabled=!0)}})},h={preserveWhitespace:"full",...n.parseOptions};if(!n.errorOnInvalidContent&&!l.options.enableContentCheck&&l.options.emitContentError)try{ya(e,l.schema,{parseOptions:h,errorOnInvalidContent:!0})}catch(C){d(C)}try{c=ya(e,l.schema,{parseOptions:h,errorOnInvalidContent:(a=n.errorOnInvalidContent)!=null?a:l.options.enableContentCheck})}catch(C){return d(C),!1}let{from:p,to:g}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},b=!0,v=!0;if((OV(c)?c:[c]).forEach(C=>{C.check(),b=b?C.isText&&C.marks.length===0:!1,v=v?C.isBlock:!1}),p===g&&v){const{parent:C}=r.doc.resolve(p);C.isTextblock&&!C.type.spec.code&&!C.childCount&&(p-=1,g+=1)}let x;if(b){if(Array.isArray(e))x=e.map(C=>C.text||"").join("");else if(e instanceof te){let C="";e.forEach(E=>{E.text&&(C+=E.text)}),x=C}else typeof e=="object"&&e&&e.text?x=e.text:x=e;r.insertText(x,p,g)}else{x=c;const C=r.doc.resolve(p),E=C.node(),A=C.parentOffset===0,k=E.isText||E.isTextblock,D=E.content.size>0;A&&k&&D&&(p=Math.max(0,p-1)),r.replaceWith(p,g,x)}n.updateSelection&&AV(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:p,text:x}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:p,text:x})}return!0},NV=()=>({state:t,dispatch:e})=>tB(t,e),DV=()=>({state:t,dispatch:e})=>nB(t,e),_V=()=>({state:t,dispatch:e})=>lE(t,e),zV=()=>({state:t,dispatch:e})=>fE(t,e),jV=()=>({state:t,dispatch:e,tr:n})=>{try{const r=gf(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},LV=()=>({state:t,dispatch:e,tr:n})=>{try{const r=gf(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},BV=()=>({state:t,dispatch:e})=>WL(t,e),IV=()=>({state:t,dispatch:e})=>eB(t,e);function sR(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function VV(t){const e=t.split(/-(?!$)/);let n=e[e.length-1];n==="Space"&&(n=" ");let r,o,l,a;for(let c=0;c<e.length-1;c+=1){const d=e[c];if(/^(cmd|meta|m)$/i.test(d))a=!0;else if(/^a(lt)?$/i.test(d))r=!0;else if(/^(c|ctrl|control)$/i.test(d))o=!0;else if(/^s(hift)?$/i.test(d))l=!0;else if(/^mod$/i.test(d))Gc()||sR()?a=!0:o=!0;else throw new Error(`Unrecognized modifier name: ${d}`)}return r&&(n=`Alt-${n}`),o&&(n=`Ctrl-${n}`),a&&(n=`Meta-${n}`),l&&(n=`Shift-${n}`),n}var FV=t=>({editor:e,view:n,tr:r,dispatch:o})=>{const l=VV(t).split(/-(?!$)/),a=l.find(h=>!["Alt","Ctrl","Meta","Shift"].includes(h)),c=new KeyboardEvent("keydown",{key:a==="Space"?" ":a,altKey:l.includes("Alt"),ctrlKey:l.includes("Ctrl"),metaKey:l.includes("Meta"),shiftKey:l.includes("Shift"),bubbles:!0,cancelable:!0}),d=e.captureTransaction(()=>{n.someProp("handleKeyDown",h=>h(n,c))});return d?.steps.forEach(h=>{const p=h.map(r.mapping);p&&o&&r.maybeStep(p)}),!0};function va(t,e,n={}){const{from:r,to:o,empty:l}=t.selection,a=e?Ot(e,t.schema):null,c=[];t.doc.nodesBetween(r,o,(g,b)=>{if(g.isText)return;const v=Math.max(r,b),S=Math.min(o,b+g.nodeSize);c.push({node:g,from:v,to:S})});const d=o-r,h=c.filter(g=>a?a.name===g.node.type.name:!0).filter(g=>qc(g.node.attrs,n,{strict:!1}));return l?!!h.length:h.reduce((g,b)=>g+b.to-b.from,0)>=d}var PV=(t,e={})=>({state:n,dispatch:r})=>{const o=Ot(t,n.schema);return va(n,o,e)?rB(n,r):!1},$V=()=>({state:t,dispatch:e})=>mE(t,e),HV=t=>({state:e,dispatch:n})=>{const r=Ot(t,e.schema);return mB(r)(e,n)},UV=()=>({state:t,dispatch:e})=>hE(t,e);function Mf(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function Ox(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,o)=>(n.includes(o)||(r[o]=t[o]),r),{})}var qV=(t,e)=>({tr:n,state:r,dispatch:o})=>{let l=null,a=null;const c=Mf(typeof t=="string"?t:t.name,r.schema);if(!c)return!1;c==="node"&&(l=Ot(t,r.schema)),c==="mark"&&(a=Hr(t,r.schema));let d=!1;return n.selection.ranges.forEach(h=>{r.doc.nodesBetween(h.$from.pos,h.$to.pos,(p,g)=>{l&&l===p.type&&(d=!0,o&&n.setNodeMarkup(g,void 0,Ox(p.attrs,e))),a&&p.marks.length&&p.marks.forEach(b=>{a===b.type&&(d=!0,o&&n.addMark(g,g+p.nodeSize,a.create(Ox(b.attrs,e))))})})}),d},GV=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),KV=()=>({tr:t,dispatch:e})=>{if(e){const n=new En(t.doc);t.setSelection(n)}return!0},YV=()=>({state:t,dispatch:e})=>uE(t,e),XV=()=>({state:t,dispatch:e})=>dE(t,e),JV=()=>({state:t,dispatch:e})=>lB(t,e),QV=()=>({state:t,dispatch:e})=>cB(t,e),ZV=()=>({state:t,dispatch:e})=>uB(t,e);function wm(t,e,n={},r={}){return ya(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var WV=(t,{errorOnInvalidContent:e,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:o,tr:l,dispatch:a,commands:c})=>{const{doc:d}=l;if(r.preserveWhitespace!=="full"){const h=wm(t,o.schema,r,{errorOnInvalidContent:e??o.options.enableContentCheck});return a&&l.replaceWith(0,d.content.size,h).setMeta("preventUpdate",!n),!0}return a&&l.setMeta("preventUpdate",!n),c.insertContentAt({from:0,to:d.content.size},t,{parseOptions:r,errorOnInvalidContent:e??o.options.enableContentCheck})};function lR(t,e){const n=Hr(e,t.schema),{from:r,to:o,empty:l}=t.selection,a=[];l?(t.storedMarks&&a.push(...t.storedMarks),a.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,o,d=>{a.push(...d.marks)});const c=a.find(d=>d.type.name===n.name);return c?{...c.attrs}:{}}function e4(t,e){const n=new rE(t);return e.forEach(r=>{r.steps.forEach(o=>{n.step(o)})}),n}function t4(t){for(let e=0;e<t.edgeCount;e+=1){const{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function n4(t,e){for(let n=t.depth;n>0;n-=1){const r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}function bg(t){return e=>n4(e.$from,t)}function ye(t,e,n){return t.config[e]===void 0&&t.parent?ye(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?ye(t.parent,e,n):null}):t.config[e]}function Sg(t){return t.map(e=>{const n={name:e.name,options:e.options,storage:e.storage},r=ye(e,"addExtensions",n);return r?[e,...Sg(r())]:e}).flat(10)}function xg(t,e){const n=Ao.fromSchema(e).serializeFragment(t),o=document.implementation.createHTMLDocument().createElement("div");return o.appendChild(n),o.innerHTML}function aR(t){return typeof t=="function"}function it(t,e=void 0,...n){return aR(t)?e?t.bind(e)(...n):t(...n):t}function r4(t={}){return Object.keys(t).length===0&&t.constructor===Object}function Us(t){const e=t.filter(o=>o.type==="extension"),n=t.filter(o=>o.type==="node"),r=t.filter(o=>o.type==="mark");return{baseExtensions:e,nodeExtensions:n,markExtensions:r}}function uR(t){const e=[],{nodeExtensions:n,markExtensions:r}=Us(t),o=[...n,...r],l={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},a=n.filter(h=>h.name!=="text").map(h=>h.name),c=r.map(h=>h.name),d=[...a,...c];return t.forEach(h=>{const p={name:h.name,options:h.options,storage:h.storage,extensions:o},g=ye(h,"addGlobalAttributes",p);if(!g)return;g().forEach(v=>{let S;Array.isArray(v.types)?S=v.types:v.types==="*"?S=d:v.types==="nodes"?S=a:v.types==="marks"?S=c:S=[],S.forEach(x=>{Object.entries(v.attributes).forEach(([C,E])=>{e.push({type:x,name:C,attribute:{...l,...E}})})})})}),o.forEach(h=>{const p={name:h.name,options:h.options,storage:h.storage},g=ye(h,"addAttributes",p);if(!g)return;const b=g();Object.entries(b).forEach(([v,S])=>{const x={...l,...S};typeof x?.default=="function"&&(x.default=x.default()),x?.isRequired&&x?.default===void 0&&delete x.default,e.push({type:h.name,name:v,attribute:x})})}),e}function i4(t){const e=[];let n="",r=!1,o=!1,l=0;const a=t.length;for(let c=0;c<a;c+=1){const d=t[c];if(d==="'"&&!o){r=!r,n+=d;continue}if(d==='"'&&!r){o=!o,n+=d;continue}if(!r&&!o){if(d==="("){l+=1,n+=d;continue}if(d===")"&&l>0){l-=1,n+=d;continue}if(d===";"&&l===0){e.push(n),n="";continue}}n+=d}return n&&e.push(n),e}function kx(t){const e=[],n=i4(t||""),r=n.length;for(let o=0;o<r;o+=1){const l=n[o],a=l.indexOf(":");if(a===-1)continue;const c=l.slice(0,a).trim(),d=l.slice(a+1).trim();c&&d&&e.push([c,d])}return e}function cR(...t){return t.filter(e=>!!e).reduce((e,n)=>{const r={...e};return Object.entries(n).forEach(([o,l])=>{if(!r[o]){r[o]=l;return}if(o==="class"){const c=l?String(l).split(" "):[],d=r[o]?r[o].split(" "):[],h=c.filter(p=>!d.includes(p));r[o]=[...d,...h].join(" ")}else if(o==="style"){const c=new Map([...kx(r[o]),...kx(l)]);r[o]=Array.from(c.entries()).map(([d,h])=>`${d}: ${h}`).join("; ")}else r[o]=l}),r},{})}function Kc(t,e){return e.filter(n=>n.type===t.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,r)=>cR(n,r),{})}function o4(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function Nx(t,e){return"style"in t?t:{...t,getAttrs:n=>{const r=t.getAttrs?t.getAttrs(n):t.attrs;if(r===!1)return!1;const o=e.reduce((l,a)=>{const c=a.attribute.parseHTML?a.attribute.parseHTML(n):o4(n.getAttribute(a.name));return c==null?l:{...l,[a.name]:c}},{});return{...r,...o}}}}function Dx(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&r4(n)?!1:n!=null))}function _x(t){var e,n;const r={};return!((e=t?.attribute)!=null&&e.isRequired)&&"default"in(t?.attribute||{})&&(r.default=t.attribute.default),((n=t?.attribute)==null?void 0:n.validate)!==void 0&&(r.validate=t.attribute.validate),[t.name,r]}function s4(t,e){var n;const r=uR(t),{nodeExtensions:o,markExtensions:l}=Us(t),a=(n=o.find(h=>ye(h,"topNode")))==null?void 0:n.name,c=Object.fromEntries(o.map(h=>{const p=r.filter(E=>E.type===h.name),g={name:h.name,options:h.options,storage:h.storage,editor:e},b=t.reduce((E,A)=>{const k=ye(A,"extendNodeSchema",g);return{...E,...k?k(h):{}}},{}),v=Dx({...b,content:it(ye(h,"content",g)),marks:it(ye(h,"marks",g)),group:it(ye(h,"group",g)),inline:it(ye(h,"inline",g)),atom:it(ye(h,"atom",g)),selectable:it(ye(h,"selectable",g)),draggable:it(ye(h,"draggable",g)),code:it(ye(h,"code",g)),whitespace:it(ye(h,"whitespace",g)),linebreakReplacement:it(ye(h,"linebreakReplacement",g)),defining:it(ye(h,"defining",g)),isolating:it(ye(h,"isolating",g)),attrs:Object.fromEntries(p.map(_x))}),S=it(ye(h,"parseHTML",g));S&&(v.parseDOM=S.map(E=>Nx(E,p)));const x=ye(h,"renderHTML",g);x&&(v.toDOM=E=>x({node:E,HTMLAttributes:Kc(E,p)}));const C=ye(h,"renderText",g);return C&&(v.toText=C),[h.name,v]})),d=Object.fromEntries(l.map(h=>{const p=r.filter(C=>C.type===h.name),g={name:h.name,options:h.options,storage:h.storage,editor:e},b=t.reduce((C,E)=>{const A=ye(E,"extendMarkSchema",g);return{...C,...A?A(h):{}}},{}),v=Dx({...b,inclusive:it(ye(h,"inclusive",g)),excludes:it(ye(h,"excludes",g)),group:it(ye(h,"group",g)),spanning:it(ye(h,"spanning",g)),code:it(ye(h,"code",g)),attrs:Object.fromEntries(p.map(_x))}),S=it(ye(h,"parseHTML",g));S&&(v.parseDOM=S.map(C=>Nx(C,p)));const x=ye(h,"renderHTML",g);return x&&(v.toDOM=C=>x({mark:C,HTMLAttributes:Kc(C,p)})),[h.name,v]}));return new FM({topNode:a,nodes:c,marks:d})}function l4(t){const e=t.filter((n,r)=>t.indexOf(n)!==r);return Array.from(new Set(e))}function ra(t){return t.sort((n,r)=>{const o=ye(n,"priority")||100,l=ye(r,"priority")||100;return o>l?-1:o<l?1:0})}function fR(t){const e=ra(Sg(t)),n=l4(e.map(r=>r.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(r=>`'${r}'`).join(", ")}]. This can lead to issues.`),e}function dR(t,e,n){const{from:r,to:o}=e,{blockSeparator:l=`
|
|
65
|
+
|
|
66
|
+
`,textSerializers:a={}}=n||{};let c="";return t.nodesBetween(r,o,(d,h,p,g)=>{var b;d.isBlock&&h>r&&(c+=l);const v=a?.[d.type.name];if(v)return p&&(c+=v({node:d,pos:h,parent:p,index:g,range:e})),!1;d.isText&&(c+=(b=d?.text)==null?void 0:b.slice(Math.max(r,h)-h,o-h))}),c}function a4(t,e){const n={from:0,to:t.content.size};return dR(t,n,e)}function hR(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}function u4(t,e){const n=Ot(e,t.schema),{from:r,to:o}=t.selection,l=[];t.doc.nodesBetween(r,o,c=>{l.push(c)});const a=l.reverse().find(c=>c.type.name===n.name);return a?{...a.attrs}:{}}function c4(t,e){const n=Mf(typeof e=="string"?e:e.name,t.schema);return n==="node"?u4(t,e):n==="mark"?lR(t,e):{}}function f4(t,e=JSON.stringify){const n={};return t.filter(r=>{const o=e(r);return Object.prototype.hasOwnProperty.call(n,o)?!1:n[o]=!0})}function d4(t){const e=f4(t);return e.length===1?e:e.filter((n,r)=>!e.filter((l,a)=>a!==r).some(l=>n.oldRange.from>=l.oldRange.from&&n.oldRange.to<=l.oldRange.to&&n.newRange.from>=l.newRange.from&&n.newRange.to<=l.newRange.to))}function h4(t){const{mapping:e,steps:n}=t,r=[];return e.maps.forEach((o,l)=>{const a=[];if(o.ranges.length)o.forEach((c,d)=>{a.push({from:c,to:d})});else{const{from:c,to:d}=n[l];if(c===void 0||d===void 0)return;a.push({from:c,to:d})}a.forEach(({from:c,to:d})=>{const h=e.slice(l).map(c,-1),p=e.slice(l).map(d),g=e.invert().map(h,-1),b=e.invert().map(p);r.push({oldRange:{from:g,to:b},newRange:{from:h,to:p}})})}),d4(r)}function ql(t,e){return e.nodes[t]||e.marks[t]||null}function Cc(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const o=t.find(l=>l.type===e&&l.name===r);return o?o.attribute.keepOnSplit:!1}))}var p4=(t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(o,l,a,c)=>{var d,h;const p=((h=(d=o.type.spec).toText)==null?void 0:h.call(d,{node:o,pos:l,parent:a,index:c}))||o.textContent||"%leaf%";n+=o.isAtom&&!o.isText?p:p.slice(0,Math.max(0,r-l))}),n};function Cm(t,e,n={}){const{empty:r,ranges:o}=t.selection,l=e?Hr(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(g=>l?l.name===g.type.name:!0).find(g=>qc(g.attrs,n,{strict:!1}));let a=0;const c=[];if(o.forEach(({$from:g,$to:b})=>{const v=g.pos,S=b.pos;t.doc.nodesBetween(v,S,(x,C)=>{if(l&&x.inlineContent&&!x.type.allowsMarkType(l))return!1;if(!x.isText&&!x.marks.length)return;const E=Math.max(v,C),A=Math.min(S,C+x.nodeSize),k=A-E;a+=k,c.push(...x.marks.map(D=>({mark:D,from:E,to:A})))})}),a===0)return!1;const d=c.filter(g=>l?l.name===g.mark.type.name:!0).filter(g=>qc(g.mark.attrs,n,{strict:!1})).reduce((g,b)=>g+b.to-b.from,0),h=c.filter(g=>l?g.mark.type!==l&&g.mark.type.excludes(l):!0).reduce((g,b)=>g+b.to-b.from,0);return(d>0?d+h:d)>=a}function m4(t,e,n={}){if(!e)return va(t,null,n)||Cm(t,null,n);const r=Mf(e,t.schema);return r==="node"?va(t,e,n):r==="mark"?Cm(t,e,n):!1}function zx(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}function jx(t,e){const{nodeExtensions:n}=Us(e),r=n.find(a=>a.name===t);if(!r)return!1;const o={name:r.name,options:r.options,storage:r.storage},l=it(ye(r,"group",o));return typeof l!="string"?!1:l.split(" ").includes("list")}function Ef(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(t.type.name==="hardBreak")return!0;if(t.isText)return!/\S/.test((r=t.text)!=null?r:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let o=!0;return t.content.forEach(l=>{o!==!1&&(Ef(l,{ignoreWhitespace:n,checkChildren:e})||(o=!1))}),o}return!1}function g4(t){return t instanceof be}var pR=class mR{constructor(e){this.position=e}static fromJSON(e){return new mR(e.position)}toJSON(){return{position:this.position}}};function y4(t,e){const n=e.mapping.mapResult(t.position);return{position:new pR(n.pos),mapResult:n}}function v4(t){return new pR(t)}function b4(t,e,n){var r;const{selection:o}=e;let l=null;if(rR(o)&&(l=o.$cursor),l){const c=(r=t.storedMarks)!=null?r:l.marks();return l.parent.type.allowsMarkType(n)&&(!!n.isInSet(c)||!c.some(h=>h.type.excludes(n)))}const{ranges:a}=o;return a.some(({$from:c,$to:d})=>{let h=c.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(c.pos,d.pos,(p,g,b)=>{if(h)return!1;if(p.isInline){const v=!b||b.type.allowsMarkType(n),S=!!n.isInSet(p.marks)||!p.marks.some(x=>x.type.excludes(n));h=v&&S}return!h}),h})}var S4=(t,e={})=>({tr:n,state:r,dispatch:o})=>{const{selection:l}=n,{empty:a,ranges:c}=l,d=Hr(t,r.schema);if(o)if(a){const h=lR(r,d);n.addStoredMark(d.create({...h,...e}))}else c.forEach(h=>{const p=h.$from.pos,g=h.$to.pos;r.doc.nodesBetween(p,g,(b,v)=>{const S=Math.max(v,p),x=Math.min(v+b.nodeSize,g);b.marks.find(E=>E.type===d)?b.marks.forEach(E=>{d===E.type&&n.addMark(S,x,d.create({...E.attrs,...e}))}):n.addMark(S,x,d.create(e))})});return b4(r,n,d)},x4=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),w4=(t,e={})=>({state:n,dispatch:r,chain:o})=>{const l=Ot(t,n.schema);let a;return n.selection.$anchor.sameParent(n.selection.$head)&&(a=n.selection.$anchor.parent.attrs),l.isTextblock?o().command(({commands:c})=>KS(l,{...a,...e})(n)?!0:c.clearNodes()).command(({state:c})=>KS(l,{...a,...e})(c,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},C4=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,o=mo(t,0,r.content.size),l=be.create(r,o);e.setSelection(l)}return!0},M4=(t,e)=>({tr:n,state:r,dispatch:o})=>{const{selection:l}=r;let a,c;return typeof e=="number"?(a=e,c=e):e&&"from"in e&&"to"in e?(a=e.from,c=e.to):(a=l.from,c=l.to),o&&n.doc.nodesBetween(a,c,(d,h)=>{d.isText||n.setNodeMarkup(h,void 0,{...d.attrs,dir:t})}),!0},E4=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,{from:o,to:l}=typeof t=="number"?{from:t,to:t}:t,a=Oe.atStart(r).from,c=Oe.atEnd(r).to,d=mo(o,a,c),h=mo(l,a,c),p=Oe.create(r,d,h);e.setSelection(p)}return!0},R4=t=>({state:e,dispatch:n})=>{const r=Ot(t,e.schema);return vB(r)(e,n)};function Lx(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter(o=>e?.includes(o.type.name));t.tr.ensureMarks(r)}}var T4=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:o})=>{const{selection:l,doc:a}=e,{$from:c,$to:d}=l,h=o.extensionManager.attributes,p=Cc(h,c.node().type.name,c.node().attrs);if(l instanceof be&&l.node.isBlock)return!c.parentOffset||!Ir(a,c.pos)?!1:(r&&(t&&Lx(n,o.extensionManager.splittableMarks),e.split(c.pos).scrollIntoView()),!0);if(!c.parent.isBlock)return!1;const g=d.parentOffset===d.parent.content.size,b=c.depth===0?void 0:t4(c.node(-1).contentMatchAt(c.indexAfter(-1)));let v=g&&b?[{type:b,attrs:p}]:void 0,S=Ir(e.doc,e.mapping.map(c.pos),1,v);if(!v&&!S&&Ir(e.doc,e.mapping.map(c.pos),1,b?[{type:b}]:void 0)&&(S=!0,v=b?[{type:b,attrs:p}]:void 0),r){if(S&&(l instanceof Oe&&e.deleteSelection(),e.split(e.mapping.map(c.pos),1,v),b&&!g&&!c.parentOffset&&c.parent.type!==b)){const x=e.mapping.map(c.before()),C=e.doc.resolve(x);c.node(-1).canReplaceWith(C.index(),C.index()+1,b)&&e.setNodeMarkup(e.mapping.map(c.before()),b)}t&&Lx(n,o.extensionManager.splittableMarks),e.scrollIntoView()}return S},A4=(t,e={})=>({tr:n,state:r,dispatch:o,editor:l})=>{var a;const c=Ot(t,r.schema),{$from:d,$to:h}=r.selection,p=r.selection.node;if(p&&p.isBlock||d.depth<2||!d.sameParent(h))return!1;const g=d.node(-1);if(g.type!==c)return!1;const b=l.extensionManager.attributes;if(d.parent.content.size===0&&d.node(-1).childCount===d.indexAfter(-1)){if(d.depth===2||d.node(-3).type!==c||d.index(-2)!==d.node(-2).childCount-1)return!1;if(o){let E=te.empty;const A=d.index(-1)?1:d.index(-2)?2:3;for(let j=d.depth-A;j>=d.depth-3;j-=1)E=te.from(d.node(j).copy(E));const k=d.indexAfter(-1)<d.node(-2).childCount?1:d.indexAfter(-2)<d.node(-3).childCount?2:3,D={...Cc(b,d.node().type.name,d.node().attrs),...e},L=((a=c.contentMatch.defaultType)==null?void 0:a.createAndFill(D))||void 0;E=E.append(te.from(c.createAndFill(null,L)||void 0));const H=d.before(d.depth-(A-1));n.replace(H,d.after(-k),new ue(E,4-A,0));let z=-1;n.doc.nodesBetween(H,n.doc.content.size,(j,J)=>{if(z>-1)return!1;j.isTextblock&&j.content.size===0&&(z=J+1)}),z>-1&&n.setSelection(Oe.near(n.doc.resolve(z))),n.scrollIntoView()}return!0}const v=h.pos===d.end()?g.contentMatchAt(0).defaultType:null,S={...Cc(b,g.type.name,g.attrs),...e},x={...Cc(b,d.node().type.name,d.node().attrs),...e};n.delete(d.pos,h.pos);const C=v?[{type:c,attrs:S},{type:v,attrs:x}]:[{type:c,attrs:S}];if(!Ir(n.doc,d.pos,2))return!1;if(o){const{selection:E,storedMarks:A}=r,{splittableMarks:k}=l.extensionManager,D=A||E.$to.parentOffset&&E.$from.marks();if(n.split(d.pos,2,C).scrollIntoView(),!D||!o)return!0;const L=D.filter(H=>k.includes(H.type.name));n.ensureMarks(L)}return!0},Op=(t,e)=>{const n=bg(a=>a.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const o=t.doc.nodeAt(r);return n.node.type===o?.type&&Oo(t.doc,n.pos)&&t.join(n.pos),!0},kp=(t,e)=>{const n=bg(a=>a.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const o=t.doc.nodeAt(r);return n.node.type===o?.type&&Oo(t.doc,r)&&t.join(r),!0},O4=(t,e,n,r={})=>({editor:o,tr:l,state:a,dispatch:c,chain:d,commands:h,can:p})=>{const{extensions:g,splittableMarks:b}=o.extensionManager,v=Ot(t,a.schema),S=Ot(e,a.schema),{selection:x,storedMarks:C}=a,{$from:E,$to:A}=x,k=E.blockRange(A),D=C||x.$to.parentOffset&&x.$from.marks();if(!k)return!1;const L=bg(H=>jx(H.type.name,g))(x);if(k.depth>=1&&L&&k.depth-L.depth<=1){if(L.node.type===v)return h.liftListItem(S);if(jx(L.node.type.name,g)&&v.validContent(L.node.content)&&c)return d().command(()=>(l.setNodeMarkup(L.pos,v),!0)).command(()=>Op(l,v)).command(()=>kp(l,v)).run()}return!n||!D||!c?d().command(()=>p().wrapInList(v,r)?!0:h.clearNodes()).wrapInList(v,r).command(()=>Op(l,v)).command(()=>kp(l,v)).run():d().command(()=>{const H=p().wrapInList(v,r),z=D.filter(j=>b.includes(j.type.name));return l.ensureMarks(z),H?!0:h.clearNodes()}).wrapInList(v,r).command(()=>Op(l,v)).command(()=>kp(l,v)).run()},k4=(t,e={},n={})=>({state:r,commands:o})=>{const{extendEmptyMarkRange:l=!1}=n,a=Hr(t,r.schema);return Cm(r,a,e)?o.unsetMark(a,{extendEmptyMarkRange:l}):o.setMark(a,e)},N4=(t,e,n={})=>({state:r,commands:o})=>{const l=Ot(t,r.schema),a=Ot(e,r.schema),c=va(r,l,n);let d;return r.selection.$anchor.sameParent(r.selection.$head)&&(d=r.selection.$anchor.parent.attrs),c?o.setNode(a,d):o.setNode(l,{...d,...n})},D4=(t,e={})=>({state:n,commands:r})=>{const o=Ot(t,n.schema);return va(n,o,e)?r.lift(o):r.wrapIn(o,e)},_4=()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r<n.length;r+=1){const o=n[r];let l;if(o.spec.isInputRules&&(l=o.getState(t))){if(e){const a=t.tr,c=l.transform;for(let d=c.steps.length-1;d>=0;d-=1)a.step(c.steps[d].invert(c.docs[d]));if(l.text){const d=a.doc.resolve(l.from).marks();a.replaceWith(l.from,l.to,t.schema.text(l.text,d))}else a.delete(l.from,l.to)}return!0}}return!1},z4=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:r,ranges:o}=n;return r||e&&o.forEach(l=>{t.removeMark(l.$from.pos,l.$to.pos)}),!0},j4=(t,e={})=>({tr:n,state:r,dispatch:o})=>{var l;const{extendEmptyMarkRange:a=!1}=e,{selection:c}=n,d=Hr(t,r.schema),{$from:h,empty:p,ranges:g}=c;if(!o)return!0;if(p&&a){let{from:b,to:v}=c;const S=(l=h.marks().find(C=>C.type===d))==null?void 0:l.attrs,x=nR(h,d,S);x&&(b=x.from,v=x.to),n.removeMark(b,v,d)}else g.forEach(b=>{n.removeMark(b.$from.pos,b.$to.pos,d)});return n.removeStoredMark(d),!0},L4=t=>({tr:e,state:n,dispatch:r})=>{const{selection:o}=n;let l,a;return typeof t=="number"?(l=t,a=t):t&&"from"in t&&"to"in t?(l=t.from,a=t.to):(l=o.from,a=o.to),r&&e.doc.nodesBetween(l,a,(c,d)=>{if(c.isText)return;const h={...c.attrs};delete h.dir,e.setNodeMarkup(d,void 0,h)}),!0},B4=(t,e={})=>({tr:n,state:r,dispatch:o})=>{let l=null,a=null;const c=Mf(typeof t=="string"?t:t.name,r.schema);if(!c)return!1;c==="node"&&(l=Ot(t,r.schema)),c==="mark"&&(a=Hr(t,r.schema));let d=!1;return n.selection.ranges.forEach(h=>{const p=h.$from.pos,g=h.$to.pos;let b,v,S,x;n.selection.empty?r.doc.nodesBetween(p,g,(C,E)=>{l&&l===C.type&&(d=!0,S=Math.max(E,p),x=Math.min(E+C.nodeSize,g),b=E,v=C)}):r.doc.nodesBetween(p,g,(C,E)=>{E<p&&l&&l===C.type&&(d=!0,S=Math.max(E,p),x=Math.min(E+C.nodeSize,g),b=E,v=C),E>=p&&E<=g&&(l&&l===C.type&&(d=!0,o&&n.setNodeMarkup(E,void 0,{...C.attrs,...e})),a&&C.marks.length&&C.marks.forEach(A=>{if(a===A.type&&(d=!0,o)){const k=Math.max(E,p),D=Math.min(E+C.nodeSize,g);n.addMark(k,D,a.create({...A.attrs,...e}))}}))}),v&&(b!==void 0&&o&&n.setNodeMarkup(b,void 0,{...v.attrs,...e}),a&&v.marks.length&&v.marks.forEach(C=>{a===C.type&&o&&n.addMark(S,x,a.create({...C.attrs,...e}))}))}),d},I4=(t,e={})=>({state:n,dispatch:r})=>{const o=Ot(t,n.schema);return fB(o,e)(n,r)},V4=(t,e={})=>({state:n,dispatch:r})=>{const o=Ot(t,n.schema);return dB(o,e)(n,r)},F4=class{constructor(){this.callbacks={}}on(t,e){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(e),this}emit(t,...e){const n=this.callbacks[t];return n&&n.forEach(r=>r.apply(this,e)),this}off(t,e){const n=this.callbacks[t];return n&&(e?this.callbacks[t]=n.filter(r=>r!==e):delete this.callbacks[t]),this}once(t,e){const n=(...r)=>{this.off(t,n),e.apply(this,r)};return this.on(t,n)}removeAllListeners(){this.callbacks={}}},P4=(t,e)=>{if(vg(e))return e.exec(t);const n=e(t);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=t,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 dc(t){var e;const{editor:n,from:r,to:o,text:l,rules:a,plugin:c}=t,{view:d}=n;if(d.composing)return!1;const h=d.state.doc.resolve(r);if(h.parent.type.spec.code||(e=h.nodeBefore||h.nodeAfter)!=null&&e.marks.find(b=>b.type.spec.code))return!1;let p=!1;const g=p4(h)+l;return a.forEach(b=>{if(p)return;const v=P4(g,b.find);if(!v)return;const S=d.state.tr,x=wf({state:d.state,transaction:S}),C={from:r-(v[0].length-l.length),to:o},{commands:E,chain:A,can:k}=new Cf({editor:n,state:x});b.handler({state:x,range:C,match:v,commands:E,chain:A,can:k})===null||!S.steps.length||(b.undoable&&S.setMeta(c,{transform:S,from:r,to:o,text:l}),d.dispatch(S),p=!0)}),p}function $4(t){const{editor:e,rules:n}=t,r=new bt({state:{init(){return null},apply(o,l,a){const c=o.getMeta(r);if(c)return c;const d=o.getMeta("applyInputRules");return d&&setTimeout(()=>{let{text:p}=d;typeof p=="string"?p=p:p=xg(te.from(p),a.schema);const{from:g}=d,b=g+p.length;dc({editor:e,from:g,to:b,text:p,rules:n,plugin:r})}),o.selectionSet||o.docChanged?null:l}},props:{handleTextInput(o,l,a,c){return dc({editor:e,from:l,to:a,text:c,rules:n,plugin:r})},handleDOMEvents:{compositionend:o=>(setTimeout(()=>{const{$cursor:l}=o.state.selection;l&&dc({editor:e,from:l.pos,to:l.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(o,l){if(l.key!=="Enter")return!1;const{$cursor:a}=o.state.selection;return a?dc({editor:e,from:a.pos,to:a.pos,text:`
|
|
67
|
+
`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function H4(t){return Object.prototype.toString.call(t).slice(8,-1)}function hc(t){return H4(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function gR(t,e){const n={...t};return hc(t)&&hc(e)&&Object.keys(e).forEach(r=>{hc(e[r])&&hc(t[r])?n[r]=gR(t[r],e[r]):n[r]=e[r]}),n}var wg=class{constructor(t={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...t},this.name=this.config.name}get options(){return{...it(ye(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...it(ye(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(t={}){const e=this.extend({...this.config,addOptions:()=>gR(this.options,t)});return e.name=this.name,e.parent=this.parent,e}extend(t={}){const e=new this.constructor({...this.config,...t});return e.parent=this,this.child=e,e.name="name"in t?t.name:e.parent.name,e}},U4=class yR extends wg{constructor(){super(...arguments),this.type="mark"}static create(e={}){const n=typeof e=="function"?e():e;return new yR(n)}static handleExit({editor:e,mark:n}){const{tr:r}=e.state,o=e.state.selection.$from;if(o.pos===o.end()){const a=o.marks();if(!!!a.find(h=>h?.type.name===n.name))return!1;const d=a.find(h=>h?.type.name===n.name);return d&&r.removeStoredMark(d),r.insertText(" ",o.pos),e.view.dispatch(r),!0}return!1}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}};function q4(t){return typeof t=="number"}var G4=(t,e,n)=>{if(vg(e))return[...t.matchAll(e)];const r=e(t,n);return r?r.map(o=>{const l=[o.text];return l.index=o.index,l.input=t,l.data=o.data,o.replaceWith&&(o.text.includes(o.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),l.push(o.replaceWith)),l}):[]};function K4(t){const{editor:e,state:n,from:r,to:o,rule:l,pasteEvent:a,dropEvent:c}=t,{commands:d,chain:h,can:p}=new Cf({editor:e,state:n}),g=[];return n.doc.nodesBetween(r,o,(v,S)=>{var x,C,E,A,k;if((C=(x=v.type)==null?void 0:x.spec)!=null&&C.code||!(v.isText||v.isTextblock||v.isInline))return;const D=(k=(A=(E=v.content)==null?void 0:E.size)!=null?A:v.nodeSize)!=null?k:0,L=Math.max(r,S),H=Math.min(o,S+D);if(L>=H)return;const z=v.isText?v.text||"":v.textBetween(L-S,H-S,void 0,"");G4(z,l.find,a).forEach(J=>{if(J.index===void 0)return;const le=L+J.index+1,ce=le+J[0].length,se={from:n.tr.mapping.map(le),to:n.tr.mapping.map(ce)},Se=l.handler({state:n,range:se,match:J,commands:d,chain:h,can:p,pasteEvent:a,dropEvent:c});g.push(Se)})}),g.every(v=>v!==null)}var pc=null,Y4=t=>{var e;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=n.clipboardData)==null||e.setData("text/html",t),n};function X4(t){const{editor:e,rules:n}=t;let r=null,o=!1,l=!1,a=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,c;try{c=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{c=null}const d=({state:p,from:g,to:b,rule:v,pasteEvt:S})=>{const x=p.tr,C=wf({state:p,transaction:x});if(!(!K4({editor:e,state:C,from:Math.max(g-1,0),to:b.b-1,rule:v,pasteEvent:S,dropEvent:c})||!x.steps.length)){try{c=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{c=null}return a=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,x}};return n.map(p=>new bt({view(g){const b=S=>{var x;r=(x=g.dom.parentElement)!=null&&x.contains(S.target)?g.dom.parentElement:null,r&&(pc=e)},v=()=>{pc&&(pc=null)};return window.addEventListener("dragstart",b),window.addEventListener("dragend",v),{destroy(){window.removeEventListener("dragstart",b),window.removeEventListener("dragend",v)}}},props:{handleDOMEvents:{drop:(g,b)=>{if(l=r===g.dom.parentElement,c=b,!l){const v=pc;v?.isEditable&&setTimeout(()=>{const S=v.state.selection;S&&v.commands.deleteRange({from:S.from,to:S.to})},10)}return!1},paste:(g,b)=>{var v;const S=(v=b.clipboardData)==null?void 0:v.getData("text/html");return a=b,o=!!S?.includes("data-pm-slice"),!1}}},appendTransaction:(g,b,v)=>{const S=g[0],x=S.getMeta("uiEvent")==="paste"&&!o,C=S.getMeta("uiEvent")==="drop"&&!l,E=S.getMeta("applyPasteRules"),A=!!E;if(!x&&!C&&!A)return;if(A){let{text:L}=E;typeof L=="string"?L=L:L=xg(te.from(L),v.schema);const{from:H}=E,z=H+L.length,j=Y4(L);return d({rule:p,state:v,from:H,to:{b:z},pasteEvt:j})}const k=b.doc.content.findDiffStart(v.doc.content),D=b.doc.content.findDiffEnd(v.doc.content);if(!(!q4(k)||!D||k===D.b))return d({rule:p,state:v,from:k,to:D,pasteEvt:a})}}))}var Rf=class{constructor(t,e){this.splittableMarks=[],this.editor=e,this.baseExtensions=t,this.extensions=fR(t),this.schema=s4(this.extensions,e),this.setupExtensions()}get commands(){return this.extensions.reduce((t,e)=>{const n={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:ql(e.name,this.schema)},r=ye(e,"addCommands",n);return r?{...t,...r()}:t},{})}get plugins(){const{editor:t}=this;return ra([...this.extensions].reverse()).flatMap(r=>{const o={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:t,type:ql(r.name,this.schema)},l=[],a=ye(r,"addKeyboardShortcuts",o);let c={};if(r.type==="mark"&&ye(r,"exitable",o)&&(c.ArrowRight=()=>U4.handleExit({editor:t,mark:r})),a){const b=Object.fromEntries(Object.entries(a()).map(([v,S])=>[v,()=>S({editor:t})]));c={...c,...b}}const d=aV(c);l.push(d);const h=ye(r,"addInputRules",o);if(zx(r,t.options.enableInputRules)&&h){const b=h();if(b&&b.length){const v=$4({editor:t,rules:b}),S=Array.isArray(v)?v:[v];l.push(...S)}}const p=ye(r,"addPasteRules",o);if(zx(r,t.options.enablePasteRules)&&p){const b=p();if(b&&b.length){const v=X4({editor:t,rules:b});l.push(...v)}}const g=ye(r,"addProseMirrorPlugins",o);if(g){const b=g();l.push(...b)}return l})}get attributes(){return uR(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:e}=Us(this.extensions);return Object.fromEntries(e.filter(n=>!!ye(n,"addNodeView")).map(n=>{const r=this.attributes.filter(d=>d.type===n.name),o={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:Ot(n.name,this.schema)},l=ye(n,"addNodeView",o);if(!l)return[];const a=l();if(!a)return[];const c=(d,h,p,g,b)=>{const v=Kc(d,r);return a({node:d,view:h,getPos:p,decorations:g,innerDecorations:b,editor:t,extension:n,HTMLAttributes:v})};return[n.name,c]}))}dispatchTransaction(t){const{editor:e}=this;return ra([...this.extensions].reverse()).reduceRight((r,o)=>{const l={name:o.name,options:o.options,storage:this.editor.extensionStorage[o.name],editor:e,type:ql(o.name,this.schema)},a=ye(o,"dispatchTransaction",l);return a?c=>{a.call(l,{transaction:c,next:r})}:r},t)}transformPastedHTML(t){const{editor:e}=this;return ra([...this.extensions]).reduce((r,o)=>{const l={name:o.name,options:o.options,storage:this.editor.extensionStorage[o.name],editor:e,type:ql(o.name,this.schema)},a=ye(o,"transformPastedHTML",l);return a?(c,d)=>{const h=r(c,d);return a.call(l,h)}:r},t||(r=>r))}get markViews(){const{editor:t}=this,{markExtensions:e}=Us(this.extensions);return Object.fromEntries(e.filter(n=>!!ye(n,"addMarkView")).map(n=>{const r=this.attributes.filter(c=>c.type===n.name),o={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:Hr(n.name,this.schema)},l=ye(n,"addMarkView",o);if(!l)return[];const a=(c,d,h)=>{const p=Kc(c,r);return l()({mark:c,view:d,inline:h,editor:t,extension:n,HTMLAttributes:p,updateAttributes:g=>{uF(c,t,g)}})};return[n.name,a]}))}setupExtensions(){const t=this.extensions;this.editor.extensionStorage=Object.fromEntries(t.map(e=>[e.name,e.storage])),t.forEach(e=>{var n;const r={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:ql(e.name,this.schema)};e.type==="mark"&&((n=it(ye(e,"keepOnSplit",r)))==null||n)&&this.splittableMarks.push(e.name);const o=ye(e,"onBeforeCreate",r),l=ye(e,"onCreate",r),a=ye(e,"onUpdate",r),c=ye(e,"onSelectionUpdate",r),d=ye(e,"onTransaction",r),h=ye(e,"onFocus",r),p=ye(e,"onBlur",r),g=ye(e,"onDestroy",r);o&&this.editor.on("beforeCreate",o),l&&this.editor.on("create",l),a&&this.editor.on("update",a),c&&this.editor.on("selectionUpdate",c),d&&this.editor.on("transaction",d),h&&this.editor.on("focus",h),p&&this.editor.on("blur",p),g&&this.editor.on("destroy",g)})}};Rf.resolve=fR;Rf.sort=ra;Rf.flatten=Sg;var J4={};yg(J4,{ClipboardTextSerializer:()=>bR,Commands:()=>SR,Delete:()=>xR,Drop:()=>wR,Editable:()=>CR,FocusEvents:()=>ER,Keymap:()=>RR,Paste:()=>TR,Tabindex:()=>AR,TextDirection:()=>OR,focusEventsPluginKey:()=>MR});var St=class vR extends wg{constructor(){super(...arguments),this.type="extension"}static create(e={}){const n=typeof e=="function"?e():e;return new vR(n)}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}},bR=St.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new bt({key:new Jt("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:o}=e,{ranges:l}=o,a=Math.min(...l.map(p=>p.$from.pos)),c=Math.max(...l.map(p=>p.$to.pos)),d=hR(n);return dR(r,{from:a,to:c},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:d})}}})]}}),SR=St.create({name:"commands",addCommands(){return{...eR}}}),xR=St.create({name:"delete",onUpdate({transaction:t,appendedTransactions:e}){var n,r,o;const l=()=>{var a,c,d,h;if((h=(d=(c=(a=this.editor.options.coreExtensionOptions)==null?void 0:a.delete)==null?void 0:c.filterTransaction)==null?void 0:d.call(c,t))!=null?h:t.getMeta("y-sync$"))return;const p=e4(t.before,[t,...e]);h4(p).forEach(v=>{p.mapping.mapResult(v.oldRange.from).deletedAfter&&p.mapping.mapResult(v.oldRange.to).deletedBefore&&p.before.nodesBetween(v.oldRange.from,v.oldRange.to,(S,x)=>{const C=x+S.nodeSize-2,E=v.oldRange.from<=x&&C<=v.oldRange.to;this.editor.emit("delete",{type:"node",node:S,from:x,to:C,newFrom:p.mapping.map(x),newTo:p.mapping.map(C),deletedRange:v.oldRange,newRange:v.newRange,partial:!E,editor:this.editor,transaction:t,combinedTransform:p})})});const b=p.mapping;p.steps.forEach((v,S)=>{var x,C;if(v instanceof Jn){const E=b.slice(S).map(v.from,-1),A=b.slice(S).map(v.to),k=b.invert().map(E,-1),D=b.invert().map(A),L=(x=p.doc.nodeAt(E-1))==null?void 0:x.marks.some(z=>z.eq(v.mark)),H=(C=p.doc.nodeAt(A))==null?void 0:C.marks.some(z=>z.eq(v.mark));this.editor.emit("delete",{type:"mark",mark:v.mark,from:v.from,to:v.to,deletedRange:{from:k,to:D},newRange:{from:E,to:A},partial:!!(H||L),editor:this.editor,transaction:t,combinedTransform:p})}})};(o=(r=(n=this.editor.options.coreExtensionOptions)==null?void 0:n.delete)==null?void 0:r.async)==null||o?setTimeout(l,0):l()}}),wR=St.create({name:"drop",addProseMirrorPlugins(){return[new bt({key:new Jt("tiptapDrop"),props:{handleDrop:(t,e,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:r})}}})]}}),CR=St.create({name:"editable",addProseMirrorPlugins(){return[new bt({key:new Jt("editable"),props:{editable:()=>this.editor.options.editable}})]}}),MR=new Jt("focusEvents"),ER=St.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new bt({key:MR,props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),RR=St.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:a})=>[()=>a.undoInputRule(),()=>a.command(({tr:c})=>{const{selection:d,doc:h}=c,{empty:p,$anchor:g}=d,{pos:b,parent:v}=g,S=g.parent.isTextblock&&b>0?c.doc.resolve(b-1):g,x=S.parent.type.spec.isolating,C=g.pos-g.parentOffset,E=x&&S.parent.childCount===1?C===g.pos:ze.atStart(h).from===b;return!p||!v.type.isTextblock||v.textContent.length||!E||E&&g.parent.type.name==="paragraph"?!1:a.clearNodes()}),()=>a.deleteSelection(),()=>a.joinBackward(),()=>a.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:a})=>[()=>a.deleteSelection(),()=>a.deleteCurrentNode(),()=>a.joinForward(),()=>a.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:a})=>[()=>a.newlineInCode(),()=>a.createParagraphNear(),()=>a.liftEmptyBlock(),()=>a.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},o={...r},l={...r,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Gc()||sR()?l:o},addProseMirrorPlugins(){return[new bt({key:new Jt("clearDocument"),appendTransaction:(t,e,n)=>{if(t.some(x=>x.getMeta("composition")))return;const r=t.some(x=>x.docChanged)&&!e.doc.eq(n.doc),o=t.some(x=>x.getMeta("preventClearDocument"));if(!r||o)return;const{empty:l,from:a,to:c}=e.selection,d=ze.atStart(e.doc).from,h=ze.atEnd(e.doc).to;if(l||!(a===d&&c===h)||!Ef(n.doc))return;const b=n.tr,v=wf({state:n,transaction:b}),{commands:S}=new Cf({editor:this.editor,state:v});if(S.clearNodes(),!!b.steps.length)return b}})]}}),TR=St.create({name:"paste",addProseMirrorPlugins(){return[new bt({key:new Jt("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),AR=St.create({name:"tabindex",addProseMirrorPlugins(){return[new bt({key:new Jt("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}}),OR=St.create({name:"textDirection",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];const{nodeExtensions:t}=Us(this.extensions);return[{types:t.filter(e=>e.name!=="text").map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{const n=e.getAttribute("dir");return n&&(n==="ltr"||n==="rtl"||n==="auto")?n:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new bt({key:new Jt("textDirection"),props:{attributes:()=>{const t=this.options.direction;return t?{dir:t}:{}}}})]}}),Q4=class Ql{constructor(e,n,r=!1,o=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=n,this.currentNode=o}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!=null?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let 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},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(e);return new Ql(n,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new Ql(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new Ql(e,this.editor)}get children(){const e=[];return this.node.content.forEach((n,r)=>{const o=n.isBlock&&!n.isTextblock,l=n.isAtom&&!n.isText,a=n.isInline,c=this.pos+r+(l?0:1);if(c<0||c>this.resolvedPos.doc.nodeSize-2)return;const d=this.resolvedPos.doc.resolve(c);if(!o&&!a&&d.depth<=this.depth)return;const h=new Ql(d,this.editor,o,o||a?n:null);o&&(h.actualDepth=this.depth+1),e.push(h)}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,n={}){let r=null,o=this.parent;for(;o&&!r;){if(o.node.type.name===e)if(Object.keys(n).length>0){const l=o.node.attrs,a=Object.keys(n);for(let c=0;c<a.length;c+=1){const d=a[c];if(l[d]!==n[d])break}}else r=o;o=o.parent}return r}querySelector(e,n={}){return this.querySelectorAll(e,n,!0)[0]||null}querySelectorAll(e,n={},r=!1){let o=[];if(!this.children||this.children.length===0)return o;const l=Object.keys(n);return this.children.forEach(a=>{r&&o.length>0||(a.node.type.name===e&&l.every(d=>n[d]===a.node.attrs[d])&&o.push(a),!(r&&o.length>0)&&(o=o.concat(a.querySelectorAll(e,n,r))))}),o}setAttribute(e){const{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(n)}},Z4=`.ProseMirror {
|
|
68
|
+
position: relative;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.ProseMirror {
|
|
72
|
+
word-wrap: break-word;
|
|
73
|
+
white-space: pre-wrap;
|
|
74
|
+
white-space: break-spaces;
|
|
75
|
+
-webkit-font-variant-ligatures: none;
|
|
76
|
+
font-variant-ligatures: none;
|
|
77
|
+
font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.ProseMirror [contenteditable="false"] {
|
|
81
|
+
white-space: normal;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.ProseMirror [contenteditable="false"] [contenteditable="true"] {
|
|
85
|
+
white-space: pre-wrap;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.ProseMirror pre {
|
|
89
|
+
white-space: pre-wrap;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
img.ProseMirror-separator {
|
|
93
|
+
display: inline !important;
|
|
94
|
+
border: none !important;
|
|
95
|
+
margin: 0 !important;
|
|
96
|
+
width: 0 !important;
|
|
97
|
+
height: 0 !important;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.ProseMirror-gapcursor {
|
|
101
|
+
display: none;
|
|
102
|
+
pointer-events: none;
|
|
103
|
+
position: absolute;
|
|
104
|
+
margin: 0;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.ProseMirror-gapcursor:after {
|
|
108
|
+
content: "";
|
|
109
|
+
display: block;
|
|
110
|
+
position: absolute;
|
|
111
|
+
top: -2px;
|
|
112
|
+
width: 20px;
|
|
113
|
+
border-top: 1px solid black;
|
|
114
|
+
animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
@keyframes ProseMirror-cursor-blink {
|
|
118
|
+
to {
|
|
119
|
+
visibility: hidden;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.ProseMirror-hideselection *::selection {
|
|
124
|
+
background: transparent;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.ProseMirror-hideselection *::-moz-selection {
|
|
128
|
+
background: transparent;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.ProseMirror-hideselection * {
|
|
132
|
+
caret-color: transparent;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.ProseMirror-focused .ProseMirror-gapcursor {
|
|
136
|
+
display: block;
|
|
137
|
+
}`;function W4(t,e,n){const r=document.querySelector("style[data-tiptap-style]");if(r!==null)return r;const o=document.createElement("style");return e&&o.setAttribute("nonce",e),o.setAttribute("data-tiptap-style",""),o.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(o),o}var eF=class extends F4{constructor(t={}){super(),this.css=null,this.className="tiptap",this.editorView=null,this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:typeof document<"u"?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:r})=>{throw r},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:y4,createMappablePosition:v4},this.setOptions(t),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:r,slice:o,moved:l})=>this.options.onDrop(r,o,l)),this.on("paste",({event:r,slice:o})=>this.options.onPaste(r,o)),this.on("delete",this.options.onDelete);const e=this.createDoc(),n=iR(e,this.options.autofocus);this.editorState=Ds.create({doc:e,schema:this.schema,selection:n||void 0}),this.options.element&&this.mount(this.options.element)}mount(t){if(typeof document>"u")throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(t),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){const t=this.editorView.dom;t?.editor&&delete t.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove=="function"?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(t){console.warn("Failed to remove CSS element:",t)}this.css=null,this.emit("unmount",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&typeof document<"u"&&(this.css=W4(Z4,this.options.injectNonce))}setOptions(t={}){this.options={...this.options,...t},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(t,e=!0){this.setOptions({editable:t}),e&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:t=>{this.editorState=t},dispatch:t=>{this.dispatchTransaction(t)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(t,e)=>{if(this.editorView)return this.editorView[e];if(e==="state")return this.editorState;if(e in t)return Reflect.get(t,e);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${e}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(t,e){const n=aR(e)?e(t,[...this.state.plugins]):[...this.state.plugins,t],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(t){if(this.isDestroyed)return;const e=this.state.plugins;let n=e;if([].concat(t).forEach(o=>{const l=typeof o=="string"?`${o}$`:o.key;n=n.filter(a=>!a.key.startsWith(l))}),e.length===n.length)return;const r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){var t,e;const r=[...this.options.enableCoreExtensions?[CR,bR.configure({blockSeparator:(e=(t=this.options.coreExtensionOptions)==null?void 0:t.clipboardTextSerializer)==null?void 0:e.blockSeparator}),SR,ER,RR,AR,wR,TR,xR,OR.configure({direction:this.options.textDirection})].filter(o=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[o.name]!==!1:!0):[],...this.options.extensions].filter(o=>["extension","node","mark"].includes(o?.type));this.extensionManager=new Rf(r,this)}createCommandManager(){this.commandManager=new Cf({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let t;try{t=wm(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(e){if(!(e instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(e.message))throw e;this.emit("contentError",{editor:this,error:e,disableCollaboration:()=>{"collaboration"in this.storage&&typeof this.storage.collaboration=="object"&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(n=>n.name!=="collaboration"),this.createExtensionManager()}}),t=wm(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return t}createView(t){const{editorProps:e,enableExtensionDispatchTransaction:n}=this.options,r=e.dispatchTransaction||this.dispatchTransaction.bind(this),o=n?this.extensionManager.dispatchTransaction(r):r,l=e.transformPastedHTML,a=this.extensionManager.transformPastedHTML(l);this.editorView=new ZE(t,{...e,attributes:{role:"textbox",...e?.attributes},dispatchTransaction:o,transformPastedHTML:a,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});const c=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(c),this.prependClass(),this.injectCSS();const d=this.view.dom;d.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(t){this.isCapturingTransaction=!0,t(),this.isCapturingTransaction=!1;const e=this.capturedTransaction;return this.capturedTransaction=null,e}dispatchTransaction(t){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=t;return}t.steps.forEach(h=>{var p;return(p=this.capturedTransaction)==null?void 0:p.step(h)});return}const{state:e,transactions:n}=this.state.applyTransaction(t),r=!this.state.selection.eq(e.selection),o=n.includes(t),l=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:t,nextState:e}),!o)return;this.view.updateState(e),this.emit("transaction",{editor:this,transaction:t,appendedTransactions:n.slice(1)}),r&&this.emit("selectionUpdate",{editor:this,transaction:t});const a=n.findLast(h=>h.getMeta("focus")||h.getMeta("blur")),c=a?.getMeta("focus"),d=a?.getMeta("blur");c&&this.emit("focus",{editor:this,event:c.event,transaction:a}),d&&this.emit("blur",{editor:this,event:d.event,transaction:a}),!(t.getMeta("preventUpdate")||!n.some(h=>h.docChanged)||l.doc.eq(e.doc))&&this.emit("update",{editor:this,transaction:t,appendedTransactions:n.slice(1)})}getAttributes(t){return c4(this.state,t)}isActive(t,e){const n=typeof t=="string"?t:null,r=typeof t=="string"?e:t;return m4(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return xg(this.state.doc.content,this.schema)}getText(t){const{blockSeparator:e=`
|
|
138
|
+
|
|
139
|
+
`,textSerializers:n={}}=t||{};return a4(this.state.doc,{blockSeparator:e,textSerializers:{...hR(this.schema),...n}})}get isEmpty(){return Ef(this.state.doc)}destroy(){this.emit("destroy"),this.unmount(),this.removeAllListeners()}get isDestroyed(){var t,e;return(e=(t=this.editorView)==null?void 0:t.isDestroyed)!=null?e:!0}$node(t,e){var n;return((n=this.$doc)==null?void 0:n.querySelector(t,e))||null}$nodes(t,e){var n;return((n=this.$doc)==null?void 0:n.querySelectorAll(t,e))||null}$pos(t){const e=this.state.doc.resolve(t);return new Q4(e,this)}get $doc(){return this.$pos(0)}},tF={};yg(tF,{createAtomBlockMarkdownSpec:()=>nF,createBlockMarkdownSpec:()=>rF,createInlineMarkdownSpec:()=>sF,parseAttributes:()=>Cg,parseIndentedBlocks:()=>lF,renderNestedMarkdownContent:()=>aF,serializeAttributes:()=>Mg});function Cg(t){if(!t?.trim())return{};const e={},n=[],r=t.replace(/["']([^"']*)["']/g,h=>(n.push(h),`__QUOTED_${n.length-1}__`)),o=r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);if(o){const h=o.map(p=>p.trim().slice(1));e.class=h.join(" ")}const l=r.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);l&&(e.id=l[1]);const a=/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g;Array.from(r.matchAll(a)).forEach(([,h,p])=>{var g;const b=parseInt(((g=p.match(/__QUOTED_(\d+)__/))==null?void 0:g[1])||"0",10),v=n[b];v&&(e[h]=v.slice(1,-1))});const d=r.replace(/(?:^|\s)\.([a-zA-Z][\w-]*)/g,"").replace(/(?:^|\s)#([a-zA-Z][\w-]*)/g,"").replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,"").trim();return d&&d.split(/\s+/).filter(Boolean).forEach(p=>{p.match(/^[a-zA-Z][\w-]*$/)&&(e[p]=!0)}),e}function Mg(t){if(!t||Object.keys(t).length===0)return"";const e=[];return t.class&&String(t.class).split(/\s+/).filter(Boolean).forEach(r=>e.push(`.${r}`)),t.id&&e.push(`#${t.id}`),Object.entries(t).forEach(([n,r])=>{n==="class"||n==="id"||(r===!0?e.push(n):r!==!1&&r!=null&&e.push(`${n}="${String(r)}"`))}),e.join(" ")}function nF(t){const{nodeName:e,name:n,parseAttributes:r=Cg,serializeAttributes:o=Mg,defaultAttributes:l={},requiredAttributes:a=[],allowedAttributes:c}=t,d=n||e,h=p=>{if(!c)return p;const g={};return c.forEach(b=>{b in p&&(g[b]=p[b])}),g};return{parseMarkdown:(p,g)=>{const b={...l,...p.attributes};return g.createNode(e,b,[])},markdownTokenizer:{name:e,level:"block",start(p){var g;const b=new RegExp(`^:::${d}(?:\\s|$)`,"m"),v=(g=p.match(b))==null?void 0:g.index;return v!==void 0?v:-1},tokenize(p,g,b){const v=new RegExp(`^:::${d}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),S=p.match(v);if(!S)return;const x=S[1]||"",C=r(x);if(!a.find(A=>!(A in C)))return{type:e,raw:S[0],attributes:C}}},renderMarkdown:p=>{const g=h(p.attrs||{}),b=o(g),v=b?` {${b}}`:"";return`:::${d}${v} :::`}}}function rF(t){const{nodeName:e,name:n,getContent:r,parseAttributes:o=Cg,serializeAttributes:l=Mg,defaultAttributes:a={},content:c="block",allowedAttributes:d}=t,h=n||e,p=g=>{if(!d)return g;const b={};return d.forEach(v=>{v in g&&(b[v]=g[v])}),b};return{parseMarkdown:(g,b)=>{let v;if(r){const x=r(g);v=typeof x=="string"?[{type:"text",text:x}]:x}else c==="block"?v=b.parseChildren(g.tokens||[]):v=b.parseInline(g.tokens||[]);const S={...a,...g.attributes};return b.createNode(e,S,v)},markdownTokenizer:{name:e,level:"block",start(g){var b;const v=new RegExp(`^:::${h}`,"m"),S=(b=g.match(v))==null?void 0:b.index;return S!==void 0?S:-1},tokenize(g,b,v){var S;const x=new RegExp(`^:::${h}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),C=g.match(x);if(!C)return;const[E,A=""]=C,k=o(A);let D=1;const L=E.length;let H="";const z=/^:::([\w-]*)(\s.*)?/gm,j=g.slice(L);for(z.lastIndex=0;;){const J=z.exec(j);if(J===null)break;const le=J.index,ce=J[1];if(!((S=J[2])!=null&&S.endsWith(":::"))){if(ce)D+=1;else if(D-=1,D===0){const se=j.slice(0,le);H=se.trim();const Se=g.slice(0,L+le+J[0].length);let ne=[];if(H)if(c==="block")for(ne=v.blockTokens(se),ne.forEach(me=>{me.text&&(!me.tokens||me.tokens.length===0)&&(me.tokens=v.inlineTokens(me.text))});ne.length>0;){const me=ne[ne.length-1];if(me.type==="paragraph"&&(!me.text||me.text.trim()===""))ne.pop();else break}else ne=v.inlineTokens(H);return{type:e,raw:Se,attributes:k,content:H,tokens:ne}}}}}},renderMarkdown:(g,b)=>{const v=p(g.attrs||{}),S=l(v),x=S?` {${S}}`:"",C=b.renderChildren(g.content||[],`
|
|
140
|
+
|
|
141
|
+
`);return`:::${h}${x}
|
|
142
|
+
|
|
143
|
+
${C}
|
|
144
|
+
|
|
145
|
+
:::`}}}function iF(t){if(!t.trim())return{};const e={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let r=n.exec(t);for(;r!==null;){const[,o,l,a]=r;e[o]=l||a,r=n.exec(t)}return e}function oF(t){return Object.entries(t).filter(([,e])=>e!=null).map(([e,n])=>`${e}="${n}"`).join(" ")}function sF(t){const{nodeName:e,name:n,getContent:r,parseAttributes:o=iF,serializeAttributes:l=oF,defaultAttributes:a={},selfClosing:c=!1,allowedAttributes:d}=t,h=n||e,p=b=>{if(!d)return b;const v={};return d.forEach(S=>{const x=typeof S=="string"?S:S.name,C=typeof S=="string"?void 0:S.skipIfDefault;if(x in b){const E=b[x];if(C!==void 0&&E===C)return;v[x]=E}}),v},g=h.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(b,v)=>{const S={...a,...b.attributes};if(c)return v.createNode(e,S);const x=r?r(b):b.content||"";return x?v.createNode(e,S,[v.createTextNode(x)]):v.createNode(e,S,[])},markdownTokenizer:{name:e,level:"inline",start(b){const v=c?new RegExp(`\\[${g}\\s*[^\\]]*\\]`):new RegExp(`\\[${g}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${g}\\]`),S=b.match(v),x=S?.index;return x!==void 0?x:-1},tokenize(b,v,S){const x=c?new RegExp(`^\\[${g}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${g}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${g}\\]`),C=b.match(x);if(!C)return;let E="",A="";if(c){const[,D]=C;A=D}else{const[,D,L]=C;A=D,E=L||""}const k=o(A.trim());return{type:e,raw:C[0],content:E.trim(),attributes:k}}},renderMarkdown:b=>{let v="";r?v=r(b):b.content&&b.content.length>0&&(v=b.content.filter(E=>E.type==="text").map(E=>E.text).join(""));const S=p(b.attrs||{}),x=l(S),C=x?` ${x}`:"";return c?`[${h}${C}]`:`[${h}${C}]${v}[/${h}]`}}}function lF(t,e,n){var r,o,l,a;const c=t.split(`
|
|
146
|
+
`),d=[];let h="",p=0;const g=e.baseIndentSize||2;for(;p<c.length;){const b=c[p],v=b.match(e.itemPattern);if(!v){if(d.length>0)break;if(b.trim()===""){p+=1,h=`${h}${b}
|
|
147
|
+
`;continue}else return}const S=e.extractItemData(v),{indentLevel:x,mainContent:C}=S;h=`${h}${b}
|
|
148
|
+
`;const E=[C];for(p+=1;p<c.length;){const L=c[p];if(L.trim()===""){const z=c.slice(p+1).findIndex(le=>le.trim()!=="");if(z===-1)break;if((((o=(r=c[p+1+z].match(/^(\s*)/))==null?void 0:r[1])==null?void 0:o.length)||0)>x){E.push(L),h=`${h}${L}
|
|
149
|
+
`,p+=1;continue}else break}if((((a=(l=L.match(/^(\s*)/))==null?void 0:l[1])==null?void 0:a.length)||0)>x)E.push(L),h=`${h}${L}
|
|
150
|
+
`,p+=1;else break}let A;const k=E.slice(1);if(k.length>0){const L=k.map(H=>H.slice(x+g)).join(`
|
|
151
|
+
`);L.trim()&&(e.customNestedParser?A=e.customNestedParser(L):A=n.blockTokens(L))}const D=e.createToken(S,A);d.push(D)}if(d.length!==0)return{items:d,raw:h}}function aF(t,e,n,r){if(!t||!Array.isArray(t.content))return"";const o=typeof n=="function"?n(r):n,[l,...a]=t.content,c=e.renderChildren([l]);let d=`${o}${c}`;return a&&a.length>0&&a.forEach((h,p)=>{var g,b;const v=(b=(g=e.renderChild)==null?void 0:g.call(e,h,p+1))!=null?b:e.renderChildren([h]);if(v!=null){const S=v.split(`
|
|
152
|
+
`).map(x=>x?e.indent(x):e.indent("")).join(`
|
|
153
|
+
`);d+=h.type==="paragraph"?`
|
|
154
|
+
|
|
155
|
+
${S}`:`
|
|
156
|
+
${S}`}}),d}function uF(t,e,n={}){const{state:r}=e,{doc:o,tr:l}=r,a=t;o.descendants((c,d)=>{const h=l.mapping.map(d),p=l.mapping.map(d)+c.nodeSize;let g=null;if(c.marks.forEach(v=>{if(v!==a)return!1;g=v}),!g)return;let b=!1;if(Object.keys(n).forEach(v=>{n[v]!==g.attrs[v]&&(b=!0)}),b){const v=t.type.create({...t.attrs,...n});l.removeMark(h,p,t.type),l.addMark(h,p,v)}}),l.docChanged&&e.view.dispatch(l)}var Eg=class kR extends wg{constructor(){super(...arguments),this.type="node"}static create(e={}){const n=typeof e=="function"?e():e;return new kR(n)}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}},cF=Eg.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
|
|
157
|
+
|
|
158
|
+
`):""}),fF=cF,Bx=" ",dF=" ",hF=Eg.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",cR(this.options.HTMLAttributes,t),0]},parseMarkdown:(t,e)=>{const n=t.tokens||[];if(n.length===1&&n[0].type==="image")return e.parseChildren([n[0]]);const r=e.parseInline(n);return r.length===1&&r[0].type==="text"&&(r[0].text===Bx||r[0].text===dF)?e.createNode("paragraph",void 0,[]):e.createNode("paragraph",void 0,r)},renderMarkdown:(t,e,n)=>{var r,o;if(!t)return"";const l=Array.isArray(t.content)?t.content:[];if(l.length===0){const a=Array.isArray((r=n?.previousNode)==null?void 0:r.content)?n.previousNode.content:[];return((o=n?.previousNode)==null?void 0:o.type)==="paragraph"&&a.length===0?Bx:""}return e.renderChildren(l)},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),pF=hF;function mF(t={}){return new bt({view(e){return new gF(e,t)}})}class gF{constructor(e,n){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(o=>{let l=a=>{this[o](a)};return e.dom.addEventListener(o,l),{name:o,handler:l}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,r,o=this.editorView.dom,l=o.getBoundingClientRect(),a=l.width/o.offsetWidth,c=l.height/o.offsetHeight;if(n){let g=e.nodeBefore,b=e.nodeAfter;if(g||b){let v=this.editorView.nodeDOM(this.cursorPos-(g?g.nodeSize:0));if(v){let S=v.getBoundingClientRect(),x=g?S.bottom:S.top;g&&b&&(x=(x+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let C=this.width/2*c;r={left:S.left,right:S.right,top:x-C,bottom:x+C}}}}if(!r){let g=this.editorView.coordsAtPos(this.cursorPos),b=this.width/2*a;r={left:g.left-b,right:g.left+b,top:g.top,bottom:g.bottom}}let d=this.editorView.dom.offsetParent;this.element||(this.element=d.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let h,p;if(!d||d==document.body&&getComputedStyle(d).position=="static")h=-pageXOffset,p=-pageYOffset;else{let g=d.getBoundingClientRect(),b=g.width/d.offsetWidth,v=g.height/d.offsetHeight;h=g.left-d.scrollLeft*b,p=g.top-d.scrollTop*v}this.element.style.left=(r.left-h)/a+"px",this.element.style.top=(r.top-p)/c+"px",this.element.style.width=(r.right-r.left)/a+"px",this.element.style.height=(r.bottom-r.top)/c+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),o=r&&r.type.spec.disableDropCursor,l=typeof o=="function"?o(this.editorView,n,e):o;if(n&&!l){let a=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let c=ZM(this.editorView.state.doc,a,this.editorView.dragging.slice);c!=null&&(a=c)}this.setCursor(a),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}class at extends ze{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return at.valid(r)?new at(r):ze.near(r)}content(){return ue.empty}eq(e){return e instanceof at&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new at(e.resolve(n.pos))}getBookmark(){return new Rg(this.anchor)}static valid(e){let n=e.parent;if(n.inlineContent||!yF(e)||!vF(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let o=n.contentMatchAt(e.index()).defaultType;return o&&o.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&at.valid(e))return e;let o=e.pos,l=null;for(let a=e.depth;;a--){let c=e.node(a);if(n>0?e.indexAfter(a)<c.childCount:e.index(a)>0){l=c.child(n>0?e.indexAfter(a):e.index(a)-1);break}else if(a==0)return null;o+=n;let d=e.doc.resolve(o);if(at.valid(d))return d}for(;;){let a=n>0?l.firstChild:l.lastChild;if(!a){if(l.isAtom&&!l.isText&&!be.isSelectable(l)){e=e.doc.resolve(o+l.nodeSize*n),r=!1;continue e}break}l=a,o+=n;let c=e.doc.resolve(o);if(at.valid(c))return c}return null}}}at.prototype.visible=!1;at.findFrom=at.findGapCursorFrom;ze.jsonID("gapcursor",at);class Rg{constructor(e){this.pos=e}map(e){return new Rg(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return at.valid(n)?new at(n):ze.near(n)}}function NR(t){return t.isAtom||t.spec.isolating||t.spec.createGapCursor}function yF(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let o=r.child(n-1);;o=o.lastChild){if(o.childCount==0&&!o.inlineContent||NR(o.type))return!0;if(o.inlineContent)return!1}}return!0}function vF(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let o=r.child(n);;o=o.firstChild){if(o.childCount==0&&!o.inlineContent||NR(o.type))return!0;if(o.inlineContent)return!1}}return!0}function bF(){return new bt({props:{decorations:CF,createSelectionBetween(t,e,n){return e.pos==n.pos&&at.valid(n)?new at(n):null},handleClick:xF,handleKeyDown:SF,handleDOMEvents:{beforeinput:wF}}})}const SF=WE({ArrowLeft:mc("horiz",-1),ArrowRight:mc("horiz",1),ArrowUp:mc("vert",-1),ArrowDown:mc("vert",1)});function mc(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,o,l){let a=r.selection,c=e>0?a.$to:a.$from,d=a.empty;if(a instanceof Oe){if(!l.endOfTextblock(n)||c.depth==0)return!1;d=!1,c=r.doc.resolve(e>0?c.after():c.before())}let h=at.findGapCursorFrom(c,e,d);return h?(o&&o(r.tr.setSelection(new at(h))),!0):!1}}function xF(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!at.valid(r))return!1;let o=t.posAtCoords({left:n.clientX,top:n.clientY});return o&&o.inside>-1&&be.isSelectable(t.state.doc.nodeAt(o.inside))?!1:(t.dispatch(t.state.tr.setSelection(new at(r))),!0)}function wF(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof at))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let o=te.empty;for(let a=r.length-1;a>=0;a--)o=te.from(r[a].createAndFill(null,o));let l=t.state.tr.replace(n.pos,n.pos,new ue(o,0,0));return l.setSelection(Oe.near(l.doc.resolve(n.pos+1))),t.dispatch(l),!1}function CF(t){if(!(t.selection instanceof at))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",ot.create(t.doc,[Ut.widget(t.selection.head,e,{key:"gapcursor"})])}var Yc=200,At=function(){};At.prototype.append=function(e){return e.length?(e=At.from(e),!this.length&&e||e.length<Yc&&this.leafAppend(e)||this.length<Yc&&e.leafPrepend(this)||this.appendInner(e)):this};At.prototype.prepend=function(e){return e.length?At.from(e).append(this):this};At.prototype.appendInner=function(e){return new MF(this,e)};At.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?At.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))};At.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};At.prototype.forEach=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(e,n,r,0):this.forEachInvertedInner(e,n,r,0)};At.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var o=[];return this.forEach(function(l,a){return o.push(e(l,a))},n,r),o};At.from=function(e){return e instanceof At?e:e&&e.length?new DR(e):At.empty};var DR=(function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(o,l){return o==0&&l==this.length?this:new e(this.values.slice(o,l))},e.prototype.getInner=function(o){return this.values[o]},e.prototype.forEachInner=function(o,l,a,c){for(var d=l;d<a;d++)if(o(this.values[d],c+d)===!1)return!1},e.prototype.forEachInvertedInner=function(o,l,a,c){for(var d=l-1;d>=a;d--)if(o(this.values[d],c+d)===!1)return!1},e.prototype.leafAppend=function(o){if(this.length+o.length<=Yc)return new e(this.values.concat(o.flatten()))},e.prototype.leafPrepend=function(o){if(this.length+o.length<=Yc)return new e(o.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e})(At);At.empty=new DR([]);var MF=(function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,o,l,a){var c=this.left.length;if(o<c&&this.left.forEachInner(r,o,Math.min(l,c),a)===!1||l>c&&this.right.forEachInner(r,Math.max(o-c,0),Math.min(this.length,l)-c,a+c)===!1)return!1},e.prototype.forEachInvertedInner=function(r,o,l,a){var c=this.left.length;if(o>c&&this.right.forEachInvertedInner(r,o-c,Math.max(l,c)-c,a+c)===!1||l<c&&this.left.forEachInvertedInner(r,Math.min(o,c),l,a)===!1)return!1},e.prototype.sliceInner=function(r,o){if(r==0&&o==this.length)return this;var l=this.left.length;return o<=l?this.left.slice(r,o):r>=l?this.right.slice(r-l,o-l):this.left.slice(r,l).append(this.right.slice(0,o-l))},e.prototype.leafAppend=function(r){var o=this.right.leafAppend(r);if(o)return new e(this.left,o)},e.prototype.leafPrepend=function(r){var o=this.left.leafPrepend(r);if(o)return new e(o,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e})(At);const EF=500;class Yn{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let o,l;n&&(o=this.remapping(r,this.items.length),l=o.maps.length);let a=e.tr,c,d,h=[],p=[];return this.items.forEach((g,b)=>{if(!g.step){o||(o=this.remapping(r,b+1),l=o.maps.length),l--,p.push(g);return}if(o){p.push(new sr(g.map));let v=g.step.map(o.slice(l)),S;v&&a.maybeStep(v).doc&&(S=a.mapping.maps[a.mapping.maps.length-1],h.push(new sr(S,void 0,void 0,h.length+p.length))),l--,S&&o.appendMap(S,l)}else a.maybeStep(g.step);if(g.selection)return c=o?g.selection.map(o.slice(l)):g.selection,d=new Yn(this.items.slice(0,r).append(p.reverse().concat(h)),this.eventCount-1),!1},this.items.length,0),{remaining:d,transform:a,selection:c}}addTransform(e,n,r,o){let l=[],a=this.eventCount,c=this.items,d=!o&&c.length?c.get(c.length-1):null;for(let p=0;p<e.steps.length;p++){let g=e.steps[p].invert(e.docs[p]),b=new sr(e.mapping.maps[p],g,n),v;(v=d&&d.merge(b))&&(b=v,p?l.pop():c=c.slice(0,c.length-1)),l.push(b),n&&(a++,n=void 0),o||(d=b)}let h=a-r.depth;return h>TF&&(c=RF(c,h),a-=h),new Yn(c.append(l),a)}remapping(e,n){let r=new da;return this.items.forEach((o,l)=>{let a=o.mirrorOffset!=null&&l-o.mirrorOffset>=e?r.maps.length-o.mirrorOffset:void 0;r.appendMap(o.map,a)},e,n),r}addMaps(e){return this.eventCount==0?this:new Yn(this.items.append(e.map(n=>new sr(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],o=Math.max(0,this.items.length-n),l=e.mapping,a=e.steps.length,c=this.eventCount;this.items.forEach(b=>{b.selection&&c--},o);let d=n;this.items.forEach(b=>{let v=l.getMirror(--d);if(v==null)return;a=Math.min(a,v);let S=l.maps[v];if(b.step){let x=e.steps[v].invert(e.docs[v]),C=b.selection&&b.selection.map(l.slice(d+1,v));C&&c++,r.push(new sr(S,x,C))}else r.push(new sr(S))},o);let h=[];for(let b=n;b<a;b++)h.push(new sr(l.maps[b]));let p=this.items.slice(0,o).append(h).append(r),g=new Yn(p,c);return g.emptyItemCount()>EF&&(g=g.compress(this.items.length-r.length)),g}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,o=[],l=0;return this.items.forEach((a,c)=>{if(c>=e)o.push(a),a.selection&&l++;else if(a.step){let d=a.step.map(n.slice(r)),h=d&&d.getMap();if(r--,h&&n.appendMap(h,r),d){let p=a.selection&&a.selection.map(n.slice(r));p&&l++;let g=new sr(h.invert(),d,p),b,v=o.length-1;(b=o.length&&o[v].merge(g))?o[v]=b:o.push(g)}}else a.map&&r--},this.items.length,0),new Yn(At.from(o.reverse()),l)}}Yn.empty=new Yn(At.empty,0);function RF(t,e){let n;return t.forEach((r,o)=>{if(r.selection&&e--==0)return n=o,!1}),t.slice(n)}class sr{constructor(e,n,r,o){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=o}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new sr(n.getMap().invert(),n,this.selection)}}}class wi{constructor(e,n,r,o,l){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=o,this.prevComposition=l}}const TF=20;function AF(t,e,n,r){let o=n.getMeta(So),l;if(o)return o.historyState;n.getMeta(NF)&&(t=new wi(t.done,t.undone,null,0,-1));let a=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(a&&a.getMeta(So))return a.getMeta(So).redo?new wi(t.done.addTransform(n,void 0,r,Mc(e)),t.undone,Ix(n.mapping.maps),t.prevTime,t.prevComposition):new wi(t.done,t.undone.addTransform(n,void 0,r,Mc(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(a&&a.getMeta("addToHistory")===!1)){let c=n.getMeta("composition"),d=t.prevTime==0||!a&&t.prevComposition!=c&&(t.prevTime<(n.time||0)-r.newGroupDelay||!OF(n,t.prevRanges)),h=a?Np(t.prevRanges,n.mapping):Ix(n.mapping.maps);return new wi(t.done.addTransform(n,d?e.selection.getBookmark():void 0,r,Mc(e)),Yn.empty,h,n.time,c??t.prevComposition)}else return(l=n.getMeta("rebased"))?new wi(t.done.rebased(n,l),t.undone.rebased(n,l),Np(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new wi(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),Np(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function OF(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,o)=>{for(let l=0;l<e.length;l+=2)r<=e[l+1]&&o>=e[l]&&(n=!0)}),n}function Ix(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,o,l,a)=>e.push(l,a));return e}function Np(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let o=e.map(t[r],1),l=e.map(t[r+1],-1);o<=l&&n.push(o,l)}return n}function kF(t,e,n){let r=Mc(e),o=So.get(e).spec.config,l=(n?t.undone:t.done).popEvent(e,r);if(!l)return null;let a=l.selection.resolve(l.transform.doc),c=(n?t.done:t.undone).addTransform(l.transform,e.selection.getBookmark(),o,r),d=new wi(n?c:l.remaining,n?l.remaining:c,null,0,-1);return l.transform.setSelection(a).setMeta(So,{redo:n,historyState:d})}let Dp=!1,Vx=null;function Mc(t){let e=t.plugins;if(Vx!=e){Dp=!1,Vx=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){Dp=!0;break}}return Dp}const So=new Jt("history"),NF=new Jt("closeHistory");function DF(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new bt({key:So,state:{init(){return new wi(Yn.empty,Yn.empty,null,0,-1)},apply(e,n,r){return AF(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,o=r=="historyUndo"?zR:r=="historyRedo"?jR:null;return!o||!e.editable?!1:(n.preventDefault(),o(e.state,e.dispatch))}}}})}function _R(t,e){return(n,r)=>{let o=So.getState(n);if(!o||(t?o.undone:o.done).eventCount==0)return!1;if(r){let l=kF(o,n,t);l&&r(e?l.scrollIntoView():l)}return!0}}const zR=_R(!1,!0),jR=_R(!0,!0);St.create({name:"characterCount",addOptions(){return{limit:null,mode:"textSize",textCounter:t=>t.length,wordCounter:t=>t.split(" ").filter(e=>e!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=t=>{const e=t?.node||this.editor.state.doc;if((t?.mode||this.options.mode)==="textSize"){const r=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(r)}return e.nodeSize},this.storage.words=t=>{const e=t?.node||this.editor.state.doc,n=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let t=!1;return[new bt({key:new Jt("characterCount"),appendTransaction:(e,n,r)=>{if(t)return;const o=this.options.limit;if(o==null||o===0){t=!0;return}const l=this.storage.characters({node:r.doc});if(l>o){const a=l-o,c=0,d=a;console.warn(`[CharacterCount] Initial content exceeded limit of ${o} characters. Content was automatically trimmed.`);const h=r.tr.deleteRange(c,d);return t=!0,h}t=!0},filterTransaction:(e,n)=>{const r=this.options.limit;if(!e.docChanged||r===0||r===null||r===void 0)return!0;const o=this.storage.characters({node:n.doc}),l=this.storage.characters({node:e.doc});if(l<=r||o>r&&l>r&&l<=o)return!0;if(o>r&&l>r&&l>o||!e.getMeta("paste"))return!1;const c=e.selection.$head.pos,d=l-r,h=c-d,p=c;return e.deleteRange(h,p),!(this.storage.characters({node:e.doc})>r)}})]}});St.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[mF(this.options)]}});St.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new bt({key:new Jt("focus"),props:{decorations:({doc:t,selection:e})=>{const{isEditable:n,isFocused:r}=this.editor,{anchor:o}=e,l=[];if(!n||!r)return ot.create(t,[]);let a=0;this.options.mode==="deepest"&&t.descendants((d,h)=>{if(d.isText)return;if(!(o>=h&&o<=h+d.nodeSize-1))return!1;a+=1});let c=0;return t.descendants((d,h)=>{if(d.isText||!(o>=h&&o<=h+d.nodeSize-1))return!1;if(c+=1,this.options.mode==="deepest"&&a-c>0||this.options.mode==="shallowest"&&c>1)return this.options.mode==="deepest";l.push(Ut.node(h,h+d.nodeSize,{class:this.options.className}))}),ot.create(t,l)}}})]}});St.create({name:"gapCursor",addProseMirrorPlugins(){return[bF()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=it(ye(t,"allowGapCursor",n)))!=null?e:null}}});var Fx="placeholder";function _F(t){return t.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}var zF=St.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:Fx,placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){const t=this.options.dataAttribute?`data-${_F(this.options.dataAttribute)}`:`data-${Fx}`;return[new bt({key:new Jt("placeholder"),props:{decorations:({doc:e,selection:n})=>{const r=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:o}=n,l=[];if(!r)return null;const a=this.editor.isEmpty;return e.descendants((c,d)=>{const h=o>=d&&o<=d+c.nodeSize,p=!c.isLeaf&&Ef(c);if(!c.type.isTextblock)return this.options.includeChildren;if((h||!this.options.showOnlyCurrent)&&p){const g=[this.options.emptyNodeClass];a&&g.push(this.options.emptyEditorClass);const b=Ut.node(d,d+c.nodeSize,{class:g.join(" "),[t]:typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:c,pos:d,hasAnchor:h}):this.options.placeholder});l.push(b)}return this.options.includeChildren}),ot.create(e,l)}}})]}});St.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:t,options:e}=this;return[new bt({key:new Jt("selection"),props:{decorations(n){return n.selection.empty||t.isFocused||!t.isEditable||g4(n.selection)||t.view.dragging?null:ot.create(n.doc,[Ut.inline(n.selection.from,n.selection.to,{class:e.className})])}}})]}});function Px({types:t,node:e}){return e&&Array.isArray(t)&&t.includes(e.type)||e?.type===t}St.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var t;const e=new Jt(this.name),n=this.options.node||((t=this.editor.schema.topNodeType.contentMatch.defaultType)==null?void 0:t.name)||"paragraph",r=Object.entries(this.editor.schema.nodes).map(([,o])=>o).filter(o=>(this.options.notAfter||[]).concat(n).includes(o.name));return[new bt({key:e,appendTransaction:(o,l,a)=>{const{doc:c,tr:d,schema:h}=a,p=e.getState(a),g=c.content.size,b=h.nodes[n];if(p)return d.insert(g,b.create())},state:{init:(o,l)=>{const a=l.tr.doc.lastChild;return!Px({node:a,types:r})},apply:(o,l)=>{if(!o.docChanged||o.getMeta("__uniqueIDTransaction"))return l;const a=o.doc.lastChild;return!Px({node:a,types:r})}}})]}});St.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>zR(t,e),redo:()=>({state:t,dispatch:e})=>jR(t,e)}},addProseMirrorPlugins(){return[DF(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()}}});var jF=zF,LF=Eg.create({name:"text",group:"inline",parseMarkdown:t=>({type:"text",text:t.text||""}),renderMarkdown:t=>t.text||""}),BF=LF;const{getOwnPropertyNames:IF,getOwnPropertySymbols:VF}=Object,{hasOwnProperty:FF}=Object.prototype;function _p(t,e){return function(r,o,l){return t(r,o,l)&&e(r,o,l)}}function gc(t){return function(n,r,o){if(!n||!r||typeof n!="object"||typeof r!="object")return t(n,r,o);const{cache:l}=o,a=l.get(n),c=l.get(r);if(a&&c)return a===r&&c===n;l.set(n,r),l.set(r,n);const d=t(n,r,o);return l.delete(n),l.delete(r),d}}function PF(t){return t?.[Symbol.toStringTag]}function $x(t){return IF(t).concat(VF(t))}const $F=Object.hasOwn||((t,e)=>FF.call(t,e));function ko(t,e){return t===e||!t&&!e&&t!==t&&e!==e}const HF="__v",UF="__o",qF="_owner",{getOwnPropertyDescriptor:Hx,keys:Ux}=Object;function GF(t,e){return t.byteLength===e.byteLength&&Xc(new Uint8Array(t),new Uint8Array(e))}function KF(t,e,n){let r=t.length;if(e.length!==r)return!1;for(;r-- >0;)if(!n.equals(t[r],e[r],r,r,t,e,n))return!1;return!0}function YF(t,e){return t.byteLength===e.byteLength&&Xc(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function XF(t,e){return ko(t.getTime(),e.getTime())}function JF(t,e){return t.name===e.name&&t.message===e.message&&t.cause===e.cause&&t.stack===e.stack}function QF(t,e){return t===e}function qx(t,e,n){const r=t.size;if(r!==e.size)return!1;if(!r)return!0;const o=new Array(r),l=t.entries();let a,c,d=0;for(;(a=l.next())&&!a.done;){const h=e.entries();let p=!1,g=0;for(;(c=h.next())&&!c.done;){if(o[g]){g++;continue}const b=a.value,v=c.value;if(n.equals(b[0],v[0],d,g,t,e,n)&&n.equals(b[1],v[1],b[0],v[0],t,e,n)){p=o[g]=!0;break}g++}if(!p)return!1;d++}return!0}const ZF=ko;function WF(t,e,n){const r=Ux(t);let o=r.length;if(Ux(e).length!==o)return!1;for(;o-- >0;)if(!LR(t,e,n,r[o]))return!1;return!0}function Gl(t,e,n){const r=$x(t);let o=r.length;if($x(e).length!==o)return!1;let l,a,c;for(;o-- >0;)if(l=r[o],!LR(t,e,n,l)||(a=Hx(t,l),c=Hx(e,l),(a||c)&&(!a||!c||a.configurable!==c.configurable||a.enumerable!==c.enumerable||a.writable!==c.writable)))return!1;return!0}function e5(t,e){return ko(t.valueOf(),e.valueOf())}function t5(t,e){return t.source===e.source&&t.flags===e.flags}function Gx(t,e,n){const r=t.size;if(r!==e.size)return!1;if(!r)return!0;const o=new Array(r),l=t.values();let a,c;for(;(a=l.next())&&!a.done;){const d=e.values();let h=!1,p=0;for(;(c=d.next())&&!c.done;){if(!o[p]&&n.equals(a.value,c.value,a.value,c.value,t,e,n)){h=o[p]=!0;break}p++}if(!h)return!1}return!0}function Xc(t,e){let n=t.byteLength;if(e.byteLength!==n||t.byteOffset!==e.byteOffset)return!1;for(;n-- >0;)if(t[n]!==e[n])return!1;return!0}function n5(t,e){return t.hostname===e.hostname&&t.pathname===e.pathname&&t.protocol===e.protocol&&t.port===e.port&&t.hash===e.hash&&t.username===e.username&&t.password===e.password}function LR(t,e,n,r){return(r===qF||r===UF||r===HF)&&(t.$$typeof||e.$$typeof)?!0:$F(e,r)&&n.equals(t[r],e[r],r,r,t,e,n)}const r5="[object ArrayBuffer]",i5="[object Arguments]",o5="[object Boolean]",s5="[object DataView]",l5="[object Date]",a5="[object Error]",u5="[object Map]",c5="[object Number]",f5="[object Object]",d5="[object RegExp]",h5="[object Set]",p5="[object String]",m5={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},g5="[object URL]",y5=Object.prototype.toString;function v5({areArrayBuffersEqual:t,areArraysEqual:e,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:o,areFunctionsEqual:l,areMapsEqual:a,areNumbersEqual:c,areObjectsEqual:d,arePrimitiveWrappersEqual:h,areRegExpsEqual:p,areSetsEqual:g,areTypedArraysEqual:b,areUrlsEqual:v,unknownTagComparators:S}){return function(C,E,A){if(C===E)return!0;if(C==null||E==null)return!1;const k=typeof C;if(k!==typeof E)return!1;if(k!=="object")return k==="number"?c(C,E,A):k==="function"?l(C,E,A):!1;const D=C.constructor;if(D!==E.constructor)return!1;if(D===Object)return d(C,E,A);if(Array.isArray(C))return e(C,E,A);if(D===Date)return r(C,E,A);if(D===RegExp)return p(C,E,A);if(D===Map)return a(C,E,A);if(D===Set)return g(C,E,A);const L=y5.call(C);if(L===l5)return r(C,E,A);if(L===d5)return p(C,E,A);if(L===u5)return a(C,E,A);if(L===h5)return g(C,E,A);if(L===f5)return typeof C.then!="function"&&typeof E.then!="function"&&d(C,E,A);if(L===g5)return v(C,E,A);if(L===a5)return o(C,E,A);if(L===i5)return d(C,E,A);if(m5[L])return b(C,E,A);if(L===r5)return t(C,E,A);if(L===s5)return n(C,E,A);if(L===o5||L===c5||L===p5)return h(C,E,A);if(S){let H=S[L];if(!H){const z=PF(C);z&&(H=S[z])}if(H)return H(C,E,A)}return!1}}function b5({circular:t,createCustomConfig:e,strict:n}){let r={areArrayBuffersEqual:GF,areArraysEqual:n?Gl:KF,areDataViewsEqual:YF,areDatesEqual:XF,areErrorsEqual:JF,areFunctionsEqual:QF,areMapsEqual:n?_p(qx,Gl):qx,areNumbersEqual:ZF,areObjectsEqual:n?Gl:WF,arePrimitiveWrappersEqual:e5,areRegExpsEqual:t5,areSetsEqual:n?_p(Gx,Gl):Gx,areTypedArraysEqual:n?_p(Xc,Gl):Xc,areUrlsEqual:n5,unknownTagComparators:void 0};if(e&&(r=Object.assign({},r,e(r))),t){const o=gc(r.areArraysEqual),l=gc(r.areMapsEqual),a=gc(r.areObjectsEqual),c=gc(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:o,areMapsEqual:l,areObjectsEqual:a,areSetsEqual:c})}return r}function S5(t){return function(e,n,r,o,l,a,c){return t(e,n,c)}}function x5({circular:t,comparator:e,createState:n,equals:r,strict:o}){if(n)return function(c,d){const{cache:h=t?new WeakMap:void 0,meta:p}=n();return e(c,d,{cache:h,equals:r,meta:p,strict:o})};if(t)return function(c,d){return e(c,d,{cache:new WeakMap,equals:r,meta:void 0,strict:o})};const l={cache:void 0,equals:r,meta:void 0,strict:o};return function(c,d){return e(c,d,l)}}const w5=Fi();Fi({strict:!0});Fi({circular:!0});Fi({circular:!0,strict:!0});Fi({createInternalComparator:()=>ko});Fi({strict:!0,createInternalComparator:()=>ko});Fi({circular:!0,createInternalComparator:()=>ko});Fi({circular:!0,createInternalComparator:()=>ko,strict:!0});function Fi(t={}){const{circular:e=!1,createInternalComparator:n,createState:r,strict:o=!1}=t,l=b5(t),a=v5(l),c=n?n(a):S5(a);return x5({circular:e,comparator:a,createState:r,equals:c,strict:o})}var zp={exports:{}},jp={};var Kx;function C5(){if(Kx)return jp;Kx=1;var t=ba(),e=dw();function n(h,p){return h===p&&(h!==0||1/h===1/p)||h!==h&&p!==p}var r=typeof Object.is=="function"?Object.is:n,o=e.useSyncExternalStore,l=t.useRef,a=t.useEffect,c=t.useMemo,d=t.useDebugValue;return jp.useSyncExternalStoreWithSelector=function(h,p,g,b,v){var S=l(null);if(S.current===null){var x={hasValue:!1,value:null};S.current=x}else x=S.current;S=c(function(){function E(H){if(!A){if(A=!0,k=H,H=b(H),v!==void 0&&x.hasValue){var z=x.value;if(v(z,H))return D=z}return D=H}if(z=D,r(k,H))return z;var j=b(H);return v!==void 0&&v(z,j)?(k=H,z):(k=H,D=j)}var A=!1,k,D,L=g===void 0?null:g;return[function(){return E(p())},L===null?void 0:function(){return E(L())}]},[p,g,b,v]);var C=o(h,S[0],S[1]);return a(function(){x.hasValue=!0,x.value=C},[C]),d(C),C},jp}var Yx;function M5(){return Yx||(Yx=1,zp.exports=C5()),zp.exports}var E5=M5(),R5=(...t)=>e=>{t.forEach(n=>{typeof n=="function"?n(e):n&&(n.current=e)})},T5=({contentComponent:t})=>{const e=hw.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getServerSnapshot);return T.jsx(T.Fragment,{children:Object.values(e)})};function A5(){const t=new Set;let e={};return{subscribe(n){return t.add(n),()=>{t.delete(n)}},getSnapshot(){return e},getServerSnapshot(){return e},setRenderer(n,r){e={...e,[n]:O1.createPortal(r.reactElement,r.element,n)},t.forEach(o=>o())},removeRenderer(n){const r={...e};delete r[n],e=r,t.forEach(o=>o())}}}var O5=class extends tn.Component{constructor(t){var e;super(t),this.editorContentRef=tn.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:!!((e=t.editor)!=null&&e.contentComponent)}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){var t;const e=this.props.editor;if(e&&!e.isDestroyed&&((t=e.view.dom)!=null&&t.parentNode)){if(e.contentComponent)return;const n=this.editorContentRef.current;n.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:n}),e.contentComponent=A5(),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=e.contentComponent.subscribe(()=>{this.setState(r=>r.hasContentComponentInitialized?r:{hasContentComponentInitialized:!0}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()})),e.createNodeViews(),this.initialized=!0}}componentWillUnmount(){var t;const e=this.props.editor;if(e){this.initialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),e.contentComponent=null;try{if(!((t=e.view.dom)!=null&&t.parentNode))return;const n=document.createElement("div");n.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:n})}catch{}}}render(){const{editor:t,innerRef:e,...n}=this.props;return T.jsxs(T.Fragment,{children:[T.jsx("div",{ref:R5(e,this.editorContentRef),...n}),t?.contentComponent&&T.jsx(T5,{contentComponent:t.contentComponent})]})}},k5=M.forwardRef((t,e)=>{const n=tn.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[t.editor]);return tn.createElement(O5,{key:n,innerRef:e,...t})}),BR=tn.memo(k5),N5=typeof window<"u"?M.useLayoutEffect:M.useEffect,D5=class{constructor(t){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=t,this.lastSnapshot={editor:t,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(t){return this.subscribers.add(t),()=>{this.subscribers.delete(t)}}watch(t){if(this.editor=t,this.editor){const e=()=>{this.transactionNumber+=1,this.subscribers.forEach(r=>r())},n=this.editor;return n.on("transaction",e),()=>{n.off("transaction",e)}}}};function _5(t){var e;const[n]=M.useState(()=>new D5(t.editor)),r=E5.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getServerSnapshot,t.selector,(e=t.equalityFn)!=null?e:w5);return N5(()=>n.watch(t.editor),[t.editor,n]),M.useDebugValue(r),r}var z5=!1,Mm=typeof window>"u",j5=Mm||!!(typeof window<"u"&&window.next),L5=class IR{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(n=>n())}getInitialEditor(){return this.options.current.immediatelyRender===void 0?Mm||j5?null:this.createEditor():(this.options.current.immediatelyRender,this.options.current.immediatelyRender?this.createEditor():null)}createEditor(){const e={...this.options.current,onBeforeCreate:(...r)=>{var o,l;return(l=(o=this.options.current).onBeforeCreate)==null?void 0:l.call(o,...r)},onBlur:(...r)=>{var o,l;return(l=(o=this.options.current).onBlur)==null?void 0:l.call(o,...r)},onCreate:(...r)=>{var o,l;return(l=(o=this.options.current).onCreate)==null?void 0:l.call(o,...r)},onDestroy:(...r)=>{var o,l;return(l=(o=this.options.current).onDestroy)==null?void 0:l.call(o,...r)},onFocus:(...r)=>{var o,l;return(l=(o=this.options.current).onFocus)==null?void 0:l.call(o,...r)},onSelectionUpdate:(...r)=>{var o,l;return(l=(o=this.options.current).onSelectionUpdate)==null?void 0:l.call(o,...r)},onTransaction:(...r)=>{var o,l;return(l=(o=this.options.current).onTransaction)==null?void 0:l.call(o,...r)},onUpdate:(...r)=>{var o,l;return(l=(o=this.options.current).onUpdate)==null?void 0:l.call(o,...r)},onContentError:(...r)=>{var o,l;return(l=(o=this.options.current).onContentError)==null?void 0:l.call(o,...r)},onDrop:(...r)=>{var o,l;return(l=(o=this.options.current).onDrop)==null?void 0:l.call(o,...r)},onPaste:(...r)=>{var o,l;return(l=(o=this.options.current).onPaste)==null?void 0:l.call(o,...r)},onDelete:(...r)=>{var o,l;return(l=(o=this.options.current).onDelete)==null?void 0:l.call(o,...r)}};return new eF(e)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,n){return Object.keys(e).every(r=>["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(r)?!0:r==="extensions"&&e.extensions&&n.extensions?e.extensions.length!==n.extensions.length?!1:e.extensions.every((o,l)=>{var a;return o===((a=n.extensions)==null?void 0:a[l])}):e[r]===n[r])}onRender(e){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&e.length===0?IR.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(e),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((r,o)=>r===e[o]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){const e=this.instanceId,n=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){n&&n.setOptions(this.options.current);return}n&&!n.isDestroyed&&(n.destroy(),this.instanceId===e&&this.setEditor(null))},1)}};function B5(t={},e=[]){const n=M.useRef(t);n.current=t;const[r]=M.useState(()=>new L5(n)),o=hw.useSyncExternalStore(r.subscribe,r.getEditor,r.getServerSnapshot);return M.useDebugValue(o),M.useEffect(r.onRender(e)),_5({editor:o,selector:({transactionNumber:l})=>t.shouldRerenderOnTransaction===!1||t.shouldRerenderOnTransaction===void 0?null:t.immediatelyRender&&l===0?0:l+1}),o}var VR=M.createContext({editor:null});VR.Consumer;var I5=M.createContext({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),V5=()=>M.useContext(I5);tn.forwardRef((t,e)=>{const{onDragStart:n}=V5(),r=t.as||"div";return T.jsx(r,{...t,ref:e,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...t.style}})});tn.createContext({markViewContentRef:()=>{}});var Tg=M.createContext({get editor(){throw new Error("useTiptap must be used within a <Tiptap> provider")}});Tg.displayName="TiptapContext";var F5=()=>M.useContext(Tg);function FR({editor:t,instance:e,children:n}){const r=t??e;if(!r)throw new Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");const o=M.useMemo(()=>({editor:r}),[r]),l=M.useMemo(()=>({editor:r}),[r]);return T.jsx(VR.Provider,{value:l,children:T.jsx(Tg.Provider,{value:o,children:n})})}FR.displayName="Tiptap";function PR({...t}){const{editor:e}=F5();return T.jsx(BR,{editor:e,...t})}PR.displayName="Tiptap.Content";Object.assign(FR,{Content:PR});function P5({className:t,...e}){return T.jsx("div",{"data-slot":"input-group",role:"group",className:Ne("group/input-group relative flex h-7 w-full min-w-0 items-center rounded-md border border-input bg-input/20 transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-data-[align=block-end]:rounded-md has-data-[align=block-start]:rounded-md has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-2 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/30 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-2 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[textarea]:rounded-md has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5",t),...e})}const $5=zm("flex h-auto cursor-text items-center justify-center gap-1 py-2 text-xs/relaxed font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 **:data-[slot=kbd]:rounded-[calc(var(--radius-sm)-2px)] **:data-[slot=kbd]:bg-muted-foreground/10 **:data-[slot=kbd]:px-1 **:data-[slot=kbd]:text-[0.625rem] [&>svg:not([class*='size-'])]:size-3.5",{variants:{align:{"inline-start":"order-first pl-2 has-[>button]:ml-[-0.275rem] has-[>kbd]:ml-[-0.275rem]","inline-end":"order-last pr-2 has-[>button]:mr-[-0.275rem] has-[>kbd]:mr-[-0.275rem]","block-start":"order-first w-full justify-start px-2 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2","block-end":"order-last w-full justify-start px-2 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2"}},defaultVariants:{align:"inline-start"}});function Xx({className:t,align:e="inline-start",...n}){return T.jsx("div",{role:"group","data-slot":"input-group-addon","data-align":e,className:Ne($5({align:e}),t),onClick:r=>{r.target.closest("button")||r.currentTarget.parentElement?.querySelector("input")?.focus()},...n})}const H5=zm("flex items-center gap-2 rounded-md text-xs/relaxed shadow-none",{variants:{size:{xs:"h-5 gap-1 rounded-[calc(var(--radius-sm)-2px)] px-1 [&>svg:not([class*='size-'])]:size-3",sm:"gap-1","icon-xs":"size-6 p-0 has-[>svg]:p-0","icon-sm":"size-7 p-0 has-[>svg]:p-0"}},defaultVariants:{size:"xs"}});function U5({className:t,type:e="button",variant:n="ghost",size:r="xs",...o}){return T.jsx(Ls,{type:e,"data-size":r,variant:n,className:Ne(H5({size:r}),t),...o})}const Jx=new Jt("data-table-search-selector-highlighter"),$R="refresh-data-table-search-selector-highlighter",HR={fields:[]};function Qx(t){const e=k3(Jc(t),HR.fields);return ot.create(t,e.map(n=>{const r=_s(t,n.start),o=_s(t,n.end);return r>=o?null:Ut.inline(r,o,{class:"data-table-search-input-selector-token","data-table-search-selector":""},{inclusiveEnd:!1,inclusiveStart:!1})}).filter(n=>n!==null))}const q5=St.create({name:"dataTableSelectorHighlighter",addProseMirrorPlugins(){return[new bt({key:Jx,state:{init:(t,e)=>Qx(e.doc),apply:(t,e,n,r)=>t.docChanged||t.getMeta($R)?Qx(r.doc):e.map(t.mapping,t.doc)},props:{decorations(t){return Jx.getState(t)}}})]}});function Zx(t,e){if(typeof t=="function"){t(e);return}t&&(t.current=e)}function Wx(t){return{content:t?[{content:[{text:t,type:"text"}],type:"paragraph"}]:[{type:"paragraph"}],type:"doc"}}function Jc(t){return t.textBetween(0,t.content.size,"","")}function As(t){return t.state.doc.textBetween(0,t.state.selection.from,"","").length}function _s(t,e){const n=Jc(t).length;let o=Math.max(0,Math.min(e,n)),l=Oe.atStart(t).from;return t.descendants((a,c)=>{if(!a.isText)return!0;const d=a.text??"";return o<=d.length?(l=c+o,!1):(o-=d.length,l=c+d.length,!0)}),l}function G5(t){return t.replace(/\r\n?/g,`
|
|
159
|
+
`).replace(/\n/g," ")}function e1(t,e,n){return e<=0?-1:t<0?n===1?0:e-1:(t+n+e)%e}function K5({inputRef:t,isLoading:e=!1,placeholder:n="Search table...",...r}){const o=hf(),l="fields"in r?r.fields:o?.searchFields??void 0,a="value"in r?r.value:o?.search??void 0,c="onSearchChange"in r?r.onSearchChange:o?.setSearch??void 0,d=M.useRef(null),h=M.useRef([]),p=M.useRef(a??""),g=M.useRef(!1),b=M.useRef(-1),v=M.useRef(!1),S=M.useRef([]),x=M.useRef(()=>{}),C=M.useRef(null),[E,A]=M.useState(0),[k,D]=M.useState(!1),[L,H]=M.useState(-1);if(!l||a===void 0||!c)throw new Error("DataTableSearchInput must be used inside DataTableProvider or receive fields, value, and onSearchChange props.");const z=M.useCallback(U=>{b.current=U,H(U)},[]),j=M.useMemo(()=>N3(a,E,l),[E,l,a]),J=M.useMemo(()=>j.filter(U=>U.group==="input"),[j]),le=M.useMemo(()=>j.filter(U=>U.group==="values"),[j]),ce=M.useMemo(()=>j.filter(U=>U.group==="filters"),[j]),se=M.useCallback((U,K,G)=>{U.commands.setContent(Wx(K),{emitUpdate:!1,parseOptions:{preserveWhitespace:"full"}}),G&&U.commands.setTextSelection({from:_s(U.state.doc,G.start),to:_s(U.state.doc,G.end)})},[]),Se=M.useCallback((U,K)=>{const G=D3(a,E,l,K);C.current={end:G.selectionStart,start:G.selectionStart},A(G.selectionStart),D(G.keepOpen),G.keepOpen||(v.current=!0),U&&(se(U,G.value,C.current),U.commands.focus()),c(G.value)},[E,l,c,se,a]),ne=B5({content:Wx(a),editorProps:{attributes:{autocapitalize:"off",autocomplete:"off",autocorrect:"off",class:"data-table-search-input-editor min-w-0 flex-1 overflow-x-auto px-2 py-0 text-sm outline-none whitespace-pre",spellcheck:"false"},handleKeyDown:(U,K)=>{if(K.key==="Escape")return K.preventDefault(),v.current=!0,D(!1),!0;if(K.key==="ArrowDown")return K.preventDefault(),D(!0),z(e1(b.current,S.current.length,1)),!0;if(K.key==="ArrowUp")return K.preventDefault(),D(!0),z(e1(b.current,S.current.length,-1)),!0;if(K.key==="Tab"){const G=S.current[b.current];return!g.current||!G?!1:(K.preventDefault(),x.current(ne,G),!0)}if(K.key==="Enter"){K.preventDefault(),K.stopPropagation();const G=S.current[b.current];return g.current&&G?x.current(ne,G):A(As(ne)),!0}return!1},handlePaste:(U,K)=>{const G=K.clipboardData?.getData("text/plain");return typeof G!="string"?!1:(K.preventDefault(),U.dispatch(U.state.tr.insertText(G5(G),U.state.selection.from,U.state.selection.to)),!0)}},extensions:[fF,pF,BF,jF.configure({placeholder:n}),q5,St.create({name:"singleLineSearchBehavior",addKeyboardShortcuts(){return{Enter:()=>!0}}})],immediatelyRender:!0,onSelectionUpdate:({editor:U})=>{A(As(U))},onUpdate:({editor:U})=>{const K=Jc(U.state.doc);A(As(U)),K!==p.current&&c(K),D(!0)}},[]);M.useEffect(()=>{p.current=a},[a]),M.useEffect(()=>{g.current=k},[k]),M.useEffect(()=>{b.current=L},[L]),M.useEffect(()=>{S.current=j},[j]),M.useEffect(()=>{x.current=Se},[Se]),M.useEffect(()=>{h.current.length=j.length},[j.length]),M.useEffect(()=>{HR.fields=l},[l]),M.useEffect(()=>{ne&&ne.view.dispatch(ne.state.tr.setMeta($R,!0))},[ne,l]),M.useEffect(()=>{if(!ne)return;const U=C.current;Jc(ne.state.doc)!==a?se(ne,a,U??void 0):U&&ne.commands.setTextSelection({from:_s(ne.state.doc,U.start),to:_s(ne.state.doc,U.end)}),C.current=null,A(As(ne))},[ne,se,a]),M.useEffect(()=>{const U=Math.min(E,a.length);U!==E&&A(U)},[E,a.length]),M.useEffect(()=>{const U=j.length>0?Math.min(L,j.length-1):-1;z(k?U:-1)},[L,k,z,j.length]),M.useEffect(()=>{!k||L<0||h.current[L]?.scrollIntoView({block:"nearest"})},[L,k]),M.useEffect(()=>{const U=K=>{d.current?.contains(K.target)||D(!1)};return window.addEventListener("pointerdown",U),()=>window.removeEventListener("pointerdown",U)},[]),M.useEffect(()=>{if(t)return Zx(t,{focus:()=>{ne?.commands.focus()},selectAll:()=>{ne?.chain().focus().selectAll().run()}}),()=>Zx(t,null)},[ne,t]);const me=e,I=[{items:J,label:void 0},{items:le,label:"Values"},{items:ce,label:"Filters"}];let Q=0;return T.jsxs("div",{ref:d,className:"relative min-w-64 flex-1",children:[T.jsxs(P5,{className:"h-10 w-full text-lg focus-within:border-ring focus-within:ring-2 focus-within:ring-ring/30",children:[T.jsx(Xx,{align:"inline-start",children:T.jsx("span",{"aria-hidden":"true",className:"flex size-5 shrink-0 items-center justify-center",children:me?T.jsx(ef,{className:"size-4.5 animate-spin"}):T.jsx(Rm,{className:"size-4.5"})})}),T.jsx("div",{className:"min-w-0 flex-1",children:T.jsx(BR,{editor:ne,onBlur:()=>{requestAnimationFrame(()=>{d.current?.contains(document.activeElement)||D(!1),v.current=!1})},onClick:()=>{A(ne?As(ne):0),v.current=!1,D(!0)},onFocus:()=>{if(A(ne?As(ne):0),v.current){v.current=!1;return}D(!0)}})}),T.jsx(Xx,{align:"inline-end",children:a?T.jsx(U5,{"aria-label":"Clear search",size:"icon-xs",variant:"ghost",onClick:()=>{if(!ne){c(""),A(0),D(!1);return}C.current={end:0,start:0},A(0),D(!1),se(ne,"",C.current),ne.commands.focus(),c("")},children:T.jsx(Tm,{className:"pointer-events-none"})}):null})]}),k?T.jsx("div",{className:"absolute top-full left-0 z-50 mt-1 w-full",children:T.jsx("div",{className:"max-h-[min(calc(var(--spacing(72)---spacing(9)),calc(100svh---spacing(20)))] overflow-hidden rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10",children:j.length===0?T.jsx("div",{className:"flex w-full justify-center py-2 text-center text-xs/relaxed text-muted-foreground",children:"No items found."}):T.jsx("div",{className:"max-h-[min(calc(var(--spacing(72)---spacing(9)),calc(100svh---spacing(20)))] overflow-y-auto p-1",children:I.map(U=>U.items.length===0?null:T.jsxs("div",{children:[U.label?T.jsx("div",{className:"px-2 py-1.5 text-xs text-muted-foreground",children:U.label}):null,U.items.map(K=>{const G=Q;return Q+=1,T.jsx("button",{ref:N=>{h.current[G]=N},type:"button",className:`relative flex min-h-7 w-full cursor-default items-center gap-2 rounded-md px-2 py-1 text-left text-xs/relaxed outline-hidden select-none hover:bg-accent hover:text-accent-foreground ${G===L?"bg-accent text-accent-foreground":""}`,"data-highlighted":G===L?"":void 0,onClick:()=>Se(ne,K),onMouseDown:N=>{N.preventDefault()},onMouseEnter:()=>z(G),children:T.jsx("span",{className:"truncate",children:K.label})},K.id)})]},U.label??"Input"))})})}):null]})}function UR({...t}){return T.jsx(t3,{"data-slot":"dropdown-menu",...t})}function qR({...t}){return T.jsx(n3,{"data-slot":"dropdown-menu-trigger",...t})}function GR({className:t,align:e="start",sideOffset:n=4,...r}){return T.jsx(r3,{children:T.jsx(i3,{"data-slot":"dropdown-menu-content",sideOffset:n,align:e,className:Ne("z-50 max-h-(--radix-dropdown-menu-content-available-height) w-(--radix-dropdown-menu-trigger-width) min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:overflow-hidden data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",t),...r})})}function Lp({className:t,inset:e,variant:n="default",...r}){return T.jsx(s3,{"data-slot":"dropdown-menu-item","data-inset":e,"data-variant":n,className:Ne("group/dropdown-menu-item relative flex min-h-7 cursor-default items-center gap-2 rounded-md px-2 py-1 text-xs/relaxed outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7.5 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5 data-[variant=destructive]:*:[svg]:text-destructive",t),...r})}function t1({className:t,children:e,checked:n,inset:r,...o}){return T.jsxs(l3,{"data-slot":"dropdown-menu-checkbox-item","data-inset":r,className:Ne("relative flex min-h-7 cursor-default items-center gap-2 rounded-md py-1.5 pr-8 pl-2 text-xs outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7.5 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5",t),checked:n,...o,children:[T.jsx("span",{className:"pointer-events-none absolute right-2 flex items-center justify-center","data-slot":"dropdown-menu-checkbox-item-indicator",children:T.jsx(oM,{children:T.jsx(qs,{})})}),e]})}function KR({...t}){return T.jsx(a3,{"data-slot":"dropdown-menu-radio-group",...t})}function YR({className:t,children:e,inset:n,...r}){return T.jsxs(u3,{"data-slot":"dropdown-menu-radio-item","data-inset":n,className:Ne("relative flex min-h-7 cursor-default items-center gap-2 rounded-md py-1.5 pr-8 pl-2 text-xs outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7.5 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5",t),...r,children:[T.jsx("span",{className:"pointer-events-none absolute right-2 flex items-center justify-center","data-slot":"dropdown-menu-radio-item-indicator",children:T.jsx(oM,{children:T.jsx(qs,{})})}),e]})}function Ns({className:t,inset:e,...n}){return T.jsx(o3,{"data-slot":"dropdown-menu-label","data-inset":e,className:Ne("px-2 py-1.5 text-xs text-muted-foreground data-inset:pl-7.5",t),...n})}function fo({className:t,...e}){return T.jsx(c3,{"data-slot":"dropdown-menu-separator",className:Ne("-mx-1 my-1 h-px bg-border/50",t),...e})}function Bp({...t}){return T.jsx(f3,{"data-slot":"dropdown-menu-sub",...t})}function Ip({className:t,inset:e,children:n,...r}){return T.jsxs(d3,{"data-slot":"dropdown-menu-sub-trigger","data-inset":e,className:Ne("flex min-h-7 cursor-default items-center gap-2 rounded-md px-2 py-1 text-xs outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7.5 data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5",t),...r,children:[n,T.jsx(p1,{className:"ml-auto"})]})}function Vp({className:t,...e}){return T.jsx(h3,{"data-slot":"dropdown-menu-sub-content",className:Ne("z-50 min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",t),...e})}function Y5({isConnected:t,isConnecting:e,className:n}){const r=t?{dotClassName:"bg-emerald-500",label:"Connected",textClassName:"text-emerald-600 dark:text-emerald-400"}:e?{dotClassName:"bg-amber-500",label:"Connecting",textClassName:"text-amber-600 dark:text-amber-400"}:{dotClassName:"bg-muted-foreground/60",label:"Disconnected",textClassName:"text-muted-foreground"};return T.jsxs("div",{className:Ne("inline-flex items-center gap-2 text-xs font-medium",n),children:[T.jsx("span",{"aria-hidden":"true",className:Ne("size-2 rounded-full",r.dotClassName)}),T.jsx("span",{className:r.textClassName,children:r.label})]})}function X5({streams:t,selectedStreamId:e,isConnected:n,isConnecting:r,isDisabled:o=!1,canClear:l=!0,onClear:a,onPause:c,onPlay:d,onSelectStream:h,className:p}){const g=M.useMemo(()=>e?t.find(x=>x.id===e)?.label??"Select a stream":t[0]?.label??"Select a stream",[e,t]),b=!o&&t.length>0,v=!o&&!!e&&!r,S=n?"Pause stream":"Play stream";return T.jsxs("div",{className:"flex items-center gap-2",children:[T.jsxs("div",{className:Ne("flex min-w-0 h-10 overflow-hidden rounded-md border border-input bg-background",p),children:[T.jsxs(UR,{children:[T.jsx(qR,{asChild:!0,children:T.jsxs(Ls,{type:"button",variant:"ghost",className:"h-10 min-w-0 border-0 flex-1 justify-between",disabled:!b,children:[T.jsx("span",{className:"truncate text-sm",children:g}),T.jsx($O,{className:"size-4 text-muted-foreground"})]})}),T.jsxs(GR,{align:"start",sideOffset:10,className:"max-h-80 max-w-[min(24rem,calc(100vw-2rem))]",children:[T.jsx("div",{className:"px-2 py-1.5",children:T.jsx(Y5,{isConnected:n,isConnecting:r})}),T.jsx(fo,{}),T.jsx(Ns,{children:"Streams"}),T.jsx(fo,{}),T.jsx(KR,{value:e??"",onValueChange:h,children:t.map(x=>T.jsx(YR,{value:x.id,className:"min-h-9 text-sm",children:x.label},x.id))})]})]}),T.jsx(Ls,{type:"button",variant:"ghost",size:"icon-xl",disabled:!l,"aria-label":"Clear rows",onClick:a,className:"rounded-full",children:T.jsx(Tm,{className:"size-5"})})]}),T.jsxs(Ls,{type:"button",size:"xl",variant:"outline",disabled:!v,"aria-label":S,onClick:n?c:d,className:Ne(n?"border-blue-500 ring-1 ring-blue-500 text-blue-500!":"","cursor-pointer gap-2"),children:[T.jsx("div",{className:Ne("[&_svg]:shrink-0 [&_svg]:size-3",r?"animate-spin":""),children:r?T.jsx(ef,{}):n?T.jsx(YO,{className:"[&_rect]:fill-current"}):T.jsx(GO,{className:"[&_path]:fill-current"})}),"Live"]})]})}const XR="(prefers-color-scheme: dark)",J5=["dark","light","system"],JR=M.createContext(void 0);function n1(t){return t===null?!1:J5.includes(t)}function r1(){return window.matchMedia(XR).matches?"dark":"light"}function Q5(){const t=document.createElement("style");return t.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;transition:none!important}")),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),requestAnimationFrame(()=>{requestAnimationFrame(()=>{t.remove()})})}}function Z5(t){return t instanceof HTMLElement?!!(t.isContentEditable||t.closest("input, textarea, select, [contenteditable='true']")):!1}function W5({children:t,defaultTheme:e="system",storageKey:n="theme",disableTransitionOnChange:r=!0,...o}){const[l,a]=M.useState(()=>{const p=localStorage.getItem(n);return n1(p)?p:e}),c=M.useCallback(p=>{localStorage.setItem(n,p),a(p)},[n]),d=M.useCallback(p=>{const g=document.documentElement,b=p==="system"?r1():p,v=r?Q5():null;g.classList.remove("light","dark"),g.classList.add(b),v&&v()},[r]);M.useEffect(()=>{if(d(l),l!=="system")return;const p=window.matchMedia(XR),g=()=>{d("system")};return p.addEventListener("change",g),()=>{p.removeEventListener("change",g)}},[l,d]),M.useEffect(()=>{const p=g=>{g.repeat||g.metaKey||g.ctrlKey||g.altKey||Z5(g.target)||g.key.toLowerCase()==="d"&&a(b=>{const v=b==="dark"?"light":b==="light"?"dark":r1()==="dark"?"light":"dark";return localStorage.setItem(n,v),v})};return window.addEventListener("keydown",p),()=>{window.removeEventListener("keydown",p)}},[n]),M.useEffect(()=>{const p=g=>{if(g.storageArea===localStorage&&g.key===n){if(n1(g.newValue)){a(g.newValue);return}a(e)}};return window.addEventListener("storage",p),()=>{window.removeEventListener("storage",p)}},[e,n]);const h=M.useMemo(()=>({theme:l,setTheme:c}),[l,c]);return T.jsx(JR.Provider,{...o,value:h,children:t})}const eP=()=>{const t=M.useContext(JR);if(t===void 0)throw new Error("useTheme must be used within a ThemeProvider");return t},tP=[{icon:b1,label:"Light",value:"light"},{icon:y1,label:"Dark",value:"dark"},{icon:v1,label:"System",value:"system"}];function nP({columns:t,groupedColumnIds:e,isDisabled:n=!1,onExportCsv:r,onExportMarkdown:o,onClearGrouping:l,onToggleGrouping:a,onToggleColumn:c,className:d}){const{theme:h,setTheme:p}=eP(),g=!n&&t.length>0,b=M.useMemo(()=>e.flatMap(v=>{const S=t.find(x=>x.id===v);return S?[S.label]:[]}),[t,e]);return T.jsxs(UR,{children:[T.jsx(qR,{asChild:!0,children:T.jsx(Ls,{type:"button",variant:"outline",size:"icon-xl",disabled:n,className:Ne("shrink-0",d),"aria-label":"Open settings",children:T.jsx(ZO,{className:"size-4"})})}),T.jsxs(GR,{align:"end",sideOffset:10,className:"w-64 max-w-[min(24rem,calc(100vw-2rem))]",children:[T.jsx(Ns,{children:"View"}),T.jsxs(Bp,{children:[T.jsxs(Ip,{className:"min-h-9 text-sm",children:[T.jsx(v1,{className:"size-4 text-muted-foreground"}),"Columns"]}),T.jsxs(Vp,{className:"max-h-80 w-64 overflow-y-auto",children:[T.jsx(Ns,{children:"Visible columns"}),T.jsx(fo,{}),t.map(v=>T.jsx(t1,{checked:v.visible,className:"min-h-9 text-sm",onSelect:S=>{S.preventDefault()},onCheckedChange:S=>c(v.id,S===!0),children:T.jsxs("span",{className:"flex min-w-0 items-center gap-2 pr-4",children:[v.kind?T.jsx(ia,{kind:v.kind,className:"size-4 shrink-0 text-muted-foreground"}):null,T.jsx("span",{className:"truncate",children:v.label})]})},v.id))]})]}),T.jsxs(Bp,{children:[T.jsxs(Ip,{className:"min-h-9 text-sm",disabled:n||t.length===0,children:[T.jsx(lk,{className:"size-4 text-muted-foreground"}),"Group rows"]}),T.jsxs(Vp,{className:"max-h-80 w-64 overflow-y-auto",children:[T.jsx(Ns,{children:b.length>0?`Grouped by ${b.join(", ")}`:"Group rows by field"}),T.jsx(fo,{}),T.jsx(Lp,{className:"min-h-9 text-sm",disabled:e.length===0,onSelect:v=>{v.preventDefault(),l()},children:"Clear grouping"}),T.jsx(fo,{}),t.map(v=>T.jsx(t1,{checked:e.includes(v.id),className:"min-h-9 text-sm",onSelect:S=>{S.preventDefault()},onCheckedChange:S=>a(v.id,S===!0),children:T.jsxs("span",{className:"flex min-w-0 items-center gap-2 pr-4",children:[v.kind?T.jsx(ia,{kind:v.kind,className:"size-4 shrink-0 text-muted-foreground"}):null,T.jsx("span",{className:"truncate",children:v.label})]})},v.id))]})]}),T.jsxs(Bp,{children:[T.jsxs(Ip,{className:"min-h-9 text-sm",children:[T.jsx(b1,{className:"size-4 text-muted-foreground dark:hidden"}),T.jsx(y1,{className:"hidden size-4 text-muted-foreground dark:block"}),"Theme"]}),T.jsxs(Vp,{className:"w-44",children:[T.jsx(Ns,{children:"Appearance"}),T.jsx(fo,{}),T.jsx(KR,{value:h,onValueChange:v=>p(v),children:tP.map(v=>{const S=v.icon;return T.jsxs(YR,{value:v.value,className:"min-h-9 text-sm",children:[T.jsx(S,{className:"size-4 text-muted-foreground"}),v.label]},v.value)})})]})]}),T.jsx(fo,{}),T.jsx(Ns,{children:"Export"}),T.jsxs(Lp,{className:"min-h-9 text-sm",disabled:!g,onSelect:r,children:[T.jsx($p,{className:"size-4 text-muted-foreground"}),"Export CSV"]}),T.jsxs(Lp,{className:"min-h-9 text-sm",disabled:!g,onSelect:o,children:[T.jsx($p,{className:"size-4 text-muted-foreground"}),"Export Markdown"]})]})]})}const Qc="stream",QR="datatable-",i1="datool";function Zc(t){return`${t}-search`}function Wc(t){return`${QR}${t}`}function rP(t){return t.startsWith(`${QR}${i1}`)||t.startsWith(`${i1}-`)&&t.endsWith("-search")}function Ag(t){if(typeof window>"u")return null;try{const e=new URL(window.location.href).searchParams.get(Wc(t));return e?JSON.parse(e):null}catch{return null}}function ZR(t,e){const n=new Set(e);return Object.fromEntries(Object.entries(t??{}).filter(([r])=>n.has(r)))}function WR(t,e){const n=new Set(e);return(t??[]).filter((r,o,l)=>n.has(r)&&l.indexOf(r)===o)}function iP(t,e){const n=Zc(e),r=Wc(e);for(const o of Array.from(t.searchParams.keys()))o===Qc||o===n||o===r||rP(o)&&t.searchParams.delete(o)}function eT(){return typeof window>"u"?null:new URL(window.location.href).searchParams.get(Qc)}function Fp(t){return typeof window>"u"?"":new URL(window.location.href).searchParams.get(Zc(t))??""}function o1(t,e){return ZR(Ag(t)?.columnVisibility,e)}function s1(t,e){return WR(Ag(t)?.groupBy,e)}function oP({columnIds:t,columnVisibility:e,groupBy:n,search:r,selectedStreamId:o,tableId:l}){if(typeof window>"u")return;const a=new URL(window.location.href),c=r.trim(),d=ZR(e,t),h=WR(n,t),p={...Ag(l)};iP(a,l),o?a.searchParams.set(Qc,o):a.searchParams.delete(Qc),c?a.searchParams.set(Zc(l),r):a.searchParams.delete(Zc(l)),Object.keys(d).length>0?p.columnVisibility=d:delete p.columnVisibility,h.length>0?p.groupBy=h:delete p.groupBy,Object.keys(p).length>0?a.searchParams.set(Wc(l),JSON.stringify(p)):a.searchParams.delete(Wc(l)),window.history.replaceState(window.history.state,"",a)}const sP={Ban:jO,Check:qs,CircleAlert:Em,Copy:m1,Download:$p,ExternalLink:ek,Filter:g1,Info:ok,Play:mk,RefreshCcw:yk,Search:Rm,Trash:Ck,X:Tm};function lP(t,e){const n=t.findIndex(r=>r.__datoolRowId===e.__datoolRowId);return n<0?[...t,e]:t.map((r,o)=>o===n?e:r)}const aP=32;function uP(t){return t.map(({__datoolRowId:e,...n})=>n)}function cP(t){if(t===void 0)return"undefined:";if(t===null)return"null:";if(t instanceof Date)return`date:${t.toISOString()}`;if(typeof t=="object")try{return`object:${JSON.stringify(t)}`}catch{return`object:${String(t)}`}return`${typeof t}:${String(t)}`}function fP(t,e){if(e.length===0||t.length===0)return{groupStartRowIds:new Set,rows:t};const n=[],r=new Map;for(const a of t){const c=e.map(h=>cP(pf(a,h.accessorKey))).join(""),d=r.get(c);if(d){d.push(a);continue}n.push(c),r.set(c,[a])}const o=[],l=new Set;return n.forEach((a,c)=>{const d=r.get(a)??[];c>0&&d[0]&&l.add(d[0].__datoolRowId),o.push(...d)}),{groupStartRowIds:l,rows:o}}function dP(t,e,n){if(!n||n.length===0)return t;const r=new Map(e.map((o,l)=>[o,n[l]??!0]));return t.flatMap(o=>{const l=r.get(o.__datoolRowId);return l===void 0||l===!0?[o]:l===!1||l===null?[]:[{...l,__datoolRowId:o.__datoolRowId}]})}function hP(){return eT()}function pP(t){return t.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,e=>e.toUpperCase())}function Pp(t){return t?`datool-${t}`:"datool"}function tT(t,e){if(t==null||t==="")return"";if(e==="date"){const n=t instanceof Date?t:new Date(t);if(!Number.isNaN(n.getTime()))return n.toISOString()}return typeof t=="object"?JSON.stringify(t):String(t)}function l1(t){return/[",\n]/.test(t)?`"${t.replaceAll('"','""')}"`:t}function a1(t){return t.replace(/\|/g,"\\|").replace(/\r\n?/g,`
|
|
160
|
+
`).replace(/\n/g,"<br />")}function mP(t){return t.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"log-view"}function gP(t,e,n){const r=new Blob([t],{type:`${n};charset=utf-8`}),o=window.URL.createObjectURL(r),l=document.createElement("a");l.href=o,l.download=e,document.body.appendChild(l),l.click(),l.remove(),window.setTimeout(()=>{window.URL.revokeObjectURL(o)},0)}function yP(t,e){const n=e.map(o=>l1(o.label)).join(","),r=t.map(o=>e.map(l=>l1(tT(pf(o,l.accessorKey),l.kind))).join(","));return[n,...r].join(`
|
|
161
|
+
`)}function vP(t,e){const n=`| ${e.map(l=>a1(l.label)).join(" | ")} |`,r=`| ${e.map(()=>"---").join(" | ")} |`,o=t.map(l=>`| ${e.map(a=>a1(tT(pf(l,a.accessorKey),a.kind))).join(" | ")} |`);return[n,r,...o].join(`
|
|
162
|
+
`)}function bP(t){return t.map((e,n)=>{const r=rL(e.accessorKey);return{accessorFn:r?o=>pf(o,e.accessorKey):void 0,accessorKey:r?void 0:e.accessorKey,align:e.align,enumColors:e.enumColors,header:e.header,id:MM(e,n),kind:e.kind,maxWidth:e.maxWidth,minWidth:e.minWidth,truncate:e.truncate,width:e.width}})}function SP(t){return JSON.parse(t.data)}function xP(t){return JSON.parse(t.data)}function wP(t){return JSON.parse(t.data)}function Og(t){return t==null?"":t instanceof Date?t.toISOString():typeof t=="object"?JSON.stringify(t):String(t)}function u1(t){return t.replace(/\|/g,"\\|").replace(/\r\n?/g,`
|
|
163
|
+
`).replace(/\n/g,"<br />")}function nT(t,e){if(e.accessorFn)return e.accessorFn(t);if(e.accessorKey)return t[e.accessorKey]}function rT(t,e){return t.header??t.id??t.accessorKey??`Column ${e+1}`}function CP(t,e){const n=e.map((o,l)=>u1(rT(o,l)));return[`| ${n.join(" | ")} |`,`| ${n.map(()=>"---").join(" | ")} |`,...t.map(o=>`| ${e.map(a=>u1(Og(nT(o,a)))).join(" | ")} |`)].join(`
|
|
164
|
+
`)}function MP(t,e){const n=Og(e);return n.trim()?`${t}:${cM(n)}`:null}function EP(t,e,n){const r=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=aM(t).filter(l=>!l.match(new RegExp(`^${r}(:|>|<)`)));return o.push(n),o.join(" ")}function RP({activeStream:t,columns:e,config:n,errorMessage:r,isConnected:o,isConnecting:l,isLoadingConfig:a,rows:c,settingsColumns:d,groupedColumnIds:h,groupedRowStartIds:p,selectedStreamId:g,setGroupedColumnIds:b,setColumnVisibility:v,searchInputRef:S,handleExport:x,setRows:C,setSelectedStreamId:E,setShouldConnect:A}){const{search:k,setSearch:D}=$3(),L=M.useCallback(z=>{if(p.has(z.__datoolRowId))return{borderTop:`${aP}px solid var(--color-table-gap)`,boxShadow:"inset 0 1px 0 0 var(--color-border)"}},[p]),H=M.useMemo(()=>[...t?.actions.map(j=>({button:j.button,icon:j.icon?sP[j.icon]:void 0,id:`config-${j.id}`,label:j.label,onSelect:async({actionRowIds:J,actionRows:le})=>{if(!t)return;const ce=new URL(`/api/streams/${encodeURIComponent(t.id)}/actions/${encodeURIComponent(j.id)}`,window.location.origin),se=new URL(window.location.href).searchParams;for(const[I,Q]of se.entries())ce.searchParams.set(I,Q);const Se={rows:uP(le)},ne=await fetch(ce,{body:JSON.stringify(Se),headers:{"Content-Type":"application/json"},method:"POST"}),me=await ne.json().catch(()=>null);if(!ne.ok)throw new Error(me?.error??`Failed to run action "${j.label}".`);if(me?.rowChanges!==void 0&&!Array.isArray(me.rowChanges))throw new Error(`Action "${j.label}" returned an invalid response.`);C(I=>dP(I,J,me?.rowChanges))},scope:"selection"}))??[],{icon:m1,id:"copy-markdown",label:({actionRows:j})=>j.length>1?`Copy ${j.length} rows as Markdown`:"Copy row as Markdown",onSelect:async({actionRows:j})=>{await navigator.clipboard.writeText(CP(j,e))},scope:"selection"},{icon:g1,id:"filter-matching",items:({anchorRow:j})=>e.map((J,le)=>{const ce=nT(j,J),se=MP(J.id??`column-${le}`,ce);return{disabled:se===null,icon:Se=>T.jsx(ia,{kind:J.kind??"text",...Se}),id:`filter-${J.id??le}`,label:`${rT(J,le)}: ${Og(ce)||"(empty)"}`,onSelect:()=>{se&&D(EP(k,J.id??`column-${le}`,se))},scope:"row"}}),label:"Filter matching",scope:"row"}],[t,e,k,D]);return T.jsxs("main",{className:"flex h-svh min-h-0 w-full min-w-0 flex-col gap-3 bg-background px-0 pt-3 pb-0",children:[T.jsxs("header",{className:"flex w-full flex-wrap items-start gap-3 px-4",children:[T.jsx(K5,{inputRef:S}),T.jsxs("div",{className:"flex min-w-20 items-start gap-3",children:[T.jsx(X5,{streams:n?.streams??[],selectedStreamId:g,isConnected:o,isConnecting:l,isDisabled:a||!n,canClear:c.length>0,onSelectStream:E,onPlay:()=>A(!0),onPause:()=>A(!1),onClear:()=>C([])}),T.jsx(nP,{columns:d,groupedColumnIds:h,isDisabled:a||!t,onExportCsv:()=>x("csv"),onExportMarkdown:()=>x("md"),onClearGrouping:()=>b([]),onToggleGrouping:(z,j)=>b(J=>j?J.includes(z)?J:[...J,z]:J.filter(le=>le!==z)),onToggleColumn:(z,j)=>v(J=>({...J,[z]:j}))})]})]}),r?T.jsx("div",{className:"px-4 text-sm text-destructive",children:r}):null,T.jsx("div",{className:"min-h-0 flex-1",children:t?T.jsx(nL,{rowActions:H,rowStyle:L}):T.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:"No stream selected."})})]})}function TP(){const[t]=M.useState(()=>{const V=hP(),X=Pp(V);return{search:Fp(X),streamId:V,tableId:X}}),[e,n]=M.useState(null),[r,o]=M.useState([]),[l,a]=M.useState(()=>t.streamId),[c,d]=M.useState(()=>!!t.streamId),[h,p]=M.useState(!0),[g,b]=M.useState(!1),[v,S]=M.useState(null),[x,C]=M.useState(()=>t.search),[E,A]=M.useState({}),[k,D]=M.useState([]),L=M.useRef(null),H=M.useRef(!1),[z,j]=M.useState(null);M.useEffect(()=>{let V=!1;return fetch("/api/config").then(async X=>{if(!X.ok)throw new Error("Failed to load log viewer config.");return await X.json()}).then(X=>{V||(n(X),a(ee=>ee&&X.streams.some(re=>re.id===ee)?ee:X.streams[0]?.id??null))}).catch(X=>{V||S(X instanceof Error?X.message:String(X))}).finally(()=>{V||p(!1)}),()=>{V=!0}},[]);const J=M.useMemo(()=>!e||!l?null:e.streams.find(V=>V.id===l)??null,[e,l]),le=M.useMemo(()=>J?bP(J.columns):[],[J]),ce=M.useMemo(()=>Pp(l),[l]),se=M.useMemo(()=>J?.columns.map((V,X)=>({accessorKey:V.accessorKey,id:MM(V,X),kind:V.kind,label:V.header??pP(V.accessorKey)}))??[],[J]),Se=M.useMemo(()=>se.map(V=>({id:V.id,kind:V.kind,label:V.label,visible:E[V.id]!==!1})),[E,se]),ne=M.useMemo(()=>se.filter(V=>E[V.id]!==!1),[E,se]),me=M.useMemo(()=>new Map(se.map(V=>[V.id,V])),[se]),I=M.useMemo(()=>k.flatMap(V=>{const X=me.get(V);return X?[X]:[]}),[me,k]),Q=M.useMemo(()=>fP(r,I),[I,r]),U=!!l&&c&&!g,K=M.useMemo(()=>se.map(V=>V.id),[se]);M.useEffect(()=>{H.current&&(o([]),S(null)),H.current=!0},[l]),M.useEffect(()=>{if(!J){D([]),j(null);return}C(Fp(ce)),A(o1(ce,K)),D(s1(ce,K)),j(ce)},[J,K,ce]),M.useEffect(()=>{if(!J||z!==ce)return;const V=window.setTimeout(()=>{oP({columnIds:K,columnVisibility:E,groupBy:k,search:x,selectedStreamId:l,tableId:ce})},300);return()=>window.clearTimeout(V)},[J,K,E,k,z,x,l,ce]),M.useEffect(()=>{const V=()=>{const X=eT(),ee=Pp(X);a(re=>(re===X&&(C(Fp(ee)),A(o1(ee,K)),D(s1(ee,K)),j(ee)),X))};return window.addEventListener("popstate",V),()=>window.removeEventListener("popstate",V)},[K]),M.useEffect(()=>{if(!l||!c){L.current?.close(),L.current=null,b(!1);return}S(null),o([]);const V=new URL(`/api/streams/${encodeURIComponent(l)}/events`,window.location.origin),X=new URL(window.location.href).searchParams;for(const[De,xe]of X.entries())V.searchParams.set(De,xe);const ee=new EventSource(V);L.current=ee;const re=De=>{const xe=SP(De);o(Ft=>lP(Ft,{...xe.row,__datoolRowId:xe.id}))},ae=De=>{const xe=xP(De);S(xe.message)},de=De=>{wP(De),ee.close(),L.current=null,b(!1)};return ee.onopen=()=>{b(!0)},ee.onerror=()=>{b(!1)},ee.addEventListener("row",re),ee.addEventListener("runtime-error",ae),ee.addEventListener("end",de),()=>{ee.removeEventListener("row",re),ee.removeEventListener("runtime-error",ae),ee.removeEventListener("end",de),ee.close(),b(!1)}},[l,c]);const G=M.useRef(null);M.useEffect(()=>{const V=X=>{(X.metaKey||X.ctrlKey)&&X.key.toLowerCase()==="f"&&(X.preventDefault(),G.current?.focus(),G.current?.selectAll())};return window.addEventListener("keydown",V),()=>window.removeEventListener("keydown",V)},[]);const N=M.useCallback(V=>{if(!J||ne.length===0)return;const X=new Date().toISOString().replaceAll(":","-"),ee=`${mP(J.label)}-${X}`,re=V==="csv"?yP(Q.rows,ne):vP(Q.rows,ne);gP(re,`${ee}.${V}`,V==="csv"?"text/csv":"text/markdown")},[J,Q.rows,ne]);return T.jsx(H3,{autoScrollToBottom:k.length===0,columnVisibility:E,columns:le,data:Q.rows,getRowId:V=>V.__datoolRowId,height:"100%",id:ce,onColumnVisibilityChange:A,onSearchChange:C,search:x,rowHeight:20,statePersistence:"none",children:T.jsx(RP,{activeStream:J,columns:le,config:e,errorMessage:v,handleExport:N,isConnected:g,isConnecting:U,isLoadingConfig:h,groupedColumnIds:k,groupedRowStartIds:Q.groupStartRowIds,rows:r,settingsColumns:Se,setGroupedColumnIds:D,setColumnVisibility:A,searchInputRef:G,selectedStreamId:l,setRows:o,setSelectedStreamId:a,setShouldConnect:d})})}MO.createRoot(document.getElementById("root")).render(T.jsx(M.StrictMode,{children:T.jsx(W5,{storageKey:"datool-theme",children:T.jsx(TP,{})})}));
|