datool 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/README.md +218 -0
  2. package/client-dist/assets/geist-cyrillic-wght-normal-CHSlOQsW.woff2 +0 -0
  3. package/client-dist/assets/geist-latin-ext-wght-normal-DMtmJ5ZE.woff2 +0 -0
  4. package/client-dist/assets/geist-latin-wght-normal-Dm3htQBi.woff2 +0 -0
  5. package/client-dist/assets/index-BeRNeRUq.css +1 -0
  6. package/client-dist/assets/index-uoZ4c_I8.js +164 -0
  7. package/client-dist/index.html +13 -0
  8. package/index.html +12 -0
  9. package/package.json +55 -0
  10. package/src/client/App.tsx +885 -0
  11. package/src/client/components/connection-status.tsx +43 -0
  12. package/src/client/components/data-table-cell.tsx +235 -0
  13. package/src/client/components/data-table-col-icon.tsx +73 -0
  14. package/src/client/components/data-table-header-col.tsx +225 -0
  15. package/src/client/components/data-table-search-input.tsx +729 -0
  16. package/src/client/components/data-table.tsx +2014 -0
  17. package/src/client/components/stream-controls.tsx +157 -0
  18. package/src/client/components/theme-provider.tsx +230 -0
  19. package/src/client/components/ui/button.tsx +68 -0
  20. package/src/client/components/ui/combobox.tsx +308 -0
  21. package/src/client/components/ui/context-menu.tsx +261 -0
  22. package/src/client/components/ui/dropdown-menu.tsx +267 -0
  23. package/src/client/components/ui/input-group.tsx +153 -0
  24. package/src/client/components/ui/input.tsx +19 -0
  25. package/src/client/components/ui/textarea.tsx +18 -0
  26. package/src/client/components/viewer-settings.tsx +185 -0
  27. package/src/client/index.css +192 -0
  28. package/src/client/lib/data-table-search.ts +750 -0
  29. package/src/client/lib/datool-icons.ts +37 -0
  30. package/src/client/lib/datool-url-state.ts +159 -0
  31. package/src/client/lib/filterable-table.ts +146 -0
  32. package/src/client/lib/table-search-persistence.ts +94 -0
  33. package/src/client/lib/utils.ts +6 -0
  34. package/src/client/main.tsx +14 -0
  35. package/src/index.ts +19 -0
  36. package/src/node/cli.ts +54 -0
  37. package/src/node/config.ts +231 -0
  38. package/src/node/lines.ts +82 -0
  39. package/src/node/runtime.ts +102 -0
  40. package/src/node/server.ts +403 -0
  41. package/src/node/sources/command.ts +82 -0
  42. package/src/node/sources/file.ts +116 -0
  43. package/src/node/sources/ssh.ts +59 -0
  44. package/src/shared/columns.ts +41 -0
  45. package/src/shared/types.ts +188 -0
@@ -0,0 +1,164 @@
1
+ function aO(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 i1(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var _h={exports:{}},Pl={};var db;function uO(){if(db)return Pl;db=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 Pl.Fragment=e,Pl.jsx=n,Pl.jsxs=n,Pl}var hb;function cO(){return hb||(hb=1,_h.exports=uO()),_h.exports}var T=cO(),zh={exports:{}},Te={};var pb;function fO(){if(pb)return Te;pb=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"),v=Symbol.iterator;function b(k){return k===null||typeof k!="object"?null:(k=v&&k[v]||k["@@iterator"],typeof k=="function"?k:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,C={};function E(k,K,W){this.props=k,this.context=K,this.refs=C,this.updater=W||S}E.prototype.isReactComponent={},E.prototype.setState=function(k,K){if(typeof k!="object"&&typeof k!="function"&&k!=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,k,K,"setState")},E.prototype.forceUpdate=function(k){this.updater.enqueueForceUpdate(this,k,"forceUpdate")};function A(){}A.prototype=E.prototype;function N(k,K,W){this.props=k,this.context=K,this.refs=C,this.updater=W||S}var D=N.prototype=new A;D.constructor=N,x(D,E.prototype),D.isPureReactComponent=!0;var j=Array.isArray;function $(){}var _={H:null,A:null,T:null,S:null},B=Object.prototype.hasOwnProperty;function Z(k,K,W){var ne=W.ref;return{$$typeof:t,type:k,key:K,ref:ne!==void 0?ne:null,props:W}}function ie(k,K){return Z(k.type,K,k.props)}function pe(k){return typeof k=="object"&&k!==null&&k.$$typeof===t}function se(k){var K={"=":"=0",":":"=2"};return"$"+k.replace(/[=:]/g,function(W){return K[W]})}var be=/\/+/g;function te(k,K){return typeof k=="object"&&k!==null&&k.key!=null?se(""+k.key):K.toString(36)}function ye(k){switch(k.status){case"fulfilled":return k.value;case"rejected":throw k.reason;default:switch(typeof k.status=="string"?k.then($,$):(k.status="pending",k.then(function(K){k.status==="pending"&&(k.status="fulfilled",k.value=K)},function(K){k.status==="pending"&&(k.status="rejected",k.reason=K)})),k.status){case"fulfilled":return k.value;case"rejected":throw k.reason}}throw k}function V(k,K,W,ne,le){var ae=typeof k;(ae==="undefined"||ae==="boolean")&&(k=null);var me=!1;if(k===null)me=!0;else switch(ae){case"bigint":case"string":case"number":me=!0;break;case"object":switch(k.$$typeof){case t:case e:me=!0;break;case p:return me=k._init,V(me(k._payload),K,W,ne,le)}}if(me)return le=le(k),me=ne===""?"."+te(k,0):ne,j(le)?(W="",me!=null&&(W=me.replace(be,"$&/")+"/"),V(le,K,W,"",function(St){return St})):le!=null&&(pe(le)&&(le=ie(le,W+(le.key==null||k&&k.key===le.key?"":(""+le.key).replace(be,"$&/")+"/")+me)),K.push(le)),1;me=0;var Ke=ne===""?".":ne+":";if(j(k))for(var Ee=0;Ee<k.length;Ee++)ne=k[Ee],ae=Ke+te(ne,Ee),me+=V(ne,K,W,ae,le);else if(Ee=b(k),typeof Ee=="function")for(k=Ee.call(k),Ee=0;!(ne=k.next()).done;)ne=ne.value,ae=Ke+te(ne,Ee++),me+=V(ne,K,W,ae,le);else if(ae==="object"){if(typeof k.then=="function")return V(ye(k),K,W,ne,le);throw K=String(k),Error("Objects are not valid as a React child (found: "+(K==="[object Object]"?"object with keys {"+Object.keys(k).join(", ")+"}":K)+"). If you meant to render a collection of children, use an array instead.")}return me}function U(k,K,W){if(k==null)return k;var ne=[],le=0;return V(k,ne,"","",function(ae){return K.call(W,ae,le++)}),ne}function L(k){if(k._status===-1){var K=k._result;K=K(),K.then(function(W){(k._status===0||k._status===-1)&&(k._status=1,k._result=W)},function(W){(k._status===0||k._status===-1)&&(k._status=2,k._result=W)}),k._status===-1&&(k._status=0,k._result=K)}if(k._status===1)return k._result.default;throw k._result}var q=typeof reportError=="function"?reportError:function(k){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var K=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof k=="object"&&k!==null&&typeof k.message=="string"?String(k.message):String(k),error:k});if(!window.dispatchEvent(K))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",k);return}console.error(k)},Y={map:U,forEach:function(k,K,W){U(k,function(){K.apply(this,arguments)},W)},count:function(k){var K=0;return U(k,function(){K++}),K},toArray:function(k){return U(k,function(K){return K})||[]},only:function(k){if(!pe(k))throw Error("React.Children.only expected to receive a single React element child.");return k}};return Te.Activity=g,Te.Children=Y,Te.Component=E,Te.Fragment=n,Te.Profiler=o,Te.PureComponent=N,Te.StrictMode=r,Te.Suspense=d,Te.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=_,Te.__COMPILER_RUNTIME={__proto__:null,c:function(k){return _.H.useMemoCache(k)}},Te.cache=function(k){return function(){return k.apply(null,arguments)}},Te.cacheSignal=function(){return null},Te.cloneElement=function(k,K,W){if(k==null)throw Error("The argument must be a React element, but you passed "+k+".");var ne=x({},k.props),le=k.key;if(K!=null)for(ae in K.key!==void 0&&(le=""+K.key),K)!B.call(K,ae)||ae==="key"||ae==="__self"||ae==="__source"||ae==="ref"&&K.ref===void 0||(ne[ae]=K[ae]);var ae=arguments.length-2;if(ae===1)ne.children=W;else if(1<ae){for(var me=Array(ae),Ke=0;Ke<ae;Ke++)me[Ke]=arguments[Ke+2];ne.children=me}return Z(k.type,le,ne)},Te.createContext=function(k){return k={$$typeof:a,_currentValue:k,_currentValue2:k,_threadCount:0,Provider:null,Consumer:null},k.Provider=k,k.Consumer={$$typeof:l,_context:k},k},Te.createElement=function(k,K,W){var ne,le={},ae=null;if(K!=null)for(ne in K.key!==void 0&&(ae=""+K.key),K)B.call(K,ne)&&ne!=="key"&&ne!=="__self"&&ne!=="__source"&&(le[ne]=K[ne]);var me=arguments.length-2;if(me===1)le.children=W;else if(1<me){for(var Ke=Array(me),Ee=0;Ee<me;Ee++)Ke[Ee]=arguments[Ee+2];le.children=Ke}if(k&&k.defaultProps)for(ne in me=k.defaultProps,me)le[ne]===void 0&&(le[ne]=me[ne]);return Z(k,ae,le)},Te.createRef=function(){return{current:null}},Te.forwardRef=function(k){return{$$typeof:c,render:k}},Te.isValidElement=pe,Te.lazy=function(k){return{$$typeof:p,_payload:{_status:-1,_result:k},_init:L}},Te.memo=function(k,K){return{$$typeof:h,type:k,compare:K===void 0?null:K}},Te.startTransition=function(k){var K=_.T,W={};_.T=W;try{var ne=k(),le=_.S;le!==null&&le(W,ne),typeof ne=="object"&&ne!==null&&typeof ne.then=="function"&&ne.then($,q)}catch(ae){q(ae)}finally{K!==null&&W.types!==null&&(K.types=W.types),_.T=K}},Te.unstable_useCacheRefresh=function(){return _.H.useCacheRefresh()},Te.use=function(k){return _.H.use(k)},Te.useActionState=function(k,K,W){return _.H.useActionState(k,K,W)},Te.useCallback=function(k,K){return _.H.useCallback(k,K)},Te.useContext=function(k){return _.H.useContext(k)},Te.useDebugValue=function(){},Te.useDeferredValue=function(k,K){return _.H.useDeferredValue(k,K)},Te.useEffect=function(k,K){return _.H.useEffect(k,K)},Te.useEffectEvent=function(k){return _.H.useEffectEvent(k)},Te.useId=function(){return _.H.useId()},Te.useImperativeHandle=function(k,K,W){return _.H.useImperativeHandle(k,K,W)},Te.useInsertionEffect=function(k,K){return _.H.useInsertionEffect(k,K)},Te.useLayoutEffect=function(k,K){return _.H.useLayoutEffect(k,K)},Te.useMemo=function(k,K){return _.H.useMemo(k,K)},Te.useOptimistic=function(k,K){return _.H.useOptimistic(k,K)},Te.useReducer=function(k,K,W){return _.H.useReducer(k,K,W)},Te.useRef=function(k){return _.H.useRef(k)},Te.useState=function(k){return _.H.useState(k)},Te.useSyncExternalStore=function(k,K,W){return _.H.useSyncExternalStore(k,K,W)},Te.useTransition=function(){return _.H.useTransition()},Te.version="19.2.4",Te}var mb;function xa(){return mb||(mb=1,zh.exports=fO()),zh.exports}var M=xa();const tn=i1(M),o1=aO({__proto__:null,default:tn},[M]);var jh={exports:{}},$l={},Lh={exports:{}},Ih={};var gb;function dO(){return gb||(gb=1,(function(t){function e(V,U){var L=V.length;V.push(U);e:for(;0<L;){var q=L-1>>>1,Y=V[q];if(0<o(Y,U))V[q]=U,V[L]=Y,L=q;else break e}}function n(V){return V.length===0?null:V[0]}function r(V){if(V.length===0)return null;var U=V[0],L=V.pop();if(L!==U){V[0]=L;e:for(var q=0,Y=V.length,k=Y>>>1;q<k;){var K=2*(q+1)-1,W=V[K],ne=K+1,le=V[ne];if(0>o(W,L))ne<Y&&0>o(le,W)?(V[q]=le,V[ne]=L,q=ne):(V[q]=W,V[K]=L,q=K);else if(ne<Y&&0>o(le,L))V[q]=le,V[ne]=L,q=ne;else break e}}return U}function o(V,U){var L=V.sortIndex-U.sortIndex;return L!==0?L:V.id-U.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,v=3,b=!1,S=!1,x=!1,C=!1,E=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;function D(V){for(var U=n(h);U!==null;){if(U.callback===null)r(h);else if(U.startTime<=V)r(h),U.sortIndex=U.expirationTime,e(d,U);else break;U=n(h)}}function j(V){if(x=!1,D(V),!S)if(n(d)!==null)S=!0,$||($=!0,se());else{var U=n(h);U!==null&&ye(j,U.startTime-V)}}var $=!1,_=-1,B=5,Z=-1;function ie(){return C?!0:!(t.unstable_now()-Z<B)}function pe(){if(C=!1,$){var V=t.unstable_now();Z=V;var U=!0;try{e:{S=!1,x&&(x=!1,A(_),_=-1),b=!0;var L=v;try{t:{for(D(V),g=n(d);g!==null&&!(g.expirationTime>V&&ie());){var q=g.callback;if(typeof q=="function"){g.callback=null,v=g.priorityLevel;var Y=q(g.expirationTime<=V);if(V=t.unstable_now(),typeof Y=="function"){g.callback=Y,D(V),U=!0;break t}g===n(d)&&r(d),D(V)}else r(d);g=n(d)}if(g!==null)U=!0;else{var k=n(h);k!==null&&ye(j,k.startTime-V),U=!1}}break e}finally{g=null,v=L,b=!1}U=void 0}}finally{U?se():$=!1}}}var se;if(typeof N=="function")se=function(){N(pe)};else if(typeof MessageChannel<"u"){var be=new MessageChannel,te=be.port2;be.port1.onmessage=pe,se=function(){te.postMessage(null)}}else se=function(){E(pe,0)};function ye(V,U){_=E(function(){V(t.unstable_now())},U)}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(V){V.callback=null},t.unstable_forceFrameRate=function(V){0>V||125<V?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):B=0<V?Math.floor(1e3/V):5},t.unstable_getCurrentPriorityLevel=function(){return v},t.unstable_next=function(V){switch(v){case 1:case 2:case 3:var U=3;break;default:U=v}var L=v;v=U;try{return V()}finally{v=L}},t.unstable_requestPaint=function(){C=!0},t.unstable_runWithPriority=function(V,U){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var L=v;v=V;try{return U()}finally{v=L}},t.unstable_scheduleCallback=function(V,U,L){var q=t.unstable_now();switch(typeof L=="object"&&L!==null?(L=L.delay,L=typeof L=="number"&&0<L?q+L:q):L=q,V){case 1:var Y=-1;break;case 2:Y=250;break;case 5:Y=1073741823;break;case 4:Y=1e4;break;default:Y=5e3}return Y=L+Y,V={id:p++,callback:U,priorityLevel:V,startTime:L,expirationTime:Y,sortIndex:-1},L>q?(V.sortIndex=L,e(h,V),n(d)===null&&V===n(h)&&(x?(A(_),_=-1):x=!0,ye(j,L-q))):(V.sortIndex=Y,e(d,V),S||b||(S=!0,$||($=!0,se()))),V},t.unstable_shouldYield=ie,t.unstable_wrapCallback=function(V){var U=v;return function(){var L=v;v=U;try{return V.apply(this,arguments)}finally{v=L}}}})(Ih)),Ih}var yb;function hO(){return yb||(yb=1,Lh.exports=dO()),Lh.exports}var Bh={exports:{}},Ft={};var vb;function pO(){if(vb)return Ft;vb=1;var t=xa();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 Ft.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Ft.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)},Ft.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()}},Ft.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))},Ft.prefetchDNS=function(d){typeof d=="string"&&r.d.D(d)},Ft.preinit=function(d,h){if(typeof d=="string"&&h&&typeof h.as=="string"){var p=h.as,g=c(p,h.crossOrigin),v=typeof h.integrity=="string"?h.integrity:void 0,b=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:v,fetchPriority:b}):p==="script"&&r.d.X(d,{crossOrigin:g,integrity:v,fetchPriority:b,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Ft.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)},Ft.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})}},Ft.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)},Ft.requestFormReset=function(d){r.d.r(d)},Ft.unstable_batchedUpdates=function(d,h){return d(h)},Ft.useFormState=function(d,h,p){return a.H.useFormState(d,h,p)},Ft.useFormStatus=function(){return a.H.useHostTransitionStatus()},Ft.version="19.2.4",Ft}var bb;function s1(){if(bb)return Bh.exports;bb=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(),Bh.exports=pO(),Bh.exports}var Sb;function mO(){if(Sb)return $l;Sb=1;var t=hO(),e=xa(),n=s1();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,v=Symbol.for("react.element"),b=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"),N=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),j=Symbol.for("react.suspense"),$=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),B=Symbol.for("react.lazy"),Z=Symbol.for("react.activity"),ie=Symbol.for("react.memo_cache_sentinel"),pe=Symbol.iterator;function se(i){return i===null||typeof i!="object"?null:(i=pe&&i[pe]||i["@@iterator"],typeof i=="function"?i:null)}var be=Symbol.for("react.client.reference");function te(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===be?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 j:return"Suspense";case $:return"SuspenseList";case Z:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case S:return"Portal";case N: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 _:return s=i.displayName||null,s!==null?s:te(i.type)||"Memo";case B:s=i._payload,i=i._init;try{return te(i(s))}catch{}}return null}var ye=Array.isArray,V=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,U=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L={pending:!1,data:null,method:null,action:null},q=[],Y=-1;function k(i){return{current:i}}function K(i){0>Y||(i.current=q[Y],q[Y]=null,Y--)}function W(i,s){Y++,q[Y]=i.current,i.current=s}var ne=k(null),le=k(null),ae=k(null),me=k(null);function Ke(i,s){switch(W(ae,s),W(le,i),W(ne,null),s.nodeType){case 9:case 11:i=(i=s.documentElement)&&(i=i.namespaceURI)?j0(i):0;break;default:if(i=s.tagName,s=s.namespaceURI)s=j0(s),i=L0(s,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}K(ne),W(ne,i)}function Ee(){K(ne),K(le),K(ae)}function St(i){i.memoizedState!==null&&W(me,i);var s=ne.current,u=L0(s,i.type);s!==u&&(W(le,i),W(ne,u))}function ct(i){le.current===i&&(K(ne),K(le)),me.current===i&&(K(me),Il._currentValue=L)}var Jt,Qt;function Ct(i){if(Jt===void 0)try{throw Error()}catch(u){var s=u.stack.trim().match(/\n( *(at )?)/);Jt=s&&s[1]||"",Qt=-1<u.stack.indexOf(`
2
+ at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
3
+ `+Jt+i+Qt}var Gs=!1;function Fi(i,s){if(!i||Gs)return"";Gs=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var f={DetermineComponentFrameRoot:function(){try{if(s){var Q=function(){throw Error()};if(Object.defineProperty(Q.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Q,[])}catch(G){var H=G}Reflect.construct(i,[],Q)}else{try{Q.call()}catch(G){H=G}i.call(Q.prototype)}}else{try{throw Error()}catch(G){H=G}(Q=i())&&typeof Q.catch=="function"&&Q.catch(function(){})}}catch(G){if(G&&H&&typeof G.stack=="string")return[G.stack,H.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 X=`
6
+ `+O[f].replace(" at new "," at ");return i.displayName&&X.includes("<anonymous>")&&(X=X.replace("<anonymous>",i.displayName)),X}while(1<=f&&0<=m);break}}}finally{Gs=!1,Error.prepareStackTrace=u}return(u=i?i.displayName||i.name:"")?Ct(u):""}function Wn(i,s){switch(i.tag){case 26:case 27:case 5:return Ct(i.type);case 16:return Ct("Lazy");case 13:return i.child!==s&&s!==null?Ct("Suspense Fallback"):Ct("Suspense");case 19:return Ct("SuspenseList");case 0:case 15:return Fi(i.type,!1);case 11:return Fi(i.type.render,!1);case 1:return Fi(i.type,!0);case 31:return Ct("Activity");default:return""}}function Ks(i){try{var s="",u=null;do s+=Wn(i,u),u=i,i=i.return;while(i);return s}catch(f){return`
7
+ Error generating stack: `+f.message+`
8
+ `+f.stack}}var Ao=Object.prototype.hasOwnProperty,Oo=t.unstable_scheduleCallback,Ys=t.unstable_cancelCallback,Da=t.unstable_shouldYield,xf=t.unstable_requestPaint,Zt=t.unstable_now,wf=t.unstable_getCurrentPriorityLevel,er=t.unstable_ImmediatePriority,tr=t.unstable_UserBlockingPriority,Ur=t.unstable_NormalPriority,_a=t.unstable_LowPriority,Xs=t.unstable_IdlePriority,on=t.log,ko=t.unstable_setDisableYieldValue,Pi=null,Wt=null;function sn(i){if(typeof on=="function"&&ko(i),Wt&&typeof Wt.setStrictMode=="function")try{Wt.setStrictMode(Pi,i)}catch{}}var Vt=Math.clz32?Math.clz32:za,Js=Math.log,qr=Math.LN2;function za(i){return i>>>=0,i===0?32:31-(Js(i)/qr|0)|0}var hr=256,No=262144,Do=4194304;function pr(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 re(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=pr(f):(w&=R,w!==0?m=pr(w):u||(u=R&~i,u!==0&&(m=pr(u))))):(R=f&~y,R!==0?m=pr(R):w!==0?m=pr(w):u||(u=f&~i,u!==0&&(m=pr(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 ue(i,s){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&s)===0}function Re(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 Fe(){var i=Do;return Do<<=1,(Do&62914560)===0&&(Do=4194304),i}function We(i){for(var s=[],u=0;31>u;u++)s.push(i);return s}function Me(i,s){i.pendingLanes|=s,s!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function ft(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 X=31-Vt(u),Q=1<<X;R[X]=0,O[X]=-1;var H=P[X];if(H!==null)for(P[X]=null,X=0;X<H.length;X++){var G=H[X];G!==null&&(G.lane&=-536870913)}u&=~Q}f!==0&&dt(i,f,0),y!==0&&m===0&&i.tag!==0&&(i.suspendedLanes|=y&~(w&~s))}function dt(i,s,u){i.pendingLanes|=s,i.suspendedLanes&=~s;var f=31-Vt(s);i.entangledLanes|=s,i.entanglements[f]=i.entanglements[f]|1073741824|u&261930}function $i(i,s){var u=i.entangledLanes|=s;for(i=i.entanglements;u;){var f=31-Vt(u),m=1<<f;m&s|i[f]&s&&(i[f]|=s),u&=~m}}function _o(i,s){var u=s&-s;return u=(u&42)!==0?1:Qs(u),(u&(i.suspendedLanes|s))!==0?0:u}function Qs(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 Cf(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function Sg(){var i=U.p;return i!==0?i:(i=window.event,i===void 0?32:ob(i.type))}function xg(i,s){var u=U.p;try{return U.p=i,s()}finally{U.p=u}}var Gr=Math.random().toString(36).slice(2),kt="__reactFiber$"+Gr,ln="__reactProps$"+Gr,zo="__reactContainer$"+Gr,Mf="__reactEvents$"+Gr,QR="__reactListeners$"+Gr,ZR="__reactHandles$"+Gr,wg="__reactResources$"+Gr,Zs="__reactMarker$"+Gr;function Ef(i){delete i[kt],delete i[ln],delete i[Mf],delete i[QR],delete i[ZR]}function jo(i){var s=i[kt];if(s)return s;for(var u=i.parentNode;u;){if(s=u[zo]||u[kt]){if(u=s.alternate,s.child!==null||u!==null&&u.child!==null)for(i=H0(i);i!==null;){if(u=i[kt])return u;i=H0(i)}return s}i=u,u=i.parentNode}return null}function Lo(i){if(i=i[kt]||i[zo]){var s=i.tag;if(s===5||s===6||s===13||s===31||s===26||s===27||s===3)return i}return null}function Ws(i){var s=i.tag;if(s===5||s===26||s===27||s===6)return i.stateNode;throw Error(r(33))}function Io(i){var s=i[wg];return s||(s=i[wg]={hoistableStyles:new Map,hoistableScripts:new Map}),s}function Mt(i){i[Zs]=!0}var Cg=new Set,Mg={};function Hi(i,s){Bo(i,s),Bo(i+"Capture",s)}function Bo(i,s){for(Mg[i]=s,i=0;i<s.length;i++)Cg.add(s[i])}var WR=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]*$"),Eg={},Rg={};function eT(i){return Ao.call(Rg,i)?!0:Ao.call(Eg,i)?!1:WR.test(i)?Rg[i]=!0:(Eg[i]=!0,!1)}function ja(i,s,u){if(eT(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 La(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 An(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function Tg(i){var s=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function tT(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 Rf(i){if(!i._valueTracker){var s=Tg(i)?"checked":"value";i._valueTracker=tT(i,s,""+i[s])}}function Ag(i){if(!i)return!1;var s=i._valueTracker;if(!s)return!0;var u=s.getValue(),f="";return i&&(f=Tg(i)?i.checked?"true":"false":i.value),i=f,i!==u?(s.setValue(i),!0):!1}function Ia(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 nT=/[\n"\\]/g;function On(i){return i.replace(nT,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function Tf(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=""+An(s)):i.value!==""+An(s)&&(i.value=""+An(s)):w!=="submit"&&w!=="reset"||i.removeAttribute("value"),s!=null?Af(i,w,An(s)):u!=null?Af(i,w,An(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=""+An(R):i.removeAttribute("name")}function Og(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)){Rf(i);return}u=u!=null?""+An(u):"",s=s!=null?""+An(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),Rf(i)}function Af(i,s,u){s==="number"&&Ia(i.ownerDocument)===i||i.defaultValue===""+u||(i.defaultValue=""+u)}function Vo(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=""+An(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 kg(i,s,u){if(s!=null&&(s=""+An(s),s!==i.value&&(i.value=s),u==null)){i.defaultValue!==s&&(i.defaultValue=s);return}i.defaultValue=u!=null?""+An(u):""}function Ng(i,s,u,f){if(s==null){if(f!=null){if(u!=null)throw Error(r(92));if(ye(f)){if(1<f.length)throw Error(r(93));f=f[0]}u=f}u==null&&(u=""),s=u}u=An(s),i.defaultValue=u,f=i.textContent,f===u&&f!==""&&f!==null&&(i.value=f),Rf(i)}function Fo(i,s){if(s){var u=i.firstChild;if(u&&u===i.lastChild&&u.nodeType===3){u.nodeValue=s;return}}i.textContent=s}var rT=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 Dg(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||rT.has(s)?s==="float"?i.cssFloat=u:i[s]=(""+u).trim():i[s]=u+"px"}function _g(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&&Dg(i,m,f)}else for(var y in s)s.hasOwnProperty(y)&&Dg(i,y,s[y])}function Of(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 iT=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"]]),oT=/^[\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 Ba(i){return oT.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function gr(){}var kf=null;function Nf(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var Po=null,$o=null;function zg(i){var s=Lo(i);if(s&&(i=s.stateNode)){var u=i[ln]||null;e:switch(i=s.stateNode,s.type){case"input":if(Tf(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="'+On(""+s)+'"][type="radio"]'),s=0;s<u.length;s++){var f=u[s];if(f!==i&&f.form===i.form){var m=f[ln]||null;if(!m)throw Error(r(90));Tf(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&&Ag(f)}break e;case"textarea":kg(i,u.value,u.defaultValue);break e;case"select":s=u.value,s!=null&&Vo(i,!!u.multiple,s,!1)}}}var Df=!1;function jg(i,s,u){if(Df)return i(s,u);Df=!0;try{var f=i(s);return f}finally{if(Df=!1,(Po!==null||$o!==null)&&(Eu(),Po&&(s=Po,i=$o,$o=Po=null,zg(s),i)))for(s=0;s<i.length;s++)zg(i[s])}}function el(i,s){var u=i.stateNode;if(u===null)return null;var f=u[ln]||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"),_f=!1;if(yr)try{var tl={};Object.defineProperty(tl,"passive",{get:function(){_f=!0}}),window.addEventListener("test",tl,tl),window.removeEventListener("test",tl,tl)}catch{_f=!1}var Kr=null,zf=null,Va=null;function Lg(){if(Va)return Va;var i,s=zf,u=s.length,f,m="value"in Kr?Kr.value:Kr.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 Va=m.slice(i,1<f?1-f:void 0)}function Fa(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 Pa(){return!0}function Ig(){return!1}function an(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)?Pa:Ig,this.isPropagationStopped=Ig,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=Pa)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=Pa)},persist:function(){},isPersistent:Pa}),s}var Ui={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},$a=an(Ui),nl=g({},Ui,{view:0,detail:0}),sT=an(nl),jf,Lf,rl,Ha=g({},nl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Bf,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!==rl&&(rl&&i.type==="mousemove"?(jf=i.screenX-rl.screenX,Lf=i.screenY-rl.screenY):Lf=jf=0,rl=i),jf)},movementY:function(i){return"movementY"in i?i.movementY:Lf}}),Bg=an(Ha),lT=g({},Ha,{dataTransfer:0}),aT=an(lT),uT=g({},nl,{relatedTarget:0}),If=an(uT),cT=g({},Ui,{animationName:0,elapsedTime:0,pseudoElement:0}),fT=an(cT),dT=g({},Ui,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),hT=an(dT),pT=g({},Ui,{data:0}),Vg=an(pT),mT={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},gT={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"},yT={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function vT(i){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(i):(i=yT[i])?!!s[i]:!1}function Bf(){return vT}var bT=g({},nl,{key:function(i){if(i.key){var s=mT[i.key]||i.key;if(s!=="Unidentified")return s}return i.type==="keypress"?(i=Fa(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?gT[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Bf,charCode:function(i){return i.type==="keypress"?Fa(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?Fa(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),ST=an(bT),xT=g({},Ha,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Fg=an(xT),wT=g({},nl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Bf}),CT=an(wT),MT=g({},Ui,{propertyName:0,elapsedTime:0,pseudoElement:0}),ET=an(MT),RT=g({},Ha,{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}),TT=an(RT),AT=g({},Ui,{newState:0,oldState:0}),OT=an(AT),kT=[9,13,27,32],Vf=yr&&"CompositionEvent"in window,il=null;yr&&"documentMode"in document&&(il=document.documentMode);var NT=yr&&"TextEvent"in window&&!il,Pg=yr&&(!Vf||il&&8<il&&11>=il),$g=" ",Hg=!1;function Ug(i,s){switch(i){case"keyup":return kT.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function qg(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var Ho=!1;function DT(i,s){switch(i){case"compositionend":return qg(s);case"keypress":return s.which!==32?null:(Hg=!0,$g);case"textInput":return i=s.data,i===$g&&Hg?null:i;default:return null}}function _T(i,s){if(Ho)return i==="compositionend"||!Vf&&Ug(i,s)?(i=Lg(),Va=zf=Kr=null,Ho=!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 Pg&&s.locale!=="ko"?null:s.data;default:return null}}var zT={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 Gg(i){var s=i&&i.nodeName&&i.nodeName.toLowerCase();return s==="input"?!!zT[i.type]:s==="textarea"}function Kg(i,s,u,f){Po?$o?$o.push(f):$o=[f]:Po=f,s=Du(s,"onChange"),0<s.length&&(u=new $a("onChange","change",null,u,f),i.push({event:u,listeners:s}))}var ol=null,sl=null;function jT(i){O0(i,0)}function Ua(i){var s=Ws(i);if(Ag(s))return i}function Yg(i,s){if(i==="change")return s}var Xg=!1;if(yr){var Ff;if(yr){var Pf="oninput"in document;if(!Pf){var Jg=document.createElement("div");Jg.setAttribute("oninput","return;"),Pf=typeof Jg.oninput=="function"}Ff=Pf}else Ff=!1;Xg=Ff&&(!document.documentMode||9<document.documentMode)}function Qg(){ol&&(ol.detachEvent("onpropertychange",Zg),sl=ol=null)}function Zg(i){if(i.propertyName==="value"&&Ua(sl)){var s=[];Kg(s,sl,i,Nf(i)),jg(jT,s)}}function LT(i,s,u){i==="focusin"?(Qg(),ol=s,sl=u,ol.attachEvent("onpropertychange",Zg)):i==="focusout"&&Qg()}function IT(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return Ua(sl)}function BT(i,s){if(i==="click")return Ua(s)}function VT(i,s){if(i==="input"||i==="change")return Ua(s)}function FT(i,s){return i===s&&(i!==0||1/i===1/s)||i!==i&&s!==s}var gn=typeof Object.is=="function"?Object.is:FT;function ll(i,s){if(gn(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(!Ao.call(s,m)||!gn(i[m],s[m]))return!1}return!0}function Wg(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function ey(i,s){var u=Wg(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=Wg(u)}}function ty(i,s){return i&&s?i===s?!0:i&&i.nodeType===3?!1:s&&s.nodeType===3?ty(i,s.parentNode):"contains"in i?i.contains(s):i.compareDocumentPosition?!!(i.compareDocumentPosition(s)&16):!1:!1}function ny(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var s=Ia(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=Ia(i.document)}return s}function $f(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 PT=yr&&"documentMode"in document&&11>=document.documentMode,Uo=null,Hf=null,al=null,Uf=!1;function ry(i,s,u){var f=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;Uf||Uo==null||Uo!==Ia(f)||(f=Uo,"selectionStart"in f&&$f(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}),al&&ll(al,f)||(al=f,f=Du(Hf,"onSelect"),0<f.length&&(s=new $a("onSelect","select",null,s,u),i.push({event:s,listeners:f}),s.target=Uo)))}function qi(i,s){var u={};return u[i.toLowerCase()]=s.toLowerCase(),u["Webkit"+i]="webkit"+s,u["Moz"+i]="moz"+s,u}var qo={animationend:qi("Animation","AnimationEnd"),animationiteration:qi("Animation","AnimationIteration"),animationstart:qi("Animation","AnimationStart"),transitionrun:qi("Transition","TransitionRun"),transitionstart:qi("Transition","TransitionStart"),transitioncancel:qi("Transition","TransitionCancel"),transitionend:qi("Transition","TransitionEnd")},qf={},iy={};yr&&(iy=document.createElement("div").style,"AnimationEvent"in window||(delete qo.animationend.animation,delete qo.animationiteration.animation,delete qo.animationstart.animation),"TransitionEvent"in window||delete qo.transitionend.transition);function Gi(i){if(qf[i])return qf[i];if(!qo[i])return i;var s=qo[i],u;for(u in s)if(s.hasOwnProperty(u)&&u in iy)return qf[i]=s[u];return i}var oy=Gi("animationend"),sy=Gi("animationiteration"),ly=Gi("animationstart"),$T=Gi("transitionrun"),HT=Gi("transitionstart"),UT=Gi("transitioncancel"),ay=Gi("transitionend"),uy=new Map,Gf="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(" ");Gf.push("scrollEnd");function Hn(i,s){uy.set(i,s),Hi(s,[i])}var qa=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)},kn=[],Go=0,Kf=0;function Ga(){for(var i=Go,s=Kf=Go=0;s<i;){var u=kn[s];kn[s++]=null;var f=kn[s];kn[s++]=null;var m=kn[s];kn[s++]=null;var y=kn[s];if(kn[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&&cy(u,m,y)}}function Ka(i,s,u,f){kn[Go++]=i,kn[Go++]=s,kn[Go++]=u,kn[Go++]=f,Kf|=f,i.lanes|=f,i=i.alternate,i!==null&&(i.lanes|=f)}function Yf(i,s,u,f){return Ka(i,s,u,f),Ya(i)}function Ki(i,s){return Ka(i,null,null,s),Ya(i)}function cy(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-Vt(u),i=y.hiddenUpdates,f=i[m],f===null?i[m]=[s]:f.push(s),s.lane=u|536870912),y):null}function Ya(i){if(50<kl)throw kl=0,rh=null,Error(r(185));for(var s=i.return;s!==null;)i=s,s=i.return;return i.tag===3?i.stateNode:null}var Ko={};function qT(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 yn(i,s,u,f){return new qT(i,s,u,f)}function Xf(i){return i=i.prototype,!(!i||!i.isReactComponent)}function vr(i,s){var u=i.alternate;return u===null?(u=yn(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 fy(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 Xa(i,s,u,f,m,y){var w=0;if(f=i,typeof i=="function")Xf(i)&&(w=1);else if(typeof i=="string")w=JA(i,u,ne.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case Z:return i=yn(31,u,s,m),i.elementType=Z,i.lanes=y,i;case x:return Yi(u.children,m,y,s);case C:w=8,m|=24;break;case E:return i=yn(12,u,s,m|2),i.elementType=E,i.lanes=y,i;case j:return i=yn(13,u,s,m),i.elementType=j,i.lanes=y,i;case $:return i=yn(19,u,s,m),i.elementType=$,i.lanes=y,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case N:w=10;break e;case A:w=9;break e;case D:w=11;break e;case _:w=14;break e;case B:w=16,f=null;break e}w=29,u=Error(r(130,i===null?"null":typeof i,"")),f=null}return s=yn(w,u,s,m),s.elementType=i,s.type=f,s.lanes=y,s}function Yi(i,s,u,f){return i=yn(7,i,f,s),i.lanes=u,i}function Jf(i,s,u){return i=yn(6,i,null,s),i.lanes=u,i}function dy(i){var s=yn(18,null,null,0);return s.stateNode=i,s}function Qf(i,s,u){return s=yn(4,i.children!==null?i.children:[],i.key,s),s.lanes=u,s.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},s}var hy=new WeakMap;function Nn(i,s){if(typeof i=="object"&&i!==null){var u=hy.get(i);return u!==void 0?u:(s={value:i,source:s,stack:Ks(s)},hy.set(i,s),s)}return{value:i,source:s,stack:Ks(s)}}var Yo=[],Xo=0,Ja=null,ul=0,Dn=[],_n=0,Yr=null,nr=1,rr="";function br(i,s){Yo[Xo++]=ul,Yo[Xo++]=Ja,Ja=i,ul=s}function py(i,s,u){Dn[_n++]=nr,Dn[_n++]=rr,Dn[_n++]=Yr,Yr=i;var f=nr;i=rr;var m=32-Vt(f)-1;f&=~(1<<m),u+=1;var y=32-Vt(s)+m;if(30<y){var w=m-m%5;y=(f&(1<<w)-1).toString(32),f>>=w,m-=w,nr=1<<32-Vt(s)+m|u<<m|f,rr=y+i}else nr=1<<y|u<<m|f,rr=i}function Zf(i){i.return!==null&&(br(i,1),py(i,1,0))}function Wf(i){for(;i===Ja;)Ja=Yo[--Xo],Yo[Xo]=null,ul=Yo[--Xo],Yo[Xo]=null;for(;i===Yr;)Yr=Dn[--_n],Dn[_n]=null,rr=Dn[--_n],Dn[_n]=null,nr=Dn[--_n],Dn[_n]=null}function my(i,s){Dn[_n++]=nr,Dn[_n++]=rr,Dn[_n++]=Yr,nr=s.id,rr=s.overflow,Yr=i}var Nt=null,et=null,Ve=!1,Xr=null,zn=!1,ed=Error(r(519));function Jr(i){var s=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw cl(Nn(s,i)),ed}function gy(i){var s=i.stateNode,u=i.type,f=i.memoizedProps;switch(s[kt]=i,s[ln]=f,u){case"dialog":Le("cancel",s),Le("close",s);break;case"iframe":case"object":case"embed":Le("load",s);break;case"video":case"audio":for(u=0;u<Dl.length;u++)Le(Dl[u],s);break;case"source":Le("error",s);break;case"img":case"image":case"link":Le("error",s),Le("load",s);break;case"details":Le("toggle",s);break;case"input":Le("invalid",s),Og(s,f.value,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name,!0);break;case"select":Le("invalid",s);break;case"textarea":Le("invalid",s),Ng(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||_0(s.textContent,u)?(f.popover!=null&&(Le("beforetoggle",s),Le("toggle",s)),f.onScroll!=null&&Le("scroll",s),f.onScrollEnd!=null&&Le("scrollend",s),f.onClick!=null&&(s.onclick=gr),s=!0):s=!1,s||Jr(i,!0)}function yy(i){for(Nt=i.return;Nt;)switch(Nt.tag){case 5:case 31:case 13:zn=!1;return;case 27:case 3:zn=!0;return;default:Nt=Nt.return}}function Jo(i){if(i!==Nt)return!1;if(!Ve)return yy(i),Ve=!0,!1;var s=i.tag,u;if((u=s!==3&&s!==27)&&((u=s===5)&&(u=i.type,u=!(u!=="form"&&u!=="button")||vh(i.type,i.memoizedProps)),u=!u),u&&et&&Jr(i),yy(i),s===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));et=$0(i)}else if(s===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));et=$0(i)}else s===27?(s=et,ci(i.type)?(i=Ch,Ch=null,et=i):et=s):et=Nt?Ln(i.stateNode.nextSibling):null;return!0}function Xi(){et=Nt=null,Ve=!1}function td(){var i=Xr;return i!==null&&(dn===null?dn=i:dn.push.apply(dn,i),Xr=null),i}function cl(i){Xr===null?Xr=[i]:Xr.push(i)}var nd=k(null),Ji=null,Sr=null;function Qr(i,s,u){W(nd,s._currentValue),s._currentValue=u}function xr(i){i._currentValue=nd.current,K(nd)}function rd(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 id(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),rd(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),rd(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 Qo(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;gn(m.pendingProps.value,w.value)||(i!==null?i.push(R):i=[R])}}else if(m===me.current){if(w=m.alternate,w===null)throw Error(r(387));w.memoizedState.memoizedState!==m.memoizedState.memoizedState&&(i!==null?i.push(Il):i=[Il])}m=m.return}i!==null&&id(s,i,u,f),s.flags|=262144}function Qa(i){for(i=i.firstContext;i!==null;){if(!gn(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function Qi(i){Ji=i,Sr=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function Dt(i){return vy(Ji,i)}function Za(i,s){return Ji===null&&Qi(i),vy(i,s)}function vy(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 GT=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()})}},KT=t.unstable_scheduleCallback,YT=t.unstable_NormalPriority,ht={$$typeof:N,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function od(){return{controller:new GT,data:new Map,refCount:0}}function fl(i){i.refCount--,i.refCount===0&&KT(YT,function(){i.controller.abort()})}var dl=null,sd=0,Zo=0,Wo=null;function XT(i,s){if(dl===null){var u=dl=[];sd=0,Zo=uh(),Wo={status:"pending",value:void 0,then:function(f){u.push(f)}}}return sd++,s.then(by,by),s}function by(){if(--sd===0&&dl!==null){Wo!==null&&(Wo.status="fulfilled");var i=dl;dl=null,Zo=0,Wo=null;for(var s=0;s<i.length;s++)(0,i[s])()}}function JT(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 Sy=V.S;V.S=function(i,s){r0=Zt(),typeof s=="object"&&s!==null&&typeof s.then=="function"&&XT(i,s),Sy!==null&&Sy(i,s)};var Zi=k(null);function ld(){var i=Zi.current;return i!==null?i:Qe.pooledCache}function Wa(i,s){s===null?W(Zi,Zi.current):W(Zi,s.pool)}function xy(){var i=ld();return i===null?null:{parent:ht._currentValue,pool:i}}var es=Error(r(460)),ad=Error(r(474)),eu=Error(r(542)),tu={then:function(){}};function wy(i){return i=i.status,i==="fulfilled"||i==="rejected"}function Cy(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,Ey(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,Ey(i),i}throw eo=s,es}}function Wi(i){try{var s=i._init;return s(i._payload)}catch(u){throw u!==null&&typeof u=="object"&&typeof u.then=="function"?(eo=u,es):u}}var eo=null;function My(){if(eo===null)throw Error(r(459));var i=eo;return eo=null,i}function Ey(i){if(i===es||i===eu)throw Error(r(483))}var ts=null,hl=0;function nu(i){var s=hl;return hl+=1,ts===null&&(ts=[]),Cy(ts,i,s)}function pl(i,s){s=s.props.ref,i.ref=s!==void 0?s:null}function ru(i,s){throw s.$$typeof===v?Error(r(525)):(i=Object.prototype.toString.call(s),Error(r(31,i==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":i)))}function Ry(i){function s(I,z){if(i){var F=I.deletions;F===null?(I.deletions=[z],I.flags|=16):F.push(z)}}function u(I,z){if(!i)return null;for(;z!==null;)s(I,z),z=z.sibling;return null}function f(I){for(var z=new Map;I!==null;)I.key!==null?z.set(I.key,I):z.set(I.index,I),I=I.sibling;return z}function m(I,z){return I=vr(I,z),I.index=0,I.sibling=null,I}function y(I,z,F){return I.index=F,i?(F=I.alternate,F!==null?(F=F.index,F<z?(I.flags|=67108866,z):F):(I.flags|=67108866,z)):(I.flags|=1048576,z)}function w(I){return i&&I.alternate===null&&(I.flags|=67108866),I}function R(I,z,F,J){return z===null||z.tag!==6?(z=Jf(F,I.mode,J),z.return=I,z):(z=m(z,F),z.return=I,z)}function O(I,z,F,J){var ve=F.type;return ve===x?X(I,z,F.props.children,J,F.key):z!==null&&(z.elementType===ve||typeof ve=="object"&&ve!==null&&ve.$$typeof===B&&Wi(ve)===z.type)?(z=m(z,F.props),pl(z,F),z.return=I,z):(z=Xa(F.type,F.key,F.props,null,I.mode,J),pl(z,F),z.return=I,z)}function P(I,z,F,J){return z===null||z.tag!==4||z.stateNode.containerInfo!==F.containerInfo||z.stateNode.implementation!==F.implementation?(z=Qf(F,I.mode,J),z.return=I,z):(z=m(z,F.children||[]),z.return=I,z)}function X(I,z,F,J,ve){return z===null||z.tag!==7?(z=Yi(F,I.mode,J,ve),z.return=I,z):(z=m(z,F),z.return=I,z)}function Q(I,z,F){if(typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint")return z=Jf(""+z,I.mode,F),z.return=I,z;if(typeof z=="object"&&z!==null){switch(z.$$typeof){case b:return F=Xa(z.type,z.key,z.props,null,I.mode,F),pl(F,z),F.return=I,F;case S:return z=Qf(z,I.mode,F),z.return=I,z;case B:return z=Wi(z),Q(I,z,F)}if(ye(z)||se(z))return z=Yi(z,I.mode,F,null),z.return=I,z;if(typeof z.then=="function")return Q(I,nu(z),F);if(z.$$typeof===N)return Q(I,Za(I,z),F);ru(I,z)}return null}function H(I,z,F,J){var ve=z!==null?z.key:null;if(typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint")return ve!==null?null:R(I,z,""+F,J);if(typeof F=="object"&&F!==null){switch(F.$$typeof){case b:return F.key===ve?O(I,z,F,J):null;case S:return F.key===ve?P(I,z,F,J):null;case B:return F=Wi(F),H(I,z,F,J)}if(ye(F)||se(F))return ve!==null?null:X(I,z,F,J,null);if(typeof F.then=="function")return H(I,z,nu(F),J);if(F.$$typeof===N)return H(I,z,Za(I,F),J);ru(I,F)}return null}function G(I,z,F,J,ve){if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return I=I.get(F)||null,R(z,I,""+J,ve);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case b:return I=I.get(J.key===null?F:J.key)||null,O(z,I,J,ve);case S:return I=I.get(J.key===null?F:J.key)||null,P(z,I,J,ve);case B:return J=Wi(J),G(I,z,F,J,ve)}if(ye(J)||se(J))return I=I.get(F)||null,X(z,I,J,ve,null);if(typeof J.then=="function")return G(I,z,F,nu(J),ve);if(J.$$typeof===N)return G(I,z,F,Za(z,J),ve);ru(z,J)}return null}function ce(I,z,F,J){for(var ve=null,Pe=null,he=z,ke=z=0,Be=null;he!==null&&ke<F.length;ke++){he.index>ke?(Be=he,he=null):Be=he.sibling;var $e=H(I,he,F[ke],J);if($e===null){he===null&&(he=Be);break}i&&he&&$e.alternate===null&&s(I,he),z=y($e,z,ke),Pe===null?ve=$e:Pe.sibling=$e,Pe=$e,he=Be}if(ke===F.length)return u(I,he),Ve&&br(I,ke),ve;if(he===null){for(;ke<F.length;ke++)he=Q(I,F[ke],J),he!==null&&(z=y(he,z,ke),Pe===null?ve=he:Pe.sibling=he,Pe=he);return Ve&&br(I,ke),ve}for(he=f(he);ke<F.length;ke++)Be=G(he,I,ke,F[ke],J),Be!==null&&(i&&Be.alternate!==null&&he.delete(Be.key===null?ke:Be.key),z=y(Be,z,ke),Pe===null?ve=Be:Pe.sibling=Be,Pe=Be);return i&&he.forEach(function(mi){return s(I,mi)}),Ve&&br(I,ke),ve}function xe(I,z,F,J){if(F==null)throw Error(r(151));for(var ve=null,Pe=null,he=z,ke=z=0,Be=null,$e=F.next();he!==null&&!$e.done;ke++,$e=F.next()){he.index>ke?(Be=he,he=null):Be=he.sibling;var mi=H(I,he,$e.value,J);if(mi===null){he===null&&(he=Be);break}i&&he&&mi.alternate===null&&s(I,he),z=y(mi,z,ke),Pe===null?ve=mi:Pe.sibling=mi,Pe=mi,he=Be}if($e.done)return u(I,he),Ve&&br(I,ke),ve;if(he===null){for(;!$e.done;ke++,$e=F.next())$e=Q(I,$e.value,J),$e!==null&&(z=y($e,z,ke),Pe===null?ve=$e:Pe.sibling=$e,Pe=$e);return Ve&&br(I,ke),ve}for(he=f(he);!$e.done;ke++,$e=F.next())$e=G(he,I,ke,$e.value,J),$e!==null&&(i&&$e.alternate!==null&&he.delete($e.key===null?ke:$e.key),z=y($e,z,ke),Pe===null?ve=$e:Pe.sibling=$e,Pe=$e);return i&&he.forEach(function(lO){return s(I,lO)}),Ve&&br(I,ke),ve}function Je(I,z,F,J){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 b:e:{for(var ve=F.key;z!==null;){if(z.key===ve){if(ve=F.type,ve===x){if(z.tag===7){u(I,z.sibling),J=m(z,F.props.children),J.return=I,I=J;break e}}else if(z.elementType===ve||typeof ve=="object"&&ve!==null&&ve.$$typeof===B&&Wi(ve)===z.type){u(I,z.sibling),J=m(z,F.props),pl(J,F),J.return=I,I=J;break e}u(I,z);break}else s(I,z);z=z.sibling}F.type===x?(J=Yi(F.props.children,I.mode,J,F.key),J.return=I,I=J):(J=Xa(F.type,F.key,F.props,null,I.mode,J),pl(J,F),J.return=I,I=J)}return w(I);case S:e:{for(ve=F.key;z!==null;){if(z.key===ve)if(z.tag===4&&z.stateNode.containerInfo===F.containerInfo&&z.stateNode.implementation===F.implementation){u(I,z.sibling),J=m(z,F.children||[]),J.return=I,I=J;break e}else{u(I,z);break}else s(I,z);z=z.sibling}J=Qf(F,I.mode,J),J.return=I,I=J}return w(I);case B:return F=Wi(F),Je(I,z,F,J)}if(ye(F))return ce(I,z,F,J);if(se(F)){if(ve=se(F),typeof ve!="function")throw Error(r(150));return F=ve.call(F),xe(I,z,F,J)}if(typeof F.then=="function")return Je(I,z,nu(F),J);if(F.$$typeof===N)return Je(I,z,Za(I,F),J);ru(I,F)}return typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint"?(F=""+F,z!==null&&z.tag===6?(u(I,z.sibling),J=m(z,F),J.return=I,I=J):(u(I,z),J=Jf(F,I.mode,J),J.return=I,I=J),w(I)):u(I,z)}return function(I,z,F,J){try{hl=0;var ve=Je(I,z,F,J);return ts=null,ve}catch(he){if(he===es||he===eu)throw he;var Pe=yn(29,he,null,I.mode);return Pe.lanes=J,Pe.return=I,Pe}}}var to=Ry(!0),Ty=Ry(!1),Zr=!1;function ud(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function cd(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 Wr(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function ei(i,s,u){var f=i.updateQueue;if(f===null)return null;if(f=f.shared,(He&2)!==0){var m=f.pending;return m===null?s.next=s:(s.next=m.next,m.next=s),f.pending=s,s=Ya(i),cy(i,null,u),s}return Ka(i,f,s,u),Ya(i)}function ml(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,$i(i,u)}}function fd(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 dd=!1;function gl(){if(dd){var i=Wo;if(i!==null)throw i}}function yl(i,s,u,f){dd=!1;var m=i.updateQueue;Zr=!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 X=i.alternate;X!==null&&(X=X.updateQueue,R=X.lastBaseUpdate,R!==w&&(R===null?X.firstBaseUpdate=P:R.next=P,X.lastBaseUpdate=O))}if(y!==null){var Q=m.baseState;w=0,X=P=O=null,R=y;do{var H=R.lane&-536870913,G=H!==R.lane;if(G?(Ie&H)===H:(f&H)===H){H!==0&&H===Zo&&(dd=!0),X!==null&&(X=X.next={lane:0,tag:R.tag,payload:R.payload,callback:null,next:null});e:{var ce=i,xe=R;H=s;var Je=u;switch(xe.tag){case 1:if(ce=xe.payload,typeof ce=="function"){Q=ce.call(Je,Q,H);break e}Q=ce;break e;case 3:ce.flags=ce.flags&-65537|128;case 0:if(ce=xe.payload,H=typeof ce=="function"?ce.call(Je,Q,H):ce,H==null)break e;Q=g({},Q,H);break e;case 2:Zr=!0}}H=R.callback,H!==null&&(i.flags|=64,G&&(i.flags|=8192),G=m.callbacks,G===null?m.callbacks=[H]:G.push(H))}else G={lane:H,tag:R.tag,payload:R.payload,callback:R.callback,next:null},X===null?(P=X=G,O=Q):X=X.next=G,w|=H;if(R=R.next,R===null){if(R=m.shared.pending,R===null)break;G=R,R=G.next,G.next=null,m.lastBaseUpdate=G,m.shared.pending=null}}while(!0);X===null&&(O=Q),m.baseState=O,m.firstBaseUpdate=P,m.lastBaseUpdate=X,y===null&&(m.shared.lanes=0),oi|=w,i.lanes=w,i.memoizedState=Q}}function Ay(i,s){if(typeof i!="function")throw Error(r(191,i));i.call(s)}function Oy(i,s){var u=i.callbacks;if(u!==null)for(i.callbacks=null,i=0;i<u.length;i++)Ay(u[i],s)}var ns=k(null),iu=k(0);function ky(i,s){i=kr,W(iu,i),W(ns,s),kr=i|s.baseLanes}function hd(){W(iu,kr),W(ns,ns.current)}function pd(){kr=iu.current,K(ns),K(iu)}var vn=k(null),jn=null;function ti(i){var s=i.alternate;W(at,at.current&1),W(vn,i),jn===null&&(s===null||ns.current!==null||s.memoizedState!==null)&&(jn=i)}function md(i){W(at,at.current),W(vn,i),jn===null&&(jn=i)}function Ny(i){i.tag===22?(W(at,at.current),W(vn,i),jn===null&&(jn=i)):ni()}function ni(){W(at,at.current),W(vn,vn.current)}function bn(i){K(vn),jn===i&&(jn=null),K(at)}var at=k(0);function ou(i){for(var s=i;s!==null;){if(s.tag===13){var u=s.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||xh(u)||wh(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,pt=null,su=!1,rs=!1,no=!1,lu=0,vl=0,is=null,QT=0;function ot(){throw Error(r(321))}function gd(i,s){if(s===null)return!1;for(var u=0;u<s.length&&u<i.length;u++)if(!gn(i[u],s[u]))return!1;return!0}function yd(i,s,u,f,m,y){return wr=y,Ae=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,V.H=i===null||i.memoizedState===null?pv:Dd,no=!1,y=u(f,m),no=!1,rs&&(y=_y(s,u,f,m)),Dy(i),y}function Dy(i){V.H=xl;var s=Ye!==null&&Ye.next!==null;if(wr=0,pt=Ye=Ae=null,su=!1,vl=0,is=null,s)throw Error(r(300));i===null||mt||(i=i.dependencies,i!==null&&Qa(i)&&(mt=!0))}function _y(i,s,u,f){Ae=i;var m=0;do{if(rs&&(is=null),vl=0,rs=!1,25<=m)throw Error(r(301));if(m+=1,pt=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)}V.H=mv,y=s(u,f)}while(rs);return y}function ZT(){var i=V.H,s=i.useState()[0];return s=typeof s.then=="function"?bl(s):s,i=i.useState()[0],(Ye!==null?Ye.memoizedState:null)!==i&&(Ae.flags|=1024),s}function vd(){var i=lu!==0;return lu=0,i}function bd(i,s,u){s.updateQueue=i.updateQueue,s.flags&=-2053,i.lanes&=~u}function Sd(i){if(su){for(i=i.memoizedState;i!==null;){var s=i.queue;s!==null&&(s.pending=null),i=i.next}su=!1}wr=0,pt=Ye=Ae=null,rs=!1,vl=lu=0,is=null}function en(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return pt===null?Ae.memoizedState=pt=i:pt=pt.next=i,pt}function ut(){if(Ye===null){var i=Ae.alternate;i=i!==null?i.memoizedState:null}else i=Ye.next;var s=pt===null?Ae.memoizedState:pt.next;if(s!==null)pt=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},pt===null?Ae.memoizedState=pt=i:pt=pt.next=i}return pt}function au(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function bl(i){var s=vl;return vl+=1,is===null&&(is=[]),i=Cy(is,i,s),s=Ae,(pt===null?s.memoizedState:pt.next)===null&&(s=s.alternate,V.H=s===null||s.memoizedState===null?pv:Dd),i}function uu(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return bl(i);if(i.$$typeof===N)return Dt(i)}throw Error(r(438,String(i)))}function xd(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=au(),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]=ie;return s.index++,u}function Cr(i,s){return typeof s=="function"?s(i):s}function cu(i){var s=ut();return wd(s,Ye,i)}function wd(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,X=!1;do{var Q=P.lane&-536870913;if(Q!==P.lane?(Ie&Q)===Q:(wr&Q)===Q){var H=P.revertLane;if(H===0)O!==null&&(O=O.next={lane:0,revertLane:0,gesture:null,action:P.action,hasEagerState:P.hasEagerState,eagerState:P.eagerState,next:null}),Q===Zo&&(X=!0);else if((wr&H)===H){P=P.next,H===Zo&&(X=!0);continue}else Q={lane:0,revertLane:P.revertLane,gesture:null,action:P.action,hasEagerState:P.hasEagerState,eagerState:P.eagerState,next:null},O===null?(R=O=Q,w=y):O=O.next=Q,Ae.lanes|=H,oi|=H;Q=P.action,no&&u(y,Q),y=P.hasEagerState?P.eagerState:u(y,Q)}else H={lane:Q,revertLane:P.revertLane,gesture:P.gesture,action:P.action,hasEagerState:P.hasEagerState,eagerState:P.eagerState,next:null},O===null?(R=O=H,w=y):O=O.next=H,Ae.lanes|=Q,oi|=Q;P=P.next}while(P!==null&&P!==s);if(O===null?w=y:O.next=R,!gn(y,i.memoizedState)&&(mt=!0,X&&(u=Wo,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 Cd(i){var s=ut(),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);gn(y,s.memoizedState)||(mt=!0),s.memoizedState=y,s.baseQueue===null&&(s.baseState=y),u.lastRenderedState=y}return[y,f]}function zy(i,s,u){var f=Ae,m=ut(),y=Ve;if(y){if(u===void 0)throw Error(r(407));u=u()}else u=s();var w=!gn((Ye||m).memoizedState,u);if(w&&(m.memoizedState=u,mt=!0),m=m.queue,Rd(Iy.bind(null,f,m,i),[i]),m.getSnapshot!==s||w||pt!==null&&pt.memoizedState.tag&1){if(f.flags|=2048,ss(9,{destroy:void 0},Ly.bind(null,f,m,u,s),null),Qe===null)throw Error(r(349));y||(wr&127)!==0||jy(f,s,u)}return u}function jy(i,s,u){i.flags|=16384,i={getSnapshot:s,value:u},s=Ae.updateQueue,s===null?(s=au(),Ae.updateQueue=s,s.stores=[i]):(u=s.stores,u===null?s.stores=[i]:u.push(i))}function Ly(i,s,u,f){s.value=u,s.getSnapshot=f,By(s)&&Vy(i)}function Iy(i,s,u){return u(function(){By(s)&&Vy(i)})}function By(i){var s=i.getSnapshot;i=i.value;try{var u=s();return!gn(i,u)}catch{return!0}}function Vy(i){var s=Ki(i,2);s!==null&&hn(s,i,2)}function Md(i){var s=en();if(typeof i=="function"){var u=i;if(i=u(),no){sn(!0);try{u()}finally{sn(!1)}}}return s.memoizedState=s.baseState=i,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Cr,lastRenderedState:i},s}function Fy(i,s,u,f){return i.baseState=u,wd(i,Ye,typeof f=="function"?f:Cr)}function WT(i,s,u,f,m){if(hu(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)}};V.T!==null?u(!0):y.isTransition=!1,f(y),u=s.pending,u===null?(y.next=s.pending=y,Py(s,y)):(y.next=u.next,s.pending=u.next=y)}}function Py(i,s){var u=s.action,f=s.payload,m=i.state;if(s.isTransition){var y=V.T,w={};V.T=w;try{var R=u(m,f),O=V.S;O!==null&&O(w,R),$y(i,s,R)}catch(P){Ed(i,s,P)}finally{y!==null&&w.types!==null&&(y.types=w.types),V.T=y}}else try{y=u(m,f),$y(i,s,y)}catch(P){Ed(i,s,P)}}function $y(i,s,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(f){Hy(i,s,f)},function(f){return Ed(i,s,f)}):Hy(i,s,u)}function Hy(i,s,u){s.status="fulfilled",s.value=u,Uy(s),i.state=u,s=i.pending,s!==null&&(u=s.next,u===s?i.pending=null:(u=u.next,s.next=u,Py(i,u)))}function Ed(i,s,u){var f=i.pending;if(i.pending=null,f!==null){f=f.next;do s.status="rejected",s.reason=u,Uy(s),s=s.next;while(s!==f)}i.action=null}function Uy(i){i=i.listeners;for(var s=0;s<i.length;s++)(0,i[s])()}function qy(i,s){return s}function Gy(i,s){if(Ve){var u=Qe.formState;if(u!==null){e:{var f=Ae;if(Ve){if(et){t:{for(var m=et,y=zn;m.nodeType!==8;){if(!y){m=null;break t}if(m=Ln(m.nextSibling),m===null){m=null;break t}}y=m.data,m=y==="F!"||y==="F"?m:null}if(m){et=Ln(m.nextSibling),f=m.data==="F!";break e}}Jr(f)}f=!1}f&&(s=u[0])}}return u=en(),u.memoizedState=u.baseState=s,f={pending:null,lanes:0,dispatch:null,lastRenderedReducer:qy,lastRenderedState:s},u.queue=f,u=fv.bind(null,Ae,f),f.dispatch=u,f=Md(!1),y=Nd.bind(null,Ae,!1,f.queue),f=en(),m={state:s,dispatch:null,action:i,pending:null},f.queue=m,u=WT.bind(null,Ae,m,y,u),m.dispatch=u,f.memoizedState=i,[s,u,!1]}function Ky(i){var s=ut();return Yy(s,Ye,i)}function Yy(i,s,u){if(s=wd(i,s,qy)[0],i=cu(Cr)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var f=bl(s)}catch(w){throw w===es?eu:w}else f=s;s=ut();var m=s.queue,y=m.dispatch;return u!==s.memoizedState&&(Ae.flags|=2048,ss(9,{destroy:void 0},eA.bind(null,m,u),null)),[f,y,i]}function eA(i,s){i.action=s}function Xy(i){var s=ut(),u=Ye;if(u!==null)return Yy(s,u,i);ut(),s=s.memoizedState,u=ut();var f=u.queue.dispatch;return u.memoizedState=i,[s,f,!1]}function ss(i,s,u,f){return i={tag:i,create:u,deps:f,inst:s,next:null},s=Ae.updateQueue,s===null&&(s=au(),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 Jy(){return ut().memoizedState}function fu(i,s,u,f){var m=en();Ae.flags|=i,m.memoizedState=ss(1|s,{destroy:void 0},u,f===void 0?null:f)}function du(i,s,u,f){var m=ut();f=f===void 0?null:f;var y=m.memoizedState.inst;Ye!==null&&f!==null&&gd(f,Ye.memoizedState.deps)?m.memoizedState=ss(s,y,u,f):(Ae.flags|=i,m.memoizedState=ss(1|s,y,u,f))}function Qy(i,s){fu(8390656,8,i,s)}function Rd(i,s){du(2048,8,i,s)}function tA(i){Ae.flags|=4;var s=Ae.updateQueue;if(s===null)s=au(),Ae.updateQueue=s,s.events=[i];else{var u=s.events;u===null?s.events=[i]:u.push(i)}}function Zy(i){var s=ut().memoizedState;return tA({ref:s,nextImpl:i}),function(){if((He&2)!==0)throw Error(r(440));return s.impl.apply(void 0,arguments)}}function Wy(i,s){return du(4,2,i,s)}function ev(i,s){return du(4,4,i,s)}function tv(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 nv(i,s,u){u=u!=null?u.concat([i]):null,du(4,4,tv.bind(null,s,i),u)}function Td(){}function rv(i,s){var u=ut();s=s===void 0?null:s;var f=u.memoizedState;return s!==null&&gd(s,f[1])?f[0]:(u.memoizedState=[i,s],i)}function iv(i,s){var u=ut();s=s===void 0?null:s;var f=u.memoizedState;if(s!==null&&gd(s,f[1]))return f[0];if(f=i(),no){sn(!0);try{i()}finally{sn(!1)}}return u.memoizedState=[f,s],f}function Ad(i,s,u){return u===void 0||(wr&1073741824)!==0&&(Ie&261930)===0?i.memoizedState=s:(i.memoizedState=u,i=o0(),Ae.lanes|=i,oi|=i,u)}function ov(i,s,u,f){return gn(u,s)?u:ns.current!==null?(i=Ad(i,u,f),gn(i,s)||(mt=!0),i):(wr&42)===0||(wr&1073741824)!==0&&(Ie&261930)===0?(mt=!0,i.memoizedState=u):(i=o0(),Ae.lanes|=i,oi|=i,s)}function sv(i,s,u,f,m){var y=U.p;U.p=y!==0&&8>y?y:8;var w=V.T,R={};V.T=R,Nd(i,!1,s,u);try{var O=m(),P=V.S;if(P!==null&&P(R,O),O!==null&&typeof O=="object"&&typeof O.then=="function"){var X=JT(O,f);Sl(i,s,X,wn(i))}else Sl(i,s,f,wn(i))}catch(Q){Sl(i,s,{then:function(){},status:"rejected",reason:Q},wn())}finally{U.p=y,w!==null&&R.types!==null&&(w.types=R.types),V.T=w}}function nA(){}function Od(i,s,u,f){if(i.tag!==5)throw Error(r(476));var m=lv(i).queue;sv(i,m,s,L,u===null?nA:function(){return av(i),u(f)})}function lv(i){var s=i.memoizedState;if(s!==null)return s;s={memoizedState:L,baseState:L,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Cr,lastRenderedState:L},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 av(i){var s=lv(i);s.next===null&&(s=i.alternate.memoizedState),Sl(i,s.next.queue,{},wn())}function kd(){return Dt(Il)}function uv(){return ut().memoizedState}function cv(){return ut().memoizedState}function rA(i){for(var s=i.return;s!==null;){switch(s.tag){case 24:case 3:var u=wn();i=Wr(u);var f=ei(s,i,u);f!==null&&(hn(f,s,u),ml(f,s,u)),s={cache:od()},i.payload=s;return}s=s.return}}function iA(i,s,u){var f=wn();u={lane:f,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},hu(i)?dv(s,u):(u=Yf(i,s,u,f),u!==null&&(hn(u,i,f),hv(u,s,f)))}function fv(i,s,u){var f=wn();Sl(i,s,u,f)}function Sl(i,s,u,f){var m={lane:f,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(hu(i))dv(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,gn(R,w))return Ka(i,s,m,0),Qe===null&&Ga(),!1}catch{}if(u=Yf(i,s,m,f),u!==null)return hn(u,i,f),hv(u,s,f),!0}return!1}function Nd(i,s,u,f){if(f={lane:2,revertLane:uh(),gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null},hu(i)){if(s)throw Error(r(479))}else s=Yf(i,u,f,2),s!==null&&hn(s,i,2)}function hu(i){var s=i.alternate;return i===Ae||s!==null&&s===Ae}function dv(i,s){rs=su=!0;var u=i.pending;u===null?s.next=s:(s.next=u.next,u.next=s),i.pending=s}function hv(i,s,u){if((u&4194048)!==0){var f=s.lanes;f&=i.pendingLanes,u|=f,s.lanes=u,$i(i,u)}}var xl={readContext:Dt,use:uu,useCallback:ot,useContext:ot,useEffect:ot,useImperativeHandle:ot,useLayoutEffect:ot,useInsertionEffect:ot,useMemo:ot,useReducer:ot,useRef:ot,useState:ot,useDebugValue:ot,useDeferredValue:ot,useTransition:ot,useSyncExternalStore:ot,useId:ot,useHostTransitionStatus:ot,useFormState:ot,useActionState:ot,useOptimistic:ot,useMemoCache:ot,useCacheRefresh:ot};xl.useEffectEvent=ot;var pv={readContext:Dt,use:uu,useCallback:function(i,s){return en().memoizedState=[i,s===void 0?null:s],i},useContext:Dt,useEffect:Qy,useImperativeHandle:function(i,s,u){u=u!=null?u.concat([i]):null,fu(4194308,4,tv.bind(null,s,i),u)},useLayoutEffect:function(i,s){return fu(4194308,4,i,s)},useInsertionEffect:function(i,s){fu(4,2,i,s)},useMemo:function(i,s){var u=en();s=s===void 0?null:s;var f=i();if(no){sn(!0);try{i()}finally{sn(!1)}}return u.memoizedState=[f,s],f},useReducer:function(i,s,u){var f=en();if(u!==void 0){var m=u(s);if(no){sn(!0);try{u(s)}finally{sn(!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=iA.bind(null,Ae,i),[f.memoizedState,i]},useRef:function(i){var s=en();return i={current:i},s.memoizedState=i},useState:function(i){i=Md(i);var s=i.queue,u=fv.bind(null,Ae,s);return s.dispatch=u,[i.memoizedState,u]},useDebugValue:Td,useDeferredValue:function(i,s){var u=en();return Ad(u,i,s)},useTransition:function(){var i=Md(!1);return i=sv.bind(null,Ae,i.queue,!0,!1),en().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,s,u){var f=Ae,m=en();if(Ve){if(u===void 0)throw Error(r(407));u=u()}else{if(u=s(),Qe===null)throw Error(r(349));(Ie&127)!==0||jy(f,s,u)}m.memoizedState=u;var y={value:u,getSnapshot:s};return m.queue=y,Qy(Iy.bind(null,f,y,i),[i]),f.flags|=2048,ss(9,{destroy:void 0},Ly.bind(null,f,y,u,s),null),u},useId:function(){var i=en(),s=Qe.identifierPrefix;if(Ve){var u=rr,f=nr;u=(f&~(1<<32-Vt(f)-1)).toString(32)+u,s="_"+s+"R_"+u,u=lu++,0<u&&(s+="H"+u.toString(32)),s+="_"}else u=QT++,s="_"+s+"r_"+u.toString(32)+"_";return i.memoizedState=s},useHostTransitionStatus:kd,useFormState:Gy,useActionState:Gy,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=Nd.bind(null,Ae,!0,u),u.dispatch=s,[i,s]},useMemoCache:xd,useCacheRefresh:function(){return en().memoizedState=rA.bind(null,Ae)},useEffectEvent:function(i){var s=en(),u={impl:i};return s.memoizedState=u,function(){if((He&2)!==0)throw Error(r(440));return u.impl.apply(void 0,arguments)}}},Dd={readContext:Dt,use:uu,useCallback:rv,useContext:Dt,useEffect:Rd,useImperativeHandle:nv,useInsertionEffect:Wy,useLayoutEffect:ev,useMemo:iv,useReducer:cu,useRef:Jy,useState:function(){return cu(Cr)},useDebugValue:Td,useDeferredValue:function(i,s){var u=ut();return ov(u,Ye.memoizedState,i,s)},useTransition:function(){var i=cu(Cr)[0],s=ut().memoizedState;return[typeof i=="boolean"?i:bl(i),s]},useSyncExternalStore:zy,useId:uv,useHostTransitionStatus:kd,useFormState:Ky,useActionState:Ky,useOptimistic:function(i,s){var u=ut();return Fy(u,Ye,i,s)},useMemoCache:xd,useCacheRefresh:cv};Dd.useEffectEvent=Zy;var mv={readContext:Dt,use:uu,useCallback:rv,useContext:Dt,useEffect:Rd,useImperativeHandle:nv,useInsertionEffect:Wy,useLayoutEffect:ev,useMemo:iv,useReducer:Cd,useRef:Jy,useState:function(){return Cd(Cr)},useDebugValue:Td,useDeferredValue:function(i,s){var u=ut();return Ye===null?Ad(u,i,s):ov(u,Ye.memoizedState,i,s)},useTransition:function(){var i=Cd(Cr)[0],s=ut().memoizedState;return[typeof i=="boolean"?i:bl(i),s]},useSyncExternalStore:zy,useId:uv,useHostTransitionStatus:kd,useFormState:Xy,useActionState:Xy,useOptimistic:function(i,s){var u=ut();return Ye!==null?Fy(u,Ye,i,s):(u.baseState=i,[i,u.queue.dispatch])},useMemoCache:xd,useCacheRefresh:cv};mv.useEffectEvent=Zy;function _d(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 zd={enqueueSetState:function(i,s,u){i=i._reactInternals;var f=wn(),m=Wr(f);m.payload=s,u!=null&&(m.callback=u),s=ei(i,m,f),s!==null&&(hn(s,i,f),ml(s,i,f))},enqueueReplaceState:function(i,s,u){i=i._reactInternals;var f=wn(),m=Wr(f);m.tag=1,m.payload=s,u!=null&&(m.callback=u),s=ei(i,m,f),s!==null&&(hn(s,i,f),ml(s,i,f))},enqueueForceUpdate:function(i,s){i=i._reactInternals;var u=wn(),f=Wr(u);f.tag=2,s!=null&&(f.callback=s),s=ei(i,f,u),s!==null&&(hn(s,i,u),ml(s,i,u))}};function gv(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?!ll(u,f)||!ll(m,y):!0}function yv(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&&zd.enqueueReplaceState(s,s.state,null)}function ro(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 vv(i){qa(i)}function bv(i){console.error(i)}function Sv(i){qa(i)}function pu(i,s){try{var u=i.onUncaughtError;u(s.value,{componentStack:s.stack})}catch(f){setTimeout(function(){throw f})}}function xv(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 jd(i,s,u){return u=Wr(u),u.tag=3,u.payload={element:null},u.callback=function(){pu(i,s)},u}function wv(i){return i=Wr(i),i.tag=3,i}function Cv(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(){xv(s,u,f)}}var w=u.stateNode;w!==null&&typeof w.componentDidCatch=="function"&&(i.callback=function(){xv(s,u,f),typeof m!="function"&&(si===null?si=new Set([this]):si.add(this));var R=f.stack;this.componentDidCatch(f.value,{componentStack:R!==null?R:""})})}function oA(i,s,u,f,m){if(u.flags|=32768,f!==null&&typeof f=="object"&&typeof f.then=="function"){if(s=u.alternate,s!==null&&Qo(s,u,m,!0),u=vn.current,u!==null){switch(u.tag){case 31:case 13:return jn===null?Ru():u.alternate===null&&st===0&&(st=3),u.flags&=-257,u.flags|=65536,u.lanes=m,f===tu?u.flags|=16384:(s=u.updateQueue,s===null?u.updateQueue=new Set([f]):s.add(f),sh(i,f,m)),!1;case 22:return u.flags|=65536,f===tu?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)),sh(i,f,m)),!1}throw Error(r(435,u.tag))}return sh(i,f,m),Ru(),!1}if(Ve)return s=vn.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=m,f!==ed&&(i=Error(r(422),{cause:f}),cl(Nn(i,u)))):(f!==ed&&(s=Error(r(423),{cause:f}),cl(Nn(s,u))),i=i.current.alternate,i.flags|=65536,m&=-m,i.lanes|=m,f=Nn(f,u),m=jd(i.stateNode,f,m),fd(i,m),st!==4&&(st=2)),!1;var y=Error(r(520),{cause:f});if(y=Nn(y,u),Ol===null?Ol=[y]:Ol.push(y),st!==4&&(st=2),s===null)return!0;f=Nn(f,u),u=s;do{switch(u.tag){case 3:return u.flags|=65536,i=m&-m,u.lanes|=i,i=jd(u.stateNode,f,i),fd(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"&&(si===null||!si.has(y))))return u.flags|=65536,m&=-m,u.lanes|=m,m=wv(m),Cv(m,i,u,f),fd(u,m),!1}u=u.return}while(u!==null);return!1}var Ld=Error(r(461)),mt=!1;function _t(i,s,u,f){s.child=i===null?Ty(s,null,u,f):to(s,i.child,u,f)}function Mv(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 Qi(s),f=yd(i,s,u,w,y,m),R=vd(),i!==null&&!mt?(bd(i,s,m),Mr(i,s,m)):(Ve&&R&&Zf(s),s.flags|=1,_t(i,s,f,m),s.child)}function Ev(i,s,u,f,m){if(i===null){var y=u.type;return typeof y=="function"&&!Xf(y)&&y.defaultProps===void 0&&u.compare===null?(s.tag=15,s.type=y,Rv(i,s,y,f,m)):(i=Xa(u.type,null,f,s,s.mode,m),i.ref=s.ref,i.return=s,s.child=i)}if(y=i.child,!Ud(i,m)){var w=y.memoizedProps;if(u=u.compare,u=u!==null?u:ll,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 Rv(i,s,u,f,m){if(i!==null){var y=i.memoizedProps;if(ll(y,f)&&i.ref===s.ref)if(mt=!1,s.pendingProps=f=y,Ud(i,m))(i.flags&131072)!==0&&(mt=!0);else return s.lanes=i.lanes,Mr(i,s,m)}return Id(i,s,u,f,m)}function Tv(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 Av(i,s,y,u,f)}if((u&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},i!==null&&Wa(s,y!==null?y.cachePool:null),y!==null?ky(s,y):hd(),Ny(s);else return f=s.lanes=536870912,Av(i,s,y!==null?y.baseLanes|u:u,u,f)}else y!==null?(Wa(s,y.cachePool),ky(s,y),ni(),s.memoizedState=null):(i!==null&&Wa(s,null),hd(),ni());return _t(i,s,m,u),s.child}function wl(i,s){return i!==null&&i.tag===22||s.stateNode!==null||(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.sibling}function Av(i,s,u,f,m){var y=ld();return y=y===null?null:{parent:ht._currentValue,pool:y},s.memoizedState={baseLanes:u,cachePool:y},i!==null&&Wa(s,null),hd(),Ny(s),i!==null&&Qo(i,s,f,!0),s.childLanes=m,null}function mu(i,s){return s=yu({mode:s.mode,children:s.children},i.mode),s.ref=i.ref,i.child=s,s.return=i,s}function Ov(i,s,u){return to(s,i.child,null,u),i=mu(s,s.pendingProps),i.flags|=2,bn(s),s.memoizedState=null,i}function sA(i,s,u){var f=s.pendingProps,m=(s.flags&128)!==0;if(s.flags&=-129,i===null){if(Ve){if(f.mode==="hidden")return i=mu(s,f),s.lanes=536870912,wl(null,i);if(md(s),(i=et)?(i=P0(i,zn),i=i!==null&&i.data==="&"?i:null,i!==null&&(s.memoizedState={dehydrated:i,treeContext:Yr!==null?{id:nr,overflow:rr}:null,retryLane:536870912,hydrationErrors:null},u=dy(i),u.return=s,s.child=u,Nt=s,et=null)):i=null,i===null)throw Jr(s);return s.lanes=536870912,null}return mu(s,f)}var y=i.memoizedState;if(y!==null){var w=y.dehydrated;if(md(s),m)if(s.flags&256)s.flags&=-257,s=Ov(i,s,u);else if(s.memoizedState!==null)s.child=i.child,s.flags|=128,s=null;else throw Error(r(558));else if(mt||Qo(i,s,u,!1),m=(u&i.childLanes)!==0,mt||m){if(f=Qe,f!==null&&(w=_o(f,u),w!==0&&w!==y.retryLane))throw y.retryLane=w,Ki(i,w),hn(f,i,w),Ld;Ru(),s=Ov(i,s,u)}else i=y.treeContext,et=Ln(w.nextSibling),Nt=s,Ve=!0,Xr=null,zn=!1,i!==null&&my(s,i),s=mu(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 gu(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 Id(i,s,u,f,m){return Qi(s),u=yd(i,s,u,f,void 0,m),f=vd(),i!==null&&!mt?(bd(i,s,m),Mr(i,s,m)):(Ve&&f&&Zf(s),s.flags|=1,_t(i,s,u,m),s.child)}function kv(i,s,u,f,m,y){return Qi(s),s.updateQueue=null,u=_y(s,f,u,m),Dy(i),f=vd(),i!==null&&!mt?(bd(i,s,y),Mr(i,s,y)):(Ve&&f&&Zf(s),s.flags|=1,_t(i,s,u,y),s.child)}function Nv(i,s,u,f,m){if(Qi(s),s.stateNode===null){var y=Ko,w=u.contextType;typeof w=="object"&&w!==null&&(y=Dt(w)),y=new u(f,y),s.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,y.updater=zd,s.stateNode=y,y._reactInternals=s,y=s.stateNode,y.props=f,y.state=s.memoizedState,y.refs={},ud(s),w=u.contextType,y.context=typeof w=="object"&&w!==null?Dt(w):Ko,y.state=s.memoizedState,w=u.getDerivedStateFromProps,typeof w=="function"&&(_d(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&&zd.enqueueReplaceState(y,y.state,null),yl(s,f,y,m),gl(),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=ro(u,R);y.props=O;var P=y.context,X=u.contextType;w=Ko,typeof X=="object"&&X!==null&&(w=Dt(X));var Q=u.getDerivedStateFromProps;X=typeof Q=="function"||typeof y.getSnapshotBeforeUpdate=="function",R=s.pendingProps!==R,X||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(R||P!==w)&&yv(s,y,f,w),Zr=!1;var H=s.memoizedState;y.state=H,yl(s,f,y,m),gl(),P=s.memoizedState,R||H!==P||Zr?(typeof Q=="function"&&(_d(s,u,Q,f),P=s.memoizedState),(O=Zr||gv(s,u,O,f,H,P,w))?(X||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,cd(i,s),w=s.memoizedProps,X=ro(u,w),y.props=X,Q=s.pendingProps,H=y.context,P=u.contextType,O=Ko,typeof P=="object"&&P!==null&&(O=Dt(P)),R=u.getDerivedStateFromProps,(P=typeof R=="function"||typeof y.getSnapshotBeforeUpdate=="function")||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(w!==Q||H!==O)&&yv(s,y,f,O),Zr=!1,H=s.memoizedState,y.state=H,yl(s,f,y,m),gl();var G=s.memoizedState;w!==Q||H!==G||Zr||i!==null&&i.dependencies!==null&&Qa(i.dependencies)?(typeof R=="function"&&(_d(s,u,R,f),G=s.memoizedState),(X=Zr||gv(s,u,X,f,H,G,O)||i!==null&&i.dependencies!==null&&Qa(i.dependencies))?(P||typeof y.UNSAFE_componentWillUpdate!="function"&&typeof y.componentWillUpdate!="function"||(typeof y.componentWillUpdate=="function"&&y.componentWillUpdate(f,G,O),typeof y.UNSAFE_componentWillUpdate=="function"&&y.UNSAFE_componentWillUpdate(f,G,O)),typeof y.componentDidUpdate=="function"&&(s.flags|=4),typeof y.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof y.componentDidUpdate!="function"||w===i.memoizedProps&&H===i.memoizedState||(s.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||w===i.memoizedProps&&H===i.memoizedState||(s.flags|=1024),s.memoizedProps=f,s.memoizedState=G),y.props=f,y.state=G,y.context=O,f=X):(typeof y.componentDidUpdate!="function"||w===i.memoizedProps&&H===i.memoizedState||(s.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||w===i.memoizedProps&&H===i.memoizedState||(s.flags|=1024),f=!1)}return y=f,gu(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=to(s,i.child,null,m),s.child=to(s,null,u,m)):_t(i,s,u,m),s.memoizedState=y.state,i=s.child):i=Mr(i,s,m),i}function Dv(i,s,u,f){return Xi(),s.flags|=256,_t(i,s,u,f),s.child}var Bd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Vd(i){return{baseLanes:i,cachePool:xy()}}function Fd(i,s,u){return i=i!==null?i.childLanes&~u:0,s&&(i|=xn),i}function _v(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:(at.current&2)!==0),w&&(m=!0,s.flags&=-129),w=(s.flags&32)!==0,s.flags&=-33,i===null){if(Ve){if(m?ti(s):ni(),(i=et)?(i=P0(i,zn),i=i!==null&&i.data!=="&"?i:null,i!==null&&(s.memoizedState={dehydrated:i,treeContext:Yr!==null?{id:nr,overflow:rr}:null,retryLane:536870912,hydrationErrors:null},u=dy(i),u.return=s,s.child=u,Nt=s,et=null)):i=null,i===null)throw Jr(s);return wh(i)?s.lanes=32:s.lanes=536870912,null}var R=f.children;return f=f.fallback,m?(ni(),m=s.mode,R=yu({mode:"hidden",children:R},m),f=Yi(f,m,u,null),R.return=s,f.return=s,R.sibling=f,s.child=R,f=s.child,f.memoizedState=Vd(u),f.childLanes=Fd(i,w,u),s.memoizedState=Bd,wl(null,f)):(ti(s),Pd(s,R))}var O=i.memoizedState;if(O!==null&&(R=O.dehydrated,R!==null)){if(y)s.flags&256?(ti(s),s.flags&=-257,s=$d(i,s,u)):s.memoizedState!==null?(ni(),s.child=i.child,s.flags|=128,s=null):(ni(),R=f.fallback,m=s.mode,f=yu({mode:"visible",children:f.children},m),R=Yi(R,m,u,null),R.flags|=2,f.return=s,R.return=s,f.sibling=R,s.child=f,to(s,i.child,null,u),f=s.child,f.memoizedState=Vd(u),f.childLanes=Fd(i,w,u),s.memoizedState=Bd,s=wl(null,f));else if(ti(s),wh(R)){if(w=R.nextSibling&&R.nextSibling.dataset,w)var P=w.dgst;w=P,f=Error(r(419)),f.stack="",f.digest=w,cl({value:f,source:null,stack:null}),s=$d(i,s,u)}else if(mt||Qo(i,s,u,!1),w=(u&i.childLanes)!==0,mt||w){if(w=Qe,w!==null&&(f=_o(w,u),f!==0&&f!==O.retryLane))throw O.retryLane=f,Ki(i,f),hn(w,i,f),Ld;xh(R)||Ru(),s=$d(i,s,u)}else xh(R)?(s.flags|=192,s.child=i.child,s=null):(i=O.treeContext,et=Ln(R.nextSibling),Nt=s,Ve=!0,Xr=null,zn=!1,i!==null&&my(s,i),s=Pd(s,f.children),s.flags|=4096);return s}return m?(ni(),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=Yi(R,m,u,null),R.flags|=2),R.return=s,f.return=s,f.sibling=R,s.child=f,wl(null,f),f=s.child,R=i.child.memoizedState,R===null?R=Vd(u):(m=R.cachePool,m!==null?(O=ht._currentValue,m=m.parent!==O?{parent:O,pool:O}:m):m=xy(),R={baseLanes:R.baseLanes|u,cachePool:m}),f.memoizedState=R,f.childLanes=Fd(i,w,u),s.memoizedState=Bd,wl(i.child,f)):(ti(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 Pd(i,s){return s=yu({mode:"visible",children:s},i.mode),s.return=i,i.child=s}function yu(i,s){return i=yn(22,i,null,s),i.lanes=0,i}function $d(i,s,u){return to(s,i.child,null,u),i=Pd(s,s.pendingProps.children),i.flags|=2,s.memoizedState=null,i}function zv(i,s,u){i.lanes|=s;var f=i.alternate;f!==null&&(f.lanes|=s),rd(i.return,s,u)}function Hd(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 jv(i,s,u){var f=s.pendingProps,m=f.revealOrder,y=f.tail;f=f.children;var w=at.current,R=(w&2)!==0;if(R?(w=w&1|2,s.flags|=128):w&=1,W(at,w),_t(i,s,f,u),f=Ve?ul:0,!R&&i!==null&&(i.flags&128)!==0)e:for(i=s.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&zv(i,u,s);else if(i.tag===19)zv(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&&ou(i)===null&&(m=u),u=u.sibling;u=m,u===null?(m=s.child,s.child=null):(m=u.sibling,u.sibling=null),Hd(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&&ou(i)===null){s.child=m;break}i=m.sibling,m.sibling=u,u=m,m=i}Hd(s,!0,u,null,y,f);break;case"together":Hd(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),oi|=s.lanes,(u&s.childLanes)===0)if(i!==null){if(Qo(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 Ud(i,s){return(i.lanes&s)!==0?!0:(i=i.dependencies,!!(i!==null&&Qa(i)))}function lA(i,s,u){switch(s.tag){case 3:Ke(s,s.stateNode.containerInfo),Qr(s,ht,i.memoizedState.cache),Xi();break;case 27:case 5:St(s);break;case 4:Ke(s,s.stateNode.containerInfo);break;case 10:Qr(s,s.type,s.memoizedProps.value);break;case 31:if(s.memoizedState!==null)return s.flags|=128,md(s),null;break;case 13:var f=s.memoizedState;if(f!==null)return f.dehydrated!==null?(ti(s),s.flags|=128,null):(u&s.child.childLanes)!==0?_v(i,s,u):(ti(s),i=Mr(i,s,u),i!==null?i.sibling:null);ti(s);break;case 19:var m=(i.flags&128)!==0;if(f=(u&s.childLanes)!==0,f||(Qo(i,s,u,!1),f=(u&s.childLanes)!==0),m){if(f)return jv(i,s,u);s.flags|=128}if(m=s.memoizedState,m!==null&&(m.rendering=null,m.tail=null,m.lastEffect=null),W(at,at.current),f)break;return null;case 22:return s.lanes=0,Tv(i,s,u,s.pendingProps);case 24:Qr(s,ht,i.memoizedState.cache)}return Mr(i,s,u)}function Lv(i,s,u){if(i!==null)if(i.memoizedProps!==s.pendingProps)mt=!0;else{if(!Ud(i,u)&&(s.flags&128)===0)return mt=!1,lA(i,s,u);mt=(i.flags&131072)!==0}else mt=!1,Ve&&(s.flags&1048576)!==0&&py(s,ul,s.index);switch(s.lanes=0,s.tag){case 16:e:{var f=s.pendingProps;if(i=Wi(s.elementType),s.type=i,typeof i=="function")Xf(i)?(f=ro(i,f),s.tag=1,s=Nv(null,s,i,f,u)):(s.tag=0,s=Id(null,s,i,f,u));else{if(i!=null){var m=i.$$typeof;if(m===D){s.tag=11,s=Mv(null,s,i,f,u);break e}else if(m===_){s.tag=14,s=Ev(null,s,i,f,u);break e}}throw s=te(i)||i,Error(r(306,s,""))}}return s;case 0:return Id(i,s,s.type,s.pendingProps,u);case 1:return f=s.type,m=ro(f,s.pendingProps),Nv(i,s,f,m,u);case 3:e:{if(Ke(s,s.stateNode.containerInfo),i===null)throw Error(r(387));f=s.pendingProps;var y=s.memoizedState;m=y.element,cd(i,s),yl(s,f,null,u);var w=s.memoizedState;if(f=w.cache,Qr(s,ht,f),f!==y.cache&&id(s,[ht],u,!0),gl(),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=Dv(i,s,f,u);break e}else if(f!==m){m=Nn(Error(r(424)),s),cl(m),s=Dv(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,et=Ln(i.firstChild),Nt=s,Ve=!0,Xr=null,zn=!0,u=Ty(s,null,f,u),s.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling;else{if(Xi(),f===m){s=Mr(i,s,u);break e}_t(i,s,f,u)}s=s.child}return s;case 26:return gu(i,s),i===null?(u=K0(s.type,null,s.pendingProps,null))?s.memoizedState=u:Ve||(u=s.type,i=s.pendingProps,f=_u(ae.current).createElement(u),f[kt]=s,f[ln]=i,zt(f,u,i),Mt(f),s.stateNode=f):s.memoizedState=K0(s.type,i.memoizedProps,s.pendingProps,i.memoizedState),null;case 27:return St(s),i===null&&Ve&&(f=s.stateNode=U0(s.type,s.pendingProps,ae.current),Nt=s,zn=!0,m=et,ci(s.type)?(Ch=m,et=Ln(f.firstChild)):et=m),_t(i,s,s.pendingProps.children,u),gu(i,s),i===null&&(s.flags|=4194304),s.child;case 5:return i===null&&Ve&&((m=f=et)&&(f=IA(f,s.type,s.pendingProps,zn),f!==null?(s.stateNode=f,Nt=s,et=Ln(f.firstChild),zn=!1,m=!0):m=!1),m||Jr(s)),St(s),m=s.type,y=s.pendingProps,w=i!==null?i.memoizedProps:null,f=y.children,vh(m,y)?f=null:w!==null&&vh(m,w)&&(s.flags|=32),s.memoizedState!==null&&(m=yd(i,s,ZT,null,null,u),Il._currentValue=m),gu(i,s),_t(i,s,f,u),s.child;case 6:return i===null&&Ve&&((i=u=et)&&(u=BA(u,s.pendingProps,zn),u!==null?(s.stateNode=u,Nt=s,et=null,i=!0):i=!1),i||Jr(s)),null;case 13:return _v(i,s,u);case 4:return Ke(s,s.stateNode.containerInfo),f=s.pendingProps,i===null?s.child=to(s,null,f,u):_t(i,s,f,u),s.child;case 11:return Mv(i,s,s.type,s.pendingProps,u);case 7:return _t(i,s,s.pendingProps,u),s.child;case 8:return _t(i,s,s.pendingProps.children,u),s.child;case 12:return _t(i,s,s.pendingProps.children,u),s.child;case 10:return f=s.pendingProps,Qr(s,s.type,f.value),_t(i,s,f.children,u),s.child;case 9:return m=s.type._context,f=s.pendingProps.children,Qi(s),m=Dt(m),f=f(m),s.flags|=1,_t(i,s,f,u),s.child;case 14:return Ev(i,s,s.type,s.pendingProps,u);case 15:return Rv(i,s,s.type,s.pendingProps,u);case 19:return jv(i,s,u);case 31:return sA(i,s,u);case 22:return Tv(i,s,u,s.pendingProps);case 24:return Qi(s),f=Dt(ht),i===null?(m=ld(),m===null&&(m=Qe,y=od(),m.pooledCache=y,y.refCount++,y!==null&&(m.pooledCacheLanes|=u),m=y),s.memoizedState={parent:f,cache:m},ud(s),Qr(s,ht,m)):((i.lanes&u)!==0&&(cd(i,s),yl(s,null,null,u),gl()),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),Qr(s,ht,f)):(f=y.cache,Qr(s,ht,f),f!==m.cache&&id(s,[ht],u,!0))),_t(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(u0())i.flags|=8192;else throw eo=tu,ad}else i.flags&=-16777217}function Iv(i,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!Z0(s))if(u0())i.flags|=8192;else throw eo=tu,ad}function vu(i,s){s!==null&&(i.flags|=4),i.flags&16384&&(s=i.tag!==22?Fe():536870912,i.lanes|=s,cs|=s)}function Cl(i,s){if(!Ve)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 tt(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 aA(i,s,u){var f=s.pendingProps;switch(Wf(s),s.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return tt(s),null;case 1:return tt(s),null;case 3:return u=s.stateNode,f=null,i!==null&&(f=i.memoizedState.cache),s.memoizedState.cache!==f&&(s.flags|=2048),xr(ht),Ee(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(i===null||i.child===null)&&(Jo(s)?Er(s):i===null||i.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,td())),tt(s),null;case 26:var m=s.type,y=s.memoizedState;return i===null?(Er(s),y!==null?(tt(s),Iv(s,y)):(tt(s),qd(s,m,null,f,u))):y?y!==i.memoizedState?(Er(s),tt(s),Iv(s,y)):(tt(s),s.flags&=-16777217):(i=i.memoizedProps,i!==f&&Er(s),tt(s),qd(s,m,i,f,u)),null;case 27:if(ct(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 tt(s),null}i=ne.current,Jo(s)?gy(s):(i=U0(m,f,u),s.stateNode=i,Er(s))}return tt(s),null;case 5:if(ct(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 tt(s),null}if(y=ne.current,Jo(s))gy(s);else{var w=_u(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[kt]=s,y[ln]=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(zt(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 tt(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,Jo(s)){if(i=s.stateNode,u=s.memoizedProps,f=null,m=Nt,m!==null)switch(m.tag){case 27:case 5:f=m.memoizedProps}i[kt]=s,i=!!(i.nodeValue===u||f!==null&&f.suppressHydrationWarning===!0||_0(i.nodeValue,u)),i||Jr(s,!0)}else i=_u(i).createTextNode(f),i[kt]=s,s.stateNode=i}return tt(s),null;case 31:if(u=s.memoizedState,i===null||i.memoizedState!==null){if(f=Jo(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[kt]=s}else Xi(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;tt(s),i=!1}else u=td(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=u),i=!0;if(!i)return s.flags&256?(bn(s),s):(bn(s),null);if((s.flags&128)!==0)throw Error(r(558))}return tt(s),null;case 13:if(f=s.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(m=Jo(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[kt]=s}else Xi(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;tt(s),m=!1}else m=td(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=m),m=!0;if(!m)return s.flags&256?(bn(s),s):(bn(s),null)}return bn(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),vu(s,s.updateQueue),tt(s),null);case 4:return Ee(),i===null&&hh(s.stateNode.containerInfo),tt(s),null;case 10:return xr(s.type),tt(s),null;case 19:if(K(at),f=s.memoizedState,f===null)return tt(s),null;if(m=(s.flags&128)!==0,y=f.rendering,y===null)if(m)Cl(f,!1);else{if(st!==0||i!==null&&(i.flags&128)!==0)for(i=s.child;i!==null;){if(y=ou(i),y!==null){for(s.flags|=128,Cl(f,!1),i=y.updateQueue,s.updateQueue=i,vu(s,i),s.subtreeFlags=0,i=u,u=s.child;u!==null;)fy(u,i),u=u.sibling;return W(at,at.current&1|2),Ve&&br(s,f.treeForkCount),s.child}i=i.sibling}f.tail!==null&&Zt()>Cu&&(s.flags|=128,m=!0,Cl(f,!1),s.lanes=4194304)}else{if(!m)if(i=ou(y),i!==null){if(s.flags|=128,m=!0,i=i.updateQueue,s.updateQueue=i,vu(s,i),Cl(f,!0),f.tail===null&&f.tailMode==="hidden"&&!y.alternate&&!Ve)return tt(s),null}else 2*Zt()-f.renderingStartTime>Cu&&u!==536870912&&(s.flags|=128,m=!0,Cl(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=at.current,W(at,m?u&1|2:u&1),Ve&&br(s,f.treeForkCount),i):(tt(s),null);case 22:case 23:return bn(s),pd(),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&&(tt(s),s.subtreeFlags&6&&(s.flags|=8192)):tt(s),u=s.updateQueue,u!==null&&vu(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&&K(Zi),null;case 24:return u=null,i!==null&&(u=i.memoizedState.cache),s.memoizedState.cache!==u&&(s.flags|=2048),xr(ht),tt(s),null;case 25:return null;case 30:return null}throw Error(r(156,s.tag))}function uA(i,s){switch(Wf(s),s.tag){case 1:return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 3:return xr(ht),Ee(),i=s.flags,(i&65536)!==0&&(i&128)===0?(s.flags=i&-65537|128,s):null;case 26:case 27:case 5:return ct(s),null;case 31:if(s.memoizedState!==null){if(bn(s),s.alternate===null)throw Error(r(340));Xi()}return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 13:if(bn(s),i=s.memoizedState,i!==null&&i.dehydrated!==null){if(s.alternate===null)throw Error(r(340));Xi()}return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 19:return K(at),null;case 4:return Ee(),null;case 10:return xr(s.type),null;case 22:case 23:return bn(s),pd(),i!==null&&K(Zi),i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 24:return xr(ht),null;case 25:return null;default:return null}}function Bv(i,s){switch(Wf(s),s.tag){case 3:xr(ht),Ee();break;case 26:case 27:case 5:ct(s);break;case 4:Ee();break;case 31:s.memoizedState!==null&&bn(s);break;case 13:bn(s);break;case 19:K(at);break;case 10:xr(s.type);break;case 22:case 23:bn(s),pd(),i!==null&&K(Zi);break;case 24:xr(ht)}}function Ml(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){Ge(s,s.return,R)}}function ri(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(X){Ge(m,O,X)}}}f=f.next}while(f!==y)}}catch(X){Ge(s,s.return,X)}}function Vv(i){var s=i.updateQueue;if(s!==null){var u=i.stateNode;try{Oy(s,u)}catch(f){Ge(i,i.return,f)}}}function Fv(i,s,u){u.props=ro(i.type,i.memoizedProps),u.state=i.memoizedState;try{u.componentWillUnmount()}catch(f){Ge(i,s,f)}}function El(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){Ge(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){Ge(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){Ge(i,s,m)}else u.current=null}function Pv(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){Ge(i,i.return,m)}}function Gd(i,s,u){try{var f=i.stateNode;NA(f,i.type,u,s),f[ln]=s}catch(m){Ge(i,i.return,m)}}function $v(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&ci(i.type)||i.tag===4}function Kd(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||$v(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&&ci(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 Yd(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&&ci(i.type)&&(u=i.stateNode,s=null),i=i.child,i!==null))for(Yd(i,s,u),i=i.sibling;i!==null;)Yd(i,s,u),i=i.sibling}function bu(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&&ci(i.type)&&(u=i.stateNode),i=i.child,i!==null))for(bu(i,s,u),i=i.sibling;i!==null;)bu(i,s,u),i=i.sibling}function Hv(i){var s=i.stateNode,u=i.memoizedProps;try{for(var f=i.type,m=s.attributes;m.length;)s.removeAttributeNode(m[0]);zt(s,f,u),s[kt]=i,s[ln]=u}catch(y){Ge(i,i.return,y)}}var Rr=!1,gt=!1,Xd=!1,Uv=typeof WeakSet=="function"?WeakSet:Set,Et=null;function cA(i,s){if(i=i.containerInfo,gh=Fu,i=ny(i),$f(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,X=0,Q=i,H=null;t:for(;;){for(var G;Q!==u||m!==0&&Q.nodeType!==3||(R=w+m),Q!==y||f!==0&&Q.nodeType!==3||(O=w+f),Q.nodeType===3&&(w+=Q.nodeValue.length),(G=Q.firstChild)!==null;)H=Q,Q=G;for(;;){if(Q===i)break t;if(H===u&&++P===m&&(R=w),H===y&&++X===f&&(O=w),(G=Q.nextSibling)!==null)break;Q=H,H=Q.parentNode}Q=G}u=R===-1||O===-1?null:{start:R,end:O}}else u=null}u=u||{start:0,end:0}}else u=null;for(yh={focusedElem:i,selectionRange:u},Fu=!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 ce=ro(u.type,m);i=f.getSnapshotBeforeUpdate(ce,y),f.__reactInternalSnapshotBeforeUpdate=i}catch(xe){Ge(u,u.return,xe)}}break;case 3:if((i&1024)!==0){if(i=s.stateNode.containerInfo,u=i.nodeType,u===9)Sh(i);else if(u===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":Sh(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 qv(i,s,u){var f=u.flags;switch(u.tag){case 0:case 11:case 15:Ar(i,u),f&4&&Ml(5,u);break;case 1:if(Ar(i,u),f&4)if(i=u.stateNode,s===null)try{i.componentDidMount()}catch(w){Ge(u,u.return,w)}else{var m=ro(u.type,s.memoizedProps);s=s.memoizedState;try{i.componentDidUpdate(m,s,i.__reactInternalSnapshotBeforeUpdate)}catch(w){Ge(u,u.return,w)}}f&64&&Vv(u),f&512&&El(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{Oy(i,s)}catch(w){Ge(u,u.return,w)}}break;case 27:s===null&&f&4&&Hv(u);case 26:case 5:Ar(i,u),s===null&&f&4&&Pv(u),f&512&&El(u,u.return);break;case 12:Ar(i,u);break;case 31:Ar(i,u),f&4&&Yv(i,u);break;case 13:Ar(i,u),f&4&&Xv(i,u),f&64&&(i=u.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(u=bA.bind(null,u),VA(i,u))));break;case 22:if(f=u.memoizedState!==null||Rr,!f){s=s!==null&&s.memoizedState!==null||gt,m=Rr;var y=gt;Rr=f,(gt=s)&&!y?Or(i,u,(u.subtreeFlags&8772)!==0):Ar(i,u),Rr=m,gt=y}break;case 30:break;default:Ar(i,u)}}function Gv(i){var s=i.alternate;s!==null&&(i.alternate=null,Gv(s)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(s=i.stateNode,s!==null&&Ef(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 nt=null,un=!1;function Tr(i,s,u){for(u=u.child;u!==null;)Kv(i,s,u),u=u.sibling}function Kv(i,s,u){if(Wt&&typeof Wt.onCommitFiberUnmount=="function")try{Wt.onCommitFiberUnmount(Pi,u)}catch{}switch(u.tag){case 26:gt||ir(u,s),Tr(i,s,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:gt||ir(u,s);var f=nt,m=un;ci(u.type)&&(nt=u.stateNode,un=!1),Tr(i,s,u),zl(u.stateNode),nt=f,un=m;break;case 5:gt||ir(u,s);case 6:if(f=nt,m=un,nt=null,Tr(i,s,u),nt=f,un=m,nt!==null)if(un)try{(nt.nodeType===9?nt.body:nt.nodeName==="HTML"?nt.ownerDocument.body:nt).removeChild(u.stateNode)}catch(y){Ge(u,s,y)}else try{nt.removeChild(u.stateNode)}catch(y){Ge(u,s,y)}break;case 18:nt!==null&&(un?(i=nt,V0(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,u.stateNode),vs(i)):V0(nt,u.stateNode));break;case 4:f=nt,m=un,nt=u.stateNode.containerInfo,un=!0,Tr(i,s,u),nt=f,un=m;break;case 0:case 11:case 14:case 15:ri(2,u,s),gt||ri(4,u,s),Tr(i,s,u);break;case 1:gt||(ir(u,s),f=u.stateNode,typeof f.componentWillUnmount=="function"&&Fv(u,s,f)),Tr(i,s,u);break;case 21:Tr(i,s,u);break;case 22:gt=(f=gt)||u.memoizedState!==null,Tr(i,s,u),gt=f;break;default:Tr(i,s,u)}}function Yv(i,s){if(s.memoizedState===null&&(i=s.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{vs(i)}catch(u){Ge(s,s.return,u)}}}function Xv(i,s){if(s.memoizedState===null&&(i=s.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{vs(i)}catch(u){Ge(s,s.return,u)}}function fA(i){switch(i.tag){case 31:case 13:case 19:var s=i.stateNode;return s===null&&(s=i.stateNode=new Uv),s;case 22:return i=i.stateNode,s=i._retryCache,s===null&&(s=i._retryCache=new Uv),s;default:throw Error(r(435,i.tag))}}function Su(i,s){var u=fA(i);s.forEach(function(f){if(!u.has(f)){u.add(f);var m=SA.bind(null,i,f);f.then(m,m)}})}function cn(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(ci(R.type)){nt=R.stateNode,un=!1;break e}break;case 5:nt=R.stateNode,un=!1;break e;case 3:case 4:nt=R.stateNode.containerInfo,un=!0;break e}R=R.return}if(nt===null)throw Error(r(160));Kv(y,w,m),nt=null,un=!1,y=m.alternate,y!==null&&(y.return=null),m.return=null}if(s.subtreeFlags&13886)for(s=s.child;s!==null;)Jv(s,i),s=s.sibling}var Un=null;function Jv(i,s){var u=i.alternate,f=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:cn(s,i),fn(i),f&4&&(ri(3,i,i.return),Ml(3,i),ri(5,i,i.return));break;case 1:cn(s,i),fn(i),f&512&&(gt||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=Un;if(cn(s,i),fn(i),f&512&&(gt||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[Zs]||y[kt]||y.namespaceURI==="http://www.w3.org/2000/svg"||y.hasAttribute("itemprop"))&&(y=m.createElement(f),m.head.insertBefore(y,m.querySelector("head > title"))),zt(y,f,u),y[kt]=i,Mt(y),f=y;break e;case"link":var w=J0("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),zt(y,f,u),m.head.appendChild(y);break;case"meta":if(w=J0("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),zt(y,f,u),m.head.appendChild(y);break;default:throw Error(r(468,f))}y[kt]=i,Mt(y),f=y}i.stateNode=f}else Q0(m,i.type,i.stateNode);else i.stateNode=X0(m,f,i.memoizedProps);else y!==f?(y===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):y.count--,f===null?Q0(m,i.type,i.stateNode):X0(m,f,i.memoizedProps)):f===null&&i.stateNode!==null&&Gd(i,i.memoizedProps,u.memoizedProps)}break;case 27:cn(s,i),fn(i),f&512&&(gt||u===null||ir(u,u.return)),u!==null&&f&4&&Gd(i,i.memoizedProps,u.memoizedProps);break;case 5:if(cn(s,i),fn(i),f&512&&(gt||u===null||ir(u,u.return)),i.flags&32){m=i.stateNode;try{Fo(m,"")}catch(ce){Ge(i,i.return,ce)}}f&4&&i.stateNode!=null&&(m=i.memoizedProps,Gd(i,m,u!==null?u.memoizedProps:m)),f&1024&&(Xd=!0);break;case 6:if(cn(s,i),fn(i),f&4){if(i.stateNode===null)throw Error(r(162));f=i.memoizedProps,u=i.stateNode;try{u.nodeValue=f}catch(ce){Ge(i,i.return,ce)}}break;case 3:if(Lu=null,m=Un,Un=zu(s.containerInfo),cn(s,i),Un=m,fn(i),f&4&&u!==null&&u.memoizedState.isDehydrated)try{vs(s.containerInfo)}catch(ce){Ge(i,i.return,ce)}Xd&&(Xd=!1,Qv(i));break;case 4:f=Un,Un=zu(i.stateNode.containerInfo),cn(s,i),fn(i),Un=f;break;case 12:cn(s,i),fn(i);break;case 31:cn(s,i),fn(i),f&4&&(f=i.updateQueue,f!==null&&(i.updateQueue=null,Su(i,f)));break;case 13:cn(s,i),fn(i),i.child.flags&8192&&i.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(wu=Zt()),f&4&&(f=i.updateQueue,f!==null&&(i.updateQueue=null,Su(i,f)));break;case 22:m=i.memoizedState!==null;var O=u!==null&&u.memoizedState!==null,P=Rr,X=gt;if(Rr=P||m,gt=X||O,cn(s,i),gt=X,Rr=P,fn(i),f&8192)e:for(s=i.stateNode,s._visibility=m?s._visibility&-2:s._visibility|1,m&&(u===null||O||Rr||gt||io(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 Q=O.memoizedProps.style,H=Q!=null&&Q.hasOwnProperty("display")?Q.display:null;R.style.display=H==null||typeof H=="boolean"?"":(""+H).trim()}}catch(ce){Ge(O,O.return,ce)}}}else if(s.tag===6){if(u===null){O=s;try{O.stateNode.nodeValue=m?"":O.memoizedProps}catch(ce){Ge(O,O.return,ce)}}}else if(s.tag===18){if(u===null){O=s;try{var G=O.stateNode;m?F0(G,!0):F0(O.stateNode,!1)}catch(ce){Ge(O,O.return,ce)}}}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,Su(i,u))));break;case 19:cn(s,i),fn(i),f&4&&(f=i.updateQueue,f!==null&&(i.updateQueue=null,Su(i,f)));break;case 30:break;case 21:break;default:cn(s,i),fn(i)}}function fn(i){var s=i.flags;if(s&2){try{for(var u,f=i.return;f!==null;){if($v(f)){u=f;break}f=f.return}if(u==null)throw Error(r(160));switch(u.tag){case 27:var m=u.stateNode,y=Kd(i);bu(i,y,m);break;case 5:var w=u.stateNode;u.flags&32&&(Fo(w,""),u.flags&=-33);var R=Kd(i);bu(i,R,w);break;case 3:case 4:var O=u.stateNode.containerInfo,P=Kd(i);Yd(i,P,O);break;default:throw Error(r(161))}}catch(X){Ge(i,i.return,X)}i.flags&=-3}s&4096&&(i.flags&=-4097)}function Qv(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var s=i;Qv(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;)qv(i,s.alternate,s),s=s.sibling}function io(i){for(i=i.child;i!==null;){var s=i;switch(s.tag){case 0:case 11:case 14:case 15:ri(4,s,s.return),io(s);break;case 1:ir(s,s.return);var u=s.stateNode;typeof u.componentWillUnmount=="function"&&Fv(s,s.return,u),io(s);break;case 27:zl(s.stateNode);case 26:case 5:ir(s,s.return),io(s);break;case 22:s.memoizedState===null&&io(s);break;case 30:io(s);break;default:io(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),Ml(4,y);break;case 1:if(Or(m,y,u),f=y,m=f.stateNode,typeof m.componentDidMount=="function")try{m.componentDidMount()}catch(P){Ge(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++)Ay(O[m],R)}catch(P){Ge(f,f.return,P)}}u&&w&64&&Vv(y),El(y,y.return);break;case 27:Hv(y);case 26:case 5:Or(m,y,u),u&&f===null&&w&4&&Pv(y),El(y,y.return);break;case 12:Or(m,y,u);break;case 31:Or(m,y,u),u&&w&4&&Yv(m,y);break;case 13:Or(m,y,u),u&&w&4&&Xv(m,y);break;case 22:y.memoizedState===null&&Or(m,y,u),El(y,y.return);break;case 30:break;default:Or(m,y,u)}s=s.sibling}}function Jd(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&&fl(u))}function Qd(i,s){i=null,s.alternate!==null&&(i=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==i&&(s.refCount++,i!=null&&fl(i))}function qn(i,s,u,f){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)Zv(i,s,u,f),s=s.sibling}function Zv(i,s,u,f){var m=s.flags;switch(s.tag){case 0:case 11:case 15:qn(i,s,u,f),m&2048&&Ml(9,s);break;case 1:qn(i,s,u,f);break;case 3:qn(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&&fl(i)));break;case 12:if(m&2048){qn(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){Ge(s,s.return,O)}}else qn(i,s,u,f);break;case 31:qn(i,s,u,f);break;case 13:qn(i,s,u,f);break;case 23:break;case 22:y=s.stateNode,w=s.alternate,s.memoizedState!==null?y._visibility&2?qn(i,s,u,f):Rl(i,s):y._visibility&2?qn(i,s,u,f):(y._visibility|=2,ls(i,s,u,f,(s.subtreeFlags&10256)!==0||!1)),m&2048&&Jd(w,s);break;case 24:qn(i,s,u,f),m&2048&&Qd(s.alternate,s);break;default:qn(i,s,u,f)}}function ls(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:ls(y,w,R,O,m),Ml(8,w);break;case 23:break;case 22:var X=w.stateNode;w.memoizedState!==null?X._visibility&2?ls(y,w,R,O,m):Rl(y,w):(X._visibility|=2,ls(y,w,R,O,m)),m&&P&2048&&Jd(w.alternate,w);break;case 24:ls(y,w,R,O,m),m&&P&2048&&Qd(w.alternate,w);break;default:ls(y,w,R,O,m)}s=s.sibling}}function Rl(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:Rl(u,f),m&2048&&Jd(f.alternate,f);break;case 24:Rl(u,f),m&2048&&Qd(f.alternate,f);break;default:Rl(u,f)}s=s.sibling}}var Tl=8192;function as(i,s,u){if(i.subtreeFlags&Tl)for(i=i.child;i!==null;)Wv(i,s,u),i=i.sibling}function Wv(i,s,u){switch(i.tag){case 26:as(i,s,u),i.flags&Tl&&i.memoizedState!==null&&QA(u,Un,i.memoizedState,i.memoizedProps);break;case 5:as(i,s,u);break;case 3:case 4:var f=Un;Un=zu(i.stateNode.containerInfo),as(i,s,u),Un=f;break;case 22:i.memoizedState===null&&(f=i.alternate,f!==null&&f.memoizedState!==null?(f=Tl,Tl=16777216,as(i,s,u),Tl=f):as(i,s,u));break;default:as(i,s,u)}}function e0(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 Al(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,n0(f,i)}e0(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)t0(i),i=i.sibling}function t0(i){switch(i.tag){case 0:case 11:case 15:Al(i),i.flags&2048&&ri(9,i,i.return);break;case 3:Al(i);break;case 12:Al(i);break;case 22:var s=i.stateNode;i.memoizedState!==null&&s._visibility&2&&(i.return===null||i.return.tag!==13)?(s._visibility&=-3,xu(i)):Al(i);break;default:Al(i)}}function xu(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,n0(f,i)}e0(i)}for(i=i.child;i!==null;){switch(s=i,s.tag){case 0:case 11:case 15:ri(8,s,s.return),xu(s);break;case 22:u=s.stateNode,u._visibility&2&&(u._visibility&=-3,xu(s));break;default:xu(s)}i=i.sibling}}function n0(i,s){for(;Et!==null;){var u=Et;switch(u.tag){case 0:case 11:case 15:ri(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:fl(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(Gv(f),f===u){Et=null;break e}if(m!==null){m.return=y,Et=m;break e}Et=y}}}var dA={getCacheForType:function(i){var s=Dt(ht),u=s.data.get(i);return u===void 0&&(u=i(),s.data.set(i,u)),u},cacheSignal:function(){return Dt(ht).controller.signal}},hA=typeof WeakMap=="function"?WeakMap:Map,He=0,Qe=null,je=null,Ie=0,qe=0,Sn=null,ii=!1,us=!1,Zd=!1,kr=0,st=0,oi=0,oo=0,Wd=0,xn=0,cs=0,Ol=null,dn=null,eh=!1,wu=0,r0=0,Cu=1/0,Mu=null,si=null,xt=0,li=null,fs=null,Nr=0,th=0,nh=null,i0=null,kl=0,rh=null;function wn(){return(He&2)!==0&&Ie!==0?Ie&-Ie:V.T!==null?uh():Sg()}function o0(){if(xn===0)if((Ie&536870912)===0||Ve){var i=No;No<<=1,(No&3932160)===0&&(No=262144),xn=i}else xn=536870912;return i=vn.current,i!==null&&(i.flags|=32),xn}function hn(i,s,u){(i===Qe&&(qe===2||qe===9)||i.cancelPendingCommit!==null)&&(ds(i,0),ai(i,Ie,xn,!1)),Me(i,u),((He&2)===0||i!==Qe)&&(i===Qe&&((He&2)===0&&(oo|=u),st===4&&ai(i,Ie,xn,!1)),or(i))}function s0(i,s,u){if((He&6)!==0)throw Error(r(327));var f=!u&&(s&127)===0&&(s&i.expiredLanes)===0||ue(i,s),m=f?gA(i,s):oh(i,s,!0),y=f;do{if(m===0){us&&!f&&ai(i,s,0,!1);break}else{if(u=i.current.alternate,y&&!pA(u)){m=oh(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=Ol;var O=R.current.memoizedState.isDehydrated;if(O&&(ds(R,w).flags|=256),w=oh(R,w,!1),w!==2){if(Zd&&!O){R.errorRecoveryDisabledLanes|=y,oo|=y,m=4;break e}y=dn,dn=m,y!==null&&(dn===null?dn=y:dn.push.apply(dn,y))}m=w}if(y=!1,m!==2)continue}}if(m===1){ds(i,0),ai(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:ai(f,s,xn,!ii);break e;case 2:dn=null;break;case 3:case 5:break;default:throw Error(r(329))}if((s&62914560)===s&&(m=wu+300-Zt(),10<m)){if(ai(f,s,xn,!ii),re(f,0,!0)!==0)break e;Nr=s,f.timeoutHandle=I0(l0.bind(null,f,u,dn,Mu,eh,s,xn,oo,cs,ii,y,"Throttled",-0,0),m);break e}l0(f,u,dn,Mu,eh,s,xn,oo,cs,ii,y,null,-0,0)}}break}while(!0);or(i)}function l0(i,s,u,f,m,y,w,R,O,P,X,Q,H,G){if(i.timeoutHandle=-1,Q=s.subtreeFlags,Q&8192||(Q&16785408)===16785408){Q={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:gr},Wv(s,y,Q);var ce=(y&62914560)===y?wu-Zt():(y&4194048)===y?r0-Zt():0;if(ce=ZA(Q,ce),ce!==null){Nr=y,i.cancelPendingCommit=ce(m0.bind(null,i,s,y,u,f,m,w,R,O,X,Q,null,H,G)),ai(i,y,w,!P);return}}m0(i,s,y,u,f,m,w,R,O)}function pA(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(!gn(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 ai(i,s,u,f){s&=~Wd,s&=~oo,i.suspendedLanes|=s,i.pingedLanes&=~s,f&&(i.warmLanes|=s),f=i.expirationTimes;for(var m=s;0<m;){var y=31-Vt(m),w=1<<y;f[y]=-1,m&=~w}u!==0&&dt(i,u,s)}function Eu(){return(He&6)===0?(Nl(0),!1):!0}function ih(){if(je!==null){if(qe===0)var i=je.return;else i=je,Sr=Ji=null,Sd(i),ts=null,hl=0,i=je;for(;i!==null;)Bv(i.alternate,i),i=i.return;je=null}}function ds(i,s){var u=i.timeoutHandle;u!==-1&&(i.timeoutHandle=-1,zA(u)),u=i.cancelPendingCommit,u!==null&&(i.cancelPendingCommit=null,u()),Nr=0,ih(),Qe=i,je=u=vr(i.current,null),Ie=s,qe=0,Sn=null,ii=!1,us=ue(i,s),Zd=!1,cs=xn=Wd=oo=oi=st=0,dn=Ol=null,eh=!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-Vt(f),y=1<<m;s|=i[m],f&=~y}return kr=s,Ga(),u}function a0(i,s){Ae=null,V.H=xl,s===es||s===eu?(s=My(),qe=3):s===ad?(s=My(),qe=4):qe=s===Ld?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,Sn=s,je===null&&(st=1,pu(i,Nn(s,i.current)))}function u0(){var i=vn.current;return i===null?!0:(Ie&4194048)===Ie?jn===null:(Ie&62914560)===Ie||(Ie&536870912)!==0?i===jn:!1}function c0(){var i=V.H;return V.H=xl,i===null?xl:i}function f0(){var i=V.A;return V.A=dA,i}function Ru(){st=4,ii||(Ie&4194048)!==Ie&&vn.current!==null||(us=!0),(oi&134217727)===0&&(oo&134217727)===0||Qe===null||ai(Qe,Ie,xn,!1)}function oh(i,s,u){var f=He;He|=2;var m=c0(),y=f0();(Qe!==i||Ie!==s)&&(Mu=null,ds(i,s)),s=!1;var w=st;e:do try{if(qe!==0&&je!==null){var R=je,O=Sn;switch(qe){case 8:ih(),w=6;break e;case 3:case 2:case 9:case 6:vn.current===null&&(s=!0);var P=qe;if(qe=0,Sn=null,hs(i,R,O,P),u&&us){w=0;break e}break;default:P=qe,qe=0,Sn=null,hs(i,R,O,P)}}mA(),w=st;break}catch(X){a0(i,X)}while(!0);return s&&i.shellSuspendCounter++,Sr=Ji=null,He=f,V.H=m,V.A=y,je===null&&(Qe=null,Ie=0,Ga()),w}function mA(){for(;je!==null;)d0(je)}function gA(i,s){var u=He;He|=2;var f=c0(),m=f0();Qe!==i||Ie!==s?(Mu=null,Cu=Zt()+500,ds(i,s)):us=ue(i,s);e:do try{if(qe!==0&&je!==null){s=je;var y=Sn;t:switch(qe){case 1:qe=0,Sn=null,hs(i,s,y,1);break;case 2:case 9:if(wy(y)){qe=0,Sn=null,h0(s);break}s=function(){qe!==2&&qe!==9||Qe!==i||(qe=7),or(i)},y.then(s,s);break e;case 3:qe=7;break e;case 4:qe=5;break e;case 7:wy(y)?(qe=0,Sn=null,h0(s)):(qe=0,Sn=null,hs(i,s,y,7));break;case 5:var w=null;switch(je.tag){case 26:w=je.memoizedState;case 5:case 27:var R=je;if(w?Z0(w):R.stateNode.complete){qe=0,Sn=null;var O=R.sibling;if(O!==null)je=O;else{var P=R.return;P!==null?(je=P,Tu(P)):je=null}break t}}qe=0,Sn=null,hs(i,s,y,5);break;case 6:qe=0,Sn=null,hs(i,s,y,6);break;case 8:ih(),st=6;break e;default:throw Error(r(462))}}yA();break}catch(X){a0(i,X)}while(!0);return Sr=Ji=null,V.H=f,V.A=m,He=u,je!==null?0:(Qe=null,Ie=0,Ga(),st)}function yA(){for(;je!==null&&!Da();)d0(je)}function d0(i){var s=Lv(i.alternate,i,kr);i.memoizedProps=i.pendingProps,s===null?Tu(i):je=s}function h0(i){var s=i,u=s.alternate;switch(s.tag){case 15:case 0:s=kv(u,s,s.pendingProps,s.type,void 0,Ie);break;case 11:s=kv(u,s,s.pendingProps,s.type.render,s.ref,Ie);break;case 5:Sd(s);default:Bv(u,s),s=je=fy(s,kr),s=Lv(u,s,kr)}i.memoizedProps=i.pendingProps,s===null?Tu(i):je=s}function hs(i,s,u,f){Sr=Ji=null,Sd(s),ts=null,hl=0;var m=s.return;try{if(oA(i,m,s,u,Ie)){st=1,pu(i,Nn(u,i.current)),je=null;return}}catch(y){if(m!==null)throw je=m,y;st=1,pu(i,Nn(u,i.current)),je=null;return}s.flags&32768?(Ve||f===1?i=!0:us||(Ie&536870912)!==0?i=!1:(ii=i=!0,(f===2||f===9||f===3||f===6)&&(f=vn.current,f!==null&&f.tag===13&&(f.flags|=16384))),p0(s,i)):Tu(s)}function Tu(i){var s=i;do{if((s.flags&32768)!==0){p0(s,ii);return}i=s.return;var u=aA(s.alternate,s,kr);if(u!==null){je=u;return}if(s=s.sibling,s!==null){je=s;return}je=s=i}while(s!==null);st===0&&(st=5)}function p0(i,s){do{var u=uA(i.alternate,i);if(u!==null){u.flags&=32767,je=u;return}if(u=i.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!s&&(i=i.sibling,i!==null)){je=i;return}je=i=u}while(i!==null);st=6,je=null}function m0(i,s,u,f,m,y,w,R,O){i.cancelPendingCommit=null;do Au();while(xt!==0);if((He&6)!==0)throw Error(r(327));if(s!==null){if(s===i.current)throw Error(r(177));if(y=s.lanes|s.childLanes,y|=Kf,ft(i,u,y,w,R,O),i===Qe&&(je=Qe=null,Ie=0),fs=s,li=i,Nr=u,th=y,nh=m,i0=f,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,xA(Ur,function(){return S0(),null})):(i.callbackNode=null,i.callbackPriority=0),f=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||f){f=V.T,V.T=null,m=U.p,U.p=2,w=He,He|=4;try{cA(i,s,u)}finally{He=w,U.p=m,V.T=f}}xt=1,g0(),y0(),v0()}}function g0(){if(xt===1){xt=0;var i=li,s=fs,u=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||u){u=V.T,V.T=null;var f=U.p;U.p=2;var m=He;He|=4;try{Jv(s,i);var y=yh,w=ny(i.containerInfo),R=y.focusedElem,O=y.selectionRange;if(w!==R&&R&&R.ownerDocument&&ty(R.ownerDocument.documentElement,R)){if(O!==null&&$f(R)){var P=O.start,X=O.end;if(X===void 0&&(X=P),"selectionStart"in R)R.selectionStart=P,R.selectionEnd=Math.min(X,R.value.length);else{var Q=R.ownerDocument||document,H=Q&&Q.defaultView||window;if(H.getSelection){var G=H.getSelection(),ce=R.textContent.length,xe=Math.min(O.start,ce),Je=O.end===void 0?xe:Math.min(O.end,ce);!G.extend&&xe>Je&&(w=Je,Je=xe,xe=w);var I=ey(R,xe),z=ey(R,Je);if(I&&z&&(G.rangeCount!==1||G.anchorNode!==I.node||G.anchorOffset!==I.offset||G.focusNode!==z.node||G.focusOffset!==z.offset)){var F=Q.createRange();F.setStart(I.node,I.offset),G.removeAllRanges(),xe>Je?(G.addRange(F),G.extend(z.node,z.offset)):(F.setEnd(z.node,z.offset),G.addRange(F))}}}}for(Q=[],G=R;G=G.parentNode;)G.nodeType===1&&Q.push({element:G,left:G.scrollLeft,top:G.scrollTop});for(typeof R.focus=="function"&&R.focus(),R=0;R<Q.length;R++){var J=Q[R];J.element.scrollLeft=J.left,J.element.scrollTop=J.top}}Fu=!!gh,yh=gh=null}finally{He=m,U.p=f,V.T=u}}i.current=s,xt=2}}function y0(){if(xt===2){xt=0;var i=li,s=fs,u=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||u){u=V.T,V.T=null;var f=U.p;U.p=2;var m=He;He|=4;try{qv(i,s.alternate,s)}finally{He=m,U.p=f,V.T=u}}xt=3}}function v0(){if(xt===4||xt===3){xt=0,xf();var i=li,s=fs,u=Nr,f=i0;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?xt=5:(xt=0,fs=li=null,b0(i,i.pendingLanes));var m=i.pendingLanes;if(m===0&&(si=null),Cf(u),s=s.stateNode,Wt&&typeof Wt.onCommitFiberRoot=="function")try{Wt.onCommitFiberRoot(Pi,s,void 0,(s.current.flags&128)===128)}catch{}if(f!==null){s=V.T,m=U.p,U.p=2,V.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{V.T=s,U.p=m}}(Nr&3)!==0&&Au(),or(i),m=i.pendingLanes,(u&261930)!==0&&(m&42)!==0?i===rh?kl++:(kl=0,rh=i):kl=0,Nl(0)}}function b0(i,s){(i.pooledCacheLanes&=s)===0&&(s=i.pooledCache,s!=null&&(i.pooledCache=null,fl(s)))}function Au(){return g0(),y0(),v0(),S0()}function S0(){if(xt!==5)return!1;var i=li,s=th;th=0;var u=Cf(Nr),f=V.T,m=U.p;try{U.p=32>u?32:u,V.T=null,u=nh,nh=null;var y=li,w=Nr;if(xt=0,fs=li=null,Nr=0,(He&6)!==0)throw Error(r(331));var R=He;if(He|=4,t0(y.current),Zv(y,y.current,w,u),He=R,Nl(0,!1),Wt&&typeof Wt.onPostCommitFiberRoot=="function")try{Wt.onPostCommitFiberRoot(Pi,y)}catch{}return!0}finally{U.p=m,V.T=f,b0(i,s)}}function x0(i,s,u){s=Nn(u,s),s=jd(i.stateNode,s,2),i=ei(i,s,2),i!==null&&(Me(i,2),or(i))}function Ge(i,s,u){if(i.tag===3)x0(i,i,u);else for(;s!==null;){if(s.tag===3){x0(s,i,u);break}else if(s.tag===1){var f=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof f.componentDidCatch=="function"&&(si===null||!si.has(f))){i=Nn(u,i),u=wv(2),f=ei(s,u,2),f!==null&&(Cv(u,f,s,i),Me(f,2),or(f));break}}s=s.return}}function sh(i,s,u){var f=i.pingCache;if(f===null){f=i.pingCache=new hA;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)||(Zd=!0,m.add(u),i=vA.bind(null,i,s,u),s.then(i,i))}function vA(i,s,u){var f=i.pingCache;f!==null&&f.delete(s),i.pingedLanes|=i.suspendedLanes&u,i.warmLanes&=~u,Qe===i&&(Ie&u)===u&&(st===4||st===3&&(Ie&62914560)===Ie&&300>Zt()-wu?(He&2)===0&&ds(i,0):Wd|=u,cs===Ie&&(cs=0)),or(i)}function w0(i,s){s===0&&(s=Fe()),i=Ki(i,s),i!==null&&(Me(i,s),or(i))}function bA(i){var s=i.memoizedState,u=0;s!==null&&(u=s.retryLane),w0(i,u)}function SA(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),w0(i,u)}function xA(i,s){return Oo(i,s)}var Ou=null,ps=null,lh=!1,ku=!1,ah=!1,ui=0;function or(i){i!==ps&&i.next===null&&(ps===null?Ou=ps=i:ps=ps.next=i),ku=!0,lh||(lh=!0,CA())}function Nl(i,s){if(!ah&&ku){ah=!0;do for(var u=!1,f=Ou;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-Vt(42|i)+1)-1,y&=m&~(w&~R),y=y&201326741?y&201326741|1:y?y|2:0}y!==0&&(u=!0,R0(f,y))}else y=Ie,y=re(f,f===Qe?y:0,f.cancelPendingCommit!==null||f.timeoutHandle!==-1),(y&3)===0||ue(f,y)||(u=!0,R0(f,y));f=f.next}while(u);ah=!1}}function wA(){C0()}function C0(){ku=lh=!1;var i=0;ui!==0&&_A()&&(i=ui);for(var s=Zt(),u=null,f=Ou;f!==null;){var m=f.next,y=M0(f,s);y===0?(f.next=null,u===null?Ou=m:u.next=m,m===null&&(ps=u)):(u=f,(i!==0||(y&3)!==0)&&(ku=!0)),f=m}xt!==0&&xt!==5||Nl(i),ui!==0&&(ui=0)}function M0(i,s){for(var u=i.suspendedLanes,f=i.pingedLanes,m=i.expirationTimes,y=i.pendingLanes&-62914561;0<y;){var w=31-Vt(y),R=1<<w,O=m[w];O===-1?((R&u)===0||(R&f)!==0)&&(m[w]=Re(R,s)):O<=s&&(i.expiredLanes|=R),y&=~R}if(s=Qe,u=Ie,u=re(i,i===s?u:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),f=i.callbackNode,u===0||i===s&&(qe===2||qe===9)||i.cancelPendingCommit!==null)return f!==null&&f!==null&&Ys(f),i.callbackNode=null,i.callbackPriority=0;if((u&3)===0||ue(i,u)){if(s=u&-u,s===i.callbackPriority)return s;switch(f!==null&&Ys(f),Cf(u)){case 2:case 8:u=tr;break;case 32:u=Ur;break;case 268435456:u=Xs;break;default:u=Ur}return f=E0.bind(null,i),u=Oo(u,f),i.callbackPriority=s,i.callbackNode=u,s}return f!==null&&f!==null&&Ys(f),i.callbackPriority=2,i.callbackNode=null,2}function E0(i,s){if(xt!==0&&xt!==5)return i.callbackNode=null,i.callbackPriority=0,null;var u=i.callbackNode;if(Au()&&i.callbackNode!==u)return null;var f=Ie;return f=re(i,i===Qe?f:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),f===0?null:(s0(i,f,s),M0(i,Zt()),i.callbackNode!=null&&i.callbackNode===u?E0.bind(null,i):null)}function R0(i,s){if(Au())return null;s0(i,s,!0)}function CA(){jA(function(){(He&6)!==0?Oo(er,wA):C0()})}function uh(){if(ui===0){var i=Zo;i===0&&(i=hr,hr<<=1,(hr&261888)===0&&(hr=256)),ui=i}return ui}function T0(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:Ba(""+i)}function A0(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 MA(i,s,u,f,m){if(s==="submit"&&u&&u.stateNode===m){var y=T0((m[ln]||null).action),w=f.submitter;w&&(s=(s=w[ln]||null)?T0(s.formAction):w.getAttribute("formAction"),s!==null&&(y=s,w=null));var R=new $a("action","action",null,f,m);i.push({event:R,listeners:[{instance:null,listener:function(){if(f.defaultPrevented){if(ui!==0){var O=w?A0(m,w):new FormData(m);Od(u,{pending:!0,data:O,method:m.method,action:y},null,O)}}else typeof y=="function"&&(R.preventDefault(),O=w?A0(m,w):new FormData(m),Od(u,{pending:!0,data:O,method:m.method,action:y},y,O))},currentTarget:m}]})}}for(var ch=0;ch<Gf.length;ch++){var fh=Gf[ch],EA=fh.toLowerCase(),RA=fh[0].toUpperCase()+fh.slice(1);Hn(EA,"on"+RA)}Hn(oy,"onAnimationEnd"),Hn(sy,"onAnimationIteration"),Hn(ly,"onAnimationStart"),Hn("dblclick","onDoubleClick"),Hn("focusin","onFocus"),Hn("focusout","onBlur"),Hn($T,"onTransitionRun"),Hn(HT,"onTransitionStart"),Hn(UT,"onTransitionCancel"),Hn(ay,"onTransitionEnd"),Bo("onMouseEnter",["mouseout","mouseover"]),Bo("onMouseLeave",["mouseout","mouseover"]),Bo("onPointerEnter",["pointerout","pointerover"]),Bo("onPointerLeave",["pointerout","pointerover"]),Hi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Hi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Hi("onBeforeInput",["compositionend","keypress","textInput","paste"]),Hi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Hi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Hi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Dl="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(" "),TA=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Dl));function O0(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(X){qa(X)}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(X){qa(X)}m.currentTarget=null,y=O}}}}function Le(i,s){var u=s[Mf];u===void 0&&(u=s[Mf]=new Set);var f=i+"__bubble";u.has(f)||(k0(s,i,2,!1),u.add(f))}function dh(i,s,u){var f=0;s&&(f|=4),k0(u,i,f,s)}var Nu="_reactListening"+Math.random().toString(36).slice(2);function hh(i){if(!i[Nu]){i[Nu]=!0,Cg.forEach(function(u){u!=="selectionchange"&&(TA.has(u)||dh(u,!1,i),dh(u,!0,i))});var s=i.nodeType===9?i:i.ownerDocument;s===null||s[Nu]||(s[Nu]=!0,dh("selectionchange",!1,s))}}function k0(i,s,u,f){switch(ob(s)){case 2:var m=tO;break;case 8:m=nO;break;default:m=Ah}u=m.bind(null,s,u,i),m=void 0,!_f||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 ph(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=jo(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}jg(function(){var P=y,X=Nf(u),Q=[];e:{var H=uy.get(i);if(H!==void 0){var G=$a,ce=i;switch(i){case"keypress":if(Fa(u)===0)break e;case"keydown":case"keyup":G=ST;break;case"focusin":ce="focus",G=If;break;case"focusout":ce="blur",G=If;break;case"beforeblur":case"afterblur":G=If;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":G=Bg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":G=aT;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":G=CT;break;case oy:case sy:case ly:G=fT;break;case ay:G=ET;break;case"scroll":case"scrollend":G=sT;break;case"wheel":G=TT;break;case"copy":case"cut":case"paste":G=hT;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":G=Fg;break;case"toggle":case"beforetoggle":G=OT}var xe=(s&4)!==0,Je=!xe&&(i==="scroll"||i==="scrollend"),I=xe?H!==null?H+"Capture":null:H;xe=[];for(var z=P,F;z!==null;){var J=z;if(F=J.stateNode,J=J.tag,J!==5&&J!==26&&J!==27||F===null||I===null||(J=el(z,I),J!=null&&xe.push(_l(z,J,F))),Je)break;z=z.return}0<xe.length&&(H=new G(H,ce,null,u,X),Q.push({event:H,listeners:xe}))}}if((s&7)===0){e:{if(H=i==="mouseover"||i==="pointerover",G=i==="mouseout"||i==="pointerout",H&&u!==kf&&(ce=u.relatedTarget||u.fromElement)&&(jo(ce)||ce[zo]))break e;if((G||H)&&(H=X.window===X?X:(H=X.ownerDocument)?H.defaultView||H.parentWindow:window,G?(ce=u.relatedTarget||u.toElement,G=P,ce=ce?jo(ce):null,ce!==null&&(Je=l(ce),xe=ce.tag,ce!==Je||xe!==5&&xe!==27&&xe!==6)&&(ce=null)):(G=null,ce=P),G!==ce)){if(xe=Bg,J="onMouseLeave",I="onMouseEnter",z="mouse",(i==="pointerout"||i==="pointerover")&&(xe=Fg,J="onPointerLeave",I="onPointerEnter",z="pointer"),Je=G==null?H:Ws(G),F=ce==null?H:Ws(ce),H=new xe(J,z+"leave",G,u,X),H.target=Je,H.relatedTarget=F,J=null,jo(X)===P&&(xe=new xe(I,z+"enter",ce,u,X),xe.target=F,xe.relatedTarget=Je,J=xe),Je=J,G&&ce)t:{for(xe=AA,I=G,z=ce,F=0,J=I;J;J=xe(J))F++;J=0;for(var ve=z;ve;ve=xe(ve))J++;for(;0<F-J;)I=xe(I),F--;for(;0<J-F;)z=xe(z),J--;for(;F--;){if(I===z||z!==null&&I===z.alternate){xe=I;break t}I=xe(I),z=xe(z)}xe=null}else xe=null;G!==null&&N0(Q,H,G,xe,!1),ce!==null&&Je!==null&&N0(Q,Je,ce,xe,!0)}}e:{if(H=P?Ws(P):window,G=H.nodeName&&H.nodeName.toLowerCase(),G==="select"||G==="input"&&H.type==="file")var Pe=Yg;else if(Gg(H))if(Xg)Pe=VT;else{Pe=IT;var he=LT}else G=H.nodeName,!G||G.toLowerCase()!=="input"||H.type!=="checkbox"&&H.type!=="radio"?P&&Of(P.elementType)&&(Pe=Yg):Pe=BT;if(Pe&&(Pe=Pe(i,P))){Kg(Q,Pe,u,X);break e}he&&he(i,H,P),i==="focusout"&&P&&H.type==="number"&&P.memoizedProps.value!=null&&Af(H,"number",H.value)}switch(he=P?Ws(P):window,i){case"focusin":(Gg(he)||he.contentEditable==="true")&&(Uo=he,Hf=P,al=null);break;case"focusout":al=Hf=Uo=null;break;case"mousedown":Uf=!0;break;case"contextmenu":case"mouseup":case"dragend":Uf=!1,ry(Q,u,X);break;case"selectionchange":if(PT)break;case"keydown":case"keyup":ry(Q,u,X)}var ke;if(Vf)e:{switch(i){case"compositionstart":var Be="onCompositionStart";break e;case"compositionend":Be="onCompositionEnd";break e;case"compositionupdate":Be="onCompositionUpdate";break e}Be=void 0}else Ho?Ug(i,u)&&(Be="onCompositionEnd"):i==="keydown"&&u.keyCode===229&&(Be="onCompositionStart");Be&&(Pg&&u.locale!=="ko"&&(Ho||Be!=="onCompositionStart"?Be==="onCompositionEnd"&&Ho&&(ke=Lg()):(Kr=X,zf="value"in Kr?Kr.value:Kr.textContent,Ho=!0)),he=Du(P,Be),0<he.length&&(Be=new Vg(Be,i,null,u,X),Q.push({event:Be,listeners:he}),ke?Be.data=ke:(ke=qg(u),ke!==null&&(Be.data=ke)))),(ke=NT?DT(i,u):_T(i,u))&&(Be=Du(P,"onBeforeInput"),0<Be.length&&(he=new Vg("onBeforeInput","beforeinput",null,u,X),Q.push({event:he,listeners:Be}),he.data=ke)),MA(Q,i,P,u,X)}O0(Q,s)})}function _l(i,s,u){return{instance:i,listener:s,currentTarget:u}}function Du(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=el(i,u),m!=null&&f.unshift(_l(i,m,y)),m=el(i,s),m!=null&&f.push(_l(i,m,y))),i.tag===3)return f;i=i.return}return[]}function AA(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function N0(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=el(u,y),P!=null&&w.unshift(_l(u,P,O))):m||(P=el(u,y),P!=null&&w.push(_l(u,P,O)))),u=u.return}w.length!==0&&i.push({event:s,listeners:w})}var OA=/\r\n?/g,kA=/\u0000|\uFFFD/g;function D0(i){return(typeof i=="string"?i:""+i).replace(OA,`
9
+ `).replace(kA,"")}function _0(i,s){return s=D0(s),D0(i)===s}function Xe(i,s,u,f,m,y){switch(u){case"children":typeof f=="string"?s==="body"||s==="textarea"&&f===""||Fo(i,f):(typeof f=="number"||typeof f=="bigint")&&s!=="body"&&Fo(i,""+f);break;case"className":La(i,"class",f);break;case"tabIndex":La(i,"tabindex",f);break;case"dir":case"role":case"viewBox":case"width":case"height":La(i,u,f);break;case"style":_g(i,f,y);break;case"data":if(s!=="object"){La(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=Ba(""+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=Ba(""+f),i.setAttribute(u,f);break;case"onClick":f!=null&&(i.onclick=gr);break;case"onScroll":f!=null&&Le("scroll",i);break;case"onScrollEnd":f!=null&&Le("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=Ba(""+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":Le("beforetoggle",i),Le("toggle",i),ja(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":ja(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=iT.get(u)||u,ja(i,u,f))}}function mh(i,s,u,f,m,y){switch(u){case"style":_g(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"?Fo(i,f):(typeof f=="number"||typeof f=="bigint")&&Fo(i,""+f);break;case"onScroll":f!=null&&Le("scroll",i);break;case"onScrollEnd":f!=null&&Le("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(!Mg.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[ln]||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,""):ja(i,u,f)}}}function zt(i,s,u){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Le("error",i),Le("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":Le("invalid",i);var R=y=w=m=null,O=null,P=null;for(f in u)if(u.hasOwnProperty(f)){var X=u[f];if(X!=null)switch(f){case"name":m=X;break;case"type":w=X;break;case"checked":O=X;break;case"defaultChecked":P=X;break;case"value":y=X;break;case"defaultValue":R=X;break;case"children":case"dangerouslySetInnerHTML":if(X!=null)throw Error(r(137,s));break;default:Xe(i,s,f,X,u,null)}}Og(i,y,R,O,P,w,m,!1);return;case"select":Le("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?Vo(i,!!f,s,!1):u!=null&&Vo(i,!!f,u,!0);return;case"textarea":Le("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)}Ng(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":Le("beforetoggle",i),Le("toggle",i),Le("cancel",i),Le("close",i);break;case"iframe":case"object":Le("load",i);break;case"video":case"audio":for(f=0;f<Dl.length;f++)Le(Dl[f],i);break;case"image":Le("error",i),Le("load",i);break;case"details":Le("toggle",i);break;case"embed":case"source":case"link":Le("error",i),Le("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(Of(s)){for(X in u)u.hasOwnProperty(X)&&(f=u[X],f!==void 0&&mh(i,s,X,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 NA(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,X=null;for(G in u){var Q=u[G];if(u.hasOwnProperty(G)&&Q!=null)switch(G){case"checked":break;case"value":break;case"defaultValue":O=Q;default:f.hasOwnProperty(G)||Xe(i,s,G,null,f,Q)}}for(var H in f){var G=f[H];if(Q=u[H],f.hasOwnProperty(H)&&(G!=null||Q!=null))switch(H){case"type":y=G;break;case"name":m=G;break;case"checked":P=G;break;case"defaultChecked":X=G;break;case"value":w=G;break;case"defaultValue":R=G;break;case"children":case"dangerouslySetInnerHTML":if(G!=null)throw Error(r(137,s));break;default:G!==Q&&Xe(i,s,H,G,f,Q)}}Tf(i,w,R,O,P,X,y,m);return;case"select":G=w=R=H=null;for(y in u)if(O=u[y],u.hasOwnProperty(y)&&O!=null)switch(y){case"value":break;case"multiple":G=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":H=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=G,H!=null?Vo(i,!!u,H,!1):!!f!=!!u&&(s!=null?Vo(i,!!u,s,!0):Vo(i,!!u,u?[]:"",!1));return;case"textarea":G=H=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":H=m;break;case"defaultValue":G=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)}kg(i,H,G);return;case"option":for(var ce in u)H=u[ce],u.hasOwnProperty(ce)&&H!=null&&!f.hasOwnProperty(ce)&&(ce==="selected"?i.selected=!1:Xe(i,s,ce,null,f,H));for(O in f)H=f[O],G=u[O],f.hasOwnProperty(O)&&H!==G&&(H!=null||G!=null)&&(O==="selected"?i.selected=H&&typeof H!="function"&&typeof H!="symbol":Xe(i,s,O,H,f,G));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 xe in u)H=u[xe],u.hasOwnProperty(xe)&&H!=null&&!f.hasOwnProperty(xe)&&Xe(i,s,xe,null,f,H);for(P in f)if(H=f[P],G=u[P],f.hasOwnProperty(P)&&H!==G&&(H!=null||G!=null))switch(P){case"children":case"dangerouslySetInnerHTML":if(H!=null)throw Error(r(137,s));break;default:Xe(i,s,P,H,f,G)}return;default:if(Of(s)){for(var Je in u)H=u[Je],u.hasOwnProperty(Je)&&H!==void 0&&!f.hasOwnProperty(Je)&&mh(i,s,Je,void 0,f,H);for(X in f)H=f[X],G=u[X],!f.hasOwnProperty(X)||H===G||H===void 0&&G===void 0||mh(i,s,X,H,f,G);return}}for(var I in u)H=u[I],u.hasOwnProperty(I)&&H!=null&&!f.hasOwnProperty(I)&&Xe(i,s,I,null,f,H);for(Q in f)H=f[Q],G=u[Q],!f.hasOwnProperty(Q)||H===G||H==null&&G==null||Xe(i,s,Q,H,f,G)}function z0(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function DA(){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&&z0(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 X=O.transferSize,Q=O.initiatorType;X&&z0(Q)&&(O=O.responseEnd,w+=X*(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 gh=null,yh=null;function _u(i){return i.nodeType===9?i:i.ownerDocument}function j0(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 L0(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 vh(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 bh=null;function _A(){var i=window.event;return i&&i.type==="popstate"?i===bh?!1:(bh=i,!0):(bh=null,!1)}var I0=typeof setTimeout=="function"?setTimeout:void 0,zA=typeof clearTimeout=="function"?clearTimeout:void 0,B0=typeof Promise=="function"?Promise:void 0,jA=typeof queueMicrotask=="function"?queueMicrotask:typeof B0<"u"?function(i){return B0.resolve(null).then(i).catch(LA)}:I0;function LA(i){setTimeout(function(){throw i})}function ci(i){return i==="head"}function V0(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),vs(s);return}f--}else if(u==="$"||u==="$?"||u==="$~"||u==="$!"||u==="&")f++;else if(u==="html")zl(i.ownerDocument.documentElement);else if(u==="head"){u=i.ownerDocument.head,zl(u);for(var y=u.firstChild;y;){var w=y.nextSibling,R=y.nodeName;y[Zs]||R==="SCRIPT"||R==="STYLE"||R==="LINK"&&y.rel.toLowerCase()==="stylesheet"||u.removeChild(y),y=w}}else u==="body"&&zl(i.ownerDocument.body);u=m}while(u);vs(s)}function F0(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 Sh(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":Sh(u),Ef(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}i.removeChild(u)}}function IA(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[Zs])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=Ln(i.nextSibling),i===null)break}return null}function BA(i,s,u){if(s==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!u||(i=Ln(i.nextSibling),i===null))return null;return i}function P0(i,s){for(;i.nodeType!==8;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!s||(i=Ln(i.nextSibling),i===null))return null;return i}function xh(i){return i.data==="$?"||i.data==="$~"}function wh(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function VA(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 Ln(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 Ch=null;function $0(i){i=i.nextSibling;for(var s=0;i;){if(i.nodeType===8){var u=i.data;if(u==="/$"||u==="/&"){if(s===0)return Ln(i.nextSibling);s--}else u!=="$"&&u!=="$!"&&u!=="$?"&&u!=="$~"&&u!=="&"||s++}i=i.nextSibling}return null}function H0(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 U0(i,s,u){switch(s=_u(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 zl(i){for(var s=i.attributes;s.length;)i.removeAttributeNode(s[0]);Ef(i)}var In=new Map,q0=new Set;function zu(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var Dr=U.d;U.d={f:FA,r:PA,D:$A,C:HA,L:UA,m:qA,X:KA,S:GA,M:YA};function FA(){var i=Dr.f(),s=Eu();return i||s}function PA(i){var s=Lo(i);s!==null&&s.tag===5&&s.type==="form"?av(s):Dr.r(i)}var ms=typeof document>"u"?null:document;function G0(i,s,u){var f=ms;if(f&&typeof s=="string"&&s){var m=On(s);m='link[rel="'+i+'"][href="'+m+'"]',typeof u=="string"&&(m+='[crossorigin="'+u+'"]'),q0.has(m)||(q0.add(m),i={rel:i,crossOrigin:u,href:s},f.querySelector(m)===null&&(s=f.createElement("link"),zt(s,"link",i),Mt(s),f.head.appendChild(s)))}}function $A(i){Dr.D(i),G0("dns-prefetch",i,null)}function HA(i,s){Dr.C(i,s),G0("preconnect",i,s)}function UA(i,s,u){Dr.L(i,s,u);var f=ms;if(f&&i&&s){var m='link[rel="preload"][as="'+On(s)+'"]';s==="image"&&u&&u.imageSrcSet?(m+='[imagesrcset="'+On(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(m+='[imagesizes="'+On(u.imageSizes)+'"]')):m+='[href="'+On(i)+'"]';var y=m;switch(s){case"style":y=gs(i);break;case"script":y=ys(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(jl(y))||s==="script"&&f.querySelector(Ll(y))||(s=f.createElement("link"),zt(s,"link",i),Mt(s),f.head.appendChild(s)))}}function qA(i,s){Dr.m(i,s);var u=ms;if(u&&i){var f=s&&typeof s.as=="string"?s.as:"script",m='link[rel="modulepreload"][as="'+On(f)+'"][href="'+On(i)+'"]',y=m;switch(f){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":y=ys(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(Ll(y)))return}f=u.createElement("link"),zt(f,"link",i),Mt(f),u.head.appendChild(f)}}}function GA(i,s,u){Dr.S(i,s,u);var f=ms;if(f&&i){var m=Io(f).hoistableStyles,y=gs(i);s=s||"default";var w=m.get(y);if(!w){var R={loading:0,preload:null};if(w=f.querySelector(jl(y)))R.loading=5;else{i=g({rel:"stylesheet",href:i,"data-precedence":s},u),(u=In.get(y))&&Mh(i,u);var O=w=f.createElement("link");Mt(O),zt(O,"link",i),O._p=new Promise(function(P,X){O.onload=P,O.onerror=X}),O.addEventListener("load",function(){R.loading|=1}),O.addEventListener("error",function(){R.loading|=2}),R.loading|=4,ju(w,s,f)}w={type:"stylesheet",instance:w,count:1,state:R},m.set(y,w)}}}function KA(i,s){Dr.X(i,s);var u=ms;if(u&&i){var f=Io(u).hoistableScripts,m=ys(i),y=f.get(m);y||(y=u.querySelector(Ll(m)),y||(i=g({src:i,async:!0},s),(s=In.get(m))&&Eh(i,s),y=u.createElement("script"),Mt(y),zt(y,"link",i),u.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},f.set(m,y))}}function YA(i,s){Dr.M(i,s);var u=ms;if(u&&i){var f=Io(u).hoistableScripts,m=ys(i),y=f.get(m);y||(y=u.querySelector(Ll(m)),y||(i=g({src:i,async:!0,type:"module"},s),(s=In.get(m))&&Eh(i,s),y=u.createElement("script"),Mt(y),zt(y,"link",i),u.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},f.set(m,y))}}function K0(i,s,u,f){var m=(m=ae.current)?zu(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=gs(u.href),u=Io(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=gs(u.href);var y=Io(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(jl(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||XA(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=ys(u),u=Io(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 gs(i){return'href="'+On(i)+'"'}function jl(i){return'link[rel="stylesheet"]['+i+"]"}function Y0(i){return g({},i,{"data-precedence":i.precedence,precedence:null})}function XA(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}),zt(s,"link",u),Mt(s),i.head.appendChild(s))}function ys(i){return'[src="'+On(i)+'"]'}function Ll(i){return"script[async]"+i}function X0(i,s,u){if(s.count++,s.instance===null)switch(s.type){case"style":var f=i.querySelector('style[data-href~="'+On(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),zt(f,"style",m),ju(f,u.precedence,i),s.instance=f;case"stylesheet":m=gs(u.href);var y=i.querySelector(jl(m));if(y)return s.state.loading|=4,s.instance=y,Mt(y),y;f=Y0(u),(m=In.get(m))&&Mh(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}),zt(y,"link",f),s.state.loading|=4,ju(y,u.precedence,i),s.instance=y;case"script":return y=ys(u.src),(m=i.querySelector(Ll(y)))?(s.instance=m,Mt(m),m):(f=u,(m=In.get(y))&&(f=g({},u),Eh(f,m)),i=i.ownerDocument||i,m=i.createElement("script"),Mt(m),zt(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,ju(f,u.precedence,i));return s.instance}function ju(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 Mh(i,s){i.crossOrigin==null&&(i.crossOrigin=s.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=s.referrerPolicy),i.title==null&&(i.title=s.title)}function Eh(i,s){i.crossOrigin==null&&(i.crossOrigin=s.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=s.referrerPolicy),i.integrity==null&&(i.integrity=s.integrity)}var Lu=null;function J0(i,s,u){if(Lu===null){var f=new Map,m=Lu=new Map;m.set(u,f)}else m=Lu,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[Zs]||y[kt]||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 Q0(i,s,u){i=i.ownerDocument||i,i.head.insertBefore(u,s==="title"?i.querySelector("head > title"):null)}function JA(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 Z0(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function QA(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=gs(f.href),y=s.querySelector(jl(m));if(y){s=y._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(i.count++,i=Iu.bind(i),s.then(i,i)),u.state.loading|=4,u.instance=y,Mt(y);return}y=s.ownerDocument||s,f=Y0(f),(m=In.get(m))&&Mh(f,m),y=y.createElement("link"),Mt(y);var w=y;w._p=new Promise(function(R,O){w.onload=R,w.onerror=O}),zt(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=Iu.bind(i),s.addEventListener("load",u),s.addEventListener("error",u))}}var Rh=0;function ZA(i,s){return i.stylesheets&&i.count===0&&Vu(i,i.stylesheets),0<i.count||0<i.imgCount?function(u){var f=setTimeout(function(){if(i.stylesheets&&Vu(i,i.stylesheets),i.unsuspend){var y=i.unsuspend;i.unsuspend=null,y()}},6e4+s);0<i.imgBytes&&Rh===0&&(Rh=62500*DA());var m=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&Vu(i,i.stylesheets),i.unsuspend)){var y=i.unsuspend;i.unsuspend=null,y()}},(i.imgBytes>Rh?50:800)+s);return i.unsuspend=u,function(){i.unsuspend=null,clearTimeout(f),clearTimeout(m)}}:null}function Iu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Vu(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var Bu=null;function Vu(i,s){i.stylesheets=null,i.unsuspend!==null&&(i.count++,Bu=new Map,s.forEach(WA,i),Bu=null,Iu.call(i))}function WA(i,s){if(!(s.state.loading&4)){var u=Bu.get(i);if(u)var f=u.get(null);else{u=new Map,Bu.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=Iu.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 Il={$$typeof:N,Provider:null,Consumer:null,_currentValue:L,_currentValue2:L,_threadCount:0};function eO(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=We(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=We(0),this.hiddenUpdates=We(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 W0(i,s,u,f,m,y,w,R,O,P,X,Q){return i=new eO(i,s,u,w,O,P,X,Q,R),s=1,y===!0&&(s|=24),y=yn(3,null,null,s),i.current=y,y.stateNode=i,s=od(),s.refCount++,i.pooledCache=s,s.refCount++,y.memoizedState={element:f,isDehydrated:u,cache:s},ud(y),i}function eb(i){return i?(i=Ko,i):Ko}function tb(i,s,u,f,m,y){m=eb(m),f.context===null?f.context=m:f.pendingContext=m,f=Wr(s),f.payload={element:u},y=y===void 0?null:y,y!==null&&(f.callback=y),u=ei(i,f,s),u!==null&&(hn(u,i,s),ml(u,i,s))}function nb(i,s){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var u=i.retryLane;i.retryLane=u!==0&&u<s?u:s}}function Th(i,s){nb(i,s),(i=i.alternate)&&nb(i,s)}function rb(i){if(i.tag===13||i.tag===31){var s=Ki(i,67108864);s!==null&&hn(s,i,67108864),Th(i,67108864)}}function ib(i){if(i.tag===13||i.tag===31){var s=wn();s=Qs(s);var u=Ki(i,s);u!==null&&hn(u,i,s),Th(i,s)}}var Fu=!0;function tO(i,s,u,f){var m=V.T;V.T=null;var y=U.p;try{U.p=2,Ah(i,s,u,f)}finally{U.p=y,V.T=m}}function nO(i,s,u,f){var m=V.T;V.T=null;var y=U.p;try{U.p=8,Ah(i,s,u,f)}finally{U.p=y,V.T=m}}function Ah(i,s,u,f){if(Fu){var m=Oh(f);if(m===null)ph(i,s,f,Pu,u),sb(i,f);else if(iO(m,i,s,u,f))f.stopPropagation();else if(sb(i,f),s&4&&-1<rO.indexOf(i)){for(;m!==null;){var y=Lo(m);if(y!==null)switch(y.tag){case 3:if(y=y.stateNode,y.current.memoizedState.isDehydrated){var w=pr(y.pendingLanes);if(w!==0){var R=y;for(R.pendingLanes|=2,R.entangledLanes|=2;w;){var O=1<<31-Vt(w);R.entanglements[1]|=O,w&=~O}or(y),(He&6)===0&&(Cu=Zt()+500,Nl(0))}}break;case 31:case 13:R=Ki(y,2),R!==null&&hn(R,y,2),Eu(),Th(y,2)}if(y=Oh(f),y===null&&ph(i,s,f,Pu,u),y===m)break;m=y}m!==null&&f.stopPropagation()}else ph(i,s,f,null,u)}}function Oh(i){return i=Nf(i),kh(i)}var Pu=null;function kh(i){if(Pu=null,i=jo(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 Pu=i,null}function ob(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(wf()){case er:return 2;case tr:return 8;case Ur:case _a:return 32;case Xs:return 268435456;default:return 32}default:return 32}}var Nh=!1,fi=null,di=null,hi=null,Bl=new Map,Vl=new Map,pi=[],rO="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 sb(i,s){switch(i){case"focusin":case"focusout":fi=null;break;case"dragenter":case"dragleave":di=null;break;case"mouseover":case"mouseout":hi=null;break;case"pointerover":case"pointerout":Bl.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":Vl.delete(s.pointerId)}}function Fl(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=Lo(s),s!==null&&rb(s)),i):(i.eventSystemFlags|=f,s=i.targetContainers,m!==null&&s.indexOf(m)===-1&&s.push(m),i)}function iO(i,s,u,f,m){switch(s){case"focusin":return fi=Fl(fi,i,s,u,f,m),!0;case"dragenter":return di=Fl(di,i,s,u,f,m),!0;case"mouseover":return hi=Fl(hi,i,s,u,f,m),!0;case"pointerover":var y=m.pointerId;return Bl.set(y,Fl(Bl.get(y)||null,i,s,u,f,m)),!0;case"gotpointercapture":return y=m.pointerId,Vl.set(y,Fl(Vl.get(y)||null,i,s,u,f,m)),!0}return!1}function lb(i){var s=jo(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,xg(i.priority,function(){ib(u)});return}}else if(s===31){if(s=c(u),s!==null){i.blockedOn=s,xg(i.priority,function(){ib(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 $u(i){if(i.blockedOn!==null)return!1;for(var s=i.targetContainers;0<s.length;){var u=Oh(i.nativeEvent);if(u===null){u=i.nativeEvent;var f=new u.constructor(u.type,u);kf=f,u.target.dispatchEvent(f),kf=null}else return s=Lo(u),s!==null&&rb(s),i.blockedOn=u,!1;s.shift()}return!0}function ab(i,s,u){$u(i)&&u.delete(s)}function oO(){Nh=!1,fi!==null&&$u(fi)&&(fi=null),di!==null&&$u(di)&&(di=null),hi!==null&&$u(hi)&&(hi=null),Bl.forEach(ab),Vl.forEach(ab)}function Hu(i,s){i.blockedOn===s&&(i.blockedOn=null,Nh||(Nh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,oO)))}var Uu=null;function ub(i){Uu!==i&&(Uu=i,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Uu===i&&(Uu=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(kh(f||u)===null)continue;break}var y=Lo(u);y!==null&&(i.splice(s,3),s-=3,Od(y,{pending:!0,data:m,method:u.method,action:f},f,m))}}))}function vs(i){function s(O){return Hu(O,i)}fi!==null&&Hu(fi,i),di!==null&&Hu(di,i),hi!==null&&Hu(hi,i),Bl.forEach(s),Vl.forEach(s);for(var u=0;u<pi.length;u++){var f=pi[u];f.blockedOn===i&&(f.blockedOn=null)}for(;0<pi.length&&(u=pi[0],u.blockedOn===null);)lb(u),u.blockedOn===null&&pi.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[ln]||null;if(typeof y=="function")w||ub(u);else if(w){var R=null;if(y&&y.hasAttribute("formAction")){if(m=y,w=y[ln]||null)R=w.formAction;else if(kh(m)!==null)continue}else R=w.action;typeof R=="function"?u[f+1]=R:(u.splice(f,3),f-=3),ub(u)}}}function cb(){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 Dh(i){this._internalRoot=i}qu.prototype.render=Dh.prototype.render=function(i){var s=this._internalRoot;if(s===null)throw Error(r(409));var u=s.current,f=wn();tb(u,f,i,s,null,null)},qu.prototype.unmount=Dh.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var s=i.containerInfo;tb(i.current,2,null,i,null,null),Eu(),s[zo]=null}};function qu(i){this._internalRoot=i}qu.prototype.unstable_scheduleHydration=function(i){if(i){var s=Sg();i={blockedOn:null,target:i,priority:s};for(var u=0;u<pi.length&&s!==0&&s<pi[u].priority;u++);pi.splice(u,0,i),u===0&&lb(i)}};var fb=e.version;if(fb!=="19.2.4")throw Error(r(527,fb,"19.2.4"));U.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 sO={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:V,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Gu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Gu.isDisabled&&Gu.supportsFiber)try{Pi=Gu.inject(sO),Wt=Gu}catch{}}return $l.createRoot=function(i,s){if(!o(i))throw Error(r(299));var u=!1,f="",m=vv,y=bv,w=Sv;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=W0(i,1,!1,null,null,u,f,null,m,y,w,cb),i[zo]=s.current,hh(i),new Dh(s)},$l.hydrateRoot=function(i,s,u){if(!o(i))throw Error(r(299));var f=!1,m="",y=vv,w=bv,R=Sv,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=W0(i,1,!0,s,u??null,f,m,O,y,w,R,cb),s.context=eb(null),u=s.current,f=wn(),f=Qs(f),m=Wr(f),m.callback=null,ei(u,m,f),u=f,s.current.lanes=u,Me(s,u),or(s),i[zo]=s.current,hh(i),new qu(s)},$l.version="19.2.4",$l}var xb;function gO(){if(xb)return jh.exports;xb=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(),jh.exports=mO(),jh.exports}var yO=gO();const l1=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim();const vO=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const bO=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,r)=>r?r.toUpperCase():n.toLowerCase());const wb=t=>{const e=bO(t);return e.charAt(0).toUpperCase()+e.slice(1)};var SO={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 xO=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1};const wO=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,...SO,width:e,height:e,stroke:t,strokeWidth:r?Number(n)*24/Number(e):n,className:l1("lucide",o),...!l&&!xO(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(wO,{ref:l,iconNode:e,className:l1(`lucide-${vO(wb(t))}`,`lucide-${t}`,r),...o}));return n.displayName=wb(t),n};const CO=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],MO=Ue("arrow-down",CO);const EO=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],RO=Ue("arrow-up",EO);const TO=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}]],AO=Ue("ban",TO);const OO=[["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"}]],kO=Ue("braces",OO);const NO=[["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"}]],DO=Ue("calendar-days",NO);const _O=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Ps=Ue("check",_O);const zO=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],jO=Ue("chevron-down",zO);const LO=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],a1=Ue("chevron-right",LO);const IO=[["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"}]],pm=Ue("circle-alert",IO);const BO=[["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"}]],VO=Ue("circle-play",BO);const FO=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]],PO=Ue("circle-stop",FO);const $O=[["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"}]],u1=Ue("copy",$O);const HO=[["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"}]],Np=Ue("download",HO);const UO=[["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"}]],qO=Ue("ellipsis",UO);const GO=[["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"}]],KO=Ue("external-link",GO);const YO=[["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"}]],c1=Ue("funnel",YO);const XO=[["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"}]],JO=Ue("hash",XO);const QO=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],ZO=Ue("info",QO);const WO=[["path",{d:"M2 5h20",key:"1fs1ex"}],["path",{d:"M6 12h12",key:"8npq4p"}],["path",{d:"M9 19h6",key:"456am0"}]],ek=Ue("list-filter",WO);const tk=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Jc=Ue("loader-circle",tk);const nk=[["path",{d:"M5 12h14",key:"1ays0h"}]],rk=Ue("minus",nk);const ik=[["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"}]],f1=Ue("moon",ik);const ok=[["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"}]],sk=Ue("play",ok);const lk=[["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"}]],ak=Ue("refresh-ccw",lk);const uk=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],mm=Ue("search",uk);const ck=[["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"}]],d1=Ue("settings-2",ck);const fk=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Cb=Ue("square-check",fk);const dk=[["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"}]],h1=Ue("sun",dk);const hk=[["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"}]],pk=Ue("trash-2",hk);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"}]],gk=Ue("type",mk);const yk=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],gm=Ue("x",yk);function Kn(t,e){return typeof t=="function"?t(e):t}function Tn(t,e){return n=>{e.setState(r=>({...r,[t]:Kn(n,r[t])}))}}function Qc(t){return t instanceof Function}function vk(t){return Array.isArray(t)&&t.every(e=>typeof e=="number")}function bk(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 we(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,v=g/16,b=(S,x)=>{for(S=String(S);S.length<x;)S=" "+S;return S};console.info(`%c⏱ ${b(g,5)} /${b(p,5)} ms`,`
10
+ font-size: .6rem;
11
+ font-weight: bold;
12
+ color: hsl(${Math.max(0,Math.min(120-120*v,120))}deg 100% 31%);`,n?.key)}return o}}function Ce(t,e,n,r){return{debug:()=>{var o;return(o=t?.debugAll)!=null?o:t[e]},key:!1,onChange:r}}function Sk(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:we(()=>[t,n,e,l],(a,c,d,h)=>({table:a,column:c,row:d,cell:h,getValue:h.getValue,renderValue:h.renderValue}),Ce(t.options,"debugCells"))};return t._features.forEach(a=>{a.createCell==null||a.createCell(l,n,e,t)},{}),l}function xk(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=v=>{let b=v;for(const x of d.split(".")){var S;b=(S=b)==null?void 0:S[x]}return b}:p=v=>v[c.accessorKey]),!h)throw new Error;let g={id:`${String(h)}`,accessorFn:p,parent:r,depth:n,columnDef:c,columns:[],getFlatColumns:we(()=>[!0],()=>{var v;return[g,...(v=g.columns)==null?void 0:v.flatMap(b=>b.getFlatColumns())]},Ce(t.options,"debugColumns")),getLeafColumns:we(()=>[t._getOrderColumnsFn()],v=>{var b;if((b=g.columns)!=null&&b.length){let S=g.columns.flatMap(x=>x.getLeafColumns());return v(S)}return[g]},Ce(t.options,"debugColumns"))};for(const v of t._features)v.createColumn==null||v.createColumn(g,t);return g}const Pt="debugHeaders";function Mb(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 wk={createTable:t=>{t.getHeaderGroups=we(()=>[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(v=>v.id===g)).filter(Boolean))!=null?l:[],d=(a=o?.map(g=>n.find(v=>v.id===g)).filter(Boolean))!=null?a:[],h=n.filter(g=>!(r!=null&&r.includes(g.id))&&!(o!=null&&o.includes(g.id)));return Ku(e,[...c,...h,...d],t)},Ce(t.options,Pt)),t.getCenterHeaderGroups=we(()=>[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))),Ku(e,n,t,"center")),Ce(t.options,Pt)),t.getLeftHeaderGroups=we(()=>[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 Ku(e,l,t,"left")},Ce(t.options,Pt)),t.getRightHeaderGroups=we(()=>[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 Ku(e,l,t,"right")},Ce(t.options,Pt)),t.getFooterGroups=we(()=>[t.getHeaderGroups()],e=>[...e].reverse(),Ce(t.options,Pt)),t.getLeftFooterGroups=we(()=>[t.getLeftHeaderGroups()],e=>[...e].reverse(),Ce(t.options,Pt)),t.getCenterFooterGroups=we(()=>[t.getCenterHeaderGroups()],e=>[...e].reverse(),Ce(t.options,Pt)),t.getRightFooterGroups=we(()=>[t.getRightHeaderGroups()],e=>[...e].reverse(),Ce(t.options,Pt)),t.getFlatHeaders=we(()=>[t.getHeaderGroups()],e=>e.map(n=>n.headers).flat(),Ce(t.options,Pt)),t.getLeftFlatHeaders=we(()=>[t.getLeftHeaderGroups()],e=>e.map(n=>n.headers).flat(),Ce(t.options,Pt)),t.getCenterFlatHeaders=we(()=>[t.getCenterHeaderGroups()],e=>e.map(n=>n.headers).flat(),Ce(t.options,Pt)),t.getRightFlatHeaders=we(()=>[t.getRightHeaderGroups()],e=>e.map(n=>n.headers).flat(),Ce(t.options,Pt)),t.getCenterLeafHeaders=we(()=>[t.getCenterFlatHeaders()],e=>e.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Ce(t.options,Pt)),t.getLeftLeafHeaders=we(()=>[t.getLeftFlatHeaders()],e=>e.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Ce(t.options,Pt)),t.getRightLeafHeaders=we(()=>[t.getRightFlatHeaders()],e=>e.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Ce(t.options,Pt)),t.getLeafHeaders=we(()=>[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()},Ce(t.options,Pt))}};function Ku(t,e,n,r){var o,l;let a=0;const c=function(v,b){b===void 0&&(b=1),a=Math.max(a,b),v.filter(S=>S.getIsVisible()).forEach(S=>{var x;(x=S.columns)!=null&&x.length&&c(S.columns,b+1)},0)};c(t);let d=[];const h=(v,b)=>{const S={depth:b,id:[r,`${b}`].filter(Boolean).join("_"),headers:[]},x=[];v.forEach(C=>{const E=[...x].reverse()[0],A=C.column.depth===S.depth;let N,D=!1;if(A&&C.column.parent?N=C.column.parent:(N=C.column,D=!0),E&&E?.column===N)E.subHeaders.push(C);else{const j=Mb(n,N,{id:[r,b,N.id,C?.id].filter(Boolean).join("_"),isPlaceholder:D,placeholderId:D?`${x.filter($=>$.column===N).length}`:void 0,depth:b,index:x.length});j.subHeaders.push(C),x.push(j)}S.headers.push(C),C.headerGroup=S}),d.push(S),b>0&&h(x,b-1)},p=e.map((v,b)=>Mb(n,v,{depth:a,index:b}));h(p,a-1),d.reverse();const g=v=>v.filter(S=>S.column.getIsVisible()).map(S=>{let x=0,C=0,E=[0];S.subHeaders&&S.subHeaders.length?(E=[],g(S.subHeaders).forEach(N=>{let{colSpan:D,rowSpan:j}=N;x+=D,E.push(j)})):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 ym=(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:()=>bk(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:we(()=>[t.getAllLeafColumns()],d=>d.map(h=>Sk(t,c,h,h.id)),Ce(t.options,"debugRows")),_getAllCellsByColumnId:we(()=>[c.getAllCells()],d=>d.reduce((h,p)=>(h[p.column.id]=p,h),{}),Ce(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},Ck={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()}}},p1=(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))};p1.autoRemove=t=>Xn(t);const m1=(t,e,n)=>{var r;return!!(!((r=t.getValue(e))==null||(r=r.toString())==null)&&r.includes(n))};m1.autoRemove=t=>Xn(t);const g1=(t,e,n)=>{var r;return((r=t.getValue(e))==null||(r=r.toString())==null?void 0:r.toLowerCase())===n?.toLowerCase()};g1.autoRemove=t=>Xn(t);const y1=(t,e,n)=>{var r;return(r=t.getValue(e))==null?void 0:r.includes(n)};y1.autoRemove=t=>Xn(t);const v1=(t,e,n)=>!n.some(r=>{var o;return!((o=t.getValue(e))!=null&&o.includes(r))});v1.autoRemove=t=>Xn(t)||!(t!=null&&t.length);const b1=(t,e,n)=>n.some(r=>{var o;return(o=t.getValue(e))==null?void 0:o.includes(r)});b1.autoRemove=t=>Xn(t)||!(t!=null&&t.length);const S1=(t,e,n)=>t.getValue(e)===n;S1.autoRemove=t=>Xn(t);const x1=(t,e,n)=>t.getValue(e)==n;x1.autoRemove=t=>Xn(t);const vm=(t,e,n)=>{let[r,o]=n;const l=t.getValue(e);return l>=r&&l<=o};vm.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]};vm.autoRemove=t=>Xn(t)||Xn(t[0])&&Xn(t[1]);const jr={includesString:p1,includesStringSensitive:m1,equalsString:g1,arrIncludes:y1,arrIncludesAll:v1,arrIncludesSome:b1,equals:S1,weakEquals:x1,inNumberRange:vm};function Xn(t){return t==null||t===""}const Mk={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:t=>({columnFilters:[],...t}),getDefaultOptions:t=>({onColumnFiltersChange:Tn("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 Qc(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=Kn(n,l?l.value:void 0);if(Eb(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=Kn(e,o))==null?void 0:l.filter(a=>{const c=n.find(d=>d.id===a.id);if(c){const d=c.getFilterFn();if(Eb(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 Eb(t,e,n){return(t&&t.autoRemove?t.autoRemove(e,n):!1)||typeof e>"u"||typeof e=="string"&&!e}const Ek=(t,e,n)=>n.reduce((r,o)=>{const l=o.getValue(t);return r+(typeof l=="number"?l:0)},0),Rk=(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},Tk=(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},Ak=(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]},Ok=(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},kk=(t,e)=>{if(!e.length)return;const n=e.map(l=>l.getValue(t));if(!vk(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},Nk=(t,e)=>Array.from(new Set(e.map(n=>n.getValue(t))).values()),Dk=(t,e)=>new Set(e.map(n=>n.getValue(t))).size,_k=(t,e)=>e.length,Vh={sum:Ek,min:Rk,max:Tk,extent:Ak,mean:Ok,median:kk,unique:Nk,uniqueCount:Dk,count:_k},zk={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:Tn("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 Vh.sum;if(Object.prototype.toString.call(r)==="[object Date]")return Vh.extent},t.getAggregationFn=()=>{var n,r;if(!t)throw new Error;return Qc(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:Vh[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 jk(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 Lk={getInitialState:t=>({columnOrder:[],...t}),getDefaultOptions:t=>({onColumnOrderChange:Tn("columnOrder",t)}),createColumn:(t,e)=>{t.getIndex=we(n=>[ea(e,n)],n=>n.findIndex(r=>r.id===t.id),Ce(e.options,"debugColumns")),t.getIsFirstColumn=n=>{var r;return((r=ea(e,n)[0])==null?void 0:r.id)===t.id},t.getIsLastColumn=n=>{var r;const o=ea(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=we(()=>[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 jk(l,n,r)},Ce(t.options,"debugTable"))}},Fh=()=>({left:[],right:[]}),Ik={getInitialState:t=>({columnPinning:Fh(),...t}),getDefaultOptions:t=>({onColumnPinningChange:Tn("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=we(()=>[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))},Ce(e.options,"debugRows")),t.getLeftVisibleCells=we(()=>[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"})),Ce(e.options,"debugRows")),t.getRightVisibleCells=we(()=>[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"})),Ce(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?Fh():(n=(r=t.initialState)==null?void 0:r.columnPinning)!=null?n:Fh())},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=we(()=>[t.getAllLeafColumns(),t.getState().columnPinning.left],(e,n)=>(n??[]).map(r=>e.find(o=>o.id===r)).filter(Boolean),Ce(t.options,"debugColumns")),t.getRightLeafColumns=we(()=>[t.getAllLeafColumns(),t.getState().columnPinning.right],(e,n)=>(n??[]).map(r=>e.find(o=>o.id===r)).filter(Boolean),Ce(t.options,"debugColumns")),t.getCenterLeafColumns=we(()=>[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))},Ce(t.options,"debugColumns"))}};function Bk(t){return t||(typeof document<"u"?document:null)}const Yu={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Ph=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),Vk={getDefaultColumnDef:()=>Yu,getInitialState:t=>({columnSizing:{},columnSizingInfo:Ph(),...t}),getDefaultOptions:t=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Tn("columnSizing",t),onColumnSizingInfoChange:Tn("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:Yu.minSize,(r=l??t.columnDef.size)!=null?r:Yu.size),(o=t.columnDef.maxSize)!=null?o:Yu.maxSize)},t.getStart=we(n=>[n,ea(e,n),e.getState().columnSizing],(n,r)=>r.slice(0,t.getIndex(n)).reduce((o,l)=>o+l.getSize(),0),Ce(e.options,"debugColumns")),t.getAfter=we(n=>[n,ea(e,n),e.getState().columnSizing],(n,r)=>r.slice(t.getIndex(n)+1).reduce((o,l)=>o+l.getSize(),0),Ce(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(),$h(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=$h(l)?Math.round(l.touches[0].clientX):l.clientX,h={},p=(E,A)=>{typeof A=="number"&&(e.setColumnSizingInfo(N=>{var D,j;const $=e.options.columnResizeDirection==="rtl"?-1:1,_=(A-((D=N?.startOffset)!=null?D:0))*$,B=Math.max(_/((j=N?.startSize)!=null?j:0),-.999999);return N.columnSizingStart.forEach(Z=>{let[ie,pe]=Z;h[ie]=Math.round(Math.max(pe+pe*B,0)*100)/100}),{...N,deltaOffset:_,deltaPercentage:B}}),(e.options.columnResizeMode==="onChange"||E==="end")&&e.setColumnSizing(N=>({...N,...h})))},g=E=>p("move",E),v=E=>{p("end",E),e.setColumnSizingInfo(A=>({...A,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},b=Bk(n),S={moveHandler:E=>g(E.clientX),upHandler:E=>{b?.removeEventListener("mousemove",S.moveHandler),b?.removeEventListener("mouseup",S.upHandler),v(E.clientX)}},x={moveHandler:E=>(E.cancelable&&(E.preventDefault(),E.stopPropagation()),g(E.touches[0].clientX),!1),upHandler:E=>{var A;b?.removeEventListener("touchmove",x.moveHandler),b?.removeEventListener("touchend",x.upHandler),E.cancelable&&(E.preventDefault(),E.stopPropagation()),v((A=E.touches[0])==null?void 0:A.clientX)}},C=Fk()?{passive:!1}:!1;$h(l)?(b?.addEventListener("touchmove",x.moveHandler,C),b?.addEventListener("touchend",x.upHandler,C)):(b?.addEventListener("mousemove",S.moveHandler,C),b?.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?Ph():(n=t.initialState.columnSizingInfo)!=null?n:Ph())},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 Xu=null;function Fk(){if(typeof Xu=="boolean")return Xu;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 Xu=t,Xu}function $h(t){return t.type==="touchstart"}const Pk={getInitialState:t=>({columnVisibility:{},...t}),getDefaultOptions:t=>({onColumnVisibilityChange:Tn("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=we(()=>[t.getAllCells(),e.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),Ce(e.options,"debugRows")),t.getVisibleCells=we(()=>[t.getLeftVisibleCells(),t.getCenterVisibleCells(),t.getRightVisibleCells()],(n,r,o)=>[...n,...r,...o],Ce(e.options,"debugRows"))},createTable:t=>{const e=(n,r)=>we(()=>[r(),r().filter(o=>o.getIsVisible()).map(o=>o.id).join("_")],o=>o.filter(l=>l.getIsVisible==null?void 0:l.getIsVisible()),Ce(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 ea(t,e){return e?e==="center"?t.getCenterVisibleLeafColumns():e==="left"?t.getLeftVisibleLeafColumns():t.getRightVisibleLeafColumns():t.getVisibleLeafColumns()}const $k={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()}}},Hk={getInitialState:t=>({globalFilter:void 0,...t}),getDefaultOptions:t=>({onGlobalFilterChange:Tn("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 Qc(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)}}},Uk={getInitialState:t=>({expanded:{},...t}),getDefaultOptions:t=>({onExpandedChange:Tn("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()}}}},Dp=0,_p=10,Hh=()=>({pageIndex:Dp,pageSize:_p}),qk={getInitialState:t=>({...t,pagination:{...Hh(),...t?.pagination}}),getDefaultOptions:t=>({onPaginationChange:Tn("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=>Kn(r,l);return t.options.onPaginationChange==null?void 0:t.options.onPaginationChange(o)},t.resetPagination=r=>{var o;t.setPagination(r?Hh():(o=t.initialState.pagination)!=null?o:Hh())},t.setPageIndex=r=>{t.setPagination(o=>{let l=Kn(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?Dp:(o=(l=t.initialState)==null||(l=l.pagination)==null?void 0:l.pageIndex)!=null?o:Dp)},t.resetPageSize=r=>{var o,l;t.setPageSize(r?_p:(o=(l=t.initialState)==null||(l=l.pagination)==null?void 0:l.pageSize)!=null?o:_p)},t.setPageSize=r=>{t.setPagination(o=>{const l=Math.max(1,Kn(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=Kn(r,(l=t.options.pageCount)!=null?l:-1);return typeof a=="number"&&(a=Math.max(-1,a)),{...o,pageCount:a}}),t.getPageOptions=we(()=>[t.getPageCount()],r=>{let o=[];return r&&r>0&&(o=[...new Array(r)].fill(null).map((l,a)=>a)),o},Ce(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}}},Uh=()=>({top:[],bottom:[]}),Gk={getInitialState:t=>({rowPinning:Uh(),...t}),getDefaultOptions:t=>({onRowPinningChange:Tn("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,v;return{top:((g=d?.top)!=null?g:[]).filter(x=>!(c!=null&&c.has(x))),bottom:[...((v=d?.bottom)!=null?v:[]).filter(x=>!(c!=null&&c.has(x))),...Array.from(c)]}}if(n==="top"){var b,S;return{top:[...((b=d?.top)!=null?b:[]).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?Uh():(n=(r=t.initialState)==null?void 0:r.rowPinning)!=null?n:Uh())},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=we(()=>[t.getRowModel().rows,t.getState().rowPinning.top],(e,n)=>t._getPinnedRows(e,n,"top"),Ce(t.options,"debugRows")),t.getBottomRows=we(()=>[t.getRowModel().rows,t.getState().rowPinning.bottom],(e,n)=>t._getPinnedRows(e,n,"bottom"),Ce(t.options,"debugRows")),t.getCenterRows=we(()=>[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))},Ce(t.options,"debugRows"))}},Kk={getInitialState:t=>({rowSelection:{},...t}),getDefaultOptions:t=>({onRowSelectionChange:Tn("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=>{zp(o,l.id,r,!0,t)}),o}),t.getPreSelectedRowModel=()=>t.getCoreRowModel(),t.getSelectedRowModel=we(()=>[t.getState().rowSelection,t.getCoreRowModel()],(e,n)=>Object.keys(e).length?qh(t,n):{rows:[],flatRows:[],rowsById:{}},Ce(t.options,"debugTable")),t.getFilteredSelectedRowModel=we(()=>[t.getState().rowSelection,t.getFilteredRowModel()],(e,n)=>Object.keys(e).length?qh(t,n):{rows:[],flatRows:[],rowsById:{}},Ce(t.options,"debugTable")),t.getGroupedSelectedRowModel=we(()=>[t.getState().rowSelection,t.getSortedRowModel()],(e,n)=>Object.keys(e).length?qh(t,n):{rows:[],flatRows:[],rowsById:{}},Ce(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 zp(c,t.id,n,(a=r?.selectChildren)!=null?a:!0,e),c})},t.getIsSelected=()=>{const{rowSelection:n}=e.getState();return bm(t,n)},t.getIsSomeSelected=()=>{const{rowSelection:n}=e.getState();return jp(t,n)==="some"},t.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=e.getState();return jp(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)}}}},zp=(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=>zp(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=bm(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 bm(t,e){var n;return(n=e[t.id])!=null?n:!1}function jp(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()&&(bm(a,e)?l=!0:o=!1),a.subRows&&a.subRows.length)){const c=jp(a,e);c==="all"?l=!0:(c==="some"&&(l=!0),o=!1)}}),o?"all":l?"some":!1}const Lp=/([0-9]+)/gm,Yk=(t,e,n)=>w1(Ni(t.getValue(n)).toLowerCase(),Ni(e.getValue(n)).toLowerCase()),Xk=(t,e,n)=>w1(Ni(t.getValue(n)),Ni(e.getValue(n))),Jk=(t,e,n)=>Sm(Ni(t.getValue(n)).toLowerCase(),Ni(e.getValue(n)).toLowerCase()),Qk=(t,e,n)=>Sm(Ni(t.getValue(n)),Ni(e.getValue(n))),Zk=(t,e,n)=>{const r=t.getValue(n),o=e.getValue(n);return r>o?1:r<o?-1:0},Wk=(t,e,n)=>Sm(t.getValue(n),e.getValue(n));function Sm(t,e){return t===e?0:t>e?1:-1}function Ni(t){return typeof t=="number"?isNaN(t)||t===1/0||t===-1/0?"":String(t):typeof t=="string"?t:""}function w1(t,e){const n=t.split(Lp).filter(Boolean),r=e.split(Lp).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 Hl={alphanumeric:Yk,alphanumericCaseSensitive:Xk,text:Jk,textCaseSensitive:Qk,datetime:Zk,basic:Wk},eN={getInitialState:t=>({sorting:[],...t}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:t=>({onSortingChange:Tn("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 Hl.datetime;if(typeof l=="string"&&(r=!0,l.split(Lp).length>1))return Hl.alphanumeric}return r?Hl.text:Hl.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 Qc(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:Hl[t.columnDef.sortingFn]},t.toggleSorting=(n,r)=>{const o=t.getNextSortingOrder(),l=typeof n<"u"&&n!==null;e.setSorting(a=>{const c=a?.find(b=>b.id===t.id),d=a?.findIndex(b=>b.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 v;h=[...a,{id:t.id,desc:g}],h.splice(0,h.length-((v=e.options.maxMultiSortColCount)!=null?v:Number.MAX_SAFE_INTEGER))}else p==="toggle"?h=a.map(b=>b.id===t.id?{...b,desc:g}:b):p==="remove"?h=a.filter(b=>b.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())}},tN=[wk,Pk,Lk,Ik,Ck,Mk,$k,Hk,eN,zk,Uk,qk,Gk,Kk,Vk];function nN(t){var e,n;const r=[...tN,...(e=t._features)!=null?e:[]];let o={_features:r};const l=o._features.reduce((v,b)=>Object.assign(v,b.getDefaultOptions==null?void 0:b.getDefaultOptions(o)),{}),a=v=>o.options.mergeOptions?o.options.mergeOptions(l,v):{...l,...v};let d={...{},...(n=t.initialState)!=null?n:{}};o._features.forEach(v=>{var b;d=(b=v.getInitialState==null?void 0:v.getInitialState(d))!=null?b:d});const h=[];let p=!1;const g={_features:r,options:{...l,...t},initialState:d,_queue:v=>{h.push(v),p||(p=!0,Promise.resolve().then(()=>{for(;h.length;)h.shift()();p=!1}).catch(b=>setTimeout(()=>{throw b})))},reset:()=>{o.setState(o.initialState)},setOptions:v=>{const b=Kn(v,o.options);o.options=a(b)},getState:()=>o.options.state,setState:v=>{o.options.onStateChange==null||o.options.onStateChange(v)},_getRowId:(v,b,S)=>{var x;return(x=o.options.getRowId==null?void 0:o.options.getRowId(v,b,S))!=null?x:`${S?[S.id,b].join("."):b}`},getCoreRowModel:()=>(o._getCoreRowModel||(o._getCoreRowModel=o.options.getCoreRowModel(o)),o._getCoreRowModel()),getRowModel:()=>o.getPaginationRowModel(),getRow:(v,b)=>{let S=(b?o.getPrePaginationRowModel():o.getRowModel()).rowsById[v];if(!S&&(S=o.getCoreRowModel().rowsById[v],!S))throw new Error;return S},_getDefaultColumnDef:we(()=>[o.options.defaultColumn],v=>{var b;return v=(b=v)!=null?b:{},{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()),{}),...v}},Ce(t,"debugColumns")),_getColumnDefs:()=>o.options.columns,getAllColumns:we(()=>[o._getColumnDefs()],v=>{const b=function(S,x,C){return C===void 0&&(C=0),S.map(E=>{const A=xk(o,E,C,x),N=E;return A.columns=N.columns?b(N.columns,A,C+1):[],A})};return b(v)},Ce(t,"debugColumns")),getAllFlatColumns:we(()=>[o.getAllColumns()],v=>v.flatMap(b=>b.getFlatColumns()),Ce(t,"debugColumns")),_getAllFlatColumnsById:we(()=>[o.getAllFlatColumns()],v=>v.reduce((b,S)=>(b[S.id]=S,b),{}),Ce(t,"debugColumns")),getAllLeafColumns:we(()=>[o.getAllColumns(),o._getOrderColumnsFn()],(v,b)=>{let S=v.flatMap(x=>x.getLeafColumns());return b(S)},Ce(t,"debugColumns")),getColumn:v=>o._getAllFlatColumnsById()[v]};Object.assign(o,g);for(let v=0;v<o._features.length;v++){const b=o._features[v];b==null||b.createTable==null||b.createTable(o)}return o}function rN(){return t=>we(()=>[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=ym(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},Ce(t.options,"debugTable","getRowModel",()=>t._autoResetPageIndex()))}function iN(t,e,n){return n.options.filterFromLeafRows?oN(t,e,n):sN(t,e,n)}function oN(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 v=0;v<d.length;v++){var g;let b=d[v];const S=ym(n,b.id,b.original,b.index,b.depth,void 0,b.parentId);if(S.columnFilters=b.columnFilters,(g=b.subRows)!=null&&g.length&&h<a){if(S.subRows=c(b.subRows,h+1),b=S,e(b)&&!S.subRows.length){p.push(b),l[b.id]=b,o.push(b);continue}if(e(b)||S.subRows.length){p.push(b),l[b.id]=b,o.push(b);continue}}else b=S,e(b)&&(p.push(b),l[b.id]=b,o.push(b))}return p};return{rows:c(t),flatRows:o,rowsById:l}}function sN(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 v=0;v<d.length;v++){let b=d[v];if(e(b)){var g;if((g=b.subRows)!=null&&g.length&&h<a){const x=ym(n,b.id,b.original,b.index,b.depth,void 0,b.parentId);x.subRows=c(b.subRows,h+1),b=x}p.push(b),o.push(b),l[b.id]=b}}return p};return{rows:c(t),flatRows:o,rowsById:l}}function lN(){return t=>we(()=>[t.getPreFilteredRowModel(),t.getState().columnFilters,t.getState().globalFilter],(e,n,r)=>{if(!e.rows.length||!(n!=null&&n.length)&&!r){for(let v=0;v<e.flatRows.length;v++)e.flatRows[v].columnFilters={},e.flatRows[v].columnFiltersMeta={};return e}const o=[],l=[];(n??[]).forEach(v=>{var b;const S=t.getColumn(v.id);if(!S)return;const x=S.getFilterFn();x&&o.push({id:v.id,filterFn:x,resolvedValue:(b=x.resolveFilterValue==null?void 0:x.resolveFilterValue(v.value))!=null?b:v.value})});const a=(n??[]).map(v=>v.id),c=t.getGlobalFilterFn(),d=t.getAllLeafColumns().filter(v=>v.getCanGlobalFilter());r&&c&&d.length&&(a.push("__global__"),d.forEach(v=>{var b;l.push({id:v.id,filterFn:c,resolvedValue:(b=c.resolveFilterValue==null?void 0:c.resolveFilterValue(r))!=null?b:r})}));let h,p;for(let v=0;v<e.flatRows.length;v++){const b=e.flatRows[v];if(b.columnFilters={},o.length)for(let S=0;S<o.length;S++){h=o[S];const x=h.id;b.columnFilters[x]=h.filterFn(b,x,h.resolvedValue,C=>{b.columnFiltersMeta[x]=C})}if(l.length){for(let S=0;S<l.length;S++){p=l[S];const x=p.id;if(p.filterFn(b,x,p.resolvedValue,C=>{b.columnFiltersMeta[x]=C})){b.columnFilters.__global__=!0;break}}b.columnFilters.__global__!==!0&&(b.columnFilters.__global__=!1)}}const g=v=>{for(let b=0;b<a.length;b++)if(v.columnFilters[a[b]]===!1)return!1;return!0};return iN(e.rows,g,t)},Ce(t.options,"debugTable","getFilteredRowModel",()=>t._autoResetPageIndex()))}function aN(){return t=>we(()=>[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 b=0;b<l.length;b+=1){var v;const S=l[b],x=a[S.id],C=x.sortUndefined,E=(v=S?.desc)!=null?v:!1;let A=0;if(C){const N=p.getValue(S.id),D=g.getValue(S.id),j=N===void 0,$=D===void 0;if(j||$){if(C==="first")return j?-1:1;if(C==="last")return j?1:-1;A=j&&$?0:j?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}},Ce(t.options,"debugTable","getSortedRowModel",()=>t._autoResetPageIndex()))}function Ip(t,e){return t?uN(t)?M.createElement(t,e):t:null}function uN(t){return cN(t)||typeof t=="function"||fN(t)}function cN(t){return typeof t=="function"&&(()=>{const e=Object.getPrototypeOf(t);return e.prototype&&e.prototype.isReactComponent})()}function fN(t){return typeof t=="object"&&typeof t.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(t.$$typeof.description)}function dN(t){const e={state:{},onStateChange:()=>{},renderFallbackValue:null,...t},[n]=M.useState(()=>({current:nN(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 wa=s1();const C1=i1(wa);function bs(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 b;if(n.key&&((d=n.debug)!=null&&d.call(n))&&(b=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()-b)*100)/100,C=x/16,E=(A,N)=>{for(A=String(A);A.length<N;)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 Rb(t,e){if(t===void 0)throw new Error("Unexpected undefined");return t}const hN=(t,e)=>Math.abs(t-e)<1.01,pN=(t,e,n)=>{let r;return function(...o){t.clearTimeout(r),r=t.setTimeout(()=>e.apply(this,o),n)}},Tb=t=>{const{offsetWidth:e,offsetHeight:n}=t;return{width:e,height:n}},mN=t=>t,gN=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},yN=(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(Tb(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(Tb(n))};t.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(c):c()});return l.observe(n,{box:"border-box"}),()=>{l.unobserve(n)}},Ab={passive:!0},Ob=typeof window>"u"?!0:"onscrollend"in window,vN=(t,e)=>{const n=t.scrollElement;if(!n)return;const r=t.targetWindow;if(!r)return;let o=0;const l=t.options.useScrollendEvent&&Ob?()=>{}:pN(r,()=>{e(o,!1)},t.options.isScrollingResetDelay),a=p=>()=>{const{horizontal:g,isRtl:v}=t.options;o=g?n.scrollLeft*(v&&-1||1):n.scrollTop,l(),e(o,p)},c=a(!0),d=a(!1);n.addEventListener("scroll",c,Ab);const h=t.options.useScrollendEvent&&Ob;return h&&n.addEventListener("scrollend",d,Ab),()=>{n.removeEventListener("scroll",c),h&&n.removeEventListener("scrollend",d)}},bN=(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"]},SN=(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 xN{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:gN,onChange:()=>{},measureElement:bN,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=bs(()=>(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=bs(()=>[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=bs(()=>[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 v of this.laneAssignments.keys())v>=n&&this.laneAssignments.delete(v);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(v=>{this.itemSizeCache.set(v.key,v.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 v=0;v<h;v++){const b=p[v];b&&(g[b.lane]=v)}for(let v=h;v<n;v++){const b=l(v),S=this.laneAssignments.get(v);let x,C;if(S!==void 0&&this.options.lanes>1){x=S;const D=g[x],j=D!==void 0?p[D]:void 0;C=j?j.end+this.options.gap:r+o}else{const D=this.options.lanes===1?p[v-1]:this.getFurthestMeasurement(p,v);C=D?D.end+this.options.gap:r+o,x=D?D.lane:v%this.options.lanes,this.options.lanes>1&&this.laneAssignments.set(v,x)}const E=d.get(b),A=typeof E=="number"?E:this.options.estimateSize(v),N=C+A;p[v]={index:v,start:C,size:A,end:N,key:b,lane:x},g[x]=v}return this.measurementsCache=p,p},{key:!1,debug:()=>this.options.debug}),this.calculateRange=bs(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,o,l)=>this.range=n.length>0&&r>0?wN({measurements:n,outerSize:r,scrollOffset:o,lanes:l}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=bs(()=>{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=bs(()=>[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 Rb(r[M1(0,r.length-1,o=>Rb(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&&hN(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 M1=(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 wN({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=M1(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 kb=typeof document<"u"?M.useLayoutEffect:M.useEffect;function CN({useFlushSync:t=!0,...e}){const n=M.useReducer(()=>({}),{})[1],r={...e,onChange:(l,a)=>{var c;t&&a?wa.flushSync(n):n(),(c=e.onChange)==null||c.call(e,l,a)}},[o]=M.useState(()=>new xN(r));return o.setOptions(r),kb(()=>o._didMount(),[]),kb(()=>o._willUpdate()),o}function MN(t){return CN({observeElementRect:yN,observeElementOffset:vN,scrollToFn:SN,...t})}function E1(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=E1(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function R1(){for(var t,e,n=0,r="",o=arguments.length;n<o;n++)(t=arguments[n])&&(e=E1(t))&&(r&&(r+=" "),r+=e);return r}const EN=(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},RN=(t,e)=>({classGroupId:t,validator:e}),T1=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),xc="-",Nb=[],TN="arbitrary..",AN=t=>{const e=kN(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return ON(a);const c=a.split(xc),d=c[0]===""&&c.length>1?1:0;return A1(c,d,e)},getConflictingClassGroupIds:(a,c)=>{if(c){const d=r[a],h=n[a];return d?h?EN(h,d):d:h||Nb}return n[a]||Nb}}},A1=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const o=t[e],l=n.nextPart.get(o);if(l){const h=A1(t,e+1,l);if(h)return h}const a=n.validators;if(a===null)return;const c=e===0?t.join(xc):t.slice(e).join(xc),d=a.length;for(let h=0;h<d;h++){const p=a[h];if(p.validator(c))return p.classGroupId}},ON=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?TN+r:void 0})(),kN=t=>{const{theme:e,classGroups:n}=t;return NN(n,e)},NN=(t,e)=>{const n=T1();for(const r in t){const o=t[r];xm(o,n,r,e)}return n},xm=(t,e,n,r)=>{const o=t.length;for(let l=0;l<o;l++){const a=t[l];DN(a,e,n,r)}},DN=(t,e,n,r)=>{if(typeof t=="string"){_N(t,e,n);return}if(typeof t=="function"){zN(t,e,n,r);return}jN(t,e,n,r)},_N=(t,e,n)=>{const r=t===""?e:O1(e,t);r.classGroupId=n},zN=(t,e,n,r)=>{if(LN(t)){xm(t(r),e,n,r);return}e.validators===null&&(e.validators=[]),e.validators.push(RN(n,t))},jN=(t,e,n,r)=>{const o=Object.entries(t),l=o.length;for(let a=0;a<l;a++){const[c,d]=o[a];xm(d,O1(e,c),n,r)}},O1=(t,e)=>{let n=t;const r=e.split(xc),o=r.length;for(let l=0;l<o;l++){const a=r[l];let c=n.nextPart.get(a);c||(c=T1(),n.nextPart.set(a,c)),n=c}return n},LN=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,IN=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)}}},Bp="!",Db=":",BN=[],_b=(t,e,n,r,o)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:r,isExternal:o}),VN=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===Db){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 v=g,b=!1;g.endsWith(Bp)?(v=g.slice(0,-1),b=!0):g.startsWith(Bp)&&(v=g.slice(1),b=!0);const S=h&&h>d?h-d:void 0;return _b(l,b,v,S)};if(e){const o=e+Db,l=r;r=a=>a.startsWith(o)?l(a.slice(o.length)):_b(BN,!1,a,void 0,!0)}if(n){const o=r;r=l=>n({className:l,parseClassName:o})}return r},FN=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}},PN=t=>({cache:IN(t.cacheSize),parseClassName:VN(t),sortModifiers:FN(t),...AN(t)}),$N=/\s+/,HN=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:l}=e,a=[],c=t.trim().split($N);let d="";for(let h=c.length-1;h>=0;h-=1){const p=c[h],{isExternal:g,modifiers:v,hasImportantModifier:b,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=v.length===0?"":v.length===1?v[0]:l(v).join(":"),N=b?A+Bp:A,D=N+E;if(a.indexOf(D)>-1)continue;a.push(D);const j=o(E,C);for(let $=0;$<j.length;++$){const _=j[$];a.push(N+_)}d=p+(d.length>0?" "+d:d)}return d},UN=(...t)=>{let e=0,n,r,o="";for(;e<t.length;)(n=t[e++])&&(r=k1(n))&&(o&&(o+=" "),o+=r);return o},k1=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=k1(t[r]))&&(n&&(n+=" "),n+=e);return n},qN=(t,...e)=>{let n,r,o,l;const a=d=>{const h=e.reduce((p,g)=>g(p),t());return n=PN(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=HN(d,n);return o(d,p),p};return l=a,(...d)=>l(UN(...d))},GN=[],wt=t=>{const e=n=>n[t]||GN;return e.isThemeGetter=!0,e},N1=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,D1=/^\((?:(\w[\w-]*):)?(.+)\)$/i,KN=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,YN=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,XN=/\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$/,JN=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,QN=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ZN=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,gi=t=>KN.test(t),De=t=>!!t&&!Number.isNaN(Number(t)),yi=t=>!!t&&Number.isInteger(Number(t)),Gh=t=>t.endsWith("%")&&De(t.slice(0,-1)),_r=t=>YN.test(t),_1=()=>!0,WN=t=>XN.test(t)&&!JN.test(t),wm=()=>!1,eD=t=>QN.test(t),tD=t=>ZN.test(t),nD=t=>!fe(t)&&!de(t),rD=t=>Li(t,L1,wm),fe=t=>N1.test(t),so=t=>Li(t,I1,WN),zb=t=>Li(t,fD,De),iD=t=>Li(t,V1,_1),oD=t=>Li(t,B1,wm),jb=t=>Li(t,z1,wm),sD=t=>Li(t,j1,tD),Ju=t=>Li(t,F1,eD),de=t=>D1.test(t),Ul=t=>Co(t,I1),lD=t=>Co(t,B1),Lb=t=>Co(t,z1),aD=t=>Co(t,L1),uD=t=>Co(t,j1),Qu=t=>Co(t,F1,!0),cD=t=>Co(t,V1,!0),Li=(t,e,n)=>{const r=N1.exec(t);return r?r[1]?e(r[1]):n(r[2]):!1},Co=(t,e,n=!1)=>{const r=D1.exec(t);return r?r[1]?e(r[1]):n:!1},z1=t=>t==="position"||t==="percentage",j1=t=>t==="image"||t==="url",L1=t=>t==="length"||t==="size"||t==="bg-size",I1=t=>t==="length",fD=t=>t==="number",B1=t=>t==="family-name",V1=t=>t==="number"||t==="weight",F1=t=>t==="shadow",dD=()=>{const t=wt("color"),e=wt("font"),n=wt("text"),r=wt("font-weight"),o=wt("tracking"),l=wt("leading"),a=wt("breakpoint"),c=wt("container"),d=wt("spacing"),h=wt("radius"),p=wt("shadow"),g=wt("inset-shadow"),v=wt("text-shadow"),b=wt("drop-shadow"),S=wt("blur"),x=wt("perspective"),C=wt("aspect"),E=wt("ease"),A=wt("animate"),N=()=>["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"],j=()=>[...D(),de,fe],$=()=>["auto","hidden","clip","visible","scroll"],_=()=>["auto","contain","none"],B=()=>[de,fe,d],Z=()=>[gi,"full","auto",...B()],ie=()=>[yi,"none","subgrid",de,fe],pe=()=>["auto",{span:["full",yi,de,fe]},yi,de,fe],se=()=>[yi,"auto",de,fe],be=()=>["auto","min","max","fr",de,fe],te=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ye=()=>["start","end","center","stretch","center-safe","end-safe"],V=()=>["auto",...B()],U=()=>[gi,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...B()],L=()=>[gi,"screen","full","dvw","lvw","svw","min","max","fit",...B()],q=()=>[gi,"screen","full","lh","dvh","lvh","svh","min","max","fit",...B()],Y=()=>[t,de,fe],k=()=>[...D(),Lb,jb,{position:[de,fe]}],K=()=>["no-repeat",{repeat:["","x","y","space","round"]}],W=()=>["auto","cover","contain",aD,rD,{size:[de,fe]}],ne=()=>[Gh,Ul,so],le=()=>["","none","full",h,de,fe],ae=()=>["",De,Ul,so],me=()=>["solid","dashed","dotted","double"],Ke=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Ee=()=>[De,Gh,Lb,jb],St=()=>["","none",S,de,fe],ct=()=>["none",De,de,fe],Jt=()=>["none",De,de,fe],Qt=()=>[De,de,fe],Ct=()=>[gi,"full",...B()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[_r],breakpoint:[_r],color:[_1],container:[_r],"drop-shadow":[_r],ease:["in","out","in-out"],font:[nD],"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",De],text:[_r],"text-shadow":[_r],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",gi,fe,de,C]}],container:["container"],columns:[{columns:[De,fe,de,c]}],"break-after":[{"break-after":N()}],"break-before":[{"break-before":N()}],"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:j()}],overflow:[{overflow:$()}],"overflow-x":[{"overflow-x":$()}],"overflow-y":[{"overflow-y":$()}],overscroll:[{overscroll:_()}],"overscroll-x":[{"overscroll-x":_()}],"overscroll-y":[{"overscroll-y":_()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:Z()}],"inset-x":[{"inset-x":Z()}],"inset-y":[{"inset-y":Z()}],start:[{"inset-s":Z(),start:Z()}],end:[{"inset-e":Z(),end:Z()}],"inset-bs":[{"inset-bs":Z()}],"inset-be":[{"inset-be":Z()}],top:[{top:Z()}],right:[{right:Z()}],bottom:[{bottom:Z()}],left:[{left:Z()}],visibility:["visible","invisible","collapse"],z:[{z:[yi,"auto",de,fe]}],basis:[{basis:[gi,"full","auto",c,...B()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[De,gi,"auto","initial","none",fe]}],grow:[{grow:["",De,de,fe]}],shrink:[{shrink:["",De,de,fe]}],order:[{order:[yi,"first","last","none",de,fe]}],"grid-cols":[{"grid-cols":ie()}],"col-start-end":[{col:pe()}],"col-start":[{"col-start":se()}],"col-end":[{"col-end":se()}],"grid-rows":[{"grid-rows":ie()}],"row-start-end":[{row:pe()}],"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":be()}],"auto-rows":[{"auto-rows":be()}],gap:[{gap:B()}],"gap-x":[{"gap-x":B()}],"gap-y":[{"gap-y":B()}],"justify-content":[{justify:[...te(),"normal"]}],"justify-items":[{"justify-items":[...ye(),"normal"]}],"justify-self":[{"justify-self":["auto",...ye()]}],"align-content":[{content:["normal",...te()]}],"align-items":[{items:[...ye(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ye(),{baseline:["","last"]}]}],"place-content":[{"place-content":te()}],"place-items":[{"place-items":[...ye(),"baseline"]}],"place-self":[{"place-self":["auto",...ye()]}],p:[{p:B()}],px:[{px:B()}],py:[{py:B()}],ps:[{ps:B()}],pe:[{pe:B()}],pbs:[{pbs:B()}],pbe:[{pbe:B()}],pt:[{pt:B()}],pr:[{pr:B()}],pb:[{pb:B()}],pl:[{pl:B()}],m:[{m:V()}],mx:[{mx:V()}],my:[{my:V()}],ms:[{ms:V()}],me:[{me:V()}],mbs:[{mbs:V()}],mbe:[{mbe:V()}],mt:[{mt:V()}],mr:[{mr:V()}],mb:[{mb:V()}],ml:[{ml:V()}],"space-x":[{"space-x":B()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":B()}],"space-y-reverse":["space-y-reverse"],size:[{size:U()}],"inline-size":[{inline:["auto",...L()]}],"min-inline-size":[{"min-inline":["auto",...L()]}],"max-inline-size":[{"max-inline":["none",...L()]}],"block-size":[{block:["auto",...q()]}],"min-block-size":[{"min-block":["auto",...q()]}],"max-block-size":[{"max-block":["none",...q()]}],w:[{w:[c,"screen",...U()]}],"min-w":[{"min-w":[c,"screen","none",...U()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[a]},...U()]}],h:[{h:["screen","lh",...U()]}],"min-h":[{"min-h":["screen","lh","none",...U()]}],"max-h":[{"max-h":["screen","lh",...U()]}],"font-size":[{text:["base",n,Ul,so]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,cD,iD]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Gh,fe]}],"font-family":[{font:[lD,oD,e]}],"font-features":[{"font-features":[fe]}],"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,de,fe]}],"line-clamp":[{"line-clamp":[De,"none",de,zb]}],leading:[{leading:[l,...B()]}],"list-image":[{"list-image":["none",de,fe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",de,fe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:Y()}],"text-color":[{text:Y()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...me(),"wavy"]}],"text-decoration-thickness":[{decoration:[De,"from-font","auto",de,so]}],"text-decoration-color":[{decoration:Y()}],"underline-offset":[{"underline-offset":[De,"auto",de,fe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:B()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",de,fe]}],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",de,fe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:k()}],"bg-repeat":[{bg:K()}],"bg-size":[{bg:W()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},yi,de,fe],radial:["",de,fe],conic:[yi,de,fe]},uD,sD]}],"bg-color":[{bg:Y()}],"gradient-from-pos":[{from:ne()}],"gradient-via-pos":[{via:ne()}],"gradient-to-pos":[{to:ne()}],"gradient-from":[{from:Y()}],"gradient-via":[{via:Y()}],"gradient-to":[{to:Y()}],rounded:[{rounded:le()}],"rounded-s":[{"rounded-s":le()}],"rounded-e":[{"rounded-e":le()}],"rounded-t":[{"rounded-t":le()}],"rounded-r":[{"rounded-r":le()}],"rounded-b":[{"rounded-b":le()}],"rounded-l":[{"rounded-l":le()}],"rounded-ss":[{"rounded-ss":le()}],"rounded-se":[{"rounded-se":le()}],"rounded-ee":[{"rounded-ee":le()}],"rounded-es":[{"rounded-es":le()}],"rounded-tl":[{"rounded-tl":le()}],"rounded-tr":[{"rounded-tr":le()}],"rounded-br":[{"rounded-br":le()}],"rounded-bl":[{"rounded-bl":le()}],"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:[...me(),"hidden","none"]}],"divide-style":[{divide:[...me(),"hidden","none"]}],"border-color":[{border:Y()}],"border-color-x":[{"border-x":Y()}],"border-color-y":[{"border-y":Y()}],"border-color-s":[{"border-s":Y()}],"border-color-e":[{"border-e":Y()}],"border-color-bs":[{"border-bs":Y()}],"border-color-be":[{"border-be":Y()}],"border-color-t":[{"border-t":Y()}],"border-color-r":[{"border-r":Y()}],"border-color-b":[{"border-b":Y()}],"border-color-l":[{"border-l":Y()}],"divide-color":[{divide:Y()}],"outline-style":[{outline:[...me(),"none","hidden"]}],"outline-offset":[{"outline-offset":[De,de,fe]}],"outline-w":[{outline:["",De,Ul,so]}],"outline-color":[{outline:Y()}],shadow:[{shadow:["","none",p,Qu,Ju]}],"shadow-color":[{shadow:Y()}],"inset-shadow":[{"inset-shadow":["none",g,Qu,Ju]}],"inset-shadow-color":[{"inset-shadow":Y()}],"ring-w":[{ring:ae()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:Y()}],"ring-offset-w":[{"ring-offset":[De,so]}],"ring-offset-color":[{"ring-offset":Y()}],"inset-ring-w":[{"inset-ring":ae()}],"inset-ring-color":[{"inset-ring":Y()}],"text-shadow":[{"text-shadow":["none",v,Qu,Ju]}],"text-shadow-color":[{"text-shadow":Y()}],opacity:[{opacity:[De,de,fe]}],"mix-blend":[{"mix-blend":[...Ke(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Ke()}],"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":[De]}],"mask-image-linear-from-pos":[{"mask-linear-from":Ee()}],"mask-image-linear-to-pos":[{"mask-linear-to":Ee()}],"mask-image-linear-from-color":[{"mask-linear-from":Y()}],"mask-image-linear-to-color":[{"mask-linear-to":Y()}],"mask-image-t-from-pos":[{"mask-t-from":Ee()}],"mask-image-t-to-pos":[{"mask-t-to":Ee()}],"mask-image-t-from-color":[{"mask-t-from":Y()}],"mask-image-t-to-color":[{"mask-t-to":Y()}],"mask-image-r-from-pos":[{"mask-r-from":Ee()}],"mask-image-r-to-pos":[{"mask-r-to":Ee()}],"mask-image-r-from-color":[{"mask-r-from":Y()}],"mask-image-r-to-color":[{"mask-r-to":Y()}],"mask-image-b-from-pos":[{"mask-b-from":Ee()}],"mask-image-b-to-pos":[{"mask-b-to":Ee()}],"mask-image-b-from-color":[{"mask-b-from":Y()}],"mask-image-b-to-color":[{"mask-b-to":Y()}],"mask-image-l-from-pos":[{"mask-l-from":Ee()}],"mask-image-l-to-pos":[{"mask-l-to":Ee()}],"mask-image-l-from-color":[{"mask-l-from":Y()}],"mask-image-l-to-color":[{"mask-l-to":Y()}],"mask-image-x-from-pos":[{"mask-x-from":Ee()}],"mask-image-x-to-pos":[{"mask-x-to":Ee()}],"mask-image-x-from-color":[{"mask-x-from":Y()}],"mask-image-x-to-color":[{"mask-x-to":Y()}],"mask-image-y-from-pos":[{"mask-y-from":Ee()}],"mask-image-y-to-pos":[{"mask-y-to":Ee()}],"mask-image-y-from-color":[{"mask-y-from":Y()}],"mask-image-y-to-color":[{"mask-y-to":Y()}],"mask-image-radial":[{"mask-radial":[de,fe]}],"mask-image-radial-from-pos":[{"mask-radial-from":Ee()}],"mask-image-radial-to-pos":[{"mask-radial-to":Ee()}],"mask-image-radial-from-color":[{"mask-radial-from":Y()}],"mask-image-radial-to-color":[{"mask-radial-to":Y()}],"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":[De]}],"mask-image-conic-from-pos":[{"mask-conic-from":Ee()}],"mask-image-conic-to-pos":[{"mask-conic-to":Ee()}],"mask-image-conic-from-color":[{"mask-conic-from":Y()}],"mask-image-conic-to-color":[{"mask-conic-to":Y()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:k()}],"mask-repeat":[{mask:K()}],"mask-size":[{mask:W()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",de,fe]}],filter:[{filter:["","none",de,fe]}],blur:[{blur:St()}],brightness:[{brightness:[De,de,fe]}],contrast:[{contrast:[De,de,fe]}],"drop-shadow":[{"drop-shadow":["","none",b,Qu,Ju]}],"drop-shadow-color":[{"drop-shadow":Y()}],grayscale:[{grayscale:["",De,de,fe]}],"hue-rotate":[{"hue-rotate":[De,de,fe]}],invert:[{invert:["",De,de,fe]}],saturate:[{saturate:[De,de,fe]}],sepia:[{sepia:["",De,de,fe]}],"backdrop-filter":[{"backdrop-filter":["","none",de,fe]}],"backdrop-blur":[{"backdrop-blur":St()}],"backdrop-brightness":[{"backdrop-brightness":[De,de,fe]}],"backdrop-contrast":[{"backdrop-contrast":[De,de,fe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",De,de,fe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[De,de,fe]}],"backdrop-invert":[{"backdrop-invert":["",De,de,fe]}],"backdrop-opacity":[{"backdrop-opacity":[De,de,fe]}],"backdrop-saturate":[{"backdrop-saturate":[De,de,fe]}],"backdrop-sepia":[{"backdrop-sepia":["",De,de,fe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":B()}],"border-spacing-x":[{"border-spacing-x":B()}],"border-spacing-y":[{"border-spacing-y":B()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",de,fe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[De,"initial",de,fe]}],ease:[{ease:["linear","initial",E,de,fe]}],delay:[{delay:[De,de,fe]}],animate:[{animate:["none",A,de,fe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[x,de,fe]}],"perspective-origin":[{"perspective-origin":j()}],rotate:[{rotate:ct()}],"rotate-x":[{"rotate-x":ct()}],"rotate-y":[{"rotate-y":ct()}],"rotate-z":[{"rotate-z":ct()}],scale:[{scale:Jt()}],"scale-x":[{"scale-x":Jt()}],"scale-y":[{"scale-y":Jt()}],"scale-z":[{"scale-z":Jt()}],"scale-3d":["scale-3d"],skew:[{skew:Qt()}],"skew-x":[{"skew-x":Qt()}],"skew-y":[{"skew-y":Qt()}],transform:[{transform:[de,fe,"","none","gpu","cpu"]}],"transform-origin":[{origin:j()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ct()}],"translate-x":[{"translate-x":Ct()}],"translate-y":[{"translate-y":Ct()}],"translate-z":[{"translate-z":Ct()}],"translate-none":["translate-none"],accent:[{accent:Y()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:Y()}],"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",de,fe]}],"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":B()}],"scroll-mx":[{"scroll-mx":B()}],"scroll-my":[{"scroll-my":B()}],"scroll-ms":[{"scroll-ms":B()}],"scroll-me":[{"scroll-me":B()}],"scroll-mbs":[{"scroll-mbs":B()}],"scroll-mbe":[{"scroll-mbe":B()}],"scroll-mt":[{"scroll-mt":B()}],"scroll-mr":[{"scroll-mr":B()}],"scroll-mb":[{"scroll-mb":B()}],"scroll-ml":[{"scroll-ml":B()}],"scroll-p":[{"scroll-p":B()}],"scroll-px":[{"scroll-px":B()}],"scroll-py":[{"scroll-py":B()}],"scroll-ps":[{"scroll-ps":B()}],"scroll-pe":[{"scroll-pe":B()}],"scroll-pbs":[{"scroll-pbs":B()}],"scroll-pbe":[{"scroll-pbe":B()}],"scroll-pt":[{"scroll-pt":B()}],"scroll-pr":[{"scroll-pr":B()}],"scroll-pb":[{"scroll-pb":B()}],"scroll-pl":[{"scroll-pl":B()}],"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",de,fe]}],fill:[{fill:["none",...Y()]}],"stroke-w":[{stroke:[De,Ul,so,zb]}],stroke:[{stroke:["none",...Y()]}],"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"]}},hD=qN(dD);function Ne(...t){return hD(R1(t))}function pD(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 mD(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 gD(t){return new Intl.NumberFormat(void 0,{maximumFractionDigits:Number.isInteger(t)?0:2}).format(t)}function P1(t,e){return t==null||t===""?T.jsx("span",{className:"text-muted-foreground",children:"-"}):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"?gD(Number(t)):e==="date"||t instanceof Date?mD(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 yD(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 vD(t,e,n){const r=yD(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 Ib({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(rk,{className:"size-3.5"}):null,t?T.jsx(Ps,{className:"size-3.5"}):null]})]})}function bD({cell:t,highlightTerms:e=[],paddingLeft:n,paddingRight:r}){const o=t.column.columnDef.meta??{},l=t.getValue(),a=Ip(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?vD(l,e,a):a??P1(l,o.kind);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",pD(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 SD={text:gk,enum:ek,number:JO,boolean:Cb,date:DO,json:kO,selection:Cb};function wc({kind:t,...e}){const n=SD[t];return T.jsx(n,{...e})}function xD(t){return/\d{4}-\d{2}-\d{2}/.test(t)?!Number.isNaN(Date.parse(t)):!1}function wD(t){const e=t.find(n=>n!=null);return e instanceof Date?"date":typeof e=="boolean"?"boolean":typeof e=="number"?"number":typeof e=="string"&&xD(e)?"date":e&&typeof e=="object"?"json":"text"}function CD(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 MD({sorted:t}){return t==="asc"?T.jsx(RO,{className:"size-3.5 text-foreground"}):t==="desc"?T.jsx(MO,{className:"size-3.5 text-foreground"}):null}function ED({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=CD(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(wc,{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:Ip(t.column.columnDef.header,t.getContext())}),T.jsx(MD,{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(wc,{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:Ip(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(mm,{className:"size-3"})}):null]}),t.column.getCanResize()?T.jsx(RD,{header:t,scrollContainerRef:l}):null]})}function RD({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?wa.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 Bb=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,Vb=R1,Cm=(t,e)=>n=>{var r;if(e?.variants==null)return Vb(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 v=Bb(p)||Bb(g);return o[h][v]}),c=n&&Object.entries(n).reduce((h,p)=>{let[g,v]=p;return v===void 0||(h[g]=v),h},{}),d=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((h,p)=>{let{class:g,className:v,...b}=p;return Object.entries(b).every(S=>{let[x,C]=S;return Array.isArray(C)?C.includes({...l,...c}[x]):{...l,...c}[x]===C})?[...h,g,v]:h},[]);return Vb(t,a,d,n?.class,n?.className)};function Fb(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function Zc(...t){return e=>{let n=!1;const r=t.map(o=>{const l=Fb(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():Fb(t[o],null)}}}}function mn(...t){return M.useCallback(Zc(...t),t)}function la(t){const e=AD(t),n=M.forwardRef((r,o)=>{const{children:l,...a}=r,c=M.Children.toArray(l),d=c.find(kD);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 TD=la("Slot");function AD(t){const e=M.forwardRef((n,r)=>{const{children:o,...l}=n;if(M.isValidElement(o)){const a=DD(o),c=ND(l,o.props);return o.type!==M.Fragment&&(c.ref=r?Zc(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 OD=Symbol("radix.slottable");function kD(t){return M.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===OD}function ND(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 DD(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 _D=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],qt=_D.reduce((t,e)=>{const n=la(`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 $1(t,e){t&&wa.flushSync(()=>t.dispatchEvent(e))}function $s(t,e=[]){let n=[];function r(l,a){const c=M.createContext(a),d=n.length;n=[...n,a];const h=g=>{const{scope:v,children:b,...S}=g,x=v?.[t]?.[d]||c,C=M.useMemo(()=>S,Object.values(S));return T.jsx(x.Provider,{value:C,children:b})};h.displayName=l+"Provider";function p(g,v){const b=v?.[t]?.[d]||c,S=M.useContext(b);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,zD(o,...e)]}function zD(...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 H1(t){const e=t+"CollectionProvider",[n,r]=$s(e),[o,l]=n(e,{collectionRef:{current:null},itemMap:new Map}),a=x=>{const{scope:C,children:E}=x,A=tn.useRef(null),N=tn.useRef(new Map).current;return T.jsx(o,{scope:C,itemMap:N,collectionRef:A,children:E})};a.displayName=e;const c=t+"CollectionSlot",d=la(c),h=tn.forwardRef((x,C)=>{const{scope:E,children:A}=x,N=l(c,E),D=mn(C,N.collectionRef);return T.jsx(d,{ref:D,children:A})});h.displayName=c;const p=t+"CollectionItemSlot",g="data-radix-collection-item",v=la(p),b=tn.forwardRef((x,C)=>{const{scope:E,children:A,...N}=x,D=tn.useRef(null),j=mn(C,D),$=l(p,E);return tn.useEffect(()=>($.itemMap.set(D,{ref:D,...N}),()=>{$.itemMap.delete(D)})),T.jsx(v,{[g]:"",ref:j,children:A})});b.displayName=p;function S(x){const C=l(t+"CollectionConsumer",x);return tn.useCallback(()=>{const A=C.collectionRef.current;if(!A)return[];const N=Array.from(A.querySelectorAll(`[${g}]`));return Array.from(C.itemMap.values()).sort(($,_)=>N.indexOf($.ref.current)-N.indexOf(_.ref.current))},[C.collectionRef,C.itemMap])}return[{Provider:a,Slot:h,ItemSlot:b},S,r]}function ze(t,e,{checkForDefaultPrevented:n=!0}={}){return function(o){if(t?.(o),n===!1||!o.defaultPrevented)return e?.(o)}}var Di=globalThis?.document?M.useLayoutEffect:()=>{},jD=o1[" useInsertionEffect ".trim().toString()]||Di;function Wc({prop:t,defaultProp:e,onChange:n=()=>{},caller:r}){const[o,l,a]=LD({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=ID(p)?p(t):p;g!==t&&a.current?.(g)}else l(p)},[c,t,l,a]);return[d,h]}function LD({defaultProp:t,onChange:e}){const[n,r]=M.useState(t),o=M.useRef(n),l=M.useRef(e);return jD(()=>{l.current=e},[e]),M.useEffect(()=>{o.current!==n&&(l.current?.(n),o.current=n)},[n,o]),[n,r,l]}function ID(t){return typeof t=="function"}function BD(t,e){return M.useReducer((n,r)=>e[n][r]??n,t)}var Ca=t=>{const{present:e,children:n}=t,r=VD(e),o=typeof n=="function"?n({present:r.isPresent}):M.Children.only(n),l=mn(r.ref,FD(o));return typeof n=="function"||r.isPresent?M.cloneElement(o,{ref:l}):null};Ca.displayName="Presence";function VD(t){const[e,n]=M.useState(),r=M.useRef(null),o=M.useRef(t),l=M.useRef("none"),a=t?"mounted":"unmounted",[c,d]=BD(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return M.useEffect(()=>{const h=Zu(r.current);l.current=c==="mounted"?h:"none"},[c]),Di(()=>{const h=r.current,p=o.current;if(p!==t){const v=l.current,b=Zu(h);t?d("MOUNT"):b==="none"||h?.display==="none"?d("UNMOUNT"):d(p&&v!==b?"ANIMATION_OUT":"UNMOUNT"),o.current=t}},[t,d]),Di(()=>{if(e){let h;const p=e.ownerDocument.defaultView??window,g=b=>{const x=Zu(r.current).includes(CSS.escape(b.animationName));if(b.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)})}},v=b=>{b.target===e&&(l.current=Zu(r.current))};return e.addEventListener("animationstart",v),e.addEventListener("animationcancel",g),e.addEventListener("animationend",g),()=>{p.clearTimeout(h),e.removeEventListener("animationstart",v),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 Zu(t){return t?.animationName||"none"}function FD(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 PD=o1[" useId ".trim().toString()]||(()=>{}),$D=0;function aa(t){const[e,n]=M.useState(PD());return Di(()=>{n(r=>r??String($D++))},[t]),t||(e?`radix-${e}`:"")}var HD=M.createContext(void 0);function U1(t){const e=M.useContext(HD);return t||e||"ltr"}function Jn(t){const e=M.useRef(t);return M.useEffect(()=>{e.current=t}),M.useMemo(()=>(...n)=>e.current?.(...n),[])}function UD(t,e=globalThis?.document){const n=Jn(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 qD="DismissableLayer",Vp="dismissableLayer.update",GD="dismissableLayer.pointerDownOutside",KD="dismissableLayer.focusOutside",Pb,q1=M.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),G1=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),v=p?.ownerDocument??globalThis?.document,[,b]=M.useState({}),S=mn(e,_=>g(_)),x=Array.from(h.layers),[C]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),E=x.indexOf(C),A=p?x.indexOf(p):-1,N=h.layersWithOutsidePointerEventsDisabled.size>0,D=A>=E,j=JD(_=>{const B=_.target,Z=[...h.branches].some(ie=>ie.contains(B));!D||Z||(o?.(_),a?.(_),_.defaultPrevented||c?.())},v),$=QD(_=>{const B=_.target;[...h.branches].some(ie=>ie.contains(B))||(l?.(_),a?.(_),_.defaultPrevented||c?.())},v);return UD(_=>{A===h.layers.size-1&&(r?.(_),!_.defaultPrevented&&c&&(_.preventDefault(),c()))},v),M.useEffect(()=>{if(p)return n&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(Pb=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(p)),h.layers.add(p),$b(),()=>{n&&h.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=Pb)}},[p,v,n,h]),M.useEffect(()=>()=>{p&&(h.layers.delete(p),h.layersWithOutsidePointerEventsDisabled.delete(p),$b())},[p,h]),M.useEffect(()=>{const _=()=>b({});return document.addEventListener(Vp,_),()=>document.removeEventListener(Vp,_)},[]),T.jsx(qt.div,{...d,ref:S,style:{pointerEvents:N?D?"auto":"none":void 0,...t.style},onFocusCapture:ze(t.onFocusCapture,$.onFocusCapture),onBlurCapture:ze(t.onBlurCapture,$.onBlurCapture),onPointerDownCapture:ze(t.onPointerDownCapture,j.onPointerDownCapture)})});G1.displayName=qD;var YD="DismissableLayerBranch",XD=M.forwardRef((t,e)=>{const n=M.useContext(q1),r=M.useRef(null),o=mn(e,r);return M.useEffect(()=>{const l=r.current;if(l)return n.branches.add(l),()=>{n.branches.delete(l)}},[n.branches]),T.jsx(qt.div,{...t,ref:o})});XD.displayName=YD;function JD(t,e=globalThis?.document){const n=Jn(t),r=M.useRef(!1),o=M.useRef(()=>{});return M.useEffect(()=>{const l=c=>{if(c.target&&!r.current){let d=function(){K1(GD,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 QD(t,e=globalThis?.document){const n=Jn(t),r=M.useRef(!1);return M.useEffect(()=>{const o=l=>{l.target&&!r.current&&K1(KD,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 $b(){const t=new CustomEvent(Vp);document.dispatchEvent(t)}function K1(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?$1(o,l):o.dispatchEvent(l)}var Kh="focusScope.autoFocusOnMount",Yh="focusScope.autoFocusOnUnmount",Hb={bubbles:!1,cancelable:!0},ZD="FocusScope",Y1=M.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:l,...a}=t,[c,d]=M.useState(null),h=Jn(o),p=Jn(l),g=M.useRef(null),v=mn(e,x=>d(x)),b=M.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;M.useEffect(()=>{if(r){let x=function(N){if(b.paused||!c)return;const D=N.target;c.contains(D)?g.current=D:vi(g.current,{select:!0})},C=function(N){if(b.paused||!c)return;const D=N.relatedTarget;D!==null&&(c.contains(D)||vi(g.current,{select:!0}))},E=function(N){if(document.activeElement===document.body)for(const j of N)j.removedNodes.length>0&&vi(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,b.paused]),M.useEffect(()=>{if(c){qb.add(b);const x=document.activeElement;if(!c.contains(x)){const E=new CustomEvent(Kh,Hb);c.addEventListener(Kh,h),c.dispatchEvent(E),E.defaultPrevented||(WD(i_(X1(c)),{select:!0}),document.activeElement===x&&vi(c))}return()=>{c.removeEventListener(Kh,h),setTimeout(()=>{const E=new CustomEvent(Yh,Hb);c.addEventListener(Yh,p),c.dispatchEvent(E),E.defaultPrevented||vi(x??document.body,{select:!0}),c.removeEventListener(Yh,p),qb.remove(b)},0)}}},[c,h,p,b]);const S=M.useCallback(x=>{if(!n&&!r||b.paused)return;const C=x.key==="Tab"&&!x.altKey&&!x.ctrlKey&&!x.metaKey,E=document.activeElement;if(C&&E){const A=x.currentTarget,[N,D]=e_(A);N&&D?!x.shiftKey&&E===D?(x.preventDefault(),n&&vi(N,{select:!0})):x.shiftKey&&E===N&&(x.preventDefault(),n&&vi(D,{select:!0})):E===A&&x.preventDefault()}},[n,r,b.paused]);return T.jsx(qt.div,{tabIndex:-1,...a,ref:v,onKeyDown:S})});Y1.displayName=ZD;function WD(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(vi(r,{select:e}),document.activeElement!==n)return}function e_(t){const e=X1(t),n=Ub(e,t),r=Ub(e.reverse(),t);return[n,r]}function X1(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 Ub(t,e){for(const n of t)if(!t_(n,{upTo:e}))return n}function t_(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 n_(t){return t instanceof HTMLInputElement&&"select"in t}function vi(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&n_(t)&&e&&t.select()}}var qb=r_();function r_(){let t=[];return{add(e){const n=t[0];e!==n&&n?.pause(),t=Gb(t,e),t.unshift(e)},remove(e){t=Gb(t,e),t[0]?.resume()}}}function Gb(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function i_(t){return t.filter(e=>e.tagName!=="A")}var o_="Portal",J1=M.forwardRef((t,e)=>{const{container:n,...r}=t,[o,l]=M.useState(!1);Di(()=>l(!0),[]);const a=n||o&&globalThis?.document?.body;return a?C1.createPortal(T.jsx(qt.div,{...r,ref:e}),a):null});J1.displayName=o_;var Xh=0;function s_(){M.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??Kb()),document.body.insertAdjacentElement("beforeend",t[1]??Kb()),Xh++,()=>{Xh===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),Xh--}},[])}function Kb(){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 Q1(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 l_(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 pc="right-scroll-bar-position",mc="width-before-scroll-bar",a_="with-scroll-bars-hidden",u_="--removed-body-scroll-bar-size";function Jh(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 f_=typeof window<"u"?M.useLayoutEffect:M.useEffect,Yb=new WeakMap;function d_(t,e){var n=c_(null,function(r){return t.forEach(function(o){return Jh(o,r)})});return f_(function(){var r=Yb.get(n);if(r){var o=new Set(r),l=new Set(t),a=n.current;o.forEach(function(c){l.has(c)||Jh(c,null)}),l.forEach(function(c){o.has(c)||Jh(c,a)})}Yb.set(n,t)},[t]),n}function h_(t){return t}function p_(t,e){e===void 0&&(e=h_);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 m_(t){t===void 0&&(t={});var e=p_(null);return e.options=lr({async:!0,ssr:!1},t),e}var Z1=function(t){var e=t.sideCar,n=Q1(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))};Z1.isSideCarExport=!0;function g_(t,e){return t.useMedium(e),Z1}var W1=m_(),Qh=function(){},ef=M.forwardRef(function(t,e){var n=M.useRef(null),r=M.useState({onScrollCapture:Qh,onWheelCapture:Qh,onTouchMoveCapture:Qh}),o=r[0],l=r[1],a=t.forwardProps,c=t.children,d=t.className,h=t.removeScrollBar,p=t.enabled,g=t.shards,v=t.sideCar,b=t.noRelative,S=t.noIsolation,x=t.inert,C=t.allowPinchZoom,E=t.as,A=E===void 0?"div":E,N=t.gapMode,D=Q1(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),j=v,$=d_([n,e]),_=lr(lr({},D),o);return M.createElement(M.Fragment,null,p&&M.createElement(j,{sideCar:W1,removeScrollBar:h,shards:g,noRelative:b,noIsolation:S,inert:x,setCallbacks:l,allowPinchZoom:!!C,lockRef:n,gapMode:N}),a?M.cloneElement(M.Children.only(c),lr(lr({},_),{ref:$})):M.createElement(A,lr({},_,{className:d,ref:$}),c))});ef.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};ef.classNames={fullWidth:mc,zeroRight:pc};var y_=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function v_(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=y_();return e&&t.setAttribute("nonce",e),t}function b_(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function S_(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var x_=function(){var t=0,e=null;return{add:function(n){t==0&&(e=v_())&&(b_(e,n),S_(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},w_=function(){var t=x_();return function(e,n){M.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},ew=function(){var t=w_(),e=function(n){var r=n.styles,o=n.dynamic;return t(r,o),null};return e},C_={left:0,top:0,right:0,gap:0},Zh=function(t){return parseInt(t||"",10)||0},M_=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[Zh(n),Zh(r),Zh(o)]},E_=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return C_;var e=M_(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])}},R_=ew(),ks="data-scroll-locked",T_=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(a_,` {
17
+ overflow: hidden `).concat(r,`;
18
+ padding-right: `).concat(c,"px ").concat(r,`;
19
+ }
20
+ body[`).concat(ks,`] {
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(pc,` {
34
+ right: `).concat(c,"px ").concat(r,`;
35
+ }
36
+
37
+ .`).concat(mc,` {
38
+ margin-right: `).concat(c,"px ").concat(r,`;
39
+ }
40
+
41
+ .`).concat(pc," .").concat(pc,` {
42
+ right: 0 `).concat(r,`;
43
+ }
44
+
45
+ .`).concat(mc," .").concat(mc,` {
46
+ margin-right: 0 `).concat(r,`;
47
+ }
48
+
49
+ body[`).concat(ks,`] {
50
+ `).concat(u_,": ").concat(c,`px;
51
+ }
52
+ `)},Xb=function(){var t=parseInt(document.body.getAttribute(ks)||"0",10);return isFinite(t)?t:0},A_=function(){M.useEffect(function(){return document.body.setAttribute(ks,(Xb()+1).toString()),function(){var t=Xb()-1;t<=0?document.body.removeAttribute(ks):document.body.setAttribute(ks,t.toString())}},[])},O_=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,o=r===void 0?"margin":r;A_();var l=M.useMemo(function(){return E_(o)},[o]);return M.createElement(R_,{styles:T_(l,!e,o,n?"":"!important")})},Fp=!1;if(typeof window<"u")try{var Wu=Object.defineProperty({},"passive",{get:function(){return Fp=!0,!0}});window.addEventListener("test",Wu,Wu),window.removeEventListener("test",Wu,Wu)}catch{Fp=!1}var Ss=Fp?{passive:!1}:!1,k_=function(t){return t.tagName==="TEXTAREA"},tw=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!k_(t)&&n[e]==="visible")},N_=function(t){return tw(t,"overflowY")},D_=function(t){return tw(t,"overflowX")},Jb=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=nw(t,r);if(o){var l=rw(t,r),a=l[1],c=l[2];if(a>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},__=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},z_=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},nw=function(t,e){return t==="v"?N_(e):D_(e)},rw=function(t,e){return t==="v"?__(e):z_(e)},j_=function(t,e){return t==="h"&&e==="rtl"?-1:1},L_=function(t,e,n,r,o){var l=j_(t,window.getComputedStyle(e).direction),a=l*r,c=n.target,d=e.contains(c),h=!1,p=a>0,g=0,v=0;do{if(!c)break;var b=rw(t,c),S=b[0],x=b[1],C=b[2],E=x-C-l*S;(S||E)&&nw(t,c)&&(g+=E,v+=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(v)<1)&&(h=!0),h},ec=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},Qb=function(t){return[t.deltaX,t.deltaY]},Zb=function(t){return t&&"current"in t?t.current:t},I_=function(t,e){return t[0]===e[0]&&t[1]===e[1]},B_=function(t){return`
53
+ .block-interactivity-`.concat(t,` {pointer-events: none;}
54
+ .allow-interactivity-`).concat(t,` {pointer-events: all;}
55
+ `)},V_=0,xs=[];function F_(t){var e=M.useRef([]),n=M.useRef([0,0]),r=M.useRef(),o=M.useState(V_++)[0],l=M.useState(ew)[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=l_([t.lockRef.current],(t.shards||[]).map(Zb),!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=ec(x),A=n.current,N="deltaX"in x?x.deltaX:A[0]-E[0],D="deltaY"in x?x.deltaY:A[1]-E[1],j,$=x.target,_=Math.abs(N)>Math.abs(D)?"h":"v";if("touches"in x&&_==="h"&&$.type==="range")return!1;var B=window.getSelection(),Z=B&&B.anchorNode,ie=Z?Z===$||Z.contains($):!1;if(ie)return!1;var pe=Jb(_,$);if(!pe)return!0;if(pe?j=_:(j=_==="v"?"h":"v",pe=Jb(_,$)),!pe)return!1;if(!r.current&&"changedTouches"in x&&(N||D)&&(r.current=j),!j)return!0;var se=r.current||j;return L_(se,C,x,se==="h"?N:D)},[]),d=M.useCallback(function(x){var C=x;if(!(!xs.length||xs[xs.length-1]!==l)){var E="deltaY"in C?Qb(C):ec(C),A=e.current.filter(function(j){return j.name===C.type&&(j.target===C.target||C.target===j.shadowParent)&&I_(j.delta,E)})[0];if(A&&A.should){C.cancelable&&C.preventDefault();return}if(!A){var N=(a.current.shards||[]).map(Zb).filter(Boolean).filter(function(j){return j.contains(C.target)}),D=N.length>0?c(C,N[0]):!a.current.noIsolation;D&&C.cancelable&&C.preventDefault()}}},[]),h=M.useCallback(function(x,C,E,A){var N={name:x,delta:C,target:E,should:A,shadowParent:P_(E)};e.current.push(N),setTimeout(function(){e.current=e.current.filter(function(D){return D!==N})},1)},[]),p=M.useCallback(function(x){n.current=ec(x),r.current=void 0},[]),g=M.useCallback(function(x){h(x.type,Qb(x),x.target,c(x,t.lockRef.current))},[]),v=M.useCallback(function(x){h(x.type,ec(x),x.target,c(x,t.lockRef.current))},[]);M.useEffect(function(){return xs.push(l),t.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:v}),document.addEventListener("wheel",d,Ss),document.addEventListener("touchmove",d,Ss),document.addEventListener("touchstart",p,Ss),function(){xs=xs.filter(function(x){return x!==l}),document.removeEventListener("wheel",d,Ss),document.removeEventListener("touchmove",d,Ss),document.removeEventListener("touchstart",p,Ss)}},[]);var b=t.removeScrollBar,S=t.inert;return M.createElement(M.Fragment,null,S?M.createElement(l,{styles:B_(o)}):null,b?M.createElement(O_,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function P_(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const $_=g_(W1,F_);var iw=M.forwardRef(function(t,e){return M.createElement(ef,lr({},t,{ref:e,sideCar:$_}))});iw.classNames=ef.classNames;var H_=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},ws=new WeakMap,tc=new WeakMap,nc={},Wh=0,ow=function(t){return t&&(t.host||ow(t.parentNode))},U_=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=ow(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})},q_=function(t,e,n,r){var o=U_(e,Array.isArray(t)?t:[t]);nc[n]||(nc[n]=new WeakMap);var l=nc[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(v){if(c.has(v))p(v);else try{var b=v.getAttribute(r),S=b!==null&&b!=="false",x=(ws.get(v)||0)+1,C=(l.get(v)||0)+1;ws.set(v,x),l.set(v,C),a.push(v),x===1&&S&&tc.set(v,!0),C===1&&v.setAttribute(n,"true"),S||v.setAttribute(r,"true")}catch(E){console.error("aria-hidden: cannot operate on ",v,E)}})};return p(e),c.clear(),Wh++,function(){a.forEach(function(g){var v=ws.get(g)-1,b=l.get(g)-1;ws.set(g,v),l.set(g,b),v||(tc.has(g)||g.removeAttribute(r),tc.delete(g)),b||g.removeAttribute(n)}),Wh--,Wh||(ws=new WeakMap,ws=new WeakMap,tc=new WeakMap,nc={})}},G_=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),o=H_(t);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),q_(r,o,n,"aria-hidden")):function(){return null}},ep={exports:{}},tp={};var Wb;function K_(){if(Wb)return tp;Wb=1;var t=xa();function e(g,v){return g===v&&(g!==0||1/g===1/v)||g!==g&&v!==v}var n=typeof Object.is=="function"?Object.is:e,r=t.useState,o=t.useEffect,l=t.useLayoutEffect,a=t.useDebugValue;function c(g,v){var b=v(),S=r({inst:{value:b,getSnapshot:v}}),x=S[0].inst,C=S[1];return l(function(){x.value=b,x.getSnapshot=v,d(x)&&C({inst:x})},[g,b,v]),o(function(){return d(x)&&C({inst:x}),g(function(){d(x)&&C({inst:x})})},[g]),a(b),b}function d(g){var v=g.getSnapshot;g=g.value;try{var b=v();return!n(g,b)}catch{return!0}}function h(g,v){return v()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:c;return tp.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:p,tp}var eS;function sw(){return eS||(eS=1,ep.exports=K_()),ep.exports}var lw=sw();function Y_(t){const[e,n]=M.useState(void 0);return Di(()=>{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 X_=["top","right","bottom","left"],_i=Math.min,Cn=Math.max,Cc=Math.round,rc=Math.floor,ur=t=>({x:t,y:t}),J_={left:"right",right:"left",bottom:"top",top:"bottom"};function Pp(t,e,n){return Cn(t,_i(e,n))}function Fr(t,e){return typeof t=="function"?t(e):t}function Pr(t){return t.split("-")[0]}function Hs(t){return t.split("-")[1]}function Mm(t){return t==="x"?"y":"x"}function Em(t){return t==="y"?"height":"width"}function ar(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function Rm(t){return Mm(ar(t))}function Q_(t,e,n){n===void 0&&(n=!1);const r=Hs(t),o=Rm(t),l=Em(o);let a=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[l]>e.floating[l]&&(a=Mc(a)),[a,Mc(a)]}function Z_(t){const e=Mc(t);return[$p(t),e,$p(e)]}function $p(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const tS=["left","right"],nS=["right","left"],W_=["top","bottom"],e2=["bottom","top"];function t2(t,e,n){switch(t){case"top":case"bottom":return n?e?nS:tS:e?tS:nS;case"left":case"right":return e?W_:e2;default:return[]}}function n2(t,e,n,r){const o=Hs(t);let l=t2(Pr(t),n==="start",r);return o&&(l=l.map(a=>a+"-"+o),e&&(l=l.concat(l.map($p)))),l}function Mc(t){const e=Pr(t);return J_[e]+t.slice(e.length)}function r2(t){return{top:0,right:0,bottom:0,left:0,...t}}function aw(t){return typeof t!="number"?r2(t):{top:t,right:t,bottom:t,left:t}}function Ec(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 rS(t,e,n){let{reference:r,floating:o}=t;const l=ar(e),a=Rm(e),c=Em(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,v=r[c]/2-o[c]/2;let b;switch(d){case"top":b={x:p,y:r.y-o.height};break;case"bottom":b={x:p,y:r.y+r.height};break;case"right":b={x:r.x+r.width,y:g};break;case"left":b={x:r.x-o.width,y:g};break;default:b={x:r.x,y:r.y}}switch(Hs(e)){case"start":b[a]-=v*(n&&h?-1:1);break;case"end":b[a]+=v*(n&&h?-1:1);break}return b}async function i2(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:v=!1,padding:b=0}=Fr(e,t),S=aw(b),C=c[v?g==="floating"?"reference":"floating":g],E=Ec(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,N=await(l.getOffsetParent==null?void 0:l.getOffsetParent(c.floating)),D=await(l.isElement==null?void 0:l.isElement(N))?await(l.getScale==null?void 0:l.getScale(N))||{x:1,y:1}:{x:1,y:1},j=Ec(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:A,offsetParent:N,strategy:d}):A);return{top:(E.top-j.top+S.top)/D.y,bottom:(j.bottom-E.bottom+S.bottom)/D.y,left:(E.left-j.left+S.left)/D.x,right:(j.right-E.right+S.right)/D.x}}const o2=50,s2=async(t,e,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:l=[],platform:a}=n,c=a.detectOverflow?a:{...a,detectOverflow:i2},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}=rS(h,r,d),v=r,b=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:N,y:D,data:j,reset:$}=await A({x:p,y:g,initialPlacement:r,placement:v,strategy:o,middlewareData:S,rects:h,platform:c,elements:{reference:t,floating:e}});p=N??p,g=D??g,S[E]={...S[E],...j},$&&b<o2&&(b++,typeof $=="object"&&($.placement&&(v=$.placement),$.rects&&(h=$.rects===!0?await a.getElementRects({reference:t,floating:e,strategy:o}):$.rects),{x:p,y:g}=rS(h,v,d)),x=-1)}return{x:p,y:g,placement:v,strategy:o,middlewareData:S}},l2=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=aw(p),v={x:n,y:r},b=Rm(o),S=Em(b),x=await a.getDimensions(h),C=b==="y",E=C?"top":"left",A=C?"bottom":"right",N=C?"clientHeight":"clientWidth",D=l.reference[S]+l.reference[b]-v[b]-l.floating[S],j=v[b]-l.reference[b],$=await(a.getOffsetParent==null?void 0:a.getOffsetParent(h));let _=$?$[N]:0;(!_||!await(a.isElement==null?void 0:a.isElement($)))&&(_=c.floating[N]||l.floating[S]);const B=D/2-j/2,Z=_/2-x[S]/2-1,ie=_i(g[E],Z),pe=_i(g[A],Z),se=ie,be=_-x[S]-pe,te=_/2-x[S]/2+B,ye=Pp(se,te,be),V=!d.arrow&&Hs(o)!=null&&te!==ye&&l.reference[S]/2-(te<se?ie:pe)-x[S]/2<0,U=V?te<se?te-se:te-be:0;return{[b]:v[b]+U,data:{[b]:ye,centerOffset:te-ye-U,...V&&{alignmentOffset:U}},reset:V}}}),a2=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:v,fallbackStrategy:b="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),N=Pr(c)===c,D=await(d.isRTL==null?void 0:d.isRTL(h.floating)),j=v||(N||!x?[Mc(c)]:Z_(c)),$=S!=="none";!v&&$&&j.push(...n2(c,x,S,D));const _=[c,...j],B=await d.detectOverflow(e,C),Z=[];let ie=((r=l.flip)==null?void 0:r.overflows)||[];if(p&&Z.push(B[E]),g){const te=Q_(o,a,D);Z.push(B[te[0]],B[te[1]])}if(ie=[...ie,{placement:o,overflows:Z}],!Z.every(te=>te<=0)){var pe,se;const te=(((pe=l.flip)==null?void 0:pe.index)||0)+1,ye=_[te];if(ye&&(!(g==="alignment"?A!==ar(ye):!1)||ie.every(L=>ar(L.placement)===A?L.overflows[0]>0:!0)))return{data:{index:te,overflows:ie},reset:{placement:ye}};let V=(se=ie.filter(U=>U.overflows[0]<=0).sort((U,L)=>U.overflows[1]-L.overflows[1])[0])==null?void 0:se.placement;if(!V)switch(b){case"bestFit":{var be;const U=(be=ie.filter(L=>{if($){const q=ar(L.placement);return q===A||q==="y"}return!0}).map(L=>[L.placement,L.overflows.filter(q=>q>0).reduce((q,Y)=>q+Y,0)]).sort((L,q)=>L[1]-q[1])[0])==null?void 0:be[0];U&&(V=U);break}case"initialPlacement":V=c;break}if(o!==V)return{reset:{placement:V}}}return{}}}};function iS(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function oS(t){return X_.some(e=>t[e]>=0)}const u2=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=iS(a,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:oS(c)}}}case"escaped":{const a=await r.detectOverflow(e,{...l,altBoundary:!0}),c=iS(a,n.floating);return{data:{escapedOffsets:c,escaped:oS(c)}}}default:return{}}}}},uw=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=Hs(n),d=ar(n)==="y",h=uw.has(a)?-1:1,p=l&&d?-1:1,g=Fr(e,t);let{mainAxis:v,crossAxis:b,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"&&(b=c==="end"?S*-1:S),d?{x:b*p,y:v*h}:{x:v*h,y:b*p}}const f2=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}}}}},d2=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:N}=E;return{x:A,y:N}}},...h}=Fr(t,e),p={x:n,y:r},g=await l.detectOverflow(e,h),v=ar(Pr(o)),b=Mm(v);let S=p[b],x=p[v];if(a){const E=b==="y"?"top":"left",A=b==="y"?"bottom":"right",N=S+g[E],D=S-g[A];S=Pp(N,S,D)}if(c){const E=v==="y"?"top":"left",A=v==="y"?"bottom":"right",N=x+g[E],D=x-g[A];x=Pp(N,x,D)}const C=d.fn({...e,[b]:S,[v]:x});return{...C,data:{x:C.x-n,y:C.y-r,enabled:{[b]:a,[v]:c}}}}}},h2=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),v=Mm(g);let b=p[v],S=p[g];const x=Fr(c,e),C=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(d){const N=v==="y"?"height":"width",D=l.reference[v]-l.floating[N]+C.mainAxis,j=l.reference[v]+l.reference[N]-C.mainAxis;b<D?b=D:b>j&&(b=j)}if(h){var E,A;const N=v==="y"?"width":"height",D=uw.has(Pr(o)),j=l.reference[g]-l.floating[N]+(D&&((E=a.offset)==null?void 0:E[g])||0)+(D?0:C.crossAxis),$=l.reference[g]+l.reference[N]+(D?0:((A=a.offset)==null?void 0:A[g])||0)-(D?C.crossAxis:0);S<j?S=j:S>$&&(S=$)}return{[v]:b,[g]:S}}}},p2=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),v=Hs(o),b=ar(o)==="y",{width:S,height:x}=l.floating;let C,E;g==="top"||g==="bottom"?(C=g,E=v===(await(a.isRTL==null?void 0:a.isRTL(c.floating))?"start":"end")?"left":"right"):(E=g,C=v==="end"?"top":"bottom");const A=x-p.top-p.bottom,N=S-p.left-p.right,D=_i(x-p[C],A),j=_i(S-p[E],N),$=!e.middlewareData.shift;let _=D,B=j;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(B=N),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(_=A),$&&!v){const ie=Cn(p.left,0),pe=Cn(p.right,0),se=Cn(p.top,0),be=Cn(p.bottom,0);b?B=S-2*(ie!==0||pe!==0?ie+pe:Cn(p.left,p.right)):_=x-2*(se!==0||be!==0?se+be:Cn(p.top,p.bottom))}await d({...e,availableWidth:B,availableHeight:_});const Z=await a.getDimensions(c.floating);return S!==Z.width||x!==Z.height?{reset:{rects:!0}}:{}}}};function tf(){return typeof window<"u"}function Us(t){return cw(t)?(t.nodeName||"").toLowerCase():"#document"}function En(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function dr(t){var e;return(e=(cw(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function cw(t){return tf()?t instanceof Node||t instanceof En(t).Node:!1}function Qn(t){return tf()?t instanceof Element||t instanceof En(t).Element:!1}function $r(t){return tf()?t instanceof HTMLElement||t instanceof En(t).HTMLElement:!1}function sS(t){return!tf()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof En(t).ShadowRoot}function Ma(t){const{overflow:e,overflowX:n,overflowY:r,display:o}=Zn(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&o!=="inline"&&o!=="contents"}function m2(t){return/^(table|td|th)$/.test(Us(t))}function nf(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const g2=/transform|translate|scale|rotate|perspective|filter/,y2=/paint|layout|strict|content/,lo=t=>!!t&&t!=="none";let np;function Tm(t){const e=Qn(t)?Zn(t):t;return lo(e.transform)||lo(e.translate)||lo(e.scale)||lo(e.rotate)||lo(e.perspective)||!Am()&&(lo(e.backdropFilter)||lo(e.filter))||g2.test(e.willChange||"")||y2.test(e.contain||"")}function v2(t){let e=zi(t);for(;$r(e)&&!js(e);){if(Tm(e))return e;if(nf(e))return null;e=zi(e)}return null}function Am(){return np==null&&(np=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),np}function js(t){return/^(html|body|#document)$/.test(Us(t))}function Zn(t){return En(t).getComputedStyle(t)}function rf(t){return Qn(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function zi(t){if(Us(t)==="html")return t;const e=t.assignedSlot||t.parentNode||sS(t)&&t.host||dr(t);return sS(e)?e.host:e}function fw(t){const e=zi(t);return js(e)?t.ownerDocument?t.ownerDocument.body:t.body:$r(e)&&Ma(e)?e:fw(e)}function ua(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const o=fw(t),l=o===((r=t.ownerDocument)==null?void 0:r.body),a=En(o);if(l){const c=Hp(a);return e.concat(a,a.visualViewport||[],Ma(o)?o:[],c&&n?ua(c):[])}else return e.concat(o,ua(o,[],n))}function Hp(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function dw(t){const e=Zn(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=Cc(n)!==l||Cc(r)!==a;return c&&(n=l,r=a),{width:n,height:r,$:c}}function Om(t){return Qn(t)?t:t.contextElement}function Ns(t){const e=Om(t);if(!$r(e))return ur(1);const n=e.getBoundingClientRect(),{width:r,height:o,$:l}=dw(e);let a=(l?Cc(n.width):n.width)/r,c=(l?Cc(n.height):n.height)/o;return(!a||!Number.isFinite(a))&&(a=1),(!c||!Number.isFinite(c))&&(c=1),{x:a,y:c}}const b2=ur(0);function hw(t){const e=En(t);return!Am()||!e.visualViewport?b2:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function S2(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==En(t)?!1:e}function vo(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const o=t.getBoundingClientRect(),l=Om(t);let a=ur(1);e&&(r?Qn(r)&&(a=Ns(r)):a=Ns(t));const c=S2(l,n,r)?hw(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 v=En(l),b=r&&Qn(r)?En(r):r;let S=v,x=Hp(S);for(;x&&r&&b!==S;){const C=Ns(x),E=x.getBoundingClientRect(),A=Zn(x),N=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+=N,h+=D,S=En(x),x=Hp(S)}}return Ec({width:p,height:g,x:d,y:h})}function of(t,e){const n=rf(t).scrollLeft;return e?e.left+n:vo(dr(t)).left+n}function pw(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-of(t,n),o=n.top+e.scrollTop;return{x:r,y:o}}function x2(t){let{elements:e,rect:n,offsetParent:r,strategy:o}=t;const l=o==="fixed",a=dr(r),c=e?nf(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)&&((Us(r)!=="body"||Ma(a))&&(d=rf(r)),g)){const b=vo(r);h=Ns(r),p.x=b.x+r.clientLeft,p.y=b.y+r.clientTop}const v=a&&!g&&!l?pw(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+v.x,y:n.y*h.y-d.scrollTop*h.y+p.y+v.y}}function w2(t){return Array.from(t.getClientRects())}function C2(t){const e=dr(t),n=rf(t),r=t.ownerDocument.body,o=Cn(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),l=Cn(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+of(t);const c=-n.scrollTop;return Zn(r).direction==="rtl"&&(a+=Cn(e.clientWidth,r.clientWidth)-o),{width:o,height:l,x:a,y:c}}const lS=25;function M2(t,e){const n=En(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=Am();(!p||p&&e==="fixed")&&(c=o.offsetLeft,d=o.offsetTop)}const h=of(r);if(h<=0){const p=r.ownerDocument,g=p.body,v=getComputedStyle(g),b=p.compatMode==="CSS1Compat"&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,S=Math.abs(r.clientWidth-g.clientWidth-b);S<=lS&&(l-=S)}else h<=lS&&(l+=h);return{width:l,height:a,x:c,y:d}}function E2(t,e){const n=vo(t,!0,e==="fixed"),r=n.top+t.clientTop,o=n.left+t.clientLeft,l=$r(t)?Ns(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 aS(t,e,n){let r;if(e==="viewport")r=M2(t,n);else if(e==="document")r=C2(dr(t));else if(Qn(e))r=E2(e,n);else{const o=hw(t);r={x:e.x-o.x,y:e.y-o.y,width:e.width,height:e.height}}return Ec(r)}function mw(t,e){const n=zi(t);return n===e||!Qn(n)||js(n)?!1:Zn(n).position==="fixed"||mw(n,e)}function R2(t,e){const n=e.get(t);if(n)return n;let r=ua(t,[],!1).filter(c=>Qn(c)&&Us(c)!=="body"),o=null;const l=Zn(t).position==="fixed";let a=l?zi(t):t;for(;Qn(a)&&!js(a);){const c=Zn(a),d=Tm(a);!d&&c.position==="fixed"&&(o=null),(l?!d&&!o:!d&&c.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||Ma(a)&&!d&&mw(t,a))?r=r.filter(p=>p!==a):o=c,a=zi(a)}return e.set(t,r),r}function T2(t){let{element:e,boundary:n,rootBoundary:r,strategy:o}=t;const a=[...n==="clippingAncestors"?nf(e)?[]:R2(e,this._c):[].concat(n),r],c=aS(e,a[0],o);let d=c.top,h=c.right,p=c.bottom,g=c.left;for(let v=1;v<a.length;v++){const b=aS(e,a[v],o);d=Cn(b.top,d),h=_i(b.right,h),p=_i(b.bottom,p),g=Cn(b.left,g)}return{width:h-g,height:p-d,x:g,y:d}}function A2(t){const{width:e,height:n}=dw(t);return{width:e,height:n}}function O2(t,e,n){const r=$r(e),o=dr(e),l=n==="fixed",a=vo(t,!0,l,e);let c={scrollLeft:0,scrollTop:0};const d=ur(0);function h(){d.x=of(o)}if(r||!r&&!l)if((Us(e)!=="body"||Ma(o))&&(c=rf(e)),r){const b=vo(e,!0,l,e);d.x=b.x+e.clientLeft,d.y=b.y+e.clientTop}else o&&h();l&&!r&&o&&h();const p=o&&!r&&!l?pw(o,c):ur(0),g=a.left+c.scrollLeft-d.x-p.x,v=a.top+c.scrollTop-d.y-p.y;return{x:g,y:v,width:a.width,height:a.height}}function rp(t){return Zn(t).position==="static"}function uS(t,e){if(!$r(t)||Zn(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return dr(t)===n&&(n=n.ownerDocument.body),n}function gw(t,e){const n=En(t);if(nf(t))return n;if(!$r(t)){let o=zi(t);for(;o&&!js(o);){if(Qn(o)&&!rp(o))return o;o=zi(o)}return n}let r=uS(t,e);for(;r&&m2(r)&&rp(r);)r=uS(r,e);return r&&js(r)&&rp(r)&&!Tm(r)?n:r||v2(t)||n}const k2=async function(t){const e=this.getOffsetParent||gw,n=this.getDimensions,r=await n(t.floating);return{reference:O2(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function N2(t){return Zn(t).direction==="rtl"}const D2={convertOffsetParentRelativeRectToViewportRelativeRect:x2,getDocumentElement:dr,getClippingRect:T2,getOffsetParent:gw,getElementRects:k2,getClientRects:w2,getDimensions:A2,getScale:Ns,isElement:Qn,isRTL:N2};function yw(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function _2(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:v,height:b}=h;if(c||e(),!v||!b)return;const S=rc(g),x=rc(o.clientWidth-(p+v)),C=rc(o.clientHeight-(g+b)),E=rc(p),N={rootMargin:-S+"px "+-x+"px "+-C+"px "+-E+"px",threshold:Cn(0,_i(1,d))||1};let D=!0;function j($){const _=$[0].intersectionRatio;if(_!==d){if(!D)return a();_?a(!1,_):r=setTimeout(()=>{a(!1,1e-7)},1e3)}_===1&&!yw(h,t.getBoundingClientRect())&&a(),D=!1}try{n=new IntersectionObserver(j,{...N,root:o.ownerDocument})}catch{n=new IntersectionObserver(j,N)}n.observe(t)}return a(!0),l}function z2(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=Om(t),p=o||l?[...h?ua(h):[],...e?ua(e):[]]:[];p.forEach(E=>{o&&E.addEventListener("scroll",n,{passive:!0}),l&&E.addEventListener("resize",n)});const g=h&&c?_2(h,n):null;let v=-1,b=null;a&&(b=new ResizeObserver(E=>{let[A]=E;A&&A.target===h&&b&&e&&(b.unobserve(e),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var N;(N=b)==null||N.observe(e)})),n()}),h&&!d&&b.observe(h),e&&b.observe(e));let S,x=d?vo(t):null;d&&C();function C(){const E=vo(t);x&&!yw(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=b)==null||E.disconnect(),b=null,d&&cancelAnimationFrame(S)}}const j2=f2,L2=d2,I2=a2,B2=p2,V2=u2,cS=l2,F2=h2,P2=(t,e,n)=>{const r=new Map,o={platform:D2,...n},l={...o.platform,_c:r};return s2(t,e,{...o,platform:l})};var $2=typeof document<"u",H2=function(){},gc=$2?M.useLayoutEffect:H2;function Rc(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(!Rc(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)&&!Rc(t[l],e[l]))return!1}return!0}return t!==t&&e!==e}function vw(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function fS(t,e){const n=vw(t);return Math.round(e*n)/n}function ip(t){const e=M.useRef(t);return gc(()=>{e.current=t}),e}function U2(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}),[v,b]=M.useState(r);Rc(v,r)||b(r);const[S,x]=M.useState(null),[C,E]=M.useState(null),A=M.useCallback(L=>{L!==$.current&&($.current=L,x(L))},[]),N=M.useCallback(L=>{L!==_.current&&(_.current=L,E(L))},[]),D=l||S,j=a||C,$=M.useRef(null),_=M.useRef(null),B=M.useRef(p),Z=d!=null,ie=ip(d),pe=ip(o),se=ip(h),be=M.useCallback(()=>{if(!$.current||!_.current)return;const L={placement:e,strategy:n,middleware:v};pe.current&&(L.platform=pe.current),P2($.current,_.current,L).then(q=>{const Y={...q,isPositioned:se.current!==!1};te.current&&!Rc(B.current,Y)&&(B.current=Y,wa.flushSync(()=>{g(Y)}))})},[v,e,n,pe,se]);gc(()=>{h===!1&&B.current.isPositioned&&(B.current.isPositioned=!1,g(L=>({...L,isPositioned:!1})))},[h]);const te=M.useRef(!1);gc(()=>(te.current=!0,()=>{te.current=!1}),[]),gc(()=>{if(D&&($.current=D),j&&(_.current=j),D&&j){if(ie.current)return ie.current(D,j,be);be()}},[D,j,be,ie,Z]);const ye=M.useMemo(()=>({reference:$,floating:_,setReference:A,setFloating:N}),[A,N]),V=M.useMemo(()=>({reference:D,floating:j}),[D,j]),U=M.useMemo(()=>{const L={position:n,left:0,top:0};if(!V.floating)return L;const q=fS(V.floating,p.x),Y=fS(V.floating,p.y);return c?{...L,transform:"translate("+q+"px, "+Y+"px)",...vw(V.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:q,top:Y}},[n,c,V.floating,p.x,p.y]);return M.useMemo(()=>({...p,update:be,refs:ye,elements:V,floatingStyles:U}),[p,be,ye,V,U])}const q2=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?cS({element:r.current,padding:o}).fn(n):{}:r?cS({element:r,padding:o}).fn(n):{}}}},G2=(t,e)=>{const n=j2(t);return{name:n.name,fn:n.fn,options:[t,e]}},K2=(t,e)=>{const n=L2(t);return{name:n.name,fn:n.fn,options:[t,e]}},Y2=(t,e)=>({fn:F2(t).fn,options:[t,e]}),X2=(t,e)=>{const n=I2(t);return{name:n.name,fn:n.fn,options:[t,e]}},J2=(t,e)=>{const n=B2(t);return{name:n.name,fn:n.fn,options:[t,e]}},Q2=(t,e)=>{const n=V2(t);return{name:n.name,fn:n.fn,options:[t,e]}},Z2=(t,e)=>{const n=q2(t);return{name:n.name,fn:n.fn,options:[t,e]}};var W2="Arrow",bw=M.forwardRef((t,e)=>{const{children:n,width:r=10,height:o=5,...l}=t;return T.jsx(qt.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"})})});bw.displayName=W2;var ez=bw,km="Popper",[Sw,xw]=$s(km),[tz,ww]=Sw(km),Cw=t=>{const{__scopePopper:e,children:n}=t,[r,o]=M.useState(null);return T.jsx(tz,{scope:e,anchor:r,onAnchorChange:o,children:n})};Cw.displayName=km;var Mw="PopperAnchor",Ew=M.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...o}=t,l=ww(Mw,n),a=M.useRef(null),c=mn(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(qt.div,{...o,ref:c})});Ew.displayName=Mw;var Nm="PopperContent",[nz,rz]=Sw(Nm),Rw=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:v=!1,updatePositionStrategy:b="optimized",onPlaced:S,...x}=t,C=ww(Nm,n),[E,A]=M.useState(null),N=mn(e,me=>A(me)),[D,j]=M.useState(null),$=Y_(D),_=$?.width??0,B=$?.height??0,Z=r+(l!=="center"?"-"+l:""),ie=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},pe=Array.isArray(h)?h:[h],se=pe.length>0,be={padding:ie,boundary:pe.filter(oz),altBoundary:se},{refs:te,floatingStyles:ye,placement:V,isPositioned:U,middlewareData:L}=U2({strategy:"fixed",placement:Z,whileElementsMounted:(...me)=>z2(...me,{animationFrame:b==="always"}),elements:{reference:C.anchor},middleware:[G2({mainAxis:o+B,alignmentAxis:a}),d&&K2({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?Y2():void 0,...be}),d&&X2({...be}),J2({...be,apply:({elements:me,rects:Ke,availableWidth:Ee,availableHeight:St})=>{const{width:ct,height:Jt}=Ke.reference,Qt=me.floating.style;Qt.setProperty("--radix-popper-available-width",`${Ee}px`),Qt.setProperty("--radix-popper-available-height",`${St}px`),Qt.setProperty("--radix-popper-anchor-width",`${ct}px`),Qt.setProperty("--radix-popper-anchor-height",`${Jt}px`)}}),D&&Z2({element:D,padding:c}),sz({arrowWidth:_,arrowHeight:B}),v&&Q2({strategy:"referenceHidden",...be})]}),[q,Y]=Ow(V),k=Jn(S);Di(()=>{U&&k?.()},[U,k]);const K=L.arrow?.x,W=L.arrow?.y,ne=L.arrow?.centerOffset!==0,[le,ae]=M.useState();return Di(()=>{E&&ae(window.getComputedStyle(E).zIndex)},[E]),T.jsx("div",{ref:te.setFloating,"data-radix-popper-content-wrapper":"",style:{...ye,transform:U?ye.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:le,"--radix-popper-transform-origin":[L.transformOrigin?.x,L.transformOrigin?.y].join(" "),...L.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:T.jsx(nz,{scope:n,placedSide:q,onArrowChange:j,arrowX:K,arrowY:W,shouldHideArrow:ne,children:T.jsx(qt.div,{"data-side":q,"data-align":Y,...x,ref:N,style:{...x.style,animation:U?void 0:"none"}})})})});Rw.displayName=Nm;var Tw="PopperArrow",iz={top:"bottom",right:"left",bottom:"top",left:"right"},Aw=M.forwardRef(function(e,n){const{__scopePopper:r,...o}=e,l=rz(Tw,r),a=iz[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(ez,{...o,ref:n,style:{...o.style,display:"block"}})})});Aw.displayName=Tw;function oz(t){return t!==null}var sz=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]=Ow(n),g={start:"0%",center:"50%",end:"100%"}[p],v=(o.arrow?.x??0)+c/2,b=(o.arrow?.y??0)+d/2;let S="",x="";return h==="bottom"?(S=a?g:`${v}px`,x=`${-d}px`):h==="top"?(S=a?g:`${v}px`,x=`${r.floating.height+d}px`):h==="right"?(S=`${-d}px`,x=a?g:`${b}px`):h==="left"&&(S=`${r.floating.width+d}px`,x=a?g:`${b}px`),{data:{x:S,y:x}}}});function Ow(t){const[e,n="center"]=t.split("-");return[e,n]}var kw=Cw,lz=Ew,az=Rw,uz=Aw,op="rovingFocusGroup.onEntryFocus",cz={bubbles:!1,cancelable:!0},Ea="RovingFocusGroup",[Up,Nw,fz]=H1(Ea),[dz,Dw]=$s(Ea,[fz]),[hz,pz]=dz(Ea),_w=M.forwardRef((t,e)=>T.jsx(Up.Provider,{scope:t.__scopeRovingFocusGroup,children:T.jsx(Up.Slot,{scope:t.__scopeRovingFocusGroup,children:T.jsx(mz,{...t,ref:e})})}));_w.displayName=Ea;var mz=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,v=M.useRef(null),b=mn(e,v),S=U1(l),[x,C]=Wc({prop:a,defaultProp:c??null,onChange:d,caller:Ea}),[E,A]=M.useState(!1),N=Jn(h),D=Nw(n),j=M.useRef(!1),[$,_]=M.useState(0);return M.useEffect(()=>{const B=v.current;if(B)return B.addEventListener(op,N),()=>B.removeEventListener(op,N)},[N]),T.jsx(hz,{scope:n,orientation:r,dir:S,loop:o,currentTabStopId:x,onItemFocus:M.useCallback(B=>C(B),[C]),onItemShiftTab:M.useCallback(()=>A(!0),[]),onFocusableItemAdd:M.useCallback(()=>_(B=>B+1),[]),onFocusableItemRemove:M.useCallback(()=>_(B=>B-1),[]),children:T.jsx(qt.div,{tabIndex:E||$===0?-1:0,"data-orientation":r,...g,ref:b,style:{outline:"none",...t.style},onMouseDown:ze(t.onMouseDown,()=>{j.current=!0}),onFocus:ze(t.onFocus,B=>{const Z=!j.current;if(B.target===B.currentTarget&&Z&&!E){const ie=new CustomEvent(op,cz);if(B.currentTarget.dispatchEvent(ie),!ie.defaultPrevented){const pe=D().filter(V=>V.focusable),se=pe.find(V=>V.active),be=pe.find(V=>V.id===x),ye=[se,be,...pe].filter(Boolean).map(V=>V.ref.current);Lw(ye,p)}}j.current=!1}),onBlur:ze(t.onBlur,()=>A(!1))})})}),zw="RovingFocusGroupItem",jw=M.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:l,children:a,...c}=t,d=aa(),h=l||d,p=pz(zw,n),g=p.currentTabStopId===h,v=Nw(n),{onFocusableItemAdd:b,onFocusableItemRemove:S,currentTabStopId:x}=p;return M.useEffect(()=>{if(r)return b(),()=>S()},[r,b,S]),T.jsx(Up.ItemSlot,{scope:n,id:h,focusable:r,active:o,children:T.jsx(qt.span,{tabIndex:g?0:-1,"data-orientation":p.orientation,...c,ref:e,onMouseDown:ze(t.onMouseDown,C=>{r?p.onItemFocus(h):C.preventDefault()}),onFocus:ze(t.onFocus,()=>p.onItemFocus(h)),onKeyDown:ze(t.onKeyDown,C=>{if(C.key==="Tab"&&C.shiftKey){p.onItemShiftTab();return}if(C.target!==C.currentTarget)return;const E=vz(C,p.orientation,p.dir);if(E!==void 0){if(C.metaKey||C.ctrlKey||C.altKey||C.shiftKey)return;C.preventDefault();let N=v().filter(D=>D.focusable).map(D=>D.ref.current);if(E==="last")N.reverse();else if(E==="prev"||E==="next"){E==="prev"&&N.reverse();const D=N.indexOf(C.currentTarget);N=p.loop?bz(N,D+1):N.slice(D+1)}setTimeout(()=>Lw(N))}}),children:typeof a=="function"?a({isCurrentTabStop:g,hasTabStop:x!=null}):a})})});jw.displayName=zw;var gz={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function yz(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function vz(t,e,n){const r=yz(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return gz[r]}function Lw(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}function bz(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var Sz=_w,xz=jw,qp=["Enter"," "],wz=["ArrowDown","PageUp","Home"],Iw=["ArrowUp","PageDown","End"],Cz=[...wz,...Iw],Mz={ltr:[...qp,"ArrowRight"],rtl:[...qp,"ArrowLeft"]},Ez={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Ra="Menu",[ca,Rz,Tz]=H1(Ra),[Mo,sf]=$s(Ra,[Tz,xw,Dw]),Ta=xw(),Bw=Dw(),[Vw,Ii]=Mo(Ra),[Az,Aa]=Mo(Ra),Fw=t=>{const{__scopeMenu:e,open:n=!1,children:r,dir:o,onOpenChange:l,modal:a=!0}=t,c=Ta(e),[d,h]=M.useState(null),p=M.useRef(!1),g=Jn(l),v=U1(o);return M.useEffect(()=>{const b=()=>{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",b,{capture:!0}),()=>{document.removeEventListener("keydown",b,{capture:!0}),document.removeEventListener("pointerdown",S,{capture:!0}),document.removeEventListener("pointermove",S,{capture:!0})}},[]),T.jsx(kw,{...c,children:T.jsx(Vw,{scope:e,open:n,onOpenChange:g,content:d,onContentChange:h,children:T.jsx(Az,{scope:e,onClose:M.useCallback(()=>g(!1),[g]),isUsingKeyboardRef:p,dir:v,modal:a,children:r})})})};Fw.displayName=Ra;var Oz="MenuAnchor",Dm=M.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,o=Ta(n);return T.jsx(lz,{...o,...r,ref:e})});Dm.displayName=Oz;var _m="MenuPortal",[kz,Pw]=Mo(_m,{forceMount:void 0}),$w=t=>{const{__scopeMenu:e,forceMount:n,children:r,container:o}=t,l=Ii(_m,e);return T.jsx(kz,{scope:e,forceMount:n,children:T.jsx(Ca,{present:n||l.open,children:T.jsx(J1,{asChild:!0,container:o,children:r})})})};$w.displayName=_m;var Fn="MenuContent",[Nz,zm]=Mo(Fn),Hw=M.forwardRef((t,e)=>{const n=Pw(Fn,t.__scopeMenu),{forceMount:r=n.forceMount,...o}=t,l=Ii(Fn,t.__scopeMenu),a=Aa(Fn,t.__scopeMenu);return T.jsx(ca.Provider,{scope:t.__scopeMenu,children:T.jsx(Ca,{present:r||l.open,children:T.jsx(ca.Slot,{scope:t.__scopeMenu,children:a.modal?T.jsx(Dz,{...o,ref:e}):T.jsx(_z,{...o,ref:e})})})})}),Dz=M.forwardRef((t,e)=>{const n=Ii(Fn,t.__scopeMenu),r=M.useRef(null),o=mn(e,r);return M.useEffect(()=>{const l=r.current;if(l)return G_(l)},[]),T.jsx(jm,{...t,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:ze(t.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),_z=M.forwardRef((t,e)=>{const n=Ii(Fn,t.__scopeMenu);return T.jsx(jm,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),zz=la("MenuContent.ScrollLock"),jm=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:v,onDismiss:b,disableOutsideScroll:S,...x}=t,C=Ii(Fn,n),E=Aa(Fn,n),A=Ta(n),N=Bw(n),D=Rz(n),[j,$]=M.useState(null),_=M.useRef(null),B=mn(e,_,C.onContentChange),Z=M.useRef(0),ie=M.useRef(""),pe=M.useRef(0),se=M.useRef(null),be=M.useRef("right"),te=M.useRef(0),ye=S?iw:M.Fragment,V=S?{as:zz,allowPinchZoom:!0}:void 0,U=q=>{const Y=ie.current+q,k=D().filter(me=>!me.disabled),K=document.activeElement,W=k.find(me=>me.ref.current===K)?.textValue,ne=k.map(me=>me.textValue),le=Gz(ne,Y,W),ae=k.find(me=>me.textValue===le)?.ref.current;(function me(Ke){ie.current=Ke,window.clearTimeout(Z.current),Ke!==""&&(Z.current=window.setTimeout(()=>me(""),1e3))})(Y),ae&&setTimeout(()=>ae.focus())};M.useEffect(()=>()=>window.clearTimeout(Z.current),[]),s_();const L=M.useCallback(q=>be.current===se.current?.side&&Yz(q,se.current?.area),[]);return T.jsx(Nz,{scope:n,searchRef:ie,onItemEnter:M.useCallback(q=>{L(q)&&q.preventDefault()},[L]),onItemLeave:M.useCallback(q=>{L(q)||(_.current?.focus(),$(null))},[L]),onTriggerLeave:M.useCallback(q=>{L(q)&&q.preventDefault()},[L]),pointerGraceTimerRef:pe,onPointerGraceIntentChange:M.useCallback(q=>{se.current=q},[]),children:T.jsx(ye,{...V,children:T.jsx(Y1,{asChild:!0,trapped:o,onMountAutoFocus:ze(l,q=>{q.preventDefault(),_.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:T.jsx(G1,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:h,onPointerDownOutside:p,onFocusOutside:g,onInteractOutside:v,onDismiss:b,children:T.jsx(Sz,{asChild:!0,...N,dir:E.dir,orientation:"vertical",loop:r,currentTabStopId:j,onCurrentTabStopIdChange:$,onEntryFocus:ze(d,q=>{E.isUsingKeyboardRef.current||q.preventDefault()}),preventScrollOnEntryFocus:!0,children:T.jsx(az,{role:"menu","aria-orientation":"vertical","data-state":sC(C.open),"data-radix-menu-content":"",dir:E.dir,...A,...x,ref:B,style:{outline:"none",...x.style},onKeyDown:ze(x.onKeyDown,q=>{const k=q.target.closest("[data-radix-menu-content]")===q.currentTarget,K=q.ctrlKey||q.altKey||q.metaKey,W=q.key.length===1;k&&(q.key==="Tab"&&q.preventDefault(),!K&&W&&U(q.key));const ne=_.current;if(q.target!==ne||!Cz.includes(q.key))return;q.preventDefault();const ae=D().filter(me=>!me.disabled).map(me=>me.ref.current);Iw.includes(q.key)&&ae.reverse(),Uz(ae)}),onBlur:ze(t.onBlur,q=>{q.currentTarget.contains(q.target)||(window.clearTimeout(Z.current),ie.current="")}),onPointerMove:ze(t.onPointerMove,fa(q=>{const Y=q.target,k=te.current!==q.clientX;if(q.currentTarget.contains(Y)&&k){const K=q.clientX>te.current?"right":"left";be.current=K,te.current=q.clientX}}))})})})})})})});Hw.displayName=Fn;var jz="MenuGroup",Lm=M.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return T.jsx(qt.div,{role:"group",...r,ref:e})});Lm.displayName=jz;var Lz="MenuLabel",Uw=M.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return T.jsx(qt.div,{...r,ref:e})});Uw.displayName=Lz;var Tc="MenuItem",dS="menu.itemSelect",lf=M.forwardRef((t,e)=>{const{disabled:n=!1,onSelect:r,...o}=t,l=M.useRef(null),a=Aa(Tc,t.__scopeMenu),c=zm(Tc,t.__scopeMenu),d=mn(e,l),h=M.useRef(!1),p=()=>{const g=l.current;if(!n&&g){const v=new CustomEvent(dS,{bubbles:!0,cancelable:!0});g.addEventListener(dS,b=>r?.(b),{once:!0}),$1(g,v),v.defaultPrevented?h.current=!1:a.onClose()}};return T.jsx(qw,{...o,ref:d,disabled:n,onClick:ze(t.onClick,p),onPointerDown:g=>{t.onPointerDown?.(g),h.current=!0},onPointerUp:ze(t.onPointerUp,g=>{h.current||g.currentTarget?.click()}),onKeyDown:ze(t.onKeyDown,g=>{const v=c.searchRef.current!=="";n||v&&g.key===" "||qp.includes(g.key)&&(g.currentTarget.click(),g.preventDefault())})})});lf.displayName=Tc;var qw=M.forwardRef((t,e)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...l}=t,a=zm(Tc,n),c=Bw(n),d=M.useRef(null),h=mn(e,d),[p,g]=M.useState(!1),[v,b]=M.useState("");return M.useEffect(()=>{const S=d.current;S&&b((S.textContent??"").trim())},[l.children]),T.jsx(ca.ItemSlot,{scope:n,disabled:r,textValue:o??v,children:T.jsx(xz,{asChild:!0,...c,focusable:!r,children:T.jsx(qt.div,{role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...l,ref:h,onPointerMove:ze(t.onPointerMove,fa(S=>{r?a.onItemLeave(S):(a.onItemEnter(S),S.defaultPrevented||S.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ze(t.onPointerLeave,fa(S=>a.onItemLeave(S))),onFocus:ze(t.onFocus,()=>g(!0)),onBlur:ze(t.onBlur,()=>g(!1))})})})}),Iz="MenuCheckboxItem",Gw=M.forwardRef((t,e)=>{const{checked:n=!1,onCheckedChange:r,...o}=t;return T.jsx(Qw,{scope:t.__scopeMenu,checked:n,children:T.jsx(lf,{role:"menuitemcheckbox","aria-checked":Ac(n)?"mixed":n,...o,ref:e,"data-state":Vm(n),onSelect:ze(o.onSelect,()=>r?.(Ac(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Gw.displayName=Iz;var Kw="MenuRadioGroup",[Bz,Vz]=Mo(Kw,{value:void 0,onValueChange:()=>{}}),Yw=M.forwardRef((t,e)=>{const{value:n,onValueChange:r,...o}=t,l=Jn(r);return T.jsx(Bz,{scope:t.__scopeMenu,value:n,onValueChange:l,children:T.jsx(Lm,{...o,ref:e})})});Yw.displayName=Kw;var Xw="MenuRadioItem",Jw=M.forwardRef((t,e)=>{const{value:n,...r}=t,o=Vz(Xw,t.__scopeMenu),l=n===o.value;return T.jsx(Qw,{scope:t.__scopeMenu,checked:l,children:T.jsx(lf,{role:"menuitemradio","aria-checked":l,...r,ref:e,"data-state":Vm(l),onSelect:ze(r.onSelect,()=>o.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});Jw.displayName=Xw;var Im="MenuItemIndicator",[Qw,Fz]=Mo(Im,{checked:!1}),Zw=M.forwardRef((t,e)=>{const{__scopeMenu:n,forceMount:r,...o}=t,l=Fz(Im,n);return T.jsx(Ca,{present:r||Ac(l.checked)||l.checked===!0,children:T.jsx(qt.span,{...o,ref:e,"data-state":Vm(l.checked)})})});Zw.displayName=Im;var Pz="MenuSeparator",Ww=M.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return T.jsx(qt.div,{role:"separator","aria-orientation":"horizontal",...r,ref:e})});Ww.displayName=Pz;var $z="MenuArrow",eC=M.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,o=Ta(n);return T.jsx(uz,{...o,...r,ref:e})});eC.displayName=$z;var Bm="MenuSub",[Hz,tC]=Mo(Bm),nC=t=>{const{__scopeMenu:e,children:n,open:r=!1,onOpenChange:o}=t,l=Ii(Bm,e),a=Ta(e),[c,d]=M.useState(null),[h,p]=M.useState(null),g=Jn(o);return M.useEffect(()=>(l.open===!1&&g(!1),()=>g(!1)),[l.open,g]),T.jsx(kw,{...a,children:T.jsx(Vw,{scope:e,open:r,onOpenChange:g,content:h,onContentChange:p,children:T.jsx(Hz,{scope:e,contentId:aa(),triggerId:aa(),trigger:c,onTriggerChange:d,children:n})})})};nC.displayName=Bm;var Yl="MenuSubTrigger",rC=M.forwardRef((t,e)=>{const n=Ii(Yl,t.__scopeMenu),r=Aa(Yl,t.__scopeMenu),o=tC(Yl,t.__scopeMenu),l=zm(Yl,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(Dm,{asChild:!0,...h,children:T.jsx(qw,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":sC(n.open),...t,ref:Zc(e,o.onTriggerChange),onClick:g=>{t.onClick?.(g),!(t.disabled||g.defaultPrevented)&&(g.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:ze(t.onPointerMove,fa(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:ze(t.onPointerLeave,fa(g=>{p();const v=n.content?.getBoundingClientRect();if(v){const b=n.content?.dataset.side,S=b==="right",x=S?-5:5,C=v[S?"left":"right"],E=v[S?"right":"left"];l.onPointerGraceIntentChange({area:[{x:g.clientX+x,y:g.clientY},{x:C,y:v.top},{x:E,y:v.top},{x:E,y:v.bottom},{x:C,y:v.bottom}],side:b}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>l.onPointerGraceIntentChange(null),300)}else{if(l.onTriggerLeave(g),g.defaultPrevented)return;l.onPointerGraceIntentChange(null)}})),onKeyDown:ze(t.onKeyDown,g=>{const v=l.searchRef.current!=="";t.disabled||v&&g.key===" "||Mz[r.dir].includes(g.key)&&(n.onOpenChange(!0),n.content?.focus(),g.preventDefault())})})})});rC.displayName=Yl;var iC="MenuSubContent",oC=M.forwardRef((t,e)=>{const n=Pw(Fn,t.__scopeMenu),{forceMount:r=n.forceMount,...o}=t,l=Ii(Fn,t.__scopeMenu),a=Aa(Fn,t.__scopeMenu),c=tC(iC,t.__scopeMenu),d=M.useRef(null),h=mn(e,d);return T.jsx(ca.Provider,{scope:t.__scopeMenu,children:T.jsx(Ca,{present:r||l.open,children:T.jsx(ca.Slot,{scope:t.__scopeMenu,children:T.jsx(jm,{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:ze(t.onFocusOutside,p=>{p.target!==c.trigger&&l.onOpenChange(!1)}),onEscapeKeyDown:ze(t.onEscapeKeyDown,p=>{a.onClose(),p.preventDefault()}),onKeyDown:ze(t.onKeyDown,p=>{const g=p.currentTarget.contains(p.target),v=Ez[a.dir].includes(p.key);g&&v&&(l.onOpenChange(!1),c.trigger?.focus(),p.preventDefault())})})})})})});oC.displayName=iC;function sC(t){return t?"open":"closed"}function Ac(t){return t==="indeterminate"}function Vm(t){return Ac(t)?"indeterminate":t?"checked":"unchecked"}function Uz(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function qz(t,e){return t.map((n,r)=>t[(e+r)%t.length])}function Gz(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=qz(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 Kz(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,v=d.y;p>r!=v>r&&n<(g-h)*(r-p)/(v-p)+h&&(o=!o)}return o}function Yz(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return Kz(n,e)}function fa(t){return e=>e.pointerType==="mouse"?t(e):void 0}var lC=Fw,aC=Dm,uC=$w,cC=Hw,fC=Lm,dC=Uw,hC=lf,pC=Gw,mC=Yw,gC=Jw,yC=Zw,vC=Ww,bC=eC,SC=nC,xC=rC,wC=oC,Fm="ContextMenu",[Xz]=$s(Fm,[sf]),Gt=sf(),[Jz,CC]=Xz(Fm),MC=t=>{const{__scopeContextMenu:e,children:n,onOpenChange:r,dir:o,modal:l=!0}=t,[a,c]=M.useState(!1),d=Gt(e),h=Jn(r),p=M.useCallback(g=>{c(g),h(g)},[h]);return T.jsx(Jz,{scope:e,open:a,onOpenChange:p,modal:l,children:T.jsx(lC,{...d,dir:o,open:a,onOpenChange:p,modal:l,children:n})})};MC.displayName=Fm;var EC="ContextMenuTrigger",RC=M.forwardRef((t,e)=>{const{__scopeContextMenu:n,disabled:r=!1,...o}=t,l=CC(EC,n),a=Gt(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=v=>{c.current={x:v.clientX,y:v.clientY},l.onOpenChange(!0)};return M.useEffect(()=>p,[p]),M.useEffect(()=>{r&&p()},[r,p]),T.jsxs(T.Fragment,{children:[T.jsx(aC,{...a,virtualRef:d}),T.jsx(qt.span,{"data-state":l.open?"open":"closed","data-disabled":r?"":void 0,...o,ref:e,style:{WebkitTouchCallout:"none",...t.style},onContextMenu:r?t.onContextMenu:ze(t.onContextMenu,v=>{p(),g(v),v.preventDefault()}),onPointerDown:r?t.onPointerDown:ze(t.onPointerDown,ic(v=>{p(),h.current=window.setTimeout(()=>g(v),700)})),onPointerMove:r?t.onPointerMove:ze(t.onPointerMove,ic(p)),onPointerCancel:r?t.onPointerCancel:ze(t.onPointerCancel,ic(p)),onPointerUp:r?t.onPointerUp:ze(t.onPointerUp,ic(p))})]})});RC.displayName=EC;var Qz="ContextMenuPortal",TC=t=>{const{__scopeContextMenu:e,...n}=t,r=Gt(e);return T.jsx(uC,{...r,...n})};TC.displayName=Qz;var AC="ContextMenuContent",OC=M.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=CC(AC,n),l=Gt(n),a=M.useRef(!1);return T.jsx(cC,{...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)"}})});OC.displayName=AC;var Zz="ContextMenuGroup",Wz=M.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=Gt(n);return T.jsx(fC,{...o,...r,ref:e})});Wz.displayName=Zz;var ej="ContextMenuLabel",kC=M.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=Gt(n);return T.jsx(dC,{...o,...r,ref:e})});kC.displayName=ej;var tj="ContextMenuItem",NC=M.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=Gt(n);return T.jsx(hC,{...o,...r,ref:e})});NC.displayName=tj;var nj="ContextMenuCheckboxItem",rj=M.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=Gt(n);return T.jsx(pC,{...o,...r,ref:e})});rj.displayName=nj;var ij="ContextMenuRadioGroup",oj=M.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=Gt(n);return T.jsx(mC,{...o,...r,ref:e})});oj.displayName=ij;var sj="ContextMenuRadioItem",lj=M.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=Gt(n);return T.jsx(gC,{...o,...r,ref:e})});lj.displayName=sj;var aj="ContextMenuItemIndicator",uj=M.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=Gt(n);return T.jsx(yC,{...o,...r,ref:e})});uj.displayName=aj;var cj="ContextMenuSeparator",DC=M.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=Gt(n);return T.jsx(vC,{...o,...r,ref:e})});DC.displayName=cj;var fj="ContextMenuArrow",dj=M.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=Gt(n);return T.jsx(bC,{...o,...r,ref:e})});dj.displayName=fj;var _C="ContextMenuSub",zC=t=>{const{__scopeContextMenu:e,children:n,onOpenChange:r,open:o,defaultOpen:l}=t,a=Gt(e),[c,d]=Wc({prop:o,defaultProp:l??!1,onChange:r,caller:_C});return T.jsx(SC,{...a,open:c,onOpenChange:d,children:n})};zC.displayName=_C;var hj="ContextMenuSubTrigger",jC=M.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=Gt(n);return T.jsx(xC,{...o,...r,ref:e})});jC.displayName=hj;var pj="ContextMenuSubContent",LC=M.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,o=Gt(n);return T.jsx(wC,{...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)"}})});LC.displayName=pj;function ic(t){return e=>e.pointerType!=="mouse"?t(e):void 0}var mj=MC,gj=RC,yj=TC,vj=OC,bj=kC,Sj=NC,xj=DC,wj=zC,Cj=jC,Mj=LC,af="DropdownMenu",[Ej]=$s(af,[sf]),Kt=sf(),[Rj,IC]=Ej(af),BC=t=>{const{__scopeDropdownMenu:e,children:n,dir:r,open:o,defaultOpen:l,onOpenChange:a,modal:c=!0}=t,d=Kt(e),h=M.useRef(null),[p,g]=Wc({prop:o,defaultProp:l??!1,onChange:a,caller:af});return T.jsx(Rj,{scope:e,triggerId:aa(),triggerRef:h,contentId:aa(),open:p,onOpenChange:g,onOpenToggle:M.useCallback(()=>g(v=>!v),[g]),modal:c,children:T.jsx(lC,{...d,open:p,onOpenChange:g,dir:r,modal:c,children:n})})};BC.displayName=af;var VC="DropdownMenuTrigger",FC=M.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=t,l=IC(VC,n),a=Kt(n);return T.jsx(aC,{asChild:!0,...a,children:T.jsx(qt.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:Zc(e,l.triggerRef),onPointerDown:ze(t.onPointerDown,c=>{!r&&c.button===0&&c.ctrlKey===!1&&(l.onOpenToggle(),l.open||c.preventDefault())}),onKeyDown:ze(t.onKeyDown,c=>{r||(["Enter"," "].includes(c.key)&&l.onOpenToggle(),c.key==="ArrowDown"&&l.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(c.key)&&c.preventDefault())})})})});FC.displayName=VC;var Tj="DropdownMenuPortal",PC=t=>{const{__scopeDropdownMenu:e,...n}=t,r=Kt(e);return T.jsx(uC,{...r,...n})};PC.displayName=Tj;var $C="DropdownMenuContent",HC=M.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=IC($C,n),l=Kt(n),a=M.useRef(!1);return T.jsx(cC,{id:o.contentId,"aria-labelledby":o.triggerId,...l,...r,ref:e,onCloseAutoFocus:ze(t.onCloseAutoFocus,c=>{a.current||o.triggerRef.current?.focus(),a.current=!1,c.preventDefault()}),onInteractOutside:ze(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)"}})});HC.displayName=$C;var Aj="DropdownMenuGroup",Oj=M.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Kt(n);return T.jsx(fC,{...o,...r,ref:e})});Oj.displayName=Aj;var kj="DropdownMenuLabel",UC=M.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Kt(n);return T.jsx(dC,{...o,...r,ref:e})});UC.displayName=kj;var Nj="DropdownMenuItem",qC=M.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Kt(n);return T.jsx(hC,{...o,...r,ref:e})});qC.displayName=Nj;var Dj="DropdownMenuCheckboxItem",GC=M.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Kt(n);return T.jsx(pC,{...o,...r,ref:e})});GC.displayName=Dj;var _j="DropdownMenuRadioGroup",KC=M.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Kt(n);return T.jsx(mC,{...o,...r,ref:e})});KC.displayName=_j;var zj="DropdownMenuRadioItem",YC=M.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Kt(n);return T.jsx(gC,{...o,...r,ref:e})});YC.displayName=zj;var jj="DropdownMenuItemIndicator",XC=M.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Kt(n);return T.jsx(yC,{...o,...r,ref:e})});XC.displayName=jj;var Lj="DropdownMenuSeparator",JC=M.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Kt(n);return T.jsx(vC,{...o,...r,ref:e})});JC.displayName=Lj;var Ij="DropdownMenuArrow",Bj=M.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Kt(n);return T.jsx(bC,{...o,...r,ref:e})});Bj.displayName=Ij;var Vj=t=>{const{__scopeDropdownMenu:e,children:n,open:r,onOpenChange:o,defaultOpen:l}=t,a=Kt(e),[c,d]=Wc({prop:r,defaultProp:l??!1,onChange:o,caller:"DropdownMenuSub"});return T.jsx(SC,{...a,open:c,onOpenChange:d,children:n})},Fj="DropdownMenuSubTrigger",QC=M.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Kt(n);return T.jsx(xC,{...o,...r,ref:e})});QC.displayName=Fj;var Pj="DropdownMenuSubContent",ZC=M.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Kt(n);return T.jsx(wC,{...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)"}})});ZC.displayName=Pj;var $j=BC,Hj=FC,Uj=PC,qj=HC,Gj=UC,Kj=qC,Yj=GC,Xj=KC,Jj=YC,WC=XC,Qj=JC,Zj=Vj,Wj=QC,e3=ZC;const t3=Cm("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 Ds({className:t,variant:e="default",size:n="default",asChild:r=!1,...o}){const l=r?TD:"button";return T.jsx(l,{"data-slot":"button","data-variant":e,"data-size":n,className:Ne(t3({variant:e,size:n,className:t})),...o})}function n3({...t}){return T.jsx(mj,{"data-slot":"context-menu",...t})}function r3({className:t,...e}){return T.jsx(gj,{"data-slot":"context-menu-trigger",className:Ne("select-none",t),...e})}function i3({...t}){return T.jsx(wj,{"data-slot":"context-menu-sub",...t})}function o3({className:t,...e}){return T.jsx(yj,{children:T.jsx(vj,{"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 s3({className:t,inset:e,variant:n="default",...r}){return T.jsx(Sj,{"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 l3({className:t,inset:e,children:n,...r}){return T.jsxs(Cj,{"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(a1,{className:"ml-auto"})]})}function a3({className:t,...e}){return T.jsx(Mj,{"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 u3({className:t,inset:e,...n}){return T.jsx(bj,{"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(xj,{"data-slot":"context-menu-separator",className:Ne("-mx-1 my-1 h-px bg-border/50",t),...e})}function f3({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 d3(t,e){return{...t,mode:e}}function eM(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 h3(t,e){switch(t.kind){case"date":case"number":return e===":"||e===">"||e==="<";case"json":return e===":"||e===".";default:return e===":"}}function tM(t){return t==null?"":t instanceof Date?t.toISOString():typeof t=="object"?JSON.stringify(t):String(t)}function Pm(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 nM(t){return Pm(t).map(e=>e.token)}function hS(t){return t.replace(/\\(["\\])/g,"$1")}function rM(t){const e=t.trim();return e.length>=2&&e.startsWith('"')&&e.endsWith('"')?hS(e.slice(1,-1)):hS(e)}function iM(t){return!t||/[\s"]/u.test(t)?`"${t.replace(/["\\]/g,"\\$&")}"`:t}function pS(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 p3(t,e){return t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()&&t.getDate()===e.getDate()}function m3(t,e,n,r){const o=e.getValue(t),l=tM(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=pS(l),p=pS(d);return!h||!p?l.toLowerCase().includes(r.trim().toLowerCase()):c===">"?h>p:c==="<"?h<p:p3(h,p)}return l.toLowerCase().includes(r.trim().toLowerCase())}function g3(t,e,n){return n.every(r=>m3(t,e,r.operator,r.value))}function mS(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 oM(t,e,n){const r=Pm(t).find(d=>e>=d.start&&e<=d.end),o=r?.start??e,l=r?.end??e,a=r?.token??"",c=eM(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 y3(t,e){const n=[];for(const{end:r,start:o,token:l}of Pm(t)){const a=eM(l,e);a?.field&&h3(a.field,a.operator)&&n.push({end:r,fieldId:a.field.id,operator:a.operator,start:o,token:l})}return n}function v3(t,e,n){const r=oM(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=mS(n),d=r.fragment.trim()?c.filter(h=>h.label.toLowerCase().includes(r.fragment.trim().toLowerCase())):c;return o?[...l,...d.map(h=>d3(h,"replace-token"))]:[...l,...d]}if(r.field.kind==="enum"&&r.operator===":"){const c=rM(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}:${iM(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=mS([r.field]).filter(c=>c.label.toLowerCase().includes(r.token.trim().toLowerCase()));return[...l,...a]}function b3(t,e,n,r){const o=oM(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 sM(t,e){const n=t.trim();if(!n)return{columnFilters:[],globalFilter:""};const r=nM(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(b=>b.id===d);if(!g){l.push(a);return}const v=o.get(g.id)??[];v.push({operator:h,value:rM(p)}),o.set(g.id,v)}),{columnFilters:Array.from(o.entries()).map(([a,c])=>({id:a,value:c})),globalFilter:l.join(" ")}}function S3(t,e,n){const r=sM(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 x3(t,e){return Array.from(new Set(t.map(n=>tM(e(n)).trim()).filter(Boolean).map(n=>n.toUpperCase())))}function w3(t){return t==null?new Date().toISOString():t instanceof Date?t.toISOString():typeof t=="object"?JSON.stringify(t):String(t)}function C3(t){return e=>{if(t.accessorFn)return t.accessorFn(e);if(t.accessorKey)return e[t.accessorKey]}}function M3(t){switch(t.kind){case"date":return"date";case"enum":return"enum";case"json":return"json";case"number":return"number";default:return"text"}}function lM(t,e){return t.id??t.accessorKey??(t.header?t.header.toLowerCase().replace(/\s+/g,"-"):`column-${e}`)}function E3(t,e,n={}){const r=e.at(-1);return t.map((o,l)=>{const a=lM(o,l),c=C3(o),d=M3(o);return d==="enum"?{getValue:c,id:a,kind:d,options:n.fieldOptions?.[a]??x3(e,c)}:d==="date"?{getValue:c,id:a,kind:d,sample:w3(r?c(r):new Date().toISOString())}:{getValue:c,id:a,kind:d}})}function R3(t,e){const n=new Map(e.map(r=>[r.id,r]));return t.map((r,o)=>{const l=lM(r,o),a=n.get(l);return!a||r.filterFn?r:{...r,filterFn:((c,d,h)=>{const p=Array.isArray(h)?h:[];return g3(c.original,a,p)})}})}function Gp(t){return`${t}:search`}function Kp(t){return`${t}-search`}function gS(t,e){return typeof window>"u"?"":e==="url"?new URL(window.location.href).searchParams.get(Kp(t))??"":window.localStorage.getItem(Gp(t))??""}function T3(t,e,n){if(!(typeof window>"u")){if(e==="url"){const r=new URL(window.location.href);n.trim()?r.searchParams.set(Kp(t),n):r.searchParams.delete(Kp(t)),window.history.replaceState(window.history.state,"",r);return}if(n){window.localStorage.setItem(Gp(t),n);return}window.localStorage.removeItem(Gp(t))}}const aM="datatable:",A3="datatable-",uM=M.createContext(null);function $m(){return M.useContext(uM)}function O3(){const t=$m();if(!t)throw new Error("useDataTableContext must be used inside DataTableProvider.");return t}function k3({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"),v=c!==void 0,[b,S]=M.useState(()=>g==="none"?"":gS(o,g)),x=c??b,C=M.useCallback($=>{v||S($),l?.($)},[v,l]);M.useEffect(()=>{if(v||g==="none"){S("");return}S(gS(o,g))},[o,v,g]),M.useEffect(()=>{v||g==="none"||T3(o,g,b)},[o,v,g,b]);const E=M.useMemo(()=>E3(e,n,{fieldOptions:r}),[e,n,r]),A=M.useMemo(()=>sM(x,E),[x,E]),N=M.useMemo(()=>R3(e,E),[e,E]),D=M.useMemo(()=>({...p,columnFilters:A.columnFilters,columns:N,data:n,globalFilter:A.globalFilter,highlightQuery:x,id:o,resolveColumnHighlightTerms:($,_)=>S3(_,$,E),statePersistence:h??(g==="none"?"none":g)}),[n,o,A.columnFilters,A.globalFilter,N,g,x,E,h,p]),j=M.useMemo(()=>({search:x,searchFields:E,setSearch:C,tableProps:D}),[C,x,D,E]);return T.jsx(uM.Provider,{value:j,children:t})}function yS(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 N3(t){return t==null?"":t instanceof Date?t.toISOString():typeof t=="object"?JSON.stringify(t):String(t)}function Yp(t){return`${A3}${t}`}function D3(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 sp(t,e){if(typeof window>"u")return{};try{if(e==="none")return{};const n=e==="url"?new URL(window.location.href).searchParams.get(Yp(t)):window.localStorage.getItem(`${aM}${t}`);return n?JSON.parse(n):{}}catch{return{}}}function _3(t,e,n){if(!(typeof window>"u")&&e!=="none"){if(e==="url"){const r=new URL(window.location.href);D3(n)?r.searchParams.delete(Yp(t)):r.searchParams.set(Yp(t),JSON.stringify(n)),window.history.replaceState(window.history.state,"",r);return}window.localStorage.setItem(`${aM}${t}`,JSON.stringify(n))}}function z3(t){return t==="number"?"right":t==="boolean"||t==="selection"?"center":"left"}function vS(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 j3(t,e){return t.id??t.accessorKey??(t.header?t.header.toLowerCase().replace(/\s+/g,"-"):`column-${e}`)}function L3(t,e,n,r,o){const l=Object.keys(t[0]??{}).map(h=>({accessorKey:h,header:yS(h)})),c=(e&&e.length>0?e:l).map((h,p)=>{const g=j3(h,p),v=t.slice(0,25).map(x=>h.accessorFn?h.accessorFn(x):h.accessorKey?x[h.accessorKey]:void 0),b=h.kind??wD(v),S={align:h.align??z3(b),cellClassName:h.cellClassName,headerClassName:h.headerClassName,highlightMatches:h.highlightMatches??b==="text",kind:b,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()}):P1(x(),b),enableGlobalFilter:h.enableFiltering??!0,filterFn:h.filterFn,enableHiding:h.enableHiding??!0,enableResizing:h.enableResizing??!0,enableSorting:h.enableSorting??!0,header:h.header??yS(g),id:g,maxSize:h.maxWidth??420,meta:S,minSize:h.minWidth??Math.min(vS(b),120),size:h.width??vS(b)}});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(Ib,{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(Ib,{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 I3=(t,e,n)=>{const r=String(n??"").trim().toLowerCase();return r?N3(t.getValue(e)).toLowerCase().includes(r):!0};function bS(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 B3(t,e,n){return t.scope==="selection"&&e.getIsSelected()?n.length>0?n.map(r=>r.original):[e.original]:[e.original]}function V3(t,e,n){return t.scope==="selection"&&e.getIsSelected()?n.length>0?n.map(r=>r.id):[e.id]:[e.id]}function F3(t,e,n){return{actionRowIds:V3(t,e,n),actionRows:B3(t,e,n),anchorRow:e.original,anchorRowId:e.id,selectedRowIds:n.map(r=>r.id),selectedRows:n.map(r=>r.original)}}function Hm(t,e){return typeof t=="function"?t(e):!!t}function cM(t,e){return typeof t.label=="function"?t.label(e):t.label}function Oc(t){return t.button===void 0||t.button===!1?null:t.button}function fM(t,e){return`${t.id}:${e.actionRowIds.join(",")}`}function dM(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 hM(t){return t.some(e=>{if(e.scope==="selection")return!0;const n=Array.isArray(e.items)?e.items:void 0;return n?hM(n):!1})}function pM(t){return t.reduce((e,n)=>{const r=Oc(n)!==null?e+1:e,o=Array.isArray(n.items)?n.items:void 0;return o?r+pM(o):r},0)}function P3(t,e,n,r){const o=typeof t.items=="function"?t.items(e):t.items;return mM(o??[],n,r)}function mM(t,e,n){return t.flatMap(r=>{const o=F3(r,e,n);if(Hm(r.hidden,o))return[];const l=P3(r,o,e,n);return r.items&&l.length===0?[]:[{action:r,context:o,items:l}]})}function gM({resolvedAction:t,setStatus:e,statuses:n}){const{action:r,context:o,items:l}=t,a=cM(r,o),c=Hm(r.disabled,o),d=fM(r,o),h=n[d],p=Oc(r),g=M.useCallback(async()=>{if(r.onSelect){e(d,{state:"loading"});try{const S=await r.onSelect(o);e(d,{message:dM(S),state:"success"},2500)}catch(S){e(d,{message:S instanceof Error?S.message:String(S),state:"error"},4e3)}}},[r,o,e,d]),v=h?.state==="loading"?Jc:h?.state==="success"?Ps:h?.state==="error"?pm:r.icon,b=h?.state==="loading";return l.length>0?T.jsxs(i3,{children:[T.jsxs(l3,{disabled:c||b,children:[v?T.jsx(v,{className:"size-3.5"}):null,T.jsx("span",{className:"truncate",children:a})]}),T.jsx(a3,{className:"w-72",children:l.map(S=>T.jsx(gM,{resolvedAction:S,setStatus:e,statuses:n},S.action.id))})]}):T.jsxs(s3,{disabled:c||b,onSelect:()=>{g()},title:h?.message,variant:r.variant??(p==="destructive"||typeof p=="object"&&p?.variant==="destructive"?"destructive":"default"),children:[v?T.jsx(v,{className:Ne("size-3.5",b&&"animate-spin")}):null,T.jsx("span",{className:"truncate",children:a}),r.shortcut?T.jsx(f3,{children:r.shortcut}):null]})}function $3({resolvedActions:t,setStatus:e,statuses:n}){const r=t.filter(o=>o.items.length===0&&Oc(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=Oc(l),d=cM(l,a),h=fM(l,a),p=n[h],g=Hm(l.disabled,a)||p?.state==="loading",v=p?.state==="loading"?Jc:p?.state==="success"?Ps:p?.state==="error"?pm:l.icon,b=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(Ds,{"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:dM(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:[v?T.jsx(v,{className:Ne("size-3.5",p?.state==="loading"&&"animate-spin")}):null,b]},h)})})}function H3({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:v="",id:b,onColumnFiltersChange:S,onColumnVisibilityChange:x,onGlobalFilterChange:C,resolveColumnHighlightTerms:E,rowActions:A,rowClassName:N,rowHeight:D=48,statePersistence:j="localStorage"}){const $=M.useMemo(()=>sp(b,j),[b,j]),[_,B]=M.useState(()=>$.sorting??[]),[Z,ie]=M.useState(()=>$.columnSizing??{}),[pe,se]=M.useState(()=>$.columnVisibility??{}),[be,te]=M.useState(()=>$.highlightedColumns??{}),[ye,V]=M.useState(()=>$.columnFilters??[]),[U,L]=M.useState({}),[q,Y]=M.useState({}),k=M.useRef({}),K=M.useRef(null),W=M.useRef(null),ne=M.useRef(null),[le,ae]=M.useState(!1),[me,Ke]=M.useState(()=>$.globalFilter??""),Ee=M.useDeferredValue(me),St=n!==void 0,ct=r!==void 0,Jt=h!==void 0,Qt=n??ye,Ct=r??pe,Gs=A?hM(A):!1,Fi=A?pM(A):0,Wn=c||Gs,Ks=c,Ao=Fi>0,Oo=M.useMemo(()=>Math.max(160,Math.min(320,Fi*96)),[Fi]),Ys=M.useMemo(()=>L3(l,o,Ks,Ao,Oo),[o,l,Oo,Ao,Ks]),Da=M.useCallback((re,ue,Re)=>{const Fe=k.current[re];Fe&&(window.clearTimeout(Fe),delete k.current[re]),Y(We=>({...We,[re]:ue})),Re&&(k.current[re]=window.setTimeout(()=>{Y(We=>{const Me={...We};return delete Me[re],Me}),delete k.current[re]},Re))},[]),xf=M.useCallback(re=>{ie(ue=>Kn(re,ue))},[]),Zt=M.useCallback(re=>{const ue=Kn(re,Qt);St||V(ue),S?.(ue)},[St,S,Qt]),wf=M.useCallback(re=>{const ue=Kn(re,Ct);ct||se(ue),x?.(ue)},[ct,x,Ct]),er=dN({columnResizeMode:"onChange",columns:Ys,data:l,enableColumnResizing:!0,enableRowSelection:Wn,getCoreRowModel:rN(),getFilteredRowModel:lN(),getRowId:p,getSortedRowModel:aN(),globalFilterFn:I3,onColumnFiltersChange:Zt,onColumnSizingChange:xf,onColumnVisibilityChange:wf,onRowSelectionChange:L,onSortingChange:B,state:{columnFilters:Qt,columnSizing:Z,columnVisibility:Ct,globalFilter:Ee.trim(),rowSelection:U,sorting:_}}),tr=M.useRef(null),Ur=M.useRef(!0),_a=M.useRef(!1),Xs=M.useRef(0),on=er.getRowModel().rows,ko=er.getSelectedRowModel().rows,Pi=typeof g=="number"?g:0,Wt=M.useRef(t?Math.max(on.length*D-Pi,0):0),sn=MN({count:on.length,estimateSize:()=>D,getScrollElement:()=>tr.current,initialOffset:Wt.current,overscan:12}),Vt=sn.getVirtualItems();l.length,on.length,ko.length,M.useEffect(()=>()=>{for(const re of Object.values(k.current))window.clearTimeout(re)},[]),M.useEffect(()=>{if(St)return;const re=sp(b,j);B(re.sorting??[]),ie(re.columnSizing??{}),ct||se(re.columnVisibility??{}),te(re.highlightedColumns??{}),V(re.columnFilters??[]),Ke(re.globalFilter??""),L({}),W.current=null,ne.current=null,ae(!1),K.current=null;for(const ue of Object.values(k.current))window.clearTimeout(ue);k.current={},Y({})},[b,St,ct,j]),M.useEffect(()=>{St&&V(n)},[n,St]),M.useEffect(()=>{ct&&se(r)},[r,ct]),M.useEffect(()=>{Jt&&Ke(h)},[h,Jt]),M.useEffect(()=>{if(typeof window>"u"||j!=="url")return;const re=()=>{const ue=sp(b,"url");B(ue.sorting??[]),ie(ue.columnSizing??{}),ct||se(ue.columnVisibility??{}),te(ue.highlightedColumns??{}),V(ue.columnFilters??[]),Ke(ue.globalFilter??""),L({}),W.current=null,ne.current=null,ae(!1),K.current=null};return window.addEventListener("popstate",re),()=>window.removeEventListener("popstate",re)},[b,ct,j]),M.useEffect(()=>{Jt||St||_3(b,j,{columnFilters:ye,columnSizing:Z,highlightedColumns:be,columnVisibility:Ct,globalFilter:Ee.trim(),sorting:_})},[ye,Z,Ee,be,b,St,Jt,Ct,_,j]),M.useEffect(()=>{const re=tr.current;if(!t||!re)return;const ue=()=>{const Re=re.scrollHeight-re.scrollTop-re.clientHeight;Ur.current=Re<=e};return ue(),re.addEventListener("scroll",ue,{passive:!0}),()=>{re.removeEventListener("scroll",ue)}},[t,e]),M.useLayoutEffect(()=>{const re=tr.current,ue=Xs.current;Xs.current=l.length;const Re=()=>{on.length!==0&&(sn.scrollToIndex(on.length-1,{align:"end"}),re?.scrollTo({top:re.scrollHeight}))},Fe=()=>{const We=[],Me=ft=>{if(Re(),ft<=0)return;const dt=window.requestAnimationFrame(()=>Me(ft-1));We.push(dt)};return Me(4),()=>{for(const ft of We)window.cancelAnimationFrame(ft)}};if(t&&re&&!_a.current&&on.length>0)return _a.current=!0,Ur.current=!0,Fe();if(!(!t||!re||l.length<=ue||!Ur.current))return Fe()},[t,l.length,sn,on.length]);const Js=M.useCallback((re,ue)=>be[re]??!!ue.highlightMatches,[be]),qr=M.useCallback((re,ue,Re={})=>{const Fe=on.findIndex(dt=>dt.id===re),We=on.findIndex(dt=>dt.id===ue);if(Fe===-1||We===-1)return;const[Me,ft]=Fe<=We?[Fe,We]:[We,Fe];L({...Re,...Object.fromEntries(on.slice(Me,ft+1).map(dt=>[dt.id,!0]))})},[on]),za=M.useCallback(re=>{K.current=re,L({[re]:!0})},[]),hr=M.useCallback((re,ue)=>{if(!W.current)return;const Re=tr.current;if(!Re)return;const Fe=document.elementFromPoint(re,ue)?.closest("tr[data-row-id]"),We=Array.from(Re.querySelectorAll("tr[data-row-id]")),Me=Fe?.dataset.rowId??(ue<Re.getBoundingClientRect().top?We[0]?.dataset.rowId:ue>Re.getBoundingClientRect().bottom?We.at(-1)?.dataset.rowId:void 0);if(!Me)return;const{anchorId:ft,baseSelection:dt}=W.current;qr(ft,Me,dt)},[qr]),No=M.useCallback((re,ue)=>{if(re.button!==0||!Wn||bS(re.target))return;re.preventDefault(),ne.current={clientX:re.clientX,clientY:re.clientY};const Re=ue.id,Fe=re.metaKey||re.ctrlKey,We=er.getState().rowSelection;if(re.shiftKey){const Me=K.current??Re;K.current=Me,W.current={anchorId:Me,baseSelection:{}},ae(!0),qr(Me,Re);return}if(Fe){const Me={...We};Me[Re]?delete Me[Re]:Me[Re]=!0,K.current=Re,W.current={anchorId:Re,baseSelection:Me},ae(!0),L(Me);return}K.current=Re,W.current={anchorId:Re,baseSelection:{}},ae(!0),L({[Re]:!0})},[Wn,qr,er]),Do=M.useCallback((re,ue)=>{if(!Wn||re.buttons!==1||bS(re.target)||!W.current)return;const{anchorId:Re,baseSelection:Fe}=W.current;qr(Re,ue.id,Fe)},[Wn,qr]),pr=M.useCallback(re=>{if(Wn){if(re.getIsSelected()){K.current=re.id;return}za(re.id)}},[Wn,za]);return M.useEffect(()=>{if(!le)return;const re=Re=>{ne.current={clientX:Re.clientX,clientY:Re.clientY},hr(Re.clientX,Re.clientY)},ue=()=>{W.current=null,ne.current=null,ae(!1)};return window.addEventListener("mousemove",re),window.addEventListener("mouseup",ue),()=>{window.removeEventListener("mousemove",re),window.removeEventListener("mouseup",ue)}},[le,hr]),M.useEffect(()=>{if(!le)return;let re=0;const ue=()=>{const Re=tr.current,Fe=ne.current;if(Re&&Fe){const{top:We,bottom:Me}=Re.getBoundingClientRect(),ft=48;let dt=0;if(Fe.clientY<We+ft?dt=-Math.ceil((We+ft-Fe.clientY)/6):Fe.clientY>Me-ft&&(dt=Math.ceil((Fe.clientY-(Me-ft))/6)),dt!==0){const _o=Math.max(-28,Math.min(28,dt));Re.scrollTop+=_o,hr(Fe.clientX,Fe.clientY)}}re=window.requestAnimationFrame(ue)};return re=window.requestAnimationFrame(ue),()=>{window.cancelAnimationFrame(re)}},[le,hr]),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",le&&"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:er.getHeaderGroups().map(re=>T.jsx("tr",{className:"flex w-full",style:{width:er.getTotalSize()},children:re.headers.map((ue,Re)=>T.jsx(ED,{header:ue,highlightEnabled:Js(ue.column.id,ue.column.columnDef.meta??{}),onToggleHighlight:()=>te(Fe=>({...Fe,[ue.column.id]:!Js(ue.column.id,ue.column.columnDef.meta??{})})),paddingLeft:Re===0?a:void 0,paddingRight:Re===re.headers.length-1?a:void 0,scrollContainerRef:tr},ue.id))},re.id))}),T.jsx("tbody",{className:"relative grid",style:{height:sn.getTotalSize()},children:Vt.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."})}):Vt.map(re=>{const ue=on[re.index],Re=mM(A??[],ue,ko),Fe=ue.getIsSelected(),We=T.jsx("tr",{"aria-selected":Fe,className:Ne("absolute left-0 flex w-full bg-card transition-colors",Wn&&"cursor-pointer",N?.(ue.original),Fe&&"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":re.index,"data-row-id":ue.id,"data-state":Fe?"selected":void 0,onContextMenu:()=>pr(ue),onMouseDown:Me=>No(Me,ue),onMouseEnter:Me=>Do(Me,ue),ref:Me=>{Me&&sn.measureElement(Me)},style:{minHeight:D,transform:`translateY(${re.start}px)`,width:er.getTotalSize()},children:ue.getVisibleCells().map((Me,ft,dt)=>{const $i=Me.column.columnDef.meta??{},_o=Me.column.id==="__actions",Qs=$i.kind==="text"&&E&&Js(Me.column.id,$i)?E(Me.column.id,v):[];return _o?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",$i.cellClassName),style:{paddingLeft:ft===0?a:void 0,paddingRight:ft===dt.length-1?a:void 0,width:Me.column.getSize()},children:T.jsx("div",{className:"w-full min-w-0",children:T.jsx($3,{resolvedActions:Re,setStatus:Da,statuses:q})})},Me.id):T.jsx(bD,{cell:Me,highlightTerms:Qs,paddingLeft:ft===0?a:void 0,paddingRight:ft===dt.length-1?a:void 0},Me.id)})},ue.id);return Re.length===0?We:T.jsxs(n3,{children:[T.jsx(r3,{asChild:!0,children:We}),T.jsxs(o3,{className:"w-64",children:[Re.map(Me=>T.jsx(gM,{resolvedAction:Me,setStatus:Da,statuses:q},Me.action.id)),T.jsx(c3,{}),T.jsx(u3,{children:Fe&&ko.length>1?`${ko.length} selected rows`:"Row actions"})]})]},ue.id)})})]})})})}function U3(t={}){const e=$m(),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(H3,{...n})}function yM(t,e){return t.id??t.accessorKey??(t.header?t.header.toLowerCase().replace(/\s+/g,"-"):`column-${e}`)}function Um(t,e){return e.includes(".")?e.split(".").reduce((n,r)=>{if(!(n==null||typeof n!="object"))return n[r]},t):t[e]}function q3(t){return t.includes(".")}function jt(t){this.content=t}jt.prototype={constructor:jt,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 jt(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 jt(n)},addToStart:function(t,e){return new jt([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new jt(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 jt(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=jt.from(t),t.size?new jt(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=jt.from(t),t.size?new jt(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=jt.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}};jt.from=function(t){if(t instanceof jt)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new jt(e)};function vM(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=vM(o.content,l.content,n+1);if(a!=null)return a}n+=o.nodeSize}}function bM(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=bM(a.content,c.content,n-1,r-1);if(h)return h}n-=d,r-=d}}class ee{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 ee(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 ee(r,o)}cutByIndex(e,n){return e==n?ee.empty:e==0&&n==this.content.length?this:new ee(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 ee(o,l)}addToStart(e){return new ee([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new ee(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 vM(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return bM(this,e,n,r)}findIndex(e){if(e==0)return oc(0,e);if(e==this.size)return oc(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?oc(n+1,l):oc(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 ee.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new ee(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return ee.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 ee(n||e,r)}static from(e){if(!e)return ee.empty;if(e instanceof ee)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new ee([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}ee.empty=new ee([],0);const lp={index:0,offset:0};function oc(t,e){return lp.index=t,lp.offset=e,lp}function kc(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(!kc(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!kc(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let Ze=class Xp{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&&kc(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 Xp.none;if(e instanceof Xp)return[e];let n=e.slice();return n.sort((r,o)=>r.type.rank-o.type.rank),n}};Ze.none=[];class Nc extends Error{}class oe{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=xM(this.content,e+this.openStart,n);return r&&new oe(r,this.openStart,this.openEnd)}removeBetween(e,n){return new oe(SM(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 oe.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 oe(ee.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 oe(e,r,o)}}oe.empty=new oe(ee.empty,0,0);function SM(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(SM(l.content,e-o-1,n-o-1)))}function xM(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=xM(a.content,e-l-1,n,a);return c&&t.replaceChild(o,a.copy(c))}function G3(t,e,n){if(n.openStart>t.depth)throw new Nc("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Nc("Inconsistent open depths");return wM(t,e,n,0)}function wM(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=wM(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 po(a,c.cut(0,t.parentOffset).append(n.content).append(c.cut(e.parentOffset)))}else{let{start:a,end:c}=K3(n,t);return po(l,MM(t,a,c,e,r))}else return po(l,Dc(t,e,r))}function CM(t,e){if(!e.type.compatibleContent(t.type))throw new Nc("Cannot join "+e.type.name+" onto "+t.type.name)}function Jp(t,e,n){let r=t.node(n);return CM(r,e.node(n)),r}function ho(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 ta(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&&(ho(t.nodeAfter,r),l++));for(let c=l;c<a;c++)ho(o.child(c),r);e&&e.depth==n&&e.textOffset&&ho(e.nodeBefore,r)}function po(t,e){return t.type.checkContent(e),t.copy(e)}function MM(t,e,n,r,o){let l=t.depth>o&&Jp(t,e,o+1),a=r.depth>o&&Jp(n,r,o+1),c=[];return ta(null,t,o,c),l&&a&&e.index(o)==n.index(o)?(CM(l,a),ho(po(l,MM(t,e,n,r,o+1)),c)):(l&&ho(po(l,Dc(t,e,o+1)),c),ta(e,n,o,c),a&&ho(po(a,Dc(n,r,o+1)),c)),ta(r,null,o,c),new ee(c)}function Dc(t,e,n){let r=[];if(ta(null,t,n,r),t.depth>n){let o=Jp(t,e,n+1);ho(po(o,Dc(t,e,n+1)),r)}return ta(e,null,n,r),new ee(r)}function K3(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(ee.from(o));return{start:o.resolveNoCache(t.openStart+n),end:o.resolveNoCache(o.content.size-t.openEnd-n)}}class da{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 _c(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 da(n,r,l)}static resolveCached(e,n){let r=SS.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 SS.set(e,r=new Y3);let o=r.elts[r.i]=da.resolve(e,n);return r.i=(r.i+1)%X3,o}}class Y3{constructor(){this.elts=[],this.i=0}}const X3=12,SS=new WeakMap;class _c{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 J3=Object.create(null);let Ri=class Qp{constructor(e,n,r,o=Ze.none){this.type=e,this.attrs=n,this.marks=o,this.content=r||ee.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&&kc(this.attrs,n||e.defaultAttrs||J3)&&Ze.sameSet(this.marks,r||Ze.none)}copy(e=null){return e==this.content?this:new Qp(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Qp(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 oe.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 oe(h,o.depth-a,l.depth-a)}replace(e,n,r){return G3(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 da.resolveCached(this,e)}resolveNoCache(e){return da.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()+")"),EM(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=ee.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=ee.fromJSON(e,n.content),l=e.nodeType(n.type).create(n.attrs,o,r);return l.type.checkAttrs(l.attrs),l}};Ri.prototype.text=void 0;class zc extends Ri{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):EM(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 zc(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new zc(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 EM(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class bo{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new Q3(e,n);if(r.next==null)return bo.empty;let o=RM(r);r.next&&r.err("Unexpected trailing text");let l=iL(rL(o));return oL(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 ee.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 v=l(g,c.concat(p));if(v)return v}}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
+ `)}}bo.empty=new bo(!0);class Q3{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 RM(t){let e=[];do e.push(Z3(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function Z3(t){let e=[];do e.push(W3(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function W3(t){let e=nL(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=eL(t,e);else break;return e}function xS(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function eL(t,e){let n=xS(t),r=n;return t.eat(",")&&(t.next!="}"?r=xS(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function tL(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 nL(t){if(t.eat("(")){let e=RM(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=tL(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 rL(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 TM(t,e){return e-t}function wS(t,e){let n=[];return r(e),n.sort(TM);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 iL(t){let e=Object.create(null);return n(wS(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]);wS(t,d).forEach(p=>{h||o.push([c,h=[]]),h.indexOf(p)==-1&&h.push(p)})})});let l=e[r.join(",")]=new bo(r.indexOf(t.length-1)>-1);for(let a=0;a<o.length;a++){let c=o[a][1].sort(TM);l.next.push({type:o[a][0],next:e[c.join(",")]||n(c)})}return l}}function oL(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 AM(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 OM(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 kM(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 NM(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new lL(t,r,e[r]);return n}let CS=class DM{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=NM(e,r.attrs),this.defaultAttrs=AM(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==bo.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:OM(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Ri(this,this.computeAttrs(e),ee.from(n),Ze.setFrom(r))}createChecked(e=null,n,r){return n=ee.from(n),this.checkContent(n),new Ri(this,this.computeAttrs(e),n,Ze.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=ee.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(ee.empty,!0);return l?new Ri(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){kM(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 DM(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 sL(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 lL{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?sL(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class uf{constructor(e,n,r,o){this.name=e,this.rank=n,this.schema=r,this.spec=o,this.attrs=NM(e,o.attrs),this.excluded=null;let l=AM(this.attrs);this.instance=l?new Ze(this,l):null}create(e=null){return!e&&this.instance?this.instance:new Ze(this,OM(this.attrs,e))}static compile(e,n){let r=Object.create(null),o=0;return e.forEach((l,a)=>r[l]=new uf(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){kM(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class _M{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=jt.from(e.nodes),n.marks=jt.from(e.marks||{}),this.nodes=CS.compile(this.spec.nodes,this),this.marks=uf.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]=bo.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?MS(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==""?[]:MS(this,a.split(" "))}this.nodeFromJSON=o=>Ri.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 CS){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 zc(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 MS(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 aL(t){return t.tag!=null}function uL(t){return t.style!=null}class Ti{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(o=>{if(aL(o))this.tags.push(o);else if(uL(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 RS(this,n,!1);return r.addAll(e,Ze.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new RS(this,n,!0);return r.addAll(e,Ze.none,n.from,n.to),oe.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(dL(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=TS(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=TS(a)),a.node||a.ignore||a.mark||(a.node=o)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Ti(e,Ti.schemaRules(e)))}}const zM={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},cL={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},jM={ol:!0,ul:!0},ha=1,Zp=2,na=4;function ES(t,e,n){return e!=null?(e?ha:0)|(e==="full"?Zp:0):t&&t.whitespace=="pre"?ha|Zp:n&~na}class sc{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&na?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(ee.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&ha)){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=ee.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(ee.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&&!zM.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class RS{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=ES(null,n.preserveWhitespace,0)|(r?na:0);o?l=new sc(o.type,o.attrs,Ze.none,!0,n.topMatch||o.type.contentMatch,a):r?l=new sc(null,null,Ze.none,!0,null,a):l=new sc(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&Zp?"full":this.localPreserveWS||(o.options&ha)>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;jM.hasOwnProperty(a)&&this.parser.normalizeLists&&fL(e);let d=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(c=this.parser.matchTag(e,this,r));e:if(d?d.ignore:cL.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(zM.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):AS(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=ES(e,l,a.options);a.options&na&&a.content.length==0&&(c|=na);let d=Ze.none;return r=r.filter(h=>(a.type?a.type.allowsMarkType(h.type):AS(h.type,e))?(d=h.addToSet(d),!1):!0),this.nodes.push(new sc(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|=ha)}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 fL(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&jM.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function dL(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function TS(t){let e={};for(let n in t)e[n]=t[n];return e}function AS(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 Eo{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=ap(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}=yc(ap(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&&yc(ap(r),o(e,n),null,e.attrs)}static renderSpec(e,n,r=null,o){return yc(e,n,r,o)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Eo(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=OS(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return OS(e.marks)}}function OS(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function ap(t){return t.document||window.document}const kS=new WeakMap;function hL(t){let e=kS.get(t);return e===void 0&&kS.set(t,e=pL(t)),e}function pL(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 yc(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=hL(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 v=g.indexOf(" ");v>0?d.setAttributeNS(g.slice(0,v),g.slice(v+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 v=e[g];if(v===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:b,contentDOM:S}=yc(t,v,n,r);if(d.appendChild(b),S){if(c)throw new RangeError("Multiple content holes");c=S}}}return{dom:d,contentDOM:c}}const LM=65535,IM=Math.pow(2,16);function mL(t,e){return t+e*IM}function NS(t){return t&LM}function gL(t){return(t-(t&LM))/IM}const BM=1,VM=2,vc=4,FM=8;class Wp{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&FM)>0}get deletedBefore(){return(this.delInfo&(BM|vc))>0}get deletedAfter(){return(this.delInfo&(VM|vc))>0}get deletedAcross(){return(this.delInfo&vc)>0}}class Mn{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&Mn.empty)return Mn.empty}recover(e){let n=0,r=NS(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+gL(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 v=h?e==d?-1:e==g?1:n:n,b=d+o+(v<0?0:p);if(r)return b;let S=e==(n<0?d:g)?null:mL(c/3,e-d),x=e==d?VM:e==g?BM:vc;return(n<0?e!=d:e!=g)&&(x|=FM),new Wp(b,x,S)}o+=p-h}return r?e+o:new Wp(e+o,0,null)}touches(e,n){let r=0,o=NS(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 Mn(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Mn.empty:new Mn(e<0?[0,-e,0]:[0,0,e])}}Mn.empty=new Mn([]);class pa{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 pa(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 pa;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 Wp(e,o,null)}}const up=Object.create(null);class Yt{getMap(){return Mn.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=up[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 up)throw new RangeError("Duplicate use of step JSON ID "+e);return up[e]=n,n.prototype.jsonID=e,n}}class yt{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new yt(e,null)}static fail(e){return new yt(null,e)}static fromReplace(e,n,r,o){try{return yt.ok(e.replace(n,r,o))}catch(l){if(l instanceof Nc)return yt.fail(l.message);throw l}}}function qm(t,e,n){let r=[];for(let o=0;o<t.childCount;o++){let l=t.child(o);l.content.size&&(l=l.copy(qm(l.content,e,l))),l.isInline&&(l=e(l,n,o)),r.push(l)}return ee.fromArray(r)}class Ci extends Yt{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 oe(qm(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 yt.fromReplace(e,this.from,this.to,l)}invert(){return new Yn(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 Ci(n.pos,r.pos,this.mark)}merge(e){return e instanceof Ci&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Ci(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 Ci(n.from,n.to,e.markFromJSON(n.mark))}}Yt.jsonID("addMark",Ci);class Yn extends Yt{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 oe(qm(n.content,o=>o.mark(this.mark.removeFromSet(o.marks)),e),n.openStart,n.openEnd);return yt.fromReplace(e,this.from,this.to,r)}invert(){return new Ci(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 Yn(n.pos,r.pos,this.mark)}merge(e){return e instanceof Yn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Yn(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 Yn(n.from,n.to,e.markFromJSON(n.mark))}}Yt.jsonID("removeMark",Yn);class Mi extends Yt{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return yt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return yt.fromReplace(e,this.pos,this.pos+1,new oe(ee.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 Mi(this.pos,n.marks[o]);return new Mi(this.pos,this.mark)}}return new So(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Mi(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 Mi(n.pos,e.markFromJSON(n.mark))}}Yt.jsonID("addNodeMark",Mi);class So extends Yt{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return yt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return yt.fromReplace(e,this.pos,this.pos+1,new oe(ee.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new Mi(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new So(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 So(n.pos,e.markFromJSON(n.mark))}}Yt.jsonID("removeNodeMark",So);class Rt extends Yt{constructor(e,n,r,o=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=o}apply(e){return this.structure&&em(e,this.from,this.to)?yt.fail("Structure replace would overwrite content"):yt.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Mn([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?oe.empty:new oe(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?oe.empty:new oe(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,oe.fromJSON(e,n.slice),!!n.structure)}}Yt.jsonID("replace",Rt);class Tt extends Yt{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&&(em(e,this.from,this.gapFrom)||em(e,this.gapTo,this.to)))return yt.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return yt.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?yt.fromReplace(e,this.from,this.to,r):yt.fail("Content does not fit in gap")}getMap(){return new Mn([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,oe.fromJSON(e,n.slice),n.insert,!!n.structure)}}Yt.jsonID("replaceAround",Tt);function em(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 yL(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 v=Math.max(h,e),b=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==v&&a.mark.eq(g[x])?a.to=b:o.push(a=new Yn(v,b,g[x])));c&&c.to==v?c.to=b:l.push(c=new Ci(v,b,r))}}),o.forEach(d=>t.step(d)),l.forEach(d=>t.step(d))}function vL(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 uf){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],v;for(let b=0;b<o.length;b++){let S=o[b];S.step==l-1&&g.eq(o[b].style)&&(v=S)}v?(v.to=h,v.step=l):o.push({style:g,from:Math.max(c,e),to:h,step:l})}}}),o.forEach(a=>t.step(new Yn(a.from,a.to,a.style)))}function Gm(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,oe.empty));else{r=g;for(let v=0;v<h.marks.length;v++)n.allowsMarkType(h.marks[v].type)||t.step(new Yn(c,p,h.marks[v]));if(o&&h.isText&&n.whitespace!="pre"){let v,b=/\r?\n|\r/g,S;for(;v=b.exec(h.text);)S||(S=new oe(ee.from(n.schema.text(" ",n.allowedMarks(h.marks))),0,0)),a.push(new Rt(c+v.index,c+v.index+v[0].length,S))}}c=p}if(!r.validEnd){let d=r.fillBefore(ee.empty,!0);t.replace(c,c,new oe(d,0,0))}for(let d=a.length-1;d>=0;d--)t.step(a[d])}function bL(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function qs(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||!bL(a,c,d))break;c&&(o=1),d<a.childCount&&(l=1)}return null}function SL(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=ee.empty,g=0;for(let S=l,x=!1;S>n;S--)x||r.index(S)>0?(x=!0,p=ee.from(r.node(S).copy(p)),g++):d--;let v=ee.empty,b=0;for(let S=l,x=!1;S>n;S--)x||o.after(S+1)<o.end(S)?(x=!0,v=ee.from(o.node(S).copy(v)),b++):h++;t.step(new Tt(d,h,a,c,new oe(p.append(v),g,b),p.size-g,!0))}function PM(t,e,n=null,r=t){let o=xL(t,e),l=o&&wL(r,e);return l?o.map(DS).concat({type:e,attrs:n}).concat(l.map(DS)):null}function DS(t){return{type:t,attrs:null}}function xL(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 wL(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 CL(t,e,n){let r=ee.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=ee.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 oe(r,0,0),n.length,!0))}function ML(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)&&EL(t.doc,t.mapping.slice(l).map(c),r)){let h=null;if(r.schema.linebreakReplacement){let b=r.whitespace=="pre",S=!!r.contentMatch.matchType(r.schema.linebreakReplacement);b&&!S?h=!1:!b&&S&&(h=!0)}h===!1&&HM(t,a,c,l),Gm(t,t.mapping.slice(l).map(c,1),r,void 0,h===null);let p=t.mapping.slice(l),g=p.map(c,1),v=p.map(c+a.nodeSize,1);return t.step(new Tt(g,v,g+1,v-1,new oe(ee.from(r.create(d,null,a.marks)),0,0),1,!0)),h===!0&&$M(t,a,c,l),!1}})}function $M(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 HM(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 EL(t,e,n){let r=t.resolve(e),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}function RL(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 oe(ee.from(a),0,0),1,!0))}function Br(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),v=o.index(h);if(g.type.spec.isolating)return!1;let b=g.content.cutByIndex(v,g.childCount),S=r&&r[p+1];S&&(b=b.replaceChild(0,S.type.create(S.attrs)));let x=r&&r[p]||g;if(!g.canReplace(v+1,g.childCount)||!x.type.validContent(b))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 TL(t,e,n=1,r){let o=t.doc.resolve(e),l=ee.empty,a=ee.empty;for(let c=o.depth,d=o.depth-n,h=n-1;c>d;c--,h--){l=ee.from(o.node(c).copy(l));let p=r&&r[h];a=ee.from(p?p.type.create(p.attrs,a):o.node(c).copy(a))}t.step(new Rt(e,e,new oe(l.append(a),n,n),!0))}function Ro(t,e){let n=t.resolve(e),r=n.index();return UM(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function AL(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 UM(t,e){return!!(t&&e&&!t.isLeaf&&AL(t,e))}function cf(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&&UM(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 OL(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);HM(t,p.node(),p.before(),c)}a.inlineContent&&Gm(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),oe.empty,!0)),r===!0){let p=t.doc.resolve(h);$M(t,p.node(),p.before(),t.steps.length)}return t}function kL(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 qM(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 ff(t,e,n=e,r=oe.empty){if(e==n&&!r.size)return null;let o=t.resolve(e),l=t.resolve(n);return GM(o,l,r)?new Rt(e,n,r):new NL(o,l,r).fit()}function GM(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class NL{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=ee.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=ee.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 oe(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=cp(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(ee.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=cp(e,n);return!o.childCount||o.firstChild.isLeaf?!1:(this.unplaced=new oe(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=cp(e,n);if(o.childCount<=1&&n>0){let l=e.size-n<=n+o.size;this.unplaced=new oe(Xl(e,n-1,1),n-1,l?n-1:r)}else this.unplaced=new oe(Xl(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:v}=this.frontier[n];if(o){for(let x=0;x<o.childCount;x++)p.push(o.child(x));g=g.matchFragment(o)}let b=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(KM(x.mark(v.allowedMarks(x.marks)),h==1?d:0,h==c.childCount?b:-1)))}let S=h==c.childCount;S||(b=-1),this.placed=Jl(this.placed,n,ee.from(p)),this.frontier[n].match=g,S&&b<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let x=0,C=c;x<b;x++){let E=C.lastChild;this.frontier.push({type:E.type,match:E.contentMatchAt(E.childCount)}),C=E.content}this.unplaced=S?e==0?oe.empty:new oe(Xl(a.content,e-1,1),e-1,b<0?a.openEnd:e-1):new oe(Xl(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||!fp(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=fp(e,n,o,r,l);if(a){for(let c=n-1;c>=0;c--){let{match:d,type:h}=this.frontier[c],p=fp(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=Jl(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=Jl(this.placed,this.depth,ee.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(ee.empty,!0);n.childCount&&(this.placed=Jl(this.placed,this.frontier.length,n))}}function Xl(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Xl(t.firstChild.content,e-1,n)))}function Jl(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Jl(t.lastChild.content,e-1,n)))}function cp(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function KM(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,KM(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(ee.empty,!0)))),t.copy(r)}function fp(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&&!DL(n,l.content,a)?c:null}function DL(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function _L(t){return t.spec.defining||t.spec.definingForContent}function zL(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let o=t.doc.resolve(e),l=t.doc.resolve(n);if(GM(o,l,r))return t.step(new Rt(e,n,r));let a=XM(o,l);a[a.length-1]==0&&a.pop();let c=-(o.depth+1);a.unshift(c);for(let v=o.depth,b=o.pos-1;v>0;v--,b--){let S=o.node(v).type.spec;if(S.defining||S.definingAsContext||S.isolating)break;a.indexOf(v)>-1?c=v:o.before(v)==b&&a.splice(1,0,-v)}let d=a.indexOf(c),h=[],p=r.openStart;for(let v=r.content,b=0;;b++){let S=v.firstChild;if(h.push(S),b==r.openStart)break;v=S.content}for(let v=p-1;v>=0;v--){let b=h[v],S=_L(b.type);if(S&&!b.sameMarkup(o.node(Math.abs(c)-1)))p=v;else if(S||!b.type.isTextblock)break}for(let v=r.openStart;v>=0;v--){let b=(v+p+1)%(r.openStart+1),S=h[b];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),N=o.index(C-1);if(A.canReplaceWith(N,N,S.type,S.marks))return t.replace(o.before(C),E?l.after(C):n,new oe(YM(r.content,0,r.openStart,b),b,r.openEnd))}}let g=t.steps.length;for(let v=a.length-1;v>=0&&(t.replace(e,n,r),!(t.steps.length>g));v--){let b=a[v];b<0||(e=o.before(b),n=l.after(b))}}function YM(t,e,n,r,o){if(e<n){let l=t.firstChild;t=t.replaceChild(0,l.copy(YM(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(ee.empty,!0))}return t}function jL(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let o=kL(t.doc,e,r.type);o!=null&&(e=n=o)}t.replaceRange(e,n,new oe(ee.from(r),0,0))}function LL(t,e,n){let r=t.doc.resolve(e),o=t.doc.resolve(n),l=XM(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 XM(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 _s extends Yt{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 yt.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 yt.fromReplace(e,this.pos,this.pos+1,new oe(ee.from(o),0,n.isLeaf?0:1))}getMap(){return Mn.empty}invert(e){return new _s(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 _s(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 _s(n.pos,n.attr,n.value)}}Yt.jsonID("attr",_s);class ma extends Yt{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 yt.ok(r)}getMap(){return Mn.empty}invert(e){return new ma(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 ma(n.attr,n.value)}}Yt.jsonID("docAttr",ma);let Ls=class extends Error{};Ls=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};Ls.prototype=Object.create(Error.prototype);Ls.prototype.constructor=Ls;Ls.prototype.name="TransformError";class JM{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new pa}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new Ls(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=oe.empty){let o=ff(this.doc,e,n,r);return o&&this.step(o),this}replaceWith(e,n,r){return this.replace(e,n,new oe(ee.from(r),0,0))}delete(e,n){return this.replace(e,n,oe.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return zL(this,e,n,r),this}replaceRangeWith(e,n,r){return jL(this,e,n,r),this}deleteRange(e,n){return LL(this,e,n),this}lift(e,n){return SL(this,e,n),this}join(e,n=1){return OL(this,e,n),this}wrap(e,n){return CL(this,e,n),this}setBlockType(e,n=e,r,o=null){return ML(this,e,n,r,o),this}setNodeMarkup(e,n,r=null,o){return RL(this,e,n,r,o),this}setNodeAttribute(e,n,r){return this.step(new _s(e,n,r)),this}setDocAttribute(e,n){return this.step(new ma(e,n)),this}addNodeMark(e,n){return this.step(new Mi(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 So(e,n));else{let o=r.marks,l,a=[];for(;l=n.isInSet(o);)a.push(new So(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 TL(this,e,n,r),this}addMark(e,n,r){return yL(this,e,n,r),this}removeMark(e,n,r){return vL(this,e,n,r),this}clearIncompatible(e,n,r){return Gm(this,e,n,r),this}}const dp=Object.create(null);class _e{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new IL(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=oe.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?oe.empty:n),c==0&&jS(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),jS(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let o=e.parent.inlineContent?new Oe(e):Rs(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?Rs(e.node(0),e.node(l),e.before(l+1),e.index(l),n,r):Rs(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 Rn(e.node(0))}static atStart(e){return Rs(e,e,0,0,1)||new Rn(e)}static atEnd(e){return Rs(e,e,e.content.size,e.childCount,-1)||new Rn(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=dp[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 dp)throw new RangeError("Duplicate use of selection JSON ID "+e);return dp[e]=n,n.prototype.jsonID=e,n}getBookmark(){return Oe.between(this.$anchor,this.$head).getBookmark()}}_e.prototype.visible=!0;class IL{constructor(e,n){this.$from=e,this.$to=n}}let _S=!1;function zS(t){!_S&&!t.parent.inlineContent&&(_S=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class Oe extends _e{constructor(e,n=e){zS(e),zS(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 _e.near(r);let o=e.resolve(n.map(this.anchor));return new Oe(o.parent.inlineContent?o:r,r)}replace(e,n=oe.empty){if(super.replace(e,n),n==oe.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 df(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=_e.findFrom(n,r,!0)||_e.findFrom(n,-r,!0);if(l)n=l.$head;else return _e.near(n,r)}return e.parent.inlineContent||(o==0?e=n:(e=(_e.findFrom(e,-r,!0)||_e.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=o<0&&(e=n))),new Oe(e,n)}}_e.jsonID("text",Oe);class df{constructor(e,n){this.anchor=e,this.head=n}map(e){return new df(e.map(this.anchor),e.map(this.head))}resolve(e){return Oe.between(e.resolve(this.anchor),e.resolve(this.head))}}class Se extends _e{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?_e.near(l):new Se(l)}content(){return new oe(ee.from(this.node),0,0)}eq(e){return e instanceof Se&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Km(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Se(e.resolve(n.anchor))}static create(e,n){return new Se(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}Se.prototype.visible=!1;_e.jsonID("node",Se);class Km{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new df(r,r):new Km(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&Se.isSelectable(r)?new Se(n):_e.near(n)}}class Rn extends _e{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=oe.empty){if(n==oe.empty){e.delete(0,e.doc.content.size);let r=_e.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new Rn(e)}map(e){return new Rn(e)}eq(e){return e instanceof Rn}getBookmark(){return BL}}_e.jsonID("all",Rn);const BL={map(){return this},resolve(t){return new Rn(t)}};function Rs(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&&Se.isSelectable(c))return Se.create(t,n-(o<0?c.nodeSize:0))}else{let d=Rs(t,c,n+o,o<0?c.childCount:0,o,l);if(d)return d}n+=c.nodeSize*o}return null}function jS(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(_e.near(t.doc.resolve(a),n))}const LS=1,lc=2,IS=4;class VL extends JM{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|LS)&~lc,this.storedMarks=null,this}get selectionSet(){return(this.updated&LS)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=lc,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&lc)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~lc,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(_e.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|=IS,this}get scrolledIntoView(){return(this.updated&IS)>0}}function BS(t,e){return!e||!t?t:t.bind(e)}class Ql{constructor(e,n,r){this.name=e,this.init=BS(n.init,r),this.apply=BS(n.apply,r)}}const FL=[new Ql("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new Ql("selection",{init(t,e){return t.selection||_e.atStart(e.doc)},apply(t){return t.selection}}),new Ql("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new Ql("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class hp{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=FL.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 Ql(r.key,r.spec.state,r))})}}class As{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 As(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 VL(this)}static create(e){let n=new hp(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new As(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 hp(this.schema,e.plugins),r=n.fields,o=new As(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 hp(e.schema,e.plugins),l=new As(o);return o.fields.forEach(a=>{if(a.name=="doc")l.doc=Ri.fromJSON(e.schema,n.doc);else if(a.name=="selection")l.selection=_e.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 QM(t,e,n){for(let r in t){let o=t[r];o instanceof Function?o=o.bind(e):r=="handleDOMEvents"&&(o=QM(o,e,{})),n[r]=o}return n}class vt{constructor(e){this.spec=e,this.props={},e.props&&QM(e.props,this,this.props),this.key=e.key?e.key.key:ZM("plugin")}getState(e){return e[this.key]}}const pp=Object.create(null);function ZM(t){return t in pp?t+"$"+ ++pp[t]:(pp[t]=0,t+"$")}class Xt{constructor(e="key"){this.key=ZM(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const Ym=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function WM(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const eE=(t,e,n)=>{let r=WM(t,n);if(!r)return!1;let o=Xm(r);if(!o){let a=r.blockRange(),c=a&&qs(a);return c==null?!1:(e&&e(t.tr.lift(a,c).scrollIntoView()),!0)}let l=o.nodeBefore;if(uE(t,o,e,-1))return!0;if(r.parent.content.size==0&&(Is(l,"end")||Se.isSelectable(l)))for(let a=r.depth;;a--){let c=ff(t.doc,r.before(a),r.after(a),oe.empty);if(c&&c.slice.size<c.to-c.from){if(e){let d=t.tr.step(c);d.setSelection(Is(l,"end")?_e.findFrom(d.doc.resolve(d.mapping.map(o.pos,-1)),-1):Se.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},PL=(t,e,n)=>{let r=WM(t,n);if(!r)return!1;let o=Xm(r);return o?tE(t,o,e):!1},$L=(t,e,n)=>{let r=rE(t,n);if(!r)return!1;let o=Jm(r);return o?tE(t,o,e):!1};function tE(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=ff(t.doc,l,d,oe.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 Is(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 nE=(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=Xm(r)}let a=l&&l.nodeBefore;return!a||!Se.isSelectable(a)?!1:(e&&e(t.tr.setSelection(Se.create(t.doc,l.pos-a.nodeSize)).scrollIntoView()),!0)};function Xm(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 rE(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const iE=(t,e,n)=>{let r=rE(t,n);if(!r)return!1;let o=Jm(r);if(!o)return!1;let l=o.nodeAfter;if(uE(t,o,e,1))return!0;if(r.parent.content.size==0&&(Is(l,"start")||Se.isSelectable(l))){let a=ff(t.doc,r.before(),r.after(),oe.empty);if(a&&a.slice.size<a.to-a.from){if(e){let c=t.tr.step(a);c.setSelection(Is(l,"start")?_e.findFrom(c.doc.resolve(c.mapping.map(o.pos)),1):Se.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},oE=(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=Jm(r)}let a=l&&l.nodeAfter;return!a||!Se.isSelectable(a)?!1:(e&&e(t.tr.setSelection(Se.create(t.doc,l.pos)).scrollIntoView()),!0)};function Jm(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 HL=(t,e)=>{let n=t.selection,r=n instanceof Se,o;if(r){if(n.node.isTextblock||!Ro(t.doc,n.from))return!1;o=n.from}else if(o=cf(t.doc,n.from,-1),o==null)return!1;if(e){let l=t.tr.join(o);r&&l.setSelection(Se.create(l.doc,o-t.doc.resolve(o).nodeBefore.nodeSize)),e(l.scrollIntoView())}return!0},UL=(t,e)=>{let n=t.selection,r;if(n instanceof Se){if(n.node.isTextblock||!Ro(t.doc,n.to))return!1;r=n.to}else if(r=cf(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},qL=(t,e)=>{let{$from:n,$to:r}=t.selection,o=n.blockRange(r),l=o&&qs(o);return l==null?!1:(e&&e(t.tr.lift(o,l).scrollIntoView()),!0)},sE=(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 Qm(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 GL=(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=Qm(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(_e.near(d.doc.resolve(c),1)),e(d.scrollIntoView())}return!0},lE=(t,e)=>{let n=t.selection,{$from:r,$to:o}=n;if(n instanceof Rn||r.parent.inlineContent||o.parent.inlineContent)return!1;let l=Qm(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},aE=(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(Br(t.doc,l))return e&&e(t.tr.split(l).scrollIntoView()),!0}let r=n.blockRange(),o=r&&qs(r);return o==null?!1:(e&&e(t.tr.lift(r,o).scrollIntoView()),!0)};function KL(t){return(e,n)=>{let{$from:r,$to:o}=e.selection;if(e.selection instanceof Se&&e.selection.node.isBlock)return!r.parentOffset||!Br(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 b=r.depth;;b--)if(r.node(b).isBlock){d=r.end(b)==r.pos+(r.depth-b),h=r.start(b)==r.pos-(r.depth-b),c=Qm(r.node(b-1).contentMatchAt(r.indexAfter(b-1))),l.unshift(d&&c?{type:c}:null),a=b;break}else{if(b==1)return!1;l.unshift(null)}let p=e.tr;(e.selection instanceof Oe||e.selection instanceof Rn)&&p.deleteSelection();let g=p.mapping.map(r.pos),v=Br(p.doc,g,l.length,l);if(v||(l[0]=c?{type:c}:null,v=Br(p.doc,g,l.length,l)),!v)return!1;if(p.split(g,l.length,l),!d&&h&&r.node(a).type!=c){let b=p.mapping.map(r.before(a)),S=p.doc.resolve(b);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 YL=KL(),XL=(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(Se.create(t.doc,o))),!0)};function JL(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||Ro(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function uE(t,e,n,r){let o=e.nodeBefore,l=e.nodeAfter,a,c,d=o.type.spec.isolating||l.type.spec.isolating;if(!d&&JL(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 b=e.pos+l.nodeSize,S=ee.empty;for(let E=a.length-1;E>=0;E--)S=ee.from(a[E].create(null,S));S=ee.from(o.copy(S));let x=t.tr.step(new Tt(e.pos-1,b,e.pos,b,new oe(S,1,0),a.length,!0)),C=x.doc.resolve(b+2*a.length);C.nodeAfter&&C.nodeAfter.type==o.type&&Ro(x.doc,C.pos)&&x.join(C.pos),n(x.scrollIntoView())}return!0}let p=l.type.spec.isolating||r>0&&d?null:_e.findFrom(e,1),g=p&&p.$from.blockRange(p.$to),v=g&&qs(g);if(v!=null&&v>=e.depth)return n&&n(t.tr.lift(g,v).scrollIntoView()),!0;if(h&&Is(l,"start",!0)&&Is(o,"end")){let b=o,S=[];for(;S.push(b),!b.isTextblock;)b=b.lastChild;let x=l,C=1;for(;!x.isTextblock;x=x.firstChild)C++;if(b.canReplace(b.childCount,b.childCount,x.content)){if(n){let E=ee.empty;for(let N=S.length-1;N>=0;N--)E=ee.from(S[N].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 oe(E,S.length,0),0,!0));n(A.scrollIntoView())}return!0}}return!1}function cE(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 QL=cE(-1),ZL=cE(1);function WL(t,e=null){return function(n,r){let{$from:o,$to:l}=n.selection,a=o.blockRange(l),c=a&&PM(a,t,e);return c?(r&&r(n.tr.wrap(a,c).scrollIntoView()),!0):!1}}function VS(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 Zm(...t){return function(e,n,r){for(let o=0;o<t.length;o++)if(t[o](e,n,r))return!0;return!1}}Zm(Ym,eE,nE);Zm(Ym,iE,oE);Zm(sE,lE,aE,YL);typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function eI(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 tI(c,a,t,e)?(r&&r(c.scrollIntoView()),!0):!1}}function tI(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 _c(d,d,e.depth),e.endIndex<e.parent.childCount&&(e=new _c(e.$from,a.resolve(e.$to.end(e.depth)),e.depth)),o=!0}let c=PM(l,n,r,e);return c?(t&&nI(t,e,c,o,n),!0):!1}function nI(t,e,n,r,o){let l=ee.empty;for(let p=n.length-1;p>=0;p--)l=ee.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 oe(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,v=!0;p<g;p++,v=!1)!v&&Br(t.doc,d,c)&&(t.split(d,c),d+=2*c),d+=h.child(p).nodeSize;return t}function rI(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?iI(e,n,t,l):oI(e,n,l):!0:!1}}function iI(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 oe(ee.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new _c(o.doc.resolve(r.$from.pos),o.doc.resolve(a),r.depth));const c=qs(r);if(c==null)return!1;o.lift(r,c);let d=o.doc.resolve(o.mapping.map(l,-1)-1);return Ro(o.doc,d.pos)&&d.nodeBefore.type==d.nodeAfter.type&&o.join(d.pos),e(o.scrollIntoView()),!0}function oI(t,e,n){let r=t.tr,o=n.parent;for(let b=n.end,S=n.endIndex-1,x=n.startIndex;S>x;S--)b-=o.child(S).nodeSize,r.delete(b-1,b+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?ee.empty:ee.from(o))))return!1;let g=l.pos,v=g+a.nodeSize;return r.step(new Tt(g-(c?1:0),v+(d?1:0),g+1,v-1,new oe((c?ee.empty:ee.from(o.copy(ee.empty))).append(d?ee.empty:ee.from(o.copy(ee.empty))),c?0:1,d?0:1),c?0:1)),e(r.scrollIntoView()),!0}function sI(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=ee.from(h?t.create():null),g=new oe(ee.from(t.create(null,ee.from(c.type.create(null,p)))),h?3:1,0),v=l.start,b=l.end;n(e.tr.step(new Tt(v-(h?3:1),b,v,b,g,1,!0)).scrollIntoView())}return!0}}const Lt=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},Bs=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let tm=null;const Lr=function(t,e,n){let r=tm||(tm=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},lI=function(){tm=null},xo=function(t,e,n,r){return n&&(FS(t,e,n,r,-1)||FS(t,e,n,r,1))},aI=/^(img|br|input|textarea|hr)$/i;function FS(t,e,n,r,o){for(var l;;){if(t==n&&e==r)return!0;if(e==(o<0?0:Vn(t))){let a=t.parentNode;if(!a||a.nodeType!=1||Oa(t)||aI.test(t.nodeName)||t.contentEditable=="false")return!1;e=Lt(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?Vn(t):0}else return!1}}function Vn(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function uI(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=Vn(t)}else if(t.parentNode&&!Oa(t))e=Lt(t),t=t.parentNode;else return null}}function cI(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&&!Oa(t))e=Lt(t)+1,t=t.parentNode;else return null}}function fI(t,e,n){for(let r=e==0,o=e==Vn(t);r||o;){if(t==n)return!0;let l=Lt(t);if(t=t.parentNode,!t)return!1;r=r&&l==0,o=o&&l==Vn(t)}}function Oa(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 hf=function(t){return t.focusNode&&xo(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function ao(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function dI(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function hI(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:Math.min(Vn(r.offsetNode),r.offset)}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:Math.min(Vn(r.startContainer),r.startOffset)}}}const cr=typeof navigator<"u"?navigator:null,PS=typeof document<"u"?document:null,Bi=cr&&cr.userAgent||"",nm=/Edge\/(\d+)/.exec(Bi),fE=/MSIE \d/.exec(Bi),rm=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Bi),pn=!!(fE||rm||nm),Ai=fE?document.documentMode:rm?+rm[1]:nm?+nm[1]:0,Pn=!pn&&/gecko\/(\d+)/i.test(Bi);Pn&&+(/Firefox\/(\d+)/.exec(Bi)||[0,0])[1];const im=!pn&&/Chrome\/(\d+)/.exec(Bi),Bt=!!im,dE=im?+im[1]:0,Ut=!pn&&!!cr&&/Apple Computer/.test(cr.vendor),Vs=Ut&&(/Mobile\/\w+/.test(Bi)||!!cr&&cr.maxTouchPoints>2),Bn=Vs||(cr?/Mac/.test(cr.platform):!1),hE=cr?/Win/.test(cr.platform):!1,Ir=/Android \d/.test(Bi),ka=!!PS&&"webkitFontSmoothing"in PS.documentElement.style,pI=ka?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function mI(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 gI(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 $S(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=Bs(a);continue}let c=a,d=c==l.body,h=d?mI(l):gI(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 b=c.scrollLeft,S=c.scrollTop;g&&(c.scrollTop+=g),p&&(c.scrollLeft+=p);let x=c.scrollLeft-b,C=c.scrollTop-S;e={left:e.left-x,top:e.top-C,right:e.right-x,bottom:e.bottom-C}}let v=d?"fixed":getComputedStyle(a).position;if(/^(fixed|sticky)$/.test(v))break;a=v=="absolute"?a.offsetParent:Bs(a)}}function yI(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:pE(t.dom)}}function pE(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=Bs(r));return e}function vI({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;mE(n,r==0?0:r-e)}function mE(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 Cs=null;function bI(t){if(t.setActive)return t.setActive();if(Cs)return t.focus(Cs);let e=pE(t);t.focus(Cs==null?{get preventScroll(){return Cs={preventScroll:!0},!0}}:void 0),Cs||(Cs=!1,mE(e,0))}function gE(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 v;if(p.nodeType==1)v=p.getClientRects();else if(p.nodeType==3)v=Lr(p).getClientRects();else continue;for(let b=0;b<v.length;b++){let S=v[b];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?SI(n,o):!n||r&&n.nodeType==1?{node:t,offset:l}:gE(n,o)}function SI(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=bi(r,1);if(a.top!=a.bottom&&Wm(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 Wm(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function xI(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function wI(t,e,n){let{node:r,offset:o}=gE(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 CI(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 yE(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(Wm(e,h))return yE(a,e,h)}}if((l=(l+1)%r)==o)break}return t}function MI(t,e){let n=t.dom.ownerDocument,r,o=0,l=hI(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(!Wm(e,h)||(a=yE(t.dom,e,h),!a))return null}if(Ut)for(let h=a;r&&h;h=Bs(h))h.draggable&&(r=void 0);if(a=xI(a,e),r){if(Pn&&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;ka&&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=CI(t,r,o,e))}c==null&&(c=wI(t,a,e));let d=t.docView.nearestDesc(a,!0);return{pos:c,inside:d?d.posAtStart-d.border:-1}}function HS(t){return t.top<t.bottom||t.left<t.right}function bi(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(HS(r))return r}return Array.prototype.find.call(n,HS)||t.getBoundingClientRect()}const EI=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function vE(t,e,n){let{node:r,offset:o,atom:l}=t.docView.domFromPos(e,n<0?-1:1),a=ka||Pn;if(r.nodeType==3)if(a&&(EI.test(r.nodeValue)||(n<0?!o:o==r.nodeValue.length))){let d=bi(Lr(r,o,o),n);if(Pn&&o&&/\s/.test(r.nodeValue[o-1])&&o<r.nodeValue.length){let h=bi(Lr(r,o-1,o-1),-1);if(h.top==d.top){let p=bi(Lr(r,o,o+1),-1);if(p.top!=d.top)return ql(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++,ql(bi(Lr(r,d,h),p),p<0)}if(!t.state.doc.resolve(e-(l||0)).parent.inlineContent){if(l==null&&o&&(n<0||o==Vn(r))){let d=r.childNodes[o-1];if(d.nodeType==1)return mp(d.getBoundingClientRect(),!1)}if(l==null&&o<Vn(r)){let d=r.childNodes[o];if(d.nodeType==1)return mp(d.getBoundingClientRect(),!0)}return mp(r.getBoundingClientRect(),n>=0)}if(l==null&&o&&(n<0||o==Vn(r))){let d=r.childNodes[o-1],h=d.nodeType==3?Lr(d,Vn(d)-(a?0:1)):d.nodeType==1&&(d.nodeName!="BR"||!d.nextSibling)?d:null;if(h)return ql(bi(h,1),!1)}if(l==null&&o<Vn(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 ql(bi(h,-1),!0)}return ql(bi(r.nodeType==3?Lr(r):r,-n),n>=0)}function ql(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 mp(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 bE(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 RI(t,e,n){let r=e.selection,o=n=="up"?r.$from:r.$to;return bE(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=vE(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 TI=/[\u0590-\u08ac]/;function AI(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?!TI.test(r.parent.textContent)||!c.modify?n=="left"||n=="backward"?l:a:bE(t,e,()=>{let{focusNode:d,focusOffset:h,anchorNode:p,anchorOffset:g}=t.domSelectionRange(),v=c.caretBidiLevel;c.modify("move",n,"character");let b=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:S,focusOffset:x}=t.domSelectionRange(),C=S&&!b.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 v!=null&&(c.caretBidiLevel=v),C}):r.pos==r.start()||r.pos==r.end()}let US=null,qS=null,GS=!1;function OI(t,e,n){return US==e&&qS==n?GS:(US=e,qS=n,GS=n=="up"||n=="down"?RI(t,e,n):AI(t,e,n))}const $n=0,KS=1,uo=2,fr=3;class Na{constructor(e,n,r,o){this.parent=e,this.children=n,this.dom=r,this.contentDOM=o,this.dirty=$n,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>Lt(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 xE){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 SE&&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?Lt(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?Lt(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 v=this.children[g-1];if(v.size&&v.dom.parentNode==this.contentDOM&&!v.emptyChildAt(1)){o=Lt(v.dom)+1;break}e-=v.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=Lt(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 b=0,S=0;b<this.children.length;b++){let x=this.children[b],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((Pn||Ut)&&e==n){let{node:b,offset:S}=c;if(b.nodeType==3){if(g=!!(S&&b.nodeValue[S-1]==`
61
+ `),g&&S==b.nodeValue.length)for(let x=b,C;x;x=x.parentNode){if(C=x.nextSibling){C.nodeName=="BR"&&(c=d={node:C.parentNode,offset:Lt(C)+1});break}let E=x.pmViewDesc;if(E&&E.node&&E.node.isBlock)break}}else{let x=b.childNodes[S-1];g=x&&(x.nodeName=="BR"||x.contentEditable=="false")}}if(Pn&&p.focusNode&&p.focusNode!=d.node&&p.focusNode.nodeType==1){let b=p.focusNode.childNodes[p.focusOffset];b&&b.contentEditable=="false"&&(o=!0)}if(!(o||g&&Ut)&&xo(c.node,c.offset,p.anchorNode,p.anchorOffset)&&xo(d.node,d.offset,p.focusNode,p.focusOffset))return;let v=!1;if((h.extend||e==n)&&!(g&&Pn)){h.collapse(c.node,c.offset);try{e!=n&&h.extend(d.node,d.offset),v=!0}catch{}}if(!v){if(e>n){let S=c;c=d,d=S}let b=document.createRange();b.setEnd(d.node,d.offset),b.setStart(c.node,c.offset),h.removeAllRanges(),h.addRange(b)}}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?uo:KS,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?uo:fr}r=a}this.dirty=uo}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?uo:KS;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class SE extends Na{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==$n&&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 kI extends Na{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 wo extends Na{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=Eo.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new wo(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!=$n){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=$n}}slice(e,n,r){let o=wo.create(this.parent,this.mark,!0,r),l=this.children,a=this.size;n<a&&(l=sm(l,n,a,r)),e>0&&(l=sm(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 Oi extends Na{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}=Eo.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 v=p;return p=ME(p,r,n),h?d=new NI(e,n,r,o,p,g||null,v,h,l,a+1):n.isText?new pf(e,n,r,o,p,v,l):new Oi(e,n,r,o,p,g||null,v,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=()=>ee.empty)}return e}matchesNode(e,n,r){return this.dirty==$n&&e.eq(this.node)&&jc(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 _I(this,a&&a.node,e);LI(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,v)=>{d.syncToMarks(h.marks,r,e,v);let b;d.findNodeMatch(h,p,g,v)||c&&e.state.selection.from>o&&e.state.selection.to<o+h.nodeSize&&(b=d.findIndexWithChild(l.node))>-1&&d.updateNodeAt(h,p,g,b,e)||d.updateNextNode(h,p,g,e,v,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==uo)&&(a&&this.protectLocalComposition(e,a),wE(this.contentDOM,this.children,e),Vs&&II(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=BI(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 kI(this,l,n,o);e.input.compositionNodes.push(a),this.children=sm(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=$n}updateOuterDeco(e){if(jc(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=CE(this.dom,this.nodeDOM,om(this.outerDeco,this.node,n),om(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 YS(t,e,n,r,o){ME(r,e,t);let l=new Oi(void 0,t,e,n,r,r,r,o,0);return l.contentDOM&&l.updateChildren(o,0),l}class pf extends Oi{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!=$n&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=$n||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=$n,!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 pf(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 xE extends Na{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==$n&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class NI extends Oi{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 wE(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=XS(r),o=!0;r=r.nextSibling}else o=!0,t.insertBefore(c,r);if(a instanceof wo){let d=r?r.previousSibling:t.lastChild;wE(a.contentDOM,a.children,n),r=d?d.nextSibling:t.firstChild}}for(;r;)r=XS(r),o=!0;o&&n.trackWrites==t&&(n.trackWrites=null)}const ra=function(t){t&&(this.nodeName=t)};ra.prototype=Object.create(null);const co=[new ra];function om(t,e,n){if(t.length==0)return co;let r=n?co[0]:new ra,o=[r];for(let l=0;l<t.length;l++){let a=t[l].type.attrs;if(a){a.nodeName&&o.push(r=new ra(a.nodeName));for(let c in a){let d=a[c];d!=null&&(n&&o.length==1&&o.push(r=new ra(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 CE(t,e,n,r){if(n==co&&r==co)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=co[0]),o=d}DI(o,c||co[0],a)}return o}function DI(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 ME(t,e,n){return CE(t,t,co,om(e,n,t.nodeType!=1))}function jc(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 XS(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class _I{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=zI(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=$n,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=wo.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=uo),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 Oi){let h=this.preMatch.matched.get(d);if(h!=null&&h!=l)return!1;let p=d.dom,g,v=this.isLocked(p)&&!(e.isText&&d.node&&d.node.isText&&d.nodeDOM.nodeValue==e.text&&d.dirty!=fr&&jc(n,d.outerDeco));if(!v&&d.update(e,n,r,o))return this.destroyBetween(this.index,c),d.dom!=p&&(this.changed=!0),this.index++,!0;if(!v&&(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=uo,g.updateChildren(o,a+1),g.dirty=$n),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)||!jc(r,e.outerDeco)||!o.eq(e.innerDeco))return null;let c=Oi.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=Oi.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 SE(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 wo;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof pf)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Ut||Bt)&&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 xE(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 zI(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 wo)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 jI(t,e){return t.type.side-e.type.side}function LI(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(jI);for(let C=0;C<g.length;C++)n(g[C],h,!!d)}else n(p,h,!!d);let v,b;if(d)b=-1,v=d,d=null;else if(h<t.childCount)b=h,v=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+v.nodeSize;if(v.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=v.cut(C-l),v=v.cut(0,C-l),S=C,b=-1)}else for(;a<o.length&&o[a].to<S;)a++;let x=v.isInline&&!v.isLeaf?c.filter(C=>!C.inline):c.slice();r(v,x,e.forChild(l,v),b),l=S}}function II(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 BI(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 sm(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 eg(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(hf(n)){for(d=a;o&&!o.node;)o=o.parent;let g=o.node;if(o&&g.isAtom&&Se.isSelectable(g)&&o.parent&&!(g.isInline&&fI(n.focusNode,n.focusOffset,o.dom))){let v=o.posBefore;h=new Se(a==v?c:r.resolve(v))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let g=a,v=a;for(let b=0;b<n.rangeCount;b++){let S=n.getRangeAt(b);g=Math.min(g,t.docView.posFromDOM(S.startContainer,S.startOffset,1)),v=Math.max(v,t.docView.posFromDOM(S.endContainer,S.endOffset,-1))}if(g<0)return null;[d,a]=v==t.state.selection.anchor?[v,g]:[g,v],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=tg(t,p,c,g)}return h}function EE(t){return t.editable?t.hasFocus():TE(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function Vr(t,e=!1){let n=t.state.selection;if(RE(t,n),!!EE(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&Bt){let r=t.domSelectionRange(),o=t.domObserver.currentSelection;if(r.anchorNode&&o.anchorNode&&xo(r.anchorNode,r.anchorOffset,o.anchorNode,o.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)FI(t);else{let{anchor:r,head:o}=n,l,a;JS&&!(n instanceof Oe)&&(n.$from.parent.inlineContent||(l=QS(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(a=QS(t,n.to))),t.docView.setSelection(r,o,t,e),JS&&(l&&ZS(l),a&&ZS(a)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&VI(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const JS=Ut||Bt&&dE<63;function QS(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(Ut&&o&&o.contentEditable=="false")return gp(o);if((!o||o.contentEditable=="false")&&(!l||l.contentEditable=="false")){if(o)return gp(o);if(l)return gp(l)}}function gp(t){return t.contentEditable="true",Ut&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function ZS(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function VI(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(()=>{(!EE(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function FI(t){let e=t.domSelection();if(!e)return;let n=t.cursorWrapper.dom,r=n.nodeName=="IMG";r?e.collapse(n.parentNode,Lt(n)+1):e.collapse(n,0),!r&&!t.state.selection.visible&&pn&&Ai<=11&&(n.disabled=!0,n.disabled=!1)}function RE(t,e){if(e instanceof Se){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(WS(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else WS(t)}function WS(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function tg(t,e,n,r){return t.someProp("createSelectionBetween",o=>o(t,e,n))||Oe.between(e,n,r)}function ex(t){return t.editable&&!t.hasFocus()?!1:TE(t)}function TE(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 PI(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return xo(e.node,e.offset,n.anchorNode,n.anchorOffset)}function lm(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&&_e.findFrom(l,e)}function Si(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function tx(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 Si(t,new Oe(r.$anchor,a))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let o=lm(t.state,e);return o&&o instanceof Se?Si(t,o):!1}else if(!(Bn&&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?Se.isSelectable(l)?Si(t,new Se(e<0?t.state.doc.resolve(o.pos-l.nodeSize):o)):ka?Si(t,new Oe(t.state.doc.resolve(e<0?c:c+l.nodeSize))):!1:!1}}else return!1;else{if(r instanceof Se&&r.node.isInline)return Si(t,new Oe(e>0?r.$to:r.$from));{let o=lm(t.state,e);return o?Si(t,o):!1}}}function Lc(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function ia(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function Ms(t,e){return e<0?$I(t):HI(t)}function $I(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o,l,a=!1;for(Pn&&n.nodeType==1&&r<Lc(n)&&ia(n.childNodes[r],-1)&&(a=!0);;)if(r>0){if(n.nodeType!=1)break;{let c=n.childNodes[r-1];if(ia(c,-1))o=n,l=--r;else if(c.nodeType==3)n=c,r=n.nodeValue.length;else break}}else{if(AE(n))break;{let c=n.previousSibling;for(;c&&ia(c,-1);)o=n.parentNode,l=Lt(c),c=c.previousSibling;if(c)n=c,r=Lc(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}a?am(t,n,r):o&&am(t,o,l)}function HI(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o=Lc(n),l,a;for(;;)if(r<o){if(n.nodeType!=1)break;let c=n.childNodes[r];if(ia(c,1))l=n,a=++r;else break}else{if(AE(n))break;{let c=n.nextSibling;for(;c&&ia(c,1);)l=c.parentNode,a=Lt(c)+1,c=c.nextSibling;if(c)n=c,r=0,o=Lc(n);else{if(n=n.parentNode,n==t.dom)break;r=o=0}}}l&&am(t,l,a)}function AE(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function UI(t,e){for(;t&&e==t.childNodes.length&&!Oa(t);)e=Lt(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 qI(t,e){for(;t&&!e&&!Oa(t);)e=Lt(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 am(t,e,n){if(e.nodeType!=3){let l,a;(a=UI(e,n))?(e=a,n=0):(l=qI(e,n))&&(e=l,n=l.nodeValue.length)}let r=t.domSelection();if(!r)return;if(hf(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 nx(t,e){let n=t.state.doc.resolve(e);if(!(Bt||hE)&&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 rx(t,e,n){let r=t.state.selection;if(r instanceof Oe&&!r.empty||n.indexOf("s")>-1||Bn&&n.indexOf("m")>-1)return!1;let{$from:o,$to:l}=r;if(!o.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let a=lm(t.state,e);if(a&&a instanceof Se)return Si(t,a)}if(!o.parent.inlineContent){let a=e<0?o:l,c=r instanceof Rn?_e.near(a,e):_e.findFrom(a,e);return c?Si(t,c):!1}return!1}function ix(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 ox(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function GI(t){if(!Ut||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;ox(t,r,"true"),setTimeout(()=>ox(t,r,"false"),20)}return!1}function KI(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function YI(t,e){let n=e.keyCode,r=KI(e);if(n==8||Bn&&n==72&&r=="c")return ix(t,-1)||Ms(t,-1);if(n==46&&!e.shiftKey||Bn&&n==68&&r=="c")return ix(t,1)||Ms(t,1);if(n==13||n==27)return!0;if(n==37||Bn&&n==66&&r=="c"){let o=n==37?nx(t,t.state.selection.from)=="ltr"?-1:1:-1;return tx(t,o,r)||Ms(t,o)}else if(n==39||Bn&&n==70&&r=="c"){let o=n==39?nx(t,t.state.selection.from)=="ltr"?1:-1:1;return tx(t,o,r)||Ms(t,o)}else{if(n==38||Bn&&n==80&&r=="c")return rx(t,-1,r)||Ms(t,-1);if(n==40||Bn&&n==78&&r=="c")return GI(t)||rx(t,1,r)||Ms(t,1);if(r==(Bn?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function ng(t,e){t.someProp("transformCopied",b=>{e=b(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 b=r.firstChild;n.push(b.type.name,b.attrs!=b.type.defaultAttrs?b.attrs:null),r=b.content}let a=t.someProp("clipboardSerializer")||Eo.fromSchema(t.state.schema),c=zE(),d=c.createElement("div");d.appendChild(a.serializeFragment(r,{document:c}));let h=d.firstChild,p,g=0;for(;h&&h.nodeType==1&&(p=_E[h.nodeName.toLowerCase()]);){for(let b=p.length-1;b>=0;b--){let S=c.createElement(p[b]);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 v=t.someProp("clipboardTextSerializer",b=>b(e,t))||e.content.textBetween(0,e.content.size,`
62
+
63
+ `);return{dom:d,text:v,slice:e}}function OE(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",v=>{e=v(e,l||r,t)}),l)return c=new oe(ee.from(t.state.schema.text(e.replace(/\r\n?/g,`
64
+ `))),0,0),t.someProp("transformPasted",v=>{c=v(c,t,!0)}),c;let g=t.someProp("clipboardTextParser",v=>v(e,o,r,t));if(g)c=g;else{let v=o.marks(),{schema:b}=t.state,S=Eo.fromSchema(b);a=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(x=>{let C=a.appendChild(document.createElement("p"));x&&C.appendChild(S.serializeNode(b.text(x,v)))})}}else t.someProp("transformPastedHTML",g=>{n=g(n,t)}),a=ZI(n),ka&&WI(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 v=a.firstChild;for(;v&&v.nodeType!=1;)v=v.nextSibling;if(!v)break;a=v}if(c||(c=(t.someProp("clipboardParser")||t.someProp("domParser")||Ti.fromSchema(t.state.schema)).parseSlice(a,{preserveWhitespace:!!(d||p),context:o,ruleFromNode(v){return v.nodeName=="BR"&&!v.nextSibling&&v.parentNode&&!XI.test(v.parentNode.nodeName)?{ignore:!0}:null}})),p)c=eB(sx(c,+p[1],+p[2]),p[4]);else if(c=oe.maxOpen(JI(c.content,o),!0),c.openStart||c.openEnd){let g=0,v=0;for(let b=c.content.firstChild;g<c.openStart&&!b.type.spec.isolating;g++,b=b.firstChild);for(let b=c.content.lastChild;v<c.openEnd&&!b.type.spec.isolating;v++,b=b.lastChild);c=sx(c,g,v)}return t.someProp("transformPasted",g=>{c=g(c,t,d)}),c}const XI=/^(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 JI(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&&NE(d,l,c,a[a.length-1],0))a[a.length-1]=h;else{a.length&&(a[a.length-1]=DE(a[a.length-1],l.length));let p=kE(c,d);a.push(p),o=o.matchType(p.type),l=d}}),a)return ee.from(a)}return t}function kE(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,ee.from(t));return t}function NE(t,e,n,r,o){if(o<t.length&&o<e.length&&t[o]==e[o]){let l=NE(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(ee.from(kE(n,t,o+1))))}}function DE(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,DE(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(ee.empty,!0);return t.copy(n.append(r))}function um(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=um(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(ee.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,a.copy(c))}function sx(t,e,n){return e<t.openStart&&(t=new oe(um(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new oe(um(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const _E={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 lx=null;function zE(){return lx||(lx=document.implementation.createHTMLDocument("title"))}let yp=null;function QI(t){let e=window.trustedTypes;return e?(yp||(yp=e.defaultPolicy||e.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),yp.createHTML(t)):t}function ZI(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=zE().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),o;if((o=r&&_E[r[1].toLowerCase()])&&(t=o.map(l=>"<"+l+">").join("")+t+o.map(l=>"</"+l+">").reverse().join("")),n.innerHTML=QI(t),o)for(let l=0;l<o.length;l++)n=n.querySelector(o[l])||n;return n}function WI(t){let e=t.querySelectorAll(Bt?"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 eB(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=ee.from(d.create(r[c+1],o)),l++,a++}return new oe(o,l,a)}const nn={},rn={},tB={touchstart:!0,touchmove:!0};class nB{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 rB(t){for(let e in nn){let n=nn[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{oB(t,r)&&!rg(t,r)&&(t.editable||!(r.type in rn))&&n(t,r)},tB[e]?{passive:!0}:void 0)}Ut&&t.dom.addEventListener("input",()=>null),cm(t)}function Ei(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function iB(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 cm(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>rg(t,r))})}function rg(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function oB(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 sB(t,e){!rg(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,!LE(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(Ir&&Bt&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),Vs&&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,ao(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||YI(t,n)?n.preventDefault():Ei(t,"key")};rn.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};rn.keypress=(t,e)=>{let n=e;if(LE(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||Bn&&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 mf(t){return{left:t.clientX,top:t.clientY}}function lB(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function ig(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 zs(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 aB(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&Se.isSelectable(r)?(zs(t,new Se(n)),!0):!1}function uB(t,e){if(e==-1)return!1;let n=t.state.selection,r,o;n instanceof Se&&(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(Se.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?(zs(t,Se.create(t.state.doc,o)),!0):!1}function cB(t,e,n,r,o){return ig(t,"handleClickOn",e,n,r)||t.someProp("handleClick",l=>l(t,e,r))||(o?uB(t,n):aB(t,n))}function fB(t,e,n,r){return ig(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",o=>o(t,e,r))}function dB(t,e,n,r){return ig(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",o=>o(t,e,r))||hB(t,n,r)}function hB(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(zs(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)zs(t,Oe.create(r,c+1,c+1+a.content.size));else if(Se.isSelectable(a))zs(t,Se.create(r,c));else continue;return!0}}function og(t){return Ic(t)}const jE=Bn?"metaKey":"ctrlKey";nn.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=og(t),o=Date.now(),l="singleClick";o-t.input.lastClick.time<500&&lB(n,t.input.lastClick)&&!n[jE]&&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(mf(n));a&&(l=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new pB(t,a,n,!!r)):(l=="doubleClick"?fB:dB)(t,a.pos,a.inside,n)?n.preventDefault():Ei(t,"pointer"))};class pB{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[jE],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 Se&&h.from<=a&&h.to>a)&&(this.mightDrag={node:l,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Pn&&!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)),Ei(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(mf(e))),this.updateAllowDefault(e),this.allowDefault||!n?Ei(this.view,"pointer"):cB(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Ut&&this.mightDrag&&!this.mightDrag.node.isAtom||Bt&&!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)?(zs(this.view,_e.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):Ei(this.view,"pointer")}move(e){this.updateAllowDefault(e),Ei(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(),og(t),Ei(t,"pointer")};nn.touchmove=t=>{t.input.lastTouch=Date.now(),Ei(t,"pointer")};nn.contextmenu=t=>og(t);function LE(t,e){return t.composing?!0:Ut&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const mB=Ir?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)||Bt&&hE&&gB(t)))t.markCursor=t.state.storedMarks||n.marks(),Ic(t,!0),t.markCursor=null;else if(Ic(t,!e.selection.empty),Pn&&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}IE(t,mB)};function gB(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++,IE(t,20))};function IE(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>Ic(t),e))}function BE(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=vB());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function yB(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=uI(e.focusNode,e.focusOffset),r=cI(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 vB(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function Ic(t,e=!1){if(!(Ir&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),BE(t),e||t.docView&&t.docView.dirty){let n=eg(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 bB(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 ga=pn&&Ai<15||Vs&&pI<604;nn.copy=rn.cut=(t,e)=>{let n=e,r=t.state.selection,o=n.type=="cut";if(r.empty)return;let l=ga?null:n.clipboardData,a=r.content(),{dom:c,text:d}=ng(t,a);l?(n.preventDefault(),l.clearData(),l.setData("text/html",c.innerHTML),l.setData("text/plain",d)):bB(t,c),o&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function SB(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function xB(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?ya(t,r.value,null,o,e):ya(t,r.textContent,r.innerHTML,o,e)},50)}function ya(t,e,n,r,o){let l=OE(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",d=>d(t,o,l||oe.empty)))return!0;if(!l)return!1;let a=SB(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 VE(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&&!Ir)return;let r=ga?null:n.clipboardData,o=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&ya(t,VE(r),r.getData("text/html"),o,n)?n.preventDefault():xB(t,n)};class FE{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const wB=Bn?"altKey":"ctrlKey";function PE(t,e){let n=t.someProp("dragCopies",r=>!r(e));return n??!e[wB]}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(mf(n)),a;if(!(l&&l.pos>=o.from&&l.pos<=(o instanceof Se?o.to-1:o.to))){if(r&&r.mightDrag)a=Se.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=Se.create(t.state.doc,g.posBefore))}}let c=(a||t.state.selection).content(),{dom:d,text:h,slice:p}=ng(t,c);(!n.dataTransfer.files.length||!Bt||dE>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(ga?"Text":"text/html",d.innerHTML),n.dataTransfer.effectAllowed="copyMove",ga||n.dataTransfer.setData("text/plain",h),t.dragging=new FE(p,PE(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{CB(t,e,t.dragging)}finally{t.dragging=null}};function CB(t,e,n){if(!e.dataTransfer)return;let r=t.posAtCoords(mf(e));if(!r)return;let o=t.state.doc.resolve(r.pos),l=n&&n.slice;l?t.someProp("transformPasted",b=>{l=b(l,t,!1)}):l=OE(t,VE(e.dataTransfer),ga?null:e.dataTransfer.getData("text/html"),!1,o);let a=!!(n&&PE(t,e));if(t.someProp("handleDrop",b=>b(t,e,l||oe.empty,a))){e.preventDefault();return}if(!l)return;e.preventDefault();let c=l?qM(t.state.doc,o.pos,l):o.pos;c==null&&(c=o.pos);let d=t.state.tr;if(a){let{node:b}=n;b?b.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 v=d.doc.resolve(h);if(p&&Se.isSelectable(l.content.firstChild)&&v.nodeAfter&&v.nodeAfter.sameMarkup(l.content.firstChild))d.setSelection(new Se(v));else{let b=d.mapping.map(c);d.mapping.maps[d.mapping.maps.length-1].forEach((S,x,C,E)=>b=E),d.setSelection(tg(t,v,d.doc.resolve(b)))}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(Bt&&Ir&&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,ao(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 va(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 Bc{constructor(e,n){this.toDOM=e,this.spec=n||mo,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 Ht(l-r,l-r,this)}valid(){return!0}eq(e){return this==e||e instanceof Bc&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&va(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class ki{constructor(e,n){this.attrs=e,this.spec=n||mo}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 Ht(l,a,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof ki&&va(this.attrs,e.attrs)&&va(this.spec,e.spec)}static is(e){return e.type instanceof ki}destroy(){}}class sg{constructor(e,n){this.attrs=e,this.spec=n||mo}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 Ht(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 sg&&va(this.attrs,e.attrs)&&va(this.spec,e.spec)}destroy(){}}class Ht{constructor(e,n,r){this.from=e,this.to=n,this.type=r}copy(e,n){return new Ht(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 Ht(e,e,new Bc(n,r))}static inline(e,n,r,o){return new Ht(e,n,new ki(r,o))}static node(e,n,r,o){return new Ht(e,n,new sg(r,o))}get spec(){return this.type.spec}get inline(){return this.type instanceof ki}get widget(){return this.type instanceof Bc}}const Ts=[],mo={};class it{constructor(e,n){this.local=e.length?e:Ts,this.children=n.length?n:Ts}static create(e,n){return n.length?Vc(n,e,0,mo):$t}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==$t||e.maps.length==0?this:this.mapInner(e,n,0,0,r||mo)}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?MB(this.children,a||[],e,n,r,o,l):a?new it(a.sort(go),Ts):$t}add(e,n){return n.length?this==$t?it.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=HE(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,Vc(p,c,h+1,mo)),l+=3}});let a=$E(l?UE(n):n,-r);for(let c=0;c<a.length;c++)a[c].type.valid(e,a[c])||a.splice(c--,1);return new it(a.length?this.local.concat(a).sort(go):this.local,o||this.children)}remove(e){return e.length==0||this==$t?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!=$t?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 it(o,r):$t}forChild(e,n){if(this==$t)return this;if(n.isLeaf)return it.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 ki){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 it(o.sort(go),Ts);return r?new wi([c,r]):c}return r||$t}eq(e){if(this==e)return!0;if(!(e instanceof it)||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 lg(this.localsInner(e))}localsInner(e){if(this==$t)return Ts;if(e.inlineContent||!this.local.some(ki.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof ki||n.push(this.local[r]);return n}forEachSet(e){e(this)}}it.empty=new it([],[]);it.removeOverlap=lg;const $t=it.empty;class wi{constructor(e){this.members=e}map(e,n){const r=this.members.map(o=>o.map(e,n,mo));return wi.from(r)}forChild(e,n){if(n.isLeaf)return it.empty;let r=[];for(let o=0;o<this.members.length;o++){let l=this.members[o].forChild(e,n);l!=$t&&(l instanceof wi?r=r.concat(l.members):r.push(l))}return wi.from(r)}eq(e){if(!(e instanceof wi)||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?lg(r?n:n.sort(go)):Ts}static from(e){switch(e.length){case 0:return $t;case 1:return e[0];default:return new wi(e.every(n=>n instanceof it)?e:e.reduce((n,r)=>n.concat(r instanceof it?r:r.members),[]))}}forEachSet(e){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(e)}}function MB(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((v,b,S,x)=>{let C=x-S-(b-v);for(let E=0;E<c.length;E+=3){let A=c[E+1];if(A<0||v>A+p-g)continue;let N=c[E]+p-g;b>=N?c[E+1]=v<=N?-2:-1:v>=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 v=n.map(t[h+1]+l,-1),b=v-o,{index:S,offset:x}=r.content.findIndex(g),C=r.maybeChild(S);if(C&&x==g&&x+C.nodeSize==b){let E=c[h+2].mapInner(n,C,p+1,t[h]+l+1,a);E!=$t?(c[h]=g,c[h+1]=b,c[h+2]=E):(c[h+1]=-2,d=!0)}else d=!0}if(d){let h=EB(c,t,e,n,o,l,a),p=Vc(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,v=0;g<p.children.length;g+=3){let b=p.children[g];for(;v<c.length&&c[v]<b;)v+=3;c.splice(v,0,p.children[g],p.children[g+1],p.children[g+2])}}return new it(e.sort(go),c)}function $E(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 Ht(o.from+e,o.to+e,o.type))}return n}function EB(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 HE(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 UE(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function Vc(t,e,n,r){let o=[],l=!1;e.forEach((c,d)=>{let h=HE(t,c,d+n);if(h){l=!0;let p=Vc(h,c,n+d+1,r);p!=$t&&o.push(d,d+c.nodeSize,p)}});let a=$E(l?UE(t):t,-n).sort(go);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 it(a,o):$t}function go(t,e){return t.from-e.from||t.to-e.to}function lg(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),ax(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),ax(e,o,r.copy(l.from,r.to)));break}}}return e}function ax(t,e,n){for(;e<t.length&&go(n,t[e])>0;)e++;t.splice(e,0,n)}function vp(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=$t&&e.push(r)}),t.cursorWrapper&&e.push(it.create(t.state.doc,[t.cursorWrapper.deco])),wi.from(e)}const RB={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},TB=pn&&Ai<=11;class AB{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 OB{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new AB,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]);pn&&Ai<=11&&r.some(o=>o.type=="childList"&&o.removedNodes.length||o.type=="characterData"&&o.oldValue.length>o.target.nodeValue.length)?this.flushSoon():Ut&&e.composing&&r.some(o=>o.type=="childList"&&o.target.nodeName=="TR")?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),TB&&(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,RB)),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(ex(this.view)){if(this.suppressingSelectionUpdates)return Vr(this.view);if(pn&&Ai<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&xo(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=Bs(l))n.add(l);for(let l=e.anchorNode;l;l=Bs(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)&&ex(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(Pn&&d.length){let p=d.filter(g=>g.nodeName=="BR");if(p.length==2){let[g,v]=p;g.parentNode&&g.parentNode.parentNode==v.parentNode?v.remove():g.remove()}else{let{focusNode:g}=this.currentSelection;for(let v of p){let b=v.parentNode;b&&b.nodeName=="LI"&&(!g||DB(e,g)!=b)&&v.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&&hf(r)&&(h=eg(e))&&h.eq(_e.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),kB(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,_B(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(pn&&Ai<=11&&e.addedNodes.length)for(let p=0;p<e.addedNodes.length;p++){let{previousSibling:g,nextSibling:v}=e.addedNodes[p];(!g||Array.prototype.indexOf.call(e.addedNodes,g)<0)&&(o=g),(!v||Array.prototype.indexOf.call(e.addedNodes,v)<0)&&(l=v)}let a=o&&o.parentNode==e.target?Lt(o)+1:0,c=r.localPosFromDOM(e.target,a,-1),d=l&&l.parentNode==e.target?Lt(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 ux=new WeakMap,cx=!1;function kB(t){if(!ux.has(t)&&(ux.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=Pn,cx)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."),cx=!0}}function fx(t,e){let n=e.startContainer,r=e.startOffset,o=e.endContainer,l=e.endOffset,a=t.domAtPos(t.state.selection.anchor);return xo(a.node,a.offset,o,l)&&([n,r,o,l]=[o,l,n,r]),{anchorNode:n,anchorOffset:r,focusNode:o,focusOffset:l}}function NB(t,e){if(e.getComposedRanges){let o=e.getComposedRanges(t.root)[0];if(o)return fx(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?fx(t,n):null}function DB(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 _B(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 zB(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}],hf(d)||h.push({node:d.focusNode,offset:d.focusOffset})),Bt&&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,v=t.someProp("domParser")||Ti.fromSchema(t.state.schema),b=g.resolve(a),S=null,x=v.parse(r,{topNode:b.parent,topMatch:b.parent.contentMatchAt(b.index()),topOpen:!0,from:o,to:l,preserveWhitespace:b.parent.type.whitespace=="pre"?"full":!0,findPositions:h,ruleFromNode:jB,context:b});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 jB(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(Ut&&/^(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||Ut&&/^(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 LB=/^(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 IB(t,e,n,r,o){let l=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let _=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,B=eg(t,_);if(B&&!t.state.selection.eq(B)){if(Bt&&Ir&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",ie=>ie(t,ao(13,"Enter"))))return;let Z=t.state.tr.setSelection(B);_=="pointer"?Z.setMeta("pointer",!0):_=="key"&&Z.scrollIntoView(),l&&Z.setMeta("composition",l),t.dispatch(Z)}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=zB(t,e,n),p=t.state.doc,g=p.slice(h.from,h.to),v,b;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(v=t.state.selection.to,b="end"):(v=t.state.selection.from,b="start"),t.input.lastKeyCode=null;let S=FB(g.content,h.doc.content,h.from,v,b);if(S&&t.input.domChangeCount++,(Vs&&t.input.lastIOSEnter>Date.now()-225||Ir)&&o.some(_=>_.nodeType==1&&!LB.test(_.nodeName))&&(!S||S.endA>=S.endB)&&t.someProp("handleKeyDown",_=>_(t,ao(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 _=dx(t,t.state.doc,h.sel);if(_&&!_.eq(t.state.selection)){let B=t.state.tr.setSelection(_);l&&B.setMeta("composition",l),t.dispatch(B)}}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)),pn&&Ai<=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((Vs&&t.input.lastIOSEnter>Date.now()-225&&(!A||o.some(_=>_.nodeName=="DIV"||_.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",_=>_(t,ao(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>S.start&&VB(p,S.start,S.endA,x,C)&&t.someProp("handleKeyDown",_=>_(t,ao(8,"Backspace")))){Ir&&Bt&&t.domObserver.suppressSelectionUpdates();return}Bt&&S.endB==S.start&&(t.input.lastChromeDelete=Date.now()),Ir&&!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(_){return _(t,ao(13,"Enter"))})},20));let N=S.start,D=S.endA,j=_=>{let B=_||t.state.tr.replace(N,D,h.doc.slice(S.start-h.from,S.endB-h.from));if(h.sel){let Z=dx(t,B.doc,h.sel);Z&&!(Bt&&t.composing&&Z.empty&&(S.start!=S.endB||t.input.lastChromeDelete<Date.now()-100)&&(Z.head==N||Z.head==B.mapping.map(D)-1)||pn&&Z.empty&&Z.head==N)&&B.setSelection(Z)}return l&&B.setMeta("composition",l),B.scrollIntoView()},$;if(A)if(x.pos==C.pos){pn&&Ai<=11&&x.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Vr(t),20));let _=j(t.state.tr.delete(N,D)),B=p.resolve(S.start).marksAcross(p.resolve(S.endA));B&&_.ensureMarks(B),t.dispatch(_)}else if(S.endA==S.endB&&($=BB(x.parent.content.cut(x.parentOffset,C.parentOffset),E.parent.content.cut(E.parentOffset,S.endA-E.start())))){let _=j(t.state.tr);$.type=="add"?_.addMark(N,D,$.mark):_.removeMark(N,D,$.mark),t.dispatch(_)}else if(x.parent.child(x.index()).isText&&x.index()==C.index()-(C.textOffset?0:1)){let _=x.parent.textBetween(x.parentOffset,C.parentOffset),B=()=>j(t.state.tr.insertText(_,N,D));t.someProp("handleTextInput",Z=>Z(t,N,D,_,B))||t.dispatch(B())}else t.dispatch(j());else t.dispatch(j())}function dx(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:tg(t,e.resolve(n.anchor),e.resolve(n.head))}function BB(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(ee.from(h).eq(t))return{mark:c,type:a}}function VB(t,e,n,r,o){if(n-e<=o.pos-r.pos||bp(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(bp(l,!0,!0));return!a.parent.isTextblock||a.pos>n||bp(a,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(a.parent.content)}function bp(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 FB(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&&hx(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&&hx(t.textBetween(l-1,l+1))&&(l+=d?1:-1),a=l+(a-c),c=l}return{start:l,endA:a,endB:c}}function hx(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 qE{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 nB,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(vx),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=gx(this),mx(this),this.nodeViews=yx(this),this.docView=YS(this.state.doc,px(this),vp(this),this.dom,this),this.domObserver=new OB(this,(r,o,l,a)=>IB(this,r,o,l,a)),this.domObserver.start(),rB(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&&cm(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(vx),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&&(BE(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 b=yx(this);$B(b,this.nodeViews)&&(this.nodeViews=b,l=!0)}(c||n.handleDOMEvents!=this._props.handleDOMEvents)&&cm(this),this.editable=gx(this),mx(this);let d=vp(this),h=px(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 v=p=="preserve"&&a&&this.dom.style.overflowAnchor==null&&yI(this);if(a){this.domObserver.stop();let b=g&&(pn||Bt)&&!this.composing&&!o.selection.empty&&!e.selection.empty&&PB(o.selection,e.selection);if(g){let S=Bt?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=yB(this)),(l||!this.docView.update(e.doc,h,d,this))&&(this.docView.updateOuterDeco(h),this.docView.destroy(),this.docView=YS(e.doc,h,d,this.dom,this)),S&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(b=!0)}b||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&PI(this))?Vr(this,b):(RE(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():v&&vI(v)}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 Se){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&$S(this,n.getBoundingClientRect(),e)}else $S(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 FE(e.slice,e.move,o<0?void 0:Se.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(pn){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&&bI(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 MI(this,e)}coordsAtPos(e,n=1){return vE(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 OI(this,n||this.state,e)}pasteHTML(e,n){return ya(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return ya(this,e,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(e){return ng(this,e)}destroy(){this.docView&&(iB(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],vp(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,lI())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return sB(this,e)}domSelectionRange(){let e=this.domSelection();return e?Ut&&this.root.nodeType===11&&dI(this.dom.ownerDocument)==this.dom&&NB(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}qE.prototype.dispatch=function(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))};function px(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"),[Ht.node(0,t.state.doc.content.size,e)]}function mx(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:Ht.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function gx(t){return!t.someProp("editable",e=>e(t.state)===!1)}function PB(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 yx(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 $B(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 vx(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 ji={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:"'"},Fc={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},HB=typeof navigator<"u"&&/Mac/.test(navigator.platform),UB=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var It=0;It<10;It++)ji[48+It]=ji[96+It]=String(It);for(var It=1;It<=24;It++)ji[It+111]="F"+It;for(var It=65;It<=90;It++)ji[It]=String.fromCharCode(It+32),Fc[It]=String.fromCharCode(It);for(var Sp in ji)Fc.hasOwnProperty(Sp)||(Fc[Sp]=ji[Sp]);function qB(t){var e=HB&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||UB&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Fc:ji)[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 GB=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),KB=typeof navigator<"u"&&/Win/.test(navigator.platform);function YB(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))GB?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 XB(t){let e=Object.create(null);for(let n in t)e[YB(n)]=t[n];return e}function xp(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 JB(t){return new vt({props:{handleKeyDown:GE(t)}})}function GE(t){let e=XB(t);return function(n,r){let o=qB(r),l,a=e[xp(o,r)];if(a&&a(n.state,n.dispatch,n))return!0;if(o.length==1&&o!=" "){if(r.shiftKey){let c=e[xp(o,r,!1)];if(c&&c(n.state,n.dispatch,n))return!0}if((r.altKey||r.metaKey||r.ctrlKey)&&!(KB&&r.ctrlKey&&r.altKey)&&(l=ji[r.keyCode])&&l!=o){let c=e[xp(l,r)];if(c&&c(n.state,n.dispatch,n))return!0}}return!1}}var QB=Object.defineProperty,ag=(t,e)=>{for(var n in e)QB(t,n,{get:e[n],enumerable:!0})};function gf(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 yf=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,v])=>[g,(...S)=>{const x=this.buildProps(d,e),C=v(...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:gf({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}},KE={};ag(KE,{blur:()=>ZB,clearContent:()=>WB,clearNodes:()=>eV,command:()=>tV,createParagraphNear:()=>nV,cut:()=>rV,deleteCurrentNode:()=>iV,deleteNode:()=>oV,deleteRange:()=>sV,deleteSelection:()=>lV,enter:()=>aV,exitCode:()=>uV,extendMarkRange:()=>cV,first:()=>fV,focus:()=>hV,forEach:()=>pV,insertContent:()=>mV,insertContentAt:()=>vV,joinBackward:()=>xV,joinDown:()=>SV,joinForward:()=>wV,joinItemBackward:()=>CV,joinItemForward:()=>MV,joinTextblockBackward:()=>EV,joinTextblockForward:()=>RV,joinUp:()=>bV,keyboardShortcut:()=>AV,lift:()=>OV,liftEmptyBlock:()=>kV,liftListItem:()=>NV,newlineInCode:()=>DV,resetAttributes:()=>_V,scrollIntoView:()=>zV,selectAll:()=>jV,selectNodeBackward:()=>LV,selectNodeForward:()=>IV,selectParentNode:()=>BV,selectTextblockEnd:()=>VV,selectTextblockStart:()=>FV,setContent:()=>PV,setMark:()=>aF,setMeta:()=>uF,setNode:()=>cF,setNodeSelection:()=>fF,setTextDirection:()=>dF,setTextSelection:()=>hF,sinkListItem:()=>pF,splitBlock:()=>mF,splitListItem:()=>gF,toggleList:()=>yF,toggleMark:()=>vF,toggleNode:()=>bF,toggleWrap:()=>SF,undoInputRule:()=>xF,unsetAllMarks:()=>wF,unsetMark:()=>CF,unsetTextDirection:()=>MF,updateAttributes:()=>EF,wrapIn:()=>RF,wrapInList:()=>TF});var ZB=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window?.getSelection())==null||n.removeAllRanges())}),!0),WB=(t=!0)=>({commands:e})=>e.setContent("",{emitUpdate:t}),eV=()=>({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)),v=h.resolve(p.map(d+c.nodeSize)),b=g.blockRange(v);if(!b)return;const S=qs(b);if(c.type.isTextblock){const{defaultType:x}=g.parent.contentMatchAt(g.index());e.setNodeMarkup(b.start,x)}(S||S===0)&&e.lift(b,S)})}),!0},tV=t=>e=>t(e),nV=()=>({state:t,dispatch:e})=>lE(t,e),rV=(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},iV=()=>({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 oV=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},sV=t=>({tr:e,dispatch:n})=>{const{from:r,to:o}=t;return n&&e.delete(r,o),!0},lV=()=>({state:t,dispatch:e})=>Ym(t,e),aV=()=>({commands:t})=>t.keyboardShortcut("Enter"),uV=()=>({state:t,dispatch:e})=>GL(t,e);function ug(t){return Object.prototype.toString.call(t)==="[object RegExp]"}function Pc(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(o=>n.strict?e[o]===t[o]:ug(e[o])?e[o].test(t[o]):e[o]===t[o]):!0}function YE(t,e,n={}){return t.find(r=>r.type===e&&Pc(Object.fromEntries(Object.keys(n).map(o=>[o,r.attrs[o]])),n))}function bx(t,e,n={}){return!!YE(t,e,n)}function XE(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),!YE([...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&&bx([...t.parent.child(a-1).marks],e,n);)a-=1,c-=t.parent.child(a).nodeSize;for(;d<t.parent.childCount&&bx([...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 cV=(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=XE(d,l,e);if(g&&g.from<=h&&g.to>=p){const v=Oe.create(a,g.from,g.to);n.setSelection(v)}}return!0},fV=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 JE(t){return t instanceof Oe}function fo(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function QE(t,e=null){if(!e)return null;const n=_e.atStart(t),r=_e.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,fo(0,o,l),fo(t.content.size,o,l)):Oe.create(t,fo(e,o,l),fo(e,o,l))}function Sx(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function $c(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function dV(){return typeof navigator<"u"?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}var hV=(t=null,e={})=>({editor:n,view:r,tr:o,dispatch:l})=>{e={scrollIntoView:!0,...e};const a=()=>{($c()||Sx())&&r.dom.focus(),dV()&&!$c()&&!Sx()&&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&&!JE(n.state.selection))return a(),!0;const c=QE(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},pV=(t,e)=>n=>t.every((r,o)=>e(r,{...n,index:o})),mV=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),ZE=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&&ZE(r)}return t};function ac(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 ZE(n)}function ba(t,e,n){if(t instanceof Ri||t instanceof ee)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 ee.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),ba("",e,n)}if(o){if(n.errorOnInvalidContent){let a=!1,c="";const d=new _M({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?Ti.fromSchema(d).parseSlice(ac(t),n.parseOptions):Ti.fromSchema(d).parse(ac(t),n.parseOptions),n.errorOnInvalidContent&&a)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${c}`)})}const l=Ti.fromSchema(e);return n.slice?l.parseSlice(ac(t),n.parseOptions).content:l.parse(ac(t),n.parseOptions)}return ba("",e,n)}function gV(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(_e.near(t.doc.resolve(a),n))}var yV=t=>!("type"in t),vV=(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{ba(e,l.schema,{parseOptions:h,errorOnInvalidContent:!0})}catch(C){d(C)}try{c=ba(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},v=!0,b=!0;if((yV(c)?c:[c]).forEach(C=>{C.check(),v=v?C.isText&&C.marks.length===0:!1,b=b?C.isBlock:!1}),p===g&&b){const{parent:C}=r.doc.resolve(p);C.isTextblock&&!C.type.spec.code&&!C.childCount&&(p-=1,g+=1)}let x;if(v){if(Array.isArray(e))x=e.map(C=>C.text||"").join("");else if(e instanceof ee){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,N=E.isText||E.isTextblock,D=E.content.size>0;A&&N&&D&&(p=Math.max(0,p-1)),r.replaceWith(p,g,x)}n.updateSelection&&gV(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},bV=()=>({state:t,dispatch:e})=>HL(t,e),SV=()=>({state:t,dispatch:e})=>UL(t,e),xV=()=>({state:t,dispatch:e})=>eE(t,e),wV=()=>({state:t,dispatch:e})=>iE(t,e),CV=()=>({state:t,dispatch:e,tr:n})=>{try{const r=cf(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},MV=()=>({state:t,dispatch:e,tr:n})=>{try{const r=cf(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},EV=()=>({state:t,dispatch:e})=>PL(t,e),RV=()=>({state:t,dispatch:e})=>$L(t,e);function WE(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function TV(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))$c()||WE()?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 AV=t=>({editor:e,view:n,tr:r,dispatch:o})=>{const l=TV(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 Sa(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,v)=>{if(g.isText)return;const b=Math.max(r,v),S=Math.min(o,v+g.nodeSize);c.push({node:g,from:b,to:S})});const d=o-r,h=c.filter(g=>a?a.name===g.node.type.name:!0).filter(g=>Pc(g.node.attrs,n,{strict:!1}));return l?!!h.length:h.reduce((g,v)=>g+v.to-v.from,0)>=d}var OV=(t,e={})=>({state:n,dispatch:r})=>{const o=Ot(t,n.schema);return Sa(n,o,e)?qL(n,r):!1},kV=()=>({state:t,dispatch:e})=>aE(t,e),NV=t=>({state:e,dispatch:n})=>{const r=Ot(t,e.schema);return rI(r)(e,n)},DV=()=>({state:t,dispatch:e})=>sE(t,e);function vf(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function xx(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 _V=(t,e)=>({tr:n,state:r,dispatch:o})=>{let l=null,a=null;const c=vf(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,xx(p.attrs,e))),a&&p.marks.length&&p.marks.forEach(v=>{a===v.type&&(d=!0,o&&n.addMark(g,g+p.nodeSize,a.create(xx(v.attrs,e))))})})}),d},zV=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),jV=()=>({tr:t,dispatch:e})=>{if(e){const n=new Rn(t.doc);t.setSelection(n)}return!0},LV=()=>({state:t,dispatch:e})=>nE(t,e),IV=()=>({state:t,dispatch:e})=>oE(t,e),BV=()=>({state:t,dispatch:e})=>XL(t,e),VV=()=>({state:t,dispatch:e})=>ZL(t,e),FV=()=>({state:t,dispatch:e})=>QL(t,e);function fm(t,e,n={},r={}){return ba(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var PV=(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=fm(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 eR(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 $V(t,e){const n=new JM(t);return e.forEach(r=>{r.steps.forEach(o=>{n.step(o)})}),n}function HV(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 UV(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 cg(t){return e=>UV(e.$from,t)}function ge(t,e,n){return t.config[e]===void 0&&t.parent?ge(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?ge(t.parent,e,n):null}):t.config[e]}function fg(t){return t.map(e=>{const n={name:e.name,options:e.options,storage:e.storage},r=ge(e,"addExtensions",n);return r?[e,...fg(r())]:e}).flat(10)}function dg(t,e){const n=Eo.fromSchema(e).serializeFragment(t),o=document.implementation.createHTMLDocument().createElement("div");return o.appendChild(n),o.innerHTML}function tR(t){return typeof t=="function"}function rt(t,e=void 0,...n){return tR(t)?e?t.bind(e)(...n):t(...n):t}function qV(t={}){return Object.keys(t).length===0&&t.constructor===Object}function Fs(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 nR(t){const e=[],{nodeExtensions:n,markExtensions:r}=Fs(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=ge(h,"addGlobalAttributes",p);if(!g)return;g().forEach(b=>{let S;Array.isArray(b.types)?S=b.types:b.types==="*"?S=d:b.types==="nodes"?S=a:b.types==="marks"?S=c:S=[],S.forEach(x=>{Object.entries(b.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=ge(h,"addAttributes",p);if(!g)return;const v=g();Object.entries(v).forEach(([b,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:b,attribute:x})})}),e}function GV(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 wx(t){const e=[],n=GV(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 rR(...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([...wx(r[o]),...wx(l)]);r[o]=Array.from(c.entries()).map(([d,h])=>`${d}: ${h}`).join("; ")}else r[o]=l}),r},{})}function Hc(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)=>rR(n,r),{})}function KV(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function Cx(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):KV(n.getAttribute(a.name));return c==null?l:{...l,[a.name]:c}},{});return{...r,...o}}}}function Mx(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&qV(n)?!1:n!=null))}function Ex(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 YV(t,e){var n;const r=nR(t),{nodeExtensions:o,markExtensions:l}=Fs(t),a=(n=o.find(h=>ge(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},v=t.reduce((E,A)=>{const N=ge(A,"extendNodeSchema",g);return{...E,...N?N(h):{}}},{}),b=Mx({...v,content:rt(ge(h,"content",g)),marks:rt(ge(h,"marks",g)),group:rt(ge(h,"group",g)),inline:rt(ge(h,"inline",g)),atom:rt(ge(h,"atom",g)),selectable:rt(ge(h,"selectable",g)),draggable:rt(ge(h,"draggable",g)),code:rt(ge(h,"code",g)),whitespace:rt(ge(h,"whitespace",g)),linebreakReplacement:rt(ge(h,"linebreakReplacement",g)),defining:rt(ge(h,"defining",g)),isolating:rt(ge(h,"isolating",g)),attrs:Object.fromEntries(p.map(Ex))}),S=rt(ge(h,"parseHTML",g));S&&(b.parseDOM=S.map(E=>Cx(E,p)));const x=ge(h,"renderHTML",g);x&&(b.toDOM=E=>x({node:E,HTMLAttributes:Hc(E,p)}));const C=ge(h,"renderText",g);return C&&(b.toText=C),[h.name,b]})),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},v=t.reduce((C,E)=>{const A=ge(E,"extendMarkSchema",g);return{...C,...A?A(h):{}}},{}),b=Mx({...v,inclusive:rt(ge(h,"inclusive",g)),excludes:rt(ge(h,"excludes",g)),group:rt(ge(h,"group",g)),spanning:rt(ge(h,"spanning",g)),code:rt(ge(h,"code",g)),attrs:Object.fromEntries(p.map(Ex))}),S=rt(ge(h,"parseHTML",g));S&&(b.parseDOM=S.map(C=>Cx(C,p)));const x=ge(h,"renderHTML",g);return x&&(b.toDOM=C=>x({mark:C,HTMLAttributes:Hc(C,p)})),[h.name,b]}));return new _M({topNode:a,nodes:c,marks:d})}function XV(t){const e=t.filter((n,r)=>t.indexOf(n)!==r);return Array.from(new Set(e))}function oa(t){return t.sort((n,r)=>{const o=ge(n,"priority")||100,l=ge(r,"priority")||100;return o>l?-1:o<l?1:0})}function iR(t){const e=oa(fg(t)),n=XV(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 oR(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 v;d.isBlock&&h>r&&(c+=l);const b=a?.[d.type.name];if(b)return p&&(c+=b({node:d,pos:h,parent:p,index:g,range:e})),!1;d.isText&&(c+=(v=d?.text)==null?void 0:v.slice(Math.max(r,h)-h,o-h))}),c}function JV(t,e){const n={from:0,to:t.content.size};return oR(t,n,e)}function sR(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}function QV(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 ZV(t,e){const n=vf(typeof e=="string"?e:e.name,t.schema);return n==="node"?QV(t,e):n==="mark"?eR(t,e):{}}function WV(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 eF(t){const e=WV(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 tF(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),v=e.invert().map(p);r.push({oldRange:{from:g,to:v},newRange:{from:h,to:p}})})}),eF(r)}function Gl(t,e){return e.nodes[t]||e.marks[t]||null}function bc(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 nF=(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 dm(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=>Pc(g.attrs,n,{strict:!1}));let a=0;const c=[];if(o.forEach(({$from:g,$to:v})=>{const b=g.pos,S=v.pos;t.doc.nodesBetween(b,S,(x,C)=>{if(l&&x.inlineContent&&!x.type.allowsMarkType(l))return!1;if(!x.isText&&!x.marks.length)return;const E=Math.max(b,C),A=Math.min(S,C+x.nodeSize),N=A-E;a+=N,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=>Pc(g.mark.attrs,n,{strict:!1})).reduce((g,v)=>g+v.to-v.from,0),h=c.filter(g=>l?g.mark.type!==l&&g.mark.type.excludes(l):!0).reduce((g,v)=>g+v.to-v.from,0);return(d>0?d+h:d)>=a}function rF(t,e,n={}){if(!e)return Sa(t,null,n)||dm(t,null,n);const r=vf(e,t.schema);return r==="node"?Sa(t,e,n):r==="mark"?dm(t,e,n):!1}function Rx(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}function Tx(t,e){const{nodeExtensions:n}=Fs(e),r=n.find(a=>a.name===t);if(!r)return!1;const o={name:r.name,options:r.options,storage:r.storage},l=rt(ge(r,"group",o));return typeof l!="string"?!1:l.split(" ").includes("list")}function bf(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&&(bf(l,{ignoreWhitespace:n,checkChildren:e})||(o=!1))}),o}return!1}function iF(t){return t instanceof Se}var lR=class aR{constructor(e){this.position=e}static fromJSON(e){return new aR(e.position)}toJSON(){return{position:this.position}}};function oF(t,e){const n=e.mapping.mapResult(t.position);return{position:new lR(n.pos),mapResult:n}}function sF(t){return new lR(t)}function lF(t,e,n){var r;const{selection:o}=e;let l=null;if(JE(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,v)=>{if(h)return!1;if(p.isInline){const b=!v||v.type.allowsMarkType(n),S=!!n.isInSet(p.marks)||!p.marks.some(x=>x.type.excludes(n));h=b&&S}return!h}),h})}var aF=(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=eR(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,(v,b)=>{const S=Math.max(b,p),x=Math.min(b+v.nodeSize,g);v.marks.find(E=>E.type===d)?v.marks.forEach(E=>{d===E.type&&n.addMark(S,x,d.create({...E.attrs,...e}))}):n.addMark(S,x,d.create(e))})});return lF(r,n,d)},uF=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),cF=(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})=>VS(l,{...a,...e})(n)?!0:c.clearNodes()).command(({state:c})=>VS(l,{...a,...e})(c,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},fF=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,o=fo(t,0,r.content.size),l=Se.create(r,o);e.setSelection(l)}return!0},dF=(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},hF=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=fo(o,a,c),h=fo(l,a,c),p=Oe.create(r,d,h);e.setSelection(p)}return!0},pF=t=>({state:e,dispatch:n})=>{const r=Ot(t,e.schema);return sI(r)(e,n)};function Ax(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 mF=({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=bc(h,c.node().type.name,c.node().attrs);if(l instanceof Se&&l.node.isBlock)return!c.parentOffset||!Br(a,c.pos)?!1:(r&&(t&&Ax(n,o.extensionManager.splittableMarks),e.split(c.pos).scrollIntoView()),!0);if(!c.parent.isBlock)return!1;const g=d.parentOffset===d.parent.content.size,v=c.depth===0?void 0:HV(c.node(-1).contentMatchAt(c.indexAfter(-1)));let b=g&&v?[{type:v,attrs:p}]:void 0,S=Br(e.doc,e.mapping.map(c.pos),1,b);if(!b&&!S&&Br(e.doc,e.mapping.map(c.pos),1,v?[{type:v}]:void 0)&&(S=!0,b=v?[{type:v,attrs:p}]:void 0),r){if(S&&(l instanceof Oe&&e.deleteSelection(),e.split(e.mapping.map(c.pos),1,b),v&&!g&&!c.parentOffset&&c.parent.type!==v)){const x=e.mapping.map(c.before()),C=e.doc.resolve(x);c.node(-1).canReplaceWith(C.index(),C.index()+1,v)&&e.setNodeMarkup(e.mapping.map(c.before()),v)}t&&Ax(n,o.extensionManager.splittableMarks),e.scrollIntoView()}return S},gF=(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 v=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=ee.empty;const A=d.index(-1)?1:d.index(-2)?2:3;for(let B=d.depth-A;B>=d.depth-3;B-=1)E=ee.from(d.node(B).copy(E));const N=d.indexAfter(-1)<d.node(-2).childCount?1:d.indexAfter(-2)<d.node(-3).childCount?2:3,D={...bc(v,d.node().type.name,d.node().attrs),...e},j=((a=c.contentMatch.defaultType)==null?void 0:a.createAndFill(D))||void 0;E=E.append(ee.from(c.createAndFill(null,j)||void 0));const $=d.before(d.depth-(A-1));n.replace($,d.after(-N),new oe(E,4-A,0));let _=-1;n.doc.nodesBetween($,n.doc.content.size,(B,Z)=>{if(_>-1)return!1;B.isTextblock&&B.content.size===0&&(_=Z+1)}),_>-1&&n.setSelection(Oe.near(n.doc.resolve(_))),n.scrollIntoView()}return!0}const b=h.pos===d.end()?g.contentMatchAt(0).defaultType:null,S={...bc(v,g.type.name,g.attrs),...e},x={...bc(v,d.node().type.name,d.node().attrs),...e};n.delete(d.pos,h.pos);const C=b?[{type:c,attrs:S},{type:b,attrs:x}]:[{type:c,attrs:S}];if(!Br(n.doc,d.pos,2))return!1;if(o){const{selection:E,storedMarks:A}=r,{splittableMarks:N}=l.extensionManager,D=A||E.$to.parentOffset&&E.$from.marks();if(n.split(d.pos,2,C).scrollIntoView(),!D||!o)return!0;const j=D.filter($=>N.includes($.type.name));n.ensureMarks(j)}return!0},wp=(t,e)=>{const n=cg(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&&Ro(t.doc,n.pos)&&t.join(n.pos),!0},Cp=(t,e)=>{const n=cg(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&&Ro(t.doc,r)&&t.join(r),!0},yF=(t,e,n,r={})=>({editor:o,tr:l,state:a,dispatch:c,chain:d,commands:h,can:p})=>{const{extensions:g,splittableMarks:v}=o.extensionManager,b=Ot(t,a.schema),S=Ot(e,a.schema),{selection:x,storedMarks:C}=a,{$from:E,$to:A}=x,N=E.blockRange(A),D=C||x.$to.parentOffset&&x.$from.marks();if(!N)return!1;const j=cg($=>Tx($.type.name,g))(x);if(N.depth>=1&&j&&N.depth-j.depth<=1){if(j.node.type===b)return h.liftListItem(S);if(Tx(j.node.type.name,g)&&b.validContent(j.node.content)&&c)return d().command(()=>(l.setNodeMarkup(j.pos,b),!0)).command(()=>wp(l,b)).command(()=>Cp(l,b)).run()}return!n||!D||!c?d().command(()=>p().wrapInList(b,r)?!0:h.clearNodes()).wrapInList(b,r).command(()=>wp(l,b)).command(()=>Cp(l,b)).run():d().command(()=>{const $=p().wrapInList(b,r),_=D.filter(B=>v.includes(B.type.name));return l.ensureMarks(_),$?!0:h.clearNodes()}).wrapInList(b,r).command(()=>wp(l,b)).command(()=>Cp(l,b)).run()},vF=(t,e={},n={})=>({state:r,commands:o})=>{const{extendEmptyMarkRange:l=!1}=n,a=Hr(t,r.schema);return dm(r,a,e)?o.unsetMark(a,{extendEmptyMarkRange:l}):o.setMark(a,e)},bF=(t,e,n={})=>({state:r,commands:o})=>{const l=Ot(t,r.schema),a=Ot(e,r.schema),c=Sa(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})},SF=(t,e={})=>({state:n,commands:r})=>{const o=Ot(t,n.schema);return Sa(n,o,e)?r.lift(o):r.wrapIn(o,e)},xF=()=>({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},wF=()=>({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},CF=(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:v,to:b}=c;const S=(l=h.marks().find(C=>C.type===d))==null?void 0:l.attrs,x=XE(h,d,S);x&&(v=x.from,b=x.to),n.removeMark(v,b,d)}else g.forEach(v=>{n.removeMark(v.$from.pos,v.$to.pos,d)});return n.removeStoredMark(d),!0},MF=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},EF=(t,e={})=>({tr:n,state:r,dispatch:o})=>{let l=null,a=null;const c=vf(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 v,b,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),v=E,b=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),v=E,b=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 N=Math.max(E,p),D=Math.min(E+C.nodeSize,g);n.addMark(N,D,a.create({...A.attrs,...e}))}}))}),b&&(v!==void 0&&o&&n.setNodeMarkup(v,void 0,{...b.attrs,...e}),a&&b.marks.length&&b.marks.forEach(C=>{a===C.type&&o&&n.addMark(S,x,a.create({...C.attrs,...e}))}))}),d},RF=(t,e={})=>({state:n,dispatch:r})=>{const o=Ot(t,n.schema);return WL(o,e)(n,r)},TF=(t,e={})=>({state:n,dispatch:r})=>{const o=Ot(t,n.schema);return eI(o,e)(n,r)},AF=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={}}},OF=(t,e)=>{if(ug(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 uc(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(v=>v.type.spec.code))return!1;let p=!1;const g=nF(h)+l;return a.forEach(v=>{if(p)return;const b=OF(g,v.find);if(!b)return;const S=d.state.tr,x=gf({state:d.state,transaction:S}),C={from:r-(b[0].length-l.length),to:o},{commands:E,chain:A,can:N}=new yf({editor:n,state:x});v.handler({state:x,range:C,match:b,commands:E,chain:A,can:N})===null||!S.steps.length||(v.undoable&&S.setMeta(c,{transform:S,from:r,to:o,text:l}),d.dispatch(S),p=!0)}),p}function kF(t){const{editor:e,rules:n}=t,r=new vt({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=dg(ee.from(p),a.schema);const{from:g}=d,v=g+p.length;uc({editor:e,from:g,to:v,text:p,rules:n,plugin:r})}),o.selectionSet||o.docChanged?null:l}},props:{handleTextInput(o,l,a,c){return uc({editor:e,from:l,to:a,text:c,rules:n,plugin:r})},handleDOMEvents:{compositionend:o=>(setTimeout(()=>{const{$cursor:l}=o.state.selection;l&&uc({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?uc({editor:e,from:a.pos,to:a.pos,text:`
67
+ `,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function NF(t){return Object.prototype.toString.call(t).slice(8,-1)}function cc(t){return NF(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function uR(t,e){const n={...t};return cc(t)&&cc(e)&&Object.keys(e).forEach(r=>{cc(e[r])&&cc(t[r])?n[r]=uR(t[r],e[r]):n[r]=e[r]}),n}var hg=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{...rt(ge(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...rt(ge(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(t={}){const e=this.extend({...this.config,addOptions:()=>uR(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}},DF=class cR extends hg{constructor(){super(...arguments),this.type="mark"}static create(e={}){const n=typeof e=="function"?e():e;return new cR(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 _F(t){return typeof t=="number"}var zF=(t,e,n)=>{if(ug(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 jF(t){const{editor:e,state:n,from:r,to:o,rule:l,pasteEvent:a,dropEvent:c}=t,{commands:d,chain:h,can:p}=new yf({editor:e,state:n}),g=[];return n.doc.nodesBetween(r,o,(b,S)=>{var x,C,E,A,N;if((C=(x=b.type)==null?void 0:x.spec)!=null&&C.code||!(b.isText||b.isTextblock||b.isInline))return;const D=(N=(A=(E=b.content)==null?void 0:E.size)!=null?A:b.nodeSize)!=null?N:0,j=Math.max(r,S),$=Math.min(o,S+D);if(j>=$)return;const _=b.isText?b.text||"":b.textBetween(j-S,$-S,void 0,"");zF(_,l.find,a).forEach(Z=>{if(Z.index===void 0)return;const ie=j+Z.index+1,pe=ie+Z[0].length,se={from:n.tr.mapping.map(ie),to:n.tr.mapping.map(pe)},be=l.handler({state:n,range:se,match:Z,commands:d,chain:h,can:p,pasteEvent:a,dropEvent:c});g.push(be)})}),g.every(b=>b!==null)}var fc=null,LF=t=>{var e;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=n.clipboardData)==null||e.setData("text/html",t),n};function IF(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:v,rule:b,pasteEvt:S})=>{const x=p.tr,C=gf({state:p,transaction:x});if(!(!jF({editor:e,state:C,from:Math.max(g-1,0),to:v.b-1,rule:b,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 vt({view(g){const v=S=>{var x;r=(x=g.dom.parentElement)!=null&&x.contains(S.target)?g.dom.parentElement:null,r&&(fc=e)},b=()=>{fc&&(fc=null)};return window.addEventListener("dragstart",v),window.addEventListener("dragend",b),{destroy(){window.removeEventListener("dragstart",v),window.removeEventListener("dragend",b)}}},props:{handleDOMEvents:{drop:(g,v)=>{if(l=r===g.dom.parentElement,c=v,!l){const b=fc;b?.isEditable&&setTimeout(()=>{const S=b.state.selection;S&&b.commands.deleteRange({from:S.from,to:S.to})},10)}return!1},paste:(g,v)=>{var b;const S=(b=v.clipboardData)==null?void 0:b.getData("text/html");return a=v,o=!!S?.includes("data-pm-slice"),!1}}},appendTransaction:(g,v,b)=>{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:j}=E;typeof j=="string"?j=j:j=dg(ee.from(j),b.schema);const{from:$}=E,_=$+j.length,B=LF(j);return d({rule:p,state:b,from:$,to:{b:_},pasteEvt:B})}const N=v.doc.content.findDiffStart(b.doc.content),D=v.doc.content.findDiffEnd(b.doc.content);if(!(!_F(N)||!D||N===D.b))return d({rule:p,state:b,from:N,to:D,pasteEvt:a})}}))}var Sf=class{constructor(t,e){this.splittableMarks=[],this.editor=e,this.baseExtensions=t,this.extensions=iR(t),this.schema=YV(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:Gl(e.name,this.schema)},r=ge(e,"addCommands",n);return r?{...t,...r()}:t},{})}get plugins(){const{editor:t}=this;return oa([...this.extensions].reverse()).flatMap(r=>{const o={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:t,type:Gl(r.name,this.schema)},l=[],a=ge(r,"addKeyboardShortcuts",o);let c={};if(r.type==="mark"&&ge(r,"exitable",o)&&(c.ArrowRight=()=>DF.handleExit({editor:t,mark:r})),a){const v=Object.fromEntries(Object.entries(a()).map(([b,S])=>[b,()=>S({editor:t})]));c={...c,...v}}const d=JB(c);l.push(d);const h=ge(r,"addInputRules",o);if(Rx(r,t.options.enableInputRules)&&h){const v=h();if(v&&v.length){const b=kF({editor:t,rules:v}),S=Array.isArray(b)?b:[b];l.push(...S)}}const p=ge(r,"addPasteRules",o);if(Rx(r,t.options.enablePasteRules)&&p){const v=p();if(v&&v.length){const b=IF({editor:t,rules:v});l.push(...b)}}const g=ge(r,"addProseMirrorPlugins",o);if(g){const v=g();l.push(...v)}return l})}get attributes(){return nR(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:e}=Fs(this.extensions);return Object.fromEntries(e.filter(n=>!!ge(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=ge(n,"addNodeView",o);if(!l)return[];const a=l();if(!a)return[];const c=(d,h,p,g,v)=>{const b=Hc(d,r);return a({node:d,view:h,getPos:p,decorations:g,innerDecorations:v,editor:t,extension:n,HTMLAttributes:b})};return[n.name,c]}))}dispatchTransaction(t){const{editor:e}=this;return oa([...this.extensions].reverse()).reduceRight((r,o)=>{const l={name:o.name,options:o.options,storage:this.editor.extensionStorage[o.name],editor:e,type:Gl(o.name,this.schema)},a=ge(o,"dispatchTransaction",l);return a?c=>{a.call(l,{transaction:c,next:r})}:r},t)}transformPastedHTML(t){const{editor:e}=this;return oa([...this.extensions]).reduce((r,o)=>{const l={name:o.name,options:o.options,storage:this.editor.extensionStorage[o.name],editor:e,type:Gl(o.name,this.schema)},a=ge(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}=Fs(this.extensions);return Object.fromEntries(e.filter(n=>!!ge(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=ge(n,"addMarkView",o);if(!l)return[];const a=(c,d,h)=>{const p=Hc(c,r);return l()({mark:c,view:d,inline:h,editor:t,extension:n,HTMLAttributes:p,updateAttributes:g=>{QF(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:Gl(e.name,this.schema)};e.type==="mark"&&((n=rt(ge(e,"keepOnSplit",r)))==null||n)&&this.splittableMarks.push(e.name);const o=ge(e,"onBeforeCreate",r),l=ge(e,"onCreate",r),a=ge(e,"onUpdate",r),c=ge(e,"onSelectionUpdate",r),d=ge(e,"onTransaction",r),h=ge(e,"onFocus",r),p=ge(e,"onBlur",r),g=ge(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)})}};Sf.resolve=iR;Sf.sort=oa;Sf.flatten=fg;var BF={};ag(BF,{ClipboardTextSerializer:()=>dR,Commands:()=>hR,Delete:()=>pR,Drop:()=>mR,Editable:()=>gR,FocusEvents:()=>vR,Keymap:()=>bR,Paste:()=>SR,Tabindex:()=>xR,TextDirection:()=>wR,focusEventsPluginKey:()=>yR});var bt=class fR extends hg{constructor(){super(...arguments),this.type="extension"}static create(e={}){const n=typeof e=="function"?e():e;return new fR(n)}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}},dR=bt.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new vt({key:new Xt("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=sR(n);return oR(r,{from:a,to:c},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:d})}}})]}}),hR=bt.create({name:"commands",addCommands(){return{...KE}}}),pR=bt.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=$V(t.before,[t,...e]);tF(p).forEach(b=>{p.mapping.mapResult(b.oldRange.from).deletedAfter&&p.mapping.mapResult(b.oldRange.to).deletedBefore&&p.before.nodesBetween(b.oldRange.from,b.oldRange.to,(S,x)=>{const C=x+S.nodeSize-2,E=b.oldRange.from<=x&&C<=b.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:b.oldRange,newRange:b.newRange,partial:!E,editor:this.editor,transaction:t,combinedTransform:p})})});const v=p.mapping;p.steps.forEach((b,S)=>{var x,C;if(b instanceof Yn){const E=v.slice(S).map(b.from,-1),A=v.slice(S).map(b.to),N=v.invert().map(E,-1),D=v.invert().map(A),j=(x=p.doc.nodeAt(E-1))==null?void 0:x.marks.some(_=>_.eq(b.mark)),$=(C=p.doc.nodeAt(A))==null?void 0:C.marks.some(_=>_.eq(b.mark));this.editor.emit("delete",{type:"mark",mark:b.mark,from:b.from,to:b.to,deletedRange:{from:N,to:D},newRange:{from:E,to:A},partial:!!($||j),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()}}),mR=bt.create({name:"drop",addProseMirrorPlugins(){return[new vt({key:new Xt("tiptapDrop"),props:{handleDrop:(t,e,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:r})}}})]}}),gR=bt.create({name:"editable",addProseMirrorPlugins(){return[new vt({key:new Xt("editable"),props:{editable:()=>this.editor.options.editable}})]}}),yR=new Xt("focusEvents"),vR=bt.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new vt({key:yR,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}}}})]}}),bR=bt.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:v,parent:b}=g,S=g.parent.isTextblock&&v>0?c.doc.resolve(v-1):g,x=S.parent.type.spec.isolating,C=g.pos-g.parentOffset,E=x&&S.parent.childCount===1?C===g.pos:_e.atStart(h).from===v;return!p||!b.type.isTextblock||b.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 $c()||WE()?l:o},addProseMirrorPlugins(){return[new vt({key:new Xt("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=_e.atStart(e.doc).from,h=_e.atEnd(e.doc).to;if(l||!(a===d&&c===h)||!bf(n.doc))return;const v=n.tr,b=gf({state:n,transaction:v}),{commands:S}=new yf({editor:this.editor,state:b});if(S.clearNodes(),!!v.steps.length)return v}})]}}),SR=bt.create({name:"paste",addProseMirrorPlugins(){return[new vt({key:new Xt("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),xR=bt.create({name:"tabindex",addProseMirrorPlugins(){return[new vt({key:new Xt("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}}),wR=bt.create({name:"textDirection",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];const{nodeExtensions:t}=Fs(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 vt({key:new Xt("textDirection"),props:{attributes:()=>{const t=this.options.direction;return t?{dir:t}:{}}}})]}}),VF=class Zl{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 Zl(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 Zl(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 Zl(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 Zl(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)}},FF=`.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 PF(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 $F=class extends AF{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:oF,createMappablePosition:sF},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=QE(e,this.options.autofocus);this.editorState=As.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=PF(FF,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=tR(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?[gR,dR.configure({blockSeparator:(e=(t=this.options.coreExtensionOptions)==null?void 0:t.clipboardTextSerializer)==null?void 0:e.blockSeparator}),hR,vR,bR,xR,mR,SR,pR,wR.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 Sf(r,this)}createCommandManager(){this.commandManager=new yf({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let t;try{t=fm(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=fm(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 qE(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 ZV(this.state,t)}isActive(t,e){const n=typeof t=="string"?t:null,r=typeof t=="string"?e:t;return rF(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return dg(this.state.doc.content,this.schema)}getText(t){const{blockSeparator:e=`
138
+
139
+ `,textSerializers:n={}}=t||{};return JV(this.state.doc,{blockSeparator:e,textSerializers:{...sR(this.schema),...n}})}get isEmpty(){return bf(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 VF(e,this)}get $doc(){return this.$pos(0)}},HF={};ag(HF,{createAtomBlockMarkdownSpec:()=>UF,createBlockMarkdownSpec:()=>qF,createInlineMarkdownSpec:()=>YF,parseAttributes:()=>pg,parseIndentedBlocks:()=>XF,renderNestedMarkdownContent:()=>JF,serializeAttributes:()=>mg});function pg(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 v=parseInt(((g=p.match(/__QUOTED_(\d+)__/))==null?void 0:g[1])||"0",10),b=n[v];b&&(e[h]=b.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 UF(t){const{nodeName:e,name:n,parseAttributes:r=pg,serializeAttributes:o=mg,defaultAttributes:l={},requiredAttributes:a=[],allowedAttributes:c}=t,d=n||e,h=p=>{if(!c)return p;const g={};return c.forEach(v=>{v in p&&(g[v]=p[v])}),g};return{parseMarkdown:(p,g)=>{const v={...l,...p.attributes};return g.createNode(e,v,[])},markdownTokenizer:{name:e,level:"block",start(p){var g;const v=new RegExp(`^:::${d}(?:\\s|$)`,"m"),b=(g=p.match(v))==null?void 0:g.index;return b!==void 0?b:-1},tokenize(p,g,v){const b=new RegExp(`^:::${d}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),S=p.match(b);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||{}),v=o(g),b=v?` {${v}}`:"";return`:::${d}${b} :::`}}}function qF(t){const{nodeName:e,name:n,getContent:r,parseAttributes:o=pg,serializeAttributes:l=mg,defaultAttributes:a={},content:c="block",allowedAttributes:d}=t,h=n||e,p=g=>{if(!d)return g;const v={};return d.forEach(b=>{b in g&&(v[b]=g[b])}),v};return{parseMarkdown:(g,v)=>{let b;if(r){const x=r(g);b=typeof x=="string"?[{type:"text",text:x}]:x}else c==="block"?b=v.parseChildren(g.tokens||[]):b=v.parseInline(g.tokens||[]);const S={...a,...g.attributes};return v.createNode(e,S,b)},markdownTokenizer:{name:e,level:"block",start(g){var v;const b=new RegExp(`^:::${h}`,"m"),S=(v=g.match(b))==null?void 0:v.index;return S!==void 0?S:-1},tokenize(g,v,b){var S;const x=new RegExp(`^:::${h}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),C=g.match(x);if(!C)return;const[E,A=""]=C,N=o(A);let D=1;const j=E.length;let $="";const _=/^:::([\w-]*)(\s.*)?/gm,B=g.slice(j);for(_.lastIndex=0;;){const Z=_.exec(B);if(Z===null)break;const ie=Z.index,pe=Z[1];if(!((S=Z[2])!=null&&S.endsWith(":::"))){if(pe)D+=1;else if(D-=1,D===0){const se=B.slice(0,ie);$=se.trim();const be=g.slice(0,j+ie+Z[0].length);let te=[];if($)if(c==="block")for(te=b.blockTokens(se),te.forEach(ye=>{ye.text&&(!ye.tokens||ye.tokens.length===0)&&(ye.tokens=b.inlineTokens(ye.text))});te.length>0;){const ye=te[te.length-1];if(ye.type==="paragraph"&&(!ye.text||ye.text.trim()===""))te.pop();else break}else te=b.inlineTokens($);return{type:e,raw:be,attributes:N,content:$,tokens:te}}}}}},renderMarkdown:(g,v)=>{const b=p(g.attrs||{}),S=l(b),x=S?` {${S}}`:"",C=v.renderChildren(g.content||[],`
140
+
141
+ `);return`:::${h}${x}
142
+
143
+ ${C}
144
+
145
+ :::`}}}function GF(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 KF(t){return Object.entries(t).filter(([,e])=>e!=null).map(([e,n])=>`${e}="${n}"`).join(" ")}function YF(t){const{nodeName:e,name:n,getContent:r,parseAttributes:o=GF,serializeAttributes:l=KF,defaultAttributes:a={},selfClosing:c=!1,allowedAttributes:d}=t,h=n||e,p=v=>{if(!d)return v;const b={};return d.forEach(S=>{const x=typeof S=="string"?S:S.name,C=typeof S=="string"?void 0:S.skipIfDefault;if(x in v){const E=v[x];if(C!==void 0&&E===C)return;b[x]=E}}),b},g=h.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(v,b)=>{const S={...a,...v.attributes};if(c)return b.createNode(e,S);const x=r?r(v):v.content||"";return x?b.createNode(e,S,[b.createTextNode(x)]):b.createNode(e,S,[])},markdownTokenizer:{name:e,level:"inline",start(v){const b=c?new RegExp(`\\[${g}\\s*[^\\]]*\\]`):new RegExp(`\\[${g}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${g}\\]`),S=v.match(b),x=S?.index;return x!==void 0?x:-1},tokenize(v,b,S){const x=c?new RegExp(`^\\[${g}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${g}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${g}\\]`),C=v.match(x);if(!C)return;let E="",A="";if(c){const[,D]=C;A=D}else{const[,D,j]=C;A=D,E=j||""}const N=o(A.trim());return{type:e,raw:C[0],content:E.trim(),attributes:N}}},renderMarkdown:v=>{let b="";r?b=r(v):v.content&&v.content.length>0&&(b=v.content.filter(E=>E.type==="text").map(E=>E.text).join(""));const S=p(v.attrs||{}),x=l(S),C=x?` ${x}`:"";return c?`[${h}${C}]`:`[${h}${C}]${b}[/${h}]`}}}function XF(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 v=c[p],b=v.match(e.itemPattern);if(!b){if(d.length>0)break;if(v.trim()===""){p+=1,h=`${h}${v}
147
+ `;continue}else return}const S=e.extractItemData(b),{indentLevel:x,mainContent:C}=S;h=`${h}${v}
148
+ `;const E=[C];for(p+=1;p<c.length;){const j=c[p];if(j.trim()===""){const _=c.slice(p+1).findIndex(ie=>ie.trim()!=="");if(_===-1)break;if((((o=(r=c[p+1+_].match(/^(\s*)/))==null?void 0:r[1])==null?void 0:o.length)||0)>x){E.push(j),h=`${h}${j}
149
+ `,p+=1;continue}else break}if((((a=(l=j.match(/^(\s*)/))==null?void 0:l[1])==null?void 0:a.length)||0)>x)E.push(j),h=`${h}${j}
150
+ `,p+=1;else break}let A;const N=E.slice(1);if(N.length>0){const j=N.map($=>$.slice(x+g)).join(`
151
+ `);j.trim()&&(e.customNestedParser?A=e.customNestedParser(j):A=n.blockTokens(j))}const D=e.createToken(S,A);d.push(D)}if(d.length!==0)return{items:d,raw:h}}function JF(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,v;const b=(v=(g=e.renderChild)==null?void 0:g.call(e,h,p+1))!=null?v:e.renderChildren([h]);if(b!=null){const S=b.split(`
152
+ `).map(x=>x?e.indent(x):e.indent("")).join(`
153
+ `);d+=h.type==="paragraph"?`
154
+
155
+ ${S}`:`
156
+ ${S}`}}),d}function QF(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(b=>{if(b!==a)return!1;g=b}),!g)return;let v=!1;if(Object.keys(n).forEach(b=>{n[b]!==g.attrs[b]&&(v=!0)}),v){const b=t.type.create({...t.attrs,...n});l.removeMark(h,p,t.type),l.addMark(h,p,b)}}),l.docChanged&&e.view.dispatch(l)}var gg=class CR extends hg{constructor(){super(...arguments),this.type="node"}static create(e={}){const n=typeof e=="function"?e():e;return new CR(n)}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}},ZF=gg.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
157
+
158
+ `):""}),WF=ZF,Ox="&nbsp;",e4=" ",t4=gg.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",rR(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===Ox||r[0].text===e4)?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?Ox:""}return e.renderChildren(l)},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),n4=t4;function r4(t={}){return new vt({view(e){return new i4(e,t)}})}class i4{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,v=e.nodeAfter;if(g||v){let b=this.editorView.nodeDOM(this.cursorPos-(g?g.nodeSize:0));if(b){let S=b.getBoundingClientRect(),x=g?S.bottom:S.top;g&&v&&(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),v=this.width/2*a;r={left:g.left-v,right:g.left+v,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(),v=g.width/d.offsetWidth,b=g.height/d.offsetHeight;h=g.left-d.scrollLeft*v,p=g.top-d.scrollTop*b}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=qM(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 lt extends _e{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return lt.valid(r)?new lt(r):_e.near(r)}content(){return oe.empty}eq(e){return e instanceof lt&&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 lt(e.resolve(n.pos))}getBookmark(){return new yg(this.anchor)}static valid(e){let n=e.parent;if(n.inlineContent||!o4(e)||!s4(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&&lt.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(lt.valid(d))return d}for(;;){let a=n>0?l.firstChild:l.lastChild;if(!a){if(l.isAtom&&!l.isText&&!Se.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(lt.valid(c))return c}return null}}}lt.prototype.visible=!1;lt.findFrom=lt.findGapCursorFrom;_e.jsonID("gapcursor",lt);class yg{constructor(e){this.pos=e}map(e){return new yg(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return lt.valid(n)?new lt(n):_e.near(n)}}function MR(t){return t.isAtom||t.spec.isolating||t.spec.createGapCursor}function o4(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||MR(o.type))return!0;if(o.inlineContent)return!1}}return!0}function s4(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||MR(o.type))return!0;if(o.inlineContent)return!1}}return!0}function l4(){return new vt({props:{decorations:f4,createSelectionBetween(t,e,n){return e.pos==n.pos&&lt.valid(n)?new lt(n):null},handleClick:u4,handleKeyDown:a4,handleDOMEvents:{beforeinput:c4}}})}const a4=GE({ArrowLeft:dc("horiz",-1),ArrowRight:dc("horiz",1),ArrowUp:dc("vert",-1),ArrowDown:dc("vert",1)});function dc(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=lt.findGapCursorFrom(c,e,d);return h?(o&&o(r.tr.setSelection(new lt(h))),!0):!1}}function u4(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!lt.valid(r))return!1;let o=t.posAtCoords({left:n.clientX,top:n.clientY});return o&&o.inside>-1&&Se.isSelectable(t.state.doc.nodeAt(o.inside))?!1:(t.dispatch(t.state.tr.setSelection(new lt(r))),!0)}function c4(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof lt))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=ee.empty;for(let a=r.length-1;a>=0;a--)o=ee.from(r[a].createAndFill(null,o));let l=t.state.tr.replace(n.pos,n.pos,new oe(o,0,0));return l.setSelection(Oe.near(l.doc.resolve(n.pos+1))),t.dispatch(l),!1}function f4(t){if(!(t.selection instanceof lt))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",it.create(t.doc,[Ht.widget(t.selection.head,e,{key:"gapcursor"})])}var Uc=200,At=function(){};At.prototype.append=function(e){return e.length?(e=At.from(e),!this.length&&e||e.length<Uc&&this.leafAppend(e)||this.length<Uc&&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 d4(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 ER(e):At.empty};var ER=(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<=Uc)return new e(this.values.concat(o.flatten()))},e.prototype.leafPrepend=function(o){if(this.length+o.length<=Uc)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 ER([]);var d4=(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 h4=500;class Gn{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,v)=>{if(!g.step){o||(o=this.remapping(r,v+1),l=o.maps.length),l--,p.push(g);return}if(o){p.push(new sr(g.map));let b=g.step.map(o.slice(l)),S;b&&a.maybeStep(b).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 Gn(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]),v=new sr(e.mapping.maps[p],g,n),b;(b=d&&d.merge(v))&&(v=b,p?l.pop():c=c.slice(0,c.length-1)),l.push(v),n&&(a++,n=void 0),o||(d=v)}let h=a-r.depth;return h>m4&&(c=p4(c,h),a-=h),new Gn(c.append(l),a)}remapping(e,n){let r=new pa;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 Gn(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(v=>{v.selection&&c--},o);let d=n;this.items.forEach(v=>{let b=l.getMirror(--d);if(b==null)return;a=Math.min(a,b);let S=l.maps[b];if(v.step){let x=e.steps[b].invert(e.docs[b]),C=v.selection&&v.selection.map(l.slice(d+1,b));C&&c++,r.push(new sr(S,x,C))}else r.push(new sr(S))},o);let h=[];for(let v=n;v<a;v++)h.push(new sr(l.maps[v]));let p=this.items.slice(0,o).append(h).append(r),g=new Gn(p,c);return g.emptyItemCount()>h4&&(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),v,b=o.length-1;(v=o.length&&o[b].merge(g))?o[b]=v:o.push(g)}}else a.map&&r--},this.items.length,0),new Gn(At.from(o.reverse()),l)}}Gn.empty=new Gn(At.empty,0);function p4(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 xi{constructor(e,n,r,o,l){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=o,this.prevComposition=l}}const m4=20;function g4(t,e,n,r){let o=n.getMeta(yo),l;if(o)return o.historyState;n.getMeta(b4)&&(t=new xi(t.done,t.undone,null,0,-1));let a=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(a&&a.getMeta(yo))return a.getMeta(yo).redo?new xi(t.done.addTransform(n,void 0,r,Sc(e)),t.undone,kx(n.mapping.maps),t.prevTime,t.prevComposition):new xi(t.done,t.undone.addTransform(n,void 0,r,Sc(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||!y4(n,t.prevRanges)),h=a?Mp(t.prevRanges,n.mapping):kx(n.mapping.maps);return new xi(t.done.addTransform(n,d?e.selection.getBookmark():void 0,r,Sc(e)),Gn.empty,h,n.time,c??t.prevComposition)}else return(l=n.getMeta("rebased"))?new xi(t.done.rebased(n,l),t.undone.rebased(n,l),Mp(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new xi(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),Mp(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function y4(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 kx(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 Mp(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 v4(t,e,n){let r=Sc(e),o=yo.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 xi(n?c:l.remaining,n?l.remaining:c,null,0,-1);return l.transform.setSelection(a).setMeta(yo,{redo:n,historyState:d})}let Ep=!1,Nx=null;function Sc(t){let e=t.plugins;if(Nx!=e){Ep=!1,Nx=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){Ep=!0;break}}return Ep}const yo=new Xt("history"),b4=new Xt("closeHistory");function S4(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new vt({key:yo,state:{init(){return new xi(Gn.empty,Gn.empty,null,0,-1)},apply(e,n,r){return g4(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,o=r=="historyUndo"?TR:r=="historyRedo"?AR:null;return!o||!e.editable?!1:(n.preventDefault(),o(e.state,e.dispatch))}}}})}function RR(t,e){return(n,r)=>{let o=yo.getState(n);if(!o||(t?o.undone:o.done).eventCount==0)return!1;if(r){let l=v4(o,n,t);l&&r(e?l.scrollIntoView():l)}return!0}}const TR=RR(!1,!0),AR=RR(!0,!0);bt.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 vt({key:new Xt("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)}})]}});bt.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[r4(this.options)]}});bt.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new vt({key:new Xt("focus"),props:{decorations:({doc:t,selection:e})=>{const{isEditable:n,isFocused:r}=this.editor,{anchor:o}=e,l=[];if(!n||!r)return it.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(Ht.node(h,h+d.nodeSize,{class:this.options.className}))}),it.create(t,l)}}})]}});bt.create({name:"gapCursor",addProseMirrorPlugins(){return[l4()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=rt(ge(t,"allowGapCursor",n)))!=null?e:null}}});var Dx="placeholder";function x4(t){return t.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}var w4=bt.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:Dx,placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){const t=this.options.dataAttribute?`data-${x4(this.options.dataAttribute)}`:`data-${Dx}`;return[new vt({key:new Xt("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&&bf(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 v=Ht.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(v)}return this.options.includeChildren}),it.create(e,l)}}})]}});bt.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:t,options:e}=this;return[new vt({key:new Xt("selection"),props:{decorations(n){return n.selection.empty||t.isFocused||!t.isEditable||iF(n.selection)||t.view.dragging?null:it.create(n.doc,[Ht.inline(n.selection.from,n.selection.to,{class:e.className})])}}})]}});function _x({types:t,node:e}){return e&&Array.isArray(t)&&t.includes(e.type)||e?.type===t}bt.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var t;const e=new Xt(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 vt({key:e,appendTransaction:(o,l,a)=>{const{doc:c,tr:d,schema:h}=a,p=e.getState(a),g=c.content.size,v=h.nodes[n];if(p)return d.insert(g,v.create())},state:{init:(o,l)=>{const a=l.tr.doc.lastChild;return!_x({node:a,types:r})},apply:(o,l)=>{if(!o.docChanged||o.getMeta("__uniqueIDTransaction"))return l;const a=o.doc.lastChild;return!_x({node:a,types:r})}}})]}});bt.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>TR(t,e),redo:()=>({state:t,dispatch:e})=>AR(t,e)}},addProseMirrorPlugins(){return[S4(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 C4=w4,M4=gg.create({name:"text",group:"inline",parseMarkdown:t=>({type:"text",text:t.text||""}),renderMarkdown:t=>t.text||""}),E4=M4;const{getOwnPropertyNames:R4,getOwnPropertySymbols:T4}=Object,{hasOwnProperty:A4}=Object.prototype;function Rp(t,e){return function(r,o,l){return t(r,o,l)&&e(r,o,l)}}function hc(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 O4(t){return t?.[Symbol.toStringTag]}function zx(t){return R4(t).concat(T4(t))}const k4=Object.hasOwn||((t,e)=>A4.call(t,e));function To(t,e){return t===e||!t&&!e&&t!==t&&e!==e}const N4="__v",D4="__o",_4="_owner",{getOwnPropertyDescriptor:jx,keys:Lx}=Object;function z4(t,e){return t.byteLength===e.byteLength&&qc(new Uint8Array(t),new Uint8Array(e))}function j4(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 L4(t,e){return t.byteLength===e.byteLength&&qc(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function I4(t,e){return To(t.getTime(),e.getTime())}function B4(t,e){return t.name===e.name&&t.message===e.message&&t.cause===e.cause&&t.stack===e.stack}function V4(t,e){return t===e}function Ix(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 v=a.value,b=c.value;if(n.equals(v[0],b[0],d,g,t,e,n)&&n.equals(v[1],b[1],v[0],b[0],t,e,n)){p=o[g]=!0;break}g++}if(!p)return!1;d++}return!0}const F4=To;function P4(t,e,n){const r=Lx(t);let o=r.length;if(Lx(e).length!==o)return!1;for(;o-- >0;)if(!OR(t,e,n,r[o]))return!1;return!0}function Kl(t,e,n){const r=zx(t);let o=r.length;if(zx(e).length!==o)return!1;let l,a,c;for(;o-- >0;)if(l=r[o],!OR(t,e,n,l)||(a=jx(t,l),c=jx(e,l),(a||c)&&(!a||!c||a.configurable!==c.configurable||a.enumerable!==c.enumerable||a.writable!==c.writable)))return!1;return!0}function $4(t,e){return To(t.valueOf(),e.valueOf())}function H4(t,e){return t.source===e.source&&t.flags===e.flags}function Bx(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 qc(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 U4(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 OR(t,e,n,r){return(r===_4||r===D4||r===N4)&&(t.$$typeof||e.$$typeof)?!0:k4(e,r)&&n.equals(t[r],e[r],r,r,t,e,n)}const q4="[object ArrayBuffer]",G4="[object Arguments]",K4="[object Boolean]",Y4="[object DataView]",X4="[object Date]",J4="[object Error]",Q4="[object Map]",Z4="[object Number]",W4="[object Object]",e5="[object RegExp]",t5="[object Set]",n5="[object String]",r5={"[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},i5="[object URL]",o5=Object.prototype.toString;function s5({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:v,areUrlsEqual:b,unknownTagComparators:S}){return function(C,E,A){if(C===E)return!0;if(C==null||E==null)return!1;const N=typeof C;if(N!==typeof E)return!1;if(N!=="object")return N==="number"?c(C,E,A):N==="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 j=o5.call(C);if(j===X4)return r(C,E,A);if(j===e5)return p(C,E,A);if(j===Q4)return a(C,E,A);if(j===t5)return g(C,E,A);if(j===W4)return typeof C.then!="function"&&typeof E.then!="function"&&d(C,E,A);if(j===i5)return b(C,E,A);if(j===J4)return o(C,E,A);if(j===G4)return d(C,E,A);if(r5[j])return v(C,E,A);if(j===q4)return t(C,E,A);if(j===Y4)return n(C,E,A);if(j===K4||j===Z4||j===n5)return h(C,E,A);if(S){let $=S[j];if(!$){const _=O4(C);_&&($=S[_])}if($)return $(C,E,A)}return!1}}function l5({circular:t,createCustomConfig:e,strict:n}){let r={areArrayBuffersEqual:z4,areArraysEqual:n?Kl:j4,areDataViewsEqual:L4,areDatesEqual:I4,areErrorsEqual:B4,areFunctionsEqual:V4,areMapsEqual:n?Rp(Ix,Kl):Ix,areNumbersEqual:F4,areObjectsEqual:n?Kl:P4,arePrimitiveWrappersEqual:$4,areRegExpsEqual:H4,areSetsEqual:n?Rp(Bx,Kl):Bx,areTypedArraysEqual:n?Rp(qc,Kl):qc,areUrlsEqual:U4,unknownTagComparators:void 0};if(e&&(r=Object.assign({},r,e(r))),t){const o=hc(r.areArraysEqual),l=hc(r.areMapsEqual),a=hc(r.areObjectsEqual),c=hc(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:o,areMapsEqual:l,areObjectsEqual:a,areSetsEqual:c})}return r}function a5(t){return function(e,n,r,o,l,a,c){return t(e,n,c)}}function u5({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 c5=Vi();Vi({strict:!0});Vi({circular:!0});Vi({circular:!0,strict:!0});Vi({createInternalComparator:()=>To});Vi({strict:!0,createInternalComparator:()=>To});Vi({circular:!0,createInternalComparator:()=>To});Vi({circular:!0,createInternalComparator:()=>To,strict:!0});function Vi(t={}){const{circular:e=!1,createInternalComparator:n,createState:r,strict:o=!1}=t,l=l5(t),a=s5(l),c=n?n(a):a5(a);return u5({circular:e,comparator:a,createState:r,equals:c,strict:o})}var Tp={exports:{}},Ap={};var Vx;function f5(){if(Vx)return Ap;Vx=1;var t=xa(),e=sw();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 Ap.useSyncExternalStoreWithSelector=function(h,p,g,v,b){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($){if(!A){if(A=!0,N=$,$=v($),b!==void 0&&x.hasValue){var _=x.value;if(b(_,$))return D=_}return D=$}if(_=D,r(N,$))return _;var B=v($);return b!==void 0&&b(_,B)?(N=$,_):(N=$,D=B)}var A=!1,N,D,j=g===void 0?null:g;return[function(){return E(p())},j===null?void 0:function(){return E(j())}]},[p,g,v,b]);var C=o(h,S[0],S[1]);return a(function(){x.hasValue=!0,x.value=C},[C]),d(C),C},Ap}var Fx;function d5(){return Fx||(Fx=1,Tp.exports=f5()),Tp.exports}var h5=d5(),p5=(...t)=>e=>{t.forEach(n=>{typeof n=="function"?n(e):n&&(n.current=e)})},m5=({contentComponent:t})=>{const e=lw.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getServerSnapshot);return T.jsx(T.Fragment,{children:Object.values(e)})};function g5(){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]:C1.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 y5=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=g5(),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:p5(e,this.editorContentRef),...n}),t?.contentComponent&&T.jsx(m5,{contentComponent:t.contentComponent})]})}},v5=M.forwardRef((t,e)=>{const n=tn.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[t.editor]);return tn.createElement(y5,{key:n,innerRef:e,...t})}),kR=tn.memo(v5),b5=typeof window<"u"?M.useLayoutEffect:M.useEffect,S5=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 x5(t){var e;const[n]=M.useState(()=>new S5(t.editor)),r=h5.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getServerSnapshot,t.selector,(e=t.equalityFn)!=null?e:c5);return b5(()=>n.watch(t.editor),[t.editor,n]),M.useDebugValue(r),r}var w5=!1,hm=typeof window>"u",C5=hm||!!(typeof window<"u"&&window.next),M5=class NR{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?hm||C5?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 $F(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?NR.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 E5(t={},e=[]){const n=M.useRef(t);n.current=t;const[r]=M.useState(()=>new M5(n)),o=lw.useSyncExternalStore(r.subscribe,r.getEditor,r.getServerSnapshot);return M.useDebugValue(o),M.useEffect(r.onRender(e)),x5({editor:o,selector:({transactionNumber:l})=>t.shouldRerenderOnTransaction===!1||t.shouldRerenderOnTransaction===void 0?null:t.immediatelyRender&&l===0?0:l+1}),o}var DR=M.createContext({editor:null});DR.Consumer;var R5=M.createContext({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),T5=()=>M.useContext(R5);tn.forwardRef((t,e)=>{const{onDragStart:n}=T5(),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 vg=M.createContext({get editor(){throw new Error("useTiptap must be used within a <Tiptap> provider")}});vg.displayName="TiptapContext";var A5=()=>M.useContext(vg);function _R({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(DR.Provider,{value:l,children:T.jsx(vg.Provider,{value:o,children:n})})}_R.displayName="Tiptap";function zR({...t}){const{editor:e}=A5();return T.jsx(kR,{editor:e,...t})}zR.displayName="Tiptap.Content";Object.assign(_R,{Content:zR});function O5({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 k5=Cm("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 Px({className:t,align:e="inline-start",...n}){return T.jsx("div",{role:"group","data-slot":"input-group-addon","data-align":e,className:Ne(k5({align:e}),t),onClick:r=>{r.target.closest("button")||r.currentTarget.parentElement?.querySelector("input")?.focus()},...n})}const N5=Cm("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 D5({className:t,type:e="button",variant:n="ghost",size:r="xs",...o}){return T.jsx(Ds,{type:e,"data-size":r,variant:n,className:Ne(N5({size:r}),t),...o})}const $x=new Xt("data-table-search-selector-highlighter"),jR="refresh-data-table-search-selector-highlighter",LR={fields:[]};function Hx(t){const e=y3(Gc(t),LR.fields);return it.create(t,e.map(n=>{const r=Os(t,n.start),o=Os(t,n.end);return r>=o?null:Ht.inline(r,o,{class:"data-table-search-input-selector-token","data-table-search-selector":""},{inclusiveEnd:!1,inclusiveStart:!1})}).filter(n=>n!==null))}const _5=bt.create({name:"dataTableSelectorHighlighter",addProseMirrorPlugins(){return[new vt({key:$x,state:{init:(t,e)=>Hx(e.doc),apply:(t,e,n,r)=>t.docChanged||t.getMeta(jR)?Hx(r.doc):e.map(t.mapping,t.doc)},props:{decorations(t){return $x.getState(t)}}})]}});function Ux(t,e){if(typeof t=="function"){t(e);return}t&&(t.current=e)}function qx(t){return{content:t?[{content:[{text:t,type:"text"}],type:"paragraph"}]:[{type:"paragraph"}],type:"doc"}}function Gc(t){return t.textBetween(0,t.content.size,"","")}function Es(t){return t.state.doc.textBetween(0,t.state.selection.from,"","").length}function Os(t,e){const n=Gc(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 z5(t){return t.replace(/\r\n?/g,`
159
+ `).replace(/\n/g," ")}function Gx(t,e,n){return e<=0?-1:t<0?n===1?0:e-1:(t+n+e)%e}function j5({inputRef:t,isLoading:e=!1,placeholder:n="Search table...",...r}){const o=$m(),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),v=M.useRef(-1),b=M.useRef(!1),S=M.useRef([]),x=M.useRef(()=>{}),C=M.useRef(null),[E,A]=M.useState(0),[N,D]=M.useState(!1),[j,$]=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 _=M.useCallback(L=>{v.current=L,$(L)},[]),B=M.useMemo(()=>v3(a,E,l),[E,l,a]),Z=M.useMemo(()=>B.filter(L=>L.group==="input"),[B]),ie=M.useMemo(()=>B.filter(L=>L.group==="values"),[B]),pe=M.useMemo(()=>B.filter(L=>L.group==="filters"),[B]),se=M.useCallback((L,q,Y)=>{L.commands.setContent(qx(q),{emitUpdate:!1,parseOptions:{preserveWhitespace:"full"}}),Y&&L.commands.setTextSelection({from:Os(L.state.doc,Y.start),to:Os(L.state.doc,Y.end)})},[]),be=M.useCallback((L,q)=>{const Y=b3(a,E,l,q);C.current={end:Y.selectionStart,start:Y.selectionStart},A(Y.selectionStart),D(Y.keepOpen),Y.keepOpen||(b.current=!0),L&&(se(L,Y.value,C.current),L.commands.focus()),c(Y.value)},[E,l,c,se,a]),te=E5({content:qx(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:(L,q)=>{if(q.key==="Escape")return q.preventDefault(),b.current=!0,D(!1),!0;if(q.key==="ArrowDown")return q.preventDefault(),D(!0),_(Gx(v.current,S.current.length,1)),!0;if(q.key==="ArrowUp")return q.preventDefault(),D(!0),_(Gx(v.current,S.current.length,-1)),!0;if(q.key==="Tab"){const Y=S.current[v.current];return!g.current||!Y?!1:(q.preventDefault(),x.current(te,Y),!0)}if(q.key==="Enter"){q.preventDefault(),q.stopPropagation();const Y=S.current[v.current];return g.current&&Y?x.current(te,Y):A(Es(te)),!0}return!1},handlePaste:(L,q)=>{const Y=q.clipboardData?.getData("text/plain");return typeof Y!="string"?!1:(q.preventDefault(),L.dispatch(L.state.tr.insertText(z5(Y),L.state.selection.from,L.state.selection.to)),!0)}},extensions:[WF,n4,E4,C4.configure({placeholder:n}),_5,bt.create({name:"singleLineSearchBehavior",addKeyboardShortcuts(){return{Enter:()=>!0}}})],immediatelyRender:!0,onSelectionUpdate:({editor:L})=>{A(Es(L))},onUpdate:({editor:L})=>{const q=Gc(L.state.doc);A(Es(L)),q!==p.current&&c(q),D(!0)}},[]);M.useEffect(()=>{p.current=a},[a]),M.useEffect(()=>{g.current=N},[N]),M.useEffect(()=>{v.current=j},[j]),M.useEffect(()=>{S.current=B},[B]),M.useEffect(()=>{x.current=be},[be]),M.useEffect(()=>{h.current.length=B.length},[B.length]),M.useEffect(()=>{LR.fields=l},[l]),M.useEffect(()=>{te&&te.view.dispatch(te.state.tr.setMeta(jR,!0))},[te,l]),M.useEffect(()=>{if(!te)return;const L=C.current;Gc(te.state.doc)!==a?se(te,a,L??void 0):L&&te.commands.setTextSelection({from:Os(te.state.doc,L.start),to:Os(te.state.doc,L.end)}),C.current=null,A(Es(te))},[te,se,a]),M.useEffect(()=>{const L=Math.min(E,a.length);L!==E&&A(L)},[E,a.length]),M.useEffect(()=>{const L=B.length>0?Math.min(j,B.length-1):-1;_(N?L:-1)},[j,N,_,B.length]),M.useEffect(()=>{!N||j<0||h.current[j]?.scrollIntoView({block:"nearest"})},[j,N]),M.useEffect(()=>{const L=q=>{d.current?.contains(q.target)||D(!1)};return window.addEventListener("pointerdown",L),()=>window.removeEventListener("pointerdown",L)},[]),M.useEffect(()=>{if(t)return Ux(t,{focus:()=>{te?.commands.focus()},selectAll:()=>{te?.chain().focus().selectAll().run()}}),()=>Ux(t,null)},[te,t]);const ye=e,V=[{items:Z,label:void 0},{items:ie,label:"Values"},{items:pe,label:"Filters"}];let U=0;return T.jsxs("div",{ref:d,className:"relative min-w-64 flex-1",children:[T.jsxs(O5,{className:"h-10 w-full text-lg focus-within:border-ring focus-within:ring-2 focus-within:ring-ring/30",children:[T.jsx(Px,{align:"inline-start",children:T.jsx("span",{"aria-hidden":"true",className:"flex size-5 shrink-0 items-center justify-center",children:ye?T.jsx(Jc,{className:"size-4.5 animate-spin"}):T.jsx(mm,{className:"size-4.5"})})}),T.jsx("div",{className:"min-w-0 flex-1",children:T.jsx(kR,{editor:te,onBlur:()=>{requestAnimationFrame(()=>{d.current?.contains(document.activeElement)||D(!1),b.current=!1})},onClick:()=>{A(te?Es(te):0),b.current=!1,D(!0)},onFocus:()=>{if(A(te?Es(te):0),b.current){b.current=!1;return}D(!0)}})}),T.jsx(Px,{align:"inline-end",children:a?T.jsx(D5,{"aria-label":"Clear search",size:"icon-xs",variant:"ghost",onClick:()=>{if(!te){c(""),A(0),D(!1);return}C.current={end:0,start:0},A(0),D(!1),se(te,"",C.current),te.commands.focus(),c("")},children:T.jsx(gm,{className:"pointer-events-none"})}):null})]}),N?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:B.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:V.map(L=>L.items.length===0?null:T.jsxs("div",{children:[L.label?T.jsx("div",{className:"px-2 py-1.5 text-xs text-muted-foreground",children:L.label}):null,L.items.map(q=>{const Y=U;return U+=1,T.jsx("button",{ref:k=>{h.current[Y]=k},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 ${Y===j?"bg-accent text-accent-foreground":""}`,"data-highlighted":Y===j?"":void 0,onClick:()=>be(te,q),onMouseDown:k=>{k.preventDefault()},onMouseEnter:()=>_(Y),children:T.jsx("span",{className:"truncate",children:q.label})},q.id)})]},L.label??"Input"))})})}):null]})}function IR({...t}){return T.jsx($j,{"data-slot":"dropdown-menu",...t})}function BR({...t}){return T.jsx(Hj,{"data-slot":"dropdown-menu-trigger",...t})}function VR({className:t,align:e="start",sideOffset:n=4,...r}){return T.jsx(Uj,{children:T.jsx(qj,{"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 Kx({className:t,inset:e,variant:n="default",...r}){return T.jsx(Kj,{"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 L5({className:t,children:e,checked:n,inset:r,...o}){return T.jsxs(Yj,{"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(WC,{children:T.jsx(Ps,{})})}),e]})}function FR({...t}){return T.jsx(Xj,{"data-slot":"dropdown-menu-radio-group",...t})}function PR({className:t,children:e,inset:n,...r}){return T.jsxs(Jj,{"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(WC,{children:T.jsx(Ps,{})})}),e]})}function Wl({className:t,inset:e,...n}){return T.jsx(Gj,{"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 sa({className:t,...e}){return T.jsx(Qj,{"data-slot":"dropdown-menu-separator",className:Ne("-mx-1 my-1 h-px bg-border/50",t),...e})}function Yx({...t}){return T.jsx(Zj,{"data-slot":"dropdown-menu-sub",...t})}function Xx({className:t,inset:e,children:n,...r}){return T.jsxs(Wj,{"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(a1,{className:"ml-auto"})]})}function Jx({className:t,...e}){return T.jsx(e3,{"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 I5({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 B5({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]),v=!o&&t.length>0,b=!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(IR,{children:[T.jsx(BR,{asChild:!0,children:T.jsxs(Ds,{type:"button",variant:"ghost",className:"h-10 min-w-0 border-0 flex-1 justify-between",disabled:!v,children:[T.jsx("span",{className:"truncate text-sm",children:g}),T.jsx(jO,{className:"size-4 text-muted-foreground"})]})}),T.jsxs(VR,{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(I5,{isConnected:n,isConnecting:r})}),T.jsx(sa,{}),T.jsx(Wl,{children:"Streams"}),T.jsx(sa,{}),T.jsx(FR,{value:e??"",onValueChange:h,children:t.map(x=>T.jsx(PR,{value:x.id,className:"min-h-9 text-sm",children:x.label},x.id))})]})]}),T.jsx(Ds,{type:"button",variant:"ghost",size:"icon-xl",disabled:!l,"aria-label":"Clear rows",onClick:a,className:"rounded-full",children:T.jsx(gm,{className:"size-5"})})]}),T.jsxs(Ds,{type:"button",size:"xl",variant:"outline",disabled:!b,"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(Jc,{}):n?T.jsx(PO,{className:"[&_rect]:fill-current"}):T.jsx(VO,{className:"[&_path]:fill-current"})}),"Live"]})]})}const $R="(prefers-color-scheme: dark)",V5=["dark","light","system"],HR=M.createContext(void 0);function Qx(t){return t===null?!1:V5.includes(t)}function Zx(){return window.matchMedia($R).matches?"dark":"light"}function F5(){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 P5(t){return t instanceof HTMLElement?!!(t.isContentEditable||t.closest("input, textarea, select, [contenteditable='true']")):!1}function $5({children:t,defaultTheme:e="system",storageKey:n="theme",disableTransitionOnChange:r=!0,...o}){const[l,a]=M.useState(()=>{const p=localStorage.getItem(n);return Qx(p)?p:e}),c=M.useCallback(p=>{localStorage.setItem(n,p),a(p)},[n]),d=M.useCallback(p=>{const g=document.documentElement,v=p==="system"?Zx():p,b=r?F5():null;g.classList.remove("light","dark"),g.classList.add(v),b&&b()},[r]);M.useEffect(()=>{if(d(l),l!=="system")return;const p=window.matchMedia($R),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||P5(g.target)||g.key.toLowerCase()==="d"&&a(v=>{const b=v==="dark"?"light":v==="light"?"dark":Zx()==="dark"?"light":"dark";return localStorage.setItem(n,b),b})};return window.addEventListener("keydown",p),()=>{window.removeEventListener("keydown",p)}},[n]),M.useEffect(()=>{const p=g=>{if(g.storageArea===localStorage&&g.key===n){if(Qx(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(HR.Provider,{...o,value:h,children:t})}const H5=()=>{const t=M.useContext(HR);if(t===void 0)throw new Error("useTheme must be used within a ThemeProvider");return t},U5=[{icon:h1,label:"Light",value:"light"},{icon:f1,label:"Dark",value:"dark"},{icon:d1,label:"System",value:"system"}];function q5({columns:t,isDisabled:e=!1,onExportCsv:n,onExportMarkdown:r,onToggleColumn:o,className:l}){const{theme:a,setTheme:c}=H5(),d=!e&&t.length>0;return T.jsxs(IR,{children:[T.jsx(BR,{asChild:!0,children:T.jsx(Ds,{type:"button",variant:"outline",size:"icon-xl",disabled:e,className:Ne("shrink-0",l),"aria-label":"Open settings",children:T.jsx(qO,{className:"size-4"})})}),T.jsxs(VR,{align:"end",sideOffset:10,className:"w-64 max-w-[min(24rem,calc(100vw-2rem))]",children:[T.jsx(Wl,{children:"View"}),T.jsxs(Yx,{children:[T.jsxs(Xx,{className:"min-h-9 text-sm",children:[T.jsx(d1,{className:"size-4 text-muted-foreground"}),"Columns"]}),T.jsxs(Jx,{className:"max-h-80 w-64 overflow-y-auto",children:[T.jsx(Wl,{children:"Visible columns"}),T.jsx(sa,{}),t.map(h=>T.jsx(L5,{checked:h.visible,className:"min-h-9 text-sm",onSelect:p=>{p.preventDefault()},onCheckedChange:p=>o(h.id,p===!0),children:T.jsxs("span",{className:"flex min-w-0 items-center gap-2 pr-4",children:[h.kind?T.jsx(wc,{kind:h.kind,className:"size-4 shrink-0 text-muted-foreground"}):null,T.jsx("span",{className:"truncate",children:h.label})]})},h.id))]})]}),T.jsxs(Yx,{children:[T.jsxs(Xx,{className:"min-h-9 text-sm",children:[T.jsx(h1,{className:"size-4 text-muted-foreground dark:hidden"}),T.jsx(f1,{className:"hidden size-4 text-muted-foreground dark:block"}),"Theme"]}),T.jsxs(Jx,{className:"w-44",children:[T.jsx(Wl,{children:"Appearance"}),T.jsx(sa,{}),T.jsx(FR,{value:a,onValueChange:h=>c(h),children:U5.map(h=>{const p=h.icon;return T.jsxs(PR,{value:h.value,className:"min-h-9 text-sm",children:[T.jsx(p,{className:"size-4 text-muted-foreground"}),h.label]},h.value)})})]})]}),T.jsx(sa,{}),T.jsx(Wl,{children:"Export"}),T.jsxs(Kx,{className:"min-h-9 text-sm",disabled:!d,onSelect:n,children:[T.jsx(Np,{className:"size-4 text-muted-foreground"}),"Export CSV"]}),T.jsxs(Kx,{className:"min-h-9 text-sm",disabled:!d,onSelect:r,children:[T.jsx(Np,{className:"size-4 text-muted-foreground"}),"Export Markdown"]})]})]})}const Kc="stream",UR="datatable-",Wx="datool";function Yc(t){return`${t}-search`}function Xc(t){return`${UR}${t}`}function G5(t){return t.startsWith(`${UR}${Wx}`)||t.startsWith(`${Wx}-`)&&t.endsWith("-search")}function qR(t){if(typeof window>"u")return null;try{const e=new URL(window.location.href).searchParams.get(Xc(t));return e?JSON.parse(e):null}catch{return null}}function GR(t,e){const n=new Set(e);return Object.fromEntries(Object.entries(t??{}).filter(([r])=>n.has(r)))}function K5(t,e){const n=Yc(e),r=Xc(e);for(const o of Array.from(t.searchParams.keys()))o===Kc||o===n||o===r||G5(o)&&t.searchParams.delete(o)}function KR(){return typeof window>"u"?null:new URL(window.location.href).searchParams.get(Kc)}function Op(t){return typeof window>"u"?"":new URL(window.location.href).searchParams.get(Yc(t))??""}function e1(t,e){return GR(qR(t)?.columnVisibility,e)}function Y5({columnIds:t,columnVisibility:e,search:n,selectedStreamId:r,tableId:o}){if(typeof window>"u")return;const l=new URL(window.location.href),a=n.trim(),c=GR(e,t),d={...qR(o)};K5(l,o),r?l.searchParams.set(Kc,r):l.searchParams.delete(Kc),a?l.searchParams.set(Yc(o),n):l.searchParams.delete(Yc(o)),Object.keys(c).length>0?d.columnVisibility=c:delete d.columnVisibility,Object.keys(d).length>0?l.searchParams.set(Xc(o),JSON.stringify(d)):l.searchParams.delete(Xc(o)),window.history.replaceState(window.history.state,"",l)}const X5={Ban:AO,Check:Ps,CircleAlert:pm,Copy:u1,Download:Np,ExternalLink:KO,Filter:c1,Info:ZO,Play:sk,RefreshCcw:ak,Search:mm,Trash:pk,X:gm};function J5(t){return t.map(({__datoolRowId:e,...n})=>n)}function Q5(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 Z5(){return KR()}function W5(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 kp(t){return t?`datool-${t}`:"datool"}function YR(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 t1(t){return/[",\n]/.test(t)?`"${t.replaceAll('"','""')}"`:t}function n1(t){return t.replace(/\|/g,"\\|").replace(/\r\n?/g,`
160
+ `).replace(/\n/g,"<br />")}function eP(t){return t.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"log-view"}function tP(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 nP(t,e){const n=e.map(o=>t1(o.label)).join(","),r=t.map(o=>e.map(l=>t1(YR(Um(o,l.accessorKey),l.kind))).join(","));return[n,...r].join(`
161
+ `)}function rP(t,e){const n=`| ${e.map(l=>n1(l.label)).join(" | ")} |`,r=`| ${e.map(()=>"---").join(" | ")} |`,o=t.map(l=>`| ${e.map(a=>n1(YR(Um(l,a.accessorKey),a.kind))).join(" | ")} |`);return[n,r,...o].join(`
162
+ `)}function iP(t){return t.map((e,n)=>{const r=q3(e.accessorKey);return{accessorFn:r?o=>Um(o,e.accessorKey):void 0,accessorKey:r?void 0:e.accessorKey,align:e.align,header:e.header,id:yM(e,n),kind:e.kind,maxWidth:e.maxWidth,minWidth:e.minWidth,truncate:e.truncate,width:e.width}})}function oP(t){return JSON.parse(t.data)}function sP(t){return JSON.parse(t.data)}function bg(t){return t==null?"":t instanceof Date?t.toISOString():typeof t=="object"?JSON.stringify(t):String(t)}function r1(t){return t.replace(/\|/g,"\\|").replace(/\r\n?/g,`
163
+ `).replace(/\n/g,"<br />")}function XR(t,e){if(e.accessorFn)return e.accessorFn(t);if(e.accessorKey)return t[e.accessorKey]}function JR(t,e){return t.header??t.id??t.accessorKey??`Column ${e+1}`}function lP(t,e){const n=e.map((o,l)=>r1(JR(o,l)));return[`| ${n.join(" | ")} |`,`| ${n.map(()=>"---").join(" | ")} |`,...t.map(o=>`| ${e.map(a=>r1(bg(XR(o,a)))).join(" | ")} |`)].join(`
164
+ `)}function aP(t,e){const n=bg(e);return n.trim()?`${t}:${iM(n)}`:null}function uP(t,e,n){const r=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=nM(t).filter(l=>!l.match(new RegExp(`^${r}(:|>|<)`)));return o.push(n),o.join(" ")}function cP({activeStream:t,columns:e,config:n,errorMessage:r,isConnected:o,isConnecting:l,isLoadingConfig:a,rows:c,settingsColumns:d,selectedStreamId:h,setColumnVisibility:p,searchInputRef:g,handleExport:v,setRows:b,setSelectedStreamId:S,setShouldConnect:x}){const{search:C,setSearch:E}=O3(),A=M.useMemo(()=>[...t?.actions.map(D=>({button:D.button,icon:D.icon?X5[D.icon]:void 0,id:`config-${D.id}`,label:D.label,onSelect:async({actionRowIds:j,actionRows:$})=>{if(!t)return;const _=new URL(`/api/streams/${encodeURIComponent(t.id)}/actions/${encodeURIComponent(D.id)}`,window.location.origin),B=new URL(window.location.href).searchParams;for(const[se,be]of B.entries())_.searchParams.set(se,be);const Z={rows:J5($)},ie=await fetch(_,{body:JSON.stringify(Z),headers:{"Content-Type":"application/json"},method:"POST"}),pe=await ie.json().catch(()=>null);if(!ie.ok)throw new Error(pe?.error??`Failed to run action "${D.label}".`);if(pe?.rowChanges!==void 0&&!Array.isArray(pe.rowChanges))throw new Error(`Action "${D.label}" returned an invalid response.`);b(se=>Q5(se,j,pe?.rowChanges))},scope:"selection"}))??[],{icon:u1,id:"copy-markdown",label:({actionRows:D})=>D.length>1?`Copy ${D.length} rows as Markdown`:"Copy row as Markdown",onSelect:async({actionRows:D})=>{await navigator.clipboard.writeText(lP(D,e))},scope:"selection"},{icon:c1,id:"filter-matching",items:({anchorRow:D})=>e.map((j,$)=>{const _=XR(D,j),B=aP(j.id??`column-${$}`,_);return{disabled:B===null,icon:Z=>T.jsx(wc,{kind:j.kind??"text",...Z}),id:`filter-${j.id??$}`,label:`${JR(j,$)}: ${bg(_)||"(empty)"}`,onSelect:()=>{B&&E(uP(C,j.id??`column-${$}`,B))},scope:"row"}}),label:"Filter matching",scope:"row"}],[t,e,C,E]);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(j5,{inputRef:g}),T.jsxs("div",{className:"flex min-w-20 items-start gap-3",children:[T.jsx(B5,{streams:n?.streams??[],selectedStreamId:h,isConnected:o,isConnecting:l,isDisabled:a||!n,canClear:c.length>0,onSelectStream:S,onPlay:()=>x(!0),onPause:()=>x(!1),onClear:()=>b([])}),T.jsx(q5,{columns:d,isDisabled:a||!t,onExportCsv:()=>v("csv"),onExportMarkdown:()=>v("md"),onToggleColumn:(N,D)=>p(j=>({...j,[N]:D}))})]})]}),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(U3,{rowActions:A}):T.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:"No stream selected."})})]})}function fP(){const[t]=M.useState(()=>{const U=Z5(),L=kp(U);return{search:Op(L),streamId:U,tableId:L}}),[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,v]=M.useState(!1),[b,S]=M.useState(null),[x,C]=M.useState(()=>t.search),[E,A]=M.useState({}),N=M.useRef(null),D=M.useRef(!1),[j,$]=M.useState(null);M.useEffect(()=>{let U=!1;return fetch("/api/config").then(async L=>{if(!L.ok)throw new Error("Failed to load log viewer config.");return await L.json()}).then(L=>{U||(n(L),a(q=>q&&L.streams.some(Y=>Y.id===q)?q:L.streams[0]?.id??null))}).catch(L=>{U||S(L instanceof Error?L.message:String(L))}).finally(()=>{U||p(!1)}),()=>{U=!0}},[]);const _=M.useMemo(()=>!e||!l?null:e.streams.find(U=>U.id===l)??null,[e,l]),B=M.useMemo(()=>_?iP(_.columns):[],[_]),Z=M.useMemo(()=>kp(l),[l]),ie=M.useMemo(()=>_?.columns.map((U,L)=>({accessorKey:U.accessorKey,id:yM(U,L),kind:U.kind,label:U.header??W5(U.accessorKey)}))??[],[_]),pe=M.useMemo(()=>ie.map(U=>({id:U.id,kind:U.kind,label:U.label,visible:E[U.id]!==!1})),[E,ie]),se=M.useMemo(()=>ie.filter(U=>E[U.id]!==!1),[E,ie]),be=!!l&&c&&!g,te=M.useMemo(()=>ie.map(U=>U.id),[ie]);M.useEffect(()=>{D.current&&(o([]),S(null)),D.current=!0},[l]),M.useEffect(()=>{if(!_){$(null);return}C(Op(Z)),A(e1(Z,te)),$(Z)},[_,te,Z]),M.useEffect(()=>{if(!_||j!==Z)return;const U=window.setTimeout(()=>{Y5({columnIds:te,columnVisibility:E,search:x,selectedStreamId:l,tableId:Z})},300);return()=>window.clearTimeout(U)},[_,te,E,j,x,l,Z]),M.useEffect(()=>{const U=()=>{const L=KR(),q=kp(L);a(Y=>(Y===L&&(C(Op(q)),A(e1(q,te)),$(q)),L))};return window.addEventListener("popstate",U),()=>window.removeEventListener("popstate",U)},[te]),M.useEffect(()=>{if(!l||!c){N.current?.close(),N.current=null,v(!1);return}S(null),o([]);const U=new URL(`/api/streams/${encodeURIComponent(l)}/events`,window.location.origin),L=new URL(window.location.href).searchParams;for(const[K,W]of L.entries())U.searchParams.set(K,W);const q=new EventSource(U);N.current=q;const Y=K=>{const W=oP(K);o(ne=>[...ne,{...W.row,__datoolRowId:W.id}])},k=K=>{const W=sP(K);S(W.message)};return q.onopen=()=>{v(!0)},q.onerror=()=>{v(!1)},q.addEventListener("row",Y),q.addEventListener("error",k),()=>{q.removeEventListener("row",Y),q.removeEventListener("error",k),q.close(),v(!1)}},[l,c]);const ye=M.useRef(null);M.useEffect(()=>{const U=L=>{(L.metaKey||L.ctrlKey)&&L.key.toLowerCase()==="f"&&(L.preventDefault(),ye.current?.focus(),ye.current?.selectAll())};return window.addEventListener("keydown",U),()=>window.removeEventListener("keydown",U)},[]);const V=M.useCallback(U=>{if(!_||se.length===0)return;const L=new Date().toISOString().replaceAll(":","-"),q=`${eP(_.label)}-${L}`,Y=U==="csv"?nP(r,se):rP(r,se);tP(Y,`${q}.${U}`,U==="csv"?"text/csv":"text/markdown")},[_,r,se]);return T.jsx(k3,{autoScrollToBottom:!0,columnVisibility:E,columns:B,data:r,getRowId:U=>U.__datoolRowId,height:"100%",id:Z,onColumnVisibilityChange:A,onSearchChange:C,search:x,rowHeight:20,statePersistence:"none",children:T.jsx(cP,{activeStream:_,columns:B,config:e,errorMessage:b,handleExport:V,isConnected:g,isConnecting:be,isLoadingConfig:h,rows:r,settingsColumns:pe,setColumnVisibility:A,searchInputRef:ye,selectedStreamId:l,setRows:o,setSelectedStreamId:a,setShouldConnect:d})})}yO.createRoot(document.getElementById("root")).render(T.jsx(M.StrictMode,{children:T.jsx($5,{storageKey:"datool-theme",children:T.jsx(fP,{})})}));