@valbuild/ui 0.46.1 → 0.47.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/valbuild-ui.cjs.js +55 -8
- package/dist/valbuild-ui.esm.js +55 -8
- package/package.json +3 -3
- package/server/.tmp/assets/{index-yY5yCkWt.js → index-8U9B2Ocg.js} +26 -26
- package/server/.tmp/index.html +1 -1
- package/server/dist/valbuild-ui-main.cjs.js +55 -8
- package/server/dist/valbuild-ui-main.esm.js +55 -8
- package/server/dist/valbuild-ui-server.cjs.js +1 -1
- package/server/dist/valbuild-ui-server.esm.js +1 -1
|
@@ -6,7 +6,7 @@ var xb=Object.defineProperty;var _b=(t,e,n)=>e in t?xb(t,e,{enumerable:!0,config
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var Pu=Symbol.for("react.element"),Sb=Symbol.for("react.portal"),Eb=Symbol.for("react.fragment"),Cb=Symbol.for("react.strict_mode"),kb=Symbol.for("react.profiler"),bb=Symbol.for("react.provider"),$b=Symbol.for("react.context"),Tb=Symbol.for("react.forward_ref"),Nb=Symbol.for("react.suspense"),Rb=Symbol.for("react.memo"),Ob=Symbol.for("react.lazy"),fy=Symbol.iterator;function Pb(t){return t===null||typeof t!="object"?null:(t=fy&&t[fy]||t["@@iterator"],typeof t=="function"?t:null)}var R_={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},O_=Object.assign,P_={};function
|
|
9
|
+
*/var Pu=Symbol.for("react.element"),Sb=Symbol.for("react.portal"),Eb=Symbol.for("react.fragment"),Cb=Symbol.for("react.strict_mode"),kb=Symbol.for("react.profiler"),bb=Symbol.for("react.provider"),$b=Symbol.for("react.context"),Tb=Symbol.for("react.forward_ref"),Nb=Symbol.for("react.suspense"),Rb=Symbol.for("react.memo"),Ob=Symbol.for("react.lazy"),fy=Symbol.iterator;function Pb(t){return t===null||typeof t!="object"?null:(t=fy&&t[fy]||t["@@iterator"],typeof t=="function"?t:null)}var R_={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},O_=Object.assign,P_={};function Ss(t,e,n){this.props=t,this.context=e,this.refs=P_,this.updater=n||R_}Ss.prototype.isReactComponent={};Ss.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};Ss.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function A_(){}A_.prototype=Ss.prototype;function Qm(t,e,n){this.props=t,this.context=e,this.refs=P_,this.updater=n||R_}var qm=Qm.prototype=new A_;qm.constructor=Qm;O_(qm,Ss.prototype);qm.isPureReactComponent=!0;var hy=Array.isArray,M_=Object.prototype.hasOwnProperty,eg={current:null},L_={key:!0,ref:!0,__self:!0,__source:!0};function D_(t,e,n){var r,i={},o=null,l=null;if(e!=null)for(r in e.ref!==void 0&&(l=e.ref),e.key!==void 0&&(o=""+e.key),e)M_.call(e,r)&&!L_.hasOwnProperty(r)&&(i[r]=e[r]);var s=arguments.length-2;if(s===1)i.children=n;else if(1<s){for(var a=Array(s),u=0;u<s;u++)a[u]=arguments[u+2];i.children=a}if(t&&t.defaultProps)for(r in s=t.defaultProps,s)i[r]===void 0&&(i[r]=s[r]);return{$$typeof:Pu,type:t,key:o,ref:l,props:i,_owner:eg.current}}function Ab(t,e){return{$$typeof:Pu,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}function tg(t){return typeof t=="object"&&t!==null&&t.$$typeof===Pu}function Mb(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(n){return e[n]})}var py=/\/+/g;function oh(t,e){return typeof t=="object"&&t!==null&&t.key!=null?Mb(""+t.key):e.toString(36)}function Rc(t,e,n,r,i){var o=typeof t;(o==="undefined"||o==="boolean")&&(t=null);var l=!1;if(t===null)l=!0;else switch(o){case"string":case"number":l=!0;break;case"object":switch(t.$$typeof){case Pu:case Sb:l=!0}}if(l)return l=t,i=i(l),t=r===""?"."+oh(l,0):r,hy(i)?(n="",t!=null&&(n=t.replace(py,"$&/")+"/"),Rc(i,e,n,"",function(u){return u})):i!=null&&(tg(i)&&(i=Ab(i,n+(!i.key||l&&l.key===i.key?"":(""+i.key).replace(py,"$&/")+"/")+t)),e.push(i)),1;if(l=0,r=r===""?".":r+":",hy(t))for(var s=0;s<t.length;s++){o=t[s];var a=r+oh(o,s);l+=Rc(o,e,n,a,i)}else if(a=Pb(t),typeof a=="function")for(t=a.call(t),s=0;!(o=t.next()).done;)o=o.value,a=r+oh(o,s++),l+=Rc(o,e,n,a,i);else if(o==="object")throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.");return l}function Ju(t,e,n){if(t==null)return t;var r=[],i=0;return Rc(t,r,"","",function(o){return e.call(n,o,i++)}),r}function Lb(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(n){(t._status===0||t._status===-1)&&(t._status=1,t._result=n)},function(n){(t._status===0||t._status===-1)&&(t._status=2,t._result=n)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var xn={current:null},Oc={transition:null},Db={ReactCurrentDispatcher:xn,ReactCurrentBatchConfig:Oc,ReactCurrentOwner:eg};Pe.Children={map:Ju,forEach:function(t,e,n){Ju(t,function(){e.apply(this,arguments)},n)},count:function(t){var e=0;return Ju(t,function(){e++}),e},toArray:function(t){return Ju(t,function(e){return e})||[]},only:function(t){if(!tg(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};Pe.Component=Ss;Pe.Fragment=Eb;Pe.Profiler=kb;Pe.PureComponent=Qm;Pe.StrictMode=Cb;Pe.Suspense=Nb;Pe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Db;Pe.cloneElement=function(t,e,n){if(t==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var r=O_({},t.props),i=t.key,o=t.ref,l=t._owner;if(e!=null){if(e.ref!==void 0&&(o=e.ref,l=eg.current),e.key!==void 0&&(i=""+e.key),t.type&&t.type.defaultProps)var s=t.type.defaultProps;for(a in e)M_.call(e,a)&&!L_.hasOwnProperty(a)&&(r[a]=e[a]===void 0&&s!==void 0?s[a]:e[a])}var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){s=Array(a);for(var u=0;u<a;u++)s[u]=arguments[u+2];r.children=s}return{$$typeof:Pu,type:t.type,key:i,ref:o,props:r,_owner:l}};Pe.createContext=function(t){return t={$$typeof:$b,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},t.Provider={$$typeof:bb,_context:t},t.Consumer=t};Pe.createElement=D_;Pe.createFactory=function(t){var e=D_.bind(null,t);return e.type=t,e};Pe.createRef=function(){return{current:null}};Pe.forwardRef=function(t){return{$$typeof:Tb,render:t}};Pe.isValidElement=tg;Pe.lazy=function(t){return{$$typeof:Ob,_payload:{_status:-1,_result:t},_init:Lb}};Pe.memo=function(t,e){return{$$typeof:Rb,type:t,compare:e===void 0?null:e}};Pe.startTransition=function(t){var e=Oc.transition;Oc.transition={};try{t()}finally{Oc.transition=e}};Pe.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")};Pe.useCallback=function(t,e){return xn.current.useCallback(t,e)};Pe.useContext=function(t){return xn.current.useContext(t)};Pe.useDebugValue=function(){};Pe.useDeferredValue=function(t){return xn.current.useDeferredValue(t)};Pe.useEffect=function(t,e){return xn.current.useEffect(t,e)};Pe.useId=function(){return xn.current.useId()};Pe.useImperativeHandle=function(t,e,n){return xn.current.useImperativeHandle(t,e,n)};Pe.useInsertionEffect=function(t,e){return xn.current.useInsertionEffect(t,e)};Pe.useLayoutEffect=function(t,e){return xn.current.useLayoutEffect(t,e)};Pe.useMemo=function(t,e){return xn.current.useMemo(t,e)};Pe.useReducer=function(t,e,n){return xn.current.useReducer(t,e,n)};Pe.useRef=function(t){return xn.current.useRef(t)};Pe.useState=function(t){return xn.current.useState(t)};Pe.useSyncExternalStore=function(t,e,n){return xn.current.useSyncExternalStore(t,e,n)};Pe.useTransition=function(){return xn.current.useTransition()};Pe.version="18.2.0";N_.exports=Pe;var p=N_.exports;const re=Ou(p),I_=T_({__proto__:null,default:re},[p]);var qh={},j_={exports:{}},Kn={},z_={exports:{}},F_={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* scheduler.production.min.js
|
|
12
12
|
*
|
|
@@ -22,14 +22,14 @@ var xb=Object.defineProperty;var _b=(t,e,n)=>e in t?xb(t,e,{enumerable:!0,config
|
|
|
22
22
|
*
|
|
23
23
|
* This source code is licensed under the MIT license found in the
|
|
24
24
|
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/var B_=p,Wn=Ib;function U(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var U_=new Set,Fa={};function ll(t,e){
|
|
25
|
+
*/var B_=p,Wn=Ib;function U(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var U_=new Set,Fa={};function ll(t,e){os(t,e),os(t+"Capture",e)}function os(t,e){for(Fa[t]=e,t=0;t<e.length;t++)U_.add(e[t])}var fi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ep=Object.prototype.hasOwnProperty,jb=/^[: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]*$/,my={},gy={};function zb(t){return ep.call(gy,t)?!0:ep.call(my,t)?!1:jb.test(t)?gy[t]=!0:(my[t]=!0,!1)}function Fb(t,e,n,r){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function Bb(t,e,n,r){if(e===null||typeof e>"u"||Fb(t,e,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function _n(t,e,n,r,i,o,l){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=o,this.removeEmptyString=l}var Gt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){Gt[t]=new _n(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];Gt[e]=new _n(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){Gt[t]=new _n(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){Gt[t]=new _n(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){Gt[t]=new _n(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){Gt[t]=new _n(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){Gt[t]=new _n(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){Gt[t]=new _n(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){Gt[t]=new _n(t,5,!1,t.toLowerCase(),null,!1,!1)});var ng=/[\-:]([a-z])/g;function rg(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(ng,rg);Gt[e]=new _n(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(ng,rg);Gt[e]=new _n(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(ng,rg);Gt[e]=new _n(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){Gt[t]=new _n(t,1,!1,t.toLowerCase(),null,!1,!1)});Gt.xlinkHref=new _n("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){Gt[t]=new _n(t,1,!1,t.toLowerCase(),null,!0,!0)});function ig(t,e,n,r){var i=Gt.hasOwnProperty(e)?Gt[e]:null;(i!==null?i.type!==0:r||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(Bb(e,n,i,r)&&(n=null),r||i===null?zb(e)&&(n===null?t.removeAttribute(e):t.setAttribute(e,""+n)):i.mustUseProperty?t[i.propertyName]=n===null?i.type===3?!1:"":n:(e=i.attributeName,r=i.attributeNamespace,n===null?t.removeAttribute(e):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?t.setAttributeNS(r,e,n):t.setAttribute(e,n))))}var _i=B_.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Qu=Symbol.for("react.element"),Rl=Symbol.for("react.portal"),Ol=Symbol.for("react.fragment"),og=Symbol.for("react.strict_mode"),tp=Symbol.for("react.profiler"),W_=Symbol.for("react.provider"),V_=Symbol.for("react.context"),lg=Symbol.for("react.forward_ref"),np=Symbol.for("react.suspense"),rp=Symbol.for("react.suspense_list"),sg=Symbol.for("react.memo"),Ii=Symbol.for("react.lazy"),H_=Symbol.for("react.offscreen"),vy=Symbol.iterator;function Hs(t){return t===null||typeof t!="object"?null:(t=vy&&t[vy]||t["@@iterator"],typeof t=="function"?t:null)}var mt=Object.assign,lh;function ca(t){if(lh===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);lh=e&&e[1]||""}return`
|
|
26
26
|
`+lh+t}var sh=!1;function ah(t,e){if(!t||sh)return"";sh=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(e)if(e=function(){throw Error()},Object.defineProperty(e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(e,[])}catch(u){var r=u}Reflect.construct(t,[],e)}else{try{e.call()}catch(u){r=u}t.call(e.prototype)}else{try{throw Error()}catch(u){r=u}t()}}catch(u){if(u&&r&&typeof u.stack=="string"){for(var i=u.stack.split(`
|
|
27
27
|
`),o=r.stack.split(`
|
|
28
28
|
`),l=i.length-1,s=o.length-1;1<=l&&0<=s&&i[l]!==o[s];)s--;for(;1<=l&&0<=s;l--,s--)if(i[l]!==o[s]){if(l!==1||s!==1)do if(l--,s--,0>s||i[l]!==o[s]){var a=`
|
|
29
|
-
`+i[l].replace(" at new "," at ");return t.displayName&&a.includes("<anonymous>")&&(a=a.replace("<anonymous>",t.displayName)),a}while(1<=l&&0<=s);break}}}finally{sh=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?ca(t):""}function Ub(t){switch(t.tag){case 5:return ca(t.type);case 16:return ca("Lazy");case 13:return ca("Suspense");case 19:return ca("SuspenseList");case 0:case 2:case 15:return t=ah(t.type,!1),t;case 11:return t=ah(t.type.render,!1),t;case 1:return t=ah(t.type,!0),t;default:return""}}function ip(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case Rl:return"Fragment";case Nl:return"Portal";case tp:return"Profiler";case og:return"StrictMode";case np:return"Suspense";case rp:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case V_:return(t.displayName||"Context")+".Consumer";case W_:return(t._context.displayName||"Context")+".Provider";case lg:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case sg:return e=t.displayName||null,e!==null?e:ip(t.type)||"Memo";case Ii:e=t._payload,t=t._init;try{return ip(t(e))}catch{}}return null}function Wb(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ip(e);case 8:return e===og?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function oo(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function K_(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function Vb(t){var e=K_(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(l){r=""+l,o.call(this,l)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(l){r=""+l},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function qu(t){t._valueTracker||(t._valueTracker=Vb(t))}function Z_(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=K_(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function Jc(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function op(t,e){var n=e.checked;return mt({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function yy(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=oo(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function G_(t,e){e=e.checked,e!=null&&ig(t,"checked",e,!1)}function lp(t,e){G_(t,e);var n=oo(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?sp(t,e.type,n):e.hasOwnProperty("defaultValue")&&sp(t,e.type,oo(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function xy(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function sp(t,e,n){(e!=="number"||Jc(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var da=Array.isArray;function Kl(t,e,n,r){if(t=t.options,e){e={};for(var i=0;i<n.length;i++)e["$"+n[i]]=!0;for(n=0;n<t.length;n++)i=e.hasOwnProperty("$"+t[n].value),t[n].selected!==i&&(t[n].selected=i),i&&r&&(t[n].defaultSelected=!0)}else{for(n=""+oo(n),e=null,i=0;i<t.length;i++){if(t[i].value===n){t[i].selected=!0,r&&(t[i].defaultSelected=!0);return}e!==null||t[i].disabled||(e=t[i])}e!==null&&(e.selected=!0)}}function ap(t,e){if(e.dangerouslySetInnerHTML!=null)throw Error(U(91));return mt({},e,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function _y(t,e){var n=e.value;if(n==null){if(n=e.children,e=e.defaultValue,n!=null){if(e!=null)throw Error(U(92));if(da(n)){if(1<n.length)throw Error(U(93));n=n[0]}e=n}e==null&&(e=""),n=e}t._wrapperState={initialValue:oo(n)}}function Y_(t,e){var n=oo(e.value),r=oo(e.defaultValue);n!=null&&(n=""+n,n!==t.value&&(t.value=n),e.defaultValue==null&&t.defaultValue!==n&&(t.defaultValue=n)),r!=null&&(t.defaultValue=""+r)}function wy(t){var e=t.textContent;e===t._wrapperState.initialValue&&e!==""&&e!==null&&(t.value=e)}function X_(t){switch(t){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function up(t,e){return t==null||t==="http://www.w3.org/1999/xhtml"?X_(e):t==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var ec,J_=function(t){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(e,n,r,i){MSApp.execUnsafeLocalFunction(function(){return t(e,n,r,i)})}:t}(function(t,e){if(t.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in t)t.innerHTML=e;else{for(ec=ec||document.createElement("div"),ec.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=ec.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function Ba(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var ya={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Hb=["Webkit","ms","Moz","O"];Object.keys(ya).forEach(function(t){Hb.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),ya[e]=ya[t]})});function Q_(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||ya.hasOwnProperty(t)&&ya[t]?(""+e).trim():e+"px"}function q_(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=Q_(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,i):t[n]=i}}var Kb=mt({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function cp(t,e){if(e){if(Kb[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(U(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(U(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(U(61))}if(e.style!=null&&typeof e.style!="object")throw Error(U(62))}}function dp(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){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 fp=null;function ag(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var hp=null,Zl=null,Gl=null;function Sy(t){if(t=Lu(t)){if(typeof hp!="function")throw Error(U(280));var e=t.stateNode;e&&(e=cf(e),hp(t.stateNode,t.type,e))}}function e1(t){Zl?Gl?Gl.push(t):Gl=[t]:Zl=t}function t1(){if(Zl){var t=Zl,e=Gl;if(Gl=Zl=null,Sy(t),e)for(t=0;t<e.length;t++)Sy(e[t])}}function n1(t,e){return t(e)}function r1(){}var uh=!1;function i1(t,e,n){if(uh)return t(e,n);uh=!0;try{return n1(t,e,n)}finally{uh=!1,(Zl!==null||Gl!==null)&&(r1(),t1())}}function Ua(t,e){var n=t.stateNode;if(n===null)return null;var r=cf(n);if(r===null)return null;n=r[e];e:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(t=t.type,r=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!r;break e;default:t=!1}if(t)return null;if(n&&typeof n!="function")throw Error(U(231,e,typeof n));return n}var pp=!1;if(fi)try{var Ks={};Object.defineProperty(Ks,"passive",{get:function(){pp=!0}}),window.addEventListener("test",Ks,Ks),window.removeEventListener("test",Ks,Ks)}catch{pp=!1}function Zb(t,e,n,r,i,o,l,s,a){var u=Array.prototype.slice.call(arguments,3);try{e.apply(n,u)}catch(c){this.onError(c)}}var xa=!1,Qc=null,qc=!1,mp=null,Gb={onError:function(t){xa=!0,Qc=t}};function Yb(t,e,n,r,i,o,l,s,a){xa=!1,Qc=null,Zb.apply(Gb,arguments)}function Xb(t,e,n,r,i,o,l,s,a){if(Yb.apply(this,arguments),xa){if(xa){var u=Qc;xa=!1,Qc=null}else throw Error(U(198));qc||(qc=!0,mp=u)}}function sl(t){var e=t,n=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,e.flags&4098&&(n=e.return),t=e.return;while(t)}return e.tag===3?n:null}function o1(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function Ey(t){if(sl(t)!==t)throw Error(U(188))}function Jb(t){var e=t.alternate;if(!e){if(e=sl(t),e===null)throw Error(U(188));return e!==t?null:t}for(var n=t,r=e;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return Ey(i),t;if(o===r)return Ey(i),e;o=o.sibling}throw Error(U(188))}if(n.return!==r.return)n=i,r=o;else{for(var l=!1,s=i.child;s;){if(s===n){l=!0,n=i,r=o;break}if(s===r){l=!0,r=i,n=o;break}s=s.sibling}if(!l){for(s=o.child;s;){if(s===n){l=!0,n=o,r=i;break}if(s===r){l=!0,r=o,n=i;break}s=s.sibling}if(!l)throw Error(U(189))}}if(n.alternate!==r)throw Error(U(190))}if(n.tag!==3)throw Error(U(188));return n.stateNode.current===n?t:e}function l1(t){return t=Jb(t),t!==null?s1(t):null}function s1(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var e=s1(t);if(e!==null)return e;t=t.sibling}return null}var a1=Wn.unstable_scheduleCallback,Cy=Wn.unstable_cancelCallback,Qb=Wn.unstable_shouldYield,qb=Wn.unstable_requestPaint,Ct=Wn.unstable_now,e$=Wn.unstable_getCurrentPriorityLevel,ug=Wn.unstable_ImmediatePriority,u1=Wn.unstable_UserBlockingPriority,ed=Wn.unstable_NormalPriority,t$=Wn.unstable_LowPriority,c1=Wn.unstable_IdlePriority,lf=null,Fr=null;function n$(t){if(Fr&&typeof Fr.onCommitFiberRoot=="function")try{Fr.onCommitFiberRoot(lf,t,void 0,(t.current.flags&128)===128)}catch{}}var Sr=Math.clz32?Math.clz32:o$,r$=Math.log,i$=Math.LN2;function o$(t){return t>>>=0,t===0?32:31-(r$(t)/i$|0)|0}var tc=64,nc=4194304;function fa(t){switch(t&-t){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:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function td(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,i=t.suspendedLanes,o=t.pingedLanes,l=n&268435455;if(l!==0){var s=l&~i;s!==0?r=fa(s):(o&=l,o!==0&&(r=fa(o)))}else l=n&~i,l!==0?r=fa(l):o!==0&&(r=fa(o));if(r===0)return 0;if(e!==0&&e!==r&&!(e&i)&&(i=r&-r,o=e&-e,i>=o||i===16&&(o&4194240)!==0))return e;if(r&4&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0<e;)n=31-Sr(e),i=1<<n,r|=t[n],e&=~i;return r}function l$(t,e){switch(t){case 1:case 2:case 4:return e+250;case 8:case 16:case 32:case 64: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 e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function s$(t,e){for(var n=t.suspendedLanes,r=t.pingedLanes,i=t.expirationTimes,o=t.pendingLanes;0<o;){var l=31-Sr(o),s=1<<l,a=i[l];a===-1?(!(s&n)||s&r)&&(i[l]=l$(s,e)):a<=e&&(t.expiredLanes|=s),o&=~s}}function gp(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function d1(){var t=tc;return tc<<=1,!(tc&4194240)&&(tc=64),t}function ch(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function Au(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-Sr(e),t[e]=n}function a$(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var r=t.eventTimes;for(t=t.expirationTimes;0<n;){var i=31-Sr(n),o=1<<i;e[i]=0,r[i]=-1,t[i]=-1,n&=~o}}function cg(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var r=31-Sr(n),i=1<<r;i&e|t[r]&e&&(t[r]|=e),n&=~i}}var Ue=0;function f1(t){return t&=-t,1<t?4<t?t&268435455?16:536870912:4:1}var h1,dg,p1,m1,g1,vp=!1,rc=[],Gi=null,Yi=null,Xi=null,Wa=new Map,Va=new Map,Fi=[],u$="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 submit".split(" ");function ky(t,e){switch(t){case"focusin":case"focusout":Gi=null;break;case"dragenter":case"dragleave":Yi=null;break;case"mouseover":case"mouseout":Xi=null;break;case"pointerover":case"pointerout":Wa.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":Va.delete(e.pointerId)}}function Zs(t,e,n,r,i,o){return t===null||t.nativeEvent!==o?(t={blockedOn:e,domEventName:n,eventSystemFlags:r,nativeEvent:o,targetContainers:[i]},e!==null&&(e=Lu(e),e!==null&&dg(e)),t):(t.eventSystemFlags|=r,e=t.targetContainers,i!==null&&e.indexOf(i)===-1&&e.push(i),t)}function c$(t,e,n,r,i){switch(e){case"focusin":return Gi=Zs(Gi,t,e,n,r,i),!0;case"dragenter":return Yi=Zs(Yi,t,e,n,r,i),!0;case"mouseover":return Xi=Zs(Xi,t,e,n,r,i),!0;case"pointerover":var o=i.pointerId;return Wa.set(o,Zs(Wa.get(o)||null,t,e,n,r,i)),!0;case"gotpointercapture":return o=i.pointerId,Va.set(o,Zs(Va.get(o)||null,t,e,n,r,i)),!0}return!1}function v1(t){var e=Po(t.target);if(e!==null){var n=sl(e);if(n!==null){if(e=n.tag,e===13){if(e=o1(n),e!==null){t.blockedOn=e,g1(t.priority,function(){p1(n)});return}}else if(e===3&&n.stateNode.current.memoizedState.isDehydrated){t.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Pc(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var n=yp(t.domEventName,t.eventSystemFlags,e[0],t.nativeEvent);if(n===null){n=t.nativeEvent;var r=new n.constructor(n.type,n);fp=r,n.target.dispatchEvent(r),fp=null}else return e=Lu(n),e!==null&&dg(e),t.blockedOn=n,!1;e.shift()}return!0}function by(t,e,n){Pc(t)&&n.delete(e)}function d$(){vp=!1,Gi!==null&&Pc(Gi)&&(Gi=null),Yi!==null&&Pc(Yi)&&(Yi=null),Xi!==null&&Pc(Xi)&&(Xi=null),Wa.forEach(by),Va.forEach(by)}function Gs(t,e){t.blockedOn===e&&(t.blockedOn=null,vp||(vp=!0,Wn.unstable_scheduleCallback(Wn.unstable_NormalPriority,d$)))}function Ha(t){function e(i){return Gs(i,t)}if(0<rc.length){Gs(rc[0],t);for(var n=1;n<rc.length;n++){var r=rc[n];r.blockedOn===t&&(r.blockedOn=null)}}for(Gi!==null&&Gs(Gi,t),Yi!==null&&Gs(Yi,t),Xi!==null&&Gs(Xi,t),Wa.forEach(e),Va.forEach(e),n=0;n<Fi.length;n++)r=Fi[n],r.blockedOn===t&&(r.blockedOn=null);for(;0<Fi.length&&(n=Fi[0],n.blockedOn===null);)v1(n),n.blockedOn===null&&Fi.shift()}var Yl=_i.ReactCurrentBatchConfig,nd=!0;function f$(t,e,n,r){var i=Ue,o=Yl.transition;Yl.transition=null;try{Ue=1,fg(t,e,n,r)}finally{Ue=i,Yl.transition=o}}function h$(t,e,n,r){var i=Ue,o=Yl.transition;Yl.transition=null;try{Ue=4,fg(t,e,n,r)}finally{Ue=i,Yl.transition=o}}function fg(t,e,n,r){if(nd){var i=yp(t,e,n,r);if(i===null)_h(t,e,r,rd,n),ky(t,r);else if(c$(i,t,e,n,r))r.stopPropagation();else if(ky(t,r),e&4&&-1<u$.indexOf(t)){for(;i!==null;){var o=Lu(i);if(o!==null&&h1(o),o=yp(t,e,n,r),o===null&&_h(t,e,r,rd,n),o===i)break;i=o}i!==null&&r.stopPropagation()}else _h(t,e,r,null,n)}}var rd=null;function yp(t,e,n,r){if(rd=null,t=ag(r),t=Po(t),t!==null)if(e=sl(t),e===null)t=null;else if(n=e.tag,n===13){if(t=o1(e),t!==null)return t;t=null}else if(n===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null);return rd=t,null}function y1(t){switch(t){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(e$()){case ug:return 1;case u1:return 4;case ed:case t$:return 16;case c1:return 536870912;default:return 16}default:return 16}}var Vi=null,hg=null,Ac=null;function x1(){if(Ac)return Ac;var t,e=hg,n=e.length,r,i="value"in Vi?Vi.value:Vi.textContent,o=i.length;for(t=0;t<n&&e[t]===i[t];t++);var l=n-t;for(r=1;r<=l&&e[n-r]===i[o-r];r++);return Ac=i.slice(t,1<r?1-r:void 0)}function Mc(t){var e=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&e===13&&(t=13)):t=e,t===10&&(t=13),32<=t||t===13?t:0}function ic(){return!0}function $y(){return!1}function Zn(t){function e(n,r,i,o,l){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=o,this.target=l,this.currentTarget=null;for(var s in t)t.hasOwnProperty(s)&&(n=t[s],this[s]=n?n(o):o[s]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?ic:$y,this.isPropagationStopped=$y,this}return mt(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=ic)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=ic)},persist:function(){},isPersistent:ic}),e}var Ss={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},pg=Zn(Ss),Mu=mt({},Ss,{view:0,detail:0}),p$=Zn(Mu),dh,fh,Ys,sf=mt({},Mu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:mg,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Ys&&(Ys&&t.type==="mousemove"?(dh=t.screenX-Ys.screenX,fh=t.screenY-Ys.screenY):fh=dh=0,Ys=t),dh)},movementY:function(t){return"movementY"in t?t.movementY:fh}}),Ty=Zn(sf),m$=mt({},sf,{dataTransfer:0}),g$=Zn(m$),v$=mt({},Mu,{relatedTarget:0}),hh=Zn(v$),y$=mt({},Ss,{animationName:0,elapsedTime:0,pseudoElement:0}),x$=Zn(y$),_$=mt({},Ss,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),w$=Zn(_$),S$=mt({},Ss,{data:0}),Ny=Zn(S$),E$={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},C$={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"},k$={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function b$(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=k$[t])?!!e[t]:!1}function mg(){return b$}var $$=mt({},Mu,{key:function(t){if(t.key){var e=E$[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=Mc(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?C$[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:mg,charCode:function(t){return t.type==="keypress"?Mc(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Mc(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),T$=Zn($$),N$=mt({},sf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ry=Zn(N$),R$=mt({},Mu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:mg}),O$=Zn(R$),P$=mt({},Ss,{propertyName:0,elapsedTime:0,pseudoElement:0}),A$=Zn(P$),M$=mt({},sf,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),L$=Zn(M$),D$=[9,13,27,32],gg=fi&&"CompositionEvent"in window,_a=null;fi&&"documentMode"in document&&(_a=document.documentMode);var I$=fi&&"TextEvent"in window&&!_a,_1=fi&&(!gg||_a&&8<_a&&11>=_a),Oy=" ",Py=!1;function w1(t,e){switch(t){case"keyup":return D$.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function S1(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Ol=!1;function j$(t,e){switch(t){case"compositionend":return S1(e);case"keypress":return e.which!==32?null:(Py=!0,Oy);case"textInput":return t=e.data,t===Oy&&Py?null:t;default:return null}}function z$(t,e){if(Ol)return t==="compositionend"||!gg&&w1(t,e)?(t=x1(),Ac=hg=Vi=null,Ol=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return _1&&e.locale!=="ko"?null:e.data;default:return null}}var F$={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 Ay(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!F$[t.type]:e==="textarea"}function E1(t,e,n,r){e1(r),e=id(e,"onChange"),0<e.length&&(n=new pg("onChange","change",null,n,r),t.push({event:n,listeners:e}))}var wa=null,Ka=null;function B$(t){M1(t,0)}function af(t){var e=Ml(t);if(Z_(e))return t}function U$(t,e){if(t==="change")return e}var C1=!1;if(fi){var ph;if(fi){var mh="oninput"in document;if(!mh){var My=document.createElement("div");My.setAttribute("oninput","return;"),mh=typeof My.oninput=="function"}ph=mh}else ph=!1;C1=ph&&(!document.documentMode||9<document.documentMode)}function Ly(){wa&&(wa.detachEvent("onpropertychange",k1),Ka=wa=null)}function k1(t){if(t.propertyName==="value"&&af(Ka)){var e=[];E1(e,Ka,t,ag(t)),i1(B$,e)}}function W$(t,e,n){t==="focusin"?(Ly(),wa=e,Ka=n,wa.attachEvent("onpropertychange",k1)):t==="focusout"&&Ly()}function V$(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return af(Ka)}function H$(t,e){if(t==="click")return af(e)}function K$(t,e){if(t==="input"||t==="change")return af(e)}function Z$(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var br=typeof Object.is=="function"?Object.is:Z$;function Za(t,e){if(br(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!ep.call(e,i)||!br(t[i],e[i]))return!1}return!0}function Dy(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Iy(t,e){var n=Dy(t);t=0;for(var r;n;){if(n.nodeType===3){if(r=t+n.textContent.length,t<=e&&r>=e)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Dy(n)}}function b1(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?b1(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function $1(){for(var t=window,e=Jc();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=Jc(t.document)}return e}function vg(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function G$(t){var e=$1(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&b1(n.ownerDocument.documentElement,n)){if(r!==null&&vg(n)){if(e=r.start,t=r.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!t.extend&&o>r&&(i=r,r=o,o=i),i=Iy(n,o);var l=Iy(n,r);i&&l&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==l.node||t.focusOffset!==l.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),o>r?(t.addRange(e),t.extend(l.node,l.offset)):(e.setEnd(l.node,l.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<e.length;n++)t=e[n],t.element.scrollLeft=t.left,t.element.scrollTop=t.top}}var Y$=fi&&"documentMode"in document&&11>=document.documentMode,Pl=null,xp=null,Sa=null,_p=!1;function jy(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;_p||Pl==null||Pl!==Jc(r)||(r=Pl,"selectionStart"in r&&vg(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Sa&&Za(Sa,r)||(Sa=r,r=id(xp,"onSelect"),0<r.length&&(e=new pg("onSelect","select",null,e,n),t.push({event:e,listeners:r}),e.target=Pl)))}function oc(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var Al={animationend:oc("Animation","AnimationEnd"),animationiteration:oc("Animation","AnimationIteration"),animationstart:oc("Animation","AnimationStart"),transitionend:oc("Transition","TransitionEnd")},gh={},T1={};fi&&(T1=document.createElement("div").style,"AnimationEvent"in window||(delete Al.animationend.animation,delete Al.animationiteration.animation,delete Al.animationstart.animation),"TransitionEvent"in window||delete Al.transitionend.transition);function uf(t){if(gh[t])return gh[t];if(!Al[t])return t;var e=Al[t],n;for(n in e)if(e.hasOwnProperty(n)&&n in T1)return gh[t]=e[n];return t}var N1=uf("animationend"),R1=uf("animationiteration"),O1=uf("animationstart"),P1=uf("transitionend"),A1=new Map,zy="abort auxClick 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(" ");function xo(t,e){A1.set(t,e),ll(e,[t])}for(var vh=0;vh<zy.length;vh++){var yh=zy[vh],X$=yh.toLowerCase(),J$=yh[0].toUpperCase()+yh.slice(1);xo(X$,"on"+J$)}xo(N1,"onAnimationEnd");xo(R1,"onAnimationIteration");xo(O1,"onAnimationStart");xo("dblclick","onDoubleClick");xo("focusin","onFocus");xo("focusout","onBlur");xo(P1,"onTransitionEnd");is("onMouseEnter",["mouseout","mouseover"]);is("onMouseLeave",["mouseout","mouseover"]);is("onPointerEnter",["pointerout","pointerover"]);is("onPointerLeave",["pointerout","pointerover"]);ll("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));ll("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));ll("onBeforeInput",["compositionend","keypress","textInput","paste"]);ll("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));ll("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));ll("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ha="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(" "),Q$=new Set("cancel close invalid load scroll toggle".split(" ").concat(ha));function Fy(t,e,n){var r=t.type||"unknown-event";t.currentTarget=n,Xb(r,e,void 0,t),t.currentTarget=null}function M1(t,e){e=(e&4)!==0;for(var n=0;n<t.length;n++){var r=t[n],i=r.event;r=r.listeners;e:{var o=void 0;if(e)for(var l=r.length-1;0<=l;l--){var s=r[l],a=s.instance,u=s.currentTarget;if(s=s.listener,a!==o&&i.isPropagationStopped())break e;Fy(i,s,u),o=a}else for(l=0;l<r.length;l++){if(s=r[l],a=s.instance,u=s.currentTarget,s=s.listener,a!==o&&i.isPropagationStopped())break e;Fy(i,s,u),o=a}}}if(qc)throw t=mp,qc=!1,mp=null,t}function et(t,e){var n=e[kp];n===void 0&&(n=e[kp]=new Set);var r=t+"__bubble";n.has(r)||(L1(e,t,2,!1),n.add(r))}function xh(t,e,n){var r=0;e&&(r|=4),L1(n,t,r,e)}var lc="_reactListening"+Math.random().toString(36).slice(2);function Ga(t){if(!t[lc]){t[lc]=!0,U_.forEach(function(n){n!=="selectionchange"&&(Q$.has(n)||xh(n,!1,t),xh(n,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[lc]||(e[lc]=!0,xh("selectionchange",!1,e))}}function L1(t,e,n,r){switch(y1(e)){case 1:var i=f$;break;case 4:i=h$;break;default:i=fg}n=i.bind(null,e,n,t),i=void 0,!pp||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(i=!0),r?i!==void 0?t.addEventListener(e,n,{capture:!0,passive:i}):t.addEventListener(e,n,!0):i!==void 0?t.addEventListener(e,n,{passive:i}):t.addEventListener(e,n,!1)}function _h(t,e,n,r,i){var o=r;if(!(e&1)&&!(e&2)&&r!==null)e:for(;;){if(r===null)return;var l=r.tag;if(l===3||l===4){var s=r.stateNode.containerInfo;if(s===i||s.nodeType===8&&s.parentNode===i)break;if(l===4)for(l=r.return;l!==null;){var a=l.tag;if((a===3||a===4)&&(a=l.stateNode.containerInfo,a===i||a.nodeType===8&&a.parentNode===i))return;l=l.return}for(;s!==null;){if(l=Po(s),l===null)return;if(a=l.tag,a===5||a===6){r=o=l;continue e}s=s.parentNode}}r=r.return}i1(function(){var u=o,c=ag(n),d=[];e:{var f=A1.get(t);if(f!==void 0){var h=pg,g=t;switch(t){case"keypress":if(Mc(n)===0)break e;case"keydown":case"keyup":h=T$;break;case"focusin":g="focus",h=hh;break;case"focusout":g="blur",h=hh;break;case"beforeblur":case"afterblur":h=hh;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":h=Ty;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=g$;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=O$;break;case N1:case R1:case O1:h=x$;break;case P1:h=A$;break;case"scroll":h=p$;break;case"wheel":h=L$;break;case"copy":case"cut":case"paste":h=w$;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=Ry}var m=(e&4)!==0,w=!m&&t==="scroll",v=m?f!==null?f+"Capture":null:f;m=[];for(var y=u,_;y!==null;){_=y;var S=_.stateNode;if(_.tag===5&&S!==null&&(_=S,v!==null&&(S=Ua(y,v),S!=null&&m.push(Ya(y,S,_)))),w)break;y=y.return}0<m.length&&(f=new h(f,g,null,n,c),d.push({event:f,listeners:m}))}}if(!(e&7)){e:{if(f=t==="mouseover"||t==="pointerover",h=t==="mouseout"||t==="pointerout",f&&n!==fp&&(g=n.relatedTarget||n.fromElement)&&(Po(g)||g[hi]))break e;if((h||f)&&(f=c.window===c?c:(f=c.ownerDocument)?f.defaultView||f.parentWindow:window,h?(g=n.relatedTarget||n.toElement,h=u,g=g?Po(g):null,g!==null&&(w=sl(g),g!==w||g.tag!==5&&g.tag!==6)&&(g=null)):(h=null,g=u),h!==g)){if(m=Ty,S="onMouseLeave",v="onMouseEnter",y="mouse",(t==="pointerout"||t==="pointerover")&&(m=Ry,S="onPointerLeave",v="onPointerEnter",y="pointer"),w=h==null?f:Ml(h),_=g==null?f:Ml(g),f=new m(S,y+"leave",h,n,c),f.target=w,f.relatedTarget=_,S=null,Po(c)===u&&(m=new m(v,y+"enter",g,n,c),m.target=_,m.relatedTarget=w,S=m),w=S,h&&g)t:{for(m=h,v=g,y=0,_=m;_;_=vl(_))y++;for(_=0,S=v;S;S=vl(S))_++;for(;0<y-_;)m=vl(m),y--;for(;0<_-y;)v=vl(v),_--;for(;y--;){if(m===v||v!==null&&m===v.alternate)break t;m=vl(m),v=vl(v)}m=null}else m=null;h!==null&&By(d,f,h,m,!1),g!==null&&w!==null&&By(d,w,g,m,!0)}}e:{if(f=u?Ml(u):window,h=f.nodeName&&f.nodeName.toLowerCase(),h==="select"||h==="input"&&f.type==="file")var E=U$;else if(Ay(f))if(C1)E=K$;else{E=V$;var $=W$}else(h=f.nodeName)&&h.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(E=H$);if(E&&(E=E(t,u))){E1(d,E,n,c);break e}$&&$(t,f,u),t==="focusout"&&($=f._wrapperState)&&$.controlled&&f.type==="number"&&sp(f,"number",f.value)}switch($=u?Ml(u):window,t){case"focusin":(Ay($)||$.contentEditable==="true")&&(Pl=$,xp=u,Sa=null);break;case"focusout":Sa=xp=Pl=null;break;case"mousedown":_p=!0;break;case"contextmenu":case"mouseup":case"dragend":_p=!1,jy(d,n,c);break;case"selectionchange":if(Y$)break;case"keydown":case"keyup":jy(d,n,c)}var C;if(gg)e:{switch(t){case"compositionstart":var N="onCompositionStart";break e;case"compositionend":N="onCompositionEnd";break e;case"compositionupdate":N="onCompositionUpdate";break e}N=void 0}else Ol?w1(t,n)&&(N="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(N="onCompositionStart");N&&(_1&&n.locale!=="ko"&&(Ol||N!=="onCompositionStart"?N==="onCompositionEnd"&&Ol&&(C=x1()):(Vi=c,hg="value"in Vi?Vi.value:Vi.textContent,Ol=!0)),$=id(u,N),0<$.length&&(N=new Ny(N,t,null,n,c),d.push({event:N,listeners:$}),C?N.data=C:(C=S1(n),C!==null&&(N.data=C)))),(C=I$?j$(t,n):z$(t,n))&&(u=id(u,"onBeforeInput"),0<u.length&&(c=new Ny("onBeforeInput","beforeinput",null,n,c),d.push({event:c,listeners:u}),c.data=C))}M1(d,e)})}function Ya(t,e,n){return{instance:t,listener:e,currentTarget:n}}function id(t,e){for(var n=e+"Capture",r=[];t!==null;){var i=t,o=i.stateNode;i.tag===5&&o!==null&&(i=o,o=Ua(t,n),o!=null&&r.unshift(Ya(t,o,i)),o=Ua(t,e),o!=null&&r.push(Ya(t,o,i))),t=t.return}return r}function vl(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function By(t,e,n,r,i){for(var o=e._reactName,l=[];n!==null&&n!==r;){var s=n,a=s.alternate,u=s.stateNode;if(a!==null&&a===r)break;s.tag===5&&u!==null&&(s=u,i?(a=Ua(n,o),a!=null&&l.unshift(Ya(n,a,s))):i||(a=Ua(n,o),a!=null&&l.push(Ya(n,a,s)))),n=n.return}l.length!==0&&t.push({event:e,listeners:l})}var q$=/\r\n?/g,eT=/\u0000|\uFFFD/g;function Uy(t){return(typeof t=="string"?t:""+t).replace(q$,`
|
|
30
|
-
`).replace(eT,"")}function sc(t,e,n){if(e=Uy(e),Uy(t)!==e&&n)throw Error(U(425))}function od(){}var wp=null,Sp=null;function Ep(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var Cp=typeof setTimeout=="function"?setTimeout:void 0,tT=typeof clearTimeout=="function"?clearTimeout:void 0,Wy=typeof Promise=="function"?Promise:void 0,nT=typeof queueMicrotask=="function"?queueMicrotask:typeof Wy<"u"?function(t){return Wy.resolve(null).then(t).catch(rT)}:Cp;function rT(t){setTimeout(function(){throw t})}function wh(t,e){var n=e,r=0;do{var i=n.nextSibling;if(t.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){t.removeChild(i),Ha(e);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);Ha(e)}function Ji(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break;if(e===8){if(e=t.data,e==="$"||e==="$!"||e==="$?")break;if(e==="/$")return null}}return t}function Vy(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="$"||n==="$!"||n==="$?"){if(e===0)return t;e--}else n==="/$"&&e++}t=t.previousSibling}return null}var Es=Math.random().toString(36).slice(2),Lr="__reactFiber$"+Es,Xa="__reactProps$"+Es,hi="__reactContainer$"+Es,kp="__reactEvents$"+Es,iT="__reactListeners$"+Es,oT="__reactHandles$"+Es;function Po(t){var e=t[Lr];if(e)return e;for(var n=t.parentNode;n;){if(e=n[hi]||n[Lr]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=Vy(t);t!==null;){if(n=t[Lr])return n;t=Vy(t)}return e}t=n,n=t.parentNode}return null}function Lu(t){return t=t[Lr]||t[hi],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function Ml(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(U(33))}function cf(t){return t[Xa]||null}var bp=[],Ll=-1;function _o(t){return{current:t}}function it(t){0>Ll||(t.current=bp[Ll],bp[Ll]=null,Ll--)}function Xe(t,e){Ll++,bp[Ll]=t.current,t.current=e}var lo={},rn=_o(lo),$n=_o(!1),Ho=lo;function os(t,e){var n=t.type.contextTypes;if(!n)return lo;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=e[o];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function Tn(t){return t=t.childContextTypes,t!=null}function ld(){it($n),it(rn)}function Hy(t,e,n){if(rn.current!==lo)throw Error(U(168));Xe(rn,e),Xe($n,n)}function D1(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in e))throw Error(U(108,Wb(t)||"Unknown",i));return mt({},n,r)}function sd(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||lo,Ho=rn.current,Xe(rn,t),Xe($n,$n.current),!0}function Ky(t,e,n){var r=t.stateNode;if(!r)throw Error(U(169));n?(t=D1(t,e,Ho),r.__reactInternalMemoizedMergedChildContext=t,it($n),it(rn),Xe(rn,t)):it($n),Xe($n,n)}var oi=null,df=!1,Sh=!1;function I1(t){oi===null?oi=[t]:oi.push(t)}function lT(t){df=!0,I1(t)}function wo(){if(!Sh&&oi!==null){Sh=!0;var t=0,e=Ue;try{var n=oi;for(Ue=1;t<n.length;t++){var r=n[t];do r=r(!0);while(r!==null)}oi=null,df=!1}catch(i){throw oi!==null&&(oi=oi.slice(t+1)),a1(ug,wo),i}finally{Ue=e,Sh=!1}}return null}var Dl=[],Il=0,ad=null,ud=0,Qn=[],qn=0,Ko=null,ai=1,ui="";function To(t,e){Dl[Il++]=ud,Dl[Il++]=ad,ad=t,ud=e}function j1(t,e,n){Qn[qn++]=ai,Qn[qn++]=ui,Qn[qn++]=Ko,Ko=t;var r=ai;t=ui;var i=32-Sr(r)-1;r&=~(1<<i),n+=1;var o=32-Sr(e)+i;if(30<o){var l=i-i%5;o=(r&(1<<l)-1).toString(32),r>>=l,i-=l,ai=1<<32-Sr(e)+i|n<<i|r,ui=o+t}else ai=1<<o|n<<i|r,ui=t}function yg(t){t.return!==null&&(To(t,1),j1(t,1,0))}function xg(t){for(;t===ad;)ad=Dl[--Il],Dl[Il]=null,ud=Dl[--Il],Dl[Il]=null;for(;t===Ko;)Ko=Qn[--qn],Qn[qn]=null,ui=Qn[--qn],Qn[qn]=null,ai=Qn[--qn],Qn[qn]=null}var Fn=null,zn=null,ot=!1,xr=null;function z1(t,e){var n=nr(5,null,null,0);n.elementType="DELETED",n.stateNode=e,n.return=t,e=t.deletions,e===null?(t.deletions=[n],t.flags|=16):e.push(n)}function Zy(t,e){switch(t.tag){case 5:var n=t.type;return e=e.nodeType!==1||n.toLowerCase()!==e.nodeName.toLowerCase()?null:e,e!==null?(t.stateNode=e,Fn=t,zn=Ji(e.firstChild),!0):!1;case 6:return e=t.pendingProps===""||e.nodeType!==3?null:e,e!==null?(t.stateNode=e,Fn=t,zn=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(n=Ko!==null?{id:ai,overflow:ui}:null,t.memoizedState={dehydrated:e,treeContext:n,retryLane:1073741824},n=nr(18,null,null,0),n.stateNode=e,n.return=t,t.child=n,Fn=t,zn=null,!0):!1;default:return!1}}function $p(t){return(t.mode&1)!==0&&(t.flags&128)===0}function Tp(t){if(ot){var e=zn;if(e){var n=e;if(!Zy(t,e)){if($p(t))throw Error(U(418));e=Ji(n.nextSibling);var r=Fn;e&&Zy(t,e)?z1(r,n):(t.flags=t.flags&-4097|2,ot=!1,Fn=t)}}else{if($p(t))throw Error(U(418));t.flags=t.flags&-4097|2,ot=!1,Fn=t}}}function Gy(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;Fn=t}function ac(t){if(t!==Fn)return!1;if(!ot)return Gy(t),ot=!0,!1;var e;if((e=t.tag!==3)&&!(e=t.tag!==5)&&(e=t.type,e=e!=="head"&&e!=="body"&&!Ep(t.type,t.memoizedProps)),e&&(e=zn)){if($p(t))throw F1(),Error(U(418));for(;e;)z1(t,e),e=Ji(e.nextSibling)}if(Gy(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(U(317));e:{for(t=t.nextSibling,e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="/$"){if(e===0){zn=Ji(t.nextSibling);break e}e--}else n!=="$"&&n!=="$!"&&n!=="$?"||e++}t=t.nextSibling}zn=null}}else zn=Fn?Ji(t.stateNode.nextSibling):null;return!0}function F1(){for(var t=zn;t;)t=Ji(t.nextSibling)}function ls(){zn=Fn=null,ot=!1}function _g(t){xr===null?xr=[t]:xr.push(t)}var sT=_i.ReactCurrentBatchConfig;function gr(t,e){if(t&&t.defaultProps){e=mt({},e),t=t.defaultProps;for(var n in t)e[n]===void 0&&(e[n]=t[n]);return e}return e}var cd=_o(null),dd=null,jl=null,wg=null;function Sg(){wg=jl=dd=null}function Eg(t){var e=cd.current;it(cd),t._currentValue=e}function Np(t,e,n){for(;t!==null;){var r=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),t===n)break;t=t.return}}function Xl(t,e){dd=t,wg=jl=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(bn=!0),t.firstContext=null)}function lr(t){var e=t._currentValue;if(wg!==t)if(t={context:t,memoizedValue:e,next:null},jl===null){if(dd===null)throw Error(U(308));jl=t,dd.dependencies={lanes:0,firstContext:t}}else jl=jl.next=t;return e}var Ao=null;function Cg(t){Ao===null?Ao=[t]:Ao.push(t)}function B1(t,e,n,r){var i=e.interleaved;return i===null?(n.next=n,Cg(e)):(n.next=i.next,i.next=n),e.interleaved=n,pi(t,r)}function pi(t,e){t.lanes|=e;var n=t.alternate;for(n!==null&&(n.lanes|=e),n=t,t=t.return;t!==null;)t.childLanes|=e,n=t.alternate,n!==null&&(n.childLanes|=e),n=t,t=t.return;return n.tag===3?n.stateNode:null}var ji=!1;function kg(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function U1(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function ci(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function Qi(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,Me&2){var i=r.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),r.pending=e,pi(t,n)}return i=r.interleaved,i===null?(e.next=e,Cg(r)):(e.next=i.next,i.next=e),r.interleaved=e,pi(t,n)}function Lc(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194240)!==0)){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,cg(t,n)}}function Yy(t,e){var n=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var l={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?i=o=l:o=o.next=l,n=n.next}while(n!==null);o===null?i=o=e:o=o.next=e}else i=o=e;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function fd(t,e,n,r){var i=t.updateQueue;ji=!1;var o=i.firstBaseUpdate,l=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var a=s,u=a.next;a.next=null,l===null?o=u:l.next=u,l=a;var c=t.alternate;c!==null&&(c=c.updateQueue,s=c.lastBaseUpdate,s!==l&&(s===null?c.firstBaseUpdate=u:s.next=u,c.lastBaseUpdate=a))}if(o!==null){var d=i.baseState;l=0,c=u=a=null,s=o;do{var f=s.lane,h=s.eventTime;if((r&f)===f){c!==null&&(c=c.next={eventTime:h,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var g=t,m=s;switch(f=e,h=n,m.tag){case 1:if(g=m.payload,typeof g=="function"){d=g.call(h,d,f);break e}d=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=m.payload,f=typeof g=="function"?g.call(h,d,f):g,f==null)break e;d=mt({},d,f);break e;case 2:ji=!0}}s.callback!==null&&s.lane!==0&&(t.flags|=64,f=i.effects,f===null?i.effects=[s]:f.push(s))}else h={eventTime:h,lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},c===null?(u=c=h,a=d):c=c.next=h,l|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;f=s,s=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(!0);if(c===null&&(a=d),i.baseState=a,i.firstBaseUpdate=u,i.lastBaseUpdate=c,e=i.shared.interleaved,e!==null){i=e;do l|=i.lane,i=i.next;while(i!==e)}else o===null&&(i.shared.lanes=0);Go|=l,t.lanes=l,t.memoizedState=d}}function Xy(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;e<t.length;e++){var r=t[e],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(U(191,i));i.call(r)}}}var W1=new B_.Component().refs;function Rp(t,e,n,r){e=t.memoizedState,n=n(r,e),n=n==null?e:mt({},e,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n)}var ff={isMounted:function(t){return(t=t._reactInternals)?sl(t)===t:!1},enqueueSetState:function(t,e,n){t=t._reactInternals;var r=vn(),i=eo(t),o=ci(r,i);o.payload=e,n!=null&&(o.callback=n),e=Qi(t,o,i),e!==null&&(Er(e,t,i,r),Lc(e,t,i))},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var r=vn(),i=eo(t),o=ci(r,i);o.tag=1,o.payload=e,n!=null&&(o.callback=n),e=Qi(t,o,i),e!==null&&(Er(e,t,i,r),Lc(e,t,i))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=vn(),r=eo(t),i=ci(n,r);i.tag=2,e!=null&&(i.callback=e),e=Qi(t,i,r),e!==null&&(Er(e,t,r,n),Lc(e,t,r))}};function Jy(t,e,n,r,i,o,l){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(r,o,l):e.prototype&&e.prototype.isPureReactComponent?!Za(n,r)||!Za(i,o):!0}function V1(t,e,n){var r=!1,i=lo,o=e.contextType;return typeof o=="object"&&o!==null?o=lr(o):(i=Tn(e)?Ho:rn.current,r=e.contextTypes,o=(r=r!=null)?os(t,i):lo),e=new e(n,o),t.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=ff,t.stateNode=e,e._reactInternals=t,r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=i,t.__reactInternalMemoizedMaskedChildContext=o),e}function Qy(t,e,n,r){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(n,r),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(n,r),e.state!==t&&ff.enqueueReplaceState(e,e.state,null)}function Op(t,e,n,r){var i=t.stateNode;i.props=n,i.state=t.memoizedState,i.refs=W1,kg(t);var o=e.contextType;typeof o=="object"&&o!==null?i.context=lr(o):(o=Tn(e)?Ho:rn.current,i.context=os(t,o)),i.state=t.memoizedState,o=e.getDerivedStateFromProps,typeof o=="function"&&(Rp(t,e,o,n),i.state=t.memoizedState),typeof e.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(e=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),e!==i.state&&ff.enqueueReplaceState(i,i.state,null),fd(t,n,i,r),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308)}function Xs(t,e,n){if(t=n.ref,t!==null&&typeof t!="function"&&typeof t!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(U(309));var r=n.stateNode}if(!r)throw Error(U(147,t));var i=r,o=""+t;return e!==null&&e.ref!==null&&typeof e.ref=="function"&&e.ref._stringRef===o?e.ref:(e=function(l){var s=i.refs;s===W1&&(s=i.refs={}),l===null?delete s[o]:s[o]=l},e._stringRef=o,e)}if(typeof t!="string")throw Error(U(284));if(!n._owner)throw Error(U(290,t))}return t}function uc(t,e){throw t=Object.prototype.toString.call(e),Error(U(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t))}function qy(t){var e=t._init;return e(t._payload)}function H1(t){function e(v,y){if(t){var _=v.deletions;_===null?(v.deletions=[y],v.flags|=16):_.push(y)}}function n(v,y){if(!t)return null;for(;y!==null;)e(v,y),y=y.sibling;return null}function r(v,y){for(v=new Map;y!==null;)y.key!==null?v.set(y.key,y):v.set(y.index,y),y=y.sibling;return v}function i(v,y){return v=to(v,y),v.index=0,v.sibling=null,v}function o(v,y,_){return v.index=_,t?(_=v.alternate,_!==null?(_=_.index,_<y?(v.flags|=2,y):_):(v.flags|=2,y)):(v.flags|=1048576,y)}function l(v){return t&&v.alternate===null&&(v.flags|=2),v}function s(v,y,_,S){return y===null||y.tag!==6?(y=Nh(_,v.mode,S),y.return=v,y):(y=i(y,_),y.return=v,y)}function a(v,y,_,S){var E=_.type;return E===Rl?c(v,y,_.props.children,S,_.key):y!==null&&(y.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Ii&&qy(E)===y.type)?(S=i(y,_.props),S.ref=Xs(v,y,_),S.return=v,S):(S=Bc(_.type,_.key,_.props,null,v.mode,S),S.ref=Xs(v,y,_),S.return=v,S)}function u(v,y,_,S){return y===null||y.tag!==4||y.stateNode.containerInfo!==_.containerInfo||y.stateNode.implementation!==_.implementation?(y=Rh(_,v.mode,S),y.return=v,y):(y=i(y,_.children||[]),y.return=v,y)}function c(v,y,_,S,E){return y===null||y.tag!==7?(y=jo(_,v.mode,S,E),y.return=v,y):(y=i(y,_),y.return=v,y)}function d(v,y,_){if(typeof y=="string"&&y!==""||typeof y=="number")return y=Nh(""+y,v.mode,_),y.return=v,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Qu:return _=Bc(y.type,y.key,y.props,null,v.mode,_),_.ref=Xs(v,null,y),_.return=v,_;case Nl:return y=Rh(y,v.mode,_),y.return=v,y;case Ii:var S=y._init;return d(v,S(y._payload),_)}if(da(y)||Hs(y))return y=jo(y,v.mode,_,null),y.return=v,y;uc(v,y)}return null}function f(v,y,_,S){var E=y!==null?y.key:null;if(typeof _=="string"&&_!==""||typeof _=="number")return E!==null?null:s(v,y,""+_,S);if(typeof _=="object"&&_!==null){switch(_.$$typeof){case Qu:return _.key===E?a(v,y,_,S):null;case Nl:return _.key===E?u(v,y,_,S):null;case Ii:return E=_._init,f(v,y,E(_._payload),S)}if(da(_)||Hs(_))return E!==null?null:c(v,y,_,S,null);uc(v,_)}return null}function h(v,y,_,S,E){if(typeof S=="string"&&S!==""||typeof S=="number")return v=v.get(_)||null,s(y,v,""+S,E);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case Qu:return v=v.get(S.key===null?_:S.key)||null,a(y,v,S,E);case Nl:return v=v.get(S.key===null?_:S.key)||null,u(y,v,S,E);case Ii:var $=S._init;return h(v,y,_,$(S._payload),E)}if(da(S)||Hs(S))return v=v.get(_)||null,c(y,v,S,E,null);uc(y,S)}return null}function g(v,y,_,S){for(var E=null,$=null,C=y,N=y=0,R=null;C!==null&&N<_.length;N++){C.index>N?(R=C,C=null):R=C.sibling;var b=f(v,C,_[N],S);if(b===null){C===null&&(C=R);break}t&&C&&b.alternate===null&&e(v,C),y=o(b,y,N),$===null?E=b:$.sibling=b,$=b,C=R}if(N===_.length)return n(v,C),ot&&To(v,N),E;if(C===null){for(;N<_.length;N++)C=d(v,_[N],S),C!==null&&(y=o(C,y,N),$===null?E=C:$.sibling=C,$=C);return ot&&To(v,N),E}for(C=r(v,C);N<_.length;N++)R=h(C,v,N,_[N],S),R!==null&&(t&&R.alternate!==null&&C.delete(R.key===null?N:R.key),y=o(R,y,N),$===null?E=R:$.sibling=R,$=R);return t&&C.forEach(function(L){return e(v,L)}),ot&&To(v,N),E}function m(v,y,_,S){var E=Hs(_);if(typeof E!="function")throw Error(U(150));if(_=E.call(_),_==null)throw Error(U(151));for(var $=E=null,C=y,N=y=0,R=null,b=_.next();C!==null&&!b.done;N++,b=_.next()){C.index>N?(R=C,C=null):R=C.sibling;var L=f(v,C,b.value,S);if(L===null){C===null&&(C=R);break}t&&C&&L.alternate===null&&e(v,C),y=o(L,y,N),$===null?E=L:$.sibling=L,$=L,C=R}if(b.done)return n(v,C),ot&&To(v,N),E;if(C===null){for(;!b.done;N++,b=_.next())b=d(v,b.value,S),b!==null&&(y=o(b,y,N),$===null?E=b:$.sibling=b,$=b);return ot&&To(v,N),E}for(C=r(v,C);!b.done;N++,b=_.next())b=h(C,v,N,b.value,S),b!==null&&(t&&b.alternate!==null&&C.delete(b.key===null?N:b.key),y=o(b,y,N),$===null?E=b:$.sibling=b,$=b);return t&&C.forEach(function(F){return e(v,F)}),ot&&To(v,N),E}function w(v,y,_,S){if(typeof _=="object"&&_!==null&&_.type===Rl&&_.key===null&&(_=_.props.children),typeof _=="object"&&_!==null){switch(_.$$typeof){case Qu:e:{for(var E=_.key,$=y;$!==null;){if($.key===E){if(E=_.type,E===Rl){if($.tag===7){n(v,$.sibling),y=i($,_.props.children),y.return=v,v=y;break e}}else if($.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Ii&&qy(E)===$.type){n(v,$.sibling),y=i($,_.props),y.ref=Xs(v,$,_),y.return=v,v=y;break e}n(v,$);break}else e(v,$);$=$.sibling}_.type===Rl?(y=jo(_.props.children,v.mode,S,_.key),y.return=v,v=y):(S=Bc(_.type,_.key,_.props,null,v.mode,S),S.ref=Xs(v,y,_),S.return=v,v=S)}return l(v);case Nl:e:{for($=_.key;y!==null;){if(y.key===$)if(y.tag===4&&y.stateNode.containerInfo===_.containerInfo&&y.stateNode.implementation===_.implementation){n(v,y.sibling),y=i(y,_.children||[]),y.return=v,v=y;break e}else{n(v,y);break}else e(v,y);y=y.sibling}y=Rh(_,v.mode,S),y.return=v,v=y}return l(v);case Ii:return $=_._init,w(v,y,$(_._payload),S)}if(da(_))return g(v,y,_,S);if(Hs(_))return m(v,y,_,S);uc(v,_)}return typeof _=="string"&&_!==""||typeof _=="number"?(_=""+_,y!==null&&y.tag===6?(n(v,y.sibling),y=i(y,_),y.return=v,v=y):(n(v,y),y=Nh(_,v.mode,S),y.return=v,v=y),l(v)):n(v,y)}return w}var ss=H1(!0),K1=H1(!1),Du={},Br=_o(Du),Ja=_o(Du),Qa=_o(Du);function Mo(t){if(t===Du)throw Error(U(174));return t}function bg(t,e){switch(Xe(Qa,e),Xe(Ja,t),Xe(Br,Du),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:up(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=up(e,t)}it(Br),Xe(Br,e)}function as(){it(Br),it(Ja),it(Qa)}function Z1(t){Mo(Qa.current);var e=Mo(Br.current),n=up(e,t.type);e!==n&&(Xe(Ja,t),Xe(Br,n))}function $g(t){Ja.current===t&&(it(Br),it(Ja))}var dt=_o(0);function hd(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var Eh=[];function Tg(){for(var t=0;t<Eh.length;t++)Eh[t]._workInProgressVersionPrimary=null;Eh.length=0}var Dc=_i.ReactCurrentDispatcher,Ch=_i.ReactCurrentBatchConfig,Zo=0,ht=null,Rt=null,Dt=null,pd=!1,Ea=!1,qa=0,aT=0;function Yt(){throw Error(U(321))}function Ng(t,e){if(e===null)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!br(t[n],e[n]))return!1;return!0}function Rg(t,e,n,r,i,o){if(Zo=o,ht=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,Dc.current=t===null||t.memoizedState===null?fT:hT,t=n(r,i),Ea){o=0;do{if(Ea=!1,qa=0,25<=o)throw Error(U(301));o+=1,Dt=Rt=null,e.updateQueue=null,Dc.current=pT,t=n(r,i)}while(Ea)}if(Dc.current=md,e=Rt!==null&&Rt.next!==null,Zo=0,Dt=Rt=ht=null,pd=!1,e)throw Error(U(300));return t}function Og(){var t=qa!==0;return qa=0,t}function Ar(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Dt===null?ht.memoizedState=Dt=t:Dt=Dt.next=t,Dt}function sr(){if(Rt===null){var t=ht.alternate;t=t!==null?t.memoizedState:null}else t=Rt.next;var e=Dt===null?ht.memoizedState:Dt.next;if(e!==null)Dt=e,Rt=t;else{if(t===null)throw Error(U(310));Rt=t,t={memoizedState:Rt.memoizedState,baseState:Rt.baseState,baseQueue:Rt.baseQueue,queue:Rt.queue,next:null},Dt===null?ht.memoizedState=Dt=t:Dt=Dt.next=t}return Dt}function eu(t,e){return typeof e=="function"?e(t):e}function kh(t){var e=sr(),n=e.queue;if(n===null)throw Error(U(311));n.lastRenderedReducer=t;var r=Rt,i=r.baseQueue,o=n.pending;if(o!==null){if(i!==null){var l=i.next;i.next=o.next,o.next=l}r.baseQueue=i=o,n.pending=null}if(i!==null){o=i.next,r=r.baseState;var s=l=null,a=null,u=o;do{var c=u.lane;if((Zo&c)===c)a!==null&&(a=a.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:t(r,u.action);else{var d={lane:c,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};a===null?(s=a=d,l=r):a=a.next=d,ht.lanes|=c,Go|=c}u=u.next}while(u!==null&&u!==o);a===null?l=r:a.next=s,br(r,e.memoizedState)||(bn=!0),e.memoizedState=r,e.baseState=l,e.baseQueue=a,n.lastRenderedState=r}if(t=n.interleaved,t!==null){i=t;do o=i.lane,ht.lanes|=o,Go|=o,i=i.next;while(i!==t)}else i===null&&(n.lanes=0);return[e.memoizedState,n.dispatch]}function bh(t){var e=sr(),n=e.queue;if(n===null)throw Error(U(311));n.lastRenderedReducer=t;var r=n.dispatch,i=n.pending,o=e.memoizedState;if(i!==null){n.pending=null;var l=i=i.next;do o=t(o,l.action),l=l.next;while(l!==i);br(o,e.memoizedState)||(bn=!0),e.memoizedState=o,e.baseQueue===null&&(e.baseState=o),n.lastRenderedState=o}return[o,r]}function G1(){}function Y1(t,e){var n=ht,r=sr(),i=e(),o=!br(r.memoizedState,i);if(o&&(r.memoizedState=i,bn=!0),r=r.queue,Pg(Q1.bind(null,n,r,t),[t]),r.getSnapshot!==e||o||Dt!==null&&Dt.memoizedState.tag&1){if(n.flags|=2048,tu(9,J1.bind(null,n,r,i,e),void 0,null),Bt===null)throw Error(U(349));Zo&30||X1(n,e,i)}return i}function X1(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},e=ht.updateQueue,e===null?(e={lastEffect:null,stores:null},ht.updateQueue=e,e.stores=[t]):(n=e.stores,n===null?e.stores=[t]:n.push(t))}function J1(t,e,n,r){e.value=n,e.getSnapshot=r,q1(e)&&ew(t)}function Q1(t,e,n){return n(function(){q1(e)&&ew(t)})}function q1(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!br(t,n)}catch{return!0}}function ew(t){var e=pi(t,1);e!==null&&Er(e,t,1,-1)}function e0(t){var e=Ar();return typeof t=="function"&&(t=t()),e.memoizedState=e.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:eu,lastRenderedState:t},e.queue=t,t=t.dispatch=dT.bind(null,ht,t),[e.memoizedState,t]}function tu(t,e,n,r){return t={tag:t,create:e,destroy:n,deps:r,next:null},e=ht.updateQueue,e===null?(e={lastEffect:null,stores:null},ht.updateQueue=e,e.lastEffect=t.next=t):(n=e.lastEffect,n===null?e.lastEffect=t.next=t:(r=n.next,n.next=t,t.next=r,e.lastEffect=t)),t}function tw(){return sr().memoizedState}function Ic(t,e,n,r){var i=Ar();ht.flags|=t,i.memoizedState=tu(1|e,n,void 0,r===void 0?null:r)}function hf(t,e,n,r){var i=sr();r=r===void 0?null:r;var o=void 0;if(Rt!==null){var l=Rt.memoizedState;if(o=l.destroy,r!==null&&Ng(r,l.deps)){i.memoizedState=tu(e,n,o,r);return}}ht.flags|=t,i.memoizedState=tu(1|e,n,o,r)}function t0(t,e){return Ic(8390656,8,t,e)}function Pg(t,e){return hf(2048,8,t,e)}function nw(t,e){return hf(4,2,t,e)}function rw(t,e){return hf(4,4,t,e)}function iw(t,e){if(typeof e=="function")return t=t(),e(t),function(){e(null)};if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function ow(t,e,n){return n=n!=null?n.concat([t]):null,hf(4,4,iw.bind(null,e,t),n)}function Ag(){}function lw(t,e){var n=sr();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&Ng(e,r[1])?r[0]:(n.memoizedState=[t,e],t)}function sw(t,e){var n=sr();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&Ng(e,r[1])?r[0]:(t=t(),n.memoizedState=[t,e],t)}function aw(t,e,n){return Zo&21?(br(n,e)||(n=d1(),ht.lanes|=n,Go|=n,t.baseState=!0),e):(t.baseState&&(t.baseState=!1,bn=!0),t.memoizedState=n)}function uT(t,e){var n=Ue;Ue=n!==0&&4>n?n:4,t(!0);var r=Ch.transition;Ch.transition={};try{t(!1),e()}finally{Ue=n,Ch.transition=r}}function uw(){return sr().memoizedState}function cT(t,e,n){var r=eo(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},cw(t))dw(e,n);else if(n=B1(t,e,n,r),n!==null){var i=vn();Er(n,t,r,i),fw(n,e,r)}}function dT(t,e,n){var r=eo(t),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(cw(t))dw(e,i);else{var o=t.alternate;if(t.lanes===0&&(o===null||o.lanes===0)&&(o=e.lastRenderedReducer,o!==null))try{var l=e.lastRenderedState,s=o(l,n);if(i.hasEagerState=!0,i.eagerState=s,br(s,l)){var a=e.interleaved;a===null?(i.next=i,Cg(e)):(i.next=a.next,a.next=i),e.interleaved=i;return}}catch{}finally{}n=B1(t,e,i,r),n!==null&&(i=vn(),Er(n,t,r,i),fw(n,e,r))}}function cw(t){var e=t.alternate;return t===ht||e!==null&&e===ht}function dw(t,e){Ea=pd=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function fw(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,cg(t,n)}}var md={readContext:lr,useCallback:Yt,useContext:Yt,useEffect:Yt,useImperativeHandle:Yt,useInsertionEffect:Yt,useLayoutEffect:Yt,useMemo:Yt,useReducer:Yt,useRef:Yt,useState:Yt,useDebugValue:Yt,useDeferredValue:Yt,useTransition:Yt,useMutableSource:Yt,useSyncExternalStore:Yt,useId:Yt,unstable_isNewReconciler:!1},fT={readContext:lr,useCallback:function(t,e){return Ar().memoizedState=[t,e===void 0?null:e],t},useContext:lr,useEffect:t0,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,Ic(4194308,4,iw.bind(null,e,t),n)},useLayoutEffect:function(t,e){return Ic(4194308,4,t,e)},useInsertionEffect:function(t,e){return Ic(4,2,t,e)},useMemo:function(t,e){var n=Ar();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=Ar();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=cT.bind(null,ht,t),[r.memoizedState,t]},useRef:function(t){var e=Ar();return t={current:t},e.memoizedState=t},useState:e0,useDebugValue:Ag,useDeferredValue:function(t){return Ar().memoizedState=t},useTransition:function(){var t=e0(!1),e=t[0];return t=uT.bind(null,t[1]),Ar().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=ht,i=Ar();if(ot){if(n===void 0)throw Error(U(407));n=n()}else{if(n=e(),Bt===null)throw Error(U(349));Zo&30||X1(r,e,n)}i.memoizedState=n;var o={value:n,getSnapshot:e};return i.queue=o,t0(Q1.bind(null,r,o,t),[t]),r.flags|=2048,tu(9,J1.bind(null,r,o,n,e),void 0,null),n},useId:function(){var t=Ar(),e=Bt.identifierPrefix;if(ot){var n=ui,r=ai;n=(r&~(1<<32-Sr(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=qa++,0<n&&(e+="H"+n.toString(32)),e+=":"}else n=aT++,e=":"+e+"r"+n.toString(32)+":";return t.memoizedState=e},unstable_isNewReconciler:!1},hT={readContext:lr,useCallback:lw,useContext:lr,useEffect:Pg,useImperativeHandle:ow,useInsertionEffect:nw,useLayoutEffect:rw,useMemo:sw,useReducer:kh,useRef:tw,useState:function(){return kh(eu)},useDebugValue:Ag,useDeferredValue:function(t){var e=sr();return aw(e,Rt.memoizedState,t)},useTransition:function(){var t=kh(eu)[0],e=sr().memoizedState;return[t,e]},useMutableSource:G1,useSyncExternalStore:Y1,useId:uw,unstable_isNewReconciler:!1},pT={readContext:lr,useCallback:lw,useContext:lr,useEffect:Pg,useImperativeHandle:ow,useInsertionEffect:nw,useLayoutEffect:rw,useMemo:sw,useReducer:bh,useRef:tw,useState:function(){return bh(eu)},useDebugValue:Ag,useDeferredValue:function(t){var e=sr();return Rt===null?e.memoizedState=t:aw(e,Rt.memoizedState,t)},useTransition:function(){var t=bh(eu)[0],e=sr().memoizedState;return[t,e]},useMutableSource:G1,useSyncExternalStore:Y1,useId:uw,unstable_isNewReconciler:!1};function us(t,e){try{var n="",r=e;do n+=Ub(r),r=r.return;while(r);var i=n}catch(o){i=`
|
|
29
|
+
`+i[l].replace(" at new "," at ");return t.displayName&&a.includes("<anonymous>")&&(a=a.replace("<anonymous>",t.displayName)),a}while(1<=l&&0<=s);break}}}finally{sh=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?ca(t):""}function Ub(t){switch(t.tag){case 5:return ca(t.type);case 16:return ca("Lazy");case 13:return ca("Suspense");case 19:return ca("SuspenseList");case 0:case 2:case 15:return t=ah(t.type,!1),t;case 11:return t=ah(t.type.render,!1),t;case 1:return t=ah(t.type,!0),t;default:return""}}function ip(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case Ol:return"Fragment";case Rl:return"Portal";case tp:return"Profiler";case og:return"StrictMode";case np:return"Suspense";case rp:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case V_:return(t.displayName||"Context")+".Consumer";case W_:return(t._context.displayName||"Context")+".Provider";case lg:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case sg:return e=t.displayName||null,e!==null?e:ip(t.type)||"Memo";case Ii:e=t._payload,t=t._init;try{return ip(t(e))}catch{}}return null}function Wb(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ip(e);case 8:return e===og?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function oo(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function K_(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function Vb(t){var e=K_(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(l){r=""+l,o.call(this,l)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(l){r=""+l},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function qu(t){t._valueTracker||(t._valueTracker=Vb(t))}function Z_(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=K_(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function Jc(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function op(t,e){var n=e.checked;return mt({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function yy(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=oo(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function G_(t,e){e=e.checked,e!=null&&ig(t,"checked",e,!1)}function lp(t,e){G_(t,e);var n=oo(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?sp(t,e.type,n):e.hasOwnProperty("defaultValue")&&sp(t,e.type,oo(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function xy(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function sp(t,e,n){(e!=="number"||Jc(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var da=Array.isArray;function Zl(t,e,n,r){if(t=t.options,e){e={};for(var i=0;i<n.length;i++)e["$"+n[i]]=!0;for(n=0;n<t.length;n++)i=e.hasOwnProperty("$"+t[n].value),t[n].selected!==i&&(t[n].selected=i),i&&r&&(t[n].defaultSelected=!0)}else{for(n=""+oo(n),e=null,i=0;i<t.length;i++){if(t[i].value===n){t[i].selected=!0,r&&(t[i].defaultSelected=!0);return}e!==null||t[i].disabled||(e=t[i])}e!==null&&(e.selected=!0)}}function ap(t,e){if(e.dangerouslySetInnerHTML!=null)throw Error(U(91));return mt({},e,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function _y(t,e){var n=e.value;if(n==null){if(n=e.children,e=e.defaultValue,n!=null){if(e!=null)throw Error(U(92));if(da(n)){if(1<n.length)throw Error(U(93));n=n[0]}e=n}e==null&&(e=""),n=e}t._wrapperState={initialValue:oo(n)}}function Y_(t,e){var n=oo(e.value),r=oo(e.defaultValue);n!=null&&(n=""+n,n!==t.value&&(t.value=n),e.defaultValue==null&&t.defaultValue!==n&&(t.defaultValue=n)),r!=null&&(t.defaultValue=""+r)}function wy(t){var e=t.textContent;e===t._wrapperState.initialValue&&e!==""&&e!==null&&(t.value=e)}function X_(t){switch(t){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function up(t,e){return t==null||t==="http://www.w3.org/1999/xhtml"?X_(e):t==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var ec,J_=function(t){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(e,n,r,i){MSApp.execUnsafeLocalFunction(function(){return t(e,n,r,i)})}:t}(function(t,e){if(t.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in t)t.innerHTML=e;else{for(ec=ec||document.createElement("div"),ec.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=ec.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function Ba(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var ya={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Hb=["Webkit","ms","Moz","O"];Object.keys(ya).forEach(function(t){Hb.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),ya[e]=ya[t]})});function Q_(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||ya.hasOwnProperty(t)&&ya[t]?(""+e).trim():e+"px"}function q_(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=Q_(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,i):t[n]=i}}var Kb=mt({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function cp(t,e){if(e){if(Kb[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(U(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(U(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(U(61))}if(e.style!=null&&typeof e.style!="object")throw Error(U(62))}}function dp(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){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 fp=null;function ag(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var hp=null,Gl=null,Yl=null;function Sy(t){if(t=Lu(t)){if(typeof hp!="function")throw Error(U(280));var e=t.stateNode;e&&(e=cf(e),hp(t.stateNode,t.type,e))}}function e1(t){Gl?Yl?Yl.push(t):Yl=[t]:Gl=t}function t1(){if(Gl){var t=Gl,e=Yl;if(Yl=Gl=null,Sy(t),e)for(t=0;t<e.length;t++)Sy(e[t])}}function n1(t,e){return t(e)}function r1(){}var uh=!1;function i1(t,e,n){if(uh)return t(e,n);uh=!0;try{return n1(t,e,n)}finally{uh=!1,(Gl!==null||Yl!==null)&&(r1(),t1())}}function Ua(t,e){var n=t.stateNode;if(n===null)return null;var r=cf(n);if(r===null)return null;n=r[e];e:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(t=t.type,r=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!r;break e;default:t=!1}if(t)return null;if(n&&typeof n!="function")throw Error(U(231,e,typeof n));return n}var pp=!1;if(fi)try{var Ks={};Object.defineProperty(Ks,"passive",{get:function(){pp=!0}}),window.addEventListener("test",Ks,Ks),window.removeEventListener("test",Ks,Ks)}catch{pp=!1}function Zb(t,e,n,r,i,o,l,s,a){var u=Array.prototype.slice.call(arguments,3);try{e.apply(n,u)}catch(c){this.onError(c)}}var xa=!1,Qc=null,qc=!1,mp=null,Gb={onError:function(t){xa=!0,Qc=t}};function Yb(t,e,n,r,i,o,l,s,a){xa=!1,Qc=null,Zb.apply(Gb,arguments)}function Xb(t,e,n,r,i,o,l,s,a){if(Yb.apply(this,arguments),xa){if(xa){var u=Qc;xa=!1,Qc=null}else throw Error(U(198));qc||(qc=!0,mp=u)}}function sl(t){var e=t,n=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,e.flags&4098&&(n=e.return),t=e.return;while(t)}return e.tag===3?n:null}function o1(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function Ey(t){if(sl(t)!==t)throw Error(U(188))}function Jb(t){var e=t.alternate;if(!e){if(e=sl(t),e===null)throw Error(U(188));return e!==t?null:t}for(var n=t,r=e;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return Ey(i),t;if(o===r)return Ey(i),e;o=o.sibling}throw Error(U(188))}if(n.return!==r.return)n=i,r=o;else{for(var l=!1,s=i.child;s;){if(s===n){l=!0,n=i,r=o;break}if(s===r){l=!0,r=i,n=o;break}s=s.sibling}if(!l){for(s=o.child;s;){if(s===n){l=!0,n=o,r=i;break}if(s===r){l=!0,r=o,n=i;break}s=s.sibling}if(!l)throw Error(U(189))}}if(n.alternate!==r)throw Error(U(190))}if(n.tag!==3)throw Error(U(188));return n.stateNode.current===n?t:e}function l1(t){return t=Jb(t),t!==null?s1(t):null}function s1(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var e=s1(t);if(e!==null)return e;t=t.sibling}return null}var a1=Wn.unstable_scheduleCallback,Cy=Wn.unstable_cancelCallback,Qb=Wn.unstable_shouldYield,qb=Wn.unstable_requestPaint,Ct=Wn.unstable_now,e$=Wn.unstable_getCurrentPriorityLevel,ug=Wn.unstable_ImmediatePriority,u1=Wn.unstable_UserBlockingPriority,ed=Wn.unstable_NormalPriority,t$=Wn.unstable_LowPriority,c1=Wn.unstable_IdlePriority,lf=null,Fr=null;function n$(t){if(Fr&&typeof Fr.onCommitFiberRoot=="function")try{Fr.onCommitFiberRoot(lf,t,void 0,(t.current.flags&128)===128)}catch{}}var Sr=Math.clz32?Math.clz32:o$,r$=Math.log,i$=Math.LN2;function o$(t){return t>>>=0,t===0?32:31-(r$(t)/i$|0)|0}var tc=64,nc=4194304;function fa(t){switch(t&-t){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:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function td(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,i=t.suspendedLanes,o=t.pingedLanes,l=n&268435455;if(l!==0){var s=l&~i;s!==0?r=fa(s):(o&=l,o!==0&&(r=fa(o)))}else l=n&~i,l!==0?r=fa(l):o!==0&&(r=fa(o));if(r===0)return 0;if(e!==0&&e!==r&&!(e&i)&&(i=r&-r,o=e&-e,i>=o||i===16&&(o&4194240)!==0))return e;if(r&4&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0<e;)n=31-Sr(e),i=1<<n,r|=t[n],e&=~i;return r}function l$(t,e){switch(t){case 1:case 2:case 4:return e+250;case 8:case 16:case 32:case 64: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 e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function s$(t,e){for(var n=t.suspendedLanes,r=t.pingedLanes,i=t.expirationTimes,o=t.pendingLanes;0<o;){var l=31-Sr(o),s=1<<l,a=i[l];a===-1?(!(s&n)||s&r)&&(i[l]=l$(s,e)):a<=e&&(t.expiredLanes|=s),o&=~s}}function gp(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function d1(){var t=tc;return tc<<=1,!(tc&4194240)&&(tc=64),t}function ch(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function Au(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-Sr(e),t[e]=n}function a$(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var r=t.eventTimes;for(t=t.expirationTimes;0<n;){var i=31-Sr(n),o=1<<i;e[i]=0,r[i]=-1,t[i]=-1,n&=~o}}function cg(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var r=31-Sr(n),i=1<<r;i&e|t[r]&e&&(t[r]|=e),n&=~i}}var Ue=0;function f1(t){return t&=-t,1<t?4<t?t&268435455?16:536870912:4:1}var h1,dg,p1,m1,g1,vp=!1,rc=[],Gi=null,Yi=null,Xi=null,Wa=new Map,Va=new Map,Fi=[],u$="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 submit".split(" ");function ky(t,e){switch(t){case"focusin":case"focusout":Gi=null;break;case"dragenter":case"dragleave":Yi=null;break;case"mouseover":case"mouseout":Xi=null;break;case"pointerover":case"pointerout":Wa.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":Va.delete(e.pointerId)}}function Zs(t,e,n,r,i,o){return t===null||t.nativeEvent!==o?(t={blockedOn:e,domEventName:n,eventSystemFlags:r,nativeEvent:o,targetContainers:[i]},e!==null&&(e=Lu(e),e!==null&&dg(e)),t):(t.eventSystemFlags|=r,e=t.targetContainers,i!==null&&e.indexOf(i)===-1&&e.push(i),t)}function c$(t,e,n,r,i){switch(e){case"focusin":return Gi=Zs(Gi,t,e,n,r,i),!0;case"dragenter":return Yi=Zs(Yi,t,e,n,r,i),!0;case"mouseover":return Xi=Zs(Xi,t,e,n,r,i),!0;case"pointerover":var o=i.pointerId;return Wa.set(o,Zs(Wa.get(o)||null,t,e,n,r,i)),!0;case"gotpointercapture":return o=i.pointerId,Va.set(o,Zs(Va.get(o)||null,t,e,n,r,i)),!0}return!1}function v1(t){var e=Po(t.target);if(e!==null){var n=sl(e);if(n!==null){if(e=n.tag,e===13){if(e=o1(n),e!==null){t.blockedOn=e,g1(t.priority,function(){p1(n)});return}}else if(e===3&&n.stateNode.current.memoizedState.isDehydrated){t.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Pc(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var n=yp(t.domEventName,t.eventSystemFlags,e[0],t.nativeEvent);if(n===null){n=t.nativeEvent;var r=new n.constructor(n.type,n);fp=r,n.target.dispatchEvent(r),fp=null}else return e=Lu(n),e!==null&&dg(e),t.blockedOn=n,!1;e.shift()}return!0}function by(t,e,n){Pc(t)&&n.delete(e)}function d$(){vp=!1,Gi!==null&&Pc(Gi)&&(Gi=null),Yi!==null&&Pc(Yi)&&(Yi=null),Xi!==null&&Pc(Xi)&&(Xi=null),Wa.forEach(by),Va.forEach(by)}function Gs(t,e){t.blockedOn===e&&(t.blockedOn=null,vp||(vp=!0,Wn.unstable_scheduleCallback(Wn.unstable_NormalPriority,d$)))}function Ha(t){function e(i){return Gs(i,t)}if(0<rc.length){Gs(rc[0],t);for(var n=1;n<rc.length;n++){var r=rc[n];r.blockedOn===t&&(r.blockedOn=null)}}for(Gi!==null&&Gs(Gi,t),Yi!==null&&Gs(Yi,t),Xi!==null&&Gs(Xi,t),Wa.forEach(e),Va.forEach(e),n=0;n<Fi.length;n++)r=Fi[n],r.blockedOn===t&&(r.blockedOn=null);for(;0<Fi.length&&(n=Fi[0],n.blockedOn===null);)v1(n),n.blockedOn===null&&Fi.shift()}var Xl=_i.ReactCurrentBatchConfig,nd=!0;function f$(t,e,n,r){var i=Ue,o=Xl.transition;Xl.transition=null;try{Ue=1,fg(t,e,n,r)}finally{Ue=i,Xl.transition=o}}function h$(t,e,n,r){var i=Ue,o=Xl.transition;Xl.transition=null;try{Ue=4,fg(t,e,n,r)}finally{Ue=i,Xl.transition=o}}function fg(t,e,n,r){if(nd){var i=yp(t,e,n,r);if(i===null)_h(t,e,r,rd,n),ky(t,r);else if(c$(i,t,e,n,r))r.stopPropagation();else if(ky(t,r),e&4&&-1<u$.indexOf(t)){for(;i!==null;){var o=Lu(i);if(o!==null&&h1(o),o=yp(t,e,n,r),o===null&&_h(t,e,r,rd,n),o===i)break;i=o}i!==null&&r.stopPropagation()}else _h(t,e,r,null,n)}}var rd=null;function yp(t,e,n,r){if(rd=null,t=ag(r),t=Po(t),t!==null)if(e=sl(t),e===null)t=null;else if(n=e.tag,n===13){if(t=o1(e),t!==null)return t;t=null}else if(n===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null);return rd=t,null}function y1(t){switch(t){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(e$()){case ug:return 1;case u1:return 4;case ed:case t$:return 16;case c1:return 536870912;default:return 16}default:return 16}}var Vi=null,hg=null,Ac=null;function x1(){if(Ac)return Ac;var t,e=hg,n=e.length,r,i="value"in Vi?Vi.value:Vi.textContent,o=i.length;for(t=0;t<n&&e[t]===i[t];t++);var l=n-t;for(r=1;r<=l&&e[n-r]===i[o-r];r++);return Ac=i.slice(t,1<r?1-r:void 0)}function Mc(t){var e=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&e===13&&(t=13)):t=e,t===10&&(t=13),32<=t||t===13?t:0}function ic(){return!0}function $y(){return!1}function Zn(t){function e(n,r,i,o,l){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=o,this.target=l,this.currentTarget=null;for(var s in t)t.hasOwnProperty(s)&&(n=t[s],this[s]=n?n(o):o[s]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?ic:$y,this.isPropagationStopped=$y,this}return mt(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=ic)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=ic)},persist:function(){},isPersistent:ic}),e}var Es={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},pg=Zn(Es),Mu=mt({},Es,{view:0,detail:0}),p$=Zn(Mu),dh,fh,Ys,sf=mt({},Mu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:mg,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Ys&&(Ys&&t.type==="mousemove"?(dh=t.screenX-Ys.screenX,fh=t.screenY-Ys.screenY):fh=dh=0,Ys=t),dh)},movementY:function(t){return"movementY"in t?t.movementY:fh}}),Ty=Zn(sf),m$=mt({},sf,{dataTransfer:0}),g$=Zn(m$),v$=mt({},Mu,{relatedTarget:0}),hh=Zn(v$),y$=mt({},Es,{animationName:0,elapsedTime:0,pseudoElement:0}),x$=Zn(y$),_$=mt({},Es,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),w$=Zn(_$),S$=mt({},Es,{data:0}),Ny=Zn(S$),E$={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},C$={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"},k$={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function b$(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=k$[t])?!!e[t]:!1}function mg(){return b$}var $$=mt({},Mu,{key:function(t){if(t.key){var e=E$[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=Mc(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?C$[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:mg,charCode:function(t){return t.type==="keypress"?Mc(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Mc(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),T$=Zn($$),N$=mt({},sf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ry=Zn(N$),R$=mt({},Mu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:mg}),O$=Zn(R$),P$=mt({},Es,{propertyName:0,elapsedTime:0,pseudoElement:0}),A$=Zn(P$),M$=mt({},sf,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),L$=Zn(M$),D$=[9,13,27,32],gg=fi&&"CompositionEvent"in window,_a=null;fi&&"documentMode"in document&&(_a=document.documentMode);var I$=fi&&"TextEvent"in window&&!_a,_1=fi&&(!gg||_a&&8<_a&&11>=_a),Oy=" ",Py=!1;function w1(t,e){switch(t){case"keyup":return D$.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function S1(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Pl=!1;function j$(t,e){switch(t){case"compositionend":return S1(e);case"keypress":return e.which!==32?null:(Py=!0,Oy);case"textInput":return t=e.data,t===Oy&&Py?null:t;default:return null}}function z$(t,e){if(Pl)return t==="compositionend"||!gg&&w1(t,e)?(t=x1(),Ac=hg=Vi=null,Pl=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return _1&&e.locale!=="ko"?null:e.data;default:return null}}var F$={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 Ay(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!F$[t.type]:e==="textarea"}function E1(t,e,n,r){e1(r),e=id(e,"onChange"),0<e.length&&(n=new pg("onChange","change",null,n,r),t.push({event:n,listeners:e}))}var wa=null,Ka=null;function B$(t){M1(t,0)}function af(t){var e=Ll(t);if(Z_(e))return t}function U$(t,e){if(t==="change")return e}var C1=!1;if(fi){var ph;if(fi){var mh="oninput"in document;if(!mh){var My=document.createElement("div");My.setAttribute("oninput","return;"),mh=typeof My.oninput=="function"}ph=mh}else ph=!1;C1=ph&&(!document.documentMode||9<document.documentMode)}function Ly(){wa&&(wa.detachEvent("onpropertychange",k1),Ka=wa=null)}function k1(t){if(t.propertyName==="value"&&af(Ka)){var e=[];E1(e,Ka,t,ag(t)),i1(B$,e)}}function W$(t,e,n){t==="focusin"?(Ly(),wa=e,Ka=n,wa.attachEvent("onpropertychange",k1)):t==="focusout"&&Ly()}function V$(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return af(Ka)}function H$(t,e){if(t==="click")return af(e)}function K$(t,e){if(t==="input"||t==="change")return af(e)}function Z$(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var br=typeof Object.is=="function"?Object.is:Z$;function Za(t,e){if(br(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!ep.call(e,i)||!br(t[i],e[i]))return!1}return!0}function Dy(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Iy(t,e){var n=Dy(t);t=0;for(var r;n;){if(n.nodeType===3){if(r=t+n.textContent.length,t<=e&&r>=e)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Dy(n)}}function b1(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?b1(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function $1(){for(var t=window,e=Jc();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=Jc(t.document)}return e}function vg(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function G$(t){var e=$1(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&b1(n.ownerDocument.documentElement,n)){if(r!==null&&vg(n)){if(e=r.start,t=r.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!t.extend&&o>r&&(i=r,r=o,o=i),i=Iy(n,o);var l=Iy(n,r);i&&l&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==l.node||t.focusOffset!==l.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),o>r?(t.addRange(e),t.extend(l.node,l.offset)):(e.setEnd(l.node,l.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<e.length;n++)t=e[n],t.element.scrollLeft=t.left,t.element.scrollTop=t.top}}var Y$=fi&&"documentMode"in document&&11>=document.documentMode,Al=null,xp=null,Sa=null,_p=!1;function jy(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;_p||Al==null||Al!==Jc(r)||(r=Al,"selectionStart"in r&&vg(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Sa&&Za(Sa,r)||(Sa=r,r=id(xp,"onSelect"),0<r.length&&(e=new pg("onSelect","select",null,e,n),t.push({event:e,listeners:r}),e.target=Al)))}function oc(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var Ml={animationend:oc("Animation","AnimationEnd"),animationiteration:oc("Animation","AnimationIteration"),animationstart:oc("Animation","AnimationStart"),transitionend:oc("Transition","TransitionEnd")},gh={},T1={};fi&&(T1=document.createElement("div").style,"AnimationEvent"in window||(delete Ml.animationend.animation,delete Ml.animationiteration.animation,delete Ml.animationstart.animation),"TransitionEvent"in window||delete Ml.transitionend.transition);function uf(t){if(gh[t])return gh[t];if(!Ml[t])return t;var e=Ml[t],n;for(n in e)if(e.hasOwnProperty(n)&&n in T1)return gh[t]=e[n];return t}var N1=uf("animationend"),R1=uf("animationiteration"),O1=uf("animationstart"),P1=uf("transitionend"),A1=new Map,zy="abort auxClick 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(" ");function xo(t,e){A1.set(t,e),ll(e,[t])}for(var vh=0;vh<zy.length;vh++){var yh=zy[vh],X$=yh.toLowerCase(),J$=yh[0].toUpperCase()+yh.slice(1);xo(X$,"on"+J$)}xo(N1,"onAnimationEnd");xo(R1,"onAnimationIteration");xo(O1,"onAnimationStart");xo("dblclick","onDoubleClick");xo("focusin","onFocus");xo("focusout","onBlur");xo(P1,"onTransitionEnd");os("onMouseEnter",["mouseout","mouseover"]);os("onMouseLeave",["mouseout","mouseover"]);os("onPointerEnter",["pointerout","pointerover"]);os("onPointerLeave",["pointerout","pointerover"]);ll("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));ll("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));ll("onBeforeInput",["compositionend","keypress","textInput","paste"]);ll("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));ll("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));ll("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ha="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(" "),Q$=new Set("cancel close invalid load scroll toggle".split(" ").concat(ha));function Fy(t,e,n){var r=t.type||"unknown-event";t.currentTarget=n,Xb(r,e,void 0,t),t.currentTarget=null}function M1(t,e){e=(e&4)!==0;for(var n=0;n<t.length;n++){var r=t[n],i=r.event;r=r.listeners;e:{var o=void 0;if(e)for(var l=r.length-1;0<=l;l--){var s=r[l],a=s.instance,u=s.currentTarget;if(s=s.listener,a!==o&&i.isPropagationStopped())break e;Fy(i,s,u),o=a}else for(l=0;l<r.length;l++){if(s=r[l],a=s.instance,u=s.currentTarget,s=s.listener,a!==o&&i.isPropagationStopped())break e;Fy(i,s,u),o=a}}}if(qc)throw t=mp,qc=!1,mp=null,t}function et(t,e){var n=e[kp];n===void 0&&(n=e[kp]=new Set);var r=t+"__bubble";n.has(r)||(L1(e,t,2,!1),n.add(r))}function xh(t,e,n){var r=0;e&&(r|=4),L1(n,t,r,e)}var lc="_reactListening"+Math.random().toString(36).slice(2);function Ga(t){if(!t[lc]){t[lc]=!0,U_.forEach(function(n){n!=="selectionchange"&&(Q$.has(n)||xh(n,!1,t),xh(n,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[lc]||(e[lc]=!0,xh("selectionchange",!1,e))}}function L1(t,e,n,r){switch(y1(e)){case 1:var i=f$;break;case 4:i=h$;break;default:i=fg}n=i.bind(null,e,n,t),i=void 0,!pp||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(i=!0),r?i!==void 0?t.addEventListener(e,n,{capture:!0,passive:i}):t.addEventListener(e,n,!0):i!==void 0?t.addEventListener(e,n,{passive:i}):t.addEventListener(e,n,!1)}function _h(t,e,n,r,i){var o=r;if(!(e&1)&&!(e&2)&&r!==null)e:for(;;){if(r===null)return;var l=r.tag;if(l===3||l===4){var s=r.stateNode.containerInfo;if(s===i||s.nodeType===8&&s.parentNode===i)break;if(l===4)for(l=r.return;l!==null;){var a=l.tag;if((a===3||a===4)&&(a=l.stateNode.containerInfo,a===i||a.nodeType===8&&a.parentNode===i))return;l=l.return}for(;s!==null;){if(l=Po(s),l===null)return;if(a=l.tag,a===5||a===6){r=o=l;continue e}s=s.parentNode}}r=r.return}i1(function(){var u=o,c=ag(n),d=[];e:{var f=A1.get(t);if(f!==void 0){var h=pg,g=t;switch(t){case"keypress":if(Mc(n)===0)break e;case"keydown":case"keyup":h=T$;break;case"focusin":g="focus",h=hh;break;case"focusout":g="blur",h=hh;break;case"beforeblur":case"afterblur":h=hh;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":h=Ty;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=g$;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=O$;break;case N1:case R1:case O1:h=x$;break;case P1:h=A$;break;case"scroll":h=p$;break;case"wheel":h=L$;break;case"copy":case"cut":case"paste":h=w$;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=Ry}var m=(e&4)!==0,w=!m&&t==="scroll",v=m?f!==null?f+"Capture":null:f;m=[];for(var y=u,_;y!==null;){_=y;var S=_.stateNode;if(_.tag===5&&S!==null&&(_=S,v!==null&&(S=Ua(y,v),S!=null&&m.push(Ya(y,S,_)))),w)break;y=y.return}0<m.length&&(f=new h(f,g,null,n,c),d.push({event:f,listeners:m}))}}if(!(e&7)){e:{if(f=t==="mouseover"||t==="pointerover",h=t==="mouseout"||t==="pointerout",f&&n!==fp&&(g=n.relatedTarget||n.fromElement)&&(Po(g)||g[hi]))break e;if((h||f)&&(f=c.window===c?c:(f=c.ownerDocument)?f.defaultView||f.parentWindow:window,h?(g=n.relatedTarget||n.toElement,h=u,g=g?Po(g):null,g!==null&&(w=sl(g),g!==w||g.tag!==5&&g.tag!==6)&&(g=null)):(h=null,g=u),h!==g)){if(m=Ty,S="onMouseLeave",v="onMouseEnter",y="mouse",(t==="pointerout"||t==="pointerover")&&(m=Ry,S="onPointerLeave",v="onPointerEnter",y="pointer"),w=h==null?f:Ll(h),_=g==null?f:Ll(g),f=new m(S,y+"leave",h,n,c),f.target=w,f.relatedTarget=_,S=null,Po(c)===u&&(m=new m(v,y+"enter",g,n,c),m.target=_,m.relatedTarget=w,S=m),w=S,h&&g)t:{for(m=h,v=g,y=0,_=m;_;_=yl(_))y++;for(_=0,S=v;S;S=yl(S))_++;for(;0<y-_;)m=yl(m),y--;for(;0<_-y;)v=yl(v),_--;for(;y--;){if(m===v||v!==null&&m===v.alternate)break t;m=yl(m),v=yl(v)}m=null}else m=null;h!==null&&By(d,f,h,m,!1),g!==null&&w!==null&&By(d,w,g,m,!0)}}e:{if(f=u?Ll(u):window,h=f.nodeName&&f.nodeName.toLowerCase(),h==="select"||h==="input"&&f.type==="file")var E=U$;else if(Ay(f))if(C1)E=K$;else{E=V$;var $=W$}else(h=f.nodeName)&&h.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(E=H$);if(E&&(E=E(t,u))){E1(d,E,n,c);break e}$&&$(t,f,u),t==="focusout"&&($=f._wrapperState)&&$.controlled&&f.type==="number"&&sp(f,"number",f.value)}switch($=u?Ll(u):window,t){case"focusin":(Ay($)||$.contentEditable==="true")&&(Al=$,xp=u,Sa=null);break;case"focusout":Sa=xp=Al=null;break;case"mousedown":_p=!0;break;case"contextmenu":case"mouseup":case"dragend":_p=!1,jy(d,n,c);break;case"selectionchange":if(Y$)break;case"keydown":case"keyup":jy(d,n,c)}var C;if(gg)e:{switch(t){case"compositionstart":var N="onCompositionStart";break e;case"compositionend":N="onCompositionEnd";break e;case"compositionupdate":N="onCompositionUpdate";break e}N=void 0}else Pl?w1(t,n)&&(N="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(N="onCompositionStart");N&&(_1&&n.locale!=="ko"&&(Pl||N!=="onCompositionStart"?N==="onCompositionEnd"&&Pl&&(C=x1()):(Vi=c,hg="value"in Vi?Vi.value:Vi.textContent,Pl=!0)),$=id(u,N),0<$.length&&(N=new Ny(N,t,null,n,c),d.push({event:N,listeners:$}),C?N.data=C:(C=S1(n),C!==null&&(N.data=C)))),(C=I$?j$(t,n):z$(t,n))&&(u=id(u,"onBeforeInput"),0<u.length&&(c=new Ny("onBeforeInput","beforeinput",null,n,c),d.push({event:c,listeners:u}),c.data=C))}M1(d,e)})}function Ya(t,e,n){return{instance:t,listener:e,currentTarget:n}}function id(t,e){for(var n=e+"Capture",r=[];t!==null;){var i=t,o=i.stateNode;i.tag===5&&o!==null&&(i=o,o=Ua(t,n),o!=null&&r.unshift(Ya(t,o,i)),o=Ua(t,e),o!=null&&r.push(Ya(t,o,i))),t=t.return}return r}function yl(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function By(t,e,n,r,i){for(var o=e._reactName,l=[];n!==null&&n!==r;){var s=n,a=s.alternate,u=s.stateNode;if(a!==null&&a===r)break;s.tag===5&&u!==null&&(s=u,i?(a=Ua(n,o),a!=null&&l.unshift(Ya(n,a,s))):i||(a=Ua(n,o),a!=null&&l.push(Ya(n,a,s)))),n=n.return}l.length!==0&&t.push({event:e,listeners:l})}var q$=/\r\n?/g,eT=/\u0000|\uFFFD/g;function Uy(t){return(typeof t=="string"?t:""+t).replace(q$,`
|
|
30
|
+
`).replace(eT,"")}function sc(t,e,n){if(e=Uy(e),Uy(t)!==e&&n)throw Error(U(425))}function od(){}var wp=null,Sp=null;function Ep(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var Cp=typeof setTimeout=="function"?setTimeout:void 0,tT=typeof clearTimeout=="function"?clearTimeout:void 0,Wy=typeof Promise=="function"?Promise:void 0,nT=typeof queueMicrotask=="function"?queueMicrotask:typeof Wy<"u"?function(t){return Wy.resolve(null).then(t).catch(rT)}:Cp;function rT(t){setTimeout(function(){throw t})}function wh(t,e){var n=e,r=0;do{var i=n.nextSibling;if(t.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){t.removeChild(i),Ha(e);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);Ha(e)}function Ji(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break;if(e===8){if(e=t.data,e==="$"||e==="$!"||e==="$?")break;if(e==="/$")return null}}return t}function Vy(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="$"||n==="$!"||n==="$?"){if(e===0)return t;e--}else n==="/$"&&e++}t=t.previousSibling}return null}var Cs=Math.random().toString(36).slice(2),Lr="__reactFiber$"+Cs,Xa="__reactProps$"+Cs,hi="__reactContainer$"+Cs,kp="__reactEvents$"+Cs,iT="__reactListeners$"+Cs,oT="__reactHandles$"+Cs;function Po(t){var e=t[Lr];if(e)return e;for(var n=t.parentNode;n;){if(e=n[hi]||n[Lr]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=Vy(t);t!==null;){if(n=t[Lr])return n;t=Vy(t)}return e}t=n,n=t.parentNode}return null}function Lu(t){return t=t[Lr]||t[hi],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function Ll(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(U(33))}function cf(t){return t[Xa]||null}var bp=[],Dl=-1;function _o(t){return{current:t}}function it(t){0>Dl||(t.current=bp[Dl],bp[Dl]=null,Dl--)}function Xe(t,e){Dl++,bp[Dl]=t.current,t.current=e}var lo={},rn=_o(lo),$n=_o(!1),Ho=lo;function ls(t,e){var n=t.type.contextTypes;if(!n)return lo;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=e[o];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function Tn(t){return t=t.childContextTypes,t!=null}function ld(){it($n),it(rn)}function Hy(t,e,n){if(rn.current!==lo)throw Error(U(168));Xe(rn,e),Xe($n,n)}function D1(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in e))throw Error(U(108,Wb(t)||"Unknown",i));return mt({},n,r)}function sd(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||lo,Ho=rn.current,Xe(rn,t),Xe($n,$n.current),!0}function Ky(t,e,n){var r=t.stateNode;if(!r)throw Error(U(169));n?(t=D1(t,e,Ho),r.__reactInternalMemoizedMergedChildContext=t,it($n),it(rn),Xe(rn,t)):it($n),Xe($n,n)}var oi=null,df=!1,Sh=!1;function I1(t){oi===null?oi=[t]:oi.push(t)}function lT(t){df=!0,I1(t)}function wo(){if(!Sh&&oi!==null){Sh=!0;var t=0,e=Ue;try{var n=oi;for(Ue=1;t<n.length;t++){var r=n[t];do r=r(!0);while(r!==null)}oi=null,df=!1}catch(i){throw oi!==null&&(oi=oi.slice(t+1)),a1(ug,wo),i}finally{Ue=e,Sh=!1}}return null}var Il=[],jl=0,ad=null,ud=0,Qn=[],qn=0,Ko=null,ai=1,ui="";function To(t,e){Il[jl++]=ud,Il[jl++]=ad,ad=t,ud=e}function j1(t,e,n){Qn[qn++]=ai,Qn[qn++]=ui,Qn[qn++]=Ko,Ko=t;var r=ai;t=ui;var i=32-Sr(r)-1;r&=~(1<<i),n+=1;var o=32-Sr(e)+i;if(30<o){var l=i-i%5;o=(r&(1<<l)-1).toString(32),r>>=l,i-=l,ai=1<<32-Sr(e)+i|n<<i|r,ui=o+t}else ai=1<<o|n<<i|r,ui=t}function yg(t){t.return!==null&&(To(t,1),j1(t,1,0))}function xg(t){for(;t===ad;)ad=Il[--jl],Il[jl]=null,ud=Il[--jl],Il[jl]=null;for(;t===Ko;)Ko=Qn[--qn],Qn[qn]=null,ui=Qn[--qn],Qn[qn]=null,ai=Qn[--qn],Qn[qn]=null}var Fn=null,zn=null,ot=!1,xr=null;function z1(t,e){var n=nr(5,null,null,0);n.elementType="DELETED",n.stateNode=e,n.return=t,e=t.deletions,e===null?(t.deletions=[n],t.flags|=16):e.push(n)}function Zy(t,e){switch(t.tag){case 5:var n=t.type;return e=e.nodeType!==1||n.toLowerCase()!==e.nodeName.toLowerCase()?null:e,e!==null?(t.stateNode=e,Fn=t,zn=Ji(e.firstChild),!0):!1;case 6:return e=t.pendingProps===""||e.nodeType!==3?null:e,e!==null?(t.stateNode=e,Fn=t,zn=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(n=Ko!==null?{id:ai,overflow:ui}:null,t.memoizedState={dehydrated:e,treeContext:n,retryLane:1073741824},n=nr(18,null,null,0),n.stateNode=e,n.return=t,t.child=n,Fn=t,zn=null,!0):!1;default:return!1}}function $p(t){return(t.mode&1)!==0&&(t.flags&128)===0}function Tp(t){if(ot){var e=zn;if(e){var n=e;if(!Zy(t,e)){if($p(t))throw Error(U(418));e=Ji(n.nextSibling);var r=Fn;e&&Zy(t,e)?z1(r,n):(t.flags=t.flags&-4097|2,ot=!1,Fn=t)}}else{if($p(t))throw Error(U(418));t.flags=t.flags&-4097|2,ot=!1,Fn=t}}}function Gy(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;Fn=t}function ac(t){if(t!==Fn)return!1;if(!ot)return Gy(t),ot=!0,!1;var e;if((e=t.tag!==3)&&!(e=t.tag!==5)&&(e=t.type,e=e!=="head"&&e!=="body"&&!Ep(t.type,t.memoizedProps)),e&&(e=zn)){if($p(t))throw F1(),Error(U(418));for(;e;)z1(t,e),e=Ji(e.nextSibling)}if(Gy(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(U(317));e:{for(t=t.nextSibling,e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="/$"){if(e===0){zn=Ji(t.nextSibling);break e}e--}else n!=="$"&&n!=="$!"&&n!=="$?"||e++}t=t.nextSibling}zn=null}}else zn=Fn?Ji(t.stateNode.nextSibling):null;return!0}function F1(){for(var t=zn;t;)t=Ji(t.nextSibling)}function ss(){zn=Fn=null,ot=!1}function _g(t){xr===null?xr=[t]:xr.push(t)}var sT=_i.ReactCurrentBatchConfig;function gr(t,e){if(t&&t.defaultProps){e=mt({},e),t=t.defaultProps;for(var n in t)e[n]===void 0&&(e[n]=t[n]);return e}return e}var cd=_o(null),dd=null,zl=null,wg=null;function Sg(){wg=zl=dd=null}function Eg(t){var e=cd.current;it(cd),t._currentValue=e}function Np(t,e,n){for(;t!==null;){var r=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),t===n)break;t=t.return}}function Jl(t,e){dd=t,wg=zl=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(bn=!0),t.firstContext=null)}function lr(t){var e=t._currentValue;if(wg!==t)if(t={context:t,memoizedValue:e,next:null},zl===null){if(dd===null)throw Error(U(308));zl=t,dd.dependencies={lanes:0,firstContext:t}}else zl=zl.next=t;return e}var Ao=null;function Cg(t){Ao===null?Ao=[t]:Ao.push(t)}function B1(t,e,n,r){var i=e.interleaved;return i===null?(n.next=n,Cg(e)):(n.next=i.next,i.next=n),e.interleaved=n,pi(t,r)}function pi(t,e){t.lanes|=e;var n=t.alternate;for(n!==null&&(n.lanes|=e),n=t,t=t.return;t!==null;)t.childLanes|=e,n=t.alternate,n!==null&&(n.childLanes|=e),n=t,t=t.return;return n.tag===3?n.stateNode:null}var ji=!1;function kg(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function U1(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function ci(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function Qi(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,Me&2){var i=r.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),r.pending=e,pi(t,n)}return i=r.interleaved,i===null?(e.next=e,Cg(r)):(e.next=i.next,i.next=e),r.interleaved=e,pi(t,n)}function Lc(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194240)!==0)){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,cg(t,n)}}function Yy(t,e){var n=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var l={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?i=o=l:o=o.next=l,n=n.next}while(n!==null);o===null?i=o=e:o=o.next=e}else i=o=e;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function fd(t,e,n,r){var i=t.updateQueue;ji=!1;var o=i.firstBaseUpdate,l=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var a=s,u=a.next;a.next=null,l===null?o=u:l.next=u,l=a;var c=t.alternate;c!==null&&(c=c.updateQueue,s=c.lastBaseUpdate,s!==l&&(s===null?c.firstBaseUpdate=u:s.next=u,c.lastBaseUpdate=a))}if(o!==null){var d=i.baseState;l=0,c=u=a=null,s=o;do{var f=s.lane,h=s.eventTime;if((r&f)===f){c!==null&&(c=c.next={eventTime:h,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var g=t,m=s;switch(f=e,h=n,m.tag){case 1:if(g=m.payload,typeof g=="function"){d=g.call(h,d,f);break e}d=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=m.payload,f=typeof g=="function"?g.call(h,d,f):g,f==null)break e;d=mt({},d,f);break e;case 2:ji=!0}}s.callback!==null&&s.lane!==0&&(t.flags|=64,f=i.effects,f===null?i.effects=[s]:f.push(s))}else h={eventTime:h,lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},c===null?(u=c=h,a=d):c=c.next=h,l|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;f=s,s=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(!0);if(c===null&&(a=d),i.baseState=a,i.firstBaseUpdate=u,i.lastBaseUpdate=c,e=i.shared.interleaved,e!==null){i=e;do l|=i.lane,i=i.next;while(i!==e)}else o===null&&(i.shared.lanes=0);Go|=l,t.lanes=l,t.memoizedState=d}}function Xy(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;e<t.length;e++){var r=t[e],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(U(191,i));i.call(r)}}}var W1=new B_.Component().refs;function Rp(t,e,n,r){e=t.memoizedState,n=n(r,e),n=n==null?e:mt({},e,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n)}var ff={isMounted:function(t){return(t=t._reactInternals)?sl(t)===t:!1},enqueueSetState:function(t,e,n){t=t._reactInternals;var r=vn(),i=eo(t),o=ci(r,i);o.payload=e,n!=null&&(o.callback=n),e=Qi(t,o,i),e!==null&&(Er(e,t,i,r),Lc(e,t,i))},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var r=vn(),i=eo(t),o=ci(r,i);o.tag=1,o.payload=e,n!=null&&(o.callback=n),e=Qi(t,o,i),e!==null&&(Er(e,t,i,r),Lc(e,t,i))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=vn(),r=eo(t),i=ci(n,r);i.tag=2,e!=null&&(i.callback=e),e=Qi(t,i,r),e!==null&&(Er(e,t,r,n),Lc(e,t,r))}};function Jy(t,e,n,r,i,o,l){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(r,o,l):e.prototype&&e.prototype.isPureReactComponent?!Za(n,r)||!Za(i,o):!0}function V1(t,e,n){var r=!1,i=lo,o=e.contextType;return typeof o=="object"&&o!==null?o=lr(o):(i=Tn(e)?Ho:rn.current,r=e.contextTypes,o=(r=r!=null)?ls(t,i):lo),e=new e(n,o),t.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=ff,t.stateNode=e,e._reactInternals=t,r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=i,t.__reactInternalMemoizedMaskedChildContext=o),e}function Qy(t,e,n,r){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(n,r),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(n,r),e.state!==t&&ff.enqueueReplaceState(e,e.state,null)}function Op(t,e,n,r){var i=t.stateNode;i.props=n,i.state=t.memoizedState,i.refs=W1,kg(t);var o=e.contextType;typeof o=="object"&&o!==null?i.context=lr(o):(o=Tn(e)?Ho:rn.current,i.context=ls(t,o)),i.state=t.memoizedState,o=e.getDerivedStateFromProps,typeof o=="function"&&(Rp(t,e,o,n),i.state=t.memoizedState),typeof e.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(e=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),e!==i.state&&ff.enqueueReplaceState(i,i.state,null),fd(t,n,i,r),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308)}function Xs(t,e,n){if(t=n.ref,t!==null&&typeof t!="function"&&typeof t!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(U(309));var r=n.stateNode}if(!r)throw Error(U(147,t));var i=r,o=""+t;return e!==null&&e.ref!==null&&typeof e.ref=="function"&&e.ref._stringRef===o?e.ref:(e=function(l){var s=i.refs;s===W1&&(s=i.refs={}),l===null?delete s[o]:s[o]=l},e._stringRef=o,e)}if(typeof t!="string")throw Error(U(284));if(!n._owner)throw Error(U(290,t))}return t}function uc(t,e){throw t=Object.prototype.toString.call(e),Error(U(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t))}function qy(t){var e=t._init;return e(t._payload)}function H1(t){function e(v,y){if(t){var _=v.deletions;_===null?(v.deletions=[y],v.flags|=16):_.push(y)}}function n(v,y){if(!t)return null;for(;y!==null;)e(v,y),y=y.sibling;return null}function r(v,y){for(v=new Map;y!==null;)y.key!==null?v.set(y.key,y):v.set(y.index,y),y=y.sibling;return v}function i(v,y){return v=to(v,y),v.index=0,v.sibling=null,v}function o(v,y,_){return v.index=_,t?(_=v.alternate,_!==null?(_=_.index,_<y?(v.flags|=2,y):_):(v.flags|=2,y)):(v.flags|=1048576,y)}function l(v){return t&&v.alternate===null&&(v.flags|=2),v}function s(v,y,_,S){return y===null||y.tag!==6?(y=Nh(_,v.mode,S),y.return=v,y):(y=i(y,_),y.return=v,y)}function a(v,y,_,S){var E=_.type;return E===Ol?c(v,y,_.props.children,S,_.key):y!==null&&(y.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Ii&&qy(E)===y.type)?(S=i(y,_.props),S.ref=Xs(v,y,_),S.return=v,S):(S=Bc(_.type,_.key,_.props,null,v.mode,S),S.ref=Xs(v,y,_),S.return=v,S)}function u(v,y,_,S){return y===null||y.tag!==4||y.stateNode.containerInfo!==_.containerInfo||y.stateNode.implementation!==_.implementation?(y=Rh(_,v.mode,S),y.return=v,y):(y=i(y,_.children||[]),y.return=v,y)}function c(v,y,_,S,E){return y===null||y.tag!==7?(y=jo(_,v.mode,S,E),y.return=v,y):(y=i(y,_),y.return=v,y)}function d(v,y,_){if(typeof y=="string"&&y!==""||typeof y=="number")return y=Nh(""+y,v.mode,_),y.return=v,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Qu:return _=Bc(y.type,y.key,y.props,null,v.mode,_),_.ref=Xs(v,null,y),_.return=v,_;case Rl:return y=Rh(y,v.mode,_),y.return=v,y;case Ii:var S=y._init;return d(v,S(y._payload),_)}if(da(y)||Hs(y))return y=jo(y,v.mode,_,null),y.return=v,y;uc(v,y)}return null}function f(v,y,_,S){var E=y!==null?y.key:null;if(typeof _=="string"&&_!==""||typeof _=="number")return E!==null?null:s(v,y,""+_,S);if(typeof _=="object"&&_!==null){switch(_.$$typeof){case Qu:return _.key===E?a(v,y,_,S):null;case Rl:return _.key===E?u(v,y,_,S):null;case Ii:return E=_._init,f(v,y,E(_._payload),S)}if(da(_)||Hs(_))return E!==null?null:c(v,y,_,S,null);uc(v,_)}return null}function h(v,y,_,S,E){if(typeof S=="string"&&S!==""||typeof S=="number")return v=v.get(_)||null,s(y,v,""+S,E);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case Qu:return v=v.get(S.key===null?_:S.key)||null,a(y,v,S,E);case Rl:return v=v.get(S.key===null?_:S.key)||null,u(y,v,S,E);case Ii:var $=S._init;return h(v,y,_,$(S._payload),E)}if(da(S)||Hs(S))return v=v.get(_)||null,c(y,v,S,E,null);uc(y,S)}return null}function g(v,y,_,S){for(var E=null,$=null,C=y,N=y=0,R=null;C!==null&&N<_.length;N++){C.index>N?(R=C,C=null):R=C.sibling;var b=f(v,C,_[N],S);if(b===null){C===null&&(C=R);break}t&&C&&b.alternate===null&&e(v,C),y=o(b,y,N),$===null?E=b:$.sibling=b,$=b,C=R}if(N===_.length)return n(v,C),ot&&To(v,N),E;if(C===null){for(;N<_.length;N++)C=d(v,_[N],S),C!==null&&(y=o(C,y,N),$===null?E=C:$.sibling=C,$=C);return ot&&To(v,N),E}for(C=r(v,C);N<_.length;N++)R=h(C,v,N,_[N],S),R!==null&&(t&&R.alternate!==null&&C.delete(R.key===null?N:R.key),y=o(R,y,N),$===null?E=R:$.sibling=R,$=R);return t&&C.forEach(function(L){return e(v,L)}),ot&&To(v,N),E}function m(v,y,_,S){var E=Hs(_);if(typeof E!="function")throw Error(U(150));if(_=E.call(_),_==null)throw Error(U(151));for(var $=E=null,C=y,N=y=0,R=null,b=_.next();C!==null&&!b.done;N++,b=_.next()){C.index>N?(R=C,C=null):R=C.sibling;var L=f(v,C,b.value,S);if(L===null){C===null&&(C=R);break}t&&C&&L.alternate===null&&e(v,C),y=o(L,y,N),$===null?E=L:$.sibling=L,$=L,C=R}if(b.done)return n(v,C),ot&&To(v,N),E;if(C===null){for(;!b.done;N++,b=_.next())b=d(v,b.value,S),b!==null&&(y=o(b,y,N),$===null?E=b:$.sibling=b,$=b);return ot&&To(v,N),E}for(C=r(v,C);!b.done;N++,b=_.next())b=h(C,v,N,b.value,S),b!==null&&(t&&b.alternate!==null&&C.delete(b.key===null?N:b.key),y=o(b,y,N),$===null?E=b:$.sibling=b,$=b);return t&&C.forEach(function(F){return e(v,F)}),ot&&To(v,N),E}function w(v,y,_,S){if(typeof _=="object"&&_!==null&&_.type===Ol&&_.key===null&&(_=_.props.children),typeof _=="object"&&_!==null){switch(_.$$typeof){case Qu:e:{for(var E=_.key,$=y;$!==null;){if($.key===E){if(E=_.type,E===Ol){if($.tag===7){n(v,$.sibling),y=i($,_.props.children),y.return=v,v=y;break e}}else if($.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Ii&&qy(E)===$.type){n(v,$.sibling),y=i($,_.props),y.ref=Xs(v,$,_),y.return=v,v=y;break e}n(v,$);break}else e(v,$);$=$.sibling}_.type===Ol?(y=jo(_.props.children,v.mode,S,_.key),y.return=v,v=y):(S=Bc(_.type,_.key,_.props,null,v.mode,S),S.ref=Xs(v,y,_),S.return=v,v=S)}return l(v);case Rl:e:{for($=_.key;y!==null;){if(y.key===$)if(y.tag===4&&y.stateNode.containerInfo===_.containerInfo&&y.stateNode.implementation===_.implementation){n(v,y.sibling),y=i(y,_.children||[]),y.return=v,v=y;break e}else{n(v,y);break}else e(v,y);y=y.sibling}y=Rh(_,v.mode,S),y.return=v,v=y}return l(v);case Ii:return $=_._init,w(v,y,$(_._payload),S)}if(da(_))return g(v,y,_,S);if(Hs(_))return m(v,y,_,S);uc(v,_)}return typeof _=="string"&&_!==""||typeof _=="number"?(_=""+_,y!==null&&y.tag===6?(n(v,y.sibling),y=i(y,_),y.return=v,v=y):(n(v,y),y=Nh(_,v.mode,S),y.return=v,v=y),l(v)):n(v,y)}return w}var as=H1(!0),K1=H1(!1),Du={},Br=_o(Du),Ja=_o(Du),Qa=_o(Du);function Mo(t){if(t===Du)throw Error(U(174));return t}function bg(t,e){switch(Xe(Qa,e),Xe(Ja,t),Xe(Br,Du),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:up(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=up(e,t)}it(Br),Xe(Br,e)}function us(){it(Br),it(Ja),it(Qa)}function Z1(t){Mo(Qa.current);var e=Mo(Br.current),n=up(e,t.type);e!==n&&(Xe(Ja,t),Xe(Br,n))}function $g(t){Ja.current===t&&(it(Br),it(Ja))}var dt=_o(0);function hd(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var Eh=[];function Tg(){for(var t=0;t<Eh.length;t++)Eh[t]._workInProgressVersionPrimary=null;Eh.length=0}var Dc=_i.ReactCurrentDispatcher,Ch=_i.ReactCurrentBatchConfig,Zo=0,ht=null,Rt=null,Dt=null,pd=!1,Ea=!1,qa=0,aT=0;function Yt(){throw Error(U(321))}function Ng(t,e){if(e===null)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!br(t[n],e[n]))return!1;return!0}function Rg(t,e,n,r,i,o){if(Zo=o,ht=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,Dc.current=t===null||t.memoizedState===null?fT:hT,t=n(r,i),Ea){o=0;do{if(Ea=!1,qa=0,25<=o)throw Error(U(301));o+=1,Dt=Rt=null,e.updateQueue=null,Dc.current=pT,t=n(r,i)}while(Ea)}if(Dc.current=md,e=Rt!==null&&Rt.next!==null,Zo=0,Dt=Rt=ht=null,pd=!1,e)throw Error(U(300));return t}function Og(){var t=qa!==0;return qa=0,t}function Ar(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Dt===null?ht.memoizedState=Dt=t:Dt=Dt.next=t,Dt}function sr(){if(Rt===null){var t=ht.alternate;t=t!==null?t.memoizedState:null}else t=Rt.next;var e=Dt===null?ht.memoizedState:Dt.next;if(e!==null)Dt=e,Rt=t;else{if(t===null)throw Error(U(310));Rt=t,t={memoizedState:Rt.memoizedState,baseState:Rt.baseState,baseQueue:Rt.baseQueue,queue:Rt.queue,next:null},Dt===null?ht.memoizedState=Dt=t:Dt=Dt.next=t}return Dt}function eu(t,e){return typeof e=="function"?e(t):e}function kh(t){var e=sr(),n=e.queue;if(n===null)throw Error(U(311));n.lastRenderedReducer=t;var r=Rt,i=r.baseQueue,o=n.pending;if(o!==null){if(i!==null){var l=i.next;i.next=o.next,o.next=l}r.baseQueue=i=o,n.pending=null}if(i!==null){o=i.next,r=r.baseState;var s=l=null,a=null,u=o;do{var c=u.lane;if((Zo&c)===c)a!==null&&(a=a.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:t(r,u.action);else{var d={lane:c,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};a===null?(s=a=d,l=r):a=a.next=d,ht.lanes|=c,Go|=c}u=u.next}while(u!==null&&u!==o);a===null?l=r:a.next=s,br(r,e.memoizedState)||(bn=!0),e.memoizedState=r,e.baseState=l,e.baseQueue=a,n.lastRenderedState=r}if(t=n.interleaved,t!==null){i=t;do o=i.lane,ht.lanes|=o,Go|=o,i=i.next;while(i!==t)}else i===null&&(n.lanes=0);return[e.memoizedState,n.dispatch]}function bh(t){var e=sr(),n=e.queue;if(n===null)throw Error(U(311));n.lastRenderedReducer=t;var r=n.dispatch,i=n.pending,o=e.memoizedState;if(i!==null){n.pending=null;var l=i=i.next;do o=t(o,l.action),l=l.next;while(l!==i);br(o,e.memoizedState)||(bn=!0),e.memoizedState=o,e.baseQueue===null&&(e.baseState=o),n.lastRenderedState=o}return[o,r]}function G1(){}function Y1(t,e){var n=ht,r=sr(),i=e(),o=!br(r.memoizedState,i);if(o&&(r.memoizedState=i,bn=!0),r=r.queue,Pg(Q1.bind(null,n,r,t),[t]),r.getSnapshot!==e||o||Dt!==null&&Dt.memoizedState.tag&1){if(n.flags|=2048,tu(9,J1.bind(null,n,r,i,e),void 0,null),Bt===null)throw Error(U(349));Zo&30||X1(n,e,i)}return i}function X1(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},e=ht.updateQueue,e===null?(e={lastEffect:null,stores:null},ht.updateQueue=e,e.stores=[t]):(n=e.stores,n===null?e.stores=[t]:n.push(t))}function J1(t,e,n,r){e.value=n,e.getSnapshot=r,q1(e)&&ew(t)}function Q1(t,e,n){return n(function(){q1(e)&&ew(t)})}function q1(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!br(t,n)}catch{return!0}}function ew(t){var e=pi(t,1);e!==null&&Er(e,t,1,-1)}function e0(t){var e=Ar();return typeof t=="function"&&(t=t()),e.memoizedState=e.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:eu,lastRenderedState:t},e.queue=t,t=t.dispatch=dT.bind(null,ht,t),[e.memoizedState,t]}function tu(t,e,n,r){return t={tag:t,create:e,destroy:n,deps:r,next:null},e=ht.updateQueue,e===null?(e={lastEffect:null,stores:null},ht.updateQueue=e,e.lastEffect=t.next=t):(n=e.lastEffect,n===null?e.lastEffect=t.next=t:(r=n.next,n.next=t,t.next=r,e.lastEffect=t)),t}function tw(){return sr().memoizedState}function Ic(t,e,n,r){var i=Ar();ht.flags|=t,i.memoizedState=tu(1|e,n,void 0,r===void 0?null:r)}function hf(t,e,n,r){var i=sr();r=r===void 0?null:r;var o=void 0;if(Rt!==null){var l=Rt.memoizedState;if(o=l.destroy,r!==null&&Ng(r,l.deps)){i.memoizedState=tu(e,n,o,r);return}}ht.flags|=t,i.memoizedState=tu(1|e,n,o,r)}function t0(t,e){return Ic(8390656,8,t,e)}function Pg(t,e){return hf(2048,8,t,e)}function nw(t,e){return hf(4,2,t,e)}function rw(t,e){return hf(4,4,t,e)}function iw(t,e){if(typeof e=="function")return t=t(),e(t),function(){e(null)};if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function ow(t,e,n){return n=n!=null?n.concat([t]):null,hf(4,4,iw.bind(null,e,t),n)}function Ag(){}function lw(t,e){var n=sr();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&Ng(e,r[1])?r[0]:(n.memoizedState=[t,e],t)}function sw(t,e){var n=sr();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&Ng(e,r[1])?r[0]:(t=t(),n.memoizedState=[t,e],t)}function aw(t,e,n){return Zo&21?(br(n,e)||(n=d1(),ht.lanes|=n,Go|=n,t.baseState=!0),e):(t.baseState&&(t.baseState=!1,bn=!0),t.memoizedState=n)}function uT(t,e){var n=Ue;Ue=n!==0&&4>n?n:4,t(!0);var r=Ch.transition;Ch.transition={};try{t(!1),e()}finally{Ue=n,Ch.transition=r}}function uw(){return sr().memoizedState}function cT(t,e,n){var r=eo(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},cw(t))dw(e,n);else if(n=B1(t,e,n,r),n!==null){var i=vn();Er(n,t,r,i),fw(n,e,r)}}function dT(t,e,n){var r=eo(t),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(cw(t))dw(e,i);else{var o=t.alternate;if(t.lanes===0&&(o===null||o.lanes===0)&&(o=e.lastRenderedReducer,o!==null))try{var l=e.lastRenderedState,s=o(l,n);if(i.hasEagerState=!0,i.eagerState=s,br(s,l)){var a=e.interleaved;a===null?(i.next=i,Cg(e)):(i.next=a.next,a.next=i),e.interleaved=i;return}}catch{}finally{}n=B1(t,e,i,r),n!==null&&(i=vn(),Er(n,t,r,i),fw(n,e,r))}}function cw(t){var e=t.alternate;return t===ht||e!==null&&e===ht}function dw(t,e){Ea=pd=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function fw(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,cg(t,n)}}var md={readContext:lr,useCallback:Yt,useContext:Yt,useEffect:Yt,useImperativeHandle:Yt,useInsertionEffect:Yt,useLayoutEffect:Yt,useMemo:Yt,useReducer:Yt,useRef:Yt,useState:Yt,useDebugValue:Yt,useDeferredValue:Yt,useTransition:Yt,useMutableSource:Yt,useSyncExternalStore:Yt,useId:Yt,unstable_isNewReconciler:!1},fT={readContext:lr,useCallback:function(t,e){return Ar().memoizedState=[t,e===void 0?null:e],t},useContext:lr,useEffect:t0,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,Ic(4194308,4,iw.bind(null,e,t),n)},useLayoutEffect:function(t,e){return Ic(4194308,4,t,e)},useInsertionEffect:function(t,e){return Ic(4,2,t,e)},useMemo:function(t,e){var n=Ar();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=Ar();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=cT.bind(null,ht,t),[r.memoizedState,t]},useRef:function(t){var e=Ar();return t={current:t},e.memoizedState=t},useState:e0,useDebugValue:Ag,useDeferredValue:function(t){return Ar().memoizedState=t},useTransition:function(){var t=e0(!1),e=t[0];return t=uT.bind(null,t[1]),Ar().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=ht,i=Ar();if(ot){if(n===void 0)throw Error(U(407));n=n()}else{if(n=e(),Bt===null)throw Error(U(349));Zo&30||X1(r,e,n)}i.memoizedState=n;var o={value:n,getSnapshot:e};return i.queue=o,t0(Q1.bind(null,r,o,t),[t]),r.flags|=2048,tu(9,J1.bind(null,r,o,n,e),void 0,null),n},useId:function(){var t=Ar(),e=Bt.identifierPrefix;if(ot){var n=ui,r=ai;n=(r&~(1<<32-Sr(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=qa++,0<n&&(e+="H"+n.toString(32)),e+=":"}else n=aT++,e=":"+e+"r"+n.toString(32)+":";return t.memoizedState=e},unstable_isNewReconciler:!1},hT={readContext:lr,useCallback:lw,useContext:lr,useEffect:Pg,useImperativeHandle:ow,useInsertionEffect:nw,useLayoutEffect:rw,useMemo:sw,useReducer:kh,useRef:tw,useState:function(){return kh(eu)},useDebugValue:Ag,useDeferredValue:function(t){var e=sr();return aw(e,Rt.memoizedState,t)},useTransition:function(){var t=kh(eu)[0],e=sr().memoizedState;return[t,e]},useMutableSource:G1,useSyncExternalStore:Y1,useId:uw,unstable_isNewReconciler:!1},pT={readContext:lr,useCallback:lw,useContext:lr,useEffect:Pg,useImperativeHandle:ow,useInsertionEffect:nw,useLayoutEffect:rw,useMemo:sw,useReducer:bh,useRef:tw,useState:function(){return bh(eu)},useDebugValue:Ag,useDeferredValue:function(t){var e=sr();return Rt===null?e.memoizedState=t:aw(e,Rt.memoizedState,t)},useTransition:function(){var t=bh(eu)[0],e=sr().memoizedState;return[t,e]},useMutableSource:G1,useSyncExternalStore:Y1,useId:uw,unstable_isNewReconciler:!1};function cs(t,e){try{var n="",r=e;do n+=Ub(r),r=r.return;while(r);var i=n}catch(o){i=`
|
|
31
31
|
Error generating stack: `+o.message+`
|
|
32
|
-
`+o.stack}return{value:t,source:e,stack:i,digest:null}}function $h(t,e,n){return{value:t,source:null,stack:n??null,digest:e??null}}function Pp(t,e){try{console.error(e.value)}catch(n){setTimeout(function(){throw n})}}var mT=typeof WeakMap=="function"?WeakMap:Map;function hw(t,e,n){n=ci(-1,n),n.tag=3,n.payload={element:null};var r=e.value;return n.callback=function(){vd||(vd=!0,Up=r),Pp(t,e)},n}function pw(t,e,n){n=ci(-1,n),n.tag=3;var r=t.type.getDerivedStateFromError;if(typeof r=="function"){var i=e.value;n.payload=function(){return r(i)},n.callback=function(){Pp(t,e)}}var o=t.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){Pp(t,e),typeof r!="function"&&(qi===null?qi=new Set([this]):qi.add(this));var l=e.stack;this.componentDidCatch(e.value,{componentStack:l!==null?l:""})}),n}function n0(t,e,n){var r=t.pingCache;if(r===null){r=t.pingCache=new mT;var i=new Set;r.set(e,i)}else i=r.get(e),i===void 0&&(i=new Set,r.set(e,i));i.has(n)||(i.add(n),t=NT.bind(null,t,e,n),e.then(t,t))}function r0(t){do{var e;if((e=t.tag===13)&&(e=t.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return t;t=t.return}while(t!==null);return null}function i0(t,e,n,r,i){return t.mode&1?(t.flags|=65536,t.lanes=i,t):(t===e?t.flags|=65536:(t.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(e=ci(-1,1),e.tag=2,Qi(n,e,1))),n.lanes|=1),t)}var gT=_i.ReactCurrentOwner,bn=!1;function un(t,e,n,r){e.child=t===null?K1(e,null,n,r):ss(e,t.child,n,r)}function o0(t,e,n,r,i){n=n.render;var o=e.ref;return Xl(e,i),r=Rg(t,e,n,r,o,i),n=Og(),t!==null&&!bn?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,mi(t,e,i)):(ot&&n&&yg(e),e.flags|=1,un(t,e,r,i),e.child)}function l0(t,e,n,r,i){if(t===null){var o=n.type;return typeof o=="function"&&!Bg(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(e.tag=15,e.type=o,mw(t,e,o,r,i)):(t=Bc(n.type,null,r,e,e.mode,i),t.ref=e.ref,t.return=e,e.child=t)}if(o=t.child,!(t.lanes&i)){var l=o.memoizedProps;if(n=n.compare,n=n!==null?n:Za,n(l,r)&&t.ref===e.ref)return mi(t,e,i)}return e.flags|=1,t=to(o,r),t.ref=e.ref,t.return=e,e.child=t}function mw(t,e,n,r,i){if(t!==null){var o=t.memoizedProps;if(Za(o,r)&&t.ref===e.ref)if(bn=!1,e.pendingProps=r=o,(t.lanes&i)!==0)t.flags&131072&&(bn=!0);else return e.lanes=t.lanes,mi(t,e,i)}return Ap(t,e,n,r,i)}function gw(t,e,n){var r=e.pendingProps,i=r.children,o=t!==null?t.memoizedState:null;if(r.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},Xe(Fl,Dn),Dn|=n;else{if(!(n&1073741824))return t=o!==null?o.baseLanes|n:n,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,Xe(Fl,Dn),Dn|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,Xe(Fl,Dn),Dn|=r}else o!==null?(r=o.baseLanes|n,e.memoizedState=null):r=n,Xe(Fl,Dn),Dn|=r;return un(t,e,i,n),e.child}function vw(t,e){var n=e.ref;(t===null&&n!==null||t!==null&&t.ref!==n)&&(e.flags|=512,e.flags|=2097152)}function Ap(t,e,n,r,i){var o=Tn(n)?Ho:rn.current;return o=os(e,o),Xl(e,i),n=Rg(t,e,n,r,o,i),r=Og(),t!==null&&!bn?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,mi(t,e,i)):(ot&&r&&yg(e),e.flags|=1,un(t,e,n,i),e.child)}function s0(t,e,n,r,i){if(Tn(n)){var o=!0;sd(e)}else o=!1;if(Xl(e,i),e.stateNode===null)jc(t,e),V1(e,n,r),Op(e,n,r,i),r=!0;else if(t===null){var l=e.stateNode,s=e.memoizedProps;l.props=s;var a=l.context,u=n.contextType;typeof u=="object"&&u!==null?u=lr(u):(u=Tn(n)?Ho:rn.current,u=os(e,u));var c=n.getDerivedStateFromProps,d=typeof c=="function"||typeof l.getSnapshotBeforeUpdate=="function";d||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(s!==r||a!==u)&&Qy(e,l,r,u),ji=!1;var f=e.memoizedState;l.state=f,fd(e,r,l,i),a=e.memoizedState,s!==r||f!==a||$n.current||ji?(typeof c=="function"&&(Rp(e,n,c,r),a=e.memoizedState),(s=ji||Jy(e,n,s,r,f,a,u))?(d||typeof l.UNSAFE_componentWillMount!="function"&&typeof l.componentWillMount!="function"||(typeof l.componentWillMount=="function"&&l.componentWillMount(),typeof l.UNSAFE_componentWillMount=="function"&&l.UNSAFE_componentWillMount()),typeof l.componentDidMount=="function"&&(e.flags|=4194308)):(typeof l.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=r,e.memoizedState=a),l.props=r,l.state=a,l.context=u,r=s):(typeof l.componentDidMount=="function"&&(e.flags|=4194308),r=!1)}else{l=e.stateNode,U1(t,e),s=e.memoizedProps,u=e.type===e.elementType?s:gr(e.type,s),l.props=u,d=e.pendingProps,f=l.context,a=n.contextType,typeof a=="object"&&a!==null?a=lr(a):(a=Tn(n)?Ho:rn.current,a=os(e,a));var h=n.getDerivedStateFromProps;(c=typeof h=="function"||typeof l.getSnapshotBeforeUpdate=="function")||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(s!==d||f!==a)&&Qy(e,l,r,a),ji=!1,f=e.memoizedState,l.state=f,fd(e,r,l,i);var g=e.memoizedState;s!==d||f!==g||$n.current||ji?(typeof h=="function"&&(Rp(e,n,h,r),g=e.memoizedState),(u=ji||Jy(e,n,u,r,f,g,a)||!1)?(c||typeof l.UNSAFE_componentWillUpdate!="function"&&typeof l.componentWillUpdate!="function"||(typeof l.componentWillUpdate=="function"&&l.componentWillUpdate(r,g,a),typeof l.UNSAFE_componentWillUpdate=="function"&&l.UNSAFE_componentWillUpdate(r,g,a)),typeof l.componentDidUpdate=="function"&&(e.flags|=4),typeof l.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof l.componentDidUpdate!="function"||s===t.memoizedProps&&f===t.memoizedState||(e.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||s===t.memoizedProps&&f===t.memoizedState||(e.flags|=1024),e.memoizedProps=r,e.memoizedState=g),l.props=r,l.state=g,l.context=a,r=u):(typeof l.componentDidUpdate!="function"||s===t.memoizedProps&&f===t.memoizedState||(e.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||s===t.memoizedProps&&f===t.memoizedState||(e.flags|=1024),r=!1)}return Mp(t,e,n,r,o,i)}function Mp(t,e,n,r,i,o){vw(t,e);var l=(e.flags&128)!==0;if(!r&&!l)return i&&Ky(e,n,!1),mi(t,e,o);r=e.stateNode,gT.current=e;var s=l&&typeof n.getDerivedStateFromError!="function"?null:r.render();return e.flags|=1,t!==null&&l?(e.child=ss(e,t.child,null,o),e.child=ss(e,null,s,o)):un(t,e,s,o),e.memoizedState=r.state,i&&Ky(e,n,!0),e.child}function yw(t){var e=t.stateNode;e.pendingContext?Hy(t,e.pendingContext,e.pendingContext!==e.context):e.context&&Hy(t,e.context,!1),bg(t,e.containerInfo)}function a0(t,e,n,r,i){return ls(),_g(i),e.flags|=256,un(t,e,n,r),e.child}var Lp={dehydrated:null,treeContext:null,retryLane:0};function Dp(t){return{baseLanes:t,cachePool:null,transitions:null}}function xw(t,e,n){var r=e.pendingProps,i=dt.current,o=!1,l=(e.flags&128)!==0,s;if((s=l)||(s=t!==null&&t.memoizedState===null?!1:(i&2)!==0),s?(o=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(i|=1),Xe(dt,i&1),t===null)return Tp(e),t=e.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?(e.mode&1?t.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(l=r.children,t=r.fallback,o?(r=e.mode,o=e.child,l={mode:"hidden",children:l},!(r&1)&&o!==null?(o.childLanes=0,o.pendingProps=l):o=gf(l,r,0,null),t=jo(t,r,n,null),o.return=e,t.return=e,o.sibling=t,e.child=o,e.child.memoizedState=Dp(n),e.memoizedState=Lp,t):Mg(e,l));if(i=t.memoizedState,i!==null&&(s=i.dehydrated,s!==null))return vT(t,e,l,r,s,i,n);if(o){o=r.fallback,l=e.mode,i=t.child,s=i.sibling;var a={mode:"hidden",children:r.children};return!(l&1)&&e.child!==i?(r=e.child,r.childLanes=0,r.pendingProps=a,e.deletions=null):(r=to(i,a),r.subtreeFlags=i.subtreeFlags&14680064),s!==null?o=to(s,o):(o=jo(o,l,n,null),o.flags|=2),o.return=e,r.return=e,r.sibling=o,e.child=r,r=o,o=e.child,l=t.child.memoizedState,l=l===null?Dp(n):{baseLanes:l.baseLanes|n,cachePool:null,transitions:l.transitions},o.memoizedState=l,o.childLanes=t.childLanes&~n,e.memoizedState=Lp,r}return o=t.child,t=o.sibling,r=to(o,{mode:"visible",children:r.children}),!(e.mode&1)&&(r.lanes=n),r.return=e,r.sibling=null,t!==null&&(n=e.deletions,n===null?(e.deletions=[t],e.flags|=16):n.push(t)),e.child=r,e.memoizedState=null,r}function Mg(t,e){return e=gf({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function cc(t,e,n,r){return r!==null&&_g(r),ss(e,t.child,null,n),t=Mg(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function vT(t,e,n,r,i,o,l){if(n)return e.flags&256?(e.flags&=-257,r=$h(Error(U(422))),cc(t,e,l,r)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(o=r.fallback,i=e.mode,r=gf({mode:"visible",children:r.children},i,0,null),o=jo(o,i,l,null),o.flags|=2,r.return=e,o.return=e,r.sibling=o,e.child=r,e.mode&1&&ss(e,t.child,null,l),e.child.memoizedState=Dp(l),e.memoizedState=Lp,o);if(!(e.mode&1))return cc(t,e,l,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var s=r.dgst;return r=s,o=Error(U(419)),r=$h(o,r,void 0),cc(t,e,l,r)}if(s=(l&t.childLanes)!==0,bn||s){if(r=Bt,r!==null){switch(l&-l){case 4:i=2;break;case 16:i=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|l)?0:i,i!==0&&i!==o.retryLane&&(o.retryLane=i,pi(t,i),Er(r,t,i,-1))}return Fg(),r=$h(Error(U(421))),cc(t,e,l,r)}return i.data==="$?"?(e.flags|=128,e.child=t.child,e=RT.bind(null,t),i._reactRetry=e,null):(t=o.treeContext,zn=Ji(i.nextSibling),Fn=e,ot=!0,xr=null,t!==null&&(Qn[qn++]=ai,Qn[qn++]=ui,Qn[qn++]=Ko,ai=t.id,ui=t.overflow,Ko=e),e=Mg(e,r.children),e.flags|=4096,e)}function u0(t,e,n){t.lanes|=e;var r=t.alternate;r!==null&&(r.lanes|=e),Np(t.return,e,n)}function Th(t,e,n,r,i){var o=t.memoizedState;o===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(o.isBackwards=e,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i)}function _w(t,e,n){var r=e.pendingProps,i=r.revealOrder,o=r.tail;if(un(t,e,r.children,n),r=dt.current,r&2)r=r&1|2,e.flags|=128;else{if(t!==null&&t.flags&128)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&u0(t,n,e);else if(t.tag===19)u0(t,n,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}r&=1}if(Xe(dt,r),!(e.mode&1))e.memoizedState=null;else switch(i){case"forwards":for(n=e.child,i=null;n!==null;)t=n.alternate,t!==null&&hd(t)===null&&(i=n),n=n.sibling;n=i,n===null?(i=e.child,e.child=null):(i=n.sibling,n.sibling=null),Th(e,!1,i,n,o);break;case"backwards":for(n=null,i=e.child,e.child=null;i!==null;){if(t=i.alternate,t!==null&&hd(t)===null){e.child=i;break}t=i.sibling,i.sibling=n,n=i,i=t}Th(e,!0,n,null,o);break;case"together":Th(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function jc(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function mi(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),Go|=e.lanes,!(n&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(U(153));if(e.child!==null){for(t=e.child,n=to(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=to(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function yT(t,e,n){switch(e.tag){case 3:yw(e),ls();break;case 5:Z1(e);break;case 1:Tn(e.type)&&sd(e);break;case 4:bg(e,e.stateNode.containerInfo);break;case 10:var r=e.type._context,i=e.memoizedProps.value;Xe(cd,r._currentValue),r._currentValue=i;break;case 13:if(r=e.memoizedState,r!==null)return r.dehydrated!==null?(Xe(dt,dt.current&1),e.flags|=128,null):n&e.child.childLanes?xw(t,e,n):(Xe(dt,dt.current&1),t=mi(t,e,n),t!==null?t.sibling:null);Xe(dt,dt.current&1);break;case 19:if(r=(n&e.childLanes)!==0,t.flags&128){if(r)return _w(t,e,n);e.flags|=128}if(i=e.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Xe(dt,dt.current),r)break;return null;case 22:case 23:return e.lanes=0,gw(t,e,n)}return mi(t,e,n)}var ww,Ip,Sw,Ew;ww=function(t,e){for(var n=e.child;n!==null;){if(n.tag===5||n.tag===6)t.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Ip=function(){};Sw=function(t,e,n,r){var i=t.memoizedProps;if(i!==r){t=e.stateNode,Mo(Br.current);var o=null;switch(n){case"input":i=op(t,i),r=op(t,r),o=[];break;case"select":i=mt({},i,{value:void 0}),r=mt({},r,{value:void 0}),o=[];break;case"textarea":i=ap(t,i),r=ap(t,r),o=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(t.onclick=od)}cp(n,r);var l;n=null;for(u in i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var s=i[u];for(l in s)s.hasOwnProperty(l)&&(n||(n={}),n[l]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Fa.hasOwnProperty(u)?o||(o=[]):(o=o||[]).push(u,null));for(u in r){var a=r[u];if(s=i!=null?i[u]:void 0,r.hasOwnProperty(u)&&a!==s&&(a!=null||s!=null))if(u==="style")if(s){for(l in s)!s.hasOwnProperty(l)||a&&a.hasOwnProperty(l)||(n||(n={}),n[l]="");for(l in a)a.hasOwnProperty(l)&&s[l]!==a[l]&&(n||(n={}),n[l]=a[l])}else n||(o||(o=[]),o.push(u,n)),n=a;else u==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,s=s?s.__html:void 0,a!=null&&s!==a&&(o=o||[]).push(u,a)):u==="children"?typeof a!="string"&&typeof a!="number"||(o=o||[]).push(u,""+a):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Fa.hasOwnProperty(u)?(a!=null&&u==="onScroll"&&et("scroll",t),o||s===a||(o=[])):(o=o||[]).push(u,a))}n&&(o=o||[]).push("style",n);var u=o;(e.updateQueue=u)&&(e.flags|=4)}};Ew=function(t,e,n,r){n!==r&&(e.flags|=4)};function Js(t,e){if(!ot)switch(t.tailMode){case"hidden":e=t.tail;for(var n=null;e!==null;)e.alternate!==null&&(n=e),e=e.sibling;n===null?t.tail=null:n.sibling=null;break;case"collapsed":n=t.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:r.sibling=null}}function Xt(t){var e=t.alternate!==null&&t.alternate.child===t.child,n=0,r=0;if(e)for(var i=t.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=t,i=i.sibling;else for(i=t.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=t,i=i.sibling;return t.subtreeFlags|=r,t.childLanes=n,e}function xT(t,e,n){var r=e.pendingProps;switch(xg(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Xt(e),null;case 1:return Tn(e.type)&&ld(),Xt(e),null;case 3:return r=e.stateNode,as(),it($n),it(rn),Tg(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(t===null||t.child===null)&&(ac(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,xr!==null&&(Hp(xr),xr=null))),Ip(t,e),Xt(e),null;case 5:$g(e);var i=Mo(Qa.current);if(n=e.type,t!==null&&e.stateNode!=null)Sw(t,e,n,r,i),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!r){if(e.stateNode===null)throw Error(U(166));return Xt(e),null}if(t=Mo(Br.current),ac(e)){r=e.stateNode,n=e.type;var o=e.memoizedProps;switch(r[Lr]=e,r[Xa]=o,t=(e.mode&1)!==0,n){case"dialog":et("cancel",r),et("close",r);break;case"iframe":case"object":case"embed":et("load",r);break;case"video":case"audio":for(i=0;i<ha.length;i++)et(ha[i],r);break;case"source":et("error",r);break;case"img":case"image":case"link":et("error",r),et("load",r);break;case"details":et("toggle",r);break;case"input":yy(r,o),et("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!o.multiple},et("invalid",r);break;case"textarea":_y(r,o),et("invalid",r)}cp(n,o),i=null;for(var l in o)if(o.hasOwnProperty(l)){var s=o[l];l==="children"?typeof s=="string"?r.textContent!==s&&(o.suppressHydrationWarning!==!0&&sc(r.textContent,s,t),i=["children",s]):typeof s=="number"&&r.textContent!==""+s&&(o.suppressHydrationWarning!==!0&&sc(r.textContent,s,t),i=["children",""+s]):Fa.hasOwnProperty(l)&&s!=null&&l==="onScroll"&&et("scroll",r)}switch(n){case"input":qu(r),xy(r,o,!0);break;case"textarea":qu(r),wy(r);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(r.onclick=od)}r=i,e.updateQueue=r,r!==null&&(e.flags|=4)}else{l=i.nodeType===9?i:i.ownerDocument,t==="http://www.w3.org/1999/xhtml"&&(t=X_(n)),t==="http://www.w3.org/1999/xhtml"?n==="script"?(t=l.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=l.createElement(n,{is:r.is}):(t=l.createElement(n),n==="select"&&(l=t,r.multiple?l.multiple=!0:r.size&&(l.size=r.size))):t=l.createElementNS(t,n),t[Lr]=e,t[Xa]=r,ww(t,e,!1,!1),e.stateNode=t;e:{switch(l=dp(n,r),n){case"dialog":et("cancel",t),et("close",t),i=r;break;case"iframe":case"object":case"embed":et("load",t),i=r;break;case"video":case"audio":for(i=0;i<ha.length;i++)et(ha[i],t);i=r;break;case"source":et("error",t),i=r;break;case"img":case"image":case"link":et("error",t),et("load",t),i=r;break;case"details":et("toggle",t),i=r;break;case"input":yy(t,r),i=op(t,r),et("invalid",t);break;case"option":i=r;break;case"select":t._wrapperState={wasMultiple:!!r.multiple},i=mt({},r,{value:void 0}),et("invalid",t);break;case"textarea":_y(t,r),i=ap(t,r),et("invalid",t);break;default:i=r}cp(n,i),s=i;for(o in s)if(s.hasOwnProperty(o)){var a=s[o];o==="style"?q_(t,a):o==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,a!=null&&J_(t,a)):o==="children"?typeof a=="string"?(n!=="textarea"||a!=="")&&Ba(t,a):typeof a=="number"&&Ba(t,""+a):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(Fa.hasOwnProperty(o)?a!=null&&o==="onScroll"&&et("scroll",t):a!=null&&ig(t,o,a,l))}switch(n){case"input":qu(t),xy(t,r,!1);break;case"textarea":qu(t),wy(t);break;case"option":r.value!=null&&t.setAttribute("value",""+oo(r.value));break;case"select":t.multiple=!!r.multiple,o=r.value,o!=null?Kl(t,!!r.multiple,o,!1):r.defaultValue!=null&&Kl(t,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(t.onclick=od)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(e.flags|=4)}e.ref!==null&&(e.flags|=512,e.flags|=2097152)}return Xt(e),null;case 6:if(t&&e.stateNode!=null)Ew(t,e,t.memoizedProps,r);else{if(typeof r!="string"&&e.stateNode===null)throw Error(U(166));if(n=Mo(Qa.current),Mo(Br.current),ac(e)){if(r=e.stateNode,n=e.memoizedProps,r[Lr]=e,(o=r.nodeValue!==n)&&(t=Fn,t!==null))switch(t.tag){case 3:sc(r.nodeValue,n,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&sc(r.nodeValue,n,(t.mode&1)!==0)}o&&(e.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Lr]=e,e.stateNode=r}return Xt(e),null;case 13:if(it(dt),r=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(ot&&zn!==null&&e.mode&1&&!(e.flags&128))F1(),ls(),e.flags|=98560,o=!1;else if(o=ac(e),r!==null&&r.dehydrated!==null){if(t===null){if(!o)throw Error(U(318));if(o=e.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(U(317));o[Lr]=e}else ls(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;Xt(e),o=!1}else xr!==null&&(Hp(xr),xr=null),o=!0;if(!o)return e.flags&65536?e:null}return e.flags&128?(e.lanes=n,e):(r=r!==null,r!==(t!==null&&t.memoizedState!==null)&&r&&(e.child.flags|=8192,e.mode&1&&(t===null||dt.current&1?Pt===0&&(Pt=3):Fg())),e.updateQueue!==null&&(e.flags|=4),Xt(e),null);case 4:return as(),Ip(t,e),t===null&&Ga(e.stateNode.containerInfo),Xt(e),null;case 10:return Eg(e.type._context),Xt(e),null;case 17:return Tn(e.type)&&ld(),Xt(e),null;case 19:if(it(dt),o=e.memoizedState,o===null)return Xt(e),null;if(r=(e.flags&128)!==0,l=o.rendering,l===null)if(r)Js(o,!1);else{if(Pt!==0||t!==null&&t.flags&128)for(t=e.child;t!==null;){if(l=hd(t),l!==null){for(e.flags|=128,Js(o,!1),r=l.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),e.subtreeFlags=0,r=n,n=e.child;n!==null;)o=n,t=r,o.flags&=14680066,l=o.alternate,l===null?(o.childLanes=0,o.lanes=t,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=l.childLanes,o.lanes=l.lanes,o.child=l.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=l.memoizedProps,o.memoizedState=l.memoizedState,o.updateQueue=l.updateQueue,o.type=l.type,t=l.dependencies,o.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),n=n.sibling;return Xe(dt,dt.current&1|2),e.child}t=t.sibling}o.tail!==null&&Ct()>cs&&(e.flags|=128,r=!0,Js(o,!1),e.lanes=4194304)}else{if(!r)if(t=hd(l),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),Js(o,!0),o.tail===null&&o.tailMode==="hidden"&&!l.alternate&&!ot)return Xt(e),null}else 2*Ct()-o.renderingStartTime>cs&&n!==1073741824&&(e.flags|=128,r=!0,Js(o,!1),e.lanes=4194304);o.isBackwards?(l.sibling=e.child,e.child=l):(n=o.last,n!==null?n.sibling=l:e.child=l,o.last=l)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=Ct(),e.sibling=null,n=dt.current,Xe(dt,r?n&1|2:n&1),e):(Xt(e),null);case 22:case 23:return zg(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?Dn&1073741824&&(Xt(e),e.subtreeFlags&6&&(e.flags|=8192)):Xt(e),null;case 24:return null;case 25:return null}throw Error(U(156,e.tag))}function _T(t,e){switch(xg(e),e.tag){case 1:return Tn(e.type)&&ld(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return as(),it($n),it(rn),Tg(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return $g(e),null;case 13:if(it(dt),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(U(340));ls()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return it(dt),null;case 4:return as(),null;case 10:return Eg(e.type._context),null;case 22:case 23:return zg(),null;case 24:return null;default:return null}}var dc=!1,Qt=!1,wT=typeof WeakSet=="function"?WeakSet:Set,ee=null;function zl(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){vt(t,e,r)}else n.current=null}function jp(t,e,n){try{n()}catch(r){vt(t,e,r)}}var c0=!1;function ST(t,e){if(wp=nd,t=$1(),vg(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var l=0,s=-1,a=-1,u=0,c=0,d=t,f=null;t:for(;;){for(var h;d!==n||i!==0&&d.nodeType!==3||(s=l+i),d!==o||r!==0&&d.nodeType!==3||(a=l+r),d.nodeType===3&&(l+=d.nodeValue.length),(h=d.firstChild)!==null;)f=d,d=h;for(;;){if(d===t)break t;if(f===n&&++u===i&&(s=l),f===o&&++c===r&&(a=l),(h=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=h}n=s===-1||a===-1?null:{start:s,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(Sp={focusedElem:t,selectionRange:n},nd=!1,ee=e;ee!==null;)if(e=ee,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,ee=t;else for(;ee!==null;){e=ee;try{var g=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var m=g.memoizedProps,w=g.memoizedState,v=e.stateNode,y=v.getSnapshotBeforeUpdate(e.elementType===e.type?m:gr(e.type,m),w);v.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var _=e.stateNode.containerInfo;_.nodeType===1?_.textContent="":_.nodeType===9&&_.documentElement&&_.removeChild(_.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(U(163))}}catch(S){vt(e,e.return,S)}if(t=e.sibling,t!==null){t.return=e.return,ee=t;break}ee=e.return}return g=c0,c0=!1,g}function Ca(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&t)===t){var o=i.destroy;i.destroy=void 0,o!==void 0&&jp(e,n,o)}i=i.next}while(i!==r)}}function pf(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function zp(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function Cw(t){var e=t.alternate;e!==null&&(t.alternate=null,Cw(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[Lr],delete e[Xa],delete e[kp],delete e[iT],delete e[oT])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function kw(t){return t.tag===5||t.tag===3||t.tag===4}function d0(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||kw(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Fp(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=od));else if(r!==4&&(t=t.child,t!==null))for(Fp(t,e,n),t=t.sibling;t!==null;)Fp(t,e,n),t=t.sibling}function Bp(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(Bp(t,e,n),t=t.sibling;t!==null;)Bp(t,e,n),t=t.sibling}var Ht=null,vr=!1;function Ri(t,e,n){for(n=n.child;n!==null;)bw(t,e,n),n=n.sibling}function bw(t,e,n){if(Fr&&typeof Fr.onCommitFiberUnmount=="function")try{Fr.onCommitFiberUnmount(lf,n)}catch{}switch(n.tag){case 5:Qt||zl(n,e);case 6:var r=Ht,i=vr;Ht=null,Ri(t,e,n),Ht=r,vr=i,Ht!==null&&(vr?(t=Ht,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):Ht.removeChild(n.stateNode));break;case 18:Ht!==null&&(vr?(t=Ht,n=n.stateNode,t.nodeType===8?wh(t.parentNode,n):t.nodeType===1&&wh(t,n),Ha(t)):wh(Ht,n.stateNode));break;case 4:r=Ht,i=vr,Ht=n.stateNode.containerInfo,vr=!0,Ri(t,e,n),Ht=r,vr=i;break;case 0:case 11:case 14:case 15:if(!Qt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,l=o.destroy;o=o.tag,l!==void 0&&(o&2||o&4)&&jp(n,e,l),i=i.next}while(i!==r)}Ri(t,e,n);break;case 1:if(!Qt&&(zl(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){vt(n,e,s)}Ri(t,e,n);break;case 21:Ri(t,e,n);break;case 22:n.mode&1?(Qt=(r=Qt)||n.memoizedState!==null,Ri(t,e,n),Qt=r):Ri(t,e,n);break;default:Ri(t,e,n)}}function f0(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new wT),e.forEach(function(r){var i=OT.bind(null,t,r);n.has(r)||(n.add(r),r.then(i,i))})}}function fr(t,e){var n=e.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var o=t,l=e,s=l;e:for(;s!==null;){switch(s.tag){case 5:Ht=s.stateNode,vr=!1;break e;case 3:Ht=s.stateNode.containerInfo,vr=!0;break e;case 4:Ht=s.stateNode.containerInfo,vr=!0;break e}s=s.return}if(Ht===null)throw Error(U(160));bw(o,l,i),Ht=null,vr=!1;var a=i.alternate;a!==null&&(a.return=null),i.return=null}catch(u){vt(i,e,u)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)$w(e,t),e=e.sibling}function $w(t,e){var n=t.alternate,r=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(fr(e,t),Pr(t),r&4){try{Ca(3,t,t.return),pf(3,t)}catch(m){vt(t,t.return,m)}try{Ca(5,t,t.return)}catch(m){vt(t,t.return,m)}}break;case 1:fr(e,t),Pr(t),r&512&&n!==null&&zl(n,n.return);break;case 5:if(fr(e,t),Pr(t),r&512&&n!==null&&zl(n,n.return),t.flags&32){var i=t.stateNode;try{Ba(i,"")}catch(m){vt(t,t.return,m)}}if(r&4&&(i=t.stateNode,i!=null)){var o=t.memoizedProps,l=n!==null?n.memoizedProps:o,s=t.type,a=t.updateQueue;if(t.updateQueue=null,a!==null)try{s==="input"&&o.type==="radio"&&o.name!=null&&G_(i,o),dp(s,l);var u=dp(s,o);for(l=0;l<a.length;l+=2){var c=a[l],d=a[l+1];c==="style"?q_(i,d):c==="dangerouslySetInnerHTML"?J_(i,d):c==="children"?Ba(i,d):ig(i,c,d,u)}switch(s){case"input":lp(i,o);break;case"textarea":Y_(i,o);break;case"select":var f=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!o.multiple;var h=o.value;h!=null?Kl(i,!!o.multiple,h,!1):f!==!!o.multiple&&(o.defaultValue!=null?Kl(i,!!o.multiple,o.defaultValue,!0):Kl(i,!!o.multiple,o.multiple?[]:"",!1))}i[Xa]=o}catch(m){vt(t,t.return,m)}}break;case 6:if(fr(e,t),Pr(t),r&4){if(t.stateNode===null)throw Error(U(162));i=t.stateNode,o=t.memoizedProps;try{i.nodeValue=o}catch(m){vt(t,t.return,m)}}break;case 3:if(fr(e,t),Pr(t),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Ha(e.containerInfo)}catch(m){vt(t,t.return,m)}break;case 4:fr(e,t),Pr(t);break;case 13:fr(e,t),Pr(t),i=t.child,i.flags&8192&&(o=i.memoizedState!==null,i.stateNode.isHidden=o,!o||i.alternate!==null&&i.alternate.memoizedState!==null||(Ig=Ct())),r&4&&f0(t);break;case 22:if(c=n!==null&&n.memoizedState!==null,t.mode&1?(Qt=(u=Qt)||c,fr(e,t),Qt=u):fr(e,t),Pr(t),r&8192){if(u=t.memoizedState!==null,(t.stateNode.isHidden=u)&&!c&&t.mode&1)for(ee=t,c=t.child;c!==null;){for(d=ee=c;ee!==null;){switch(f=ee,h=f.child,f.tag){case 0:case 11:case 14:case 15:Ca(4,f,f.return);break;case 1:zl(f,f.return);var g=f.stateNode;if(typeof g.componentWillUnmount=="function"){r=f,n=f.return;try{e=r,g.props=e.memoizedProps,g.state=e.memoizedState,g.componentWillUnmount()}catch(m){vt(r,n,m)}}break;case 5:zl(f,f.return);break;case 22:if(f.memoizedState!==null){p0(d);continue}}h!==null?(h.return=f,ee=h):p0(d)}c=c.sibling}e:for(c=null,d=t;;){if(d.tag===5){if(c===null){c=d;try{i=d.stateNode,u?(o=i.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none"):(s=d.stateNode,a=d.memoizedProps.style,l=a!=null&&a.hasOwnProperty("display")?a.display:null,s.style.display=Q_("display",l))}catch(m){vt(t,t.return,m)}}}else if(d.tag===6){if(c===null)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(m){vt(t,t.return,m)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===t)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===t)break e;for(;d.sibling===null;){if(d.return===null||d.return===t)break e;c===d&&(c=null),d=d.return}c===d&&(c=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:fr(e,t),Pr(t),r&4&&f0(t);break;case 21:break;default:fr(e,t),Pr(t)}}function Pr(t){var e=t.flags;if(e&2){try{e:{for(var n=t.return;n!==null;){if(kw(n)){var r=n;break e}n=n.return}throw Error(U(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(Ba(i,""),r.flags&=-33);var o=d0(t);Bp(t,o,i);break;case 3:case 4:var l=r.stateNode.containerInfo,s=d0(t);Fp(t,s,l);break;default:throw Error(U(161))}}catch(a){vt(t,t.return,a)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function ET(t,e,n){ee=t,Tw(t)}function Tw(t,e,n){for(var r=(t.mode&1)!==0;ee!==null;){var i=ee,o=i.child;if(i.tag===22&&r){var l=i.memoizedState!==null||dc;if(!l){var s=i.alternate,a=s!==null&&s.memoizedState!==null||Qt;s=dc;var u=Qt;if(dc=l,(Qt=a)&&!u)for(ee=i;ee!==null;)l=ee,a=l.child,l.tag===22&&l.memoizedState!==null?m0(i):a!==null?(a.return=l,ee=a):m0(i);for(;o!==null;)ee=o,Tw(o),o=o.sibling;ee=i,dc=s,Qt=u}h0(t)}else i.subtreeFlags&8772&&o!==null?(o.return=i,ee=o):h0(t)}}function h0(t){for(;ee!==null;){var e=ee;if(e.flags&8772){var n=e.alternate;try{if(e.flags&8772)switch(e.tag){case 0:case 11:case 15:Qt||pf(5,e);break;case 1:var r=e.stateNode;if(e.flags&4&&!Qt)if(n===null)r.componentDidMount();else{var i=e.elementType===e.type?n.memoizedProps:gr(e.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var o=e.updateQueue;o!==null&&Xy(e,o,r);break;case 3:var l=e.updateQueue;if(l!==null){if(n=null,e.child!==null)switch(e.child.tag){case 5:n=e.child.stateNode;break;case 1:n=e.child.stateNode}Xy(e,l,n)}break;case 5:var s=e.stateNode;if(n===null&&e.flags&4){n=s;var a=e.memoizedProps;switch(e.type){case"button":case"input":case"select":case"textarea":a.autoFocus&&n.focus();break;case"img":a.src&&(n.src=a.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(e.memoizedState===null){var u=e.alternate;if(u!==null){var c=u.memoizedState;if(c!==null){var d=c.dehydrated;d!==null&&Ha(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(U(163))}Qt||e.flags&512&&zp(e)}catch(f){vt(e,e.return,f)}}if(e===t){ee=null;break}if(n=e.sibling,n!==null){n.return=e.return,ee=n;break}ee=e.return}}function p0(t){for(;ee!==null;){var e=ee;if(e===t){ee=null;break}var n=e.sibling;if(n!==null){n.return=e.return,ee=n;break}ee=e.return}}function m0(t){for(;ee!==null;){var e=ee;try{switch(e.tag){case 0:case 11:case 15:var n=e.return;try{pf(4,e)}catch(a){vt(e,n,a)}break;case 1:var r=e.stateNode;if(typeof r.componentDidMount=="function"){var i=e.return;try{r.componentDidMount()}catch(a){vt(e,i,a)}}var o=e.return;try{zp(e)}catch(a){vt(e,o,a)}break;case 5:var l=e.return;try{zp(e)}catch(a){vt(e,l,a)}}}catch(a){vt(e,e.return,a)}if(e===t){ee=null;break}var s=e.sibling;if(s!==null){s.return=e.return,ee=s;break}ee=e.return}}var CT=Math.ceil,gd=_i.ReactCurrentDispatcher,Lg=_i.ReactCurrentOwner,or=_i.ReactCurrentBatchConfig,Me=0,Bt=null,bt=null,Zt=0,Dn=0,Fl=_o(0),Pt=0,nu=null,Go=0,mf=0,Dg=0,ka=null,kn=null,Ig=0,cs=1/0,ni=null,vd=!1,Up=null,qi=null,fc=!1,Hi=null,yd=0,ba=0,Wp=null,zc=-1,Fc=0;function vn(){return Me&6?Ct():zc!==-1?zc:zc=Ct()}function eo(t){return t.mode&1?Me&2&&Zt!==0?Zt&-Zt:sT.transition!==null?(Fc===0&&(Fc=d1()),Fc):(t=Ue,t!==0||(t=window.event,t=t===void 0?16:y1(t.type)),t):1}function Er(t,e,n,r){if(50<ba)throw ba=0,Wp=null,Error(U(185));Au(t,n,r),(!(Me&2)||t!==Bt)&&(t===Bt&&(!(Me&2)&&(mf|=n),Pt===4&&Bi(t,Zt)),Nn(t,r),n===1&&Me===0&&!(e.mode&1)&&(cs=Ct()+500,df&&wo()))}function Nn(t,e){var n=t.callbackNode;s$(t,e);var r=td(t,t===Bt?Zt:0);if(r===0)n!==null&&Cy(n),t.callbackNode=null,t.callbackPriority=0;else if(e=r&-r,t.callbackPriority!==e){if(n!=null&&Cy(n),e===1)t.tag===0?lT(g0.bind(null,t)):I1(g0.bind(null,t)),nT(function(){!(Me&6)&&wo()}),n=null;else{switch(f1(r)){case 1:n=ug;break;case 4:n=u1;break;case 16:n=ed;break;case 536870912:n=c1;break;default:n=ed}n=Dw(n,Nw.bind(null,t))}t.callbackPriority=e,t.callbackNode=n}}function Nw(t,e){if(zc=-1,Fc=0,Me&6)throw Error(U(327));var n=t.callbackNode;if(Jl()&&t.callbackNode!==n)return null;var r=td(t,t===Bt?Zt:0);if(r===0)return null;if(r&30||r&t.expiredLanes||e)e=xd(t,r);else{e=r;var i=Me;Me|=2;var o=Ow();(Bt!==t||Zt!==e)&&(ni=null,cs=Ct()+500,Io(t,e));do try{$T();break}catch(s){Rw(t,s)}while(!0);Sg(),gd.current=o,Me=i,bt!==null?e=0:(Bt=null,Zt=0,e=Pt)}if(e!==0){if(e===2&&(i=gp(t),i!==0&&(r=i,e=Vp(t,i))),e===1)throw n=nu,Io(t,0),Bi(t,r),Nn(t,Ct()),n;if(e===6)Bi(t,r);else{if(i=t.current.alternate,!(r&30)&&!kT(i)&&(e=xd(t,r),e===2&&(o=gp(t),o!==0&&(r=o,e=Vp(t,o))),e===1))throw n=nu,Io(t,0),Bi(t,r),Nn(t,Ct()),n;switch(t.finishedWork=i,t.finishedLanes=r,e){case 0:case 1:throw Error(U(345));case 2:No(t,kn,ni);break;case 3:if(Bi(t,r),(r&130023424)===r&&(e=Ig+500-Ct(),10<e)){if(td(t,0)!==0)break;if(i=t.suspendedLanes,(i&r)!==r){vn(),t.pingedLanes|=t.suspendedLanes&i;break}t.timeoutHandle=Cp(No.bind(null,t,kn,ni),e);break}No(t,kn,ni);break;case 4:if(Bi(t,r),(r&4194240)===r)break;for(e=t.eventTimes,i=-1;0<r;){var l=31-Sr(r);o=1<<l,l=e[l],l>i&&(i=l),r&=~o}if(r=i,r=Ct()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*CT(r/1960))-r,10<r){t.timeoutHandle=Cp(No.bind(null,t,kn,ni),r);break}No(t,kn,ni);break;case 5:No(t,kn,ni);break;default:throw Error(U(329))}}}return Nn(t,Ct()),t.callbackNode===n?Nw.bind(null,t):null}function Vp(t,e){var n=ka;return t.current.memoizedState.isDehydrated&&(Io(t,e).flags|=256),t=xd(t,e),t!==2&&(e=kn,kn=n,e!==null&&Hp(e)),t}function Hp(t){kn===null?kn=t:kn.push.apply(kn,t)}function kT(t){for(var e=t;;){if(e.flags&16384){var n=e.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],o=i.getSnapshot;i=i.value;try{if(!br(o(),i))return!1}catch{return!1}}}if(n=e.child,e.subtreeFlags&16384&&n!==null)n.return=e,e=n;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function Bi(t,e){for(e&=~Dg,e&=~mf,t.suspendedLanes|=e,t.pingedLanes&=~e,t=t.expirationTimes;0<e;){var n=31-Sr(e),r=1<<n;t[n]=-1,e&=~r}}function g0(t){if(Me&6)throw Error(U(327));Jl();var e=td(t,0);if(!(e&1))return Nn(t,Ct()),null;var n=xd(t,e);if(t.tag!==0&&n===2){var r=gp(t);r!==0&&(e=r,n=Vp(t,r))}if(n===1)throw n=nu,Io(t,0),Bi(t,e),Nn(t,Ct()),n;if(n===6)throw Error(U(345));return t.finishedWork=t.current.alternate,t.finishedLanes=e,No(t,kn,ni),Nn(t,Ct()),null}function jg(t,e){var n=Me;Me|=1;try{return t(e)}finally{Me=n,Me===0&&(cs=Ct()+500,df&&wo())}}function Yo(t){Hi!==null&&Hi.tag===0&&!(Me&6)&&Jl();var e=Me;Me|=1;var n=or.transition,r=Ue;try{if(or.transition=null,Ue=1,t)return t()}finally{Ue=r,or.transition=n,Me=e,!(Me&6)&&wo()}}function zg(){Dn=Fl.current,it(Fl)}function Io(t,e){t.finishedWork=null,t.finishedLanes=0;var n=t.timeoutHandle;if(n!==-1&&(t.timeoutHandle=-1,tT(n)),bt!==null)for(n=bt.return;n!==null;){var r=n;switch(xg(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&ld();break;case 3:as(),it($n),it(rn),Tg();break;case 5:$g(r);break;case 4:as();break;case 13:it(dt);break;case 19:it(dt);break;case 10:Eg(r.type._context);break;case 22:case 23:zg()}n=n.return}if(Bt=t,bt=t=to(t.current,null),Zt=Dn=e,Pt=0,nu=null,Dg=mf=Go=0,kn=ka=null,Ao!==null){for(e=0;e<Ao.length;e++)if(n=Ao[e],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,o=n.pending;if(o!==null){var l=o.next;o.next=i,r.next=l}n.pending=r}Ao=null}return t}function Rw(t,e){do{var n=bt;try{if(Sg(),Dc.current=md,pd){for(var r=ht.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}pd=!1}if(Zo=0,Dt=Rt=ht=null,Ea=!1,qa=0,Lg.current=null,n===null||n.return===null){Pt=1,nu=e,bt=null;break}e:{var o=t,l=n.return,s=n,a=e;if(e=Zt,s.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){var u=a,c=s,d=c.tag;if(!(c.mode&1)&&(d===0||d===11||d===15)){var f=c.alternate;f?(c.updateQueue=f.updateQueue,c.memoizedState=f.memoizedState,c.lanes=f.lanes):(c.updateQueue=null,c.memoizedState=null)}var h=r0(l);if(h!==null){h.flags&=-257,i0(h,l,s,o,e),h.mode&1&&n0(o,u,e),e=h,a=u;var g=e.updateQueue;if(g===null){var m=new Set;m.add(a),e.updateQueue=m}else g.add(a);break e}else{if(!(e&1)){n0(o,u,e),Fg();break e}a=Error(U(426))}}else if(ot&&s.mode&1){var w=r0(l);if(w!==null){!(w.flags&65536)&&(w.flags|=256),i0(w,l,s,o,e),_g(us(a,s));break e}}o=a=us(a,s),Pt!==4&&(Pt=2),ka===null?ka=[o]:ka.push(o),o=l;do{switch(o.tag){case 3:o.flags|=65536,e&=-e,o.lanes|=e;var v=hw(o,a,e);Yy(o,v);break e;case 1:s=a;var y=o.type,_=o.stateNode;if(!(o.flags&128)&&(typeof y.getDerivedStateFromError=="function"||_!==null&&typeof _.componentDidCatch=="function"&&(qi===null||!qi.has(_)))){o.flags|=65536,e&=-e,o.lanes|=e;var S=pw(o,s,e);Yy(o,S);break e}}o=o.return}while(o!==null)}Aw(n)}catch(E){e=E,bt===n&&n!==null&&(bt=n=n.return);continue}break}while(!0)}function Ow(){var t=gd.current;return gd.current=md,t===null?md:t}function Fg(){(Pt===0||Pt===3||Pt===2)&&(Pt=4),Bt===null||!(Go&268435455)&&!(mf&268435455)||Bi(Bt,Zt)}function xd(t,e){var n=Me;Me|=2;var r=Ow();(Bt!==t||Zt!==e)&&(ni=null,Io(t,e));do try{bT();break}catch(i){Rw(t,i)}while(!0);if(Sg(),Me=n,gd.current=r,bt!==null)throw Error(U(261));return Bt=null,Zt=0,Pt}function bT(){for(;bt!==null;)Pw(bt)}function $T(){for(;bt!==null&&!Qb();)Pw(bt)}function Pw(t){var e=Lw(t.alternate,t,Dn);t.memoizedProps=t.pendingProps,e===null?Aw(t):bt=e,Lg.current=null}function Aw(t){var e=t;do{var n=e.alternate;if(t=e.return,e.flags&32768){if(n=_T(n,e),n!==null){n.flags&=32767,bt=n;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{Pt=6,bt=null;return}}else if(n=xT(n,e,Dn),n!==null){bt=n;return}if(e=e.sibling,e!==null){bt=e;return}bt=e=t}while(e!==null);Pt===0&&(Pt=5)}function No(t,e,n){var r=Ue,i=or.transition;try{or.transition=null,Ue=1,TT(t,e,n,r)}finally{or.transition=i,Ue=r}return null}function TT(t,e,n,r){do Jl();while(Hi!==null);if(Me&6)throw Error(U(327));n=t.finishedWork;var i=t.finishedLanes;if(n===null)return null;if(t.finishedWork=null,t.finishedLanes=0,n===t.current)throw Error(U(177));t.callbackNode=null,t.callbackPriority=0;var o=n.lanes|n.childLanes;if(a$(t,o),t===Bt&&(bt=Bt=null,Zt=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||fc||(fc=!0,Dw(ed,function(){return Jl(),null})),o=(n.flags&15990)!==0,n.subtreeFlags&15990||o){o=or.transition,or.transition=null;var l=Ue;Ue=1;var s=Me;Me|=4,Lg.current=null,ST(t,n),$w(n,t),G$(Sp),nd=!!wp,Sp=wp=null,t.current=n,ET(n),qb(),Me=s,Ue=l,or.transition=o}else t.current=n;if(fc&&(fc=!1,Hi=t,yd=i),o=t.pendingLanes,o===0&&(qi=null),n$(n.stateNode),Nn(t,Ct()),e!==null)for(r=t.onRecoverableError,n=0;n<e.length;n++)i=e[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(vd)throw vd=!1,t=Up,Up=null,t;return yd&1&&t.tag!==0&&Jl(),o=t.pendingLanes,o&1?t===Wp?ba++:(ba=0,Wp=t):ba=0,wo(),null}function Jl(){if(Hi!==null){var t=f1(yd),e=or.transition,n=Ue;try{if(or.transition=null,Ue=16>t?16:t,Hi===null)var r=!1;else{if(t=Hi,Hi=null,yd=0,Me&6)throw Error(U(331));var i=Me;for(Me|=4,ee=t.current;ee!==null;){var o=ee,l=o.child;if(ee.flags&16){var s=o.deletions;if(s!==null){for(var a=0;a<s.length;a++){var u=s[a];for(ee=u;ee!==null;){var c=ee;switch(c.tag){case 0:case 11:case 15:Ca(8,c,o)}var d=c.child;if(d!==null)d.return=c,ee=d;else for(;ee!==null;){c=ee;var f=c.sibling,h=c.return;if(Cw(c),c===u){ee=null;break}if(f!==null){f.return=h,ee=f;break}ee=h}}}var g=o.alternate;if(g!==null){var m=g.child;if(m!==null){g.child=null;do{var w=m.sibling;m.sibling=null,m=w}while(m!==null)}}ee=o}}if(o.subtreeFlags&2064&&l!==null)l.return=o,ee=l;else e:for(;ee!==null;){if(o=ee,o.flags&2048)switch(o.tag){case 0:case 11:case 15:Ca(9,o,o.return)}var v=o.sibling;if(v!==null){v.return=o.return,ee=v;break e}ee=o.return}}var y=t.current;for(ee=y;ee!==null;){l=ee;var _=l.child;if(l.subtreeFlags&2064&&_!==null)_.return=l,ee=_;else e:for(l=y;ee!==null;){if(s=ee,s.flags&2048)try{switch(s.tag){case 0:case 11:case 15:pf(9,s)}}catch(E){vt(s,s.return,E)}if(s===l){ee=null;break e}var S=s.sibling;if(S!==null){S.return=s.return,ee=S;break e}ee=s.return}}if(Me=i,wo(),Fr&&typeof Fr.onPostCommitFiberRoot=="function")try{Fr.onPostCommitFiberRoot(lf,t)}catch{}r=!0}return r}finally{Ue=n,or.transition=e}}return!1}function v0(t,e,n){e=us(n,e),e=hw(t,e,1),t=Qi(t,e,1),e=vn(),t!==null&&(Au(t,1,e),Nn(t,e))}function vt(t,e,n){if(t.tag===3)v0(t,t,n);else for(;e!==null;){if(e.tag===3){v0(e,t,n);break}else if(e.tag===1){var r=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(qi===null||!qi.has(r))){t=us(n,t),t=pw(e,t,1),e=Qi(e,t,1),t=vn(),e!==null&&(Au(e,1,t),Nn(e,t));break}}e=e.return}}function NT(t,e,n){var r=t.pingCache;r!==null&&r.delete(e),e=vn(),t.pingedLanes|=t.suspendedLanes&n,Bt===t&&(Zt&n)===n&&(Pt===4||Pt===3&&(Zt&130023424)===Zt&&500>Ct()-Ig?Io(t,0):Dg|=n),Nn(t,e)}function Mw(t,e){e===0&&(t.mode&1?(e=nc,nc<<=1,!(nc&130023424)&&(nc=4194304)):e=1);var n=vn();t=pi(t,e),t!==null&&(Au(t,e,n),Nn(t,n))}function RT(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),Mw(t,n)}function OT(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,i=t.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(U(314))}r!==null&&r.delete(e),Mw(t,n)}var Lw;Lw=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||$n.current)bn=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return bn=!1,yT(t,e,n);bn=!!(t.flags&131072)}else bn=!1,ot&&e.flags&1048576&&j1(e,ud,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;jc(t,e),t=e.pendingProps;var i=os(e,rn.current);Xl(e,n),i=Rg(null,e,r,t,i,n);var o=Og();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,Tn(r)?(o=!0,sd(e)):o=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,kg(e),i.updater=ff,e.stateNode=i,i._reactInternals=e,Op(e,r,t,n),e=Mp(null,e,r,!0,o,n)):(e.tag=0,ot&&o&&yg(e),un(null,e,i,n),e=e.child),e;case 16:r=e.elementType;e:{switch(jc(t,e),t=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=AT(r),t=gr(r,t),i){case 0:e=Ap(null,e,r,t,n);break e;case 1:e=s0(null,e,r,t,n);break e;case 11:e=o0(null,e,r,t,n);break e;case 14:e=l0(null,e,r,gr(r.type,t),n);break e}throw Error(U(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:gr(r,i),Ap(t,e,r,i,n);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:gr(r,i),s0(t,e,r,i,n);case 3:e:{if(yw(e),t===null)throw Error(U(387));r=e.pendingProps,o=e.memoizedState,i=o.element,U1(t,e),fd(e,r,null,n);var l=e.memoizedState;if(r=l.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:l.cache,pendingSuspenseBoundaries:l.pendingSuspenseBoundaries,transitions:l.transitions},e.updateQueue.baseState=o,e.memoizedState=o,e.flags&256){i=us(Error(U(423)),e),e=a0(t,e,r,n,i);break e}else if(r!==i){i=us(Error(U(424)),e),e=a0(t,e,r,n,i);break e}else for(zn=Ji(e.stateNode.containerInfo.firstChild),Fn=e,ot=!0,xr=null,n=K1(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ls(),r===i){e=mi(t,e,n);break e}un(t,e,r,n)}e=e.child}return e;case 5:return Z1(e),t===null&&Tp(e),r=e.type,i=e.pendingProps,o=t!==null?t.memoizedProps:null,l=i.children,Ep(r,i)?l=null:o!==null&&Ep(r,o)&&(e.flags|=32),vw(t,e),un(t,e,l,n),e.child;case 6:return t===null&&Tp(e),null;case 13:return xw(t,e,n);case 4:return bg(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=ss(e,null,r,n):un(t,e,r,n),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:gr(r,i),o0(t,e,r,i,n);case 7:return un(t,e,e.pendingProps,n),e.child;case 8:return un(t,e,e.pendingProps.children,n),e.child;case 12:return un(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,i=e.pendingProps,o=e.memoizedProps,l=i.value,Xe(cd,r._currentValue),r._currentValue=l,o!==null)if(br(o.value,l)){if(o.children===i.children&&!$n.current){e=mi(t,e,n);break e}}else for(o=e.child,o!==null&&(o.return=e);o!==null;){var s=o.dependencies;if(s!==null){l=o.child;for(var a=s.firstContext;a!==null;){if(a.context===r){if(o.tag===1){a=ci(-1,n&-n),a.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?a.next=a:(a.next=c.next,c.next=a),u.pending=a}}o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),Np(o.return,n,e),s.lanes|=n;break}a=a.next}}else if(o.tag===10)l=o.type===e.type?null:o.child;else if(o.tag===18){if(l=o.return,l===null)throw Error(U(341));l.lanes|=n,s=l.alternate,s!==null&&(s.lanes|=n),Np(l,n,e),l=o.sibling}else l=o.child;if(l!==null)l.return=o;else for(l=o;l!==null;){if(l===e){l=null;break}if(o=l.sibling,o!==null){o.return=l.return,l=o;break}l=l.return}o=l}un(t,e,i.children,n),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,Xl(e,n),i=lr(i),r=r(i),e.flags|=1,un(t,e,r,n),e.child;case 14:return r=e.type,i=gr(r,e.pendingProps),i=gr(r.type,i),l0(t,e,r,i,n);case 15:return mw(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:gr(r,i),jc(t,e),e.tag=1,Tn(r)?(t=!0,sd(e)):t=!1,Xl(e,n),V1(e,r,i),Op(e,r,i,n),Mp(null,e,r,!0,t,n);case 19:return _w(t,e,n);case 22:return gw(t,e,n)}throw Error(U(156,e.tag))};function Dw(t,e){return a1(t,e)}function PT(t,e,n,r){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function nr(t,e,n,r){return new PT(t,e,n,r)}function Bg(t){return t=t.prototype,!(!t||!t.isReactComponent)}function AT(t){if(typeof t=="function")return Bg(t)?1:0;if(t!=null){if(t=t.$$typeof,t===lg)return 11;if(t===sg)return 14}return 2}function to(t,e){var n=t.alternate;return n===null?(n=nr(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function Bc(t,e,n,r,i,o){var l=2;if(r=t,typeof t=="function")Bg(t)&&(l=1);else if(typeof t=="string")l=5;else e:switch(t){case Rl:return jo(n.children,i,o,e);case og:l=8,i|=8;break;case tp:return t=nr(12,n,e,i|2),t.elementType=tp,t.lanes=o,t;case np:return t=nr(13,n,e,i),t.elementType=np,t.lanes=o,t;case rp:return t=nr(19,n,e,i),t.elementType=rp,t.lanes=o,t;case H_:return gf(n,i,o,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case W_:l=10;break e;case V_:l=9;break e;case lg:l=11;break e;case sg:l=14;break e;case Ii:l=16,r=null;break e}throw Error(U(130,t==null?t:typeof t,""))}return e=nr(l,n,e,i),e.elementType=t,e.type=r,e.lanes=o,e}function jo(t,e,n,r){return t=nr(7,t,r,e),t.lanes=n,t}function gf(t,e,n,r){return t=nr(22,t,r,e),t.elementType=H_,t.lanes=n,t.stateNode={isHidden:!1},t}function Nh(t,e,n){return t=nr(6,t,null,e),t.lanes=n,t}function Rh(t,e,n){return e=nr(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function MT(t,e,n,r,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ch(0),this.expirationTimes=ch(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ch(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Ug(t,e,n,r,i,o,l,s,a){return t=new MT(t,e,n,s,a),e===1?(e=1,o===!0&&(e|=8)):e=0,o=nr(3,null,null,e),t.current=o,o.stateNode=t,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},kg(o),t}function LT(t,e,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Nl,key:r==null?null:""+r,children:t,containerInfo:e,implementation:n}}function Iw(t){if(!t)return lo;t=t._reactInternals;e:{if(sl(t)!==t||t.tag!==1)throw Error(U(170));var e=t;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(Tn(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(U(171))}if(t.tag===1){var n=t.type;if(Tn(n))return D1(t,n,e)}return e}function jw(t,e,n,r,i,o,l,s,a){return t=Ug(n,r,!0,t,i,o,l,s,a),t.context=Iw(null),n=t.current,r=vn(),i=eo(n),o=ci(r,i),o.callback=e??null,Qi(n,o,i),t.current.lanes=i,Au(t,i,r),Nn(t,r),t}function vf(t,e,n,r){var i=e.current,o=vn(),l=eo(i);return n=Iw(n),e.context===null?e.context=n:e.pendingContext=n,e=ci(o,l),e.payload={element:t},r=r===void 0?null:r,r!==null&&(e.callback=r),t=Qi(i,e,l),t!==null&&(Er(t,i,l,o),Lc(t,i,l)),l}function _d(t){if(t=t.current,!t.child)return null;switch(t.child.tag){case 5:return t.child.stateNode;default:return t.child.stateNode}}function y0(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<e?n:e}}function Wg(t,e){y0(t,e),(t=t.alternate)&&y0(t,e)}function DT(){return null}var zw=typeof reportError=="function"?reportError:function(t){console.error(t)};function Vg(t){this._internalRoot=t}yf.prototype.render=Vg.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(U(409));vf(t,e,null,null)};yf.prototype.unmount=Vg.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;Yo(function(){vf(null,t,null,null)}),e[hi]=null}};function yf(t){this._internalRoot=t}yf.prototype.unstable_scheduleHydration=function(t){if(t){var e=m1();t={blockedOn:null,target:t,priority:e};for(var n=0;n<Fi.length&&e!==0&&e<Fi[n].priority;n++);Fi.splice(n,0,t),n===0&&v1(t)}};function Hg(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function xf(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function x0(){}function IT(t,e,n,r,i){if(i){if(typeof r=="function"){var o=r;r=function(){var u=_d(l);o.call(u)}}var l=jw(e,r,t,0,null,!1,!1,"",x0);return t._reactRootContainer=l,t[hi]=l.current,Ga(t.nodeType===8?t.parentNode:t),Yo(),l}for(;i=t.lastChild;)t.removeChild(i);if(typeof r=="function"){var s=r;r=function(){var u=_d(a);s.call(u)}}var a=Ug(t,0,!1,null,null,!1,!1,"",x0);return t._reactRootContainer=a,t[hi]=a.current,Ga(t.nodeType===8?t.parentNode:t),Yo(function(){vf(e,a,n,r)}),a}function _f(t,e,n,r,i){var o=n._reactRootContainer;if(o){var l=o;if(typeof i=="function"){var s=i;i=function(){var a=_d(l);s.call(a)}}vf(e,l,t,i)}else l=IT(n,e,t,i,r);return _d(l)}h1=function(t){switch(t.tag){case 3:var e=t.stateNode;if(e.current.memoizedState.isDehydrated){var n=fa(e.pendingLanes);n!==0&&(cg(e,n|1),Nn(e,Ct()),!(Me&6)&&(cs=Ct()+500,wo()))}break;case 13:Yo(function(){var r=pi(t,1);if(r!==null){var i=vn();Er(r,t,1,i)}}),Wg(t,1)}};dg=function(t){if(t.tag===13){var e=pi(t,134217728);if(e!==null){var n=vn();Er(e,t,134217728,n)}Wg(t,134217728)}};p1=function(t){if(t.tag===13){var e=eo(t),n=pi(t,e);if(n!==null){var r=vn();Er(n,t,e,r)}Wg(t,e)}};m1=function(){return Ue};g1=function(t,e){var n=Ue;try{return Ue=t,e()}finally{Ue=n}};hp=function(t,e,n){switch(e){case"input":if(lp(t,n),e=n.name,n.type==="radio"&&e!=null){for(n=t;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+e)+'][type="radio"]'),e=0;e<n.length;e++){var r=n[e];if(r!==t&&r.form===t.form){var i=cf(r);if(!i)throw Error(U(90));Z_(r),lp(r,i)}}}break;case"textarea":Y_(t,n);break;case"select":e=n.value,e!=null&&Kl(t,!!n.multiple,e,!1)}};n1=jg;r1=Yo;var jT={usingClientEntryPoint:!1,Events:[Lu,Ml,cf,e1,t1,jg]},Qs={findFiberByHostInstance:Po,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},zT={bundleType:Qs.bundleType,version:Qs.version,rendererPackageName:Qs.rendererPackageName,rendererConfig:Qs.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:_i.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=l1(t),t===null?null:t.stateNode},findFiberByHostInstance:Qs.findFiberByHostInstance||DT,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var hc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!hc.isDisabled&&hc.supportsFiber)try{lf=hc.inject(zT),Fr=hc}catch{}}Kn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=jT;Kn.createPortal=function(t,e){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Hg(e))throw Error(U(200));return LT(t,e,null,n)};Kn.createRoot=function(t,e){if(!Hg(t))throw Error(U(299));var n=!1,r="",i=zw;return e!=null&&(e.unstable_strictMode===!0&&(n=!0),e.identifierPrefix!==void 0&&(r=e.identifierPrefix),e.onRecoverableError!==void 0&&(i=e.onRecoverableError)),e=Ug(t,1,!1,null,null,n,!1,r,i),t[hi]=e.current,Ga(t.nodeType===8?t.parentNode:t),new Vg(e)};Kn.findDOMNode=function(t){if(t==null)return null;if(t.nodeType===1)return t;var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(U(188)):(t=Object.keys(t).join(","),Error(U(268,t)));return t=l1(e),t=t===null?null:t.stateNode,t};Kn.flushSync=function(t){return Yo(t)};Kn.hydrate=function(t,e,n){if(!xf(e))throw Error(U(200));return _f(null,t,e,!0,n)};Kn.hydrateRoot=function(t,e,n){if(!Hg(t))throw Error(U(405));var r=n!=null&&n.hydratedSources||null,i=!1,o="",l=zw;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(l=n.onRecoverableError)),e=jw(e,null,t,1,n??null,i,!1,o,l),t[hi]=e.current,Ga(t),r)for(t=0;t<r.length;t++)n=r[t],i=n._getVersion,i=i(n._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[n,i]:e.mutableSourceEagerHydrationData.push(n,i);return new yf(e)};Kn.render=function(t,e,n){if(!xf(e))throw Error(U(200));return _f(null,t,e,!1,n)};Kn.unmountComponentAtNode=function(t){if(!xf(t))throw Error(U(40));return t._reactRootContainer?(Yo(function(){_f(null,null,t,!1,function(){t._reactRootContainer=null,t[hi]=null})}),!0):!1};Kn.unstable_batchedUpdates=jg;Kn.unstable_renderSubtreeIntoContainer=function(t,e,n,r){if(!xf(n))throw Error(U(200));if(t==null||t._reactInternals===void 0)throw Error(U(38));return _f(t,e,n,!1,r)};Kn.version="18.2.0-next-9e3b772b8-20220608";function Fw(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Fw)}catch(t){console.error(t)}}Fw(),j_.exports=Kn;var Yr=j_.exports;const Bw=Ou(Yr),FT=T_({__proto__:null,default:Bw},[Yr]);var _0=Yr;qh.createRoot=_0.createRoot,qh.hydrateRoot=_0.hydrateRoot;var Uw={exports:{}},wf={};/**
|
|
32
|
+
`+o.stack}return{value:t,source:e,stack:i,digest:null}}function $h(t,e,n){return{value:t,source:null,stack:n??null,digest:e??null}}function Pp(t,e){try{console.error(e.value)}catch(n){setTimeout(function(){throw n})}}var mT=typeof WeakMap=="function"?WeakMap:Map;function hw(t,e,n){n=ci(-1,n),n.tag=3,n.payload={element:null};var r=e.value;return n.callback=function(){vd||(vd=!0,Up=r),Pp(t,e)},n}function pw(t,e,n){n=ci(-1,n),n.tag=3;var r=t.type.getDerivedStateFromError;if(typeof r=="function"){var i=e.value;n.payload=function(){return r(i)},n.callback=function(){Pp(t,e)}}var o=t.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){Pp(t,e),typeof r!="function"&&(qi===null?qi=new Set([this]):qi.add(this));var l=e.stack;this.componentDidCatch(e.value,{componentStack:l!==null?l:""})}),n}function n0(t,e,n){var r=t.pingCache;if(r===null){r=t.pingCache=new mT;var i=new Set;r.set(e,i)}else i=r.get(e),i===void 0&&(i=new Set,r.set(e,i));i.has(n)||(i.add(n),t=NT.bind(null,t,e,n),e.then(t,t))}function r0(t){do{var e;if((e=t.tag===13)&&(e=t.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return t;t=t.return}while(t!==null);return null}function i0(t,e,n,r,i){return t.mode&1?(t.flags|=65536,t.lanes=i,t):(t===e?t.flags|=65536:(t.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(e=ci(-1,1),e.tag=2,Qi(n,e,1))),n.lanes|=1),t)}var gT=_i.ReactCurrentOwner,bn=!1;function un(t,e,n,r){e.child=t===null?K1(e,null,n,r):as(e,t.child,n,r)}function o0(t,e,n,r,i){n=n.render;var o=e.ref;return Jl(e,i),r=Rg(t,e,n,r,o,i),n=Og(),t!==null&&!bn?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,mi(t,e,i)):(ot&&n&&yg(e),e.flags|=1,un(t,e,r,i),e.child)}function l0(t,e,n,r,i){if(t===null){var o=n.type;return typeof o=="function"&&!Bg(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(e.tag=15,e.type=o,mw(t,e,o,r,i)):(t=Bc(n.type,null,r,e,e.mode,i),t.ref=e.ref,t.return=e,e.child=t)}if(o=t.child,!(t.lanes&i)){var l=o.memoizedProps;if(n=n.compare,n=n!==null?n:Za,n(l,r)&&t.ref===e.ref)return mi(t,e,i)}return e.flags|=1,t=to(o,r),t.ref=e.ref,t.return=e,e.child=t}function mw(t,e,n,r,i){if(t!==null){var o=t.memoizedProps;if(Za(o,r)&&t.ref===e.ref)if(bn=!1,e.pendingProps=r=o,(t.lanes&i)!==0)t.flags&131072&&(bn=!0);else return e.lanes=t.lanes,mi(t,e,i)}return Ap(t,e,n,r,i)}function gw(t,e,n){var r=e.pendingProps,i=r.children,o=t!==null?t.memoizedState:null;if(r.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},Xe(Bl,Dn),Dn|=n;else{if(!(n&1073741824))return t=o!==null?o.baseLanes|n:n,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,Xe(Bl,Dn),Dn|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,Xe(Bl,Dn),Dn|=r}else o!==null?(r=o.baseLanes|n,e.memoizedState=null):r=n,Xe(Bl,Dn),Dn|=r;return un(t,e,i,n),e.child}function vw(t,e){var n=e.ref;(t===null&&n!==null||t!==null&&t.ref!==n)&&(e.flags|=512,e.flags|=2097152)}function Ap(t,e,n,r,i){var o=Tn(n)?Ho:rn.current;return o=ls(e,o),Jl(e,i),n=Rg(t,e,n,r,o,i),r=Og(),t!==null&&!bn?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,mi(t,e,i)):(ot&&r&&yg(e),e.flags|=1,un(t,e,n,i),e.child)}function s0(t,e,n,r,i){if(Tn(n)){var o=!0;sd(e)}else o=!1;if(Jl(e,i),e.stateNode===null)jc(t,e),V1(e,n,r),Op(e,n,r,i),r=!0;else if(t===null){var l=e.stateNode,s=e.memoizedProps;l.props=s;var a=l.context,u=n.contextType;typeof u=="object"&&u!==null?u=lr(u):(u=Tn(n)?Ho:rn.current,u=ls(e,u));var c=n.getDerivedStateFromProps,d=typeof c=="function"||typeof l.getSnapshotBeforeUpdate=="function";d||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(s!==r||a!==u)&&Qy(e,l,r,u),ji=!1;var f=e.memoizedState;l.state=f,fd(e,r,l,i),a=e.memoizedState,s!==r||f!==a||$n.current||ji?(typeof c=="function"&&(Rp(e,n,c,r),a=e.memoizedState),(s=ji||Jy(e,n,s,r,f,a,u))?(d||typeof l.UNSAFE_componentWillMount!="function"&&typeof l.componentWillMount!="function"||(typeof l.componentWillMount=="function"&&l.componentWillMount(),typeof l.UNSAFE_componentWillMount=="function"&&l.UNSAFE_componentWillMount()),typeof l.componentDidMount=="function"&&(e.flags|=4194308)):(typeof l.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=r,e.memoizedState=a),l.props=r,l.state=a,l.context=u,r=s):(typeof l.componentDidMount=="function"&&(e.flags|=4194308),r=!1)}else{l=e.stateNode,U1(t,e),s=e.memoizedProps,u=e.type===e.elementType?s:gr(e.type,s),l.props=u,d=e.pendingProps,f=l.context,a=n.contextType,typeof a=="object"&&a!==null?a=lr(a):(a=Tn(n)?Ho:rn.current,a=ls(e,a));var h=n.getDerivedStateFromProps;(c=typeof h=="function"||typeof l.getSnapshotBeforeUpdate=="function")||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(s!==d||f!==a)&&Qy(e,l,r,a),ji=!1,f=e.memoizedState,l.state=f,fd(e,r,l,i);var g=e.memoizedState;s!==d||f!==g||$n.current||ji?(typeof h=="function"&&(Rp(e,n,h,r),g=e.memoizedState),(u=ji||Jy(e,n,u,r,f,g,a)||!1)?(c||typeof l.UNSAFE_componentWillUpdate!="function"&&typeof l.componentWillUpdate!="function"||(typeof l.componentWillUpdate=="function"&&l.componentWillUpdate(r,g,a),typeof l.UNSAFE_componentWillUpdate=="function"&&l.UNSAFE_componentWillUpdate(r,g,a)),typeof l.componentDidUpdate=="function"&&(e.flags|=4),typeof l.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof l.componentDidUpdate!="function"||s===t.memoizedProps&&f===t.memoizedState||(e.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||s===t.memoizedProps&&f===t.memoizedState||(e.flags|=1024),e.memoizedProps=r,e.memoizedState=g),l.props=r,l.state=g,l.context=a,r=u):(typeof l.componentDidUpdate!="function"||s===t.memoizedProps&&f===t.memoizedState||(e.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||s===t.memoizedProps&&f===t.memoizedState||(e.flags|=1024),r=!1)}return Mp(t,e,n,r,o,i)}function Mp(t,e,n,r,i,o){vw(t,e);var l=(e.flags&128)!==0;if(!r&&!l)return i&&Ky(e,n,!1),mi(t,e,o);r=e.stateNode,gT.current=e;var s=l&&typeof n.getDerivedStateFromError!="function"?null:r.render();return e.flags|=1,t!==null&&l?(e.child=as(e,t.child,null,o),e.child=as(e,null,s,o)):un(t,e,s,o),e.memoizedState=r.state,i&&Ky(e,n,!0),e.child}function yw(t){var e=t.stateNode;e.pendingContext?Hy(t,e.pendingContext,e.pendingContext!==e.context):e.context&&Hy(t,e.context,!1),bg(t,e.containerInfo)}function a0(t,e,n,r,i){return ss(),_g(i),e.flags|=256,un(t,e,n,r),e.child}var Lp={dehydrated:null,treeContext:null,retryLane:0};function Dp(t){return{baseLanes:t,cachePool:null,transitions:null}}function xw(t,e,n){var r=e.pendingProps,i=dt.current,o=!1,l=(e.flags&128)!==0,s;if((s=l)||(s=t!==null&&t.memoizedState===null?!1:(i&2)!==0),s?(o=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(i|=1),Xe(dt,i&1),t===null)return Tp(e),t=e.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?(e.mode&1?t.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(l=r.children,t=r.fallback,o?(r=e.mode,o=e.child,l={mode:"hidden",children:l},!(r&1)&&o!==null?(o.childLanes=0,o.pendingProps=l):o=gf(l,r,0,null),t=jo(t,r,n,null),o.return=e,t.return=e,o.sibling=t,e.child=o,e.child.memoizedState=Dp(n),e.memoizedState=Lp,t):Mg(e,l));if(i=t.memoizedState,i!==null&&(s=i.dehydrated,s!==null))return vT(t,e,l,r,s,i,n);if(o){o=r.fallback,l=e.mode,i=t.child,s=i.sibling;var a={mode:"hidden",children:r.children};return!(l&1)&&e.child!==i?(r=e.child,r.childLanes=0,r.pendingProps=a,e.deletions=null):(r=to(i,a),r.subtreeFlags=i.subtreeFlags&14680064),s!==null?o=to(s,o):(o=jo(o,l,n,null),o.flags|=2),o.return=e,r.return=e,r.sibling=o,e.child=r,r=o,o=e.child,l=t.child.memoizedState,l=l===null?Dp(n):{baseLanes:l.baseLanes|n,cachePool:null,transitions:l.transitions},o.memoizedState=l,o.childLanes=t.childLanes&~n,e.memoizedState=Lp,r}return o=t.child,t=o.sibling,r=to(o,{mode:"visible",children:r.children}),!(e.mode&1)&&(r.lanes=n),r.return=e,r.sibling=null,t!==null&&(n=e.deletions,n===null?(e.deletions=[t],e.flags|=16):n.push(t)),e.child=r,e.memoizedState=null,r}function Mg(t,e){return e=gf({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function cc(t,e,n,r){return r!==null&&_g(r),as(e,t.child,null,n),t=Mg(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function vT(t,e,n,r,i,o,l){if(n)return e.flags&256?(e.flags&=-257,r=$h(Error(U(422))),cc(t,e,l,r)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(o=r.fallback,i=e.mode,r=gf({mode:"visible",children:r.children},i,0,null),o=jo(o,i,l,null),o.flags|=2,r.return=e,o.return=e,r.sibling=o,e.child=r,e.mode&1&&as(e,t.child,null,l),e.child.memoizedState=Dp(l),e.memoizedState=Lp,o);if(!(e.mode&1))return cc(t,e,l,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var s=r.dgst;return r=s,o=Error(U(419)),r=$h(o,r,void 0),cc(t,e,l,r)}if(s=(l&t.childLanes)!==0,bn||s){if(r=Bt,r!==null){switch(l&-l){case 4:i=2;break;case 16:i=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|l)?0:i,i!==0&&i!==o.retryLane&&(o.retryLane=i,pi(t,i),Er(r,t,i,-1))}return Fg(),r=$h(Error(U(421))),cc(t,e,l,r)}return i.data==="$?"?(e.flags|=128,e.child=t.child,e=RT.bind(null,t),i._reactRetry=e,null):(t=o.treeContext,zn=Ji(i.nextSibling),Fn=e,ot=!0,xr=null,t!==null&&(Qn[qn++]=ai,Qn[qn++]=ui,Qn[qn++]=Ko,ai=t.id,ui=t.overflow,Ko=e),e=Mg(e,r.children),e.flags|=4096,e)}function u0(t,e,n){t.lanes|=e;var r=t.alternate;r!==null&&(r.lanes|=e),Np(t.return,e,n)}function Th(t,e,n,r,i){var o=t.memoizedState;o===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(o.isBackwards=e,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i)}function _w(t,e,n){var r=e.pendingProps,i=r.revealOrder,o=r.tail;if(un(t,e,r.children,n),r=dt.current,r&2)r=r&1|2,e.flags|=128;else{if(t!==null&&t.flags&128)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&u0(t,n,e);else if(t.tag===19)u0(t,n,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}r&=1}if(Xe(dt,r),!(e.mode&1))e.memoizedState=null;else switch(i){case"forwards":for(n=e.child,i=null;n!==null;)t=n.alternate,t!==null&&hd(t)===null&&(i=n),n=n.sibling;n=i,n===null?(i=e.child,e.child=null):(i=n.sibling,n.sibling=null),Th(e,!1,i,n,o);break;case"backwards":for(n=null,i=e.child,e.child=null;i!==null;){if(t=i.alternate,t!==null&&hd(t)===null){e.child=i;break}t=i.sibling,i.sibling=n,n=i,i=t}Th(e,!0,n,null,o);break;case"together":Th(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function jc(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function mi(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),Go|=e.lanes,!(n&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(U(153));if(e.child!==null){for(t=e.child,n=to(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=to(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function yT(t,e,n){switch(e.tag){case 3:yw(e),ss();break;case 5:Z1(e);break;case 1:Tn(e.type)&&sd(e);break;case 4:bg(e,e.stateNode.containerInfo);break;case 10:var r=e.type._context,i=e.memoizedProps.value;Xe(cd,r._currentValue),r._currentValue=i;break;case 13:if(r=e.memoizedState,r!==null)return r.dehydrated!==null?(Xe(dt,dt.current&1),e.flags|=128,null):n&e.child.childLanes?xw(t,e,n):(Xe(dt,dt.current&1),t=mi(t,e,n),t!==null?t.sibling:null);Xe(dt,dt.current&1);break;case 19:if(r=(n&e.childLanes)!==0,t.flags&128){if(r)return _w(t,e,n);e.flags|=128}if(i=e.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Xe(dt,dt.current),r)break;return null;case 22:case 23:return e.lanes=0,gw(t,e,n)}return mi(t,e,n)}var ww,Ip,Sw,Ew;ww=function(t,e){for(var n=e.child;n!==null;){if(n.tag===5||n.tag===6)t.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Ip=function(){};Sw=function(t,e,n,r){var i=t.memoizedProps;if(i!==r){t=e.stateNode,Mo(Br.current);var o=null;switch(n){case"input":i=op(t,i),r=op(t,r),o=[];break;case"select":i=mt({},i,{value:void 0}),r=mt({},r,{value:void 0}),o=[];break;case"textarea":i=ap(t,i),r=ap(t,r),o=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(t.onclick=od)}cp(n,r);var l;n=null;for(u in i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var s=i[u];for(l in s)s.hasOwnProperty(l)&&(n||(n={}),n[l]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Fa.hasOwnProperty(u)?o||(o=[]):(o=o||[]).push(u,null));for(u in r){var a=r[u];if(s=i!=null?i[u]:void 0,r.hasOwnProperty(u)&&a!==s&&(a!=null||s!=null))if(u==="style")if(s){for(l in s)!s.hasOwnProperty(l)||a&&a.hasOwnProperty(l)||(n||(n={}),n[l]="");for(l in a)a.hasOwnProperty(l)&&s[l]!==a[l]&&(n||(n={}),n[l]=a[l])}else n||(o||(o=[]),o.push(u,n)),n=a;else u==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,s=s?s.__html:void 0,a!=null&&s!==a&&(o=o||[]).push(u,a)):u==="children"?typeof a!="string"&&typeof a!="number"||(o=o||[]).push(u,""+a):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Fa.hasOwnProperty(u)?(a!=null&&u==="onScroll"&&et("scroll",t),o||s===a||(o=[])):(o=o||[]).push(u,a))}n&&(o=o||[]).push("style",n);var u=o;(e.updateQueue=u)&&(e.flags|=4)}};Ew=function(t,e,n,r){n!==r&&(e.flags|=4)};function Js(t,e){if(!ot)switch(t.tailMode){case"hidden":e=t.tail;for(var n=null;e!==null;)e.alternate!==null&&(n=e),e=e.sibling;n===null?t.tail=null:n.sibling=null;break;case"collapsed":n=t.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:r.sibling=null}}function Xt(t){var e=t.alternate!==null&&t.alternate.child===t.child,n=0,r=0;if(e)for(var i=t.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=t,i=i.sibling;else for(i=t.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=t,i=i.sibling;return t.subtreeFlags|=r,t.childLanes=n,e}function xT(t,e,n){var r=e.pendingProps;switch(xg(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Xt(e),null;case 1:return Tn(e.type)&&ld(),Xt(e),null;case 3:return r=e.stateNode,us(),it($n),it(rn),Tg(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(t===null||t.child===null)&&(ac(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,xr!==null&&(Hp(xr),xr=null))),Ip(t,e),Xt(e),null;case 5:$g(e);var i=Mo(Qa.current);if(n=e.type,t!==null&&e.stateNode!=null)Sw(t,e,n,r,i),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!r){if(e.stateNode===null)throw Error(U(166));return Xt(e),null}if(t=Mo(Br.current),ac(e)){r=e.stateNode,n=e.type;var o=e.memoizedProps;switch(r[Lr]=e,r[Xa]=o,t=(e.mode&1)!==0,n){case"dialog":et("cancel",r),et("close",r);break;case"iframe":case"object":case"embed":et("load",r);break;case"video":case"audio":for(i=0;i<ha.length;i++)et(ha[i],r);break;case"source":et("error",r);break;case"img":case"image":case"link":et("error",r),et("load",r);break;case"details":et("toggle",r);break;case"input":yy(r,o),et("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!o.multiple},et("invalid",r);break;case"textarea":_y(r,o),et("invalid",r)}cp(n,o),i=null;for(var l in o)if(o.hasOwnProperty(l)){var s=o[l];l==="children"?typeof s=="string"?r.textContent!==s&&(o.suppressHydrationWarning!==!0&&sc(r.textContent,s,t),i=["children",s]):typeof s=="number"&&r.textContent!==""+s&&(o.suppressHydrationWarning!==!0&&sc(r.textContent,s,t),i=["children",""+s]):Fa.hasOwnProperty(l)&&s!=null&&l==="onScroll"&&et("scroll",r)}switch(n){case"input":qu(r),xy(r,o,!0);break;case"textarea":qu(r),wy(r);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(r.onclick=od)}r=i,e.updateQueue=r,r!==null&&(e.flags|=4)}else{l=i.nodeType===9?i:i.ownerDocument,t==="http://www.w3.org/1999/xhtml"&&(t=X_(n)),t==="http://www.w3.org/1999/xhtml"?n==="script"?(t=l.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=l.createElement(n,{is:r.is}):(t=l.createElement(n),n==="select"&&(l=t,r.multiple?l.multiple=!0:r.size&&(l.size=r.size))):t=l.createElementNS(t,n),t[Lr]=e,t[Xa]=r,ww(t,e,!1,!1),e.stateNode=t;e:{switch(l=dp(n,r),n){case"dialog":et("cancel",t),et("close",t),i=r;break;case"iframe":case"object":case"embed":et("load",t),i=r;break;case"video":case"audio":for(i=0;i<ha.length;i++)et(ha[i],t);i=r;break;case"source":et("error",t),i=r;break;case"img":case"image":case"link":et("error",t),et("load",t),i=r;break;case"details":et("toggle",t),i=r;break;case"input":yy(t,r),i=op(t,r),et("invalid",t);break;case"option":i=r;break;case"select":t._wrapperState={wasMultiple:!!r.multiple},i=mt({},r,{value:void 0}),et("invalid",t);break;case"textarea":_y(t,r),i=ap(t,r),et("invalid",t);break;default:i=r}cp(n,i),s=i;for(o in s)if(s.hasOwnProperty(o)){var a=s[o];o==="style"?q_(t,a):o==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,a!=null&&J_(t,a)):o==="children"?typeof a=="string"?(n!=="textarea"||a!=="")&&Ba(t,a):typeof a=="number"&&Ba(t,""+a):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(Fa.hasOwnProperty(o)?a!=null&&o==="onScroll"&&et("scroll",t):a!=null&&ig(t,o,a,l))}switch(n){case"input":qu(t),xy(t,r,!1);break;case"textarea":qu(t),wy(t);break;case"option":r.value!=null&&t.setAttribute("value",""+oo(r.value));break;case"select":t.multiple=!!r.multiple,o=r.value,o!=null?Zl(t,!!r.multiple,o,!1):r.defaultValue!=null&&Zl(t,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(t.onclick=od)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(e.flags|=4)}e.ref!==null&&(e.flags|=512,e.flags|=2097152)}return Xt(e),null;case 6:if(t&&e.stateNode!=null)Ew(t,e,t.memoizedProps,r);else{if(typeof r!="string"&&e.stateNode===null)throw Error(U(166));if(n=Mo(Qa.current),Mo(Br.current),ac(e)){if(r=e.stateNode,n=e.memoizedProps,r[Lr]=e,(o=r.nodeValue!==n)&&(t=Fn,t!==null))switch(t.tag){case 3:sc(r.nodeValue,n,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&sc(r.nodeValue,n,(t.mode&1)!==0)}o&&(e.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Lr]=e,e.stateNode=r}return Xt(e),null;case 13:if(it(dt),r=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(ot&&zn!==null&&e.mode&1&&!(e.flags&128))F1(),ss(),e.flags|=98560,o=!1;else if(o=ac(e),r!==null&&r.dehydrated!==null){if(t===null){if(!o)throw Error(U(318));if(o=e.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(U(317));o[Lr]=e}else ss(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;Xt(e),o=!1}else xr!==null&&(Hp(xr),xr=null),o=!0;if(!o)return e.flags&65536?e:null}return e.flags&128?(e.lanes=n,e):(r=r!==null,r!==(t!==null&&t.memoizedState!==null)&&r&&(e.child.flags|=8192,e.mode&1&&(t===null||dt.current&1?Pt===0&&(Pt=3):Fg())),e.updateQueue!==null&&(e.flags|=4),Xt(e),null);case 4:return us(),Ip(t,e),t===null&&Ga(e.stateNode.containerInfo),Xt(e),null;case 10:return Eg(e.type._context),Xt(e),null;case 17:return Tn(e.type)&&ld(),Xt(e),null;case 19:if(it(dt),o=e.memoizedState,o===null)return Xt(e),null;if(r=(e.flags&128)!==0,l=o.rendering,l===null)if(r)Js(o,!1);else{if(Pt!==0||t!==null&&t.flags&128)for(t=e.child;t!==null;){if(l=hd(t),l!==null){for(e.flags|=128,Js(o,!1),r=l.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),e.subtreeFlags=0,r=n,n=e.child;n!==null;)o=n,t=r,o.flags&=14680066,l=o.alternate,l===null?(o.childLanes=0,o.lanes=t,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=l.childLanes,o.lanes=l.lanes,o.child=l.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=l.memoizedProps,o.memoizedState=l.memoizedState,o.updateQueue=l.updateQueue,o.type=l.type,t=l.dependencies,o.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),n=n.sibling;return Xe(dt,dt.current&1|2),e.child}t=t.sibling}o.tail!==null&&Ct()>ds&&(e.flags|=128,r=!0,Js(o,!1),e.lanes=4194304)}else{if(!r)if(t=hd(l),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),Js(o,!0),o.tail===null&&o.tailMode==="hidden"&&!l.alternate&&!ot)return Xt(e),null}else 2*Ct()-o.renderingStartTime>ds&&n!==1073741824&&(e.flags|=128,r=!0,Js(o,!1),e.lanes=4194304);o.isBackwards?(l.sibling=e.child,e.child=l):(n=o.last,n!==null?n.sibling=l:e.child=l,o.last=l)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=Ct(),e.sibling=null,n=dt.current,Xe(dt,r?n&1|2:n&1),e):(Xt(e),null);case 22:case 23:return zg(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?Dn&1073741824&&(Xt(e),e.subtreeFlags&6&&(e.flags|=8192)):Xt(e),null;case 24:return null;case 25:return null}throw Error(U(156,e.tag))}function _T(t,e){switch(xg(e),e.tag){case 1:return Tn(e.type)&&ld(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return us(),it($n),it(rn),Tg(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return $g(e),null;case 13:if(it(dt),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(U(340));ss()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return it(dt),null;case 4:return us(),null;case 10:return Eg(e.type._context),null;case 22:case 23:return zg(),null;case 24:return null;default:return null}}var dc=!1,Qt=!1,wT=typeof WeakSet=="function"?WeakSet:Set,ee=null;function Fl(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){vt(t,e,r)}else n.current=null}function jp(t,e,n){try{n()}catch(r){vt(t,e,r)}}var c0=!1;function ST(t,e){if(wp=nd,t=$1(),vg(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var l=0,s=-1,a=-1,u=0,c=0,d=t,f=null;t:for(;;){for(var h;d!==n||i!==0&&d.nodeType!==3||(s=l+i),d!==o||r!==0&&d.nodeType!==3||(a=l+r),d.nodeType===3&&(l+=d.nodeValue.length),(h=d.firstChild)!==null;)f=d,d=h;for(;;){if(d===t)break t;if(f===n&&++u===i&&(s=l),f===o&&++c===r&&(a=l),(h=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=h}n=s===-1||a===-1?null:{start:s,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(Sp={focusedElem:t,selectionRange:n},nd=!1,ee=e;ee!==null;)if(e=ee,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,ee=t;else for(;ee!==null;){e=ee;try{var g=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var m=g.memoizedProps,w=g.memoizedState,v=e.stateNode,y=v.getSnapshotBeforeUpdate(e.elementType===e.type?m:gr(e.type,m),w);v.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var _=e.stateNode.containerInfo;_.nodeType===1?_.textContent="":_.nodeType===9&&_.documentElement&&_.removeChild(_.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(U(163))}}catch(S){vt(e,e.return,S)}if(t=e.sibling,t!==null){t.return=e.return,ee=t;break}ee=e.return}return g=c0,c0=!1,g}function Ca(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&t)===t){var o=i.destroy;i.destroy=void 0,o!==void 0&&jp(e,n,o)}i=i.next}while(i!==r)}}function pf(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function zp(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function Cw(t){var e=t.alternate;e!==null&&(t.alternate=null,Cw(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[Lr],delete e[Xa],delete e[kp],delete e[iT],delete e[oT])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function kw(t){return t.tag===5||t.tag===3||t.tag===4}function d0(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||kw(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Fp(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=od));else if(r!==4&&(t=t.child,t!==null))for(Fp(t,e,n),t=t.sibling;t!==null;)Fp(t,e,n),t=t.sibling}function Bp(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(Bp(t,e,n),t=t.sibling;t!==null;)Bp(t,e,n),t=t.sibling}var Ht=null,vr=!1;function Ri(t,e,n){for(n=n.child;n!==null;)bw(t,e,n),n=n.sibling}function bw(t,e,n){if(Fr&&typeof Fr.onCommitFiberUnmount=="function")try{Fr.onCommitFiberUnmount(lf,n)}catch{}switch(n.tag){case 5:Qt||Fl(n,e);case 6:var r=Ht,i=vr;Ht=null,Ri(t,e,n),Ht=r,vr=i,Ht!==null&&(vr?(t=Ht,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):Ht.removeChild(n.stateNode));break;case 18:Ht!==null&&(vr?(t=Ht,n=n.stateNode,t.nodeType===8?wh(t.parentNode,n):t.nodeType===1&&wh(t,n),Ha(t)):wh(Ht,n.stateNode));break;case 4:r=Ht,i=vr,Ht=n.stateNode.containerInfo,vr=!0,Ri(t,e,n),Ht=r,vr=i;break;case 0:case 11:case 14:case 15:if(!Qt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,l=o.destroy;o=o.tag,l!==void 0&&(o&2||o&4)&&jp(n,e,l),i=i.next}while(i!==r)}Ri(t,e,n);break;case 1:if(!Qt&&(Fl(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){vt(n,e,s)}Ri(t,e,n);break;case 21:Ri(t,e,n);break;case 22:n.mode&1?(Qt=(r=Qt)||n.memoizedState!==null,Ri(t,e,n),Qt=r):Ri(t,e,n);break;default:Ri(t,e,n)}}function f0(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new wT),e.forEach(function(r){var i=OT.bind(null,t,r);n.has(r)||(n.add(r),r.then(i,i))})}}function fr(t,e){var n=e.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var o=t,l=e,s=l;e:for(;s!==null;){switch(s.tag){case 5:Ht=s.stateNode,vr=!1;break e;case 3:Ht=s.stateNode.containerInfo,vr=!0;break e;case 4:Ht=s.stateNode.containerInfo,vr=!0;break e}s=s.return}if(Ht===null)throw Error(U(160));bw(o,l,i),Ht=null,vr=!1;var a=i.alternate;a!==null&&(a.return=null),i.return=null}catch(u){vt(i,e,u)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)$w(e,t),e=e.sibling}function $w(t,e){var n=t.alternate,r=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(fr(e,t),Pr(t),r&4){try{Ca(3,t,t.return),pf(3,t)}catch(m){vt(t,t.return,m)}try{Ca(5,t,t.return)}catch(m){vt(t,t.return,m)}}break;case 1:fr(e,t),Pr(t),r&512&&n!==null&&Fl(n,n.return);break;case 5:if(fr(e,t),Pr(t),r&512&&n!==null&&Fl(n,n.return),t.flags&32){var i=t.stateNode;try{Ba(i,"")}catch(m){vt(t,t.return,m)}}if(r&4&&(i=t.stateNode,i!=null)){var o=t.memoizedProps,l=n!==null?n.memoizedProps:o,s=t.type,a=t.updateQueue;if(t.updateQueue=null,a!==null)try{s==="input"&&o.type==="radio"&&o.name!=null&&G_(i,o),dp(s,l);var u=dp(s,o);for(l=0;l<a.length;l+=2){var c=a[l],d=a[l+1];c==="style"?q_(i,d):c==="dangerouslySetInnerHTML"?J_(i,d):c==="children"?Ba(i,d):ig(i,c,d,u)}switch(s){case"input":lp(i,o);break;case"textarea":Y_(i,o);break;case"select":var f=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!o.multiple;var h=o.value;h!=null?Zl(i,!!o.multiple,h,!1):f!==!!o.multiple&&(o.defaultValue!=null?Zl(i,!!o.multiple,o.defaultValue,!0):Zl(i,!!o.multiple,o.multiple?[]:"",!1))}i[Xa]=o}catch(m){vt(t,t.return,m)}}break;case 6:if(fr(e,t),Pr(t),r&4){if(t.stateNode===null)throw Error(U(162));i=t.stateNode,o=t.memoizedProps;try{i.nodeValue=o}catch(m){vt(t,t.return,m)}}break;case 3:if(fr(e,t),Pr(t),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Ha(e.containerInfo)}catch(m){vt(t,t.return,m)}break;case 4:fr(e,t),Pr(t);break;case 13:fr(e,t),Pr(t),i=t.child,i.flags&8192&&(o=i.memoizedState!==null,i.stateNode.isHidden=o,!o||i.alternate!==null&&i.alternate.memoizedState!==null||(Ig=Ct())),r&4&&f0(t);break;case 22:if(c=n!==null&&n.memoizedState!==null,t.mode&1?(Qt=(u=Qt)||c,fr(e,t),Qt=u):fr(e,t),Pr(t),r&8192){if(u=t.memoizedState!==null,(t.stateNode.isHidden=u)&&!c&&t.mode&1)for(ee=t,c=t.child;c!==null;){for(d=ee=c;ee!==null;){switch(f=ee,h=f.child,f.tag){case 0:case 11:case 14:case 15:Ca(4,f,f.return);break;case 1:Fl(f,f.return);var g=f.stateNode;if(typeof g.componentWillUnmount=="function"){r=f,n=f.return;try{e=r,g.props=e.memoizedProps,g.state=e.memoizedState,g.componentWillUnmount()}catch(m){vt(r,n,m)}}break;case 5:Fl(f,f.return);break;case 22:if(f.memoizedState!==null){p0(d);continue}}h!==null?(h.return=f,ee=h):p0(d)}c=c.sibling}e:for(c=null,d=t;;){if(d.tag===5){if(c===null){c=d;try{i=d.stateNode,u?(o=i.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none"):(s=d.stateNode,a=d.memoizedProps.style,l=a!=null&&a.hasOwnProperty("display")?a.display:null,s.style.display=Q_("display",l))}catch(m){vt(t,t.return,m)}}}else if(d.tag===6){if(c===null)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(m){vt(t,t.return,m)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===t)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===t)break e;for(;d.sibling===null;){if(d.return===null||d.return===t)break e;c===d&&(c=null),d=d.return}c===d&&(c=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:fr(e,t),Pr(t),r&4&&f0(t);break;case 21:break;default:fr(e,t),Pr(t)}}function Pr(t){var e=t.flags;if(e&2){try{e:{for(var n=t.return;n!==null;){if(kw(n)){var r=n;break e}n=n.return}throw Error(U(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(Ba(i,""),r.flags&=-33);var o=d0(t);Bp(t,o,i);break;case 3:case 4:var l=r.stateNode.containerInfo,s=d0(t);Fp(t,s,l);break;default:throw Error(U(161))}}catch(a){vt(t,t.return,a)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function ET(t,e,n){ee=t,Tw(t)}function Tw(t,e,n){for(var r=(t.mode&1)!==0;ee!==null;){var i=ee,o=i.child;if(i.tag===22&&r){var l=i.memoizedState!==null||dc;if(!l){var s=i.alternate,a=s!==null&&s.memoizedState!==null||Qt;s=dc;var u=Qt;if(dc=l,(Qt=a)&&!u)for(ee=i;ee!==null;)l=ee,a=l.child,l.tag===22&&l.memoizedState!==null?m0(i):a!==null?(a.return=l,ee=a):m0(i);for(;o!==null;)ee=o,Tw(o),o=o.sibling;ee=i,dc=s,Qt=u}h0(t)}else i.subtreeFlags&8772&&o!==null?(o.return=i,ee=o):h0(t)}}function h0(t){for(;ee!==null;){var e=ee;if(e.flags&8772){var n=e.alternate;try{if(e.flags&8772)switch(e.tag){case 0:case 11:case 15:Qt||pf(5,e);break;case 1:var r=e.stateNode;if(e.flags&4&&!Qt)if(n===null)r.componentDidMount();else{var i=e.elementType===e.type?n.memoizedProps:gr(e.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var o=e.updateQueue;o!==null&&Xy(e,o,r);break;case 3:var l=e.updateQueue;if(l!==null){if(n=null,e.child!==null)switch(e.child.tag){case 5:n=e.child.stateNode;break;case 1:n=e.child.stateNode}Xy(e,l,n)}break;case 5:var s=e.stateNode;if(n===null&&e.flags&4){n=s;var a=e.memoizedProps;switch(e.type){case"button":case"input":case"select":case"textarea":a.autoFocus&&n.focus();break;case"img":a.src&&(n.src=a.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(e.memoizedState===null){var u=e.alternate;if(u!==null){var c=u.memoizedState;if(c!==null){var d=c.dehydrated;d!==null&&Ha(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(U(163))}Qt||e.flags&512&&zp(e)}catch(f){vt(e,e.return,f)}}if(e===t){ee=null;break}if(n=e.sibling,n!==null){n.return=e.return,ee=n;break}ee=e.return}}function p0(t){for(;ee!==null;){var e=ee;if(e===t){ee=null;break}var n=e.sibling;if(n!==null){n.return=e.return,ee=n;break}ee=e.return}}function m0(t){for(;ee!==null;){var e=ee;try{switch(e.tag){case 0:case 11:case 15:var n=e.return;try{pf(4,e)}catch(a){vt(e,n,a)}break;case 1:var r=e.stateNode;if(typeof r.componentDidMount=="function"){var i=e.return;try{r.componentDidMount()}catch(a){vt(e,i,a)}}var o=e.return;try{zp(e)}catch(a){vt(e,o,a)}break;case 5:var l=e.return;try{zp(e)}catch(a){vt(e,l,a)}}}catch(a){vt(e,e.return,a)}if(e===t){ee=null;break}var s=e.sibling;if(s!==null){s.return=e.return,ee=s;break}ee=e.return}}var CT=Math.ceil,gd=_i.ReactCurrentDispatcher,Lg=_i.ReactCurrentOwner,or=_i.ReactCurrentBatchConfig,Me=0,Bt=null,bt=null,Zt=0,Dn=0,Bl=_o(0),Pt=0,nu=null,Go=0,mf=0,Dg=0,ka=null,kn=null,Ig=0,ds=1/0,ni=null,vd=!1,Up=null,qi=null,fc=!1,Hi=null,yd=0,ba=0,Wp=null,zc=-1,Fc=0;function vn(){return Me&6?Ct():zc!==-1?zc:zc=Ct()}function eo(t){return t.mode&1?Me&2&&Zt!==0?Zt&-Zt:sT.transition!==null?(Fc===0&&(Fc=d1()),Fc):(t=Ue,t!==0||(t=window.event,t=t===void 0?16:y1(t.type)),t):1}function Er(t,e,n,r){if(50<ba)throw ba=0,Wp=null,Error(U(185));Au(t,n,r),(!(Me&2)||t!==Bt)&&(t===Bt&&(!(Me&2)&&(mf|=n),Pt===4&&Bi(t,Zt)),Nn(t,r),n===1&&Me===0&&!(e.mode&1)&&(ds=Ct()+500,df&&wo()))}function Nn(t,e){var n=t.callbackNode;s$(t,e);var r=td(t,t===Bt?Zt:0);if(r===0)n!==null&&Cy(n),t.callbackNode=null,t.callbackPriority=0;else if(e=r&-r,t.callbackPriority!==e){if(n!=null&&Cy(n),e===1)t.tag===0?lT(g0.bind(null,t)):I1(g0.bind(null,t)),nT(function(){!(Me&6)&&wo()}),n=null;else{switch(f1(r)){case 1:n=ug;break;case 4:n=u1;break;case 16:n=ed;break;case 536870912:n=c1;break;default:n=ed}n=Dw(n,Nw.bind(null,t))}t.callbackPriority=e,t.callbackNode=n}}function Nw(t,e){if(zc=-1,Fc=0,Me&6)throw Error(U(327));var n=t.callbackNode;if(Ql()&&t.callbackNode!==n)return null;var r=td(t,t===Bt?Zt:0);if(r===0)return null;if(r&30||r&t.expiredLanes||e)e=xd(t,r);else{e=r;var i=Me;Me|=2;var o=Ow();(Bt!==t||Zt!==e)&&(ni=null,ds=Ct()+500,Io(t,e));do try{$T();break}catch(s){Rw(t,s)}while(!0);Sg(),gd.current=o,Me=i,bt!==null?e=0:(Bt=null,Zt=0,e=Pt)}if(e!==0){if(e===2&&(i=gp(t),i!==0&&(r=i,e=Vp(t,i))),e===1)throw n=nu,Io(t,0),Bi(t,r),Nn(t,Ct()),n;if(e===6)Bi(t,r);else{if(i=t.current.alternate,!(r&30)&&!kT(i)&&(e=xd(t,r),e===2&&(o=gp(t),o!==0&&(r=o,e=Vp(t,o))),e===1))throw n=nu,Io(t,0),Bi(t,r),Nn(t,Ct()),n;switch(t.finishedWork=i,t.finishedLanes=r,e){case 0:case 1:throw Error(U(345));case 2:No(t,kn,ni);break;case 3:if(Bi(t,r),(r&130023424)===r&&(e=Ig+500-Ct(),10<e)){if(td(t,0)!==0)break;if(i=t.suspendedLanes,(i&r)!==r){vn(),t.pingedLanes|=t.suspendedLanes&i;break}t.timeoutHandle=Cp(No.bind(null,t,kn,ni),e);break}No(t,kn,ni);break;case 4:if(Bi(t,r),(r&4194240)===r)break;for(e=t.eventTimes,i=-1;0<r;){var l=31-Sr(r);o=1<<l,l=e[l],l>i&&(i=l),r&=~o}if(r=i,r=Ct()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*CT(r/1960))-r,10<r){t.timeoutHandle=Cp(No.bind(null,t,kn,ni),r);break}No(t,kn,ni);break;case 5:No(t,kn,ni);break;default:throw Error(U(329))}}}return Nn(t,Ct()),t.callbackNode===n?Nw.bind(null,t):null}function Vp(t,e){var n=ka;return t.current.memoizedState.isDehydrated&&(Io(t,e).flags|=256),t=xd(t,e),t!==2&&(e=kn,kn=n,e!==null&&Hp(e)),t}function Hp(t){kn===null?kn=t:kn.push.apply(kn,t)}function kT(t){for(var e=t;;){if(e.flags&16384){var n=e.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],o=i.getSnapshot;i=i.value;try{if(!br(o(),i))return!1}catch{return!1}}}if(n=e.child,e.subtreeFlags&16384&&n!==null)n.return=e,e=n;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function Bi(t,e){for(e&=~Dg,e&=~mf,t.suspendedLanes|=e,t.pingedLanes&=~e,t=t.expirationTimes;0<e;){var n=31-Sr(e),r=1<<n;t[n]=-1,e&=~r}}function g0(t){if(Me&6)throw Error(U(327));Ql();var e=td(t,0);if(!(e&1))return Nn(t,Ct()),null;var n=xd(t,e);if(t.tag!==0&&n===2){var r=gp(t);r!==0&&(e=r,n=Vp(t,r))}if(n===1)throw n=nu,Io(t,0),Bi(t,e),Nn(t,Ct()),n;if(n===6)throw Error(U(345));return t.finishedWork=t.current.alternate,t.finishedLanes=e,No(t,kn,ni),Nn(t,Ct()),null}function jg(t,e){var n=Me;Me|=1;try{return t(e)}finally{Me=n,Me===0&&(ds=Ct()+500,df&&wo())}}function Yo(t){Hi!==null&&Hi.tag===0&&!(Me&6)&&Ql();var e=Me;Me|=1;var n=or.transition,r=Ue;try{if(or.transition=null,Ue=1,t)return t()}finally{Ue=r,or.transition=n,Me=e,!(Me&6)&&wo()}}function zg(){Dn=Bl.current,it(Bl)}function Io(t,e){t.finishedWork=null,t.finishedLanes=0;var n=t.timeoutHandle;if(n!==-1&&(t.timeoutHandle=-1,tT(n)),bt!==null)for(n=bt.return;n!==null;){var r=n;switch(xg(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&ld();break;case 3:us(),it($n),it(rn),Tg();break;case 5:$g(r);break;case 4:us();break;case 13:it(dt);break;case 19:it(dt);break;case 10:Eg(r.type._context);break;case 22:case 23:zg()}n=n.return}if(Bt=t,bt=t=to(t.current,null),Zt=Dn=e,Pt=0,nu=null,Dg=mf=Go=0,kn=ka=null,Ao!==null){for(e=0;e<Ao.length;e++)if(n=Ao[e],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,o=n.pending;if(o!==null){var l=o.next;o.next=i,r.next=l}n.pending=r}Ao=null}return t}function Rw(t,e){do{var n=bt;try{if(Sg(),Dc.current=md,pd){for(var r=ht.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}pd=!1}if(Zo=0,Dt=Rt=ht=null,Ea=!1,qa=0,Lg.current=null,n===null||n.return===null){Pt=1,nu=e,bt=null;break}e:{var o=t,l=n.return,s=n,a=e;if(e=Zt,s.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){var u=a,c=s,d=c.tag;if(!(c.mode&1)&&(d===0||d===11||d===15)){var f=c.alternate;f?(c.updateQueue=f.updateQueue,c.memoizedState=f.memoizedState,c.lanes=f.lanes):(c.updateQueue=null,c.memoizedState=null)}var h=r0(l);if(h!==null){h.flags&=-257,i0(h,l,s,o,e),h.mode&1&&n0(o,u,e),e=h,a=u;var g=e.updateQueue;if(g===null){var m=new Set;m.add(a),e.updateQueue=m}else g.add(a);break e}else{if(!(e&1)){n0(o,u,e),Fg();break e}a=Error(U(426))}}else if(ot&&s.mode&1){var w=r0(l);if(w!==null){!(w.flags&65536)&&(w.flags|=256),i0(w,l,s,o,e),_g(cs(a,s));break e}}o=a=cs(a,s),Pt!==4&&(Pt=2),ka===null?ka=[o]:ka.push(o),o=l;do{switch(o.tag){case 3:o.flags|=65536,e&=-e,o.lanes|=e;var v=hw(o,a,e);Yy(o,v);break e;case 1:s=a;var y=o.type,_=o.stateNode;if(!(o.flags&128)&&(typeof y.getDerivedStateFromError=="function"||_!==null&&typeof _.componentDidCatch=="function"&&(qi===null||!qi.has(_)))){o.flags|=65536,e&=-e,o.lanes|=e;var S=pw(o,s,e);Yy(o,S);break e}}o=o.return}while(o!==null)}Aw(n)}catch(E){e=E,bt===n&&n!==null&&(bt=n=n.return);continue}break}while(!0)}function Ow(){var t=gd.current;return gd.current=md,t===null?md:t}function Fg(){(Pt===0||Pt===3||Pt===2)&&(Pt=4),Bt===null||!(Go&268435455)&&!(mf&268435455)||Bi(Bt,Zt)}function xd(t,e){var n=Me;Me|=2;var r=Ow();(Bt!==t||Zt!==e)&&(ni=null,Io(t,e));do try{bT();break}catch(i){Rw(t,i)}while(!0);if(Sg(),Me=n,gd.current=r,bt!==null)throw Error(U(261));return Bt=null,Zt=0,Pt}function bT(){for(;bt!==null;)Pw(bt)}function $T(){for(;bt!==null&&!Qb();)Pw(bt)}function Pw(t){var e=Lw(t.alternate,t,Dn);t.memoizedProps=t.pendingProps,e===null?Aw(t):bt=e,Lg.current=null}function Aw(t){var e=t;do{var n=e.alternate;if(t=e.return,e.flags&32768){if(n=_T(n,e),n!==null){n.flags&=32767,bt=n;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{Pt=6,bt=null;return}}else if(n=xT(n,e,Dn),n!==null){bt=n;return}if(e=e.sibling,e!==null){bt=e;return}bt=e=t}while(e!==null);Pt===0&&(Pt=5)}function No(t,e,n){var r=Ue,i=or.transition;try{or.transition=null,Ue=1,TT(t,e,n,r)}finally{or.transition=i,Ue=r}return null}function TT(t,e,n,r){do Ql();while(Hi!==null);if(Me&6)throw Error(U(327));n=t.finishedWork;var i=t.finishedLanes;if(n===null)return null;if(t.finishedWork=null,t.finishedLanes=0,n===t.current)throw Error(U(177));t.callbackNode=null,t.callbackPriority=0;var o=n.lanes|n.childLanes;if(a$(t,o),t===Bt&&(bt=Bt=null,Zt=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||fc||(fc=!0,Dw(ed,function(){return Ql(),null})),o=(n.flags&15990)!==0,n.subtreeFlags&15990||o){o=or.transition,or.transition=null;var l=Ue;Ue=1;var s=Me;Me|=4,Lg.current=null,ST(t,n),$w(n,t),G$(Sp),nd=!!wp,Sp=wp=null,t.current=n,ET(n),qb(),Me=s,Ue=l,or.transition=o}else t.current=n;if(fc&&(fc=!1,Hi=t,yd=i),o=t.pendingLanes,o===0&&(qi=null),n$(n.stateNode),Nn(t,Ct()),e!==null)for(r=t.onRecoverableError,n=0;n<e.length;n++)i=e[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(vd)throw vd=!1,t=Up,Up=null,t;return yd&1&&t.tag!==0&&Ql(),o=t.pendingLanes,o&1?t===Wp?ba++:(ba=0,Wp=t):ba=0,wo(),null}function Ql(){if(Hi!==null){var t=f1(yd),e=or.transition,n=Ue;try{if(or.transition=null,Ue=16>t?16:t,Hi===null)var r=!1;else{if(t=Hi,Hi=null,yd=0,Me&6)throw Error(U(331));var i=Me;for(Me|=4,ee=t.current;ee!==null;){var o=ee,l=o.child;if(ee.flags&16){var s=o.deletions;if(s!==null){for(var a=0;a<s.length;a++){var u=s[a];for(ee=u;ee!==null;){var c=ee;switch(c.tag){case 0:case 11:case 15:Ca(8,c,o)}var d=c.child;if(d!==null)d.return=c,ee=d;else for(;ee!==null;){c=ee;var f=c.sibling,h=c.return;if(Cw(c),c===u){ee=null;break}if(f!==null){f.return=h,ee=f;break}ee=h}}}var g=o.alternate;if(g!==null){var m=g.child;if(m!==null){g.child=null;do{var w=m.sibling;m.sibling=null,m=w}while(m!==null)}}ee=o}}if(o.subtreeFlags&2064&&l!==null)l.return=o,ee=l;else e:for(;ee!==null;){if(o=ee,o.flags&2048)switch(o.tag){case 0:case 11:case 15:Ca(9,o,o.return)}var v=o.sibling;if(v!==null){v.return=o.return,ee=v;break e}ee=o.return}}var y=t.current;for(ee=y;ee!==null;){l=ee;var _=l.child;if(l.subtreeFlags&2064&&_!==null)_.return=l,ee=_;else e:for(l=y;ee!==null;){if(s=ee,s.flags&2048)try{switch(s.tag){case 0:case 11:case 15:pf(9,s)}}catch(E){vt(s,s.return,E)}if(s===l){ee=null;break e}var S=s.sibling;if(S!==null){S.return=s.return,ee=S;break e}ee=s.return}}if(Me=i,wo(),Fr&&typeof Fr.onPostCommitFiberRoot=="function")try{Fr.onPostCommitFiberRoot(lf,t)}catch{}r=!0}return r}finally{Ue=n,or.transition=e}}return!1}function v0(t,e,n){e=cs(n,e),e=hw(t,e,1),t=Qi(t,e,1),e=vn(),t!==null&&(Au(t,1,e),Nn(t,e))}function vt(t,e,n){if(t.tag===3)v0(t,t,n);else for(;e!==null;){if(e.tag===3){v0(e,t,n);break}else if(e.tag===1){var r=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(qi===null||!qi.has(r))){t=cs(n,t),t=pw(e,t,1),e=Qi(e,t,1),t=vn(),e!==null&&(Au(e,1,t),Nn(e,t));break}}e=e.return}}function NT(t,e,n){var r=t.pingCache;r!==null&&r.delete(e),e=vn(),t.pingedLanes|=t.suspendedLanes&n,Bt===t&&(Zt&n)===n&&(Pt===4||Pt===3&&(Zt&130023424)===Zt&&500>Ct()-Ig?Io(t,0):Dg|=n),Nn(t,e)}function Mw(t,e){e===0&&(t.mode&1?(e=nc,nc<<=1,!(nc&130023424)&&(nc=4194304)):e=1);var n=vn();t=pi(t,e),t!==null&&(Au(t,e,n),Nn(t,n))}function RT(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),Mw(t,n)}function OT(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,i=t.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(U(314))}r!==null&&r.delete(e),Mw(t,n)}var Lw;Lw=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||$n.current)bn=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return bn=!1,yT(t,e,n);bn=!!(t.flags&131072)}else bn=!1,ot&&e.flags&1048576&&j1(e,ud,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;jc(t,e),t=e.pendingProps;var i=ls(e,rn.current);Jl(e,n),i=Rg(null,e,r,t,i,n);var o=Og();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,Tn(r)?(o=!0,sd(e)):o=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,kg(e),i.updater=ff,e.stateNode=i,i._reactInternals=e,Op(e,r,t,n),e=Mp(null,e,r,!0,o,n)):(e.tag=0,ot&&o&&yg(e),un(null,e,i,n),e=e.child),e;case 16:r=e.elementType;e:{switch(jc(t,e),t=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=AT(r),t=gr(r,t),i){case 0:e=Ap(null,e,r,t,n);break e;case 1:e=s0(null,e,r,t,n);break e;case 11:e=o0(null,e,r,t,n);break e;case 14:e=l0(null,e,r,gr(r.type,t),n);break e}throw Error(U(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:gr(r,i),Ap(t,e,r,i,n);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:gr(r,i),s0(t,e,r,i,n);case 3:e:{if(yw(e),t===null)throw Error(U(387));r=e.pendingProps,o=e.memoizedState,i=o.element,U1(t,e),fd(e,r,null,n);var l=e.memoizedState;if(r=l.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:l.cache,pendingSuspenseBoundaries:l.pendingSuspenseBoundaries,transitions:l.transitions},e.updateQueue.baseState=o,e.memoizedState=o,e.flags&256){i=cs(Error(U(423)),e),e=a0(t,e,r,n,i);break e}else if(r!==i){i=cs(Error(U(424)),e),e=a0(t,e,r,n,i);break e}else for(zn=Ji(e.stateNode.containerInfo.firstChild),Fn=e,ot=!0,xr=null,n=K1(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ss(),r===i){e=mi(t,e,n);break e}un(t,e,r,n)}e=e.child}return e;case 5:return Z1(e),t===null&&Tp(e),r=e.type,i=e.pendingProps,o=t!==null?t.memoizedProps:null,l=i.children,Ep(r,i)?l=null:o!==null&&Ep(r,o)&&(e.flags|=32),vw(t,e),un(t,e,l,n),e.child;case 6:return t===null&&Tp(e),null;case 13:return xw(t,e,n);case 4:return bg(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=as(e,null,r,n):un(t,e,r,n),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:gr(r,i),o0(t,e,r,i,n);case 7:return un(t,e,e.pendingProps,n),e.child;case 8:return un(t,e,e.pendingProps.children,n),e.child;case 12:return un(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,i=e.pendingProps,o=e.memoizedProps,l=i.value,Xe(cd,r._currentValue),r._currentValue=l,o!==null)if(br(o.value,l)){if(o.children===i.children&&!$n.current){e=mi(t,e,n);break e}}else for(o=e.child,o!==null&&(o.return=e);o!==null;){var s=o.dependencies;if(s!==null){l=o.child;for(var a=s.firstContext;a!==null;){if(a.context===r){if(o.tag===1){a=ci(-1,n&-n),a.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?a.next=a:(a.next=c.next,c.next=a),u.pending=a}}o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),Np(o.return,n,e),s.lanes|=n;break}a=a.next}}else if(o.tag===10)l=o.type===e.type?null:o.child;else if(o.tag===18){if(l=o.return,l===null)throw Error(U(341));l.lanes|=n,s=l.alternate,s!==null&&(s.lanes|=n),Np(l,n,e),l=o.sibling}else l=o.child;if(l!==null)l.return=o;else for(l=o;l!==null;){if(l===e){l=null;break}if(o=l.sibling,o!==null){o.return=l.return,l=o;break}l=l.return}o=l}un(t,e,i.children,n),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,Jl(e,n),i=lr(i),r=r(i),e.flags|=1,un(t,e,r,n),e.child;case 14:return r=e.type,i=gr(r,e.pendingProps),i=gr(r.type,i),l0(t,e,r,i,n);case 15:return mw(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:gr(r,i),jc(t,e),e.tag=1,Tn(r)?(t=!0,sd(e)):t=!1,Jl(e,n),V1(e,r,i),Op(e,r,i,n),Mp(null,e,r,!0,t,n);case 19:return _w(t,e,n);case 22:return gw(t,e,n)}throw Error(U(156,e.tag))};function Dw(t,e){return a1(t,e)}function PT(t,e,n,r){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function nr(t,e,n,r){return new PT(t,e,n,r)}function Bg(t){return t=t.prototype,!(!t||!t.isReactComponent)}function AT(t){if(typeof t=="function")return Bg(t)?1:0;if(t!=null){if(t=t.$$typeof,t===lg)return 11;if(t===sg)return 14}return 2}function to(t,e){var n=t.alternate;return n===null?(n=nr(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function Bc(t,e,n,r,i,o){var l=2;if(r=t,typeof t=="function")Bg(t)&&(l=1);else if(typeof t=="string")l=5;else e:switch(t){case Ol:return jo(n.children,i,o,e);case og:l=8,i|=8;break;case tp:return t=nr(12,n,e,i|2),t.elementType=tp,t.lanes=o,t;case np:return t=nr(13,n,e,i),t.elementType=np,t.lanes=o,t;case rp:return t=nr(19,n,e,i),t.elementType=rp,t.lanes=o,t;case H_:return gf(n,i,o,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case W_:l=10;break e;case V_:l=9;break e;case lg:l=11;break e;case sg:l=14;break e;case Ii:l=16,r=null;break e}throw Error(U(130,t==null?t:typeof t,""))}return e=nr(l,n,e,i),e.elementType=t,e.type=r,e.lanes=o,e}function jo(t,e,n,r){return t=nr(7,t,r,e),t.lanes=n,t}function gf(t,e,n,r){return t=nr(22,t,r,e),t.elementType=H_,t.lanes=n,t.stateNode={isHidden:!1},t}function Nh(t,e,n){return t=nr(6,t,null,e),t.lanes=n,t}function Rh(t,e,n){return e=nr(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function MT(t,e,n,r,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ch(0),this.expirationTimes=ch(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ch(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Ug(t,e,n,r,i,o,l,s,a){return t=new MT(t,e,n,s,a),e===1?(e=1,o===!0&&(e|=8)):e=0,o=nr(3,null,null,e),t.current=o,o.stateNode=t,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},kg(o),t}function LT(t,e,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Rl,key:r==null?null:""+r,children:t,containerInfo:e,implementation:n}}function Iw(t){if(!t)return lo;t=t._reactInternals;e:{if(sl(t)!==t||t.tag!==1)throw Error(U(170));var e=t;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(Tn(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(U(171))}if(t.tag===1){var n=t.type;if(Tn(n))return D1(t,n,e)}return e}function jw(t,e,n,r,i,o,l,s,a){return t=Ug(n,r,!0,t,i,o,l,s,a),t.context=Iw(null),n=t.current,r=vn(),i=eo(n),o=ci(r,i),o.callback=e??null,Qi(n,o,i),t.current.lanes=i,Au(t,i,r),Nn(t,r),t}function vf(t,e,n,r){var i=e.current,o=vn(),l=eo(i);return n=Iw(n),e.context===null?e.context=n:e.pendingContext=n,e=ci(o,l),e.payload={element:t},r=r===void 0?null:r,r!==null&&(e.callback=r),t=Qi(i,e,l),t!==null&&(Er(t,i,l,o),Lc(t,i,l)),l}function _d(t){if(t=t.current,!t.child)return null;switch(t.child.tag){case 5:return t.child.stateNode;default:return t.child.stateNode}}function y0(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<e?n:e}}function Wg(t,e){y0(t,e),(t=t.alternate)&&y0(t,e)}function DT(){return null}var zw=typeof reportError=="function"?reportError:function(t){console.error(t)};function Vg(t){this._internalRoot=t}yf.prototype.render=Vg.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(U(409));vf(t,e,null,null)};yf.prototype.unmount=Vg.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;Yo(function(){vf(null,t,null,null)}),e[hi]=null}};function yf(t){this._internalRoot=t}yf.prototype.unstable_scheduleHydration=function(t){if(t){var e=m1();t={blockedOn:null,target:t,priority:e};for(var n=0;n<Fi.length&&e!==0&&e<Fi[n].priority;n++);Fi.splice(n,0,t),n===0&&v1(t)}};function Hg(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function xf(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function x0(){}function IT(t,e,n,r,i){if(i){if(typeof r=="function"){var o=r;r=function(){var u=_d(l);o.call(u)}}var l=jw(e,r,t,0,null,!1,!1,"",x0);return t._reactRootContainer=l,t[hi]=l.current,Ga(t.nodeType===8?t.parentNode:t),Yo(),l}for(;i=t.lastChild;)t.removeChild(i);if(typeof r=="function"){var s=r;r=function(){var u=_d(a);s.call(u)}}var a=Ug(t,0,!1,null,null,!1,!1,"",x0);return t._reactRootContainer=a,t[hi]=a.current,Ga(t.nodeType===8?t.parentNode:t),Yo(function(){vf(e,a,n,r)}),a}function _f(t,e,n,r,i){var o=n._reactRootContainer;if(o){var l=o;if(typeof i=="function"){var s=i;i=function(){var a=_d(l);s.call(a)}}vf(e,l,t,i)}else l=IT(n,e,t,i,r);return _d(l)}h1=function(t){switch(t.tag){case 3:var e=t.stateNode;if(e.current.memoizedState.isDehydrated){var n=fa(e.pendingLanes);n!==0&&(cg(e,n|1),Nn(e,Ct()),!(Me&6)&&(ds=Ct()+500,wo()))}break;case 13:Yo(function(){var r=pi(t,1);if(r!==null){var i=vn();Er(r,t,1,i)}}),Wg(t,1)}};dg=function(t){if(t.tag===13){var e=pi(t,134217728);if(e!==null){var n=vn();Er(e,t,134217728,n)}Wg(t,134217728)}};p1=function(t){if(t.tag===13){var e=eo(t),n=pi(t,e);if(n!==null){var r=vn();Er(n,t,e,r)}Wg(t,e)}};m1=function(){return Ue};g1=function(t,e){var n=Ue;try{return Ue=t,e()}finally{Ue=n}};hp=function(t,e,n){switch(e){case"input":if(lp(t,n),e=n.name,n.type==="radio"&&e!=null){for(n=t;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+e)+'][type="radio"]'),e=0;e<n.length;e++){var r=n[e];if(r!==t&&r.form===t.form){var i=cf(r);if(!i)throw Error(U(90));Z_(r),lp(r,i)}}}break;case"textarea":Y_(t,n);break;case"select":e=n.value,e!=null&&Zl(t,!!n.multiple,e,!1)}};n1=jg;r1=Yo;var jT={usingClientEntryPoint:!1,Events:[Lu,Ll,cf,e1,t1,jg]},Qs={findFiberByHostInstance:Po,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},zT={bundleType:Qs.bundleType,version:Qs.version,rendererPackageName:Qs.rendererPackageName,rendererConfig:Qs.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:_i.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=l1(t),t===null?null:t.stateNode},findFiberByHostInstance:Qs.findFiberByHostInstance||DT,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var hc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!hc.isDisabled&&hc.supportsFiber)try{lf=hc.inject(zT),Fr=hc}catch{}}Kn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=jT;Kn.createPortal=function(t,e){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Hg(e))throw Error(U(200));return LT(t,e,null,n)};Kn.createRoot=function(t,e){if(!Hg(t))throw Error(U(299));var n=!1,r="",i=zw;return e!=null&&(e.unstable_strictMode===!0&&(n=!0),e.identifierPrefix!==void 0&&(r=e.identifierPrefix),e.onRecoverableError!==void 0&&(i=e.onRecoverableError)),e=Ug(t,1,!1,null,null,n,!1,r,i),t[hi]=e.current,Ga(t.nodeType===8?t.parentNode:t),new Vg(e)};Kn.findDOMNode=function(t){if(t==null)return null;if(t.nodeType===1)return t;var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(U(188)):(t=Object.keys(t).join(","),Error(U(268,t)));return t=l1(e),t=t===null?null:t.stateNode,t};Kn.flushSync=function(t){return Yo(t)};Kn.hydrate=function(t,e,n){if(!xf(e))throw Error(U(200));return _f(null,t,e,!0,n)};Kn.hydrateRoot=function(t,e,n){if(!Hg(t))throw Error(U(405));var r=n!=null&&n.hydratedSources||null,i=!1,o="",l=zw;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(l=n.onRecoverableError)),e=jw(e,null,t,1,n??null,i,!1,o,l),t[hi]=e.current,Ga(t),r)for(t=0;t<r.length;t++)n=r[t],i=n._getVersion,i=i(n._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[n,i]:e.mutableSourceEagerHydrationData.push(n,i);return new yf(e)};Kn.render=function(t,e,n){if(!xf(e))throw Error(U(200));return _f(null,t,e,!1,n)};Kn.unmountComponentAtNode=function(t){if(!xf(t))throw Error(U(40));return t._reactRootContainer?(Yo(function(){_f(null,null,t,!1,function(){t._reactRootContainer=null,t[hi]=null})}),!0):!1};Kn.unstable_batchedUpdates=jg;Kn.unstable_renderSubtreeIntoContainer=function(t,e,n,r){if(!xf(n))throw Error(U(200));if(t==null||t._reactInternals===void 0)throw Error(U(38));return _f(t,e,n,!1,r)};Kn.version="18.2.0-next-9e3b772b8-20220608";function Fw(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Fw)}catch(t){console.error(t)}}Fw(),j_.exports=Kn;var Yr=j_.exports;const Bw=Ou(Yr),FT=T_({__proto__:null,default:Bw},[Yr]);var _0=Yr;qh.createRoot=_0.createRoot,qh.hydrateRoot=_0.hydrateRoot;var Uw={exports:{}},wf={};/**
|
|
33
33
|
* @license React
|
|
34
34
|
* react-jsx-runtime.production.min.js
|
|
35
35
|
*
|
|
@@ -38,13 +38,13 @@ Error generating stack: `+o.message+`
|
|
|
38
38
|
* This source code is licensed under the MIT license found in the
|
|
39
39
|
* LICENSE file in the root directory of this source tree.
|
|
40
40
|
*/var BT=p,UT=Symbol.for("react.element"),WT=Symbol.for("react.fragment"),VT=Object.prototype.hasOwnProperty,HT=BT.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,KT={key:!0,ref:!0,__self:!0,__source:!0};function Ww(t,e,n){var r,i={},o=null,l=null;n!==void 0&&(o=""+n),e.key!==void 0&&(o=""+e.key),e.ref!==void 0&&(l=e.ref);for(r in e)VT.call(e,r)&&!KT.hasOwnProperty(r)&&(i[r]=e[r]);if(t&&t.defaultProps)for(r in e=t.defaultProps,e)i[r]===void 0&&(i[r]=e[r]);return{$$typeof:UT,type:t,key:o,ref:l,props:i,_owner:HT.current}}wf.Fragment=WT;wf.jsx=Ww;wf.jsxs=Ww;Uw.exports=wf;var x=Uw.exports;function Kp(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Kg(t,e){if(t){if(typeof t=="string")return Kp(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Kp(t,e)}}function Sf(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=Kg(t))||e&&t&&typeof t.length=="number"){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(a){throw a},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
41
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,l=!1,s;return{s:function(){n=n.call(t)},n:function(){var a=n.next();return o=a.done,a},e:function(a){l=!0,s=a},f:function(){try{!o&&n.return!=null&&n.return()}finally{if(l)throw s}}}}function Vw(t){return t.length>0}var Iu=Object.freeze({kind:"ok",value:void 0});function ju(t){return t===void 0?Iu:{kind:"ok",value:t}}function Ur(t){return{kind:"err",error:t}}function
|
|
42
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Kw(t){return tN(t)||nN(t)||Kg(t)||rN()}function xe(t){"@babel/helpers - typeof";return xe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},xe(t)}function iN(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Zw(t){var e=iN(t,"string");return typeof e=="symbol"?e:String(e)}function me(t,e,n){return e=Zw(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function w0(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function
|
|
43
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function no(t,e){return oN(t)||lN(t,e)||Kg(t,e)||sN()}function Gn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function S0(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Zw(r.key),r)}}function Yn(t,e,n){return e&&S0(t.prototype,e),n&&S0(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Zp(t,e){return Zp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Zp(t,e)}function wi(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Zp(t,e)}function wd(t){return wd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},wd(t)}function aN(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Gw(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function uN(t,e){if(e&&(typeof e=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Gw(t)}function Si(t){var e=aN();return function(){var r=wd(t),i;if(e){var o=wd(this).constructor;i=Reflect.construct(r,arguments,o)}else i=r.apply(this,arguments);return uN(this,i)}}var Ei=function(){function t(){Gn(this,t)}return Yn(t,[{key:"appendValidationError",value:function(n,r,i,o){return n?(n[r]?n[r].push({message:i,value:o}):n[r]=[{message:i,value:o}],n):me({},r,[{message:i,value:o}])}}]),t}(),Uc=Symbol("GetSchema"),pn=Symbol("Path"),Ot=Symbol("GetSource");function cN(t){return t[Uc]}var Gg=Yn(function t(e){Gn(this,t),this.span=e}),dN=function(t){wi(n,t);var e=Si(n);function n(r,i){var o;return Gn(this,n),o=e.call(this,i),me(Gw(o),"type","Sym"),o.value=r,o}return Yn(n,[{key:"transpile",value:function(){return this.value}}]),n}(Gg);new dN("()");var nn="_type",Rn="_ref";function Yw(t){var e;if(!t[Rn].startsWith("/public")){var n;return{url:t[Rn]+"?sha256=".concat((n=t.metadata)===null||n===void 0?void 0:n.sha256),metadata:t.metadata}}return{url:t[Rn].slice(7)+"?sha256=".concat((e=t.metadata)===null||e===void 0?void 0:e.sha256),metadata:t.metadata}}function Xw(t){return xe(t)==="object"&&t!==null&&t!==void 0&&("val"in t||"valPath"in t)}function fN(t){return xe(t)==="object"&&t!==null&&t!==void 0&&pn in t&&"val"in t}function hN(t){return t[pn]}function pN(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function E0(t,e,n){return e?Mt(t(Mt(e,n))):Mt(e,n)}function ro(t){return xe(t)==="object"&&t!==null&&(Ot in t||pn in t)}function Mt(t,e,n){if(xe(t)==="object"){if(ro(t))return t;if(Xw(t))return Mt(t.val,t.valPath)}if(t&&t[Rn]&&t[nn]==="file"){var r=t[Rn];if(typeof r!="string")throw Error("Invalid file ref: "+r);return Mt(Yw(t),e,n)}switch(xe(t)){case"function":case"symbol":throw Error("Invalid selector type: ".concat(xe(t),": ").concat(t));case"object":if(t!==null)return new Proxy(t,{has:function(o,l){return l===Ot||l===pn||l==="andThen"||l===Uc?!0:l in o},get:function(o,l){if(l===Ot)return t;if(l===pn)return e;if(l===Uc)return n;if(l==="andThen")return function(a){return E0(a,t,e)};if(Array.isArray(o)){if(l==="filter")return function(a){var u=o.map(function(c,d){return Mt(c,rr(e,d),n==null?void 0:n.item)}).filter(function(c){return a&&a instanceof Ei?a.assert(C0(c)):C0(a(c))});return Mt(u,e,n)};if(l==="map")return function(a){var u=o.map(function(c,d){var f=a(Mt(c,rr(e,d),n==null?void 0:n.item),Mt(d));return ro(f)?f:Mt(f)});return Mt(u,e,n)}}if(Array.isArray(o)&&l==="length")return Mt(o.length);var s=Reflect.get(o,l);return pN(t,l)?Number.isNaN(Number(l))?Mt(s,rr(e,l),n==null?void 0:n.items[l]):Mt(s,rr(e,Number(l)),n==null?void 0:n.item):s}});default:return me(me(me({eq:function(o){var l=o;if(ro(o)&&(l=o[Ot],l instanceof Gg))throw Error("TODO: Cannot evaluate equality with an Expr");return Mt(t===l,void 0)},andThen:function(o){return E0(o,t===void 0?null:t,e)}},Ot,t===void 0?null:t),pn,e),Uc,n)}}function rr(t,e){if(xe(e)==="symbol")throw Error("Cannot create val path of array item with symbol prop: ".concat(e.toString()));return t&&"".concat(t,".").concat(JSON.stringify(e))}function C0(t){if(xe(t)==="object"&&(Ot in t||pn in t)){var e=t[Ot];return e}return t}var Jw=function(t){wi(n,t);var e=Si(n);function n(r){var i,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Gn(this,n),i=e.call(this),i.items=r,i.opt=o,i}return Yn(n,[{key:"validate",value:function(i,o){var l=this,s=!1;return this.opt&&o==null?!1:xe(o)!=="object"?me({},i,[{message:"Expected 'object', got '".concat(xe(o),"'")}]):Array.isArray(o)?me({},i,[{message:"Expected 'object', got 'array'"}]):(Object.entries(this.items).forEach(function(a){var u=no(a,2),c=u[0],d=u[1],f=rr(i,c);if(!f)s=l.appendValidationError(s,i,"Internal error: could not create path at ".concat(!i&&typeof i=="string"?"<empty string>":i," at key ").concat(c),o);else{var h=d.validate(f,o[c]);h&&s?s=ds(ds({},h),s):h&&(s=h)}}),s)}},{key:"assert",value:function(i){if(this.opt&&i==null)return!0;if(!i)return!1;for(var o=0,l=Object.entries(this.items);o<l.length;o++){var s=no(l[o],2),a=s[0],u=s[1];if(!u.assert(i[a]))return!1}return xe(i)==="object"&&!Array.isArray(i)}},{key:"optional",value:function(){return new n(this.items,!0)}},{key:"serialize",value:function(){return{type:"object",items:Object.fromEntries(Object.entries(this.items).map(function(i){var o=no(i,2),l=o[0],s=o[1];return[l,s.serialize()]})),opt:this.opt}}}]),n}(Ei),mN=function(t){wi(n,t);var e=Si(n);function n(r){var i,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Gn(this,n),i=e.call(this),i.item=r,i.opt=o,i}return Yn(n,[{key:"validate",value:function(i,o){var l=this,s=!1;return this.opt&&o==null?!1:xe(o)!=="object"||!Array.isArray(o)?me({},i,[{message:"Expected 'array', got '".concat(xe(o),"'")}]):(o.forEach(function(a,u){var c=rr(i,u);if(!c)s=l.appendValidationError(s,i,"Internal error: could not create path at ".concat(!i&&typeof i=="string"?"<empty string>":i," at index ").concat(u),o);else{var d=l.item.validate(c,a);d&&s?s=ds(ds({},d),s):d&&(s=d)}}),s)}},{key:"assert",value:function(i){if(this.opt&&i==null)return!0;if(!i)return!1;var o=Sf(i),l;try{for(o.s();!(l=o.n()).done;){var s=l.value;if(!this.item.assert(s))return!1}}catch(a){o.e(a)}finally{o.f()}return xe(i)==="object"&&Array.isArray(i)}},{key:"optional",value:function(){return new n(this.item,!0)}},{key:"serialize",value:function(){return{type:"array",item:this.item.serialize(),opt:this.opt}}}]),n}(Ei),k0=function(t){wi(n,t);var e=Si(n);function n(r){var i,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Gn(this,n),i=e.call(this),i.value=r,i.opt=o,i}return Yn(n,[{key:"validate",value:function(i,o){return this.opt&&o==null?!1:typeof o!="string"?me({},i,[{message:"Expected 'string', got '".concat(xe(o),"'"),value:o}]):o!==this.value?me({},i,[{message:"Expected literal '".concat(this.value,"', got '").concat(o,"'"),value:o}]):!1}},{key:"assert",value:function(i){return this.opt&&i==null?!0:typeof i=="string"}},{key:"optional",value:function(){return new n(this.value,!0)}},{key:"serialize",value:function(){return{type:"literal",value:this.value,opt:this.opt}}}]),n}(Ei),gN=function(t){wi(n,t);var e=Si(n);function n(r,i){var o,l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return Gn(this,n),o=e.call(this),o.key=r,o.items=i,o.opt=l,o}return Yn(n,[{key:"validate",value:function(i,o){var l=o,s=!1;if(this.opt&&l==null)return!1;if(!this.key)return me({},i,[{message:"Missing required first argument in union"}]);var a=this.key;if(!Array.isArray(this.items))return me({},i,[{message:"A union schema must take more than 1 schema arguments",fatal:!0}]);if(typeof a=="string"){if(this.items.some(function(R){return!(R instanceof Jw)}))return me({},i,[{message:"Key is a string, so all schema items must be objects",fatal:!0}]);var u=this.items,c=u.map(function(R){return R.serialize()}),d=c.filter(function(R){return R.type!=="object"||R.items[a].type!=="literal"});if(d.length>0)return me({},i,[{message:"All schema items must be objects with a key: ".concat(a," that is a literal schema. Found: ").concat(JSON.stringify(d,null,2)),fatal:!0}]);var f=c,h=f.filter(function(R){return R.items[a].opt});if(h.length>1)return me({},i,[{message:"Schema cannot have an optional keys: ".concat(a),fatal:!0}]);if(xe(l)!=="object")return me({},i,[{message:"Expected an object"}]);var g=l;if(g[a]===void 0)return me({},i,[{message:"Missing required key: ".concat(a)}]);var m=[],w=Sf(f),v;try{for(w.s();!(v=w.n()).done;){var y=v.value,_=y.items[a];if(_.type==="literal")if(!m.includes(_.value))m.push(_.value);else return me({},i,[{message:"Found duplicate key in schema: ".concat(_.value),fatal:!0}])}}catch(R){w.e(R)}finally{w.f()}var S=u.find(function(R){return!R.items[a].validate(i,g[a])});if(!S){var E=rr(i,a);if(!E)throw new Error("Internal error: could not create path at ".concat(!i&&typeof i=="string"?"<empty string>":i," at key ").concat(a));return me({},E,[{message:'Invalid key: "'.concat(a,'". Value was: "').concat(g[a],'". Valid values: ').concat(f.map(function(R){var b=R.items[a];if(b.type==="literal"&&b.value)return'"'.concat(b.value,'"');throw new Error("Expected literal schema, got ".concat(JSON.stringify(b,null,2)))}).join(", "))}])}var $=S.validate(i,g);if($)return $}else if(a instanceof k0){if(this.items.some(function(R){return!(R instanceof k0)}))return me({},i,[{message:"Key is a literal schema, so all schema items must be literals",fatal:!0}]);var C=[a].concat(Kw(this.items));if(typeof l=="string"){var N=C.some(function(R){return!R.validate(i,l)});if(!N)return me({},i,[{message:"Union must match one of the following: ".concat(C.map(function(R){return'"'.concat(R.value,'"')}).join(", "))}])}}else return me({},i,[{message:"Expected a string or literal"}]);return s}},{key:"assert",value:function(i){return!0}},{key:"optional",value:function(){return new n(this.key,this.items,!0)}},{key:"serialize",value:function(){return typeof this.key=="string"?{type:"union",key:this.key,items:this.items.map(function(i){return i.serialize()}),opt:this.opt}:{type:"union",items:this.items.map(function(i){return i.serialize()}),opt:this.opt}}}]),n}(Ei),vN=function(t){wi(n,t);var e=Si(n);function n(r){var i,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Gn(this,n),i=e.call(this),i.options=r,i.opt=o,i}return Yn(n,[{key:"validate",value:function(i,o){return!1}},{key:"assert",value:function(i){return!0}},{key:"optional",value:function(){return new n(this.options,!0)}},{key:"serialize",value:function(){return{type:"richtext",opt:this.opt}}}]),n}(Ei),yN=function(t){wi(n,t);var e=Si(n);function n(r){var i,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Gn(this,n),i=e.call(this),i.options=r,i.opt=o,i}return Yn(n,[{key:"validate",value:function(i,o){return this.opt&&o==null?!1:o==null?me({},i,[{message:"Non-optional image was null or undefined.",value:o}]):typeof o[Rn]!="string"?me({},i,[{message:"Image did not have a file reference string. Got: ".concat(xe(o[Rn])),value:o}]):o[nn]!=="file"?me({},i,[{message:"Image did not have the valid file extension type. Got: ".concat(o[nn]),value:o}]):o.metadata?me({},i,[{message:"Found metadata, but it could not be validated. Image metadata must be an object with the required props: width (positive number), height (positive number) and sha256 (string of length 64 of the base16 hash).",value:o,fixes:["image:replace-metadata"]}]):me({},i,[{message:"Could not validate Image metadata.",value:o,fixes:["image:add-metadata"]}])}},{key:"assert",value:function(i){return this.opt&&i==null?!0:(i==null?void 0:i[Rn])==="image"&&(i==null?void 0:i[nn])==="file"}},{key:"optional",value:function(){return new n(this.options,!0)}},{key:"serialize",value:function(){return{type:"image",options:this.options,opt:this.opt}}}]),n}(Ei),xN=function(t){wi(n,t);var e=Si(n);function n(r){var i,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Gn(this,n),i=e.call(this),i.item=r,i.opt=o,i}return Yn(n,[{key:"validate",value:function(i,o){var l=this,s=!1;return this.opt&&o==null?!1:xe(o)!=="object"?me({},i,[{message:"Expected 'object', got '".concat(xe(o),"'")}]):Array.isArray(o)?me({},i,[{message:"Expected 'object', got 'array'"}]):(Object.entries(o).forEach(function(a){var u=no(a,2),c=u[0],d=u[1],f=rr(i,c);if(!f)s=l.appendValidationError(s,i,"Internal error: could not create path at ".concat(!i&&typeof i=="string"?"<empty string>":i," at key ").concat(d),o);else{var h=l.item.validate(f,d);h&&s?s=ds(ds({},h),s):h&&(s=h)}}),s)}},{key:"assert",value:function(i){if(this.opt&&i==null)return!0;if(!i)return!1;for(var o=0,l=Object.entries(i);o<l.length;o++){var s=no(l[o],2),a=s[1];if(!this.item.assert(a))return!1}return xe(i)==="object"&&!Array.isArray(i)}},{key:"optional",value:function(){return new n(this.item,!0)}},{key:"serialize",value:function(){return{type:"record",item:this.item.serialize(),opt:this.opt}}}]),n}(Ei);function _N(t){var e=t[Ot];if(e instanceof Gg)throw Error("Cannot get raw source of an Expr");var n=e;return n}function wN(t){return t.indexOf(".")===-1?[t,""]:[t.slice(0,t.indexOf(".")),t.slice(t.indexOf(".")+1)]}function SN(t){return t instanceof Jw||xe(t)==="object"&&"type"in t&&t.type==="object"}function EN(t){return t instanceof xN||xe(t)==="object"&&"type"in t&&t.type==="record"}function CN(t){return t instanceof mN||xe(t)==="object"&&"type"in t&&t.type==="array"}function kN(t){return t instanceof gN||xe(t)==="object"&&"type"in t&&t.type==="union"}function bN(t){return t instanceof vN||xe(t)==="object"&&"type"in t&&t.type==="richtext"}function $N(t){return t instanceof yN||xe(t)==="object"&&"type"in t&&t.type==="image"}function TN(t,e,n){for(var r=NN(t),i=Kw(r),o=n,l=e,s=function(){var c=r.shift();if(c===void 0)throw Error("Unexpected undefined part");if(CN(o)){if(Number.isNaN(Number(c)))throw Error("Invalid path: array schema ".concat(JSON.stringify(o)," must have a number as path, but got ").concat(c,". Path: ").concat(t));if(xe(l)!=="object"&&!Array.isArray(l))throw Error("Schema type error: expected source to be type of array, but got ".concat(xe(l)));if(!l[c]){var d;throw Error("Invalid path: array source (length: ".concat((d=l)===null||d===void 0?void 0:d.length,") did not have index ").concat(c," from path: ").concat(t))}l=l[c],o=o.item}else if(EN(o)){if(typeof c!="string")throw Error("Invalid path: record schema ".concat(o," must have path: ").concat(c," as string"));if(xe(l)!=="object"&&!Array.isArray(l))throw Error("Schema type error: expected source to be type of record, but got ".concat(xe(l)));if(!l[c])throw Error("Invalid path: record source did not have key ".concat(c," from path: ").concat(t));l=l[c],o=o.item}else if(SN(o)){if(xe(l)!=="object")throw Error("Schema type error: expected source to be type of object, but got ".concat(xe(l)));if(!l[c])throw Error("Invalid path: object source did not have key ".concat(c," from path: ").concat(t));l=l[c],o=o.items[c]}else{if($N(o))return{v:{path:i.slice(0,i.length-r.length-1).map(function(m){return JSON.stringify(m)}).join("."),schema:o,source:l}};if(kN(o)){var f=o.key;if(!f)return{v:{path:i.map(function(m){return Number.isNaN(Number(m))?JSON.stringify(m):m}).join("."),schema:o,source:l}};var h=l[f];if(!h)throw Error("Invalid path: union source ".concat(o," did not have required key ").concat(f," in path: ").concat(t));var g=o.items.find(function(m){var w;return(m==null||(w=m.items)===null||w===void 0||(w=w[f])===null||w===void 0?void 0:w.value)===h});if(!g)throw Error("Invalid path: union schema ".concat(o," did not have a child object with ").concat(f," of value ").concat(h," in path: ").concat(t));o=g.items[c],l=l[c]}else{if(bN(o))return{v:{path:i.slice(0,i.length-r.length-1).map(function(m){return JSON.stringify(m)}).join("."),schema:o,source:l}};throw Error("Invalid path: ".concat(c," resolved to an unexpected schema ").concat(JSON.stringify(o)))}}},a;r.length>0;)if(a=s(),a)return a.v;if(r.length>0)throw Error("Invalid path: ".concat(r.join(".")," is not a valid path"));return{path:i.map(function(u){return Number.isNaN(Number(u))?JSON.stringify(u):u}).join("."),schema:o,source:l}}function NN(t){for(var e=[],n=0;n<t.length;){var r="";if(t[n]==='"'){for(n++;n<t.length&&t[n]!=='"';)t[n]==="\\"&&t[n+1]==='"'?(r+='"',n++):r+=t[n],n++;if(t[n]!=='"'){var i;throw new Error("Invalid input (".concat(JSON.stringify(t),"): Missing closing double quote: ").concat((i=t[n])!==null&&i!==void 0?i:"at end of string"," (char: ").concat(n,"; length: ").concat(t.length,")"))}}else for(;n<t.length&&t[n]!==".";)r+=t[n],n++;r!==""&&e.push(r),n++}return e}var RN=function(t){wi(n,t);var e=Si(n);function n(r){var i,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return Gn(this,n),i=e.call(this),i.options=r,i.opt=o,i.isRaw=l,i}return Yn(n,[{key:"validate",value:function(i,o){var l,s,a;if(this.opt&&o==null)return!1;if(typeof o!="string")return me({},i,[{message:"Expected 'string', got '".concat(xe(o),"'"),value:o}]);var u=[];return(l=this.options)!==null&&l!==void 0&&l.maxLength&&o.length>this.options.maxLength&&u.push({message:"Expected string to be at most ".concat(this.options.maxLength," characters long, got ").concat(o.length),value:o}),(s=this.options)!==null&&s!==void 0&&s.minLength&&o.length<this.options.minLength&&u.push({message:"Expected string to be at least ".concat(this.options.minLength," characters long, got ").concat(o.length),value:o}),(a=this.options)!==null&&a!==void 0&&a.regexp&&!this.options.regexp.test(o)&&u.push({message:"Expected string to match reg exp: ".concat(this.options.regexp.toString(),", got '").concat(o,"'"),value:o}),u.length>0?me({},i,u):!1}},{key:"assert",value:function(i){return this.opt&&i==null?!0:typeof i=="string"}},{key:"optional",value:function(){return new n(this.options,!0,this.isRaw)}},{key:"raw",value:function(){return new n(this.options,this.opt,!0)}},{key:"serialize",value:function(){var i,o,l;return{type:"string",options:{maxLength:(i=this.options)===null||i===void 0?void 0:i.maxLength,minLength:(o=this.options)===null||o===void 0?void 0:o.minLength,regexp:((l=this.options)===null||l===void 0?void 0:l.regexp)&&{source:this.options.regexp.source,flags:this.options.regexp.flags}},opt:this.opt,raw:this.isRaw}}}]),n}(Ei);function ON(t){return Qw(MN(t))}function PN(t){return ro(t)?xe(t[Ot])==="object"&&t[Ot]!==null&&Array.isArray(t[Ot]):Array.isArray(t)}function AN(t){return ro(t)?xe(t[Ot])==="object"&&t[Ot]!==null&&!Array.isArray(t[Ot]):xe(t)==="object"}function MN(t){var e=Mt(t);function n(r){var i=PN(r),o=AN(r);if(i){var l=Ot in r?r[Ot]:r,s=pn in r?r[pn]:void 0;return{val:l.map(function(c,d){return n(ro(c)?c:Mt(c,rr(s,d)))}),valPath:s}}else if(o){var a=Ot in r?r[Ot]:r,u=pn in r?r[pn]:void 0;return{val:a!==null&&Object.fromEntries(Object.entries(a).map(function(c){var d=no(c,2),f=d[0],h=d[1];return[f,n(ro(h)?h:Mt(h,rr(u,f)))]})),valPath:u}}else return ro(r)?{val:n(r[Ot]),valPath:r[pn]}:r}return n(e)}function Gp(t){var e=Xw(t)?t.val:t;switch(xe(e)){case"function":case"symbol":throw Error("Invalid val type: ".concat(xe(e)));case"object":return e===null?null:Array.isArray(e)?e.map(Gp):Object.fromEntries(Object.entries(e).map(function(n){var r=no(n,2),i=r[0],o=r[1];return[i,o&&Gp(o)]}));default:return e}}function Qw(t){var e=t.val;switch(xe(e)){case"function":case"symbol":throw Error("Invalid val type: ".concat(xe(e)));case"object":if(e!==null)return new Proxy(e,{has:function(r,i){return i==="val"||i===pn?!0:b0(r,i)},get:function(r,i){if(i===pn)return t.valPath;if(i==="val")return Gp(t);if(Array.isArray(r)&&i==="length")return r.length;if(b0(e,i)){var o,l;return Qw({val:Reflect.get(r,i).val,valPath:(o=(l=Reflect.get(r,i))===null||l===void 0?void 0:l.valPath)!==null&&o!==void 0?o:rr(t.valPath,Array.isArray(r)?Number(i):i)})}return Reflect.get(r,i)}});default:return me(me({},pn,t.valPath),"val",t.val)}}function b0(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var LN=[1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998],Ve=function(t){return t[t.inputBytes=64]="inputBytes",t[t.inputWords=16]="inputWords",t[t.highIndex=14]="highIndex",t[t.lowIndex=15]="lowIndex",t[t.workWords=64]="workWords",t[t.allocBytes=80]="allocBytes",t[t.allocWords=20]="allocWords",t[t.allocTotal=8e3]="allocTotal",t}(Ve||{}),$0={sha256:1};function DN(t){if(t&&!$0[t]&&!$0[t.toLowerCase()])throw new Error("Digest method not supported");return new IN}var IN=function(){function t(){Gn(this,t),me(this,"A",1779033703),me(this,"B",-1150833019),me(this,"C",1013904242),me(this,"D",-1521486534),me(this,"E",1359893119),me(this,"F",-1694144372),me(this,"G",528734635),me(this,"H",1541459225),me(this,"_size",0),me(this,"_sp",0),(!pc||qs>=Ve.allocTotal)&&(pc=new ArrayBuffer(Ve.allocTotal),qs=0),this._byte=new Uint8Array(pc,qs,Ve.allocBytes),this._word=new Int32Array(pc,qs,Ve.allocWords),qs+=Ve.allocBytes}return Yn(t,[{key:"update",value:function(n){if(typeof n=="string")return this._utf8(n);if(n==null)throw new TypeError("Invalid type: "+xe(n));var r=n.byteOffset,i=n.byteLength,o=i/Ve.inputBytes|0,l=0;if(o&&!(r&3)&&!(this._size%Ve.inputBytes)){for(var s=new Int32Array(n.buffer,r,o*Ve.inputWords);o--;)this._int32(s,l>>2),l+=Ve.inputBytes;this._size+=l}var a=n.BYTES_PER_ELEMENT;if(a!==1&&n.buffer){var u=new Uint8Array(n.buffer,r+l,i-l);return this._uint8(u)}return l===i?this:this._uint8(n,l)}},{key:"_uint8",value:function(n,r){var i=this._byte,o=this._word,l=n.length;for(r=r|0;r<l;){for(var s=this._size%Ve.inputBytes,a=s;r<l&&a<Ve.inputBytes;)i[a++]=n[r++];a>=Ve.inputBytes&&this._int32(o),this._size+=a-s}return this}},{key:"_utf8",value:function(n){for(var r=this._byte,i=this._word,o=n.length,l=this._sp,s=0;s<o;){for(var a=this._size%Ve.inputBytes,u=a;s<o&&u<Ve.inputBytes;){var c=n.charCodeAt(s++)|0;c<128?r[u++]=c:c<2048?(r[u++]=192|c>>>6,r[u++]=128|c&63):c<55296||c>57343?(r[u++]=224|c>>>12,r[u++]=128|c>>>6&63,r[u++]=128|c&63):l?(c=((l&1023)<<10)+(c&1023)+65536,r[u++]=240|c>>>18,r[u++]=128|c>>>12&63,r[u++]=128|c>>>6&63,r[u++]=128|c&63,l=0):l=c}u>=Ve.inputBytes&&(this._int32(i),i[0]=i[Ve.inputWords]),this._size+=u-a}return this._sp=l,this}},{key:"_int32",value:function(n,r){var i=this.A,o=this.B,l=this.C,s=this.D,a=this.E,u=this.F,c=this.G,d=this.H,f=0;for(r=r|0;f<Ve.inputWords;)bo[f++]=hr(n[r++]);for(f=Ve.inputWords;f<Ve.workWords;f++)bo[f]=HN(bo[f-2])+bo[f-7]+VN(bo[f-15])+bo[f-16]|0;for(f=0;f<Ve.workWords;f++){var h=d+WN(a)+FN(a,u,c)+LN[f]+bo[f]|0,g=UN(i)+BN(i,o,l)|0;d=c,c=u,u=a,a=s+h|0,s=l,l=o,o=i,i=h+g|0}this.A=i+this.A|0,this.B=o+this.B|0,this.C=l+this.C|0,this.D=s+this.D|0,this.E=a+this.E|0,this.F=u+this.F|0,this.G=c+this.G|0,this.H=d+this.H|0}},{key:"digest",value:function(n){var r=this._byte,i=this._word,o=this._size%Ve.inputBytes|0;for(r[o++]=128;o&3;)r[o++]=0;if(o>>=2,o>Ve.highIndex){for(;o<Ve.inputWords;)i[o++]=0;o=0,this._int32(i)}for(;o<Ve.inputWords;)i[o++]=0;var l=this._size*8,s=(l&4294967295)>>>0,a=(l-s)/4294967296;return a&&(i[Ve.highIndex]=hr(a)),s&&(i[Ve.lowIndex]=hr(s)),this._int32(i),n==="hex"?this._hex():this._bin()}},{key:"_hex",value:function(){var n=this.A,r=this.B,i=this.C,o=this.D,l=this.E,s=this.F,a=this.G,u=this.H;return Oi(n)+Oi(r)+Oi(i)+Oi(o)+Oi(l)+Oi(s)+Oi(a)+Oi(u)}},{key:"_bin",value:function(){var n=this.A,r=this.B,i=this.C,o=this.D,l=this.E,s=this.F,a=this.G,u=this.H,c=this._byte,d=this._word;return d[0]=hr(n),d[1]=hr(r),d[2]=hr(i),d[3]=hr(o),d[4]=hr(l),d[5]=hr(s),d[6]=hr(a),d[7]=hr(u),c.slice(0,32)}}]),t}(),bo=new Int32Array(Ve.workWords),pc,qs=0,Oi=function(e){return(e+4294967296).toString(16).substr(-8)},jN=function(e){return e<<24&4278190080|e<<8&16711680|e>>8&65280|e>>24&255},zN=function(e){return e},hr=KN()?zN:jN,FN=function(e,n,r){return r^e&(n^r)},BN=function(e,n,r){return e&n|r&(e|n)},UN=function(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)},WN=function(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)},VN=function(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3},HN=function(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10};function KN(){var t=new Uint8Array(new Uint16Array([65279]).buffer);return t[0]===254}var ZN=function(e){return DN().update(e).digest("hex")};function ru(){ru=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(O,A,k){O[A]=k.value},o=typeof Symbol=="function"?Symbol:{},l=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",a=o.toStringTag||"@@toStringTag";function u(O,A,k){return Object.defineProperty(O,A,{value:k,enumerable:!0,configurable:!0,writable:!0}),O[A]}try{u({},"")}catch{u=function(A,k,j){return A[k]=j}}function c(O,A,k,j){var I=A&&A.prototype instanceof v?A:v,Z=Object.create(I.prototype),ne=new V(j||[]);return i(Z,"_invoke",{value:b(O,k,ne)}),Z}function d(O,A,k){try{return{type:"normal",arg:O.call(A,k)}}catch(j){return{type:"throw",arg:j}}}e.wrap=c;var f="suspendedStart",h="suspendedYield",g="executing",m="completed",w={};function v(){}function y(){}function _(){}var S={};u(S,l,function(){return this});var E=Object.getPrototypeOf,$=E&&E(E(H([])));$&&$!==n&&r.call($,l)&&(S=$);var C=_.prototype=v.prototype=Object.create(S);function N(O){["next","throw","return"].forEach(function(A){u(O,A,function(k){return this._invoke(A,k)})})}function R(O,A){function k(I,Z,ne,ke){var ye=d(O[I],O,Z);if(ye.type!=="throw"){var We=ye.arg,Fe=We.value;return Fe&&typeof Fe=="object"&&r.call(Fe,"__await")?A.resolve(Fe.__await).then(function(te){k("next",te,ne,ke)},function(te){k("throw",te,ne,ke)}):A.resolve(Fe).then(function(te){We.value=te,ne(We)},function(te){return k("throw",te,ne,ke)})}ke(ye.arg)}var j;i(this,"_invoke",{value:function(I,Z){function ne(){return new A(function(ke,ye){k(I,Z,ke,ye)})}return j=j?j.then(ne,ne):ne()}})}function b(O,A,k){var j=f;return function(I,Z){if(j===g)throw new Error("Generator is already running");if(j===m){if(I==="throw")throw Z;return{value:t,done:!0}}for(k.method=I,k.arg=Z;;){var ne=k.delegate;if(ne){var ke=L(ne,k);if(ke){if(ke===w)continue;return ke}}if(k.method==="next")k.sent=k._sent=k.arg;else if(k.method==="throw"){if(j===f)throw j=m,k.arg;k.dispatchException(k.arg)}else k.method==="return"&&k.abrupt("return",k.arg);j=g;var ye=d(O,A,k);if(ye.type==="normal"){if(j=k.done?m:h,ye.arg===w)continue;return{value:ye.arg,done:k.done}}ye.type==="throw"&&(j=m,k.method="throw",k.arg=ye.arg)}}}function L(O,A){var k=A.method,j=O.iterator[k];if(j===t)return A.delegate=null,k==="throw"&&O.iterator.return&&(A.method="return",A.arg=t,L(O,A),A.method==="throw")||k!=="return"&&(A.method="throw",A.arg=new TypeError("The iterator does not provide a '"+k+"' method")),w;var I=d(j,O.iterator,A.arg);if(I.type==="throw")return A.method="throw",A.arg=I.arg,A.delegate=null,w;var Z=I.arg;return Z?Z.done?(A[O.resultName]=Z.value,A.next=O.nextLoc,A.method!=="return"&&(A.method="next",A.arg=t),A.delegate=null,w):Z:(A.method="throw",A.arg=new TypeError("iterator result is not an object"),A.delegate=null,w)}function F(O){var A={tryLoc:O[0]};1 in O&&(A.catchLoc=O[1]),2 in O&&(A.finallyLoc=O[2],A.afterLoc=O[3]),this.tryEntries.push(A)}function le(O){var A=O.completion||{};A.type="normal",delete A.arg,O.completion=A}function V(O){this.tryEntries=[{tryLoc:"root"}],O.forEach(F,this),this.reset(!0)}function H(O){if(O||O===""){var A=O[l];if(A)return A.call(O);if(typeof O.next=="function")return O;if(!isNaN(O.length)){var k=-1,j=function I(){for(;++k<O.length;)if(r.call(O,k))return I.value=O[k],I.done=!1,I;return I.value=t,I.done=!0,I};return j.next=j}}throw new TypeError(typeof O+" is not iterable")}return y.prototype=_,i(C,"constructor",{value:_,configurable:!0}),i(_,"constructor",{value:y,configurable:!0}),y.displayName=u(_,a,"GeneratorFunction"),e.isGeneratorFunction=function(O){var A=typeof O=="function"&&O.constructor;return!!A&&(A===y||(A.displayName||A.name)==="GeneratorFunction")},e.mark=function(O){return Object.setPrototypeOf?Object.setPrototypeOf(O,_):(O.__proto__=_,u(O,a,"GeneratorFunction")),O.prototype=Object.create(C),O},e.awrap=function(O){return{__await:O}},N(R.prototype),u(R.prototype,s,function(){return this}),e.AsyncIterator=R,e.async=function(O,A,k,j,I){I===void 0&&(I=Promise);var Z=new R(c(O,A,k,j),I);return e.isGeneratorFunction(A)?Z:Z.next().then(function(ne){return ne.done?ne.value:Z.next()})},N(C),u(C,a,"Generator"),u(C,l,function(){return this}),u(C,"toString",function(){return"[object Generator]"}),e.keys=function(O){var A=Object(O),k=[];for(var j in A)k.push(j);return k.reverse(),function I(){for(;k.length;){var Z=k.pop();if(Z in A)return I.value=Z,I.done=!1,I}return I.done=!0,I}},e.values=H,V.prototype={constructor:V,reset:function(O){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(le),!O)for(var A in this)A.charAt(0)==="t"&&r.call(this,A)&&!isNaN(+A.slice(1))&&(this[A]=t)},stop:function(){this.done=!0;var O=this.tryEntries[0].completion;if(O.type==="throw")throw O.arg;return this.rval},dispatchException:function(O){if(this.done)throw O;var A=this;function k(ye,We){return Z.type="throw",Z.arg=O,A.next=ye,We&&(A.method="next",A.arg=t),!!We}for(var j=this.tryEntries.length-1;j>=0;--j){var I=this.tryEntries[j],Z=I.completion;if(I.tryLoc==="root")return k("end");if(I.tryLoc<=this.prev){var ne=r.call(I,"catchLoc"),ke=r.call(I,"finallyLoc");if(ne&&ke){if(this.prev<I.catchLoc)return k(I.catchLoc,!0);if(this.prev<I.finallyLoc)return k(I.finallyLoc)}else if(ne){if(this.prev<I.catchLoc)return k(I.catchLoc,!0)}else{if(!ke)throw new Error("try statement without catch or finally");if(this.prev<I.finallyLoc)return k(I.finallyLoc)}}}},abrupt:function(O,A){for(var k=this.tryEntries.length-1;k>=0;--k){var j=this.tryEntries[k];if(j.tryLoc<=this.prev&&r.call(j,"finallyLoc")&&this.prev<j.finallyLoc){var I=j;break}}I&&(O==="break"||O==="continue")&&I.tryLoc<=A&&A<=I.finallyLoc&&(I=null);var Z=I?I.completion:{};return Z.type=O,Z.arg=A,I?(this.method="next",this.next=I.finallyLoc,w):this.complete(Z)},complete:function(O,A){if(O.type==="throw")throw O.arg;return O.type==="break"||O.type==="continue"?this.next=O.arg:O.type==="return"?(this.rval=this.arg=O.arg,this.method="return",this.next="end"):O.type==="normal"&&A&&(this.next=A),w},finish:function(O){for(var A=this.tryEntries.length-1;A>=0;--A){var k=this.tryEntries[A];if(k.finallyLoc===O)return this.complete(k.completion,k.afterLoc),le(k),w}},catch:function(O){for(var A=this.tryEntries.length-1;A>=0;--A){var k=this.tryEntries[A];if(k.tryLoc===O){var j=k.completion;if(j.type==="throw"){var I=j.arg;le(k)}return I}}throw new Error("illegal catch attempt")},delegateYield:function(O,A,k){return this.delegate={iterator:H(O),resultName:A,nextLoc:k},this.method==="next"&&(this.arg=t),w}},e}function T0(t,e,n,r,i,o,l){try{var s=t[o](l),a=s.value}catch(u){n(u);return}s.done?e(a):Promise.resolve(a).then(r,i)}function qw(t){return function(){var e=this,n=arguments;return new Promise(function(r,i){var o=t.apply(e,n);function l(a){T0(o,r,i,l,s,"next",a)}function s(a){T0(o,r,i,l,s,"throw",a)}l(void 0)})}}var GN=function(){function t(e){Gn(this,t),this.host=e}return Yn(t,[{key:"getDisableUrl",value:function(n){return"".concat(this.host,"/disable?redirect_to=").concat(encodeURIComponent(n))}},{key:"getLoginUrl",value:function(n){return"".concat(this.host,"/authorize?redirect_to=").concat(encodeURIComponent(n))}},{key:"getEnableUrl",value:function(n){return"".concat(this.host,"/enable?redirect_to=").concat(encodeURIComponent(n))}},{key:"getPatches",value:function(){var e=qw(ru().mark(function r(i){var o,l,s;return ru().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return o=i.patchIds,l=i.headers,s=o?"?".concat(o.map(function(c){return"".concat(c,"=").concat(encodeURIComponent(c))}).join("&")):"",u.abrupt("return",fetch("".concat(this.host,"/patches/~").concat(s),{headers:l||{"Content-Type":"application/json"}}).then(function(c){return ta(c)}).catch(ea));case 3:case"end":return u.stop()}},r,this)}));function n(r){return e.apply(this,arguments)}return n}()},{key:"getEditUrl",value:function(){return"".concat(this.host,"/static/edit")}},{key:"postPatches",value:function(n,r,i){return fetch("".concat(this.host,"/patches/~"),{headers:i||{"Content-Type":"application/json"},method:"POST",body:JSON.stringify(me({},n,r))}).then(function(o){return ta(o)}).catch(ea)}},{key:"getSession",value:function(){return fetch("".concat(this.host,"/session")).then(function(n){return ta(n).catch(ea)})}},{key:"getTree",value:function(n){var r=n.patch,i=r===void 0?!1:r,o=n.includeSchema,l=o===void 0?!1:o,s=n.includeSource,a=s===void 0?!1:s,u=n.treePath,c=u===void 0?"/":u,d=n.headers,f=new URLSearchParams;return f.set("patch",i.toString()),f.set("schema",l.toString()),f.set("source",a.toString()),fetch("".concat(this.host,"/tree/~").concat(c,"?").concat(f.toString()),{headers:d}).then(function(h){return ta(h)}).catch(ea)}},{key:"postCommit",value:function(n){var r=n.patches,i=n.headers;return fetch("".concat(this.host,"/commit"),{method:"POST",body:JSON.stringify({patches:r}),headers:i||{"Content-Type":"application/json"}}).then(function(o){return ta(o)}).catch(ea)}}]),t}();function ea(t){return Ur({statusCode:500,message:t instanceof Error?t.message:"Unknown error"})}function ta(t){return Yp.apply(this,arguments)}function Yp(){return Yp=qw(ru().mark(function t(e){var n;return ru().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:if(i.prev=0,!e.ok){i.next=9;break}return i.t0=zo,i.next=5,e.json();case 5:return i.t1=i.sent,i.abrupt("return",i.t0.ok.call(i.t0,i.t1));case 9:return i.prev=9,i.next=12,e.json();case 12:return n=i.sent,i.abrupt("return",Ur({statusCode:e.status,message:n.message||e.statusText,details:n.details||Object.fromEntries(Object.entries(n).filter(function(o){var l=no(o,1),s=l[0];return s!=="message"}))}));case 16:return i.prev=16,i.t2=i.catch(9),i.abrupt("return",Ur({statusCode:e.status,message:e.statusText}));case 19:i.next=24;break;case 21:return i.prev=21,i.t3=i.catch(0),i.abrupt("return",Ur({message:i.t3 instanceof Error?i.t3.message:"Unknown error"}));case 24:case"end":return i.stop()}},t,null,[[0,21],[9,16]])})),Yp.apply(this,arguments)}var On={convertFileSource:Yw,getSchema:cN,getValPath:hN,getVal:ON,getSource:_N,resolvePath:TN,splitModuleIdAndModulePath:wN,isVal:fN,createValPathOfItem:rr,getSHA256Hash:ZN,createPatchJSONPath:function(e){return"/".concat(e.split(".").map(function(n){return n&&YN(n)}).join("/"))},VAL_ENABLE_COOKIE_NAME:"val_enable",VAL_STATE_COOKIE:"val_state",VAL_SESSION_COOKIE:"val_session"};function YN(t){try{return JSON.parse(t)}catch{return t}}var eS={exports:{}};/*!
|
|
41
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,l=!1,s;return{s:function(){n=n.call(t)},n:function(){var a=n.next();return o=a.done,a},e:function(a){l=!0,s=a},f:function(){try{!o&&n.return!=null&&n.return()}finally{if(l)throw s}}}}function Vw(t){return t.length>0}var Iu=Object.freeze({kind:"ok",value:void 0});function ju(t){return t===void 0?Iu:{kind:"ok",value:t}}function Ur(t){return{kind:"err",error:t}}function ks(t){return t===Iu||t.kind==="ok"}function Zg(t){return t!==Iu&&t.kind==="err"}function Hw(t){var e=[],n=[],r=Sf(t),i;try{for(r.s();!(i=r.n()).done;){var o=i.value;ks(o)?e.push(o.value):n.push(o.error)}}catch(l){r.e(l)}finally{r.f()}return Vw(n)?Ur(n):ju(e)}function ZT(t){return Hw(t)}function GT(t){var e=[],n=Sf(t),r;try{for(n.s();!(r=n.n()).done;){var i=r.value;Zg(i)&&e.push(i.error)}}catch(o){n.e(o)}finally{n.f()}return Vw(e)?Ur(e):Iu}function YT(t,e){return function(n){for(var r=ju(e),i=0;i<n.length&&ks(r);++i)r=t(r.value,n[i],i);return r}}function XT(t){return function(e){return ks(e)?ju(t(e.value)):e}}function JT(t){return function(e){return ks(e)?t(e.value):e}}function QT(t){return function(e){return Zg(e)?Ur(t(e.error)):e}}function qT(t,e){return function(n){return t(n)?ju(n):Ur(e(n))}}var eN=function(e,n){return function(r){return ks(r)?e(r.value)?r:Ur(n(r.value)):r}},zo=Object.freeze({__proto__:null,voidOk:Iu,ok:ju,err:Ur,isOk:ks,isErr:Zg,allT:Hw,all:ZT,allV:GT,flatMapReduce:YT,map:XT,flatMap:JT,mapErr:QT,fromPredicate:qT,filterOrElse:eN});function tN(t){if(Array.isArray(t))return Kp(t)}function nN(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function rN(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
42
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Kw(t){return tN(t)||nN(t)||Kg(t)||rN()}function xe(t){"@babel/helpers - typeof";return xe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},xe(t)}function iN(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Zw(t){var e=iN(t,"string");return typeof e=="symbol"?e:String(e)}function me(t,e,n){return e=Zw(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function w0(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function fs(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?w0(Object(n),!0).forEach(function(r){me(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):w0(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function oN(t){if(Array.isArray(t))return t}function lN(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,o,l,s=[],a=!0,u=!1;try{if(o=(n=n.call(t)).next,e===0){if(Object(n)!==n)return;a=!1}else for(;!(a=(r=o.call(n)).done)&&(s.push(r.value),s.length!==e);a=!0);}catch(c){u=!0,i=c}finally{try{if(!a&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(u)throw i}}return s}}function sN(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
43
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function no(t,e){return oN(t)||lN(t,e)||Kg(t,e)||sN()}function Gn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function S0(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Zw(r.key),r)}}function Yn(t,e,n){return e&&S0(t.prototype,e),n&&S0(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Zp(t,e){return Zp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Zp(t,e)}function wi(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Zp(t,e)}function wd(t){return wd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},wd(t)}function aN(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Gw(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function uN(t,e){if(e&&(typeof e=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Gw(t)}function Si(t){var e=aN();return function(){var r=wd(t),i;if(e){var o=wd(this).constructor;i=Reflect.construct(r,arguments,o)}else i=r.apply(this,arguments);return uN(this,i)}}var Ei=function(){function t(){Gn(this,t)}return Yn(t,[{key:"appendValidationError",value:function(n,r,i,o){return n?(n[r]?n[r].push({message:i,value:o}):n[r]=[{message:i,value:o}],n):me({},r,[{message:i,value:o}])}}]),t}(),Uc=Symbol("GetSchema"),pn=Symbol("Path"),Ot=Symbol("GetSource");function cN(t){return t[Uc]}var Gg=Yn(function t(e){Gn(this,t),this.span=e}),dN=function(t){wi(n,t);var e=Si(n);function n(r,i){var o;return Gn(this,n),o=e.call(this,i),me(Gw(o),"type","Sym"),o.value=r,o}return Yn(n,[{key:"transpile",value:function(){return this.value}}]),n}(Gg);new dN("()");var nn="_type",Rn="_ref";function Yw(t){var e;if(!t[Rn].startsWith("/public")){var n;return{url:t[Rn]+"?sha256=".concat((n=t.metadata)===null||n===void 0?void 0:n.sha256),metadata:t.metadata}}return{url:t[Rn].slice(7)+"?sha256=".concat((e=t.metadata)===null||e===void 0?void 0:e.sha256),metadata:t.metadata}}function Xw(t){return xe(t)==="object"&&t!==null&&t!==void 0&&("val"in t||"valPath"in t)}function fN(t){return xe(t)==="object"&&t!==null&&t!==void 0&&pn in t&&"val"in t}function hN(t){return t[pn]}function pN(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function E0(t,e,n){return e?Mt(t(Mt(e,n))):Mt(e,n)}function ro(t){return xe(t)==="object"&&t!==null&&(Ot in t||pn in t)}function Mt(t,e,n){if(xe(t)==="object"){if(ro(t))return t;if(Xw(t))return Mt(t.val,t.valPath)}if(t&&t[Rn]&&t[nn]==="file"){var r=t[Rn];if(typeof r!="string")throw Error("Invalid file ref: "+r);return Mt(Yw(t),e,n)}switch(xe(t)){case"function":case"symbol":throw Error("Invalid selector type: ".concat(xe(t),": ").concat(t));case"object":if(t!==null)return new Proxy(t,{has:function(o,l){return l===Ot||l===pn||l==="andThen"||l===Uc?!0:l in o},get:function(o,l){if(l===Ot)return t;if(l===pn)return e;if(l===Uc)return n;if(l==="andThen")return function(a){return E0(a,t,e)};if(Array.isArray(o)){if(l==="filter")return function(a){var u=o.map(function(c,d){return Mt(c,rr(e,d),n==null?void 0:n.item)}).filter(function(c){return a&&a instanceof Ei?a.assert(C0(c)):C0(a(c))});return Mt(u,e,n)};if(l==="map")return function(a){var u=o.map(function(c,d){var f=a(Mt(c,rr(e,d),n==null?void 0:n.item),Mt(d));return ro(f)?f:Mt(f)});return Mt(u,e,n)}}if(Array.isArray(o)&&l==="length")return Mt(o.length);var s=Reflect.get(o,l);return pN(t,l)?Number.isNaN(Number(l))?Mt(s,rr(e,l),n==null?void 0:n.items[l]):Mt(s,rr(e,Number(l)),n==null?void 0:n.item):s}});default:return me(me(me({eq:function(o){var l=o;if(ro(o)&&(l=o[Ot],l instanceof Gg))throw Error("TODO: Cannot evaluate equality with an Expr");return Mt(t===l,void 0)},andThen:function(o){return E0(o,t===void 0?null:t,e)}},Ot,t===void 0?null:t),pn,e),Uc,n)}}function rr(t,e){if(xe(e)==="symbol")throw Error("Cannot create val path of array item with symbol prop: ".concat(e.toString()));return t&&"".concat(t,".").concat(JSON.stringify(e))}function C0(t){if(xe(t)==="object"&&(Ot in t||pn in t)){var e=t[Ot];return e}return t}var Jw=function(t){wi(n,t);var e=Si(n);function n(r){var i,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Gn(this,n),i=e.call(this),i.items=r,i.opt=o,i}return Yn(n,[{key:"validate",value:function(i,o){var l=this,s=!1;return this.opt&&o==null?!1:xe(o)!=="object"?me({},i,[{message:"Expected 'object', got '".concat(xe(o),"'")}]):Array.isArray(o)?me({},i,[{message:"Expected 'object', got 'array'"}]):(Object.entries(this.items).forEach(function(a){var u=no(a,2),c=u[0],d=u[1],f=rr(i,c);if(!f)s=l.appendValidationError(s,i,"Internal error: could not create path at ".concat(!i&&typeof i=="string"?"<empty string>":i," at key ").concat(c),o);else{var h=d.validate(f,o[c]);h&&s?s=fs(fs({},h),s):h&&(s=h)}}),s)}},{key:"assert",value:function(i){if(this.opt&&i==null)return!0;if(!i)return!1;for(var o=0,l=Object.entries(this.items);o<l.length;o++){var s=no(l[o],2),a=s[0],u=s[1];if(!u.assert(i[a]))return!1}return xe(i)==="object"&&!Array.isArray(i)}},{key:"optional",value:function(){return new n(this.items,!0)}},{key:"serialize",value:function(){return{type:"object",items:Object.fromEntries(Object.entries(this.items).map(function(i){var o=no(i,2),l=o[0],s=o[1];return[l,s.serialize()]})),opt:this.opt}}}]),n}(Ei),mN=function(t){wi(n,t);var e=Si(n);function n(r){var i,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Gn(this,n),i=e.call(this),i.item=r,i.opt=o,i}return Yn(n,[{key:"validate",value:function(i,o){var l=this,s=!1;return this.opt&&o==null?!1:xe(o)!=="object"||!Array.isArray(o)?me({},i,[{message:"Expected 'array', got '".concat(xe(o),"'")}]):(o.forEach(function(a,u){var c=rr(i,u);if(!c)s=l.appendValidationError(s,i,"Internal error: could not create path at ".concat(!i&&typeof i=="string"?"<empty string>":i," at index ").concat(u),o);else{var d=l.item.validate(c,a);d&&s?s=fs(fs({},d),s):d&&(s=d)}}),s)}},{key:"assert",value:function(i){if(this.opt&&i==null)return!0;if(!i)return!1;var o=Sf(i),l;try{for(o.s();!(l=o.n()).done;){var s=l.value;if(!this.item.assert(s))return!1}}catch(a){o.e(a)}finally{o.f()}return xe(i)==="object"&&Array.isArray(i)}},{key:"optional",value:function(){return new n(this.item,!0)}},{key:"serialize",value:function(){return{type:"array",item:this.item.serialize(),opt:this.opt}}}]),n}(Ei),k0=function(t){wi(n,t);var e=Si(n);function n(r){var i,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Gn(this,n),i=e.call(this),i.value=r,i.opt=o,i}return Yn(n,[{key:"validate",value:function(i,o){return this.opt&&o==null?!1:typeof o!="string"?me({},i,[{message:"Expected 'string', got '".concat(xe(o),"'"),value:o}]):o!==this.value?me({},i,[{message:"Expected literal '".concat(this.value,"', got '").concat(o,"'"),value:o}]):!1}},{key:"assert",value:function(i){return this.opt&&i==null?!0:typeof i=="string"}},{key:"optional",value:function(){return new n(this.value,!0)}},{key:"serialize",value:function(){return{type:"literal",value:this.value,opt:this.opt}}}]),n}(Ei),gN=function(t){wi(n,t);var e=Si(n);function n(r,i){var o,l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return Gn(this,n),o=e.call(this),o.key=r,o.items=i,o.opt=l,o}return Yn(n,[{key:"validate",value:function(i,o){var l=o,s=!1;if(this.opt&&l==null)return!1;if(!this.key)return me({},i,[{message:"Missing required first argument in union"}]);var a=this.key;if(!Array.isArray(this.items))return me({},i,[{message:"A union schema must take more than 1 schema arguments",fatal:!0}]);if(typeof a=="string"){if(this.items.some(function(R){return!(R instanceof Jw)}))return me({},i,[{message:"Key is a string, so all schema items must be objects",fatal:!0}]);var u=this.items,c=u.map(function(R){return R.serialize()}),d=c.filter(function(R){return R.type!=="object"||R.items[a].type!=="literal"});if(d.length>0)return me({},i,[{message:"All schema items must be objects with a key: ".concat(a," that is a literal schema. Found: ").concat(JSON.stringify(d,null,2)),fatal:!0}]);var f=c,h=f.filter(function(R){return R.items[a].opt});if(h.length>1)return me({},i,[{message:"Schema cannot have an optional keys: ".concat(a),fatal:!0}]);if(xe(l)!=="object")return me({},i,[{message:"Expected an object"}]);var g=l;if(g[a]===void 0)return me({},i,[{message:"Missing required key: ".concat(a)}]);var m=[],w=Sf(f),v;try{for(w.s();!(v=w.n()).done;){var y=v.value,_=y.items[a];if(_.type==="literal")if(!m.includes(_.value))m.push(_.value);else return me({},i,[{message:"Found duplicate key in schema: ".concat(_.value),fatal:!0}])}}catch(R){w.e(R)}finally{w.f()}var S=u.find(function(R){return!R.items[a].validate(i,g[a])});if(!S){var E=rr(i,a);if(!E)throw new Error("Internal error: could not create path at ".concat(!i&&typeof i=="string"?"<empty string>":i," at key ").concat(a));return me({},E,[{message:'Invalid key: "'.concat(a,'". Value was: "').concat(g[a],'". Valid values: ').concat(f.map(function(R){var b=R.items[a];if(b.type==="literal"&&b.value)return'"'.concat(b.value,'"');throw new Error("Expected literal schema, got ".concat(JSON.stringify(b,null,2)))}).join(", "))}])}var $=S.validate(i,g);if($)return $}else if(a instanceof k0){if(this.items.some(function(R){return!(R instanceof k0)}))return me({},i,[{message:"Key is a literal schema, so all schema items must be literals",fatal:!0}]);var C=[a].concat(Kw(this.items));if(typeof l=="string"){var N=C.some(function(R){return!R.validate(i,l)});if(!N)return me({},i,[{message:"Union must match one of the following: ".concat(C.map(function(R){return'"'.concat(R.value,'"')}).join(", "))}])}}else return me({},i,[{message:"Expected a string or literal"}]);return s}},{key:"assert",value:function(i){return!0}},{key:"optional",value:function(){return new n(this.key,this.items,!0)}},{key:"serialize",value:function(){return typeof this.key=="string"?{type:"union",key:this.key,items:this.items.map(function(i){return i.serialize()}),opt:this.opt}:{type:"union",items:this.items.map(function(i){return i.serialize()}),opt:this.opt}}}]),n}(Ei),vN=function(t){wi(n,t);var e=Si(n);function n(r){var i,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Gn(this,n),i=e.call(this),i.options=r,i.opt=o,i}return Yn(n,[{key:"validate",value:function(i,o){return!1}},{key:"assert",value:function(i){return!0}},{key:"optional",value:function(){return new n(this.options,!0)}},{key:"serialize",value:function(){return{type:"richtext",opt:this.opt}}}]),n}(Ei),yN=function(t){wi(n,t);var e=Si(n);function n(r){var i,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Gn(this,n),i=e.call(this),i.options=r,i.opt=o,i}return Yn(n,[{key:"validate",value:function(i,o){return this.opt&&o==null?!1:o==null?me({},i,[{message:"Non-optional image was null or undefined.",value:o}]):typeof o[Rn]!="string"?me({},i,[{message:"Image did not have a file reference string. Got: ".concat(xe(o[Rn])),value:o}]):o[nn]!=="file"?me({},i,[{message:"Image did not have the valid file extension type. Got: ".concat(o[nn]),value:o}]):o.metadata?me({},i,[{message:"Found metadata, but it could not be validated. Image metadata must be an object with the required props: width (positive number), height (positive number) and sha256 (string of length 64 of the base16 hash).",value:o,fixes:["image:replace-metadata"]}]):me({},i,[{message:"Could not validate Image metadata.",value:o,fixes:["image:add-metadata"]}])}},{key:"assert",value:function(i){return this.opt&&i==null?!0:(i==null?void 0:i[Rn])==="image"&&(i==null?void 0:i[nn])==="file"}},{key:"optional",value:function(){return new n(this.options,!0)}},{key:"serialize",value:function(){return{type:"image",options:this.options,opt:this.opt}}}]),n}(Ei),xN=function(t){wi(n,t);var e=Si(n);function n(r){var i,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Gn(this,n),i=e.call(this),i.item=r,i.opt=o,i}return Yn(n,[{key:"validate",value:function(i,o){var l=this,s=!1;return this.opt&&o==null?!1:xe(o)!=="object"?me({},i,[{message:"Expected 'object', got '".concat(xe(o),"'")}]):Array.isArray(o)?me({},i,[{message:"Expected 'object', got 'array'"}]):(Object.entries(o).forEach(function(a){var u=no(a,2),c=u[0],d=u[1],f=rr(i,c);if(!f)s=l.appendValidationError(s,i,"Internal error: could not create path at ".concat(!i&&typeof i=="string"?"<empty string>":i," at key ").concat(d),o);else{var h=l.item.validate(f,d);h&&s?s=fs(fs({},h),s):h&&(s=h)}}),s)}},{key:"assert",value:function(i){if(this.opt&&i==null)return!0;if(!i)return!1;for(var o=0,l=Object.entries(i);o<l.length;o++){var s=no(l[o],2),a=s[1];if(!this.item.assert(a))return!1}return xe(i)==="object"&&!Array.isArray(i)}},{key:"optional",value:function(){return new n(this.item,!0)}},{key:"serialize",value:function(){return{type:"record",item:this.item.serialize(),opt:this.opt}}}]),n}(Ei);function _N(t){var e=t[Ot];if(e instanceof Gg)throw Error("Cannot get raw source of an Expr");var n=e;return n}function wN(t){return t.indexOf(".")===-1?[t,""]:[t.slice(0,t.indexOf(".")),t.slice(t.indexOf(".")+1)]}function SN(t){return t instanceof Jw||xe(t)==="object"&&"type"in t&&t.type==="object"}function EN(t){return t instanceof xN||xe(t)==="object"&&"type"in t&&t.type==="record"}function CN(t){return t instanceof mN||xe(t)==="object"&&"type"in t&&t.type==="array"}function kN(t){return t instanceof gN||xe(t)==="object"&&"type"in t&&t.type==="union"}function bN(t){return t instanceof vN||xe(t)==="object"&&"type"in t&&t.type==="richtext"}function $N(t){return t instanceof yN||xe(t)==="object"&&"type"in t&&t.type==="image"}function TN(t,e,n){for(var r=NN(t),i=Kw(r),o=n,l=e,s=function(){var c=r.shift();if(c===void 0)throw Error("Unexpected undefined part");if(CN(o)){if(Number.isNaN(Number(c)))throw Error("Invalid path: array schema ".concat(JSON.stringify(o)," must have a number as path, but got ").concat(c,". Path: ").concat(t));if(xe(l)!=="object"&&!Array.isArray(l))throw Error("Schema type error: expected source to be type of array, but got ".concat(xe(l)));if(!l[c]){var d;throw Error("Invalid path: array source (length: ".concat((d=l)===null||d===void 0?void 0:d.length,") did not have index ").concat(c," from path: ").concat(t))}l=l[c],o=o.item}else if(EN(o)){if(typeof c!="string")throw Error("Invalid path: record schema ".concat(o," must have path: ").concat(c," as string"));if(xe(l)!=="object"&&!Array.isArray(l))throw Error("Schema type error: expected source to be type of record, but got ".concat(xe(l)));if(!l[c])throw Error("Invalid path: record source did not have key ".concat(c," from path: ").concat(t));l=l[c],o=o.item}else if(SN(o)){if(xe(l)!=="object")throw Error("Schema type error: expected source to be type of object, but got ".concat(xe(l)));if(!l[c])throw Error("Invalid path: object source did not have key ".concat(c," from path: ").concat(t));l=l[c],o=o.items[c]}else{if($N(o))return{v:{path:i.slice(0,i.length-r.length-1).map(function(m){return JSON.stringify(m)}).join("."),schema:o,source:l}};if(kN(o)){var f=o.key;if(!f)return{v:{path:i.map(function(m){return Number.isNaN(Number(m))?JSON.stringify(m):m}).join("."),schema:o,source:l}};var h=l[f];if(!h)throw Error("Invalid path: union source ".concat(o," did not have required key ").concat(f," in path: ").concat(t));var g=o.items.find(function(m){var w;return(m==null||(w=m.items)===null||w===void 0||(w=w[f])===null||w===void 0?void 0:w.value)===h});if(!g)throw Error("Invalid path: union schema ".concat(o," did not have a child object with ").concat(f," of value ").concat(h," in path: ").concat(t));o=g.items[c],l=l[c]}else{if(bN(o))return{v:{path:i.slice(0,i.length-r.length-1).map(function(m){return JSON.stringify(m)}).join("."),schema:o,source:l}};throw Error("Invalid path: ".concat(c," resolved to an unexpected schema ").concat(JSON.stringify(o)))}}},a;r.length>0;)if(a=s(),a)return a.v;if(r.length>0)throw Error("Invalid path: ".concat(r.join(".")," is not a valid path"));return{path:i.map(function(u){return Number.isNaN(Number(u))?JSON.stringify(u):u}).join("."),schema:o,source:l}}function NN(t){for(var e=[],n=0;n<t.length;){var r="";if(t[n]==='"'){for(n++;n<t.length&&t[n]!=='"';)t[n]==="\\"&&t[n+1]==='"'?(r+='"',n++):r+=t[n],n++;if(t[n]!=='"'){var i;throw new Error("Invalid input (".concat(JSON.stringify(t),"): Missing closing double quote: ").concat((i=t[n])!==null&&i!==void 0?i:"at end of string"," (char: ").concat(n,"; length: ").concat(t.length,")"))}}else for(;n<t.length&&t[n]!==".";)r+=t[n],n++;r!==""&&e.push(r),n++}return e}var RN=function(t){wi(n,t);var e=Si(n);function n(r){var i,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return Gn(this,n),i=e.call(this),i.options=r,i.opt=o,i.isRaw=l,i}return Yn(n,[{key:"validate",value:function(i,o){var l,s,a;if(this.opt&&o==null)return!1;if(typeof o!="string")return me({},i,[{message:"Expected 'string', got '".concat(xe(o),"'"),value:o}]);var u=[];return(l=this.options)!==null&&l!==void 0&&l.maxLength&&o.length>this.options.maxLength&&u.push({message:"Expected string to be at most ".concat(this.options.maxLength," characters long, got ").concat(o.length),value:o}),(s=this.options)!==null&&s!==void 0&&s.minLength&&o.length<this.options.minLength&&u.push({message:"Expected string to be at least ".concat(this.options.minLength," characters long, got ").concat(o.length),value:o}),(a=this.options)!==null&&a!==void 0&&a.regexp&&!this.options.regexp.test(o)&&u.push({message:"Expected string to match reg exp: ".concat(this.options.regexp.toString(),", got '").concat(o,"'"),value:o}),u.length>0?me({},i,u):!1}},{key:"assert",value:function(i){return this.opt&&i==null?!0:typeof i=="string"}},{key:"optional",value:function(){return new n(this.options,!0,this.isRaw)}},{key:"raw",value:function(){return new n(this.options,this.opt,!0)}},{key:"serialize",value:function(){var i,o,l;return{type:"string",options:{maxLength:(i=this.options)===null||i===void 0?void 0:i.maxLength,minLength:(o=this.options)===null||o===void 0?void 0:o.minLength,regexp:((l=this.options)===null||l===void 0?void 0:l.regexp)&&{source:this.options.regexp.source,flags:this.options.regexp.flags}},opt:this.opt,raw:this.isRaw}}}]),n}(Ei);function ON(t){return Qw(MN(t))}function PN(t){return ro(t)?xe(t[Ot])==="object"&&t[Ot]!==null&&Array.isArray(t[Ot]):Array.isArray(t)}function AN(t){return ro(t)?xe(t[Ot])==="object"&&t[Ot]!==null&&!Array.isArray(t[Ot]):xe(t)==="object"}function MN(t){var e=Mt(t);function n(r){var i=PN(r),o=AN(r);if(i){var l=Ot in r?r[Ot]:r,s=pn in r?r[pn]:void 0;return{val:l.map(function(c,d){return n(ro(c)?c:Mt(c,rr(s,d)))}),valPath:s}}else if(o){var a=Ot in r?r[Ot]:r,u=pn in r?r[pn]:void 0;return{val:a!==null&&Object.fromEntries(Object.entries(a).map(function(c){var d=no(c,2),f=d[0],h=d[1];return[f,n(ro(h)?h:Mt(h,rr(u,f)))]})),valPath:u}}else return ro(r)?{val:n(r[Ot]),valPath:r[pn]}:r}return n(e)}function Gp(t){var e=Xw(t)?t.val:t;switch(xe(e)){case"function":case"symbol":throw Error("Invalid val type: ".concat(xe(e)));case"object":return e===null?null:Array.isArray(e)?e.map(Gp):Object.fromEntries(Object.entries(e).map(function(n){var r=no(n,2),i=r[0],o=r[1];return[i,o&&Gp(o)]}));default:return e}}function Qw(t){var e=t.val;switch(xe(e)){case"function":case"symbol":throw Error("Invalid val type: ".concat(xe(e)));case"object":if(e!==null)return new Proxy(e,{has:function(r,i){return i==="val"||i===pn?!0:b0(r,i)},get:function(r,i){if(i===pn)return t.valPath;if(i==="val")return Gp(t);if(Array.isArray(r)&&i==="length")return r.length;if(b0(e,i)){var o,l;return Qw({val:Reflect.get(r,i).val,valPath:(o=(l=Reflect.get(r,i))===null||l===void 0?void 0:l.valPath)!==null&&o!==void 0?o:rr(t.valPath,Array.isArray(r)?Number(i):i)})}return Reflect.get(r,i)}});default:return me(me({},pn,t.valPath),"val",t.val)}}function b0(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var LN=[1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998],Ve=function(t){return t[t.inputBytes=64]="inputBytes",t[t.inputWords=16]="inputWords",t[t.highIndex=14]="highIndex",t[t.lowIndex=15]="lowIndex",t[t.workWords=64]="workWords",t[t.allocBytes=80]="allocBytes",t[t.allocWords=20]="allocWords",t[t.allocTotal=8e3]="allocTotal",t}(Ve||{}),$0={sha256:1};function DN(t){if(t&&!$0[t]&&!$0[t.toLowerCase()])throw new Error("Digest method not supported");return new IN}var IN=function(){function t(){Gn(this,t),me(this,"A",1779033703),me(this,"B",-1150833019),me(this,"C",1013904242),me(this,"D",-1521486534),me(this,"E",1359893119),me(this,"F",-1694144372),me(this,"G",528734635),me(this,"H",1541459225),me(this,"_size",0),me(this,"_sp",0),(!pc||qs>=Ve.allocTotal)&&(pc=new ArrayBuffer(Ve.allocTotal),qs=0),this._byte=new Uint8Array(pc,qs,Ve.allocBytes),this._word=new Int32Array(pc,qs,Ve.allocWords),qs+=Ve.allocBytes}return Yn(t,[{key:"update",value:function(n){if(typeof n=="string")return this._utf8(n);if(n==null)throw new TypeError("Invalid type: "+xe(n));var r=n.byteOffset,i=n.byteLength,o=i/Ve.inputBytes|0,l=0;if(o&&!(r&3)&&!(this._size%Ve.inputBytes)){for(var s=new Int32Array(n.buffer,r,o*Ve.inputWords);o--;)this._int32(s,l>>2),l+=Ve.inputBytes;this._size+=l}var a=n.BYTES_PER_ELEMENT;if(a!==1&&n.buffer){var u=new Uint8Array(n.buffer,r+l,i-l);return this._uint8(u)}return l===i?this:this._uint8(n,l)}},{key:"_uint8",value:function(n,r){var i=this._byte,o=this._word,l=n.length;for(r=r|0;r<l;){for(var s=this._size%Ve.inputBytes,a=s;r<l&&a<Ve.inputBytes;)i[a++]=n[r++];a>=Ve.inputBytes&&this._int32(o),this._size+=a-s}return this}},{key:"_utf8",value:function(n){for(var r=this._byte,i=this._word,o=n.length,l=this._sp,s=0;s<o;){for(var a=this._size%Ve.inputBytes,u=a;s<o&&u<Ve.inputBytes;){var c=n.charCodeAt(s++)|0;c<128?r[u++]=c:c<2048?(r[u++]=192|c>>>6,r[u++]=128|c&63):c<55296||c>57343?(r[u++]=224|c>>>12,r[u++]=128|c>>>6&63,r[u++]=128|c&63):l?(c=((l&1023)<<10)+(c&1023)+65536,r[u++]=240|c>>>18,r[u++]=128|c>>>12&63,r[u++]=128|c>>>6&63,r[u++]=128|c&63,l=0):l=c}u>=Ve.inputBytes&&(this._int32(i),i[0]=i[Ve.inputWords]),this._size+=u-a}return this._sp=l,this}},{key:"_int32",value:function(n,r){var i=this.A,o=this.B,l=this.C,s=this.D,a=this.E,u=this.F,c=this.G,d=this.H,f=0;for(r=r|0;f<Ve.inputWords;)bo[f++]=hr(n[r++]);for(f=Ve.inputWords;f<Ve.workWords;f++)bo[f]=HN(bo[f-2])+bo[f-7]+VN(bo[f-15])+bo[f-16]|0;for(f=0;f<Ve.workWords;f++){var h=d+WN(a)+FN(a,u,c)+LN[f]+bo[f]|0,g=UN(i)+BN(i,o,l)|0;d=c,c=u,u=a,a=s+h|0,s=l,l=o,o=i,i=h+g|0}this.A=i+this.A|0,this.B=o+this.B|0,this.C=l+this.C|0,this.D=s+this.D|0,this.E=a+this.E|0,this.F=u+this.F|0,this.G=c+this.G|0,this.H=d+this.H|0}},{key:"digest",value:function(n){var r=this._byte,i=this._word,o=this._size%Ve.inputBytes|0;for(r[o++]=128;o&3;)r[o++]=0;if(o>>=2,o>Ve.highIndex){for(;o<Ve.inputWords;)i[o++]=0;o=0,this._int32(i)}for(;o<Ve.inputWords;)i[o++]=0;var l=this._size*8,s=(l&4294967295)>>>0,a=(l-s)/4294967296;return a&&(i[Ve.highIndex]=hr(a)),s&&(i[Ve.lowIndex]=hr(s)),this._int32(i),n==="hex"?this._hex():this._bin()}},{key:"_hex",value:function(){var n=this.A,r=this.B,i=this.C,o=this.D,l=this.E,s=this.F,a=this.G,u=this.H;return Oi(n)+Oi(r)+Oi(i)+Oi(o)+Oi(l)+Oi(s)+Oi(a)+Oi(u)}},{key:"_bin",value:function(){var n=this.A,r=this.B,i=this.C,o=this.D,l=this.E,s=this.F,a=this.G,u=this.H,c=this._byte,d=this._word;return d[0]=hr(n),d[1]=hr(r),d[2]=hr(i),d[3]=hr(o),d[4]=hr(l),d[5]=hr(s),d[6]=hr(a),d[7]=hr(u),c.slice(0,32)}}]),t}(),bo=new Int32Array(Ve.workWords),pc,qs=0,Oi=function(e){return(e+4294967296).toString(16).substr(-8)},jN=function(e){return e<<24&4278190080|e<<8&16711680|e>>8&65280|e>>24&255},zN=function(e){return e},hr=KN()?zN:jN,FN=function(e,n,r){return r^e&(n^r)},BN=function(e,n,r){return e&n|r&(e|n)},UN=function(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)},WN=function(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)},VN=function(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3},HN=function(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10};function KN(){var t=new Uint8Array(new Uint16Array([65279]).buffer);return t[0]===254}var ZN=function(e){return DN().update(e).digest("hex")};function ru(){ru=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(O,A,k){O[A]=k.value},o=typeof Symbol=="function"?Symbol:{},l=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",a=o.toStringTag||"@@toStringTag";function u(O,A,k){return Object.defineProperty(O,A,{value:k,enumerable:!0,configurable:!0,writable:!0}),O[A]}try{u({},"")}catch{u=function(A,k,j){return A[k]=j}}function c(O,A,k,j){var I=A&&A.prototype instanceof v?A:v,Z=Object.create(I.prototype),ne=new V(j||[]);return i(Z,"_invoke",{value:b(O,k,ne)}),Z}function d(O,A,k){try{return{type:"normal",arg:O.call(A,k)}}catch(j){return{type:"throw",arg:j}}}e.wrap=c;var f="suspendedStart",h="suspendedYield",g="executing",m="completed",w={};function v(){}function y(){}function _(){}var S={};u(S,l,function(){return this});var E=Object.getPrototypeOf,$=E&&E(E(H([])));$&&$!==n&&r.call($,l)&&(S=$);var C=_.prototype=v.prototype=Object.create(S);function N(O){["next","throw","return"].forEach(function(A){u(O,A,function(k){return this._invoke(A,k)})})}function R(O,A){function k(I,Z,ne,ke){var ye=d(O[I],O,Z);if(ye.type!=="throw"){var We=ye.arg,Fe=We.value;return Fe&&typeof Fe=="object"&&r.call(Fe,"__await")?A.resolve(Fe.__await).then(function(te){k("next",te,ne,ke)},function(te){k("throw",te,ne,ke)}):A.resolve(Fe).then(function(te){We.value=te,ne(We)},function(te){return k("throw",te,ne,ke)})}ke(ye.arg)}var j;i(this,"_invoke",{value:function(I,Z){function ne(){return new A(function(ke,ye){k(I,Z,ke,ye)})}return j=j?j.then(ne,ne):ne()}})}function b(O,A,k){var j=f;return function(I,Z){if(j===g)throw new Error("Generator is already running");if(j===m){if(I==="throw")throw Z;return{value:t,done:!0}}for(k.method=I,k.arg=Z;;){var ne=k.delegate;if(ne){var ke=L(ne,k);if(ke){if(ke===w)continue;return ke}}if(k.method==="next")k.sent=k._sent=k.arg;else if(k.method==="throw"){if(j===f)throw j=m,k.arg;k.dispatchException(k.arg)}else k.method==="return"&&k.abrupt("return",k.arg);j=g;var ye=d(O,A,k);if(ye.type==="normal"){if(j=k.done?m:h,ye.arg===w)continue;return{value:ye.arg,done:k.done}}ye.type==="throw"&&(j=m,k.method="throw",k.arg=ye.arg)}}}function L(O,A){var k=A.method,j=O.iterator[k];if(j===t)return A.delegate=null,k==="throw"&&O.iterator.return&&(A.method="return",A.arg=t,L(O,A),A.method==="throw")||k!=="return"&&(A.method="throw",A.arg=new TypeError("The iterator does not provide a '"+k+"' method")),w;var I=d(j,O.iterator,A.arg);if(I.type==="throw")return A.method="throw",A.arg=I.arg,A.delegate=null,w;var Z=I.arg;return Z?Z.done?(A[O.resultName]=Z.value,A.next=O.nextLoc,A.method!=="return"&&(A.method="next",A.arg=t),A.delegate=null,w):Z:(A.method="throw",A.arg=new TypeError("iterator result is not an object"),A.delegate=null,w)}function F(O){var A={tryLoc:O[0]};1 in O&&(A.catchLoc=O[1]),2 in O&&(A.finallyLoc=O[2],A.afterLoc=O[3]),this.tryEntries.push(A)}function le(O){var A=O.completion||{};A.type="normal",delete A.arg,O.completion=A}function V(O){this.tryEntries=[{tryLoc:"root"}],O.forEach(F,this),this.reset(!0)}function H(O){if(O||O===""){var A=O[l];if(A)return A.call(O);if(typeof O.next=="function")return O;if(!isNaN(O.length)){var k=-1,j=function I(){for(;++k<O.length;)if(r.call(O,k))return I.value=O[k],I.done=!1,I;return I.value=t,I.done=!0,I};return j.next=j}}throw new TypeError(typeof O+" is not iterable")}return y.prototype=_,i(C,"constructor",{value:_,configurable:!0}),i(_,"constructor",{value:y,configurable:!0}),y.displayName=u(_,a,"GeneratorFunction"),e.isGeneratorFunction=function(O){var A=typeof O=="function"&&O.constructor;return!!A&&(A===y||(A.displayName||A.name)==="GeneratorFunction")},e.mark=function(O){return Object.setPrototypeOf?Object.setPrototypeOf(O,_):(O.__proto__=_,u(O,a,"GeneratorFunction")),O.prototype=Object.create(C),O},e.awrap=function(O){return{__await:O}},N(R.prototype),u(R.prototype,s,function(){return this}),e.AsyncIterator=R,e.async=function(O,A,k,j,I){I===void 0&&(I=Promise);var Z=new R(c(O,A,k,j),I);return e.isGeneratorFunction(A)?Z:Z.next().then(function(ne){return ne.done?ne.value:Z.next()})},N(C),u(C,a,"Generator"),u(C,l,function(){return this}),u(C,"toString",function(){return"[object Generator]"}),e.keys=function(O){var A=Object(O),k=[];for(var j in A)k.push(j);return k.reverse(),function I(){for(;k.length;){var Z=k.pop();if(Z in A)return I.value=Z,I.done=!1,I}return I.done=!0,I}},e.values=H,V.prototype={constructor:V,reset:function(O){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(le),!O)for(var A in this)A.charAt(0)==="t"&&r.call(this,A)&&!isNaN(+A.slice(1))&&(this[A]=t)},stop:function(){this.done=!0;var O=this.tryEntries[0].completion;if(O.type==="throw")throw O.arg;return this.rval},dispatchException:function(O){if(this.done)throw O;var A=this;function k(ye,We){return Z.type="throw",Z.arg=O,A.next=ye,We&&(A.method="next",A.arg=t),!!We}for(var j=this.tryEntries.length-1;j>=0;--j){var I=this.tryEntries[j],Z=I.completion;if(I.tryLoc==="root")return k("end");if(I.tryLoc<=this.prev){var ne=r.call(I,"catchLoc"),ke=r.call(I,"finallyLoc");if(ne&&ke){if(this.prev<I.catchLoc)return k(I.catchLoc,!0);if(this.prev<I.finallyLoc)return k(I.finallyLoc)}else if(ne){if(this.prev<I.catchLoc)return k(I.catchLoc,!0)}else{if(!ke)throw new Error("try statement without catch or finally");if(this.prev<I.finallyLoc)return k(I.finallyLoc)}}}},abrupt:function(O,A){for(var k=this.tryEntries.length-1;k>=0;--k){var j=this.tryEntries[k];if(j.tryLoc<=this.prev&&r.call(j,"finallyLoc")&&this.prev<j.finallyLoc){var I=j;break}}I&&(O==="break"||O==="continue")&&I.tryLoc<=A&&A<=I.finallyLoc&&(I=null);var Z=I?I.completion:{};return Z.type=O,Z.arg=A,I?(this.method="next",this.next=I.finallyLoc,w):this.complete(Z)},complete:function(O,A){if(O.type==="throw")throw O.arg;return O.type==="break"||O.type==="continue"?this.next=O.arg:O.type==="return"?(this.rval=this.arg=O.arg,this.method="return",this.next="end"):O.type==="normal"&&A&&(this.next=A),w},finish:function(O){for(var A=this.tryEntries.length-1;A>=0;--A){var k=this.tryEntries[A];if(k.finallyLoc===O)return this.complete(k.completion,k.afterLoc),le(k),w}},catch:function(O){for(var A=this.tryEntries.length-1;A>=0;--A){var k=this.tryEntries[A];if(k.tryLoc===O){var j=k.completion;if(j.type==="throw"){var I=j.arg;le(k)}return I}}throw new Error("illegal catch attempt")},delegateYield:function(O,A,k){return this.delegate={iterator:H(O),resultName:A,nextLoc:k},this.method==="next"&&(this.arg=t),w}},e}function T0(t,e,n,r,i,o,l){try{var s=t[o](l),a=s.value}catch(u){n(u);return}s.done?e(a):Promise.resolve(a).then(r,i)}function qw(t){return function(){var e=this,n=arguments;return new Promise(function(r,i){var o=t.apply(e,n);function l(a){T0(o,r,i,l,s,"next",a)}function s(a){T0(o,r,i,l,s,"throw",a)}l(void 0)})}}var GN=function(){function t(e){Gn(this,t),this.host=e}return Yn(t,[{key:"getDisableUrl",value:function(n){return"".concat(this.host,"/disable?redirect_to=").concat(encodeURIComponent(n))}},{key:"getLoginUrl",value:function(n){return"".concat(this.host,"/authorize?redirect_to=").concat(encodeURIComponent(n))}},{key:"getEnableUrl",value:function(n){return"".concat(this.host,"/enable?redirect_to=").concat(encodeURIComponent(n))}},{key:"getPatches",value:function(){var e=qw(ru().mark(function r(i){var o,l,s;return ru().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return o=i.patchIds,l=i.headers,s=o?"?".concat(o.map(function(c){return"".concat(c,"=").concat(encodeURIComponent(c))}).join("&")):"",u.abrupt("return",fetch("".concat(this.host,"/patches/~").concat(s),{headers:l||{"Content-Type":"application/json"}}).then(function(c){return ta(c)}).catch(ea));case 3:case"end":return u.stop()}},r,this)}));function n(r){return e.apply(this,arguments)}return n}()},{key:"getEditUrl",value:function(){return"".concat(this.host,"/static/edit")}},{key:"postPatches",value:function(n,r,i){return fetch("".concat(this.host,"/patches/~"),{headers:i||{"Content-Type":"application/json"},method:"POST",body:JSON.stringify(me({},n,r))}).then(function(o){return ta(o)}).catch(ea)}},{key:"getSession",value:function(){return fetch("".concat(this.host,"/session")).then(function(n){return ta(n).catch(ea)})}},{key:"getTree",value:function(n){var r=n.patch,i=r===void 0?!1:r,o=n.includeSchema,l=o===void 0?!1:o,s=n.includeSource,a=s===void 0?!1:s,u=n.treePath,c=u===void 0?"/":u,d=n.headers,f=new URLSearchParams;return f.set("patch",i.toString()),f.set("schema",l.toString()),f.set("source",a.toString()),fetch("".concat(this.host,"/tree/~").concat(c,"?").concat(f.toString()),{headers:d}).then(function(h){return ta(h)}).catch(ea)}},{key:"postCommit",value:function(n){var r=n.patches,i=n.headers;return fetch("".concat(this.host,"/commit"),{method:"POST",body:JSON.stringify({patches:r}),headers:i||{"Content-Type":"application/json"}}).then(function(o){return ta(o)}).catch(ea)}}]),t}();function ea(t){return Ur({statusCode:500,message:t instanceof Error?t.message:"Unknown error"})}function ta(t){return Yp.apply(this,arguments)}function Yp(){return Yp=qw(ru().mark(function t(e){var n;return ru().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:if(i.prev=0,!e.ok){i.next=9;break}return i.t0=zo,i.next=5,e.json();case 5:return i.t1=i.sent,i.abrupt("return",i.t0.ok.call(i.t0,i.t1));case 9:return i.prev=9,i.next=12,e.json();case 12:return n=i.sent,i.abrupt("return",Ur({statusCode:e.status,message:n.message||e.statusText,details:n.details||Object.fromEntries(Object.entries(n).filter(function(o){var l=no(o,1),s=l[0];return s!=="message"}))}));case 16:return i.prev=16,i.t2=i.catch(9),i.abrupt("return",Ur({statusCode:e.status,message:e.statusText}));case 19:i.next=24;break;case 21:return i.prev=21,i.t3=i.catch(0),i.abrupt("return",Ur({message:i.t3 instanceof Error?i.t3.message:"Unknown error"}));case 24:case"end":return i.stop()}},t,null,[[0,21],[9,16]])})),Yp.apply(this,arguments)}var On={convertFileSource:Yw,getSchema:cN,getValPath:hN,getVal:ON,getSource:_N,resolvePath:TN,splitModuleIdAndModulePath:wN,isVal:fN,createValPathOfItem:rr,getSHA256Hash:ZN,createPatchJSONPath:function(e){return"/".concat(e.split(".").map(function(n){return n&&YN(n)}).join("/"))},VAL_ENABLE_COOKIE_NAME:"val_enable",VAL_STATE_COOKIE:"val_state",VAL_SESSION_COOKIE:"val_session"};function YN(t){try{return JSON.parse(t)}catch{return t}}var eS={exports:{}};/*!
|
|
44
44
|
Copyright (c) 2018 Jed Watson.
|
|
45
45
|
Licensed under the MIT License (MIT), see
|
|
46
46
|
http://jedwatson.github.io/classnames
|
|
47
|
-
*/(function(t){(function(){var e={}.hasOwnProperty;function n(){for(var r=[],i=0;i<arguments.length;i++){var o=arguments[i];if(o){var l=typeof o;if(l==="string"||l==="number")r.push(o);else if(Array.isArray(o)){if(o.length){var s=n.apply(null,o);s&&r.push(s)}}else if(l==="object"){if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]")){r.push(o.toString());continue}for(var a in o)e.call(o,a)&&o[a]&&r.push(a)}}}return r.join(" ")}t.exports?(n.default=n,t.exports=n):window.classNames=n})()})(eS);var XN=eS.exports;const Pn=Ou(XN);function ie(){return ie=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},ie.apply(this,arguments)}function JN(t,e){typeof t=="function"?t(e):t!=null&&(t.current=e)}function tS(...t){return e=>t.forEach(n=>JN(n,e))}function st(...t){return p.useCallback(tS(...t),t)}const fs=p.forwardRef((t,e)=>{const{children:n,...r}=t,i=p.Children.toArray(n),o=i.find(qN);if(o){const l=o.props.children,s=i.map(a=>a===o?p.Children.count(l)>1?p.Children.only(null):p.isValidElement(l)?l.props.children:null:a);return p.createElement(Xp,ie({},r,{ref:e}),p.isValidElement(l)?p.cloneElement(l,void 0,s):null)}return p.createElement(Xp,ie({},r,{ref:e}),n)});fs.displayName="Slot";const Xp=p.forwardRef((t,e)=>{const{children:n,...r}=t;return p.isValidElement(n)?p.cloneElement(n,{...e2(r,n.props),ref:e?tS(e,n.ref):n.ref}):p.Children.count(n)>1?p.Children.only(null):null});Xp.displayName="SlotClone";const QN=({children:t})=>p.createElement(p.Fragment,null,t);function qN(t){return p.isValidElement(t)&&t.type===QN}function e2(t,e){const n={...e};for(const r in e){const i=t[r],o=e[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...s)=>{o(...s),i(...s)}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...t,...n}}const t2=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Ke=t2.reduce((t,e)=>{const n=p.forwardRef((r,i)=>{const{asChild:o,...l}=r,s=o?fs:e;return p.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),p.createElement(s,ie({},l,{ref:i}))});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function n2(t,e){t&&Yr.flushSync(()=>t.dispatchEvent(e))}const Vn=globalThis!=null&&globalThis.document?p.useLayoutEffect:()=>{};function r2(t,e){return p.useReducer((n,r)=>{const i=e[n][r];return i??n},t)}const ks=t=>{const{present:e,children:n}=t,r=i2(e),i=typeof n=="function"?n({present:r.isPresent}):p.Children.only(n),o=st(r.ref,i.ref);return typeof n=="function"||r.isPresent?p.cloneElement(i,{ref:o}):null};ks.displayName="Presence";function i2(t){const[e,n]=p.useState(),r=p.useRef({}),i=p.useRef(t),o=p.useRef("none"),l=t?"mounted":"unmounted",[s,a]=r2(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{const u=mc(r.current);o.current=s==="mounted"?u:"none"},[s]),Vn(()=>{const u=r.current,c=i.current;if(c!==t){const f=o.current,h=mc(u);t?a("MOUNT"):h==="none"||(u==null?void 0:u.display)==="none"?a("UNMOUNT"):a(c&&f!==h?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,a]),Vn(()=>{if(e){const u=d=>{const h=mc(r.current).includes(d.animationName);d.target===e&&h&&Yr.flushSync(()=>a("ANIMATION_END"))},c=d=>{d.target===e&&(o.current=mc(r.current))};return e.addEventListener("animationstart",c),e.addEventListener("animationcancel",u),e.addEventListener("animationend",u),()=>{e.removeEventListener("animationstart",c),e.removeEventListener("animationcancel",u),e.removeEventListener("animationend",u)}}else a("ANIMATION_END")},[e,a]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:p.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function mc(t){return(t==null?void 0:t.animationName)||"none"}function al(t,e=[]){let n=[];function r(o,l){const s=p.createContext(l),a=n.length;n=[...n,l];function u(d){const{scope:f,children:h,...g}=d,m=(f==null?void 0:f[t][a])||s,w=p.useMemo(()=>g,Object.values(g));return p.createElement(m.Provider,{value:w},h)}function c(d,f){const h=(f==null?void 0:f[t][a])||s,g=p.useContext(h);if(g)return g;if(l!==void 0)return l;throw new Error(`\`${d}\` must be used within \`${o}\``)}return u.displayName=o+"Provider",[u,c]}const i=()=>{const o=n.map(l=>p.createContext(l));return function(s){const a=(s==null?void 0:s[t])||o;return p.useMemo(()=>({[`__scope${t}`]:{...s,[t]:a}}),[s,a])}};return i.scopeName=t,[r,o2(i,...e)]}function o2(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const l=r.reduce((s,{useScope:a,scopeName:u})=>{const d=a(o)[`__scope${u}`];return{...s,...d}},{});return p.useMemo(()=>({[`__scope${e.scopeName}`]:l}),[l])}};return n.scopeName=e.scopeName,n}function en(t){const e=p.useRef(t);return p.useEffect(()=>{e.current=t}),p.useMemo(()=>(...n)=>{var r;return(r=e.current)===null||r===void 0?void 0:r.call(e,...n)},[])}const l2=p.createContext(void 0);function Yg(t){const e=p.useContext(l2);return t||e||"ltr"}function Jp(t,[e,n]){return Math.min(n,Math.max(e,t))}function nt(t,e,{checkForDefaultPrevented:n=!0}={}){return function(i){if(t==null||t(i),n===!1||!i.defaultPrevented)return e==null?void 0:e(i)}}function s2(t,e){return p.useReducer((n,r)=>{const i=e[n][r];return i??n},t)}const nS="ScrollArea",[rS,TI]=al(nS),[a2,ur]=rS(nS),u2=p.forwardRef((t,e)=>{const{__scopeScrollArea:n,type:r="hover",dir:i,scrollHideDelay:o=600,...l}=t,[s,a]=p.useState(null),[u,c]=p.useState(null),[d,f]=p.useState(null),[h,g]=p.useState(null),[m,w]=p.useState(null),[v,y]=p.useState(0),[_,S]=p.useState(0),[E,$]=p.useState(!1),[C,N]=p.useState(!1),R=st(e,L=>a(L)),b=Yg(i);return p.createElement(a2,{scope:n,type:r,dir:b,scrollHideDelay:o,scrollArea:s,viewport:u,onViewportChange:c,content:d,onContentChange:f,scrollbarX:h,onScrollbarXChange:g,scrollbarXEnabled:E,onScrollbarXEnabledChange:$,scrollbarY:m,onScrollbarYChange:w,scrollbarYEnabled:C,onScrollbarYEnabledChange:N,onCornerWidthChange:y,onCornerHeightChange:S},p.createElement(Ke.div,ie({dir:b},l,{ref:R,style:{position:"relative","--radix-scroll-area-corner-width":v+"px","--radix-scroll-area-corner-height":_+"px",...t.style}})))}),c2="ScrollAreaViewport",d2=p.forwardRef((t,e)=>{const{__scopeScrollArea:n,children:r,...i}=t,o=ur(c2,n),l=p.useRef(null),s=st(e,l,o.onViewportChange);return p.createElement(p.Fragment,null,p.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"}}),p.createElement(Ke.div,ie({"data-radix-scroll-area-viewport":""},i,{ref:s,style:{overflowX:o.scrollbarXEnabled?"scroll":"hidden",overflowY:o.scrollbarYEnabled?"scroll":"hidden",...t.style}}),p.createElement("div",{ref:o.onContentChange,style:{minWidth:"100%",display:"table"}},r)))}),Ci="ScrollAreaScrollbar",iS=p.forwardRef((t,e)=>{const{forceMount:n,...r}=t,i=ur(Ci,t.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:l}=i,s=t.orientation==="horizontal";return p.useEffect(()=>(s?o(!0):l(!0),()=>{s?o(!1):l(!1)}),[s,o,l]),i.type==="hover"?p.createElement(f2,ie({},r,{ref:e,forceMount:n})):i.type==="scroll"?p.createElement(h2,ie({},r,{ref:e,forceMount:n})):i.type==="auto"?p.createElement(oS,ie({},r,{ref:e,forceMount:n})):i.type==="always"?p.createElement(Xg,ie({},r,{ref:e})):null}),f2=p.forwardRef((t,e)=>{const{forceMount:n,...r}=t,i=ur(Ci,t.__scopeScrollArea),[o,l]=p.useState(!1);return p.useEffect(()=>{const s=i.scrollArea;let a=0;if(s){const u=()=>{window.clearTimeout(a),l(!0)},c=()=>{a=window.setTimeout(()=>l(!1),i.scrollHideDelay)};return s.addEventListener("pointerenter",u),s.addEventListener("pointerleave",c),()=>{window.clearTimeout(a),s.removeEventListener("pointerenter",u),s.removeEventListener("pointerleave",c)}}},[i.scrollArea,i.scrollHideDelay]),p.createElement(ks,{present:n||o},p.createElement(oS,ie({"data-state":o?"visible":"hidden"},r,{ref:e})))}),h2=p.forwardRef((t,e)=>{const{forceMount:n,...r}=t,i=ur(Ci,t.__scopeScrollArea),o=t.orientation==="horizontal",l=Cf(()=>a("SCROLL_END"),100),[s,a]=s2("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return p.useEffect(()=>{if(s==="idle"){const u=window.setTimeout(()=>a("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(u)}},[s,i.scrollHideDelay,a]),p.useEffect(()=>{const u=i.viewport,c=o?"scrollLeft":"scrollTop";if(u){let d=u[c];const f=()=>{const h=u[c];d!==h&&(a("SCROLL"),l()),d=h};return u.addEventListener("scroll",f),()=>u.removeEventListener("scroll",f)}},[i.viewport,o,a,l]),p.createElement(ks,{present:n||s!=="hidden"},p.createElement(Xg,ie({"data-state":s==="hidden"?"hidden":"visible"},r,{ref:e,onPointerEnter:nt(t.onPointerEnter,()=>a("POINTER_ENTER")),onPointerLeave:nt(t.onPointerLeave,()=>a("POINTER_LEAVE"))})))}),oS=p.forwardRef((t,e)=>{const n=ur(Ci,t.__scopeScrollArea),{forceMount:r,...i}=t,[o,l]=p.useState(!1),s=t.orientation==="horizontal",a=Cf(()=>{if(n.viewport){const u=n.viewport.offsetWidth<n.viewport.scrollWidth,c=n.viewport.offsetHeight<n.viewport.scrollHeight;l(s?u:c)}},10);return hs(n.viewport,a),hs(n.content,a),p.createElement(ks,{present:r||o},p.createElement(Xg,ie({"data-state":o?"visible":"hidden"},i,{ref:e})))}),Xg=p.forwardRef((t,e)=>{const{orientation:n="vertical",...r}=t,i=ur(Ci,t.__scopeScrollArea),o=p.useRef(null),l=p.useRef(0),[s,a]=p.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=uS(s.viewport,s.content),c={...r,sizes:s,onSizesChange:a,hasThumb:u>0&&u<1,onThumbChange:f=>o.current=f,onThumbPointerUp:()=>l.current=0,onThumbPointerDown:f=>l.current=f};function d(f,h){return w2(f,l.current,s,h)}return n==="horizontal"?p.createElement(p2,ie({},c,{ref:e,onThumbPositionChange:()=>{if(i.viewport&&o.current){const f=i.viewport.scrollLeft,h=N0(f,s,i.dir);o.current.style.transform=`translate3d(${h}px, 0, 0)`}},onWheelScroll:f=>{i.viewport&&(i.viewport.scrollLeft=f)},onDragScroll:f=>{i.viewport&&(i.viewport.scrollLeft=d(f,i.dir))}})):n==="vertical"?p.createElement(m2,ie({},c,{ref:e,onThumbPositionChange:()=>{if(i.viewport&&o.current){const f=i.viewport.scrollTop,h=N0(f,s);o.current.style.transform=`translate3d(0, ${h}px, 0)`}},onWheelScroll:f=>{i.viewport&&(i.viewport.scrollTop=f)},onDragScroll:f=>{i.viewport&&(i.viewport.scrollTop=d(f))}})):null}),p2=p.forwardRef((t,e)=>{const{sizes:n,onSizesChange:r,...i}=t,o=ur(Ci,t.__scopeScrollArea),[l,s]=p.useState(),a=p.useRef(null),u=st(e,a,o.onScrollbarXChange);return p.useEffect(()=>{a.current&&s(getComputedStyle(a.current))},[a]),p.createElement(sS,ie({"data-orientation":"horizontal"},i,{ref:u,sizes:n,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Ef(n)+"px",...t.style},onThumbPointerDown:c=>t.onThumbPointerDown(c.x),onDragScroll:c=>t.onDragScroll(c.x),onWheelScroll:(c,d)=>{if(o.viewport){const f=o.viewport.scrollLeft+c.deltaX;t.onWheelScroll(f),dS(f,d)&&c.preventDefault()}},onResize:()=>{a.current&&o.viewport&&l&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:a.current.clientWidth,paddingStart:Sd(l.paddingLeft),paddingEnd:Sd(l.paddingRight)}})}}))}),m2=p.forwardRef((t,e)=>{const{sizes:n,onSizesChange:r,...i}=t,o=ur(Ci,t.__scopeScrollArea),[l,s]=p.useState(),a=p.useRef(null),u=st(e,a,o.onScrollbarYChange);return p.useEffect(()=>{a.current&&s(getComputedStyle(a.current))},[a]),p.createElement(sS,ie({"data-orientation":"vertical"},i,{ref:u,sizes:n,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Ef(n)+"px",...t.style},onThumbPointerDown:c=>t.onThumbPointerDown(c.y),onDragScroll:c=>t.onDragScroll(c.y),onWheelScroll:(c,d)=>{if(o.viewport){const f=o.viewport.scrollTop+c.deltaY;t.onWheelScroll(f),dS(f,d)&&c.preventDefault()}},onResize:()=>{a.current&&o.viewport&&l&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:a.current.clientHeight,paddingStart:Sd(l.paddingTop),paddingEnd:Sd(l.paddingBottom)}})}}))}),[g2,lS]=rS(Ci),sS=p.forwardRef((t,e)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:o,onThumbPointerUp:l,onThumbPointerDown:s,onThumbPositionChange:a,onDragScroll:u,onWheelScroll:c,onResize:d,...f}=t,h=ur(Ci,n),[g,m]=p.useState(null),w=st(e,R=>m(R)),v=p.useRef(null),y=p.useRef(""),_=h.viewport,S=r.content-r.viewport,E=en(c),$=en(a),C=Cf(d,10);function N(R){if(v.current){const b=R.clientX-v.current.left,L=R.clientY-v.current.top;u({x:b,y:L})}}return p.useEffect(()=>{const R=b=>{const L=b.target;(g==null?void 0:g.contains(L))&&E(b,S)};return document.addEventListener("wheel",R,{passive:!1}),()=>document.removeEventListener("wheel",R,{passive:!1})},[_,g,S,E]),p.useEffect($,[r,$]),hs(g,C),hs(h.content,C),p.createElement(g2,{scope:n,scrollbar:g,hasThumb:i,onThumbChange:en(o),onThumbPointerUp:en(l),onThumbPositionChange:$,onThumbPointerDown:en(s)},p.createElement(Ke.div,ie({},f,{ref:w,style:{position:"absolute",...f.style},onPointerDown:nt(t.onPointerDown,R=>{R.button===0&&(R.target.setPointerCapture(R.pointerId),v.current=g.getBoundingClientRect(),y.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",h.viewport&&(h.viewport.style.scrollBehavior="auto"),N(R))}),onPointerMove:nt(t.onPointerMove,N),onPointerUp:nt(t.onPointerUp,R=>{const b=R.target;b.hasPointerCapture(R.pointerId)&&b.releasePointerCapture(R.pointerId),document.body.style.webkitUserSelect=y.current,h.viewport&&(h.viewport.style.scrollBehavior=""),v.current=null})})))}),Qp="ScrollAreaThumb",v2=p.forwardRef((t,e)=>{const{forceMount:n,...r}=t,i=lS(Qp,t.__scopeScrollArea);return p.createElement(ks,{present:n||i.hasThumb},p.createElement(y2,ie({ref:e},r)))}),y2=p.forwardRef((t,e)=>{const{__scopeScrollArea:n,style:r,...i}=t,o=ur(Qp,n),l=lS(Qp,n),{onThumbPositionChange:s}=l,a=st(e,d=>l.onThumbChange(d)),u=p.useRef(),c=Cf(()=>{u.current&&(u.current(),u.current=void 0)},100);return p.useEffect(()=>{const d=o.viewport;if(d){const f=()=>{if(c(),!u.current){const h=S2(d,s);u.current=h,s()}};return s(),d.addEventListener("scroll",f),()=>d.removeEventListener("scroll",f)}},[o.viewport,c,s]),p.createElement(Ke.div,ie({"data-state":l.hasThumb?"visible":"hidden"},i,{ref:a,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:nt(t.onPointerDownCapture,d=>{const h=d.target.getBoundingClientRect(),g=d.clientX-h.left,m=d.clientY-h.top;l.onThumbPointerDown({x:g,y:m})}),onPointerUp:nt(t.onPointerUp,l.onThumbPointerUp)}))}),aS="ScrollAreaCorner",x2=p.forwardRef((t,e)=>{const n=ur(aS,t.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?p.createElement(_2,ie({},t,{ref:e})):null}),_2=p.forwardRef((t,e)=>{const{__scopeScrollArea:n,...r}=t,i=ur(aS,n),[o,l]=p.useState(0),[s,a]=p.useState(0),u=!!(o&&s);return hs(i.scrollbarX,()=>{var c;const d=((c=i.scrollbarX)===null||c===void 0?void 0:c.offsetHeight)||0;i.onCornerHeightChange(d),a(d)}),hs(i.scrollbarY,()=>{var c;const d=((c=i.scrollbarY)===null||c===void 0?void 0:c.offsetWidth)||0;i.onCornerWidthChange(d),l(d)}),u?p.createElement(Ke.div,ie({},r,{ref:e,style:{width:o,height:s,position:"absolute",right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:0,...t.style}})):null});function Sd(t){return t?parseInt(t,10):0}function uS(t,e){const n=t/e;return isNaN(n)?0:n}function Ef(t){const e=uS(t.viewport,t.content),n=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,r=(t.scrollbar.size-n)*e;return Math.max(r,18)}function w2(t,e,n,r="ltr"){const i=Ef(n),o=i/2,l=e||o,s=i-l,a=n.scrollbar.paddingStart+l,u=n.scrollbar.size-n.scrollbar.paddingEnd-s,c=n.content-n.viewport,d=r==="ltr"?[0,c]:[c*-1,0];return cS([a,u],d)(t)}function N0(t,e,n="ltr"){const r=Ef(e),i=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,o=e.scrollbar.size-i,l=e.content-e.viewport,s=o-r,a=n==="ltr"?[0,l]:[l*-1,0],u=Jp(t,a);return cS([0,l],[0,s])(u)}function cS(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(t[1]-t[0]);return e[0]+r*(n-t[0])}}function dS(t,e){return t>0&&t<e}const S2=(t,e=()=>{})=>{let n={left:t.scrollLeft,top:t.scrollTop},r=0;return function i(){const o={left:t.scrollLeft,top:t.scrollTop},l=n.left!==o.left,s=n.top!==o.top;(l||s)&&e(),n=o,r=window.requestAnimationFrame(i)}(),()=>window.cancelAnimationFrame(r)};function Cf(t,e){const n=en(t),r=p.useRef(0);return p.useEffect(()=>()=>window.clearTimeout(r.current),[]),p.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,e)},[n,e])}function hs(t,e){const n=en(e);Vn(()=>{let r=0;if(t){const i=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return i.observe(t),()=>{window.cancelAnimationFrame(r),i.unobserve(t)}}},[t,n])}const fS=u2,E2=d2,C2=x2;function hS(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e<t.length;e++)t[e]&&(n=hS(t[e]))&&(r&&(r+=" "),r+=n);else for(e in t)t[e]&&(r&&(r+=" "),r+=e);return r}function pS(){for(var t,e,n=0,r="";n<arguments.length;)(t=arguments[n++])&&(e=hS(t))&&(r&&(r+=" "),r+=e);return r}const Jg="-";function k2(t){const e=$2(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;function i(l){const s=l.split(Jg);return s[0]===""&&s.length!==1&&s.shift(),mS(s,e)||b2(l)}function o(l,s){const a=n[l]||[];return s&&r[l]?[...a,...r[l]]:a}return{getClassGroupId:i,getConflictingClassGroupIds:o}}function mS(t,e){var l;if(t.length===0)return e.classGroupId;const n=t[0],r=e.nextPart.get(n),i=r?mS(t.slice(1),r):void 0;if(i)return i;if(e.validators.length===0)return;const o=t.join(Jg);return(l=e.validators.find(({validator:s})=>s(o)))==null?void 0:l.classGroupId}const R0=/^\[(.+)\]$/;function b2(t){if(R0.test(t)){const e=R0.exec(t)[1],n=e==null?void 0:e.substring(0,e.indexOf(":"));if(n)return"arbitrary.."+n}}function $2(t){const{theme:e,prefix:n}=t,r={nextPart:new Map,validators:[]};return N2(Object.entries(t.classGroups),n).forEach(([o,l])=>{qp(l,r,o,e)}),r}function qp(t,e,n,r){t.forEach(i=>{if(typeof i=="string"){const o=i===""?e:O0(e,i);o.classGroupId=n;return}if(typeof i=="function"){if(T2(i)){qp(i(r),e,n,r);return}e.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([o,l])=>{qp(l,O0(e,o),n,r)})})}function O0(t,e){let n=t;return e.split(Jg).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n}function T2(t){return t.isThemeGetter}function N2(t,e){return e?t.map(([n,r])=>{const i=r.map(o=>typeof o=="string"?e+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([l,s])=>[e+l,s])):o);return[n,i]}):t}function R2(t){if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=new Map,r=new Map;function i(o,l){n.set(o,l),e++,e>t&&(e=0,r=n,n=new Map)}return{get(o){let l=n.get(o);if(l!==void 0)return l;if((l=r.get(o))!==void 0)return i(o,l),l},set(o,l){n.has(o)?n.set(o,l):i(o,l)}}}const gS="!";function O2(t){const e=t.separator,n=e.length===1,r=e[0],i=e.length;return function(l){const s=[];let a=0,u=0,c;for(let m=0;m<l.length;m++){let w=l[m];if(a===0){if(w===r&&(n||l.slice(m,m+i)===e)){s.push(l.slice(u,m)),u=m+i;continue}if(w==="/"){c=m;continue}}w==="["?a++:w==="]"&&a--}const d=s.length===0?l:l.substring(u),f=d.startsWith(gS),h=f?d.substring(1):d,g=c&&c>u?c-u:void 0;return{modifiers:s,hasImportantModifier:f,baseClassName:h,maybePostfixModifierPosition:g}}}function P2(t){if(t.length<=1)return t;const e=[];let n=[];return t.forEach(r=>{r[0]==="["?(e.push(...n.sort(),r),n=[]):n.push(r)}),e.push(...n.sort()),e}function A2(t){return{cache:R2(t.cacheSize),splitModifiers:O2(t),...k2(t)}}const M2=/\s+/;function L2(t,e){const{splitModifiers:n,getClassGroupId:r,getConflictingClassGroupIds:i}=e,o=new Set;return t.trim().split(M2).map(l=>{const{modifiers:s,hasImportantModifier:a,baseClassName:u,maybePostfixModifierPosition:c}=n(l);let d=r(c?u.substring(0,c):u),f=!!c;if(!d){if(!c)return{isTailwindClass:!1,originalClassName:l};if(d=r(u),!d)return{isTailwindClass:!1,originalClassName:l};f=!1}const h=P2(s).join(":");return{isTailwindClass:!0,modifierId:a?h+gS:h,classGroupId:d,originalClassName:l,hasPostfixModifier:f}}).reverse().filter(l=>{if(!l.isTailwindClass)return!0;const{modifierId:s,classGroupId:a,hasPostfixModifier:u}=l,c=s+a;return o.has(c)?!1:(o.add(c),i(a,u).forEach(d=>o.add(s+d)),!0)}).reverse().map(l=>l.originalClassName).join(" ")}function D2(){let t=0,e,n,r="";for(;t<arguments.length;)(e=arguments[t++])&&(n=vS(e))&&(r&&(r+=" "),r+=n);return r}function vS(t){if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=vS(t[r]))&&(n&&(n+=" "),n+=e);return n}function I2(t,...e){let n,r,i,o=l;function l(a){const u=e.reduce((c,d)=>d(c),t());return n=A2(u),r=n.cache.get,i=n.cache.set,o=s,s(a)}function s(a){const u=r(a);if(u)return u;const c=L2(a,n);return i(a,c),c}return function(){return o(D2.apply(null,arguments))}}function qe(t){const e=n=>n[t]||[];return e.isThemeGetter=!0,e}const yS=/^\[(?:([a-z-]+):)?(.+)\]$/i,j2=/^\d+\/\d+$/,z2=new Set(["px","full","screen"]),F2=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,B2=/\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$/,U2=/^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,W2=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function pr(t){return Lo(t)||z2.has(t)||j2.test(t)}function Pi(t){return bs(t,"length",J2)}function Lo(t){return!!t&&!Number.isNaN(Number(t))}function gc(t){return bs(t,"number",Lo)}function na(t){return!!t&&Number.isInteger(Number(t))}function V2(t){return t.endsWith("%")&&Lo(t.slice(0,-1))}function Ee(t){return yS.test(t)}function Ai(t){return F2.test(t)}const H2=new Set(["length","size","percentage"]);function K2(t){return bs(t,H2,xS)}function Z2(t){return bs(t,"position",xS)}const G2=new Set(["image","url"]);function Y2(t){return bs(t,G2,q2)}function X2(t){return bs(t,"",Q2)}function ra(){return!0}function bs(t,e,n){const r=yS.exec(t);return r?r[1]?typeof e=="string"?r[1]===e:e.has(r[1]):n(r[2]):!1}function J2(t){return B2.test(t)}function xS(){return!1}function Q2(t){return U2.test(t)}function q2(t){return W2.test(t)}function eR(){const t=qe("colors"),e=qe("spacing"),n=qe("blur"),r=qe("brightness"),i=qe("borderColor"),o=qe("borderRadius"),l=qe("borderSpacing"),s=qe("borderWidth"),a=qe("contrast"),u=qe("grayscale"),c=qe("hueRotate"),d=qe("invert"),f=qe("gap"),h=qe("gradientColorStops"),g=qe("gradientColorStopPositions"),m=qe("inset"),w=qe("margin"),v=qe("opacity"),y=qe("padding"),_=qe("saturate"),S=qe("scale"),E=qe("sepia"),$=qe("skew"),C=qe("space"),N=qe("translate"),R=()=>["auto","contain","none"],b=()=>["auto","hidden","clip","visible","scroll"],L=()=>["auto",Ee,e],F=()=>[Ee,e],le=()=>["",pr,Pi],V=()=>["auto",Lo,Ee],H=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],O=()=>["solid","dashed","dotted","double","none"],A=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"],k=()=>["start","end","center","between","around","evenly","stretch"],j=()=>["","0",Ee],I=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Z=()=>[Lo,gc],ne=()=>[Lo,Ee];return{cacheSize:500,separator:":",theme:{colors:[ra],spacing:[pr,Pi],blur:["none","",Ai,Ee],brightness:Z(),borderColor:[t],borderRadius:["none","","full",Ai,Ee],borderSpacing:F(),borderWidth:le(),contrast:Z(),grayscale:j(),hueRotate:ne(),invert:j(),gap:F(),gradientColorStops:[t],gradientColorStopPositions:[V2,Pi],inset:L(),margin:L(),opacity:Z(),padding:F(),saturate:Z(),scale:Z(),sepia:j(),skew:ne(),space:F(),translate:F()},classGroups:{aspect:[{aspect:["auto","square","video",Ee]}],container:["container"],columns:[{columns:[Ai]}],"break-after":[{"break-after":I()}],"break-before":[{"break-before":I()}],"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"],float:[{float:["right","left","none"]}],clear:[{clear:["left","right","both","none"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...H(),Ee]}],overflow:[{overflow:b()}],"overflow-x":[{"overflow-x":b()}],"overflow-y":[{"overflow-y":b()}],overscroll:[{overscroll:R()}],"overscroll-x":[{"overscroll-x":R()}],"overscroll-y":[{"overscroll-y":R()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",na,Ee]}],basis:[{basis:L()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Ee]}],grow:[{grow:j()}],shrink:[{shrink:j()}],order:[{order:["first","last","none",na,Ee]}],"grid-cols":[{"grid-cols":[ra]}],"col-start-end":[{col:["auto",{span:["full",na,Ee]},Ee]}],"col-start":[{"col-start":V()}],"col-end":[{"col-end":V()}],"grid-rows":[{"grid-rows":[ra]}],"row-start-end":[{row:["auto",{span:[na,Ee]},Ee]}],"row-start":[{"row-start":V()}],"row-end":[{"row-end":V()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Ee]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Ee]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...k()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...k(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...k(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[w]}],mx:[{mx:[w]}],my:[{my:[w]}],ms:[{ms:[w]}],me:[{me:[w]}],mt:[{mt:[w]}],mr:[{mr:[w]}],mb:[{mb:[w]}],ml:[{ml:[w]}],"space-x":[{"space-x":[C]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[C]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit",Ee,e]}],"min-w":[{"min-w":["min","max","fit",Ee,pr]}],"max-w":[{"max-w":["0","none","full","min","max","fit","prose",{screen:[Ai]},Ai,Ee]}],h:[{h:[Ee,e,"auto","min","max","fit"]}],"min-h":[{"min-h":["min","max","fit",pr,Ee]}],"max-h":[{"max-h":[Ee,e,"min","max","fit"]}],"font-size":[{text:["base",Ai,Pi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",gc]}],"font-family":[{font:[ra]}],"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-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Ee]}],"line-clamp":[{"line-clamp":["none",Lo,gc]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",pr,Ee]}],"list-image":[{"list-image":["none",Ee]}],"list-style-type":[{list:["none","disc","decimal",Ee]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...O(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",pr,Pi]}],"underline-offset":[{"underline-offset":["auto",pr,Ee]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],indent:[{indent:F()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ee]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ee]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...H(),Z2]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",K2]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Y2]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[g]}],"gradient-via-pos":[{via:[g]}],"gradient-to-pos":[{to:[g]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:[...O(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:O()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...O()]}],"outline-offset":[{"outline-offset":[pr,Ee]}],"outline-w":[{outline:[pr,Pi]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:le()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[pr,Pi]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",Ai,X2]}],"shadow-color":[{shadow:[ra]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":A()}],"bg-blend":[{"bg-blend":A()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[a]}],"drop-shadow":[{"drop-shadow":["","none",Ai,Ee]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[c]}],invert:[{invert:[d]}],saturate:[{saturate:[_]}],sepia:[{sepia:[E]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[a]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[c]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[_]}],"backdrop-sepia":[{"backdrop-sepia":[E]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[l]}],"border-spacing-x":[{"border-spacing-x":[l]}],"border-spacing-y":[{"border-spacing-y":[l]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Ee]}],duration:[{duration:ne()}],ease:[{ease:["linear","in","out","in-out",Ee]}],delay:[{delay:ne()}],animate:[{animate:["none","spin","ping","pulse","bounce",Ee]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[na,Ee]}],"translate-x":[{"translate-x":[N]}],"translate-y":[{"translate-y":[N]}],"skew-x":[{"skew-x":[$]}],"skew-y":[{"skew-y":[$]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Ee]}],accent:[{accent:["auto",t]}],appearance:["appearance-none"],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",Ee]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":F()}],"scroll-mx":[{"scroll-mx":F()}],"scroll-my":[{"scroll-my":F()}],"scroll-ms":[{"scroll-ms":F()}],"scroll-me":[{"scroll-me":F()}],"scroll-mt":[{"scroll-mt":F()}],"scroll-mr":[{"scroll-mr":F()}],"scroll-mb":[{"scroll-mb":F()}],"scroll-ml":[{"scroll-ml":F()}],"scroll-p":[{"scroll-p":F()}],"scroll-px":[{"scroll-px":F()}],"scroll-py":[{"scroll-py":F()}],"scroll-ps":[{"scroll-ps":F()}],"scroll-pe":[{"scroll-pe":F()}],"scroll-pt":[{"scroll-pt":F()}],"scroll-pr":[{"scroll-pr":F()}],"scroll-pb":[{"scroll-pb":F()}],"scroll-pl":[{"scroll-pl":F()}],"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",Ee]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[pr,Pi,gc]}],stroke:[{stroke:[t,"none"]}],sr:["sr-only","not-sr-only"]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","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","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],"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"],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-s","border-w-e","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-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"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","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-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"]}}}const tR=I2(eR);function xt(...t){return tR(pS(t))}const $a=p.forwardRef(({className:t,children:e,innerRef:n,...r},i)=>x.jsxs(fS,{ref:i,className:xt("relative overflow-hidden",t),...r,children:[x.jsx(E2,{className:"h-full w-full rounded-[inherit]",ref:n,children:e}),x.jsx(_S,{}),x.jsx(C2,{})]}));$a.displayName=fS.displayName;const _S=p.forwardRef(({className:t,orientation:e="vertical",...n},r)=>x.jsx(iS,{ref:r,orientation:e,className:xt("flex touch-none select-none transition-colors",e==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",e==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",t),...n,children:x.jsx(v2,{className:xt("relative rounded-full bg-border",e==="vertical"&&"flex-1")})}));_S.displayName=iS.displayName;var nR={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 rR=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Mn=(t,e)=>{const n=p.forwardRef(({color:r="currentColor",size:i=24,strokeWidth:o=2,absoluteStrokeWidth:l,children:s,...a},u)=>p.createElement("svg",{ref:u,...nR,width:i,height:i,stroke:r,strokeWidth:l?Number(o)*24/Number(i):o,className:`lucide lucide-${rR(t)}`,...a},[...e.map(([c,d])=>p.createElement(c,d)),...(Array.isArray(s)?s:[s])||[]]));return n.displayName=`${t}`,n},iR=Mn("Check",[["polyline",{points:"20 6 9 17 4 12",key:"10jjfj"}]]),wS=Mn("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),oR=Mn("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]),P0=Mn("LogIn",[["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}],["polyline",{points:"10 17 15 12 10 7",key:"1ail0h"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}]]),lR=Mn("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]),sR=Mn("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]),aR=Mn("Minimize2",[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]),uR=Mn("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]),cR=Mn("Pause",[["rect",{width:"4",height:"16",x:"6",y:"4",key:"iffhe4"}],["rect",{width:"4",height:"16",x:"14",y:"4",key:"sjin7j"}]]),dR=Mn("Play",[["polygon",{points:"5 3 19 12 5 21 5 3",key:"191637"}]]),fR=Mn("Power",[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]]),hR=Mn("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]]),pR=Mn("Sun",[["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"}]]),mR=Mn("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function Ta({children:t}){const e=p.useRef(null),n=p.useRef(null),r=p.useRef(!1),i=p.useRef(0),o=p.useRef(null),l=p.useRef(0),[s,a]=p.useState(!0),u=()=>{r.current=!1,o.current=null,i.current=0,l.current=0},c=y=>{y.preventDefault();const _=o.current==="left"?e:n;if(_.current&&r.current){const S=o.current==="left"?y.screenX-i.current:i.current-y.screenX;_.current.style.width=`${Math.max(l.current+S,150)}px`}},d=y=>_=>{if(_.target){const E=y==="left"?e:y==="right"?n:null;r.current=!0,E&&E.current&&(i.current=_.screenX,o.current=y,E.current&&(l.current=E.current.offsetWidth))}},[f,h,g,m,w,v]=p.Children.toArray(t);return p.useEffect(()=>(document.addEventListener("mouseup",u),document.addEventListener("mousemove",c),()=>{document.removeEventListener("mouseup",u),document.removeEventListener("mousemove",c)}),[]),x.jsxs("div",{className:"relative flex h-screen",children:[x.jsxs("div",{ref:e,className:Pn("absolute top-0 left-0 border-r border-border md:relative z-[1] bg-gradient-to-br from-card from-50% to-background",{"w-[300px]":s,"w-0 md:w-[300px]":!s}),children:[x.jsxs(Ta.Column,{children:[x.jsx(A0,{showOnMobile:!s,onClick:()=>{a(!s)},children:f}),x.jsx($a,{style:{height:"calc(100vh - 50px)"},onClick:()=>{a(!1)},children:h})]}),x.jsx("div",{className:"absolute inset-y-0 right-0 cursor-col-resize w-[1px] hover:w-[3px] h-full hover:bg-border",onMouseDown:d("left")})]}),x.jsx("div",{className:Pn("",{"w-full":!w&&!v}),children:x.jsxs(Ta.Column,{children:[x.jsxs("span",{className:"flex w-full border-b border-border",children:[x.jsx(A0,{className:"md:hidden",showOnMobile:s,onClick:()=>{a(!s)},children:f}),x.jsx("span",{className:Pn({"pl-[300px] md:pl-0":s}),children:g})]}),x.jsx($a,{style:{height:"calc(100vh - 50px)"},children:m})]})}),w||v&&x.jsxs("div",{ref:n,className:"relative h-screen border-l border-border",style:{width:300},children:[x.jsxs(Ta.Column,{children:[w,x.jsx($a,{style:{height:"calc(100vh - 50px)"},children:v})]}),x.jsx("div",{onMouseDown:d("right"),className:"absolute inset-y-0 left-0 cursor-col-resize w-[1px] bg-border hover:w-[3px] hover:bg-border"})]})]})}function A0({className:t,showOnMobile:e,onClick:n,children:r}){return x.jsxs("div",{className:Pn("flex items-center px-4 md:px-4",t,{"hidden md:flex":e}),children:[x.jsx("button",{className:"md:hidden",onClick:n,children:x.jsx(sR,{})}),x.jsx("span",{className:"flex items-center justify-between w-full",children:r})]})}Ta.Column=({children:t,className:e})=>{const[n,r]=p.Children.toArray(t);return x.jsxs("div",{className:Pn("flex flex-col",e),children:[x.jsx("div",{className:"flex items-center border-b border-border",children:n}),r]})};var D={};let kf={},SS={},iu={},Na={},em={},Ql={},Qg={},tm={},ou={},lu={},Ki={},qg={},ev={},ES={},CS={},kS={},bS={},$S={},TS={},NS={},Ed={},RS={},OS={},PS={},AS={},MS={},LS={},DS={},IS={},jS={},tv={},nv={},nm={},zS={},FS={},BS={};function K(t){let e=new URLSearchParams;e.append("code",t);for(let n=1;n<arguments.length;n++)e.append("v",arguments[n]);throw Error(`Minified Lexical error #${t}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}let ki=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",gR=ki&&"documentMode"in document?document.documentMode:null,Jt=ki&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),so=ki&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),Cd=ki&&"InputEvent"in window&&!gR?"getTargetRanges"in new window.InputEvent("input"):!1,rv=ki&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),bf=ki&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,vR=ki&&/^(?=.*Chrome).*/i.test(navigator.userAgent),iv=ki&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!vR,$f=rv||bf||iv?" ":"",yR=so?" ":$f,xR=/^[^A-Za-z\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u02b8\u0300-\u0590\u0800-\u1fff\u200e\u2c00-\ufb1c\ufe00-\ufe6f\ufefd-\uffff]*[\u0591-\u07ff\ufb1d-\ufdfd\ufe70-\ufefc]/,_R=/^[^\u0591-\u07ff\ufb1d-\ufdfd\ufe70-\ufefc]*[A-Za-z\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u02b8\u0300-\u0590\u0800-\u1fff\u200e\u2c00-\ufb1c\ufe00-\ufe6f\ufefd-\uffff]/,Fo={bold:1,code:16,highlight:128,italic:2,strikethrough:4,subscript:32,superscript:64,underline:8},wR={directionless:1,unmergeable:2},M0={center:2,end:6,justify:4,left:1,right:3,start:5},SR={2:"center",6:"end",4:"justify",1:"left",3:"right",5:"start"},ER={normal:0,segmented:2,token:1},CR={0:"normal",2:"segmented",1:"token"},rm=!1,ov=0;function kR(t){ov=t.timeStamp}function Oh(t,e,n){return e.__lexicalLineBreak===t||t[`__lexicalKey_${n._key}`]!==void 0}function bR(t){return t.getEditorState().read(()=>{let e=rt();return e!==null?e.clone():null})}function US(t,e,n){rm=!0;let r=100<performance.now()-ov;try{Hn(t,()=>{let i=rt()||bR(t);var o=new Map,l=t.getRootElement(),s=t._editorState,a=t._blockCursorElement;let u=!1,c="";for(var d=0;d<e.length;d++){var f=e[d],h=f.type,g=f.target,m=Fu(g,s);if(!(m===null&&g!==l||tt(m))){if(h==="characterData"){if(f=r&&Q(m))e:{f=i,h=g;var w=m;if(ge(f)){var v=f.anchor.getNode();if(v.is(w)&&f.format!==v.getFormat()){f=!1;break e}}f=h.nodeType===3&&w.isAttached()}f&&(w=Jr(t._window),h=f=null,w!==null&&w.anchorNode===g&&(f=w.anchorOffset,h=w.focusOffset),g=g.nodeValue,g!==null&&dv(m,g,f,h,!1))}else if(h==="childList"){for(u=!0,h=f.addedNodes,w=0;w<h.length;w++){v=h[w];var y=YS(v),_=v.parentNode;_==null||v===a||y!==null||v.nodeName==="BR"&&Oh(v,_,t)||(so&&(y=v.innerText||v.nodeValue)&&(c+=y),_.removeChild(v))}if(f=f.removedNodes,h=f.length,0<h){for(w=0,v=0;v<h;v++)_=f[v],(_.nodeName==="BR"&&Oh(_,g,t)||a===_)&&(g.appendChild(_),w++);h!==w&&(g===l&&(m=s._nodeMap.get("root")),o.set(g,m))}}}}if(0<o.size)for(let[S,E]of o)if(B(E))for(o=E.getChildrenKeys(),l=S.firstChild,s=0;s<o.length;s++)a=t.getElementByKey(o[s]),a!==null&&(l==null?(S.appendChild(a),l=a):l!==a&&S.replaceChild(a,l),l=l.nextSibling);else Q(E)&&E.markDirty();if(o=n.takeRecords(),0<o.length){for(l=0;l<o.length;l++)for(a=o[l],s=a.addedNodes,a=a.target,d=0;d<s.length;d++)m=s[d],g=m.parentNode,g==null||m.nodeName!=="BR"||Oh(m,a,t)||g.removeChild(m);n.takeRecords()}i!==null&&(u&&(i.dirty=!0,Vr(i)),so&&qS(t)&&i.insertRawText(c))})}finally{rm=!1}}function WS(t){let e=t._observer;if(e!==null){let n=e.takeRecords();US(t,n,e)}}function VS(t){ov===0&&Nf(t).addEventListener("textInput",kR,!0),t._observer=new MutationObserver((e,n)=>{US(t,e,n)})}function L0(t,e){let n=t.__mode,r=t.__format;t=t.__style;let i=e.__mode,o=e.__format;return e=e.__style,(n===null||n===i)&&(r===null||r===o)&&(t===null||t===e)}function D0(t,e){let n=t.mergeWithSibling(e),r=pt()._normalizedNodes;return r.add(t.__key),r.add(e.__key),n}function HS(t){if(t.__text===""&&t.isSimpleText()&&!t.isUnmergeable())t.remove();else{for(var e;(e=t.getPreviousSibling())!==null&&Q(e)&&e.isSimpleText()&&!e.isUnmergeable();)if(e.__text==="")e.remove();else{L0(e,t)&&(t=D0(e,t));break}for(var n;(n=t.getNextSibling())!==null&&Q(n)&&n.isSimpleText()&&!n.isUnmergeable();)if(n.__text==="")n.remove();else{L0(t,n)&&D0(t,n);break}}}function lv(t){return I0(t.anchor),I0(t.focus),t}function I0(t){for(;t.type==="element";){var e=t.getNode(),n=t.offset;if(n===e.getChildrenSize()?(e=e.getChildAtIndex(n-1),n=!0):(e=e.getChildAtIndex(n),n=!1),Q(e)){t.set(e.__key,n?e.getTextContentSize():0,"text");break}else if(!B(e))break;t.set(e.__key,n?e.getChildrenSize():0,"element")}}let $R=1,TR=typeof queueMicrotask=="function"?queueMicrotask:t=>{Promise.resolve().then(t)};function sv(t){let e=document.activeElement;if(e===null)return!1;let n=e.nodeName;return tt(Fu(t))&&(n==="INPUT"||n==="TEXTAREA"||e.contentEditable==="true"&&e.__lexicalEditor==null)}function zu(t,e,n){let r=t.getRootElement();try{return r!==null&&r.contains(e)&&r.contains(n)&&e!==null&&!sv(e)&&av(e)===t}catch{return!1}}function av(t){for(;t!=null;){let e=t.__lexicalEditor;if(e!=null)return e;t=Tf(t)}return null}function im(t){return t.isToken()||t.isSegmented()}function kd(t){for(;t!=null;){if(t.nodeType===3)return t;t=t.firstChild}return null}function KS(t,e,n){return e=Fo[e],t&e&&(n===null||!(n&e))?t^e:n===null||n&e?t|e:t}function ZS(t){return Q(t)||cu(t)||tt(t)}function GS(t,e){if(e!=null)t.__key=e;else{hn(),99<du&&K(14),e=pt();var n=Qr(),r=""+$R++;n._nodeMap.set(r,t),B(t)?e._dirtyElements.set(r,!0):e._dirtyLeaves.add(r),e._cloneNotNeeded.add(r),e._dirtyType=1,t.__key=r}}function Bo(t){var e=t.getParent();if(e!==null){let i=t.getWritable();e=e.getWritable();var n=t.getPreviousSibling();if(t=t.getNextSibling(),n===null)if(t!==null){var r=t.getWritable();e.__first=t.__key,r.__prev=null}else e.__first=null;else{if(r=n.getWritable(),t!==null){let o=t.getWritable();o.__prev=r.__key,r.__next=o.__key}else r.__next=null;i.__prev=null}t===null?n!==null?(t=n.getWritable(),e.__last=n.__key,t.__next=null):e.__last=null:(t=t.getWritable(),n!==null?(n=n.getWritable(),n.__next=t.__key,t.__prev=n.__key):t.__prev=null,i.__next=null),e.__size--,i.__parent=null}}function bd(t){99<du&&K(14);var e=t.getLatest(),n=e.__parent,r=Qr();let i=pt(),o=r._nodeMap;if(r=i._dirtyElements,n!==null)e:for(;n!==null;){if(r.has(n))break e;let l=o.get(n);if(l===void 0)break;r.set(n,!1),n=l.__parent}e=e.__key,i._dirtyType=1,B(t)?r.set(e,!0):i._dirtyLeaves.add(e)}function Kt(t){hn();var e=pt();let n=e._compositionKey;t!==n&&(e._compositionKey=t,n!==null&&(e=It(n),e!==null&&e.getWritable()),t!==null&&(t=It(t),t!==null&&t.getWritable()))}function Zi(){return Os()?null:pt()._compositionKey}function It(t,e){return t=(e||Qr())._nodeMap.get(t),t===void 0?null:t}function YS(t,e){let n=pt();return t=t[`__lexicalKey_${n._key}`],t!==void 0?It(t,e):null}function Fu(t,e){for(;t!=null;){let n=YS(t,e);if(n!==null)return n;t=Tf(t)}return null}function XS(t){let e=Object.assign({},t._decorators);return t._pendingDecorators=e}function j0(t){return t.read(()=>Xr().getTextContent())}function NR(t,e){Hn(t,()=>{var n=Qr();if(!n.isEmpty())if(e==="root")Xr().markDirty();else{n=n._nodeMap;for(let[,r]of n)r.markDirty()}},t._pendingEditorState===null?{tag:"history-merge"}:void 0)}function Xr(){return Qr()._nodeMap.get("root")}function Vr(t){hn();let e=Qr();t!==null&&(t.dirty=!0,t._cachedNodes=null),e._selection=t}function Bl(t){var e=pt(),n;e:{for(n=t;n!=null;){let r=n[`__lexicalKey_${e._key}`];if(r!==void 0){n=r;break e}n=Tf(n)}n=null}return n===null?(e=e.getRootElement(),t===e?It("root"):null):It(n)}function JS(t){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(t)}function uv(t){let e=[];for(;t!==null;)e.push(t),t=t._parentEditor;return e}function QS(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function cv(t,e,n){if(e=Jr(e._window),e!==null){var r=e.anchorNode,{anchorOffset:i,focusOffset:o}=e;if(r!==null&&(e=r.nodeType===3?r.nodeValue:null,r=Fu(r),e!==null&&Q(r))){if(e===$f&&n){let l=n.length;e=n,o=i=l}e!==null&&dv(r,e,i,o,t)}}}function dv(t,e,n,r,i){let o=t;if(o.isAttached()&&(i||!o.isDirty())){let u=o.isComposing(),c=e;if((u||i)&&e[e.length-1]===$f&&(c=e.slice(0,-1)),e=o.getTextContent(),i||c!==e)if(c==="")if(Kt(null),rv||bf||iv)o.remove();else{let d=pt();setTimeout(()=>{d.update(()=>{o.isAttached()&&o.remove()})},20)}else{i=o.getParent(),e=Rs();var l=o.getTextContentSize(),s=Zi(),a=o.getKey();o.isToken()||s!==null&&a===s&&!u||ge(e)&&(i!==null&&!i.canInsertTextBefore()&&e.anchor.offset===0||e.anchor.key===t.__key&&e.anchor.offset===0&&!o.canInsertTextBefore()||e.focus.key===t.__key&&e.focus.offset===l&&!o.canInsertTextAfter())?o.markDirty():(t=rt(),ge(t)&&n!==null&&r!==null&&(t.setTextNodeRange(o,n,o,r),o.isSegmented()&&(n=o.getTextContent(),n=Lt(n),o.replace(n),o=n)),o.setTextContent(c))}}}function RR(t,e){if(e.isSegmented())return!0;if(!t.isCollapsed())return!1;t=t.anchor.offset;let n=e.getParentOrThrow(),r=e.isToken();return t===0?((t=!e.canInsertTextBefore()||!n.canInsertTextBefore()||r)||(e=e.getPreviousSibling(),t=(Q(e)||B(e)&&e.isInline())&&!e.canInsertTextAfter()),t):t===e.getTextContentSize()?!e.canInsertTextAfter()||!n.canInsertTextAfter()||r:!1}function Ra(t,e){t.__lexicalClassNameCache===void 0&&(t.__lexicalClassNameCache={});let n=t.__lexicalClassNameCache,r=n[e];return r!==void 0?r:(t=t[e],typeof t=="string"?(t=t.split(" "),n[e]=t):t)}function fv(t,e,n,r,i){n.size!==0&&(n=r.__type,r=r.__key,e=e.get(n),e===void 0&&K(33,n),n=e.klass,e=t.get(n),e===void 0&&(e=new Map,t.set(n,e)),t=e.get(r),n=t==="destroyed"&&i==="created",(t===void 0||n)&&e.set(r,n?"updated":i))}function z0(t,e,n){let r=t.getParent(),i=n;return r!==null&&(e&&n===0?(i=t.getIndexWithinParent(),t=r):e||n!==t.getChildrenSize()||(i=t.getIndexWithinParent()+1,t=r)),t.getChildAtIndex(e?i-1:i)}function om(t,e){var n=t.offset;return t.type==="element"?(t=t.getNode(),z0(t,e,n)):(t=t.getNode(),e&&n===0||!e&&n===t.getTextContentSize()?(n=e?t.getPreviousSibling():t.getNextSibling(),n===null?z0(t.getParentOrThrow(),e,t.getIndexWithinParent()+(e?0:1)):n):null)}function qS(t){return t=(t=Nf(t).event)&&t.inputType,t==="insertFromPaste"||t==="insertFromPasteAsQuotation"}function $d(t){return!mn(t)&&!t.isLastChild()&&!t.isInline()}function Td(t,e){return t=t._keyToDOMMap.get(e),t===void 0&&K(75,e),t}function Tf(t){return t=t.assignedSlot||t.parentElement,t!==null&&t.nodeType===11?t.host:t}function Nd(t,e){for(t=t.getParent();t!==null;){if(t.is(e))return!0;t=t.getParent()}return!1}function Nf(t){return t=t._window,t===null&&K(78),t}function eE(t){for(t=t.getParentOrThrow();t!==null&&!_r(t);)t=t.getParentOrThrow();return t}function _r(t){return mn(t)||B(t)&&t.isShadowRoot()}function tE(t){return t=t.constructor.clone(t),GS(t,null),t}function Bu(t){var e=pt();let n=t.constructor.getType();return e=e._nodes.get(n),e===void 0&&K(97),e=e.replace,e!==null?(e=e(t),e instanceof t.constructor||K(98),e):t}function Ph(t,e){t=t.getParent(),!mn(t)||B(e)||tt(e)||K(99)}function Ah(t){return(tt(t)||B(t)&&!t.canBeEmpty())&&!t.isInline()}function lm(t,e,n){n.style.removeProperty("caret-color"),e._blockCursorElement=null,e=t.parentElement,e!==null&&e.removeChild(t)}function Jr(t){return ki?(t||window).getSelection():null}function nE(t,e){let n=t.getChildAtIndex(e);n==null&&(n=t),_r(t)&&K(102);let r=l=>{const s=l.getParentOrThrow(),a=_r(s),u=l!==n||a?tE(l):l;if(a)return l.insertAfter(u),[l,u,u];const[c,d,f]=r(s);return l=l.getNextSiblings(),f.append(u,...l),[c,d,u]},[i,o]=r(n);return[i,o]}function Rd(t,e){for(;t!==Xr()&&t!=null;){if(e(t))return t;t=t.getParent()}return null}function OR(t){let e=[],n=[t];for(;0<n.length;){let r=n.pop();r===void 0&&K(112),B(r)&&n.unshift(...r.getChildren()),r!==t&&e.push(r)}return e}function Rf(t){return t.nodeType===1}function rE(t,e,n,r,i,o){for(t=t.getFirstChild();t!==null;){let l=t.__key;t.__parent===e&&(B(t)&&rE(t,l,n,r,i,o),n.has(l)||o.delete(l),i.push(l)),t=t.getNextSibling()}}function PR(t,e,n,r){t=t._nodeMap,e=e._nodeMap;let i=[];for(let[o]of r){let l=e.get(o);l===void 0||l.isAttached()||(B(l)&&rE(l,o,t,e,i,r),t.has(o)||r.delete(o),i.push(o))}for(let o of i)e.delete(o);for(let o of n)r=e.get(o),r===void 0||r.isAttached()||(t.has(o)||n.delete(o),e.delete(o))}let Nt="",fn="",li="",ao,tn,su,iE=!1,hv=!1,Of,Wc=null,sm,am,Xo,uo,um,au;function Vc(t,e){let n=Xo.get(t);if(e!==null){let r=fm(t);r.parentNode===e&&e.removeChild(r)}uo.has(t)||tn._keyToDOMMap.delete(t),B(n)&&(t=Od(n,Xo),cm(t,0,t.length-1,null)),n!==void 0&&fv(au,su,Of,n,"destroyed")}function cm(t,e,n,r){for(;e<=n;++e){let i=t[e];i!==void 0&&Vc(i,r)}}function $o(t,e){t.setProperty("text-align",e)}function oE(t,e){var n=ao.theme.indent;if(typeof n=="string"){let r=t.classList.contains(n);0<e&&!r?t.classList.add(n):1>e&&r&&t.classList.remove(n)}n=getComputedStyle(t).getPropertyValue("--lexical-indent-base-value")||"40px",t.style.setProperty("padding-inline-start",e===0?"":`calc(${e} * ${n})`)}function lE(t,e){t=t.style,e===0?$o(t,""):e===1?$o(t,"left"):e===2?$o(t,"center"):e===3?$o(t,"right"):e===4?$o(t,"justify"):e===5?$o(t,"start"):e===6&&$o(t,"end")}function Hc(t,e,n){let r=uo.get(t);r===void 0&&K(60);let i=r.createDOM(ao,tn);var o=tn._keyToDOMMap;if(i["__lexicalKey_"+tn._key]=t,o.set(t,i),Q(r)?i.setAttribute("data-lexical-text","true"):tt(r)&&i.setAttribute("data-lexical-decorator","true"),B(r)){if(t=r.__indent,o=r.__size,t!==0&&oE(i,t),o!==0){--o,t=Od(r,uo);var l=fn;fn="",dm(t,r,0,o,i,null),aE(r,i),fn=l}t=r.__format,t!==0&&lE(i,t),r.isInline()||sE(null,r,i),$d(r)&&(Nt+=`
|
|
47
|
+
*/(function(t){(function(){var e={}.hasOwnProperty;function n(){for(var r=[],i=0;i<arguments.length;i++){var o=arguments[i];if(o){var l=typeof o;if(l==="string"||l==="number")r.push(o);else if(Array.isArray(o)){if(o.length){var s=n.apply(null,o);s&&r.push(s)}}else if(l==="object"){if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]")){r.push(o.toString());continue}for(var a in o)e.call(o,a)&&o[a]&&r.push(a)}}}return r.join(" ")}t.exports?(n.default=n,t.exports=n):window.classNames=n})()})(eS);var XN=eS.exports;const Pn=Ou(XN);function ie(){return ie=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},ie.apply(this,arguments)}function JN(t,e){typeof t=="function"?t(e):t!=null&&(t.current=e)}function tS(...t){return e=>t.forEach(n=>JN(n,e))}function st(...t){return p.useCallback(tS(...t),t)}const hs=p.forwardRef((t,e)=>{const{children:n,...r}=t,i=p.Children.toArray(n),o=i.find(qN);if(o){const l=o.props.children,s=i.map(a=>a===o?p.Children.count(l)>1?p.Children.only(null):p.isValidElement(l)?l.props.children:null:a);return p.createElement(Xp,ie({},r,{ref:e}),p.isValidElement(l)?p.cloneElement(l,void 0,s):null)}return p.createElement(Xp,ie({},r,{ref:e}),n)});hs.displayName="Slot";const Xp=p.forwardRef((t,e)=>{const{children:n,...r}=t;return p.isValidElement(n)?p.cloneElement(n,{...e2(r,n.props),ref:e?tS(e,n.ref):n.ref}):p.Children.count(n)>1?p.Children.only(null):null});Xp.displayName="SlotClone";const QN=({children:t})=>p.createElement(p.Fragment,null,t);function qN(t){return p.isValidElement(t)&&t.type===QN}function e2(t,e){const n={...e};for(const r in e){const i=t[r],o=e[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...s)=>{o(...s),i(...s)}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...t,...n}}const t2=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Ke=t2.reduce((t,e)=>{const n=p.forwardRef((r,i)=>{const{asChild:o,...l}=r,s=o?hs:e;return p.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),p.createElement(s,ie({},l,{ref:i}))});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function n2(t,e){t&&Yr.flushSync(()=>t.dispatchEvent(e))}const Vn=globalThis!=null&&globalThis.document?p.useLayoutEffect:()=>{};function r2(t,e){return p.useReducer((n,r)=>{const i=e[n][r];return i??n},t)}const bs=t=>{const{present:e,children:n}=t,r=i2(e),i=typeof n=="function"?n({present:r.isPresent}):p.Children.only(n),o=st(r.ref,i.ref);return typeof n=="function"||r.isPresent?p.cloneElement(i,{ref:o}):null};bs.displayName="Presence";function i2(t){const[e,n]=p.useState(),r=p.useRef({}),i=p.useRef(t),o=p.useRef("none"),l=t?"mounted":"unmounted",[s,a]=r2(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{const u=mc(r.current);o.current=s==="mounted"?u:"none"},[s]),Vn(()=>{const u=r.current,c=i.current;if(c!==t){const f=o.current,h=mc(u);t?a("MOUNT"):h==="none"||(u==null?void 0:u.display)==="none"?a("UNMOUNT"):a(c&&f!==h?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,a]),Vn(()=>{if(e){const u=d=>{const h=mc(r.current).includes(d.animationName);d.target===e&&h&&Yr.flushSync(()=>a("ANIMATION_END"))},c=d=>{d.target===e&&(o.current=mc(r.current))};return e.addEventListener("animationstart",c),e.addEventListener("animationcancel",u),e.addEventListener("animationend",u),()=>{e.removeEventListener("animationstart",c),e.removeEventListener("animationcancel",u),e.removeEventListener("animationend",u)}}else a("ANIMATION_END")},[e,a]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:p.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function mc(t){return(t==null?void 0:t.animationName)||"none"}function al(t,e=[]){let n=[];function r(o,l){const s=p.createContext(l),a=n.length;n=[...n,l];function u(d){const{scope:f,children:h,...g}=d,m=(f==null?void 0:f[t][a])||s,w=p.useMemo(()=>g,Object.values(g));return p.createElement(m.Provider,{value:w},h)}function c(d,f){const h=(f==null?void 0:f[t][a])||s,g=p.useContext(h);if(g)return g;if(l!==void 0)return l;throw new Error(`\`${d}\` must be used within \`${o}\``)}return u.displayName=o+"Provider",[u,c]}const i=()=>{const o=n.map(l=>p.createContext(l));return function(s){const a=(s==null?void 0:s[t])||o;return p.useMemo(()=>({[`__scope${t}`]:{...s,[t]:a}}),[s,a])}};return i.scopeName=t,[r,o2(i,...e)]}function o2(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const l=r.reduce((s,{useScope:a,scopeName:u})=>{const d=a(o)[`__scope${u}`];return{...s,...d}},{});return p.useMemo(()=>({[`__scope${e.scopeName}`]:l}),[l])}};return n.scopeName=e.scopeName,n}function en(t){const e=p.useRef(t);return p.useEffect(()=>{e.current=t}),p.useMemo(()=>(...n)=>{var r;return(r=e.current)===null||r===void 0?void 0:r.call(e,...n)},[])}const l2=p.createContext(void 0);function Yg(t){const e=p.useContext(l2);return t||e||"ltr"}function Jp(t,[e,n]){return Math.min(n,Math.max(e,t))}function nt(t,e,{checkForDefaultPrevented:n=!0}={}){return function(i){if(t==null||t(i),n===!1||!i.defaultPrevented)return e==null?void 0:e(i)}}function s2(t,e){return p.useReducer((n,r)=>{const i=e[n][r];return i??n},t)}const nS="ScrollArea",[rS,TI]=al(nS),[a2,ur]=rS(nS),u2=p.forwardRef((t,e)=>{const{__scopeScrollArea:n,type:r="hover",dir:i,scrollHideDelay:o=600,...l}=t,[s,a]=p.useState(null),[u,c]=p.useState(null),[d,f]=p.useState(null),[h,g]=p.useState(null),[m,w]=p.useState(null),[v,y]=p.useState(0),[_,S]=p.useState(0),[E,$]=p.useState(!1),[C,N]=p.useState(!1),R=st(e,L=>a(L)),b=Yg(i);return p.createElement(a2,{scope:n,type:r,dir:b,scrollHideDelay:o,scrollArea:s,viewport:u,onViewportChange:c,content:d,onContentChange:f,scrollbarX:h,onScrollbarXChange:g,scrollbarXEnabled:E,onScrollbarXEnabledChange:$,scrollbarY:m,onScrollbarYChange:w,scrollbarYEnabled:C,onScrollbarYEnabledChange:N,onCornerWidthChange:y,onCornerHeightChange:S},p.createElement(Ke.div,ie({dir:b},l,{ref:R,style:{position:"relative","--radix-scroll-area-corner-width":v+"px","--radix-scroll-area-corner-height":_+"px",...t.style}})))}),c2="ScrollAreaViewport",d2=p.forwardRef((t,e)=>{const{__scopeScrollArea:n,children:r,...i}=t,o=ur(c2,n),l=p.useRef(null),s=st(e,l,o.onViewportChange);return p.createElement(p.Fragment,null,p.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"}}),p.createElement(Ke.div,ie({"data-radix-scroll-area-viewport":""},i,{ref:s,style:{overflowX:o.scrollbarXEnabled?"scroll":"hidden",overflowY:o.scrollbarYEnabled?"scroll":"hidden",...t.style}}),p.createElement("div",{ref:o.onContentChange,style:{minWidth:"100%",display:"table"}},r)))}),Ci="ScrollAreaScrollbar",iS=p.forwardRef((t,e)=>{const{forceMount:n,...r}=t,i=ur(Ci,t.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:l}=i,s=t.orientation==="horizontal";return p.useEffect(()=>(s?o(!0):l(!0),()=>{s?o(!1):l(!1)}),[s,o,l]),i.type==="hover"?p.createElement(f2,ie({},r,{ref:e,forceMount:n})):i.type==="scroll"?p.createElement(h2,ie({},r,{ref:e,forceMount:n})):i.type==="auto"?p.createElement(oS,ie({},r,{ref:e,forceMount:n})):i.type==="always"?p.createElement(Xg,ie({},r,{ref:e})):null}),f2=p.forwardRef((t,e)=>{const{forceMount:n,...r}=t,i=ur(Ci,t.__scopeScrollArea),[o,l]=p.useState(!1);return p.useEffect(()=>{const s=i.scrollArea;let a=0;if(s){const u=()=>{window.clearTimeout(a),l(!0)},c=()=>{a=window.setTimeout(()=>l(!1),i.scrollHideDelay)};return s.addEventListener("pointerenter",u),s.addEventListener("pointerleave",c),()=>{window.clearTimeout(a),s.removeEventListener("pointerenter",u),s.removeEventListener("pointerleave",c)}}},[i.scrollArea,i.scrollHideDelay]),p.createElement(bs,{present:n||o},p.createElement(oS,ie({"data-state":o?"visible":"hidden"},r,{ref:e})))}),h2=p.forwardRef((t,e)=>{const{forceMount:n,...r}=t,i=ur(Ci,t.__scopeScrollArea),o=t.orientation==="horizontal",l=Cf(()=>a("SCROLL_END"),100),[s,a]=s2("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return p.useEffect(()=>{if(s==="idle"){const u=window.setTimeout(()=>a("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(u)}},[s,i.scrollHideDelay,a]),p.useEffect(()=>{const u=i.viewport,c=o?"scrollLeft":"scrollTop";if(u){let d=u[c];const f=()=>{const h=u[c];d!==h&&(a("SCROLL"),l()),d=h};return u.addEventListener("scroll",f),()=>u.removeEventListener("scroll",f)}},[i.viewport,o,a,l]),p.createElement(bs,{present:n||s!=="hidden"},p.createElement(Xg,ie({"data-state":s==="hidden"?"hidden":"visible"},r,{ref:e,onPointerEnter:nt(t.onPointerEnter,()=>a("POINTER_ENTER")),onPointerLeave:nt(t.onPointerLeave,()=>a("POINTER_LEAVE"))})))}),oS=p.forwardRef((t,e)=>{const n=ur(Ci,t.__scopeScrollArea),{forceMount:r,...i}=t,[o,l]=p.useState(!1),s=t.orientation==="horizontal",a=Cf(()=>{if(n.viewport){const u=n.viewport.offsetWidth<n.viewport.scrollWidth,c=n.viewport.offsetHeight<n.viewport.scrollHeight;l(s?u:c)}},10);return ps(n.viewport,a),ps(n.content,a),p.createElement(bs,{present:r||o},p.createElement(Xg,ie({"data-state":o?"visible":"hidden"},i,{ref:e})))}),Xg=p.forwardRef((t,e)=>{const{orientation:n="vertical",...r}=t,i=ur(Ci,t.__scopeScrollArea),o=p.useRef(null),l=p.useRef(0),[s,a]=p.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=uS(s.viewport,s.content),c={...r,sizes:s,onSizesChange:a,hasThumb:u>0&&u<1,onThumbChange:f=>o.current=f,onThumbPointerUp:()=>l.current=0,onThumbPointerDown:f=>l.current=f};function d(f,h){return w2(f,l.current,s,h)}return n==="horizontal"?p.createElement(p2,ie({},c,{ref:e,onThumbPositionChange:()=>{if(i.viewport&&o.current){const f=i.viewport.scrollLeft,h=N0(f,s,i.dir);o.current.style.transform=`translate3d(${h}px, 0, 0)`}},onWheelScroll:f=>{i.viewport&&(i.viewport.scrollLeft=f)},onDragScroll:f=>{i.viewport&&(i.viewport.scrollLeft=d(f,i.dir))}})):n==="vertical"?p.createElement(m2,ie({},c,{ref:e,onThumbPositionChange:()=>{if(i.viewport&&o.current){const f=i.viewport.scrollTop,h=N0(f,s);o.current.style.transform=`translate3d(0, ${h}px, 0)`}},onWheelScroll:f=>{i.viewport&&(i.viewport.scrollTop=f)},onDragScroll:f=>{i.viewport&&(i.viewport.scrollTop=d(f))}})):null}),p2=p.forwardRef((t,e)=>{const{sizes:n,onSizesChange:r,...i}=t,o=ur(Ci,t.__scopeScrollArea),[l,s]=p.useState(),a=p.useRef(null),u=st(e,a,o.onScrollbarXChange);return p.useEffect(()=>{a.current&&s(getComputedStyle(a.current))},[a]),p.createElement(sS,ie({"data-orientation":"horizontal"},i,{ref:u,sizes:n,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Ef(n)+"px",...t.style},onThumbPointerDown:c=>t.onThumbPointerDown(c.x),onDragScroll:c=>t.onDragScroll(c.x),onWheelScroll:(c,d)=>{if(o.viewport){const f=o.viewport.scrollLeft+c.deltaX;t.onWheelScroll(f),dS(f,d)&&c.preventDefault()}},onResize:()=>{a.current&&o.viewport&&l&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:a.current.clientWidth,paddingStart:Sd(l.paddingLeft),paddingEnd:Sd(l.paddingRight)}})}}))}),m2=p.forwardRef((t,e)=>{const{sizes:n,onSizesChange:r,...i}=t,o=ur(Ci,t.__scopeScrollArea),[l,s]=p.useState(),a=p.useRef(null),u=st(e,a,o.onScrollbarYChange);return p.useEffect(()=>{a.current&&s(getComputedStyle(a.current))},[a]),p.createElement(sS,ie({"data-orientation":"vertical"},i,{ref:u,sizes:n,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Ef(n)+"px",...t.style},onThumbPointerDown:c=>t.onThumbPointerDown(c.y),onDragScroll:c=>t.onDragScroll(c.y),onWheelScroll:(c,d)=>{if(o.viewport){const f=o.viewport.scrollTop+c.deltaY;t.onWheelScroll(f),dS(f,d)&&c.preventDefault()}},onResize:()=>{a.current&&o.viewport&&l&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:a.current.clientHeight,paddingStart:Sd(l.paddingTop),paddingEnd:Sd(l.paddingBottom)}})}}))}),[g2,lS]=rS(Ci),sS=p.forwardRef((t,e)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:o,onThumbPointerUp:l,onThumbPointerDown:s,onThumbPositionChange:a,onDragScroll:u,onWheelScroll:c,onResize:d,...f}=t,h=ur(Ci,n),[g,m]=p.useState(null),w=st(e,R=>m(R)),v=p.useRef(null),y=p.useRef(""),_=h.viewport,S=r.content-r.viewport,E=en(c),$=en(a),C=Cf(d,10);function N(R){if(v.current){const b=R.clientX-v.current.left,L=R.clientY-v.current.top;u({x:b,y:L})}}return p.useEffect(()=>{const R=b=>{const L=b.target;(g==null?void 0:g.contains(L))&&E(b,S)};return document.addEventListener("wheel",R,{passive:!1}),()=>document.removeEventListener("wheel",R,{passive:!1})},[_,g,S,E]),p.useEffect($,[r,$]),ps(g,C),ps(h.content,C),p.createElement(g2,{scope:n,scrollbar:g,hasThumb:i,onThumbChange:en(o),onThumbPointerUp:en(l),onThumbPositionChange:$,onThumbPointerDown:en(s)},p.createElement(Ke.div,ie({},f,{ref:w,style:{position:"absolute",...f.style},onPointerDown:nt(t.onPointerDown,R=>{R.button===0&&(R.target.setPointerCapture(R.pointerId),v.current=g.getBoundingClientRect(),y.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",h.viewport&&(h.viewport.style.scrollBehavior="auto"),N(R))}),onPointerMove:nt(t.onPointerMove,N),onPointerUp:nt(t.onPointerUp,R=>{const b=R.target;b.hasPointerCapture(R.pointerId)&&b.releasePointerCapture(R.pointerId),document.body.style.webkitUserSelect=y.current,h.viewport&&(h.viewport.style.scrollBehavior=""),v.current=null})})))}),Qp="ScrollAreaThumb",v2=p.forwardRef((t,e)=>{const{forceMount:n,...r}=t,i=lS(Qp,t.__scopeScrollArea);return p.createElement(bs,{present:n||i.hasThumb},p.createElement(y2,ie({ref:e},r)))}),y2=p.forwardRef((t,e)=>{const{__scopeScrollArea:n,style:r,...i}=t,o=ur(Qp,n),l=lS(Qp,n),{onThumbPositionChange:s}=l,a=st(e,d=>l.onThumbChange(d)),u=p.useRef(),c=Cf(()=>{u.current&&(u.current(),u.current=void 0)},100);return p.useEffect(()=>{const d=o.viewport;if(d){const f=()=>{if(c(),!u.current){const h=S2(d,s);u.current=h,s()}};return s(),d.addEventListener("scroll",f),()=>d.removeEventListener("scroll",f)}},[o.viewport,c,s]),p.createElement(Ke.div,ie({"data-state":l.hasThumb?"visible":"hidden"},i,{ref:a,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:nt(t.onPointerDownCapture,d=>{const h=d.target.getBoundingClientRect(),g=d.clientX-h.left,m=d.clientY-h.top;l.onThumbPointerDown({x:g,y:m})}),onPointerUp:nt(t.onPointerUp,l.onThumbPointerUp)}))}),aS="ScrollAreaCorner",x2=p.forwardRef((t,e)=>{const n=ur(aS,t.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?p.createElement(_2,ie({},t,{ref:e})):null}),_2=p.forwardRef((t,e)=>{const{__scopeScrollArea:n,...r}=t,i=ur(aS,n),[o,l]=p.useState(0),[s,a]=p.useState(0),u=!!(o&&s);return ps(i.scrollbarX,()=>{var c;const d=((c=i.scrollbarX)===null||c===void 0?void 0:c.offsetHeight)||0;i.onCornerHeightChange(d),a(d)}),ps(i.scrollbarY,()=>{var c;const d=((c=i.scrollbarY)===null||c===void 0?void 0:c.offsetWidth)||0;i.onCornerWidthChange(d),l(d)}),u?p.createElement(Ke.div,ie({},r,{ref:e,style:{width:o,height:s,position:"absolute",right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:0,...t.style}})):null});function Sd(t){return t?parseInt(t,10):0}function uS(t,e){const n=t/e;return isNaN(n)?0:n}function Ef(t){const e=uS(t.viewport,t.content),n=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,r=(t.scrollbar.size-n)*e;return Math.max(r,18)}function w2(t,e,n,r="ltr"){const i=Ef(n),o=i/2,l=e||o,s=i-l,a=n.scrollbar.paddingStart+l,u=n.scrollbar.size-n.scrollbar.paddingEnd-s,c=n.content-n.viewport,d=r==="ltr"?[0,c]:[c*-1,0];return cS([a,u],d)(t)}function N0(t,e,n="ltr"){const r=Ef(e),i=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,o=e.scrollbar.size-i,l=e.content-e.viewport,s=o-r,a=n==="ltr"?[0,l]:[l*-1,0],u=Jp(t,a);return cS([0,l],[0,s])(u)}function cS(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(t[1]-t[0]);return e[0]+r*(n-t[0])}}function dS(t,e){return t>0&&t<e}const S2=(t,e=()=>{})=>{let n={left:t.scrollLeft,top:t.scrollTop},r=0;return function i(){const o={left:t.scrollLeft,top:t.scrollTop},l=n.left!==o.left,s=n.top!==o.top;(l||s)&&e(),n=o,r=window.requestAnimationFrame(i)}(),()=>window.cancelAnimationFrame(r)};function Cf(t,e){const n=en(t),r=p.useRef(0);return p.useEffect(()=>()=>window.clearTimeout(r.current),[]),p.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,e)},[n,e])}function ps(t,e){const n=en(e);Vn(()=>{let r=0;if(t){const i=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return i.observe(t),()=>{window.cancelAnimationFrame(r),i.unobserve(t)}}},[t,n])}const fS=u2,E2=d2,C2=x2;function hS(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e<t.length;e++)t[e]&&(n=hS(t[e]))&&(r&&(r+=" "),r+=n);else for(e in t)t[e]&&(r&&(r+=" "),r+=e);return r}function pS(){for(var t,e,n=0,r="";n<arguments.length;)(t=arguments[n++])&&(e=hS(t))&&(r&&(r+=" "),r+=e);return r}const Jg="-";function k2(t){const e=$2(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;function i(l){const s=l.split(Jg);return s[0]===""&&s.length!==1&&s.shift(),mS(s,e)||b2(l)}function o(l,s){const a=n[l]||[];return s&&r[l]?[...a,...r[l]]:a}return{getClassGroupId:i,getConflictingClassGroupIds:o}}function mS(t,e){var l;if(t.length===0)return e.classGroupId;const n=t[0],r=e.nextPart.get(n),i=r?mS(t.slice(1),r):void 0;if(i)return i;if(e.validators.length===0)return;const o=t.join(Jg);return(l=e.validators.find(({validator:s})=>s(o)))==null?void 0:l.classGroupId}const R0=/^\[(.+)\]$/;function b2(t){if(R0.test(t)){const e=R0.exec(t)[1],n=e==null?void 0:e.substring(0,e.indexOf(":"));if(n)return"arbitrary.."+n}}function $2(t){const{theme:e,prefix:n}=t,r={nextPart:new Map,validators:[]};return N2(Object.entries(t.classGroups),n).forEach(([o,l])=>{qp(l,r,o,e)}),r}function qp(t,e,n,r){t.forEach(i=>{if(typeof i=="string"){const o=i===""?e:O0(e,i);o.classGroupId=n;return}if(typeof i=="function"){if(T2(i)){qp(i(r),e,n,r);return}e.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([o,l])=>{qp(l,O0(e,o),n,r)})})}function O0(t,e){let n=t;return e.split(Jg).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n}function T2(t){return t.isThemeGetter}function N2(t,e){return e?t.map(([n,r])=>{const i=r.map(o=>typeof o=="string"?e+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([l,s])=>[e+l,s])):o);return[n,i]}):t}function R2(t){if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=new Map,r=new Map;function i(o,l){n.set(o,l),e++,e>t&&(e=0,r=n,n=new Map)}return{get(o){let l=n.get(o);if(l!==void 0)return l;if((l=r.get(o))!==void 0)return i(o,l),l},set(o,l){n.has(o)?n.set(o,l):i(o,l)}}}const gS="!";function O2(t){const e=t.separator,n=e.length===1,r=e[0],i=e.length;return function(l){const s=[];let a=0,u=0,c;for(let m=0;m<l.length;m++){let w=l[m];if(a===0){if(w===r&&(n||l.slice(m,m+i)===e)){s.push(l.slice(u,m)),u=m+i;continue}if(w==="/"){c=m;continue}}w==="["?a++:w==="]"&&a--}const d=s.length===0?l:l.substring(u),f=d.startsWith(gS),h=f?d.substring(1):d,g=c&&c>u?c-u:void 0;return{modifiers:s,hasImportantModifier:f,baseClassName:h,maybePostfixModifierPosition:g}}}function P2(t){if(t.length<=1)return t;const e=[];let n=[];return t.forEach(r=>{r[0]==="["?(e.push(...n.sort(),r),n=[]):n.push(r)}),e.push(...n.sort()),e}function A2(t){return{cache:R2(t.cacheSize),splitModifiers:O2(t),...k2(t)}}const M2=/\s+/;function L2(t,e){const{splitModifiers:n,getClassGroupId:r,getConflictingClassGroupIds:i}=e,o=new Set;return t.trim().split(M2).map(l=>{const{modifiers:s,hasImportantModifier:a,baseClassName:u,maybePostfixModifierPosition:c}=n(l);let d=r(c?u.substring(0,c):u),f=!!c;if(!d){if(!c)return{isTailwindClass:!1,originalClassName:l};if(d=r(u),!d)return{isTailwindClass:!1,originalClassName:l};f=!1}const h=P2(s).join(":");return{isTailwindClass:!0,modifierId:a?h+gS:h,classGroupId:d,originalClassName:l,hasPostfixModifier:f}}).reverse().filter(l=>{if(!l.isTailwindClass)return!0;const{modifierId:s,classGroupId:a,hasPostfixModifier:u}=l,c=s+a;return o.has(c)?!1:(o.add(c),i(a,u).forEach(d=>o.add(s+d)),!0)}).reverse().map(l=>l.originalClassName).join(" ")}function D2(){let t=0,e,n,r="";for(;t<arguments.length;)(e=arguments[t++])&&(n=vS(e))&&(r&&(r+=" "),r+=n);return r}function vS(t){if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=vS(t[r]))&&(n&&(n+=" "),n+=e);return n}function I2(t,...e){let n,r,i,o=l;function l(a){const u=e.reduce((c,d)=>d(c),t());return n=A2(u),r=n.cache.get,i=n.cache.set,o=s,s(a)}function s(a){const u=r(a);if(u)return u;const c=L2(a,n);return i(a,c),c}return function(){return o(D2.apply(null,arguments))}}function qe(t){const e=n=>n[t]||[];return e.isThemeGetter=!0,e}const yS=/^\[(?:([a-z-]+):)?(.+)\]$/i,j2=/^\d+\/\d+$/,z2=new Set(["px","full","screen"]),F2=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,B2=/\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$/,U2=/^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,W2=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function pr(t){return Lo(t)||z2.has(t)||j2.test(t)}function Pi(t){return $s(t,"length",J2)}function Lo(t){return!!t&&!Number.isNaN(Number(t))}function gc(t){return $s(t,"number",Lo)}function na(t){return!!t&&Number.isInteger(Number(t))}function V2(t){return t.endsWith("%")&&Lo(t.slice(0,-1))}function Ee(t){return yS.test(t)}function Ai(t){return F2.test(t)}const H2=new Set(["length","size","percentage"]);function K2(t){return $s(t,H2,xS)}function Z2(t){return $s(t,"position",xS)}const G2=new Set(["image","url"]);function Y2(t){return $s(t,G2,q2)}function X2(t){return $s(t,"",Q2)}function ra(){return!0}function $s(t,e,n){const r=yS.exec(t);return r?r[1]?typeof e=="string"?r[1]===e:e.has(r[1]):n(r[2]):!1}function J2(t){return B2.test(t)}function xS(){return!1}function Q2(t){return U2.test(t)}function q2(t){return W2.test(t)}function eR(){const t=qe("colors"),e=qe("spacing"),n=qe("blur"),r=qe("brightness"),i=qe("borderColor"),o=qe("borderRadius"),l=qe("borderSpacing"),s=qe("borderWidth"),a=qe("contrast"),u=qe("grayscale"),c=qe("hueRotate"),d=qe("invert"),f=qe("gap"),h=qe("gradientColorStops"),g=qe("gradientColorStopPositions"),m=qe("inset"),w=qe("margin"),v=qe("opacity"),y=qe("padding"),_=qe("saturate"),S=qe("scale"),E=qe("sepia"),$=qe("skew"),C=qe("space"),N=qe("translate"),R=()=>["auto","contain","none"],b=()=>["auto","hidden","clip","visible","scroll"],L=()=>["auto",Ee,e],F=()=>[Ee,e],le=()=>["",pr,Pi],V=()=>["auto",Lo,Ee],H=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],O=()=>["solid","dashed","dotted","double","none"],A=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"],k=()=>["start","end","center","between","around","evenly","stretch"],j=()=>["","0",Ee],I=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Z=()=>[Lo,gc],ne=()=>[Lo,Ee];return{cacheSize:500,separator:":",theme:{colors:[ra],spacing:[pr,Pi],blur:["none","",Ai,Ee],brightness:Z(),borderColor:[t],borderRadius:["none","","full",Ai,Ee],borderSpacing:F(),borderWidth:le(),contrast:Z(),grayscale:j(),hueRotate:ne(),invert:j(),gap:F(),gradientColorStops:[t],gradientColorStopPositions:[V2,Pi],inset:L(),margin:L(),opacity:Z(),padding:F(),saturate:Z(),scale:Z(),sepia:j(),skew:ne(),space:F(),translate:F()},classGroups:{aspect:[{aspect:["auto","square","video",Ee]}],container:["container"],columns:[{columns:[Ai]}],"break-after":[{"break-after":I()}],"break-before":[{"break-before":I()}],"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"],float:[{float:["right","left","none"]}],clear:[{clear:["left","right","both","none"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...H(),Ee]}],overflow:[{overflow:b()}],"overflow-x":[{"overflow-x":b()}],"overflow-y":[{"overflow-y":b()}],overscroll:[{overscroll:R()}],"overscroll-x":[{"overscroll-x":R()}],"overscroll-y":[{"overscroll-y":R()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",na,Ee]}],basis:[{basis:L()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Ee]}],grow:[{grow:j()}],shrink:[{shrink:j()}],order:[{order:["first","last","none",na,Ee]}],"grid-cols":[{"grid-cols":[ra]}],"col-start-end":[{col:["auto",{span:["full",na,Ee]},Ee]}],"col-start":[{"col-start":V()}],"col-end":[{"col-end":V()}],"grid-rows":[{"grid-rows":[ra]}],"row-start-end":[{row:["auto",{span:[na,Ee]},Ee]}],"row-start":[{"row-start":V()}],"row-end":[{"row-end":V()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Ee]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Ee]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...k()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...k(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...k(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[w]}],mx:[{mx:[w]}],my:[{my:[w]}],ms:[{ms:[w]}],me:[{me:[w]}],mt:[{mt:[w]}],mr:[{mr:[w]}],mb:[{mb:[w]}],ml:[{ml:[w]}],"space-x":[{"space-x":[C]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[C]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit",Ee,e]}],"min-w":[{"min-w":["min","max","fit",Ee,pr]}],"max-w":[{"max-w":["0","none","full","min","max","fit","prose",{screen:[Ai]},Ai,Ee]}],h:[{h:[Ee,e,"auto","min","max","fit"]}],"min-h":[{"min-h":["min","max","fit",pr,Ee]}],"max-h":[{"max-h":[Ee,e,"min","max","fit"]}],"font-size":[{text:["base",Ai,Pi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",gc]}],"font-family":[{font:[ra]}],"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-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Ee]}],"line-clamp":[{"line-clamp":["none",Lo,gc]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",pr,Ee]}],"list-image":[{"list-image":["none",Ee]}],"list-style-type":[{list:["none","disc","decimal",Ee]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...O(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",pr,Pi]}],"underline-offset":[{"underline-offset":["auto",pr,Ee]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],indent:[{indent:F()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ee]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ee]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...H(),Z2]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",K2]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Y2]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[g]}],"gradient-via-pos":[{via:[g]}],"gradient-to-pos":[{to:[g]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:[...O(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:O()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...O()]}],"outline-offset":[{"outline-offset":[pr,Ee]}],"outline-w":[{outline:[pr,Pi]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:le()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[pr,Pi]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",Ai,X2]}],"shadow-color":[{shadow:[ra]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":A()}],"bg-blend":[{"bg-blend":A()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[a]}],"drop-shadow":[{"drop-shadow":["","none",Ai,Ee]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[c]}],invert:[{invert:[d]}],saturate:[{saturate:[_]}],sepia:[{sepia:[E]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[a]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[c]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[_]}],"backdrop-sepia":[{"backdrop-sepia":[E]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[l]}],"border-spacing-x":[{"border-spacing-x":[l]}],"border-spacing-y":[{"border-spacing-y":[l]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Ee]}],duration:[{duration:ne()}],ease:[{ease:["linear","in","out","in-out",Ee]}],delay:[{delay:ne()}],animate:[{animate:["none","spin","ping","pulse","bounce",Ee]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[na,Ee]}],"translate-x":[{"translate-x":[N]}],"translate-y":[{"translate-y":[N]}],"skew-x":[{"skew-x":[$]}],"skew-y":[{"skew-y":[$]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Ee]}],accent:[{accent:["auto",t]}],appearance:["appearance-none"],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",Ee]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":F()}],"scroll-mx":[{"scroll-mx":F()}],"scroll-my":[{"scroll-my":F()}],"scroll-ms":[{"scroll-ms":F()}],"scroll-me":[{"scroll-me":F()}],"scroll-mt":[{"scroll-mt":F()}],"scroll-mr":[{"scroll-mr":F()}],"scroll-mb":[{"scroll-mb":F()}],"scroll-ml":[{"scroll-ml":F()}],"scroll-p":[{"scroll-p":F()}],"scroll-px":[{"scroll-px":F()}],"scroll-py":[{"scroll-py":F()}],"scroll-ps":[{"scroll-ps":F()}],"scroll-pe":[{"scroll-pe":F()}],"scroll-pt":[{"scroll-pt":F()}],"scroll-pr":[{"scroll-pr":F()}],"scroll-pb":[{"scroll-pb":F()}],"scroll-pl":[{"scroll-pl":F()}],"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",Ee]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[pr,Pi,gc]}],stroke:[{stroke:[t,"none"]}],sr:["sr-only","not-sr-only"]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","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","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],"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"],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-s","border-w-e","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-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"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","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-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"]}}}const tR=I2(eR);function xt(...t){return tR(pS(t))}const $a=p.forwardRef(({className:t,children:e,innerRef:n,...r},i)=>x.jsxs(fS,{ref:i,className:xt("relative overflow-hidden",t),...r,children:[x.jsx(E2,{className:"h-full w-full rounded-[inherit]",ref:n,children:e}),x.jsx(_S,{}),x.jsx(C2,{})]}));$a.displayName=fS.displayName;const _S=p.forwardRef(({className:t,orientation:e="vertical",...n},r)=>x.jsx(iS,{ref:r,orientation:e,className:xt("flex touch-none select-none transition-colors",e==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",e==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",t),...n,children:x.jsx(v2,{className:xt("relative rounded-full bg-border",e==="vertical"&&"flex-1")})}));_S.displayName=iS.displayName;var nR={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 rR=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Mn=(t,e)=>{const n=p.forwardRef(({color:r="currentColor",size:i=24,strokeWidth:o=2,absoluteStrokeWidth:l,children:s,...a},u)=>p.createElement("svg",{ref:u,...nR,width:i,height:i,stroke:r,strokeWidth:l?Number(o)*24/Number(i):o,className:`lucide lucide-${rR(t)}`,...a},[...e.map(([c,d])=>p.createElement(c,d)),...(Array.isArray(s)?s:[s])||[]]));return n.displayName=`${t}`,n},iR=Mn("Check",[["polyline",{points:"20 6 9 17 4 12",key:"10jjfj"}]]),wS=Mn("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),oR=Mn("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]),P0=Mn("LogIn",[["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}],["polyline",{points:"10 17 15 12 10 7",key:"1ail0h"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}]]),lR=Mn("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]),sR=Mn("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]),aR=Mn("Minimize2",[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]),uR=Mn("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]),cR=Mn("Pause",[["rect",{width:"4",height:"16",x:"6",y:"4",key:"iffhe4"}],["rect",{width:"4",height:"16",x:"14",y:"4",key:"sjin7j"}]]),dR=Mn("Play",[["polygon",{points:"5 3 19 12 5 21 5 3",key:"191637"}]]),fR=Mn("Power",[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]]),hR=Mn("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]]),pR=Mn("Sun",[["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"}]]),mR=Mn("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function Ta({children:t}){const e=p.useRef(null),n=p.useRef(null),r=p.useRef(!1),i=p.useRef(0),o=p.useRef(null),l=p.useRef(0),[s,a]=p.useState(!0),u=()=>{r.current=!1,o.current=null,i.current=0,l.current=0},c=y=>{y.preventDefault();const _=o.current==="left"?e:n;if(_.current&&r.current){const S=o.current==="left"?y.screenX-i.current:i.current-y.screenX;_.current.style.width=`${Math.max(l.current+S,150)}px`}},d=y=>_=>{if(_.target){const E=y==="left"?e:y==="right"?n:null;r.current=!0,E&&E.current&&(i.current=_.screenX,o.current=y,E.current&&(l.current=E.current.offsetWidth))}},[f,h,g,m,w,v]=p.Children.toArray(t);return p.useEffect(()=>(document.addEventListener("mouseup",u),document.addEventListener("mousemove",c),()=>{document.removeEventListener("mouseup",u),document.removeEventListener("mousemove",c)}),[]),x.jsxs("div",{className:"relative flex h-screen",children:[x.jsxs("div",{ref:e,className:Pn("absolute top-0 left-0 border-r border-border md:relative z-[1] bg-gradient-to-br from-card from-50% to-background",{"w-[300px]":s,"w-0 md:w-[300px]":!s}),children:[x.jsxs(Ta.Column,{children:[x.jsx(A0,{showOnMobile:!s,onClick:()=>{a(!s)},children:f}),x.jsx($a,{style:{height:"calc(100vh - 50px)"},onClick:()=>{a(!1)},children:h})]}),x.jsx("div",{className:"absolute inset-y-0 right-0 cursor-col-resize w-[1px] hover:w-[3px] h-full hover:bg-border",onMouseDown:d("left")})]}),x.jsx("div",{className:Pn("",{"w-full":!w&&!v}),children:x.jsxs(Ta.Column,{children:[x.jsxs("span",{className:"flex w-full border-b border-border",children:[x.jsx(A0,{className:"md:hidden",showOnMobile:s,onClick:()=>{a(!s)},children:f}),x.jsx("span",{className:Pn({"pl-[300px] md:pl-0":s}),children:g})]}),x.jsx($a,{style:{height:"calc(100vh - 50px)"},children:m})]})}),w||v&&x.jsxs("div",{ref:n,className:"relative h-screen border-l border-border",style:{width:300},children:[x.jsxs(Ta.Column,{children:[w,x.jsx($a,{style:{height:"calc(100vh - 50px)"},children:v})]}),x.jsx("div",{onMouseDown:d("right"),className:"absolute inset-y-0 left-0 cursor-col-resize w-[1px] bg-border hover:w-[3px] hover:bg-border"})]})]})}function A0({className:t,showOnMobile:e,onClick:n,children:r}){return x.jsxs("div",{className:Pn("flex items-center px-4 md:px-4",t,{"hidden md:flex":e}),children:[x.jsx("button",{className:"md:hidden",onClick:n,children:x.jsx(sR,{})}),x.jsx("span",{className:"flex items-center justify-between w-full",children:r})]})}Ta.Column=({children:t,className:e})=>{const[n,r]=p.Children.toArray(t);return x.jsxs("div",{className:Pn("flex flex-col",e),children:[x.jsx("div",{className:"flex items-center border-b border-border",children:n}),r]})};var D={};let kf={},SS={},iu={},Na={},em={},ql={},Qg={},tm={},ou={},lu={},Ki={},qg={},ev={},ES={},CS={},kS={},bS={},$S={},TS={},NS={},Ed={},RS={},OS={},PS={},AS={},MS={},LS={},DS={},IS={},jS={},tv={},nv={},nm={},zS={},FS={},BS={};function K(t){let e=new URLSearchParams;e.append("code",t);for(let n=1;n<arguments.length;n++)e.append("v",arguments[n]);throw Error(`Minified Lexical error #${t}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}let ki=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",gR=ki&&"documentMode"in document?document.documentMode:null,Jt=ki&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),so=ki&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),Cd=ki&&"InputEvent"in window&&!gR?"getTargetRanges"in new window.InputEvent("input"):!1,rv=ki&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),bf=ki&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,vR=ki&&/^(?=.*Chrome).*/i.test(navigator.userAgent),iv=ki&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!vR,$f=rv||bf||iv?" ":"",yR=so?" ":$f,xR=/^[^A-Za-z\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u02b8\u0300-\u0590\u0800-\u1fff\u200e\u2c00-\ufb1c\ufe00-\ufe6f\ufefd-\uffff]*[\u0591-\u07ff\ufb1d-\ufdfd\ufe70-\ufefc]/,_R=/^[^\u0591-\u07ff\ufb1d-\ufdfd\ufe70-\ufefc]*[A-Za-z\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u02b8\u0300-\u0590\u0800-\u1fff\u200e\u2c00-\ufb1c\ufe00-\ufe6f\ufefd-\uffff]/,Fo={bold:1,code:16,highlight:128,italic:2,strikethrough:4,subscript:32,superscript:64,underline:8},wR={directionless:1,unmergeable:2},M0={center:2,end:6,justify:4,left:1,right:3,start:5},SR={2:"center",6:"end",4:"justify",1:"left",3:"right",5:"start"},ER={normal:0,segmented:2,token:1},CR={0:"normal",2:"segmented",1:"token"},rm=!1,ov=0;function kR(t){ov=t.timeStamp}function Oh(t,e,n){return e.__lexicalLineBreak===t||t[`__lexicalKey_${n._key}`]!==void 0}function bR(t){return t.getEditorState().read(()=>{let e=rt();return e!==null?e.clone():null})}function US(t,e,n){rm=!0;let r=100<performance.now()-ov;try{Hn(t,()=>{let i=rt()||bR(t);var o=new Map,l=t.getRootElement(),s=t._editorState,a=t._blockCursorElement;let u=!1,c="";for(var d=0;d<e.length;d++){var f=e[d],h=f.type,g=f.target,m=Fu(g,s);if(!(m===null&&g!==l||tt(m))){if(h==="characterData"){if(f=r&&Q(m))e:{f=i,h=g;var w=m;if(ge(f)){var v=f.anchor.getNode();if(v.is(w)&&f.format!==v.getFormat()){f=!1;break e}}f=h.nodeType===3&&w.isAttached()}f&&(w=Jr(t._window),h=f=null,w!==null&&w.anchorNode===g&&(f=w.anchorOffset,h=w.focusOffset),g=g.nodeValue,g!==null&&dv(m,g,f,h,!1))}else if(h==="childList"){for(u=!0,h=f.addedNodes,w=0;w<h.length;w++){v=h[w];var y=YS(v),_=v.parentNode;_==null||v===a||y!==null||v.nodeName==="BR"&&Oh(v,_,t)||(so&&(y=v.innerText||v.nodeValue)&&(c+=y),_.removeChild(v))}if(f=f.removedNodes,h=f.length,0<h){for(w=0,v=0;v<h;v++)_=f[v],(_.nodeName==="BR"&&Oh(_,g,t)||a===_)&&(g.appendChild(_),w++);h!==w&&(g===l&&(m=s._nodeMap.get("root")),o.set(g,m))}}}}if(0<o.size)for(let[S,E]of o)if(B(E))for(o=E.getChildrenKeys(),l=S.firstChild,s=0;s<o.length;s++)a=t.getElementByKey(o[s]),a!==null&&(l==null?(S.appendChild(a),l=a):l!==a&&S.replaceChild(a,l),l=l.nextSibling);else Q(E)&&E.markDirty();if(o=n.takeRecords(),0<o.length){for(l=0;l<o.length;l++)for(a=o[l],s=a.addedNodes,a=a.target,d=0;d<s.length;d++)m=s[d],g=m.parentNode,g==null||m.nodeName!=="BR"||Oh(m,a,t)||g.removeChild(m);n.takeRecords()}i!==null&&(u&&(i.dirty=!0,Vr(i)),so&&qS(t)&&i.insertRawText(c))})}finally{rm=!1}}function WS(t){let e=t._observer;if(e!==null){let n=e.takeRecords();US(t,n,e)}}function VS(t){ov===0&&Nf(t).addEventListener("textInput",kR,!0),t._observer=new MutationObserver((e,n)=>{US(t,e,n)})}function L0(t,e){let n=t.__mode,r=t.__format;t=t.__style;let i=e.__mode,o=e.__format;return e=e.__style,(n===null||n===i)&&(r===null||r===o)&&(t===null||t===e)}function D0(t,e){let n=t.mergeWithSibling(e),r=pt()._normalizedNodes;return r.add(t.__key),r.add(e.__key),n}function HS(t){if(t.__text===""&&t.isSimpleText()&&!t.isUnmergeable())t.remove();else{for(var e;(e=t.getPreviousSibling())!==null&&Q(e)&&e.isSimpleText()&&!e.isUnmergeable();)if(e.__text==="")e.remove();else{L0(e,t)&&(t=D0(e,t));break}for(var n;(n=t.getNextSibling())!==null&&Q(n)&&n.isSimpleText()&&!n.isUnmergeable();)if(n.__text==="")n.remove();else{L0(t,n)&&D0(t,n);break}}}function lv(t){return I0(t.anchor),I0(t.focus),t}function I0(t){for(;t.type==="element";){var e=t.getNode(),n=t.offset;if(n===e.getChildrenSize()?(e=e.getChildAtIndex(n-1),n=!0):(e=e.getChildAtIndex(n),n=!1),Q(e)){t.set(e.__key,n?e.getTextContentSize():0,"text");break}else if(!B(e))break;t.set(e.__key,n?e.getChildrenSize():0,"element")}}let $R=1,TR=typeof queueMicrotask=="function"?queueMicrotask:t=>{Promise.resolve().then(t)};function sv(t){let e=document.activeElement;if(e===null)return!1;let n=e.nodeName;return tt(Fu(t))&&(n==="INPUT"||n==="TEXTAREA"||e.contentEditable==="true"&&e.__lexicalEditor==null)}function zu(t,e,n){let r=t.getRootElement();try{return r!==null&&r.contains(e)&&r.contains(n)&&e!==null&&!sv(e)&&av(e)===t}catch{return!1}}function av(t){for(;t!=null;){let e=t.__lexicalEditor;if(e!=null)return e;t=Tf(t)}return null}function im(t){return t.isToken()||t.isSegmented()}function kd(t){for(;t!=null;){if(t.nodeType===3)return t;t=t.firstChild}return null}function KS(t,e,n){return e=Fo[e],t&e&&(n===null||!(n&e))?t^e:n===null||n&e?t|e:t}function ZS(t){return Q(t)||cu(t)||tt(t)}function GS(t,e){if(e!=null)t.__key=e;else{hn(),99<du&&K(14),e=pt();var n=Qr(),r=""+$R++;n._nodeMap.set(r,t),B(t)?e._dirtyElements.set(r,!0):e._dirtyLeaves.add(r),e._cloneNotNeeded.add(r),e._dirtyType=1,t.__key=r}}function Bo(t){var e=t.getParent();if(e!==null){let i=t.getWritable();e=e.getWritable();var n=t.getPreviousSibling();if(t=t.getNextSibling(),n===null)if(t!==null){var r=t.getWritable();e.__first=t.__key,r.__prev=null}else e.__first=null;else{if(r=n.getWritable(),t!==null){let o=t.getWritable();o.__prev=r.__key,r.__next=o.__key}else r.__next=null;i.__prev=null}t===null?n!==null?(t=n.getWritable(),e.__last=n.__key,t.__next=null):e.__last=null:(t=t.getWritable(),n!==null?(n=n.getWritable(),n.__next=t.__key,t.__prev=n.__key):t.__prev=null,i.__next=null),e.__size--,i.__parent=null}}function bd(t){99<du&&K(14);var e=t.getLatest(),n=e.__parent,r=Qr();let i=pt(),o=r._nodeMap;if(r=i._dirtyElements,n!==null)e:for(;n!==null;){if(r.has(n))break e;let l=o.get(n);if(l===void 0)break;r.set(n,!1),n=l.__parent}e=e.__key,i._dirtyType=1,B(t)?r.set(e,!0):i._dirtyLeaves.add(e)}function Kt(t){hn();var e=pt();let n=e._compositionKey;t!==n&&(e._compositionKey=t,n!==null&&(e=It(n),e!==null&&e.getWritable()),t!==null&&(t=It(t),t!==null&&t.getWritable()))}function Zi(){return Ps()?null:pt()._compositionKey}function It(t,e){return t=(e||Qr())._nodeMap.get(t),t===void 0?null:t}function YS(t,e){let n=pt();return t=t[`__lexicalKey_${n._key}`],t!==void 0?It(t,e):null}function Fu(t,e){for(;t!=null;){let n=YS(t,e);if(n!==null)return n;t=Tf(t)}return null}function XS(t){let e=Object.assign({},t._decorators);return t._pendingDecorators=e}function j0(t){return t.read(()=>Xr().getTextContent())}function NR(t,e){Hn(t,()=>{var n=Qr();if(!n.isEmpty())if(e==="root")Xr().markDirty();else{n=n._nodeMap;for(let[,r]of n)r.markDirty()}},t._pendingEditorState===null?{tag:"history-merge"}:void 0)}function Xr(){return Qr()._nodeMap.get("root")}function Vr(t){hn();let e=Qr();t!==null&&(t.dirty=!0,t._cachedNodes=null),e._selection=t}function Ul(t){var e=pt(),n;e:{for(n=t;n!=null;){let r=n[`__lexicalKey_${e._key}`];if(r!==void 0){n=r;break e}n=Tf(n)}n=null}return n===null?(e=e.getRootElement(),t===e?It("root"):null):It(n)}function JS(t){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(t)}function uv(t){let e=[];for(;t!==null;)e.push(t),t=t._parentEditor;return e}function QS(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function cv(t,e,n){if(e=Jr(e._window),e!==null){var r=e.anchorNode,{anchorOffset:i,focusOffset:o}=e;if(r!==null&&(e=r.nodeType===3?r.nodeValue:null,r=Fu(r),e!==null&&Q(r))){if(e===$f&&n){let l=n.length;e=n,o=i=l}e!==null&&dv(r,e,i,o,t)}}}function dv(t,e,n,r,i){let o=t;if(o.isAttached()&&(i||!o.isDirty())){let u=o.isComposing(),c=e;if((u||i)&&e[e.length-1]===$f&&(c=e.slice(0,-1)),e=o.getTextContent(),i||c!==e)if(c==="")if(Kt(null),rv||bf||iv)o.remove();else{let d=pt();setTimeout(()=>{d.update(()=>{o.isAttached()&&o.remove()})},20)}else{i=o.getParent(),e=Os();var l=o.getTextContentSize(),s=Zi(),a=o.getKey();o.isToken()||s!==null&&a===s&&!u||ge(e)&&(i!==null&&!i.canInsertTextBefore()&&e.anchor.offset===0||e.anchor.key===t.__key&&e.anchor.offset===0&&!o.canInsertTextBefore()||e.focus.key===t.__key&&e.focus.offset===l&&!o.canInsertTextAfter())?o.markDirty():(t=rt(),ge(t)&&n!==null&&r!==null&&(t.setTextNodeRange(o,n,o,r),o.isSegmented()&&(n=o.getTextContent(),n=Lt(n),o.replace(n),o=n)),o.setTextContent(c))}}}function RR(t,e){if(e.isSegmented())return!0;if(!t.isCollapsed())return!1;t=t.anchor.offset;let n=e.getParentOrThrow(),r=e.isToken();return t===0?((t=!e.canInsertTextBefore()||!n.canInsertTextBefore()||r)||(e=e.getPreviousSibling(),t=(Q(e)||B(e)&&e.isInline())&&!e.canInsertTextAfter()),t):t===e.getTextContentSize()?!e.canInsertTextAfter()||!n.canInsertTextAfter()||r:!1}function Ra(t,e){t.__lexicalClassNameCache===void 0&&(t.__lexicalClassNameCache={});let n=t.__lexicalClassNameCache,r=n[e];return r!==void 0?r:(t=t[e],typeof t=="string"?(t=t.split(" "),n[e]=t):t)}function fv(t,e,n,r,i){n.size!==0&&(n=r.__type,r=r.__key,e=e.get(n),e===void 0&&K(33,n),n=e.klass,e=t.get(n),e===void 0&&(e=new Map,t.set(n,e)),t=e.get(r),n=t==="destroyed"&&i==="created",(t===void 0||n)&&e.set(r,n?"updated":i))}function z0(t,e,n){let r=t.getParent(),i=n;return r!==null&&(e&&n===0?(i=t.getIndexWithinParent(),t=r):e||n!==t.getChildrenSize()||(i=t.getIndexWithinParent()+1,t=r)),t.getChildAtIndex(e?i-1:i)}function om(t,e){var n=t.offset;return t.type==="element"?(t=t.getNode(),z0(t,e,n)):(t=t.getNode(),e&&n===0||!e&&n===t.getTextContentSize()?(n=e?t.getPreviousSibling():t.getNextSibling(),n===null?z0(t.getParentOrThrow(),e,t.getIndexWithinParent()+(e?0:1)):n):null)}function qS(t){return t=(t=Nf(t).event)&&t.inputType,t==="insertFromPaste"||t==="insertFromPasteAsQuotation"}function $d(t){return!mn(t)&&!t.isLastChild()&&!t.isInline()}function Td(t,e){return t=t._keyToDOMMap.get(e),t===void 0&&K(75,e),t}function Tf(t){return t=t.assignedSlot||t.parentElement,t!==null&&t.nodeType===11?t.host:t}function Nd(t,e){for(t=t.getParent();t!==null;){if(t.is(e))return!0;t=t.getParent()}return!1}function Nf(t){return t=t._window,t===null&&K(78),t}function eE(t){for(t=t.getParentOrThrow();t!==null&&!_r(t);)t=t.getParentOrThrow();return t}function _r(t){return mn(t)||B(t)&&t.isShadowRoot()}function tE(t){return t=t.constructor.clone(t),GS(t,null),t}function Bu(t){var e=pt();let n=t.constructor.getType();return e=e._nodes.get(n),e===void 0&&K(97),e=e.replace,e!==null?(e=e(t),e instanceof t.constructor||K(98),e):t}function Ph(t,e){t=t.getParent(),!mn(t)||B(e)||tt(e)||K(99)}function Ah(t){return(tt(t)||B(t)&&!t.canBeEmpty())&&!t.isInline()}function lm(t,e,n){n.style.removeProperty("caret-color"),e._blockCursorElement=null,e=t.parentElement,e!==null&&e.removeChild(t)}function Jr(t){return ki?(t||window).getSelection():null}function nE(t,e){let n=t.getChildAtIndex(e);n==null&&(n=t),_r(t)&&K(102);let r=l=>{const s=l.getParentOrThrow(),a=_r(s),u=l!==n||a?tE(l):l;if(a)return l.insertAfter(u),[l,u,u];const[c,d,f]=r(s);return l=l.getNextSiblings(),f.append(u,...l),[c,d,u]},[i,o]=r(n);return[i,o]}function Rd(t,e){for(;t!==Xr()&&t!=null;){if(e(t))return t;t=t.getParent()}return null}function OR(t){let e=[],n=[t];for(;0<n.length;){let r=n.pop();r===void 0&&K(112),B(r)&&n.unshift(...r.getChildren()),r!==t&&e.push(r)}return e}function Rf(t){return t.nodeType===1}function rE(t,e,n,r,i,o){for(t=t.getFirstChild();t!==null;){let l=t.__key;t.__parent===e&&(B(t)&&rE(t,l,n,r,i,o),n.has(l)||o.delete(l),i.push(l)),t=t.getNextSibling()}}function PR(t,e,n,r){t=t._nodeMap,e=e._nodeMap;let i=[];for(let[o]of r){let l=e.get(o);l===void 0||l.isAttached()||(B(l)&&rE(l,o,t,e,i,r),t.has(o)||r.delete(o),i.push(o))}for(let o of i)e.delete(o);for(let o of n)r=e.get(o),r===void 0||r.isAttached()||(t.has(o)||n.delete(o),e.delete(o))}let Nt="",fn="",li="",ao,tn,su,iE=!1,hv=!1,Of,Wc=null,sm,am,Xo,uo,um,au;function Vc(t,e){let n=Xo.get(t);if(e!==null){let r=fm(t);r.parentNode===e&&e.removeChild(r)}uo.has(t)||tn._keyToDOMMap.delete(t),B(n)&&(t=Od(n,Xo),cm(t,0,t.length-1,null)),n!==void 0&&fv(au,su,Of,n,"destroyed")}function cm(t,e,n,r){for(;e<=n;++e){let i=t[e];i!==void 0&&Vc(i,r)}}function $o(t,e){t.setProperty("text-align",e)}function oE(t,e){var n=ao.theme.indent;if(typeof n=="string"){let r=t.classList.contains(n);0<e&&!r?t.classList.add(n):1>e&&r&&t.classList.remove(n)}n=getComputedStyle(t).getPropertyValue("--lexical-indent-base-value")||"40px",t.style.setProperty("padding-inline-start",e===0?"":`calc(${e} * ${n})`)}function lE(t,e){t=t.style,e===0?$o(t,""):e===1?$o(t,"left"):e===2?$o(t,"center"):e===3?$o(t,"right"):e===4?$o(t,"justify"):e===5?$o(t,"start"):e===6&&$o(t,"end")}function Hc(t,e,n){let r=uo.get(t);r===void 0&&K(60);let i=r.createDOM(ao,tn);var o=tn._keyToDOMMap;if(i["__lexicalKey_"+tn._key]=t,o.set(t,i),Q(r)?i.setAttribute("data-lexical-text","true"):tt(r)&&i.setAttribute("data-lexical-decorator","true"),B(r)){if(t=r.__indent,o=r.__size,t!==0&&oE(i,t),o!==0){--o,t=Od(r,uo);var l=fn;fn="",dm(t,r,0,o,i,null),aE(r,i),fn=l}t=r.__format,t!==0&&lE(i,t),r.isInline()||sE(null,r,i),$d(r)&&(Nt+=`
|
|
48
48
|
|
|
49
49
|
`,li+=`
|
|
50
50
|
|
|
@@ -56,19 +56,19 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
56
56
|
|
|
57
57
|
`,li+=`
|
|
58
58
|
|
|
59
|
-
`)}else n=r.getTextContent(),tt(r)?(i=r.decorate(tn,ao),i!==null&&uE(t,i)):Q(r)&&!r.isDirectionless()&&(fn+=n),Nt+=n,li+=n;return!hv&&mn(r)&&r.__cachedText!==li&&(r=r.getWritable(),r.__cachedText=li),o}function uE(t,e){let n=tn._pendingDecorators,r=tn._decorators;if(n===null){if(r[t]===e)return;n=XS(tn)}n[t]=e}function Mh(t){return t=t.nextSibling,t!==null&&t===tn._blockCursorElement&&(t=t.nextSibling),t}function fm(t){let e=um.get(t);return e===void 0&&K(75,t),e}let ti=Object.freeze({}),hm=[["keydown",FR],["pointerdown",MR],["compositionstart",jR],["compositionend",zR],["input",IR],["click",AR],["cut",ti],["copy",ti],["dragstart",ti],["dragover",ti],["dragend",ti],["paste",ti],["focus",ti],["blur",ti],["drop",ti]];Cd&&hm.push(["beforeinput",(t,e)=>DR(t,e)]);let uu=0,cE=0,dE=0
|
|
59
|
+
`)}else n=r.getTextContent(),tt(r)?(i=r.decorate(tn,ao),i!==null&&uE(t,i)):Q(r)&&!r.isDirectionless()&&(fn+=n),Nt+=n,li+=n;return!hv&&mn(r)&&r.__cachedText!==li&&(r=r.getWritable(),r.__cachedText=li),o}function uE(t,e){let n=tn._pendingDecorators,r=tn._decorators;if(n===null){if(r[t]===e)return;n=XS(tn)}n[t]=e}function Mh(t){return t=t.nextSibling,t!==null&&t===tn._blockCursorElement&&(t=t.nextSibling),t}function fm(t){let e=um.get(t);return e===void 0&&K(75,t),e}let ti=Object.freeze({}),hm=[["keydown",FR],["pointerdown",MR],["compositionstart",jR],["compositionend",zR],["input",IR],["click",AR],["cut",ti],["copy",ti],["dragstart",ti],["dragover",ti],["dragend",ti],["paste",ti],["focus",ti],["blur",ti],["drop",ti]];Cd&&hm.push(["beforeinput",(t,e)=>DR(t,e)]);let uu=0,cE=0,dE=0,Tl=null,Oa=0,pm=!1,mm=!1,Pa=!1,ma=!1,fE=[0,"",0,"root",0];function hE(t,e,n,r,i){let o=t.anchor,l=t.focus,s=o.getNode();var a=pt();let u=Jr(a._window),c=u!==null?u.anchorNode:null,d=o.key;a=a.getElementByKey(d);let f=n.length;return d!==l.key||!Q(s)||(!i&&(!Cd||dE<r+50)||s.isDirty()&&2>f||JS(n))&&o.offset!==l.offset&&!s.isComposing()||im(s)||s.isDirty()&&1<f||(i||!Cd)&&a!==null&&!s.isComposing()&&c!==kd(a)||u!==null&&e!==null&&(!e.collapsed||e.startContainer!==u.anchorNode||e.startOffset!==u.anchorOffset)||s.getFormat()!==t.format||s.getStyle()!==t.style||RR(t,s)}function B0(t,e){return t!==null&&t.nodeValue!==null&&t.nodeType===3&&e!==0&&e!==t.nodeValue.length}function U0(t,e,n){let{anchorNode:r,anchorOffset:i,focusNode:o,focusOffset:l}=t;pm&&(pm=!1,B0(r,i)&&B0(o,l))||Hn(e,()=>{if(!n)Vr(null);else if(zu(e,r,o)){var s=rt();if(ge(s)){var a=s.anchor,u=a.getNode();if(s.isCollapsed()){t.type==="Range"&&t.anchorNode===t.focusNode&&(s.dirty=!0);var c=Nf(e).event;c=c?c.timeStamp:performance.now();let[d,f,h,g,m]=fE;c<m+200&&a.offset===h&&a.key===g?(s.format=d,s.style=f):a.type==="text"?(s.format=u.getFormat(),s.style=u.getStyle()):a.type==="element"&&(s.format=0,s.style="")}else{a=255,u=!1,c=s.getNodes();let d=c.length;for(let f=0;f<d;f++){let h=c[f];if(Q(h)&&(u=!0,a&=h.getFormat(),a===0))break}s.format=u?a:0}}X(e,kf,void 0)}})}function AR(t,e){Hn(e,()=>{let n=rt();var r=Jr(e._window);let i=Os();if(r)if(ge(n)){let l=n.anchor;var o=l.getNode();l.type==="element"&&l.offset===0&&n.isCollapsed()&&!mn(o)&&Xr().getChildrenSize()===1&&o.getTopLevelElementOrThrow().isEmpty()&&i!==null&&n.is(i)?(r.removeAllRanges(),n.dirty=!0):t.detail!==3||n.isCollapsed()||(r=n.focus.getNode(),o!==r&&(B(o)?o.select(0):o.getParentOrThrow().select(0)))}else t.pointerType==="touch"&&(o=r.anchorNode,o!==null&&(o=o.nodeType,o===1||o===3))&&(r=mv(i,r,e),Vr(r));X(e,SS,t)})}function MR(t,e){let n=t.target;t=t.pointerType,n instanceof Node&&t!=="touch"&&Hn(e,()=>{tt(Fu(n))||(mm=!0)})}function pE(t){return t.getTargetRanges?(t=t.getTargetRanges(),t.length===0?null:t[0]):null}function LR(t,e){return t!==e||B(t)||B(e)||!t.isToken()||!e.isToken()}function DR(t,e){let n=t.inputType,r=pE(t);n==="deleteCompositionText"||so&&qS(e)||n!=="insertCompositionText"&&Hn(e,()=>{let i=rt();if(n==="deleteContentBackward"){if(i===null){var o=Os();if(!ge(o))return;Vr(o.clone())}if(ge(i)){cE===229&&t.timeStamp<uu+30&&e.isComposing()&&i.anchor.key===i.focus.key?(Kt(null),uu=0,setTimeout(()=>{Hn(e,()=>{Kt(null)})},30),ge(i)&&(o=i.anchor.getNode(),o.markDirty(),i.format=o.getFormat(),i.style=o.getStyle())):(t.preventDefault(),X(e,iu,!0));return}}if(ge(i)){o=t.data,Tl!==null&&cv(!1,e,Tl),i.dirty&&Tl===null||!i.isCollapsed()||mn(i.anchor.getNode())||r===null||i.applyDOMRange(r),Tl=null;var l=i.focus,s=i.anchor.getNode();if(l=l.getNode(),n==="insertText"||n==="insertTranspose")o===`
|
|
60
60
|
`?(t.preventDefault(),X(e,Na,!1)):o===`
|
|
61
61
|
|
|
62
|
-
`?(t.preventDefault(),X(e,em,void 0)):o==null&&t.dataTransfer?(o=t.dataTransfer.getData("text/plain"),t.preventDefault(),i.insertRawText(o)):o!=null&&hE(i,r,o,t.timeStamp,!0)?(t.preventDefault(),X(e,
|
|
63
|
-
`&&(n=rt(),ge(n))){e=n.focus,n.anchor.set(e.key,e.offset,e.type),X(t,Ed,null);return}}cv(!0,t,e)}function zR(t,e){so?ma=!0:Hn(e,()=>{gm(e,t.data)})}function FR(t,e){if(uu=t.timeStamp,cE=t.keyCode,!e.isComposing()){var{keyCode:n,shiftKey:r,ctrlKey:i,metaKey:o,altKey:l}=t;if(!X(e,ES,t)){if(n!==39||i||o||l)if(n!==39||l||r||!i&&!o)if(n!==37||i||o||l)if(n!==37||l||r||!i&&!o)if(n!==38||i||o)if(n!==40||i||o)if(n===13&&r)Pa=!0,X(e,Ed,t);else if(n===32)X(e,RS,t);else if(Jt&&i&&n===79)t.preventDefault(),Pa=!0,X(e,Na,!0);else if(n!==13||r){var s=Jt?l||o?!1:n===8||n===72&&i:i||l||o?!1:n===8;s?n===8?X(e,OS,t):(t.preventDefault(),X(e,iu,!0)):n===27?X(e,PS,t):(s=Jt?r||l||o?!1:n===46||n===68&&i:i||l||o?!1:n===46,s?n===46?X(e,AS,t):(t.preventDefault(),X(e,iu,!1)):n===8&&(Jt?l:i)?(t.preventDefault(),X(e,ou,!0)):n===46&&(Jt?l:i)?(t.preventDefault(),X(e,ou,!1)):Jt&&o&&n===8?(t.preventDefault(),X(e,lu,!0)):Jt&&o&&n===46?(t.preventDefault(),X(e,lu,!1)):n===66&&!l&&(Jt?o:i)?(t.preventDefault(),X(e,Ki,"bold")):n===85&&!l&&(Jt?o:i)?(t.preventDefault(),X(e,Ki,"underline")):n===73&&!l&&(Jt?o:i)?(t.preventDefault(),X(e,Ki,"italic")):n!==9||l||i||o?n===90&&!r&&(Jt?o:i)?(t.preventDefault(),X(e,qg,void 0)):(s=Jt?n===90&&o&&r:n===89&&i||n===90&&i&&r,s?(t.preventDefault(),X(e,ev,void 0)):
|
|
64
|
-
`}createDOM(){return document.createElement("br")}updateDOM(){return!1}static importDOM(){return{br:e=>{let n=e.parentElement,r,i;return n!==null&&((r=n.firstChild)===e||r.nextSibling===e&&r.nodeType===3&&(r.textContent||"").match(/^( |\t|\r?\n)+$/)!==null)&&((i=n.lastChild)===e||i.previousSibling===e&&i.nodeType===3&&(i.textContent||"").match(/^( |\t|\r?\n)+$/)!==null)?null:{conversion:UR,priority:0}}}}static importJSON(){return
|
|
62
|
+
`?(t.preventDefault(),X(e,em,void 0)):o==null&&t.dataTransfer?(o=t.dataTransfer.getData("text/plain"),t.preventDefault(),i.insertRawText(o)):o!=null&&hE(i,r,o,t.timeStamp,!0)?(t.preventDefault(),X(e,ql,o)):Tl=o,dE=t.timeStamp;else switch(t.preventDefault(),n){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":X(e,ql,t);break;case"insertFromComposition":Kt(null),X(e,ql,t);break;case"insertLineBreak":Kt(null),X(e,Na,!1);break;case"insertParagraph":Kt(null),Pa&&!bf?(Pa=!1,X(e,Na,!1)):X(e,em,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":X(e,Qg,t);break;case"deleteByComposition":LR(s,l)&&X(e,tm,t);break;case"deleteByDrag":case"deleteByCut":X(e,tm,t);break;case"deleteContent":X(e,iu,!1);break;case"deleteWordBackward":X(e,ou,!0);break;case"deleteWordForward":X(e,ou,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":X(e,lu,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":X(e,lu,!1);break;case"formatStrikeThrough":X(e,Ki,"strikethrough");break;case"formatBold":X(e,Ki,"bold");break;case"formatItalic":X(e,Ki,"italic");break;case"formatUnderline":X(e,Ki,"underline");break;case"historyUndo":X(e,qg,void 0);break;case"historyRedo":X(e,ev,void 0)}}})}function IR(t,e){t.stopPropagation(),Hn(e,()=>{var n=rt(),r=t.data,i=pE(t);if(r!=null&&ge(n)&&hE(n,i,r,t.timeStamp,!1)){ma&&(gm(e,r),ma=!1);var o=n.anchor,l=o.getNode();if(i=Jr(e._window),i===null)return;let s=o.offset;(o=Cd&&!n.isCollapsed()&&Q(l)&&i.anchorNode!==null)&&(l=l.getTextContent().slice(0,s)+r+l.getTextContent().slice(s+n.focus.offset),i=i.anchorNode,o=l===(i.nodeType===3?i.nodeValue:null)),o||X(e,ql,r),r=r.length,so&&1<r&&t.inputType==="insertCompositionText"&&!e.isComposing()&&(n.anchor.offset-=r),rv||bf||iv||!e.isComposing()||(uu=0,Kt(null))}else cv(!1,e,r!==null?r:void 0),ma&&(gm(e,r||void 0),ma=!1);hn(),n=pt(),WS(n)}),Tl=null}function jR(t,e){Hn(e,()=>{let n=rt();if(ge(n)&&!e.isComposing()){let r=n.anchor,i=n.anchor.getNode();Kt(r.key),(t.timeStamp<uu+30||r.type==="element"||!n.isCollapsed()||i.getFormat()!==n.format||i.getStyle()!==n.style)&&X(e,ql,yR)}})}function gm(t,e){var n=t._compositionKey;if(Kt(null),n!==null&&e!=null){if(e===""){e=It(n),t=kd(t.getElementByKey(n)),t!==null&&t.nodeValue!==null&&Q(e)&&dv(e,t.nodeValue,null,null,!0);return}if(e[e.length-1]===`
|
|
63
|
+
`&&(n=rt(),ge(n))){e=n.focus,n.anchor.set(e.key,e.offset,e.type),X(t,Ed,null);return}}cv(!0,t,e)}function zR(t,e){so?ma=!0:Hn(e,()=>{gm(e,t.data)})}function FR(t,e){if(uu=t.timeStamp,cE=t.keyCode,!e.isComposing()){var{keyCode:n,shiftKey:r,ctrlKey:i,metaKey:o,altKey:l}=t;if(!X(e,ES,t)){if(n!==39||i||o||l)if(n!==39||l||r||!i&&!o)if(n!==37||i||o||l)if(n!==37||l||r||!i&&!o)if(n!==38||i||o)if(n!==40||i||o)if(n===13&&r)Pa=!0,X(e,Ed,t);else if(n===32)X(e,RS,t);else if(Jt&&i&&n===79)t.preventDefault(),Pa=!0,X(e,Na,!0);else if(n!==13||r){var s=Jt?l||o?!1:n===8||n===72&&i:i||l||o?!1:n===8;s?n===8?X(e,OS,t):(t.preventDefault(),X(e,iu,!0)):n===27?X(e,PS,t):(s=Jt?r||l||o?!1:n===46||n===68&&i:i||l||o?!1:n===46,s?n===46?X(e,AS,t):(t.preventDefault(),X(e,iu,!1)):n===8&&(Jt?l:i)?(t.preventDefault(),X(e,ou,!0)):n===46&&(Jt?l:i)?(t.preventDefault(),X(e,ou,!1)):Jt&&o&&n===8?(t.preventDefault(),X(e,lu,!0)):Jt&&o&&n===46?(t.preventDefault(),X(e,lu,!1)):n===66&&!l&&(Jt?o:i)?(t.preventDefault(),X(e,Ki,"bold")):n===85&&!l&&(Jt?o:i)?(t.preventDefault(),X(e,Ki,"underline")):n===73&&!l&&(Jt?o:i)?(t.preventDefault(),X(e,Ki,"italic")):n!==9||l||i||o?n===90&&!r&&(Jt?o:i)?(t.preventDefault(),X(e,qg,void 0)):(s=Jt?n===90&&o&&r:n===89&&i||n===90&&i&&r,s?(t.preventDefault(),X(e,ev,void 0)):Rs(e._editorState._selection)?(s=r?!1:n===67?Jt?o:i:!1,s?(t.preventDefault(),X(e,tv,t)):(s=r?!1:n===88?Jt?o:i:!1,s?(t.preventDefault(),X(e,nv,t)):n===65&&(Jt?o:i)&&(t.preventDefault(),X(e,nm,t)))):!so&&n===65&&(Jt?o:i)&&(t.preventDefault(),X(e,nm,t))):X(e,MS,t))}else Pa=!1,X(e,Ed,t);else X(e,NS,t);else X(e,TS,t);else X(e,$S,t);else X(e,bS,t);else X(e,kS,t);else X(e,CS,t);(i||r||l||o)&&X(e,BS,t)}}}function mE(t){let e=t.__lexicalEventHandles;return e===void 0&&(e=[],t.__lexicalEventHandles=e),e}let es=new Map;function gE(t){t=t.target;let e=Jr(t==null?null:t.nodeType===9?t.defaultView:t.ownerDocument.defaultView);if(e!==null){var n=av(e.anchorNode);if(n!==null){mm&&(mm=!1,Hn(n,()=>{var l=Os(),s=e.anchorNode;s!==null&&(s=s.nodeType,s===1||s===3)&&(l=mv(l,e,n),Vr(l))})),t=uv(n),t=t[t.length-1];var r=t._key,i=es.get(r),o=i||t;o!==n&&U0(e,o,!1),U0(e,n,!0),n!==t?es.set(r,n):i&&es.delete(r)}}}function BR(t,e){Oa===0&&t.ownerDocument.addEventListener("selectionchange",gE),Oa++,t.__lexicalEditor=e;let n=mE(t);for(let r=0;r<hm.length;r++){let[i,o]=hm[r],l=typeof o=="function"?s=>{s._lexicalHandled!==!0&&(s._lexicalHandled=!0,e.isEditable()&&o(s,e))}:s=>{if(s._lexicalHandled!==!0&&(s._lexicalHandled=!0,e.isEditable()))switch(i){case"cut":return X(e,nv,s);case"copy":return X(e,tv,s);case"paste":return X(e,Qg,s);case"dragstart":return X(e,DS,s);case"dragover":return X(e,IS,s);case"dragend":return X(e,jS,s);case"focus":return X(e,zS,s);case"blur":return X(e,FS,s);case"drop":return X(e,LS,s)}};t.addEventListener(i,l),n.push(()=>{t.removeEventListener(i,l)})}}function vm(t,e,n){hn();var r=t.__key;let i=t.getParent();if(i!==null){var o=rt();if(ge(o)&&B(t)){var{anchor:l,focus:s}=o,a=l.getNode(),u=s.getNode();Nd(a,t)&&l.set(t.__key,0,"element"),Nd(u,t)&&s.set(t.__key,0,"element")}if(a=o,u=!1,ge(a)&&e){o=a.anchor;let c=a.focus;o.key===r&&(Ad(o,t,i,t.getPreviousSibling(),t.getNextSibling()),u=!0),c.key===r&&(Ad(c,t,i,t.getPreviousSibling(),t.getNextSibling()),u=!0)}else Rs(a)&&e&&t.isSelected()&&t.selectPrevious();ge(a)&&e&&!u?(r=t.getIndexWithinParent(),Bo(t),Pd(a,i,r,-1)):Bo(t),n||_r(i)||i.canBeEmpty()||!i.isEmpty()||vm(i,e),e&&mn(i)&&i.isEmpty()&&i.selectEnd()}}class Uu{static getType(){K(64,this.name)}static clone(){K(65,this.name)}constructor(e){this.__type=this.constructor.getType(),this.__next=this.__prev=this.__parent=null,GS(this,e)}getType(){return this.__type}isAttached(){for(var e=this.__key;e!==null;){if(e==="root")return!0;if(e=It(e),e===null)break;e=e.__parent}return!1}isSelected(e){if(e=e||rt(),e==null)return!1;let n=e.getNodes().some(r=>r.__key===this.__key);return Q(this)?n:ge(e)&&e.anchor.type==="element"&&e.focus.type==="element"&&e.anchor.key===e.focus.key&&e.anchor.offset===e.focus.offset?!1:n}getKey(){return this.__key}getIndexWithinParent(){var e=this.getParent();if(e===null)return-1;e=e.getFirstChild();let n=0;for(;e!==null;){if(this.is(e))return n;n++,e=e.getNextSibling()}return-1}getParent(){let e=this.getLatest().__parent;return e===null?null:It(e)}getParentOrThrow(){let e=this.getParent();return e===null&&K(66,this.__key),e}getTopLevelElement(){let e=this;for(;e!==null;){let n=e.getParent();if(_r(n))return e;e=n}return null}getTopLevelElementOrThrow(){let e=this.getTopLevelElement();return e===null&&K(67,this.__key),e}getParents(){let e=[],n=this.getParent();for(;n!==null;)e.push(n),n=n.getParent();return e}getParentKeys(){let e=[],n=this.getParent();for(;n!==null;)e.push(n.__key),n=n.getParent();return e}getPreviousSibling(){let e=this.getLatest().__prev;return e===null?null:It(e)}getPreviousSiblings(){let e=[];var n=this.getParent();if(n===null)return e;for(n=n.getFirstChild();n!==null&&!n.is(this);)e.push(n),n=n.getNextSibling();return e}getNextSibling(){let e=this.getLatest().__next;return e===null?null:It(e)}getNextSiblings(){let e=[],n=this.getNextSibling();for(;n!==null;)e.push(n),n=n.getNextSibling();return e}getCommonAncestor(e){let n=this.getParents();var r=e.getParents();B(this)&&n.unshift(this),B(e)&&r.unshift(e),e=n.length;var i=r.length;if(e===0||i===0||n[e-1]!==r[i-1])return null;for(r=new Set(r),i=0;i<e;i++){let o=n[i];if(r.has(o))return o}return null}is(e){return e==null?!1:this.__key===e.__key}isBefore(e){if(this===e)return!1;if(e.isParentOf(this))return!0;if(this.isParentOf(e))return!1;var n=this.getCommonAncestor(e);let r=this;for(;;){var i=r.getParentOrThrow();if(i===n){i=r.getIndexWithinParent();break}r=i}for(r=e;;){if(e=r.getParentOrThrow(),e===n){n=r.getIndexWithinParent();break}r=e}return i<n}isParentOf(e){let n=this.__key;if(n===e.__key)return!1;for(;e!==null;){if(e.__key===n)return!0;e=e.getParent()}return!1}getNodesBetween(e){let n=this.isBefore(e),r=[],i=new Set;for(var o=this;;){var l=o.__key;if(i.has(l)||(i.add(l),r.push(o)),o===e)break;if(l=B(o)?n?o.getFirstChild():o.getLastChild():null,l!==null)o=l;else if(l=n?o.getNextSibling():o.getPreviousSibling(),l!==null)o=l;else{if(o=o.getParentOrThrow(),i.has(o.__key)||r.push(o),o===e)break;l=o;do l===null&&K(68),o=n?l.getNextSibling():l.getPreviousSibling(),l=l.getParent(),l!==null&&(o!==null||i.has(l.__key)||r.push(l));while(o===null)}}return n||r.reverse(),r}isDirty(){let e=pt()._dirtyLeaves;return e!==null&&e.has(this.__key)}getLatest(){let e=It(this.__key);return e===null&&K(113),e}getWritable(){hn();var e=Qr(),n=pt();e=e._nodeMap;let r=this.__key,i=this.getLatest(),o=i.__parent;n=n._cloneNotNeeded;var l=rt();return l!==null&&(l._cachedNodes=null),n.has(r)?(bd(i),i):(l=i.constructor.clone(i),l.__parent=o,l.__next=i.__next,l.__prev=i.__prev,B(i)&&B(l)?(l.__first=i.__first,l.__last=i.__last,l.__size=i.__size,l.__indent=i.__indent,l.__format=i.__format,l.__dir=i.__dir):Q(i)&&Q(l)&&(l.__format=i.__format,l.__style=i.__style,l.__mode=i.__mode,l.__detail=i.__detail),n.add(r),l.__key=r,bd(l),e.set(r,l),l)}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(){K(70)}updateDOM(){K(71)}exportDOM(e){return{element:this.createDOM(e._config,e)}}exportJSON(){K(72)}static importJSON(){K(18,this.name)}static transform(){return null}remove(e){vm(this,!0,e)}replace(e,n){hn();var r=rt();r!==null&&(r=r.clone()),Ph(this,e);let i=this.getLatest(),o=this.__key,l=e.__key,s=e.getWritable();e=this.getParentOrThrow().getWritable();let a=e.__size;Bo(s);let u=i.getPreviousSibling(),c=i.getNextSibling(),d=i.__prev,f=i.__next,h=i.__parent;return vm(i,!1,!0),u===null?e.__first=l:u.getWritable().__next=l,s.__prev=d,c===null?e.__last=l:c.getWritable().__prev=l,s.__next=f,s.__parent=h,e.__size=a,n&&this.getChildren().forEach(g=>{s.append(g)}),ge(r)&&(Vr(r),n=r.anchor,r=r.focus,n.key===o&&H0(n,s),r.key===o&&H0(r,s)),Zi()===o&&Kt(l),s}insertAfter(e,n=!0){hn(),Ph(this,e);var r=this.getWritable();let i=e.getWritable();var o=i.getParent();let l=rt();var s=!1,a=!1;if(o!==null){var u=e.getIndexWithinParent();Bo(i),ge(l)&&(a=o.__key,s=l.anchor,o=l.focus,s=s.type==="element"&&s.key===a&&s.offset===u+1,a=o.type==="element"&&o.key===a&&o.offset===u+1)}o=this.getNextSibling(),u=this.getParentOrThrow().getWritable();let c=i.__key,d=r.__next;return o===null?u.__last=c:o.getWritable().__prev=c,u.__size++,r.__next=c,i.__next=d,i.__prev=r.__key,i.__parent=r.__parent,n&&ge(l)&&(n=this.getIndexWithinParent(),Pd(l,u,n+1),r=u.__key,s&&l.anchor.set(r,n+2,"element"),a&&l.focus.set(r,n+2,"element")),e}insertBefore(e,n=!0){hn(),Ph(this,e);var r=this.getWritable();let i=e.getWritable(),o=i.__key;Bo(i);let l=this.getPreviousSibling(),s=this.getParentOrThrow().getWritable(),a=r.__prev,u=this.getIndexWithinParent();return l===null?s.__first=o:l.getWritable().__next=o,s.__size++,r.__prev=o,i.__prev=a,i.__next=r.__key,i.__parent=r.__parent,r=rt(),n&&ge(r)&&(n=this.getParentOrThrow(),Pd(r,n,u)),e}isParentRequired(){return!1}createParentElementNode(){return Jo()}selectPrevious(e,n){hn();let r=this.getPreviousSibling(),i=this.getParentOrThrow();return r===null?i.select(0,0):B(r)?r.select():Q(r)?r.select(e,n):(e=r.getIndexWithinParent()+1,i.select(e,e))}selectNext(e,n){hn();let r=this.getNextSibling(),i=this.getParentOrThrow();return r===null?i.select():B(r)?r.select(0,0):Q(r)?r.select(e,n):(e=r.getIndexWithinParent(),i.select(e,e))}markDirty(){this.getWritable()}}class Ts extends Uu{static getType(){return"linebreak"}static clone(e){return new Ts(e.__key)}constructor(e){super(e)}getTextContent(){return`
|
|
64
|
+
`}createDOM(){return document.createElement("br")}updateDOM(){return!1}static importDOM(){return{br:e=>{let n=e.parentElement,r,i;return n!==null&&((r=n.firstChild)===e||r.nextSibling===e&&r.nodeType===3&&(r.textContent||"").match(/^( |\t|\r?\n)+$/)!==null)&&((i=n.lastChild)===e||i.previousSibling===e&&i.nodeType===3&&(i.textContent||"").match(/^( |\t|\r?\n)+$/)!==null)?null:{conversion:UR,priority:0}}}}static importJSON(){return ms()}exportJSON(){return{type:"linebreak",version:1}}}function UR(){return{node:ms()}}function ms(){return Bu(new Ts)}function cu(t){return t instanceof Ts}function Lh(t,e){return e&16?"code":e&128?"mark":e&32?"sub":e&64?"sup":null}function Dh(t,e){return e&1?"strong":e&2?"em":"span"}function Ih(t,e,n,r,i){t=r.classList,r=Ra(i,"base"),r!==void 0&&t.add(...r),r=Ra(i,"underlineStrikethrough");let o=!1,l=e&8&&e&4;var s=n&8&&n&4;r!==void 0&&(s?(o=!0,l||t.add(...r)):l&&t.remove(...r));for(let a in Fo)s=Fo[a],r=Ra(i,a),r!==void 0&&(n&s?!o||a!=="underline"&&a!=="strikethrough"?(!(e&s)||l&&a==="underline"||a==="strikethrough")&&t.add(...r):e&s&&t.remove(...r):e&s&&t.remove(...r))}function jh(t,e,n){let r=e.firstChild;if(n=n.isComposing(),t+=n?$f:"",r==null)e.textContent=t;else if(e=r.nodeValue,e!==t)if(n||so){n=e.length;let i=t.length,o=0,l=0;for(;o<n&&o<i&&e[o]===t[o];)o++;for(;l+o<n&&l+o<i&&e[n-l-1]===t[i-l-1];)l++;t=[o,n-o-l,t.slice(o,i-l)];let[s,a,u]=t;a!==0&&r.deleteData(s,a),r.insertData(s,u)}else r.nodeValue=t}function vc(t,e){return e=document.createElement(e),e.appendChild(t),e}class ul extends Uu{static getType(){return"text"}static clone(e){return new ul(e.__text,e.__key)}constructor(e,n){super(n),this.__text=e,this.__format=0,this.__style="",this.__detail=this.__mode=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){let e=this.getLatest();return CR[e.__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===Zi()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return(this.getLatest().__detail&1)!==0}isUnmergeable(){return(this.getLatest().__detail&2)!==0}hasFormat(e){return e=Fo[e],(this.getFormat()&e)!==0}isSimpleText(){return this.__type==="text"&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(e,n){let r=this.getLatest().__format;return KS(r,e,n)}createDOM(e){var n=this.__format,r=Lh(this,n);let i=Dh(this,n),o=document.createElement(r===null?i:r),l=o;return this.hasFormat("code")&&o.setAttribute("spellcheck","false"),r!==null&&(l=document.createElement(i),o.appendChild(l)),r=l,jh(this.__text,r,this),e=e.theme.text,e!==void 0&&Ih(i,0,n,r,e),n=this.__style,n!==""&&(o.style.cssText=n),o}updateDOM(e,n,r){let i=this.__text;var o=e.__format,l=this.__format,s=Lh(this,o);let a=Lh(this,l);var u=Dh(this,o);let c=Dh(this,l);return(s===null?u:s)!==(a===null?c:a)?!0:s===a&&u!==c?(o=n.firstChild,o==null&&K(48),e=s=document.createElement(c),jh(i,e,this),r=r.theme.text,r!==void 0&&Ih(c,0,l,e,r),n.replaceChild(s,o),!1):(u=n,a!==null&&s!==null&&(u=n.firstChild,u==null&&K(49)),jh(i,u,this),r=r.theme.text,r!==void 0&&o!==l&&Ih(c,o,l,u,r),l=this.__style,e.__style!==l&&(n.style.cssText=l),!1)}static importDOM(){return{"#text":()=>({conversion:HR,priority:0}),b:()=>({conversion:VR,priority:0}),code:()=>({conversion:Mi,priority:0}),em:()=>({conversion:Mi,priority:0}),i:()=>({conversion:Mi,priority:0}),s:()=>({conversion:Mi,priority:0}),span:()=>({conversion:WR,priority:0}),strong:()=>({conversion:Mi,priority:0}),sub:()=>({conversion:Mi,priority:0}),sup:()=>({conversion:Mi,priority:0}),u:()=>({conversion:Mi,priority:0})}}static importJSON(e){let n=Lt(e.text);return n.setFormat(e.format),n.setDetail(e.detail),n.setMode(e.mode),n.setStyle(e.style),n}exportDOM(e){return{element:e}=super.exportDOM(e),e!==null&&Rf(e)||K(132),e.style.whiteSpace="pre-wrap",this.hasFormat("bold")&&(e=vc(e,"b")),this.hasFormat("italic")&&(e=vc(e,"i")),this.hasFormat("strikethrough")&&(e=vc(e,"s")),this.hasFormat("underline")&&(e=vc(e,"u")),{element:e}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),type:"text",version:1}}selectionTransform(){}setFormat(e){let n=this.getWritable();return n.__format=typeof e=="string"?Fo[e]:e,n}setDetail(e){let n=this.getWritable();return n.__detail=typeof e=="string"?wR[e]:e,n}setStyle(e){let n=this.getWritable();return n.__style=e,n}toggleFormat(e){return e=Fo[e],this.setFormat(this.getFormat()^e)}toggleDirectionless(){let e=this.getWritable();return e.__detail^=1,e}toggleUnmergeable(){let e=this.getWritable();return e.__detail^=2,e}setMode(e){if(e=ER[e],this.__mode===e)return this;let n=this.getWritable();return n.__mode=e,n}setTextContent(e){if(this.__text===e)return this;let n=this.getWritable();return n.__text=e,n}select(e,n){hn();let r=rt();var i=this.getTextContent();let o=this.__key;if(typeof i=="string"?(i=i.length,e===void 0&&(e=i),n===void 0&&(n=i)):n=e=0,ge(r))i=Zi(),i!==r.anchor.key&&i!==r.focus.key||Kt(o),r.setTextNodeRange(this,e,this,n);else return xE(o,e,o,n,"text","text");return r}spliceText(e,n,r,i){let o=this.getWritable(),l=o.__text,s=r.length,a=e;0>a&&(a=s+a,0>a&&(a=0));let u=rt();return i&&ge(u)&&(e+=s,u.setTextNodeRange(o,e,o,e)),n=l.slice(0,a)+r+l.slice(a+n),o.__text=n,o}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){hn();var n=this.getLatest(),r=n.getTextContent(),i=n.__key,o=Zi(),l=new Set(e);e=[];for(var s=r.length,a="",u=0;u<s;u++)a!==""&&l.has(u)&&(e.push(a),a=""),a+=r[u];if(a!==""&&e.push(a),l=e.length,l===0)return[];if(e[0]===r)return[n];var c=e[0];r=n.getParentOrThrow(),u=n.getFormat();let d=n.getStyle(),f=n.__detail;s=!1,n.isSegmented()?(a=Lt(c),a.__format=u,a.__style=d,a.__detail=f,s=!0):(a=n.getWritable(),a.__text=c),n=rt(),a=[a],c=c.length;for(let m=1;m<l;m++){var h=e[m],g=h.length;h=Lt(h).getWritable(),h.__format=u,h.__style=d,h.__detail=f;let w=h.__key;if(g=c+g,ge(n)){let v=n.anchor,y=n.focus;v.key===i&&v.type==="text"&&v.offset>c&&v.offset<=g&&(v.key=w,v.offset-=c,n.dirty=!0),y.key===i&&y.type==="text"&&y.offset>c&&y.offset<=g&&(y.key=w,y.offset-=c,n.dirty=!0)}o===i&&Kt(w),c=g,a.push(h)}return i=this.getPreviousSibling(),o=this.getNextSibling(),i!==null&&bd(i),o!==null&&bd(o),i=r.getWritable(),o=this.getIndexWithinParent(),s?(i.splice(o,0,a),this.remove()):i.splice(o,1,a),ge(n)&&Pd(n,r,o,l-1),a}mergeWithSibling(e){var n=e===this.getPreviousSibling();n||e===this.getNextSibling()||K(50);var r=this.__key;let i=e.__key,o=this.__text,l=o.length;Zi()===i&&Kt(r);let s=rt();if(ge(s)){let a=s.anchor,u=s.focus;a!==null&&a.key===i&&(Q0(a,n,r,e,l),s.dirty=!0),u!==null&&u.key===i&&(Q0(u,n,r,e,l),s.dirty=!0)}return r=e.__text,this.setTextContent(n?r+o:o+r),n=this.getWritable(),e.remove(),n}isTextEntity(){return!1}}function WR(t){let e=t.style.fontWeight==="700",n=t.style.textDecoration==="line-through",r=t.style.fontStyle==="italic",i=t.style.textDecoration==="underline",o=t.style.verticalAlign;return{forChild:l=>(Q(l)&&(e&&l.toggleFormat("bold"),n&&l.toggleFormat("strikethrough"),r&&l.toggleFormat("italic"),i&&l.toggleFormat("underline"),o==="sub"&&l.toggleFormat("subscript"),o==="super"&&l.toggleFormat("superscript")),l),node:null}}function VR(t){let e=t.style.fontWeight==="normal";return{forChild:n=>(Q(n)&&!e&&n.toggleFormat("bold"),n),node:null}}let W0=new WeakMap;function HR(t){t.parentElement===null&&K(129);for(var e=t.textContent||"",n,r=t.parentNode,i=[t];r!==null&&(n=W0.get(r))===void 0&&!(r.nodeName==="PRE"||r.nodeType===1&&r.style.whiteSpace.startsWith("pre"));)i.push(r),r=r.parentNode;for(n=n===void 0?r:n,r=0;r<i.length;r++)W0.set(i[r],n);if(n!==null){for(e=e.split(/(\r?\n|\t)/),t=[],i=e.length,n=0;n<i;n++)r=e[n],r===`
|
|
65
65
|
`||r===`\r
|
|
66
|
-
`?t.push(
|
|
66
|
+
`?t.push(ms()):r===" "?t.push(Pf()):r!==""&&t.push(Lt(r));return{node:t}}if(e=e.replace(/\r/g,"").replace(/[ \t\n]+/g," "),e==="")return{node:null};if(e[0]===" "){for(i=t,n=!0;i!==null&&(i=V0(i,!1))!==null;)if(r=i.textContent||"",0<r.length){/[ \t\n]$/.test(r)&&(e=e.slice(1)),n=!1;break}n&&(e=e.slice(1))}if(e[e.length-1]===" "){for(i=!0;t!==null&&(t=V0(t,!0))!==null;)if(0<(t.textContent||"").replace(/^( |\t|\r?\n)+/,"").length){i=!1;break}i&&(e=e.slice(0,e.length-1))}return e===""?{node:null}:{node:Lt(e)}}let KR=new RegExp(/^(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 V0(t,e){for(;;){for(var n=void 0;(n=e?t.nextSibling:t.previousSibling)===null;)if(t=t.parentElement,t===null)return null;if(t=n,t.nodeType===1&&(n=t.style.display,n===""&&t.nodeName.match(KR)===null||n!==""&&!n.startsWith("inline")))return null;for(;(n=e?t.firstChild:t.lastChild)!==null;)t=n;if(t.nodeType===3)return t;if(t.nodeName==="BR")return null}}let ZR={code:"code",em:"italic",i:"italic",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function Mi(t){let e=ZR[t.nodeName.toLowerCase()];return e===void 0?{node:null}:{forChild:n=>(Q(n)&&!n.hasFormat(e)&&n.toggleFormat(e),n),node:null}}function Lt(t=""){return Bu(new ul(t))}function Q(t){return t instanceof ul}class Ns extends ul{static getType(){return"tab"}static clone(e){let n=new Ns(e.__key);return n.__text=e.__text,n.__format=e.__format,n.__style=e.__style,n}constructor(e){super(" ",e),this.__detail=2}static importDOM(){return null}static importJSON(e){let n=Pf();return n.setFormat(e.format),n.setStyle(e.style),n}exportJSON(){return{...super.exportJSON(),type:"tab",version:1}}setTextContent(){K(126)}setDetail(){K(127)}setMode(){K(128)}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function Pf(){return Bu(new Ns)}class Hr{constructor(e,n,r){this._selection=null,this.key=e,this.offset=n,this.type=r}is(e){return this.key===e.key&&this.offset===e.offset&&this.type===e.type}isBefore(e){let n=this.getNode(),r=e.getNode(),i=this.offset;if(e=e.offset,B(n)){var o=n.getDescendantByIndex(i);n=o??n}return B(r)&&(o=r.getDescendantByIndex(e),r=o??r),n===r?i<e:n.isBefore(r)}getNode(){let e=It(this.key);return e===null&&K(20),e}set(e,n,r){let i=this._selection,o=this.key;this.key=e,this.offset=n,this.type=r,Ps()||(Zi()===o&&Kt(e),i!==null&&(i._cachedNodes=null,i.dirty=!0))}}function zh(t,e){let n=e.__key,r=t.offset,i="element";if(Q(e))i="text",e=e.getTextContentSize(),r>e&&(r=e);else if(!B(e)){var o=e.getNextSibling();Q(o)?(n=o.__key,r=0,i="text"):(o=e.getParent())&&(n=o.__key,r=e.getIndexWithinParent()+1)}t.set(n,r,i)}function H0(t,e){if(B(e)){let n=e.getLastDescendant();B(n)||Q(n)?zh(t,n):zh(t,e)}else zh(t,e)}function K0(t,e,n,r){let i=t.getNode(),o=i.getChildAtIndex(t.offset),l=Lt(),s=mn(i)?Jo().append(l):l;l.setFormat(n),l.setStyle(r),o===null?i.append(s):(o.insertBefore(s),e.type==="element"&&e.key===t.key&&e.offset!==t.offset&&e.set(e.key,e.offset+1,"element")),t.is(e)&&e.set(l.__key,0,"text"),t.set(l.__key,0,"text")}function zi(t,e,n,r){t.key=e,t.offset=n,t.type=r}class Af{constructor(e){this.dirty=!1,this._nodes=e,this._cachedNodes=null}is(e){if(!Rs(e))return!1;let n=this._nodes,r=e._nodes;return n.size===r.size&&Array.from(n).every(i=>r.has(i))}add(e){this.dirty=!0,this._nodes.add(e),this._cachedNodes=null}delete(e){this.dirty=!0,this._nodes.delete(e),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(e){return this._nodes.has(e)}clone(){return new Af(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(){}insertText(){}insertNodes(e,n){let r=this.getNodes(),i=r.length;var o=r[i-1];if(Q(o))o=o.select();else{let l=o.getIndexWithinParent()+1;o=o.getParentOrThrow().select(l,l)}for(o.insertNodes(e,n),e=0;e<i;e++)r[e].remove();return!0}getNodes(){var e=this._cachedNodes;if(e!==null)return e;var n=this._nodes;e=[];for(let r of n)n=It(r),n!==null&&e.push(n);return Ps()||(this._cachedNodes=e),e}getTextContent(){let e=this.getNodes(),n="";for(let r=0;r<e.length;r++)n+=e[r].getTextContent();return n}}function ge(t){return t instanceof cl}function ym(t){let[e,,n]=wE(t);t=n.getChildren();let r=t.length;var i=t[0].getChildren().length;let o=Array(r);for(var l=0;l<r;l++)o[l]=Array(i);for(i=0;i<r;i++){l=t[i].getChildren();let s=0;for(let a=0;a<l.length;a++){for(;o[i][s];)s++;let u=l[a],c=u.__rowSpan||1,d=u.__colSpan||1;for(let f=0;f<c;f++)for(let h=0;h<d;h++)o[i+f][s+h]=u;if(e===u)return{colSpan:d,columnIndex:s,rowIndex:i,rowSpan:c};s+=d}}return null}class Mf{constructor(e,n,r){this.gridKey=e,this.anchor=n,this.focus=r,this.dirty=!1,this._cachedNodes=null,n._selection=this,r._selection=this}is(e){return pv(e)?this.gridKey===e.gridKey&&this.anchor.is(e.anchor)&&this.focus.is(e.focus):!1}set(e,n,r){this.dirty=!0,this.gridKey=e,this.anchor.key=n,this.focus.key=r,this._cachedNodes=null}clone(){return new Mf(this.gridKey,this.anchor,this.focus)}isCollapsed(){return!1}isBackward(){return this.focus.isBefore(this.anchor)}getCharacterOffsets(){return Kc(this)}extract(){return this.getNodes()}insertRawText(){}insertText(){}insertNodes(e,n){let r=this.focus.getNode();return lv(r.select(0,r.getChildrenSize())).insertNodes(e,n)}getShape(){var e=It(this.anchor.key);if(er(e)||K(103),e=ym(e),e===null)throw Error("getCellRect: expected to find AnchorNode");var n=It(this.focus.key);er(n)||K(104);let r=ym(n);if(r===null)throw Error("getCellRect: expected to find focusCellNode");n=Math.min(e.columnIndex,r.columnIndex);let i=Math.max(e.columnIndex,r.columnIndex),o=Math.min(e.rowIndex,r.rowIndex);return e=Math.max(e.rowIndex,r.rowIndex),{fromX:Math.min(n,i),fromY:Math.min(o,e),toX:Math.max(n,i),toY:Math.max(o,e)}}getNodes(){function e(w){let{cell:v,startColumn:y,startRow:_}=w;a=Math.min(a,y),u=Math.min(u,_),c=Math.max(c,y+v.__colSpan-1),d=Math.max(d,_+v.__rowSpan-1)}var n=this._cachedNodes;if(n!==null)return n;var r=this.anchor.getNode();n=this.focus.getNode(),r=Rd(r,er);var i=Rd(n,er);er(r)||K(103),er(i)||K(104),n=r.getParent(),fu(n)||K(105),n=n.getParent(),xv(n)||K(106);let[o,l,s]=_E(n,r,i),a=Math.min(l.startColumn,s.startColumn),u=Math.min(l.startRow,s.startRow),c=Math.max(l.startColumn+l.cell.__colSpan-1,s.startColumn+s.cell.__colSpan-1),d=Math.max(l.startRow+l.cell.__rowSpan-1,s.startRow+s.cell.__rowSpan-1);r=a,i=u;for(var f=a,h=u;a<r||u<i||c>f||d>h;){if(a<r){var g=h-i;--r;for(var m=0;m<=g;m++)e(o[i+m][r])}if(u<i)for(g=f-r,--i,m=0;m<=g;m++)e(o[i][r+m]);if(c>f)for(g=h-i,f+=1,m=0;m<=g;m++)e(o[i+m][f]);if(d>h)for(g=f-r,h+=1,m=0;m<=g;m++)e(o[h][r+m])}for(n=[n],r=null,i=u;i<=d;i++)for(f=a;f<=c;f++)({cell:h}=o[i][f]),g=h.getParent(),fu(g)||K(107),g!==r&&n.push(g),n.push(h,...OR(h)),r=g;return Ps()||(this._cachedNodes=n),n}getTextContent(){let e=this.getNodes(),n="";for(let r=0;r<e.length;r++)n+=e[r].getTextContent();return n}}function pv(t){return t instanceof Mf}class cl{constructor(e,n,r,i){this.anchor=e,this.focus=n,this.dirty=!1,this.format=r,this.style=i,this._cachedNodes=null,e._selection=this,n._selection=this}is(e){return ge(e)?this.anchor.is(e.anchor)&&this.focus.is(e.focus)&&this.format===e.format&&this.style===e.style:!1}isBackward(){return this.focus.isBefore(this.anchor)}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){var e=this._cachedNodes;if(e!==null)return e;e=this.anchor;var n=this.focus,r=e.isBefore(n),i=r?e:n;r=r?n:e,e=i.getNode(),n=r.getNode();let o=i.offset;return i=r.offset,B(e)&&(r=e.getDescendantByIndex(o),e=r??e),B(n)&&(r=n.getDescendantByIndex(i),r!==null&&r!==e&&n.getChildAtIndex(i)===r&&(r=r.getPreviousSibling()),n=r??n),e=e.is(n)?B(e)&&0<e.getChildrenSize()?[]:[e]:e.getNodesBetween(n),Ps()||(this._cachedNodes=e),e}setTextNodeRange(e,n,r,i){zi(this.anchor,e.__key,n,"text"),zi(this.focus,r.__key,i,"text"),this._cachedNodes=null,this.dirty=!0}getTextContent(){let e=this.getNodes();if(e.length===0)return"";let n=e[0],r=e[e.length-1],i=this.anchor,o=this.focus,l=i.isBefore(o),[s,a]=Kc(this),u="",c=!0;for(let d=0;d<e.length;d++){let f=e[d];if(B(f)&&!f.isInline())c||(u+=`
|
|
67
67
|
`),c=!f.isEmpty();else if(c=!1,Q(f)){let h=f.getTextContent();f===n?f===r?(i.type!=="element"||o.type!=="element"||o.offset===i.offset)&&(h=s<a?h.slice(s,a):h.slice(a,s)):h=l?h.slice(s):h.slice(a):f===r&&(h=l?h.slice(0,a):h.slice(0,s)),u+=h}else!tt(f)&&!cu(f)||f===r&&this.isCollapsed()||(u+=f.getTextContent())}return u}applyDOMRange(e){let n=pt(),r=n.getEditorState()._selection;if(e=yE(e.startContainer,e.startOffset,e.endContainer,e.endOffset,n,r),e!==null){var[i,o]=e;zi(this.anchor,i.key,i.offset,i.type),zi(this.focus,o.key,o.offset,o.type),this._cachedNodes=null}}clone(){let e=this.anchor,n=this.focus;return new cl(new Hr(e.key,e.offset,e.type),new Hr(n.key,n.offset,n.type),this.format,this.style)}toggleFormat(e){this.format=KS(this.format,e,null),this.dirty=!0}setStyle(e){this.style=e,this.dirty=!0}hasFormat(e){return(this.format&Fo[e])!==0}insertRawText(e){e=e.split(/(\r?\n|\t)/);let n=[],r=e.length;for(let i=0;i<r;i++){let o=e[i];o===`
|
|
68
68
|
`||o===`\r
|
|
69
|
-
`?n.push(ps()):o===" "?n.push(Pf()):n.push(Lt(o))}this.insertNodes(n)}insertText(e){var n=this.anchor,r=this.focus,i=this.isCollapsed()||n.isBefore(r),o=this.format,l=this.style;i&&n.type==="element"?K0(n,r,o,l):i||r.type!=="element"||K0(r,n,o,l);var s=this.getNodes(),a=s.length,u=i?r:n;r=(i?n:r).offset;var c=u.offset;n=s[0],Q(n)||K(26),i=n.getTextContent().length;var d=n.getParentOrThrow(),f=s[a-1];if(this.isCollapsed()&&r===i&&(n.isSegmented()||n.isToken()||!n.canInsertTextAfter()||!d.canInsertTextAfter()&&n.getNextSibling()===null)){var h=n.getNextSibling();if(Q(h)&&h.canInsertTextBefore()&&!im(h)||(h=Lt(),h.setFormat(o),d.canInsertTextAfter()?n.insertAfter(h):d.insertAfter(h)),h.select(0,0),n=h,e!==""){this.insertText(e);return}}else if(this.isCollapsed()&&r===0&&(n.isSegmented()||n.isToken()||!n.canInsertTextBefore()||!d.canInsertTextBefore()&&n.getPreviousSibling()===null)){if(h=n.getPreviousSibling(),(!Q(h)||im(h))&&(h=Lt(),h.setFormat(o),d.canInsertTextBefore()?n.insertBefore(h):d.insertBefore(h)),h.select(),n=h,e!==""){this.insertText(e);return}}else if(n.isSegmented()&&r!==i)d=Lt(n.getTextContent()),d.setFormat(o),n.replace(d),n=d;else if(!(this.isCollapsed()||e===""||(h=f.getParent(),d.canInsertTextBefore()&&d.canInsertTextAfter()&&(!B(h)||h.canInsertTextBefore()&&h.canInsertTextAfter())))){this.insertText(""),vE(this.anchor,this.focus,null),this.insertText(e);return}if(a===1)if(n.isToken())e=Lt(e),e.select(),n.replace(e);else{if(s=n.getFormat(),a=n.getStyle(),r===c&&(s!==o||a!==l))if(n.getTextContent()==="")n.setFormat(o),n.setStyle(l);else{s=Lt(e),s.setFormat(o),s.setStyle(l),s.select(),r===0?n.insertBefore(s,!1):([a]=n.splitText(r),a.insertAfter(s,!1)),s.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=e.length);return}n=n.spliceText(r,c-r,e,!0),n.getTextContent()===""?n.remove():this.anchor.type==="text"&&(n.isComposing()?this.anchor.offset-=e.length:(this.format=s,this.style=a))}else{if(o=new Set([...n.getParentKeys(),...f.getParentKeys()]),h=B(n)?n:n.getParentOrThrow(),l=B(f)?f:f.getParentOrThrow(),d=f,!h.is(l)&&l.isInline())do d=l,l=l.getParentOrThrow();while(l.isInline());if(u.type==="text"&&(c!==0||f.getTextContent()==="")||u.type==="element"&&f.getIndexWithinParent()<c)if(Q(f)&&!f.isToken()&&c!==f.getTextContentSize()){if(f.isSegmented()){var g=Lt(f.getTextContent());f.replace(g),f=g}mn(u.getNode())||(f=f.spliceText(0,c,"")),o.add(f.__key)}else u=f.getParentOrThrow(),u.canBeEmpty()||u.getChildrenSize()!==1?f.remove():u.remove();else o.add(f.__key);for(u=l.getChildren(),c=new Set(s),f=h.is(l),h=h.isInline()&&n.getNextSibling()===null?h:n,g=u.length-1;0<=g;g--){let m=u[g];if(m.is(n)||B(m)&&m.isParentOf(n))break;m.isAttached()&&(!c.has(m)||m.is(d)?f||h.insertAfter(m,!1):m.remove())}if(!f)for(u=l,c=null;u!==null;)l=u.getChildren(),f=l.length,(f===0||l[f-1].is(c))&&(o.delete(u.__key),c=u),u=u.getParent();for(n.isToken()?r===i?n.select():(e=Lt(e),e.select(),n.replace(e)):(n=n.spliceText(r,i-r,e,!0),n.getTextContent()===""?n.remove():n.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=e.length)),e=1;e<a;e++)n=s[e],o.has(n.__key)||n.remove()}}removeText(){this.insertText("")}formatText(e){if(this.isCollapsed())this.toggleFormat(e),Kt(null);else{var n=this.getNodes(),r=[];for(var i of n)Q(i)&&r.push(i);var o=r.length;if(o===0)this.toggleFormat(e),Kt(null);else{i=this.anchor;var l=this.focus,s=this.isBackward();n=s?l:i,i=s?i:l;var a=0,u=r[0];if(l=n.type==="element"?0:n.offset,n.type==="text"&&l===u.getTextContentSize()&&(a=1,u=r[1],l=0),u!=null){s=u.getFormatFlags(e,null);var c=o-1,d=r[c];if(o=i.type==="text"?i.offset:d.getTextContentSize(),u.is(d))l!==o&&(l===0&&o===u.getTextContentSize()?u.setFormat(s):(e=u.splitText(l,o),e=l===0?e[0]:e[1],e.setFormat(s),n.type==="text"&&n.set(e.__key,0,"text"),i.type==="text"&&i.set(e.__key,o-l,"text")),this.format=s);else{l!==0&&([,u]=u.splitText(l),l=0),u.setFormat(s);var f=d.getFormatFlags(e,s);for(0<o&&(o!==d.getTextContentSize()&&([d]=d.splitText(o)),d.setFormat(f)),a+=1;a<c;a++){let h=r[a];if(!h.isToken()){let g=h.getFormatFlags(e,f);h.setFormat(g)}}n.type==="text"&&n.set(u.__key,l,"text"),i.type==="text"&&i.set(d.__key,o,"text"),this.format=s|f}}}}}insertNodes(e,n){if(!this.isCollapsed()){var r=this.isBackward()?this.anchor:this.focus,i=r.getNode().getNextSibling();if(i=i?i.getKey():null,r=(r=r.getNode().getPreviousSibling())?r.getKey():null,this.removeText(),this.isCollapsed()&&this.focus.type==="element"){if(this.focus.key===i&&this.focus.offset===0){var o=Lt();this.focus.getNode().insertBefore(o)}else this.focus.key===r&&this.focus.offset===this.focus.getNode().getChildrenSize()&&(o=Lt(),this.focus.getNode().insertAfter(o));o&&(this.focus.set(o.__key,0,"text"),this.anchor.set(o.__key,0,"text"))}}o=this.anchor,r=o.offset;var l=o.getNode();i=l,o.type==="element"&&(o=o.getNode(),i=o.getChildAtIndex(r-1),i=i===null?o:i),o=[];var s=l.getNextSiblings(),a=_r(l)?null:l.getTopLevelElementOrThrow();if(Q(l))if(i=l.getTextContent().length,r===0&&i!==0)i=l.getPreviousSibling(),i=i!==null?i:l.getParentOrThrow(),o.push(l);else if(r===i)i=l;else{if(l.isToken())return!1;[i,l]=l.splitText(r),o.push(l)}l=i,o.push(...s),s=e[0];var u=!1,c=null;for(let g=0;g<e.length;g++){var d=e[g];if(_r(i)||tt(i)||!B(d)||d.isInline())u&&!B(d)&&!tt(d)&&_r(i.getParent())&&K(28);else{if(d.is(s)){if(B(i)&&i.isEmpty()&&i.canReplaceWith(d)){i.replace(d),i=d,u=!0;continue}if(u=d.getFirstDescendant(),ZS(u)){for(var f=u.getParentOrThrow();f.isInline();)f=f.getParentOrThrow();if(c=f.getChildren(),u=c.length,B(i)){var h=i.getFirstChild();for(let m=0;m<u;m++){let w=c[m];h===null?i.append(w):h.insertAfter(w),h=w}}else{for(h=u-1;0<=h;h--)i.insertAfter(c[h]);i=i.getParentOrThrow()}if(c=c[u-1],f.remove(),u=!0,f.is(d))continue}}Q(i)&&(a===null&&K(27),i=a)}u=!1,B(i)&&!i.isInline()?(c=d,tt(d)&&!d.isInline()?i=e.length===1&&i.canBeEmpty()&&i.isEmpty()?i.insertBefore(d,!1):i.insertAfter(d,!1):B(d)?(d.canBeEmpty()||!d.isEmpty())&&(mn(i)?(f=i.getChildAtIndex(r),f!==null?f.insertBefore(d):i.append(d),i=d):d.isInline()?(i.append(d),i=d):i=i.insertAfter(d,!1)):(f=i.getFirstChild(),f!==null?f.insertBefore(d):i.append(d),i=d)):!B(d)||B(d)&&d.isInline()||tt(i)&&!i.isInline()?(c=d,ge(this)&&tt(d)&&(B(i)||Q(i))&&!d.isInline()?(Q(i)?(f=i.getParentOrThrow(),[i]=i.splitText(r),i=i.getIndexWithinParent()+1):(f=i,i=r),[,i]=nE(f,i),i=i.insertBefore(d)):i=i.insertAfter(d,!1)):(d=i.getParentOrThrow(),cu(i)&&i.remove(),i=d,g--)}if(n&&(Q(l)?l.select():(e=i.getPreviousSibling(),Q(e)?e.select():(e=i.getIndexWithinParent(),i.getParentOrThrow().select(e,e)))),B(i)){if(e=Q(c)?c:B(c)&&c.isInline()?c.getLastDescendant():i.getLastDescendant(),n||(e===null?i.select():Q(e)?e.getTextContent()===""?e.selectPrevious():e.select():e.selectNext()),o.length!==0)for(n=i,e=o.length-1;0<=e;e--)r=o[e],a=r.getParentOrThrow(),!B(i)||xm(r)||tt(r)&&(!r.isInline()||r.isIsolated())?B(i)||xm(r)?B(r)&&!r.canInsertAfter(i)?(l=a.constructor.clone(a),B(l)||K(29),l.append(r),i.insertAfter(l)):i.insertAfter(r):(i.insertBefore(r),i=r):(n===i?i.append(r):i.insertBefore(r),i=r),a.isEmpty()&&!a.canBeEmpty()&&a.remove()}else n||(Q(i)?i.select():(n=i.getParentOrThrow(),e=i.getIndexWithinParent()+1,n.select(e,e)));return!0}insertParagraph(){this.isCollapsed()||this.removeText();var e=this.anchor,n=e.offset,r=[];if(e.type==="text"){var i=e.getNode(),o=i.getNextSiblings().reverse(),l=i.getParentOrThrow(),s=l.isInline(),a=s?l.getTextContentSize():i.getTextContentSize();n===0?o.push(i):(s&&(r=l.getNextSiblings()),n===a||s&&n===i.getTextContentSize()||([,i]=i.splitText(n),o.push(i)))}else{if(l=e.getNode(),_r(l)){o=Jo(),r=l.getChildAtIndex(n),o.select(),r!==null?r.insertBefore(o,!1):l.append(o);return}o=l.getChildren().slice(n).reverse()}if(i=o.length,n===0&&0<i&&l.isInline()){if(r=l.getParentOrThrow(),o=r.insertNewAfter(this,!1),B(o))for(r=r.getChildren(),l=0;l<r.length;l++)o.append(r[l])}else if(s=l.insertNewAfter(this,!1),s===null)this.insertLineBreak();else if(B(s))if(a=l.getFirstChild(),n===0&&(l.is(e.getNode())||a&&a.is(e.getNode()))&&0<i)l.insertBefore(s);else{if(l=null,n=r.length,e=s.getParentOrThrow(),0<n)for(a=0;a<n;a++)e.append(r[a]);if(i!==0)for(r=0;r<i;r++)n=o[r],l===null?s.append(n):l.insertBefore(n),l=n;s.canBeEmpty()||s.getChildrenSize()!==0?s.selectStart():(s.selectPrevious(),s.remove())}}insertLineBreak(e){let n=ps();var r=this.anchor;r.type==="element"&&(r=r.getNode(),mn(r)&&this.insertParagraph()),e?this.insertNodes([n],!0):this.insertNodes([n])&&n.selectNext(0,0)}getCharacterOffsets(){return Kc(this)}extract(){var e=this.getNodes(),n=e.length,r=n-1,i=this.anchor;let o=this.focus;var l=e[0];let s=e[r],[a,u]=Kc(this);return n===0?[]:n===1?Q(l)&&!this.isCollapsed()?(e=a>u?u:a,r=l.splitText(e,a>u?a:u),e=e===0?r[0]:r[1],e!=null?[e]:[]):[l]:(n=i.isBefore(o),Q(l)&&(i=n?a:u,i===l.getTextContentSize()?e.shift():i!==0&&([,l]=l.splitText(i),e[0]=l)),Q(s)&&(l=s.getTextContent().length,n=n?u:a,n===0?e.pop():n!==l&&([s]=s.splitText(n),e[r]=s)),e)}modify(e,n,r){var i=this.focus,o=this.anchor,l=e==="move",s=om(i,n);if(tt(s)&&!s.isIsolated())l&&s.isKeyboardSelectable()?(n=_m(),n.add(s.__key),Vr(n)):(e=n?s.getPreviousSibling():s.getNextSibling(),Q(e)?(s=e.__key,n=n?e.getTextContent().length:0,i.set(s,n,"text"),l&&o.set(s,n,"text")):(r=s.getParentOrThrow(),B(e)?(r=e.__key,s=n?e.getChildrenSize():0):(s=s.getIndexWithinParent(),r=r.__key,n||s++),i.set(r,s,"element"),l&&o.set(r,s,"element")));else if(o=pt(),i=Jr(o._window)){var a=o._blockCursorElement,u=o._rootElement;if(u===null||a===null||!B(s)||s.isInline()||s.canBeEmpty()||lm(a,o,u),i.modify(e,n?"backward":"forward",r),0<i.rangeCount&&(s=i.getRangeAt(0),o=this.anchor.getNode(),o=mn(o)?o:eE(o),this.applyDOMRange(s),this.dirty=!0,!l)){for(l=this.getNodes(),e=[],r=!1,a=0;a<l.length;a++)u=l[a],Nd(u,o)?e.push(u):r=!0;r&&0<e.length&&(n?(n=e[0],B(n)?n.selectStart():n.getParentOrThrow().selectStart()):(n=e[e.length-1],B(n)?n.selectEnd():n.getParentOrThrow().selectEnd())),(i.anchorNode!==s.startContainer||i.anchorOffset!==s.startOffset)&&(n=this.focus,l=this.anchor,i=l.key,s=l.offset,o=l.type,zi(l,n.key,n.offset,n.type),zi(n,i,s,o),this._cachedNodes=null)}}}deleteCharacter(e){let n=this.isCollapsed();if(this.isCollapsed()){var r=this.anchor,i=this.focus,o=r.getNode();if(!e&&(r.type==="element"&&B(o)&&r.offset===o.getChildrenSize()||r.type==="text"&&r.offset===o.getTextContentSize())){var l=o.getParent();if(l=o.getNextSibling()||(l===null?null:l.getNextSibling()),B(l)&&l.isShadowRoot())return}if(l=om(i,e),tt(l)&&!l.isIsolated()){l.isKeyboardSelectable()&&B(o)&&o.getChildrenSize()===0?(o.remove(),e=_m(),e.add(l.__key),Vr(e)):(l.remove(),pt().dispatchCommand(kf,void 0));return}if(!e&&B(l)&&B(o)&&o.isEmpty()){o.remove(),l.selectStart();return}if(this.modify("extend",e,"character"),this.isCollapsed()){if(e&&r.offset===0&&(r.type==="element"?r.getNode():r.getNode().getParentOrThrow()).collapseAtStart(this))return}else{if(l=i.type==="text"?i.getNode():null,o=r.type==="text"?r.getNode():null,l!==null&&l.isSegmented()){if(r=i.offset,i=l.getTextContentSize(),l.is(o)||e&&r!==i||!e&&r!==0){G0(l,e,r);return}}else if(o!==null&&o.isSegmented()&&(r=r.offset,i=o.getTextContentSize(),o.is(l)||e&&r!==0||!e&&r!==i)){G0(o,e,r);return}if(o=this.anchor,l=this.focus,r=o.getNode(),i=l.getNode(),r===i&&o.type==="text"&&l.type==="text"){var s=o.offset,a=l.offset;let u=s<a;i=u?s:a,a=u?a:s,s=a-1,i!==s&&(r=r.getTextContent().slice(i,a),JS(r)||(e?l.offset=s:o.offset=s))}}}this.removeText(),e&&!n&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0&&(e=this.anchor.getNode(),e.isEmpty()&&mn(e.getParent())&&e.getIndexWithinParent()===0&&e.collapseAtStart(this))}deleteLine(e){this.isCollapsed()&&(this.anchor.type==="text"&&this.modify("extend",e,"lineboundary"),(e?this.focus:this.anchor).offset===0&&this.modify("extend",e,"character")),this.removeText()}deleteWord(e){this.isCollapsed()&&this.modify("extend",e,"word"),this.removeText()}}function Ns(t){return t instanceof Af}function Z0(t){let e=t.offset;return t.type==="text"?e:(t=t.getNode(),e===t.getChildrenSize()?t.getTextContent().length:0)}function Kc(t){let e=t.anchor;return t=t.focus,e.type==="element"&&t.type==="element"&&e.key===t.key&&e.offset===t.offset?[0,0]:[Z0(e),Z0(t)]}function G0(t,e,n){let r=t.getTextContent().split(/(?=\s)/g),i=r.length,o=0,l=0;for(let s=0;s<i;s++){let a=r[s],u=s===i-1;if(l=o,o+=a.length,e&&o===n||o>n||u){r.splice(s,1),u&&(l=void 0);break}}e=r.join("").trim(),e===""?t.remove():(t.setTextContent(e),t.select(l,l))}function Y0(t,e,n,r){var i=e;if(t.nodeType===1){let s=!1;var o=t.childNodes,l=o.length;i===l&&(s=!0,i=l-1);let a=o[i];if(l=!1,a===r._blockCursorElement?(a=o[i+1],l=!0):r._blockCursorElement!==null&&i--,r=Bl(a),Q(r))i=s?r.getTextContentSize():0;else{if(o=Bl(t),o===null)return null;if(B(o)?(t=o.getChildAtIndex(i),(e=B(t))&&(e=t.getParent(),e=n===null||e===null||!e.canBeEmpty()||e!==n.getNode()),e&&(n=s?t.getLastDescendant():t.getFirstDescendant(),n===null?(o=t,i=0):(t=n,o=B(t)?t:t.getParentOrThrow())),Q(t)?(r=t,o=null,i=s?t.getTextContentSize():0):t!==o&&s&&!l&&i++):(i=o.getIndexWithinParent(),i=e===0&&tt(o)&&Bl(t)===o?i:i+1,o=o.getParentOrThrow()),B(o))return new Hr(o.__key,i,"element")}}else r=Bl(t);return Q(r)?new Hr(r.__key,i,"text"):null}function X0(t,e,n){var r=t.offset,i=t.getNode();r===0?(r=i.getPreviousSibling(),i=i.getParent(),e?(n||!e)&&r===null&&B(i)&&i.isInline()&&(e=i.getPreviousSibling(),Q(e)&&(t.key=e.__key,t.offset=e.getTextContent().length)):B(r)&&!n&&r.isInline()?(t.key=r.__key,t.offset=r.getChildrenSize(),t.type="element"):Q(r)&&(t.key=r.__key,t.offset=r.getTextContent().length)):r===i.getTextContent().length&&(r=i.getNextSibling(),i=i.getParent(),e&&B(r)&&r.isInline()?(t.key=r.__key,t.offset=0,t.type="element"):(n||e)&&r===null&&B(i)&&i.isInline()&&!i.canInsertTextAfter()&&(e=i.getNextSibling(),Q(e)&&(t.key=e.__key,t.offset=0)))}function vE(t,e,n){if(t.type==="text"&&e.type==="text"){var r=t.isBefore(e);let i=t.is(e);X0(t,r,i),X0(e,!r,i),i&&(e.key=t.key,e.offset=t.offset,e.type=t.type),r=pt(),r.isComposing()&&r._compositionKey!==t.key&&ge(n)&&(r=n.anchor,n=n.focus,zi(t,r.key,r.offset,r.type),zi(e,n.key,n.offset,n.type))}}function yE(t,e,n,r,i,o){return t===null||n===null||!zu(i,t,n)||(e=Y0(t,e,ge(o)?o.anchor:null,i),e===null)||(r=Y0(n,r,ge(o)?o.focus:null,i),r===null||e.type==="element"&&r.type==="element"&&(t=Bl(t),n=Bl(n),tt(t)&&tt(n)))?null:(vE(e,r,o),[e,r])}function xm(t){return B(t)&&!t.isInline()}function xE(t,e,n,r,i,o){let l=Qr();return t=new cl(new Hr(t,e,i),new Hr(n,r,o),0,""),t.dirty=!0,l._selection=t}function _m(){return new Af(new Set)}function GR(t){let e=t.getEditorState()._selection,n=Jr(t._window);return Ns(e)||pv(e)?e.clone():mv(e,n,t)}function mv(t,e,n){var r=n._window;if(r===null)return null;var i=r.event,o=i?i.type:void 0;r=o==="selectionchange",i=!rm&&(r||o==="beforeinput"||o==="compositionstart"||o==="compositionend"||o==="click"&&i&&i.detail===3||o==="drop"||o===void 0);let l;if(!ge(t)||i){if(e===null)return null;if(i=e.anchorNode,o=e.focusNode,l=e.anchorOffset,e=e.focusOffset,r&&ge(t)&&!zu(n,i,o))return t.clone()}else return t.clone();if(n=yE(i,l,o,e,n,t),n===null)return null;let[s,a]=n;return new cl(s,a,ge(t)?t.format:0,ge(t)?t.style:"")}function rt(){return Qr()._selection}function Rs(){return pt()._editorState._selection}function Pd(t,e,n,r=1){var i=t.anchor,o=t.focus,l=i.getNode(),s=o.getNode();if(e.is(l)||e.is(s)){if(l=e.__key,t.isCollapsed())e=i.offset,(n<=e&&0<r||n<e&&0>r)&&(n=Math.max(0,e+r),i.set(l,n,"element"),o.set(l,n,"element"),J0(t));else{let u=t.isBackward();s=u?o:i;var a=s.getNode();i=u?i:o,o=i.getNode(),e.is(a)&&(a=s.offset,(n<=a&&0<r||n<a&&0>r)&&s.set(l,Math.max(0,a+r),"element")),e.is(o)&&(e=i.offset,(n<=e&&0<r||n<e&&0>r)&&i.set(l,Math.max(0,e+r),"element"))}J0(t)}}function J0(t){var e=t.anchor,n=e.offset;let r=t.focus;var i=r.offset,o=e.getNode(),l=r.getNode();if(t.isCollapsed())B(o)&&(l=o.getChildrenSize(),l=(i=n>=l)?o.getChildAtIndex(l-1):o.getChildAtIndex(n),Q(l)&&(n=0,i&&(n=l.getTextContentSize()),e.set(l.__key,n,"text"),r.set(l.__key,n,"text")));else{if(B(o)){let s=o.getChildrenSize();n=(t=n>=s)?o.getChildAtIndex(s-1):o.getChildAtIndex(n),Q(n)&&(o=0,t&&(o=n.getTextContentSize()),e.set(n.__key,o,"text"))}B(l)&&(n=l.getChildrenSize(),i=(e=i>=n)?l.getChildAtIndex(n-1):l.getChildAtIndex(i),Q(i)&&(l=0,e&&(l=i.getTextContentSize()),r.set(i.__key,l,"text")))}}function YR(t,e){if(e=e.getEditorState()._selection,t=t._selection,ge(t)){var n=t.anchor;let r=t.focus,i;n.type==="text"&&(i=n.getNode(),i.selectionTransform(e,t)),r.type==="text"&&(n=r.getNode(),i!==n&&n.selectionTransform(e,t))}}function Ad(t,e,n,r,i){let o=null,l=0,s=null;r!==null?(o=r.__key,Q(r)?(l=r.getTextContentSize(),s="text"):B(r)&&(l=r.getChildrenSize(),s="element")):i!==null&&(o=i.__key,Q(i)?s="text":B(i)&&(s="element")),o!==null&&s!==null?t.set(o,l,s):(l=e.getIndexWithinParent(),l===-1&&(l=n.getChildrenSize()),t.set(n.__key,l,"element"))}function Q0(t,e,n,r,i){t.type==="text"?(t.key=n,e||(t.offset+=i)):t.offset>r.getIndexWithinParent()&&--t.offset}function _E(t,e,n){let r=[],i=null,o=null;t=t.getChildren();for(let c=0;c<t.length;c++){var l=t[c];fu(l)||K(108);var s=l.getChildren();l=0;for(let d of s){for(er(d)||K(109);r[c]!==void 0&&r[c][l]!==void 0;)l++;s=c;var a=l,u=d;let f={cell:u,startColumn:a,startRow:s},h=u.__rowSpan,g=u.__colSpan;for(let m=0;m<h;m++){r[s+m]===void 0&&(r[s+m]=[]);for(let w=0;w<g;w++)r[s+m][a+w]=f}e.is(u)&&(i=f),n.is(u)&&(o=f),l+=d.__colSpan}}return i===null&&K(110),o===null&&K(111),[r,i,o]}function wE(t){t instanceof yv||(t instanceof Uu?(t=Rd(t,er),er(t)||K(114)):(t=Rd(t.getNode(),er),er(t)||K(114)));let e=t.getParent();fu(e)||K(115);let n=e.getParent();return xv(n)||K(116),[t,e,n]}let jt=null,zt=null,An=!1,Fh=!1,du=0,q0={characterData:!0,childList:!0,subtree:!0};function Os(){return An||jt!==null&&jt._readOnly}function hn(){An&&K(13)}function Qr(){return jt===null&&K(15),jt}function pt(){return zt===null&&K(16),zt}function ex(t,e,n){var r=e.__type;let i=t._nodes.get(r);for(i===void 0&&K(30,r),t=n.get(r),t===void 0&&(t=Array.from(i.transforms),n.set(r,t)),n=t.length,r=0;r<n&&(t[r](e),e.isAttached());r++);}function XR(t,e){e=e._dirtyLeaves,t=t._nodeMap;for(let n of e)e=t.get(n),Q(e)&&e.isAttached()&&e.isSimpleText()&&!e.isUnmergeable()&&HS(e)}function JR(t,e){let n=e._dirtyLeaves,r=e._dirtyElements;t=t._nodeMap;let i=Zi(),o=new Map;var l=n;let s=l.size;for(var a=r,u=a.size;0<s||0<u;){if(0<s){e._dirtyLeaves=new Set;for(let c of l)l=t.get(c),Q(l)&&l.isAttached()&&l.isSimpleText()&&!l.isUnmergeable()&&HS(l),l!==void 0&&l!==void 0&&l.__key!==i&&l.isAttached()&&ex(e,l,o),n.add(c);if(l=e._dirtyLeaves,s=l.size,0<s){du++;continue}}e._dirtyLeaves=new Set,e._dirtyElements=new Map;for(let c of a)a=c[0],u=c[1],(a==="root"||u)&&(l=t.get(a),l!==void 0&&l!==void 0&&l.__key!==i&&l.isAttached()&&ex(e,l,o),r.set(a,u));l=e._dirtyLeaves,s=l.size,a=e._dirtyElements,u=a.size,du++}e._dirtyLeaves=n,e._dirtyElements=r}function gv(t,e){var n=t.type,r=e.get(n);if(r===void 0&&K(17,n),n=r.klass,t.type!==n.getType()&&K(18,n.name),n=n.importJSON(t),t=t.children,B(n)&&Array.isArray(t))for(r=0;r<t.length;r++){let i=gv(t[r],e);n.append(i)}return n}function tx(t,e){let n=jt,r=An,i=zt;jt=t,An=!0,zt=null;try{return e()}finally{jt=n,An=r,zt=i}}function Uo(t,e){let n=t._pendingEditorState,r=t._rootElement,i=t._headless||r===null;if(n!==null){var o=t._editorState,l=o._selection,s=n._selection,a=t._dirtyType!==0,u=jt,c=An,d=zt,f=t._updating,h=t._observer,g=null;if(t._pendingEditorState=null,t._editorState=n,!i&&a&&h!==null){zt=t,jt=n,An=!1,t._updating=!0;try{let je=t._dirtyType,Tt=t._dirtyElements,at=t._dirtyLeaves;h.disconnect();var m=je,w=Tt,v=at;fn=li=Nt="",iE=m===2,Wc=null,tn=t,ao=t._config,su=t._nodes,Of=tn._listeners.mutation,sm=w,am=v,Xo=o._nodeMap,uo=n._nodeMap,hv=n._readOnly,um=new Map(t._keyToDOMMap);let ln=new Map;au=ln,pa("root",null),au=um=ao=uo=Xo=am=sm=su=tn=void 0,g=ln}catch(je){if(je instanceof Error&&t._onError(je),Fh)throw je;kE(t,null,r,n),VS(t),t._dirtyType=2,Fh=!0,Uo(t,o),Fh=!1;return}finally{h.observe(r,q0),t._updating=f,jt=u,An=c,zt=d}}n._readOnly||(n._readOnly=!0);var y=t._dirtyLeaves,_=t._dirtyElements,S=t._normalizedNodes,E=t._updateTags,$=t._deferred;a&&(t._dirtyType=0,t._cloneNotNeeded.clear(),t._dirtyLeaves=new Set,t._dirtyElements=new Map,t._normalizedNodes=new Set,t._updateTags=new Set);var C=t._decorators,N=t._pendingDecorators||C,R=n._nodeMap,b;for(b in N)R.has(b)||(N===C&&(N=XS(t)),delete N[b]);var L=i?null:Jr(t._window);if(t._editable&&L!==null&&(a||s===null||s.dirty)){zt=t,jt=n;try{if(h!==null&&h.disconnect(),a||s===null||s.dirty){let je=t._blockCursorElement;je!==null&&lm(je,t,r);e:{let Tt=L.anchorNode,at=L.focusNode,ln=L.anchorOffset,En=L.focusOffset,_t=document.activeElement;if(!(E.has("collaboration")&&_t!==r||_t!==null&&sv(_t)))if(ge(s)){var F=s.anchor,le=s.focus,V=F.key,H=le.key,O=Td(t,V),A=Td(t,H),k=F.offset,j=le.offset,I=s.format,Z=s.style,ne=s.isCollapsed(),ke=O,ye=A,We=!1;if(F.type==="text"){ke=kd(O);let At=F.getNode();We=At.getFormat()!==I||At.getStyle()!==Z}else ge(l)&&l.anchor.type==="text"&&(We=!0);if(le.type==="text"&&(ye=kd(A)),ke!==null&&ye!==null){if(ne&&(l===null||We||ge(l)&&(l.format!==I||l.style!==Z))){var Fe=performance.now();fE=[I,Z,k,V,Fe]}if(ln===k&&En===j&&Tt===ke&&at===ye&&(L.type!=="Range"||!ne)&&(_t!==null&&r.contains(_t)||r.focus({preventScroll:!0}),F.type!=="element"))break e;try{L.setBaseAndExtent(ke,k,ye,j)}catch{}if(!E.has("skip-scroll-into-view")&&s.isCollapsed()&&r!==null&&r===document.activeElement){let At=s instanceof cl&&s.anchor.type==="element"?ke.childNodes[k]||null:0<L.rangeCount?L.getRangeAt(0):null;if(At!==null){let sn;if(At instanceof Text){let gt=document.createRange();gt.selectNode(At),sn=gt.getBoundingClientRect()}else sn=At.getBoundingClientRect();let Ln=r.ownerDocument,ei=Ln.defaultView;if(ei!==null)for(var{top:te,bottom:Ie}=sn,$e,Re,Se=r;Se!==null;){let gt=Se===Ln.body;if(gt)$e=0,Re=Nf(t).innerHeight;else{let Co=Se.getBoundingClientRect();$e=Co.top,Re=Co.bottom}let Rr=0;if(te<$e?Rr=-($e-te):Ie>Re&&(Rr=Ie-Re),Rr!==0)if(gt)ei.scrollBy(0,Rr);else{let Co=Se.scrollTop;Se.scrollTop+=Rr;let Ws=Se.scrollTop-Co;te-=Ws,Ie-=Ws}if(gt)break;Se=Tf(Se)}}}pm=!0}}else l!==null&&zu(t,Tt,at)&&L.removeAllRanges()}}e:{let je=t._blockCursorElement;if(ge(s)&&s.isCollapsed()&&s.anchor.type==="element"&&r.contains(document.activeElement)){let Tt=s.anchor,at=Tt.getNode(),ln=Tt.offset,En=at.getChildrenSize(),_t=!1,At=null;if(ln===En){let sn=at.getChildAtIndex(ln-1);Ah(sn)&&(_t=!0)}else{let sn=at.getChildAtIndex(ln);if(Ah(sn)){let Ln=sn.getPreviousSibling();(Ln===null||Ah(Ln))&&(_t=!0,At=t.getElementByKey(sn.__key))}}if(_t){let sn=t.getElementByKey(at.__key);if(je===null){let Ln=t._config.theme,ei=document.createElement("div");ei.contentEditable="false",ei.setAttribute("data-lexical-cursor","true");let gt=Ln.blockCursor;if(gt!==void 0){if(typeof gt=="string"){let Rr=gt.split(" ");gt=Ln.blockCursor=Rr}gt!==void 0&&ei.classList.add(...gt)}t._blockCursorElement=je=ei}r.style.caretColor="transparent",At===null?sn.appendChild(je):sn.insertBefore(je,At);break e}}je!==null&&lm(je,t,r)}h!==null&&h.observe(r,q0)}finally{zt=d,jt=u}}if(g!==null){var Le=g;let je=Array.from(t._listeners.mutation),Tt=je.length;for(let at=0;at<Tt;at++){let[ln,En]=je[at],_t=Le.get(En);_t!==void 0&&ln(_t,{dirtyLeaves:y,prevEditorState:o,updateTags:E})}}ge(s)||s===null||l!==null&&l.is(s)||t.dispatchCommand(kf,void 0);var Je=t._pendingDecorators;Je!==null&&(t._decorators=Je,t._pendingDecorators=null,Aa("decorator",t,!0,Je));var Wt=j0(e||o),Sn=j0(n);if(Wt!==Sn&&Aa("textcontent",t,!0,Sn),Aa("update",t,!0,{dirtyElements:_,dirtyLeaves:y,editorState:n,normalizedNodes:S,prevEditorState:e||o,tags:E}),t._deferred=[],$.length!==0){let je=t._updating;t._updating=!0;try{for(let Tt=0;Tt<$.length;Tt++)$[Tt]()}finally{t._updating=je}}var cr=t._updates;if(cr.length!==0){let je=cr.shift();if(je){let[Tt,at]=je;SE(t,Tt,at)}}}}function Aa(t,e,n,...r){let i=e._updating;e._updating=n;try{let o=Array.from(e._listeners[t]);for(t=0;t<o.length;t++)o[t].apply(null,r)}finally{e._updating=i}}function X(t,e,n){if(t._updating===!1||zt!==t){let o=!1;return t.update(()=>{o=X(t,e,n)}),o}let r=uv(t);for(let o=4;0<=o;o--)for(let l=0;l<r.length;l++){var i=r[l]._commands.get(e);if(i!==void 0&&(i=i[o],i!==void 0)){i=Array.from(i);let s=i.length;for(let a=0;a<s;a++)if(i[a](n,t)===!0)return!0}}return!1}function nx(t,e){let n=t._updates;for(e=e||!1;n.length!==0;){var r=n.shift();if(r){let[i,o]=r,l;o!==void 0&&(r=o.onUpdate,l=o.tag,o.skipTransforms&&(e=!0),r&&t._deferred.push(r),l&&t._updateTags.add(l)),i()}}return e}function SE(t,e,n){let r=t._updateTags;var i,o=i=!1;if(n!==void 0){var l=n.onUpdate;i=n.tag,i!=null&&r.add(i),i=n.skipTransforms||!1,o=n.discrete||!1}l&&t._deferred.push(l),n=t._editorState,l=t._pendingEditorState;let s=!1;(l===null||l._readOnly)&&(l=t._pendingEditorState=new Lf(new Map((l||n)._nodeMap)),s=!0),l._flushSync=o,o=jt;let a=An,u=zt,c=t._updating;jt=l,An=!1,t._updating=!0,zt=t;try{s&&(t._headless?n._selection!=null&&(l._selection=n._selection.clone()):l._selection=GR(t));let d=t._compositionKey;e(),i=nx(t,i),YR(l,t),t._dirtyType!==0&&(i?XR(l,t):JR(l,t),nx(t),PR(n,l,t._dirtyLeaves,t._dirtyElements)),d!==t._compositionKey&&(l._flushSync=!0);let f=l._selection;if(ge(f)){let h=l._nodeMap,g=f.focus.key;h.get(f.anchor.key)!==void 0&&h.get(g)!==void 0||K(19)}else Ns(f)&&f._nodes.size===0&&(l._selection=null)}catch(d){d instanceof Error&&t._onError(d),t._pendingEditorState=n,t._dirtyType=2,t._cloneNotNeeded.clear(),t._dirtyLeaves=new Set,t._dirtyElements.clear(),Uo(t);return}finally{jt=o,An=a,zt=u,t._updating=c,du=0}t._dirtyType!==0||QR(l,t)?l._flushSync?(l._flushSync=!1,Uo(t)):s&&TR(()=>{Uo(t)}):(l._flushSync=!1,s&&(r.clear(),t._deferred=[],t._pendingEditorState=null))}function Hn(t,e,n){t._updating?t._updates.push([e,n]):SE(t,e,n)}class EE extends Uu{constructor(e){super(e)}decorate(){K(47)}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function tt(t){return t instanceof EE}class dl extends Uu{constructor(e){super(e),this.__last=this.__first=null,this.__indent=this.__format=this.__size=0,this.__dir=null}getFormat(){return this.getLatest().__format}getFormatType(){let e=this.getFormat();return SR[e]||""}getIndent(){return this.getLatest().__indent}getChildren(){let e=[],n=this.getFirstChild();for(;n!==null;)e.push(n),n=n.getNextSibling();return e}getChildrenKeys(){let e=[],n=this.getFirstChild();for(;n!==null;)e.push(n.__key),n=n.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){let e=pt()._dirtyElements;return e!==null&&e.has(this.__key)}isLastChild(){let e=this.getLatest(),n=this.getParentOrThrow().getLastChild();return n!==null&&n.is(e)}getAllTextNodes(){let e=[],n=this.getFirstChild();for(;n!==null;){if(Q(n)&&e.push(n),B(n)){let r=n.getAllTextNodes();e.push(...r)}n=n.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;e!==null;){if(B(e)){let n=e.getFirstChild();if(n!==null){e=n;continue}}break}return e}getLastDescendant(){let e=this.getLastChild();for(;e!==null;){if(B(e)){let n=e.getLastChild();if(n!==null){e=n;continue}}break}return e}getDescendantByIndex(e){let n=this.getChildren(),r=n.length;return e>=r?(e=n[r-1],B(e)&&e.getLastDescendant()||e||null):(e=n[e],B(e)&&e.getFirstDescendant()||e||null)}getFirstChild(){let e=this.getLatest().__first;return e===null?null:It(e)}getFirstChildOrThrow(){let e=this.getFirstChild();return e===null&&K(45,this.__key),e}getLastChild(){let e=this.getLatest().__last;return e===null?null:It(e)}getLastChildOrThrow(){let e=this.getLastChild();return e===null&&K(96,this.__key),e}getChildAtIndex(e){var n=this.getChildrenSize();let r;if(e<n/2){for(r=this.getFirstChild(),n=0;r!==null&&n<=e;){if(n===e)return r;r=r.getNextSibling(),n++}return null}for(r=this.getLastChild(),--n;r!==null&&n>=e;){if(n===e)return r;r=r.getPreviousSibling(),n--}return null}getTextContent(){let e="",n=this.getChildren(),r=n.length;for(let i=0;i<r;i++){let o=n[i];e+=o.getTextContent(),B(o)&&i!==r-1&&!o.isInline()&&(e+=`
|
|
69
|
+
`?n.push(ms()):o===" "?n.push(Pf()):n.push(Lt(o))}this.insertNodes(n)}insertText(e){var n=this.anchor,r=this.focus,i=this.isCollapsed()||n.isBefore(r),o=this.format,l=this.style;i&&n.type==="element"?K0(n,r,o,l):i||r.type!=="element"||K0(r,n,o,l);var s=this.getNodes(),a=s.length,u=i?r:n;r=(i?n:r).offset;var c=u.offset;n=s[0],Q(n)||K(26),i=n.getTextContent().length;var d=n.getParentOrThrow(),f=s[a-1];if(this.isCollapsed()&&r===i&&(n.isSegmented()||n.isToken()||!n.canInsertTextAfter()||!d.canInsertTextAfter()&&n.getNextSibling()===null)){var h=n.getNextSibling();if(Q(h)&&h.canInsertTextBefore()&&!im(h)||(h=Lt(),h.setFormat(o),d.canInsertTextAfter()?n.insertAfter(h):d.insertAfter(h)),h.select(0,0),n=h,e!==""){this.insertText(e);return}}else if(this.isCollapsed()&&r===0&&(n.isSegmented()||n.isToken()||!n.canInsertTextBefore()||!d.canInsertTextBefore()&&n.getPreviousSibling()===null)){if(h=n.getPreviousSibling(),(!Q(h)||im(h))&&(h=Lt(),h.setFormat(o),d.canInsertTextBefore()?n.insertBefore(h):d.insertBefore(h)),h.select(),n=h,e!==""){this.insertText(e);return}}else if(n.isSegmented()&&r!==i)d=Lt(n.getTextContent()),d.setFormat(o),n.replace(d),n=d;else if(!(this.isCollapsed()||e===""||(h=f.getParent(),d.canInsertTextBefore()&&d.canInsertTextAfter()&&(!B(h)||h.canInsertTextBefore()&&h.canInsertTextAfter())))){this.insertText(""),vE(this.anchor,this.focus,null),this.insertText(e);return}if(a===1)if(n.isToken())e=Lt(e),e.select(),n.replace(e);else{if(s=n.getFormat(),a=n.getStyle(),r===c&&(s!==o||a!==l))if(n.getTextContent()==="")n.setFormat(o),n.setStyle(l);else{s=Lt(e),s.setFormat(o),s.setStyle(l),s.select(),r===0?n.insertBefore(s,!1):([a]=n.splitText(r),a.insertAfter(s,!1)),s.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=e.length);return}n=n.spliceText(r,c-r,e,!0),n.getTextContent()===""?n.remove():this.anchor.type==="text"&&(n.isComposing()?this.anchor.offset-=e.length:(this.format=s,this.style=a))}else{if(o=new Set([...n.getParentKeys(),...f.getParentKeys()]),h=B(n)?n:n.getParentOrThrow(),l=B(f)?f:f.getParentOrThrow(),d=f,!h.is(l)&&l.isInline())do d=l,l=l.getParentOrThrow();while(l.isInline());if(u.type==="text"&&(c!==0||f.getTextContent()==="")||u.type==="element"&&f.getIndexWithinParent()<c)if(Q(f)&&!f.isToken()&&c!==f.getTextContentSize()){if(f.isSegmented()){var g=Lt(f.getTextContent());f.replace(g),f=g}mn(u.getNode())||(f=f.spliceText(0,c,"")),o.add(f.__key)}else u=f.getParentOrThrow(),u.canBeEmpty()||u.getChildrenSize()!==1?f.remove():u.remove();else o.add(f.__key);for(u=l.getChildren(),c=new Set(s),f=h.is(l),h=h.isInline()&&n.getNextSibling()===null?h:n,g=u.length-1;0<=g;g--){let m=u[g];if(m.is(n)||B(m)&&m.isParentOf(n))break;m.isAttached()&&(!c.has(m)||m.is(d)?f||h.insertAfter(m,!1):m.remove())}if(!f)for(u=l,c=null;u!==null;)l=u.getChildren(),f=l.length,(f===0||l[f-1].is(c))&&(o.delete(u.__key),c=u),u=u.getParent();for(n.isToken()?r===i?n.select():(e=Lt(e),e.select(),n.replace(e)):(n=n.spliceText(r,i-r,e,!0),n.getTextContent()===""?n.remove():n.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=e.length)),e=1;e<a;e++)n=s[e],o.has(n.__key)||n.remove()}}removeText(){this.insertText("")}formatText(e){if(this.isCollapsed())this.toggleFormat(e),Kt(null);else{var n=this.getNodes(),r=[];for(var i of n)Q(i)&&r.push(i);var o=r.length;if(o===0)this.toggleFormat(e),Kt(null);else{i=this.anchor;var l=this.focus,s=this.isBackward();n=s?l:i,i=s?i:l;var a=0,u=r[0];if(l=n.type==="element"?0:n.offset,n.type==="text"&&l===u.getTextContentSize()&&(a=1,u=r[1],l=0),u!=null){s=u.getFormatFlags(e,null);var c=o-1,d=r[c];if(o=i.type==="text"?i.offset:d.getTextContentSize(),u.is(d))l!==o&&(l===0&&o===u.getTextContentSize()?u.setFormat(s):(e=u.splitText(l,o),e=l===0?e[0]:e[1],e.setFormat(s),n.type==="text"&&n.set(e.__key,0,"text"),i.type==="text"&&i.set(e.__key,o-l,"text")),this.format=s);else{l!==0&&([,u]=u.splitText(l),l=0),u.setFormat(s);var f=d.getFormatFlags(e,s);for(0<o&&(o!==d.getTextContentSize()&&([d]=d.splitText(o)),d.setFormat(f)),a+=1;a<c;a++){let h=r[a];if(!h.isToken()){let g=h.getFormatFlags(e,f);h.setFormat(g)}}n.type==="text"&&n.set(u.__key,l,"text"),i.type==="text"&&i.set(d.__key,o,"text"),this.format=s|f}}}}}insertNodes(e,n){if(!this.isCollapsed()){var r=this.isBackward()?this.anchor:this.focus,i=r.getNode().getNextSibling();if(i=i?i.getKey():null,r=(r=r.getNode().getPreviousSibling())?r.getKey():null,this.removeText(),this.isCollapsed()&&this.focus.type==="element"){if(this.focus.key===i&&this.focus.offset===0){var o=Lt();this.focus.getNode().insertBefore(o)}else this.focus.key===r&&this.focus.offset===this.focus.getNode().getChildrenSize()&&(o=Lt(),this.focus.getNode().insertAfter(o));o&&(this.focus.set(o.__key,0,"text"),this.anchor.set(o.__key,0,"text"))}}o=this.anchor,r=o.offset;var l=o.getNode();i=l,o.type==="element"&&(o=o.getNode(),i=o.getChildAtIndex(r-1),i=i===null?o:i),o=[];var s=l.getNextSiblings(),a=_r(l)?null:l.getTopLevelElementOrThrow();if(Q(l))if(i=l.getTextContent().length,r===0&&i!==0)i=l.getPreviousSibling(),i=i!==null?i:l.getParentOrThrow(),o.push(l);else if(r===i)i=l;else{if(l.isToken())return!1;[i,l]=l.splitText(r),o.push(l)}l=i,o.push(...s),s=e[0];var u=!1,c=null;for(let g=0;g<e.length;g++){var d=e[g];if(_r(i)||tt(i)||!B(d)||d.isInline())u&&!B(d)&&!tt(d)&&_r(i.getParent())&&K(28);else{if(d.is(s)){if(B(i)&&i.isEmpty()&&i.canReplaceWith(d)){i.replace(d),i=d,u=!0;continue}if(u=d.getFirstDescendant(),ZS(u)){for(var f=u.getParentOrThrow();f.isInline();)f=f.getParentOrThrow();if(c=f.getChildren(),u=c.length,B(i)){var h=i.getFirstChild();for(let m=0;m<u;m++){let w=c[m];h===null?i.append(w):h.insertAfter(w),h=w}}else{for(h=u-1;0<=h;h--)i.insertAfter(c[h]);i=i.getParentOrThrow()}if(c=c[u-1],f.remove(),u=!0,f.is(d))continue}}Q(i)&&(a===null&&K(27),i=a)}u=!1,B(i)&&!i.isInline()?(c=d,tt(d)&&!d.isInline()?i=e.length===1&&i.canBeEmpty()&&i.isEmpty()?i.insertBefore(d,!1):i.insertAfter(d,!1):B(d)?(d.canBeEmpty()||!d.isEmpty())&&(mn(i)?(f=i.getChildAtIndex(r),f!==null?f.insertBefore(d):i.append(d),i=d):d.isInline()?(i.append(d),i=d):i=i.insertAfter(d,!1)):(f=i.getFirstChild(),f!==null?f.insertBefore(d):i.append(d),i=d)):!B(d)||B(d)&&d.isInline()||tt(i)&&!i.isInline()?(c=d,ge(this)&&tt(d)&&(B(i)||Q(i))&&!d.isInline()?(Q(i)?(f=i.getParentOrThrow(),[i]=i.splitText(r),i=i.getIndexWithinParent()+1):(f=i,i=r),[,i]=nE(f,i),i=i.insertBefore(d)):i=i.insertAfter(d,!1)):(d=i.getParentOrThrow(),cu(i)&&i.remove(),i=d,g--)}if(n&&(Q(l)?l.select():(e=i.getPreviousSibling(),Q(e)?e.select():(e=i.getIndexWithinParent(),i.getParentOrThrow().select(e,e)))),B(i)){if(e=Q(c)?c:B(c)&&c.isInline()?c.getLastDescendant():i.getLastDescendant(),n||(e===null?i.select():Q(e)?e.getTextContent()===""?e.selectPrevious():e.select():e.selectNext()),o.length!==0)for(n=i,e=o.length-1;0<=e;e--)r=o[e],a=r.getParentOrThrow(),!B(i)||xm(r)||tt(r)&&(!r.isInline()||r.isIsolated())?B(i)||xm(r)?B(r)&&!r.canInsertAfter(i)?(l=a.constructor.clone(a),B(l)||K(29),l.append(r),i.insertAfter(l)):i.insertAfter(r):(i.insertBefore(r),i=r):(n===i?i.append(r):i.insertBefore(r),i=r),a.isEmpty()&&!a.canBeEmpty()&&a.remove()}else n||(Q(i)?i.select():(n=i.getParentOrThrow(),e=i.getIndexWithinParent()+1,n.select(e,e)));return!0}insertParagraph(){this.isCollapsed()||this.removeText();var e=this.anchor,n=e.offset,r=[];if(e.type==="text"){var i=e.getNode(),o=i.getNextSiblings().reverse(),l=i.getParentOrThrow(),s=l.isInline(),a=s?l.getTextContentSize():i.getTextContentSize();n===0?o.push(i):(s&&(r=l.getNextSiblings()),n===a||s&&n===i.getTextContentSize()||([,i]=i.splitText(n),o.push(i)))}else{if(l=e.getNode(),_r(l)){o=Jo(),r=l.getChildAtIndex(n),o.select(),r!==null?r.insertBefore(o,!1):l.append(o);return}o=l.getChildren().slice(n).reverse()}if(i=o.length,n===0&&0<i&&l.isInline()){if(r=l.getParentOrThrow(),o=r.insertNewAfter(this,!1),B(o))for(r=r.getChildren(),l=0;l<r.length;l++)o.append(r[l])}else if(s=l.insertNewAfter(this,!1),s===null)this.insertLineBreak();else if(B(s))if(a=l.getFirstChild(),n===0&&(l.is(e.getNode())||a&&a.is(e.getNode()))&&0<i)l.insertBefore(s);else{if(l=null,n=r.length,e=s.getParentOrThrow(),0<n)for(a=0;a<n;a++)e.append(r[a]);if(i!==0)for(r=0;r<i;r++)n=o[r],l===null?s.append(n):l.insertBefore(n),l=n;s.canBeEmpty()||s.getChildrenSize()!==0?s.selectStart():(s.selectPrevious(),s.remove())}}insertLineBreak(e){let n=ms();var r=this.anchor;r.type==="element"&&(r=r.getNode(),mn(r)&&this.insertParagraph()),e?this.insertNodes([n],!0):this.insertNodes([n])&&n.selectNext(0,0)}getCharacterOffsets(){return Kc(this)}extract(){var e=this.getNodes(),n=e.length,r=n-1,i=this.anchor;let o=this.focus;var l=e[0];let s=e[r],[a,u]=Kc(this);return n===0?[]:n===1?Q(l)&&!this.isCollapsed()?(e=a>u?u:a,r=l.splitText(e,a>u?a:u),e=e===0?r[0]:r[1],e!=null?[e]:[]):[l]:(n=i.isBefore(o),Q(l)&&(i=n?a:u,i===l.getTextContentSize()?e.shift():i!==0&&([,l]=l.splitText(i),e[0]=l)),Q(s)&&(l=s.getTextContent().length,n=n?u:a,n===0?e.pop():n!==l&&([s]=s.splitText(n),e[r]=s)),e)}modify(e,n,r){var i=this.focus,o=this.anchor,l=e==="move",s=om(i,n);if(tt(s)&&!s.isIsolated())l&&s.isKeyboardSelectable()?(n=_m(),n.add(s.__key),Vr(n)):(e=n?s.getPreviousSibling():s.getNextSibling(),Q(e)?(s=e.__key,n=n?e.getTextContent().length:0,i.set(s,n,"text"),l&&o.set(s,n,"text")):(r=s.getParentOrThrow(),B(e)?(r=e.__key,s=n?e.getChildrenSize():0):(s=s.getIndexWithinParent(),r=r.__key,n||s++),i.set(r,s,"element"),l&&o.set(r,s,"element")));else if(o=pt(),i=Jr(o._window)){var a=o._blockCursorElement,u=o._rootElement;if(u===null||a===null||!B(s)||s.isInline()||s.canBeEmpty()||lm(a,o,u),i.modify(e,n?"backward":"forward",r),0<i.rangeCount&&(s=i.getRangeAt(0),o=this.anchor.getNode(),o=mn(o)?o:eE(o),this.applyDOMRange(s),this.dirty=!0,!l)){for(l=this.getNodes(),e=[],r=!1,a=0;a<l.length;a++)u=l[a],Nd(u,o)?e.push(u):r=!0;r&&0<e.length&&(n?(n=e[0],B(n)?n.selectStart():n.getParentOrThrow().selectStart()):(n=e[e.length-1],B(n)?n.selectEnd():n.getParentOrThrow().selectEnd())),(i.anchorNode!==s.startContainer||i.anchorOffset!==s.startOffset)&&(n=this.focus,l=this.anchor,i=l.key,s=l.offset,o=l.type,zi(l,n.key,n.offset,n.type),zi(n,i,s,o),this._cachedNodes=null)}}}deleteCharacter(e){let n=this.isCollapsed();if(this.isCollapsed()){var r=this.anchor,i=this.focus,o=r.getNode();if(!e&&(r.type==="element"&&B(o)&&r.offset===o.getChildrenSize()||r.type==="text"&&r.offset===o.getTextContentSize())){var l=o.getParent();if(l=o.getNextSibling()||(l===null?null:l.getNextSibling()),B(l)&&l.isShadowRoot())return}if(l=om(i,e),tt(l)&&!l.isIsolated()){l.isKeyboardSelectable()&&B(o)&&o.getChildrenSize()===0?(o.remove(),e=_m(),e.add(l.__key),Vr(e)):(l.remove(),pt().dispatchCommand(kf,void 0));return}if(!e&&B(l)&&B(o)&&o.isEmpty()){o.remove(),l.selectStart();return}if(this.modify("extend",e,"character"),this.isCollapsed()){if(e&&r.offset===0&&(r.type==="element"?r.getNode():r.getNode().getParentOrThrow()).collapseAtStart(this))return}else{if(l=i.type==="text"?i.getNode():null,o=r.type==="text"?r.getNode():null,l!==null&&l.isSegmented()){if(r=i.offset,i=l.getTextContentSize(),l.is(o)||e&&r!==i||!e&&r!==0){G0(l,e,r);return}}else if(o!==null&&o.isSegmented()&&(r=r.offset,i=o.getTextContentSize(),o.is(l)||e&&r!==0||!e&&r!==i)){G0(o,e,r);return}if(o=this.anchor,l=this.focus,r=o.getNode(),i=l.getNode(),r===i&&o.type==="text"&&l.type==="text"){var s=o.offset,a=l.offset;let u=s<a;i=u?s:a,a=u?a:s,s=a-1,i!==s&&(r=r.getTextContent().slice(i,a),JS(r)||(e?l.offset=s:o.offset=s))}}}this.removeText(),e&&!n&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0&&(e=this.anchor.getNode(),e.isEmpty()&&mn(e.getParent())&&e.getIndexWithinParent()===0&&e.collapseAtStart(this))}deleteLine(e){this.isCollapsed()&&(this.anchor.type==="text"&&this.modify("extend",e,"lineboundary"),(e?this.focus:this.anchor).offset===0&&this.modify("extend",e,"character")),this.removeText()}deleteWord(e){this.isCollapsed()&&this.modify("extend",e,"word"),this.removeText()}}function Rs(t){return t instanceof Af}function Z0(t){let e=t.offset;return t.type==="text"?e:(t=t.getNode(),e===t.getChildrenSize()?t.getTextContent().length:0)}function Kc(t){let e=t.anchor;return t=t.focus,e.type==="element"&&t.type==="element"&&e.key===t.key&&e.offset===t.offset?[0,0]:[Z0(e),Z0(t)]}function G0(t,e,n){let r=t.getTextContent().split(/(?=\s)/g),i=r.length,o=0,l=0;for(let s=0;s<i;s++){let a=r[s],u=s===i-1;if(l=o,o+=a.length,e&&o===n||o>n||u){r.splice(s,1),u&&(l=void 0);break}}e=r.join("").trim(),e===""?t.remove():(t.setTextContent(e),t.select(l,l))}function Y0(t,e,n,r){var i=e;if(t.nodeType===1){let s=!1;var o=t.childNodes,l=o.length;i===l&&(s=!0,i=l-1);let a=o[i];if(l=!1,a===r._blockCursorElement?(a=o[i+1],l=!0):r._blockCursorElement!==null&&i--,r=Ul(a),Q(r))i=s?r.getTextContentSize():0;else{if(o=Ul(t),o===null)return null;if(B(o)?(t=o.getChildAtIndex(i),(e=B(t))&&(e=t.getParent(),e=n===null||e===null||!e.canBeEmpty()||e!==n.getNode()),e&&(n=s?t.getLastDescendant():t.getFirstDescendant(),n===null?(o=t,i=0):(t=n,o=B(t)?t:t.getParentOrThrow())),Q(t)?(r=t,o=null,i=s?t.getTextContentSize():0):t!==o&&s&&!l&&i++):(i=o.getIndexWithinParent(),i=e===0&&tt(o)&&Ul(t)===o?i:i+1,o=o.getParentOrThrow()),B(o))return new Hr(o.__key,i,"element")}}else r=Ul(t);return Q(r)?new Hr(r.__key,i,"text"):null}function X0(t,e,n){var r=t.offset,i=t.getNode();r===0?(r=i.getPreviousSibling(),i=i.getParent(),e?(n||!e)&&r===null&&B(i)&&i.isInline()&&(e=i.getPreviousSibling(),Q(e)&&(t.key=e.__key,t.offset=e.getTextContent().length)):B(r)&&!n&&r.isInline()?(t.key=r.__key,t.offset=r.getChildrenSize(),t.type="element"):Q(r)&&(t.key=r.__key,t.offset=r.getTextContent().length)):r===i.getTextContent().length&&(r=i.getNextSibling(),i=i.getParent(),e&&B(r)&&r.isInline()?(t.key=r.__key,t.offset=0,t.type="element"):(n||e)&&r===null&&B(i)&&i.isInline()&&!i.canInsertTextAfter()&&(e=i.getNextSibling(),Q(e)&&(t.key=e.__key,t.offset=0)))}function vE(t,e,n){if(t.type==="text"&&e.type==="text"){var r=t.isBefore(e);let i=t.is(e);X0(t,r,i),X0(e,!r,i),i&&(e.key=t.key,e.offset=t.offset,e.type=t.type),r=pt(),r.isComposing()&&r._compositionKey!==t.key&&ge(n)&&(r=n.anchor,n=n.focus,zi(t,r.key,r.offset,r.type),zi(e,n.key,n.offset,n.type))}}function yE(t,e,n,r,i,o){return t===null||n===null||!zu(i,t,n)||(e=Y0(t,e,ge(o)?o.anchor:null,i),e===null)||(r=Y0(n,r,ge(o)?o.focus:null,i),r===null||e.type==="element"&&r.type==="element"&&(t=Ul(t),n=Ul(n),tt(t)&&tt(n)))?null:(vE(e,r,o),[e,r])}function xm(t){return B(t)&&!t.isInline()}function xE(t,e,n,r,i,o){let l=Qr();return t=new cl(new Hr(t,e,i),new Hr(n,r,o),0,""),t.dirty=!0,l._selection=t}function _m(){return new Af(new Set)}function GR(t){let e=t.getEditorState()._selection,n=Jr(t._window);return Rs(e)||pv(e)?e.clone():mv(e,n,t)}function mv(t,e,n){var r=n._window;if(r===null)return null;var i=r.event,o=i?i.type:void 0;r=o==="selectionchange",i=!rm&&(r||o==="beforeinput"||o==="compositionstart"||o==="compositionend"||o==="click"&&i&&i.detail===3||o==="drop"||o===void 0);let l;if(!ge(t)||i){if(e===null)return null;if(i=e.anchorNode,o=e.focusNode,l=e.anchorOffset,e=e.focusOffset,r&&ge(t)&&!zu(n,i,o))return t.clone()}else return t.clone();if(n=yE(i,l,o,e,n,t),n===null)return null;let[s,a]=n;return new cl(s,a,ge(t)?t.format:0,ge(t)?t.style:"")}function rt(){return Qr()._selection}function Os(){return pt()._editorState._selection}function Pd(t,e,n,r=1){var i=t.anchor,o=t.focus,l=i.getNode(),s=o.getNode();if(e.is(l)||e.is(s)){if(l=e.__key,t.isCollapsed())e=i.offset,(n<=e&&0<r||n<e&&0>r)&&(n=Math.max(0,e+r),i.set(l,n,"element"),o.set(l,n,"element"),J0(t));else{let u=t.isBackward();s=u?o:i;var a=s.getNode();i=u?i:o,o=i.getNode(),e.is(a)&&(a=s.offset,(n<=a&&0<r||n<a&&0>r)&&s.set(l,Math.max(0,a+r),"element")),e.is(o)&&(e=i.offset,(n<=e&&0<r||n<e&&0>r)&&i.set(l,Math.max(0,e+r),"element"))}J0(t)}}function J0(t){var e=t.anchor,n=e.offset;let r=t.focus;var i=r.offset,o=e.getNode(),l=r.getNode();if(t.isCollapsed())B(o)&&(l=o.getChildrenSize(),l=(i=n>=l)?o.getChildAtIndex(l-1):o.getChildAtIndex(n),Q(l)&&(n=0,i&&(n=l.getTextContentSize()),e.set(l.__key,n,"text"),r.set(l.__key,n,"text")));else{if(B(o)){let s=o.getChildrenSize();n=(t=n>=s)?o.getChildAtIndex(s-1):o.getChildAtIndex(n),Q(n)&&(o=0,t&&(o=n.getTextContentSize()),e.set(n.__key,o,"text"))}B(l)&&(n=l.getChildrenSize(),i=(e=i>=n)?l.getChildAtIndex(n-1):l.getChildAtIndex(i),Q(i)&&(l=0,e&&(l=i.getTextContentSize()),r.set(i.__key,l,"text")))}}function YR(t,e){if(e=e.getEditorState()._selection,t=t._selection,ge(t)){var n=t.anchor;let r=t.focus,i;n.type==="text"&&(i=n.getNode(),i.selectionTransform(e,t)),r.type==="text"&&(n=r.getNode(),i!==n&&n.selectionTransform(e,t))}}function Ad(t,e,n,r,i){let o=null,l=0,s=null;r!==null?(o=r.__key,Q(r)?(l=r.getTextContentSize(),s="text"):B(r)&&(l=r.getChildrenSize(),s="element")):i!==null&&(o=i.__key,Q(i)?s="text":B(i)&&(s="element")),o!==null&&s!==null?t.set(o,l,s):(l=e.getIndexWithinParent(),l===-1&&(l=n.getChildrenSize()),t.set(n.__key,l,"element"))}function Q0(t,e,n,r,i){t.type==="text"?(t.key=n,e||(t.offset+=i)):t.offset>r.getIndexWithinParent()&&--t.offset}function _E(t,e,n){let r=[],i=null,o=null;t=t.getChildren();for(let c=0;c<t.length;c++){var l=t[c];fu(l)||K(108);var s=l.getChildren();l=0;for(let d of s){for(er(d)||K(109);r[c]!==void 0&&r[c][l]!==void 0;)l++;s=c;var a=l,u=d;let f={cell:u,startColumn:a,startRow:s},h=u.__rowSpan,g=u.__colSpan;for(let m=0;m<h;m++){r[s+m]===void 0&&(r[s+m]=[]);for(let w=0;w<g;w++)r[s+m][a+w]=f}e.is(u)&&(i=f),n.is(u)&&(o=f),l+=d.__colSpan}}return i===null&&K(110),o===null&&K(111),[r,i,o]}function wE(t){t instanceof yv||(t instanceof Uu?(t=Rd(t,er),er(t)||K(114)):(t=Rd(t.getNode(),er),er(t)||K(114)));let e=t.getParent();fu(e)||K(115);let n=e.getParent();return xv(n)||K(116),[t,e,n]}let jt=null,zt=null,An=!1,Fh=!1,du=0,q0={characterData:!0,childList:!0,subtree:!0};function Ps(){return An||jt!==null&&jt._readOnly}function hn(){An&&K(13)}function Qr(){return jt===null&&K(15),jt}function pt(){return zt===null&&K(16),zt}function ex(t,e,n){var r=e.__type;let i=t._nodes.get(r);for(i===void 0&&K(30,r),t=n.get(r),t===void 0&&(t=Array.from(i.transforms),n.set(r,t)),n=t.length,r=0;r<n&&(t[r](e),e.isAttached());r++);}function XR(t,e){e=e._dirtyLeaves,t=t._nodeMap;for(let n of e)e=t.get(n),Q(e)&&e.isAttached()&&e.isSimpleText()&&!e.isUnmergeable()&&HS(e)}function JR(t,e){let n=e._dirtyLeaves,r=e._dirtyElements;t=t._nodeMap;let i=Zi(),o=new Map;var l=n;let s=l.size;for(var a=r,u=a.size;0<s||0<u;){if(0<s){e._dirtyLeaves=new Set;for(let c of l)l=t.get(c),Q(l)&&l.isAttached()&&l.isSimpleText()&&!l.isUnmergeable()&&HS(l),l!==void 0&&l!==void 0&&l.__key!==i&&l.isAttached()&&ex(e,l,o),n.add(c);if(l=e._dirtyLeaves,s=l.size,0<s){du++;continue}}e._dirtyLeaves=new Set,e._dirtyElements=new Map;for(let c of a)a=c[0],u=c[1],(a==="root"||u)&&(l=t.get(a),l!==void 0&&l!==void 0&&l.__key!==i&&l.isAttached()&&ex(e,l,o),r.set(a,u));l=e._dirtyLeaves,s=l.size,a=e._dirtyElements,u=a.size,du++}e._dirtyLeaves=n,e._dirtyElements=r}function gv(t,e){var n=t.type,r=e.get(n);if(r===void 0&&K(17,n),n=r.klass,t.type!==n.getType()&&K(18,n.name),n=n.importJSON(t),t=t.children,B(n)&&Array.isArray(t))for(r=0;r<t.length;r++){let i=gv(t[r],e);n.append(i)}return n}function tx(t,e){let n=jt,r=An,i=zt;jt=t,An=!0,zt=null;try{return e()}finally{jt=n,An=r,zt=i}}function Uo(t,e){let n=t._pendingEditorState,r=t._rootElement,i=t._headless||r===null;if(n!==null){var o=t._editorState,l=o._selection,s=n._selection,a=t._dirtyType!==0,u=jt,c=An,d=zt,f=t._updating,h=t._observer,g=null;if(t._pendingEditorState=null,t._editorState=n,!i&&a&&h!==null){zt=t,jt=n,An=!1,t._updating=!0;try{let je=t._dirtyType,Tt=t._dirtyElements,at=t._dirtyLeaves;h.disconnect();var m=je,w=Tt,v=at;fn=li=Nt="",iE=m===2,Wc=null,tn=t,ao=t._config,su=t._nodes,Of=tn._listeners.mutation,sm=w,am=v,Xo=o._nodeMap,uo=n._nodeMap,hv=n._readOnly,um=new Map(t._keyToDOMMap);let ln=new Map;au=ln,pa("root",null),au=um=ao=uo=Xo=am=sm=su=tn=void 0,g=ln}catch(je){if(je instanceof Error&&t._onError(je),Fh)throw je;kE(t,null,r,n),VS(t),t._dirtyType=2,Fh=!0,Uo(t,o),Fh=!1;return}finally{h.observe(r,q0),t._updating=f,jt=u,An=c,zt=d}}n._readOnly||(n._readOnly=!0);var y=t._dirtyLeaves,_=t._dirtyElements,S=t._normalizedNodes,E=t._updateTags,$=t._deferred;a&&(t._dirtyType=0,t._cloneNotNeeded.clear(),t._dirtyLeaves=new Set,t._dirtyElements=new Map,t._normalizedNodes=new Set,t._updateTags=new Set);var C=t._decorators,N=t._pendingDecorators||C,R=n._nodeMap,b;for(b in N)R.has(b)||(N===C&&(N=XS(t)),delete N[b]);var L=i?null:Jr(t._window);if(t._editable&&L!==null&&(a||s===null||s.dirty)){zt=t,jt=n;try{if(h!==null&&h.disconnect(),a||s===null||s.dirty){let je=t._blockCursorElement;je!==null&&lm(je,t,r);e:{let Tt=L.anchorNode,at=L.focusNode,ln=L.anchorOffset,En=L.focusOffset,_t=document.activeElement;if(!(E.has("collaboration")&&_t!==r||_t!==null&&sv(_t)))if(ge(s)){var F=s.anchor,le=s.focus,V=F.key,H=le.key,O=Td(t,V),A=Td(t,H),k=F.offset,j=le.offset,I=s.format,Z=s.style,ne=s.isCollapsed(),ke=O,ye=A,We=!1;if(F.type==="text"){ke=kd(O);let At=F.getNode();We=At.getFormat()!==I||At.getStyle()!==Z}else ge(l)&&l.anchor.type==="text"&&(We=!0);if(le.type==="text"&&(ye=kd(A)),ke!==null&&ye!==null){if(ne&&(l===null||We||ge(l)&&(l.format!==I||l.style!==Z))){var Fe=performance.now();fE=[I,Z,k,V,Fe]}if(ln===k&&En===j&&Tt===ke&&at===ye&&(L.type!=="Range"||!ne)&&(_t!==null&&r.contains(_t)||r.focus({preventScroll:!0}),F.type!=="element"))break e;try{L.setBaseAndExtent(ke,k,ye,j)}catch{}if(!E.has("skip-scroll-into-view")&&s.isCollapsed()&&r!==null&&r===document.activeElement){let At=s instanceof cl&&s.anchor.type==="element"?ke.childNodes[k]||null:0<L.rangeCount?L.getRangeAt(0):null;if(At!==null){let sn;if(At instanceof Text){let gt=document.createRange();gt.selectNode(At),sn=gt.getBoundingClientRect()}else sn=At.getBoundingClientRect();let Ln=r.ownerDocument,ei=Ln.defaultView;if(ei!==null)for(var{top:te,bottom:Ie}=sn,$e,Re,Se=r;Se!==null;){let gt=Se===Ln.body;if(gt)$e=0,Re=Nf(t).innerHeight;else{let Co=Se.getBoundingClientRect();$e=Co.top,Re=Co.bottom}let Rr=0;if(te<$e?Rr=-($e-te):Ie>Re&&(Rr=Ie-Re),Rr!==0)if(gt)ei.scrollBy(0,Rr);else{let Co=Se.scrollTop;Se.scrollTop+=Rr;let Ws=Se.scrollTop-Co;te-=Ws,Ie-=Ws}if(gt)break;Se=Tf(Se)}}}pm=!0}}else l!==null&&zu(t,Tt,at)&&L.removeAllRanges()}}e:{let je=t._blockCursorElement;if(ge(s)&&s.isCollapsed()&&s.anchor.type==="element"&&r.contains(document.activeElement)){let Tt=s.anchor,at=Tt.getNode(),ln=Tt.offset,En=at.getChildrenSize(),_t=!1,At=null;if(ln===En){let sn=at.getChildAtIndex(ln-1);Ah(sn)&&(_t=!0)}else{let sn=at.getChildAtIndex(ln);if(Ah(sn)){let Ln=sn.getPreviousSibling();(Ln===null||Ah(Ln))&&(_t=!0,At=t.getElementByKey(sn.__key))}}if(_t){let sn=t.getElementByKey(at.__key);if(je===null){let Ln=t._config.theme,ei=document.createElement("div");ei.contentEditable="false",ei.setAttribute("data-lexical-cursor","true");let gt=Ln.blockCursor;if(gt!==void 0){if(typeof gt=="string"){let Rr=gt.split(" ");gt=Ln.blockCursor=Rr}gt!==void 0&&ei.classList.add(...gt)}t._blockCursorElement=je=ei}r.style.caretColor="transparent",At===null?sn.appendChild(je):sn.insertBefore(je,At);break e}}je!==null&&lm(je,t,r)}h!==null&&h.observe(r,q0)}finally{zt=d,jt=u}}if(g!==null){var Le=g;let je=Array.from(t._listeners.mutation),Tt=je.length;for(let at=0;at<Tt;at++){let[ln,En]=je[at],_t=Le.get(En);_t!==void 0&&ln(_t,{dirtyLeaves:y,prevEditorState:o,updateTags:E})}}ge(s)||s===null||l!==null&&l.is(s)||t.dispatchCommand(kf,void 0);var Je=t._pendingDecorators;Je!==null&&(t._decorators=Je,t._pendingDecorators=null,Aa("decorator",t,!0,Je));var Wt=j0(e||o),Sn=j0(n);if(Wt!==Sn&&Aa("textcontent",t,!0,Sn),Aa("update",t,!0,{dirtyElements:_,dirtyLeaves:y,editorState:n,normalizedNodes:S,prevEditorState:e||o,tags:E}),t._deferred=[],$.length!==0){let je=t._updating;t._updating=!0;try{for(let Tt=0;Tt<$.length;Tt++)$[Tt]()}finally{t._updating=je}}var cr=t._updates;if(cr.length!==0){let je=cr.shift();if(je){let[Tt,at]=je;SE(t,Tt,at)}}}}function Aa(t,e,n,...r){let i=e._updating;e._updating=n;try{let o=Array.from(e._listeners[t]);for(t=0;t<o.length;t++)o[t].apply(null,r)}finally{e._updating=i}}function X(t,e,n){if(t._updating===!1||zt!==t){let o=!1;return t.update(()=>{o=X(t,e,n)}),o}let r=uv(t);for(let o=4;0<=o;o--)for(let l=0;l<r.length;l++){var i=r[l]._commands.get(e);if(i!==void 0&&(i=i[o],i!==void 0)){i=Array.from(i);let s=i.length;for(let a=0;a<s;a++)if(i[a](n,t)===!0)return!0}}return!1}function nx(t,e){let n=t._updates;for(e=e||!1;n.length!==0;){var r=n.shift();if(r){let[i,o]=r,l;o!==void 0&&(r=o.onUpdate,l=o.tag,o.skipTransforms&&(e=!0),r&&t._deferred.push(r),l&&t._updateTags.add(l)),i()}}return e}function SE(t,e,n){let r=t._updateTags;var i,o=i=!1;if(n!==void 0){var l=n.onUpdate;i=n.tag,i!=null&&r.add(i),i=n.skipTransforms||!1,o=n.discrete||!1}l&&t._deferred.push(l),n=t._editorState,l=t._pendingEditorState;let s=!1;(l===null||l._readOnly)&&(l=t._pendingEditorState=new Lf(new Map((l||n)._nodeMap)),s=!0),l._flushSync=o,o=jt;let a=An,u=zt,c=t._updating;jt=l,An=!1,t._updating=!0,zt=t;try{s&&(t._headless?n._selection!=null&&(l._selection=n._selection.clone()):l._selection=GR(t));let d=t._compositionKey;e(),i=nx(t,i),YR(l,t),t._dirtyType!==0&&(i?XR(l,t):JR(l,t),nx(t),PR(n,l,t._dirtyLeaves,t._dirtyElements)),d!==t._compositionKey&&(l._flushSync=!0);let f=l._selection;if(ge(f)){let h=l._nodeMap,g=f.focus.key;h.get(f.anchor.key)!==void 0&&h.get(g)!==void 0||K(19)}else Rs(f)&&f._nodes.size===0&&(l._selection=null)}catch(d){d instanceof Error&&t._onError(d),t._pendingEditorState=n,t._dirtyType=2,t._cloneNotNeeded.clear(),t._dirtyLeaves=new Set,t._dirtyElements.clear(),Uo(t);return}finally{jt=o,An=a,zt=u,t._updating=c,du=0}t._dirtyType!==0||QR(l,t)?l._flushSync?(l._flushSync=!1,Uo(t)):s&&TR(()=>{Uo(t)}):(l._flushSync=!1,s&&(r.clear(),t._deferred=[],t._pendingEditorState=null))}function Hn(t,e,n){t._updating?t._updates.push([e,n]):SE(t,e,n)}class EE extends Uu{constructor(e){super(e)}decorate(){K(47)}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function tt(t){return t instanceof EE}class dl extends Uu{constructor(e){super(e),this.__last=this.__first=null,this.__indent=this.__format=this.__size=0,this.__dir=null}getFormat(){return this.getLatest().__format}getFormatType(){let e=this.getFormat();return SR[e]||""}getIndent(){return this.getLatest().__indent}getChildren(){let e=[],n=this.getFirstChild();for(;n!==null;)e.push(n),n=n.getNextSibling();return e}getChildrenKeys(){let e=[],n=this.getFirstChild();for(;n!==null;)e.push(n.__key),n=n.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){let e=pt()._dirtyElements;return e!==null&&e.has(this.__key)}isLastChild(){let e=this.getLatest(),n=this.getParentOrThrow().getLastChild();return n!==null&&n.is(e)}getAllTextNodes(){let e=[],n=this.getFirstChild();for(;n!==null;){if(Q(n)&&e.push(n),B(n)){let r=n.getAllTextNodes();e.push(...r)}n=n.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;e!==null;){if(B(e)){let n=e.getFirstChild();if(n!==null){e=n;continue}}break}return e}getLastDescendant(){let e=this.getLastChild();for(;e!==null;){if(B(e)){let n=e.getLastChild();if(n!==null){e=n;continue}}break}return e}getDescendantByIndex(e){let n=this.getChildren(),r=n.length;return e>=r?(e=n[r-1],B(e)&&e.getLastDescendant()||e||null):(e=n[e],B(e)&&e.getFirstDescendant()||e||null)}getFirstChild(){let e=this.getLatest().__first;return e===null?null:It(e)}getFirstChildOrThrow(){let e=this.getFirstChild();return e===null&&K(45,this.__key),e}getLastChild(){let e=this.getLatest().__last;return e===null?null:It(e)}getLastChildOrThrow(){let e=this.getLastChild();return e===null&&K(96,this.__key),e}getChildAtIndex(e){var n=this.getChildrenSize();let r;if(e<n/2){for(r=this.getFirstChild(),n=0;r!==null&&n<=e;){if(n===e)return r;r=r.getNextSibling(),n++}return null}for(r=this.getLastChild(),--n;r!==null&&n>=e;){if(n===e)return r;r=r.getPreviousSibling(),n--}return null}getTextContent(){let e="",n=this.getChildren(),r=n.length;for(let i=0;i<r;i++){let o=n[i];e+=o.getTextContent(),B(o)&&i!==r-1&&!o.isInline()&&(e+=`
|
|
70
70
|
|
|
71
|
-
`)}return e}getTextContentSize(){let e=0,n=this.getChildren(),r=n.length;for(let i=0;i<r;i++){let o=n[i];e+=o.getTextContentSize(),B(o)&&i!==r-1&&!o.isInline()&&(e+=2)}return e}getDirection(){return this.getLatest().__dir}hasFormat(e){return e!==""?(e=M0[e],(this.getFormat()&e)!==0):!1}select(e,n){hn();let r=rt(),i=e,o=n;var l=this.getChildrenSize();if(!this.canBeEmpty()){if(e===0&&n===0){if(e=this.getFirstChild(),Q(e)||B(e))return e.select(0,0)}else if(!(e!==void 0&&e!==l||n!==void 0&&n!==l)&&(e=this.getLastChild(),Q(e)||B(e)))return e.select()}if(i===void 0&&(i=l),o===void 0&&(o=l),l=this.__key,ge(r))r.anchor.set(l,i,"element"),r.focus.set(l,o,"element"),r.dirty=!0;else return xE(l,i,l,o,"element","element");return r}selectStart(){let e=this.getFirstDescendant();return B(e)||Q(e)?e.select(0,0):e!==null?e.selectPrevious():this.select(0,0)}selectEnd(){let e=this.getLastDescendant();return B(e)||Q(e)?e.select():e!==null?e.selectNext():this.select()}clear(){let e=this.getWritable();return this.getChildren().forEach(n=>n.remove()),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){let n=this.getWritable();return n.__dir=e,n}setFormat(e){return this.getWritable().__format=e!==""?M0[e]:0,this}setIndent(e){return this.getWritable().__indent=e,this}splice(e,n,r){let i=r.length,o=this.getChildrenSize(),l=this.getWritable(),s=l.__key;var a=[],u=[];let c=this.getChildAtIndex(e+n),d=null,f=o-n+i;if(e!==0)if(e===o)d=this.getLastChild();else{var h=this.getChildAtIndex(e);h!==null&&(d=h.getPreviousSibling())}if(0<n){var g=d===null?this.getFirstChild():d.getNextSibling();for(h=0;h<n;h++){g===null&&K(100);var m=g.getNextSibling(),w=g.__key;g=g.getWritable(),Bo(g),u.push(w),g=m}}for(h=d,m=0;m<i;m++){w=r[m],h!==null&&w.is(h)&&(d=h=h.getPreviousSibling()),g=w.getWritable(),g.__parent===s&&f--,Bo(g);let v=w.__key;h===null?(l.__first=v,g.__prev=null):(h=h.getWritable(),h.__next=v,g.__prev=h.__key),w.__key===s&&K(76),g.__parent=s,a.push(v),h=w}if(e+n===o?h!==null&&(h.getWritable().__next=null,l.__last=h.__key):c!==null&&(e=c.getWritable(),h!==null?(n=h.getWritable(),e.__prev=h.__key,n.__next=c.__key):e.__prev=null),l.__size=f,u.length&&(e=rt(),ge(e))){u=new Set(u),a=new Set(a);let{anchor:v,focus:y}=e;rx(v,u,a)&&Ad(v,v.getNode(),this,d,c),rx(y,u,a)&&Ad(y,y.getNode(),this,d,c),f!==0||this.canBeEmpty()||_r(this)||this.remove()}return l}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"element",version:1}}insertNewAfter(){return null}canIndent(){return!0}collapseAtStart(){return!1}excludeFromCopy(){return!1}canExtractContents(){return!0}canReplaceWith(){return!0}canInsertAfter(){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(){return!1}extractWithChild(){return!1}}function B(t){return t instanceof dl}function rx(t,e,n){for(t=t.getNode();t;){let r=t.__key;if(e.has(r)&&!n.has(r))return!0;t=t.getParent()}return!1}class Ps extends dl{static getType(){return"root"}static clone(){return new Ps}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){K(51)}getTextContent(){let e=this.__cachedText;return!Os()&&pt()._dirtyType!==0||e===null?super.getTextContent():e}remove(){K(52)}replace(){K(53)}insertBefore(){K(54)}insertAfter(){K(55)}updateDOM(){return!1}append(...e){for(let n=0;n<e.length;n++){let r=e[n];B(r)||tt(r)||K(56)}return super.append(...e)}static importJSON(e){let n=Xr();return n.setFormat(e.format),n.setIndent(e.indent),n.setDirection(e.direction),n}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"root",version:1}}collapseAtStart(){return!0}}function mn(t){return t instanceof Ps}function QR(t,e){if(e=e.getEditorState()._selection,t=t._selection,t!==null){if(t.dirty||!t.is(e))return!0}else if(e!==null)return!0;return!1}function vv(){return new Lf(new Map([["root",new Ps]]))}function CE(t){let e=t.exportJSON();var n=t.constructor;e.type!==n.getType()&&K(130,n.name);let r=e.children;if(B(t))for(Array.isArray(r)||K(59,n.name),t=t.getChildren(),n=0;n<t.length;n++){let i=CE(t[n]);r.push(i)}return e}class Lf{constructor(e,n){this._nodeMap=e,this._selection=n||null,this._readOnly=this._flushSync=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(e){return tx(this,e)}clone(e){return e=new Lf(this._nodeMap,e===void 0?this._selection:e),e._readOnly=!0,e}toJSON(){return tx(this,()=>({root:CE(Xr())}))}}class As extends dl{static getType(){return"paragraph"}static clone(e){return new As(e.__key)}createDOM(e){let n=document.createElement("p");return e=Ra(e.theme,"paragraph"),e!==void 0&&n.classList.add(...e),n}updateDOM(){return!1}static importDOM(){return{p:()=>({conversion:qR,priority:0})}}exportDOM(e){if({element:e}=super.exportDOM(e),e&&Rf(e)){this.isEmpty()&&e.append(document.createElement("br"));var n=this.getFormatType();e.style.textAlign=n,(n=this.getDirection())&&(e.dir=n),n=this.getIndent(),0<n&&(e.style.textIndent=`${20*n}px`)}return{element:e}}static importJSON(e){let n=Jo();return n.setFormat(e.format),n.setIndent(e.indent),n.setDirection(e.direction),n}exportJSON(){return{...super.exportJSON(),type:"paragraph",version:1}}insertNewAfter(e,n){e=Jo();let r=this.getDirection();return e.setDirection(r),this.insertAfter(e,n),e}collapseAtStart(){let e=this.getChildren();if(e.length===0||Q(e[0])&&e[0].getTextContent().trim()===""){if(this.getNextSibling()!==null)return this.selectNext(),this.remove(),!0;if(this.getPreviousSibling()!==null)return this.selectPrevious(),this.remove(),!0}return!1}}function qR(t){let e=Jo();return t.style&&(e.setFormat(t.style.textAlign),t=parseInt(t.style.textIndent,10)/20,0<t&&e.setIndent(t)),{node:e}}function Jo(){return Bu(new As)}function kE(t,e,n,r){let i=t._keyToDOMMap;i.clear(),t._editorState=vv(),t._pendingEditorState=r,t._compositionKey=null,t._dirtyType=0,t._cloneNotNeeded.clear(),t._dirtyLeaves=new Set,t._dirtyElements.clear(),t._normalizedNodes=new Set,t._updateTags=new Set,t._updates=[],t._blockCursorElement=null,r=t._observer,r!==null&&(r.disconnect(),t._observer=null),e!==null&&(e.textContent=""),n!==null&&(n.textContent="",i.set("root",n))}function eO(t){let e=new Map,n=new Set;return t.forEach(r=>{if(r=r.klass.importDOM!=null?r.klass.importDOM.bind(r.klass):null,r!=null&&!n.has(r)){n.add(r);var i=r();i!==null&&Object.keys(i).forEach(o=>{let l=e.get(o);l===void 0&&(l=[],e.set(o,l)),l.push(i[o])})}}),e}class tO{constructor(e,n,r,i,o,l,s){this._parentEditor=n,this._rootElement=null,this._editorState=e,this._compositionKey=this._pendingEditorState=null,this._deferred=[],this._keyToDOMMap=new Map,this._updates=[],this._updating=!1,this._listeners={decorator:new Set,editable:new Set,mutation:new Map,root:new Set,textcontent:new Set,update:new Set},this._commands=new Map,this._config=i,this._nodes=r,this._decorators={},this._pendingDecorators=null,this._dirtyType=0,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=QS(),this._onError=o,this._htmlConversions=l,this._editable=s,this._headless=n!==null&&n._headless,this._blockCursorElement=this._window=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(e){let n=this._listeners.update;return n.add(e),()=>{n.delete(e)}}registerEditableListener(e){let n=this._listeners.editable;return n.add(e),()=>{n.delete(e)}}registerDecoratorListener(e){let n=this._listeners.decorator;return n.add(e),()=>{n.delete(e)}}registerTextContentListener(e){let n=this._listeners.textcontent;return n.add(e),()=>{n.delete(e)}}registerRootListener(e){let n=this._listeners.root;return e(this._rootElement,null),n.add(e),()=>{e(null,this._rootElement),n.delete(e)}}registerCommand(e,n,r){r===void 0&&K(35);let i=this._commands;i.has(e)||i.set(e,[new Set,new Set,new Set,new Set,new Set]);let o=i.get(e);o===void 0&&K(36,String(e));let l=o[r];return l.add(n),()=>{l.delete(n),o.every(s=>s.size===0)&&i.delete(e)}}registerMutationListener(e,n){this._nodes.get(e.getType())===void 0&&K(37,e.name);let r=this._listeners.mutation;return r.set(n,e),()=>{r.delete(n)}}registerNodeTransformToKlass(e,n){var r=e.getType();return r=this._nodes.get(r),r===void 0&&K(37,e.name),r.transforms.add(n),r}registerNodeTransform(e,n){var r=this.registerNodeTransformToKlass(e,n);let i=[r];return r=r.replaceWithKlass,r!=null&&(r=this.registerNodeTransformToKlass(r,n),i.push(r)),NR(this,e.getType()),()=>{i.forEach(o=>o.transforms.delete(n))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,n){return X(this,e,n)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){let n=this._rootElement;if(e!==n){let l=Ra(this._config.theme,"root");var r=this._pendingEditorState||this._editorState;if(this._rootElement=e,kE(this,n,e,r),n!==null){if(!this._config.disableEvents){Oa!==0&&(Oa--,Oa===0&&n.ownerDocument.removeEventListener("selectionchange",gE));var i=n.__lexicalEditor;if(i!=null){if(i._parentEditor!==null){var o=uv(i);o=o[o.length-1]._key,ql.get(o)===i&&ql.delete(o)}else ql.delete(i._key);n.__lexicalEditor=null}for(i=mE(n),o=0;o<i.length;o++)i[o]();n.__lexicalEventHandles=[]}l!=null&&n.classList.remove(...l)}e!==null?(r=(r=e.ownerDocument)&&r.defaultView||null,i=e.style,i.userSelect="text",i.whiteSpace="pre-wrap",i.wordBreak="break-word",e.setAttribute("data-lexical-editor","true"),this._window=r,this._dirtyType=2,VS(this),this._updateTags.add("history-merge"),Uo(this),this._config.disableEvents||BR(e,this),l!=null&&e.classList.add(...l)):(this._editorState=r,this._window=this._pendingEditorState=null),Aa("root",this,!1,e,n)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,n){e.isEmpty()&&K(38),WS(this);let r=this._pendingEditorState,i=this._updateTags;n=n!==void 0?n.tag:null,r===null||r.isEmpty()||(n!=null&&i.add(n),Uo(this)),this._pendingEditorState=e,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,n!=null&&i.add(n),Uo(this)}parseEditorState(e,n){e=typeof e=="string"?JSON.parse(e):e;let r=vv(),i=jt,o=An,l=zt,s=this._dirtyElements,a=this._dirtyLeaves,u=this._cloneNotNeeded,c=this._dirtyType;this._dirtyElements=new Map,this._dirtyLeaves=new Set,this._cloneNotNeeded=new Set,this._dirtyType=0,jt=r,An=!1,zt=this;try{gv(e.root,this._nodes),n&&n(),r._readOnly=!0}catch(d){d instanceof Error&&this._onError(d)}finally{this._dirtyElements=s,this._dirtyLeaves=a,this._cloneNotNeeded=u,this._dirtyType=c,jt=i,An=o,zt=l}return r}update(e,n){Hn(this,e,n)}focus(e,n={}){let r=this._rootElement;r!==null&&(r.setAttribute("autocapitalize","off"),Hn(this,()=>{let i=rt(),o=Xr();i!==null?i.dirty=!0:o.getChildrenSize()!==0&&(n.defaultSelection==="rootStart"?o.selectStart():o.selectEnd())},{onUpdate:()=>{r.removeAttribute("autocapitalize"),e&&e()},tag:"focus"}),this._pendingEditorState===null&&r.removeAttribute("autocapitalize"))}blur(){var e=this._rootElement;e!==null&&e.blur(),e=Jr(this._window),e!==null&&e.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,Aa("editable",this,!0,e))}toJSON(){return{editorState:this._editorState.toJSON()}}}class yv extends dl{constructor(e,n){super(n),this.__colSpan=e,this.__rowSpan=1}exportJSON(){return{...super.exportJSON(),colSpan:this.__colSpan,rowSpan:this.__rowSpan}}getColSpan(){return this.__colSpan}setColSpan(e){return this.getWritable().__colSpan=e,this}getRowSpan(){return this.__rowSpan}setRowSpan(e){return this.getWritable().__rowSpan=e,this}}function er(t){return t instanceof yv}class bE extends dl{}function xv(t){return t instanceof bE}class $E extends dl{}function fu(t){return t instanceof $E}D.$addUpdateTag=function(t){hn(),pt()._updateTags.add(t)};D.$applyNodeReplacement=Bu;D.$copyNode=tE;D.$createLineBreakNode=ps;D.$createNodeSelection=_m;D.$createParagraphNode=Jo;D.$createRangeSelection=function(){let t=new Hr("root",0,"element"),e=new Hr("root",0,"element");return new cl(t,e,0,"")};D.$createTabNode=Pf;D.$createTextNode=Lt;D.$getAdjacentNode=om;D.$getNearestNodeFromDOMNode=Fu;D.$getNearestRootOrShadowRoot=eE;D.$getNodeByKey=It;D.$getPreviousSelection=Rs;D.$getRoot=Xr;D.$getSelection=rt;D.$getTextContent=function(){let t=rt();return t===null?"":t.getTextContent()};D.$hasAncestor=Nd;D.$hasUpdateTag=function(t){return pt()._updateTags.has(t)};D.$insertNodes=function(t,e){let n=rt()||Rs();return n===null&&(n=Xr().selectEnd()),n.insertNodes(t,e)};D.$isBlockElementNode=xm;D.$isDecoratorNode=tt;D.$isElementNode=B;D.$isInlineElementOrDecoratorNode=function(t){return B(t)&&t.isInline()||tt(t)&&t.isInline()};D.$isLeafNode=ZS;D.$isLineBreakNode=cu;D.$isNodeSelection=Ns;D.$isParagraphNode=function(t){return t instanceof As};D.$isRangeSelection=ge;D.$isRootNode=mn;D.$isRootOrShadowRoot=_r;D.$isTabNode=function(t){return t instanceof Ts};D.$isTextNode=Q;D.$nodesOfType=function(t){var e=Qr();let n=e._readOnly,r=t.getType();e=e._nodeMap;let i=[];for(let[,o]of e)o instanceof t&&o.__type===r&&(n||o.isAttached())&&i.push(o);return i};D.$normalizeSelection__EXPERIMENTAL=lv;D.$parseSerializedNode=function(t){return gv(t,pt()._nodes)};D.$selectAll=function(){var t=Xr();t=t.select(0,t.getChildrenSize()),Vr(lv(t))};D.$setCompositionKey=Kt;D.$setSelection=Vr;D.$splitNode=nE;D.BLUR_COMMAND=FS;D.CAN_REDO_COMMAND={};D.CAN_UNDO_COMMAND={};D.CLEAR_EDITOR_COMMAND={};D.CLEAR_HISTORY_COMMAND={};D.CLICK_COMMAND=SS;D.COMMAND_PRIORITY_CRITICAL=4;D.COMMAND_PRIORITY_EDITOR=0;D.COMMAND_PRIORITY_HIGH=3;D.COMMAND_PRIORITY_LOW=1;D.COMMAND_PRIORITY_NORMAL=2;D.CONTROLLED_TEXT_INSERTION_COMMAND=Ql;D.COPY_COMMAND=tv;D.CUT_COMMAND=nv;D.DELETE_CHARACTER_COMMAND=iu;D.DELETE_LINE_COMMAND=lu;D.DELETE_WORD_COMMAND=ou;D.DEPRECATED_$computeGridMap=_E;D.DEPRECATED_$createGridSelection=function(){let t=new Hr("root",0,"element"),e=new Hr("root",0,"element");return new Mf("root",t,e)};D.DEPRECATED_$getGridCellNodeRect=ym;D.DEPRECATED_$getNodeTriplet=wE;D.DEPRECATED_$isGridCellNode=er;D.DEPRECATED_$isGridNode=xv;D.DEPRECATED_$isGridRowNode=fu;D.DEPRECATED_$isGridSelection=pv;D.DEPRECATED_GridCellNode=yv;D.DEPRECATED_GridNode=bE;D.DEPRECATED_GridRowNode=$E;D.DRAGEND_COMMAND=jS;D.DRAGOVER_COMMAND=IS;D.DRAGSTART_COMMAND=DS;D.DROP_COMMAND=LS;D.DecoratorNode=EE;D.ElementNode=dl;D.FOCUS_COMMAND=zS;D.FORMAT_ELEMENT_COMMAND={};D.FORMAT_TEXT_COMMAND=Ki;D.INDENT_CONTENT_COMMAND={};D.INSERT_LINE_BREAK_COMMAND=Na;D.INSERT_PARAGRAPH_COMMAND=em;D.INSERT_TAB_COMMAND={};D.KEY_ARROW_DOWN_COMMAND=NS;D.KEY_ARROW_LEFT_COMMAND=bS;D.KEY_ARROW_RIGHT_COMMAND=CS;D.KEY_ARROW_UP_COMMAND=TS;D.KEY_BACKSPACE_COMMAND=OS;D.KEY_DELETE_COMMAND=AS;D.KEY_DOWN_COMMAND=ES;D.KEY_ENTER_COMMAND=Ed;D.KEY_ESCAPE_COMMAND=PS;D.KEY_MODIFIER_COMMAND=BS;D.KEY_SPACE_COMMAND=RS;D.KEY_TAB_COMMAND=MS;D.LineBreakNode=$s;D.MOVE_TO_END=kS;D.MOVE_TO_START=$S;D.OUTDENT_CONTENT_COMMAND={};D.PASTE_COMMAND=Qg;D.ParagraphNode=As;D.REDO_COMMAND=ev;D.REMOVE_TEXT_COMMAND=tm;D.RootNode=Ps;D.SELECTION_CHANGE_COMMAND=kf;D.SELECT_ALL_COMMAND=nm;D.TabNode=Ts;D.TextNode=ul;D.UNDO_COMMAND=qg;D.createCommand=function(){return{}};D.createEditor=function(t){var e=t||{},n=zt,r=e.theme||{};let i=t===void 0?n:e.parentEditor||null,o=e.disableEvents||!1,l=vv(),s=e.namespace||(i!==null?i._config.namespace:QS()),a=e.editorState,u=[Ps,ul,$s,Ts,As,...e.nodes||[]],c=e.onError;if(e=e.editable!==void 0?e.editable:!0,t===void 0&&n!==null)t=n._nodes;else for(t=new Map,n=0;n<u.length;n++){let f=u[n],h=null;var d=null;typeof f!="function"&&(d=f,f=d.replace,h=d.with,d=d.withKlass?d.withKlass:null);let g=f.getType(),m=f.transform(),w=new Set;m!==null&&w.add(m),t.set(g,{klass:f,replace:h,replaceWithKlass:d,transforms:w})}return r=new tO(l,i,t,{disableEvents:o,namespace:s,theme:r},c||console.error,eO(t),e),a!==void 0&&(r._pendingEditorState=a,r._dirtyType=2),r};D.getNearestEditorFromDOMNode=av;D.isHTMLAnchorElement=function(t){return Rf(t)&&t.tagName==="A"};D.isHTMLElement=Rf;D.isSelectionCapturedInDecoratorInput=sv;D.isSelectionWithinEditor=zu;const nO=D;var _e=nO;function _v(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let fl=_v();function TE(t){fl=t}const NE=/[&<>"']/,rO=new RegExp(NE.source,"g"),RE=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,iO=new RegExp(RE.source,"g"),oO={"&":"&","<":"<",">":">",'"':""","'":"'"},ix=t=>oO[t];function In(t,e){if(e){if(NE.test(t))return t.replace(rO,ix)}else if(RE.test(t))return t.replace(iO,ix);return t}const lO=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function sO(t){return t.replace(lO,(e,n)=>(n=n.toLowerCase(),n==="colon"?":":n.charAt(0)==="#"?n.charAt(1)==="x"?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1)):""))}const aO=/(^|[^\[])\^/g;function Be(t,e){t=typeof t=="string"?t:t.source,e=e||"";const n={replace:(r,i)=>(i=typeof i=="object"&&"source"in i?i.source:i,i=i.replace(aO,"$1"),t=t.replace(r,i),n),getRegex:()=>new RegExp(t,e)};return n}function ox(t){try{t=encodeURI(t).replace(/%25/g,"%")}catch{return null}return t}const Md={exec:()=>null};function lx(t,e){const n=t.replace(/\|/g,(o,l,s)=>{let a=!1,u=l;for(;--u>=0&&s[u]==="\\";)a=!a;return a?"|":" |"}),r=n.split(/ \|/);let i=0;if(r[0].trim()||r.shift(),r.length>0&&!r[r.length-1].trim()&&r.pop(),e)if(r.length>e)r.splice(e);else for(;r.length<e;)r.push("");for(;i<r.length;i++)r[i]=r[i].trim().replace(/\\\|/g,"|");return r}function yc(t,e,n){const r=t.length;if(r===0)return"";let i=0;for(;i<r;){const o=t.charAt(r-i-1);if(o===e&&!n)i++;else if(o!==e&&n)i++;else break}return t.slice(0,r-i)}function uO(t,e){if(t.indexOf(e[1])===-1)return-1;let n=0;for(let r=0;r<t.length;r++)if(t[r]==="\\")r++;else if(t[r]===e[0])n++;else if(t[r]===e[1]&&(n--,n<0))return r;return-1}function sx(t,e,n,r){const i=e.href,o=e.title?In(e.title):null,l=t[1].replace(/\\([\[\]])/g,"$1");if(t[0].charAt(0)!=="!"){r.state.inLink=!0;const s={type:"link",raw:n,href:i,title:o,text:l,tokens:r.inlineTokens(l)};return r.state.inLink=!1,s}return{type:"image",raw:n,href:i,title:o,text:In(l)}}function cO(t,e){const n=t.match(/^(\s+)(?:```)/);if(n===null)return e;const r=n[1];return e.split(`
|
|
71
|
+
`)}return e}getTextContentSize(){let e=0,n=this.getChildren(),r=n.length;for(let i=0;i<r;i++){let o=n[i];e+=o.getTextContentSize(),B(o)&&i!==r-1&&!o.isInline()&&(e+=2)}return e}getDirection(){return this.getLatest().__dir}hasFormat(e){return e!==""?(e=M0[e],(this.getFormat()&e)!==0):!1}select(e,n){hn();let r=rt(),i=e,o=n;var l=this.getChildrenSize();if(!this.canBeEmpty()){if(e===0&&n===0){if(e=this.getFirstChild(),Q(e)||B(e))return e.select(0,0)}else if(!(e!==void 0&&e!==l||n!==void 0&&n!==l)&&(e=this.getLastChild(),Q(e)||B(e)))return e.select()}if(i===void 0&&(i=l),o===void 0&&(o=l),l=this.__key,ge(r))r.anchor.set(l,i,"element"),r.focus.set(l,o,"element"),r.dirty=!0;else return xE(l,i,l,o,"element","element");return r}selectStart(){let e=this.getFirstDescendant();return B(e)||Q(e)?e.select(0,0):e!==null?e.selectPrevious():this.select(0,0)}selectEnd(){let e=this.getLastDescendant();return B(e)||Q(e)?e.select():e!==null?e.selectNext():this.select()}clear(){let e=this.getWritable();return this.getChildren().forEach(n=>n.remove()),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){let n=this.getWritable();return n.__dir=e,n}setFormat(e){return this.getWritable().__format=e!==""?M0[e]:0,this}setIndent(e){return this.getWritable().__indent=e,this}splice(e,n,r){let i=r.length,o=this.getChildrenSize(),l=this.getWritable(),s=l.__key;var a=[],u=[];let c=this.getChildAtIndex(e+n),d=null,f=o-n+i;if(e!==0)if(e===o)d=this.getLastChild();else{var h=this.getChildAtIndex(e);h!==null&&(d=h.getPreviousSibling())}if(0<n){var g=d===null?this.getFirstChild():d.getNextSibling();for(h=0;h<n;h++){g===null&&K(100);var m=g.getNextSibling(),w=g.__key;g=g.getWritable(),Bo(g),u.push(w),g=m}}for(h=d,m=0;m<i;m++){w=r[m],h!==null&&w.is(h)&&(d=h=h.getPreviousSibling()),g=w.getWritable(),g.__parent===s&&f--,Bo(g);let v=w.__key;h===null?(l.__first=v,g.__prev=null):(h=h.getWritable(),h.__next=v,g.__prev=h.__key),w.__key===s&&K(76),g.__parent=s,a.push(v),h=w}if(e+n===o?h!==null&&(h.getWritable().__next=null,l.__last=h.__key):c!==null&&(e=c.getWritable(),h!==null?(n=h.getWritable(),e.__prev=h.__key,n.__next=c.__key):e.__prev=null),l.__size=f,u.length&&(e=rt(),ge(e))){u=new Set(u),a=new Set(a);let{anchor:v,focus:y}=e;rx(v,u,a)&&Ad(v,v.getNode(),this,d,c),rx(y,u,a)&&Ad(y,y.getNode(),this,d,c),f!==0||this.canBeEmpty()||_r(this)||this.remove()}return l}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"element",version:1}}insertNewAfter(){return null}canIndent(){return!0}collapseAtStart(){return!1}excludeFromCopy(){return!1}canExtractContents(){return!0}canReplaceWith(){return!0}canInsertAfter(){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(){return!1}extractWithChild(){return!1}}function B(t){return t instanceof dl}function rx(t,e,n){for(t=t.getNode();t;){let r=t.__key;if(e.has(r)&&!n.has(r))return!0;t=t.getParent()}return!1}class As extends dl{static getType(){return"root"}static clone(){return new As}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){K(51)}getTextContent(){let e=this.__cachedText;return!Ps()&&pt()._dirtyType!==0||e===null?super.getTextContent():e}remove(){K(52)}replace(){K(53)}insertBefore(){K(54)}insertAfter(){K(55)}updateDOM(){return!1}append(...e){for(let n=0;n<e.length;n++){let r=e[n];B(r)||tt(r)||K(56)}return super.append(...e)}static importJSON(e){let n=Xr();return n.setFormat(e.format),n.setIndent(e.indent),n.setDirection(e.direction),n}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"root",version:1}}collapseAtStart(){return!0}}function mn(t){return t instanceof As}function QR(t,e){if(e=e.getEditorState()._selection,t=t._selection,t!==null){if(t.dirty||!t.is(e))return!0}else if(e!==null)return!0;return!1}function vv(){return new Lf(new Map([["root",new As]]))}function CE(t){let e=t.exportJSON();var n=t.constructor;e.type!==n.getType()&&K(130,n.name);let r=e.children;if(B(t))for(Array.isArray(r)||K(59,n.name),t=t.getChildren(),n=0;n<t.length;n++){let i=CE(t[n]);r.push(i)}return e}class Lf{constructor(e,n){this._nodeMap=e,this._selection=n||null,this._readOnly=this._flushSync=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(e){return tx(this,e)}clone(e){return e=new Lf(this._nodeMap,e===void 0?this._selection:e),e._readOnly=!0,e}toJSON(){return tx(this,()=>({root:CE(Xr())}))}}class Ms extends dl{static getType(){return"paragraph"}static clone(e){return new Ms(e.__key)}createDOM(e){let n=document.createElement("p");return e=Ra(e.theme,"paragraph"),e!==void 0&&n.classList.add(...e),n}updateDOM(){return!1}static importDOM(){return{p:()=>({conversion:qR,priority:0})}}exportDOM(e){if({element:e}=super.exportDOM(e),e&&Rf(e)){this.isEmpty()&&e.append(document.createElement("br"));var n=this.getFormatType();e.style.textAlign=n,(n=this.getDirection())&&(e.dir=n),n=this.getIndent(),0<n&&(e.style.textIndent=`${20*n}px`)}return{element:e}}static importJSON(e){let n=Jo();return n.setFormat(e.format),n.setIndent(e.indent),n.setDirection(e.direction),n}exportJSON(){return{...super.exportJSON(),type:"paragraph",version:1}}insertNewAfter(e,n){e=Jo();let r=this.getDirection();return e.setDirection(r),this.insertAfter(e,n),e}collapseAtStart(){let e=this.getChildren();if(e.length===0||Q(e[0])&&e[0].getTextContent().trim()===""){if(this.getNextSibling()!==null)return this.selectNext(),this.remove(),!0;if(this.getPreviousSibling()!==null)return this.selectPrevious(),this.remove(),!0}return!1}}function qR(t){let e=Jo();return t.style&&(e.setFormat(t.style.textAlign),t=parseInt(t.style.textIndent,10)/20,0<t&&e.setIndent(t)),{node:e}}function Jo(){return Bu(new Ms)}function kE(t,e,n,r){let i=t._keyToDOMMap;i.clear(),t._editorState=vv(),t._pendingEditorState=r,t._compositionKey=null,t._dirtyType=0,t._cloneNotNeeded.clear(),t._dirtyLeaves=new Set,t._dirtyElements.clear(),t._normalizedNodes=new Set,t._updateTags=new Set,t._updates=[],t._blockCursorElement=null,r=t._observer,r!==null&&(r.disconnect(),t._observer=null),e!==null&&(e.textContent=""),n!==null&&(n.textContent="",i.set("root",n))}function eO(t){let e=new Map,n=new Set;return t.forEach(r=>{if(r=r.klass.importDOM!=null?r.klass.importDOM.bind(r.klass):null,r!=null&&!n.has(r)){n.add(r);var i=r();i!==null&&Object.keys(i).forEach(o=>{let l=e.get(o);l===void 0&&(l=[],e.set(o,l)),l.push(i[o])})}}),e}class tO{constructor(e,n,r,i,o,l,s){this._parentEditor=n,this._rootElement=null,this._editorState=e,this._compositionKey=this._pendingEditorState=null,this._deferred=[],this._keyToDOMMap=new Map,this._updates=[],this._updating=!1,this._listeners={decorator:new Set,editable:new Set,mutation:new Map,root:new Set,textcontent:new Set,update:new Set},this._commands=new Map,this._config=i,this._nodes=r,this._decorators={},this._pendingDecorators=null,this._dirtyType=0,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=QS(),this._onError=o,this._htmlConversions=l,this._editable=s,this._headless=n!==null&&n._headless,this._blockCursorElement=this._window=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(e){let n=this._listeners.update;return n.add(e),()=>{n.delete(e)}}registerEditableListener(e){let n=this._listeners.editable;return n.add(e),()=>{n.delete(e)}}registerDecoratorListener(e){let n=this._listeners.decorator;return n.add(e),()=>{n.delete(e)}}registerTextContentListener(e){let n=this._listeners.textcontent;return n.add(e),()=>{n.delete(e)}}registerRootListener(e){let n=this._listeners.root;return e(this._rootElement,null),n.add(e),()=>{e(null,this._rootElement),n.delete(e)}}registerCommand(e,n,r){r===void 0&&K(35);let i=this._commands;i.has(e)||i.set(e,[new Set,new Set,new Set,new Set,new Set]);let o=i.get(e);o===void 0&&K(36,String(e));let l=o[r];return l.add(n),()=>{l.delete(n),o.every(s=>s.size===0)&&i.delete(e)}}registerMutationListener(e,n){this._nodes.get(e.getType())===void 0&&K(37,e.name);let r=this._listeners.mutation;return r.set(n,e),()=>{r.delete(n)}}registerNodeTransformToKlass(e,n){var r=e.getType();return r=this._nodes.get(r),r===void 0&&K(37,e.name),r.transforms.add(n),r}registerNodeTransform(e,n){var r=this.registerNodeTransformToKlass(e,n);let i=[r];return r=r.replaceWithKlass,r!=null&&(r=this.registerNodeTransformToKlass(r,n),i.push(r)),NR(this,e.getType()),()=>{i.forEach(o=>o.transforms.delete(n))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,n){return X(this,e,n)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){let n=this._rootElement;if(e!==n){let l=Ra(this._config.theme,"root");var r=this._pendingEditorState||this._editorState;if(this._rootElement=e,kE(this,n,e,r),n!==null){if(!this._config.disableEvents){Oa!==0&&(Oa--,Oa===0&&n.ownerDocument.removeEventListener("selectionchange",gE));var i=n.__lexicalEditor;if(i!=null){if(i._parentEditor!==null){var o=uv(i);o=o[o.length-1]._key,es.get(o)===i&&es.delete(o)}else es.delete(i._key);n.__lexicalEditor=null}for(i=mE(n),o=0;o<i.length;o++)i[o]();n.__lexicalEventHandles=[]}l!=null&&n.classList.remove(...l)}e!==null?(r=(r=e.ownerDocument)&&r.defaultView||null,i=e.style,i.userSelect="text",i.whiteSpace="pre-wrap",i.wordBreak="break-word",e.setAttribute("data-lexical-editor","true"),this._window=r,this._dirtyType=2,VS(this),this._updateTags.add("history-merge"),Uo(this),this._config.disableEvents||BR(e,this),l!=null&&e.classList.add(...l)):(this._editorState=r,this._window=this._pendingEditorState=null),Aa("root",this,!1,e,n)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,n){e.isEmpty()&&K(38),WS(this);let r=this._pendingEditorState,i=this._updateTags;n=n!==void 0?n.tag:null,r===null||r.isEmpty()||(n!=null&&i.add(n),Uo(this)),this._pendingEditorState=e,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,n!=null&&i.add(n),Uo(this)}parseEditorState(e,n){e=typeof e=="string"?JSON.parse(e):e;let r=vv(),i=jt,o=An,l=zt,s=this._dirtyElements,a=this._dirtyLeaves,u=this._cloneNotNeeded,c=this._dirtyType;this._dirtyElements=new Map,this._dirtyLeaves=new Set,this._cloneNotNeeded=new Set,this._dirtyType=0,jt=r,An=!1,zt=this;try{gv(e.root,this._nodes),n&&n(),r._readOnly=!0}catch(d){d instanceof Error&&this._onError(d)}finally{this._dirtyElements=s,this._dirtyLeaves=a,this._cloneNotNeeded=u,this._dirtyType=c,jt=i,An=o,zt=l}return r}update(e,n){Hn(this,e,n)}focus(e,n={}){let r=this._rootElement;r!==null&&(r.setAttribute("autocapitalize","off"),Hn(this,()=>{let i=rt(),o=Xr();i!==null?i.dirty=!0:o.getChildrenSize()!==0&&(n.defaultSelection==="rootStart"?o.selectStart():o.selectEnd())},{onUpdate:()=>{r.removeAttribute("autocapitalize"),e&&e()},tag:"focus"}),this._pendingEditorState===null&&r.removeAttribute("autocapitalize"))}blur(){var e=this._rootElement;e!==null&&e.blur(),e=Jr(this._window),e!==null&&e.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,Aa("editable",this,!0,e))}toJSON(){return{editorState:this._editorState.toJSON()}}}class yv extends dl{constructor(e,n){super(n),this.__colSpan=e,this.__rowSpan=1}exportJSON(){return{...super.exportJSON(),colSpan:this.__colSpan,rowSpan:this.__rowSpan}}getColSpan(){return this.__colSpan}setColSpan(e){return this.getWritable().__colSpan=e,this}getRowSpan(){return this.__rowSpan}setRowSpan(e){return this.getWritable().__rowSpan=e,this}}function er(t){return t instanceof yv}class bE extends dl{}function xv(t){return t instanceof bE}class $E extends dl{}function fu(t){return t instanceof $E}D.$addUpdateTag=function(t){hn(),pt()._updateTags.add(t)};D.$applyNodeReplacement=Bu;D.$copyNode=tE;D.$createLineBreakNode=ms;D.$createNodeSelection=_m;D.$createParagraphNode=Jo;D.$createRangeSelection=function(){let t=new Hr("root",0,"element"),e=new Hr("root",0,"element");return new cl(t,e,0,"")};D.$createTabNode=Pf;D.$createTextNode=Lt;D.$getAdjacentNode=om;D.$getNearestNodeFromDOMNode=Fu;D.$getNearestRootOrShadowRoot=eE;D.$getNodeByKey=It;D.$getPreviousSelection=Os;D.$getRoot=Xr;D.$getSelection=rt;D.$getTextContent=function(){let t=rt();return t===null?"":t.getTextContent()};D.$hasAncestor=Nd;D.$hasUpdateTag=function(t){return pt()._updateTags.has(t)};D.$insertNodes=function(t,e){let n=rt()||Os();return n===null&&(n=Xr().selectEnd()),n.insertNodes(t,e)};D.$isBlockElementNode=xm;D.$isDecoratorNode=tt;D.$isElementNode=B;D.$isInlineElementOrDecoratorNode=function(t){return B(t)&&t.isInline()||tt(t)&&t.isInline()};D.$isLeafNode=ZS;D.$isLineBreakNode=cu;D.$isNodeSelection=Rs;D.$isParagraphNode=function(t){return t instanceof Ms};D.$isRangeSelection=ge;D.$isRootNode=mn;D.$isRootOrShadowRoot=_r;D.$isTabNode=function(t){return t instanceof Ns};D.$isTextNode=Q;D.$nodesOfType=function(t){var e=Qr();let n=e._readOnly,r=t.getType();e=e._nodeMap;let i=[];for(let[,o]of e)o instanceof t&&o.__type===r&&(n||o.isAttached())&&i.push(o);return i};D.$normalizeSelection__EXPERIMENTAL=lv;D.$parseSerializedNode=function(t){return gv(t,pt()._nodes)};D.$selectAll=function(){var t=Xr();t=t.select(0,t.getChildrenSize()),Vr(lv(t))};D.$setCompositionKey=Kt;D.$setSelection=Vr;D.$splitNode=nE;D.BLUR_COMMAND=FS;D.CAN_REDO_COMMAND={};D.CAN_UNDO_COMMAND={};D.CLEAR_EDITOR_COMMAND={};D.CLEAR_HISTORY_COMMAND={};D.CLICK_COMMAND=SS;D.COMMAND_PRIORITY_CRITICAL=4;D.COMMAND_PRIORITY_EDITOR=0;D.COMMAND_PRIORITY_HIGH=3;D.COMMAND_PRIORITY_LOW=1;D.COMMAND_PRIORITY_NORMAL=2;D.CONTROLLED_TEXT_INSERTION_COMMAND=ql;D.COPY_COMMAND=tv;D.CUT_COMMAND=nv;D.DELETE_CHARACTER_COMMAND=iu;D.DELETE_LINE_COMMAND=lu;D.DELETE_WORD_COMMAND=ou;D.DEPRECATED_$computeGridMap=_E;D.DEPRECATED_$createGridSelection=function(){let t=new Hr("root",0,"element"),e=new Hr("root",0,"element");return new Mf("root",t,e)};D.DEPRECATED_$getGridCellNodeRect=ym;D.DEPRECATED_$getNodeTriplet=wE;D.DEPRECATED_$isGridCellNode=er;D.DEPRECATED_$isGridNode=xv;D.DEPRECATED_$isGridRowNode=fu;D.DEPRECATED_$isGridSelection=pv;D.DEPRECATED_GridCellNode=yv;D.DEPRECATED_GridNode=bE;D.DEPRECATED_GridRowNode=$E;D.DRAGEND_COMMAND=jS;D.DRAGOVER_COMMAND=IS;D.DRAGSTART_COMMAND=DS;D.DROP_COMMAND=LS;D.DecoratorNode=EE;D.ElementNode=dl;D.FOCUS_COMMAND=zS;D.FORMAT_ELEMENT_COMMAND={};D.FORMAT_TEXT_COMMAND=Ki;D.INDENT_CONTENT_COMMAND={};D.INSERT_LINE_BREAK_COMMAND=Na;D.INSERT_PARAGRAPH_COMMAND=em;D.INSERT_TAB_COMMAND={};D.KEY_ARROW_DOWN_COMMAND=NS;D.KEY_ARROW_LEFT_COMMAND=bS;D.KEY_ARROW_RIGHT_COMMAND=CS;D.KEY_ARROW_UP_COMMAND=TS;D.KEY_BACKSPACE_COMMAND=OS;D.KEY_DELETE_COMMAND=AS;D.KEY_DOWN_COMMAND=ES;D.KEY_ENTER_COMMAND=Ed;D.KEY_ESCAPE_COMMAND=PS;D.KEY_MODIFIER_COMMAND=BS;D.KEY_SPACE_COMMAND=RS;D.KEY_TAB_COMMAND=MS;D.LineBreakNode=Ts;D.MOVE_TO_END=kS;D.MOVE_TO_START=$S;D.OUTDENT_CONTENT_COMMAND={};D.PASTE_COMMAND=Qg;D.ParagraphNode=Ms;D.REDO_COMMAND=ev;D.REMOVE_TEXT_COMMAND=tm;D.RootNode=As;D.SELECTION_CHANGE_COMMAND=kf;D.SELECT_ALL_COMMAND=nm;D.TabNode=Ns;D.TextNode=ul;D.UNDO_COMMAND=qg;D.createCommand=function(){return{}};D.createEditor=function(t){var e=t||{},n=zt,r=e.theme||{};let i=t===void 0?n:e.parentEditor||null,o=e.disableEvents||!1,l=vv(),s=e.namespace||(i!==null?i._config.namespace:QS()),a=e.editorState,u=[As,ul,Ts,Ns,Ms,...e.nodes||[]],c=e.onError;if(e=e.editable!==void 0?e.editable:!0,t===void 0&&n!==null)t=n._nodes;else for(t=new Map,n=0;n<u.length;n++){let f=u[n],h=null;var d=null;typeof f!="function"&&(d=f,f=d.replace,h=d.with,d=d.withKlass?d.withKlass:null);let g=f.getType(),m=f.transform(),w=new Set;m!==null&&w.add(m),t.set(g,{klass:f,replace:h,replaceWithKlass:d,transforms:w})}return r=new tO(l,i,t,{disableEvents:o,namespace:s,theme:r},c||console.error,eO(t),e),a!==void 0&&(r._pendingEditorState=a,r._dirtyType=2),r};D.getNearestEditorFromDOMNode=av;D.isHTMLAnchorElement=function(t){return Rf(t)&&t.tagName==="A"};D.isHTMLElement=Rf;D.isSelectionCapturedInDecoratorInput=sv;D.isSelectionWithinEditor=zu;const nO=D;var _e=nO;function _v(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let fl=_v();function TE(t){fl=t}const NE=/[&<>"']/,rO=new RegExp(NE.source,"g"),RE=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,iO=new RegExp(RE.source,"g"),oO={"&":"&","<":"<",">":">",'"':""","'":"'"},ix=t=>oO[t];function In(t,e){if(e){if(NE.test(t))return t.replace(rO,ix)}else if(RE.test(t))return t.replace(iO,ix);return t}const lO=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function sO(t){return t.replace(lO,(e,n)=>(n=n.toLowerCase(),n==="colon"?":":n.charAt(0)==="#"?n.charAt(1)==="x"?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1)):""))}const aO=/(^|[^\[])\^/g;function Be(t,e){t=typeof t=="string"?t:t.source,e=e||"";const n={replace:(r,i)=>(i=typeof i=="object"&&"source"in i?i.source:i,i=i.replace(aO,"$1"),t=t.replace(r,i),n),getRegex:()=>new RegExp(t,e)};return n}function ox(t){try{t=encodeURI(t).replace(/%25/g,"%")}catch{return null}return t}const Md={exec:()=>null};function lx(t,e){const n=t.replace(/\|/g,(o,l,s)=>{let a=!1,u=l;for(;--u>=0&&s[u]==="\\";)a=!a;return a?"|":" |"}),r=n.split(/ \|/);let i=0;if(r[0].trim()||r.shift(),r.length>0&&!r[r.length-1].trim()&&r.pop(),e)if(r.length>e)r.splice(e);else for(;r.length<e;)r.push("");for(;i<r.length;i++)r[i]=r[i].trim().replace(/\\\|/g,"|");return r}function yc(t,e,n){const r=t.length;if(r===0)return"";let i=0;for(;i<r;){const o=t.charAt(r-i-1);if(o===e&&!n)i++;else if(o!==e&&n)i++;else break}return t.slice(0,r-i)}function uO(t,e){if(t.indexOf(e[1])===-1)return-1;let n=0;for(let r=0;r<t.length;r++)if(t[r]==="\\")r++;else if(t[r]===e[0])n++;else if(t[r]===e[1]&&(n--,n<0))return r;return-1}function sx(t,e,n,r){const i=e.href,o=e.title?In(e.title):null,l=t[1].replace(/\\([\[\]])/g,"$1");if(t[0].charAt(0)!=="!"){r.state.inLink=!0;const s={type:"link",raw:n,href:i,title:o,text:l,tokens:r.inlineTokens(l)};return r.state.inLink=!1,s}return{type:"image",raw:n,href:i,title:o,text:In(l)}}function cO(t,e){const n=t.match(/^(\s+)(?:```)/);if(n===null)return e;const r=n[1];return e.split(`
|
|
72
72
|
`).map(i=>{const o=i.match(/^\s+/);if(o===null)return i;const[l]=o;return l.length>=r.length?i.slice(r.length):i}).join(`
|
|
73
73
|
`)}class Ld{constructor(e){Qe(this,"options");Qe(this,"rules");Qe(this,"lexer");this.options=e||fl}space(e){const n=this.rules.block.newline.exec(e);if(n&&n[0].length>0)return{type:"space",raw:n[0]}}code(e){const n=this.rules.block.code.exec(e);if(n){const r=n[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?r:yc(r,`
|
|
74
74
|
`)}}}fences(e){const n=this.rules.block.fences.exec(e);if(n){const r=n[0],i=cO(r,n[3]||"");return{type:"code",raw:r,lang:n[2]?n[2].trim().replace(this.rules.inline._escapes,"$1"):n[2],text:i}}}heading(e){const n=this.rules.block.heading.exec(e);if(n){let r=n[2].trim();if(/#$/.test(r)){const i=yc(r,"#");(this.options.pedantic||!i||/ $/.test(i))&&(r=i.trim())}return{type:"heading",raw:n[0],depth:n[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(e){const n=this.rules.block.hr.exec(e);if(n)return{type:"hr",raw:n[0]}}blockquote(e){const n=this.rules.block.blockquote.exec(e);if(n){const r=yc(n[0].replace(/^ *>[ \t]?/gm,""),`
|
|
@@ -121,12 +121,12 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
121
121
|
|
|
122
122
|
`}return qt(qt(qt(qt({},nn,"richtext"),"templateStrings",e),"exprs",n),"files",r)}function PE(t){var e=typeof t.format=="number"?NO(t.format):[],n=t.text.trimStart(),r=t.text.length-n.length;n=n.trimEnd();var i=t.text.length-n.length-r;return e.includes("bold")&&e.includes("italic")?n="***".concat(n,"***"):e.includes("bold")?n="**".concat(n,"**"):e.includes("italic")&&(n="_".concat(n,"_")),e.includes("line-through")&&(n="~~".concat(n,"~~")),"".concat(" ".repeat(r)).concat(n).concat(" ".repeat(i))}function Cm(t){return t.type==="text"?PE(t):t.type==="linebreak"?`
|
|
123
123
|
`:t}function AE(t,e,n){var r,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,o=i?"":`
|
|
124
|
-
`,l=["".concat(o).concat(" ".repeat(n)).concat(t)];return((r=e.children)===null||r===void 0||(r=r[0])===null||r===void 0?void 0:r.type)!=="list"&&l.push(" "),l.concat(e.children.flatMap(function(s){return s.type==="list"?s.children.flatMap(function(a){return AE(ME(s),a,n+4)}):[Cm(s)]}))}function ME(t){if(t.listType==="bullet")return"-";if(t.listType==="number")return"1.";throw new Error("Unhandled list type: ".concat(t.listType))}var TO={bold:1,italic:2,"line-through":4};function NO(t){return Object.entries(TO).flatMap(function(e){var n=gO(e,2),r=n[0],i=n[1];return(i&t)===i?[r]:[]})}var RO=new TextEncoder;function OO(t,e){if(t.src.startsWith("data:")){var n=On.getSHA256Hash(RO.encode(t.src)),r=Ev(t.src);if(r===void 0)throw new Error("Could not detect Mime Type for image: ".concat(t.src));var i=Cv(r),o="/public/".concat(n,".").concat(i);return e[o]=t.src,qt(qt(qt({},nn,"file"),Rn,o),"metadata",{width:t.width||0,height:t.height||0,sha256:n||"",mimeType:r})}else{var l=PO("sha256",t.src);return qt(qt(qt({},nn,"file"),Rn,"/public".concat(t.src.split("?")[0])),"metadata",{width:t.width||0,height:t.height||0,sha256:l||"",mimeType:t.mimeType||""})}}function PO(t,e){var n=e.split("?");if(!(n.length<2)){var r=n[1],i=new URLSearchParams(r);if(i.has(t))return i.get(t)}}function AO(t){return qt(qt(qt({},nn,"link"),"href",t.url),"children",t.children.map(PE))}function ax(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function lt(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?ax(Object(n),!0).forEach(function(r){qt(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ax(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var $r={version:1,format:"",indent:0,direction:null};function
|
|
125
|
-
`),c=u.flatMap(function(E,$){return $===u.length-1?[E]:[E,{tag:"br",children:[]}]});i.push.apply(i,Em(c))}else i.push(a.raw);else if(a.type==="list")i.push({tag:a.ordered?"ol":"ul",children:mr(a.items,e,0).children});else if(a.type==="list_item")i.push({tag:"li",children:mr(a.tokens?a.tokens:[],e,0,!0).children});else if(a.type!=="space")if(a.type==="html"){if(a.text===bm)return{v:{children:i,cursor:n}};var d=a.text.indexOf(km);if(a.text.startsWith(Id)&&d>-1){var f=Number(a.text.slice(Id.length,d));if(Number.isNaN(f))throw Error("Illegal val intermediate node: ".concat(JSON.stringify(a)));var h=mr(t.map(function(E){return E.type==="link"||E.type==="list"?{type:"text",raw:E.raw,text:E.raw}:E}),e,n+1),g=h.children,m=h.cursor,w=e[f];if(w._type==="link")i.push({tag:"a",href:w.href,children:g});else if(w._type==="file"){var v,y,_;i.push({tag:"img",src:On.convertFileSource(w).url,width:(v=w.metadata)===null||v===void 0?void 0:v.width,height:(y=w.metadata)===null||y===void 0?void 0:y.height,mimeType:(_=w.metadata)===null||_===void 0?void 0:_.mimeType,children:[]})}n=m}var S=/<br\s*\/?>/gi;a.text.trim().match(S)&&i.push({tag:"br",children:[]})}else a.type==="link"?a.raw===a.href?i.push(a.raw):i.push({tag:"a",href:a.href,children:mr(a.tokens?a.tokens:[],e,0).children}):a.type==="br"?i.push({tag:"br",children:[]}):console.error("Could not parse markdown: unsupported token type: ".concat(a.type,". Found: ").concat(a.raw));n++},l;n<t.length;)if(l=o(),l)return l.v;return{children:i,cursor:n}}function DE(t){var e=t.templateStrings,n=t.exprs,r=e.flatMap(function(a,u){var c=n[u];return c?c[nn]==="link"?a.concat("".concat(Id).concat(u).concat(km).concat(c.children[0]).concat(bm)):a.concat("".concat(Id).concat(u).concat(km).concat(bm)):a}).join(""),i=fO(r,{gfm:!0}),o=mr(i,n,0),l=o.children,s=o.cursor;if(s!==i.length)throw Error("Unexpectedly terminated markdown parsing. Possible reason: unclosed html tag?");return qt(qt({},nn,"richtext"),"children",l)}var wn={},$t={},Ut={},se=_e;let jd=new Map;function cx(t){for(;t!=null;){if(t.nodeType===Node.TEXT_NODE)return t;t=t.firstChild}return null}function dx(t){let e=t.parentNode;if(e==null)throw Error("Should never happen");return[e,Array.from(e.childNodes).indexOf(t)]}function IE(t){let e={};t=t.split(";");for(let n of t)if(n!==""){let[r,i]=n.split(/:([^]+)/);e[r.trim()]=i.trim()}return e}function zd(t){let e=jd.get(t);return e===void 0&&(e=IE(t),jd.set(t,e)),e}function UO(t){let e="";for(let n in t)n&&(e+=`${n}: ${t[n]};`);return e}function xl(t,e){var n=zd("getStyle"in t?t.getStyle():t.style);e=Object.entries(e).reduce((r,[i,o])=>(o===null?delete r[i]:r[i]=o,r),{...n}),n=UO(e),t.setStyle(n),jd.set(n,e)}function jE(t,e){var n=t.getNodes(),r=n.length;if(se.DEPRECATED_$isGridSelection(t)){for(var i=se.$createRangeSelection(),o=i.anchor,l=i.focus,s=0;s<r;s++){var a=n[s];se.DEPRECATED_$isGridCellNode(a)&&(o.set(a.getKey(),0,"element"),l.set(a.getKey(),a.getChildrenSize(),"element"),jE(se.$normalizeSelection__EXPERIMENTAL(i),e))}se.$setSelection(t)}else if(--r,i=n[0],o=n[r],t.isCollapsed())xl(t,e);else{var u=t.anchor,c=t.focus;s=i.getTextContent().length,a=c.offset;var d=u.offset,f=u.isBefore(c);l=f?d:a,t=f?a:d;var h=f?u.type:c.type,g=f?c.type:u.type;if(u=f?c.key:u.key,se.$isTextNode(i)&&l===s&&(c=i.getNextSibling(),se.$isTextNode(c)&&(l=d=0,i=c)),n.length===1)se.$isTextNode(i)&&(l=h==="element"?0:d>a?a:d,t=g==="element"?s:d>a?d:a,l!==t&&(l===0&&t===s?(xl(i,e),i.select(l,t)):(n=i.splitText(l,t),n=l===0?n[0]:n[1],xl(n,e),n.select(0,t-l))));else for(se.$isTextNode(i)&&l<i.getTextContentSize()&&(l!==0&&(i=i.splitText(l)[1]),xl(i,e)),se.$isTextNode(o)&&(l=o.getTextContent().length,o.__key!==u&&t!==0&&(t=l),t!==l&&([o]=o.splitText(t)),t!==0&&xl(o,e)),t=1;t<r;t++)l=n[t],s=l.getKey(),se.$isTextNode(l)&&s!==i.getKey()&&s!==o.getKey()&&!l.isToken()&&xl(l,e)}}function WO(t){for(;t!==null&&!se.$isRootOrShadowRoot(t);){let e=t.getLatest(),n=t.getParent();e.getChildrenSize()===0&&t.remove(!0),t=n}}function Bh(t,e,n,r,i=null){if(e.length!==0){var o=e[0],l=new Map,s=[];o=se.$isElementNode(o)?o:o.getParentOrThrow(),o.isInline()&&(o=o.getParentOrThrow());for(var a=!1;o!==null;){var u=o.getPreviousSibling();if(u!==null){o=u,a=!0;break}if(o=o.getParentOrThrow(),se.$isRootOrShadowRoot(o))break}u=new Set;for(var c=0;c<n;c++){var d=e[c];se.$isElementNode(d)&&d.getChildrenSize()===0&&u.add(d.getKey())}var f=new Set;for(c=0;c<n;c++){d=e[c];var h=d.getParent();if(h!==null&&h.isInline()&&(h=h.getParent()),h!==null&&se.$isLeafNode(d)&&!f.has(d.getKey())){if(d=h.getKey(),l.get(d)===void 0){let g=r();g.setFormat(h.getFormatType()),g.setIndent(h.getIndent()),s.push(g),l.set(d,g),h.getChildren().forEach(m=>{g.append(m),f.add(m.getKey()),se.$isElementNode(m)&&m.getChildrenKeys().forEach(w=>f.add(w))}),WO(h)}}else u.has(d.getKey())&&(h=r(),h.setFormat(d.getFormatType()),h.setIndent(d.getIndent()),s.push(h),d.remove(!0))}if(i!==null)for(e=0;e<s.length;e++)i.append(s[e]);if(e=null,se.$isRootOrShadowRoot(o))if(a)if(i!==null)o.insertAfter(i);else for(i=s.length-1;0<=i;i--)o.insertAfter(s[i]);else if(a=o.getFirstChild(),se.$isElementNode(a)&&(o=a),a===null)if(i)o.append(i);else for(i=0;i<s.length;i++)a=s[i],o.append(a),e=a;else if(i!==null)a.insertBefore(i);else for(o=0;o<s.length;o++)i=s[o],a.insertBefore(i),e=i;else if(i)o.insertAfter(i);else for(i=s.length-1;0<=i;i--)a=s[i],o.insertAfter(a),e=a;s=se.$getPreviousSelection(),se.$isRangeSelection(s)&&s.anchor.getNode().isAttached()&&s.focus.getNode().isAttached()?se.$setSelection(s.clone()):e!==null?e.selectEnd():t.dirty=!0}}function zE(t,e,n,r){t.modify(e?"extend":"move",n,r)}function FE(t){return t=t.anchor.getNode(),(se.$isRootNode(t)?t:t.getParentOrThrow()).getDirection()==="rtl"}Ut.$addNodeStyle=function(t){t=t.getStyle();let e=IE(t);jd.set(t,e)};Ut.$cloneWithProperties=function(t){let e=t.constructor.clone(t);return e.__parent=t.__parent,e.__next=t.__next,e.__prev=t.__prev,se.$isElementNode(t)&&se.$isElementNode(e)?(e.__first=t.__first,e.__last=t.__last,e.__size=t.__size,e.__format=t.__format,e.__indent=t.__indent,e.__dir=t.__dir,e):(se.$isTextNode(t)&&se.$isTextNode(e)&&(e.__format=t.__format,e.__style=t.__style,e.__mode=t.__mode,e.__detail=t.__detail),e)};Ut.$getSelectionStyleValueForProperty=function(t,e,n=""){let r=null,i=t.getNodes();var o=t.anchor,l=t.focus,s=t.isBackward();let a=s?l.offset:o.offset;if(o=s?l.getNode():o.getNode(),t.style!==""&&(t=zd(t.style),t!==null&&e in t))return t[e];for(t=0;t<i.length;t++){var u=i[t];if((t===0||a!==0||!u.is(o))&&se.$isTextNode(u)){if(l=e,s=n,u=u.getStyle(),u=zd(u),l=u!==null&&u[l]||s,r===null)r=l;else if(r!==l){r="";break}}}return r===null?n:r};Ut.$isAtNodeEnd=function(t){return t.type==="text"?t.offset===t.getNode().getTextContentSize():t.offset===t.getNode().getChildrenSize()};Ut.$isParentElementRTL=FE;Ut.$moveCaretSelection=zE;Ut.$moveCharacter=function(t,e,n){let r=FE(t);zE(t,e,n?!r:r,"character")};Ut.$patchStyleText=jE;Ut.$selectAll=function(t){let e=t.anchor;t=t.focus;var n=e.getNode().getTopLevelElementOrThrow().getParentOrThrow();let r=n.getFirstDescendant();n=n.getLastDescendant();let i="element",o="element",l=0;se.$isTextNode(r)?i="text":se.$isElementNode(r)||r===null||(r=r.getParentOrThrow()),se.$isTextNode(n)?(o="text",l=n.getTextContentSize()):se.$isElementNode(n)||n===null||(n=n.getParentOrThrow()),r&&n&&(e.set(r.getKey(),0,i),t.set(n.getKey(),l,o))};Ut.$setBlocksType=function(t,e){if(t.anchor.key==="root"){e=e();var n=se.$getRoot();(t=n.getFirstChild())?t.replace(e,!0):n.append(e)}else for(n=t.getNodes(),t=t.anchor.getNode().getParentOrThrow(),n.indexOf(t)===-1&&n.push(t),t.isInline()&&(t=t.getParentOrThrow(),n.indexOf(t)===-1&&n.push(t)),t=0;t<n.length;t++){let o=n[t];var r=o;if(!se.$isElementNode(r)||se.$isRootOrShadowRoot(r))r=!1;else{var i=r.getFirstChild();i=i===null||se.$isLineBreakNode(i)||se.$isTextNode(i)||i.isInline(),r=!r.isInline()&&r.canBeEmpty()!==!1&&i}r&&(r=e(),r.setFormat(o.getFormatType()),r.setIndent(o.getIndent()),o.replace(r,!0))}};Ut.$shouldOverrideDefaultCharacterSelection=function(t,e){return t=se.$getAdjacentNode(t.focus,e),se.$isDecoratorNode(t)&&!t.isIsolated()||se.$isElementNode(t)&&!t.isInline()&&!t.canBeEmpty()};Ut.$sliceSelectedTextNodeContent=function(t,e){if(e.isSelected()&&!e.isSegmented()&&!e.isToken()&&(se.$isRangeSelection(t)||se.DEPRECATED_$isGridSelection(t))){var n=t.anchor.getNode(),r=t.focus.getNode(),i=e.is(n),o=e.is(r);if(i||o){i=t.isBackward();let[l,s]=t.getCharacterOffsets();t=n.is(r),o=e.is(i?r:n),r=e.is(i?n:r),n=0;let a;t?(n=l>s?s:l,a=l>s?l:s):o?(n=i?s:l,a=void 0):r&&(i=i?l:s,n=0,a=i),e.__text=e.__text.slice(n,a)}}return e};Ut.$wrapNodes=function(t,e,n=null){var r=t.getNodes();let i=r.length;var o=t.anchor;if(i===0||i===1&&o.type==="element"&&o.getNode().getChildrenSize()===0){t=o.type==="text"?o.getNode().getParentOrThrow():o.getNode(),r=t.getChildren();let s=e();s.setFormat(t.getFormatType()),s.setIndent(t.getIndent()),r.forEach(a=>s.append(a)),n&&(s=n.append(s)),t.replace(s)}else{o=null;var l=[];for(let s=0;s<i;s++){let a=r[s];se.$isRootOrShadowRoot(a)?(Bh(t,l,l.length,e,n),l=[],o=a):o===null||o!==null&&se.$hasAncestor(a,o)?l.push(a):(Bh(t,l,l.length,e,n),l=[a])}Bh(t,l,l.length,e,n)}};Ut.createDOMRange=function(t,e,n,r,i){let o=e.getKey(),l=r.getKey(),s=document.createRange(),a=t.getElementByKey(o);if(t=t.getElementByKey(l),se.$isTextNode(e)&&(a=cx(a)),se.$isTextNode(r)&&(t=cx(t)),e===void 0||r===void 0||a===null||t===null)return null;a.nodeName==="BR"&&([a,n]=dx(a)),t.nodeName==="BR"&&([t,i]=dx(t)),e=a.firstChild,a===t&&e!=null&&e.nodeName==="BR"&&n===0&&i===0&&(i=1);try{s.setStart(a,n),s.setEnd(t,i)}catch{return null}return!s.collapsed||n===i&&o===l||(s.setStart(t,i),s.setEnd(a,n)),s};Ut.createRectsFromDOMRange=function(t,e){var n=t.getRootElement();if(n===null)return[];t=n.getBoundingClientRect(),n=getComputedStyle(n),n=parseFloat(n.paddingLeft)+parseFloat(n.paddingRight),e=Array.from(e.getClientRects());let r=e.length;e.sort((o,l)=>{let s=o.top-l.top;return 3>=Math.abs(s)?o.left-l.left:s});let i;for(let o=0;o<r;o++){let l=e[o],s=l.width+n===t.width;i&&i.top<=l.top&&i.top+i.height>l.top&&i.left+i.width>l.left||s?(e.splice(o--,1),r--):i=l}return e};Ut.getStyleObjectFromCSS=zd;Ut.trimTextContentFromAnchor=function(t,e,n){let r=e.getNode();if(se.$isElementNode(r)){var i=r.getDescendantByIndex(e.offset);i!==null&&(r=i)}for(;0<n&&r!==null;){var o=r.getPreviousSibling(),l=0;if(o===null){i=r.getParentOrThrow();for(var s=i.getPreviousSibling();s===null;){if(i=i.getParent(),i===null){o=null;break}s=i.getPreviousSibling()}i!==null&&(l=i.isInline()?0:2,o=se.$isElementNode(s)?s.getLastDescendant():s)}if(s=r.getTextContent(),s===""&&se.$isElementNode(r)&&!r.isInline()&&(s=`
|
|
124
|
+
`,l=["".concat(o).concat(" ".repeat(n)).concat(t)];return((r=e.children)===null||r===void 0||(r=r[0])===null||r===void 0?void 0:r.type)!=="list"&&l.push(" "),l.concat(e.children.flatMap(function(s){return s.type==="list"?s.children.flatMap(function(a){return AE(ME(s),a,n+4)}):[Cm(s)]}))}function ME(t){if(t.listType==="bullet")return"-";if(t.listType==="number")return"1.";throw new Error("Unhandled list type: ".concat(t.listType))}var TO={bold:1,italic:2,"line-through":4};function NO(t){return Object.entries(TO).flatMap(function(e){var n=gO(e,2),r=n[0],i=n[1];return(i&t)===i?[r]:[]})}var RO=new TextEncoder;function OO(t,e){if(t.src.startsWith("data:")){var n=On.getSHA256Hash(RO.encode(t.src)),r=Ev(t.src);if(r===void 0)throw new Error("Could not detect Mime Type for image: ".concat(t.src));var i=Cv(r),o="/public/".concat(n,".").concat(i);return e[o]=t.src,qt(qt(qt({},nn,"file"),Rn,o),"metadata",{width:t.width||0,height:t.height||0,sha256:n||"",mimeType:r})}else{var l=PO("sha256",t.src);return qt(qt(qt({},nn,"file"),Rn,"/public".concat(t.src.split("?")[0])),"metadata",{width:t.width||0,height:t.height||0,sha256:l||"",mimeType:t.mimeType||""})}}function PO(t,e){var n=e.split("?");if(!(n.length<2)){var r=n[1],i=new URLSearchParams(r);if(i.has(t))return i.get(t)}}function AO(t){return qt(qt(qt({},nn,"link"),"href",t.url),"children",t.children.map(PE))}function ax(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function lt(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?ax(Object(n),!0).forEach(function(r){qt(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ax(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var $r={version:1,format:"",indent:0,direction:null};function Ls(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(typeof t=="string")return lt(lt({},$r),{},{type:"text",format:"",text:t});if("tag"in t)switch(t.tag){case"h1":return xl(t);case"h2":return xl(t);case"h3":return xl(t);case"h4":return xl(t);case"h5":return xl(t);case"h6":return xl(t);case"li":return zO(t);case"p":return IO(t);case"ul":return ux(t);case"ol":return ux(t);case"span":return LE(t);case"a":return LO(t);case"img":return MO(t);case"br":return e?lt(lt({},$r),{},{type:"linebreak"}):jO();default:throw Error("Unexpected node tag: "+JSON.stringify(t,null,2))}else throw Error("Unexpected node: "+JSON.stringify(t,null,2))}function MO(t){var e=t.src;return lt(lt({},$r),{},{type:"image",src:e,width:t.width,height:t.height,mimeType:t.mimeType})}function LO(t){return lt(lt({},$r),{},{type:"link",url:t.href,children:t.children.map(function(e){return Ls(e)})})}function DO(t){return lt(lt({},$r),{},{format:"",type:"root",children:t.children.map(function(e){return Ls(e)})})}function xl(t){return lt(lt({},$r),{},{type:"heading",tag:t.tag,children:t.children.map(function(e){return Ls(e)})})}function IO(t){return lt(lt({},$r),{},{type:"paragraph",children:t.children.map(function(e){return Ls(e,!0)})})}function jO(){return lt(lt({},$r),{},{type:"paragraph",children:[]})}function zO(t){return lt(lt({},$r),{},{type:"listitem",children:t.children.map(function(e){return Ls(e,!0)})})}function ux(t){return lt(lt({},$r),{},{type:"list",listType:t.tag==="ol"?"number":"bullet",children:t.children.map(function(e){return Ls(e)})},t.dir?{direction:t.dir}:{direction:null})}var FO={bold:1,italic:2,"line-through":4};function BO(t){return t.reduce(function(e,n){return e|FO[n]},0)}function LE(t){var e=t.children[0];return typeof e=="string"?lt(lt({},$r),{},{type:"text",text:e,format:BO(t.classes)}):LE(lt(lt({},e),{},{classes:t.classes.concat(e.classes)}))}var Id='<val value="',km='">',bm="</val>";function mr(t,e,n){for(var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,i=[],o=function(){var a=t[n];if(a.type==="heading")i.push({tag:"h".concat(a.depth),children:mr(a.tokens?a.tokens:[],e,0).children});else if(a.type==="paragraph")i.push({tag:"p",children:mr(a.tokens?a.tokens:[],e,0).children});else if(a.type==="strong")i.push({tag:"span",classes:["bold"],children:mr(a.tokens?a.tokens:[],e,0).children});else if(a.type==="em")i.push({tag:"span",classes:["italic"],children:mr(a.tokens?a.tokens:[],e,0).children});else if(a.type==="del")i.push({tag:"span",classes:["line-through"],children:mr(a.tokens?a.tokens:[],e,0).children});else if(a.type==="text")if("tokens"in a&&Array.isArray(a.tokens))i.push.apply(i,Em(mr(a.tokens,e,n,r).children));else if(r&&typeof a.raw=="string"){var u=a.raw.split(`
|
|
125
|
+
`),c=u.flatMap(function(E,$){return $===u.length-1?[E]:[E,{tag:"br",children:[]}]});i.push.apply(i,Em(c))}else i.push(a.raw);else if(a.type==="list")i.push({tag:a.ordered?"ol":"ul",children:mr(a.items,e,0).children});else if(a.type==="list_item")i.push({tag:"li",children:mr(a.tokens?a.tokens:[],e,0,!0).children});else if(a.type!=="space")if(a.type==="html"){if(a.text===bm)return{v:{children:i,cursor:n}};var d=a.text.indexOf(km);if(a.text.startsWith(Id)&&d>-1){var f=Number(a.text.slice(Id.length,d));if(Number.isNaN(f))throw Error("Illegal val intermediate node: ".concat(JSON.stringify(a)));var h=mr(t.map(function(E){return E.type==="link"||E.type==="list"?{type:"text",raw:E.raw,text:E.raw}:E}),e,n+1),g=h.children,m=h.cursor,w=e[f];if(w._type==="link")i.push({tag:"a",href:w.href,children:g});else if(w._type==="file"){var v,y,_;i.push({tag:"img",src:On.convertFileSource(w).url,width:(v=w.metadata)===null||v===void 0?void 0:v.width,height:(y=w.metadata)===null||y===void 0?void 0:y.height,mimeType:(_=w.metadata)===null||_===void 0?void 0:_.mimeType,children:[]})}n=m}var S=/<br\s*\/?>/gi;a.text.trim().match(S)&&i.push({tag:"br",children:[]})}else a.type==="link"?a.raw===a.href?i.push(a.raw):i.push({tag:"a",href:a.href,children:mr(a.tokens?a.tokens:[],e,0).children}):a.type==="br"?i.push({tag:"br",children:[]}):console.error("Could not parse markdown: unsupported token type: ".concat(a.type,". Found: ").concat(a.raw));n++},l;n<t.length;)if(l=o(),l)return l.v;return{children:i,cursor:n}}function DE(t){var e=t.templateStrings,n=t.exprs,r=e.flatMap(function(a,u){var c=n[u];return c?c[nn]==="link"?a.concat("".concat(Id).concat(u).concat(km).concat(c.children[0]).concat(bm)):a.concat("".concat(Id).concat(u).concat(km).concat(bm)):a}).join(""),i=fO(r,{gfm:!0}),o=mr(i,n,0),l=o.children,s=o.cursor;if(s!==i.length)throw Error("Unexpectedly terminated markdown parsing. Possible reason: unclosed html tag?");return qt(qt({},nn,"richtext"),"children",l)}var wn={},$t={},Ut={},se=_e;let jd=new Map;function cx(t){for(;t!=null;){if(t.nodeType===Node.TEXT_NODE)return t;t=t.firstChild}return null}function dx(t){let e=t.parentNode;if(e==null)throw Error("Should never happen");return[e,Array.from(e.childNodes).indexOf(t)]}function IE(t){let e={};t=t.split(";");for(let n of t)if(n!==""){let[r,i]=n.split(/:([^]+)/);e[r.trim()]=i.trim()}return e}function zd(t){let e=jd.get(t);return e===void 0&&(e=IE(t),jd.set(t,e)),e}function UO(t){let e="";for(let n in t)n&&(e+=`${n}: ${t[n]};`);return e}function _l(t,e){var n=zd("getStyle"in t?t.getStyle():t.style);e=Object.entries(e).reduce((r,[i,o])=>(o===null?delete r[i]:r[i]=o,r),{...n}),n=UO(e),t.setStyle(n),jd.set(n,e)}function jE(t,e){var n=t.getNodes(),r=n.length;if(se.DEPRECATED_$isGridSelection(t)){for(var i=se.$createRangeSelection(),o=i.anchor,l=i.focus,s=0;s<r;s++){var a=n[s];se.DEPRECATED_$isGridCellNode(a)&&(o.set(a.getKey(),0,"element"),l.set(a.getKey(),a.getChildrenSize(),"element"),jE(se.$normalizeSelection__EXPERIMENTAL(i),e))}se.$setSelection(t)}else if(--r,i=n[0],o=n[r],t.isCollapsed())_l(t,e);else{var u=t.anchor,c=t.focus;s=i.getTextContent().length,a=c.offset;var d=u.offset,f=u.isBefore(c);l=f?d:a,t=f?a:d;var h=f?u.type:c.type,g=f?c.type:u.type;if(u=f?c.key:u.key,se.$isTextNode(i)&&l===s&&(c=i.getNextSibling(),se.$isTextNode(c)&&(l=d=0,i=c)),n.length===1)se.$isTextNode(i)&&(l=h==="element"?0:d>a?a:d,t=g==="element"?s:d>a?d:a,l!==t&&(l===0&&t===s?(_l(i,e),i.select(l,t)):(n=i.splitText(l,t),n=l===0?n[0]:n[1],_l(n,e),n.select(0,t-l))));else for(se.$isTextNode(i)&&l<i.getTextContentSize()&&(l!==0&&(i=i.splitText(l)[1]),_l(i,e)),se.$isTextNode(o)&&(l=o.getTextContent().length,o.__key!==u&&t!==0&&(t=l),t!==l&&([o]=o.splitText(t)),t!==0&&_l(o,e)),t=1;t<r;t++)l=n[t],s=l.getKey(),se.$isTextNode(l)&&s!==i.getKey()&&s!==o.getKey()&&!l.isToken()&&_l(l,e)}}function WO(t){for(;t!==null&&!se.$isRootOrShadowRoot(t);){let e=t.getLatest(),n=t.getParent();e.getChildrenSize()===0&&t.remove(!0),t=n}}function Bh(t,e,n,r,i=null){if(e.length!==0){var o=e[0],l=new Map,s=[];o=se.$isElementNode(o)?o:o.getParentOrThrow(),o.isInline()&&(o=o.getParentOrThrow());for(var a=!1;o!==null;){var u=o.getPreviousSibling();if(u!==null){o=u,a=!0;break}if(o=o.getParentOrThrow(),se.$isRootOrShadowRoot(o))break}u=new Set;for(var c=0;c<n;c++){var d=e[c];se.$isElementNode(d)&&d.getChildrenSize()===0&&u.add(d.getKey())}var f=new Set;for(c=0;c<n;c++){d=e[c];var h=d.getParent();if(h!==null&&h.isInline()&&(h=h.getParent()),h!==null&&se.$isLeafNode(d)&&!f.has(d.getKey())){if(d=h.getKey(),l.get(d)===void 0){let g=r();g.setFormat(h.getFormatType()),g.setIndent(h.getIndent()),s.push(g),l.set(d,g),h.getChildren().forEach(m=>{g.append(m),f.add(m.getKey()),se.$isElementNode(m)&&m.getChildrenKeys().forEach(w=>f.add(w))}),WO(h)}}else u.has(d.getKey())&&(h=r(),h.setFormat(d.getFormatType()),h.setIndent(d.getIndent()),s.push(h),d.remove(!0))}if(i!==null)for(e=0;e<s.length;e++)i.append(s[e]);if(e=null,se.$isRootOrShadowRoot(o))if(a)if(i!==null)o.insertAfter(i);else for(i=s.length-1;0<=i;i--)o.insertAfter(s[i]);else if(a=o.getFirstChild(),se.$isElementNode(a)&&(o=a),a===null)if(i)o.append(i);else for(i=0;i<s.length;i++)a=s[i],o.append(a),e=a;else if(i!==null)a.insertBefore(i);else for(o=0;o<s.length;o++)i=s[o],a.insertBefore(i),e=i;else if(i)o.insertAfter(i);else for(i=s.length-1;0<=i;i--)a=s[i],o.insertAfter(a),e=a;s=se.$getPreviousSelection(),se.$isRangeSelection(s)&&s.anchor.getNode().isAttached()&&s.focus.getNode().isAttached()?se.$setSelection(s.clone()):e!==null?e.selectEnd():t.dirty=!0}}function zE(t,e,n,r){t.modify(e?"extend":"move",n,r)}function FE(t){return t=t.anchor.getNode(),(se.$isRootNode(t)?t:t.getParentOrThrow()).getDirection()==="rtl"}Ut.$addNodeStyle=function(t){t=t.getStyle();let e=IE(t);jd.set(t,e)};Ut.$cloneWithProperties=function(t){let e=t.constructor.clone(t);return e.__parent=t.__parent,e.__next=t.__next,e.__prev=t.__prev,se.$isElementNode(t)&&se.$isElementNode(e)?(e.__first=t.__first,e.__last=t.__last,e.__size=t.__size,e.__format=t.__format,e.__indent=t.__indent,e.__dir=t.__dir,e):(se.$isTextNode(t)&&se.$isTextNode(e)&&(e.__format=t.__format,e.__style=t.__style,e.__mode=t.__mode,e.__detail=t.__detail),e)};Ut.$getSelectionStyleValueForProperty=function(t,e,n=""){let r=null,i=t.getNodes();var o=t.anchor,l=t.focus,s=t.isBackward();let a=s?l.offset:o.offset;if(o=s?l.getNode():o.getNode(),t.style!==""&&(t=zd(t.style),t!==null&&e in t))return t[e];for(t=0;t<i.length;t++){var u=i[t];if((t===0||a!==0||!u.is(o))&&se.$isTextNode(u)){if(l=e,s=n,u=u.getStyle(),u=zd(u),l=u!==null&&u[l]||s,r===null)r=l;else if(r!==l){r="";break}}}return r===null?n:r};Ut.$isAtNodeEnd=function(t){return t.type==="text"?t.offset===t.getNode().getTextContentSize():t.offset===t.getNode().getChildrenSize()};Ut.$isParentElementRTL=FE;Ut.$moveCaretSelection=zE;Ut.$moveCharacter=function(t,e,n){let r=FE(t);zE(t,e,n?!r:r,"character")};Ut.$patchStyleText=jE;Ut.$selectAll=function(t){let e=t.anchor;t=t.focus;var n=e.getNode().getTopLevelElementOrThrow().getParentOrThrow();let r=n.getFirstDescendant();n=n.getLastDescendant();let i="element",o="element",l=0;se.$isTextNode(r)?i="text":se.$isElementNode(r)||r===null||(r=r.getParentOrThrow()),se.$isTextNode(n)?(o="text",l=n.getTextContentSize()):se.$isElementNode(n)||n===null||(n=n.getParentOrThrow()),r&&n&&(e.set(r.getKey(),0,i),t.set(n.getKey(),l,o))};Ut.$setBlocksType=function(t,e){if(t.anchor.key==="root"){e=e();var n=se.$getRoot();(t=n.getFirstChild())?t.replace(e,!0):n.append(e)}else for(n=t.getNodes(),t=t.anchor.getNode().getParentOrThrow(),n.indexOf(t)===-1&&n.push(t),t.isInline()&&(t=t.getParentOrThrow(),n.indexOf(t)===-1&&n.push(t)),t=0;t<n.length;t++){let o=n[t];var r=o;if(!se.$isElementNode(r)||se.$isRootOrShadowRoot(r))r=!1;else{var i=r.getFirstChild();i=i===null||se.$isLineBreakNode(i)||se.$isTextNode(i)||i.isInline(),r=!r.isInline()&&r.canBeEmpty()!==!1&&i}r&&(r=e(),r.setFormat(o.getFormatType()),r.setIndent(o.getIndent()),o.replace(r,!0))}};Ut.$shouldOverrideDefaultCharacterSelection=function(t,e){return t=se.$getAdjacentNode(t.focus,e),se.$isDecoratorNode(t)&&!t.isIsolated()||se.$isElementNode(t)&&!t.isInline()&&!t.canBeEmpty()};Ut.$sliceSelectedTextNodeContent=function(t,e){if(e.isSelected()&&!e.isSegmented()&&!e.isToken()&&(se.$isRangeSelection(t)||se.DEPRECATED_$isGridSelection(t))){var n=t.anchor.getNode(),r=t.focus.getNode(),i=e.is(n),o=e.is(r);if(i||o){i=t.isBackward();let[l,s]=t.getCharacterOffsets();t=n.is(r),o=e.is(i?r:n),r=e.is(i?n:r),n=0;let a;t?(n=l>s?s:l,a=l>s?l:s):o?(n=i?s:l,a=void 0):r&&(i=i?l:s,n=0,a=i),e.__text=e.__text.slice(n,a)}}return e};Ut.$wrapNodes=function(t,e,n=null){var r=t.getNodes();let i=r.length;var o=t.anchor;if(i===0||i===1&&o.type==="element"&&o.getNode().getChildrenSize()===0){t=o.type==="text"?o.getNode().getParentOrThrow():o.getNode(),r=t.getChildren();let s=e();s.setFormat(t.getFormatType()),s.setIndent(t.getIndent()),r.forEach(a=>s.append(a)),n&&(s=n.append(s)),t.replace(s)}else{o=null;var l=[];for(let s=0;s<i;s++){let a=r[s];se.$isRootOrShadowRoot(a)?(Bh(t,l,l.length,e,n),l=[],o=a):o===null||o!==null&&se.$hasAncestor(a,o)?l.push(a):(Bh(t,l,l.length,e,n),l=[a])}Bh(t,l,l.length,e,n)}};Ut.createDOMRange=function(t,e,n,r,i){let o=e.getKey(),l=r.getKey(),s=document.createRange(),a=t.getElementByKey(o);if(t=t.getElementByKey(l),se.$isTextNode(e)&&(a=cx(a)),se.$isTextNode(r)&&(t=cx(t)),e===void 0||r===void 0||a===null||t===null)return null;a.nodeName==="BR"&&([a,n]=dx(a)),t.nodeName==="BR"&&([t,i]=dx(t)),e=a.firstChild,a===t&&e!=null&&e.nodeName==="BR"&&n===0&&i===0&&(i=1);try{s.setStart(a,n),s.setEnd(t,i)}catch{return null}return!s.collapsed||n===i&&o===l||(s.setStart(t,i),s.setEnd(a,n)),s};Ut.createRectsFromDOMRange=function(t,e){var n=t.getRootElement();if(n===null)return[];t=n.getBoundingClientRect(),n=getComputedStyle(n),n=parseFloat(n.paddingLeft)+parseFloat(n.paddingRight),e=Array.from(e.getClientRects());let r=e.length;e.sort((o,l)=>{let s=o.top-l.top;return 3>=Math.abs(s)?o.left-l.left:s});let i;for(let o=0;o<r;o++){let l=e[o],s=l.width+n===t.width;i&&i.top<=l.top&&i.top+i.height>l.top&&i.left+i.width>l.left||s?(e.splice(o--,1),r--):i=l}return e};Ut.getStyleObjectFromCSS=zd;Ut.trimTextContentFromAnchor=function(t,e,n){let r=e.getNode();if(se.$isElementNode(r)){var i=r.getDescendantByIndex(e.offset);i!==null&&(r=i)}for(;0<n&&r!==null;){var o=r.getPreviousSibling(),l=0;if(o===null){i=r.getParentOrThrow();for(var s=i.getPreviousSibling();s===null;){if(i=i.getParent(),i===null){o=null;break}s=i.getPreviousSibling()}i!==null&&(l=i.isInline()?0:2,o=se.$isElementNode(s)?s.getLastDescendant():s)}if(s=r.getTextContent(),s===""&&se.$isElementNode(r)&&!r.isInline()&&(s=`
|
|
126
126
|
|
|
127
|
-
`),i=s.length,!se.$isTextNode(r)||n>=i)s=r.getParent(),r.remove(),s==null||s.getChildrenSize()!==0||se.$isRootNode(s)||s.remove(),n-=i+l,r=o;else{let a=r.getKey();l=t.getEditorState().read(()=>{const c=se.$getNodeByKey(a);return se.$isTextNode(c)&&c.isSimpleText()?c.getTextContent():null}),o=i-n;let u=s.slice(0,o);l!==null&&l!==s?(n=se.$getPreviousSelection(),i=r,r.isSimpleText()?r.setTextContent(l):(i=se.$createTextNode(l),r.replace(i)),se.$isRangeSelection(n)&&n.isCollapsed()&&(n=n.anchor.offset,i.select(n,n))):r.isSimpleText()?(l=e.key===a,s=e.offset,s<n&&(s=i),n=l?s-n:0,i=l?s:o,l&&n===0?([n]=r.splitText(n,i),n.remove()):([,n]=r.splitText(n,i),n.remove())):(n=se.$createTextNode(u),r.replace(n)),n=0}}};const VO=Ut;var co=VO,HO=co,Et=_e;function KO(t){let e=new URLSearchParams;e.append("code",t);for(let n=1;n<arguments.length;n++)e.append("v",arguments[n]);throw Error(`Minified Lexical error #${t}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function BE(t,e){for(let n of e)if(t.type.startsWith(n))return!0;return!1}function UE(t,e){for(;t!==Et.$getRoot()&&t!=null;){if(e(t))return t;t=t.getParent()}return null}$t.$splitNode=Et.$splitNode;$t.isHTMLAnchorElement=Et.isHTMLAnchorElement;$t.isHTMLElement=Et.isHTMLElement;$t.$dfs=function(t,e){let n=[];t=(t||Et.$getRoot()).getLatest(),e=e||(Et.$isElementNode(t)?t.getLastDescendant():t);for(var r=t,i=0;(r=r.getParent())!==null;)i++;for(r=i;t!==null&&!t.is(e);)if(n.push({depth:r,node:t}),Et.$isElementNode(t)&&0<t.getChildrenSize())t=t.getFirstChild(),r++;else for(i=null;i===null&&t!==null;)i=t.getNextSibling(),i===null?(t=t.getParent(),r--):t=i;return t!==null&&t.is(e)&&n.push({depth:r,node:t}),n};$t.$filter=function(t,e){let n=[];for(let r=0;r<t.length;r++){let i=e(t[r]);i!==null&&n.push(i)}return n};$t.$findMatchingParent=UE;$t.$getNearestBlockElementAncestorOrThrow=function(t){let e=UE(t,n=>Et.$isElementNode(n)&&!n.isInline());return Et.$isElementNode(e)||KO(4,t.__key),e};$t.$getNearestNodeOfType=function(t,e){for(;t!=null;){if(t instanceof e)return t;t=t.getParent()}return null};$t.$insertFirst=function(t,e){let n=t.getFirstChild();n!==null?n.insertBefore(e):t.append(e)};$t.$insertNodeToNearestRoot=function(t){var e=Et.$getSelection()||Et.$getPreviousSelection();if(Et.$isRangeSelection(e)){var{focus:n}=e;if(e=n.getNode(),n=n.offset,Et.$isRootOrShadowRoot(e))n=e.getChildAtIndex(n),n==null?e.append(t):n.insertBefore(t),t.selectNext();else{let r,i;Et.$isTextNode(e)?(r=e.getParentOrThrow(),i=e.getIndexWithinParent(),0<n&&(i+=1,e.splitText(n))):(r=e,i=n),[,e]=Et.$splitNode(r,i),e.insertBefore(t),e.selectStart()}}else Et.$isNodeSelection(e)||Et.DEPRECATED_$isGridSelection(e)?(e=e.getNodes(),e[e.length-1].getTopLevelElementOrThrow().insertAfter(t)):Et.$getRoot().append(t),e=Et.$createParagraphNode(),t.insertAfter(e),e.select();return t.getLatest()};$t.$restoreEditorState=function(t,e){let n=new Map,r=t._pendingEditorState;for(let[i,o]of e._nodeMap){let l=HO.$cloneWithProperties(o);Et.$isTextNode(l)&&(l.__text=o.__text),n.set(i,l)}r&&(r._nodeMap=n),t._dirtyType=2,t=e._selection,Et.$setSelection(t===null?null:t.clone())};$t.$wrapNodeInElement=function(t,e){return e=e(),t.replace(e),e.append(t),e};$t.addClassNamesToElement=function(t,...e){e.forEach(n=>{typeof n=="string"&&(n=n.split(" ").filter(r=>r!==""),t.classList.add(...n))})};$t.isMimeType=BE;$t.mediaFileReader=function(t,e){let n=t[Symbol.iterator]();return new Promise((r,i)=>{let o=[],l=()=>{const{done:s,value:a}=n.next();if(s)return r(o);const u=new FileReader;u.addEventListener("error",i),u.addEventListener("load",()=>{const c=u.result;typeof c=="string"&&o.push({file:a,result:c}),l()}),BE(a,e)?u.readAsDataURL(a):l()};l()})};$t.mergeRegister=function(...t){return()=>{t.forEach(e=>e())}};$t.objectKlassEquals=function(t,e){return t!==null?Object.getPrototypeOf(t).constructor.name===e.name:!1};$t.registerNestedElementResolver=function(t,e,n,r){return t.registerNodeTransform(e,i=>{e:{for(var o=i.getChildren(),l=0;l<o.length;l++)if(o[l]instanceof e){o=null;break e}for(o=i;o!==null;)if(l=o,o=o.getParent(),o instanceof e){o={child:l,parent:o};break e}o=null}if(o!==null){const{child:s,parent:a}=o;if(s.is(i)){if(r(a,i),i=s.getNextSiblings(),o=i.length,a.insertAfter(s),o!==0){l=n(a),s.insertAfter(l);for(let u=0;u<o;u++)l.append(i[u])}a.canBeEmpty()||a.getChildrenSize()!==0||a.remove()}}})};$t.removeClassNamesFromElement=function(t,...e){e.forEach(n=>{typeof n=="string"&&t.classList.remove(...n.split(" "))})};const ZO=$t;var Ft=ZO,ze=_e,fo=Ft;function ms(t){let e=new URLSearchParams;e.append("code",t);for(let n=1;n<arguments.length;n++)e.append("v",arguments[n]);throw Error(`Minified Lexical error #${t}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function WE(t){let e=1;for(t=t.getParent();t!=null;){if(ft(t)){if(t=t.getParent(),Ne(t)){e++,t=t.getParent();continue}ms(40)}break}return e}function $m(t){t=t.getParent(),Ne(t)||ms(40);let e=t;for(;e!==null;)e=e.getParent(),Ne(e)&&(t=e);return t}function VE(t){let e=[];t=t.getChildren().filter(ft);for(let n=0;n<t.length;n++){let r=t[n],i=r.getFirstChild();Ne(i)?e=e.concat(VE(i)):e.push(r)}return e}function Mr(t){return ft(t)&&Ne(t.getFirstChild())}function GO(t){for(;t.getNextSibling()==null&&t.getPreviousSibling()==null;){let e=t.getParent();if(e==null||!ft(t)&&!Ne(t))break;t=e}t.remove()}function fx(t){return Bn().append(t)}function HE(t,e){return ft(t)&&(e.length===0||e.length===1&&t.is(e[0])&&t.getChildrenSize()===0)}function qo(t,e){t.splice(t.getChildrenSize(),0,e)}function hx(t,e){if(Ne(t))return t;let n=t.getPreviousSibling(),r=t.getNextSibling(),i=Bn();return i.setFormat(t.getFormatType()),i.setIndent(t.getIndent()),qo(i,t.getChildren()),Ne(n)&&e===n.getListType()?(n.append(i),t.remove(),Ne(r)&&e===r.getListType()&&(qo(n,r.getChildren()),r.remove()),n):Ne(r)&&e===r.getListType()?(r.getFirstChildOrThrow().insertBefore(i),t.remove(),r):(e=gn(e),e.append(i),t.replace(e),cn(e),e)}function KE(t,e){var n=t.getLastChild();let r=e.getFirstChild();n&&r&&Mr(n)&&Mr(r)&&(KE(n.getFirstChild(),r.getFirstChild()),r.remove()),n=e.getChildren(),0<n.length&&(t.append(...n),cn(t)),e.remove()}function cn(t,e){if(t=e||t.getChildren(),t!==void 0)for(e=0;e<t.length;e++){let o=t[e];if(ft(o)){let l=o.getValue();var n=o,r=n.getParent(),i=1;for(r!=null&&(Ne(r)?i=r.getStart():ms(44)),n=n.getPreviousSiblings(),r=0;r<n.length;r++){let s=n[r];ft(s)&&!Ne(s.getFirstChild())&&i++}l!==i&&o.setValue(i)}}}function YO(t){if(!Mr(t)){var e=t.getParent(),n=e?e.getParent():void 0,r=n?n.getParent():void 0;if(Ne(r)&&ft(n)&&Ne(e)){var i=e?e.getFirstChild():void 0,o=e?e.getLastChild():void 0;if(t.is(i))n.insertBefore(t),e.isEmpty()&&n.remove();else if(t.is(o))n.insertAfter(t),e.isEmpty()&&n.remove();else{var l=e.getListType();i=Bn();let s=gn(l);i.append(s),t.getPreviousSiblings().forEach(a=>s.append(a)),o=Bn(),l=gn(l),o.append(l),qo(l,t.getNextSiblings()),n.insertBefore(i),n.insertAfter(o),n.replace(t)}cn(e),cn(r)}}}let Df=class ZE extends ze.ElementNode{static getType(){return"listitem"}static clone(e){return new ZE(e.__value,e.__checked,e.__key)}constructor(e,n,r){super(r),this.__value=e===void 0?1:e,this.__checked=n}createDOM(e){let n=document.createElement("li"),r=this.getParent();return Ne(r)&&r.getListType()==="check"&&mx(n,this,null),n.value=this.__value,px(n,e.theme,this),n}updateDOM(e,n,r){let i=this.getParent();return Ne(i)&&i.getListType()==="check"&&mx(n,this,e),n.value=this.__value,px(n,r.theme,this),!1}static transform(){return e=>{let n=e.getParent();Ne(n)&&(cn(n),n.getListType()!=="check"&&e.getChecked()!=null&&e.setChecked(void 0))}}static importDOM(){return{li:()=>({conversion:XO,priority:0})}}static importJSON(e){let n=Bn();return n.setChecked(e.checked),n.setValue(e.value),n.setFormat(e.format),n.setDirection(e.direction),n}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),type:"listitem",value:this.getValue(),version:1}}append(...e){for(let n=0;n<e.length;n++){let r=e[n];if(ze.$isElementNode(r)&&this.canMergeWith(r)){let i=r.getChildren();this.append(...i),r.remove()}else super.append(r)}return this}replace(e,n){if(ft(e))return super.replace(e);this.setIndent(0);let r=this.getParentOrThrow();if(!Ne(r))return e;if(r.__first===this.getKey())r.insertBefore(e);else if(r.__last===this.getKey())r.insertAfter(e);else{let i=gn(r.getListType()),o=this.getNextSibling();for(;o;){let l=o;o=o.getNextSibling(),i.append(l)}r.insertAfter(e),e.insertAfter(i)}return n&&this.getChildren().forEach(i=>{e.append(i)}),this.remove(),r.getChildrenSize()===0&&r.remove(),e}insertAfter(e,n=!0){var r=this.getParentOrThrow();Ne(r)||ms(39);var i=this.getNextSiblings();if(ft(e))return n=super.insertAfter(e,n),e=e.getParentOrThrow(),Ne(e)&&cn(e),n;if(Ne(e)){for(r=e,e=e.getChildren(),i=e.length-1;0<=i;i--)r=e[i],this.insertAfter(r,n);return r}if(r.insertAfter(e,n),i.length!==0){let o=gn(r.getListType());i.forEach(l=>o.append(l)),e.insertAfter(o,n)}return e}remove(e){let n=this.getPreviousSibling(),r=this.getNextSibling();super.remove(e),n&&r&&Mr(n)&&Mr(r)?(KE(n.getFirstChild(),r.getFirstChild()),r.remove()):r&&(e=r.getParent(),Ne(e)&&cn(e))}insertNewAfter(e,n=!0){return e=Bn(this.__checked==null?void 0:!1),this.insertAfter(e,n),e}collapseAtStart(e){let n=ze.$createParagraphNode();this.getChildren().forEach(l=>n.append(l));var r=this.getParentOrThrow(),i=r.getParentOrThrow();let o=ft(i);return r.getChildrenSize()===1?o?(r.remove(),i.select()):(r.insertBefore(n),r.remove(),r=e.anchor,e=e.focus,i=n.getKey(),r.type==="element"&&r.getNode().is(this)&&r.set(i,r.offset,"element"),e.type==="element"&&e.getNode().is(this)&&e.set(i,e.offset,"element")):(r.insertBefore(n),this.remove()),!0}getValue(){return this.getLatest().__value}setValue(e){this.getWritable().__value=e}getChecked(){return this.getLatest().__checked}setChecked(e){this.getWritable().__checked=e}toggleChecked(){this.setChecked(!this.__checked)}getIndent(){var e=this.getParent();if(e===null)return this.getLatest().__indent;e=e.getParentOrThrow();let n=0;for(;ft(e);)e=e.getParentOrThrow().getParentOrThrow(),n++;return n}setIndent(e){typeof e=="number"&&-1<e||ms(117);let n=this.getIndent();for(;n!==e;)if(n<e){e:{var r=new Set;if(Mr(this)||r.has(this.getKey()))break e;let s=this.getParent();var i=this.getNextSibling(),o=this.getPreviousSibling();if(Mr(i)&&Mr(o)){if(o=o.getFirstChild(),Ne(o)){o.append(this);var l=i.getFirstChild();Ne(l)&&(l=l.getChildren(),qo(o,l),i.remove(),r.add(i.getKey())),cn(o)}}else Mr(i)?(i=i.getFirstChild(),Ne(i)&&(r=i.getFirstChild(),r!==null&&r.insertBefore(this),cn(i))):Mr(o)?(i=o.getFirstChild(),Ne(i)&&(i.append(this),cn(i))):Ne(s)&&(r=Bn(),l=gn(s.getListType()),r.append(l),l.append(this),o?o.insertAfter(r):i?i.insertBefore(r):s.append(r),cn(l));Ne(s)&&cn(s)}n++}else YO(this),n--;return this}insertBefore(e){if(ft(e)){let n=this.getParentOrThrow();if(Ne(n)){let r=this.getNextSiblings();cn(n,r)}}return super.insertBefore(e)}canInsertAfter(e){return ft(e)}canReplaceWith(e){return ft(e)}canMergeWith(e){return ze.$isParagraphNode(e)||ft(e)}extractWithChild(e,n){if(!ze.$isRangeSelection(n))return!1;e=n.anchor.getNode();let r=n.focus.getNode();return this.isParentOf(e)&&this.isParentOf(r)&&this.getTextContent().length===n.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return gn("bullet")}};function px(t,e,n){let r=[],i=[];var o=(e=e.list)?e.listitem:void 0;if(e&&e.nested)var l=e.nested.listitem;if(o!==void 0&&(o=o.split(" "),r.push(...o)),e){o=n.getParent(),o=Ne(o)&&o.getListType()==="check";let s=n.getChecked();o&&!s||i.push(e.listitemUnchecked),o&&s||i.push(e.listitemChecked),o&&r.push(s?e.listitemChecked:e.listitemUnchecked)}l!==void 0&&(l=l.split(" "),n.getChildren().some(s=>Ne(s))?r.push(...l):i.push(...l)),0<i.length&&fo.removeClassNamesFromElement(t,...i),0<r.length&&fo.addClassNamesToElement(t,...r)}function mx(t,e,n){Ne(e.getFirstChild())?(t.removeAttribute("role"),t.removeAttribute("tabIndex"),t.removeAttribute("aria-checked")):(t.setAttribute("role","checkbox"),t.setAttribute("tabIndex","-1"),n&&e.__checked===n.__checked||t.setAttribute("aria-checked",e.getChecked()?"true":"false"))}function XO(t){return t=fo.isHTMLElement(t)&&t.getAttribute("aria-checked")==="true",{node:Bn(t)}}function Bn(t){return ze.$applyNodeReplacement(new Df(void 0,t))}function ft(t){return t instanceof Df}let kv=class GE extends ze.ElementNode{static getType(){return"list"}static clone(e){return new GE(e.__listType||yx[e.__tag],e.__start,e.__key)}constructor(e,n,r){super(r),this.__listType=e=yx[e]||e,this.__tag=e==="number"?"ol":"ul",this.__start=n}getTag(){return this.__tag}setListType(e){let n=this.getWritable();n.__listType=e,n.__tag=e==="number"?"ol":"ul"}getListType(){return this.__listType}getStart(){return this.__start}createDOM(e){let n=document.createElement(this.__tag);return this.__start!==1&&n.setAttribute("start",String(this.__start)),n.__lexicalListType=this.__listType,gx(n,e.theme,this),n}updateDOM(e,n,r){return e.__tag!==this.__tag?!0:(gx(n,r.theme,this),!1)}static importDOM(){return{ol:()=>({conversion:vx,priority:0}),ul:()=>({conversion:vx,priority:0})}}static importJSON(e){let n=gn(e.listType,e.start);return n.setFormat(e.format),n.setIndent(e.indent),n.setDirection(e.direction),n}exportDOM(e){return{element:e}=super.exportDOM(e),e&&fo.isHTMLElement(e)&&(this.__start!==1&&e.setAttribute("start",String(this.__start)),this.__listType==="check"&&e.setAttribute("__lexicalListType","check")),{element:e}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag(),type:"list",version:1}}canBeEmpty(){return!1}canIndent(){return!1}append(...e){for(let r=0;r<e.length;r++){var n=e[r];if(ft(n))super.append(n);else{let i=Bn();Ne(n)||ze.$isElementNode(n)&&(n=ze.$createTextNode(n.getTextContent())),i.append(n),super.append(i)}}return cn(this),this}extractWithChild(e){return ft(e)}};function gx(t,e,n){let r=[],i=[];var o=e.list;if(o!==void 0){let s=o[`${n.__tag}Depth`]||[];e=WE(n)-1;let a=e%s.length;var l=s[a];let u=o[n.__tag],c;if(o=o.nested,o!==void 0&&o.list&&(c=o.list),u!==void 0&&r.push(u),l!==void 0)for(l=l.split(" "),r.push(...l),l=0;l<s.length;l++)l!==a&&i.push(n.__tag+l);c!==void 0&&(n=c.split(" "),1<e?r.push(...n):i.push(...n))}0<i.length&&fo.removeClassNamesFromElement(t,...i),0<r.length&&fo.addClassNamesToElement(t,...r)}function JO(t){let e=[];for(let r=0;r<t.length;r++){var n=t[r];ft(n)?(e.push(n),n=n.getChildren(),1<n.length&&n.forEach(i=>{Ne(i)&&e.push(fx(i))})):e.push(fx(n))}return e}function vx(t){let e=t.nodeName.toLowerCase(),n=null;return e==="ol"?n=gn("number",t.start):e==="ul"&&(n=fo.isHTMLElement(t)&&t.getAttribute("__lexicallisttype")==="check"?gn("check"):gn("bullet")),{after:JO,node:n}}let yx={ol:"number",ul:"bullet"};function gn(t,e=1){return ze.$applyNodeReplacement(new kv(t,e))}function Ne(t){return t instanceof kv}let QO=ze.createCommand("INSERT_UNORDERED_LIST_COMMAND"),qO=ze.createCommand("INSERT_ORDERED_LIST_COMMAND"),eP=ze.createCommand("INSERT_CHECK_LIST_COMMAND"),tP=ze.createCommand("REMOVE_LIST_COMMAND");wn.$createListItemNode=Bn;wn.$createListNode=gn;wn.$getListDepth=WE;wn.$handleListInsertParagraph=function(){var t=ze.$getSelection();if(!ze.$isRangeSelection(t)||!t.isCollapsed()||(t=t.anchor.getNode(),!ft(t)||t.getChildrenSize()!==0))return!1;var e=$m(t),n=t.getParent();Ne(n)||ms(40);let r=n.getParent(),i;if(ze.$isRootOrShadowRoot(r))i=ze.$createParagraphNode(),e.insertAfter(i);else if(ft(r))i=Bn(),r.insertAfter(i);else return!1;if(i.select(),e=t.getNextSiblings(),0<e.length){let o=gn(n.getListType());ze.$isParagraphNode(i)?i.insertAfter(o):(n=Bn(),n.append(o),i.insertAfter(n)),e.forEach(l=>{l.remove(),o.append(l)})}return GO(t),!0};wn.$isListItemNode=ft;wn.$isListNode=Ne;wn.INSERT_CHECK_LIST_COMMAND=eP;wn.INSERT_ORDERED_LIST_COMMAND=qO;wn.INSERT_UNORDERED_LIST_COMMAND=QO;wn.ListItemNode=Df;wn.ListNode=kv;wn.REMOVE_LIST_COMMAND=tP;wn.insertList=function(t,e){t.update(()=>{var n=ze.$getSelection();if(ze.$isRangeSelection(n)||ze.DEPRECATED_$isGridSelection(n)){var r=n.getNodes();n=n.anchor.getNode();var i=n.getParent();if(HE(n,r))r=gn(e),ze.$isRootOrShadowRoot(i)?(n.replace(r),i=Bn(),ze.$isElementNode(n)&&(i.setFormat(n.getFormatType()),i.setIndent(n.getIndent())),r.append(i)):ft(n)&&(n=n.getParentOrThrow(),qo(r,n.getChildren()),n.replace(r));else for(n=new Set,i=0;i<r.length;i++){var o=r[i];if(ze.$isElementNode(o)&&o.isEmpty()&&!n.has(o.getKey()))hx(o,e);else if(ze.$isLeafNode(o))for(o=o.getParent();o!=null;){let s=o.getKey();if(Ne(o)){if(!n.has(s)){var l=gn(e);qo(l,o.getChildren()),o.replace(l),cn(l),n.add(s)}break}else{if(l=o.getParent(),ze.$isRootOrShadowRoot(l)&&!n.has(s)){n.add(s),hx(o,e);break}o=l}}}}})};wn.removeList=function(t){t.update(()=>{let e=ze.$getSelection();if(ze.$isRangeSelection(e)){var n=new Set,r=e.getNodes(),i=e.anchor.getNode();if(HE(i,r))n.add($m(i));else for(i=0;i<r.length;i++){var o=r[i];ze.$isLeafNode(o)&&(o=fo.$getNearestNodeOfType(o,Df),o!=null&&n.add($m(o)))}for(let l of n){n=l,r=VE(l);for(let s of r)r=ze.$createParagraphNode(),qo(r,s.getChildren()),n.insertAfter(r),n=r,s.__key===e.anchor.key&&e.anchor.set(r.getKey(),0,"element"),s.__key===e.focus.key&&e.focus.set(r.getKey(),0,"element"),s.remove();l.remove()}}})};const nP=wn;var Ui=nP,YE={},If={},XE=p;function rP(t){let e=new URLSearchParams;e.append("code",t);for(let n=1;n<arguments.length;n++)e.append("v",arguments[n]);throw Error(`Minified Lexical error #${t}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}let JE=XE.createContext(null);If.LexicalComposerContext=JE;If.createLexicalComposerContext=function(t,e){let n=null;return t!=null&&(n=t[1]),{getTheme:function(){return e??(n!=null?n.getTheme():null)}}};If.useLexicalComposerContext=function(){let t=XE.useContext(JE);return t==null&&rP(8),t};const iP=If;var Nr=iP,xx=Nr,ga=_e,Fd=p;let QE=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";var oP=QE?Fd.useLayoutEffect:Fd.useEffect;let xc={tag:"history-merge"};function lP(t,e){if(e!==null){if(e===void 0)t.update(()=>{var n=ga.$getRoot();if(n.isEmpty()){let r=ga.$createParagraphNode();n.append(r),n=QE?document.activeElement:null,(ga.$getSelection()!==null||n!==null&&n===t.getRootElement())&&r.select()}},xc);else if(e!==null)switch(typeof e){case"string":let n=t.parseEditorState(e);t.setEditorState(n,xc);break;case"object":t.setEditorState(e,xc);break;case"function":t.update(()=>{ga.$getRoot().isEmpty()&&e(t)},xc)}}}YE.LexicalComposer=function({initialConfig:t,children:e}){let n=Fd.useMemo(()=>{const{theme:r,namespace:i,editor__DEPRECATED:o,nodes:l,onError:s,editorState:a}=t,u=xx.createLexicalComposerContext(null,r);let c=o||null;if(c===null){const d=ga.createEditor({editable:t.editable,namespace:i,nodes:l,onError:f=>s(f,d),theme:r});lP(d,a),c=d}return[c,u]},[]);return oP(()=>{let r=t.editable,[i]=n;i.setEditable(r!==void 0?r:!0)},[]),Fd.createElement(xx.LexicalComposerContext.Provider,{value:n},e)};const sP=YE;var aP=sP,La=p;function Tm(t,e){return Tm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},Tm(t,e)}function uP(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,Tm(t,e)}function cP(t,e){return t===void 0&&(t=[]),e===void 0&&(e=[]),t.length!==e.length||t.some(function(n,r){return!Object.is(n,e[r])})}var _x={error:null},dP=function(t){function e(){for(var r,i=arguments.length,o=Array(i),l=0;l<i;l++)o[l]=arguments[l];return r=t.call.apply(t,[this].concat(o))||this,r.state=_x,r.resetErrorBoundary=function(){for(var s,a=arguments.length,u=Array(a),c=0;c<a;c++)u[c]=arguments[c];r.props.onReset==null||(s=r.props).onReset.apply(s,u),r.reset()},r}uP(e,t),e.getDerivedStateFromError=function(r){return{error:r}};var n=e.prototype;return n.reset=function(){this.setState(_x)},n.componentDidCatch=function(r,i){var o,l;(o=(l=this.props).onError)==null||o.call(l,r,i)},n.componentDidUpdate=function(r,i){var o=this.props.resetKeys;if(this.state.error!==null&&i.error!==null&&cP(r.resetKeys,o)){var l,s;(l=(s=this.props).onResetKeysChange)==null||l.call(s,r.resetKeys,o),this.reset()}},n.render=function(){var r=this.state.error,i=this.props,o=i.fallbackRender,l=i.FallbackComponent;if(i=i.fallback,r!==null){if(r={error:r,resetErrorBoundary:this.resetErrorBoundary},La.isValidElement(i))return i;if(typeof o=="function")return o(r);if(l)return La.createElement(l,r);throw Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},e}(La.Component),fP=function({children:t,onError:e}){return La.createElement(dP,{fallback:La.createElement("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"}},"An error was thrown."),onError:e},t)};const hP=fP;var pP=hP;const mP=Ou(pP);var bv={},$v={},gP=Ft,Ye=_e;function vP(t,e,n,r,i){if(t===null||n.size===0&&r.size===0&&!i)return 0;var o=e._selection,l=t._selection;if(i)return 1;if(!(Ye.$isRangeSelection(o)&&Ye.$isRangeSelection(l)&&l.isCollapsed()&&o.isCollapsed()))return 0;i=e._nodeMap;let s=[];for(let a of n)n=i.get(a),n!==void 0&&s.push(n);for(let[a,u]of r)u&&(r=i.get(a),r===void 0||Ye.$isRootNode(r)||s.push(r));return s.length===0?0:1<s.length?(r=e._nodeMap,e=r.get(o.anchor.key),l=r.get(l.anchor.key),e&&l&&!t._nodeMap.has(e.__key)&&Ye.$isTextNode(e)&&e.__text.length===1&&o.anchor.offset===1?2:0):(e=s[0],t=t._nodeMap.get(e.__key),!Ye.$isTextNode(t)||!Ye.$isTextNode(e)||t.__mode!==e.__mode||(t=t.__text,e=e.__text,t===e)||(o=o.anchor,l=l.anchor,o.key!==l.key||o.type!=="text")?0:(o=o.offset,l=l.offset,t=e.length-t.length,t===1&&l===o-1?2:t===-1&&l===o+1?3:t===-1&&l===o?4:0))}function yP(t,e){let n=Date.now(),r=0;return(i,o,l,s,a,u)=>{let c=Date.now();if(u.has("historic"))return r=0,n=c,2;let d=vP(i,o,s,a,t.isComposing()),f=(()=>{var h=l===null||l.editor===t,g=u.has("history-push");if(!g&&h&&u.has("history-merge"))return 0;if(i===null)return 1;var m=o._selection;if(!(0<s.size||0<a.size))return m!==null?0:2;if(g===!1&&d!==0&&d===r&&c<n+e&&h)return 0;if(s.size===1){{g=Array.from(s)[0],h=i._nodeMap.get(g),g=o._nodeMap.get(g),m=i._selection;let w=o._selection,v=!1;Ye.$isRangeSelection(m)&&Ye.$isRangeSelection(w)&&(v=m.anchor.type==="element"&&m.focus.type==="element"&&w.anchor.type==="text"&&w.focus.type==="text"),h=!v&&Ye.$isTextNode(h)&&Ye.$isTextNode(g)?h.__type===g.__type&&h.__text===g.__text&&h.__mode===g.__mode&&h.__detail===g.__detail&&h.__style===g.__style&&h.__format===g.__format&&h.__parent===g.__parent:!1}if(h)return 0}return 1})();return n=c,r=d,f}}$v.createEmptyHistoryState=function(){return{current:null,redoStack:[],undoStack:[]}};$v.registerHistory=function(t,e,n){let r=yP(t,n);n=({editorState:l,prevEditorState:s,dirtyLeaves:a,dirtyElements:u,tags:c})=>{const d=e.current,f=e.redoStack,h=e.undoStack,g=d===null?null:d.editorState;if(d===null||l!==g){if(s=r(s,l,d,a,u,c),s===1)f.length!==0&&(e.redoStack=[],t.dispatchCommand(Ye.CAN_REDO_COMMAND,!1)),d!==null&&(h.push({...d}),t.dispatchCommand(Ye.CAN_UNDO_COMMAND,!0));else if(s===2)return;e.current={editor:t,editorState:l}}};let i=gP.mergeRegister(t.registerCommand(Ye.UNDO_COMMAND,()=>{let l=e.redoStack,s=e.undoStack;if(s.length!==0){let a=e.current,u=s.pop();a!==null&&(l.push(a),t.dispatchCommand(Ye.CAN_REDO_COMMAND,!0)),s.length===0&&t.dispatchCommand(Ye.CAN_UNDO_COMMAND,!1),e.current=u||null,u&&u.editor.setEditorState(u.editorState,{tag:"historic"})}return!0},Ye.COMMAND_PRIORITY_EDITOR),t.registerCommand(Ye.REDO_COMMAND,()=>{let l=e.redoStack;var s=e.undoStack;if(l.length!==0){let a=e.current;a!==null&&(s.push(a),t.dispatchCommand(Ye.CAN_UNDO_COMMAND,!0)),s=l.pop(),l.length===0&&t.dispatchCommand(Ye.CAN_REDO_COMMAND,!1),e.current=s||null,s&&s.editor.setEditorState(s.editorState,{tag:"historic"})}return!0},Ye.COMMAND_PRIORITY_EDITOR),t.registerCommand(Ye.CLEAR_EDITOR_COMMAND,()=>(e.undoStack=[],e.redoStack=[],e.current=null,!1),Ye.COMMAND_PRIORITY_EDITOR),t.registerCommand(Ye.CLEAR_HISTORY_COMMAND,()=>(e.undoStack=[],e.redoStack=[],e.current=null,t.dispatchCommand(Ye.CAN_REDO_COMMAND,!1),t.dispatchCommand(Ye.CAN_UNDO_COMMAND,!1),!0),Ye.COMMAND_PRIORITY_EDITOR),t.registerUpdateListener(n)),o=t.registerUpdateListener(n);return()=>{i(),o()}};const xP=$v;var _P=xP,wP=Nr,Nm=_P,wx=p;function SP(t,e,n=1e3){let r=wx.useMemo(()=>e||Nm.createEmptyHistoryState(),[e]);wx.useEffect(()=>Nm.registerHistory(t,r,n),[n,t,r])}bv.createEmptyHistoryState=Nm.createEmptyHistoryState;bv.HistoryPlugin=function({externalHistoryState:t}){let[e]=wP.useLexicalComposerContext();return SP(e,t),null};const EP=bv;var CP=EP,qE={},kP=Nr,Da=p,bP=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?Da.useLayoutEffect:Da.useEffect;function $P(t){let[e]=kP.useLexicalComposerContext(),n=Da.useMemo(()=>t(e),[e,t]),r=Da.useRef(n.initialValueFn()),[i,o]=Da.useState(r.current);return bP(()=>{let{initialValueFn:l,subscribe:s}=n,a=l();return r.current!==a&&(r.current=a,o(a)),s(u=>{r.current=u,o(u)})},[n,t]),i}function TP(t){return{initialValueFn:()=>t.isEditable(),subscribe:e=>t.registerEditableListener(e)}}var NP=function(){return $P(TP)};const RP=NP;var OP=RP,So={},dn=_e;function Tv(t,e=!0){return t?!1:(t=eC(),e&&(t=t.trim()),t==="")}function eC(){return dn.$getRoot().getTextContent()}function tC(t){if(!Tv(t,!1))return!1;t=dn.$getRoot().getChildren();let e=t.length;if(1<e)return!1;for(let r=0;r<e;r++){var n=t[r];if(dn.$isDecoratorNode(n))return!1;if(dn.$isElementNode(n)){if(!dn.$isParagraphNode(n)||n.__indent!==0)return!1;n=n.getChildren();let i=n.length;for(let o=0;o<i;o++)if(!dn.$isTextNode(n[r]))return!1}}return!0}So.$canShowPlaceholder=tC;So.$canShowPlaceholderCurry=function(t){return()=>tC(t)};So.$findTextIntersectionFromCharacters=function(t,e){var n=t.getFirstChild();t=0;e:for(;n!==null;){if(dn.$isElementNode(n)){var r=n.getFirstChild();if(r!==null){n=r;continue}}else if(dn.$isTextNode(n)){if(r=n.getTextContentSize(),t+r>e)return{node:n,offset:e-t};t+=r}if(r=n.getNextSibling(),r!==null)n=r;else{for(n=n.getParent();n!==null;){if(r=n.getNextSibling(),r!==null){n=r;continue e}n=n.getParent()}break}}return null};So.$isRootTextContentEmpty=Tv;So.$isRootTextContentEmptyCurry=function(t,e){return()=>Tv(t,e)};So.$rootTextContent=eC;So.registerLexicalTextEntity=function(t,e,n,r){let i=l=>{const s=dn.$createTextNode(l.getTextContent());s.setFormat(l.getFormat()),l.replace(s)},o=t.registerNodeTransform(dn.TextNode,l=>{if(l.isSimpleText()){var s=l.getPreviousSibling(),a=l.getTextContent(),u=l;if(dn.$isTextNode(s)){var c=s.getTextContent(),d=e(c+a);if(s instanceof n){if(d===null||s.getLatest().__mode!==0){i(s);return}if(d=d.end-c.length,0<d){u=a.slice(0,d),u=c+u,s.select(),s.setTextContent(u),d===a.length?l.remove():(s=a.slice(d),l.setTextContent(s));return}}else if(d===null||d.start<c.length)return}for(;;){if(l=e(a),a=d=l===null?"":a.slice(l.end),d===""){if(c=u.getNextSibling(),dn.$isTextNode(c)){if(d=u.getTextContent()+c.getTextContent(),d=e(d),d===null){c instanceof n?i(c):c.markDirty();break}else if(d.start!==0)break}}else if(c=e(d),c!==null&&c.start===0)break;if(l===null)break;if(l.start===0&&dn.$isTextNode(s)&&s.isTextEntity())continue;let f;if(l.start===0?[f,u]=u.splitText(l.end):[,f,u]=u.splitText(l.start,l.end),l=r(f),l.setFormat(f.getFormat()),f.replace(l),u==null)break}}});return t=t.registerNodeTransform(n,l=>{var s=l.getTextContent();const a=e(s);a===null||a.start!==0?i(l):s.length>a.end?l.splitText(a.end):(s=l.getPreviousSibling(),dn.$isTextNode(s)&&s.isTextEntity()&&(i(s),i(l)),s=l.getNextSibling(),dn.$isTextNode(s)&&s.isTextEntity()&&(i(s),l instanceof n&&i(l)))}),[o,t]};const PP=So;var AP=PP,nC={},_c=_e;nC.registerDragonSupport=function(t){let e=window.location.origin,n=r=>{if(r.origin===e){var i=t.getRootElement();if(document.activeElement===i&&(i=r.data,typeof i=="string")){try{var o=JSON.parse(i)}catch{return}if(o&&o.protocol==="nuanria_messaging"&&o.type==="request"&&(o=o.payload)&&o.functionId==="makeChanges"&&(o=o.args)){const[l,s,a,u,c]=o;t.update(()=>{const d=_c.$getSelection();if(_c.$isRangeSelection(d)){var f=d.anchor;let h=f.getNode(),g=0,m=0;_c.$isTextNode(h)&&0<=l&&0<=s&&(g=l,m=l+s,d.setTextNodeRange(h,g,h,m)),(g!==m||a!=="")&&(d.insertRawText(a),h=f.getNode()),_c.$isTextNode(h)&&(g=u,m=u+c,f=h.getTextContentSize(),g=g>f?f:g,m=m>f?f:m,d.setTextNodeRange(h,g,h,m)),r.stopImmediatePropagation()}})}}}};return window.addEventListener("message",n,!0),()=>{window.removeEventListener("message",n,!0)}};const MP=nC;var LP=MP,qr={},bi={},Nv={},Sx=co,DP=Ft,Ul=_e;function rC(t,e,n,r=null){let i=r!=null?e.isSelected(r):!0,o=Ul.$isElementNode(e)&&e.excludeFromCopy("html");var l=e;r!==null&&(l=Sx.$cloneWithProperties(e),l=Ul.$isTextNode(l)&&r!=null?Sx.$sliceSelectedTextNodeContent(r,l):l);let s=Ul.$isElementNode(l)?l.getChildren():[],{element:a,after:u}=l.exportDOM(t);if(!a)return!1;let c=document.createDocumentFragment();for(let d=0;d<s.length;d++){let f=s[d],h=rC(t,f,c,r);!i&&Ul.$isElementNode(e)&&h&&e.extractWithChild(f,r,"html")&&(i=!0)}return i&&!o?(DP.isHTMLElement(a)&&a.append(c),n.append(a),u&&(t=u.call(l,a))&&a.replaceWith(t)):n.append(c),i}let iC=new Set(["STYLE","SCRIPT"]);function oC(t,e,n=new Map,r){let i=[];if(iC.has(t.nodeName))return i;let o=null;var l,{nodeName:s}=t,a=e._htmlConversions.get(s.toLowerCase());if(s=null,a!==void 0)for(l of a)a=l(t),a!==null&&(s===null||s.priority<a.priority)&&(s=a);if(s=(l=s!==null?s.conversion:null)?l(t):null,l=null,s!==null){if(l=s.after,a=s.node,o=Array.isArray(a)?a[a.length-1]:a,o!==null){for(var[,u]of n)if(o=u(o,r),!o)break;o&&i.push(...Array.isArray(a)?a:[o])}s.forChild!=null&&n.set(t.nodeName,s.forChild)}for(t=t.childNodes,r=[],u=0;u<t.length;u++)r.push(...oC(t[u],e,new Map(n),o));return l!=null&&(r=l(r)),o==null?i=i.concat(r):Ul.$isElementNode(o)&&o.append(...r),i}Nv.$generateHtmlFromNodes=function(t,e){if(typeof document>"u"||typeof window>"u")throw Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");let n=document.createElement("div"),r=Ul.$getRoot().getChildren();for(let i=0;i<r.length;i++)rC(t,r[i],n,e);return n.innerHTML};Nv.$generateNodesFromDOM=function(t,e){e=e.body?e.body.childNodes:[];let n=[];for(let i=0;i<e.length;i++){var r=e[i];iC.has(r.nodeName)||(r=oC(r,t),r!==null&&(n=n.concat(r)))}return n};const IP=Nv;var jP=IP,lC=jP,Rm=co,es=Ft,pe=_e;function si(t){let e=new URLSearchParams;e.append("code",t);for(let n=1;n<arguments.length;n++)e.append("v",arguments[n]);throw Error(`Minified Lexical error #${t}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}let sC=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function aC(t){let e=pe.$getSelection();if(e==null)throw Error("Expected valid LexicalSelection");return pe.$isRangeSelection(e)&&e.isCollapsed()||e.getNodes().length===0?"":lC.$generateHtmlFromNodes(t,e)}function uC(t){let e=pe.$getSelection();if(e==null)throw Error("Expected valid LexicalSelection");return pe.$isRangeSelection(e)&&e.isCollapsed()||e.getNodes().length===0?null:JSON.stringify(dC(t,e))}function Om(t,e,n){(pe.DEPRECATED_$isGridSelection(n)||es.$findMatchingParent(n.anchor.getNode(),r=>pe.DEPRECATED_$isGridCellNode(r))!==null&&es.$findMatchingParent(n.focus.getNode(),r=>pe.DEPRECATED_$isGridCellNode(r))!==null)&&e.length===1&&pe.DEPRECATED_$isGridNode(e[0])?FP(e,n,!1,t):zP(e,n)}function zP(t,e){let n=[],r=null;for(let i=0;i<t.length;i++){let o=t[i],l=pe.$isLineBreakNode(o);if(l||pe.$isDecoratorNode(o)&&o.isInline()||pe.$isElementNode(o)&&o.isInline()||pe.$isTextNode(o)||o.isParentRequired()){if(r===null&&(r=o.createParentElementNode(),n.push(r),l))continue;r!==null&&r.append(o)}else n.push(o),r=null}pe.$isRangeSelection(e)?e.insertNodes(n):pe.DEPRECATED_$isGridSelection(e)&&(t=e.anchor.getNode(),pe.DEPRECATED_$isGridCellNode(t)||si(41),t.append(...n))}function FP(t,e,n,r){t.length===1&&pe.DEPRECATED_$isGridNode(t[0])||si(42);var i=t[0];t=i.getChildren(),n=i.getFirstChildOrThrow().getChildrenSize();var o=i.getChildrenSize(),l=es.$findMatchingParent(e.anchor.getNode(),h=>pe.DEPRECATED_$isGridCellNode(h));e=(i=l&&es.$findMatchingParent(l,h=>pe.DEPRECATED_$isGridRowNode(h)))&&es.$findMatchingParent(i,h=>pe.DEPRECATED_$isGridNode(h)),pe.DEPRECATED_$isGridCellNode(l)&&pe.DEPRECATED_$isGridRowNode(i)&&pe.DEPRECATED_$isGridNode(e)||si(43);var s=i.getIndexWithinParent(),a=Math.min(e.getChildrenSize()-1,s+o-1);o=l.getIndexWithinParent(),l=Math.min(i.getChildrenSize()-1,o+n-1),n=Math.min(o,l),i=Math.min(s,a),o=Math.max(o,l),s=Math.max(s,a),a=e.getChildren(),l=0;let u,c;for(let h=i;h<=s;h++){var d=a[h];pe.DEPRECATED_$isGridRowNode(d)||si(24);var f=t[l];pe.DEPRECATED_$isGridRowNode(f)||si(24),d=d.getChildren(),f=f.getChildren();let g=0;for(let m=n;m<=o;m++){let w=d[m];pe.DEPRECATED_$isGridCellNode(w)||si(25);let v=f[g];pe.DEPRECATED_$isGridCellNode(v)||si(25),h===i&&m===n?u=w.getKey():h===s&&m===o&&(c=w.getKey());let y=w.getChildren();v.getChildren().forEach(_=>{pe.$isTextNode(_)&&pe.$createParagraphNode().append(_),w.append(_)}),y.forEach(_=>_.remove()),g++}l++}u&&c&&(t=pe.DEPRECATED_$createGridSelection(),t.set(e.getKey(),u,c),pe.$setSelection(t),r.dispatchCommand(pe.SELECTION_CHANGE_COMMAND,void 0))}function cC(t,e,n,r=[]){let i=e!=null?n.isSelected(e):!0,o=pe.$isElementNode(n)&&n.excludeFromCopy("html");var l=n;if(e!==null){var s=Rm.$cloneWithProperties(n);l=s=pe.$isTextNode(s)&&e!=null?Rm.$sliceSelectedTextNodeContent(e,s):s}let a=pe.$isElementNode(l)?l.getChildren():[];var u=l;s=u.exportJSON();var c=u.constructor;s.type!==c.getType()&&si(58,c.name);let d=s.children;for(pe.$isElementNode(u)&&(Array.isArray(d)||si(59,c.name)),pe.$isTextNode(l)&&(l=l.__text,0<l.length?s.text=l:i=!1),l=0;l<a.length;l++)u=a[l],c=cC(t,e,u,s.children),!i&&pe.$isElementNode(n)&&c&&n.extractWithChild(u,e,"clone")&&(i=!0);if(i&&!o)r.push(s);else if(Array.isArray(s.children))for(t=0;t<s.children.length;t++)r.push(s.children[t]);return i}function dC(t,e){let n=[],r=pe.$getRoot().getChildren();for(let i=0;i<r.length;i++)cC(t,e,r[i],n);return{namespace:t._config.namespace,nodes:n}}function fC(t){let e=[];for(let n=0;n<t.length;n++){let r=pe.$parseSerializedNode(t[n]);pe.$isTextNode(r)&&Rm.$addNodeStyle(r),e.push(r)}return e}let _l=null;function Ex(t,e){var n=sC?(t._window||window).getSelection():null;if(!n)return!1;var r=n.anchorNode;if(n=n.focusNode,r!==null&&n!==null&&!pe.isSelectionWithinEditor(t,r,n)||(e.preventDefault(),e=e.clipboardData,r=pe.$getSelection(),e===null||r===null))return!1;n=aC(t),t=uC(t);let i="";return r!==null&&(i=r.getTextContent()),n!==null&&e.setData("text/html",n),t!==null&&e.setData("application/x-lexical-editor",t),e.setData("text/plain",i),!0}bi.$generateJSONFromSelectedNodes=dC;bi.$generateNodesFromSerializedNodes=fC;bi.$getHtmlContent=aC;bi.$getLexicalContent=uC;bi.$insertDataTransferForPlainText=function(t,e){t=t.getData("text/plain")||t.getData("text/uri-list"),t!=null&&e.insertRawText(t)};bi.$insertDataTransferForRichText=function(t,e,n){var r=t.getData("application/x-lexical-editor");if(r)try{let l=JSON.parse(r);if(l.namespace===n._config.namespace&&Array.isArray(l.nodes)){let s=fC(l.nodes);return Om(n,s,e)}}catch{}if(r=t.getData("text/html"))try{var i=new DOMParser().parseFromString(r,"text/html"),o=lC.$generateNodesFromDOM(n,i);return Om(n,o,e)}catch{}if(t=t.getData("text/plain")||t.getData("text/uri-list"),t!=null)if(pe.$isRangeSelection(e))for(t=t.split(/(\r?\n|\t)/),n=t.length,i=0;i<n;i++)o=t[i],o===`
|
|
127
|
+
`),i=s.length,!se.$isTextNode(r)||n>=i)s=r.getParent(),r.remove(),s==null||s.getChildrenSize()!==0||se.$isRootNode(s)||s.remove(),n-=i+l,r=o;else{let a=r.getKey();l=t.getEditorState().read(()=>{const c=se.$getNodeByKey(a);return se.$isTextNode(c)&&c.isSimpleText()?c.getTextContent():null}),o=i-n;let u=s.slice(0,o);l!==null&&l!==s?(n=se.$getPreviousSelection(),i=r,r.isSimpleText()?r.setTextContent(l):(i=se.$createTextNode(l),r.replace(i)),se.$isRangeSelection(n)&&n.isCollapsed()&&(n=n.anchor.offset,i.select(n,n))):r.isSimpleText()?(l=e.key===a,s=e.offset,s<n&&(s=i),n=l?s-n:0,i=l?s:o,l&&n===0?([n]=r.splitText(n,i),n.remove()):([,n]=r.splitText(n,i),n.remove())):(n=se.$createTextNode(u),r.replace(n)),n=0}}};const VO=Ut;var co=VO,HO=co,Et=_e;function KO(t){let e=new URLSearchParams;e.append("code",t);for(let n=1;n<arguments.length;n++)e.append("v",arguments[n]);throw Error(`Minified Lexical error #${t}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function BE(t,e){for(let n of e)if(t.type.startsWith(n))return!0;return!1}function UE(t,e){for(;t!==Et.$getRoot()&&t!=null;){if(e(t))return t;t=t.getParent()}return null}$t.$splitNode=Et.$splitNode;$t.isHTMLAnchorElement=Et.isHTMLAnchorElement;$t.isHTMLElement=Et.isHTMLElement;$t.$dfs=function(t,e){let n=[];t=(t||Et.$getRoot()).getLatest(),e=e||(Et.$isElementNode(t)?t.getLastDescendant():t);for(var r=t,i=0;(r=r.getParent())!==null;)i++;for(r=i;t!==null&&!t.is(e);)if(n.push({depth:r,node:t}),Et.$isElementNode(t)&&0<t.getChildrenSize())t=t.getFirstChild(),r++;else for(i=null;i===null&&t!==null;)i=t.getNextSibling(),i===null?(t=t.getParent(),r--):t=i;return t!==null&&t.is(e)&&n.push({depth:r,node:t}),n};$t.$filter=function(t,e){let n=[];for(let r=0;r<t.length;r++){let i=e(t[r]);i!==null&&n.push(i)}return n};$t.$findMatchingParent=UE;$t.$getNearestBlockElementAncestorOrThrow=function(t){let e=UE(t,n=>Et.$isElementNode(n)&&!n.isInline());return Et.$isElementNode(e)||KO(4,t.__key),e};$t.$getNearestNodeOfType=function(t,e){for(;t!=null;){if(t instanceof e)return t;t=t.getParent()}return null};$t.$insertFirst=function(t,e){let n=t.getFirstChild();n!==null?n.insertBefore(e):t.append(e)};$t.$insertNodeToNearestRoot=function(t){var e=Et.$getSelection()||Et.$getPreviousSelection();if(Et.$isRangeSelection(e)){var{focus:n}=e;if(e=n.getNode(),n=n.offset,Et.$isRootOrShadowRoot(e))n=e.getChildAtIndex(n),n==null?e.append(t):n.insertBefore(t),t.selectNext();else{let r,i;Et.$isTextNode(e)?(r=e.getParentOrThrow(),i=e.getIndexWithinParent(),0<n&&(i+=1,e.splitText(n))):(r=e,i=n),[,e]=Et.$splitNode(r,i),e.insertBefore(t),e.selectStart()}}else Et.$isNodeSelection(e)||Et.DEPRECATED_$isGridSelection(e)?(e=e.getNodes(),e[e.length-1].getTopLevelElementOrThrow().insertAfter(t)):Et.$getRoot().append(t),e=Et.$createParagraphNode(),t.insertAfter(e),e.select();return t.getLatest()};$t.$restoreEditorState=function(t,e){let n=new Map,r=t._pendingEditorState;for(let[i,o]of e._nodeMap){let l=HO.$cloneWithProperties(o);Et.$isTextNode(l)&&(l.__text=o.__text),n.set(i,l)}r&&(r._nodeMap=n),t._dirtyType=2,t=e._selection,Et.$setSelection(t===null?null:t.clone())};$t.$wrapNodeInElement=function(t,e){return e=e(),t.replace(e),e.append(t),e};$t.addClassNamesToElement=function(t,...e){e.forEach(n=>{typeof n=="string"&&(n=n.split(" ").filter(r=>r!==""),t.classList.add(...n))})};$t.isMimeType=BE;$t.mediaFileReader=function(t,e){let n=t[Symbol.iterator]();return new Promise((r,i)=>{let o=[],l=()=>{const{done:s,value:a}=n.next();if(s)return r(o);const u=new FileReader;u.addEventListener("error",i),u.addEventListener("load",()=>{const c=u.result;typeof c=="string"&&o.push({file:a,result:c}),l()}),BE(a,e)?u.readAsDataURL(a):l()};l()})};$t.mergeRegister=function(...t){return()=>{t.forEach(e=>e())}};$t.objectKlassEquals=function(t,e){return t!==null?Object.getPrototypeOf(t).constructor.name===e.name:!1};$t.registerNestedElementResolver=function(t,e,n,r){return t.registerNodeTransform(e,i=>{e:{for(var o=i.getChildren(),l=0;l<o.length;l++)if(o[l]instanceof e){o=null;break e}for(o=i;o!==null;)if(l=o,o=o.getParent(),o instanceof e){o={child:l,parent:o};break e}o=null}if(o!==null){const{child:s,parent:a}=o;if(s.is(i)){if(r(a,i),i=s.getNextSiblings(),o=i.length,a.insertAfter(s),o!==0){l=n(a),s.insertAfter(l);for(let u=0;u<o;u++)l.append(i[u])}a.canBeEmpty()||a.getChildrenSize()!==0||a.remove()}}})};$t.removeClassNamesFromElement=function(t,...e){e.forEach(n=>{typeof n=="string"&&t.classList.remove(...n.split(" "))})};const ZO=$t;var Ft=ZO,ze=_e,fo=Ft;function gs(t){let e=new URLSearchParams;e.append("code",t);for(let n=1;n<arguments.length;n++)e.append("v",arguments[n]);throw Error(`Minified Lexical error #${t}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function WE(t){let e=1;for(t=t.getParent();t!=null;){if(ft(t)){if(t=t.getParent(),Ne(t)){e++,t=t.getParent();continue}gs(40)}break}return e}function $m(t){t=t.getParent(),Ne(t)||gs(40);let e=t;for(;e!==null;)e=e.getParent(),Ne(e)&&(t=e);return t}function VE(t){let e=[];t=t.getChildren().filter(ft);for(let n=0;n<t.length;n++){let r=t[n],i=r.getFirstChild();Ne(i)?e=e.concat(VE(i)):e.push(r)}return e}function Mr(t){return ft(t)&&Ne(t.getFirstChild())}function GO(t){for(;t.getNextSibling()==null&&t.getPreviousSibling()==null;){let e=t.getParent();if(e==null||!ft(t)&&!Ne(t))break;t=e}t.remove()}function fx(t){return Bn().append(t)}function HE(t,e){return ft(t)&&(e.length===0||e.length===1&&t.is(e[0])&&t.getChildrenSize()===0)}function qo(t,e){t.splice(t.getChildrenSize(),0,e)}function hx(t,e){if(Ne(t))return t;let n=t.getPreviousSibling(),r=t.getNextSibling(),i=Bn();return i.setFormat(t.getFormatType()),i.setIndent(t.getIndent()),qo(i,t.getChildren()),Ne(n)&&e===n.getListType()?(n.append(i),t.remove(),Ne(r)&&e===r.getListType()&&(qo(n,r.getChildren()),r.remove()),n):Ne(r)&&e===r.getListType()?(r.getFirstChildOrThrow().insertBefore(i),t.remove(),r):(e=gn(e),e.append(i),t.replace(e),cn(e),e)}function KE(t,e){var n=t.getLastChild();let r=e.getFirstChild();n&&r&&Mr(n)&&Mr(r)&&(KE(n.getFirstChild(),r.getFirstChild()),r.remove()),n=e.getChildren(),0<n.length&&(t.append(...n),cn(t)),e.remove()}function cn(t,e){if(t=e||t.getChildren(),t!==void 0)for(e=0;e<t.length;e++){let o=t[e];if(ft(o)){let l=o.getValue();var n=o,r=n.getParent(),i=1;for(r!=null&&(Ne(r)?i=r.getStart():gs(44)),n=n.getPreviousSiblings(),r=0;r<n.length;r++){let s=n[r];ft(s)&&!Ne(s.getFirstChild())&&i++}l!==i&&o.setValue(i)}}}function YO(t){if(!Mr(t)){var e=t.getParent(),n=e?e.getParent():void 0,r=n?n.getParent():void 0;if(Ne(r)&&ft(n)&&Ne(e)){var i=e?e.getFirstChild():void 0,o=e?e.getLastChild():void 0;if(t.is(i))n.insertBefore(t),e.isEmpty()&&n.remove();else if(t.is(o))n.insertAfter(t),e.isEmpty()&&n.remove();else{var l=e.getListType();i=Bn();let s=gn(l);i.append(s),t.getPreviousSiblings().forEach(a=>s.append(a)),o=Bn(),l=gn(l),o.append(l),qo(l,t.getNextSiblings()),n.insertBefore(i),n.insertAfter(o),n.replace(t)}cn(e),cn(r)}}}let Df=class ZE extends ze.ElementNode{static getType(){return"listitem"}static clone(e){return new ZE(e.__value,e.__checked,e.__key)}constructor(e,n,r){super(r),this.__value=e===void 0?1:e,this.__checked=n}createDOM(e){let n=document.createElement("li"),r=this.getParent();return Ne(r)&&r.getListType()==="check"&&mx(n,this,null),n.value=this.__value,px(n,e.theme,this),n}updateDOM(e,n,r){let i=this.getParent();return Ne(i)&&i.getListType()==="check"&&mx(n,this,e),n.value=this.__value,px(n,r.theme,this),!1}static transform(){return e=>{let n=e.getParent();Ne(n)&&(cn(n),n.getListType()!=="check"&&e.getChecked()!=null&&e.setChecked(void 0))}}static importDOM(){return{li:()=>({conversion:XO,priority:0})}}static importJSON(e){let n=Bn();return n.setChecked(e.checked),n.setValue(e.value),n.setFormat(e.format),n.setDirection(e.direction),n}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),type:"listitem",value:this.getValue(),version:1}}append(...e){for(let n=0;n<e.length;n++){let r=e[n];if(ze.$isElementNode(r)&&this.canMergeWith(r)){let i=r.getChildren();this.append(...i),r.remove()}else super.append(r)}return this}replace(e,n){if(ft(e))return super.replace(e);this.setIndent(0);let r=this.getParentOrThrow();if(!Ne(r))return e;if(r.__first===this.getKey())r.insertBefore(e);else if(r.__last===this.getKey())r.insertAfter(e);else{let i=gn(r.getListType()),o=this.getNextSibling();for(;o;){let l=o;o=o.getNextSibling(),i.append(l)}r.insertAfter(e),e.insertAfter(i)}return n&&this.getChildren().forEach(i=>{e.append(i)}),this.remove(),r.getChildrenSize()===0&&r.remove(),e}insertAfter(e,n=!0){var r=this.getParentOrThrow();Ne(r)||gs(39);var i=this.getNextSiblings();if(ft(e))return n=super.insertAfter(e,n),e=e.getParentOrThrow(),Ne(e)&&cn(e),n;if(Ne(e)){for(r=e,e=e.getChildren(),i=e.length-1;0<=i;i--)r=e[i],this.insertAfter(r,n);return r}if(r.insertAfter(e,n),i.length!==0){let o=gn(r.getListType());i.forEach(l=>o.append(l)),e.insertAfter(o,n)}return e}remove(e){let n=this.getPreviousSibling(),r=this.getNextSibling();super.remove(e),n&&r&&Mr(n)&&Mr(r)?(KE(n.getFirstChild(),r.getFirstChild()),r.remove()):r&&(e=r.getParent(),Ne(e)&&cn(e))}insertNewAfter(e,n=!0){return e=Bn(this.__checked==null?void 0:!1),this.insertAfter(e,n),e}collapseAtStart(e){let n=ze.$createParagraphNode();this.getChildren().forEach(l=>n.append(l));var r=this.getParentOrThrow(),i=r.getParentOrThrow();let o=ft(i);return r.getChildrenSize()===1?o?(r.remove(),i.select()):(r.insertBefore(n),r.remove(),r=e.anchor,e=e.focus,i=n.getKey(),r.type==="element"&&r.getNode().is(this)&&r.set(i,r.offset,"element"),e.type==="element"&&e.getNode().is(this)&&e.set(i,e.offset,"element")):(r.insertBefore(n),this.remove()),!0}getValue(){return this.getLatest().__value}setValue(e){this.getWritable().__value=e}getChecked(){return this.getLatest().__checked}setChecked(e){this.getWritable().__checked=e}toggleChecked(){this.setChecked(!this.__checked)}getIndent(){var e=this.getParent();if(e===null)return this.getLatest().__indent;e=e.getParentOrThrow();let n=0;for(;ft(e);)e=e.getParentOrThrow().getParentOrThrow(),n++;return n}setIndent(e){typeof e=="number"&&-1<e||gs(117);let n=this.getIndent();for(;n!==e;)if(n<e){e:{var r=new Set;if(Mr(this)||r.has(this.getKey()))break e;let s=this.getParent();var i=this.getNextSibling(),o=this.getPreviousSibling();if(Mr(i)&&Mr(o)){if(o=o.getFirstChild(),Ne(o)){o.append(this);var l=i.getFirstChild();Ne(l)&&(l=l.getChildren(),qo(o,l),i.remove(),r.add(i.getKey())),cn(o)}}else Mr(i)?(i=i.getFirstChild(),Ne(i)&&(r=i.getFirstChild(),r!==null&&r.insertBefore(this),cn(i))):Mr(o)?(i=o.getFirstChild(),Ne(i)&&(i.append(this),cn(i))):Ne(s)&&(r=Bn(),l=gn(s.getListType()),r.append(l),l.append(this),o?o.insertAfter(r):i?i.insertBefore(r):s.append(r),cn(l));Ne(s)&&cn(s)}n++}else YO(this),n--;return this}insertBefore(e){if(ft(e)){let n=this.getParentOrThrow();if(Ne(n)){let r=this.getNextSiblings();cn(n,r)}}return super.insertBefore(e)}canInsertAfter(e){return ft(e)}canReplaceWith(e){return ft(e)}canMergeWith(e){return ze.$isParagraphNode(e)||ft(e)}extractWithChild(e,n){if(!ze.$isRangeSelection(n))return!1;e=n.anchor.getNode();let r=n.focus.getNode();return this.isParentOf(e)&&this.isParentOf(r)&&this.getTextContent().length===n.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return gn("bullet")}};function px(t,e,n){let r=[],i=[];var o=(e=e.list)?e.listitem:void 0;if(e&&e.nested)var l=e.nested.listitem;if(o!==void 0&&(o=o.split(" "),r.push(...o)),e){o=n.getParent(),o=Ne(o)&&o.getListType()==="check";let s=n.getChecked();o&&!s||i.push(e.listitemUnchecked),o&&s||i.push(e.listitemChecked),o&&r.push(s?e.listitemChecked:e.listitemUnchecked)}l!==void 0&&(l=l.split(" "),n.getChildren().some(s=>Ne(s))?r.push(...l):i.push(...l)),0<i.length&&fo.removeClassNamesFromElement(t,...i),0<r.length&&fo.addClassNamesToElement(t,...r)}function mx(t,e,n){Ne(e.getFirstChild())?(t.removeAttribute("role"),t.removeAttribute("tabIndex"),t.removeAttribute("aria-checked")):(t.setAttribute("role","checkbox"),t.setAttribute("tabIndex","-1"),n&&e.__checked===n.__checked||t.setAttribute("aria-checked",e.getChecked()?"true":"false"))}function XO(t){return t=fo.isHTMLElement(t)&&t.getAttribute("aria-checked")==="true",{node:Bn(t)}}function Bn(t){return ze.$applyNodeReplacement(new Df(void 0,t))}function ft(t){return t instanceof Df}let kv=class GE extends ze.ElementNode{static getType(){return"list"}static clone(e){return new GE(e.__listType||yx[e.__tag],e.__start,e.__key)}constructor(e,n,r){super(r),this.__listType=e=yx[e]||e,this.__tag=e==="number"?"ol":"ul",this.__start=n}getTag(){return this.__tag}setListType(e){let n=this.getWritable();n.__listType=e,n.__tag=e==="number"?"ol":"ul"}getListType(){return this.__listType}getStart(){return this.__start}createDOM(e){let n=document.createElement(this.__tag);return this.__start!==1&&n.setAttribute("start",String(this.__start)),n.__lexicalListType=this.__listType,gx(n,e.theme,this),n}updateDOM(e,n,r){return e.__tag!==this.__tag?!0:(gx(n,r.theme,this),!1)}static importDOM(){return{ol:()=>({conversion:vx,priority:0}),ul:()=>({conversion:vx,priority:0})}}static importJSON(e){let n=gn(e.listType,e.start);return n.setFormat(e.format),n.setIndent(e.indent),n.setDirection(e.direction),n}exportDOM(e){return{element:e}=super.exportDOM(e),e&&fo.isHTMLElement(e)&&(this.__start!==1&&e.setAttribute("start",String(this.__start)),this.__listType==="check"&&e.setAttribute("__lexicalListType","check")),{element:e}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag(),type:"list",version:1}}canBeEmpty(){return!1}canIndent(){return!1}append(...e){for(let r=0;r<e.length;r++){var n=e[r];if(ft(n))super.append(n);else{let i=Bn();Ne(n)||ze.$isElementNode(n)&&(n=ze.$createTextNode(n.getTextContent())),i.append(n),super.append(i)}}return cn(this),this}extractWithChild(e){return ft(e)}};function gx(t,e,n){let r=[],i=[];var o=e.list;if(o!==void 0){let s=o[`${n.__tag}Depth`]||[];e=WE(n)-1;let a=e%s.length;var l=s[a];let u=o[n.__tag],c;if(o=o.nested,o!==void 0&&o.list&&(c=o.list),u!==void 0&&r.push(u),l!==void 0)for(l=l.split(" "),r.push(...l),l=0;l<s.length;l++)l!==a&&i.push(n.__tag+l);c!==void 0&&(n=c.split(" "),1<e?r.push(...n):i.push(...n))}0<i.length&&fo.removeClassNamesFromElement(t,...i),0<r.length&&fo.addClassNamesToElement(t,...r)}function JO(t){let e=[];for(let r=0;r<t.length;r++){var n=t[r];ft(n)?(e.push(n),n=n.getChildren(),1<n.length&&n.forEach(i=>{Ne(i)&&e.push(fx(i))})):e.push(fx(n))}return e}function vx(t){let e=t.nodeName.toLowerCase(),n=null;return e==="ol"?n=gn("number",t.start):e==="ul"&&(n=fo.isHTMLElement(t)&&t.getAttribute("__lexicallisttype")==="check"?gn("check"):gn("bullet")),{after:JO,node:n}}let yx={ol:"number",ul:"bullet"};function gn(t,e=1){return ze.$applyNodeReplacement(new kv(t,e))}function Ne(t){return t instanceof kv}let QO=ze.createCommand("INSERT_UNORDERED_LIST_COMMAND"),qO=ze.createCommand("INSERT_ORDERED_LIST_COMMAND"),eP=ze.createCommand("INSERT_CHECK_LIST_COMMAND"),tP=ze.createCommand("REMOVE_LIST_COMMAND");wn.$createListItemNode=Bn;wn.$createListNode=gn;wn.$getListDepth=WE;wn.$handleListInsertParagraph=function(){var t=ze.$getSelection();if(!ze.$isRangeSelection(t)||!t.isCollapsed()||(t=t.anchor.getNode(),!ft(t)||t.getChildrenSize()!==0))return!1;var e=$m(t),n=t.getParent();Ne(n)||gs(40);let r=n.getParent(),i;if(ze.$isRootOrShadowRoot(r))i=ze.$createParagraphNode(),e.insertAfter(i);else if(ft(r))i=Bn(),r.insertAfter(i);else return!1;if(i.select(),e=t.getNextSiblings(),0<e.length){let o=gn(n.getListType());ze.$isParagraphNode(i)?i.insertAfter(o):(n=Bn(),n.append(o),i.insertAfter(n)),e.forEach(l=>{l.remove(),o.append(l)})}return GO(t),!0};wn.$isListItemNode=ft;wn.$isListNode=Ne;wn.INSERT_CHECK_LIST_COMMAND=eP;wn.INSERT_ORDERED_LIST_COMMAND=qO;wn.INSERT_UNORDERED_LIST_COMMAND=QO;wn.ListItemNode=Df;wn.ListNode=kv;wn.REMOVE_LIST_COMMAND=tP;wn.insertList=function(t,e){t.update(()=>{var n=ze.$getSelection();if(ze.$isRangeSelection(n)||ze.DEPRECATED_$isGridSelection(n)){var r=n.getNodes();n=n.anchor.getNode();var i=n.getParent();if(HE(n,r))r=gn(e),ze.$isRootOrShadowRoot(i)?(n.replace(r),i=Bn(),ze.$isElementNode(n)&&(i.setFormat(n.getFormatType()),i.setIndent(n.getIndent())),r.append(i)):ft(n)&&(n=n.getParentOrThrow(),qo(r,n.getChildren()),n.replace(r));else for(n=new Set,i=0;i<r.length;i++){var o=r[i];if(ze.$isElementNode(o)&&o.isEmpty()&&!n.has(o.getKey()))hx(o,e);else if(ze.$isLeafNode(o))for(o=o.getParent();o!=null;){let s=o.getKey();if(Ne(o)){if(!n.has(s)){var l=gn(e);qo(l,o.getChildren()),o.replace(l),cn(l),n.add(s)}break}else{if(l=o.getParent(),ze.$isRootOrShadowRoot(l)&&!n.has(s)){n.add(s),hx(o,e);break}o=l}}}}})};wn.removeList=function(t){t.update(()=>{let e=ze.$getSelection();if(ze.$isRangeSelection(e)){var n=new Set,r=e.getNodes(),i=e.anchor.getNode();if(HE(i,r))n.add($m(i));else for(i=0;i<r.length;i++){var o=r[i];ze.$isLeafNode(o)&&(o=fo.$getNearestNodeOfType(o,Df),o!=null&&n.add($m(o)))}for(let l of n){n=l,r=VE(l);for(let s of r)r=ze.$createParagraphNode(),qo(r,s.getChildren()),n.insertAfter(r),n=r,s.__key===e.anchor.key&&e.anchor.set(r.getKey(),0,"element"),s.__key===e.focus.key&&e.focus.set(r.getKey(),0,"element"),s.remove();l.remove()}}})};const nP=wn;var Ui=nP,YE={},If={},XE=p;function rP(t){let e=new URLSearchParams;e.append("code",t);for(let n=1;n<arguments.length;n++)e.append("v",arguments[n]);throw Error(`Minified Lexical error #${t}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}let JE=XE.createContext(null);If.LexicalComposerContext=JE;If.createLexicalComposerContext=function(t,e){let n=null;return t!=null&&(n=t[1]),{getTheme:function(){return e??(n!=null?n.getTheme():null)}}};If.useLexicalComposerContext=function(){let t=XE.useContext(JE);return t==null&&rP(8),t};const iP=If;var Nr=iP,xx=Nr,ga=_e,Fd=p;let QE=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";var oP=QE?Fd.useLayoutEffect:Fd.useEffect;let xc={tag:"history-merge"};function lP(t,e){if(e!==null){if(e===void 0)t.update(()=>{var n=ga.$getRoot();if(n.isEmpty()){let r=ga.$createParagraphNode();n.append(r),n=QE?document.activeElement:null,(ga.$getSelection()!==null||n!==null&&n===t.getRootElement())&&r.select()}},xc);else if(e!==null)switch(typeof e){case"string":let n=t.parseEditorState(e);t.setEditorState(n,xc);break;case"object":t.setEditorState(e,xc);break;case"function":t.update(()=>{ga.$getRoot().isEmpty()&&e(t)},xc)}}}YE.LexicalComposer=function({initialConfig:t,children:e}){let n=Fd.useMemo(()=>{const{theme:r,namespace:i,editor__DEPRECATED:o,nodes:l,onError:s,editorState:a}=t,u=xx.createLexicalComposerContext(null,r);let c=o||null;if(c===null){const d=ga.createEditor({editable:t.editable,namespace:i,nodes:l,onError:f=>s(f,d),theme:r});lP(d,a),c=d}return[c,u]},[]);return oP(()=>{let r=t.editable,[i]=n;i.setEditable(r!==void 0?r:!0)},[]),Fd.createElement(xx.LexicalComposerContext.Provider,{value:n},e)};const sP=YE;var aP=sP,La=p;function Tm(t,e){return Tm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},Tm(t,e)}function uP(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,Tm(t,e)}function cP(t,e){return t===void 0&&(t=[]),e===void 0&&(e=[]),t.length!==e.length||t.some(function(n,r){return!Object.is(n,e[r])})}var _x={error:null},dP=function(t){function e(){for(var r,i=arguments.length,o=Array(i),l=0;l<i;l++)o[l]=arguments[l];return r=t.call.apply(t,[this].concat(o))||this,r.state=_x,r.resetErrorBoundary=function(){for(var s,a=arguments.length,u=Array(a),c=0;c<a;c++)u[c]=arguments[c];r.props.onReset==null||(s=r.props).onReset.apply(s,u),r.reset()},r}uP(e,t),e.getDerivedStateFromError=function(r){return{error:r}};var n=e.prototype;return n.reset=function(){this.setState(_x)},n.componentDidCatch=function(r,i){var o,l;(o=(l=this.props).onError)==null||o.call(l,r,i)},n.componentDidUpdate=function(r,i){var o=this.props.resetKeys;if(this.state.error!==null&&i.error!==null&&cP(r.resetKeys,o)){var l,s;(l=(s=this.props).onResetKeysChange)==null||l.call(s,r.resetKeys,o),this.reset()}},n.render=function(){var r=this.state.error,i=this.props,o=i.fallbackRender,l=i.FallbackComponent;if(i=i.fallback,r!==null){if(r={error:r,resetErrorBoundary:this.resetErrorBoundary},La.isValidElement(i))return i;if(typeof o=="function")return o(r);if(l)return La.createElement(l,r);throw Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},e}(La.Component),fP=function({children:t,onError:e}){return La.createElement(dP,{fallback:La.createElement("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"}},"An error was thrown."),onError:e},t)};const hP=fP;var pP=hP;const mP=Ou(pP);var bv={},$v={},gP=Ft,Ye=_e;function vP(t,e,n,r,i){if(t===null||n.size===0&&r.size===0&&!i)return 0;var o=e._selection,l=t._selection;if(i)return 1;if(!(Ye.$isRangeSelection(o)&&Ye.$isRangeSelection(l)&&l.isCollapsed()&&o.isCollapsed()))return 0;i=e._nodeMap;let s=[];for(let a of n)n=i.get(a),n!==void 0&&s.push(n);for(let[a,u]of r)u&&(r=i.get(a),r===void 0||Ye.$isRootNode(r)||s.push(r));return s.length===0?0:1<s.length?(r=e._nodeMap,e=r.get(o.anchor.key),l=r.get(l.anchor.key),e&&l&&!t._nodeMap.has(e.__key)&&Ye.$isTextNode(e)&&e.__text.length===1&&o.anchor.offset===1?2:0):(e=s[0],t=t._nodeMap.get(e.__key),!Ye.$isTextNode(t)||!Ye.$isTextNode(e)||t.__mode!==e.__mode||(t=t.__text,e=e.__text,t===e)||(o=o.anchor,l=l.anchor,o.key!==l.key||o.type!=="text")?0:(o=o.offset,l=l.offset,t=e.length-t.length,t===1&&l===o-1?2:t===-1&&l===o+1?3:t===-1&&l===o?4:0))}function yP(t,e){let n=Date.now(),r=0;return(i,o,l,s,a,u)=>{let c=Date.now();if(u.has("historic"))return r=0,n=c,2;let d=vP(i,o,s,a,t.isComposing()),f=(()=>{var h=l===null||l.editor===t,g=u.has("history-push");if(!g&&h&&u.has("history-merge"))return 0;if(i===null)return 1;var m=o._selection;if(!(0<s.size||0<a.size))return m!==null?0:2;if(g===!1&&d!==0&&d===r&&c<n+e&&h)return 0;if(s.size===1){{g=Array.from(s)[0],h=i._nodeMap.get(g),g=o._nodeMap.get(g),m=i._selection;let w=o._selection,v=!1;Ye.$isRangeSelection(m)&&Ye.$isRangeSelection(w)&&(v=m.anchor.type==="element"&&m.focus.type==="element"&&w.anchor.type==="text"&&w.focus.type==="text"),h=!v&&Ye.$isTextNode(h)&&Ye.$isTextNode(g)?h.__type===g.__type&&h.__text===g.__text&&h.__mode===g.__mode&&h.__detail===g.__detail&&h.__style===g.__style&&h.__format===g.__format&&h.__parent===g.__parent:!1}if(h)return 0}return 1})();return n=c,r=d,f}}$v.createEmptyHistoryState=function(){return{current:null,redoStack:[],undoStack:[]}};$v.registerHistory=function(t,e,n){let r=yP(t,n);n=({editorState:l,prevEditorState:s,dirtyLeaves:a,dirtyElements:u,tags:c})=>{const d=e.current,f=e.redoStack,h=e.undoStack,g=d===null?null:d.editorState;if(d===null||l!==g){if(s=r(s,l,d,a,u,c),s===1)f.length!==0&&(e.redoStack=[],t.dispatchCommand(Ye.CAN_REDO_COMMAND,!1)),d!==null&&(h.push({...d}),t.dispatchCommand(Ye.CAN_UNDO_COMMAND,!0));else if(s===2)return;e.current={editor:t,editorState:l}}};let i=gP.mergeRegister(t.registerCommand(Ye.UNDO_COMMAND,()=>{let l=e.redoStack,s=e.undoStack;if(s.length!==0){let a=e.current,u=s.pop();a!==null&&(l.push(a),t.dispatchCommand(Ye.CAN_REDO_COMMAND,!0)),s.length===0&&t.dispatchCommand(Ye.CAN_UNDO_COMMAND,!1),e.current=u||null,u&&u.editor.setEditorState(u.editorState,{tag:"historic"})}return!0},Ye.COMMAND_PRIORITY_EDITOR),t.registerCommand(Ye.REDO_COMMAND,()=>{let l=e.redoStack;var s=e.undoStack;if(l.length!==0){let a=e.current;a!==null&&(s.push(a),t.dispatchCommand(Ye.CAN_UNDO_COMMAND,!0)),s=l.pop(),l.length===0&&t.dispatchCommand(Ye.CAN_REDO_COMMAND,!1),e.current=s||null,s&&s.editor.setEditorState(s.editorState,{tag:"historic"})}return!0},Ye.COMMAND_PRIORITY_EDITOR),t.registerCommand(Ye.CLEAR_EDITOR_COMMAND,()=>(e.undoStack=[],e.redoStack=[],e.current=null,!1),Ye.COMMAND_PRIORITY_EDITOR),t.registerCommand(Ye.CLEAR_HISTORY_COMMAND,()=>(e.undoStack=[],e.redoStack=[],e.current=null,t.dispatchCommand(Ye.CAN_REDO_COMMAND,!1),t.dispatchCommand(Ye.CAN_UNDO_COMMAND,!1),!0),Ye.COMMAND_PRIORITY_EDITOR),t.registerUpdateListener(n)),o=t.registerUpdateListener(n);return()=>{i(),o()}};const xP=$v;var _P=xP,wP=Nr,Nm=_P,wx=p;function SP(t,e,n=1e3){let r=wx.useMemo(()=>e||Nm.createEmptyHistoryState(),[e]);wx.useEffect(()=>Nm.registerHistory(t,r,n),[n,t,r])}bv.createEmptyHistoryState=Nm.createEmptyHistoryState;bv.HistoryPlugin=function({externalHistoryState:t}){let[e]=wP.useLexicalComposerContext();return SP(e,t),null};const EP=bv;var CP=EP,qE={},kP=Nr,Da=p,bP=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?Da.useLayoutEffect:Da.useEffect;function $P(t){let[e]=kP.useLexicalComposerContext(),n=Da.useMemo(()=>t(e),[e,t]),r=Da.useRef(n.initialValueFn()),[i,o]=Da.useState(r.current);return bP(()=>{let{initialValueFn:l,subscribe:s}=n,a=l();return r.current!==a&&(r.current=a,o(a)),s(u=>{r.current=u,o(u)})},[n,t]),i}function TP(t){return{initialValueFn:()=>t.isEditable(),subscribe:e=>t.registerEditableListener(e)}}var NP=function(){return $P(TP)};const RP=NP;var OP=RP,So={},dn=_e;function Tv(t,e=!0){return t?!1:(t=eC(),e&&(t=t.trim()),t==="")}function eC(){return dn.$getRoot().getTextContent()}function tC(t){if(!Tv(t,!1))return!1;t=dn.$getRoot().getChildren();let e=t.length;if(1<e)return!1;for(let r=0;r<e;r++){var n=t[r];if(dn.$isDecoratorNode(n))return!1;if(dn.$isElementNode(n)){if(!dn.$isParagraphNode(n)||n.__indent!==0)return!1;n=n.getChildren();let i=n.length;for(let o=0;o<i;o++)if(!dn.$isTextNode(n[r]))return!1}}return!0}So.$canShowPlaceholder=tC;So.$canShowPlaceholderCurry=function(t){return()=>tC(t)};So.$findTextIntersectionFromCharacters=function(t,e){var n=t.getFirstChild();t=0;e:for(;n!==null;){if(dn.$isElementNode(n)){var r=n.getFirstChild();if(r!==null){n=r;continue}}else if(dn.$isTextNode(n)){if(r=n.getTextContentSize(),t+r>e)return{node:n,offset:e-t};t+=r}if(r=n.getNextSibling(),r!==null)n=r;else{for(n=n.getParent();n!==null;){if(r=n.getNextSibling(),r!==null){n=r;continue e}n=n.getParent()}break}}return null};So.$isRootTextContentEmpty=Tv;So.$isRootTextContentEmptyCurry=function(t,e){return()=>Tv(t,e)};So.$rootTextContent=eC;So.registerLexicalTextEntity=function(t,e,n,r){let i=l=>{const s=dn.$createTextNode(l.getTextContent());s.setFormat(l.getFormat()),l.replace(s)},o=t.registerNodeTransform(dn.TextNode,l=>{if(l.isSimpleText()){var s=l.getPreviousSibling(),a=l.getTextContent(),u=l;if(dn.$isTextNode(s)){var c=s.getTextContent(),d=e(c+a);if(s instanceof n){if(d===null||s.getLatest().__mode!==0){i(s);return}if(d=d.end-c.length,0<d){u=a.slice(0,d),u=c+u,s.select(),s.setTextContent(u),d===a.length?l.remove():(s=a.slice(d),l.setTextContent(s));return}}else if(d===null||d.start<c.length)return}for(;;){if(l=e(a),a=d=l===null?"":a.slice(l.end),d===""){if(c=u.getNextSibling(),dn.$isTextNode(c)){if(d=u.getTextContent()+c.getTextContent(),d=e(d),d===null){c instanceof n?i(c):c.markDirty();break}else if(d.start!==0)break}}else if(c=e(d),c!==null&&c.start===0)break;if(l===null)break;if(l.start===0&&dn.$isTextNode(s)&&s.isTextEntity())continue;let f;if(l.start===0?[f,u]=u.splitText(l.end):[,f,u]=u.splitText(l.start,l.end),l=r(f),l.setFormat(f.getFormat()),f.replace(l),u==null)break}}});return t=t.registerNodeTransform(n,l=>{var s=l.getTextContent();const a=e(s);a===null||a.start!==0?i(l):s.length>a.end?l.splitText(a.end):(s=l.getPreviousSibling(),dn.$isTextNode(s)&&s.isTextEntity()&&(i(s),i(l)),s=l.getNextSibling(),dn.$isTextNode(s)&&s.isTextEntity()&&(i(s),l instanceof n&&i(l)))}),[o,t]};const PP=So;var AP=PP,nC={},_c=_e;nC.registerDragonSupport=function(t){let e=window.location.origin,n=r=>{if(r.origin===e){var i=t.getRootElement();if(document.activeElement===i&&(i=r.data,typeof i=="string")){try{var o=JSON.parse(i)}catch{return}if(o&&o.protocol==="nuanria_messaging"&&o.type==="request"&&(o=o.payload)&&o.functionId==="makeChanges"&&(o=o.args)){const[l,s,a,u,c]=o;t.update(()=>{const d=_c.$getSelection();if(_c.$isRangeSelection(d)){var f=d.anchor;let h=f.getNode(),g=0,m=0;_c.$isTextNode(h)&&0<=l&&0<=s&&(g=l,m=l+s,d.setTextNodeRange(h,g,h,m)),(g!==m||a!=="")&&(d.insertRawText(a),h=f.getNode()),_c.$isTextNode(h)&&(g=u,m=u+c,f=h.getTextContentSize(),g=g>f?f:g,m=m>f?f:m,d.setTextNodeRange(h,g,h,m)),r.stopImmediatePropagation()}})}}}};return window.addEventListener("message",n,!0),()=>{window.removeEventListener("message",n,!0)}};const MP=nC;var LP=MP,qr={},bi={},Nv={},Sx=co,DP=Ft,Wl=_e;function rC(t,e,n,r=null){let i=r!=null?e.isSelected(r):!0,o=Wl.$isElementNode(e)&&e.excludeFromCopy("html");var l=e;r!==null&&(l=Sx.$cloneWithProperties(e),l=Wl.$isTextNode(l)&&r!=null?Sx.$sliceSelectedTextNodeContent(r,l):l);let s=Wl.$isElementNode(l)?l.getChildren():[],{element:a,after:u}=l.exportDOM(t);if(!a)return!1;let c=document.createDocumentFragment();for(let d=0;d<s.length;d++){let f=s[d],h=rC(t,f,c,r);!i&&Wl.$isElementNode(e)&&h&&e.extractWithChild(f,r,"html")&&(i=!0)}return i&&!o?(DP.isHTMLElement(a)&&a.append(c),n.append(a),u&&(t=u.call(l,a))&&a.replaceWith(t)):n.append(c),i}let iC=new Set(["STYLE","SCRIPT"]);function oC(t,e,n=new Map,r){let i=[];if(iC.has(t.nodeName))return i;let o=null;var l,{nodeName:s}=t,a=e._htmlConversions.get(s.toLowerCase());if(s=null,a!==void 0)for(l of a)a=l(t),a!==null&&(s===null||s.priority<a.priority)&&(s=a);if(s=(l=s!==null?s.conversion:null)?l(t):null,l=null,s!==null){if(l=s.after,a=s.node,o=Array.isArray(a)?a[a.length-1]:a,o!==null){for(var[,u]of n)if(o=u(o,r),!o)break;o&&i.push(...Array.isArray(a)?a:[o])}s.forChild!=null&&n.set(t.nodeName,s.forChild)}for(t=t.childNodes,r=[],u=0;u<t.length;u++)r.push(...oC(t[u],e,new Map(n),o));return l!=null&&(r=l(r)),o==null?i=i.concat(r):Wl.$isElementNode(o)&&o.append(...r),i}Nv.$generateHtmlFromNodes=function(t,e){if(typeof document>"u"||typeof window>"u")throw Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");let n=document.createElement("div"),r=Wl.$getRoot().getChildren();for(let i=0;i<r.length;i++)rC(t,r[i],n,e);return n.innerHTML};Nv.$generateNodesFromDOM=function(t,e){e=e.body?e.body.childNodes:[];let n=[];for(let i=0;i<e.length;i++){var r=e[i];iC.has(r.nodeName)||(r=oC(r,t),r!==null&&(n=n.concat(r)))}return n};const IP=Nv;var jP=IP,lC=jP,Rm=co,ts=Ft,pe=_e;function si(t){let e=new URLSearchParams;e.append("code",t);for(let n=1;n<arguments.length;n++)e.append("v",arguments[n]);throw Error(`Minified Lexical error #${t}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}let sC=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function aC(t){let e=pe.$getSelection();if(e==null)throw Error("Expected valid LexicalSelection");return pe.$isRangeSelection(e)&&e.isCollapsed()||e.getNodes().length===0?"":lC.$generateHtmlFromNodes(t,e)}function uC(t){let e=pe.$getSelection();if(e==null)throw Error("Expected valid LexicalSelection");return pe.$isRangeSelection(e)&&e.isCollapsed()||e.getNodes().length===0?null:JSON.stringify(dC(t,e))}function Om(t,e,n){(pe.DEPRECATED_$isGridSelection(n)||ts.$findMatchingParent(n.anchor.getNode(),r=>pe.DEPRECATED_$isGridCellNode(r))!==null&&ts.$findMatchingParent(n.focus.getNode(),r=>pe.DEPRECATED_$isGridCellNode(r))!==null)&&e.length===1&&pe.DEPRECATED_$isGridNode(e[0])?FP(e,n,!1,t):zP(e,n)}function zP(t,e){let n=[],r=null;for(let i=0;i<t.length;i++){let o=t[i],l=pe.$isLineBreakNode(o);if(l||pe.$isDecoratorNode(o)&&o.isInline()||pe.$isElementNode(o)&&o.isInline()||pe.$isTextNode(o)||o.isParentRequired()){if(r===null&&(r=o.createParentElementNode(),n.push(r),l))continue;r!==null&&r.append(o)}else n.push(o),r=null}pe.$isRangeSelection(e)?e.insertNodes(n):pe.DEPRECATED_$isGridSelection(e)&&(t=e.anchor.getNode(),pe.DEPRECATED_$isGridCellNode(t)||si(41),t.append(...n))}function FP(t,e,n,r){t.length===1&&pe.DEPRECATED_$isGridNode(t[0])||si(42);var i=t[0];t=i.getChildren(),n=i.getFirstChildOrThrow().getChildrenSize();var o=i.getChildrenSize(),l=ts.$findMatchingParent(e.anchor.getNode(),h=>pe.DEPRECATED_$isGridCellNode(h));e=(i=l&&ts.$findMatchingParent(l,h=>pe.DEPRECATED_$isGridRowNode(h)))&&ts.$findMatchingParent(i,h=>pe.DEPRECATED_$isGridNode(h)),pe.DEPRECATED_$isGridCellNode(l)&&pe.DEPRECATED_$isGridRowNode(i)&&pe.DEPRECATED_$isGridNode(e)||si(43);var s=i.getIndexWithinParent(),a=Math.min(e.getChildrenSize()-1,s+o-1);o=l.getIndexWithinParent(),l=Math.min(i.getChildrenSize()-1,o+n-1),n=Math.min(o,l),i=Math.min(s,a),o=Math.max(o,l),s=Math.max(s,a),a=e.getChildren(),l=0;let u,c;for(let h=i;h<=s;h++){var d=a[h];pe.DEPRECATED_$isGridRowNode(d)||si(24);var f=t[l];pe.DEPRECATED_$isGridRowNode(f)||si(24),d=d.getChildren(),f=f.getChildren();let g=0;for(let m=n;m<=o;m++){let w=d[m];pe.DEPRECATED_$isGridCellNode(w)||si(25);let v=f[g];pe.DEPRECATED_$isGridCellNode(v)||si(25),h===i&&m===n?u=w.getKey():h===s&&m===o&&(c=w.getKey());let y=w.getChildren();v.getChildren().forEach(_=>{pe.$isTextNode(_)&&pe.$createParagraphNode().append(_),w.append(_)}),y.forEach(_=>_.remove()),g++}l++}u&&c&&(t=pe.DEPRECATED_$createGridSelection(),t.set(e.getKey(),u,c),pe.$setSelection(t),r.dispatchCommand(pe.SELECTION_CHANGE_COMMAND,void 0))}function cC(t,e,n,r=[]){let i=e!=null?n.isSelected(e):!0,o=pe.$isElementNode(n)&&n.excludeFromCopy("html");var l=n;if(e!==null){var s=Rm.$cloneWithProperties(n);l=s=pe.$isTextNode(s)&&e!=null?Rm.$sliceSelectedTextNodeContent(e,s):s}let a=pe.$isElementNode(l)?l.getChildren():[];var u=l;s=u.exportJSON();var c=u.constructor;s.type!==c.getType()&&si(58,c.name);let d=s.children;for(pe.$isElementNode(u)&&(Array.isArray(d)||si(59,c.name)),pe.$isTextNode(l)&&(l=l.__text,0<l.length?s.text=l:i=!1),l=0;l<a.length;l++)u=a[l],c=cC(t,e,u,s.children),!i&&pe.$isElementNode(n)&&c&&n.extractWithChild(u,e,"clone")&&(i=!0);if(i&&!o)r.push(s);else if(Array.isArray(s.children))for(t=0;t<s.children.length;t++)r.push(s.children[t]);return i}function dC(t,e){let n=[],r=pe.$getRoot().getChildren();for(let i=0;i<r.length;i++)cC(t,e,r[i],n);return{namespace:t._config.namespace,nodes:n}}function fC(t){let e=[];for(let n=0;n<t.length;n++){let r=pe.$parseSerializedNode(t[n]);pe.$isTextNode(r)&&Rm.$addNodeStyle(r),e.push(r)}return e}let wl=null;function Ex(t,e){var n=sC?(t._window||window).getSelection():null;if(!n)return!1;var r=n.anchorNode;if(n=n.focusNode,r!==null&&n!==null&&!pe.isSelectionWithinEditor(t,r,n)||(e.preventDefault(),e=e.clipboardData,r=pe.$getSelection(),e===null||r===null))return!1;n=aC(t),t=uC(t);let i="";return r!==null&&(i=r.getTextContent()),n!==null&&e.setData("text/html",n),t!==null&&e.setData("application/x-lexical-editor",t),e.setData("text/plain",i),!0}bi.$generateJSONFromSelectedNodes=dC;bi.$generateNodesFromSerializedNodes=fC;bi.$getHtmlContent=aC;bi.$getLexicalContent=uC;bi.$insertDataTransferForPlainText=function(t,e){t=t.getData("text/plain")||t.getData("text/uri-list"),t!=null&&e.insertRawText(t)};bi.$insertDataTransferForRichText=function(t,e,n){var r=t.getData("application/x-lexical-editor");if(r)try{let l=JSON.parse(r);if(l.namespace===n._config.namespace&&Array.isArray(l.nodes)){let s=fC(l.nodes);return Om(n,s,e)}}catch{}if(r=t.getData("text/html"))try{var i=new DOMParser().parseFromString(r,"text/html"),o=lC.$generateNodesFromDOM(n,i);return Om(n,o,e)}catch{}if(t=t.getData("text/plain")||t.getData("text/uri-list"),t!=null)if(pe.$isRangeSelection(e))for(t=t.split(/(\r?\n|\t)/),n=t.length,i=0;i<n;i++)o=t[i],o===`
|
|
128
128
|
`||o===`\r
|
|
129
|
-
`?e.insertParagraph():o===" "?e.insertNodes([pe.$createTabNode()]):e.insertText(o);else e.insertRawText(t)};bi.$insertGeneratedNodes=Om;bi.copyToClipboard=async function(t,e){if(_l!==null)return!1;if(e!==null)return new Promise(l=>{t.update(()=>{l(Ex(t,e))})});var n=t.getRootElement();let r=t._window==null?window.document:t._window.document,i=sC?(t._window||window).getSelection():null;if(n===null||i===null)return!1;let o=r.createElement("span");return o.style.cssText="position: fixed; top: -1000px;",o.append(r.createTextNode("#")),n.append(o),n=new Range,n.setStart(o,0),n.setEnd(o,1),i.removeAllRanges(),i.addRange(n),new Promise(l=>{let s=t.registerCommand(pe.COPY_COMMAND,a=>(es.objectKlassEquals(a,ClipboardEvent)&&(s(),_l!==null&&(window.clearTimeout(_l),_l=null),l(Ex(t,a))),!0),pe.COMMAND_PRIORITY_CRITICAL);_l=window.setTimeout(()=>{s(),_l=null,l(!1)},50),r.execCommand("copy"),o.remove()})};const BP=bi;var UP=BP,Bd=UP,wc=co,zr=Ft,P=_e;function Cx(t,e){return typeof document.caretRangeFromPoint<"u"?(t=document.caretRangeFromPoint(t,e),t===null?null:{node:t.startContainer,offset:t.startOffset}):document.caretPositionFromPoint!=="undefined"?(t=document.caretPositionFromPoint(t,e),t===null?null:{node:t.offsetNode,offset:t.offset}):null}let Ls=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",WP=Ls&&"documentMode"in document?document.documentMode:null,VP=Ls&&"InputEvent"in window&&!WP?"getTargetRanges"in new window.InputEvent("input"):!1,HP=Ls&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),KP=Ls&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,ZP=Ls&&/^(?=.*Chrome).*/i.test(navigator.userAgent),GP=Ls&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!ZP,Pm=P.createCommand("DRAG_DROP_PASTE_FILE"),Rv=class hC extends P.ElementNode{static getType(){return"quote"}static clone(e){return new hC(e.__key)}constructor(e){super(e)}createDOM(e){let n=document.createElement("blockquote");return zr.addClassNamesToElement(n,e.theme.quote),n}updateDOM(){return!1}static importDOM(){return{blockquote:()=>({conversion:YP,priority:0})}}exportDOM(e){if({element:e}=super.exportDOM(e),e&&zr.isHTMLElement(e)){this.isEmpty()&&e.append(document.createElement("br"));var n=this.getFormatType();e.style.textAlign=n,(n=this.getDirection())&&(e.dir=n)}return{element:e}}static importJSON(e){let n=Ov();return n.setFormat(e.format),n.setIndent(e.indent),n.setDirection(e.direction),n}exportJSON(){return{...super.exportJSON(),type:"quote"}}insertNewAfter(e,n){e=P.$createParagraphNode();let r=this.getDirection();return e.setDirection(r),this.insertAfter(e,n),e}collapseAtStart(){let e=P.$createParagraphNode();return this.getChildren().forEach(n=>e.append(n)),this.replace(e),!0}};function Ov(){return P.$applyNodeReplacement(new Rv)}let Pv=class pC extends P.ElementNode{static getType(){return"heading"}static clone(e){return new pC(e.__tag,e.__key)}constructor(e,n){super(n),this.__tag=e}getTag(){return this.__tag}createDOM(e){let n=this.__tag,r=document.createElement(n);return e=e.theme.heading,e!==void 0&&zr.addClassNamesToElement(r,e[n]),r}updateDOM(){return!1}static importDOM(){return{h1:()=>({conversion:wl,priority:0}),h2:()=>({conversion:wl,priority:0}),h3:()=>({conversion:wl,priority:0}),h4:()=>({conversion:wl,priority:0}),h5:()=>({conversion:wl,priority:0}),h6:()=>({conversion:wl,priority:0}),p:e=>(e=e.firstChild,e!==null&&kx(e)?{conversion:()=>({node:null}),priority:3}:null),span:e=>kx(e)?{conversion:()=>({node:Wl("h1")}),priority:3}:null}}exportDOM(e){if({element:e}=super.exportDOM(e),e&&zr.isHTMLElement(e)){this.isEmpty()&&e.append(document.createElement("br"));var n=this.getFormatType();e.style.textAlign=n,(n=this.getDirection())&&(e.dir=n)}return{element:e}}static importJSON(e){let n=Wl(e.tag);return n.setFormat(e.format),n.setIndent(e.indent),n.setDirection(e.direction),n}exportJSON(){return{...super.exportJSON(),tag:this.getTag(),type:"heading",version:1}}insertNewAfter(e,n=!0){e=e?e.anchor.offset:0,e=0<e&&e<this.getTextContentSize()?Wl(this.getTag()):P.$createParagraphNode();let r=this.getDirection();return e.setDirection(r),this.insertAfter(e,n),e}collapseAtStart(){let e=this.isEmpty()?P.$createParagraphNode():Wl(this.getTag());return this.getChildren().forEach(n=>e.append(n)),this.replace(e),!0}extractWithChild(){return!0}};function kx(t){return t.nodeName.toLowerCase()==="span"?t.style.fontSize==="26pt":!1}function wl(t){let e=t.nodeName.toLowerCase(),n=null;return(e==="h1"||e==="h2"||e==="h3"||e==="h4"||e==="h5"||e==="h6")&&(n=Wl(e),t.style!==null&&n.setFormat(t.style.textAlign)),{node:n}}function YP(t){let e=Ov();return t.style!==null&&e.setFormat(t.style.textAlign),{node:e}}function Wl(t){return P.$applyNodeReplacement(new Pv(t))}function XP(t,e){t.preventDefault(),e.update(()=>{let n=P.$getSelection(),r=t instanceof InputEvent||t instanceof KeyboardEvent?null:t.clipboardData;r!=null&&(P.$isRangeSelection(n)||P.DEPRECATED_$isGridSelection(n))&&Bd.$insertDataTransferForRichText(r,n,e)},{tag:"paste"})}async function JP(t,e){await Bd.copyToClipboard(e,zr.objectKlassEquals(t,ClipboardEvent)?t:null),e.update(()=>{let n=P.$getSelection();P.$isRangeSelection(n)?n.removeText():P.$isNodeSelection(n)&&n.getNodes().forEach(r=>r.remove())})}function va(t){let e=null;if(t instanceof DragEvent?e=t.dataTransfer:t instanceof ClipboardEvent&&(e=t.clipboardData),e===null)return[!1,[],!1];var n=e.types;return t=n.includes("Files"),n=n.includes("text/html")||n.includes("text/plain"),[t,Array.from(e.files),n]}function bx(t){var e=P.$getSelection();if(!P.$isRangeSelection(e))return!1;let n=new Set;e=e.getNodes();for(let o=0;o<e.length;o++){var r=e[o],i=r.getKey();n.has(i)||(r=zr.$getNearestBlockElementAncestorOrThrow(r),i=r.getKey(),r.canIndent()&&!n.has(i)&&(n.add(i),t(r)))}return 0<n.size}function Sc(t){return t=P.$getNearestNodeFromDOMNode(t),P.$isDecoratorNode(t)}qr.$createHeadingNode=Wl;qr.$createQuoteNode=Ov;qr.$isHeadingNode=function(t){return t instanceof Pv};qr.$isQuoteNode=function(t){return t instanceof Rv};qr.DRAG_DROP_PASTE=Pm;qr.HeadingNode=Pv;qr.QuoteNode=Rv;qr.eventFiles=va;qr.registerRichText=function(t){return zr.mergeRegister(t.registerCommand(P.CLICK_COMMAND,()=>{const e=P.$getSelection();return P.$isNodeSelection(e)?(e.clear(),!0):!1},0),t.registerCommand(P.DELETE_CHARACTER_COMMAND,e=>{const n=P.$getSelection();return P.$isRangeSelection(n)?(n.deleteCharacter(e),!0):!1},P.COMMAND_PRIORITY_EDITOR),t.registerCommand(P.DELETE_WORD_COMMAND,e=>{const n=P.$getSelection();return P.$isRangeSelection(n)?(n.deleteWord(e),!0):!1},P.COMMAND_PRIORITY_EDITOR),t.registerCommand(P.DELETE_LINE_COMMAND,e=>{const n=P.$getSelection();return P.$isRangeSelection(n)?(n.deleteLine(e),!0):!1},P.COMMAND_PRIORITY_EDITOR),t.registerCommand(P.CONTROLLED_TEXT_INSERTION_COMMAND,e=>{const n=P.$getSelection();if(typeof e=="string")P.$isRangeSelection(n)?n.insertText(e):P.DEPRECATED_$isGridSelection(n);else{if(!P.$isRangeSelection(n)&&!P.DEPRECATED_$isGridSelection(n))return!1;const r=e.dataTransfer;r!=null?Bd.$insertDataTransferForRichText(r,n,t):P.$isRangeSelection(n)&&(e=e.data)&&n.insertText(e)}return!0},P.COMMAND_PRIORITY_EDITOR),t.registerCommand(P.REMOVE_TEXT_COMMAND,()=>{const e=P.$getSelection();return P.$isRangeSelection(e)?(e.removeText(),!0):!1},P.COMMAND_PRIORITY_EDITOR),t.registerCommand(P.FORMAT_TEXT_COMMAND,e=>{const n=P.$getSelection();return P.$isRangeSelection(n)?(n.formatText(e),!0):!1},P.COMMAND_PRIORITY_EDITOR),t.registerCommand(P.FORMAT_ELEMENT_COMMAND,e=>{var n=P.$getSelection();if(!P.$isRangeSelection(n)&&!P.$isNodeSelection(n))return!1;n=n.getNodes();for(const r of n)n=zr.$findMatchingParent(r,i=>P.$isElementNode(i)&&!i.isInline()),n!==null&&n.setFormat(e);return!0},P.COMMAND_PRIORITY_EDITOR),t.registerCommand(P.INSERT_LINE_BREAK_COMMAND,e=>{const n=P.$getSelection();return P.$isRangeSelection(n)?(n.insertLineBreak(e),!0):!1},P.COMMAND_PRIORITY_EDITOR),t.registerCommand(P.INSERT_PARAGRAPH_COMMAND,()=>{const e=P.$getSelection();return P.$isRangeSelection(e)?(e.insertParagraph(),!0):!1},P.COMMAND_PRIORITY_EDITOR),t.registerCommand(P.INSERT_TAB_COMMAND,()=>(P.$insertNodes([P.$createTabNode()]),!0),P.COMMAND_PRIORITY_EDITOR),t.registerCommand(P.INDENT_CONTENT_COMMAND,()=>bx(e=>{const n=e.getIndent();e.setIndent(n+1)}),P.COMMAND_PRIORITY_EDITOR),t.registerCommand(P.OUTDENT_CONTENT_COMMAND,()=>bx(e=>{const n=e.getIndent();0<n&&e.setIndent(n-1)}),P.COMMAND_PRIORITY_EDITOR),t.registerCommand(P.KEY_ARROW_UP_COMMAND,e=>{var n=P.$getSelection();if(P.$isNodeSelection(n)&&!Sc(e.target)){if(e=n.getNodes(),0<e.length)return e[0].selectPrevious(),!0}else if(P.$isRangeSelection(n)&&(n=P.$getAdjacentNode(n.focus,!0),!e.shiftKey&&P.$isDecoratorNode(n)&&!n.isIsolated()&&!n.isInline()))return n.selectPrevious(),e.preventDefault(),!0;return!1},P.COMMAND_PRIORITY_EDITOR),t.registerCommand(P.KEY_ARROW_DOWN_COMMAND,e=>{var n=P.$getSelection();if(P.$isNodeSelection(n)){if(e=n.getNodes(),0<e.length)return e[0].selectNext(0,0),!0}else if(P.$isRangeSelection(n)){let r=n.focus;if(r.key==="root"&&r.offset===P.$getRoot().getChildrenSize())return e.preventDefault(),!0;if(n=P.$getAdjacentNode(n.focus,!1),!e.shiftKey&&P.$isDecoratorNode(n)&&!n.isIsolated()&&!n.isInline())return n.selectNext(),e.preventDefault(),!0}return!1},P.COMMAND_PRIORITY_EDITOR),t.registerCommand(P.KEY_ARROW_LEFT_COMMAND,e=>{const n=P.$getSelection();if(P.$isNodeSelection(n)){var r=n.getNodes();if(0<r.length)return e.preventDefault(),r[0].selectPrevious(),!0}return P.$isRangeSelection(n)&&wc.$shouldOverrideDefaultCharacterSelection(n,!0)?(r=e.shiftKey,e.preventDefault(),wc.$moveCharacter(n,r,!0),!0):!1},P.COMMAND_PRIORITY_EDITOR),t.registerCommand(P.KEY_ARROW_RIGHT_COMMAND,e=>{const n=P.$getSelection();if(P.$isNodeSelection(n)&&!Sc(e.target)){var r=n.getNodes();if(0<r.length)return e.preventDefault(),r[0].selectNext(0,0),!0}return P.$isRangeSelection(n)?(r=e.shiftKey,wc.$shouldOverrideDefaultCharacterSelection(n,!1)?(e.preventDefault(),wc.$moveCharacter(n,r,!1),!0):!1):!1},P.COMMAND_PRIORITY_EDITOR),t.registerCommand(P.KEY_BACKSPACE_COMMAND,e=>{if(Sc(e.target))return!1;const n=P.$getSelection();if(!P.$isRangeSelection(n))return!1;e.preventDefault(),{anchor:e}=n;const r=e.getNode();return n.isCollapsed()&&e.offset===0&&!P.$isRootNode(r)&&0<zr.$getNearestBlockElementAncestorOrThrow(r).getIndent()?t.dispatchCommand(P.OUTDENT_CONTENT_COMMAND,void 0):t.dispatchCommand(P.DELETE_CHARACTER_COMMAND,!0)},P.COMMAND_PRIORITY_EDITOR),t.registerCommand(P.KEY_DELETE_COMMAND,e=>{if(Sc(e.target))return!1;const n=P.$getSelection();return P.$isRangeSelection(n)?(e.preventDefault(),t.dispatchCommand(P.DELETE_CHARACTER_COMMAND,!1)):!1},P.COMMAND_PRIORITY_EDITOR),t.registerCommand(P.KEY_ENTER_COMMAND,e=>{const n=P.$getSelection();if(!P.$isRangeSelection(n))return!1;if(e!==null){if((KP||HP||GP)&&VP)return!1;if(e.preventDefault(),e.shiftKey)return t.dispatchCommand(P.INSERT_LINE_BREAK_COMMAND,!1)}return t.dispatchCommand(P.INSERT_PARAGRAPH_COMMAND,void 0)},P.COMMAND_PRIORITY_EDITOR),t.registerCommand(P.KEY_ESCAPE_COMMAND,()=>{const e=P.$getSelection();return P.$isRangeSelection(e)?(t.blur(),!0):!1},P.COMMAND_PRIORITY_EDITOR),t.registerCommand(P.DROP_COMMAND,e=>{const[,n]=va(e);if(0<n.length){var r=Cx(e.clientX,e.clientY);if(r!==null){const{offset:o,node:l}=r;var i=P.$getNearestNodeFromDOMNode(l);if(i!==null){if(r=P.$createRangeSelection(),P.$isTextNode(i))r.anchor.set(i.getKey(),o,"text"),r.focus.set(i.getKey(),o,"text");else{const s=i.getParentOrThrow().getKey();i=i.getIndexWithinParent()+1,r.anchor.set(s,i,"element"),r.focus.set(s,i,"element")}r=P.$normalizeSelection__EXPERIMENTAL(r),P.$setSelection(r)}t.dispatchCommand(Pm,n)}return e.preventDefault(),!0}return e=P.$getSelection(),!!P.$isRangeSelection(e)},P.COMMAND_PRIORITY_EDITOR),t.registerCommand(P.DRAGSTART_COMMAND,e=>{[e]=va(e);const n=P.$getSelection();return!(e&&!P.$isRangeSelection(n))},P.COMMAND_PRIORITY_EDITOR),t.registerCommand(P.DRAGOVER_COMMAND,e=>{var[n]=va(e);const r=P.$getSelection();return n&&!P.$isRangeSelection(r)?!1:(n=Cx(e.clientX,e.clientY),n!==null&&(n=P.$getNearestNodeFromDOMNode(n.node),P.$isDecoratorNode(n)&&e.preventDefault()),!0)},P.COMMAND_PRIORITY_EDITOR),t.registerCommand(P.SELECT_ALL_COMMAND,()=>(P.$selectAll(),!0),P.COMMAND_PRIORITY_EDITOR),t.registerCommand(P.COPY_COMMAND,e=>(Bd.copyToClipboard(t,zr.objectKlassEquals(e,ClipboardEvent)?e:null),!0),P.COMMAND_PRIORITY_EDITOR),t.registerCommand(P.CUT_COMMAND,e=>(JP(e,t),!0),P.COMMAND_PRIORITY_EDITOR),t.registerCommand(P.PASTE_COMMAND,e=>{const[,n,r]=va(e);if(0<n.length&&!r)return t.dispatchCommand(Pm,n),!0;if(P.isSelectionCapturedInDecoratorInput(e.target))return!1;const i=P.$getSelection();return P.$isRangeSelection(i)||P.DEPRECATED_$isGridSelection(i)?(XP(e,t),!0):!1},P.COMMAND_PRIORITY_EDITOR))};const QP=qr;var Ia=QP,mC=Nr,qP=OP,tr=p,eA=AP,gC=Ft,$x=Yr,tA=LP,nA=Ia,Av=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?tr.useLayoutEffect:tr.useEffect;function Tx(t){return t.getEditorState().read(eA.$canShowPlaceholderCurry(t.isComposing()))}function rA(t){let[e,n]=tr.useState(()=>Tx(t));return Av(()=>{function r(){let i=Tx(t);n(i)}return r(),gC.mergeRegister(t.registerUpdateListener(()=>{r()}),t.registerEditableListener(()=>{r()}))},[t]),e}function iA(t,e){let[n,r]=tr.useState(()=>t.getDecorators());return Av(()=>t.registerDecoratorListener(i=>{$x.flushSync(()=>{r(i)})}),[t]),tr.useEffect(()=>{r(t.getDecorators())},[t]),tr.useMemo(()=>{let i=[],o=Object.keys(n);for(let l=0;l<o.length;l++){let s=o[l],a=tr.createElement(e,{onError:c=>t._onError(c)},tr.createElement(tr.Suspense,{fallback:null},n[s])),u=t.getElementByKey(s);u!==null&&i.push($x.createPortal(a,u,s))}return i},[e,n,t])}function oA(t){Av(()=>gC.mergeRegister(nA.registerRichText(t),tA.registerDragonSupport(t)),[t])}function lA({content:t}){var[e]=mC.useLexicalComposerContext();e=rA(e);let n=qP();return e?typeof t=="function"?t(n):t:null}qE.RichTextPlugin=function({contentEditable:t,placeholder:e,ErrorBoundary:n}){let[r]=mC.useLexicalComposerContext();return n=iA(r,n),oA(r),tr.createElement(tr.Fragment,null,t,tr.createElement(lA,{content:e}),n)};const sA=qE;var aA=sA,vC={},ri=Ui,uA=Nr,yC=p,cA=Ft,ia=_e;function dA(t){yC.useEffect(()=>cA.mergeRegister(t.registerCommand(ri.INSERT_ORDERED_LIST_COMMAND,()=>(ri.insertList(t,"number"),!0),ia.COMMAND_PRIORITY_LOW),t.registerCommand(ri.INSERT_UNORDERED_LIST_COMMAND,()=>(ri.insertList(t,"bullet"),!0),ia.COMMAND_PRIORITY_LOW),t.registerCommand(ri.REMOVE_LIST_COMMAND,()=>(ri.removeList(t),!0),ia.COMMAND_PRIORITY_LOW),t.registerCommand(ia.INSERT_PARAGRAPH_COMMAND,()=>!!ri.$handleListInsertParagraph(),ia.COMMAND_PRIORITY_LOW)),[t])}vC.ListPlugin=function(){let[t]=uA.useLexicalComposerContext();return yC.useEffect(()=>{if(!t.hasNodes([ri.ListNode,ri.ListItemNode]))throw Error("ListPlugin: ListNode and/or ListItemNode not registered on editor")},[t]),dA(t),null};const fA=vC;var hA=fA,xC={},$i={},_C=Ft,Wr=_e;let pA=new Set(["http:","https:","mailto:","sms:","tel:"]);class Ds extends Wr.ElementNode{static getType(){return"link"}static clone(e){return new Ds(e.__url,{rel:e.__rel,target:e.__target,title:e.__title},e.__key)}constructor(e,n={},r){super(r);let{target:i=null,rel:o=null,title:l=null}=n;this.__url=e,this.__target=i,this.__rel=o,this.__title=l}createDOM(e){let n=document.createElement("a");return n.href=this.sanitizeUrl(this.__url),this.__target!==null&&(n.target=this.__target),this.__rel!==null&&(n.rel=this.__rel),this.__title!==null&&(n.title=this.__title),_C.addClassNamesToElement(n,e.theme.link),n}updateDOM(e,n){let r=this.__url,i=this.__target,o=this.__rel,l=this.__title;return r!==e.__url&&(n.href=r),i!==e.__target&&(i?n.target=i:n.removeAttribute("target")),o!==e.__rel&&(o?n.rel=o:n.removeAttribute("rel")),l!==e.__title&&(l?n.title=l:n.removeAttribute("title")),!1}static importDOM(){return{a:()=>({conversion:mA,priority:1})}}static importJSON(e){let n=hu(e.url,{rel:e.rel,target:e.target,title:e.title});return n.setFormat(e.format),n.setIndent(e.indent),n.setDirection(e.direction),n}sanitizeUrl(e){try{let n=new URL(e);if(!pA.has(n.protocol))return"about:blank"}catch{}return e}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),type:"link",url:this.getURL(),version:1}}getURL(){return this.getLatest().__url}setURL(e){this.getWritable().__url=e}getTarget(){return this.getLatest().__target}setTarget(e){this.getWritable().__target=e}getRel(){return this.getLatest().__rel}setRel(e){this.getWritable().__rel=e}getTitle(){return this.getLatest().__title}setTitle(e){this.getWritable().__title=e}insertNewAfter(e,n=!0){return e=this.getParentOrThrow().insertNewAfter(e,n),Wr.$isElementNode(e)?(n=hu(this.__url,{rel:this.__rel,target:this.__target,title:this.__title}),e.append(n),n):null}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,n){if(!Wr.$isRangeSelection(n))return!1;e=n.anchor.getNode();let r=n.focus.getNode();return this.isParentOf(e)&&this.isParentOf(r)&&0<n.getTextContent().length}}function mA(t){let e=null;if(_C.isHTMLAnchorElement(t)){let n=t.textContent;n!==null&&n!==""&&(e=hu(t.getAttribute("href")||"",{rel:t.getAttribute("rel"),target:t.getAttribute("target"),title:t.getAttribute("title")}))}return{node:e}}function hu(t,e){return Wr.$applyNodeReplacement(new Ds(t,e))}function Ro(t){return t instanceof Ds}class Wu extends Ds{static getType(){return"autolink"}static clone(e){return new Wu(e.__url,{rel:e.__rel,target:e.__target,title:e.__title},e.__key)}static importJSON(e){let n=Am(e.url,{rel:e.rel,target:e.target,title:e.title});return n.setFormat(e.format),n.setIndent(e.indent),n.setDirection(e.direction),n}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),type:"autolink",version:1}}insertNewAfter(e,n=!0){return e=this.getParentOrThrow().insertNewAfter(e,n),Wr.$isElementNode(e)?(n=Am(this.__url,{rel:this._rel,target:this.__target,title:this.__title}),e.append(n),n):null}}function Am(t,e){return Wr.$applyNodeReplacement(new Wu(t,e))}let gA=Wr.createCommand("TOGGLE_LINK_COMMAND");function vA(t,e){for(;t!==null&&(t=t.getParent())!==null&&!e(t););return t}$i.$createAutoLinkNode=Am;$i.$createLinkNode=hu;$i.$isAutoLinkNode=function(t){return t instanceof Wu};$i.$isLinkNode=Ro;$i.AutoLinkNode=Wu;$i.LinkNode=Ds;$i.TOGGLE_LINK_COMMAND=gA;$i.toggleLink=function(t,e={}){let{target:n,title:r}=e,i=e.rel===void 0?"noreferrer":e.rel;if(e=Wr.$getSelection(),Wr.$isRangeSelection(e))if(e=e.extract(),t===null)e.forEach(l=>{if(l=l.getParent(),Ro(l)){let s=l.getChildren();for(let a=0;a<s.length;a++)l.insertBefore(s[a]);l.remove()}});else{if(e.length===1){var o=e[0];if(o=Ro(o)?o:vA(o,Ro),o!==null){o.setURL(t),n!==void 0&&o.setTarget(n),i!==null&&o.setRel(i),r!==void 0&&o.setTitle(r);return}}let l=null,s=null;e.forEach(a=>{var u=a.getParent();if(u!==s&&u!==null&&(!Wr.$isElementNode(a)||a.isInline()))if(Ro(u))s=u,u.setURL(t),n!==void 0&&u.setTarget(n),i!==null&&s.setRel(i),r!==void 0&&s.setTitle(r);else if(u.is(l)||(l=u,s=hu(t,{rel:i,target:n}),Ro(u)?a.getPreviousSibling()===null?u.insertBefore(s):u.insertAfter(s):a.insertBefore(s)),Ro(a)){if(!a.is(s)){if(s!==null){u=a.getChildren();for(let c=0;c<u.length;c++)s.append(u[c])}a.remove()}}else s!==null&&s.append(a)})}};const yA=$i;var el=yA,Sl=el,xA=Nr,_A=Ft,El=_e,wA=p;xC.LinkPlugin=function({validateUrl:t}){let[e]=xA.useLexicalComposerContext();return wA.useEffect(()=>{if(!e.hasNodes([Sl.LinkNode]))throw Error("LinkPlugin: LinkNode not registered on editor");return _A.mergeRegister(e.registerCommand(Sl.TOGGLE_LINK_COMMAND,n=>{if(n===null)return Sl.toggleLink(n),!0;if(typeof n=="string")return t===void 0||t(n)?(Sl.toggleLink(n),!0):!1;let{url:r,target:i,rel:o,title:l}=n;return Sl.toggleLink(r,{rel:o,target:i,title:l}),!0},El.COMMAND_PRIORITY_LOW),t!==void 0?e.registerCommand(El.PASTE_COMMAND,n=>{let r=El.$getSelection();if(!El.$isRangeSelection(r)||r.isCollapsed()||!(n instanceof ClipboardEvent)||n.clipboardData==null)return!1;let i=n.clipboardData.getData("text");return t(i)?r.getNodes().some(o=>El.$isElementNode(o))?!1:(e.dispatchCommand(Sl.TOGGLE_LINK_COMMAND,i),n.preventDefault(),!0):!1},El.COMMAND_PRIORITY_LOW):()=>{})},[e,t]),null};const SA=xC;var EA=SA;function CA({ariaActiveDescendant:t,ariaAutoComplete:e,ariaControls:n,ariaDescribedBy:r,ariaExpanded:i,ariaLabel:o,ariaLabelledBy:l,ariaMultiline:s,ariaOwns:a,ariaRequired:u,autoCapitalize:c,className:d,id:f,role:h="textbox",spellCheck:g=!0,style:m,tabIndex:w,"data-testid":v,...y}){const[_]=Nr.useLexicalComposerContext(),[S,E]=p.useState(!1),$=p.useCallback(C=>{var R;_.setRootElement(C);const N=(R=document.getElementById("val-ui"))==null?void 0:R.shadowRoot;if(N&&"getSelection"in N){_._window=N;return}},[_]);return p.useLayoutEffect(()=>(E(_.isEditable()),_.registerEditableListener(C=>{E(C)})),[_]),x.jsx("div",{...y,"aria-activedescendant":S?t:void 0,"aria-autocomplete":S?e:"none","aria-controls":S?n:void 0,"aria-describedby":r,"aria-expanded":S&&h==="combobox"?!!i:void 0,"aria-label":o,"aria-labelledby":l,"aria-multiline":s,"aria-owns":S?a:void 0,"aria-readonly":S?void 0:!0,"aria-required":u,autoCapitalize:c,className:d,contentEditable:S,"data-testid":v,id:f,ref:$,role:h,spellCheck:g,style:m,tabIndex:w})}function kA({className:t}){return x.jsx(CA,{className:t})}class Is extends _e.DecoratorNode{constructor(e,n){super(n),this.__src=e.src,this.__altText=e.altText,this.__width=e.width,this.__height=e.height}static getType(){return"image"}static clone(e){return new Is({src:e.__src,altText:e.__altText,width:e.__width,height:e.__height})}exportJSON(){return{altText:this.__altText,height:this.__width,src:this.__src,type:"image",version:1,width:this.__width}}static importJSON(e){return wC(e)}createDOM(){return document.createElement("div")}updateDOM(){return!1}decorate(){return x.jsx(bA,{src:this.__src,altText:this.__altText,empty:this.__empty,height:this.__height,nodeKey:this.getKey()})}}function bA(t){return x.jsx("img",{src:t.src})}function wC(t){return new Is(t)}function $A(){const[t]=Nr.useLexicalComposerContext();return p.useEffect(()=>{t.focus()},[t]),null}const SC=_e.createCommand("INSERT_IMAGE_COMMAND");function TA(){const[t]=Nr.useLexicalComposerContext();return p.useEffect(()=>{if(!t.hasNodes([Is]))throw new Error("ImagesPlugin: ImageNode not registered on editor");return Ft.mergeRegister(t.registerCommand(SC,e=>{const n=wC(e);return _e.$insertNodes([n]),_e.$isRootOrShadowRoot(n.getParentOrThrow())&&Ft.$wrapNodeInElement(n,_e.$createParagraphNode).selectEnd(),!0},_e.COMMAND_PRIORITY_EDITOR))},[t]),null}const NA=({className:t})=>x.jsxs("svg",{height:12,width:12,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[x.jsx("path",{d:"M6 4h8a4 4 0 0 1 4 4 4 4 0 0 1-4 4H6z"}),x.jsx("path",{d:"M6 12h9a4 4 0 0 1 4 4 4 4 0 0 1-4 4H6z"})]}),RA=NA,OA=({className:t})=>x.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 9 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[x.jsxs("g",{clipPath:"url(#clip0_1225_1638)",children:[x.jsx("rect",{y:"0.5",width:"9",height:"9"}),x.jsx("path",{d:"M0 7L8.5 5",stroke:"currentColor"}),x.jsx("circle",{cx:"3",cy:"3.5",r:"1",fill:"currentColor"})]}),x.jsx("rect",{x:"0.5",y:"1",width:"8",height:"8",stroke:"currentColor"}),x.jsx("defs",{children:x.jsx("clipPath",{id:"clip0_1225_1638",children:x.jsx("rect",{y:"0.5",width:"9",height:"9",fill:"white"})})})]}),PA=OA,AA=({className:t})=>x.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,width:12,height:12,children:[x.jsx("line",{x1:"19",y1:"4",x2:"10",y2:"4"}),x.jsx("line",{x1:"14",y1:"20",x2:"5",y2:"20"}),x.jsx("line",{x1:"15",y1:"4",x2:"9",y2:"20"})]}),MA=AA,LA=({className:t})=>x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"1",className:t,width:12,height:12,children:x.jsx("path",{fillRule:"evenodd",d:"M13,15 L13,21 C13,21.5522847 12.5522847,22 12,22 C11.4477153,22 11,21.5522847 11,21 L11,15 L13,15 Z M3,13 C2.44771525,13 2,12.5522847 2,12 C2,11.4477153 2.44771525,11 3,11 L21,11 C21.5522847,11 22,11.4477153 22,12 C22,12.5522847 21.5522847,13 21,13 L3,13 Z M19,2 C19.5522847,2 20,2.44771525 20,3 C20,3.55228475 19.5522847,4 19,4 L13,4 L13,9 L11,9 L11,4 L5,4 C4.44771525,4 4,3.55228475 4,3 C4,2.44771525 4.44771525,2 5,2 L19,2 Z"})}),DA=LA,IA=({variant:t="primary",onClick:e,children:n,icon:r,disabled:i=!1})=>x.jsx("button",{disabled:i,className:Pn("font-sans font-[12px] tracking-[0.04em] py-1 px-2 rounded whitespace-nowrap group relative text-primary",{"font-bold":t==="primary","text-fill disabled:bg-fill disabled:text-background":t==="primary","border border-primary text-primary hover:border-highlight hover:text-highlight disabled:bg-fill disabled:text-background":t!=="primary"}),onClick:e,children:x.jsxs("span",{className:"flex flex-row items-center justify-center gap-2",children:[r&&r,n]})}),Oo=IA,jA=({className:t})=>x.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",className:t,children:[x.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.70733 1.00015L8.7784 6.07121L8.07129 6.77832L3.00022 1.70725L3.70733 1.00015Z",fill:"currentColor"}),x.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.00015 10.4709L8.07121 5.39983L8.77832 6.10693L3.70725 11.178L3.00015 10.4709Z",fill:"currentColor"})]}),zA=jA,EC=re.createContext({get api(){throw Error("ValOverlayContext not found. Ensure components are wrapped by ValOverlayProvider!")},get session(){throw Error("ValOverlayContext not found. Ensure components are wrapped by ValOverlayProvider!")},get theme(){throw Error("ValOverlayContext not found. Ensure components are wrapped by ValOverlayProvider!")},get setTheme(){throw Error("ValOverlayContext not found. Ensure components are wrapped by ValOverlayProvider!")},get editMode(){throw Error("ValOverlayContext not found. Ensure components are wrapped by ValOverlayProvider!")},get setEditMode(){throw Error("ValOverlayContext not found. Ensure components are wrapped by ValOverlayProvider!")},get highlight(){throw Error("ValOverlayContext not found. Ensure components are wrapped by ValOverlayProvider!")},get setHighlight(){throw Error("ValOverlayContext not found. Ensure components are wrapped by ValOverlayProvider!")},get setWindowSize(){throw Error("ValOverlayContext not found. Ensure components are wrapped by ValOverlayProvider!")},get windowSize(){throw Error("ValOverlayContext not found. Ensure components are wrapped by ValOverlayProvider!")}});function jf(){return re.useContext(EC)}const FA=({options:t,onChange:e,label:n,icon:r})=>{const[i,o]=p.useState(!1),l=p.useRef(null),[s,a]=p.useState(0),{windowSize:u}=jf(),c=()=>{o(!i)},d=(f,h)=>{a(h),e(f),o(!1)};return p.useEffect(()=>{const f=h=>{i&&l.current&&!l.current.contains(h.target)&&o(!1)};return document.addEventListener("click",f),()=>{document.removeEventListener("click",f)}},[]),x.jsx("div",{className:"text-[12px]",ref:l,children:x.jsx(Oo,{onClick:f=>{f.preventDefault(),c()},icon:x.jsx(zA,{className:`rotate-[-90deg] transition-transform duration-150 ease-in-out ${i?"":"rotate-[90deg]"}`}),children:x.jsxs("div",{className:"relative",children:[x.jsxs("span",{className:"flex flex-row items-center justify-center gap-1",children:[n,r&&r]}),i&&x.jsx("div",{className:"absolute -top-[4px] overflow-scroll shadow-lg -left-2 text-primary w-fit z-overlay",style:{maxHeight:u==null?void 0:u.innerHeight},children:x.jsx("div",{className:"flex flex-col ",children:t==null?void 0:t.map((f,h)=>x.jsx("button",{onClick:g=>{g.preventDefault(),d(f,h)},className:`text-left px-2 py-1 hover:text-highlight ${h===s&&"font-bold truncate"}`,children:f},f))})})]})})})},BA=FA,UA=new TextEncoder;function CC(t){return new Promise((e,n)=>{var o;const r=(o=t.currentTarget.files)==null?void 0:o[0],i=new FileReader;i.addEventListener("load",()=>{const l=i.result;if(typeof l=="string"){const s=new Image;s.addEventListener("load",()=>{const a=On.getSHA256Hash(UA.encode(l));if(s.naturalWidth&&s.naturalHeight){const u=Ev(l);e({src:l,width:s.naturalWidth,height:s.naturalHeight,filename:r==null?void 0:r.name,sha256:a,mimeType:u,fileExt:u&&Cv(u)})}else e({src:l,filename:r==null?void 0:r.name,sha256:a})}),s.src=l}else n(l?{message:"Unexpected image result type",result:l}:{message:"Empty result"})}),r&&i.readAsDataURL(r)})}function kC(t){const e=t.anchor,n=t.focus,r=t.anchor.getNode(),i=t.focus.getNode();return r===i?r:t.isBackward()?co.$isAtNodeEnd(n)?r:i:co.$isAtNodeEnd(e)?r:i}function WA(){const[t]=Nr.useLexicalComposerContext();return p.useEffect(()=>Ft.mergeRegister(t.registerCommand(_e.CLICK_COMMAND,e=>{const n=_e.$getSelection();if(_e.$isRangeSelection(n)){const r=kC(n),i=Ft.$findMatchingParent(r,el.$isLinkNode);if(el.$isLinkNode(i)&&(e.metaKey||e.ctrlKey))return window.open(i.getURL(),"_blank"),!0}return!1},_e.COMMAND_PRIORITY_LOW)),[]),null}var bC={exports:{}},VA="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",HA=VA,KA=HA;function $C(){}function TC(){}TC.resetWarningCache=$C;var ZA=function(){function t(r,i,o,l,s,a){if(a!==KA){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}t.isRequired=t;function e(){return t}var n={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:TC,resetWarningCache:$C};return n.PropTypes=n,n};bC.exports=ZA();var GA=bC.exports;const ir=Ou(GA);function Mm(){return Mm=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Mm.apply(this,arguments)}function YA(t,e){if(t==null)return{};var n=XA(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)r=o[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function XA(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o<r.length;o++)i=r[o],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}var Mv=p.forwardRef(function(t,e){var n=t.color,r=n===void 0?"currentColor":n,i=t.size,o=i===void 0?24:i,l=YA(t,["color","size"]);return re.createElement("svg",Mm({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},l),re.createElement("polyline",{points:"20 6 9 17 4 12"}))});Mv.propTypes={color:ir.string,size:ir.oneOfType([ir.string,ir.number])};Mv.displayName="Check";const JA=Mv;function Lm(){return Lm=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Lm.apply(this,arguments)}function QA(t,e){if(t==null)return{};var n=qA(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)r=o[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function qA(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o<r.length;o++)i=r[o],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}var Lv=p.forwardRef(function(t,e){var n=t.color,r=n===void 0?"currentColor":n,i=t.size,o=i===void 0?24:i,l=QA(t,["color","size"]);return re.createElement("svg",Lm({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},l),re.createElement("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}),re.createElement("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"}))});Lv.propTypes={color:ir.string,size:ir.oneOfType([ir.string,ir.number])};Lv.displayName="Link";const eM=Lv;function Dm(){return Dm=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Dm.apply(this,arguments)}function tM(t,e){if(t==null)return{};var n=nM(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)r=o[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function nM(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o<r.length;o++)i=r[o],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}var Dv=p.forwardRef(function(t,e){var n=t.color,r=n===void 0?"currentColor":n,i=t.size,o=i===void 0?24:i,l=tM(t,["color","size"]);return re.createElement("svg",Dm({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},l),re.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),re.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))});Dv.propTypes={color:ir.string,size:ir.oneOfType([ir.string,ir.number])};Dv.displayName="X";const rM=Dv,iM=({fontSizes:t,fontsFamilies:e,onEditor:n,colors:r})=>{const[i]=Nr.useLexicalComposerContext();p.useEffect(()=>{n&&n(i)},[i]);const[o,l]=p.useState(i),[s,a]=p.useState(null),[u,c]=p.useState(!1),[d,f]=p.useState(!1),[h,g]=p.useState(!1),[m,w]=p.useState(!1);p.useState("15px"),p.useState("#000"),p.useState("Sans");const[v,y]=p.useState("paragraph");p.useState(!1),p.useState(!1),p.useState("url"),p.useState(null);const[_,S]=p.useState(null),E=b=>{i.dispatchCommand(el.TOGGLE_LINK_COMMAND,b)},$={paragraph:"Normal",h1:"Heading 1",h2:"Heading 2",h3:"Heading 3",h4:"Heading 4",h5:"Heading 5",h6:"Heading 6",number:"Numbered List",bullet:"Bulleted List"},C={};for(const b in $)C[$[b]]=b;const N=p.useCallback(()=>{const b=_e.$getSelection();if(_e.$isRangeSelection(b)){const L=b.anchor.getNode();let F=L.getKey()==="root"?L:Ft.$findMatchingParent(L,A=>{const k=A.getParent();return k!==null&&_e.$isRootOrShadowRoot(k)});F===null&&(F=L.getTopLevelElementOrThrow());const le=kC(b),V=Ft.$findMatchingParent(le,el.$isLinkNode);if(V!==null){const A=V.getURL();S(A)}else S(null);const H=F.getKey(),O=o.getElementByKey(H);if(c(b.hasFormat("bold")),f(b.hasFormat("italic")),g(b.hasFormat("strikethrough")),w(b.hasFormat("underline")),O!==null)if(a(H),Ui.$isListNode(F)){const A=Ft.$getNearestNodeOfType(L,Ui.ListNode),k=A?A.getListType():F.getListType();y(k)}else{const A=Ia.$isHeadingNode(F)?F.getTag():F.getType();A in $&&y(A)}}},[o]);p.useEffect(()=>Ft.mergeRegister(i.registerUpdateListener(({editorState:b})=>{b.read(()=>{N()})})),[N,o,i]),p.useEffect(()=>i.registerCommand(_e.SELECTION_CHANGE_COMMAND,(b,L)=>(N(),l(L),!1),_e.COMMAND_PRIORITY_CRITICAL),[i,N]);const R=b=>{["h1","h2","h3","h4","h5","h6"].includes(b)?v!==b&&i.update(()=>{const L=_e.$getSelection();_e.$isRangeSelection(L)&&co.$setBlocksType(L,()=>Ia.$createHeadingNode(b))}):b==="paragraph"&&v!=="paragraph"?i.update(()=>{const L=_e.$getSelection();(_e.$isRangeSelection(L)||_e.DEPRECATED_$isGridSelection(L))&&co.$setBlocksType(L,()=>_e.$createParagraphNode())}):b==="number"&&v!=="number"?i.dispatchCommand(Ui.INSERT_ORDERED_LIST_COMMAND,void 0):b==="bullet"&&v!=="bullet"?i.dispatchCommand(Ui.INSERT_UNORDERED_LIST_COMMAND,void 0):i.dispatchCommand(Ui.REMOVE_LIST_COMMAND,void 0)};return p.useCallback(()=>{i.update(()=>{const b=_e.$getSelection();if(_e.$isRangeSelection(b)){const L=b.anchor,F=b.focus,le=b.getNodes();if(L.key===F.key&&L.offset===F.offset)return;le.forEach((V,H)=>{_e.$isTextNode(V)?(H===0&&L.offset!==0&&(V=V.splitText(L.offset)[1]||V),H===le.length-1&&(V=V.splitText(F.offset)[0]||V),V.__style!==""&&V.setStyle(""),V.__format!==0&&(V.setFormat(0),Ft.$getNearestBlockElementAncestorOrThrow(V).setFormat(""))):Ia.$isHeadingNode(V)&&V.replace(_e.$createParagraphNode(),!0)})}})},[o]),x.jsxs("div",{className:"sticky top-0 flex flex-col px-4 py-2 border rounded-md rounded-b-none border-input bg-background",children:[x.jsxs("div",{className:"flex flex-row gap-1",children:[x.jsx(BA,{options:Object.values($),label:$[v]??v+" (not supported)",onChange:b=>{R(C[b])}}),x.jsx(Oo,{variant:"primary",onClick:b=>{b.preventDefault(),i.dispatchCommand(_e.FORMAT_TEXT_COMMAND,"bold")},active:u,icon:x.jsx(RA,{className:`${u&&"stroke-[3px]"}`})}),x.jsx(Oo,{active:h,onClick:b=>{b.preventDefault(),i.dispatchCommand(_e.FORMAT_TEXT_COMMAND,"strikethrough")},icon:x.jsx(DA,{className:`${h&&"stroke-[2px]"}`})}),x.jsx(Oo,{active:d,onClick:b=>{b.preventDefault(),i.dispatchCommand(_e.FORMAT_TEXT_COMMAND,"italic")},icon:x.jsx(MA,{className:`${d&&"stroke-[3px]"}`})}),x.jsx(Oo,{active:_!==null,onClick:b=>{b.preventDefault(),S(""),E("")},icon:x.jsx(eM,{width:12,height:12,className:`${_!==null&&"stroke-[3px]"}`})}),x.jsxs("label",{className:"flex items-center justify-center cursor-pointer",children:[x.jsx(PA,{}),x.jsx("input",{type:"file",hidden:!0,onChange:b=>{b.preventDefault(),CC(b).then(L=>{i.dispatchCommand(SC,{...L})}).catch(L=>{console.error("Error reading image",L)})}})]})]}),_!==null&&x.jsxs("div",{className:"flex flex-row p-2",children:[x.jsx("input",{type:"text",placeholder:"Enter URL",className:"w-1/3 px-2 bg-background text-primary",value:_,onChange:b=>{b.preventDefault(),S(b.target.value)}}),x.jsx(Oo,{variant:"primary",onClick:b=>{b.preventDefault(),E(_||null)},icon:x.jsx(JA,{size:14})}),x.jsx(Oo,{variant:"primary",onClick:b=>{b.preventDefault(),E(null)},icon:x.jsx(rM,{size:14})})]})]})},oM=iM;function lM(t){console.error(t)}const sM=({richtext:t,onEditor:e})=>{const r={namespace:"val",editorState:i=>{i.setEditorState(i.parseEditorState({root:DO(DE(t))}))},nodes:[Ia.HeadingNode,Is,Ui.ListNode,Ui.ListItemNode,el.LinkNode],theme:{text:{bold:"font-semibold",underline:"underline",italic:"italic",strikethrough:"line-through",underlineStrikethrough:"underline line-through"},list:{listitem:"ml-[20px]",ol:"list-decimal",ul:"list-disc"},heading:{h1:"text-4xl font-bold",h2:"text-3xl font-bold",h3:"text-2xl font-bold",h4:"text-xl font-bold",h5:"text-lg font-bold",h6:"text-md font-bold"},link:"text-highlight underline"},onError:lM};return x.jsxs(aP.LexicalComposer,{initialConfig:r,children:[x.jsx($A,{}),x.jsx(oM,{onEditor:e}),x.jsx(aA.RichTextPlugin,{contentEditable:x.jsx("div",{className:"px-3 py-2 text-sm border-b rounded-md rounded-t-none border-x border-input bg-background ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",children:x.jsx(kA,{className:"p-4 outline-none bg-fill"})}),placeholder:x.jsx("p",{className:""}),ErrorBoundary:mP}),x.jsx(EA.LinkPlugin,{}),x.jsx(WA,{}),x.jsx(hA.ListPlugin,{}),x.jsx(TA,{}),x.jsx(CP.HistoryPlugin,{})]})},Iv="p-1 border rounded-full shadow border-accent",Nx="valbuild:urlBeforeNavigation";function aM({api:t,patches:e,direction:n,onCommit:r}){const{theme:i,setTheme:o,editMode:l,setEditMode:s,session:a}=jf();if(a.status==="success"&&a.data.mode==="unauthorized")return x.jsxs(Rx,{direction:n,href:t.getLoginUrl(window.location.href),children:[x.jsx("span",{children:"Login"}),x.jsx(P0,{size:18})]});if(a.status==="success"&&!a.data.enabled)return x.jsxs(Rx,{direction:n,href:t.getEnableUrl(window.location.href),children:[x.jsx("span",{children:"Enable"}),x.jsx(P0,{size:18})]});const[u,c]=p.useState();return p.useEffect(()=>{let d=0;for(const f in e)d+=e[f].length;c(d)},[e]),x.jsxs(uM,{direction:n,children:[x.jsx(Ec,{active:l==="hover",onClick:()=>{s(d=>d==="hover"?"off":"hover")},children:x.jsx("div",{className:"h-[24px] w-[24px] flex justify-center items-center",children:l==="hover"?x.jsx(cR,{size:18}):x.jsx(dR,{size:18})})}),x.jsx(Ec,{onClick:()=>{o(i==="dark"?"light":"dark")},children:x.jsxs("div",{className:"h-[24px] w-[24px] flex justify-center items-center",children:[i==="dark"&&x.jsx(pR,{size:15}),i==="light"&&x.jsx(uR,{size:15})]})}),x.jsx(Ec,{active:l==="full",onClick:()=>{if(l!=="full")localStorage.setItem(Nx,window.location.href),window.location.href=t.getEditUrl();else if(l==="full"){const d=localStorage.getItem(Nx);window.location.href=d||"/"}},children:x.jsx("div",{className:"h-[24px] w-[24px] flex justify-center items-center",children:l==="full"?x.jsx(aR,{size:15}):x.jsx(lR,{size:15})})}),u!==void 0&&a.status==="success"&&a.data.mode==="proxy"&&x.jsx(Ec,{onClick:()=>{u>0?t.postCommit({patches:e}).then(d=>{zo.isErr(d)?(console.error(d.error),alert("Could not commit patches: "+d.error.message)):(console.log("Committed patches: ",d.value),r())}):alert("No patches to commit")},children:x.jsxs("div",{className:"relative h-[24px] w-[24px] flex justify-center items-center",children:[x.jsx("div",{className:"absolute -right-[10px] -top-[10px] border border-border rounded-full px-1 font-sans text-xs bg-card text-accent",children:u}),x.jsx(hR,{size:18})]})}),x.jsx("a",{className:Iv,href:t.getDisableUrl(window.location.href),children:x.jsx("div",{className:"h-[24px] w-[24px] flex justify-center items-center",children:x.jsx(fR,{size:18})})})]})}function Rx({href:t,direction:e,children:n}){return x.jsx("div",{className:Pn("flex items-start justify-center w-full h-full font-sans border rounded-full gap-3 text-primary border-fill bg-gradient-to-br from-background/90 from-40% to-background backdrop-blur-lg drop-shadow-2xl",{"flex-col items-start":e==="vertical","flex-row items-center":e==="horizontal"}),children:x.jsx("a",{className:Iv,href:t,children:x.jsx("div",{className:"flex items-center justify-center px-2 gap-y-2",children:n})})})}function uM({children:t,direction:e}){return x.jsx("div",{className:Pn("flex justify-center w-full h-full px-2 py-2 font-sans border rounded-full gap-3 text-primary border-fill bg-gradient-to-br from-background/90 from-40% to-background backdrop-blur-lg drop-shadow-2xl",{"flex-col items-start":e==="vertical","flex-row items-center":e==="horizontal"}),children:t})}function Ec({active:t,onClick:e,children:n}){return x.jsx("button",{className:Pn(Iv,{"bg-accent text-accent-foreground drop-shadow-[0px_0px_12px_hsl(var(--accent))]":t}),onClick:e,children:n})}function cM(t,e){const[n,r]=p.useState({}),[i,o]=p.useState(0);return p.useEffect(()=>{t.status==="success"&&t.data.mode==="proxy"&&e.getPatches({}).then(l=>{if(zo.isOk(l)){const s={};for(const a in l.value)s[a]=l.value[a].map(u=>u.patch_id);r(s)}else console.error("Could not load patches",l.error)})},[t,i]),{patches:n,setPatchResetId:o}}function dM(t="dark"){const[e,n]=p.useState(t);return p.useEffect(()=>{localStorage.getItem("val-theme")==="light"?n("light"):localStorage.getItem("val-theme")==="dark"||window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?n("dark"):window.matchMedia&&window.matchMedia("(prefers-color-scheme: light)").matches&&n("light");const r=i=>{localStorage.getItem("val-theme")||n(i.matches?"dark":"light")};return window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",r),()=>{window.matchMedia("(prefers-color-scheme: dark)").removeEventListener("change",r)}},[]),[e,r=>{localStorage.setItem("val-theme",r),n(r)}]}var De;(function(t){t.assertEqual=i=>i;function e(i){}t.assertIs=e;function n(i){throw new Error}t.assertNever=n,t.arrayToEnum=i=>{const o={};for(const l of i)o[l]=l;return o},t.getValidEnumValues=i=>{const o=t.objectKeys(i).filter(s=>typeof i[i[s]]!="number"),l={};for(const s of o)l[s]=i[s];return t.objectValues(l)},t.objectValues=i=>t.objectKeys(i).map(function(o){return i[o]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const o=[];for(const l in i)Object.prototype.hasOwnProperty.call(i,l)&&o.push(l);return o},t.find=(i,o)=>{for(const l of i)if(o(l))return l},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function r(i,o=" | "){return i.map(l=>typeof l=="string"?`'${l}'`:l).join(o)}t.joinValues=r,t.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(De||(De={}));var Im;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(Im||(Im={}));const J=De.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Wi=t=>{switch(typeof t){case"undefined":return J.undefined;case"string":return J.string;case"number":return isNaN(t)?J.nan:J.number;case"boolean":return J.boolean;case"function":return J.function;case"bigint":return J.bigint;case"symbol":return J.symbol;case"object":return Array.isArray(t)?J.array:t===null?J.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?J.promise:typeof Map<"u"&&t instanceof Map?J.map:typeof Set<"u"&&t instanceof Set?J.set:typeof Date<"u"&&t instanceof Date?J.date:J.object;default:return J.unknown}},W=De.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),fM=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class Cr extends Error{constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const n=e||function(o){return o.message},r={_errors:[]},i=o=>{for(const l of o.issues)if(l.code==="invalid_union")l.unionErrors.map(i);else if(l.code==="invalid_return_type")i(l.returnTypeError);else if(l.code==="invalid_arguments")i(l.argumentsError);else if(l.path.length===0)r._errors.push(n(l));else{let s=r,a=0;for(;a<l.path.length;){const u=l.path[a];a===l.path.length-1?(s[u]=s[u]||{_errors:[]},s[u]._errors.push(n(l))):s[u]=s[u]||{_errors:[]},s=s[u],a++}}};return i(this),r}toString(){return this.message}get message(){return JSON.stringify(this.issues,De.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},r=[];for(const i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(e(i))):r.push(e(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Cr.create=t=>new Cr(t);const pu=(t,e)=>{let n;switch(t.code){case W.invalid_type:t.received===J.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case W.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,De.jsonStringifyReplacer)}`;break;case W.unrecognized_keys:n=`Unrecognized key(s) in object: ${De.joinValues(t.keys,", ")}`;break;case W.invalid_union:n="Invalid input";break;case W.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${De.joinValues(t.options)}`;break;case W.invalid_enum_value:n=`Invalid enum value. Expected ${De.joinValues(t.options)}, received '${t.received}'`;break;case W.invalid_arguments:n="Invalid function arguments";break;case W.invalid_return_type:n="Invalid function return type";break;case W.invalid_date:n="Invalid date";break;case W.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:De.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case W.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case W.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case W.custom:n="Invalid input";break;case W.invalid_intersection_types:n="Intersection results could not be merged";break;case W.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case W.not_finite:n="Number must be finite";break;default:n=e.defaultError,De.assertNever(t)}return{message:n}};let NC=pu;function hM(t){NC=t}function Ud(){return NC}const Wd=t=>{const{data:e,path:n,errorMaps:r,issueData:i}=t,o=[...n,...i.path||[]],l={...i,path:o};let s="";const a=r.filter(u=>!!u).slice().reverse();for(const u of a)s=u(l,{data:e,defaultError:s}).message;return{...i,path:o,message:i.message||s}},pM=[];function q(t,e){const n=Wd({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Ud(),pu].filter(r=>!!r)});t.common.issues.push(n)}class on{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const r=[];for(const i of n){if(i.status==="aborted")return ve;i.status==="dirty"&&e.dirty(),r.push(i.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){const r=[];for(const i of n)r.push({key:await i.key,value:await i.value});return on.mergeObjectSync(e,r)}static mergeObjectSync(e,n){const r={};for(const i of n){const{key:o,value:l}=i;if(o.status==="aborted"||l.status==="aborted")return ve;o.status==="dirty"&&e.dirty(),l.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof l.value<"u"||i.alwaysSet)&&(r[o.value]=l.value)}return{status:e.value,value:r}}}const ve=Object.freeze({status:"aborted"}),RC=t=>({status:"dirty",value:t}),yn=t=>({status:"valid",value:t}),jm=t=>t.status==="aborted",zm=t=>t.status==="dirty",mu=t=>t.status==="valid",Vd=t=>typeof Promise<"u"&&t instanceof Promise;var ce;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(ce||(ce={}));class Kr{constructor(e,n,r,i){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Ox=(t,e)=>{if(mu(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Cr(t.common.issues);return this._error=n,this._error}}};function we(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:r,description:i}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(l,s)=>l.code!=="invalid_type"?{message:s.defaultError}:typeof s.data>"u"?{message:r??s.defaultError}:{message:n??s.defaultError},description:i}}class Ce{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return Wi(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:Wi(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new on,ctx:{common:e.parent.common,data:e.data,parsedType:Wi(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(Vd(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){var r;const i={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Wi(e)},o=this._parseSync({data:e,path:i.path,parent:i});return Ox(i,o)}async parseAsync(e,n){const r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Wi(e)},i=this._parse({data:e,path:r.path,parent:r}),o=await(Vd(i)?i:Promise.resolve(i));return Ox(r,o)}refine(e,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,o)=>{const l=e(i),s=()=>o.addIssue({code:W.custom,...r(i)});return typeof Promise<"u"&&l instanceof Promise?l.then(a=>a?!0:(s(),!1)):l?!0:(s(),!1)})}refinement(e,n){return this._refinement((r,i)=>e(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(e){return new Tr({schema:this,typeName:de.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return di.create(this,this._def)}nullable(){return rl.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return kr.create(this,this._def)}promise(){return vs.create(this,this._def)}or(e){return xu.create([this,e],this._def)}and(e){return _u.create(this,e,this._def)}transform(e){return new Tr({...we(this._def),schema:this,typeName:de.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new ku({...we(this._def),innerType:this,defaultValue:n,typeName:de.ZodDefault})}brand(){return new PC({typeName:de.ZodBranded,type:this,...we(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new Gd({...we(this._def),innerType:this,catchValue:n,typeName:de.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return Vu.create(this,e)}readonly(){return Xd.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const mM=/^c[^\s-]{8,}$/i,gM=/^[a-z][a-z0-9]*$/,vM=/^[0-9A-HJKMNP-TV-Z]{26}$/,yM=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,xM=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,_M="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Uh;const wM=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,SM=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,EM=t=>t.precision?t.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}Z$`):t.precision===0?t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function CM(t,e){return!!((e==="v4"||!e)&&wM.test(t)||(e==="v6"||!e)&&SM.test(t))}class wr extends Ce{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==J.string){const o=this._getOrReturnCtx(e);return q(o,{code:W.invalid_type,expected:J.string,received:o.parsedType}),ve}const r=new on;let i;for(const o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(i=this._getOrReturnCtx(e,i),q(i,{code:W.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="max")e.data.length>o.value&&(i=this._getOrReturnCtx(e,i),q(i,{code:W.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){const l=e.data.length>o.value,s=e.data.length<o.value;(l||s)&&(i=this._getOrReturnCtx(e,i),l?q(i,{code:W.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):s&&q(i,{code:W.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if(o.kind==="email")xM.test(e.data)||(i=this._getOrReturnCtx(e,i),q(i,{validation:"email",code:W.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")Uh||(Uh=new RegExp(_M,"u")),Uh.test(e.data)||(i=this._getOrReturnCtx(e,i),q(i,{validation:"emoji",code:W.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")yM.test(e.data)||(i=this._getOrReturnCtx(e,i),q(i,{validation:"uuid",code:W.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")mM.test(e.data)||(i=this._getOrReturnCtx(e,i),q(i,{validation:"cuid",code:W.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")gM.test(e.data)||(i=this._getOrReturnCtx(e,i),q(i,{validation:"cuid2",code:W.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")vM.test(e.data)||(i=this._getOrReturnCtx(e,i),q(i,{validation:"ulid",code:W.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),q(i,{validation:"url",code:W.invalid_string,message:o.message}),r.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),q(i,{validation:"regex",code:W.invalid_string,message:o.message}),r.dirty())):o.kind==="trim"?e.data=e.data.trim():o.kind==="includes"?e.data.includes(o.value,o.position)||(i=this._getOrReturnCtx(e,i),q(i,{code:W.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),r.dirty()):o.kind==="toLowerCase"?e.data=e.data.toLowerCase():o.kind==="toUpperCase"?e.data=e.data.toUpperCase():o.kind==="startsWith"?e.data.startsWith(o.value)||(i=this._getOrReturnCtx(e,i),q(i,{code:W.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(i=this._getOrReturnCtx(e,i),q(i,{code:W.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?EM(o).test(e.data)||(i=this._getOrReturnCtx(e,i),q(i,{code:W.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="ip"?CM(e.data,o.version)||(i=this._getOrReturnCtx(e,i),q(i,{validation:"ip",code:W.invalid_string,message:o.message}),r.dirty()):De.assertNever(o);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(i=>e.test(i),{validation:n,code:W.invalid_string,...ce.errToObj(r)})}_addCheck(e){return new wr({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...ce.errToObj(e)})}url(e){return this._addCheck({kind:"url",...ce.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...ce.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...ce.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...ce.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...ce.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...ce.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...ce.errToObj(e)})}datetime(e){var n;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(n=e==null?void 0:e.offset)!==null&&n!==void 0?n:!1,...ce.errToObj(e==null?void 0:e.message)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...ce.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...ce.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...ce.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...ce.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...ce.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...ce.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...ce.errToObj(n)})}nonempty(e){return this.min(1,ce.errToObj(e))}trim(){return new wr({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new wr({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new wr({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}wr.create=t=>{var e;return new wr({checks:[],typeName:de.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...we(t)})};function kM(t,e){const n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,i=n>r?n:r,o=parseInt(t.toFixed(i).replace(".","")),l=parseInt(e.toFixed(i).replace(".",""));return o%l/Math.pow(10,i)}class ho extends Ce{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==J.number){const o=this._getOrReturnCtx(e);return q(o,{code:W.invalid_type,expected:J.number,received:o.parsedType}),ve}let r;const i=new on;for(const o of this._def.checks)o.kind==="int"?De.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),q(r,{code:W.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(r=this._getOrReturnCtx(e,r),q(r,{code:W.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),q(r,{code:W.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?kM(e.data,o.value)!==0&&(r=this._getOrReturnCtx(e,r),q(r,{code:W.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),q(r,{code:W.not_finite,message:o.message}),i.dirty()):De.assertNever(o);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,ce.toString(n))}gt(e,n){return this.setLimit("min",e,!1,ce.toString(n))}lte(e,n){return this.setLimit("max",e,!0,ce.toString(n))}lt(e,n){return this.setLimit("max",e,!1,ce.toString(n))}setLimit(e,n,r,i){return new ho({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:ce.toString(i)}]})}_addCheck(e){return new ho({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:ce.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ce.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ce.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ce.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ce.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:ce.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:ce.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ce.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ce.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&De.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}}ho.create=t=>new ho({checks:[],typeName:de.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...we(t)});class po extends Ce{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==J.bigint){const o=this._getOrReturnCtx(e);return q(o,{code:W.invalid_type,expected:J.bigint,received:o.parsedType}),ve}let r;const i=new on;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(r=this._getOrReturnCtx(e,r),q(r,{code:W.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),q(r,{code:W.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),q(r,{code:W.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):De.assertNever(o);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,ce.toString(n))}gt(e,n){return this.setLimit("min",e,!1,ce.toString(n))}lte(e,n){return this.setLimit("max",e,!0,ce.toString(n))}lt(e,n){return this.setLimit("max",e,!1,ce.toString(n))}setLimit(e,n,r,i){return new po({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:ce.toString(i)}]})}_addCheck(e){return new po({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ce.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ce.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ce.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ce.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:ce.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}po.create=t=>{var e;return new po({checks:[],typeName:de.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...we(t)})};class gu extends Ce{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==J.boolean){const r=this._getOrReturnCtx(e);return q(r,{code:W.invalid_type,expected:J.boolean,received:r.parsedType}),ve}return yn(e.data)}}gu.create=t=>new gu({typeName:de.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...we(t)});class tl extends Ce{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==J.date){const o=this._getOrReturnCtx(e);return q(o,{code:W.invalid_type,expected:J.date,received:o.parsedType}),ve}if(isNaN(e.data.getTime())){const o=this._getOrReturnCtx(e);return q(o,{code:W.invalid_date}),ve}const r=new on;let i;for(const o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(i=this._getOrReturnCtx(e,i),q(i,{code:W.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),r.dirty()):o.kind==="max"?e.data.getTime()>o.value&&(i=this._getOrReturnCtx(e,i),q(i,{code:W.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):De.assertNever(o);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new tl({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:ce.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:ce.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}tl.create=t=>new tl({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:de.ZodDate,...we(t)});class Hd extends Ce{_parse(e){if(this._getType(e)!==J.symbol){const r=this._getOrReturnCtx(e);return q(r,{code:W.invalid_type,expected:J.symbol,received:r.parsedType}),ve}return yn(e.data)}}Hd.create=t=>new Hd({typeName:de.ZodSymbol,...we(t)});class vu extends Ce{_parse(e){if(this._getType(e)!==J.undefined){const r=this._getOrReturnCtx(e);return q(r,{code:W.invalid_type,expected:J.undefined,received:r.parsedType}),ve}return yn(e.data)}}vu.create=t=>new vu({typeName:de.ZodUndefined,...we(t)});class yu extends Ce{_parse(e){if(this._getType(e)!==J.null){const r=this._getOrReturnCtx(e);return q(r,{code:W.invalid_type,expected:J.null,received:r.parsedType}),ve}return yn(e.data)}}yu.create=t=>new yu({typeName:de.ZodNull,...we(t)});class gs extends Ce{constructor(){super(...arguments),this._any=!0}_parse(e){return yn(e.data)}}gs.create=t=>new gs({typeName:de.ZodAny,...we(t)});class Wo extends Ce{constructor(){super(...arguments),this._unknown=!0}_parse(e){return yn(e.data)}}Wo.create=t=>new Wo({typeName:de.ZodUnknown,...we(t)});class gi extends Ce{_parse(e){const n=this._getOrReturnCtx(e);return q(n,{code:W.invalid_type,expected:J.never,received:n.parsedType}),ve}}gi.create=t=>new gi({typeName:de.ZodNever,...we(t)});class Kd extends Ce{_parse(e){if(this._getType(e)!==J.undefined){const r=this._getOrReturnCtx(e);return q(r,{code:W.invalid_type,expected:J.void,received:r.parsedType}),ve}return yn(e.data)}}Kd.create=t=>new Kd({typeName:de.ZodVoid,...we(t)});class kr extends Ce{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),i=this._def;if(n.parsedType!==J.array)return q(n,{code:W.invalid_type,expected:J.array,received:n.parsedType}),ve;if(i.exactLength!==null){const l=n.data.length>i.exactLength.value,s=n.data.length<i.exactLength.value;(l||s)&&(q(n,{code:l?W.too_big:W.too_small,minimum:s?i.exactLength.value:void 0,maximum:l?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(q(n,{code:W.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(q(n,{code:W.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((l,s)=>i.type._parseAsync(new Kr(n,l,n.path,s)))).then(l=>on.mergeArray(r,l));const o=[...n.data].map((l,s)=>i.type._parseSync(new Kr(n,l,n.path,s)));return on.mergeArray(r,o)}get element(){return this._def.type}min(e,n){return new kr({...this._def,minLength:{value:e,message:ce.toString(n)}})}max(e,n){return new kr({...this._def,maxLength:{value:e,message:ce.toString(n)}})}length(e,n){return new kr({...this._def,exactLength:{value:e,message:ce.toString(n)}})}nonempty(e){return this.min(1,e)}}kr.create=(t,e)=>new kr({type:t,minLength:null,maxLength:null,exactLength:null,typeName:de.ZodArray,...we(e)});function Tl(t){if(t instanceof ct){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=di.create(Tl(r))}return new ct({...t._def,shape:()=>e})}else return t instanceof kr?new kr({...t._def,type:Tl(t.element)}):t instanceof di?di.create(Tl(t.unwrap())):t instanceof rl?rl.create(Tl(t.unwrap())):t instanceof Zr?Zr.create(t.items.map(e=>Tl(e))):t}class ct extends Ce{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=De.objectKeys(e);return this._cached={shape:e,keys:n}}_parse(e){if(this._getType(e)!==J.object){const u=this._getOrReturnCtx(e);return q(u,{code:W.invalid_type,expected:J.object,received:u.parsedType}),ve}const{status:r,ctx:i}=this._processInputParams(e),{shape:o,keys:l}=this._getCached(),s=[];if(!(this._def.catchall instanceof gi&&this._def.unknownKeys==="strip"))for(const u in i.data)l.includes(u)||s.push(u);const a=[];for(const u of l){const c=o[u],d=i.data[u];a.push({key:{status:"valid",value:u},value:c._parse(new Kr(i,d,i.path,u)),alwaysSet:u in i.data})}if(this._def.catchall instanceof gi){const u=this._def.unknownKeys;if(u==="passthrough")for(const c of s)a.push({key:{status:"valid",value:c},value:{status:"valid",value:i.data[c]}});else if(u==="strict")s.length>0&&(q(i,{code:W.unrecognized_keys,keys:s}),r.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const c of s){const d=i.data[c];a.push({key:{status:"valid",value:c},value:u._parse(new Kr(i,d,i.path,c)),alwaysSet:c in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const u=[];for(const c of a){const d=await c.key;u.push({key:d,value:await c.value,alwaysSet:c.alwaysSet})}return u}).then(u=>on.mergeObjectSync(r,u)):on.mergeObjectSync(r,a)}get shape(){return this._def.shape()}strict(e){return ce.errToObj,new ct({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{var i,o,l,s;const a=(l=(o=(i=this._def).errorMap)===null||o===void 0?void 0:o.call(i,n,r).message)!==null&&l!==void 0?l:r.defaultError;return n.code==="unrecognized_keys"?{message:(s=ce.errToObj(e).message)!==null&&s!==void 0?s:a}:{message:a}}}:{}})}strip(){return new ct({...this._def,unknownKeys:"strip"})}passthrough(){return new ct({...this._def,unknownKeys:"passthrough"})}extend(e){return new ct({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ct({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:de.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new ct({...this._def,catchall:e})}pick(e){const n={};return De.objectKeys(e).forEach(r=>{e[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new ct({...this._def,shape:()=>n})}omit(e){const n={};return De.objectKeys(this.shape).forEach(r=>{e[r]||(n[r]=this.shape[r])}),new ct({...this._def,shape:()=>n})}deepPartial(){return Tl(this)}partial(e){const n={};return De.objectKeys(this.shape).forEach(r=>{const i=this.shape[r];e&&!e[r]?n[r]=i:n[r]=i.optional()}),new ct({...this._def,shape:()=>n})}required(e){const n={};return De.objectKeys(this.shape).forEach(r=>{if(e&&!e[r])n[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof di;)o=o._def.innerType;n[r]=o}}),new ct({...this._def,shape:()=>n})}keyof(){return OC(De.objectKeys(this.shape))}}ct.create=(t,e)=>new ct({shape:()=>t,unknownKeys:"strip",catchall:gi.create(),typeName:de.ZodObject,...we(e)});ct.strictCreate=(t,e)=>new ct({shape:()=>t,unknownKeys:"strict",catchall:gi.create(),typeName:de.ZodObject,...we(e)});ct.lazycreate=(t,e)=>new ct({shape:t,unknownKeys:"strip",catchall:gi.create(),typeName:de.ZodObject,...we(e)});class xu extends Ce{_parse(e){const{ctx:n}=this._processInputParams(e),r=this._def.options;function i(o){for(const s of o)if(s.result.status==="valid")return s.result;for(const s of o)if(s.result.status==="dirty")return n.common.issues.push(...s.ctx.common.issues),s.result;const l=o.map(s=>new Cr(s.ctx.common.issues));return q(n,{code:W.invalid_union,unionErrors:l}),ve}if(n.common.async)return Promise.all(r.map(async o=>{const l={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:l}),ctx:l}})).then(i);{let o;const l=[];for(const a of r){const u={...n,common:{...n.common,issues:[]},parent:null},c=a._parseSync({data:n.data,path:n.path,parent:u});if(c.status==="valid")return c;c.status==="dirty"&&!o&&(o={result:c,ctx:u}),u.common.issues.length&&l.push(u.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;const s=l.map(a=>new Cr(a));return q(n,{code:W.invalid_union,unionErrors:s}),ve}}get options(){return this._def.options}}xu.create=(t,e)=>new xu({options:t,typeName:de.ZodUnion,...we(e)});const Zc=t=>t instanceof Su?Zc(t.schema):t instanceof Tr?Zc(t.innerType()):t instanceof Eu?[t.value]:t instanceof mo?t.options:t instanceof Cu?Object.keys(t.enum):t instanceof ku?Zc(t._def.innerType):t instanceof vu?[void 0]:t instanceof yu?[null]:null;class zf extends Ce{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==J.object)return q(n,{code:W.invalid_type,expected:J.object,received:n.parsedType}),ve;const r=this.discriminator,i=n.data[r],o=this.optionsMap.get(i);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(q(n,{code:W.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),ve)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,r){const i=new Map;for(const o of n){const l=Zc(o.shape[e]);if(!l)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const s of l){if(i.has(s))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(s)}`);i.set(s,o)}}return new zf({typeName:de.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:i,...we(r)})}}function Fm(t,e){const n=Wi(t),r=Wi(e);if(t===e)return{valid:!0,data:t};if(n===J.object&&r===J.object){const i=De.objectKeys(e),o=De.objectKeys(t).filter(s=>i.indexOf(s)!==-1),l={...t,...e};for(const s of o){const a=Fm(t[s],e[s]);if(!a.valid)return{valid:!1};l[s]=a.data}return{valid:!0,data:l}}else if(n===J.array&&r===J.array){if(t.length!==e.length)return{valid:!1};const i=[];for(let o=0;o<t.length;o++){const l=t[o],s=e[o],a=Fm(l,s);if(!a.valid)return{valid:!1};i.push(a.data)}return{valid:!0,data:i}}else return n===J.date&&r===J.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class _u extends Ce{_parse(e){const{status:n,ctx:r}=this._processInputParams(e),i=(o,l)=>{if(jm(o)||jm(l))return ve;const s=Fm(o.value,l.value);return s.valid?((zm(o)||zm(l))&&n.dirty(),{status:n.value,value:s.data}):(q(r,{code:W.invalid_intersection_types}),ve)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,l])=>i(o,l)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}_u.create=(t,e,n)=>new _u({left:t,right:e,typeName:de.ZodIntersection,...we(n)});class Zr extends Ce{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==J.array)return q(r,{code:W.invalid_type,expected:J.array,received:r.parsedType}),ve;if(r.data.length<this._def.items.length)return q(r,{code:W.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ve;!this._def.rest&&r.data.length>this._def.items.length&&(q(r,{code:W.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const o=[...r.data].map((l,s)=>{const a=this._def.items[s]||this._def.rest;return a?a._parse(new Kr(r,l,r.path,s)):null}).filter(l=>!!l);return r.common.async?Promise.all(o).then(l=>on.mergeArray(n,l)):on.mergeArray(n,o)}get items(){return this._def.items}rest(e){return new Zr({...this._def,rest:e})}}Zr.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Zr({items:t,typeName:de.ZodTuple,rest:null,...we(e)})};class wu extends Ce{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==J.object)return q(r,{code:W.invalid_type,expected:J.object,received:r.parsedType}),ve;const i=[],o=this._def.keyType,l=this._def.valueType;for(const s in r.data)i.push({key:o._parse(new Kr(r,s,r.path,s)),value:l._parse(new Kr(r,r.data[s],r.path,s))});return r.common.async?on.mergeObjectAsync(n,i):on.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof Ce?new wu({keyType:e,valueType:n,typeName:de.ZodRecord,...we(r)}):new wu({keyType:wr.create(),valueType:e,typeName:de.ZodRecord,...we(n)})}}class Zd extends Ce{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==J.map)return q(r,{code:W.invalid_type,expected:J.map,received:r.parsedType}),ve;const i=this._def.keyType,o=this._def.valueType,l=[...r.data.entries()].map(([s,a],u)=>({key:i._parse(new Kr(r,s,r.path,[u,"key"])),value:o._parse(new Kr(r,a,r.path,[u,"value"]))}));if(r.common.async){const s=new Map;return Promise.resolve().then(async()=>{for(const a of l){const u=await a.key,c=await a.value;if(u.status==="aborted"||c.status==="aborted")return ve;(u.status==="dirty"||c.status==="dirty")&&n.dirty(),s.set(u.value,c.value)}return{status:n.value,value:s}})}else{const s=new Map;for(const a of l){const u=a.key,c=a.value;if(u.status==="aborted"||c.status==="aborted")return ve;(u.status==="dirty"||c.status==="dirty")&&n.dirty(),s.set(u.value,c.value)}return{status:n.value,value:s}}}}Zd.create=(t,e,n)=>new Zd({valueType:e,keyType:t,typeName:de.ZodMap,...we(n)});class nl extends Ce{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==J.set)return q(r,{code:W.invalid_type,expected:J.set,received:r.parsedType}),ve;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(q(r,{code:W.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(q(r,{code:W.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const o=this._def.valueType;function l(a){const u=new Set;for(const c of a){if(c.status==="aborted")return ve;c.status==="dirty"&&n.dirty(),u.add(c.value)}return{status:n.value,value:u}}const s=[...r.data.values()].map((a,u)=>o._parse(new Kr(r,a,r.path,u)));return r.common.async?Promise.all(s).then(a=>l(a)):l(s)}min(e,n){return new nl({...this._def,minSize:{value:e,message:ce.toString(n)}})}max(e,n){return new nl({...this._def,maxSize:{value:e,message:ce.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}nl.create=(t,e)=>new nl({valueType:t,minSize:null,maxSize:null,typeName:de.ZodSet,...we(e)});class ts extends Ce{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==J.function)return q(n,{code:W.invalid_type,expected:J.function,received:n.parsedType}),ve;function r(s,a){return Wd({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Ud(),pu].filter(u=>!!u),issueData:{code:W.invalid_arguments,argumentsError:a}})}function i(s,a){return Wd({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Ud(),pu].filter(u=>!!u),issueData:{code:W.invalid_return_type,returnTypeError:a}})}const o={errorMap:n.common.contextualErrorMap},l=n.data;if(this._def.returns instanceof vs){const s=this;return yn(async function(...a){const u=new Cr([]),c=await s._def.args.parseAsync(a,o).catch(h=>{throw u.addIssue(r(a,h)),u}),d=await Reflect.apply(l,this,c);return await s._def.returns._def.type.parseAsync(d,o).catch(h=>{throw u.addIssue(i(d,h)),u})})}else{const s=this;return yn(function(...a){const u=s._def.args.safeParse(a,o);if(!u.success)throw new Cr([r(a,u.error)]);const c=Reflect.apply(l,this,u.data),d=s._def.returns.safeParse(c,o);if(!d.success)throw new Cr([i(c,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new ts({...this._def,args:Zr.create(e).rest(Wo.create())})}returns(e){return new ts({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,r){return new ts({args:e||Zr.create([]).rest(Wo.create()),returns:n||Wo.create(),typeName:de.ZodFunction,...we(r)})}}class Su extends Ce{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}Su.create=(t,e)=>new Su({getter:t,typeName:de.ZodLazy,...we(e)});class Eu extends Ce{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return q(n,{received:n.data,code:W.invalid_literal,expected:this._def.value}),ve}return{status:"valid",value:e.data}}get value(){return this._def.value}}Eu.create=(t,e)=>new Eu({value:t,typeName:de.ZodLiteral,...we(e)});function OC(t,e){return new mo({values:t,typeName:de.ZodEnum,...we(e)})}class mo extends Ce{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return q(n,{expected:De.joinValues(r),received:n.parsedType,code:W.invalid_type}),ve}if(this._def.values.indexOf(e.data)===-1){const n=this._getOrReturnCtx(e),r=this._def.values;return q(n,{received:n.data,code:W.invalid_enum_value,options:r}),ve}return yn(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e){return mo.create(e)}exclude(e){return mo.create(this.options.filter(n=>!e.includes(n)))}}mo.create=OC;class Cu extends Ce{_parse(e){const n=De.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==J.string&&r.parsedType!==J.number){const i=De.objectValues(n);return q(r,{expected:De.joinValues(i),received:r.parsedType,code:W.invalid_type}),ve}if(n.indexOf(e.data)===-1){const i=De.objectValues(n);return q(r,{received:r.data,code:W.invalid_enum_value,options:i}),ve}return yn(e.data)}get enum(){return this._def.values}}Cu.create=(t,e)=>new Cu({values:t,typeName:de.ZodNativeEnum,...we(e)});class vs extends Ce{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==J.promise&&n.common.async===!1)return q(n,{code:W.invalid_type,expected:J.promise,received:n.parsedType}),ve;const r=n.parsedType===J.promise?n.data:Promise.resolve(n.data);return yn(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}vs.create=(t,e)=>new vs({type:t,typeName:de.ZodPromise,...we(e)});class Tr extends Ce{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===de.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:r}=this._processInputParams(e),i=this._def.effect||null,o={addIssue:l=>{q(r,l),l.fatal?n.abort():n.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="preprocess"){const l=i.transform(r.data,o);return r.common.issues.length?{status:"dirty",value:r.data}:r.common.async?Promise.resolve(l).then(s=>this._def.schema._parseAsync({data:s,path:r.path,parent:r})):this._def.schema._parseSync({data:l,path:r.path,parent:r})}if(i.type==="refinement"){const l=s=>{const a=i.refinement(s,o);if(r.common.async)return Promise.resolve(a);if(a instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(r.common.async===!1){const s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?ve:(s.status==="dirty"&&n.dirty(),l(s.value),{status:n.value,value:s.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>s.status==="aborted"?ve:(s.status==="dirty"&&n.dirty(),l(s.value).then(()=>({status:n.value,value:s.value}))))}if(i.type==="transform")if(r.common.async===!1){const l=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!mu(l))return l;const s=i.transform(l.value,o);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:s}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(l=>mu(l)?Promise.resolve(i.transform(l.value,o)).then(s=>({status:n.value,value:s})):l);De.assertNever(i)}}Tr.create=(t,e,n)=>new Tr({schema:t,typeName:de.ZodEffects,effect:e,...we(n)});Tr.createWithPreprocess=(t,e,n)=>new Tr({schema:e,effect:{type:"preprocess",transform:t},typeName:de.ZodEffects,...we(n)});class di extends Ce{_parse(e){return this._getType(e)===J.undefined?yn(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}di.create=(t,e)=>new di({innerType:t,typeName:de.ZodOptional,...we(e)});class rl extends Ce{_parse(e){return this._getType(e)===J.null?yn(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}rl.create=(t,e)=>new rl({innerType:t,typeName:de.ZodNullable,...we(e)});class ku extends Ce{_parse(e){const{ctx:n}=this._processInputParams(e);let r=n.data;return n.parsedType===J.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}ku.create=(t,e)=>new ku({innerType:t,typeName:de.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...we(e)});class Gd extends Ce{_parse(e){const{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Vd(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Cr(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Cr(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Gd.create=(t,e)=>new Gd({innerType:t,typeName:de.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...we(e)});class Yd extends Ce{_parse(e){if(this._getType(e)!==J.nan){const r=this._getOrReturnCtx(e);return q(r,{code:W.invalid_type,expected:J.nan,received:r.parsedType}),ve}return{status:"valid",value:e.data}}}Yd.create=t=>new Yd({typeName:de.ZodNaN,...we(t)});const bM=Symbol("zod_brand");class PC extends Ce{_parse(e){const{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class Vu extends Ce{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?ve:o.status==="dirty"?(n.dirty(),RC(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?ve:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(e,n){return new Vu({in:e,out:n,typeName:de.ZodPipeline})}}class Xd extends Ce{_parse(e){const n=this._def.innerType._parse(e);return mu(n)&&(n.value=Object.freeze(n.value)),n}}Xd.create=(t,e)=>new Xd({innerType:t,typeName:de.ZodReadonly,...we(e)});const AC=(t,e={},n)=>t?gs.create().superRefine((r,i)=>{var o,l;if(!t(r)){const s=typeof e=="function"?e(r):typeof e=="string"?{message:e}:e,a=(l=(o=s.fatal)!==null&&o!==void 0?o:n)!==null&&l!==void 0?l:!0,u=typeof s=="string"?{message:s}:s;i.addIssue({code:"custom",...u,fatal:a})}}):gs.create(),$M={object:ct.lazycreate};var de;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(de||(de={}));const TM=(t,e={message:`Input not instance of ${t.name}`})=>AC(n=>n instanceof t,e),MC=wr.create,LC=ho.create,NM=Yd.create,RM=po.create,DC=gu.create,OM=tl.create,PM=Hd.create,AM=vu.create,MM=yu.create,LM=gs.create,DM=Wo.create,IM=gi.create,jM=Kd.create,zM=kr.create,FM=ct.create,BM=ct.strictCreate,UM=xu.create,WM=zf.create,VM=_u.create,HM=Zr.create,KM=wu.create,ZM=Zd.create,GM=nl.create,YM=ts.create,XM=Su.create,JM=Eu.create,QM=mo.create,qM=Cu.create,e5=vs.create,Px=Tr.create,t5=di.create,n5=rl.create,r5=Tr.createWithPreprocess,i5=Vu.create,o5=()=>MC().optional(),l5=()=>LC().optional(),s5=()=>DC().optional(),a5={string:t=>wr.create({...t,coerce:!0}),number:t=>ho.create({...t,coerce:!0}),boolean:t=>gu.create({...t,coerce:!0}),bigint:t=>po.create({...t,coerce:!0}),date:t=>tl.create({...t,coerce:!0})},u5=ve;var Cn=Object.freeze({__proto__:null,defaultErrorMap:pu,setErrorMap:hM,getErrorMap:Ud,makeIssue:Wd,EMPTY_PATH:pM,addIssueToContext:q,ParseStatus:on,INVALID:ve,DIRTY:RC,OK:yn,isAborted:jm,isDirty:zm,isValid:mu,isAsync:Vd,get util(){return De},get objectUtil(){return Im},ZodParsedType:J,getParsedType:Wi,ZodType:Ce,ZodString:wr,ZodNumber:ho,ZodBigInt:po,ZodBoolean:gu,ZodDate:tl,ZodSymbol:Hd,ZodUndefined:vu,ZodNull:yu,ZodAny:gs,ZodUnknown:Wo,ZodNever:gi,ZodVoid:Kd,ZodArray:kr,ZodObject:ct,ZodUnion:xu,ZodDiscriminatedUnion:zf,ZodIntersection:_u,ZodTuple:Zr,ZodRecord:wu,ZodMap:Zd,ZodSet:nl,ZodFunction:ts,ZodLazy:Su,ZodLiteral:Eu,ZodEnum:mo,ZodNativeEnum:Cu,ZodPromise:vs,ZodEffects:Tr,ZodTransformer:Tr,ZodOptional:di,ZodNullable:rl,ZodDefault:ku,ZodCatch:Gd,ZodNaN:Yd,BRAND:bM,ZodBranded:PC,ZodPipeline:Vu,ZodReadonly:Xd,custom:AC,Schema:Ce,ZodSchema:Ce,late:$M,get ZodFirstPartyTypeKind(){return de},coerce:a5,any:LM,array:zM,bigint:RM,boolean:DC,date:OM,discriminatedUnion:WM,effect:Px,enum:QM,function:YM,instanceof:TM,intersection:VM,lazy:XM,literal:JM,map:ZM,nan:NM,nativeEnum:qM,never:IM,null:MM,nullable:n5,number:LC,object:FM,oboolean:s5,onumber:l5,optional:t5,ostring:o5,pipeline:i5,preprocess:r5,promise:e5,record:KM,set:GM,strictObject:BM,string:MC,symbol:PM,transformer:Px,tuple:HM,undefined:AM,union:UM,unknown:DM,void:jM,NEVER:u5,ZodIssueCode:W,quotelessJson:fM,ZodError:Cr});const c5=Cn.union([Cn.object({id:Cn.string(),mode:Cn.literal("proxy"),full_name:Cn.string().optional().nullable(),username:Cn.string().optional().nullable(),avatar_url:Cn.string().url().optional().nullable(),enabled:Cn.boolean()}),Cn.object({mode:Cn.literal("local"),enabled:Cn.boolean().optional()}),Cn.object({mode:Cn.literal("unauthorized"),enabled:Cn.boolean().optional()})]);function d5(t){const[e,n]=p.useState({status:"not-asked"}),[r,i]=p.useState(0);return p.useEffect(()=>{n({status:"loading"}),t.getSession().then(async o=>{try{if(zo.isOk(o)){const l=o.value;n({status:"success",data:c5.parse(l)})}else o.error.statusCode===401?n({status:"success",data:{mode:"unauthorized"}}):r<3?setTimeout(()=>{i(r+1)},200*r):n({status:"error",error:"Could not fetch session"})}catch(l){console.error("Could not authorize:",l),n({status:"error",error:"Got an error while trying to get session"})}})},[r]),e}const Ax=t=>typeof t=="boolean"?"".concat(t):t===0?"0":t,Mx=pS,f5=(t,e)=>n=>{var r;if((e==null?void 0:e.variants)==null)return Mx(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:o}=e,l=Object.keys(i).map(u=>{const c=n==null?void 0:n[u],d=o==null?void 0:o[u];if(c===null)return null;const f=Ax(c)||Ax(d);return i[u][f]}),s=n&&Object.entries(n).reduce((u,c)=>{let[d,f]=c;return f===void 0||(u[d]=f),u},{}),a=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((u,c)=>{let{class:d,className:f,...h}=c;return Object.entries(h).every(g=>{let[m,w]=g;return Array.isArray(w)?w.includes({...o,...s}[m]):{...o,...s}[m]===w})?[...u,d,f]:u},[]);return Mx(t,l,a,n==null?void 0:n.class,n==null?void 0:n.className)},h5=f5("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),IC=p.forwardRef(({className:t,variant:e,size:n,asChild:r=!1,...i},o)=>{const l=r?fs:"button";return x.jsx(l,{className:xt(h5({variant:e,size:n,className:t})),ref:o,...i})});IC.displayName="Button";const jv=p.forwardRef(({className:t,type:e,...n},r)=>x.jsx("input",{type:e,className:xt("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),ref:r,...n}));jv.displayName="Input";function jC(t){const e=t+"CollectionProvider",[n,r]=al(e),[i,o]=n(e,{collectionRef:{current:null},itemMap:new Map}),l=h=>{const{scope:g,children:m}=h,w=re.useRef(null),v=re.useRef(new Map).current;return re.createElement(i,{scope:g,itemMap:v,collectionRef:w},m)},s=t+"CollectionSlot",a=re.forwardRef((h,g)=>{const{scope:m,children:w}=h,v=o(s,m),y=st(g,v.collectionRef);return re.createElement(fs,{ref:y},w)}),u=t+"CollectionItemSlot",c="data-radix-collection-item",d=re.forwardRef((h,g)=>{const{scope:m,children:w,...v}=h,y=re.useRef(null),_=st(g,y),S=o(u,m);return re.useEffect(()=>(S.itemMap.set(y,{ref:y,...v}),()=>void S.itemMap.delete(y))),re.createElement(fs,{[c]:"",ref:_},w)});function f(h){const g=o(t+"CollectionConsumer",h);return re.useCallback(()=>{const w=g.collectionRef.current;if(!w)return[];const v=Array.from(w.querySelectorAll(`[${c}]`));return Array.from(g.itemMap.values()).sort((S,E)=>v.indexOf(S.ref.current)-v.indexOf(E.ref.current))},[g.collectionRef,g.itemMap])}return[{Provider:l,Slot:a,ItemSlot:d},f,r]}function p5(t,e=globalThis==null?void 0:globalThis.document){const n=en(t);p.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return e.addEventListener("keydown",r),()=>e.removeEventListener("keydown",r)},[n,e])}const Bm="dismissableLayer.update",m5="dismissableLayer.pointerDownOutside",g5="dismissableLayer.focusOutside";let Lx;const v5=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),y5=p.forwardRef((t,e)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:l,onInteractOutside:s,onDismiss:a,...u}=t,c=p.useContext(v5),[d,f]=p.useState(null),h=(n=d==null?void 0:d.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,g]=p.useState({}),m=st(e,N=>f(N)),w=Array.from(c.layers),[v]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),y=w.indexOf(v),_=d?w.indexOf(d):-1,S=c.layersWithOutsidePointerEventsDisabled.size>0,E=_>=y,$=x5(N=>{const R=N.target,b=[...c.branches].some(L=>L.contains(R));!E||b||(o==null||o(N),s==null||s(N),N.defaultPrevented||a==null||a())},h),C=_5(N=>{const R=N.target;[...c.branches].some(L=>L.contains(R))||(l==null||l(N),s==null||s(N),N.defaultPrevented||a==null||a())},h);return p5(N=>{_===c.layers.size-1&&(i==null||i(N),!N.defaultPrevented&&a&&(N.preventDefault(),a()))},h),p.useEffect(()=>{if(d)return r&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(Lx=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(d)),c.layers.add(d),Dx(),()=>{r&&c.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=Lx)}},[d,h,r,c]),p.useEffect(()=>()=>{d&&(c.layers.delete(d),c.layersWithOutsidePointerEventsDisabled.delete(d),Dx())},[d,c]),p.useEffect(()=>{const N=()=>g({});return document.addEventListener(Bm,N),()=>document.removeEventListener(Bm,N)},[]),p.createElement(Ke.div,ie({},u,{ref:m,style:{pointerEvents:S?E?"auto":"none":void 0,...t.style},onFocusCapture:nt(t.onFocusCapture,C.onFocusCapture),onBlurCapture:nt(t.onBlurCapture,C.onBlurCapture),onPointerDownCapture:nt(t.onPointerDownCapture,$.onPointerDownCapture)}))});function x5(t,e=globalThis==null?void 0:globalThis.document){const n=en(t),r=p.useRef(!1),i=p.useRef(()=>{});return p.useEffect(()=>{const o=s=>{if(s.target&&!r.current){let c=function(){zC(m5,n,u,{discrete:!0})};var a=c;const u={originalEvent:s};s.pointerType==="touch"?(e.removeEventListener("click",i.current),i.current=c,e.addEventListener("click",i.current,{once:!0})):c()}else e.removeEventListener("click",i.current);r.current=!1},l=window.setTimeout(()=>{e.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(l),e.removeEventListener("pointerdown",o),e.removeEventListener("click",i.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function _5(t,e=globalThis==null?void 0:globalThis.document){const n=en(t),r=p.useRef(!1);return p.useEffect(()=>{const i=o=>{o.target&&!r.current&&zC(g5,n,{originalEvent:o},{discrete:!1})};return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Dx(){const t=new CustomEvent(Bm);document.dispatchEvent(t)}function zC(t,e,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&i.addEventListener(t,e,{once:!0}),r?n2(i,o):i.dispatchEvent(o)}let Wh=0;function w5(){p.useEffect(()=>{var t,e;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(t=n[0])!==null&&t!==void 0?t:Ix()),document.body.insertAdjacentElement("beforeend",(e=n[1])!==null&&e!==void 0?e:Ix()),Wh++,()=>{Wh===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),Wh--}},[])}function Ix(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",t}const Vh="focusScope.autoFocusOnMount",Hh="focusScope.autoFocusOnUnmount",jx={bubbles:!1,cancelable:!0},S5=p.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...l}=t,[s,a]=p.useState(null),u=en(i),c=en(o),d=p.useRef(null),f=st(e,m=>a(m)),h=p.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;p.useEffect(()=>{if(r){let y=function($){if(h.paused||!s)return;const C=$.target;s.contains(C)?d.current=C:Li(d.current,{select:!0})},_=function($){if(h.paused||!s)return;const C=$.relatedTarget;C!==null&&(s.contains(C)||Li(d.current,{select:!0}))},S=function($){if(document.activeElement===document.body)for(const N of $)N.removedNodes.length>0&&Li(s)};var m=y,w=_,v=S;document.addEventListener("focusin",y),document.addEventListener("focusout",_);const E=new MutationObserver(S);return s&&E.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",_),E.disconnect()}}},[r,s,h.paused]),p.useEffect(()=>{if(s){Fx.add(h);const m=document.activeElement;if(!s.contains(m)){const v=new CustomEvent(Vh,jx);s.addEventListener(Vh,u),s.dispatchEvent(v),v.defaultPrevented||(E5(T5(FC(s)),{select:!0}),document.activeElement===m&&Li(s))}return()=>{s.removeEventListener(Vh,u),setTimeout(()=>{const v=new CustomEvent(Hh,jx);s.addEventListener(Hh,c),s.dispatchEvent(v),v.defaultPrevented||Li(m??document.body,{select:!0}),s.removeEventListener(Hh,c),Fx.remove(h)},0)}}},[s,u,c,h]);const g=p.useCallback(m=>{if(!n&&!r||h.paused)return;const w=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,v=document.activeElement;if(w&&v){const y=m.currentTarget,[_,S]=C5(y);_&&S?!m.shiftKey&&v===S?(m.preventDefault(),n&&Li(_,{select:!0})):m.shiftKey&&v===_&&(m.preventDefault(),n&&Li(S,{select:!0})):v===y&&m.preventDefault()}},[n,r,h.paused]);return p.createElement(Ke.div,ie({tabIndex:-1},l,{ref:f,onKeyDown:g}))});function E5(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(Li(r,{select:e}),document.activeElement!==n)return}function C5(t){const e=FC(t),n=zx(e,t),r=zx(e.reverse(),t);return[n,r]}function FC(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function zx(t,e){for(const n of t)if(!k5(n,{upTo:e}))return n}function k5(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 b5(t){return t instanceof HTMLInputElement&&"select"in t}function Li(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&b5(t)&&e&&t.select()}}const Fx=$5();function $5(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=Bx(t,e),t.unshift(e)},remove(e){var n;t=Bx(t,e),(n=t[0])===null||n===void 0||n.resume()}}}function Bx(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function T5(t){return t.filter(e=>e.tagName!=="A")}const N5=I_.useId||(()=>{});let R5=0;function Ff(t){const[e,n]=p.useState(N5());return Vn(()=>{t||n(r=>r??String(R5++))},[t]),t||(e?`radix-${e}`:"")}const O5=["top","right","bottom","left"],go=Math.min,jn=Math.max,Jd=Math.round,Cc=Math.floor,vo=t=>({x:t,y:t}),P5={left:"right",right:"left",bottom:"top",top:"bottom"},A5={start:"end",end:"start"};function Um(t,e,n){return jn(t,go(e,n))}function vi(t,e){return typeof t=="function"?t(e):t}function yi(t){return t.split("-")[0]}function js(t){return t.split("-")[1]}function zv(t){return t==="x"?"y":"x"}function Fv(t){return t==="y"?"height":"width"}function zs(t){return["top","bottom"].includes(yi(t))?"y":"x"}function Bv(t){return zv(zs(t))}function M5(t,e,n){n===void 0&&(n=!1);const r=js(t),i=Bv(t),o=Fv(i);let l=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(l=Qd(l)),[l,Qd(l)]}function L5(t){const e=Qd(t);return[Wm(t),e,Wm(e)]}function Wm(t){return t.replace(/start|end/g,e=>A5[e])}function D5(t,e,n){const r=["left","right"],i=["right","left"],o=["top","bottom"],l=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:r:e?r:i;case"left":case"right":return e?o:l;default:return[]}}function I5(t,e,n,r){const i=js(t);let o=D5(yi(t),n==="start",r);return i&&(o=o.map(l=>l+"-"+i),e&&(o=o.concat(o.map(Wm)))),o}function Qd(t){return t.replace(/left|right|bottom|top/g,e=>P5[e])}function j5(t){return{top:0,right:0,bottom:0,left:0,...t}}function BC(t){return typeof t!="number"?j5(t):{top:t,right:t,bottom:t,left:t}}function qd(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}function Ux(t,e,n){let{reference:r,floating:i}=t;const o=zs(e),l=Bv(e),s=Fv(l),a=yi(e),u=o==="y",c=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2;let h;switch(a){case"top":h={x:c,y:r.y-i.height};break;case"bottom":h={x:c,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-i.width,y:d};break;default:h={x:r.x,y:r.y}}switch(js(e)){case"start":h[l]-=f*(n&&u?-1:1);break;case"end":h[l]+=f*(n&&u?-1:1);break}return h}const z5=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:l}=n,s=o.filter(Boolean),a=await(l.isRTL==null?void 0:l.isRTL(e));let u=await l.getElementRects({reference:t,floating:e,strategy:i}),{x:c,y:d}=Ux(u,r,a),f=r,h={},g=0;for(let m=0;m<s.length;m++){const{name:w,fn:v}=s[m],{x:y,y:_,data:S,reset:E}=await v({x:c,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:h,rects:u,platform:l,elements:{reference:t,floating:e}});if(c=y??c,d=_??d,h={...h,[w]:{...h[w],...S}},E&&g<=50){g++,typeof E=="object"&&(E.placement&&(f=E.placement),E.rects&&(u=E.rects===!0?await l.getElementRects({reference:t,floating:e,strategy:i}):E.rects),{x:c,y:d}=Ux(u,f,a)),m=-1;continue}}return{x:c,y:d,placement:f,strategy:i,middlewareData:h}};async function bu(t,e){var n;e===void 0&&(e={});const{x:r,y:i,platform:o,rects:l,elements:s,strategy:a}=t,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=vi(e,t),g=BC(h),w=s[f?d==="floating"?"reference":"floating":d],v=qd(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(w)))==null||n?w:w.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(s.floating)),boundary:u,rootBoundary:c,strategy:a})),y=d==="floating"?{...l.floating,x:r,y:i}:l.reference,_=await(o.getOffsetParent==null?void 0:o.getOffsetParent(s.floating)),S=await(o.isElement==null?void 0:o.isElement(_))?await(o.getScale==null?void 0:o.getScale(_))||{x:1,y:1}:{x:1,y:1},E=qd(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({rect:y,offsetParent:_,strategy:a}):y);return{top:(v.top-E.top+g.top)/S.y,bottom:(E.bottom-v.bottom+g.bottom)/S.y,left:(v.left-E.left+g.left)/S.x,right:(E.right-v.right+g.right)/S.x}}const Wx=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:i,rects:o,platform:l,elements:s,middlewareData:a}=e,{element:u,padding:c=0}=vi(t,e)||{};if(u==null)return{};const d=BC(c),f={x:n,y:r},h=Bv(i),g=Fv(h),m=await l.getDimensions(u),w=h==="y",v=w?"top":"left",y=w?"bottom":"right",_=w?"clientHeight":"clientWidth",S=o.reference[g]+o.reference[h]-f[h]-o.floating[g],E=f[h]-o.reference[h],$=await(l.getOffsetParent==null?void 0:l.getOffsetParent(u));let C=$?$[_]:0;(!C||!await(l.isElement==null?void 0:l.isElement($)))&&(C=s.floating[_]||o.floating[g]);const N=S/2-E/2,R=C/2-m[g]/2-1,b=go(d[v],R),L=go(d[y],R),F=b,le=C-m[g]-L,V=C/2-m[g]/2+N,H=Um(F,V,le),O=!a.arrow&&js(i)!=null&&V!=H&&o.reference[g]/2-(V<F?b:L)-m[g]/2<0,A=O?V<F?V-F:V-le:0;return{[h]:f[h]+A,data:{[h]:H,centerOffset:V-H-A,...O&&{alignmentOffset:A}},reset:O}}}),F5=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:i,middlewareData:o,rects:l,initialPlacement:s,platform:a,elements:u}=e,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:m=!0,...w}=vi(t,e);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const v=yi(i),y=yi(s)===s,_=await(a.isRTL==null?void 0:a.isRTL(u.floating)),S=f||(y||!m?[Qd(s)]:L5(s));!f&&g!=="none"&&S.push(...I5(s,m,g,_));const E=[s,...S],$=await bu(e,w),C=[];let N=((r=o.flip)==null?void 0:r.overflows)||[];if(c&&C.push($[v]),d){const F=M5(i,l,_);C.push($[F[0]],$[F[1]])}if(N=[...N,{placement:i,overflows:C}],!C.every(F=>F<=0)){var R,b;const F=(((R=o.flip)==null?void 0:R.index)||0)+1,le=E[F];if(le)return{data:{index:F,overflows:N},reset:{placement:le}};let V=(b=N.filter(H=>H.overflows[0]<=0).sort((H,O)=>H.overflows[1]-O.overflows[1])[0])==null?void 0:b.placement;if(!V)switch(h){case"bestFit":{var L;const H=(L=N.map(O=>[O.placement,O.overflows.filter(A=>A>0).reduce((A,k)=>A+k,0)]).sort((O,A)=>O[1]-A[1])[0])==null?void 0:L[0];H&&(V=H);break}case"initialPlacement":V=s;break}if(i!==V)return{reset:{placement:V}}}return{}}}};function Vx(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Hx(t){return O5.some(e=>t[e]>=0)}const B5=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:r="referenceHidden",...i}=vi(t,e);switch(r){case"referenceHidden":{const o=await bu(e,{...i,elementContext:"reference"}),l=Vx(o,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:Hx(l)}}}case"escaped":{const o=await bu(e,{...i,altBoundary:!0}),l=Vx(o,n.floating);return{data:{escapedOffsets:l,escaped:Hx(l)}}}default:return{}}}}};async function U5(t,e){const{placement:n,platform:r,elements:i}=t,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),l=yi(n),s=js(n),a=zs(n)==="y",u=["left","top"].includes(l)?-1:1,c=o&&a?-1:1,d=vi(e,t);let{mainAxis:f,crossAxis:h,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return s&&typeof g=="number"&&(h=s==="end"?g*-1:g),a?{x:h*c,y:f*u}:{x:f*u,y:h*c}}const W5=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){const{x:n,y:r}=e,i=await U5(e,t);return{x:n+i.x,y:r+i.y,data:i}}}},V5=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:i}=e,{mainAxis:o=!0,crossAxis:l=!1,limiter:s={fn:w=>{let{x:v,y}=w;return{x:v,y}}},...a}=vi(t,e),u={x:n,y:r},c=await bu(e,a),d=zs(yi(i)),f=zv(d);let h=u[f],g=u[d];if(o){const w=f==="y"?"top":"left",v=f==="y"?"bottom":"right",y=h+c[w],_=h-c[v];h=Um(y,h,_)}if(l){const w=d==="y"?"top":"left",v=d==="y"?"bottom":"right",y=g+c[w],_=g-c[v];g=Um(y,g,_)}const m=s.fn({...e,[f]:h,[d]:g});return{...m,data:{x:m.x-n,y:m.y-r}}}}},H5=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:i,rects:o,middlewareData:l}=e,{offset:s=0,mainAxis:a=!0,crossAxis:u=!0}=vi(t,e),c={x:n,y:r},d=zs(i),f=zv(d);let h=c[f],g=c[d];const m=vi(s,e),w=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(a){const _=f==="y"?"height":"width",S=o.reference[f]-o.floating[_]+w.mainAxis,E=o.reference[f]+o.reference[_]-w.mainAxis;h<S?h=S:h>E&&(h=E)}if(u){var v,y;const _=f==="y"?"width":"height",S=["top","left"].includes(yi(i)),E=o.reference[d]-o.floating[_]+(S&&((v=l.offset)==null?void 0:v[d])||0)+(S?0:w.crossAxis),$=o.reference[d]+o.reference[_]+(S?0:((y=l.offset)==null?void 0:y[d])||0)-(S?w.crossAxis:0);g<E?g=E:g>$&&(g=$)}return{[f]:h,[d]:g}}}},K5=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:r,platform:i,elements:o}=e,{apply:l=()=>{},...s}=vi(t,e),a=await bu(e,s),u=yi(n),c=js(n),d=zs(n)==="y",{width:f,height:h}=r.floating;let g,m;u==="top"||u==="bottom"?(g=u,m=c===(await(i.isRTL==null?void 0:i.isRTL(o.floating))?"start":"end")?"left":"right"):(m=u,g=c==="end"?"top":"bottom");const w=h-a[g],v=f-a[m],y=!e.middlewareData.shift;let _=w,S=v;if(d){const $=f-a.left-a.right;S=c||y?go(v,$):$}else{const $=h-a.top-a.bottom;_=c||y?go(w,$):$}if(y&&!c){const $=jn(a.left,0),C=jn(a.right,0),N=jn(a.top,0),R=jn(a.bottom,0);d?S=f-2*($!==0||C!==0?$+C:jn(a.left,a.right)):_=h-2*(N!==0||R!==0?N+R:jn(a.top,a.bottom))}await l({...e,availableWidth:S,availableHeight:_});const E=await i.getDimensions(o.floating);return f!==E.width||h!==E.height?{reset:{rects:!0}}:{}}}};function yo(t){return UC(t)?(t.nodeName||"").toLowerCase():"#document"}function Un(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Ti(t){var e;return(e=(UC(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function UC(t){return t instanceof Node||t instanceof Un(t).Node}function xi(t){return t instanceof Element||t instanceof Un(t).Element}function Gr(t){return t instanceof HTMLElement||t instanceof Un(t).HTMLElement}function Kx(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Un(t).ShadowRoot}function Hu(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=ar(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!["inline","contents"].includes(i)}function Z5(t){return["table","td","th"].includes(yo(t))}function Uv(t){const e=Wv(),n=ar(t);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function G5(t){let e=ys(t);for(;Gr(e)&&!Bf(e);){if(Uv(e))return e;e=ys(e)}return null}function Wv(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Bf(t){return["html","body","#document"].includes(yo(t))}function ar(t){return Un(t).getComputedStyle(t)}function Uf(t){return xi(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function ys(t){if(yo(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Kx(t)&&t.host||Ti(t);return Kx(e)?e.host:e}function WC(t){const e=ys(t);return Bf(e)?t.ownerDocument?t.ownerDocument.body:t.body:Gr(e)&&Hu(e)?e:WC(e)}function $u(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=WC(t),o=i===((r=t.ownerDocument)==null?void 0:r.body),l=Un(i);return o?e.concat(l,l.visualViewport||[],Hu(i)?i:[],l.frameElement&&n?$u(l.frameElement):[]):e.concat(i,$u(i,[],n))}function VC(t){const e=ar(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=Gr(t),o=i?t.offsetWidth:n,l=i?t.offsetHeight:r,s=Jd(n)!==o||Jd(r)!==l;return s&&(n=o,r=l),{width:n,height:r,$:s}}function Vv(t){return xi(t)?t:t.contextElement}function ns(t){const e=Vv(t);if(!Gr(e))return vo(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:o}=VC(e);let l=(o?Jd(n.width):n.width)/r,s=(o?Jd(n.height):n.height)/i;return(!l||!Number.isFinite(l))&&(l=1),(!s||!Number.isFinite(s))&&(s=1),{x:l,y:s}}const Y5=vo(0);function HC(t){const e=Un(t);return!Wv()||!e.visualViewport?Y5:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function X5(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Un(t)?!1:e}function il(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),o=Vv(t);let l=vo(1);e&&(r?xi(r)&&(l=ns(r)):l=ns(t));const s=X5(o,n,r)?HC(o):vo(0);let a=(i.left+s.x)/l.x,u=(i.top+s.y)/l.y,c=i.width/l.x,d=i.height/l.y;if(o){const f=Un(o),h=r&&xi(r)?Un(r):r;let g=f.frameElement;for(;g&&r&&h!==f;){const m=ns(g),w=g.getBoundingClientRect(),v=ar(g),y=w.left+(g.clientLeft+parseFloat(v.paddingLeft))*m.x,_=w.top+(g.clientTop+parseFloat(v.paddingTop))*m.y;a*=m.x,u*=m.y,c*=m.x,d*=m.y,a+=y,u+=_,g=Un(g).frameElement}}return qd({width:c,height:d,x:a,y:u})}function J5(t){let{rect:e,offsetParent:n,strategy:r}=t;const i=Gr(n),o=Ti(n);if(n===o)return e;let l={scrollLeft:0,scrollTop:0},s=vo(1);const a=vo(0);if((i||!i&&r!=="fixed")&&((yo(n)!=="body"||Hu(o))&&(l=Uf(n)),Gr(n))){const u=il(n);s=ns(n),a.x=u.x+n.clientLeft,a.y=u.y+n.clientTop}return{width:e.width*s.x,height:e.height*s.y,x:e.x*s.x-l.scrollLeft*s.x+a.x,y:e.y*s.y-l.scrollTop*s.y+a.y}}function Q5(t){return Array.from(t.getClientRects())}function KC(t){return il(Ti(t)).left+Uf(t).scrollLeft}function q5(t){const e=Ti(t),n=Uf(t),r=t.ownerDocument.body,i=jn(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),o=jn(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+KC(t);const s=-n.scrollTop;return ar(r).direction==="rtl"&&(l+=jn(e.clientWidth,r.clientWidth)-i),{width:i,height:o,x:l,y:s}}function e4(t,e){const n=Un(t),r=Ti(t),i=n.visualViewport;let o=r.clientWidth,l=r.clientHeight,s=0,a=0;if(i){o=i.width,l=i.height;const u=Wv();(!u||u&&e==="fixed")&&(s=i.offsetLeft,a=i.offsetTop)}return{width:o,height:l,x:s,y:a}}function t4(t,e){const n=il(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,o=Gr(t)?ns(t):vo(1),l=t.clientWidth*o.x,s=t.clientHeight*o.y,a=i*o.x,u=r*o.y;return{width:l,height:s,x:a,y:u}}function Zx(t,e,n){let r;if(e==="viewport")r=e4(t,n);else if(e==="document")r=q5(Ti(t));else if(xi(e))r=t4(e,n);else{const i=HC(t);r={...e,x:e.x-i.x,y:e.y-i.y}}return qd(r)}function ZC(t,e){const n=ys(t);return n===e||!xi(n)||Bf(n)?!1:ar(n).position==="fixed"||ZC(n,e)}function n4(t,e){const n=e.get(t);if(n)return n;let r=$u(t,[],!1).filter(s=>xi(s)&&yo(s)!=="body"),i=null;const o=ar(t).position==="fixed";let l=o?ys(t):t;for(;xi(l)&&!Bf(l);){const s=ar(l),a=Uv(l);!a&&s.position==="fixed"&&(i=null),(o?!a&&!i:!a&&s.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Hu(l)&&!a&&ZC(t,l))?r=r.filter(c=>c!==l):i=s,l=ys(l)}return e.set(t,r),r}function r4(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const l=[...n==="clippingAncestors"?n4(e,this._c):[].concat(n),r],s=l[0],a=l.reduce((u,c)=>{const d=Zx(e,c,i);return u.top=jn(d.top,u.top),u.right=go(d.right,u.right),u.bottom=go(d.bottom,u.bottom),u.left=jn(d.left,u.left),u},Zx(e,s,i));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function i4(t){return VC(t)}function o4(t,e,n){const r=Gr(e),i=Ti(e),o=n==="fixed",l=il(t,!0,o,e);let s={scrollLeft:0,scrollTop:0};const a=vo(0);if(r||!r&&!o)if((yo(e)!=="body"||Hu(i))&&(s=Uf(e)),r){const u=il(e,!0,o,e);a.x=u.x+e.clientLeft,a.y=u.y+e.clientTop}else i&&(a.x=KC(i));return{x:l.left+s.scrollLeft-a.x,y:l.top+s.scrollTop-a.y,width:l.width,height:l.height}}function Gx(t,e){return!Gr(t)||ar(t).position==="fixed"?null:e?e(t):t.offsetParent}function GC(t,e){const n=Un(t);if(!Gr(t))return n;let r=Gx(t,e);for(;r&&Z5(r)&&ar(r).position==="static";)r=Gx(r,e);return r&&(yo(r)==="html"||yo(r)==="body"&&ar(r).position==="static"&&!Uv(r))?n:r||G5(t)||n}const l4=async function(t){let{reference:e,floating:n,strategy:r}=t;const i=this.getOffsetParent||GC,o=this.getDimensions;return{reference:o4(e,await i(n),r),floating:{x:0,y:0,...await o(n)}}};function s4(t){return ar(t).direction==="rtl"}const a4={convertOffsetParentRelativeRectToViewportRelativeRect:J5,getDocumentElement:Ti,getClippingRect:r4,getOffsetParent:GC,getElementRects:l4,getClientRects:Q5,getDimensions:i4,getScale:ns,isElement:xi,isRTL:s4};function u4(t,e){let n=null,r;const i=Ti(t);function o(){clearTimeout(r),n&&n.disconnect(),n=null}function l(s,a){s===void 0&&(s=!1),a===void 0&&(a=1),o();const{left:u,top:c,width:d,height:f}=t.getBoundingClientRect();if(s||e(),!d||!f)return;const h=Cc(c),g=Cc(i.clientWidth-(u+d)),m=Cc(i.clientHeight-(c+f)),w=Cc(u),y={rootMargin:-h+"px "+-g+"px "+-m+"px "+-w+"px",threshold:jn(0,go(1,a))||1};let _=!0;function S(E){const $=E[0].intersectionRatio;if($!==a){if(!_)return l();$?l(!1,$):r=setTimeout(()=>{l(!1,1e-7)},100)}_=!1}try{n=new IntersectionObserver(S,{...y,root:i.ownerDocument})}catch{n=new IntersectionObserver(S,y)}n.observe(t)}return l(!0),o}function c4(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:a=!1}=r,u=Vv(t),c=i||o?[...u?$u(u):[],...$u(e)]:[];c.forEach(v=>{i&&v.addEventListener("scroll",n,{passive:!0}),o&&v.addEventListener("resize",n)});const d=u&&s?u4(u,n):null;let f=-1,h=null;l&&(h=new ResizeObserver(v=>{let[y]=v;y&&y.target===u&&h&&(h.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{h&&h.observe(e)})),n()}),u&&!a&&h.observe(u),h.observe(e));let g,m=a?il(t):null;a&&w();function w(){const v=il(t);m&&(v.x!==m.x||v.y!==m.y||v.width!==m.width||v.height!==m.height)&&n(),m=v,g=requestAnimationFrame(w)}return n(),()=>{c.forEach(v=>{i&&v.removeEventListener("scroll",n),o&&v.removeEventListener("resize",n)}),d&&d(),h&&h.disconnect(),h=null,a&&cancelAnimationFrame(g)}}const d4=(t,e,n)=>{const r=new Map,i={platform:a4,...n},o={...i.platform,_c:r};return z5(t,e,{...i,platform:o})},f4=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:i}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?Wx({element:r.current,padding:i}).fn(n):{}:r?Wx({element:r,padding:i}).fn(n):{}}}};var Gc=typeof document<"u"?p.useLayoutEffect:p.useEffect;function ef(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,i;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(!ef(t[r],e[r]))return!1;return!0}if(i=Object.keys(t),n=i.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&t.$$typeof)&&!ef(t[o],e[o]))return!1}return!0}return t!==t&&e!==e}function YC(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Yx(t,e){const n=YC(t);return Math.round(e*n)/n}function Xx(t){const e=p.useRef(t);return Gc(()=>{e.current=t}),e}function h4(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:l}={},transform:s=!0,whileElementsMounted:a,open:u}=t,[c,d]=p.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[f,h]=p.useState(r);ef(f,r)||h(r);const[g,m]=p.useState(null),[w,v]=p.useState(null),y=p.useCallback(O=>{O!=$.current&&($.current=O,m(O))},[m]),_=p.useCallback(O=>{O!==C.current&&(C.current=O,v(O))},[v]),S=o||g,E=l||w,$=p.useRef(null),C=p.useRef(null),N=p.useRef(c),R=Xx(a),b=Xx(i),L=p.useCallback(()=>{if(!$.current||!C.current)return;const O={placement:e,strategy:n,middleware:f};b.current&&(O.platform=b.current),d4($.current,C.current,O).then(A=>{const k={...A,isPositioned:!0};F.current&&!ef(N.current,k)&&(N.current=k,Yr.flushSync(()=>{d(k)}))})},[f,e,n,b]);Gc(()=>{u===!1&&N.current.isPositioned&&(N.current.isPositioned=!1,d(O=>({...O,isPositioned:!1})))},[u]);const F=p.useRef(!1);Gc(()=>(F.current=!0,()=>{F.current=!1}),[]),Gc(()=>{if(S&&($.current=S),E&&(C.current=E),S&&E){if(R.current)return R.current(S,E,L);L()}},[S,E,L,R]);const le=p.useMemo(()=>({reference:$,floating:C,setReference:y,setFloating:_}),[y,_]),V=p.useMemo(()=>({reference:S,floating:E}),[S,E]),H=p.useMemo(()=>{const O={position:n,left:0,top:0};if(!V.floating)return O;const A=Yx(V.floating,c.x),k=Yx(V.floating,c.y);return s?{...O,transform:"translate("+A+"px, "+k+"px)",...YC(V.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:A,top:k}},[n,s,V.floating,c.x,c.y]);return p.useMemo(()=>({...c,update:L,refs:le,elements:V,floatingStyles:H}),[c,L,le,V,H])}function XC(t){const[e,n]=p.useState(void 0);return Vn(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let l,s;if("borderBoxSize"in o){const a=o.borderBoxSize,u=Array.isArray(a)?a[0]:a;l=u.inlineSize,s=u.blockSize}else l=t.offsetWidth,s=t.offsetHeight;n({width:l,height:s})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}const JC="Popper",[QC,qC]=al(JC),[p4,ek]=QC(JC),m4=t=>{const{__scopePopper:e,children:n}=t,[r,i]=p.useState(null);return p.createElement(p4,{scope:e,anchor:r,onAnchorChange:i},n)},g4="PopperAnchor",v4=p.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...i}=t,o=ek(g4,n),l=p.useRef(null),s=st(e,l);return p.useEffect(()=>{o.onAnchorChange((r==null?void 0:r.current)||l.current)}),r?null:p.createElement(Ke.div,ie({},i,{ref:s}))}),tk="PopperContent",[y4,NI]=QC(tk),x4=p.forwardRef((t,e)=>{var n,r,i,o,l,s,a,u;const{__scopePopper:c,side:d="bottom",sideOffset:f=0,align:h="center",alignOffset:g=0,arrowPadding:m=0,avoidCollisions:w=!0,collisionBoundary:v=[],collisionPadding:y=0,sticky:_="partial",hideWhenDetached:S=!1,updatePositionStrategy:E="optimized",onPlaced:$,...C}=t,N=ek(tk,c),[R,b]=p.useState(null),L=st(e,Sn=>b(Sn)),[F,le]=p.useState(null),V=XC(F),H=(n=V==null?void 0:V.width)!==null&&n!==void 0?n:0,O=(r=V==null?void 0:V.height)!==null&&r!==void 0?r:0,A=d+(h!=="center"?"-"+h:""),k=typeof y=="number"?y:{top:0,right:0,bottom:0,left:0,...y},j=Array.isArray(v)?v:[v],I=j.length>0,Z={padding:k,boundary:j.filter(_4),altBoundary:I},{refs:ne,floatingStyles:ke,placement:ye,isPositioned:We,middlewareData:Fe}=h4({strategy:"fixed",placement:A,whileElementsMounted:(...Sn)=>c4(...Sn,{animationFrame:E==="always"}),elements:{reference:N.anchor},middleware:[W5({mainAxis:f+O,alignmentAxis:g}),w&&V5({mainAxis:!0,crossAxis:!1,limiter:_==="partial"?H5():void 0,...Z}),w&&F5({...Z}),K5({...Z,apply:({elements:Sn,rects:cr,availableWidth:je,availableHeight:Tt})=>{const{width:at,height:ln}=cr.reference,En=Sn.floating.style;En.setProperty("--radix-popper-available-width",`${je}px`),En.setProperty("--radix-popper-available-height",`${Tt}px`),En.setProperty("--radix-popper-anchor-width",`${at}px`),En.setProperty("--radix-popper-anchor-height",`${ln}px`)}}),F&&f4({element:F,padding:m}),w4({arrowWidth:H,arrowHeight:O}),S&&B5({strategy:"referenceHidden",...Z})]}),[te,Ie]=nk(ye),$e=en($);Vn(()=>{We&&($e==null||$e())},[We,$e]);const Re=(i=Fe.arrow)===null||i===void 0?void 0:i.x,Se=(o=Fe.arrow)===null||o===void 0?void 0:o.y,Le=((l=Fe.arrow)===null||l===void 0?void 0:l.centerOffset)!==0,[Je,Wt]=p.useState();return Vn(()=>{R&&Wt(window.getComputedStyle(R).zIndex)},[R]),p.createElement("div",{ref:ne.setFloating,"data-radix-popper-content-wrapper":"",style:{...ke,transform:We?ke.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Je,"--radix-popper-transform-origin":[(s=Fe.transformOrigin)===null||s===void 0?void 0:s.x,(a=Fe.transformOrigin)===null||a===void 0?void 0:a.y].join(" ")},dir:t.dir},p.createElement(y4,{scope:c,placedSide:te,onArrowChange:le,arrowX:Re,arrowY:Se,shouldHideArrow:Le},p.createElement(Ke.div,ie({"data-side":te,"data-align":Ie},C,{ref:L,style:{...C.style,animation:We?void 0:"none",opacity:(u=Fe.hide)!==null&&u!==void 0&&u.referenceHidden?0:void 0}}))))});function _4(t){return t!==null}const w4=t=>({name:"transformOrigin",options:t,fn(e){var n,r,i,o,l;const{placement:s,rects:a,middlewareData:u}=e,d=((n=u.arrow)===null||n===void 0?void 0:n.centerOffset)!==0,f=d?0:t.arrowWidth,h=d?0:t.arrowHeight,[g,m]=nk(s),w={start:"0%",center:"50%",end:"100%"}[m],v=((r=(i=u.arrow)===null||i===void 0?void 0:i.x)!==null&&r!==void 0?r:0)+f/2,y=((o=(l=u.arrow)===null||l===void 0?void 0:l.y)!==null&&o!==void 0?o:0)+h/2;let _="",S="";return g==="bottom"?(_=d?w:`${v}px`,S=`${-h}px`):g==="top"?(_=d?w:`${v}px`,S=`${a.floating.height+h}px`):g==="right"?(_=`${-h}px`,S=d?w:`${y}px`):g==="left"&&(_=`${a.floating.width+h}px`,S=d?w:`${y}px`),{data:{x:_,y:S}}}});function nk(t){const[e,n="center"]=t.split("-");return[e,n]}const S4=m4,E4=v4,C4=x4,k4=p.forwardRef((t,e)=>{var n;const{container:r=globalThis==null||(n=globalThis.document)===null||n===void 0?void 0:n.body,...i}=t;return r?Bw.createPortal(p.createElement(Ke.div,ie({},i,{ref:e})),r):null});function xs({prop:t,defaultProp:e,onChange:n=()=>{}}){const[r,i]=b4({defaultProp:e,onChange:n}),o=t!==void 0,l=o?t:r,s=en(n),a=p.useCallback(u=>{if(o){const d=typeof u=="function"?u(t):u;d!==t&&s(d)}else i(u)},[o,t,i,s]);return[l,a]}function b4({defaultProp:t,onChange:e}){const n=p.useState(t),[r]=n,i=p.useRef(r),o=en(e);return p.useEffect(()=>{i.current!==r&&(o(r),i.current=r)},[r,i,o]),n}function rk(t){const e=p.useRef({value:t,previous:t});return p.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}const $4=p.forwardRef((t,e)=>p.createElement(Ke.span,ie({},t,{ref:e,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...t.style}})));var T4=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},Cl=new WeakMap,kc=new WeakMap,bc={},Kh=0,ik=function(t){return t&&(t.host||ik(t.parentNode))},N4=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=ik(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})},R4=function(t,e,n,r){var i=N4(e,Array.isArray(t)?t:[t]);bc[n]||(bc[n]=new WeakMap);var o=bc[n],l=[],s=new Set,a=new Set(i),u=function(d){!d||s.has(d)||(s.add(d),u(d.parentNode))};i.forEach(u);var c=function(d){!d||a.has(d)||Array.prototype.forEach.call(d.children,function(f){if(s.has(f))c(f);else{var h=f.getAttribute(r),g=h!==null&&h!=="false",m=(Cl.get(f)||0)+1,w=(o.get(f)||0)+1;Cl.set(f,m),o.set(f,w),l.push(f),m===1&&g&&kc.set(f,!0),w===1&&f.setAttribute(n,"true"),g||f.setAttribute(r,"true")}})};return c(e),s.clear(),Kh++,function(){l.forEach(function(d){var f=Cl.get(d)-1,h=o.get(d)-1;Cl.set(d,f),o.set(d,h),f||(kc.has(d)||d.removeAttribute(r),kc.delete(d)),h||d.removeAttribute(n)}),Kh--,Kh||(Cl=new WeakMap,Cl=new WeakMap,kc=new WeakMap,bc={})}},O4=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),i=e||T4(t);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),R4(r,i,n,"aria-hidden")):function(){return null}},Dr=function(){return Dr=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Dr.apply(this,arguments)};function ok(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 i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}function P4(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))}var Yc="right-scroll-bar-position",Xc="width-before-scroll-bar",A4="with-scroll-bars-hidden",M4="--removed-body-scroll-bar-size";function L4(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function D4(t,e){var n=p.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=e,n.facade}function I4(t,e){return D4(e||null,function(n){return t.forEach(function(r){return L4(r,n)})})}function j4(t){return t}function z4(t,e){e===void 0&&(e=j4);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(o){var l=e(o,r);return n.push(l),function(){n=n.filter(function(s){return s!==l})}},assignSyncMedium:function(o){for(r=!0;n.length;){var l=n;n=[],l.forEach(o)}n={push:function(s){return o(s)},filter:function(){return n}}},assignMedium:function(o){r=!0;var l=[];if(n.length){var s=n;n=[],s.forEach(o),l=n}var a=function(){var c=l;l=[],c.forEach(o)},u=function(){return Promise.resolve().then(a)};u(),n={push:function(c){l.push(c),u()},filter:function(c){return l=l.filter(c),n}}}};return i}function F4(t){t===void 0&&(t={});var e=z4(null);return e.options=Dr({async:!0,ssr:!1},t),e}var lk=function(t){var e=t.sideCar,n=ok(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 p.createElement(r,Dr({},n))};lk.isSideCarExport=!0;function B4(t,e){return t.useMedium(e),lk}var sk=F4(),Zh=function(){},Wf=p.forwardRef(function(t,e){var n=p.useRef(null),r=p.useState({onScrollCapture:Zh,onWheelCapture:Zh,onTouchMoveCapture:Zh}),i=r[0],o=r[1],l=t.forwardProps,s=t.children,a=t.className,u=t.removeScrollBar,c=t.enabled,d=t.shards,f=t.sideCar,h=t.noIsolation,g=t.inert,m=t.allowPinchZoom,w=t.as,v=w===void 0?"div":w,y=ok(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),_=f,S=I4([n,e]),E=Dr(Dr({},y),i);return p.createElement(p.Fragment,null,c&&p.createElement(_,{sideCar:sk,removeScrollBar:u,shards:d,noIsolation:h,inert:g,setCallbacks:o,allowPinchZoom:!!m,lockRef:n}),l?p.cloneElement(p.Children.only(s),Dr(Dr({},E),{ref:S})):p.createElement(v,Dr({},E,{className:a,ref:S}),s))});Wf.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Wf.classNames={fullWidth:Xc,zeroRight:Yc};var Jx,U4=function(){if(Jx)return Jx;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function W4(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=U4();return e&&t.setAttribute("nonce",e),t}function V4(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function H4(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var K4=function(){var t=0,e=null;return{add:function(n){t==0&&(e=W4())&&(V4(e,n),H4(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},Z4=function(){var t=K4();return function(e,n){p.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},ak=function(){var t=Z4(),e=function(n){var r=n.styles,i=n.dynamic;return t(r,i),null};return e},G4={left:0,top:0,right:0,gap:0},Gh=function(t){return parseInt(t||"",10)||0},Y4=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],r=e[t==="padding"?"paddingTop":"marginTop"],i=e[t==="padding"?"paddingRight":"marginRight"];return[Gh(n),Gh(r),Gh(i)]},X4=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return G4;var e=Y4(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])}},J4=ak(),Q4=function(t,e,n,r){var i=t.left,o=t.top,l=t.right,s=t.gap;return n===void 0&&(n="margin"),`
|
|
129
|
+
`?e.insertParagraph():o===" "?e.insertNodes([pe.$createTabNode()]):e.insertText(o);else e.insertRawText(t)};bi.$insertGeneratedNodes=Om;bi.copyToClipboard=async function(t,e){if(wl!==null)return!1;if(e!==null)return new Promise(l=>{t.update(()=>{l(Ex(t,e))})});var n=t.getRootElement();let r=t._window==null?window.document:t._window.document,i=sC?(t._window||window).getSelection():null;if(n===null||i===null)return!1;let o=r.createElement("span");return o.style.cssText="position: fixed; top: -1000px;",o.append(r.createTextNode("#")),n.append(o),n=new Range,n.setStart(o,0),n.setEnd(o,1),i.removeAllRanges(),i.addRange(n),new Promise(l=>{let s=t.registerCommand(pe.COPY_COMMAND,a=>(ts.objectKlassEquals(a,ClipboardEvent)&&(s(),wl!==null&&(window.clearTimeout(wl),wl=null),l(Ex(t,a))),!0),pe.COMMAND_PRIORITY_CRITICAL);wl=window.setTimeout(()=>{s(),wl=null,l(!1)},50),r.execCommand("copy"),o.remove()})};const BP=bi;var UP=BP,Bd=UP,wc=co,zr=Ft,P=_e;function Cx(t,e){return typeof document.caretRangeFromPoint<"u"?(t=document.caretRangeFromPoint(t,e),t===null?null:{node:t.startContainer,offset:t.startOffset}):document.caretPositionFromPoint!=="undefined"?(t=document.caretPositionFromPoint(t,e),t===null?null:{node:t.offsetNode,offset:t.offset}):null}let Ds=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",WP=Ds&&"documentMode"in document?document.documentMode:null,VP=Ds&&"InputEvent"in window&&!WP?"getTargetRanges"in new window.InputEvent("input"):!1,HP=Ds&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),KP=Ds&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,ZP=Ds&&/^(?=.*Chrome).*/i.test(navigator.userAgent),GP=Ds&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!ZP,Pm=P.createCommand("DRAG_DROP_PASTE_FILE"),Rv=class hC extends P.ElementNode{static getType(){return"quote"}static clone(e){return new hC(e.__key)}constructor(e){super(e)}createDOM(e){let n=document.createElement("blockquote");return zr.addClassNamesToElement(n,e.theme.quote),n}updateDOM(){return!1}static importDOM(){return{blockquote:()=>({conversion:YP,priority:0})}}exportDOM(e){if({element:e}=super.exportDOM(e),e&&zr.isHTMLElement(e)){this.isEmpty()&&e.append(document.createElement("br"));var n=this.getFormatType();e.style.textAlign=n,(n=this.getDirection())&&(e.dir=n)}return{element:e}}static importJSON(e){let n=Ov();return n.setFormat(e.format),n.setIndent(e.indent),n.setDirection(e.direction),n}exportJSON(){return{...super.exportJSON(),type:"quote"}}insertNewAfter(e,n){e=P.$createParagraphNode();let r=this.getDirection();return e.setDirection(r),this.insertAfter(e,n),e}collapseAtStart(){let e=P.$createParagraphNode();return this.getChildren().forEach(n=>e.append(n)),this.replace(e),!0}};function Ov(){return P.$applyNodeReplacement(new Rv)}let Pv=class pC extends P.ElementNode{static getType(){return"heading"}static clone(e){return new pC(e.__tag,e.__key)}constructor(e,n){super(n),this.__tag=e}getTag(){return this.__tag}createDOM(e){let n=this.__tag,r=document.createElement(n);return e=e.theme.heading,e!==void 0&&zr.addClassNamesToElement(r,e[n]),r}updateDOM(){return!1}static importDOM(){return{h1:()=>({conversion:Sl,priority:0}),h2:()=>({conversion:Sl,priority:0}),h3:()=>({conversion:Sl,priority:0}),h4:()=>({conversion:Sl,priority:0}),h5:()=>({conversion:Sl,priority:0}),h6:()=>({conversion:Sl,priority:0}),p:e=>(e=e.firstChild,e!==null&&kx(e)?{conversion:()=>({node:null}),priority:3}:null),span:e=>kx(e)?{conversion:()=>({node:Vl("h1")}),priority:3}:null}}exportDOM(e){if({element:e}=super.exportDOM(e),e&&zr.isHTMLElement(e)){this.isEmpty()&&e.append(document.createElement("br"));var n=this.getFormatType();e.style.textAlign=n,(n=this.getDirection())&&(e.dir=n)}return{element:e}}static importJSON(e){let n=Vl(e.tag);return n.setFormat(e.format),n.setIndent(e.indent),n.setDirection(e.direction),n}exportJSON(){return{...super.exportJSON(),tag:this.getTag(),type:"heading",version:1}}insertNewAfter(e,n=!0){e=e?e.anchor.offset:0,e=0<e&&e<this.getTextContentSize()?Vl(this.getTag()):P.$createParagraphNode();let r=this.getDirection();return e.setDirection(r),this.insertAfter(e,n),e}collapseAtStart(){let e=this.isEmpty()?P.$createParagraphNode():Vl(this.getTag());return this.getChildren().forEach(n=>e.append(n)),this.replace(e),!0}extractWithChild(){return!0}};function kx(t){return t.nodeName.toLowerCase()==="span"?t.style.fontSize==="26pt":!1}function Sl(t){let e=t.nodeName.toLowerCase(),n=null;return(e==="h1"||e==="h2"||e==="h3"||e==="h4"||e==="h5"||e==="h6")&&(n=Vl(e),t.style!==null&&n.setFormat(t.style.textAlign)),{node:n}}function YP(t){let e=Ov();return t.style!==null&&e.setFormat(t.style.textAlign),{node:e}}function Vl(t){return P.$applyNodeReplacement(new Pv(t))}function XP(t,e){t.preventDefault(),e.update(()=>{let n=P.$getSelection(),r=t instanceof InputEvent||t instanceof KeyboardEvent?null:t.clipboardData;r!=null&&(P.$isRangeSelection(n)||P.DEPRECATED_$isGridSelection(n))&&Bd.$insertDataTransferForRichText(r,n,e)},{tag:"paste"})}async function JP(t,e){await Bd.copyToClipboard(e,zr.objectKlassEquals(t,ClipboardEvent)?t:null),e.update(()=>{let n=P.$getSelection();P.$isRangeSelection(n)?n.removeText():P.$isNodeSelection(n)&&n.getNodes().forEach(r=>r.remove())})}function va(t){let e=null;if(t instanceof DragEvent?e=t.dataTransfer:t instanceof ClipboardEvent&&(e=t.clipboardData),e===null)return[!1,[],!1];var n=e.types;return t=n.includes("Files"),n=n.includes("text/html")||n.includes("text/plain"),[t,Array.from(e.files),n]}function bx(t){var e=P.$getSelection();if(!P.$isRangeSelection(e))return!1;let n=new Set;e=e.getNodes();for(let o=0;o<e.length;o++){var r=e[o],i=r.getKey();n.has(i)||(r=zr.$getNearestBlockElementAncestorOrThrow(r),i=r.getKey(),r.canIndent()&&!n.has(i)&&(n.add(i),t(r)))}return 0<n.size}function Sc(t){return t=P.$getNearestNodeFromDOMNode(t),P.$isDecoratorNode(t)}qr.$createHeadingNode=Vl;qr.$createQuoteNode=Ov;qr.$isHeadingNode=function(t){return t instanceof Pv};qr.$isQuoteNode=function(t){return t instanceof Rv};qr.DRAG_DROP_PASTE=Pm;qr.HeadingNode=Pv;qr.QuoteNode=Rv;qr.eventFiles=va;qr.registerRichText=function(t){return zr.mergeRegister(t.registerCommand(P.CLICK_COMMAND,()=>{const e=P.$getSelection();return P.$isNodeSelection(e)?(e.clear(),!0):!1},0),t.registerCommand(P.DELETE_CHARACTER_COMMAND,e=>{const n=P.$getSelection();return P.$isRangeSelection(n)?(n.deleteCharacter(e),!0):!1},P.COMMAND_PRIORITY_EDITOR),t.registerCommand(P.DELETE_WORD_COMMAND,e=>{const n=P.$getSelection();return P.$isRangeSelection(n)?(n.deleteWord(e),!0):!1},P.COMMAND_PRIORITY_EDITOR),t.registerCommand(P.DELETE_LINE_COMMAND,e=>{const n=P.$getSelection();return P.$isRangeSelection(n)?(n.deleteLine(e),!0):!1},P.COMMAND_PRIORITY_EDITOR),t.registerCommand(P.CONTROLLED_TEXT_INSERTION_COMMAND,e=>{const n=P.$getSelection();if(typeof e=="string")P.$isRangeSelection(n)?n.insertText(e):P.DEPRECATED_$isGridSelection(n);else{if(!P.$isRangeSelection(n)&&!P.DEPRECATED_$isGridSelection(n))return!1;const r=e.dataTransfer;r!=null?Bd.$insertDataTransferForRichText(r,n,t):P.$isRangeSelection(n)&&(e=e.data)&&n.insertText(e)}return!0},P.COMMAND_PRIORITY_EDITOR),t.registerCommand(P.REMOVE_TEXT_COMMAND,()=>{const e=P.$getSelection();return P.$isRangeSelection(e)?(e.removeText(),!0):!1},P.COMMAND_PRIORITY_EDITOR),t.registerCommand(P.FORMAT_TEXT_COMMAND,e=>{const n=P.$getSelection();return P.$isRangeSelection(n)?(n.formatText(e),!0):!1},P.COMMAND_PRIORITY_EDITOR),t.registerCommand(P.FORMAT_ELEMENT_COMMAND,e=>{var n=P.$getSelection();if(!P.$isRangeSelection(n)&&!P.$isNodeSelection(n))return!1;n=n.getNodes();for(const r of n)n=zr.$findMatchingParent(r,i=>P.$isElementNode(i)&&!i.isInline()),n!==null&&n.setFormat(e);return!0},P.COMMAND_PRIORITY_EDITOR),t.registerCommand(P.INSERT_LINE_BREAK_COMMAND,e=>{const n=P.$getSelection();return P.$isRangeSelection(n)?(n.insertLineBreak(e),!0):!1},P.COMMAND_PRIORITY_EDITOR),t.registerCommand(P.INSERT_PARAGRAPH_COMMAND,()=>{const e=P.$getSelection();return P.$isRangeSelection(e)?(e.insertParagraph(),!0):!1},P.COMMAND_PRIORITY_EDITOR),t.registerCommand(P.INSERT_TAB_COMMAND,()=>(P.$insertNodes([P.$createTabNode()]),!0),P.COMMAND_PRIORITY_EDITOR),t.registerCommand(P.INDENT_CONTENT_COMMAND,()=>bx(e=>{const n=e.getIndent();e.setIndent(n+1)}),P.COMMAND_PRIORITY_EDITOR),t.registerCommand(P.OUTDENT_CONTENT_COMMAND,()=>bx(e=>{const n=e.getIndent();0<n&&e.setIndent(n-1)}),P.COMMAND_PRIORITY_EDITOR),t.registerCommand(P.KEY_ARROW_UP_COMMAND,e=>{var n=P.$getSelection();if(P.$isNodeSelection(n)&&!Sc(e.target)){if(e=n.getNodes(),0<e.length)return e[0].selectPrevious(),!0}else if(P.$isRangeSelection(n)&&(n=P.$getAdjacentNode(n.focus,!0),!e.shiftKey&&P.$isDecoratorNode(n)&&!n.isIsolated()&&!n.isInline()))return n.selectPrevious(),e.preventDefault(),!0;return!1},P.COMMAND_PRIORITY_EDITOR),t.registerCommand(P.KEY_ARROW_DOWN_COMMAND,e=>{var n=P.$getSelection();if(P.$isNodeSelection(n)){if(e=n.getNodes(),0<e.length)return e[0].selectNext(0,0),!0}else if(P.$isRangeSelection(n)){let r=n.focus;if(r.key==="root"&&r.offset===P.$getRoot().getChildrenSize())return e.preventDefault(),!0;if(n=P.$getAdjacentNode(n.focus,!1),!e.shiftKey&&P.$isDecoratorNode(n)&&!n.isIsolated()&&!n.isInline())return n.selectNext(),e.preventDefault(),!0}return!1},P.COMMAND_PRIORITY_EDITOR),t.registerCommand(P.KEY_ARROW_LEFT_COMMAND,e=>{const n=P.$getSelection();if(P.$isNodeSelection(n)){var r=n.getNodes();if(0<r.length)return e.preventDefault(),r[0].selectPrevious(),!0}return P.$isRangeSelection(n)&&wc.$shouldOverrideDefaultCharacterSelection(n,!0)?(r=e.shiftKey,e.preventDefault(),wc.$moveCharacter(n,r,!0),!0):!1},P.COMMAND_PRIORITY_EDITOR),t.registerCommand(P.KEY_ARROW_RIGHT_COMMAND,e=>{const n=P.$getSelection();if(P.$isNodeSelection(n)&&!Sc(e.target)){var r=n.getNodes();if(0<r.length)return e.preventDefault(),r[0].selectNext(0,0),!0}return P.$isRangeSelection(n)?(r=e.shiftKey,wc.$shouldOverrideDefaultCharacterSelection(n,!1)?(e.preventDefault(),wc.$moveCharacter(n,r,!1),!0):!1):!1},P.COMMAND_PRIORITY_EDITOR),t.registerCommand(P.KEY_BACKSPACE_COMMAND,e=>{if(Sc(e.target))return!1;const n=P.$getSelection();if(!P.$isRangeSelection(n))return!1;e.preventDefault(),{anchor:e}=n;const r=e.getNode();return n.isCollapsed()&&e.offset===0&&!P.$isRootNode(r)&&0<zr.$getNearestBlockElementAncestorOrThrow(r).getIndent()?t.dispatchCommand(P.OUTDENT_CONTENT_COMMAND,void 0):t.dispatchCommand(P.DELETE_CHARACTER_COMMAND,!0)},P.COMMAND_PRIORITY_EDITOR),t.registerCommand(P.KEY_DELETE_COMMAND,e=>{if(Sc(e.target))return!1;const n=P.$getSelection();return P.$isRangeSelection(n)?(e.preventDefault(),t.dispatchCommand(P.DELETE_CHARACTER_COMMAND,!1)):!1},P.COMMAND_PRIORITY_EDITOR),t.registerCommand(P.KEY_ENTER_COMMAND,e=>{const n=P.$getSelection();if(!P.$isRangeSelection(n))return!1;if(e!==null){if((KP||HP||GP)&&VP)return!1;if(e.preventDefault(),e.shiftKey)return t.dispatchCommand(P.INSERT_LINE_BREAK_COMMAND,!1)}return t.dispatchCommand(P.INSERT_PARAGRAPH_COMMAND,void 0)},P.COMMAND_PRIORITY_EDITOR),t.registerCommand(P.KEY_ESCAPE_COMMAND,()=>{const e=P.$getSelection();return P.$isRangeSelection(e)?(t.blur(),!0):!1},P.COMMAND_PRIORITY_EDITOR),t.registerCommand(P.DROP_COMMAND,e=>{const[,n]=va(e);if(0<n.length){var r=Cx(e.clientX,e.clientY);if(r!==null){const{offset:o,node:l}=r;var i=P.$getNearestNodeFromDOMNode(l);if(i!==null){if(r=P.$createRangeSelection(),P.$isTextNode(i))r.anchor.set(i.getKey(),o,"text"),r.focus.set(i.getKey(),o,"text");else{const s=i.getParentOrThrow().getKey();i=i.getIndexWithinParent()+1,r.anchor.set(s,i,"element"),r.focus.set(s,i,"element")}r=P.$normalizeSelection__EXPERIMENTAL(r),P.$setSelection(r)}t.dispatchCommand(Pm,n)}return e.preventDefault(),!0}return e=P.$getSelection(),!!P.$isRangeSelection(e)},P.COMMAND_PRIORITY_EDITOR),t.registerCommand(P.DRAGSTART_COMMAND,e=>{[e]=va(e);const n=P.$getSelection();return!(e&&!P.$isRangeSelection(n))},P.COMMAND_PRIORITY_EDITOR),t.registerCommand(P.DRAGOVER_COMMAND,e=>{var[n]=va(e);const r=P.$getSelection();return n&&!P.$isRangeSelection(r)?!1:(n=Cx(e.clientX,e.clientY),n!==null&&(n=P.$getNearestNodeFromDOMNode(n.node),P.$isDecoratorNode(n)&&e.preventDefault()),!0)},P.COMMAND_PRIORITY_EDITOR),t.registerCommand(P.SELECT_ALL_COMMAND,()=>(P.$selectAll(),!0),P.COMMAND_PRIORITY_EDITOR),t.registerCommand(P.COPY_COMMAND,e=>(Bd.copyToClipboard(t,zr.objectKlassEquals(e,ClipboardEvent)?e:null),!0),P.COMMAND_PRIORITY_EDITOR),t.registerCommand(P.CUT_COMMAND,e=>(JP(e,t),!0),P.COMMAND_PRIORITY_EDITOR),t.registerCommand(P.PASTE_COMMAND,e=>{const[,n,r]=va(e);if(0<n.length&&!r)return t.dispatchCommand(Pm,n),!0;if(P.isSelectionCapturedInDecoratorInput(e.target))return!1;const i=P.$getSelection();return P.$isRangeSelection(i)||P.DEPRECATED_$isGridSelection(i)?(XP(e,t),!0):!1},P.COMMAND_PRIORITY_EDITOR))};const QP=qr;var Ia=QP,mC=Nr,qP=OP,tr=p,eA=AP,gC=Ft,$x=Yr,tA=LP,nA=Ia,Av=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?tr.useLayoutEffect:tr.useEffect;function Tx(t){return t.getEditorState().read(eA.$canShowPlaceholderCurry(t.isComposing()))}function rA(t){let[e,n]=tr.useState(()=>Tx(t));return Av(()=>{function r(){let i=Tx(t);n(i)}return r(),gC.mergeRegister(t.registerUpdateListener(()=>{r()}),t.registerEditableListener(()=>{r()}))},[t]),e}function iA(t,e){let[n,r]=tr.useState(()=>t.getDecorators());return Av(()=>t.registerDecoratorListener(i=>{$x.flushSync(()=>{r(i)})}),[t]),tr.useEffect(()=>{r(t.getDecorators())},[t]),tr.useMemo(()=>{let i=[],o=Object.keys(n);for(let l=0;l<o.length;l++){let s=o[l],a=tr.createElement(e,{onError:c=>t._onError(c)},tr.createElement(tr.Suspense,{fallback:null},n[s])),u=t.getElementByKey(s);u!==null&&i.push($x.createPortal(a,u,s))}return i},[e,n,t])}function oA(t){Av(()=>gC.mergeRegister(nA.registerRichText(t),tA.registerDragonSupport(t)),[t])}function lA({content:t}){var[e]=mC.useLexicalComposerContext();e=rA(e);let n=qP();return e?typeof t=="function"?t(n):t:null}qE.RichTextPlugin=function({contentEditable:t,placeholder:e,ErrorBoundary:n}){let[r]=mC.useLexicalComposerContext();return n=iA(r,n),oA(r),tr.createElement(tr.Fragment,null,t,tr.createElement(lA,{content:e}),n)};const sA=qE;var aA=sA,vC={},ri=Ui,uA=Nr,yC=p,cA=Ft,ia=_e;function dA(t){yC.useEffect(()=>cA.mergeRegister(t.registerCommand(ri.INSERT_ORDERED_LIST_COMMAND,()=>(ri.insertList(t,"number"),!0),ia.COMMAND_PRIORITY_LOW),t.registerCommand(ri.INSERT_UNORDERED_LIST_COMMAND,()=>(ri.insertList(t,"bullet"),!0),ia.COMMAND_PRIORITY_LOW),t.registerCommand(ri.REMOVE_LIST_COMMAND,()=>(ri.removeList(t),!0),ia.COMMAND_PRIORITY_LOW),t.registerCommand(ia.INSERT_PARAGRAPH_COMMAND,()=>!!ri.$handleListInsertParagraph(),ia.COMMAND_PRIORITY_LOW)),[t])}vC.ListPlugin=function(){let[t]=uA.useLexicalComposerContext();return yC.useEffect(()=>{if(!t.hasNodes([ri.ListNode,ri.ListItemNode]))throw Error("ListPlugin: ListNode and/or ListItemNode not registered on editor")},[t]),dA(t),null};const fA=vC;var hA=fA,xC={},$i={},_C=Ft,Wr=_e;let pA=new Set(["http:","https:","mailto:","sms:","tel:"]);class Is extends Wr.ElementNode{static getType(){return"link"}static clone(e){return new Is(e.__url,{rel:e.__rel,target:e.__target,title:e.__title},e.__key)}constructor(e,n={},r){super(r);let{target:i=null,rel:o=null,title:l=null}=n;this.__url=e,this.__target=i,this.__rel=o,this.__title=l}createDOM(e){let n=document.createElement("a");return n.href=this.sanitizeUrl(this.__url),this.__target!==null&&(n.target=this.__target),this.__rel!==null&&(n.rel=this.__rel),this.__title!==null&&(n.title=this.__title),_C.addClassNamesToElement(n,e.theme.link),n}updateDOM(e,n){let r=this.__url,i=this.__target,o=this.__rel,l=this.__title;return r!==e.__url&&(n.href=r),i!==e.__target&&(i?n.target=i:n.removeAttribute("target")),o!==e.__rel&&(o?n.rel=o:n.removeAttribute("rel")),l!==e.__title&&(l?n.title=l:n.removeAttribute("title")),!1}static importDOM(){return{a:()=>({conversion:mA,priority:1})}}static importJSON(e){let n=hu(e.url,{rel:e.rel,target:e.target,title:e.title});return n.setFormat(e.format),n.setIndent(e.indent),n.setDirection(e.direction),n}sanitizeUrl(e){try{let n=new URL(e);if(!pA.has(n.protocol))return"about:blank"}catch{}return e}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),type:"link",url:this.getURL(),version:1}}getURL(){return this.getLatest().__url}setURL(e){this.getWritable().__url=e}getTarget(){return this.getLatest().__target}setTarget(e){this.getWritable().__target=e}getRel(){return this.getLatest().__rel}setRel(e){this.getWritable().__rel=e}getTitle(){return this.getLatest().__title}setTitle(e){this.getWritable().__title=e}insertNewAfter(e,n=!0){return e=this.getParentOrThrow().insertNewAfter(e,n),Wr.$isElementNode(e)?(n=hu(this.__url,{rel:this.__rel,target:this.__target,title:this.__title}),e.append(n),n):null}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,n){if(!Wr.$isRangeSelection(n))return!1;e=n.anchor.getNode();let r=n.focus.getNode();return this.isParentOf(e)&&this.isParentOf(r)&&0<n.getTextContent().length}}function mA(t){let e=null;if(_C.isHTMLAnchorElement(t)){let n=t.textContent;n!==null&&n!==""&&(e=hu(t.getAttribute("href")||"",{rel:t.getAttribute("rel"),target:t.getAttribute("target"),title:t.getAttribute("title")}))}return{node:e}}function hu(t,e){return Wr.$applyNodeReplacement(new Is(t,e))}function Ro(t){return t instanceof Is}class Wu extends Is{static getType(){return"autolink"}static clone(e){return new Wu(e.__url,{rel:e.__rel,target:e.__target,title:e.__title},e.__key)}static importJSON(e){let n=Am(e.url,{rel:e.rel,target:e.target,title:e.title});return n.setFormat(e.format),n.setIndent(e.indent),n.setDirection(e.direction),n}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),type:"autolink",version:1}}insertNewAfter(e,n=!0){return e=this.getParentOrThrow().insertNewAfter(e,n),Wr.$isElementNode(e)?(n=Am(this.__url,{rel:this._rel,target:this.__target,title:this.__title}),e.append(n),n):null}}function Am(t,e){return Wr.$applyNodeReplacement(new Wu(t,e))}let gA=Wr.createCommand("TOGGLE_LINK_COMMAND");function vA(t,e){for(;t!==null&&(t=t.getParent())!==null&&!e(t););return t}$i.$createAutoLinkNode=Am;$i.$createLinkNode=hu;$i.$isAutoLinkNode=function(t){return t instanceof Wu};$i.$isLinkNode=Ro;$i.AutoLinkNode=Wu;$i.LinkNode=Is;$i.TOGGLE_LINK_COMMAND=gA;$i.toggleLink=function(t,e={}){let{target:n,title:r}=e,i=e.rel===void 0?"noreferrer":e.rel;if(e=Wr.$getSelection(),Wr.$isRangeSelection(e))if(e=e.extract(),t===null)e.forEach(l=>{if(l=l.getParent(),Ro(l)){let s=l.getChildren();for(let a=0;a<s.length;a++)l.insertBefore(s[a]);l.remove()}});else{if(e.length===1){var o=e[0];if(o=Ro(o)?o:vA(o,Ro),o!==null){o.setURL(t),n!==void 0&&o.setTarget(n),i!==null&&o.setRel(i),r!==void 0&&o.setTitle(r);return}}let l=null,s=null;e.forEach(a=>{var u=a.getParent();if(u!==s&&u!==null&&(!Wr.$isElementNode(a)||a.isInline()))if(Ro(u))s=u,u.setURL(t),n!==void 0&&u.setTarget(n),i!==null&&s.setRel(i),r!==void 0&&s.setTitle(r);else if(u.is(l)||(l=u,s=hu(t,{rel:i,target:n}),Ro(u)?a.getPreviousSibling()===null?u.insertBefore(s):u.insertAfter(s):a.insertBefore(s)),Ro(a)){if(!a.is(s)){if(s!==null){u=a.getChildren();for(let c=0;c<u.length;c++)s.append(u[c])}a.remove()}}else s!==null&&s.append(a)})}};const yA=$i;var el=yA,El=el,xA=Nr,_A=Ft,Cl=_e,wA=p;xC.LinkPlugin=function({validateUrl:t}){let[e]=xA.useLexicalComposerContext();return wA.useEffect(()=>{if(!e.hasNodes([El.LinkNode]))throw Error("LinkPlugin: LinkNode not registered on editor");return _A.mergeRegister(e.registerCommand(El.TOGGLE_LINK_COMMAND,n=>{if(n===null)return El.toggleLink(n),!0;if(typeof n=="string")return t===void 0||t(n)?(El.toggleLink(n),!0):!1;let{url:r,target:i,rel:o,title:l}=n;return El.toggleLink(r,{rel:o,target:i,title:l}),!0},Cl.COMMAND_PRIORITY_LOW),t!==void 0?e.registerCommand(Cl.PASTE_COMMAND,n=>{let r=Cl.$getSelection();if(!Cl.$isRangeSelection(r)||r.isCollapsed()||!(n instanceof ClipboardEvent)||n.clipboardData==null)return!1;let i=n.clipboardData.getData("text");return t(i)?r.getNodes().some(o=>Cl.$isElementNode(o))?!1:(e.dispatchCommand(El.TOGGLE_LINK_COMMAND,i),n.preventDefault(),!0):!1},Cl.COMMAND_PRIORITY_LOW):()=>{})},[e,t]),null};const SA=xC;var EA=SA;function CA({ariaActiveDescendant:t,ariaAutoComplete:e,ariaControls:n,ariaDescribedBy:r,ariaExpanded:i,ariaLabel:o,ariaLabelledBy:l,ariaMultiline:s,ariaOwns:a,ariaRequired:u,autoCapitalize:c,className:d,id:f,role:h="textbox",spellCheck:g=!0,style:m,tabIndex:w,"data-testid":v,...y}){const[_]=Nr.useLexicalComposerContext(),[S,E]=p.useState(!1),$=p.useCallback(C=>{var R;_.setRootElement(C);const N=(R=document.getElementById("val-ui"))==null?void 0:R.shadowRoot;if(N&&"getSelection"in N){_._window=N;return}},[_]);return p.useLayoutEffect(()=>(E(_.isEditable()),_.registerEditableListener(C=>{E(C)})),[_]),x.jsx("div",{...y,"aria-activedescendant":S?t:void 0,"aria-autocomplete":S?e:"none","aria-controls":S?n:void 0,"aria-describedby":r,"aria-expanded":S&&h==="combobox"?!!i:void 0,"aria-label":o,"aria-labelledby":l,"aria-multiline":s,"aria-owns":S?a:void 0,"aria-readonly":S?void 0:!0,"aria-required":u,autoCapitalize:c,className:d,contentEditable:S,"data-testid":v,id:f,ref:$,role:h,spellCheck:g,style:m,tabIndex:w})}function kA({className:t}){return x.jsx(CA,{className:t})}class js extends _e.DecoratorNode{constructor(e,n){super(n),this.__src=e.src,this.__altText=e.altText,this.__width=e.width,this.__height=e.height}static getType(){return"image"}static clone(e){return new js({src:e.__src,altText:e.__altText,width:e.__width,height:e.__height})}exportJSON(){return{altText:this.__altText,height:this.__width,src:this.__src,type:"image",version:1,width:this.__width}}static importJSON(e){return wC(e)}createDOM(){return document.createElement("div")}updateDOM(){return!1}decorate(){return x.jsx(bA,{src:this.__src,altText:this.__altText,empty:this.__empty,height:this.__height,nodeKey:this.getKey()})}}function bA(t){return x.jsx("img",{src:t.src})}function wC(t){return new js(t)}function $A(){const[t]=Nr.useLexicalComposerContext();return p.useEffect(()=>{t.focus()},[t]),null}const SC=_e.createCommand("INSERT_IMAGE_COMMAND");function TA(){const[t]=Nr.useLexicalComposerContext();return p.useEffect(()=>{if(!t.hasNodes([js]))throw new Error("ImagesPlugin: ImageNode not registered on editor");return Ft.mergeRegister(t.registerCommand(SC,e=>{const n=wC(e);return _e.$insertNodes([n]),_e.$isRootOrShadowRoot(n.getParentOrThrow())&&Ft.$wrapNodeInElement(n,_e.$createParagraphNode).selectEnd(),!0},_e.COMMAND_PRIORITY_EDITOR))},[t]),null}const NA=({className:t})=>x.jsxs("svg",{height:12,width:12,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[x.jsx("path",{d:"M6 4h8a4 4 0 0 1 4 4 4 4 0 0 1-4 4H6z"}),x.jsx("path",{d:"M6 12h9a4 4 0 0 1 4 4 4 4 0 0 1-4 4H6z"})]}),RA=NA,OA=({className:t})=>x.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 9 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[x.jsxs("g",{clipPath:"url(#clip0_1225_1638)",children:[x.jsx("rect",{y:"0.5",width:"9",height:"9"}),x.jsx("path",{d:"M0 7L8.5 5",stroke:"currentColor"}),x.jsx("circle",{cx:"3",cy:"3.5",r:"1",fill:"currentColor"})]}),x.jsx("rect",{x:"0.5",y:"1",width:"8",height:"8",stroke:"currentColor"}),x.jsx("defs",{children:x.jsx("clipPath",{id:"clip0_1225_1638",children:x.jsx("rect",{y:"0.5",width:"9",height:"9",fill:"white"})})})]}),PA=OA,AA=({className:t})=>x.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,width:12,height:12,children:[x.jsx("line",{x1:"19",y1:"4",x2:"10",y2:"4"}),x.jsx("line",{x1:"14",y1:"20",x2:"5",y2:"20"}),x.jsx("line",{x1:"15",y1:"4",x2:"9",y2:"20"})]}),MA=AA,LA=({className:t})=>x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"1",className:t,width:12,height:12,children:x.jsx("path",{fillRule:"evenodd",d:"M13,15 L13,21 C13,21.5522847 12.5522847,22 12,22 C11.4477153,22 11,21.5522847 11,21 L11,15 L13,15 Z M3,13 C2.44771525,13 2,12.5522847 2,12 C2,11.4477153 2.44771525,11 3,11 L21,11 C21.5522847,11 22,11.4477153 22,12 C22,12.5522847 21.5522847,13 21,13 L3,13 Z M19,2 C19.5522847,2 20,2.44771525 20,3 C20,3.55228475 19.5522847,4 19,4 L13,4 L13,9 L11,9 L11,4 L5,4 C4.44771525,4 4,3.55228475 4,3 C4,2.44771525 4.44771525,2 5,2 L19,2 Z"})}),DA=LA,IA=({variant:t="primary",onClick:e,children:n,icon:r,disabled:i=!1})=>x.jsx("button",{disabled:i,className:Pn("font-sans font-[12px] tracking-[0.04em] py-1 px-2 rounded whitespace-nowrap group relative text-primary",{"font-bold":t==="primary","text-fill disabled:bg-fill disabled:text-background":t==="primary","border border-primary text-primary hover:border-highlight hover:text-highlight disabled:bg-fill disabled:text-background":t!=="primary"}),onClick:e,children:x.jsxs("span",{className:"flex flex-row items-center justify-center gap-2",children:[r&&r,n]})}),Oo=IA,jA=({className:t})=>x.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",className:t,children:[x.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.70733 1.00015L8.7784 6.07121L8.07129 6.77832L3.00022 1.70725L3.70733 1.00015Z",fill:"currentColor"}),x.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.00015 10.4709L8.07121 5.39983L8.77832 6.10693L3.70725 11.178L3.00015 10.4709Z",fill:"currentColor"})]}),zA=jA,EC=re.createContext({get api(){throw Error("ValOverlayContext not found. Ensure components are wrapped by ValOverlayProvider!")},get session(){throw Error("ValOverlayContext not found. Ensure components are wrapped by ValOverlayProvider!")},get theme(){throw Error("ValOverlayContext not found. Ensure components are wrapped by ValOverlayProvider!")},get setTheme(){throw Error("ValOverlayContext not found. Ensure components are wrapped by ValOverlayProvider!")},get editMode(){throw Error("ValOverlayContext not found. Ensure components are wrapped by ValOverlayProvider!")},get setEditMode(){throw Error("ValOverlayContext not found. Ensure components are wrapped by ValOverlayProvider!")},get highlight(){throw Error("ValOverlayContext not found. Ensure components are wrapped by ValOverlayProvider!")},get setHighlight(){throw Error("ValOverlayContext not found. Ensure components are wrapped by ValOverlayProvider!")},get setWindowSize(){throw Error("ValOverlayContext not found. Ensure components are wrapped by ValOverlayProvider!")},get windowSize(){throw Error("ValOverlayContext not found. Ensure components are wrapped by ValOverlayProvider!")}});function jf(){return re.useContext(EC)}const FA=({options:t,onChange:e,label:n,icon:r})=>{const[i,o]=p.useState(!1),l=p.useRef(null),[s,a]=p.useState(0),{windowSize:u}=jf(),c=()=>{o(!i)},d=(f,h)=>{a(h),e(f),o(!1)};return p.useEffect(()=>{const f=h=>{i&&l.current&&!l.current.contains(h.target)&&o(!1)};return document.addEventListener("click",f),()=>{document.removeEventListener("click",f)}},[]),x.jsx("div",{className:"text-[12px]",ref:l,children:x.jsx(Oo,{onClick:f=>{f.preventDefault(),c()},icon:x.jsx(zA,{className:`rotate-[-90deg] transition-transform duration-150 ease-in-out ${i?"":"rotate-[90deg]"}`}),children:x.jsxs("div",{className:"relative",children:[x.jsxs("span",{className:"flex flex-row items-center justify-center gap-1",children:[n,r&&r]}),i&&x.jsx("div",{className:"absolute -top-[4px] overflow-scroll shadow-lg -left-2 text-primary w-fit z-overlay",style:{maxHeight:u==null?void 0:u.innerHeight},children:x.jsx("div",{className:"flex flex-col ",children:t==null?void 0:t.map((f,h)=>x.jsx("button",{onClick:g=>{g.preventDefault(),d(f,h)},className:`text-left px-2 py-1 hover:text-highlight ${h===s&&"font-bold truncate"}`,children:f},f))})})]})})})},BA=FA,UA=new TextEncoder;function CC(t){return new Promise((e,n)=>{var o;const r=(o=t.currentTarget.files)==null?void 0:o[0],i=new FileReader;i.addEventListener("load",()=>{const l=i.result;if(typeof l=="string"){const s=new Image;s.addEventListener("load",()=>{const a=On.getSHA256Hash(UA.encode(l));if(s.naturalWidth&&s.naturalHeight){const u=Ev(l);e({src:l,width:s.naturalWidth,height:s.naturalHeight,filename:r==null?void 0:r.name,sha256:a,mimeType:u,fileExt:u&&Cv(u)})}else e({src:l,filename:r==null?void 0:r.name,sha256:a})}),s.src=l}else n(l?{message:"Unexpected image result type",result:l}:{message:"Empty result"})}),r&&i.readAsDataURL(r)})}function kC(t){const e=t.anchor,n=t.focus,r=t.anchor.getNode(),i=t.focus.getNode();return r===i?r:t.isBackward()?co.$isAtNodeEnd(n)?r:i:co.$isAtNodeEnd(e)?r:i}function WA(){const[t]=Nr.useLexicalComposerContext();return p.useEffect(()=>Ft.mergeRegister(t.registerCommand(_e.CLICK_COMMAND,e=>{const n=_e.$getSelection();if(_e.$isRangeSelection(n)){const r=kC(n),i=Ft.$findMatchingParent(r,el.$isLinkNode);if(el.$isLinkNode(i)&&(e.metaKey||e.ctrlKey))return window.open(i.getURL(),"_blank"),!0}return!1},_e.COMMAND_PRIORITY_LOW)),[]),null}var bC={exports:{}},VA="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",HA=VA,KA=HA;function $C(){}function TC(){}TC.resetWarningCache=$C;var ZA=function(){function t(r,i,o,l,s,a){if(a!==KA){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}t.isRequired=t;function e(){return t}var n={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:TC,resetWarningCache:$C};return n.PropTypes=n,n};bC.exports=ZA();var GA=bC.exports;const ir=Ou(GA);function Mm(){return Mm=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Mm.apply(this,arguments)}function YA(t,e){if(t==null)return{};var n=XA(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)r=o[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function XA(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o<r.length;o++)i=r[o],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}var Mv=p.forwardRef(function(t,e){var n=t.color,r=n===void 0?"currentColor":n,i=t.size,o=i===void 0?24:i,l=YA(t,["color","size"]);return re.createElement("svg",Mm({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},l),re.createElement("polyline",{points:"20 6 9 17 4 12"}))});Mv.propTypes={color:ir.string,size:ir.oneOfType([ir.string,ir.number])};Mv.displayName="Check";const JA=Mv;function Lm(){return Lm=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Lm.apply(this,arguments)}function QA(t,e){if(t==null)return{};var n=qA(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)r=o[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function qA(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o<r.length;o++)i=r[o],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}var Lv=p.forwardRef(function(t,e){var n=t.color,r=n===void 0?"currentColor":n,i=t.size,o=i===void 0?24:i,l=QA(t,["color","size"]);return re.createElement("svg",Lm({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},l),re.createElement("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}),re.createElement("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"}))});Lv.propTypes={color:ir.string,size:ir.oneOfType([ir.string,ir.number])};Lv.displayName="Link";const eM=Lv;function Dm(){return Dm=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Dm.apply(this,arguments)}function tM(t,e){if(t==null)return{};var n=nM(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)r=o[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function nM(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o<r.length;o++)i=r[o],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}var Dv=p.forwardRef(function(t,e){var n=t.color,r=n===void 0?"currentColor":n,i=t.size,o=i===void 0?24:i,l=tM(t,["color","size"]);return re.createElement("svg",Dm({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},l),re.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),re.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))});Dv.propTypes={color:ir.string,size:ir.oneOfType([ir.string,ir.number])};Dv.displayName="X";const rM=Dv,iM=({fontSizes:t,fontsFamilies:e,onEditor:n,colors:r})=>{const[i]=Nr.useLexicalComposerContext();p.useEffect(()=>{n&&n(i)},[i]);const[o,l]=p.useState(i),[s,a]=p.useState(null),[u,c]=p.useState(!1),[d,f]=p.useState(!1),[h,g]=p.useState(!1),[m,w]=p.useState(!1);p.useState("15px"),p.useState("#000"),p.useState("Sans");const[v,y]=p.useState("paragraph");p.useState(!1),p.useState(!1),p.useState("url"),p.useState(null);const[_,S]=p.useState(null),E=b=>{i.dispatchCommand(el.TOGGLE_LINK_COMMAND,b)},$={paragraph:"Normal",h1:"Heading 1",h2:"Heading 2",h3:"Heading 3",h4:"Heading 4",h5:"Heading 5",h6:"Heading 6",number:"Numbered List",bullet:"Bulleted List"},C={};for(const b in $)C[$[b]]=b;const N=p.useCallback(()=>{const b=_e.$getSelection();if(_e.$isRangeSelection(b)){const L=b.anchor.getNode();let F=L.getKey()==="root"?L:Ft.$findMatchingParent(L,A=>{const k=A.getParent();return k!==null&&_e.$isRootOrShadowRoot(k)});F===null&&(F=L.getTopLevelElementOrThrow());const le=kC(b),V=Ft.$findMatchingParent(le,el.$isLinkNode);if(V!==null){const A=V.getURL();S(A)}else S(null);const H=F.getKey(),O=o.getElementByKey(H);if(c(b.hasFormat("bold")),f(b.hasFormat("italic")),g(b.hasFormat("strikethrough")),w(b.hasFormat("underline")),O!==null)if(a(H),Ui.$isListNode(F)){const A=Ft.$getNearestNodeOfType(L,Ui.ListNode),k=A?A.getListType():F.getListType();y(k)}else{const A=Ia.$isHeadingNode(F)?F.getTag():F.getType();A in $&&y(A)}}},[o]);p.useEffect(()=>Ft.mergeRegister(i.registerUpdateListener(({editorState:b})=>{b.read(()=>{N()})})),[N,o,i]),p.useEffect(()=>i.registerCommand(_e.SELECTION_CHANGE_COMMAND,(b,L)=>(N(),l(L),!1),_e.COMMAND_PRIORITY_CRITICAL),[i,N]);const R=b=>{["h1","h2","h3","h4","h5","h6"].includes(b)?v!==b&&i.update(()=>{const L=_e.$getSelection();_e.$isRangeSelection(L)&&co.$setBlocksType(L,()=>Ia.$createHeadingNode(b))}):b==="paragraph"&&v!=="paragraph"?i.update(()=>{const L=_e.$getSelection();(_e.$isRangeSelection(L)||_e.DEPRECATED_$isGridSelection(L))&&co.$setBlocksType(L,()=>_e.$createParagraphNode())}):b==="number"&&v!=="number"?i.dispatchCommand(Ui.INSERT_ORDERED_LIST_COMMAND,void 0):b==="bullet"&&v!=="bullet"?i.dispatchCommand(Ui.INSERT_UNORDERED_LIST_COMMAND,void 0):i.dispatchCommand(Ui.REMOVE_LIST_COMMAND,void 0)};return p.useCallback(()=>{i.update(()=>{const b=_e.$getSelection();if(_e.$isRangeSelection(b)){const L=b.anchor,F=b.focus,le=b.getNodes();if(L.key===F.key&&L.offset===F.offset)return;le.forEach((V,H)=>{_e.$isTextNode(V)?(H===0&&L.offset!==0&&(V=V.splitText(L.offset)[1]||V),H===le.length-1&&(V=V.splitText(F.offset)[0]||V),V.__style!==""&&V.setStyle(""),V.__format!==0&&(V.setFormat(0),Ft.$getNearestBlockElementAncestorOrThrow(V).setFormat(""))):Ia.$isHeadingNode(V)&&V.replace(_e.$createParagraphNode(),!0)})}})},[o]),x.jsxs("div",{className:"sticky top-0 flex flex-col px-4 py-2 border rounded-md rounded-b-none border-input bg-background",children:[x.jsxs("div",{className:"flex flex-row gap-1",children:[x.jsx(BA,{options:Object.values($),label:$[v]??v+" (not supported)",onChange:b=>{R(C[b])}}),x.jsx(Oo,{variant:"primary",onClick:b=>{b.preventDefault(),i.dispatchCommand(_e.FORMAT_TEXT_COMMAND,"bold")},active:u,icon:x.jsx(RA,{className:`${u&&"stroke-[3px]"}`})}),x.jsx(Oo,{active:h,onClick:b=>{b.preventDefault(),i.dispatchCommand(_e.FORMAT_TEXT_COMMAND,"strikethrough")},icon:x.jsx(DA,{className:`${h&&"stroke-[2px]"}`})}),x.jsx(Oo,{active:d,onClick:b=>{b.preventDefault(),i.dispatchCommand(_e.FORMAT_TEXT_COMMAND,"italic")},icon:x.jsx(MA,{className:`${d&&"stroke-[3px]"}`})}),x.jsx(Oo,{active:_!==null,onClick:b=>{b.preventDefault(),S(""),E("")},icon:x.jsx(eM,{width:12,height:12,className:`${_!==null&&"stroke-[3px]"}`})}),x.jsxs("label",{className:"flex items-center justify-center cursor-pointer",children:[x.jsx(PA,{}),x.jsx("input",{type:"file",hidden:!0,onChange:b=>{b.preventDefault(),CC(b).then(L=>{i.dispatchCommand(SC,{...L})}).catch(L=>{console.error("Error reading image",L)})}})]})]}),_!==null&&x.jsxs("div",{className:"flex flex-row p-2",children:[x.jsx("input",{type:"text",placeholder:"Enter URL",className:"w-1/3 px-2 bg-background text-primary",value:_,onChange:b=>{b.preventDefault(),S(b.target.value)}}),x.jsx(Oo,{variant:"primary",onClick:b=>{b.preventDefault(),E(_||null)},icon:x.jsx(JA,{size:14})}),x.jsx(Oo,{variant:"primary",onClick:b=>{b.preventDefault(),E(null)},icon:x.jsx(rM,{size:14})})]})]})},oM=iM;function lM(t){console.error(t)}const sM=({richtext:t,onEditor:e})=>{const r={namespace:"val",editorState:i=>{i.setEditorState(i.parseEditorState({root:DO(DE(t))}))},nodes:[Ia.HeadingNode,js,Ui.ListNode,Ui.ListItemNode,el.LinkNode],theme:{text:{bold:"font-semibold",underline:"underline",italic:"italic",strikethrough:"line-through",underlineStrikethrough:"underline line-through"},list:{listitem:"ml-[20px]",ol:"list-decimal",ul:"list-disc"},heading:{h1:"text-4xl font-bold",h2:"text-3xl font-bold",h3:"text-2xl font-bold",h4:"text-xl font-bold",h5:"text-lg font-bold",h6:"text-md font-bold"},link:"text-highlight underline"},onError:lM};return x.jsxs(aP.LexicalComposer,{initialConfig:r,children:[x.jsx($A,{}),x.jsx(oM,{onEditor:e}),x.jsx(aA.RichTextPlugin,{contentEditable:x.jsx("div",{className:"px-3 py-2 text-sm border-b rounded-md rounded-t-none border-x border-input bg-background ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",children:x.jsx(kA,{className:"p-4 outline-none bg-fill"})}),placeholder:x.jsx("p",{className:""}),ErrorBoundary:mP}),x.jsx(EA.LinkPlugin,{}),x.jsx(WA,{}),x.jsx(hA.ListPlugin,{}),x.jsx(TA,{}),x.jsx(CP.HistoryPlugin,{})]})},Iv="p-1 border rounded-full shadow border-accent",Nx="valbuild:urlBeforeNavigation";function aM({api:t,patches:e,direction:n,onCommit:r}){const{theme:i,setTheme:o,editMode:l,setEditMode:s,session:a}=jf();if(a.status==="success"&&a.data.mode==="unauthorized")return x.jsxs(Rx,{direction:n,href:t.getLoginUrl(window.location.href),children:[x.jsx("span",{children:"Login"}),x.jsx(P0,{size:18})]});if(a.status==="success"&&!a.data.enabled)return x.jsxs(Rx,{direction:n,href:t.getEnableUrl(window.location.href),children:[x.jsx("span",{children:"Enable"}),x.jsx(P0,{size:18})]});const[u,c]=p.useState();return p.useEffect(()=>{let d=0;for(const f in e)d+=e[f].length;c(d)},[e]),x.jsxs(uM,{direction:n,children:[x.jsx(Ec,{active:l==="hover",onClick:()=>{s(d=>d==="hover"?"off":"hover")},children:x.jsx("div",{className:"h-[24px] w-[24px] flex justify-center items-center",children:l==="hover"?x.jsx(cR,{size:18}):x.jsx(dR,{size:18})})}),x.jsx(Ec,{onClick:()=>{o(i==="dark"?"light":"dark")},children:x.jsxs("div",{className:"h-[24px] w-[24px] flex justify-center items-center",children:[i==="dark"&&x.jsx(pR,{size:15}),i==="light"&&x.jsx(uR,{size:15})]})}),x.jsx(Ec,{active:l==="full",onClick:()=>{if(l!=="full")localStorage.setItem(Nx,window.location.href),window.location.href=t.getEditUrl();else if(l==="full"){const d=localStorage.getItem(Nx);window.location.href=d||"/"}},children:x.jsx("div",{className:"h-[24px] w-[24px] flex justify-center items-center",children:l==="full"?x.jsx(aR,{size:15}):x.jsx(lR,{size:15})})}),u!==void 0&&a.status==="success"&&a.data.mode==="proxy"&&x.jsx(Ec,{onClick:()=>{u>0?t.postCommit({patches:e}).then(d=>{zo.isErr(d)?(console.error(d.error),alert("Could not commit patches: "+d.error.message)):(console.log("Committed patches: ",d.value),r())}):alert("No patches to commit")},children:x.jsxs("div",{className:"relative h-[24px] w-[24px] flex justify-center items-center",children:[x.jsx("div",{className:"absolute -right-[10px] -top-[10px] border border-border rounded-full px-1 font-sans text-xs bg-card text-accent",children:u}),x.jsx(hR,{size:18})]})}),x.jsx("a",{className:Iv,href:t.getDisableUrl(window.location.href),children:x.jsx("div",{className:"h-[24px] w-[24px] flex justify-center items-center",children:x.jsx(fR,{size:18})})})]})}function Rx({href:t,direction:e,children:n}){return x.jsx("div",{className:Pn("flex items-start justify-center w-full h-full font-sans border rounded-full gap-3 text-primary border-fill bg-gradient-to-br from-background/90 from-40% to-background backdrop-blur-lg drop-shadow-2xl",{"flex-col items-start":e==="vertical","flex-row items-center":e==="horizontal"}),children:x.jsx("a",{className:Iv,href:t,children:x.jsx("div",{className:"flex items-center justify-center px-2 gap-y-2",children:n})})})}function uM({children:t,direction:e}){return x.jsx("div",{className:Pn("flex justify-center w-full h-full px-2 py-2 font-sans border rounded-full gap-3 text-primary border-fill bg-gradient-to-br from-background/90 from-40% to-background backdrop-blur-lg drop-shadow-2xl",{"flex-col items-start":e==="vertical","flex-row items-center":e==="horizontal"}),children:t})}function Ec({active:t,onClick:e,children:n}){return x.jsx("button",{className:Pn(Iv,{"bg-accent text-accent-foreground drop-shadow-[0px_0px_12px_hsl(var(--accent))]":t}),onClick:e,children:n})}function cM(t,e){const[n,r]=p.useState({}),[i,o]=p.useState(0);return p.useEffect(()=>{t.status==="success"&&t.data.mode==="proxy"&&e.getPatches({}).then(l=>{if(zo.isOk(l)){const s={};for(const a in l.value)s[a]=l.value[a].map(u=>u.patch_id);r(s)}else console.error("Could not load patches",l.error)})},[t,i]),{patches:n,setPatchResetId:o}}function dM(t="dark"){const[e,n]=p.useState(t);return p.useEffect(()=>{localStorage.getItem("val-theme")==="light"?n("light"):localStorage.getItem("val-theme")==="dark"||window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?n("dark"):window.matchMedia&&window.matchMedia("(prefers-color-scheme: light)").matches&&n("light");const r=i=>{localStorage.getItem("val-theme")||n(i.matches?"dark":"light")};return window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",r),()=>{window.matchMedia("(prefers-color-scheme: dark)").removeEventListener("change",r)}},[]),[e,r=>{localStorage.setItem("val-theme",r),n(r)}]}var De;(function(t){t.assertEqual=i=>i;function e(i){}t.assertIs=e;function n(i){throw new Error}t.assertNever=n,t.arrayToEnum=i=>{const o={};for(const l of i)o[l]=l;return o},t.getValidEnumValues=i=>{const o=t.objectKeys(i).filter(s=>typeof i[i[s]]!="number"),l={};for(const s of o)l[s]=i[s];return t.objectValues(l)},t.objectValues=i=>t.objectKeys(i).map(function(o){return i[o]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const o=[];for(const l in i)Object.prototype.hasOwnProperty.call(i,l)&&o.push(l);return o},t.find=(i,o)=>{for(const l of i)if(o(l))return l},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function r(i,o=" | "){return i.map(l=>typeof l=="string"?`'${l}'`:l).join(o)}t.joinValues=r,t.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(De||(De={}));var Im;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(Im||(Im={}));const J=De.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Wi=t=>{switch(typeof t){case"undefined":return J.undefined;case"string":return J.string;case"number":return isNaN(t)?J.nan:J.number;case"boolean":return J.boolean;case"function":return J.function;case"bigint":return J.bigint;case"symbol":return J.symbol;case"object":return Array.isArray(t)?J.array:t===null?J.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?J.promise:typeof Map<"u"&&t instanceof Map?J.map:typeof Set<"u"&&t instanceof Set?J.set:typeof Date<"u"&&t instanceof Date?J.date:J.object;default:return J.unknown}},W=De.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),fM=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class Cr extends Error{constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const n=e||function(o){return o.message},r={_errors:[]},i=o=>{for(const l of o.issues)if(l.code==="invalid_union")l.unionErrors.map(i);else if(l.code==="invalid_return_type")i(l.returnTypeError);else if(l.code==="invalid_arguments")i(l.argumentsError);else if(l.path.length===0)r._errors.push(n(l));else{let s=r,a=0;for(;a<l.path.length;){const u=l.path[a];a===l.path.length-1?(s[u]=s[u]||{_errors:[]},s[u]._errors.push(n(l))):s[u]=s[u]||{_errors:[]},s=s[u],a++}}};return i(this),r}toString(){return this.message}get message(){return JSON.stringify(this.issues,De.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},r=[];for(const i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(e(i))):r.push(e(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Cr.create=t=>new Cr(t);const pu=(t,e)=>{let n;switch(t.code){case W.invalid_type:t.received===J.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case W.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,De.jsonStringifyReplacer)}`;break;case W.unrecognized_keys:n=`Unrecognized key(s) in object: ${De.joinValues(t.keys,", ")}`;break;case W.invalid_union:n="Invalid input";break;case W.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${De.joinValues(t.options)}`;break;case W.invalid_enum_value:n=`Invalid enum value. Expected ${De.joinValues(t.options)}, received '${t.received}'`;break;case W.invalid_arguments:n="Invalid function arguments";break;case W.invalid_return_type:n="Invalid function return type";break;case W.invalid_date:n="Invalid date";break;case W.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:De.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case W.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case W.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case W.custom:n="Invalid input";break;case W.invalid_intersection_types:n="Intersection results could not be merged";break;case W.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case W.not_finite:n="Number must be finite";break;default:n=e.defaultError,De.assertNever(t)}return{message:n}};let NC=pu;function hM(t){NC=t}function Ud(){return NC}const Wd=t=>{const{data:e,path:n,errorMaps:r,issueData:i}=t,o=[...n,...i.path||[]],l={...i,path:o};let s="";const a=r.filter(u=>!!u).slice().reverse();for(const u of a)s=u(l,{data:e,defaultError:s}).message;return{...i,path:o,message:i.message||s}},pM=[];function q(t,e){const n=Wd({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Ud(),pu].filter(r=>!!r)});t.common.issues.push(n)}class on{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const r=[];for(const i of n){if(i.status==="aborted")return ve;i.status==="dirty"&&e.dirty(),r.push(i.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){const r=[];for(const i of n)r.push({key:await i.key,value:await i.value});return on.mergeObjectSync(e,r)}static mergeObjectSync(e,n){const r={};for(const i of n){const{key:o,value:l}=i;if(o.status==="aborted"||l.status==="aborted")return ve;o.status==="dirty"&&e.dirty(),l.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof l.value<"u"||i.alwaysSet)&&(r[o.value]=l.value)}return{status:e.value,value:r}}}const ve=Object.freeze({status:"aborted"}),RC=t=>({status:"dirty",value:t}),yn=t=>({status:"valid",value:t}),jm=t=>t.status==="aborted",zm=t=>t.status==="dirty",mu=t=>t.status==="valid",Vd=t=>typeof Promise<"u"&&t instanceof Promise;var ce;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(ce||(ce={}));class Kr{constructor(e,n,r,i){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Ox=(t,e)=>{if(mu(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Cr(t.common.issues);return this._error=n,this._error}}};function we(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:r,description:i}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(l,s)=>l.code!=="invalid_type"?{message:s.defaultError}:typeof s.data>"u"?{message:r??s.defaultError}:{message:n??s.defaultError},description:i}}class Ce{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return Wi(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:Wi(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new on,ctx:{common:e.parent.common,data:e.data,parsedType:Wi(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(Vd(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){var r;const i={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Wi(e)},o=this._parseSync({data:e,path:i.path,parent:i});return Ox(i,o)}async parseAsync(e,n){const r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Wi(e)},i=this._parse({data:e,path:r.path,parent:r}),o=await(Vd(i)?i:Promise.resolve(i));return Ox(r,o)}refine(e,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,o)=>{const l=e(i),s=()=>o.addIssue({code:W.custom,...r(i)});return typeof Promise<"u"&&l instanceof Promise?l.then(a=>a?!0:(s(),!1)):l?!0:(s(),!1)})}refinement(e,n){return this._refinement((r,i)=>e(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(e){return new Tr({schema:this,typeName:de.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return di.create(this,this._def)}nullable(){return rl.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return kr.create(this,this._def)}promise(){return ys.create(this,this._def)}or(e){return xu.create([this,e],this._def)}and(e){return _u.create(this,e,this._def)}transform(e){return new Tr({...we(this._def),schema:this,typeName:de.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new ku({...we(this._def),innerType:this,defaultValue:n,typeName:de.ZodDefault})}brand(){return new PC({typeName:de.ZodBranded,type:this,...we(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new Gd({...we(this._def),innerType:this,catchValue:n,typeName:de.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return Vu.create(this,e)}readonly(){return Xd.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const mM=/^c[^\s-]{8,}$/i,gM=/^[a-z][a-z0-9]*$/,vM=/^[0-9A-HJKMNP-TV-Z]{26}$/,yM=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,xM=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,_M="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Uh;const wM=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,SM=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,EM=t=>t.precision?t.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}Z$`):t.precision===0?t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function CM(t,e){return!!((e==="v4"||!e)&&wM.test(t)||(e==="v6"||!e)&&SM.test(t))}class wr extends Ce{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==J.string){const o=this._getOrReturnCtx(e);return q(o,{code:W.invalid_type,expected:J.string,received:o.parsedType}),ve}const r=new on;let i;for(const o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(i=this._getOrReturnCtx(e,i),q(i,{code:W.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="max")e.data.length>o.value&&(i=this._getOrReturnCtx(e,i),q(i,{code:W.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){const l=e.data.length>o.value,s=e.data.length<o.value;(l||s)&&(i=this._getOrReturnCtx(e,i),l?q(i,{code:W.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):s&&q(i,{code:W.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if(o.kind==="email")xM.test(e.data)||(i=this._getOrReturnCtx(e,i),q(i,{validation:"email",code:W.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")Uh||(Uh=new RegExp(_M,"u")),Uh.test(e.data)||(i=this._getOrReturnCtx(e,i),q(i,{validation:"emoji",code:W.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")yM.test(e.data)||(i=this._getOrReturnCtx(e,i),q(i,{validation:"uuid",code:W.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")mM.test(e.data)||(i=this._getOrReturnCtx(e,i),q(i,{validation:"cuid",code:W.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")gM.test(e.data)||(i=this._getOrReturnCtx(e,i),q(i,{validation:"cuid2",code:W.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")vM.test(e.data)||(i=this._getOrReturnCtx(e,i),q(i,{validation:"ulid",code:W.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),q(i,{validation:"url",code:W.invalid_string,message:o.message}),r.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),q(i,{validation:"regex",code:W.invalid_string,message:o.message}),r.dirty())):o.kind==="trim"?e.data=e.data.trim():o.kind==="includes"?e.data.includes(o.value,o.position)||(i=this._getOrReturnCtx(e,i),q(i,{code:W.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),r.dirty()):o.kind==="toLowerCase"?e.data=e.data.toLowerCase():o.kind==="toUpperCase"?e.data=e.data.toUpperCase():o.kind==="startsWith"?e.data.startsWith(o.value)||(i=this._getOrReturnCtx(e,i),q(i,{code:W.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(i=this._getOrReturnCtx(e,i),q(i,{code:W.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?EM(o).test(e.data)||(i=this._getOrReturnCtx(e,i),q(i,{code:W.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="ip"?CM(e.data,o.version)||(i=this._getOrReturnCtx(e,i),q(i,{validation:"ip",code:W.invalid_string,message:o.message}),r.dirty()):De.assertNever(o);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(i=>e.test(i),{validation:n,code:W.invalid_string,...ce.errToObj(r)})}_addCheck(e){return new wr({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...ce.errToObj(e)})}url(e){return this._addCheck({kind:"url",...ce.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...ce.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...ce.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...ce.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...ce.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...ce.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...ce.errToObj(e)})}datetime(e){var n;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(n=e==null?void 0:e.offset)!==null&&n!==void 0?n:!1,...ce.errToObj(e==null?void 0:e.message)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...ce.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...ce.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...ce.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...ce.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...ce.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...ce.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...ce.errToObj(n)})}nonempty(e){return this.min(1,ce.errToObj(e))}trim(){return new wr({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new wr({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new wr({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}wr.create=t=>{var e;return new wr({checks:[],typeName:de.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...we(t)})};function kM(t,e){const n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,i=n>r?n:r,o=parseInt(t.toFixed(i).replace(".","")),l=parseInt(e.toFixed(i).replace(".",""));return o%l/Math.pow(10,i)}class ho extends Ce{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==J.number){const o=this._getOrReturnCtx(e);return q(o,{code:W.invalid_type,expected:J.number,received:o.parsedType}),ve}let r;const i=new on;for(const o of this._def.checks)o.kind==="int"?De.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),q(r,{code:W.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(r=this._getOrReturnCtx(e,r),q(r,{code:W.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),q(r,{code:W.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?kM(e.data,o.value)!==0&&(r=this._getOrReturnCtx(e,r),q(r,{code:W.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),q(r,{code:W.not_finite,message:o.message}),i.dirty()):De.assertNever(o);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,ce.toString(n))}gt(e,n){return this.setLimit("min",e,!1,ce.toString(n))}lte(e,n){return this.setLimit("max",e,!0,ce.toString(n))}lt(e,n){return this.setLimit("max",e,!1,ce.toString(n))}setLimit(e,n,r,i){return new ho({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:ce.toString(i)}]})}_addCheck(e){return new ho({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:ce.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ce.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ce.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ce.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ce.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:ce.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:ce.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ce.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ce.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&De.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}}ho.create=t=>new ho({checks:[],typeName:de.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...we(t)});class po extends Ce{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==J.bigint){const o=this._getOrReturnCtx(e);return q(o,{code:W.invalid_type,expected:J.bigint,received:o.parsedType}),ve}let r;const i=new on;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(r=this._getOrReturnCtx(e,r),q(r,{code:W.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),q(r,{code:W.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),q(r,{code:W.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):De.assertNever(o);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,ce.toString(n))}gt(e,n){return this.setLimit("min",e,!1,ce.toString(n))}lte(e,n){return this.setLimit("max",e,!0,ce.toString(n))}lt(e,n){return this.setLimit("max",e,!1,ce.toString(n))}setLimit(e,n,r,i){return new po({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:ce.toString(i)}]})}_addCheck(e){return new po({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ce.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ce.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ce.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ce.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:ce.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}po.create=t=>{var e;return new po({checks:[],typeName:de.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...we(t)})};class gu extends Ce{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==J.boolean){const r=this._getOrReturnCtx(e);return q(r,{code:W.invalid_type,expected:J.boolean,received:r.parsedType}),ve}return yn(e.data)}}gu.create=t=>new gu({typeName:de.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...we(t)});class tl extends Ce{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==J.date){const o=this._getOrReturnCtx(e);return q(o,{code:W.invalid_type,expected:J.date,received:o.parsedType}),ve}if(isNaN(e.data.getTime())){const o=this._getOrReturnCtx(e);return q(o,{code:W.invalid_date}),ve}const r=new on;let i;for(const o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(i=this._getOrReturnCtx(e,i),q(i,{code:W.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),r.dirty()):o.kind==="max"?e.data.getTime()>o.value&&(i=this._getOrReturnCtx(e,i),q(i,{code:W.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):De.assertNever(o);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new tl({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:ce.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:ce.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}tl.create=t=>new tl({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:de.ZodDate,...we(t)});class Hd extends Ce{_parse(e){if(this._getType(e)!==J.symbol){const r=this._getOrReturnCtx(e);return q(r,{code:W.invalid_type,expected:J.symbol,received:r.parsedType}),ve}return yn(e.data)}}Hd.create=t=>new Hd({typeName:de.ZodSymbol,...we(t)});class vu extends Ce{_parse(e){if(this._getType(e)!==J.undefined){const r=this._getOrReturnCtx(e);return q(r,{code:W.invalid_type,expected:J.undefined,received:r.parsedType}),ve}return yn(e.data)}}vu.create=t=>new vu({typeName:de.ZodUndefined,...we(t)});class yu extends Ce{_parse(e){if(this._getType(e)!==J.null){const r=this._getOrReturnCtx(e);return q(r,{code:W.invalid_type,expected:J.null,received:r.parsedType}),ve}return yn(e.data)}}yu.create=t=>new yu({typeName:de.ZodNull,...we(t)});class vs extends Ce{constructor(){super(...arguments),this._any=!0}_parse(e){return yn(e.data)}}vs.create=t=>new vs({typeName:de.ZodAny,...we(t)});class Wo extends Ce{constructor(){super(...arguments),this._unknown=!0}_parse(e){return yn(e.data)}}Wo.create=t=>new Wo({typeName:de.ZodUnknown,...we(t)});class gi extends Ce{_parse(e){const n=this._getOrReturnCtx(e);return q(n,{code:W.invalid_type,expected:J.never,received:n.parsedType}),ve}}gi.create=t=>new gi({typeName:de.ZodNever,...we(t)});class Kd extends Ce{_parse(e){if(this._getType(e)!==J.undefined){const r=this._getOrReturnCtx(e);return q(r,{code:W.invalid_type,expected:J.void,received:r.parsedType}),ve}return yn(e.data)}}Kd.create=t=>new Kd({typeName:de.ZodVoid,...we(t)});class kr extends Ce{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),i=this._def;if(n.parsedType!==J.array)return q(n,{code:W.invalid_type,expected:J.array,received:n.parsedType}),ve;if(i.exactLength!==null){const l=n.data.length>i.exactLength.value,s=n.data.length<i.exactLength.value;(l||s)&&(q(n,{code:l?W.too_big:W.too_small,minimum:s?i.exactLength.value:void 0,maximum:l?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(q(n,{code:W.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(q(n,{code:W.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((l,s)=>i.type._parseAsync(new Kr(n,l,n.path,s)))).then(l=>on.mergeArray(r,l));const o=[...n.data].map((l,s)=>i.type._parseSync(new Kr(n,l,n.path,s)));return on.mergeArray(r,o)}get element(){return this._def.type}min(e,n){return new kr({...this._def,minLength:{value:e,message:ce.toString(n)}})}max(e,n){return new kr({...this._def,maxLength:{value:e,message:ce.toString(n)}})}length(e,n){return new kr({...this._def,exactLength:{value:e,message:ce.toString(n)}})}nonempty(e){return this.min(1,e)}}kr.create=(t,e)=>new kr({type:t,minLength:null,maxLength:null,exactLength:null,typeName:de.ZodArray,...we(e)});function Nl(t){if(t instanceof ct){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=di.create(Nl(r))}return new ct({...t._def,shape:()=>e})}else return t instanceof kr?new kr({...t._def,type:Nl(t.element)}):t instanceof di?di.create(Nl(t.unwrap())):t instanceof rl?rl.create(Nl(t.unwrap())):t instanceof Zr?Zr.create(t.items.map(e=>Nl(e))):t}class ct extends Ce{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=De.objectKeys(e);return this._cached={shape:e,keys:n}}_parse(e){if(this._getType(e)!==J.object){const u=this._getOrReturnCtx(e);return q(u,{code:W.invalid_type,expected:J.object,received:u.parsedType}),ve}const{status:r,ctx:i}=this._processInputParams(e),{shape:o,keys:l}=this._getCached(),s=[];if(!(this._def.catchall instanceof gi&&this._def.unknownKeys==="strip"))for(const u in i.data)l.includes(u)||s.push(u);const a=[];for(const u of l){const c=o[u],d=i.data[u];a.push({key:{status:"valid",value:u},value:c._parse(new Kr(i,d,i.path,u)),alwaysSet:u in i.data})}if(this._def.catchall instanceof gi){const u=this._def.unknownKeys;if(u==="passthrough")for(const c of s)a.push({key:{status:"valid",value:c},value:{status:"valid",value:i.data[c]}});else if(u==="strict")s.length>0&&(q(i,{code:W.unrecognized_keys,keys:s}),r.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const c of s){const d=i.data[c];a.push({key:{status:"valid",value:c},value:u._parse(new Kr(i,d,i.path,c)),alwaysSet:c in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const u=[];for(const c of a){const d=await c.key;u.push({key:d,value:await c.value,alwaysSet:c.alwaysSet})}return u}).then(u=>on.mergeObjectSync(r,u)):on.mergeObjectSync(r,a)}get shape(){return this._def.shape()}strict(e){return ce.errToObj,new ct({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{var i,o,l,s;const a=(l=(o=(i=this._def).errorMap)===null||o===void 0?void 0:o.call(i,n,r).message)!==null&&l!==void 0?l:r.defaultError;return n.code==="unrecognized_keys"?{message:(s=ce.errToObj(e).message)!==null&&s!==void 0?s:a}:{message:a}}}:{}})}strip(){return new ct({...this._def,unknownKeys:"strip"})}passthrough(){return new ct({...this._def,unknownKeys:"passthrough"})}extend(e){return new ct({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ct({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:de.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new ct({...this._def,catchall:e})}pick(e){const n={};return De.objectKeys(e).forEach(r=>{e[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new ct({...this._def,shape:()=>n})}omit(e){const n={};return De.objectKeys(this.shape).forEach(r=>{e[r]||(n[r]=this.shape[r])}),new ct({...this._def,shape:()=>n})}deepPartial(){return Nl(this)}partial(e){const n={};return De.objectKeys(this.shape).forEach(r=>{const i=this.shape[r];e&&!e[r]?n[r]=i:n[r]=i.optional()}),new ct({...this._def,shape:()=>n})}required(e){const n={};return De.objectKeys(this.shape).forEach(r=>{if(e&&!e[r])n[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof di;)o=o._def.innerType;n[r]=o}}),new ct({...this._def,shape:()=>n})}keyof(){return OC(De.objectKeys(this.shape))}}ct.create=(t,e)=>new ct({shape:()=>t,unknownKeys:"strip",catchall:gi.create(),typeName:de.ZodObject,...we(e)});ct.strictCreate=(t,e)=>new ct({shape:()=>t,unknownKeys:"strict",catchall:gi.create(),typeName:de.ZodObject,...we(e)});ct.lazycreate=(t,e)=>new ct({shape:t,unknownKeys:"strip",catchall:gi.create(),typeName:de.ZodObject,...we(e)});class xu extends Ce{_parse(e){const{ctx:n}=this._processInputParams(e),r=this._def.options;function i(o){for(const s of o)if(s.result.status==="valid")return s.result;for(const s of o)if(s.result.status==="dirty")return n.common.issues.push(...s.ctx.common.issues),s.result;const l=o.map(s=>new Cr(s.ctx.common.issues));return q(n,{code:W.invalid_union,unionErrors:l}),ve}if(n.common.async)return Promise.all(r.map(async o=>{const l={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:l}),ctx:l}})).then(i);{let o;const l=[];for(const a of r){const u={...n,common:{...n.common,issues:[]},parent:null},c=a._parseSync({data:n.data,path:n.path,parent:u});if(c.status==="valid")return c;c.status==="dirty"&&!o&&(o={result:c,ctx:u}),u.common.issues.length&&l.push(u.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;const s=l.map(a=>new Cr(a));return q(n,{code:W.invalid_union,unionErrors:s}),ve}}get options(){return this._def.options}}xu.create=(t,e)=>new xu({options:t,typeName:de.ZodUnion,...we(e)});const Zc=t=>t instanceof Su?Zc(t.schema):t instanceof Tr?Zc(t.innerType()):t instanceof Eu?[t.value]:t instanceof mo?t.options:t instanceof Cu?Object.keys(t.enum):t instanceof ku?Zc(t._def.innerType):t instanceof vu?[void 0]:t instanceof yu?[null]:null;class zf extends Ce{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==J.object)return q(n,{code:W.invalid_type,expected:J.object,received:n.parsedType}),ve;const r=this.discriminator,i=n.data[r],o=this.optionsMap.get(i);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(q(n,{code:W.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),ve)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,r){const i=new Map;for(const o of n){const l=Zc(o.shape[e]);if(!l)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const s of l){if(i.has(s))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(s)}`);i.set(s,o)}}return new zf({typeName:de.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:i,...we(r)})}}function Fm(t,e){const n=Wi(t),r=Wi(e);if(t===e)return{valid:!0,data:t};if(n===J.object&&r===J.object){const i=De.objectKeys(e),o=De.objectKeys(t).filter(s=>i.indexOf(s)!==-1),l={...t,...e};for(const s of o){const a=Fm(t[s],e[s]);if(!a.valid)return{valid:!1};l[s]=a.data}return{valid:!0,data:l}}else if(n===J.array&&r===J.array){if(t.length!==e.length)return{valid:!1};const i=[];for(let o=0;o<t.length;o++){const l=t[o],s=e[o],a=Fm(l,s);if(!a.valid)return{valid:!1};i.push(a.data)}return{valid:!0,data:i}}else return n===J.date&&r===J.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class _u extends Ce{_parse(e){const{status:n,ctx:r}=this._processInputParams(e),i=(o,l)=>{if(jm(o)||jm(l))return ve;const s=Fm(o.value,l.value);return s.valid?((zm(o)||zm(l))&&n.dirty(),{status:n.value,value:s.data}):(q(r,{code:W.invalid_intersection_types}),ve)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,l])=>i(o,l)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}_u.create=(t,e,n)=>new _u({left:t,right:e,typeName:de.ZodIntersection,...we(n)});class Zr extends Ce{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==J.array)return q(r,{code:W.invalid_type,expected:J.array,received:r.parsedType}),ve;if(r.data.length<this._def.items.length)return q(r,{code:W.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ve;!this._def.rest&&r.data.length>this._def.items.length&&(q(r,{code:W.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const o=[...r.data].map((l,s)=>{const a=this._def.items[s]||this._def.rest;return a?a._parse(new Kr(r,l,r.path,s)):null}).filter(l=>!!l);return r.common.async?Promise.all(o).then(l=>on.mergeArray(n,l)):on.mergeArray(n,o)}get items(){return this._def.items}rest(e){return new Zr({...this._def,rest:e})}}Zr.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Zr({items:t,typeName:de.ZodTuple,rest:null,...we(e)})};class wu extends Ce{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==J.object)return q(r,{code:W.invalid_type,expected:J.object,received:r.parsedType}),ve;const i=[],o=this._def.keyType,l=this._def.valueType;for(const s in r.data)i.push({key:o._parse(new Kr(r,s,r.path,s)),value:l._parse(new Kr(r,r.data[s],r.path,s))});return r.common.async?on.mergeObjectAsync(n,i):on.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof Ce?new wu({keyType:e,valueType:n,typeName:de.ZodRecord,...we(r)}):new wu({keyType:wr.create(),valueType:e,typeName:de.ZodRecord,...we(n)})}}class Zd extends Ce{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==J.map)return q(r,{code:W.invalid_type,expected:J.map,received:r.parsedType}),ve;const i=this._def.keyType,o=this._def.valueType,l=[...r.data.entries()].map(([s,a],u)=>({key:i._parse(new Kr(r,s,r.path,[u,"key"])),value:o._parse(new Kr(r,a,r.path,[u,"value"]))}));if(r.common.async){const s=new Map;return Promise.resolve().then(async()=>{for(const a of l){const u=await a.key,c=await a.value;if(u.status==="aborted"||c.status==="aborted")return ve;(u.status==="dirty"||c.status==="dirty")&&n.dirty(),s.set(u.value,c.value)}return{status:n.value,value:s}})}else{const s=new Map;for(const a of l){const u=a.key,c=a.value;if(u.status==="aborted"||c.status==="aborted")return ve;(u.status==="dirty"||c.status==="dirty")&&n.dirty(),s.set(u.value,c.value)}return{status:n.value,value:s}}}}Zd.create=(t,e,n)=>new Zd({valueType:e,keyType:t,typeName:de.ZodMap,...we(n)});class nl extends Ce{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==J.set)return q(r,{code:W.invalid_type,expected:J.set,received:r.parsedType}),ve;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(q(r,{code:W.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(q(r,{code:W.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const o=this._def.valueType;function l(a){const u=new Set;for(const c of a){if(c.status==="aborted")return ve;c.status==="dirty"&&n.dirty(),u.add(c.value)}return{status:n.value,value:u}}const s=[...r.data.values()].map((a,u)=>o._parse(new Kr(r,a,r.path,u)));return r.common.async?Promise.all(s).then(a=>l(a)):l(s)}min(e,n){return new nl({...this._def,minSize:{value:e,message:ce.toString(n)}})}max(e,n){return new nl({...this._def,maxSize:{value:e,message:ce.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}nl.create=(t,e)=>new nl({valueType:t,minSize:null,maxSize:null,typeName:de.ZodSet,...we(e)});class ns extends Ce{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==J.function)return q(n,{code:W.invalid_type,expected:J.function,received:n.parsedType}),ve;function r(s,a){return Wd({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Ud(),pu].filter(u=>!!u),issueData:{code:W.invalid_arguments,argumentsError:a}})}function i(s,a){return Wd({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Ud(),pu].filter(u=>!!u),issueData:{code:W.invalid_return_type,returnTypeError:a}})}const o={errorMap:n.common.contextualErrorMap},l=n.data;if(this._def.returns instanceof ys){const s=this;return yn(async function(...a){const u=new Cr([]),c=await s._def.args.parseAsync(a,o).catch(h=>{throw u.addIssue(r(a,h)),u}),d=await Reflect.apply(l,this,c);return await s._def.returns._def.type.parseAsync(d,o).catch(h=>{throw u.addIssue(i(d,h)),u})})}else{const s=this;return yn(function(...a){const u=s._def.args.safeParse(a,o);if(!u.success)throw new Cr([r(a,u.error)]);const c=Reflect.apply(l,this,u.data),d=s._def.returns.safeParse(c,o);if(!d.success)throw new Cr([i(c,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new ns({...this._def,args:Zr.create(e).rest(Wo.create())})}returns(e){return new ns({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,r){return new ns({args:e||Zr.create([]).rest(Wo.create()),returns:n||Wo.create(),typeName:de.ZodFunction,...we(r)})}}class Su extends Ce{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}Su.create=(t,e)=>new Su({getter:t,typeName:de.ZodLazy,...we(e)});class Eu extends Ce{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return q(n,{received:n.data,code:W.invalid_literal,expected:this._def.value}),ve}return{status:"valid",value:e.data}}get value(){return this._def.value}}Eu.create=(t,e)=>new Eu({value:t,typeName:de.ZodLiteral,...we(e)});function OC(t,e){return new mo({values:t,typeName:de.ZodEnum,...we(e)})}class mo extends Ce{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return q(n,{expected:De.joinValues(r),received:n.parsedType,code:W.invalid_type}),ve}if(this._def.values.indexOf(e.data)===-1){const n=this._getOrReturnCtx(e),r=this._def.values;return q(n,{received:n.data,code:W.invalid_enum_value,options:r}),ve}return yn(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e){return mo.create(e)}exclude(e){return mo.create(this.options.filter(n=>!e.includes(n)))}}mo.create=OC;class Cu extends Ce{_parse(e){const n=De.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==J.string&&r.parsedType!==J.number){const i=De.objectValues(n);return q(r,{expected:De.joinValues(i),received:r.parsedType,code:W.invalid_type}),ve}if(n.indexOf(e.data)===-1){const i=De.objectValues(n);return q(r,{received:r.data,code:W.invalid_enum_value,options:i}),ve}return yn(e.data)}get enum(){return this._def.values}}Cu.create=(t,e)=>new Cu({values:t,typeName:de.ZodNativeEnum,...we(e)});class ys extends Ce{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==J.promise&&n.common.async===!1)return q(n,{code:W.invalid_type,expected:J.promise,received:n.parsedType}),ve;const r=n.parsedType===J.promise?n.data:Promise.resolve(n.data);return yn(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}ys.create=(t,e)=>new ys({type:t,typeName:de.ZodPromise,...we(e)});class Tr extends Ce{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===de.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:r}=this._processInputParams(e),i=this._def.effect||null,o={addIssue:l=>{q(r,l),l.fatal?n.abort():n.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="preprocess"){const l=i.transform(r.data,o);return r.common.issues.length?{status:"dirty",value:r.data}:r.common.async?Promise.resolve(l).then(s=>this._def.schema._parseAsync({data:s,path:r.path,parent:r})):this._def.schema._parseSync({data:l,path:r.path,parent:r})}if(i.type==="refinement"){const l=s=>{const a=i.refinement(s,o);if(r.common.async)return Promise.resolve(a);if(a instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(r.common.async===!1){const s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?ve:(s.status==="dirty"&&n.dirty(),l(s.value),{status:n.value,value:s.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>s.status==="aborted"?ve:(s.status==="dirty"&&n.dirty(),l(s.value).then(()=>({status:n.value,value:s.value}))))}if(i.type==="transform")if(r.common.async===!1){const l=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!mu(l))return l;const s=i.transform(l.value,o);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:s}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(l=>mu(l)?Promise.resolve(i.transform(l.value,o)).then(s=>({status:n.value,value:s})):l);De.assertNever(i)}}Tr.create=(t,e,n)=>new Tr({schema:t,typeName:de.ZodEffects,effect:e,...we(n)});Tr.createWithPreprocess=(t,e,n)=>new Tr({schema:e,effect:{type:"preprocess",transform:t},typeName:de.ZodEffects,...we(n)});class di extends Ce{_parse(e){return this._getType(e)===J.undefined?yn(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}di.create=(t,e)=>new di({innerType:t,typeName:de.ZodOptional,...we(e)});class rl extends Ce{_parse(e){return this._getType(e)===J.null?yn(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}rl.create=(t,e)=>new rl({innerType:t,typeName:de.ZodNullable,...we(e)});class ku extends Ce{_parse(e){const{ctx:n}=this._processInputParams(e);let r=n.data;return n.parsedType===J.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}ku.create=(t,e)=>new ku({innerType:t,typeName:de.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...we(e)});class Gd extends Ce{_parse(e){const{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Vd(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Cr(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Cr(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Gd.create=(t,e)=>new Gd({innerType:t,typeName:de.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...we(e)});class Yd extends Ce{_parse(e){if(this._getType(e)!==J.nan){const r=this._getOrReturnCtx(e);return q(r,{code:W.invalid_type,expected:J.nan,received:r.parsedType}),ve}return{status:"valid",value:e.data}}}Yd.create=t=>new Yd({typeName:de.ZodNaN,...we(t)});const bM=Symbol("zod_brand");class PC extends Ce{_parse(e){const{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class Vu extends Ce{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?ve:o.status==="dirty"?(n.dirty(),RC(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?ve:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(e,n){return new Vu({in:e,out:n,typeName:de.ZodPipeline})}}class Xd extends Ce{_parse(e){const n=this._def.innerType._parse(e);return mu(n)&&(n.value=Object.freeze(n.value)),n}}Xd.create=(t,e)=>new Xd({innerType:t,typeName:de.ZodReadonly,...we(e)});const AC=(t,e={},n)=>t?vs.create().superRefine((r,i)=>{var o,l;if(!t(r)){const s=typeof e=="function"?e(r):typeof e=="string"?{message:e}:e,a=(l=(o=s.fatal)!==null&&o!==void 0?o:n)!==null&&l!==void 0?l:!0,u=typeof s=="string"?{message:s}:s;i.addIssue({code:"custom",...u,fatal:a})}}):vs.create(),$M={object:ct.lazycreate};var de;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(de||(de={}));const TM=(t,e={message:`Input not instance of ${t.name}`})=>AC(n=>n instanceof t,e),MC=wr.create,LC=ho.create,NM=Yd.create,RM=po.create,DC=gu.create,OM=tl.create,PM=Hd.create,AM=vu.create,MM=yu.create,LM=vs.create,DM=Wo.create,IM=gi.create,jM=Kd.create,zM=kr.create,FM=ct.create,BM=ct.strictCreate,UM=xu.create,WM=zf.create,VM=_u.create,HM=Zr.create,KM=wu.create,ZM=Zd.create,GM=nl.create,YM=ns.create,XM=Su.create,JM=Eu.create,QM=mo.create,qM=Cu.create,e5=ys.create,Px=Tr.create,t5=di.create,n5=rl.create,r5=Tr.createWithPreprocess,i5=Vu.create,o5=()=>MC().optional(),l5=()=>LC().optional(),s5=()=>DC().optional(),a5={string:t=>wr.create({...t,coerce:!0}),number:t=>ho.create({...t,coerce:!0}),boolean:t=>gu.create({...t,coerce:!0}),bigint:t=>po.create({...t,coerce:!0}),date:t=>tl.create({...t,coerce:!0})},u5=ve;var Cn=Object.freeze({__proto__:null,defaultErrorMap:pu,setErrorMap:hM,getErrorMap:Ud,makeIssue:Wd,EMPTY_PATH:pM,addIssueToContext:q,ParseStatus:on,INVALID:ve,DIRTY:RC,OK:yn,isAborted:jm,isDirty:zm,isValid:mu,isAsync:Vd,get util(){return De},get objectUtil(){return Im},ZodParsedType:J,getParsedType:Wi,ZodType:Ce,ZodString:wr,ZodNumber:ho,ZodBigInt:po,ZodBoolean:gu,ZodDate:tl,ZodSymbol:Hd,ZodUndefined:vu,ZodNull:yu,ZodAny:vs,ZodUnknown:Wo,ZodNever:gi,ZodVoid:Kd,ZodArray:kr,ZodObject:ct,ZodUnion:xu,ZodDiscriminatedUnion:zf,ZodIntersection:_u,ZodTuple:Zr,ZodRecord:wu,ZodMap:Zd,ZodSet:nl,ZodFunction:ns,ZodLazy:Su,ZodLiteral:Eu,ZodEnum:mo,ZodNativeEnum:Cu,ZodPromise:ys,ZodEffects:Tr,ZodTransformer:Tr,ZodOptional:di,ZodNullable:rl,ZodDefault:ku,ZodCatch:Gd,ZodNaN:Yd,BRAND:bM,ZodBranded:PC,ZodPipeline:Vu,ZodReadonly:Xd,custom:AC,Schema:Ce,ZodSchema:Ce,late:$M,get ZodFirstPartyTypeKind(){return de},coerce:a5,any:LM,array:zM,bigint:RM,boolean:DC,date:OM,discriminatedUnion:WM,effect:Px,enum:QM,function:YM,instanceof:TM,intersection:VM,lazy:XM,literal:JM,map:ZM,nan:NM,nativeEnum:qM,never:IM,null:MM,nullable:n5,number:LC,object:FM,oboolean:s5,onumber:l5,optional:t5,ostring:o5,pipeline:i5,preprocess:r5,promise:e5,record:KM,set:GM,strictObject:BM,string:MC,symbol:PM,transformer:Px,tuple:HM,undefined:AM,union:UM,unknown:DM,void:jM,NEVER:u5,ZodIssueCode:W,quotelessJson:fM,ZodError:Cr});const c5=Cn.union([Cn.object({id:Cn.string(),mode:Cn.literal("proxy"),full_name:Cn.string().optional().nullable(),username:Cn.string().optional().nullable(),avatar_url:Cn.string().url().optional().nullable(),enabled:Cn.boolean()}),Cn.object({mode:Cn.literal("local"),enabled:Cn.boolean().optional()}),Cn.object({mode:Cn.literal("unauthorized"),enabled:Cn.boolean().optional()})]);function d5(t){const[e,n]=p.useState({status:"not-asked"}),[r,i]=p.useState(0);return p.useEffect(()=>{n({status:"loading"}),t.getSession().then(async o=>{try{if(zo.isOk(o)){const l=o.value;n({status:"success",data:c5.parse(l)})}else o.error.statusCode===401?n({status:"success",data:{mode:"unauthorized"}}):r<3?setTimeout(()=>{i(r+1)},200*r):n({status:"error",error:"Could not fetch session"})}catch(l){console.error("Could not authorize:",l),n({status:"error",error:"Got an error while trying to get session"})}})},[r]),e}const Ax=t=>typeof t=="boolean"?"".concat(t):t===0?"0":t,Mx=pS,f5=(t,e)=>n=>{var r;if((e==null?void 0:e.variants)==null)return Mx(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:o}=e,l=Object.keys(i).map(u=>{const c=n==null?void 0:n[u],d=o==null?void 0:o[u];if(c===null)return null;const f=Ax(c)||Ax(d);return i[u][f]}),s=n&&Object.entries(n).reduce((u,c)=>{let[d,f]=c;return f===void 0||(u[d]=f),u},{}),a=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((u,c)=>{let{class:d,className:f,...h}=c;return Object.entries(h).every(g=>{let[m,w]=g;return Array.isArray(w)?w.includes({...o,...s}[m]):{...o,...s}[m]===w})?[...u,d,f]:u},[]);return Mx(t,l,a,n==null?void 0:n.class,n==null?void 0:n.className)},h5=f5("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),IC=p.forwardRef(({className:t,variant:e,size:n,asChild:r=!1,...i},o)=>{const l=r?hs:"button";return x.jsx(l,{className:xt(h5({variant:e,size:n,className:t})),ref:o,...i})});IC.displayName="Button";const jv=p.forwardRef(({className:t,type:e,...n},r)=>x.jsx("input",{type:e,className:xt("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),ref:r,...n}));jv.displayName="Input";function jC(t){const e=t+"CollectionProvider",[n,r]=al(e),[i,o]=n(e,{collectionRef:{current:null},itemMap:new Map}),l=h=>{const{scope:g,children:m}=h,w=re.useRef(null),v=re.useRef(new Map).current;return re.createElement(i,{scope:g,itemMap:v,collectionRef:w},m)},s=t+"CollectionSlot",a=re.forwardRef((h,g)=>{const{scope:m,children:w}=h,v=o(s,m),y=st(g,v.collectionRef);return re.createElement(hs,{ref:y},w)}),u=t+"CollectionItemSlot",c="data-radix-collection-item",d=re.forwardRef((h,g)=>{const{scope:m,children:w,...v}=h,y=re.useRef(null),_=st(g,y),S=o(u,m);return re.useEffect(()=>(S.itemMap.set(y,{ref:y,...v}),()=>void S.itemMap.delete(y))),re.createElement(hs,{[c]:"",ref:_},w)});function f(h){const g=o(t+"CollectionConsumer",h);return re.useCallback(()=>{const w=g.collectionRef.current;if(!w)return[];const v=Array.from(w.querySelectorAll(`[${c}]`));return Array.from(g.itemMap.values()).sort((S,E)=>v.indexOf(S.ref.current)-v.indexOf(E.ref.current))},[g.collectionRef,g.itemMap])}return[{Provider:l,Slot:a,ItemSlot:d},f,r]}function p5(t,e=globalThis==null?void 0:globalThis.document){const n=en(t);p.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return e.addEventListener("keydown",r),()=>e.removeEventListener("keydown",r)},[n,e])}const Bm="dismissableLayer.update",m5="dismissableLayer.pointerDownOutside",g5="dismissableLayer.focusOutside";let Lx;const v5=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),y5=p.forwardRef((t,e)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:l,onInteractOutside:s,onDismiss:a,...u}=t,c=p.useContext(v5),[d,f]=p.useState(null),h=(n=d==null?void 0:d.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,g]=p.useState({}),m=st(e,N=>f(N)),w=Array.from(c.layers),[v]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),y=w.indexOf(v),_=d?w.indexOf(d):-1,S=c.layersWithOutsidePointerEventsDisabled.size>0,E=_>=y,$=x5(N=>{const R=N.target,b=[...c.branches].some(L=>L.contains(R));!E||b||(o==null||o(N),s==null||s(N),N.defaultPrevented||a==null||a())},h),C=_5(N=>{const R=N.target;[...c.branches].some(L=>L.contains(R))||(l==null||l(N),s==null||s(N),N.defaultPrevented||a==null||a())},h);return p5(N=>{_===c.layers.size-1&&(i==null||i(N),!N.defaultPrevented&&a&&(N.preventDefault(),a()))},h),p.useEffect(()=>{if(d)return r&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(Lx=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(d)),c.layers.add(d),Dx(),()=>{r&&c.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=Lx)}},[d,h,r,c]),p.useEffect(()=>()=>{d&&(c.layers.delete(d),c.layersWithOutsidePointerEventsDisabled.delete(d),Dx())},[d,c]),p.useEffect(()=>{const N=()=>g({});return document.addEventListener(Bm,N),()=>document.removeEventListener(Bm,N)},[]),p.createElement(Ke.div,ie({},u,{ref:m,style:{pointerEvents:S?E?"auto":"none":void 0,...t.style},onFocusCapture:nt(t.onFocusCapture,C.onFocusCapture),onBlurCapture:nt(t.onBlurCapture,C.onBlurCapture),onPointerDownCapture:nt(t.onPointerDownCapture,$.onPointerDownCapture)}))});function x5(t,e=globalThis==null?void 0:globalThis.document){const n=en(t),r=p.useRef(!1),i=p.useRef(()=>{});return p.useEffect(()=>{const o=s=>{if(s.target&&!r.current){let c=function(){zC(m5,n,u,{discrete:!0})};var a=c;const u={originalEvent:s};s.pointerType==="touch"?(e.removeEventListener("click",i.current),i.current=c,e.addEventListener("click",i.current,{once:!0})):c()}else e.removeEventListener("click",i.current);r.current=!1},l=window.setTimeout(()=>{e.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(l),e.removeEventListener("pointerdown",o),e.removeEventListener("click",i.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function _5(t,e=globalThis==null?void 0:globalThis.document){const n=en(t),r=p.useRef(!1);return p.useEffect(()=>{const i=o=>{o.target&&!r.current&&zC(g5,n,{originalEvent:o},{discrete:!1})};return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Dx(){const t=new CustomEvent(Bm);document.dispatchEvent(t)}function zC(t,e,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&i.addEventListener(t,e,{once:!0}),r?n2(i,o):i.dispatchEvent(o)}let Wh=0;function w5(){p.useEffect(()=>{var t,e;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(t=n[0])!==null&&t!==void 0?t:Ix()),document.body.insertAdjacentElement("beforeend",(e=n[1])!==null&&e!==void 0?e:Ix()),Wh++,()=>{Wh===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),Wh--}},[])}function Ix(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",t}const Vh="focusScope.autoFocusOnMount",Hh="focusScope.autoFocusOnUnmount",jx={bubbles:!1,cancelable:!0},S5=p.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...l}=t,[s,a]=p.useState(null),u=en(i),c=en(o),d=p.useRef(null),f=st(e,m=>a(m)),h=p.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;p.useEffect(()=>{if(r){let y=function($){if(h.paused||!s)return;const C=$.target;s.contains(C)?d.current=C:Li(d.current,{select:!0})},_=function($){if(h.paused||!s)return;const C=$.relatedTarget;C!==null&&(s.contains(C)||Li(d.current,{select:!0}))},S=function($){if(document.activeElement===document.body)for(const N of $)N.removedNodes.length>0&&Li(s)};var m=y,w=_,v=S;document.addEventListener("focusin",y),document.addEventListener("focusout",_);const E=new MutationObserver(S);return s&&E.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",_),E.disconnect()}}},[r,s,h.paused]),p.useEffect(()=>{if(s){Fx.add(h);const m=document.activeElement;if(!s.contains(m)){const v=new CustomEvent(Vh,jx);s.addEventListener(Vh,u),s.dispatchEvent(v),v.defaultPrevented||(E5(T5(FC(s)),{select:!0}),document.activeElement===m&&Li(s))}return()=>{s.removeEventListener(Vh,u),setTimeout(()=>{const v=new CustomEvent(Hh,jx);s.addEventListener(Hh,c),s.dispatchEvent(v),v.defaultPrevented||Li(m??document.body,{select:!0}),s.removeEventListener(Hh,c),Fx.remove(h)},0)}}},[s,u,c,h]);const g=p.useCallback(m=>{if(!n&&!r||h.paused)return;const w=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,v=document.activeElement;if(w&&v){const y=m.currentTarget,[_,S]=C5(y);_&&S?!m.shiftKey&&v===S?(m.preventDefault(),n&&Li(_,{select:!0})):m.shiftKey&&v===_&&(m.preventDefault(),n&&Li(S,{select:!0})):v===y&&m.preventDefault()}},[n,r,h.paused]);return p.createElement(Ke.div,ie({tabIndex:-1},l,{ref:f,onKeyDown:g}))});function E5(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(Li(r,{select:e}),document.activeElement!==n)return}function C5(t){const e=FC(t),n=zx(e,t),r=zx(e.reverse(),t);return[n,r]}function FC(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function zx(t,e){for(const n of t)if(!k5(n,{upTo:e}))return n}function k5(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 b5(t){return t instanceof HTMLInputElement&&"select"in t}function Li(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&b5(t)&&e&&t.select()}}const Fx=$5();function $5(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=Bx(t,e),t.unshift(e)},remove(e){var n;t=Bx(t,e),(n=t[0])===null||n===void 0||n.resume()}}}function Bx(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function T5(t){return t.filter(e=>e.tagName!=="A")}const N5=I_.useId||(()=>{});let R5=0;function Ff(t){const[e,n]=p.useState(N5());return Vn(()=>{t||n(r=>r??String(R5++))},[t]),t||(e?`radix-${e}`:"")}const O5=["top","right","bottom","left"],go=Math.min,jn=Math.max,Jd=Math.round,Cc=Math.floor,vo=t=>({x:t,y:t}),P5={left:"right",right:"left",bottom:"top",top:"bottom"},A5={start:"end",end:"start"};function Um(t,e,n){return jn(t,go(e,n))}function vi(t,e){return typeof t=="function"?t(e):t}function yi(t){return t.split("-")[0]}function zs(t){return t.split("-")[1]}function zv(t){return t==="x"?"y":"x"}function Fv(t){return t==="y"?"height":"width"}function Fs(t){return["top","bottom"].includes(yi(t))?"y":"x"}function Bv(t){return zv(Fs(t))}function M5(t,e,n){n===void 0&&(n=!1);const r=zs(t),i=Bv(t),o=Fv(i);let l=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(l=Qd(l)),[l,Qd(l)]}function L5(t){const e=Qd(t);return[Wm(t),e,Wm(e)]}function Wm(t){return t.replace(/start|end/g,e=>A5[e])}function D5(t,e,n){const r=["left","right"],i=["right","left"],o=["top","bottom"],l=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:r:e?r:i;case"left":case"right":return e?o:l;default:return[]}}function I5(t,e,n,r){const i=zs(t);let o=D5(yi(t),n==="start",r);return i&&(o=o.map(l=>l+"-"+i),e&&(o=o.concat(o.map(Wm)))),o}function Qd(t){return t.replace(/left|right|bottom|top/g,e=>P5[e])}function j5(t){return{top:0,right:0,bottom:0,left:0,...t}}function BC(t){return typeof t!="number"?j5(t):{top:t,right:t,bottom:t,left:t}}function qd(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}function Ux(t,e,n){let{reference:r,floating:i}=t;const o=Fs(e),l=Bv(e),s=Fv(l),a=yi(e),u=o==="y",c=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2;let h;switch(a){case"top":h={x:c,y:r.y-i.height};break;case"bottom":h={x:c,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-i.width,y:d};break;default:h={x:r.x,y:r.y}}switch(zs(e)){case"start":h[l]-=f*(n&&u?-1:1);break;case"end":h[l]+=f*(n&&u?-1:1);break}return h}const z5=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:l}=n,s=o.filter(Boolean),a=await(l.isRTL==null?void 0:l.isRTL(e));let u=await l.getElementRects({reference:t,floating:e,strategy:i}),{x:c,y:d}=Ux(u,r,a),f=r,h={},g=0;for(let m=0;m<s.length;m++){const{name:w,fn:v}=s[m],{x:y,y:_,data:S,reset:E}=await v({x:c,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:h,rects:u,platform:l,elements:{reference:t,floating:e}});if(c=y??c,d=_??d,h={...h,[w]:{...h[w],...S}},E&&g<=50){g++,typeof E=="object"&&(E.placement&&(f=E.placement),E.rects&&(u=E.rects===!0?await l.getElementRects({reference:t,floating:e,strategy:i}):E.rects),{x:c,y:d}=Ux(u,f,a)),m=-1;continue}}return{x:c,y:d,placement:f,strategy:i,middlewareData:h}};async function bu(t,e){var n;e===void 0&&(e={});const{x:r,y:i,platform:o,rects:l,elements:s,strategy:a}=t,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=vi(e,t),g=BC(h),w=s[f?d==="floating"?"reference":"floating":d],v=qd(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(w)))==null||n?w:w.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(s.floating)),boundary:u,rootBoundary:c,strategy:a})),y=d==="floating"?{...l.floating,x:r,y:i}:l.reference,_=await(o.getOffsetParent==null?void 0:o.getOffsetParent(s.floating)),S=await(o.isElement==null?void 0:o.isElement(_))?await(o.getScale==null?void 0:o.getScale(_))||{x:1,y:1}:{x:1,y:1},E=qd(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({rect:y,offsetParent:_,strategy:a}):y);return{top:(v.top-E.top+g.top)/S.y,bottom:(E.bottom-v.bottom+g.bottom)/S.y,left:(v.left-E.left+g.left)/S.x,right:(E.right-v.right+g.right)/S.x}}const Wx=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:i,rects:o,platform:l,elements:s,middlewareData:a}=e,{element:u,padding:c=0}=vi(t,e)||{};if(u==null)return{};const d=BC(c),f={x:n,y:r},h=Bv(i),g=Fv(h),m=await l.getDimensions(u),w=h==="y",v=w?"top":"left",y=w?"bottom":"right",_=w?"clientHeight":"clientWidth",S=o.reference[g]+o.reference[h]-f[h]-o.floating[g],E=f[h]-o.reference[h],$=await(l.getOffsetParent==null?void 0:l.getOffsetParent(u));let C=$?$[_]:0;(!C||!await(l.isElement==null?void 0:l.isElement($)))&&(C=s.floating[_]||o.floating[g]);const N=S/2-E/2,R=C/2-m[g]/2-1,b=go(d[v],R),L=go(d[y],R),F=b,le=C-m[g]-L,V=C/2-m[g]/2+N,H=Um(F,V,le),O=!a.arrow&&zs(i)!=null&&V!=H&&o.reference[g]/2-(V<F?b:L)-m[g]/2<0,A=O?V<F?V-F:V-le:0;return{[h]:f[h]+A,data:{[h]:H,centerOffset:V-H-A,...O&&{alignmentOffset:A}},reset:O}}}),F5=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:i,middlewareData:o,rects:l,initialPlacement:s,platform:a,elements:u}=e,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:m=!0,...w}=vi(t,e);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const v=yi(i),y=yi(s)===s,_=await(a.isRTL==null?void 0:a.isRTL(u.floating)),S=f||(y||!m?[Qd(s)]:L5(s));!f&&g!=="none"&&S.push(...I5(s,m,g,_));const E=[s,...S],$=await bu(e,w),C=[];let N=((r=o.flip)==null?void 0:r.overflows)||[];if(c&&C.push($[v]),d){const F=M5(i,l,_);C.push($[F[0]],$[F[1]])}if(N=[...N,{placement:i,overflows:C}],!C.every(F=>F<=0)){var R,b;const F=(((R=o.flip)==null?void 0:R.index)||0)+1,le=E[F];if(le)return{data:{index:F,overflows:N},reset:{placement:le}};let V=(b=N.filter(H=>H.overflows[0]<=0).sort((H,O)=>H.overflows[1]-O.overflows[1])[0])==null?void 0:b.placement;if(!V)switch(h){case"bestFit":{var L;const H=(L=N.map(O=>[O.placement,O.overflows.filter(A=>A>0).reduce((A,k)=>A+k,0)]).sort((O,A)=>O[1]-A[1])[0])==null?void 0:L[0];H&&(V=H);break}case"initialPlacement":V=s;break}if(i!==V)return{reset:{placement:V}}}return{}}}};function Vx(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Hx(t){return O5.some(e=>t[e]>=0)}const B5=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:r="referenceHidden",...i}=vi(t,e);switch(r){case"referenceHidden":{const o=await bu(e,{...i,elementContext:"reference"}),l=Vx(o,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:Hx(l)}}}case"escaped":{const o=await bu(e,{...i,altBoundary:!0}),l=Vx(o,n.floating);return{data:{escapedOffsets:l,escaped:Hx(l)}}}default:return{}}}}};async function U5(t,e){const{placement:n,platform:r,elements:i}=t,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),l=yi(n),s=zs(n),a=Fs(n)==="y",u=["left","top"].includes(l)?-1:1,c=o&&a?-1:1,d=vi(e,t);let{mainAxis:f,crossAxis:h,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return s&&typeof g=="number"&&(h=s==="end"?g*-1:g),a?{x:h*c,y:f*u}:{x:f*u,y:h*c}}const W5=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){const{x:n,y:r}=e,i=await U5(e,t);return{x:n+i.x,y:r+i.y,data:i}}}},V5=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:i}=e,{mainAxis:o=!0,crossAxis:l=!1,limiter:s={fn:w=>{let{x:v,y}=w;return{x:v,y}}},...a}=vi(t,e),u={x:n,y:r},c=await bu(e,a),d=Fs(yi(i)),f=zv(d);let h=u[f],g=u[d];if(o){const w=f==="y"?"top":"left",v=f==="y"?"bottom":"right",y=h+c[w],_=h-c[v];h=Um(y,h,_)}if(l){const w=d==="y"?"top":"left",v=d==="y"?"bottom":"right",y=g+c[w],_=g-c[v];g=Um(y,g,_)}const m=s.fn({...e,[f]:h,[d]:g});return{...m,data:{x:m.x-n,y:m.y-r}}}}},H5=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:i,rects:o,middlewareData:l}=e,{offset:s=0,mainAxis:a=!0,crossAxis:u=!0}=vi(t,e),c={x:n,y:r},d=Fs(i),f=zv(d);let h=c[f],g=c[d];const m=vi(s,e),w=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(a){const _=f==="y"?"height":"width",S=o.reference[f]-o.floating[_]+w.mainAxis,E=o.reference[f]+o.reference[_]-w.mainAxis;h<S?h=S:h>E&&(h=E)}if(u){var v,y;const _=f==="y"?"width":"height",S=["top","left"].includes(yi(i)),E=o.reference[d]-o.floating[_]+(S&&((v=l.offset)==null?void 0:v[d])||0)+(S?0:w.crossAxis),$=o.reference[d]+o.reference[_]+(S?0:((y=l.offset)==null?void 0:y[d])||0)-(S?w.crossAxis:0);g<E?g=E:g>$&&(g=$)}return{[f]:h,[d]:g}}}},K5=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:r,platform:i,elements:o}=e,{apply:l=()=>{},...s}=vi(t,e),a=await bu(e,s),u=yi(n),c=zs(n),d=Fs(n)==="y",{width:f,height:h}=r.floating;let g,m;u==="top"||u==="bottom"?(g=u,m=c===(await(i.isRTL==null?void 0:i.isRTL(o.floating))?"start":"end")?"left":"right"):(m=u,g=c==="end"?"top":"bottom");const w=h-a[g],v=f-a[m],y=!e.middlewareData.shift;let _=w,S=v;if(d){const $=f-a.left-a.right;S=c||y?go(v,$):$}else{const $=h-a.top-a.bottom;_=c||y?go(w,$):$}if(y&&!c){const $=jn(a.left,0),C=jn(a.right,0),N=jn(a.top,0),R=jn(a.bottom,0);d?S=f-2*($!==0||C!==0?$+C:jn(a.left,a.right)):_=h-2*(N!==0||R!==0?N+R:jn(a.top,a.bottom))}await l({...e,availableWidth:S,availableHeight:_});const E=await i.getDimensions(o.floating);return f!==E.width||h!==E.height?{reset:{rects:!0}}:{}}}};function yo(t){return UC(t)?(t.nodeName||"").toLowerCase():"#document"}function Un(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Ti(t){var e;return(e=(UC(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function UC(t){return t instanceof Node||t instanceof Un(t).Node}function xi(t){return t instanceof Element||t instanceof Un(t).Element}function Gr(t){return t instanceof HTMLElement||t instanceof Un(t).HTMLElement}function Kx(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Un(t).ShadowRoot}function Hu(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=ar(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!["inline","contents"].includes(i)}function Z5(t){return["table","td","th"].includes(yo(t))}function Uv(t){const e=Wv(),n=ar(t);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function G5(t){let e=xs(t);for(;Gr(e)&&!Bf(e);){if(Uv(e))return e;e=xs(e)}return null}function Wv(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Bf(t){return["html","body","#document"].includes(yo(t))}function ar(t){return Un(t).getComputedStyle(t)}function Uf(t){return xi(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function xs(t){if(yo(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Kx(t)&&t.host||Ti(t);return Kx(e)?e.host:e}function WC(t){const e=xs(t);return Bf(e)?t.ownerDocument?t.ownerDocument.body:t.body:Gr(e)&&Hu(e)?e:WC(e)}function $u(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=WC(t),o=i===((r=t.ownerDocument)==null?void 0:r.body),l=Un(i);return o?e.concat(l,l.visualViewport||[],Hu(i)?i:[],l.frameElement&&n?$u(l.frameElement):[]):e.concat(i,$u(i,[],n))}function VC(t){const e=ar(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=Gr(t),o=i?t.offsetWidth:n,l=i?t.offsetHeight:r,s=Jd(n)!==o||Jd(r)!==l;return s&&(n=o,r=l),{width:n,height:r,$:s}}function Vv(t){return xi(t)?t:t.contextElement}function rs(t){const e=Vv(t);if(!Gr(e))return vo(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:o}=VC(e);let l=(o?Jd(n.width):n.width)/r,s=(o?Jd(n.height):n.height)/i;return(!l||!Number.isFinite(l))&&(l=1),(!s||!Number.isFinite(s))&&(s=1),{x:l,y:s}}const Y5=vo(0);function HC(t){const e=Un(t);return!Wv()||!e.visualViewport?Y5:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function X5(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Un(t)?!1:e}function il(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),o=Vv(t);let l=vo(1);e&&(r?xi(r)&&(l=rs(r)):l=rs(t));const s=X5(o,n,r)?HC(o):vo(0);let a=(i.left+s.x)/l.x,u=(i.top+s.y)/l.y,c=i.width/l.x,d=i.height/l.y;if(o){const f=Un(o),h=r&&xi(r)?Un(r):r;let g=f.frameElement;for(;g&&r&&h!==f;){const m=rs(g),w=g.getBoundingClientRect(),v=ar(g),y=w.left+(g.clientLeft+parseFloat(v.paddingLeft))*m.x,_=w.top+(g.clientTop+parseFloat(v.paddingTop))*m.y;a*=m.x,u*=m.y,c*=m.x,d*=m.y,a+=y,u+=_,g=Un(g).frameElement}}return qd({width:c,height:d,x:a,y:u})}function J5(t){let{rect:e,offsetParent:n,strategy:r}=t;const i=Gr(n),o=Ti(n);if(n===o)return e;let l={scrollLeft:0,scrollTop:0},s=vo(1);const a=vo(0);if((i||!i&&r!=="fixed")&&((yo(n)!=="body"||Hu(o))&&(l=Uf(n)),Gr(n))){const u=il(n);s=rs(n),a.x=u.x+n.clientLeft,a.y=u.y+n.clientTop}return{width:e.width*s.x,height:e.height*s.y,x:e.x*s.x-l.scrollLeft*s.x+a.x,y:e.y*s.y-l.scrollTop*s.y+a.y}}function Q5(t){return Array.from(t.getClientRects())}function KC(t){return il(Ti(t)).left+Uf(t).scrollLeft}function q5(t){const e=Ti(t),n=Uf(t),r=t.ownerDocument.body,i=jn(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),o=jn(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+KC(t);const s=-n.scrollTop;return ar(r).direction==="rtl"&&(l+=jn(e.clientWidth,r.clientWidth)-i),{width:i,height:o,x:l,y:s}}function e4(t,e){const n=Un(t),r=Ti(t),i=n.visualViewport;let o=r.clientWidth,l=r.clientHeight,s=0,a=0;if(i){o=i.width,l=i.height;const u=Wv();(!u||u&&e==="fixed")&&(s=i.offsetLeft,a=i.offsetTop)}return{width:o,height:l,x:s,y:a}}function t4(t,e){const n=il(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,o=Gr(t)?rs(t):vo(1),l=t.clientWidth*o.x,s=t.clientHeight*o.y,a=i*o.x,u=r*o.y;return{width:l,height:s,x:a,y:u}}function Zx(t,e,n){let r;if(e==="viewport")r=e4(t,n);else if(e==="document")r=q5(Ti(t));else if(xi(e))r=t4(e,n);else{const i=HC(t);r={...e,x:e.x-i.x,y:e.y-i.y}}return qd(r)}function ZC(t,e){const n=xs(t);return n===e||!xi(n)||Bf(n)?!1:ar(n).position==="fixed"||ZC(n,e)}function n4(t,e){const n=e.get(t);if(n)return n;let r=$u(t,[],!1).filter(s=>xi(s)&&yo(s)!=="body"),i=null;const o=ar(t).position==="fixed";let l=o?xs(t):t;for(;xi(l)&&!Bf(l);){const s=ar(l),a=Uv(l);!a&&s.position==="fixed"&&(i=null),(o?!a&&!i:!a&&s.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Hu(l)&&!a&&ZC(t,l))?r=r.filter(c=>c!==l):i=s,l=xs(l)}return e.set(t,r),r}function r4(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const l=[...n==="clippingAncestors"?n4(e,this._c):[].concat(n),r],s=l[0],a=l.reduce((u,c)=>{const d=Zx(e,c,i);return u.top=jn(d.top,u.top),u.right=go(d.right,u.right),u.bottom=go(d.bottom,u.bottom),u.left=jn(d.left,u.left),u},Zx(e,s,i));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function i4(t){return VC(t)}function o4(t,e,n){const r=Gr(e),i=Ti(e),o=n==="fixed",l=il(t,!0,o,e);let s={scrollLeft:0,scrollTop:0};const a=vo(0);if(r||!r&&!o)if((yo(e)!=="body"||Hu(i))&&(s=Uf(e)),r){const u=il(e,!0,o,e);a.x=u.x+e.clientLeft,a.y=u.y+e.clientTop}else i&&(a.x=KC(i));return{x:l.left+s.scrollLeft-a.x,y:l.top+s.scrollTop-a.y,width:l.width,height:l.height}}function Gx(t,e){return!Gr(t)||ar(t).position==="fixed"?null:e?e(t):t.offsetParent}function GC(t,e){const n=Un(t);if(!Gr(t))return n;let r=Gx(t,e);for(;r&&Z5(r)&&ar(r).position==="static";)r=Gx(r,e);return r&&(yo(r)==="html"||yo(r)==="body"&&ar(r).position==="static"&&!Uv(r))?n:r||G5(t)||n}const l4=async function(t){let{reference:e,floating:n,strategy:r}=t;const i=this.getOffsetParent||GC,o=this.getDimensions;return{reference:o4(e,await i(n),r),floating:{x:0,y:0,...await o(n)}}};function s4(t){return ar(t).direction==="rtl"}const a4={convertOffsetParentRelativeRectToViewportRelativeRect:J5,getDocumentElement:Ti,getClippingRect:r4,getOffsetParent:GC,getElementRects:l4,getClientRects:Q5,getDimensions:i4,getScale:rs,isElement:xi,isRTL:s4};function u4(t,e){let n=null,r;const i=Ti(t);function o(){clearTimeout(r),n&&n.disconnect(),n=null}function l(s,a){s===void 0&&(s=!1),a===void 0&&(a=1),o();const{left:u,top:c,width:d,height:f}=t.getBoundingClientRect();if(s||e(),!d||!f)return;const h=Cc(c),g=Cc(i.clientWidth-(u+d)),m=Cc(i.clientHeight-(c+f)),w=Cc(u),y={rootMargin:-h+"px "+-g+"px "+-m+"px "+-w+"px",threshold:jn(0,go(1,a))||1};let _=!0;function S(E){const $=E[0].intersectionRatio;if($!==a){if(!_)return l();$?l(!1,$):r=setTimeout(()=>{l(!1,1e-7)},100)}_=!1}try{n=new IntersectionObserver(S,{...y,root:i.ownerDocument})}catch{n=new IntersectionObserver(S,y)}n.observe(t)}return l(!0),o}function c4(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:a=!1}=r,u=Vv(t),c=i||o?[...u?$u(u):[],...$u(e)]:[];c.forEach(v=>{i&&v.addEventListener("scroll",n,{passive:!0}),o&&v.addEventListener("resize",n)});const d=u&&s?u4(u,n):null;let f=-1,h=null;l&&(h=new ResizeObserver(v=>{let[y]=v;y&&y.target===u&&h&&(h.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{h&&h.observe(e)})),n()}),u&&!a&&h.observe(u),h.observe(e));let g,m=a?il(t):null;a&&w();function w(){const v=il(t);m&&(v.x!==m.x||v.y!==m.y||v.width!==m.width||v.height!==m.height)&&n(),m=v,g=requestAnimationFrame(w)}return n(),()=>{c.forEach(v=>{i&&v.removeEventListener("scroll",n),o&&v.removeEventListener("resize",n)}),d&&d(),h&&h.disconnect(),h=null,a&&cancelAnimationFrame(g)}}const d4=(t,e,n)=>{const r=new Map,i={platform:a4,...n},o={...i.platform,_c:r};return z5(t,e,{...i,platform:o})},f4=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:i}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?Wx({element:r.current,padding:i}).fn(n):{}:r?Wx({element:r,padding:i}).fn(n):{}}}};var Gc=typeof document<"u"?p.useLayoutEffect:p.useEffect;function ef(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,i;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(!ef(t[r],e[r]))return!1;return!0}if(i=Object.keys(t),n=i.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&t.$$typeof)&&!ef(t[o],e[o]))return!1}return!0}return t!==t&&e!==e}function YC(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Yx(t,e){const n=YC(t);return Math.round(e*n)/n}function Xx(t){const e=p.useRef(t);return Gc(()=>{e.current=t}),e}function h4(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:l}={},transform:s=!0,whileElementsMounted:a,open:u}=t,[c,d]=p.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[f,h]=p.useState(r);ef(f,r)||h(r);const[g,m]=p.useState(null),[w,v]=p.useState(null),y=p.useCallback(O=>{O!=$.current&&($.current=O,m(O))},[m]),_=p.useCallback(O=>{O!==C.current&&(C.current=O,v(O))},[v]),S=o||g,E=l||w,$=p.useRef(null),C=p.useRef(null),N=p.useRef(c),R=Xx(a),b=Xx(i),L=p.useCallback(()=>{if(!$.current||!C.current)return;const O={placement:e,strategy:n,middleware:f};b.current&&(O.platform=b.current),d4($.current,C.current,O).then(A=>{const k={...A,isPositioned:!0};F.current&&!ef(N.current,k)&&(N.current=k,Yr.flushSync(()=>{d(k)}))})},[f,e,n,b]);Gc(()=>{u===!1&&N.current.isPositioned&&(N.current.isPositioned=!1,d(O=>({...O,isPositioned:!1})))},[u]);const F=p.useRef(!1);Gc(()=>(F.current=!0,()=>{F.current=!1}),[]),Gc(()=>{if(S&&($.current=S),E&&(C.current=E),S&&E){if(R.current)return R.current(S,E,L);L()}},[S,E,L,R]);const le=p.useMemo(()=>({reference:$,floating:C,setReference:y,setFloating:_}),[y,_]),V=p.useMemo(()=>({reference:S,floating:E}),[S,E]),H=p.useMemo(()=>{const O={position:n,left:0,top:0};if(!V.floating)return O;const A=Yx(V.floating,c.x),k=Yx(V.floating,c.y);return s?{...O,transform:"translate("+A+"px, "+k+"px)",...YC(V.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:A,top:k}},[n,s,V.floating,c.x,c.y]);return p.useMemo(()=>({...c,update:L,refs:le,elements:V,floatingStyles:H}),[c,L,le,V,H])}function XC(t){const[e,n]=p.useState(void 0);return Vn(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let l,s;if("borderBoxSize"in o){const a=o.borderBoxSize,u=Array.isArray(a)?a[0]:a;l=u.inlineSize,s=u.blockSize}else l=t.offsetWidth,s=t.offsetHeight;n({width:l,height:s})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}const JC="Popper",[QC,qC]=al(JC),[p4,ek]=QC(JC),m4=t=>{const{__scopePopper:e,children:n}=t,[r,i]=p.useState(null);return p.createElement(p4,{scope:e,anchor:r,onAnchorChange:i},n)},g4="PopperAnchor",v4=p.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...i}=t,o=ek(g4,n),l=p.useRef(null),s=st(e,l);return p.useEffect(()=>{o.onAnchorChange((r==null?void 0:r.current)||l.current)}),r?null:p.createElement(Ke.div,ie({},i,{ref:s}))}),tk="PopperContent",[y4,NI]=QC(tk),x4=p.forwardRef((t,e)=>{var n,r,i,o,l,s,a,u;const{__scopePopper:c,side:d="bottom",sideOffset:f=0,align:h="center",alignOffset:g=0,arrowPadding:m=0,avoidCollisions:w=!0,collisionBoundary:v=[],collisionPadding:y=0,sticky:_="partial",hideWhenDetached:S=!1,updatePositionStrategy:E="optimized",onPlaced:$,...C}=t,N=ek(tk,c),[R,b]=p.useState(null),L=st(e,Sn=>b(Sn)),[F,le]=p.useState(null),V=XC(F),H=(n=V==null?void 0:V.width)!==null&&n!==void 0?n:0,O=(r=V==null?void 0:V.height)!==null&&r!==void 0?r:0,A=d+(h!=="center"?"-"+h:""),k=typeof y=="number"?y:{top:0,right:0,bottom:0,left:0,...y},j=Array.isArray(v)?v:[v],I=j.length>0,Z={padding:k,boundary:j.filter(_4),altBoundary:I},{refs:ne,floatingStyles:ke,placement:ye,isPositioned:We,middlewareData:Fe}=h4({strategy:"fixed",placement:A,whileElementsMounted:(...Sn)=>c4(...Sn,{animationFrame:E==="always"}),elements:{reference:N.anchor},middleware:[W5({mainAxis:f+O,alignmentAxis:g}),w&&V5({mainAxis:!0,crossAxis:!1,limiter:_==="partial"?H5():void 0,...Z}),w&&F5({...Z}),K5({...Z,apply:({elements:Sn,rects:cr,availableWidth:je,availableHeight:Tt})=>{const{width:at,height:ln}=cr.reference,En=Sn.floating.style;En.setProperty("--radix-popper-available-width",`${je}px`),En.setProperty("--radix-popper-available-height",`${Tt}px`),En.setProperty("--radix-popper-anchor-width",`${at}px`),En.setProperty("--radix-popper-anchor-height",`${ln}px`)}}),F&&f4({element:F,padding:m}),w4({arrowWidth:H,arrowHeight:O}),S&&B5({strategy:"referenceHidden",...Z})]}),[te,Ie]=nk(ye),$e=en($);Vn(()=>{We&&($e==null||$e())},[We,$e]);const Re=(i=Fe.arrow)===null||i===void 0?void 0:i.x,Se=(o=Fe.arrow)===null||o===void 0?void 0:o.y,Le=((l=Fe.arrow)===null||l===void 0?void 0:l.centerOffset)!==0,[Je,Wt]=p.useState();return Vn(()=>{R&&Wt(window.getComputedStyle(R).zIndex)},[R]),p.createElement("div",{ref:ne.setFloating,"data-radix-popper-content-wrapper":"",style:{...ke,transform:We?ke.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Je,"--radix-popper-transform-origin":[(s=Fe.transformOrigin)===null||s===void 0?void 0:s.x,(a=Fe.transformOrigin)===null||a===void 0?void 0:a.y].join(" ")},dir:t.dir},p.createElement(y4,{scope:c,placedSide:te,onArrowChange:le,arrowX:Re,arrowY:Se,shouldHideArrow:Le},p.createElement(Ke.div,ie({"data-side":te,"data-align":Ie},C,{ref:L,style:{...C.style,animation:We?void 0:"none",opacity:(u=Fe.hide)!==null&&u!==void 0&&u.referenceHidden?0:void 0}}))))});function _4(t){return t!==null}const w4=t=>({name:"transformOrigin",options:t,fn(e){var n,r,i,o,l;const{placement:s,rects:a,middlewareData:u}=e,d=((n=u.arrow)===null||n===void 0?void 0:n.centerOffset)!==0,f=d?0:t.arrowWidth,h=d?0:t.arrowHeight,[g,m]=nk(s),w={start:"0%",center:"50%",end:"100%"}[m],v=((r=(i=u.arrow)===null||i===void 0?void 0:i.x)!==null&&r!==void 0?r:0)+f/2,y=((o=(l=u.arrow)===null||l===void 0?void 0:l.y)!==null&&o!==void 0?o:0)+h/2;let _="",S="";return g==="bottom"?(_=d?w:`${v}px`,S=`${-h}px`):g==="top"?(_=d?w:`${v}px`,S=`${a.floating.height+h}px`):g==="right"?(_=`${-h}px`,S=d?w:`${y}px`):g==="left"&&(_=`${a.floating.width+h}px`,S=d?w:`${y}px`),{data:{x:_,y:S}}}});function nk(t){const[e,n="center"]=t.split("-");return[e,n]}const S4=m4,E4=v4,C4=x4,k4=p.forwardRef((t,e)=>{var n;const{container:r=globalThis==null||(n=globalThis.document)===null||n===void 0?void 0:n.body,...i}=t;return r?Bw.createPortal(p.createElement(Ke.div,ie({},i,{ref:e})),r):null});function _s({prop:t,defaultProp:e,onChange:n=()=>{}}){const[r,i]=b4({defaultProp:e,onChange:n}),o=t!==void 0,l=o?t:r,s=en(n),a=p.useCallback(u=>{if(o){const d=typeof u=="function"?u(t):u;d!==t&&s(d)}else i(u)},[o,t,i,s]);return[l,a]}function b4({defaultProp:t,onChange:e}){const n=p.useState(t),[r]=n,i=p.useRef(r),o=en(e);return p.useEffect(()=>{i.current!==r&&(o(r),i.current=r)},[r,i,o]),n}function rk(t){const e=p.useRef({value:t,previous:t});return p.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}const $4=p.forwardRef((t,e)=>p.createElement(Ke.span,ie({},t,{ref:e,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...t.style}})));var T4=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},kl=new WeakMap,kc=new WeakMap,bc={},Kh=0,ik=function(t){return t&&(t.host||ik(t.parentNode))},N4=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=ik(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})},R4=function(t,e,n,r){var i=N4(e,Array.isArray(t)?t:[t]);bc[n]||(bc[n]=new WeakMap);var o=bc[n],l=[],s=new Set,a=new Set(i),u=function(d){!d||s.has(d)||(s.add(d),u(d.parentNode))};i.forEach(u);var c=function(d){!d||a.has(d)||Array.prototype.forEach.call(d.children,function(f){if(s.has(f))c(f);else{var h=f.getAttribute(r),g=h!==null&&h!=="false",m=(kl.get(f)||0)+1,w=(o.get(f)||0)+1;kl.set(f,m),o.set(f,w),l.push(f),m===1&&g&&kc.set(f,!0),w===1&&f.setAttribute(n,"true"),g||f.setAttribute(r,"true")}})};return c(e),s.clear(),Kh++,function(){l.forEach(function(d){var f=kl.get(d)-1,h=o.get(d)-1;kl.set(d,f),o.set(d,h),f||(kc.has(d)||d.removeAttribute(r),kc.delete(d)),h||d.removeAttribute(n)}),Kh--,Kh||(kl=new WeakMap,kl=new WeakMap,kc=new WeakMap,bc={})}},O4=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),i=e||T4(t);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),R4(r,i,n,"aria-hidden")):function(){return null}},Dr=function(){return Dr=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Dr.apply(this,arguments)};function ok(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 i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}function P4(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))}var Yc="right-scroll-bar-position",Xc="width-before-scroll-bar",A4="with-scroll-bars-hidden",M4="--removed-body-scroll-bar-size";function L4(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function D4(t,e){var n=p.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=e,n.facade}function I4(t,e){return D4(e||null,function(n){return t.forEach(function(r){return L4(r,n)})})}function j4(t){return t}function z4(t,e){e===void 0&&(e=j4);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(o){var l=e(o,r);return n.push(l),function(){n=n.filter(function(s){return s!==l})}},assignSyncMedium:function(o){for(r=!0;n.length;){var l=n;n=[],l.forEach(o)}n={push:function(s){return o(s)},filter:function(){return n}}},assignMedium:function(o){r=!0;var l=[];if(n.length){var s=n;n=[],s.forEach(o),l=n}var a=function(){var c=l;l=[],c.forEach(o)},u=function(){return Promise.resolve().then(a)};u(),n={push:function(c){l.push(c),u()},filter:function(c){return l=l.filter(c),n}}}};return i}function F4(t){t===void 0&&(t={});var e=z4(null);return e.options=Dr({async:!0,ssr:!1},t),e}var lk=function(t){var e=t.sideCar,n=ok(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 p.createElement(r,Dr({},n))};lk.isSideCarExport=!0;function B4(t,e){return t.useMedium(e),lk}var sk=F4(),Zh=function(){},Wf=p.forwardRef(function(t,e){var n=p.useRef(null),r=p.useState({onScrollCapture:Zh,onWheelCapture:Zh,onTouchMoveCapture:Zh}),i=r[0],o=r[1],l=t.forwardProps,s=t.children,a=t.className,u=t.removeScrollBar,c=t.enabled,d=t.shards,f=t.sideCar,h=t.noIsolation,g=t.inert,m=t.allowPinchZoom,w=t.as,v=w===void 0?"div":w,y=ok(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),_=f,S=I4([n,e]),E=Dr(Dr({},y),i);return p.createElement(p.Fragment,null,c&&p.createElement(_,{sideCar:sk,removeScrollBar:u,shards:d,noIsolation:h,inert:g,setCallbacks:o,allowPinchZoom:!!m,lockRef:n}),l?p.cloneElement(p.Children.only(s),Dr(Dr({},E),{ref:S})):p.createElement(v,Dr({},E,{className:a,ref:S}),s))});Wf.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Wf.classNames={fullWidth:Xc,zeroRight:Yc};var Jx,U4=function(){if(Jx)return Jx;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function W4(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=U4();return e&&t.setAttribute("nonce",e),t}function V4(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function H4(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var K4=function(){var t=0,e=null;return{add:function(n){t==0&&(e=W4())&&(V4(e,n),H4(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},Z4=function(){var t=K4();return function(e,n){p.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},ak=function(){var t=Z4(),e=function(n){var r=n.styles,i=n.dynamic;return t(r,i),null};return e},G4={left:0,top:0,right:0,gap:0},Gh=function(t){return parseInt(t||"",10)||0},Y4=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],r=e[t==="padding"?"paddingTop":"marginTop"],i=e[t==="padding"?"paddingRight":"marginRight"];return[Gh(n),Gh(r),Gh(i)]},X4=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return G4;var e=Y4(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])}},J4=ak(),Q4=function(t,e,n,r){var i=t.left,o=t.top,l=t.right,s=t.gap;return n===void 0&&(n="margin"),`
|
|
130
130
|
.`.concat(A4,` {
|
|
131
131
|
overflow: hidden `).concat(r,`;
|
|
132
132
|
padding-right: `).concat(s,"px ").concat(r,`;
|
|
@@ -163,10 +163,10 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
163
163
|
body {
|
|
164
164
|
`).concat(M4,": ").concat(s,`px;
|
|
165
165
|
}
|
|
166
|
-
`)},q4=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,i=r===void 0?"margin":r,o=p.useMemo(function(){return X4(i)},[i]);return p.createElement(J4,{styles:Q4(o,!e,i,n?"":"!important")})},Vm=!1;if(typeof window<"u")try{var $c=Object.defineProperty({},"passive",{get:function(){return Vm=!0,!0}});window.addEventListener("test",$c,$c),window.removeEventListener("test",$c,$c)}catch{Vm=!1}var
|
|
166
|
+
`)},q4=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,i=r===void 0?"margin":r,o=p.useMemo(function(){return X4(i)},[i]);return p.createElement(J4,{styles:Q4(o,!e,i,n?"":"!important")})},Vm=!1;if(typeof window<"u")try{var $c=Object.defineProperty({},"passive",{get:function(){return Vm=!0,!0}});window.addEventListener("test",$c,$c),window.removeEventListener("test",$c,$c)}catch{Vm=!1}var bl=Vm?{passive:!1}:!1,e3=function(t){return t.tagName==="TEXTAREA"},uk=function(t,e){var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!e3(t)&&n[e]==="visible")},t3=function(t){return uk(t,"overflowY")},n3=function(t){return uk(t,"overflowX")},Qx=function(t,e){var n=e;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=ck(t,n);if(r){var i=dk(t,n),o=i[1],l=i[2];if(o>l)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},r3=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},i3=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},ck=function(t,e){return t==="v"?t3(e):n3(e)},dk=function(t,e){return t==="v"?r3(e):i3(e)},o3=function(t,e){return t==="h"&&e==="rtl"?-1:1},l3=function(t,e,n,r,i){var o=o3(t,window.getComputedStyle(e).direction),l=o*r,s=n.target,a=e.contains(s),u=!1,c=l>0,d=0,f=0;do{var h=dk(t,s),g=h[0],m=h[1],w=h[2],v=m-w-o*g;(g||v)&&ck(t,s)&&(d+=v,f+=g),s=s.parentNode}while(!a&&s!==document.body||a&&(e.contains(s)||e===s));return(c&&(i&&d===0||!i&&l>d)||!c&&(i&&f===0||!i&&-l>f))&&(u=!0),u},Tc=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},qx=function(t){return[t.deltaX,t.deltaY]},e_=function(t){return t&&"current"in t?t.current:t},s3=function(t,e){return t[0]===e[0]&&t[1]===e[1]},a3=function(t){return`
|
|
167
167
|
.block-interactivity-`.concat(t,` {pointer-events: none;}
|
|
168
168
|
.allow-interactivity-`).concat(t,` {pointer-events: all;}
|
|
169
|
-
`)},u3=0,bl=[];function c3(t){var e=p.useRef([]),n=p.useRef([0,0]),r=p.useRef(),i=p.useState(u3++)[0],o=p.useState(function(){return ak()})[0],l=p.useRef(t);p.useEffect(function(){l.current=t},[t]),p.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(i));var m=P4([t.lockRef.current],(t.shards||[]).map(e_),!0).filter(Boolean);return m.forEach(function(w){return w.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),m.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(i))})}}},[t.inert,t.lockRef.current,t.shards]);var s=p.useCallback(function(m,w){if("touches"in m&&m.touches.length===2)return!l.current.allowPinchZoom;var v=Tc(m),y=n.current,_="deltaX"in m?m.deltaX:y[0]-v[0],S="deltaY"in m?m.deltaY:y[1]-v[1],E,$=m.target,C=Math.abs(_)>Math.abs(S)?"h":"v";if("touches"in m&&C==="h"&&$.type==="range")return!1;var N=Qx(C,$);if(!N)return!0;if(N?E=C:(E=C==="v"?"h":"v",N=Qx(C,$)),!N)return!1;if(!r.current&&"changedTouches"in m&&(_||S)&&(r.current=E),!E)return!0;var R=r.current||E;return l3(R,w,m,R==="h"?_:S,!0)},[]),a=p.useCallback(function(m){var w=m;if(!(!bl.length||bl[bl.length-1]!==o)){var v="deltaY"in w?qx(w):Tc(w),y=e.current.filter(function(E){return E.name===w.type&&E.target===w.target&&s3(E.delta,v)})[0];if(y&&y.should){w.cancelable&&w.preventDefault();return}if(!y){var _=(l.current.shards||[]).map(e_).filter(Boolean).filter(function(E){return E.contains(w.target)}),S=_.length>0?s(w,_[0]):!l.current.noIsolation;S&&w.cancelable&&w.preventDefault()}}},[]),u=p.useCallback(function(m,w,v,y){var _={name:m,delta:w,target:v,should:y};e.current.push(_),setTimeout(function(){e.current=e.current.filter(function(S){return S!==_})},1)},[]),c=p.useCallback(function(m){n.current=Tc(m),r.current=void 0},[]),d=p.useCallback(function(m){u(m.type,qx(m),m.target,s(m,t.lockRef.current))},[]),f=p.useCallback(function(m){u(m.type,Tc(m),m.target,s(m,t.lockRef.current))},[]);p.useEffect(function(){return bl.push(o),t.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",a,kl),document.addEventListener("touchmove",a,kl),document.addEventListener("touchstart",c,kl),function(){bl=bl.filter(function(m){return m!==o}),document.removeEventListener("wheel",a,kl),document.removeEventListener("touchmove",a,kl),document.removeEventListener("touchstart",c,kl)}},[]);var h=t.removeScrollBar,g=t.inert;return p.createElement(p.Fragment,null,g?p.createElement(o,{styles:a3(i)}):null,h?p.createElement(q4,{gapMode:"margin"}):null)}const d3=B4(sk,c3);var fk=p.forwardRef(function(t,e){return p.createElement(Wf,Dr({},t,{ref:e,sideCar:d3}))});fk.classNames=Wf.classNames;const f3=fk,h3=[" ","Enter","ArrowUp","ArrowDown"],p3=[" ","Enter"],Vf="Select",[Hf,Hv,m3]=jC(Vf),[Fs,RI]=al(Vf,[m3,qC]),Kv=qC(),[g3,hl]=Fs(Vf),[v3,y3]=Fs(Vf),x3=t=>{const{__scopeSelect:e,children:n,open:r,defaultOpen:i,onOpenChange:o,value:l,defaultValue:s,onValueChange:a,dir:u,name:c,autoComplete:d,disabled:f,required:h}=t,g=Kv(e),[m,w]=p.useState(null),[v,y]=p.useState(null),[_,S]=p.useState(!1),E=Yg(u),[$=!1,C]=xs({prop:r,defaultProp:i,onChange:o}),[N,R]=xs({prop:l,defaultProp:s,onChange:a}),b=p.useRef(null),L=m?!!m.closest("form"):!0,[F,le]=p.useState(new Set),V=Array.from(F).map(H=>H.props.value).join(";");return p.createElement(S4,g,p.createElement(g3,{required:h,scope:e,trigger:m,onTriggerChange:w,valueNode:v,onValueNodeChange:y,valueNodeHasChildren:_,onValueNodeHasChildrenChange:S,contentId:Ff(),value:N,onValueChange:R,open:$,onOpenChange:C,dir:E,triggerPointerDownPosRef:b,disabled:f},p.createElement(Hf.Provider,{scope:e},p.createElement(v3,{scope:t.__scopeSelect,onNativeOptionAdd:p.useCallback(H=>{le(O=>new Set(O).add(H))},[]),onNativeOptionRemove:p.useCallback(H=>{le(O=>{const A=new Set(O);return A.delete(H),A})},[])},n)),L?p.createElement(gk,{key:V,"aria-hidden":!0,required:h,tabIndex:-1,name:c,autoComplete:d,value:N,onChange:H=>R(H.target.value),disabled:f},N===void 0?p.createElement("option",{value:""}):null,Array.from(F)):null))},_3="SelectTrigger",w3=p.forwardRef((t,e)=>{const{__scopeSelect:n,disabled:r=!1,...i}=t,o=Kv(n),l=hl(_3,n),s=l.disabled||r,a=st(e,l.onTriggerChange),u=Hv(n),[c,d,f]=vk(g=>{const m=u().filter(y=>!y.disabled),w=m.find(y=>y.value===l.value),v=yk(m,g,w);v!==void 0&&l.onValueChange(v.value)}),h=()=>{s||(l.onOpenChange(!0),f())};return p.createElement(E4,ie({asChild:!0},o),p.createElement(Ke.button,ie({type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:s,"data-disabled":s?"":void 0,"data-placeholder":mk(l.value)?"":void 0},i,{ref:a,onClick:nt(i.onClick,g=>{g.currentTarget.focus()}),onPointerDown:nt(i.onPointerDown,g=>{const m=g.target;m.hasPointerCapture(g.pointerId)&&m.releasePointerCapture(g.pointerId),g.button===0&&g.ctrlKey===!1&&(h(),l.triggerPointerDownPosRef.current={x:Math.round(g.pageX),y:Math.round(g.pageY)},g.preventDefault())}),onKeyDown:nt(i.onKeyDown,g=>{const m=c.current!=="";!(g.ctrlKey||g.altKey||g.metaKey)&&g.key.length===1&&d(g.key),!(m&&g.key===" ")&&h3.includes(g.key)&&(h(),g.preventDefault())})})))}),S3="SelectValue",E3=p.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:l="",...s}=t,a=hl(S3,n),{onValueNodeHasChildrenChange:u}=a,c=o!==void 0,d=st(e,a.onValueNodeChange);return Vn(()=>{u(c)},[u,c]),p.createElement(Ke.span,ie({},s,{ref:d,style:{pointerEvents:"none"}}),mk(a.value)?p.createElement(p.Fragment,null,l):o)}),C3=p.forwardRef((t,e)=>{const{__scopeSelect:n,children:r,...i}=t;return p.createElement(Ke.span,ie({"aria-hidden":!0},i,{ref:e}),r||"▼")}),k3=t=>p.createElement(k4,ie({asChild:!0},t)),_s="SelectContent",b3=p.forwardRef((t,e)=>{const n=hl(_s,t.__scopeSelect),[r,i]=p.useState();if(Vn(()=>{i(new DocumentFragment)},[]),!n.open){const o=r;return o?Yr.createPortal(p.createElement(hk,{scope:t.__scopeSelect},p.createElement(Hf.Slot,{scope:t.__scopeSelect},p.createElement("div",null,t.children))),o):null}return p.createElement($3,ie({},t,{ref:e}))}),ii=10,[hk,Kf]=Fs(_s),$3=p.forwardRef((t,e)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:l,side:s,sideOffset:a,align:u,alignOffset:c,arrowPadding:d,collisionBoundary:f,collisionPadding:h,sticky:g,hideWhenDetached:m,avoidCollisions:w,...v}=t,y=hl(_s,n),[_,S]=p.useState(null),[E,$]=p.useState(null),C=st(e,te=>S(te)),[N,R]=p.useState(null),[b,L]=p.useState(null),F=Hv(n),[le,V]=p.useState(!1),H=p.useRef(!1);p.useEffect(()=>{if(_)return O4(_)},[_]),w5();const O=p.useCallback(te=>{const[Ie,...$e]=F().map(Le=>Le.ref.current),[Re]=$e.slice(-1),Se=document.activeElement;for(const Le of te)if(Le===Se||(Le==null||Le.scrollIntoView({block:"nearest"}),Le===Ie&&E&&(E.scrollTop=0),Le===Re&&E&&(E.scrollTop=E.scrollHeight),Le==null||Le.focus(),document.activeElement!==Se))return},[F,E]),A=p.useCallback(()=>O([N,_]),[O,N,_]);p.useEffect(()=>{le&&A()},[le,A]);const{onOpenChange:k,triggerPointerDownPosRef:j}=y;p.useEffect(()=>{if(_){let te={x:0,y:0};const Ie=Re=>{var Se,Le,Je,Wt;te={x:Math.abs(Math.round(Re.pageX)-((Se=(Le=j.current)===null||Le===void 0?void 0:Le.x)!==null&&Se!==void 0?Se:0)),y:Math.abs(Math.round(Re.pageY)-((Je=(Wt=j.current)===null||Wt===void 0?void 0:Wt.y)!==null&&Je!==void 0?Je:0))}},$e=Re=>{te.x<=10&&te.y<=10?Re.preventDefault():_.contains(Re.target)||k(!1),document.removeEventListener("pointermove",Ie),j.current=null};return j.current!==null&&(document.addEventListener("pointermove",Ie),document.addEventListener("pointerup",$e,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Ie),document.removeEventListener("pointerup",$e,{capture:!0})}}},[_,k,j]),p.useEffect(()=>{const te=()=>k(!1);return window.addEventListener("blur",te),window.addEventListener("resize",te),()=>{window.removeEventListener("blur",te),window.removeEventListener("resize",te)}},[k]);const[I,Z]=vk(te=>{const Ie=F().filter(Se=>!Se.disabled),$e=Ie.find(Se=>Se.ref.current===document.activeElement),Re=yk(Ie,te,$e);Re&&setTimeout(()=>Re.ref.current.focus())}),ne=p.useCallback((te,Ie,$e)=>{const Re=!H.current&&!$e;(y.value!==void 0&&y.value===Ie||Re)&&(R(te),Re&&(H.current=!0))},[y.value]),ke=p.useCallback(()=>_==null?void 0:_.focus(),[_]),ye=p.useCallback((te,Ie,$e)=>{const Re=!H.current&&!$e;(y.value!==void 0&&y.value===Ie||Re)&&L(te)},[y.value]),We=r==="popper"?t_:T3,Fe=We===t_?{side:s,sideOffset:a,align:u,alignOffset:c,arrowPadding:d,collisionBoundary:f,collisionPadding:h,sticky:g,hideWhenDetached:m,avoidCollisions:w}:{};return p.createElement(hk,{scope:n,content:_,viewport:E,onViewportChange:$,itemRefCallback:ne,selectedItem:N,onItemLeave:ke,itemTextRefCallback:ye,focusSelectedItem:A,selectedItemText:b,position:r,isPositioned:le,searchRef:I},p.createElement(f3,{as:fs,allowPinchZoom:!0},p.createElement(S5,{asChild:!0,trapped:y.open,onMountAutoFocus:te=>{te.preventDefault()},onUnmountAutoFocus:nt(i,te=>{var Ie;(Ie=y.trigger)===null||Ie===void 0||Ie.focus({preventScroll:!0}),te.preventDefault()})},p.createElement(y5,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:te=>te.preventDefault(),onDismiss:()=>y.onOpenChange(!1)},p.createElement(We,ie({role:"listbox",id:y.contentId,"data-state":y.open?"open":"closed",dir:y.dir,onContextMenu:te=>te.preventDefault()},v,Fe,{onPlaced:()=>V(!0),ref:C,style:{display:"flex",flexDirection:"column",outline:"none",...v.style},onKeyDown:nt(v.onKeyDown,te=>{const Ie=te.ctrlKey||te.altKey||te.metaKey;if(te.key==="Tab"&&te.preventDefault(),!Ie&&te.key.length===1&&Z(te.key),["ArrowUp","ArrowDown","Home","End"].includes(te.key)){let Re=F().filter(Se=>!Se.disabled).map(Se=>Se.ref.current);if(["ArrowUp","End"].includes(te.key)&&(Re=Re.slice().reverse()),["ArrowUp","ArrowDown"].includes(te.key)){const Se=te.target,Le=Re.indexOf(Se);Re=Re.slice(Le+1)}setTimeout(()=>O(Re)),te.preventDefault()}})}))))))}),T3=p.forwardRef((t,e)=>{const{__scopeSelect:n,onPlaced:r,...i}=t,o=hl(_s,n),l=Kf(_s,n),[s,a]=p.useState(null),[u,c]=p.useState(null),d=st(e,C=>c(C)),f=Hv(n),h=p.useRef(!1),g=p.useRef(!0),{viewport:m,selectedItem:w,selectedItemText:v,focusSelectedItem:y}=l,_=p.useCallback(()=>{if(o.trigger&&o.valueNode&&s&&u&&m&&w&&v){const C=o.trigger.getBoundingClientRect(),N=u.getBoundingClientRect(),R=o.valueNode.getBoundingClientRect(),b=v.getBoundingClientRect();if(o.dir!=="rtl"){const Se=b.left-N.left,Le=R.left-Se,Je=C.left-Le,Wt=C.width+Je,Sn=Math.max(Wt,N.width),cr=window.innerWidth-ii,je=Jp(Le,[ii,cr-Sn]);s.style.minWidth=Wt+"px",s.style.left=je+"px"}else{const Se=N.right-b.right,Le=window.innerWidth-R.right-Se,Je=window.innerWidth-C.right-Le,Wt=C.width+Je,Sn=Math.max(Wt,N.width),cr=window.innerWidth-ii,je=Jp(Le,[ii,cr-Sn]);s.style.minWidth=Wt+"px",s.style.right=je+"px"}const L=f(),F=window.innerHeight-ii*2,le=m.scrollHeight,V=window.getComputedStyle(u),H=parseInt(V.borderTopWidth,10),O=parseInt(V.paddingTop,10),A=parseInt(V.borderBottomWidth,10),k=parseInt(V.paddingBottom,10),j=H+O+le+k+A,I=Math.min(w.offsetHeight*5,j),Z=window.getComputedStyle(m),ne=parseInt(Z.paddingTop,10),ke=parseInt(Z.paddingBottom,10),ye=C.top+C.height/2-ii,We=F-ye,Fe=w.offsetHeight/2,te=w.offsetTop+Fe,Ie=H+O+te,$e=j-Ie;if(Ie<=ye){const Se=w===L[L.length-1].ref.current;s.style.bottom="0px";const Le=u.clientHeight-m.offsetTop-m.offsetHeight,Je=Math.max(We,Fe+(Se?ke:0)+Le+A),Wt=Ie+Je;s.style.height=Wt+"px"}else{const Se=w===L[0].ref.current;s.style.top="0px";const Je=Math.max(ye,H+m.offsetTop+(Se?ne:0)+Fe)+$e;s.style.height=Je+"px",m.scrollTop=Ie-ye+m.offsetTop}s.style.margin=`${ii}px 0`,s.style.minHeight=I+"px",s.style.maxHeight=F+"px",r==null||r(),requestAnimationFrame(()=>h.current=!0)}},[f,o.trigger,o.valueNode,s,u,m,w,v,o.dir,r]);Vn(()=>_(),[_]);const[S,E]=p.useState();Vn(()=>{u&&E(window.getComputedStyle(u).zIndex)},[u]);const $=p.useCallback(C=>{C&&g.current===!0&&(_(),y==null||y(),g.current=!1)},[_,y]);return p.createElement(N3,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:h,onScrollButtonChange:$},p.createElement("div",{ref:a,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S}},p.createElement(Ke.div,ie({},i,{ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}}))))}),t_=p.forwardRef((t,e)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=ii,...o}=t,l=Kv(n);return p.createElement(C4,ie({},l,o,{ref:e,align:r,collisionPadding:i,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}}))}),[N3,R3]=Fs(_s,{}),n_="SelectViewport",O3=p.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,i=Kf(n_,n),o=R3(n_,n),l=st(e,i.onViewportChange),s=p.useRef(0);return p.createElement(p.Fragment,null,p.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"}}),p.createElement(Hf.Slot,{scope:n},p.createElement(Ke.div,ie({"data-radix-select-viewport":"",role:"presentation"},r,{ref:l,style:{position:"relative",flex:1,overflow:"auto",...r.style},onScroll:nt(r.onScroll,a=>{const u=a.currentTarget,{contentWrapper:c,shouldExpandOnScrollRef:d}=o;if(d!=null&&d.current&&c){const f=Math.abs(s.current-u.scrollTop);if(f>0){const h=window.innerHeight-ii*2,g=parseFloat(c.style.minHeight),m=parseFloat(c.style.height),w=Math.max(g,m);if(w<h){const v=w+f,y=Math.min(h,v),_=v-y;c.style.height=y+"px",c.style.bottom==="0px"&&(u.scrollTop=_>0?_:0,c.style.justifyContent="flex-end")}}}s.current=u.scrollTop})}))))}),P3="SelectGroup",[OI,A3]=Fs(P3),M3="SelectLabel",L3=p.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,i=A3(M3,n);return p.createElement(Ke.div,ie({id:i.id},r,{ref:e}))}),Hm="SelectItem",[D3,pk]=Fs(Hm),I3=p.forwardRef((t,e)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...l}=t,s=hl(Hm,n),a=Kf(Hm,n),u=s.value===r,[c,d]=p.useState(o??""),[f,h]=p.useState(!1),g=st(e,v=>{var y;return(y=a.itemRefCallback)===null||y===void 0?void 0:y.call(a,v,r,i)}),m=Ff(),w=()=>{i||(s.onValueChange(r),s.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return p.createElement(D3,{scope:n,value:r,disabled:i,textId:m,isSelected:u,onItemTextChange:p.useCallback(v=>{d(y=>{var _;return y||((_=v==null?void 0:v.textContent)!==null&&_!==void 0?_:"").trim()})},[])},p.createElement(Hf.ItemSlot,{scope:n,value:r,disabled:i,textValue:c},p.createElement(Ke.div,ie({role:"option","aria-labelledby":m,"data-highlighted":f?"":void 0,"aria-selected":u&&f,"data-state":u?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1},l,{ref:g,onFocus:nt(l.onFocus,()=>h(!0)),onBlur:nt(l.onBlur,()=>h(!1)),onPointerUp:nt(l.onPointerUp,w),onPointerMove:nt(l.onPointerMove,v=>{if(i){var y;(y=a.onItemLeave)===null||y===void 0||y.call(a)}else v.currentTarget.focus({preventScroll:!0})}),onPointerLeave:nt(l.onPointerLeave,v=>{if(v.currentTarget===document.activeElement){var y;(y=a.onItemLeave)===null||y===void 0||y.call(a)}}),onKeyDown:nt(l.onKeyDown,v=>{var y;((y=a.searchRef)===null||y===void 0?void 0:y.current)!==""&&v.key===" "||(p3.includes(v.key)&&w(),v.key===" "&&v.preventDefault())})}))))}),Nc="SelectItemText",j3=p.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:i,...o}=t,l=hl(Nc,n),s=Kf(Nc,n),a=pk(Nc,n),u=y3(Nc,n),[c,d]=p.useState(null),f=st(e,v=>d(v),a.onItemTextChange,v=>{var y;return(y=s.itemTextRefCallback)===null||y===void 0?void 0:y.call(s,v,a.value,a.disabled)}),h=c==null?void 0:c.textContent,g=p.useMemo(()=>p.createElement("option",{key:a.value,value:a.value,disabled:a.disabled},h),[a.disabled,a.value,h]),{onNativeOptionAdd:m,onNativeOptionRemove:w}=u;return Vn(()=>(m(g),()=>w(g)),[m,w,g]),p.createElement(p.Fragment,null,p.createElement(Ke.span,ie({id:a.textId},o,{ref:f})),a.isSelected&&l.valueNode&&!l.valueNodeHasChildren?Yr.createPortal(o.children,l.valueNode):null)}),z3="SelectItemIndicator",F3=p.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return pk(z3,n).isSelected?p.createElement(Ke.span,ie({"aria-hidden":!0},r,{ref:e})):null}),B3=p.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return p.createElement(Ke.div,ie({"aria-hidden":!0},r,{ref:e}))});function mk(t){return t===""||t===void 0}const gk=p.forwardRef((t,e)=>{const{value:n,...r}=t,i=p.useRef(null),o=st(e,i),l=rk(n);return p.useEffect(()=>{const s=i.current,a=window.HTMLSelectElement.prototype,c=Object.getOwnPropertyDescriptor(a,"value").set;if(l!==n&&c){const d=new Event("change",{bubbles:!0});c.call(s,n),s.dispatchEvent(d)}},[l,n]),p.createElement($4,{asChild:!0},p.createElement("select",ie({},r,{ref:o,defaultValue:n})))});gk.displayName="BubbleSelect";function vk(t){const e=en(t),n=p.useRef(""),r=p.useRef(0),i=p.useCallback(l=>{const s=n.current+l;e(s),function a(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>a(""),1e3))}(s)},[e]),o=p.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return p.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}function yk(t,e,n){const i=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,o=n?t.indexOf(n):-1;let l=U3(t,Math.max(o,0));i.length===1&&(l=l.filter(u=>u!==n));const a=l.find(u=>u.textValue.toLowerCase().startsWith(i.toLowerCase()));return a!==n?a:void 0}function U3(t,e){return t.map((n,r)=>t[(e+r)%t.length])}const W3=x3,xk=w3,V3=E3,H3=C3,K3=k3,_k=b3,Z3=O3,wk=L3,Sk=I3,G3=j3,Y3=F3,Ek=B3,Ck=W3,kk=V3,Zv=p.forwardRef(({className:t,children:e,...n},r)=>x.jsxs(xk,{ref:r,className:xt("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),...n,children:[e,x.jsx(H3,{asChild:!0,children:x.jsx(wS,{className:"w-4 h-4 opacity-50"})})]}));Zv.displayName=xk.displayName;const Gv=p.forwardRef(({className:t,children:e,position:n="popper",...r},i)=>x.jsx(K3,{children:x.jsx(_k,{ref:i,className:xt("relative z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:n,...r,children:x.jsx(Z3,{className:xt("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e})})}));Gv.displayName=_k.displayName;const X3=p.forwardRef(({className:t,...e},n)=>x.jsx(wk,{ref:n,className:xt("py-1.5 pl-8 pr-2 text-sm font-semibold",t),...e}));X3.displayName=wk.displayName;const Yv=p.forwardRef(({className:t,children:e,...n},r)=>x.jsxs(Sk,{ref:r,className:xt("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...n,children:[x.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:x.jsx(Y3,{children:x.jsx(iR,{className:"w-4 h-4"})})}),x.jsx(G3,{children:e})]}));Yv.displayName=Sk.displayName;const J3=p.forwardRef(({className:t,...e},n)=>x.jsx(Ek,{ref:n,className:xt("-mx-1 my-1 h-px bg-muted",t),...e}));J3.displayName=Ek.displayName;function bk({path:t,disabled:e,source:n,schema:r,registerPatchCallback:i,onSubmit:o}){return(typeof n=="string"||n===null)&&(r==null?void 0:r.type)==="string"?x.jsx(tL,{path:t,defaultValue:n,disabled:e,schema:r,registerPatchCallback:i,onSubmit:o}):(typeof n=="number"||n===null)&&(r==null?void 0:r.type)==="number"?x.jsx(l_,{defaultValue:n,disabled:e,registerPatchCallback:i,onSubmit:o}):(typeof n=="number"||typeof n=="string"||n===null)&&(r==null?void 0:r.type)==="keyOf"?x.jsx(o_,{defaultValue:n,disabled:e,registerPatchCallback:i,onSubmit:o,selector:r.selector}):(typeof n=="number"||n===null)&&(r==null?void 0:r.type)==="number"?x.jsx(l_,{defaultValue:n,disabled:e,registerPatchCallback:i,onSubmit:o}):(typeof n=="number"||typeof n=="string"||n===null)&&(r==null?void 0:r.type)==="keyOf"?x.jsx(o_,{defaultValue:n,disabled:e,registerPatchCallback:i,onSubmit:o,selector:r.selector}):(typeof n=="object"||n===null)&&(r==null?void 0:r.type)==="richtext"?x.jsx(eL,{registerPatchCallback:i,onSubmit:o,defaultValue:n}):(typeof n=="object"||n===null)&&(r==null?void 0:r.type)==="image"?x.jsx(q3,{path:t,registerPatchCallback:i,onSubmit:o,defaultValue:n}):x.jsxs("div",{children:["Unsupported schema: ",r.type," (source type: ",typeof n," source:"," ",JSON.stringify(n),")"]})}function r_(t,e,n,r){if(!e||!r)return[];const i=r.sha256.slice(0,5),o=function(){const l=Ev(e)??"unknown",s=Cv(l);if(n){let a=n.split(".").slice(0,-1).join(".")||n;const u=a.lastIndexOf("_");return a.slice(u+1,a.length)===i&&(a=a.slice(0,u)),`/public/${a}_${i}.${s}`}return`/public/${r.sha256}.${s}`}();return[{value:{[Rn]:o,[nn]:"file",metadata:r},op:"replace",path:t},{value:e,op:"file",path:t,filePath:o}]}function Q3(t,e){const n=t+"/metadata";return[{value:e,op:"replace",path:n}]}function q3({path:t,defaultValue:e,onSubmit:n,registerPatchCallback:r}){var g,m,w,v,y,_,S,E,$,C,N,R;const[i,o]=p.useState(null),[l,s]=p.useState(!1),[a,u]=p.useState(),[c,d]=p.useState(),[f,h]=p.useState();return p.useEffect(()=>{h(e&&On.convertFileSource(e).url)},[e]),p.useEffect(()=>{r&&r(async b=>r_(b,(i==null?void 0:i.src)??null,(i==null?void 0:i.filename)??null,a))},[i,e]),p.useEffect(()=>{var b;if(c)if(a){const L={...a,hotspot:c};u(L)}else e!=null&&e.metadata?u({...e.metadata,hotspot:c}):console.error("Neither image metadata nor value is set");else(b=e==null?void 0:e.metadata)!=null&&b.hotspot&&d(e.metadata.hotspot)},[c,e]),x.jsxs(Bs,{children:[x.jsxs("div",{className:"w-fit",children:[x.jsx("div",{className:"flex flex-col justify-start p-2 border border-b-0 rounded-sm rounded-b-none gap-y-4 bg-background text-foreground border-input",children:i||f?x.jsxs("div",{className:"relative",children:[c&&x.jsx("div",{className:"rounded-full h-[12px] w-[12px] bg-background mix-blend-difference border-accent border-2 absolute pointer-events-none",style:{top:`${c.y*100}%`,left:`${c.x*100}%`}}),x.jsx("img",{src:(i==null?void 0:i.src)||f,draggable:!1,className:"object-contain w-full max-h-[500px]",style:{cursor:"crosshair"},onClick:b=>{const{width:L,height:F,left:le,top:V}=b.currentTarget.getBoundingClientRect(),H=(b.clientX-6-le)/L,O=(b.clientY-6-V)/F;d({x:H,y:O,width:1,height:1})}})]}):x.jsx("div",{children:"Select image below"})},t),x.jsxs("div",{className:"p-4 border border-t-0 rounded-b-sm bg-background border-input",children:[x.jsx("label",{htmlFor:`img_input:${t}`,className:"block px-1 py-2 text-sm text-center rounded-md cursor-pointer bg-primary text-background",children:"Update"}),x.jsx("input",{hidden:!0,id:`img_input:${t}`,type:"file",onChange:b=>{CC(b).then(L=>{o({src:L.src,filename:L.filename}),L.width&&L.height&&L.mimeType?u({sha256:L.sha256,width:L.width,height:L.height,mimeType:L.mimeType,hotspot:c}):(u(void 0),d(void 0))}).catch(L=>{console.error(L.message),o(null),d(void 0),u(void 0)})}})]})]}),n&&x.jsx(Us,{loading:l,enabled:!!i||((m=(g=e==null?void 0:e.metadata)==null?void 0:g.hotspot)==null?void 0:m.height)!==(c==null?void 0:c.height)||((v=(w=e==null?void 0:e.metadata)==null?void 0:w.hotspot)==null?void 0:v.width)!==(c==null?void 0:c.width)||((_=(y=e==null?void 0:e.metadata)==null?void 0:y.hotspot)==null?void 0:_.x)!==(c==null?void 0:c.x)||((E=(S=e==null?void 0:e.metadata)==null?void 0:S.hotspot)==null?void 0:E.y)!==(c==null?void 0:c.y)||(($=e==null?void 0:e.metadata)==null?void 0:$.width)!==(a==null?void 0:a.width)||((C=e==null?void 0:e.metadata)==null?void 0:C.height)!==(a==null?void 0:a.height)||((N=e==null?void 0:e.metadata)==null?void 0:N.mimeType)!==(a==null?void 0:a.mimeType)||((R=e==null?void 0:e.metadata)==null?void 0:R.sha256)!==(a==null?void 0:a.sha256),onClick:()=>{i?(s(!0),n(b=>Promise.resolve(r_(b,i.src,i.filename??null,a))).finally(()=>{s(!1),o(null),u(void 0)})):a&&(s(!0),n(b=>Promise.resolve(Q3(b,a))).finally(()=>{s(!1),o(null),u(void 0)}))}})]})}function i_(t,e){const{templateStrings:n,exprs:r,files:i}=e?kO(e.getEditorState().toJSON().root):{[nn]:"richtext",templateStrings:[""],exprs:[],files:{}};return[{op:"replace",path:t,value:{templateStrings:n,exprs:r,[nn]:"richtext"}},...Object.entries(i).map(([o,l])=>({op:"file",path:t,filePath:o,value:l}))]}function eL({defaultValue:t,onSubmit:e,registerPatchCallback:n}){const[r,i]=p.useState(null),[o,l]=p.useState(!1),[s,a]=p.useState(!1);return p.useEffect(()=>{r&&(l(!1),r.registerTextContentListener(()=>{l(!0)}),r.registerDecoratorListener(()=>{l(!0)}),r.registerMutationListener(el.LinkNode,()=>{l(!0)}),r.registerMutationListener(Is,()=>{l(!0)}),r.registerMutationListener(_e.TextNode,()=>{l(!0)}))},[r]),p.useEffect(()=>{r&&n&&n(async u=>i_(u,r))},[r]),x.jsxs(Bs,{children:[x.jsx(sM,{onEditor:u=>{i(u)},richtext:t||{children:[],[nn]:"root"}}),e&&x.jsx(Us,{loading:s||!r,enabled:o,onClick:()=>{r&&(a(!0),e(async u=>i_(u,r)).finally(()=>{a(!1),l(!1)}))}})]})}function o_({disabled:t,defaultValue:e,registerPatchCallback:n,onSubmit:r,selector:i}){const o=CD(i),s=(h=>Array.isArray(h.moduleSource)?{type:"number",values:Object.keys(h.moduleSource).map(g=>parseInt(g))}:{type:"string",values:Object.keys(h.moduleSource??["ERROR fetching source"])})(o),[a,u]=p.useState(e||s.values[0]),[c,d]=p.useState(!1);p.useEffect(()=>{d(t)},[t]);const f=h=>{if(s.type==="number"){if(h==="")throw new Error("Value cannot be empty");if(Number.isNaN(Number(h)))throw new Error("Value was not a number: "+JSON.stringify(h));return Number(h)}return h};return p.useEffect(()=>{n&&n(async h=>[{op:"replace",path:h,value:a}])},[a]),x.jsxs(Bs,{children:[x.jsxs(Ck,{defaultValue:a.toString(),disabled:c,onValueChange:h=>{u(f(h))},children:[x.jsx(Zv,{children:x.jsx(kk,{placeholder:"Select a value"})}),x.jsx(Gv,{children:s.values.map(h=>x.jsx(Yv,{value:h.toString(),children:h.toString()},h))})]}),r&&x.jsx(Us,{loading:c,enabled:e!==a,onClick:()=>{d(!0),r(async h=>[{op:"replace",path:h,value:a}]).finally(()=>{d(!1)})}})]})}function l_({disabled:t,defaultValue:e,registerPatchCallback:n,onSubmit:r}){const[i,o]=p.useState(e||0),[l,s]=p.useState(!1);p.useEffect(()=>{s(t)},[t]);const a=p.useRef(null);return p.useEffect(()=>{n&&n(async u=>{var c;return[{op:"replace",path:u,value:Number((c=a.current)==null?void 0:c.value)||0}]})},[]),x.jsxs(Bs,{children:[x.jsx(jv,{ref:a,disabled:l,defaultValue:i??0,onChange:u=>o(Number(u.target.value)),type:"number"}),r&&x.jsx(Us,{loading:l,enabled:e!==i,onClick:()=>{s(!0),r(async u=>{var c;return[{op:"replace",path:u,value:Number((c=a.current)==null?void 0:c.value)||0}]}).finally(()=>{s(!1)})}})]})}function tL({disabled:t,defaultValue:e,path:n,schema:r,registerPatchCallback:i,onSubmit:o}){const[l,s]=p.useState(e||""),[a,u]=p.useState(!1);p.useEffect(()=>{u(t)},[t]);const c=p.useRef(null);p.useEffect(()=>{i&&i(async h=>{var g;return[{op:"replace",path:h,value:((g=c.current)==null?void 0:g.value)||""}]})},[]);const f=new RN(r.options?{...r.options,regexp:r.options.regexp?new RegExp(r.options.regexp.source,r.options.regexp.flags):void 0}:void 0).validate(n,l);return x.jsxs(Bs,{children:[x.jsx(jv,{ref:c,disabled:a,defaultValue:l??"",onChange:h=>s(h.target.value)}),o&&x.jsx(Us,{validationErrors:f&&f[n],loading:a,enabled:e!==l&&!f,onClick:()=>{u(!0),o(async h=>{var g;return[{op:"replace",path:h,value:((g=c.current)==null?void 0:g.value)||""}]}).finally(()=>{u(!1)})}})]})}function nL({errors:t}){return x.jsx("div",{className:"flex flex-col p-2 text-sm rounded-md gap-y-1 text-destructive-foreground bg-destructive",children:t.map((e,n)=>x.jsx("div",{children:e.message},n))})}function Bs({children:t,className:e}){return x.jsx("div",{className:Pn("relative max-w-lg px-4 pt-4",e),children:t})}function Us({loading:t,enabled:e,validationErrors:n,onClick:r}){const{session:i}=jf(),o=i.status==="success"&&i.data.mode==="proxy";return x.jsx("div",{className:"sticky bottom-0 m-4 mt-2 ml-0",children:x.jsxs("div",{className:"flex justify-start w-full gap-2 text-sm",children:[x.jsx(IC,{disabled:t||!e,onClick:r,children:t?o?"Staging...":"Saving...":o?"Stage":"Save"})," ",n?x.jsx(nL,{errors:n||[]}):x.jsx("span",{})]})})}const rL=({className:t})=>x.jsxs("svg",{width:"58",height:"34",viewBox:"0 0 58 34",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[x.jsx("g",{filter:"url(#filter0_d_21_1677)",children:x.jsx("path",{d:"M5 5.36426C5 5.16309 5.16309 5 5.36426 5H17.6581C17.8593 5 18.0223 5.16309 18.0223 5.36426V28.4949C18.0223 28.696 17.8593 28.8591 17.6581 28.8591H5.36426C5.16309 28.8591 5 28.696 5 28.4949V5.36426Z",fill:"hsl(var(--accent))"})}),x.jsx("g",{filter:"url(#filter1_i_21_1677)",children:x.jsx("circle",{cx:"11.4656",cy:"23.7595",r:"2.18557",fill:"currentColor"})}),x.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M52.8588 23.839H48.7257H48.537H48.1128C47.6715 23.839 47.4508 23.5942 47.4508 23.1044V13.7293C47.4508 13.5784 47.3285 13.4561 47.1777 13.4561H45.8118C45.6609 13.4561 45.5386 13.5784 45.5386 13.7293V15.1836C45.5386 15.2844 45.4569 15.3661 45.3561 15.3661C45.2876 15.3661 45.225 15.3275 45.1924 15.2672C44.805 14.5503 44.283 14.02 43.6264 13.6765C42.9563 13.301 42.2045 13.1132 41.3709 13.1132C40.6028 13.1132 39.8755 13.252 39.189 13.5295C38.5026 13.8071 37.8979 14.2152 37.3748 14.7539C36.8682 15.2764 36.4678 15.9212 36.1736 16.6885C35.8794 17.4558 35.7323 18.3374 35.7323 19.3332V19.725C35.7323 20.7372 35.8794 21.627 36.1736 22.3942C36.4678 23.1615 36.8682 23.8146 37.3748 24.3533C37.8979 24.8757 38.5026 25.2757 39.189 25.5532C39.8755 25.8144 40.6191 25.945 41.42 25.945C42.1881 25.945 42.9154 25.7491 43.6019 25.3573C44.2751 24.982 44.8058 24.4119 45.1941 23.6471C45.2255 23.5852 45.2886 23.5452 45.358 23.5452H45.3917C45.4728 23.5452 45.5386 23.611 45.5386 23.6921C45.5386 23.7904 45.544 23.8856 45.5547 23.9777V25.1392C45.5547 25.3904 45.7584 25.5941 46.0096 25.5941H47.2261C47.2914 25.5995 47.3581 25.6022 47.4263 25.6022H48.537H48.7257H57.7268C57.8777 25.6022 58 25.4799 58 25.329V24.1122C58 23.9614 57.8777 23.839 57.7268 23.839H55.3174C55.1665 23.839 55.0442 23.7167 55.0442 23.5659V8.73368C55.0442 8.58279 54.9219 8.46048 54.771 8.46048H50.5054C50.3545 8.46048 50.2322 8.58279 50.2322 8.73368V9.95043C50.2322 10.1013 50.3545 10.2236 50.5054 10.2236H52.8588C53.0097 10.2236 53.132 10.3459 53.132 10.4968V23.5659C53.132 23.7167 53.0097 23.839 52.8588 23.839ZM41.6161 24.1329C42.1881 24.1329 42.7111 24.0268 43.1851 23.8146C43.6754 23.6023 44.0922 23.3003 44.4354 22.9085C44.7786 22.5167 45.0483 22.0514 45.2444 21.5127C45.4406 20.9576 45.5386 20.3454 45.5386 19.6761V19.3822C45.5386 18.7292 45.4406 18.1333 45.2444 17.5946C45.0483 17.0395 44.7705 16.5661 44.4109 16.1743C44.0677 15.7824 43.6509 15.4804 43.1606 15.2682C42.6866 15.0396 42.1718 14.9254 41.6161 14.9254C41.044 14.9254 40.521 15.0315 40.0471 15.2437C39.5731 15.4559 39.1563 15.758 38.7968 16.1498C38.4535 16.5252 38.1839 16.9905 37.9877 17.5456C37.7916 18.0843 37.6936 18.6802 37.6936 19.3332V19.725C37.6936 21.1127 38.0531 22.1983 38.7722 22.982C39.5077 23.7493 40.4557 24.1329 41.6161 24.1329ZM31.1115 25.4191C31.0732 25.5287 30.9698 25.6022 30.8536 25.6022H27.4661C27.35 25.6022 27.2465 25.5287 27.2082 25.4191L23.1578 13.8193C23.0958 13.6417 23.2276 13.4561 23.4157 13.4561H25.089C25.2068 13.4561 25.3114 13.5316 25.3484 13.6435L28.9666 24.581C28.9942 24.6643 29.0721 24.7206 29.1599 24.7206C29.2477 24.7206 29.3256 24.6643 29.3532 24.581L32.9714 13.6435C33.0084 13.5316 33.1129 13.4561 33.2308 13.4561H34.9041C35.0922 13.4561 35.224 13.6417 35.162 13.8193L31.1115 25.4191Z",fill:"currentColor"}),x.jsxs("defs",{children:[x.jsxs("filter",{id:"filter0_d_21_1677",x:"0.124722",y:"0.124722",width:"22.7729",height:"33.6097",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[x.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),x.jsx("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),x.jsx("feOffset",{}),x.jsx("feGaussianBlur",{stdDeviation:"2.43764"}),x.jsx("feComposite",{in2:"hardAlpha",operator:"out"}),x.jsx("feColorMatrix",{type:"matrix",values:"0 0 0 0 0.219608 0 0 0 0 0.803922 0 0 0 0 0.501961 0 0 0 0.3 0"}),x.jsx("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_21_1677"}),x.jsx("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_21_1677",result:"shape"})]}),x.jsxs("filter",{id:"filter1_i_21_1677",x:"9.28003",y:"21.5739",width:"4.37112",height:"4.37112",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[x.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),x.jsx("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),x.jsx("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),x.jsx("feOffset",{}),x.jsx("feGaussianBlur",{stdDeviation:"0.546392"}),x.jsx("feComposite",{in2:"hardAlpha",operator:"arithmetic",k2:"-1",k3:"1"}),x.jsx("feColorMatrix",{type:"matrix",values:"0 0 0 0 0.219608 0 0 0 0 0.803922 0 0 0 0 0.501961 0 0 0 0.3 0"}),x.jsx("feBlend",{mode:"normal",in2:"shape",result:"effect1_innerShadow_21_1677"})]})]})]}),$k=rL,Tk="Switch",[iL,PI]=al(Tk),[oL,lL]=iL(Tk),sL=p.forwardRef((t,e)=>{const{__scopeSwitch:n,name:r,checked:i,defaultChecked:o,required:l,disabled:s,value:a="on",onCheckedChange:u,...c}=t,[d,f]=p.useState(null),h=st(e,y=>f(y)),g=p.useRef(!1),m=d?!!d.closest("form"):!0,[w=!1,v]=xs({prop:i,defaultProp:o,onChange:u});return p.createElement(oL,{scope:n,checked:w,disabled:s},p.createElement(Ke.button,ie({type:"button",role:"switch","aria-checked":w,"aria-required":l,"data-state":Nk(w),"data-disabled":s?"":void 0,disabled:s,value:a},c,{ref:h,onClick:nt(t.onClick,y=>{v(_=>!_),m&&(g.current=y.isPropagationStopped(),g.current||y.stopPropagation())})})),m&&p.createElement(cL,{control:d,bubbles:!g.current,name:r,value:a,checked:w,required:l,disabled:s,style:{transform:"translateX(-100%)"}}))}),aL="SwitchThumb",uL=p.forwardRef((t,e)=>{const{__scopeSwitch:n,...r}=t,i=lL(aL,n);return p.createElement(Ke.span,ie({"data-state":Nk(i.checked),"data-disabled":i.disabled?"":void 0},r,{ref:e}))}),cL=t=>{const{control:e,checked:n,bubbles:r=!0,...i}=t,o=p.useRef(null),l=rk(n),s=XC(e);return p.useEffect(()=>{const a=o.current,u=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(u,"checked").set;if(l!==n&&d){const f=new Event("click",{bubbles:r});d.call(a,n),a.dispatchEvent(f)}},[l,n,r]),p.createElement("input",ie({type:"checkbox","aria-hidden":!0,defaultChecked:n},i,{tabIndex:-1,ref:o,style:{...t.style,...s,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function Nk(t){return t?"checked":"unchecked"}const Rk=sL,dL=uL,Ok=p.forwardRef(({className:t,...e},n)=>x.jsx(Rk,{className:xt("peer inline-flex h-[22px] w-[44px] shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-accent data-[state=unchecked]:bg-primary",t),...e,ref:n,children:x.jsx(dL,{className:xt("pointer-events-none block h-[18px] w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));Ok.displayName=Rk.displayName;const Xv=p.forwardRef(({className:t,...e},n)=>x.jsx("div",{ref:n,className:xt("rounded-lg border bg-card text-card-foreground shadow-sm",t),...e}));Xv.displayName="Card";const fL=p.forwardRef(({className:t,...e},n)=>x.jsx("div",{ref:n,className:xt("flex flex-col space-y-1.5 p-6",t),...e}));fL.displayName="CardHeader";const hL=p.forwardRef(({className:t,...e},n)=>x.jsx("h3",{ref:n,className:xt("text-2xl font-semibold leading-none tracking-tight",t),...e}));hL.displayName="CardTitle";const pL=p.forwardRef(({className:t,...e},n)=>x.jsx("p",{ref:n,className:xt("text-sm text-muted-foreground",t),...e}));pL.displayName="CardDescription";const mL=p.forwardRef(({className:t,...e},n)=>x.jsx("div",{ref:n,className:xt("p-6 pt-0",t),...e}));mL.displayName="CardContent";const gL=p.forwardRef(({className:t,...e},n)=>x.jsx("div",{ref:n,className:xt("flex items-center p-6 pt-0",t),...e}));gL.displayName="CardFooter";/**
|
|
169
|
+
`)},u3=0,$l=[];function c3(t){var e=p.useRef([]),n=p.useRef([0,0]),r=p.useRef(),i=p.useState(u3++)[0],o=p.useState(function(){return ak()})[0],l=p.useRef(t);p.useEffect(function(){l.current=t},[t]),p.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(i));var m=P4([t.lockRef.current],(t.shards||[]).map(e_),!0).filter(Boolean);return m.forEach(function(w){return w.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),m.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(i))})}}},[t.inert,t.lockRef.current,t.shards]);var s=p.useCallback(function(m,w){if("touches"in m&&m.touches.length===2)return!l.current.allowPinchZoom;var v=Tc(m),y=n.current,_="deltaX"in m?m.deltaX:y[0]-v[0],S="deltaY"in m?m.deltaY:y[1]-v[1],E,$=m.target,C=Math.abs(_)>Math.abs(S)?"h":"v";if("touches"in m&&C==="h"&&$.type==="range")return!1;var N=Qx(C,$);if(!N)return!0;if(N?E=C:(E=C==="v"?"h":"v",N=Qx(C,$)),!N)return!1;if(!r.current&&"changedTouches"in m&&(_||S)&&(r.current=E),!E)return!0;var R=r.current||E;return l3(R,w,m,R==="h"?_:S,!0)},[]),a=p.useCallback(function(m){var w=m;if(!(!$l.length||$l[$l.length-1]!==o)){var v="deltaY"in w?qx(w):Tc(w),y=e.current.filter(function(E){return E.name===w.type&&E.target===w.target&&s3(E.delta,v)})[0];if(y&&y.should){w.cancelable&&w.preventDefault();return}if(!y){var _=(l.current.shards||[]).map(e_).filter(Boolean).filter(function(E){return E.contains(w.target)}),S=_.length>0?s(w,_[0]):!l.current.noIsolation;S&&w.cancelable&&w.preventDefault()}}},[]),u=p.useCallback(function(m,w,v,y){var _={name:m,delta:w,target:v,should:y};e.current.push(_),setTimeout(function(){e.current=e.current.filter(function(S){return S!==_})},1)},[]),c=p.useCallback(function(m){n.current=Tc(m),r.current=void 0},[]),d=p.useCallback(function(m){u(m.type,qx(m),m.target,s(m,t.lockRef.current))},[]),f=p.useCallback(function(m){u(m.type,Tc(m),m.target,s(m,t.lockRef.current))},[]);p.useEffect(function(){return $l.push(o),t.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",a,bl),document.addEventListener("touchmove",a,bl),document.addEventListener("touchstart",c,bl),function(){$l=$l.filter(function(m){return m!==o}),document.removeEventListener("wheel",a,bl),document.removeEventListener("touchmove",a,bl),document.removeEventListener("touchstart",c,bl)}},[]);var h=t.removeScrollBar,g=t.inert;return p.createElement(p.Fragment,null,g?p.createElement(o,{styles:a3(i)}):null,h?p.createElement(q4,{gapMode:"margin"}):null)}const d3=B4(sk,c3);var fk=p.forwardRef(function(t,e){return p.createElement(Wf,Dr({},t,{ref:e,sideCar:d3}))});fk.classNames=Wf.classNames;const f3=fk,h3=[" ","Enter","ArrowUp","ArrowDown"],p3=[" ","Enter"],Vf="Select",[Hf,Hv,m3]=jC(Vf),[Bs,RI]=al(Vf,[m3,qC]),Kv=qC(),[g3,hl]=Bs(Vf),[v3,y3]=Bs(Vf),x3=t=>{const{__scopeSelect:e,children:n,open:r,defaultOpen:i,onOpenChange:o,value:l,defaultValue:s,onValueChange:a,dir:u,name:c,autoComplete:d,disabled:f,required:h}=t,g=Kv(e),[m,w]=p.useState(null),[v,y]=p.useState(null),[_,S]=p.useState(!1),E=Yg(u),[$=!1,C]=_s({prop:r,defaultProp:i,onChange:o}),[N,R]=_s({prop:l,defaultProp:s,onChange:a}),b=p.useRef(null),L=m?!!m.closest("form"):!0,[F,le]=p.useState(new Set),V=Array.from(F).map(H=>H.props.value).join(";");return p.createElement(S4,g,p.createElement(g3,{required:h,scope:e,trigger:m,onTriggerChange:w,valueNode:v,onValueNodeChange:y,valueNodeHasChildren:_,onValueNodeHasChildrenChange:S,contentId:Ff(),value:N,onValueChange:R,open:$,onOpenChange:C,dir:E,triggerPointerDownPosRef:b,disabled:f},p.createElement(Hf.Provider,{scope:e},p.createElement(v3,{scope:t.__scopeSelect,onNativeOptionAdd:p.useCallback(H=>{le(O=>new Set(O).add(H))},[]),onNativeOptionRemove:p.useCallback(H=>{le(O=>{const A=new Set(O);return A.delete(H),A})},[])},n)),L?p.createElement(gk,{key:V,"aria-hidden":!0,required:h,tabIndex:-1,name:c,autoComplete:d,value:N,onChange:H=>R(H.target.value),disabled:f},N===void 0?p.createElement("option",{value:""}):null,Array.from(F)):null))},_3="SelectTrigger",w3=p.forwardRef((t,e)=>{const{__scopeSelect:n,disabled:r=!1,...i}=t,o=Kv(n),l=hl(_3,n),s=l.disabled||r,a=st(e,l.onTriggerChange),u=Hv(n),[c,d,f]=vk(g=>{const m=u().filter(y=>!y.disabled),w=m.find(y=>y.value===l.value),v=yk(m,g,w);v!==void 0&&l.onValueChange(v.value)}),h=()=>{s||(l.onOpenChange(!0),f())};return p.createElement(E4,ie({asChild:!0},o),p.createElement(Ke.button,ie({type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:s,"data-disabled":s?"":void 0,"data-placeholder":mk(l.value)?"":void 0},i,{ref:a,onClick:nt(i.onClick,g=>{g.currentTarget.focus()}),onPointerDown:nt(i.onPointerDown,g=>{const m=g.target;m.hasPointerCapture(g.pointerId)&&m.releasePointerCapture(g.pointerId),g.button===0&&g.ctrlKey===!1&&(h(),l.triggerPointerDownPosRef.current={x:Math.round(g.pageX),y:Math.round(g.pageY)},g.preventDefault())}),onKeyDown:nt(i.onKeyDown,g=>{const m=c.current!=="";!(g.ctrlKey||g.altKey||g.metaKey)&&g.key.length===1&&d(g.key),!(m&&g.key===" ")&&h3.includes(g.key)&&(h(),g.preventDefault())})})))}),S3="SelectValue",E3=p.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:l="",...s}=t,a=hl(S3,n),{onValueNodeHasChildrenChange:u}=a,c=o!==void 0,d=st(e,a.onValueNodeChange);return Vn(()=>{u(c)},[u,c]),p.createElement(Ke.span,ie({},s,{ref:d,style:{pointerEvents:"none"}}),mk(a.value)?p.createElement(p.Fragment,null,l):o)}),C3=p.forwardRef((t,e)=>{const{__scopeSelect:n,children:r,...i}=t;return p.createElement(Ke.span,ie({"aria-hidden":!0},i,{ref:e}),r||"▼")}),k3=t=>p.createElement(k4,ie({asChild:!0},t)),ws="SelectContent",b3=p.forwardRef((t,e)=>{const n=hl(ws,t.__scopeSelect),[r,i]=p.useState();if(Vn(()=>{i(new DocumentFragment)},[]),!n.open){const o=r;return o?Yr.createPortal(p.createElement(hk,{scope:t.__scopeSelect},p.createElement(Hf.Slot,{scope:t.__scopeSelect},p.createElement("div",null,t.children))),o):null}return p.createElement($3,ie({},t,{ref:e}))}),ii=10,[hk,Kf]=Bs(ws),$3=p.forwardRef((t,e)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:l,side:s,sideOffset:a,align:u,alignOffset:c,arrowPadding:d,collisionBoundary:f,collisionPadding:h,sticky:g,hideWhenDetached:m,avoidCollisions:w,...v}=t,y=hl(ws,n),[_,S]=p.useState(null),[E,$]=p.useState(null),C=st(e,te=>S(te)),[N,R]=p.useState(null),[b,L]=p.useState(null),F=Hv(n),[le,V]=p.useState(!1),H=p.useRef(!1);p.useEffect(()=>{if(_)return O4(_)},[_]),w5();const O=p.useCallback(te=>{const[Ie,...$e]=F().map(Le=>Le.ref.current),[Re]=$e.slice(-1),Se=document.activeElement;for(const Le of te)if(Le===Se||(Le==null||Le.scrollIntoView({block:"nearest"}),Le===Ie&&E&&(E.scrollTop=0),Le===Re&&E&&(E.scrollTop=E.scrollHeight),Le==null||Le.focus(),document.activeElement!==Se))return},[F,E]),A=p.useCallback(()=>O([N,_]),[O,N,_]);p.useEffect(()=>{le&&A()},[le,A]);const{onOpenChange:k,triggerPointerDownPosRef:j}=y;p.useEffect(()=>{if(_){let te={x:0,y:0};const Ie=Re=>{var Se,Le,Je,Wt;te={x:Math.abs(Math.round(Re.pageX)-((Se=(Le=j.current)===null||Le===void 0?void 0:Le.x)!==null&&Se!==void 0?Se:0)),y:Math.abs(Math.round(Re.pageY)-((Je=(Wt=j.current)===null||Wt===void 0?void 0:Wt.y)!==null&&Je!==void 0?Je:0))}},$e=Re=>{te.x<=10&&te.y<=10?Re.preventDefault():_.contains(Re.target)||k(!1),document.removeEventListener("pointermove",Ie),j.current=null};return j.current!==null&&(document.addEventListener("pointermove",Ie),document.addEventListener("pointerup",$e,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Ie),document.removeEventListener("pointerup",$e,{capture:!0})}}},[_,k,j]),p.useEffect(()=>{const te=()=>k(!1);return window.addEventListener("blur",te),window.addEventListener("resize",te),()=>{window.removeEventListener("blur",te),window.removeEventListener("resize",te)}},[k]);const[I,Z]=vk(te=>{const Ie=F().filter(Se=>!Se.disabled),$e=Ie.find(Se=>Se.ref.current===document.activeElement),Re=yk(Ie,te,$e);Re&&setTimeout(()=>Re.ref.current.focus())}),ne=p.useCallback((te,Ie,$e)=>{const Re=!H.current&&!$e;(y.value!==void 0&&y.value===Ie||Re)&&(R(te),Re&&(H.current=!0))},[y.value]),ke=p.useCallback(()=>_==null?void 0:_.focus(),[_]),ye=p.useCallback((te,Ie,$e)=>{const Re=!H.current&&!$e;(y.value!==void 0&&y.value===Ie||Re)&&L(te)},[y.value]),We=r==="popper"?t_:T3,Fe=We===t_?{side:s,sideOffset:a,align:u,alignOffset:c,arrowPadding:d,collisionBoundary:f,collisionPadding:h,sticky:g,hideWhenDetached:m,avoidCollisions:w}:{};return p.createElement(hk,{scope:n,content:_,viewport:E,onViewportChange:$,itemRefCallback:ne,selectedItem:N,onItemLeave:ke,itemTextRefCallback:ye,focusSelectedItem:A,selectedItemText:b,position:r,isPositioned:le,searchRef:I},p.createElement(f3,{as:hs,allowPinchZoom:!0},p.createElement(S5,{asChild:!0,trapped:y.open,onMountAutoFocus:te=>{te.preventDefault()},onUnmountAutoFocus:nt(i,te=>{var Ie;(Ie=y.trigger)===null||Ie===void 0||Ie.focus({preventScroll:!0}),te.preventDefault()})},p.createElement(y5,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:te=>te.preventDefault(),onDismiss:()=>y.onOpenChange(!1)},p.createElement(We,ie({role:"listbox",id:y.contentId,"data-state":y.open?"open":"closed",dir:y.dir,onContextMenu:te=>te.preventDefault()},v,Fe,{onPlaced:()=>V(!0),ref:C,style:{display:"flex",flexDirection:"column",outline:"none",...v.style},onKeyDown:nt(v.onKeyDown,te=>{const Ie=te.ctrlKey||te.altKey||te.metaKey;if(te.key==="Tab"&&te.preventDefault(),!Ie&&te.key.length===1&&Z(te.key),["ArrowUp","ArrowDown","Home","End"].includes(te.key)){let Re=F().filter(Se=>!Se.disabled).map(Se=>Se.ref.current);if(["ArrowUp","End"].includes(te.key)&&(Re=Re.slice().reverse()),["ArrowUp","ArrowDown"].includes(te.key)){const Se=te.target,Le=Re.indexOf(Se);Re=Re.slice(Le+1)}setTimeout(()=>O(Re)),te.preventDefault()}})}))))))}),T3=p.forwardRef((t,e)=>{const{__scopeSelect:n,onPlaced:r,...i}=t,o=hl(ws,n),l=Kf(ws,n),[s,a]=p.useState(null),[u,c]=p.useState(null),d=st(e,C=>c(C)),f=Hv(n),h=p.useRef(!1),g=p.useRef(!0),{viewport:m,selectedItem:w,selectedItemText:v,focusSelectedItem:y}=l,_=p.useCallback(()=>{if(o.trigger&&o.valueNode&&s&&u&&m&&w&&v){const C=o.trigger.getBoundingClientRect(),N=u.getBoundingClientRect(),R=o.valueNode.getBoundingClientRect(),b=v.getBoundingClientRect();if(o.dir!=="rtl"){const Se=b.left-N.left,Le=R.left-Se,Je=C.left-Le,Wt=C.width+Je,Sn=Math.max(Wt,N.width),cr=window.innerWidth-ii,je=Jp(Le,[ii,cr-Sn]);s.style.minWidth=Wt+"px",s.style.left=je+"px"}else{const Se=N.right-b.right,Le=window.innerWidth-R.right-Se,Je=window.innerWidth-C.right-Le,Wt=C.width+Je,Sn=Math.max(Wt,N.width),cr=window.innerWidth-ii,je=Jp(Le,[ii,cr-Sn]);s.style.minWidth=Wt+"px",s.style.right=je+"px"}const L=f(),F=window.innerHeight-ii*2,le=m.scrollHeight,V=window.getComputedStyle(u),H=parseInt(V.borderTopWidth,10),O=parseInt(V.paddingTop,10),A=parseInt(V.borderBottomWidth,10),k=parseInt(V.paddingBottom,10),j=H+O+le+k+A,I=Math.min(w.offsetHeight*5,j),Z=window.getComputedStyle(m),ne=parseInt(Z.paddingTop,10),ke=parseInt(Z.paddingBottom,10),ye=C.top+C.height/2-ii,We=F-ye,Fe=w.offsetHeight/2,te=w.offsetTop+Fe,Ie=H+O+te,$e=j-Ie;if(Ie<=ye){const Se=w===L[L.length-1].ref.current;s.style.bottom="0px";const Le=u.clientHeight-m.offsetTop-m.offsetHeight,Je=Math.max(We,Fe+(Se?ke:0)+Le+A),Wt=Ie+Je;s.style.height=Wt+"px"}else{const Se=w===L[0].ref.current;s.style.top="0px";const Je=Math.max(ye,H+m.offsetTop+(Se?ne:0)+Fe)+$e;s.style.height=Je+"px",m.scrollTop=Ie-ye+m.offsetTop}s.style.margin=`${ii}px 0`,s.style.minHeight=I+"px",s.style.maxHeight=F+"px",r==null||r(),requestAnimationFrame(()=>h.current=!0)}},[f,o.trigger,o.valueNode,s,u,m,w,v,o.dir,r]);Vn(()=>_(),[_]);const[S,E]=p.useState();Vn(()=>{u&&E(window.getComputedStyle(u).zIndex)},[u]);const $=p.useCallback(C=>{C&&g.current===!0&&(_(),y==null||y(),g.current=!1)},[_,y]);return p.createElement(N3,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:h,onScrollButtonChange:$},p.createElement("div",{ref:a,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S}},p.createElement(Ke.div,ie({},i,{ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}}))))}),t_=p.forwardRef((t,e)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=ii,...o}=t,l=Kv(n);return p.createElement(C4,ie({},l,o,{ref:e,align:r,collisionPadding:i,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}}))}),[N3,R3]=Bs(ws,{}),n_="SelectViewport",O3=p.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,i=Kf(n_,n),o=R3(n_,n),l=st(e,i.onViewportChange),s=p.useRef(0);return p.createElement(p.Fragment,null,p.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"}}),p.createElement(Hf.Slot,{scope:n},p.createElement(Ke.div,ie({"data-radix-select-viewport":"",role:"presentation"},r,{ref:l,style:{position:"relative",flex:1,overflow:"auto",...r.style},onScroll:nt(r.onScroll,a=>{const u=a.currentTarget,{contentWrapper:c,shouldExpandOnScrollRef:d}=o;if(d!=null&&d.current&&c){const f=Math.abs(s.current-u.scrollTop);if(f>0){const h=window.innerHeight-ii*2,g=parseFloat(c.style.minHeight),m=parseFloat(c.style.height),w=Math.max(g,m);if(w<h){const v=w+f,y=Math.min(h,v),_=v-y;c.style.height=y+"px",c.style.bottom==="0px"&&(u.scrollTop=_>0?_:0,c.style.justifyContent="flex-end")}}}s.current=u.scrollTop})}))))}),P3="SelectGroup",[OI,A3]=Bs(P3),M3="SelectLabel",L3=p.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,i=A3(M3,n);return p.createElement(Ke.div,ie({id:i.id},r,{ref:e}))}),Hm="SelectItem",[D3,pk]=Bs(Hm),I3=p.forwardRef((t,e)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...l}=t,s=hl(Hm,n),a=Kf(Hm,n),u=s.value===r,[c,d]=p.useState(o??""),[f,h]=p.useState(!1),g=st(e,v=>{var y;return(y=a.itemRefCallback)===null||y===void 0?void 0:y.call(a,v,r,i)}),m=Ff(),w=()=>{i||(s.onValueChange(r),s.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return p.createElement(D3,{scope:n,value:r,disabled:i,textId:m,isSelected:u,onItemTextChange:p.useCallback(v=>{d(y=>{var _;return y||((_=v==null?void 0:v.textContent)!==null&&_!==void 0?_:"").trim()})},[])},p.createElement(Hf.ItemSlot,{scope:n,value:r,disabled:i,textValue:c},p.createElement(Ke.div,ie({role:"option","aria-labelledby":m,"data-highlighted":f?"":void 0,"aria-selected":u&&f,"data-state":u?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1},l,{ref:g,onFocus:nt(l.onFocus,()=>h(!0)),onBlur:nt(l.onBlur,()=>h(!1)),onPointerUp:nt(l.onPointerUp,w),onPointerMove:nt(l.onPointerMove,v=>{if(i){var y;(y=a.onItemLeave)===null||y===void 0||y.call(a)}else v.currentTarget.focus({preventScroll:!0})}),onPointerLeave:nt(l.onPointerLeave,v=>{if(v.currentTarget===document.activeElement){var y;(y=a.onItemLeave)===null||y===void 0||y.call(a)}}),onKeyDown:nt(l.onKeyDown,v=>{var y;((y=a.searchRef)===null||y===void 0?void 0:y.current)!==""&&v.key===" "||(p3.includes(v.key)&&w(),v.key===" "&&v.preventDefault())})}))))}),Nc="SelectItemText",j3=p.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:i,...o}=t,l=hl(Nc,n),s=Kf(Nc,n),a=pk(Nc,n),u=y3(Nc,n),[c,d]=p.useState(null),f=st(e,v=>d(v),a.onItemTextChange,v=>{var y;return(y=s.itemTextRefCallback)===null||y===void 0?void 0:y.call(s,v,a.value,a.disabled)}),h=c==null?void 0:c.textContent,g=p.useMemo(()=>p.createElement("option",{key:a.value,value:a.value,disabled:a.disabled},h),[a.disabled,a.value,h]),{onNativeOptionAdd:m,onNativeOptionRemove:w}=u;return Vn(()=>(m(g),()=>w(g)),[m,w,g]),p.createElement(p.Fragment,null,p.createElement(Ke.span,ie({id:a.textId},o,{ref:f})),a.isSelected&&l.valueNode&&!l.valueNodeHasChildren?Yr.createPortal(o.children,l.valueNode):null)}),z3="SelectItemIndicator",F3=p.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return pk(z3,n).isSelected?p.createElement(Ke.span,ie({"aria-hidden":!0},r,{ref:e})):null}),B3=p.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return p.createElement(Ke.div,ie({"aria-hidden":!0},r,{ref:e}))});function mk(t){return t===""||t===void 0}const gk=p.forwardRef((t,e)=>{const{value:n,...r}=t,i=p.useRef(null),o=st(e,i),l=rk(n);return p.useEffect(()=>{const s=i.current,a=window.HTMLSelectElement.prototype,c=Object.getOwnPropertyDescriptor(a,"value").set;if(l!==n&&c){const d=new Event("change",{bubbles:!0});c.call(s,n),s.dispatchEvent(d)}},[l,n]),p.createElement($4,{asChild:!0},p.createElement("select",ie({},r,{ref:o,defaultValue:n})))});gk.displayName="BubbleSelect";function vk(t){const e=en(t),n=p.useRef(""),r=p.useRef(0),i=p.useCallback(l=>{const s=n.current+l;e(s),function a(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>a(""),1e3))}(s)},[e]),o=p.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return p.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}function yk(t,e,n){const i=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,o=n?t.indexOf(n):-1;let l=U3(t,Math.max(o,0));i.length===1&&(l=l.filter(u=>u!==n));const a=l.find(u=>u.textValue.toLowerCase().startsWith(i.toLowerCase()));return a!==n?a:void 0}function U3(t,e){return t.map((n,r)=>t[(e+r)%t.length])}const W3=x3,xk=w3,V3=E3,H3=C3,K3=k3,_k=b3,Z3=O3,wk=L3,Sk=I3,G3=j3,Y3=F3,Ek=B3,Ck=W3,kk=V3,Zv=p.forwardRef(({className:t,children:e,...n},r)=>x.jsxs(xk,{ref:r,className:xt("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),...n,children:[e,x.jsx(H3,{asChild:!0,children:x.jsx(wS,{className:"w-4 h-4 opacity-50"})})]}));Zv.displayName=xk.displayName;const Gv=p.forwardRef(({className:t,children:e,position:n="popper",...r},i)=>x.jsx(K3,{children:x.jsx(_k,{ref:i,className:xt("relative z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:n,...r,children:x.jsx(Z3,{className:xt("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e})})}));Gv.displayName=_k.displayName;const X3=p.forwardRef(({className:t,...e},n)=>x.jsx(wk,{ref:n,className:xt("py-1.5 pl-8 pr-2 text-sm font-semibold",t),...e}));X3.displayName=wk.displayName;const Yv=p.forwardRef(({className:t,children:e,...n},r)=>x.jsxs(Sk,{ref:r,className:xt("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...n,children:[x.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:x.jsx(Y3,{children:x.jsx(iR,{className:"w-4 h-4"})})}),x.jsx(G3,{children:e})]}));Yv.displayName=Sk.displayName;const J3=p.forwardRef(({className:t,...e},n)=>x.jsx(Ek,{ref:n,className:xt("-mx-1 my-1 h-px bg-muted",t),...e}));J3.displayName=Ek.displayName;function bk({path:t,disabled:e,source:n,schema:r,registerPatchCallback:i,onSubmit:o}){return(typeof n=="string"||n===null)&&(r==null?void 0:r.type)==="string"?x.jsx(tL,{path:t,defaultValue:n,disabled:e,schema:r,registerPatchCallback:i,onSubmit:o}):(typeof n=="number"||n===null)&&(r==null?void 0:r.type)==="number"?x.jsx(l_,{defaultValue:n,disabled:e,registerPatchCallback:i,onSubmit:o}):(typeof n=="number"||typeof n=="string"||n===null)&&(r==null?void 0:r.type)==="keyOf"?x.jsx(o_,{defaultValue:n,disabled:e,registerPatchCallback:i,onSubmit:o,selector:r.selector}):(typeof n=="number"||n===null)&&(r==null?void 0:r.type)==="number"?x.jsx(l_,{defaultValue:n,disabled:e,registerPatchCallback:i,onSubmit:o}):(typeof n=="number"||typeof n=="string"||n===null)&&(r==null?void 0:r.type)==="keyOf"?x.jsx(o_,{defaultValue:n,disabled:e,registerPatchCallback:i,onSubmit:o,selector:r.selector}):(typeof n=="object"||n===null)&&(r==null?void 0:r.type)==="richtext"?x.jsx(eL,{registerPatchCallback:i,onSubmit:o,defaultValue:n}):(typeof n=="object"||n===null)&&(r==null?void 0:r.type)==="image"?x.jsx(q3,{path:t,registerPatchCallback:i,onSubmit:o,defaultValue:n}):x.jsxs("div",{children:["Unsupported schema: ",r.type," (source type: ",typeof n," source:"," ",JSON.stringify(n),")"]})}function r_(t,e,n,r){if(!e||!r)return[];const i=r.sha256.slice(0,5),o=function(){const l=Ev(e)??"unknown",s=Cv(l);if(n){let a=n.split(".").slice(0,-1).join(".")||n;const u=a.lastIndexOf("_");return a.slice(u+1,a.length)===i&&(a=a.slice(0,u)),`/public/${a}_${i}.${s}`}return`/public/${r.sha256}.${s}`}();return[{value:{[Rn]:o,[nn]:"file",metadata:r},op:"replace",path:t},{value:e,op:"file",path:t,filePath:o}]}function Q3(t,e){const n=t+"/metadata";return[{value:e,op:"replace",path:n}]}function q3({path:t,defaultValue:e,onSubmit:n,registerPatchCallback:r}){var g,m,w,v,y,_,S,E,$,C,N,R;const[i,o]=p.useState(null),[l,s]=p.useState(!1),[a,u]=p.useState(),[c,d]=p.useState(),[f,h]=p.useState();return p.useEffect(()=>{h(e&&On.convertFileSource(e).url)},[e]),p.useEffect(()=>{r&&r(async b=>r_(b,(i==null?void 0:i.src)??null,(i==null?void 0:i.filename)??null,a))},[i,e]),p.useEffect(()=>{var b;if(c)if(a){const L={...a,hotspot:c};u(L)}else e!=null&&e.metadata?u({...e.metadata,hotspot:c}):console.error("Neither image metadata nor value is set");else(b=e==null?void 0:e.metadata)!=null&&b.hotspot&&d(e.metadata.hotspot)},[c,e]),x.jsxs(pl,{children:[x.jsxs("div",{className:"w-fit",children:[x.jsx("div",{className:"flex flex-col justify-start p-2 border border-b-0 rounded-sm rounded-b-none gap-y-4 bg-background text-foreground border-input",children:i||f?x.jsxs("div",{className:"relative",children:[c&&x.jsx("div",{className:"rounded-full h-[12px] w-[12px] bg-background mix-blend-difference border-accent border-2 absolute pointer-events-none",style:{top:`${c.y*100}%`,left:`${c.x*100}%`}}),x.jsx("img",{src:(i==null?void 0:i.src)||f,draggable:!1,className:"object-contain w-full max-h-[500px]",style:{cursor:"crosshair"},onClick:b=>{const{width:L,height:F,left:le,top:V}=b.currentTarget.getBoundingClientRect(),H=(b.clientX-6-le)/L,O=(b.clientY-6-V)/F;d({x:H,y:O,width:1,height:1})}})]}):x.jsx("div",{children:"Select image below"})},t),x.jsxs("div",{className:"p-4 border border-t-0 rounded-b-sm bg-background border-input",children:[x.jsx("label",{htmlFor:`img_input:${t}`,className:"block px-1 py-2 text-sm text-center rounded-md cursor-pointer bg-primary text-background",children:"Update"}),x.jsx("input",{hidden:!0,id:`img_input:${t}`,type:"file",onChange:b=>{CC(b).then(L=>{o({src:L.src,filename:L.filename}),L.width&&L.height&&L.mimeType?u({sha256:L.sha256,width:L.width,height:L.height,mimeType:L.mimeType,hotspot:c}):(u(void 0),d(void 0))}).catch(L=>{console.error(L.message),o(null),d(void 0),u(void 0)})}})]})]}),n&&x.jsx(Us,{loading:l,enabled:!!i||((m=(g=e==null?void 0:e.metadata)==null?void 0:g.hotspot)==null?void 0:m.height)!==(c==null?void 0:c.height)||((v=(w=e==null?void 0:e.metadata)==null?void 0:w.hotspot)==null?void 0:v.width)!==(c==null?void 0:c.width)||((_=(y=e==null?void 0:e.metadata)==null?void 0:y.hotspot)==null?void 0:_.x)!==(c==null?void 0:c.x)||((E=(S=e==null?void 0:e.metadata)==null?void 0:S.hotspot)==null?void 0:E.y)!==(c==null?void 0:c.y)||(($=e==null?void 0:e.metadata)==null?void 0:$.width)!==(a==null?void 0:a.width)||((C=e==null?void 0:e.metadata)==null?void 0:C.height)!==(a==null?void 0:a.height)||((N=e==null?void 0:e.metadata)==null?void 0:N.mimeType)!==(a==null?void 0:a.mimeType)||((R=e==null?void 0:e.metadata)==null?void 0:R.sha256)!==(a==null?void 0:a.sha256),onClick:()=>{i?(s(!0),n(b=>Promise.resolve(r_(b,i.src,i.filename??null,a))).finally(()=>{s(!1),o(null),u(void 0)})):a&&(s(!0),n(b=>Promise.resolve(Q3(b,a))).finally(()=>{s(!1),o(null),u(void 0)}))}})]})}function i_(t,e){const{templateStrings:n,exprs:r,files:i}=e?kO(e.getEditorState().toJSON().root):{[nn]:"richtext",templateStrings:[""],exprs:[],files:{}};return[{op:"replace",path:t,value:{templateStrings:n,exprs:r,[nn]:"richtext"}},...Object.entries(i).map(([o,l])=>({op:"file",path:t,filePath:o,value:l}))]}function eL({defaultValue:t,onSubmit:e,registerPatchCallback:n}){const[r,i]=p.useState(null),[o,l]=p.useState(!1),[s,a]=p.useState(!1);return p.useEffect(()=>{r&&(l(!1),r.registerTextContentListener(()=>{l(!0)}),r.registerDecoratorListener(()=>{l(!0)}),r.registerMutationListener(el.LinkNode,()=>{l(!0)}),r.registerMutationListener(js,()=>{l(!0)}),r.registerMutationListener(_e.TextNode,()=>{l(!0)}))},[r]),p.useEffect(()=>{r&&n&&n(async u=>i_(u,r))},[r]),x.jsxs(pl,{children:[x.jsx(sM,{onEditor:u=>{i(u)},richtext:t||{children:[],[nn]:"root"}}),e&&x.jsx(Us,{loading:s||!r,enabled:o,onClick:()=>{r&&(a(!0),e(async u=>i_(u,r)).finally(()=>{a(!1),l(!1)}))}})]})}function o_({disabled:t,defaultValue:e,registerPatchCallback:n,onSubmit:r,selector:i}){const o=CD(i),s=(h=>Array.isArray(h.moduleSource)?{type:"number",values:Object.keys(h.moduleSource).map(g=>parseInt(g))}:{type:"string",values:Object.keys(h.moduleSource??["ERROR fetching source"])})(o),[a,u]=p.useState(e||s.values[0]),[c,d]=p.useState(!1);p.useEffect(()=>{d(t)},[t]);const f=h=>{if(s.type==="number"){if(h==="")throw new Error("Value cannot be empty");if(Number.isNaN(Number(h)))throw new Error("Value was not a number: "+JSON.stringify(h));return Number(h)}return h};return p.useEffect(()=>{n&&n(async h=>[{op:"replace",path:h,value:a}])},[a]),x.jsxs(pl,{children:[x.jsxs(Ck,{defaultValue:a.toString(),disabled:c,onValueChange:h=>{u(f(h))},children:[x.jsx(Zv,{children:x.jsx(kk,{placeholder:"Select a value"})}),x.jsx(Gv,{children:s.values.map(h=>x.jsx(Yv,{value:h.toString(),children:h.toString()},h))})]}),r&&x.jsx(Us,{loading:c,enabled:e!==a,onClick:()=>{d(!0),r(async h=>[{op:"replace",path:h,value:a}]).finally(()=>{d(!1)})}})]})}function l_({disabled:t,defaultValue:e,registerPatchCallback:n,onSubmit:r}){const[i,o]=p.useState(e||0),[l,s]=p.useState(!1);p.useEffect(()=>{s(t)},[t]);const a=p.useRef(null);return p.useEffect(()=>{n&&n(async u=>{var c;return[{op:"replace",path:u,value:Number((c=a.current)==null?void 0:c.value)||0}]})},[]),x.jsxs(pl,{children:[x.jsx(jv,{ref:a,disabled:l,defaultValue:i??0,onChange:u=>o(Number(u.target.value)),type:"number"}),r&&x.jsx(Us,{loading:l,enabled:e!==i,onClick:()=>{s(!0),r(async u=>{var c;return[{op:"replace",path:u,value:Number((c=a.current)==null?void 0:c.value)||0}]}).finally(()=>{s(!1)})}})]})}function tL({disabled:t,defaultValue:e,path:n,schema:r,registerPatchCallback:i,onSubmit:o}){const[l,s]=p.useState(e||""),[a,u]=p.useState(!1);p.useEffect(()=>{u(t)},[t]);const c=p.useRef(null);p.useEffect(()=>{i&&i(async h=>{var g;return[{op:"replace",path:h,value:((g=c.current)==null?void 0:g.value)||""}]})},[]);const f=new RN(r.options?{...r.options,regexp:r.options.regexp?new RegExp(r.options.regexp.source,r.options.regexp.flags):void 0}:void 0).validate(n,l);return x.jsxs(pl,{children:[x.jsx(jv,{ref:c,disabled:a,defaultValue:l??"",onChange:h=>s(h.target.value)}),o&&x.jsx(Us,{validationErrors:f&&f[n],loading:a,enabled:e!==l&&!f,onClick:()=>{u(!0),o(async h=>{var g;return[{op:"replace",path:h,value:((g=c.current)==null?void 0:g.value)||""}]}).finally(()=>{u(!1)})}})]})}function nL({errors:t}){return x.jsx("div",{className:"flex flex-col p-2 text-sm rounded-md gap-y-1 text-destructive-foreground bg-destructive",children:t.map((e,n)=>x.jsx("div",{children:e.message},n))})}function pl({children:t,className:e}){return x.jsx("div",{className:Pn("relative max-w-lg px-4 pt-4",e),children:t})}function Us({loading:t,enabled:e,validationErrors:n,onClick:r}){const{session:i}=jf(),o=i.status==="success"&&i.data.mode==="proxy";return x.jsx("div",{className:"sticky bottom-0 m-4 mt-2 ml-0",children:x.jsxs("div",{className:"flex justify-start w-full gap-2 text-sm",children:[x.jsx(IC,{disabled:t||!e,onClick:r,children:t?o?"Staging...":"Saving...":o?"Stage":"Save"})," ",n?x.jsx(nL,{errors:n||[]}):x.jsx("span",{})]})})}const rL=({className:t})=>x.jsxs("svg",{width:"58",height:"34",viewBox:"0 0 58 34",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[x.jsx("g",{filter:"url(#filter0_d_21_1677)",children:x.jsx("path",{d:"M5 5.36426C5 5.16309 5.16309 5 5.36426 5H17.6581C17.8593 5 18.0223 5.16309 18.0223 5.36426V28.4949C18.0223 28.696 17.8593 28.8591 17.6581 28.8591H5.36426C5.16309 28.8591 5 28.696 5 28.4949V5.36426Z",fill:"hsl(var(--accent))"})}),x.jsx("g",{filter:"url(#filter1_i_21_1677)",children:x.jsx("circle",{cx:"11.4656",cy:"23.7595",r:"2.18557",fill:"currentColor"})}),x.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M52.8588 23.839H48.7257H48.537H48.1128C47.6715 23.839 47.4508 23.5942 47.4508 23.1044V13.7293C47.4508 13.5784 47.3285 13.4561 47.1777 13.4561H45.8118C45.6609 13.4561 45.5386 13.5784 45.5386 13.7293V15.1836C45.5386 15.2844 45.4569 15.3661 45.3561 15.3661C45.2876 15.3661 45.225 15.3275 45.1924 15.2672C44.805 14.5503 44.283 14.02 43.6264 13.6765C42.9563 13.301 42.2045 13.1132 41.3709 13.1132C40.6028 13.1132 39.8755 13.252 39.189 13.5295C38.5026 13.8071 37.8979 14.2152 37.3748 14.7539C36.8682 15.2764 36.4678 15.9212 36.1736 16.6885C35.8794 17.4558 35.7323 18.3374 35.7323 19.3332V19.725C35.7323 20.7372 35.8794 21.627 36.1736 22.3942C36.4678 23.1615 36.8682 23.8146 37.3748 24.3533C37.8979 24.8757 38.5026 25.2757 39.189 25.5532C39.8755 25.8144 40.6191 25.945 41.42 25.945C42.1881 25.945 42.9154 25.7491 43.6019 25.3573C44.2751 24.982 44.8058 24.4119 45.1941 23.6471C45.2255 23.5852 45.2886 23.5452 45.358 23.5452H45.3917C45.4728 23.5452 45.5386 23.611 45.5386 23.6921C45.5386 23.7904 45.544 23.8856 45.5547 23.9777V25.1392C45.5547 25.3904 45.7584 25.5941 46.0096 25.5941H47.2261C47.2914 25.5995 47.3581 25.6022 47.4263 25.6022H48.537H48.7257H57.7268C57.8777 25.6022 58 25.4799 58 25.329V24.1122C58 23.9614 57.8777 23.839 57.7268 23.839H55.3174C55.1665 23.839 55.0442 23.7167 55.0442 23.5659V8.73368C55.0442 8.58279 54.9219 8.46048 54.771 8.46048H50.5054C50.3545 8.46048 50.2322 8.58279 50.2322 8.73368V9.95043C50.2322 10.1013 50.3545 10.2236 50.5054 10.2236H52.8588C53.0097 10.2236 53.132 10.3459 53.132 10.4968V23.5659C53.132 23.7167 53.0097 23.839 52.8588 23.839ZM41.6161 24.1329C42.1881 24.1329 42.7111 24.0268 43.1851 23.8146C43.6754 23.6023 44.0922 23.3003 44.4354 22.9085C44.7786 22.5167 45.0483 22.0514 45.2444 21.5127C45.4406 20.9576 45.5386 20.3454 45.5386 19.6761V19.3822C45.5386 18.7292 45.4406 18.1333 45.2444 17.5946C45.0483 17.0395 44.7705 16.5661 44.4109 16.1743C44.0677 15.7824 43.6509 15.4804 43.1606 15.2682C42.6866 15.0396 42.1718 14.9254 41.6161 14.9254C41.044 14.9254 40.521 15.0315 40.0471 15.2437C39.5731 15.4559 39.1563 15.758 38.7968 16.1498C38.4535 16.5252 38.1839 16.9905 37.9877 17.5456C37.7916 18.0843 37.6936 18.6802 37.6936 19.3332V19.725C37.6936 21.1127 38.0531 22.1983 38.7722 22.982C39.5077 23.7493 40.4557 24.1329 41.6161 24.1329ZM31.1115 25.4191C31.0732 25.5287 30.9698 25.6022 30.8536 25.6022H27.4661C27.35 25.6022 27.2465 25.5287 27.2082 25.4191L23.1578 13.8193C23.0958 13.6417 23.2276 13.4561 23.4157 13.4561H25.089C25.2068 13.4561 25.3114 13.5316 25.3484 13.6435L28.9666 24.581C28.9942 24.6643 29.0721 24.7206 29.1599 24.7206C29.2477 24.7206 29.3256 24.6643 29.3532 24.581L32.9714 13.6435C33.0084 13.5316 33.1129 13.4561 33.2308 13.4561H34.9041C35.0922 13.4561 35.224 13.6417 35.162 13.8193L31.1115 25.4191Z",fill:"currentColor"}),x.jsxs("defs",{children:[x.jsxs("filter",{id:"filter0_d_21_1677",x:"0.124722",y:"0.124722",width:"22.7729",height:"33.6097",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[x.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),x.jsx("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),x.jsx("feOffset",{}),x.jsx("feGaussianBlur",{stdDeviation:"2.43764"}),x.jsx("feComposite",{in2:"hardAlpha",operator:"out"}),x.jsx("feColorMatrix",{type:"matrix",values:"0 0 0 0 0.219608 0 0 0 0 0.803922 0 0 0 0 0.501961 0 0 0 0.3 0"}),x.jsx("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_21_1677"}),x.jsx("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_21_1677",result:"shape"})]}),x.jsxs("filter",{id:"filter1_i_21_1677",x:"9.28003",y:"21.5739",width:"4.37112",height:"4.37112",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[x.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),x.jsx("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),x.jsx("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),x.jsx("feOffset",{}),x.jsx("feGaussianBlur",{stdDeviation:"0.546392"}),x.jsx("feComposite",{in2:"hardAlpha",operator:"arithmetic",k2:"-1",k3:"1"}),x.jsx("feColorMatrix",{type:"matrix",values:"0 0 0 0 0.219608 0 0 0 0 0.803922 0 0 0 0 0.501961 0 0 0 0.3 0"}),x.jsx("feBlend",{mode:"normal",in2:"shape",result:"effect1_innerShadow_21_1677"})]})]})]}),$k=rL,Tk="Switch",[iL,PI]=al(Tk),[oL,lL]=iL(Tk),sL=p.forwardRef((t,e)=>{const{__scopeSwitch:n,name:r,checked:i,defaultChecked:o,required:l,disabled:s,value:a="on",onCheckedChange:u,...c}=t,[d,f]=p.useState(null),h=st(e,y=>f(y)),g=p.useRef(!1),m=d?!!d.closest("form"):!0,[w=!1,v]=_s({prop:i,defaultProp:o,onChange:u});return p.createElement(oL,{scope:n,checked:w,disabled:s},p.createElement(Ke.button,ie({type:"button",role:"switch","aria-checked":w,"aria-required":l,"data-state":Nk(w),"data-disabled":s?"":void 0,disabled:s,value:a},c,{ref:h,onClick:nt(t.onClick,y=>{v(_=>!_),m&&(g.current=y.isPropagationStopped(),g.current||y.stopPropagation())})})),m&&p.createElement(cL,{control:d,bubbles:!g.current,name:r,value:a,checked:w,required:l,disabled:s,style:{transform:"translateX(-100%)"}}))}),aL="SwitchThumb",uL=p.forwardRef((t,e)=>{const{__scopeSwitch:n,...r}=t,i=lL(aL,n);return p.createElement(Ke.span,ie({"data-state":Nk(i.checked),"data-disabled":i.disabled?"":void 0},r,{ref:e}))}),cL=t=>{const{control:e,checked:n,bubbles:r=!0,...i}=t,o=p.useRef(null),l=rk(n),s=XC(e);return p.useEffect(()=>{const a=o.current,u=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(u,"checked").set;if(l!==n&&d){const f=new Event("click",{bubbles:r});d.call(a,n),a.dispatchEvent(f)}},[l,n,r]),p.createElement("input",ie({type:"checkbox","aria-hidden":!0,defaultChecked:n},i,{tabIndex:-1,ref:o,style:{...t.style,...s,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function Nk(t){return t?"checked":"unchecked"}const Rk=sL,dL=uL,Ok=p.forwardRef(({className:t,...e},n)=>x.jsx(Rk,{className:xt("peer inline-flex h-[22px] w-[44px] shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-accent data-[state=unchecked]:bg-primary",t),...e,ref:n,children:x.jsx(dL,{className:xt("pointer-events-none block h-[18px] w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));Ok.displayName=Rk.displayName;const Xv=p.forwardRef(({className:t,...e},n)=>x.jsx("div",{ref:n,className:xt("rounded-lg border bg-card text-card-foreground shadow-sm",t),...e}));Xv.displayName="Card";const fL=p.forwardRef(({className:t,...e},n)=>x.jsx("div",{ref:n,className:xt("flex flex-col space-y-1.5 p-6",t),...e}));fL.displayName="CardHeader";const hL=p.forwardRef(({className:t,...e},n)=>x.jsx("h3",{ref:n,className:xt("text-2xl font-semibold leading-none tracking-tight",t),...e}));hL.displayName="CardTitle";const pL=p.forwardRef(({className:t,...e},n)=>x.jsx("p",{ref:n,className:xt("text-sm text-muted-foreground",t),...e}));pL.displayName="CardDescription";const mL=p.forwardRef(({className:t,...e},n)=>x.jsx("div",{ref:n,className:xt("p-6 pt-0",t),...e}));mL.displayName="CardContent";const gL=p.forwardRef(({className:t,...e},n)=>x.jsx("div",{ref:n,className:xt("flex items-center p-6 pt-0",t),...e}));gL.displayName="CardFooter";/**
|
|
170
170
|
* @remix-run/router v1.13.0
|
|
171
171
|
*
|
|
172
172
|
* Copyright (c) Remix Software Inc.
|
|
@@ -175,8 +175,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
175
175
|
* LICENSE.md file in the root directory of this source tree.
|
|
176
176
|
*
|
|
177
177
|
* @license MIT
|
|
178
|
-
*/function yt(){return yt=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},yt.apply(this,arguments)}var wt;(function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"})(wt||(wt={}));const s_="popstate";function vL(t){t===void 0&&(t={});function e(r,i){let{pathname:o,search:l,hash:s}=r.location;return Tu("",{pathname:o,search:l,hash:s},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(r,i){return typeof i=="string"?i:Ku(i)}return xL(e,n,null,t)}function Oe(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function ol(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function yL(){return Math.random().toString(36).substr(2,8)}function a_(t,e){return{usr:t.state,key:t.key,idx:e}}function Tu(t,e,n,r){return n===void 0&&(n=null),yt({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?Ni(e):e,{state:n,key:e&&e.key||r||yL()})}function Ku(t){let{pathname:e="/",search:n="",hash:r=""}=t;return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function Ni(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substr(n),t=t.substr(0,n));let r=t.indexOf("?");r>=0&&(e.search=t.substr(r),t=t.substr(0,r)),t&&(e.pathname=t)}return e}function xL(t,e,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:o=!1}=r,l=i.history,s=wt.Pop,a=null,u=c();u==null&&(u=0,l.replaceState(yt({},l.state,{idx:u}),""));function c(){return(l.state||{idx:null}).idx}function d(){s=wt.Pop;let w=c(),v=w==null?null:w-u;u=w,a&&a({action:s,location:m.location,delta:v})}function f(w,v){s=wt.Push;let y=Tu(m.location,w,v);n&&n(y,w),u=c()+1;let _=a_(y,u),S=m.createHref(y);try{l.pushState(_,"",S)}catch(E){if(E instanceof DOMException&&E.name==="DataCloneError")throw E;i.location.assign(S)}o&&a&&a({action:s,location:m.location,delta:1})}function h(w,v){s=wt.Replace;let y=Tu(m.location,w,v);n&&n(y,w),u=c();let _=a_(y,u),S=m.createHref(y);l.replaceState(_,"",S),o&&a&&a({action:s,location:m.location,delta:0})}function g(w){let v=i.location.origin!=="null"?i.location.origin:i.location.href,y=typeof w=="string"?w:Ku(w);return Oe(v,"No window.location.(origin|href) available to create URL for href: "+y),new URL(y,v)}let m={get action(){return s},get location(){return t(i,l)},listen(w){if(a)throw new Error("A history only accepts one active listener");return i.addEventListener(s_,d),a=w,()=>{i.removeEventListener(s_,d),a=null}},createHref(w){return e(i,w)},createURL:g,encodeLocation(w){let v=g(w);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:f,replace:h,go(w){return l.go(w)}};return m}var St;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(St||(St={}));const _L=new Set(["lazy","caseSensitive","path","id","index","children"]);function wL(t){return t.index===!0}function Km(t,e,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),t.map((i,o)=>{let l=[...n,o],s=typeof i.id=="string"?i.id:l.join("-");if(Oe(i.index!==!0||!i.children,"Cannot specify children on an index route"),Oe(!r[s],'Found a route id collision on id "'+s+`". Route id's must be globally unique within Data Router usages`),wL(i)){let a=yt({},i,e(i),{id:s});return r[s]=a,a}else{let a=yt({},i,e(i),{id:s,children:void 0});return r[s]=a,i.children&&(a.children=Km(i.children,e,l,r)),a}})}function Vl(t,e,n){n===void 0&&(n="/");let r=typeof e=="string"?Ni(e):e,i=Zu(r.pathname||"/",n);if(i==null)return null;let o=Pk(t);EL(o);let l=null;for(let s=0;l==null&&s<o.length;++s)l=PL(o[s],LL(i));return l}function SL(t,e){let{route:n,pathname:r,params:i}=t;return{id:n.id,pathname:r,params:i,data:e[n.id],handle:n.handle}}function Pk(t,e,n,r){e===void 0&&(e=[]),n===void 0&&(n=[]),r===void 0&&(r="");let i=(o,l,s)=>{let a={relativePath:s===void 0?o.path||"":s,caseSensitive:o.caseSensitive===!0,childrenIndex:l,route:o};a.relativePath.startsWith("/")&&(Oe(a.relativePath.startsWith(r),'Absolute route path "'+a.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),a.relativePath=a.relativePath.slice(r.length));let u=io([r,a.relativePath]),c=n.concat(a);o.children&&o.children.length>0&&(Oe(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),Pk(o.children,e,c,u)),!(o.path==null&&!o.index)&&e.push({path:u,score:RL(u,o.index),routesMeta:c})};return t.forEach((o,l)=>{var s;if(o.path===""||!((s=o.path)!=null&&s.includes("?")))i(o,l);else for(let a of Ak(o.path))i(o,l,a)}),e}function Ak(t){let e=t.split("/");if(e.length===0)return[];let[n,...r]=e,i=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return i?[o,""]:[o];let l=Ak(r.join("/")),s=[];return s.push(...l.map(a=>a===""?o:[o,a].join("/"))),i&&s.push(...l),s.map(a=>t.startsWith("/")&&a===""?"/":a)}function EL(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:OL(e.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const CL=/^:\w+$/,kL=3,bL=2,$L=1,TL=10,NL=-2,u_=t=>t==="*";function RL(t,e){let n=t.split("/"),r=n.length;return n.some(u_)&&(r+=NL),e&&(r+=bL),n.filter(i=>!u_(i)).reduce((i,o)=>i+(CL.test(o)?kL:o===""?$L:TL),r)}function OL(t,e){return t.length===e.length&&t.slice(0,-1).every((r,i)=>r===e[i])?t[t.length-1]-e[e.length-1]:0}function PL(t,e){let{routesMeta:n}=t,r={},i="/",o=[];for(let l=0;l<n.length;++l){let s=n[l],a=l===n.length-1,u=i==="/"?e:e.slice(i.length)||"/",c=AL({path:s.relativePath,caseSensitive:s.caseSensitive,end:a},u);if(!c)return null;Object.assign(r,c.params);let d=s.route;o.push({params:r,pathname:io([i,c.pathname]),pathnameBase:zL(io([i,c.pathnameBase])),route:d}),c.pathnameBase!=="/"&&(i=io([i,c.pathnameBase]))}return o}function AL(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[n,r]=ML(t.path,t.caseSensitive,t.end),i=e.match(n);if(!i)return null;let o=i[0],l=o.replace(/(.)\/+$/,"$1"),s=i.slice(1);return{params:r.reduce((u,c,d)=>{let{paramName:f,isOptional:h}=c;if(f==="*"){let m=s[d]||"";l=o.slice(0,o.length-m.length).replace(/(.)\/+$/,"$1")}const g=s[d];return h&&!g?u[f]=void 0:u[f]=DL(g||"",f),u},{}),pathname:o,pathnameBase:l,pattern:t}}function ML(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!0),ol(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let r=[],i="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:(\w+)(\?)?/g,(l,s,a)=>(r.push({paramName:s,isOptional:a!=null}),a?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(r.push({paramName:"*"}),i+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":t!==""&&t!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),r]}function LL(t){try{return decodeURI(t)}catch(e){return ol(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),t}}function DL(t,e){try{return decodeURIComponent(t)}catch(n){return ol(!1,'The value for the URL param "'+e+'" will not be decoded because'+(' the string "'+t+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+n+").")),t}}function Zu(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,r=t.charAt(n);return r&&r!=="/"?null:t.slice(n)||"/"}function IL(t,e){e===void 0&&(e="/");let{pathname:n,search:r="",hash:i=""}=typeof t=="string"?Ni(t):t;return{pathname:n?n.startsWith("/")?n:jL(n,e):e,search:FL(r),hash:BL(i)}}function jL(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function Yh(t,e,n,r){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function Mk(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function Lk(t){return Mk(t).map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function Dk(t,e,n,r){r===void 0&&(r=!1);let i;typeof t=="string"?i=Ni(t):(i=yt({},t),Oe(!i.pathname||!i.pathname.includes("?"),Yh("?","pathname","search",i)),Oe(!i.pathname||!i.pathname.includes("#"),Yh("#","pathname","hash",i)),Oe(!i.search||!i.search.includes("#"),Yh("#","search","hash",i)));let o=t===""||i.pathname==="",l=o?"/":i.pathname,s;if(l==null)s=n;else if(r){let d=e[e.length-1].replace(/^\//,"").split("/");if(l.startsWith("..")){let f=l.split("/");for(;f[0]==="..";)f.shift(),d.pop();i.pathname=f.join("/")}s="/"+d.join("/")}else{let d=e.length-1;if(l.startsWith("..")){let f=l.split("/");for(;f[0]==="..";)f.shift(),d-=1;i.pathname=f.join("/")}s=d>=0?e[d]:"/"}let a=IL(i,s),u=l&&l!=="/"&&l.endsWith("/"),c=(o||l===".")&&n.endsWith("/");return!a.pathname.endsWith("/")&&(u||c)&&(a.pathname+="/"),a}const io=t=>t.join("/").replace(/\/\/+/g,"/"),zL=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),FL=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,BL=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;class Jv{constructor(e,n,r,i){i===void 0&&(i=!1),this.status=e,this.statusText=n||"",this.internal=i,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function Ik(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const jk=["post","put","patch","delete"],UL=new Set(jk),WL=["get",...jk],VL=new Set(WL),HL=new Set([301,302,303,307,308]),KL=new Set([307,308]),Xh={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ZL={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},oa={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},zk=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,GL=t=>({hasErrorBoundary:!!t.hasErrorBoundary}),Fk="remix-router-transitions";function YL(t){const e=t.window?t.window:typeof window<"u"?window:void 0,n=typeof e<"u"&&typeof e.document<"u"&&typeof e.document.createElement<"u",r=!n;Oe(t.routes.length>0,"You must provide a non-empty routes array to createRouter");let i;if(t.mapRouteProperties)i=t.mapRouteProperties;else if(t.detectErrorBoundary){let T=t.detectErrorBoundary;i=M=>({hasErrorBoundary:T(M)})}else i=GL;let o={},l=Km(t.routes,i,void 0,o),s,a=t.basename||"/",u=yt({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_prependBasename:!1},t.future),c=null,d=new Set,f=null,h=null,g=null,m=t.hydrationData!=null,w=Vl(l,t.history.location,a),v=null;if(w==null){let T=Jn(404,{pathname:t.history.location.pathname}),{matches:M,route:z}=v_(l);w=M,v={[z.id]:T}}let y=!w.some(T=>T.route.lazy)&&(!w.some(T=>T.route.loader)||t.hydrationData!=null),_,S={historyAction:t.history.action,location:t.history.location,matches:w,initialized:y,navigation:Xh,restoreScrollPosition:t.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:t.hydrationData&&t.hydrationData.loaderData||{},actionData:t.hydrationData&&t.hydrationData.actionData||null,errors:t.hydrationData&&t.hydrationData.errors||v,fetchers:new Map,blockers:new Map},E=wt.Pop,$=!1,C,N=!1,R=new Map,b=null,L=!1,F=!1,le=[],V=[],H=new Map,O=0,A=-1,k=new Map,j=new Set,I=new Map,Z=new Map,ne=new Set,ke=new Map,ye=new Map,We=!1;function Fe(){if(c=t.history.listen(T=>{let{action:M,location:z,delta:G}=T;if(We){We=!1;return}ol(ye.size===0||G!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let oe=ay({currentLocation:S.location,nextLocation:z,historyAction:M});if(oe&&G!=null){We=!0,t.history.go(G*-1),Gu(oe,{state:"blocked",location:z,proceed(){Gu(oe,{state:"proceeding",proceed:void 0,reset:void 0,location:z}),t.history.go(G)},reset(){let be=new Map(S.blockers);be.set(oe,oa),$e({blockers:be})}});return}return Je(M,z)}),n){lD(e,R);let T=()=>sD(e,R);e.addEventListener("pagehide",T),b=()=>e.removeEventListener("pagehide",T)}return S.initialized||Je(wt.Pop,S.location),_}function te(){c&&c(),b&&b(),d.clear(),C&&C.abort(),S.fetchers.forEach((T,M)=>Ln(M)),S.blockers.forEach((T,M)=>sy(M))}function Ie(T){return d.add(T),()=>d.delete(T)}function $e(T,M){M===void 0&&(M={}),S=yt({},S,T);let z=[],G=[];u.v7_fetcherPersist&&S.fetchers.forEach((oe,be)=>{oe.state==="idle"&&(ne.has(be)?G.push(be):z.push(be))}),[...d].forEach(oe=>oe(S,{deletedFetchers:G,unstable_viewTransitionOpts:M.viewTransitionOpts,unstable_flushSync:M.flushSync===!0})),u.v7_fetcherPersist&&(z.forEach(oe=>S.fetchers.delete(oe)),G.forEach(oe=>Ln(oe)))}function Re(T,M,z){var G,oe;let{flushSync:be}=z===void 0?{}:z,he=S.actionData!=null&&S.navigation.formMethod!=null&&yr(S.navigation.formMethod)&&S.navigation.state==="loading"&&((G=T.state)==null?void 0:G._isRedirect)!==!0,fe;M.actionData?Object.keys(M.actionData).length>0?fe=M.actionData:fe=null:he?fe=S.actionData:fe=null;let ae=M.loaderData?g_(S.loaderData,M.loaderData,M.matches||[],M.errors):S.loaderData,Ae=S.blockers;Ae.size>0&&(Ae=new Map(Ae),Ae.forEach((Ze,ut)=>Ae.set(ut,oa)));let Vt=$===!0||S.navigation.formMethod!=null&&yr(S.navigation.formMethod)&&((oe=T.state)==null?void 0:oe._isRedirect)!==!0;s&&(l=s,s=void 0),L||E===wt.Pop||(E===wt.Push?t.history.push(T,T.state):E===wt.Replace&&t.history.replace(T,T.state));let Te;if(E===wt.Pop){let Ze=R.get(S.location.pathname);Ze&&Ze.has(T.pathname)?Te={currentLocation:S.location,nextLocation:T}:R.has(T.pathname)&&(Te={currentLocation:T,nextLocation:S.location})}else if(N){let Ze=R.get(S.location.pathname);Ze?Ze.add(T.pathname):(Ze=new Set([T.pathname]),R.set(S.location.pathname,Ze)),Te={currentLocation:S.location,nextLocation:T}}$e(yt({},M,{actionData:fe,loaderData:ae,historyAction:E,location:T,initialized:!0,navigation:Xh,revalidation:"idle",restoreScrollPosition:cy(T,M.matches||S.matches),preventScrollReset:Vt,blockers:Ae}),{viewTransitionOpts:Te,flushSync:be===!0}),E=wt.Pop,$=!1,N=!1,L=!1,F=!1,le=[],V=[]}async function Se(T,M){if(typeof T=="number"){t.history.go(T);return}let z=Zm(S.location,S.matches,a,u.v7_prependBasename,T,M==null?void 0:M.fromRouteId,M==null?void 0:M.relative),{path:G,submission:oe,error:be}=c_(u.v7_normalizeFormMethod,!1,z,M),he=S.location,fe=Tu(S.location,G,M&&M.state);fe=yt({},fe,t.history.encodeLocation(fe));let ae=M&&M.replace!=null?M.replace:void 0,Ae=wt.Push;ae===!0?Ae=wt.Replace:ae===!1||oe!=null&&yr(oe.formMethod)&&oe.formAction===S.location.pathname+S.location.search&&(Ae=wt.Replace);let Vt=M&&"preventScrollReset"in M?M.preventScrollReset===!0:void 0,Te=(M&&M.unstable_flushSync)===!0,Ze=ay({currentLocation:he,nextLocation:fe,historyAction:Ae});if(Ze){Gu(Ze,{state:"blocked",location:fe,proceed(){Gu(Ze,{state:"proceeding",proceed:void 0,reset:void 0,location:fe}),Se(T,M)},reset(){let ut=new Map(S.blockers);ut.set(Ze,oa),$e({blockers:ut})}});return}return await Je(Ae,fe,{submission:oe,pendingError:be,preventScrollReset:Vt,replace:M&&M.replace,enableViewTransition:M&&M.unstable_viewTransition,flushSync:Te})}function Le(){if(En(),$e({revalidation:"loading"}),S.navigation.state!=="submitting"){if(S.navigation.state==="idle"){Je(S.historyAction,S.location,{startUninterruptedRevalidation:!0});return}Je(E||S.historyAction,S.navigation.location,{overrideNavigation:S.navigation})}}async function Je(T,M,z){C&&C.abort(),C=null,E=T,L=(z&&z.startUninterruptedRevalidation)===!0,gb(S.location,S.matches),$=(z&&z.preventScrollReset)===!0,N=(z&&z.enableViewTransition)===!0;let G=s||l,oe=z&&z.overrideNavigation,be=Vl(G,M,a),he=(z&&z.flushSync)===!0;if(!be){let ut=Jn(404,{pathname:M.pathname}),{matches:an,route:Or}=v_(G);qf(),Re(M,{matches:an,loaderData:{},errors:{[Or.id]:ut}},{flushSync:he});return}if(S.initialized&&!F&&eD(S.location,M)&&!(z&&z.submission&&yr(z.submission.formMethod))){Re(M,{matches:be},{flushSync:he});return}C=new AbortController;let fe=sa(t.history,M,C.signal,z&&z.submission),ae,Ae;if(z&&z.pendingError)Ae={[ja(be).route.id]:z.pendingError};else if(z&&z.submission&&yr(z.submission.formMethod)){let ut=await Wt(fe,M,z.submission,be,{replace:z.replace,flushSync:he});if(ut.shortCircuited)return;ae=ut.pendingActionData,Ae=ut.pendingActionError,oe=Jh(M,z.submission),he=!1,fe=new Request(fe.url,{signal:fe.signal})}let{shortCircuited:Vt,loaderData:Te,errors:Ze}=await Sn(fe,M,be,oe,z&&z.submission,z&&z.fetcherSubmission,z&&z.replace,he,ae,Ae);Vt||(C=null,Re(M,yt({matches:be},ae?{actionData:ae}:{},{loaderData:Te,errors:Ze})))}async function Wt(T,M,z,G,oe){oe===void 0&&(oe={}),En();let be=iD(M,z);$e({navigation:be},{flushSync:oe.flushSync===!0});let he,fe=Ym(G,M);if(!fe.route.action&&!fe.route.lazy)he={type:St.error,error:Jn(405,{method:T.method,pathname:M.pathname,routeId:fe.route.id})};else if(he=await la("action",T,fe,G,o,i,a),T.signal.aborted)return{shortCircuited:!0};if(rs(he)){let ae;return oe&&oe.replace!=null?ae=oe.replace:ae=he.location===S.location.pathname+S.location.search,await at(S,he,{submission:z,replace:ae}),{shortCircuited:!0}}if(za(he)){let ae=ja(G,fe.route.id);return(oe&&oe.replace)!==!0&&(E=wt.Push),{pendingActionData:{},pendingActionError:{[ae.route.id]:he.error}}}if(Do(he))throw Jn(400,{type:"defer-action"});return{pendingActionData:{[fe.route.id]:he.data}}}async function Sn(T,M,z,G,oe,be,he,fe,ae,Ae){let Vt=G||Jh(M,oe),Te=oe||be||__(Vt),Ze=s||l,[ut,an]=d_(t.history,S,z,Te,M,F,le,V,ne,I,j,Ze,a,ae,Ae);if(qf(Ge=>!(z&&z.some(Xn=>Xn.route.id===Ge))||ut&&ut.some(Xn=>Xn.route.id===Ge)),A=++O,ut.length===0&&an.length===0){let Ge=Co();return Re(M,yt({matches:z,loaderData:{},errors:Ae||null},ae?{actionData:ae}:{},Ge?{fetchers:new Map(S.fetchers)}:{}),{flushSync:fe}),{shortCircuited:!0}}if(!L){an.forEach(Xn=>{let kt=S.fetchers.get(Xn.key),ko=aa(void 0,kt?kt.data:void 0);S.fetchers.set(Xn.key,ko)});let Ge=ae||S.actionData;$e(yt({navigation:Vt},Ge?Object.keys(Ge).length===0?{actionData:null}:{actionData:Ge}:{},an.length>0?{fetchers:new Map(S.fetchers)}:{}),{flushSync:fe})}an.forEach(Ge=>{H.has(Ge.key)&>(Ge.key),Ge.controller&&H.set(Ge.key,Ge.controller)});let Or=()=>an.forEach(Ge=>gt(Ge.key));C&&C.signal.addEventListener("abort",Or);let{results:Vs,loaderResults:eh,fetcherResults:ml}=await ln(S.matches,z,ut,an,T);if(T.signal.aborted)return{shortCircuited:!0};C&&C.signal.removeEventListener("abort",Or),an.forEach(Ge=>H.delete(Ge.key));let dr=y_(Vs);if(dr){if(dr.idx>=ut.length){let Ge=an[dr.idx-ut.length].key;j.add(Ge)}return await at(S,dr.result,{replace:he}),{shortCircuited:!0}}let{loaderData:Yu,errors:th}=m_(S,z,ut,eh,Ae,an,ml,ke);ke.forEach((Ge,Xn)=>{Ge.subscribe(kt=>{(kt||Ge.done)&&ke.delete(Xn)})});let nh=Co(),rh=Ws(A),gl=nh||rh||an.length>0;return yt({loaderData:Yu,errors:th},gl?{fetchers:new Map(S.fetchers)}:{})}function cr(T,M,z,G){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");H.has(T)&>(T);let oe=(G&&G.unstable_flushSync)===!0,be=s||l,he=Zm(S.location,S.matches,a,u.v7_prependBasename,z,M,G==null?void 0:G.relative),fe=Vl(be,he,a);if(!fe){At(T,M,Jn(404,{pathname:he}),{flushSync:oe});return}let{path:ae,submission:Ae,error:Vt}=c_(u.v7_normalizeFormMethod,!0,he,G);if(Vt){At(T,M,Vt,{flushSync:oe});return}let Te=Ym(fe,ae);if($=(G&&G.preventScrollReset)===!0,Ae&&yr(Ae.formMethod)){je(T,M,ae,Te,fe,oe,Ae);return}I.set(T,{routeId:M,path:ae}),Tt(T,M,ae,Te,fe,oe,Ae)}async function je(T,M,z,G,oe,be,he){if(En(),I.delete(T),!G.route.action&&!G.route.lazy){let kt=Jn(405,{method:he.formMethod,pathname:z,routeId:M});At(T,M,kt,{flushSync:be});return}let fe=S.fetchers.get(T);_t(T,oD(he,fe),{flushSync:be});let ae=new AbortController,Ae=sa(t.history,z,ae.signal,he);H.set(T,ae);let Vt=O,Te=await la("action",Ae,G,oe,o,i,a);if(Ae.signal.aborted){H.get(T)===ae&&H.delete(T);return}if(ne.has(T)){_t(T,Di(void 0));return}if(rs(Te))if(H.delete(T),A>Vt){_t(T,Di(void 0));return}else return j.add(T),_t(T,aa(he)),at(S,Te,{fetcherSubmission:he});if(za(Te)){At(T,M,Te.error);return}if(Do(Te))throw Jn(400,{type:"defer-action"});let Ze=S.navigation.location||S.location,ut=sa(t.history,Ze,ae.signal),an=s||l,Or=S.navigation.state!=="idle"?Vl(an,S.navigation.location,a):S.matches;Oe(Or,"Didn't find any matches after fetcher action");let Vs=++O;k.set(T,Vs);let eh=aa(he,Te.data);S.fetchers.set(T,eh);let[ml,dr]=d_(t.history,S,Or,he,Ze,F,le,V,ne,I,j,an,a,{[G.route.id]:Te.data},void 0);dr.filter(kt=>kt.key!==T).forEach(kt=>{let ko=kt.key,dy=S.fetchers.get(ko),yb=aa(void 0,dy?dy.data:void 0);S.fetchers.set(ko,yb),H.has(ko)&>(ko),kt.controller&&H.set(ko,kt.controller)}),$e({fetchers:new Map(S.fetchers)});let Yu=()=>dr.forEach(kt=>gt(kt.key));ae.signal.addEventListener("abort",Yu);let{results:th,loaderResults:nh,fetcherResults:rh}=await ln(S.matches,Or,ml,dr,ut);if(ae.signal.aborted)return;ae.signal.removeEventListener("abort",Yu),k.delete(T),H.delete(T),dr.forEach(kt=>H.delete(kt.key));let gl=y_(th);if(gl){if(gl.idx>=ml.length){let kt=dr[gl.idx-ml.length].key;j.add(kt)}return at(S,gl.result)}let{loaderData:Ge,errors:Xn}=m_(S,S.matches,ml,nh,void 0,dr,rh,ke);if(S.fetchers.has(T)){let kt=Di(Te.data);S.fetchers.set(T,kt)}Ws(Vs),S.navigation.state==="loading"&&Vs>A?(Oe(E,"Expected pending action"),C&&C.abort(),Re(S.navigation.location,{matches:Or,loaderData:Ge,errors:Xn,fetchers:new Map(S.fetchers)})):($e({errors:Xn,loaderData:g_(S.loaderData,Ge,Or,Xn),fetchers:new Map(S.fetchers)}),F=!1)}async function Tt(T,M,z,G,oe,be,he){let fe=S.fetchers.get(T);_t(T,aa(he,fe?fe.data:void 0),{flushSync:be});let ae=new AbortController,Ae=sa(t.history,z,ae.signal);H.set(T,ae);let Vt=O,Te=await la("loader",Ae,G,oe,o,i,a);if(Do(Te)&&(Te=await Wk(Te,Ae.signal,!0)||Te),H.get(T)===ae&&H.delete(T),!Ae.signal.aborted){if(ne.has(T)){_t(T,Di(void 0));return}if(rs(Te))if(A>Vt){_t(T,Di(void 0));return}else{j.add(T),await at(S,Te);return}if(za(Te)){At(T,M,Te.error);return}Oe(!Do(Te),"Unhandled fetcher deferred data"),_t(T,Di(Te.data))}}async function at(T,M,z){let{submission:G,fetcherSubmission:oe,replace:be}=z===void 0?{}:z;M.revalidate&&(F=!0);let he=Tu(T.location,M.location,{_isRedirect:!0});if(Oe(he,"Expected a location on the redirect navigation"),n){let Ze=!1;if(M.reloadDocument)Ze=!0;else if(zk.test(M.location)){const ut=t.history.createURL(M.location);Ze=ut.origin!==e.location.origin||Zu(ut.pathname,a)==null}if(Ze){be?e.location.replace(M.location):e.location.assign(M.location);return}}C=null;let fe=be===!0?wt.Replace:wt.Push,{formMethod:ae,formAction:Ae,formEncType:Vt}=T.navigation;!G&&!oe&&ae&&Ae&&Vt&&(G=__(T.navigation));let Te=G||oe;if(KL.has(M.status)&&Te&&yr(Te.formMethod))await Je(fe,he,{submission:yt({},Te,{formAction:M.location}),preventScrollReset:$});else{let Ze=Jh(he,G);await Je(fe,he,{overrideNavigation:Ze,fetcherSubmission:oe,preventScrollReset:$})}}async function ln(T,M,z,G,oe){let be=await Promise.all([...z.map(ae=>la("loader",oe,ae,M,o,i,a)),...G.map(ae=>ae.matches&&ae.match&&ae.controller?la("loader",sa(t.history,ae.path,ae.controller.signal),ae.match,ae.matches,o,i,a):{type:St.error,error:Jn(404,{pathname:ae.path})})]),he=be.slice(0,z.length),fe=be.slice(z.length);return await Promise.all([x_(T,z,he,he.map(()=>oe.signal),!1,S.loaderData),x_(T,G.map(ae=>ae.match),fe,G.map(ae=>ae.controller?ae.controller.signal:null),!0)]),{results:be,loaderResults:he,fetcherResults:fe}}function En(){F=!0,le.push(...qf()),I.forEach((T,M)=>{H.has(M)&&(V.push(M),gt(M))})}function _t(T,M,z){z===void 0&&(z={}),S.fetchers.set(T,M),$e({fetchers:new Map(S.fetchers)},{flushSync:(z&&z.flushSync)===!0})}function At(T,M,z,G){G===void 0&&(G={});let oe=ja(S.matches,M);Ln(T),$e({errors:{[oe.route.id]:z},fetchers:new Map(S.fetchers)},{flushSync:(G&&G.flushSync)===!0})}function sn(T){return u.v7_fetcherPersist&&(Z.set(T,(Z.get(T)||0)+1),ne.has(T)&&ne.delete(T)),S.fetchers.get(T)||ZL}function Ln(T){let M=S.fetchers.get(T);H.has(T)&&!(M&&M.state==="loading"&&k.has(T))&>(T),I.delete(T),k.delete(T),j.delete(T),ne.delete(T),S.fetchers.delete(T)}function ei(T){if(u.v7_fetcherPersist){let M=(Z.get(T)||0)-1;M<=0?(Z.delete(T),ne.add(T)):Z.set(T,M)}else Ln(T);$e({fetchers:new Map(S.fetchers)})}function gt(T){let M=H.get(T);Oe(M,"Expected fetch controller: "+T),M.abort(),H.delete(T)}function Rr(T){for(let M of T){let z=sn(M),G=Di(z.data);S.fetchers.set(M,G)}}function Co(){let T=[],M=!1;for(let z of j){let G=S.fetchers.get(z);Oe(G,"Expected fetcher: "+z),G.state==="loading"&&(j.delete(z),T.push(z),M=!0)}return Rr(T),M}function Ws(T){let M=[];for(let[z,G]of k)if(G<T){let oe=S.fetchers.get(z);Oe(oe,"Expected fetcher: "+z),oe.state==="loading"&&(gt(z),k.delete(z),M.push(z))}return Rr(M),M.length>0}function pb(T,M){let z=S.blockers.get(T)||oa;return ye.get(T)!==M&&ye.set(T,M),z}function sy(T){S.blockers.delete(T),ye.delete(T)}function Gu(T,M){let z=S.blockers.get(T)||oa;Oe(z.state==="unblocked"&&M.state==="blocked"||z.state==="blocked"&&M.state==="blocked"||z.state==="blocked"&&M.state==="proceeding"||z.state==="blocked"&&M.state==="unblocked"||z.state==="proceeding"&&M.state==="unblocked","Invalid blocker state transition: "+z.state+" -> "+M.state);let G=new Map(S.blockers);G.set(T,M),$e({blockers:G})}function ay(T){let{currentLocation:M,nextLocation:z,historyAction:G}=T;if(ye.size===0)return;ye.size>1&&ol(!1,"A router only supports one blocker at a time");let oe=Array.from(ye.entries()),[be,he]=oe[oe.length-1],fe=S.blockers.get(be);if(!(fe&&fe.state==="proceeding")&&he({currentLocation:M,nextLocation:z,historyAction:G}))return be}function qf(T){let M=[];return ke.forEach((z,G)=>{(!T||T(G))&&(z.cancel(),M.push(G),ke.delete(G))}),M}function mb(T,M,z){if(f=T,g=M,h=z||null,!m&&S.navigation===Xh){m=!0;let G=cy(S.location,S.matches);G!=null&&$e({restoreScrollPosition:G})}return()=>{f=null,g=null,h=null}}function uy(T,M){return h&&h(T,M.map(G=>SL(G,S.loaderData)))||T.key}function gb(T,M){if(f&&g){let z=uy(T,M);f[z]=g()}}function cy(T,M){if(f){let z=uy(T,M),G=f[z];if(typeof G=="number")return G}return null}function vb(T){o={},s=Km(T,i,void 0,o)}return _={get basename(){return a},get state(){return S},get routes(){return l},get window(){return e},initialize:Fe,subscribe:Ie,enableScrollRestoration:mb,navigate:Se,fetch:cr,revalidate:Le,createHref:T=>t.history.createHref(T),encodeLocation:T=>t.history.encodeLocation(T),getFetcher:sn,deleteFetcher:ei,dispose:te,getBlocker:pb,deleteBlocker:sy,_internalFetchControllers:H,_internalActiveDeferreds:ke,_internalSetRoutes:vb},_}function XL(t){return t!=null&&("formData"in t&&t.formData!=null||"body"in t&&t.body!==void 0)}function Zm(t,e,n,r,i,o,l){let s,a;if(o){s=[];for(let c of e)if(s.push(c),c.route.id===o){a=c;break}}else s=e,a=e[e.length-1];let u=Dk(i||".",Lk(s),Zu(t.pathname,n)||t.pathname,l==="path");return i==null&&(u.search=t.search,u.hash=t.hash),(i==null||i===""||i===".")&&a&&a.route.index&&!Qv(u.search)&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),r&&n!=="/"&&(u.pathname=u.pathname==="/"?n:io([n,u.pathname])),Ku(u)}function c_(t,e,n,r){if(!r||!XL(r))return{path:n};if(r.formMethod&&!rD(r.formMethod))return{path:n,error:Jn(405,{method:r.formMethod})};let i=()=>({path:n,error:Jn(400,{type:"invalid-body"})}),o=r.formMethod||"get",l=t?o.toUpperCase():o.toLowerCase(),s=Uk(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!yr(l))return i();let f=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((h,g)=>{let[m,w]=g;return""+h+m+"="+w+`
|
|
179
|
-
`},""):String(r.body);return{path:n,submission:{formMethod:l,formAction:s,formEncType:r.formEncType,formData:void 0,json:void 0,text:f}}}else if(r.formEncType==="application/json"){if(!yr(l))return i();try{let f=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:l,formAction:s,formEncType:r.formEncType,formData:void 0,json:f,text:void 0}}}catch{return i()}}}Oe(typeof FormData=="function","FormData is not available in this environment");let a,u;if(r.formData)a=Gm(r.formData),u=r.formData;else if(r.body instanceof FormData)a=Gm(r.body),u=r.body;else if(r.body instanceof URLSearchParams)a=r.body,u=p_(a);else if(r.body==null)a=new URLSearchParams,u=new FormData;else try{a=new URLSearchParams(r.body),u=p_(a)}catch{return i()}let c={formMethod:l,formAction:s,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:u,json:void 0,text:void 0};if(yr(c.formMethod))return{path:n,submission:c};let d=Ni(n);return e&&d.search&&Qv(d.search)&&a.append("index",""),d.search="?"+a,{path:Ku(d),submission:c}}function JL(t,e){let n=t;if(e){let r=t.findIndex(i=>i.route.id===e);r>=0&&(n=t.slice(0,r))}return n}function d_(t,e,n,r,i,o,l,s,a,u,c,d,f,h,g){let m=g?Object.values(g)[0]:h?Object.values(h)[0]:void 0,w=t.createURL(e.location),v=t.createURL(i),y=g?Object.keys(g)[0]:void 0,S=JL(n,y).filter(($,C)=>{if($.route.lazy)return!0;if($.route.loader==null)return!1;if(QL(e.loaderData,e.matches[C],$)||l.some(b=>b===$.route.id))return!0;let N=e.matches[C],R=$;return f_($,yt({currentUrl:w,currentParams:N.params,nextUrl:v,nextParams:R.params},r,{actionResult:m,defaultShouldRevalidate:o||w.pathname+w.search===v.pathname+v.search||w.search!==v.search||Bk(N,R)}))}),E=[];return u.forEach(($,C)=>{if(!n.some(F=>F.route.id===$.routeId)||a.has(C))return;let N=Vl(d,$.path,f);if(!N){E.push({key:C,routeId:$.routeId,path:$.path,matches:null,match:null,controller:null});return}let R=e.fetchers.get(C),b=Ym(N,$.path),L=!1;c.has(C)?L=!1:s.includes(C)?L=!0:R&&R.state!=="idle"&&R.data===void 0?L=o:L=f_(b,yt({currentUrl:w,currentParams:e.matches[e.matches.length-1].params,nextUrl:v,nextParams:n[n.length-1].params},r,{actionResult:m,defaultShouldRevalidate:o})),L&&E.push({key:C,routeId:$.routeId,path:$.path,matches:N,match:b,controller:new AbortController})}),[S,E]}function QL(t,e,n){let r=!e||n.route.id!==e.route.id,i=t[n.route.id]===void 0;return r||i}function Bk(t,e){let n=t.route.path;return t.pathname!==e.pathname||n!=null&&n.endsWith("*")&&t.params["*"]!==e.params["*"]}function f_(t,e){if(t.route.shouldRevalidate){let n=t.route.shouldRevalidate(e);if(typeof n=="boolean")return n}return e.defaultShouldRevalidate}async function h_(t,e,n){if(!t.lazy)return;let r=await t.lazy();if(!t.lazy)return;let i=n[t.id];Oe(i,"No route found in manifest");let o={};for(let l in r){let a=i[l]!==void 0&&l!=="hasErrorBoundary";ol(!a,'Route "'+i.id+'" has a static property "'+l+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+l+'" will be ignored.')),!a&&!_L.has(l)&&(o[l]=r[l])}Object.assign(i,o),Object.assign(i,yt({},e(i),{lazy:void 0}))}async function la(t,e,n,r,i,o,l,s){s===void 0&&(s={});let a,u,c,d=g=>{let m,w=new Promise((v,y)=>m=y);return c=()=>m(),e.signal.addEventListener("abort",c),Promise.race([g({request:e,params:n.params,context:s.requestContext}),w])};try{let g=n.route[t];if(n.route.lazy)if(g){let m,w=await Promise.all([d(g).catch(v=>{m=v}),h_(n.route,o,i)]);if(m)throw m;u=w[0]}else if(await h_(n.route,o,i),g=n.route[t],g)u=await d(g);else if(t==="action"){let m=new URL(e.url),w=m.pathname+m.search;throw Jn(405,{method:e.method,pathname:w,routeId:n.route.id})}else return{type:St.data,data:void 0};else if(g)u=await d(g);else{let m=new URL(e.url),w=m.pathname+m.search;throw Jn(404,{pathname:w})}Oe(u!==void 0,"You defined "+(t==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+t+"` ")+"function. Please return a value or `null`.")}catch(g){a=St.error,u=g}finally{c&&e.signal.removeEventListener("abort",c)}if(nD(u)){let g=u.status;if(HL.has(g)){let v=u.headers.get("Location");if(Oe(v,"Redirects returned/thrown from loaders/actions must have a Location header"),!zk.test(v))v=Zm(new URL(e.url),r.slice(0,r.indexOf(n)+1),l,!0,v);else if(!s.isStaticRequest){let y=new URL(e.url),_=v.startsWith("//")?new URL(y.protocol+v):new URL(v),S=Zu(_.pathname,l)!=null;_.origin===y.origin&&S&&(v=_.pathname+_.search+_.hash)}if(s.isStaticRequest)throw u.headers.set("Location",v),u;return{type:St.redirect,status:g,location:v,revalidate:u.headers.get("X-Remix-Revalidate")!==null,reloadDocument:u.headers.get("X-Remix-Reload-Document")!==null}}if(s.isRouteRequest)throw{type:a===St.error?St.error:St.data,response:u};let m,w=u.headers.get("Content-Type");return w&&/\bapplication\/json\b/.test(w)?m=await u.json():m=await u.text(),a===St.error?{type:a,error:new Jv(g,u.statusText,m),headers:u.headers}:{type:St.data,data:m,statusCode:u.status,headers:u.headers}}if(a===St.error)return{type:a,error:u};if(tD(u)){var f,h;return{type:St.deferred,deferredData:u,statusCode:(f=u.init)==null?void 0:f.status,headers:((h=u.init)==null?void 0:h.headers)&&new Headers(u.init.headers)}}return{type:St.data,data:u}}function sa(t,e,n,r){let i=t.createURL(Uk(e)).toString(),o={signal:n};if(r&&yr(r.formMethod)){let{formMethod:l,formEncType:s}=r;o.method=l.toUpperCase(),s==="application/json"?(o.headers=new Headers({"Content-Type":s}),o.body=JSON.stringify(r.json)):s==="text/plain"?o.body=r.text:s==="application/x-www-form-urlencoded"&&r.formData?o.body=Gm(r.formData):o.body=r.formData}return new Request(i,o)}function Gm(t){let e=new URLSearchParams;for(let[n,r]of t.entries())e.append(n,typeof r=="string"?r:r.name);return e}function p_(t){let e=new FormData;for(let[n,r]of t.entries())e.append(n,r);return e}function qL(t,e,n,r,i){let o={},l=null,s,a=!1,u={};return n.forEach((c,d)=>{let f=e[d].route.id;if(Oe(!rs(c),"Cannot handle redirect results in processLoaderData"),za(c)){let h=ja(t,f),g=c.error;r&&(g=Object.values(r)[0],r=void 0),l=l||{},l[h.route.id]==null&&(l[h.route.id]=g),o[f]=void 0,a||(a=!0,s=Ik(c.error)?c.error.status:500),c.headers&&(u[f]=c.headers)}else Do(c)?(i.set(f,c.deferredData),o[f]=c.deferredData.data):o[f]=c.data,c.statusCode!=null&&c.statusCode!==200&&!a&&(s=c.statusCode),c.headers&&(u[f]=c.headers)}),r&&(l=r,o[Object.keys(r)[0]]=void 0),{loaderData:o,errors:l,statusCode:s||200,loaderHeaders:u}}function m_(t,e,n,r,i,o,l,s){let{loaderData:a,errors:u}=qL(e,n,r,i,s);for(let c=0;c<o.length;c++){let{key:d,match:f,controller:h}=o[c];Oe(l!==void 0&&l[c]!==void 0,"Did not find corresponding fetcher result");let g=l[c];if(!(h&&h.signal.aborted))if(za(g)){let m=ja(t.matches,f==null?void 0:f.route.id);u&&u[m.route.id]||(u=yt({},u,{[m.route.id]:g.error})),t.fetchers.delete(d)}else if(rs(g))Oe(!1,"Unhandled fetcher revalidation redirect");else if(Do(g))Oe(!1,"Unhandled fetcher deferred data");else{let m=Di(g.data);t.fetchers.set(d,m)}}return{loaderData:a,errors:u}}function g_(t,e,n,r){let i=yt({},e);for(let o of n){let l=o.route.id;if(e.hasOwnProperty(l)?e[l]!==void 0&&(i[l]=e[l]):t[l]!==void 0&&o.route.loader&&(i[l]=t[l]),r&&r.hasOwnProperty(l))break}return i}function ja(t,e){return(e?t.slice(0,t.findIndex(r=>r.route.id===e)+1):[...t]).reverse().find(r=>r.route.hasErrorBoundary===!0)||t[0]}function v_(t){let e=t.length===1?t[0]:t.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:e}],route:e}}function Jn(t,e){let{pathname:n,routeId:r,method:i,type:o}=e===void 0?{}:e,l="Unknown Server Error",s="Unknown @remix-run/router error";return t===400?(l="Bad Request",i&&n&&r?s="You made a "+i+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":o==="defer-action"?s="defer() is not supported in actions":o==="invalid-body"&&(s="Unable to encode submission body")):t===403?(l="Forbidden",s='Route "'+r+'" does not match URL "'+n+'"'):t===404?(l="Not Found",s='No route matches URL "'+n+'"'):t===405&&(l="Method Not Allowed",i&&n&&r?s="You made a "+i.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":i&&(s='Invalid request method "'+i.toUpperCase()+'"')),new Jv(t||500,l,new Error(s),!0)}function y_(t){for(let e=t.length-1;e>=0;e--){let n=t[e];if(rs(n))return{result:n,idx:e}}}function Uk(t){let e=typeof t=="string"?Ni(t):t;return Ku(yt({},e,{hash:""}))}function eD(t,e){return t.pathname!==e.pathname||t.search!==e.search?!1:t.hash===""?e.hash!=="":t.hash===e.hash?!0:e.hash!==""}function Do(t){return t.type===St.deferred}function za(t){return t.type===St.error}function rs(t){return(t&&t.type)===St.redirect}function tD(t){let e=t;return e&&typeof e=="object"&&typeof e.data=="object"&&typeof e.subscribe=="function"&&typeof e.cancel=="function"&&typeof e.resolveData=="function"}function nD(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.headers=="object"&&typeof t.body<"u"}function rD(t){return VL.has(t.toLowerCase())}function yr(t){return UL.has(t.toLowerCase())}async function x_(t,e,n,r,i,o){for(let l=0;l<n.length;l++){let s=n[l],a=e[l];if(!a)continue;let u=t.find(d=>d.route.id===a.route.id),c=u!=null&&!Bk(u,a)&&(o&&o[a.route.id])!==void 0;if(Do(s)&&(i||c)){let d=r[l];Oe(d,"Expected an AbortSignal for revalidating fetcher deferred result"),await Wk(s,d,i).then(f=>{f&&(n[l]=f||n[l])})}}}async function Wk(t,e,n){if(n===void 0&&(n=!1),!await t.deferredData.resolveData(e)){if(n)try{return{type:St.data,data:t.deferredData.unwrappedData}}catch(i){return{type:St.error,error:i}}return{type:St.data,data:t.deferredData.data}}}function Qv(t){return new URLSearchParams(t).getAll("index").some(e=>e==="")}function Ym(t,e){let n=typeof e=="string"?Ni(e).search:e.search;if(t[t.length-1].route.index&&Qv(n||""))return t[t.length-1];let r=Mk(t);return r[r.length-1]}function __(t){let{formMethod:e,formAction:n,formEncType:r,text:i,formData:o,json:l}=t;if(!(!e||!n||!r)){if(i!=null)return{formMethod:e,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(o!=null)return{formMethod:e,formAction:n,formEncType:r,formData:o,json:void 0,text:void 0};if(l!==void 0)return{formMethod:e,formAction:n,formEncType:r,formData:void 0,json:l,text:void 0}}}function Jh(t,e){return e?{state:"loading",location:t,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text}:{state:"loading",location:t,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function iD(t,e){return{state:"submitting",location:t,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text}}function aa(t,e){return t?{state:"loading",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:e}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function oD(t,e){return{state:"submitting",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:e?e.data:void 0}}function Di(t){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function lD(t,e){try{let n=t.sessionStorage.getItem(Fk);if(n){let r=JSON.parse(n);for(let[i,o]of Object.entries(r||{}))o&&Array.isArray(o)&&e.set(i,new Set(o||[]))}}catch{}}function sD(t,e){if(e.size>0){let n={};for(let[r,i]of e)n[r]=[...i];try{t.sessionStorage.setItem(Fk,JSON.stringify(n))}catch(r){ol(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/**
|
|
178
|
+
*/function yt(){return yt=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},yt.apply(this,arguments)}var wt;(function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"})(wt||(wt={}));const s_="popstate";function vL(t){t===void 0&&(t={});function e(r,i){let{pathname:o,search:l,hash:s}=r.location;return Tu("",{pathname:o,search:l,hash:s},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(r,i){return typeof i=="string"?i:Ku(i)}return xL(e,n,null,t)}function Oe(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function ol(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function yL(){return Math.random().toString(36).substr(2,8)}function a_(t,e){return{usr:t.state,key:t.key,idx:e}}function Tu(t,e,n,r){return n===void 0&&(n=null),yt({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?Ni(e):e,{state:n,key:e&&e.key||r||yL()})}function Ku(t){let{pathname:e="/",search:n="",hash:r=""}=t;return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function Ni(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substr(n),t=t.substr(0,n));let r=t.indexOf("?");r>=0&&(e.search=t.substr(r),t=t.substr(0,r)),t&&(e.pathname=t)}return e}function xL(t,e,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:o=!1}=r,l=i.history,s=wt.Pop,a=null,u=c();u==null&&(u=0,l.replaceState(yt({},l.state,{idx:u}),""));function c(){return(l.state||{idx:null}).idx}function d(){s=wt.Pop;let w=c(),v=w==null?null:w-u;u=w,a&&a({action:s,location:m.location,delta:v})}function f(w,v){s=wt.Push;let y=Tu(m.location,w,v);n&&n(y,w),u=c()+1;let _=a_(y,u),S=m.createHref(y);try{l.pushState(_,"",S)}catch(E){if(E instanceof DOMException&&E.name==="DataCloneError")throw E;i.location.assign(S)}o&&a&&a({action:s,location:m.location,delta:1})}function h(w,v){s=wt.Replace;let y=Tu(m.location,w,v);n&&n(y,w),u=c();let _=a_(y,u),S=m.createHref(y);l.replaceState(_,"",S),o&&a&&a({action:s,location:m.location,delta:0})}function g(w){let v=i.location.origin!=="null"?i.location.origin:i.location.href,y=typeof w=="string"?w:Ku(w);return Oe(v,"No window.location.(origin|href) available to create URL for href: "+y),new URL(y,v)}let m={get action(){return s},get location(){return t(i,l)},listen(w){if(a)throw new Error("A history only accepts one active listener");return i.addEventListener(s_,d),a=w,()=>{i.removeEventListener(s_,d),a=null}},createHref(w){return e(i,w)},createURL:g,encodeLocation(w){let v=g(w);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:f,replace:h,go(w){return l.go(w)}};return m}var St;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(St||(St={}));const _L=new Set(["lazy","caseSensitive","path","id","index","children"]);function wL(t){return t.index===!0}function Km(t,e,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),t.map((i,o)=>{let l=[...n,o],s=typeof i.id=="string"?i.id:l.join("-");if(Oe(i.index!==!0||!i.children,"Cannot specify children on an index route"),Oe(!r[s],'Found a route id collision on id "'+s+`". Route id's must be globally unique within Data Router usages`),wL(i)){let a=yt({},i,e(i),{id:s});return r[s]=a,a}else{let a=yt({},i,e(i),{id:s,children:void 0});return r[s]=a,i.children&&(a.children=Km(i.children,e,l,r)),a}})}function Hl(t,e,n){n===void 0&&(n="/");let r=typeof e=="string"?Ni(e):e,i=Zu(r.pathname||"/",n);if(i==null)return null;let o=Pk(t);EL(o);let l=null;for(let s=0;l==null&&s<o.length;++s)l=PL(o[s],LL(i));return l}function SL(t,e){let{route:n,pathname:r,params:i}=t;return{id:n.id,pathname:r,params:i,data:e[n.id],handle:n.handle}}function Pk(t,e,n,r){e===void 0&&(e=[]),n===void 0&&(n=[]),r===void 0&&(r="");let i=(o,l,s)=>{let a={relativePath:s===void 0?o.path||"":s,caseSensitive:o.caseSensitive===!0,childrenIndex:l,route:o};a.relativePath.startsWith("/")&&(Oe(a.relativePath.startsWith(r),'Absolute route path "'+a.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),a.relativePath=a.relativePath.slice(r.length));let u=io([r,a.relativePath]),c=n.concat(a);o.children&&o.children.length>0&&(Oe(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),Pk(o.children,e,c,u)),!(o.path==null&&!o.index)&&e.push({path:u,score:RL(u,o.index),routesMeta:c})};return t.forEach((o,l)=>{var s;if(o.path===""||!((s=o.path)!=null&&s.includes("?")))i(o,l);else for(let a of Ak(o.path))i(o,l,a)}),e}function Ak(t){let e=t.split("/");if(e.length===0)return[];let[n,...r]=e,i=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return i?[o,""]:[o];let l=Ak(r.join("/")),s=[];return s.push(...l.map(a=>a===""?o:[o,a].join("/"))),i&&s.push(...l),s.map(a=>t.startsWith("/")&&a===""?"/":a)}function EL(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:OL(e.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const CL=/^:\w+$/,kL=3,bL=2,$L=1,TL=10,NL=-2,u_=t=>t==="*";function RL(t,e){let n=t.split("/"),r=n.length;return n.some(u_)&&(r+=NL),e&&(r+=bL),n.filter(i=>!u_(i)).reduce((i,o)=>i+(CL.test(o)?kL:o===""?$L:TL),r)}function OL(t,e){return t.length===e.length&&t.slice(0,-1).every((r,i)=>r===e[i])?t[t.length-1]-e[e.length-1]:0}function PL(t,e){let{routesMeta:n}=t,r={},i="/",o=[];for(let l=0;l<n.length;++l){let s=n[l],a=l===n.length-1,u=i==="/"?e:e.slice(i.length)||"/",c=AL({path:s.relativePath,caseSensitive:s.caseSensitive,end:a},u);if(!c)return null;Object.assign(r,c.params);let d=s.route;o.push({params:r,pathname:io([i,c.pathname]),pathnameBase:zL(io([i,c.pathnameBase])),route:d}),c.pathnameBase!=="/"&&(i=io([i,c.pathnameBase]))}return o}function AL(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[n,r]=ML(t.path,t.caseSensitive,t.end),i=e.match(n);if(!i)return null;let o=i[0],l=o.replace(/(.)\/+$/,"$1"),s=i.slice(1);return{params:r.reduce((u,c,d)=>{let{paramName:f,isOptional:h}=c;if(f==="*"){let m=s[d]||"";l=o.slice(0,o.length-m.length).replace(/(.)\/+$/,"$1")}const g=s[d];return h&&!g?u[f]=void 0:u[f]=DL(g||"",f),u},{}),pathname:o,pathnameBase:l,pattern:t}}function ML(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!0),ol(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let r=[],i="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:(\w+)(\?)?/g,(l,s,a)=>(r.push({paramName:s,isOptional:a!=null}),a?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(r.push({paramName:"*"}),i+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":t!==""&&t!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),r]}function LL(t){try{return decodeURI(t)}catch(e){return ol(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),t}}function DL(t,e){try{return decodeURIComponent(t)}catch(n){return ol(!1,'The value for the URL param "'+e+'" will not be decoded because'+(' the string "'+t+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+n+").")),t}}function Zu(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,r=t.charAt(n);return r&&r!=="/"?null:t.slice(n)||"/"}function IL(t,e){e===void 0&&(e="/");let{pathname:n,search:r="",hash:i=""}=typeof t=="string"?Ni(t):t;return{pathname:n?n.startsWith("/")?n:jL(n,e):e,search:FL(r),hash:BL(i)}}function jL(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function Yh(t,e,n,r){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function Mk(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function Lk(t){return Mk(t).map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function Dk(t,e,n,r){r===void 0&&(r=!1);let i;typeof t=="string"?i=Ni(t):(i=yt({},t),Oe(!i.pathname||!i.pathname.includes("?"),Yh("?","pathname","search",i)),Oe(!i.pathname||!i.pathname.includes("#"),Yh("#","pathname","hash",i)),Oe(!i.search||!i.search.includes("#"),Yh("#","search","hash",i)));let o=t===""||i.pathname==="",l=o?"/":i.pathname,s;if(l==null)s=n;else if(r){let d=e[e.length-1].replace(/^\//,"").split("/");if(l.startsWith("..")){let f=l.split("/");for(;f[0]==="..";)f.shift(),d.pop();i.pathname=f.join("/")}s="/"+d.join("/")}else{let d=e.length-1;if(l.startsWith("..")){let f=l.split("/");for(;f[0]==="..";)f.shift(),d-=1;i.pathname=f.join("/")}s=d>=0?e[d]:"/"}let a=IL(i,s),u=l&&l!=="/"&&l.endsWith("/"),c=(o||l===".")&&n.endsWith("/");return!a.pathname.endsWith("/")&&(u||c)&&(a.pathname+="/"),a}const io=t=>t.join("/").replace(/\/\/+/g,"/"),zL=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),FL=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,BL=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;class Jv{constructor(e,n,r,i){i===void 0&&(i=!1),this.status=e,this.statusText=n||"",this.internal=i,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function Ik(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const jk=["post","put","patch","delete"],UL=new Set(jk),WL=["get",...jk],VL=new Set(WL),HL=new Set([301,302,303,307,308]),KL=new Set([307,308]),Xh={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ZL={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},oa={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},zk=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,GL=t=>({hasErrorBoundary:!!t.hasErrorBoundary}),Fk="remix-router-transitions";function YL(t){const e=t.window?t.window:typeof window<"u"?window:void 0,n=typeof e<"u"&&typeof e.document<"u"&&typeof e.document.createElement<"u",r=!n;Oe(t.routes.length>0,"You must provide a non-empty routes array to createRouter");let i;if(t.mapRouteProperties)i=t.mapRouteProperties;else if(t.detectErrorBoundary){let T=t.detectErrorBoundary;i=M=>({hasErrorBoundary:T(M)})}else i=GL;let o={},l=Km(t.routes,i,void 0,o),s,a=t.basename||"/",u=yt({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_prependBasename:!1},t.future),c=null,d=new Set,f=null,h=null,g=null,m=t.hydrationData!=null,w=Hl(l,t.history.location,a),v=null;if(w==null){let T=Jn(404,{pathname:t.history.location.pathname}),{matches:M,route:z}=v_(l);w=M,v={[z.id]:T}}let y=!w.some(T=>T.route.lazy)&&(!w.some(T=>T.route.loader)||t.hydrationData!=null),_,S={historyAction:t.history.action,location:t.history.location,matches:w,initialized:y,navigation:Xh,restoreScrollPosition:t.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:t.hydrationData&&t.hydrationData.loaderData||{},actionData:t.hydrationData&&t.hydrationData.actionData||null,errors:t.hydrationData&&t.hydrationData.errors||v,fetchers:new Map,blockers:new Map},E=wt.Pop,$=!1,C,N=!1,R=new Map,b=null,L=!1,F=!1,le=[],V=[],H=new Map,O=0,A=-1,k=new Map,j=new Set,I=new Map,Z=new Map,ne=new Set,ke=new Map,ye=new Map,We=!1;function Fe(){if(c=t.history.listen(T=>{let{action:M,location:z,delta:G}=T;if(We){We=!1;return}ol(ye.size===0||G!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let oe=ay({currentLocation:S.location,nextLocation:z,historyAction:M});if(oe&&G!=null){We=!0,t.history.go(G*-1),Gu(oe,{state:"blocked",location:z,proceed(){Gu(oe,{state:"proceeding",proceed:void 0,reset:void 0,location:z}),t.history.go(G)},reset(){let be=new Map(S.blockers);be.set(oe,oa),$e({blockers:be})}});return}return Je(M,z)}),n){lD(e,R);let T=()=>sD(e,R);e.addEventListener("pagehide",T),b=()=>e.removeEventListener("pagehide",T)}return S.initialized||Je(wt.Pop,S.location),_}function te(){c&&c(),b&&b(),d.clear(),C&&C.abort(),S.fetchers.forEach((T,M)=>Ln(M)),S.blockers.forEach((T,M)=>sy(M))}function Ie(T){return d.add(T),()=>d.delete(T)}function $e(T,M){M===void 0&&(M={}),S=yt({},S,T);let z=[],G=[];u.v7_fetcherPersist&&S.fetchers.forEach((oe,be)=>{oe.state==="idle"&&(ne.has(be)?G.push(be):z.push(be))}),[...d].forEach(oe=>oe(S,{deletedFetchers:G,unstable_viewTransitionOpts:M.viewTransitionOpts,unstable_flushSync:M.flushSync===!0})),u.v7_fetcherPersist&&(z.forEach(oe=>S.fetchers.delete(oe)),G.forEach(oe=>Ln(oe)))}function Re(T,M,z){var G,oe;let{flushSync:be}=z===void 0?{}:z,he=S.actionData!=null&&S.navigation.formMethod!=null&&yr(S.navigation.formMethod)&&S.navigation.state==="loading"&&((G=T.state)==null?void 0:G._isRedirect)!==!0,fe;M.actionData?Object.keys(M.actionData).length>0?fe=M.actionData:fe=null:he?fe=S.actionData:fe=null;let ae=M.loaderData?g_(S.loaderData,M.loaderData,M.matches||[],M.errors):S.loaderData,Ae=S.blockers;Ae.size>0&&(Ae=new Map(Ae),Ae.forEach((Ze,ut)=>Ae.set(ut,oa)));let Vt=$===!0||S.navigation.formMethod!=null&&yr(S.navigation.formMethod)&&((oe=T.state)==null?void 0:oe._isRedirect)!==!0;s&&(l=s,s=void 0),L||E===wt.Pop||(E===wt.Push?t.history.push(T,T.state):E===wt.Replace&&t.history.replace(T,T.state));let Te;if(E===wt.Pop){let Ze=R.get(S.location.pathname);Ze&&Ze.has(T.pathname)?Te={currentLocation:S.location,nextLocation:T}:R.has(T.pathname)&&(Te={currentLocation:T,nextLocation:S.location})}else if(N){let Ze=R.get(S.location.pathname);Ze?Ze.add(T.pathname):(Ze=new Set([T.pathname]),R.set(S.location.pathname,Ze)),Te={currentLocation:S.location,nextLocation:T}}$e(yt({},M,{actionData:fe,loaderData:ae,historyAction:E,location:T,initialized:!0,navigation:Xh,revalidation:"idle",restoreScrollPosition:cy(T,M.matches||S.matches),preventScrollReset:Vt,blockers:Ae}),{viewTransitionOpts:Te,flushSync:be===!0}),E=wt.Pop,$=!1,N=!1,L=!1,F=!1,le=[],V=[]}async function Se(T,M){if(typeof T=="number"){t.history.go(T);return}let z=Zm(S.location,S.matches,a,u.v7_prependBasename,T,M==null?void 0:M.fromRouteId,M==null?void 0:M.relative),{path:G,submission:oe,error:be}=c_(u.v7_normalizeFormMethod,!1,z,M),he=S.location,fe=Tu(S.location,G,M&&M.state);fe=yt({},fe,t.history.encodeLocation(fe));let ae=M&&M.replace!=null?M.replace:void 0,Ae=wt.Push;ae===!0?Ae=wt.Replace:ae===!1||oe!=null&&yr(oe.formMethod)&&oe.formAction===S.location.pathname+S.location.search&&(Ae=wt.Replace);let Vt=M&&"preventScrollReset"in M?M.preventScrollReset===!0:void 0,Te=(M&&M.unstable_flushSync)===!0,Ze=ay({currentLocation:he,nextLocation:fe,historyAction:Ae});if(Ze){Gu(Ze,{state:"blocked",location:fe,proceed(){Gu(Ze,{state:"proceeding",proceed:void 0,reset:void 0,location:fe}),Se(T,M)},reset(){let ut=new Map(S.blockers);ut.set(Ze,oa),$e({blockers:ut})}});return}return await Je(Ae,fe,{submission:oe,pendingError:be,preventScrollReset:Vt,replace:M&&M.replace,enableViewTransition:M&&M.unstable_viewTransition,flushSync:Te})}function Le(){if(En(),$e({revalidation:"loading"}),S.navigation.state!=="submitting"){if(S.navigation.state==="idle"){Je(S.historyAction,S.location,{startUninterruptedRevalidation:!0});return}Je(E||S.historyAction,S.navigation.location,{overrideNavigation:S.navigation})}}async function Je(T,M,z){C&&C.abort(),C=null,E=T,L=(z&&z.startUninterruptedRevalidation)===!0,gb(S.location,S.matches),$=(z&&z.preventScrollReset)===!0,N=(z&&z.enableViewTransition)===!0;let G=s||l,oe=z&&z.overrideNavigation,be=Hl(G,M,a),he=(z&&z.flushSync)===!0;if(!be){let ut=Jn(404,{pathname:M.pathname}),{matches:an,route:Or}=v_(G);qf(),Re(M,{matches:an,loaderData:{},errors:{[Or.id]:ut}},{flushSync:he});return}if(S.initialized&&!F&&eD(S.location,M)&&!(z&&z.submission&&yr(z.submission.formMethod))){Re(M,{matches:be},{flushSync:he});return}C=new AbortController;let fe=sa(t.history,M,C.signal,z&&z.submission),ae,Ae;if(z&&z.pendingError)Ae={[ja(be).route.id]:z.pendingError};else if(z&&z.submission&&yr(z.submission.formMethod)){let ut=await Wt(fe,M,z.submission,be,{replace:z.replace,flushSync:he});if(ut.shortCircuited)return;ae=ut.pendingActionData,Ae=ut.pendingActionError,oe=Jh(M,z.submission),he=!1,fe=new Request(fe.url,{signal:fe.signal})}let{shortCircuited:Vt,loaderData:Te,errors:Ze}=await Sn(fe,M,be,oe,z&&z.submission,z&&z.fetcherSubmission,z&&z.replace,he,ae,Ae);Vt||(C=null,Re(M,yt({matches:be},ae?{actionData:ae}:{},{loaderData:Te,errors:Ze})))}async function Wt(T,M,z,G,oe){oe===void 0&&(oe={}),En();let be=iD(M,z);$e({navigation:be},{flushSync:oe.flushSync===!0});let he,fe=Ym(G,M);if(!fe.route.action&&!fe.route.lazy)he={type:St.error,error:Jn(405,{method:T.method,pathname:M.pathname,routeId:fe.route.id})};else if(he=await la("action",T,fe,G,o,i,a),T.signal.aborted)return{shortCircuited:!0};if(is(he)){let ae;return oe&&oe.replace!=null?ae=oe.replace:ae=he.location===S.location.pathname+S.location.search,await at(S,he,{submission:z,replace:ae}),{shortCircuited:!0}}if(za(he)){let ae=ja(G,fe.route.id);return(oe&&oe.replace)!==!0&&(E=wt.Push),{pendingActionData:{},pendingActionError:{[ae.route.id]:he.error}}}if(Do(he))throw Jn(400,{type:"defer-action"});return{pendingActionData:{[fe.route.id]:he.data}}}async function Sn(T,M,z,G,oe,be,he,fe,ae,Ae){let Vt=G||Jh(M,oe),Te=oe||be||__(Vt),Ze=s||l,[ut,an]=d_(t.history,S,z,Te,M,F,le,V,ne,I,j,Ze,a,ae,Ae);if(qf(Ge=>!(z&&z.some(Xn=>Xn.route.id===Ge))||ut&&ut.some(Xn=>Xn.route.id===Ge)),A=++O,ut.length===0&&an.length===0){let Ge=Co();return Re(M,yt({matches:z,loaderData:{},errors:Ae||null},ae?{actionData:ae}:{},Ge?{fetchers:new Map(S.fetchers)}:{}),{flushSync:fe}),{shortCircuited:!0}}if(!L){an.forEach(Xn=>{let kt=S.fetchers.get(Xn.key),ko=aa(void 0,kt?kt.data:void 0);S.fetchers.set(Xn.key,ko)});let Ge=ae||S.actionData;$e(yt({navigation:Vt},Ge?Object.keys(Ge).length===0?{actionData:null}:{actionData:Ge}:{},an.length>0?{fetchers:new Map(S.fetchers)}:{}),{flushSync:fe})}an.forEach(Ge=>{H.has(Ge.key)&>(Ge.key),Ge.controller&&H.set(Ge.key,Ge.controller)});let Or=()=>an.forEach(Ge=>gt(Ge.key));C&&C.signal.addEventListener("abort",Or);let{results:Vs,loaderResults:eh,fetcherResults:gl}=await ln(S.matches,z,ut,an,T);if(T.signal.aborted)return{shortCircuited:!0};C&&C.signal.removeEventListener("abort",Or),an.forEach(Ge=>H.delete(Ge.key));let dr=y_(Vs);if(dr){if(dr.idx>=ut.length){let Ge=an[dr.idx-ut.length].key;j.add(Ge)}return await at(S,dr.result,{replace:he}),{shortCircuited:!0}}let{loaderData:Yu,errors:th}=m_(S,z,ut,eh,Ae,an,gl,ke);ke.forEach((Ge,Xn)=>{Ge.subscribe(kt=>{(kt||Ge.done)&&ke.delete(Xn)})});let nh=Co(),rh=Ws(A),vl=nh||rh||an.length>0;return yt({loaderData:Yu,errors:th},vl?{fetchers:new Map(S.fetchers)}:{})}function cr(T,M,z,G){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");H.has(T)&>(T);let oe=(G&&G.unstable_flushSync)===!0,be=s||l,he=Zm(S.location,S.matches,a,u.v7_prependBasename,z,M,G==null?void 0:G.relative),fe=Hl(be,he,a);if(!fe){At(T,M,Jn(404,{pathname:he}),{flushSync:oe});return}let{path:ae,submission:Ae,error:Vt}=c_(u.v7_normalizeFormMethod,!0,he,G);if(Vt){At(T,M,Vt,{flushSync:oe});return}let Te=Ym(fe,ae);if($=(G&&G.preventScrollReset)===!0,Ae&&yr(Ae.formMethod)){je(T,M,ae,Te,fe,oe,Ae);return}I.set(T,{routeId:M,path:ae}),Tt(T,M,ae,Te,fe,oe,Ae)}async function je(T,M,z,G,oe,be,he){if(En(),I.delete(T),!G.route.action&&!G.route.lazy){let kt=Jn(405,{method:he.formMethod,pathname:z,routeId:M});At(T,M,kt,{flushSync:be});return}let fe=S.fetchers.get(T);_t(T,oD(he,fe),{flushSync:be});let ae=new AbortController,Ae=sa(t.history,z,ae.signal,he);H.set(T,ae);let Vt=O,Te=await la("action",Ae,G,oe,o,i,a);if(Ae.signal.aborted){H.get(T)===ae&&H.delete(T);return}if(ne.has(T)){_t(T,Di(void 0));return}if(is(Te))if(H.delete(T),A>Vt){_t(T,Di(void 0));return}else return j.add(T),_t(T,aa(he)),at(S,Te,{fetcherSubmission:he});if(za(Te)){At(T,M,Te.error);return}if(Do(Te))throw Jn(400,{type:"defer-action"});let Ze=S.navigation.location||S.location,ut=sa(t.history,Ze,ae.signal),an=s||l,Or=S.navigation.state!=="idle"?Hl(an,S.navigation.location,a):S.matches;Oe(Or,"Didn't find any matches after fetcher action");let Vs=++O;k.set(T,Vs);let eh=aa(he,Te.data);S.fetchers.set(T,eh);let[gl,dr]=d_(t.history,S,Or,he,Ze,F,le,V,ne,I,j,an,a,{[G.route.id]:Te.data},void 0);dr.filter(kt=>kt.key!==T).forEach(kt=>{let ko=kt.key,dy=S.fetchers.get(ko),yb=aa(void 0,dy?dy.data:void 0);S.fetchers.set(ko,yb),H.has(ko)&>(ko),kt.controller&&H.set(ko,kt.controller)}),$e({fetchers:new Map(S.fetchers)});let Yu=()=>dr.forEach(kt=>gt(kt.key));ae.signal.addEventListener("abort",Yu);let{results:th,loaderResults:nh,fetcherResults:rh}=await ln(S.matches,Or,gl,dr,ut);if(ae.signal.aborted)return;ae.signal.removeEventListener("abort",Yu),k.delete(T),H.delete(T),dr.forEach(kt=>H.delete(kt.key));let vl=y_(th);if(vl){if(vl.idx>=gl.length){let kt=dr[vl.idx-gl.length].key;j.add(kt)}return at(S,vl.result)}let{loaderData:Ge,errors:Xn}=m_(S,S.matches,gl,nh,void 0,dr,rh,ke);if(S.fetchers.has(T)){let kt=Di(Te.data);S.fetchers.set(T,kt)}Ws(Vs),S.navigation.state==="loading"&&Vs>A?(Oe(E,"Expected pending action"),C&&C.abort(),Re(S.navigation.location,{matches:Or,loaderData:Ge,errors:Xn,fetchers:new Map(S.fetchers)})):($e({errors:Xn,loaderData:g_(S.loaderData,Ge,Or,Xn),fetchers:new Map(S.fetchers)}),F=!1)}async function Tt(T,M,z,G,oe,be,he){let fe=S.fetchers.get(T);_t(T,aa(he,fe?fe.data:void 0),{flushSync:be});let ae=new AbortController,Ae=sa(t.history,z,ae.signal);H.set(T,ae);let Vt=O,Te=await la("loader",Ae,G,oe,o,i,a);if(Do(Te)&&(Te=await Wk(Te,Ae.signal,!0)||Te),H.get(T)===ae&&H.delete(T),!Ae.signal.aborted){if(ne.has(T)){_t(T,Di(void 0));return}if(is(Te))if(A>Vt){_t(T,Di(void 0));return}else{j.add(T),await at(S,Te);return}if(za(Te)){At(T,M,Te.error);return}Oe(!Do(Te),"Unhandled fetcher deferred data"),_t(T,Di(Te.data))}}async function at(T,M,z){let{submission:G,fetcherSubmission:oe,replace:be}=z===void 0?{}:z;M.revalidate&&(F=!0);let he=Tu(T.location,M.location,{_isRedirect:!0});if(Oe(he,"Expected a location on the redirect navigation"),n){let Ze=!1;if(M.reloadDocument)Ze=!0;else if(zk.test(M.location)){const ut=t.history.createURL(M.location);Ze=ut.origin!==e.location.origin||Zu(ut.pathname,a)==null}if(Ze){be?e.location.replace(M.location):e.location.assign(M.location);return}}C=null;let fe=be===!0?wt.Replace:wt.Push,{formMethod:ae,formAction:Ae,formEncType:Vt}=T.navigation;!G&&!oe&&ae&&Ae&&Vt&&(G=__(T.navigation));let Te=G||oe;if(KL.has(M.status)&&Te&&yr(Te.formMethod))await Je(fe,he,{submission:yt({},Te,{formAction:M.location}),preventScrollReset:$});else{let Ze=Jh(he,G);await Je(fe,he,{overrideNavigation:Ze,fetcherSubmission:oe,preventScrollReset:$})}}async function ln(T,M,z,G,oe){let be=await Promise.all([...z.map(ae=>la("loader",oe,ae,M,o,i,a)),...G.map(ae=>ae.matches&&ae.match&&ae.controller?la("loader",sa(t.history,ae.path,ae.controller.signal),ae.match,ae.matches,o,i,a):{type:St.error,error:Jn(404,{pathname:ae.path})})]),he=be.slice(0,z.length),fe=be.slice(z.length);return await Promise.all([x_(T,z,he,he.map(()=>oe.signal),!1,S.loaderData),x_(T,G.map(ae=>ae.match),fe,G.map(ae=>ae.controller?ae.controller.signal:null),!0)]),{results:be,loaderResults:he,fetcherResults:fe}}function En(){F=!0,le.push(...qf()),I.forEach((T,M)=>{H.has(M)&&(V.push(M),gt(M))})}function _t(T,M,z){z===void 0&&(z={}),S.fetchers.set(T,M),$e({fetchers:new Map(S.fetchers)},{flushSync:(z&&z.flushSync)===!0})}function At(T,M,z,G){G===void 0&&(G={});let oe=ja(S.matches,M);Ln(T),$e({errors:{[oe.route.id]:z},fetchers:new Map(S.fetchers)},{flushSync:(G&&G.flushSync)===!0})}function sn(T){return u.v7_fetcherPersist&&(Z.set(T,(Z.get(T)||0)+1),ne.has(T)&&ne.delete(T)),S.fetchers.get(T)||ZL}function Ln(T){let M=S.fetchers.get(T);H.has(T)&&!(M&&M.state==="loading"&&k.has(T))&>(T),I.delete(T),k.delete(T),j.delete(T),ne.delete(T),S.fetchers.delete(T)}function ei(T){if(u.v7_fetcherPersist){let M=(Z.get(T)||0)-1;M<=0?(Z.delete(T),ne.add(T)):Z.set(T,M)}else Ln(T);$e({fetchers:new Map(S.fetchers)})}function gt(T){let M=H.get(T);Oe(M,"Expected fetch controller: "+T),M.abort(),H.delete(T)}function Rr(T){for(let M of T){let z=sn(M),G=Di(z.data);S.fetchers.set(M,G)}}function Co(){let T=[],M=!1;for(let z of j){let G=S.fetchers.get(z);Oe(G,"Expected fetcher: "+z),G.state==="loading"&&(j.delete(z),T.push(z),M=!0)}return Rr(T),M}function Ws(T){let M=[];for(let[z,G]of k)if(G<T){let oe=S.fetchers.get(z);Oe(oe,"Expected fetcher: "+z),oe.state==="loading"&&(gt(z),k.delete(z),M.push(z))}return Rr(M),M.length>0}function pb(T,M){let z=S.blockers.get(T)||oa;return ye.get(T)!==M&&ye.set(T,M),z}function sy(T){S.blockers.delete(T),ye.delete(T)}function Gu(T,M){let z=S.blockers.get(T)||oa;Oe(z.state==="unblocked"&&M.state==="blocked"||z.state==="blocked"&&M.state==="blocked"||z.state==="blocked"&&M.state==="proceeding"||z.state==="blocked"&&M.state==="unblocked"||z.state==="proceeding"&&M.state==="unblocked","Invalid blocker state transition: "+z.state+" -> "+M.state);let G=new Map(S.blockers);G.set(T,M),$e({blockers:G})}function ay(T){let{currentLocation:M,nextLocation:z,historyAction:G}=T;if(ye.size===0)return;ye.size>1&&ol(!1,"A router only supports one blocker at a time");let oe=Array.from(ye.entries()),[be,he]=oe[oe.length-1],fe=S.blockers.get(be);if(!(fe&&fe.state==="proceeding")&&he({currentLocation:M,nextLocation:z,historyAction:G}))return be}function qf(T){let M=[];return ke.forEach((z,G)=>{(!T||T(G))&&(z.cancel(),M.push(G),ke.delete(G))}),M}function mb(T,M,z){if(f=T,g=M,h=z||null,!m&&S.navigation===Xh){m=!0;let G=cy(S.location,S.matches);G!=null&&$e({restoreScrollPosition:G})}return()=>{f=null,g=null,h=null}}function uy(T,M){return h&&h(T,M.map(G=>SL(G,S.loaderData)))||T.key}function gb(T,M){if(f&&g){let z=uy(T,M);f[z]=g()}}function cy(T,M){if(f){let z=uy(T,M),G=f[z];if(typeof G=="number")return G}return null}function vb(T){o={},s=Km(T,i,void 0,o)}return _={get basename(){return a},get state(){return S},get routes(){return l},get window(){return e},initialize:Fe,subscribe:Ie,enableScrollRestoration:mb,navigate:Se,fetch:cr,revalidate:Le,createHref:T=>t.history.createHref(T),encodeLocation:T=>t.history.encodeLocation(T),getFetcher:sn,deleteFetcher:ei,dispose:te,getBlocker:pb,deleteBlocker:sy,_internalFetchControllers:H,_internalActiveDeferreds:ke,_internalSetRoutes:vb},_}function XL(t){return t!=null&&("formData"in t&&t.formData!=null||"body"in t&&t.body!==void 0)}function Zm(t,e,n,r,i,o,l){let s,a;if(o){s=[];for(let c of e)if(s.push(c),c.route.id===o){a=c;break}}else s=e,a=e[e.length-1];let u=Dk(i||".",Lk(s),Zu(t.pathname,n)||t.pathname,l==="path");return i==null&&(u.search=t.search,u.hash=t.hash),(i==null||i===""||i===".")&&a&&a.route.index&&!Qv(u.search)&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),r&&n!=="/"&&(u.pathname=u.pathname==="/"?n:io([n,u.pathname])),Ku(u)}function c_(t,e,n,r){if(!r||!XL(r))return{path:n};if(r.formMethod&&!rD(r.formMethod))return{path:n,error:Jn(405,{method:r.formMethod})};let i=()=>({path:n,error:Jn(400,{type:"invalid-body"})}),o=r.formMethod||"get",l=t?o.toUpperCase():o.toLowerCase(),s=Uk(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!yr(l))return i();let f=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((h,g)=>{let[m,w]=g;return""+h+m+"="+w+`
|
|
179
|
+
`},""):String(r.body);return{path:n,submission:{formMethod:l,formAction:s,formEncType:r.formEncType,formData:void 0,json:void 0,text:f}}}else if(r.formEncType==="application/json"){if(!yr(l))return i();try{let f=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:l,formAction:s,formEncType:r.formEncType,formData:void 0,json:f,text:void 0}}}catch{return i()}}}Oe(typeof FormData=="function","FormData is not available in this environment");let a,u;if(r.formData)a=Gm(r.formData),u=r.formData;else if(r.body instanceof FormData)a=Gm(r.body),u=r.body;else if(r.body instanceof URLSearchParams)a=r.body,u=p_(a);else if(r.body==null)a=new URLSearchParams,u=new FormData;else try{a=new URLSearchParams(r.body),u=p_(a)}catch{return i()}let c={formMethod:l,formAction:s,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:u,json:void 0,text:void 0};if(yr(c.formMethod))return{path:n,submission:c};let d=Ni(n);return e&&d.search&&Qv(d.search)&&a.append("index",""),d.search="?"+a,{path:Ku(d),submission:c}}function JL(t,e){let n=t;if(e){let r=t.findIndex(i=>i.route.id===e);r>=0&&(n=t.slice(0,r))}return n}function d_(t,e,n,r,i,o,l,s,a,u,c,d,f,h,g){let m=g?Object.values(g)[0]:h?Object.values(h)[0]:void 0,w=t.createURL(e.location),v=t.createURL(i),y=g?Object.keys(g)[0]:void 0,S=JL(n,y).filter(($,C)=>{if($.route.lazy)return!0;if($.route.loader==null)return!1;if(QL(e.loaderData,e.matches[C],$)||l.some(b=>b===$.route.id))return!0;let N=e.matches[C],R=$;return f_($,yt({currentUrl:w,currentParams:N.params,nextUrl:v,nextParams:R.params},r,{actionResult:m,defaultShouldRevalidate:o||w.pathname+w.search===v.pathname+v.search||w.search!==v.search||Bk(N,R)}))}),E=[];return u.forEach(($,C)=>{if(!n.some(F=>F.route.id===$.routeId)||a.has(C))return;let N=Hl(d,$.path,f);if(!N){E.push({key:C,routeId:$.routeId,path:$.path,matches:null,match:null,controller:null});return}let R=e.fetchers.get(C),b=Ym(N,$.path),L=!1;c.has(C)?L=!1:s.includes(C)?L=!0:R&&R.state!=="idle"&&R.data===void 0?L=o:L=f_(b,yt({currentUrl:w,currentParams:e.matches[e.matches.length-1].params,nextUrl:v,nextParams:n[n.length-1].params},r,{actionResult:m,defaultShouldRevalidate:o})),L&&E.push({key:C,routeId:$.routeId,path:$.path,matches:N,match:b,controller:new AbortController})}),[S,E]}function QL(t,e,n){let r=!e||n.route.id!==e.route.id,i=t[n.route.id]===void 0;return r||i}function Bk(t,e){let n=t.route.path;return t.pathname!==e.pathname||n!=null&&n.endsWith("*")&&t.params["*"]!==e.params["*"]}function f_(t,e){if(t.route.shouldRevalidate){let n=t.route.shouldRevalidate(e);if(typeof n=="boolean")return n}return e.defaultShouldRevalidate}async function h_(t,e,n){if(!t.lazy)return;let r=await t.lazy();if(!t.lazy)return;let i=n[t.id];Oe(i,"No route found in manifest");let o={};for(let l in r){let a=i[l]!==void 0&&l!=="hasErrorBoundary";ol(!a,'Route "'+i.id+'" has a static property "'+l+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+l+'" will be ignored.')),!a&&!_L.has(l)&&(o[l]=r[l])}Object.assign(i,o),Object.assign(i,yt({},e(i),{lazy:void 0}))}async function la(t,e,n,r,i,o,l,s){s===void 0&&(s={});let a,u,c,d=g=>{let m,w=new Promise((v,y)=>m=y);return c=()=>m(),e.signal.addEventListener("abort",c),Promise.race([g({request:e,params:n.params,context:s.requestContext}),w])};try{let g=n.route[t];if(n.route.lazy)if(g){let m,w=await Promise.all([d(g).catch(v=>{m=v}),h_(n.route,o,i)]);if(m)throw m;u=w[0]}else if(await h_(n.route,o,i),g=n.route[t],g)u=await d(g);else if(t==="action"){let m=new URL(e.url),w=m.pathname+m.search;throw Jn(405,{method:e.method,pathname:w,routeId:n.route.id})}else return{type:St.data,data:void 0};else if(g)u=await d(g);else{let m=new URL(e.url),w=m.pathname+m.search;throw Jn(404,{pathname:w})}Oe(u!==void 0,"You defined "+(t==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+t+"` ")+"function. Please return a value or `null`.")}catch(g){a=St.error,u=g}finally{c&&e.signal.removeEventListener("abort",c)}if(nD(u)){let g=u.status;if(HL.has(g)){let v=u.headers.get("Location");if(Oe(v,"Redirects returned/thrown from loaders/actions must have a Location header"),!zk.test(v))v=Zm(new URL(e.url),r.slice(0,r.indexOf(n)+1),l,!0,v);else if(!s.isStaticRequest){let y=new URL(e.url),_=v.startsWith("//")?new URL(y.protocol+v):new URL(v),S=Zu(_.pathname,l)!=null;_.origin===y.origin&&S&&(v=_.pathname+_.search+_.hash)}if(s.isStaticRequest)throw u.headers.set("Location",v),u;return{type:St.redirect,status:g,location:v,revalidate:u.headers.get("X-Remix-Revalidate")!==null,reloadDocument:u.headers.get("X-Remix-Reload-Document")!==null}}if(s.isRouteRequest)throw{type:a===St.error?St.error:St.data,response:u};let m,w=u.headers.get("Content-Type");return w&&/\bapplication\/json\b/.test(w)?m=await u.json():m=await u.text(),a===St.error?{type:a,error:new Jv(g,u.statusText,m),headers:u.headers}:{type:St.data,data:m,statusCode:u.status,headers:u.headers}}if(a===St.error)return{type:a,error:u};if(tD(u)){var f,h;return{type:St.deferred,deferredData:u,statusCode:(f=u.init)==null?void 0:f.status,headers:((h=u.init)==null?void 0:h.headers)&&new Headers(u.init.headers)}}return{type:St.data,data:u}}function sa(t,e,n,r){let i=t.createURL(Uk(e)).toString(),o={signal:n};if(r&&yr(r.formMethod)){let{formMethod:l,formEncType:s}=r;o.method=l.toUpperCase(),s==="application/json"?(o.headers=new Headers({"Content-Type":s}),o.body=JSON.stringify(r.json)):s==="text/plain"?o.body=r.text:s==="application/x-www-form-urlencoded"&&r.formData?o.body=Gm(r.formData):o.body=r.formData}return new Request(i,o)}function Gm(t){let e=new URLSearchParams;for(let[n,r]of t.entries())e.append(n,typeof r=="string"?r:r.name);return e}function p_(t){let e=new FormData;for(let[n,r]of t.entries())e.append(n,r);return e}function qL(t,e,n,r,i){let o={},l=null,s,a=!1,u={};return n.forEach((c,d)=>{let f=e[d].route.id;if(Oe(!is(c),"Cannot handle redirect results in processLoaderData"),za(c)){let h=ja(t,f),g=c.error;r&&(g=Object.values(r)[0],r=void 0),l=l||{},l[h.route.id]==null&&(l[h.route.id]=g),o[f]=void 0,a||(a=!0,s=Ik(c.error)?c.error.status:500),c.headers&&(u[f]=c.headers)}else Do(c)?(i.set(f,c.deferredData),o[f]=c.deferredData.data):o[f]=c.data,c.statusCode!=null&&c.statusCode!==200&&!a&&(s=c.statusCode),c.headers&&(u[f]=c.headers)}),r&&(l=r,o[Object.keys(r)[0]]=void 0),{loaderData:o,errors:l,statusCode:s||200,loaderHeaders:u}}function m_(t,e,n,r,i,o,l,s){let{loaderData:a,errors:u}=qL(e,n,r,i,s);for(let c=0;c<o.length;c++){let{key:d,match:f,controller:h}=o[c];Oe(l!==void 0&&l[c]!==void 0,"Did not find corresponding fetcher result");let g=l[c];if(!(h&&h.signal.aborted))if(za(g)){let m=ja(t.matches,f==null?void 0:f.route.id);u&&u[m.route.id]||(u=yt({},u,{[m.route.id]:g.error})),t.fetchers.delete(d)}else if(is(g))Oe(!1,"Unhandled fetcher revalidation redirect");else if(Do(g))Oe(!1,"Unhandled fetcher deferred data");else{let m=Di(g.data);t.fetchers.set(d,m)}}return{loaderData:a,errors:u}}function g_(t,e,n,r){let i=yt({},e);for(let o of n){let l=o.route.id;if(e.hasOwnProperty(l)?e[l]!==void 0&&(i[l]=e[l]):t[l]!==void 0&&o.route.loader&&(i[l]=t[l]),r&&r.hasOwnProperty(l))break}return i}function ja(t,e){return(e?t.slice(0,t.findIndex(r=>r.route.id===e)+1):[...t]).reverse().find(r=>r.route.hasErrorBoundary===!0)||t[0]}function v_(t){let e=t.length===1?t[0]:t.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:e}],route:e}}function Jn(t,e){let{pathname:n,routeId:r,method:i,type:o}=e===void 0?{}:e,l="Unknown Server Error",s="Unknown @remix-run/router error";return t===400?(l="Bad Request",i&&n&&r?s="You made a "+i+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":o==="defer-action"?s="defer() is not supported in actions":o==="invalid-body"&&(s="Unable to encode submission body")):t===403?(l="Forbidden",s='Route "'+r+'" does not match URL "'+n+'"'):t===404?(l="Not Found",s='No route matches URL "'+n+'"'):t===405&&(l="Method Not Allowed",i&&n&&r?s="You made a "+i.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":i&&(s='Invalid request method "'+i.toUpperCase()+'"')),new Jv(t||500,l,new Error(s),!0)}function y_(t){for(let e=t.length-1;e>=0;e--){let n=t[e];if(is(n))return{result:n,idx:e}}}function Uk(t){let e=typeof t=="string"?Ni(t):t;return Ku(yt({},e,{hash:""}))}function eD(t,e){return t.pathname!==e.pathname||t.search!==e.search?!1:t.hash===""?e.hash!=="":t.hash===e.hash?!0:e.hash!==""}function Do(t){return t.type===St.deferred}function za(t){return t.type===St.error}function is(t){return(t&&t.type)===St.redirect}function tD(t){let e=t;return e&&typeof e=="object"&&typeof e.data=="object"&&typeof e.subscribe=="function"&&typeof e.cancel=="function"&&typeof e.resolveData=="function"}function nD(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.headers=="object"&&typeof t.body<"u"}function rD(t){return VL.has(t.toLowerCase())}function yr(t){return UL.has(t.toLowerCase())}async function x_(t,e,n,r,i,o){for(let l=0;l<n.length;l++){let s=n[l],a=e[l];if(!a)continue;let u=t.find(d=>d.route.id===a.route.id),c=u!=null&&!Bk(u,a)&&(o&&o[a.route.id])!==void 0;if(Do(s)&&(i||c)){let d=r[l];Oe(d,"Expected an AbortSignal for revalidating fetcher deferred result"),await Wk(s,d,i).then(f=>{f&&(n[l]=f||n[l])})}}}async function Wk(t,e,n){if(n===void 0&&(n=!1),!await t.deferredData.resolveData(e)){if(n)try{return{type:St.data,data:t.deferredData.unwrappedData}}catch(i){return{type:St.error,error:i}}return{type:St.data,data:t.deferredData.data}}}function Qv(t){return new URLSearchParams(t).getAll("index").some(e=>e==="")}function Ym(t,e){let n=typeof e=="string"?Ni(e).search:e.search;if(t[t.length-1].route.index&&Qv(n||""))return t[t.length-1];let r=Mk(t);return r[r.length-1]}function __(t){let{formMethod:e,formAction:n,formEncType:r,text:i,formData:o,json:l}=t;if(!(!e||!n||!r)){if(i!=null)return{formMethod:e,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(o!=null)return{formMethod:e,formAction:n,formEncType:r,formData:o,json:void 0,text:void 0};if(l!==void 0)return{formMethod:e,formAction:n,formEncType:r,formData:void 0,json:l,text:void 0}}}function Jh(t,e){return e?{state:"loading",location:t,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text}:{state:"loading",location:t,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function iD(t,e){return{state:"submitting",location:t,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text}}function aa(t,e){return t?{state:"loading",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:e}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function oD(t,e){return{state:"submitting",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:e?e.data:void 0}}function Di(t){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function lD(t,e){try{let n=t.sessionStorage.getItem(Fk);if(n){let r=JSON.parse(n);for(let[i,o]of Object.entries(r||{}))o&&Array.isArray(o)&&e.set(i,new Set(o||[]))}}catch{}}function sD(t,e){if(e.size>0){let n={};for(let[r,i]of e)n[r]=[...i];try{t.sessionStorage.setItem(Fk,JSON.stringify(n))}catch(r){ol(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/**
|
|
180
180
|
* React Router v6.20.0
|
|
181
181
|
*
|
|
182
182
|
* Copyright (c) Remix Software Inc.
|
|
@@ -185,11 +185,11 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
185
185
|
* LICENSE.md file in the root directory of this source tree.
|
|
186
186
|
*
|
|
187
187
|
* @license MIT
|
|
188
|
-
*/function tf(){return tf=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},tf.apply(this,arguments)}const Zf=p.createContext(null),Vk=p.createContext(null),Gf=p.createContext(null),Yf=p.createContext(null),
|
|
188
|
+
*/function tf(){return tf=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},tf.apply(this,arguments)}const Zf=p.createContext(null),Vk=p.createContext(null),Gf=p.createContext(null),Yf=p.createContext(null),ml=p.createContext({outlet:null,matches:[],isDataRoute:!1}),Hk=p.createContext(null);function Xf(){return p.useContext(Yf)!=null}function Kk(){return Xf()||Oe(!1),p.useContext(Yf).location}function Zk(t){p.useContext(Gf).static||p.useLayoutEffect(t)}function qv(){let{isDataRoute:t}=p.useContext(ml);return t?_D():aD()}function aD(){Xf()||Oe(!1);let t=p.useContext(Zf),{basename:e,navigator:n}=p.useContext(Gf),{matches:r}=p.useContext(ml),{pathname:i}=Kk(),o=JSON.stringify(Lk(r)),l=p.useRef(!1);return Zk(()=>{l.current=!0}),p.useCallback(function(a,u){if(u===void 0&&(u={}),!l.current)return;if(typeof a=="number"){n.go(a);return}let c=Dk(a,JSON.parse(o),i,u.relative==="path");t==null&&e!=="/"&&(c.pathname=c.pathname==="/"?e:io([e,c.pathname])),(u.replace?n.replace:n.push)(c,u.state,u)},[e,n,o,i,t])}function uD(){let{matches:t}=p.useContext(ml),e=t[t.length-1];return e?e.params:{}}function cD(t,e,n){Xf()||Oe(!1);let{navigator:r}=p.useContext(Gf),{matches:i}=p.useContext(ml),o=i[i.length-1],l=o?o.params:{};o&&o.pathname;let s=o?o.pathnameBase:"/";o&&o.route;let a=Kk(),u;if(e){var c;let m=typeof e=="string"?Ni(e):e;s==="/"||(c=m.pathname)!=null&&c.startsWith(s)||Oe(!1),u=m}else u=a;let d=u.pathname||"/",f=s==="/"?d:d.slice(s.length)||"/",h=Hl(t,{pathname:f}),g=mD(h&&h.map(m=>Object.assign({},m,{params:Object.assign({},l,m.params),pathname:io([s,r.encodeLocation?r.encodeLocation(m.pathname).pathname:m.pathname]),pathnameBase:m.pathnameBase==="/"?s:io([s,r.encodeLocation?r.encodeLocation(m.pathnameBase).pathname:m.pathnameBase])})),i,n);return e&&g?p.createElement(Yf.Provider,{value:{location:tf({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:wt.Pop}},g):g}function dD(){let t=xD(),e=Ik(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},o=null;return p.createElement(p.Fragment,null,p.createElement("h2",null,"Unexpected Application Error!"),p.createElement("h3",{style:{fontStyle:"italic"}},e),n?p.createElement("pre",{style:i},n):null,o)}const fD=p.createElement(dD,null);class hD extends p.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error||n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){console.error("React Router caught the following error during render",e,n)}render(){return this.state.error?p.createElement(ml.Provider,{value:this.props.routeContext},p.createElement(Hk.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function pD(t){let{routeContext:e,match:n,children:r}=t,i=p.useContext(Zf);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),p.createElement(ml.Provider,{value:e},r)}function mD(t,e,n){var r;if(e===void 0&&(e=[]),n===void 0&&(n=null),t==null){var i;if((i=n)!=null&&i.errors)t=n.matches;else return null}let o=t,l=(r=n)==null?void 0:r.errors;if(l!=null){let s=o.findIndex(a=>a.route.id&&(l==null?void 0:l[a.route.id]));s>=0||Oe(!1),o=o.slice(0,Math.min(o.length,s+1))}return o.reduceRight((s,a,u)=>{let c=a.route.id?l==null?void 0:l[a.route.id]:null,d=null;n&&(d=a.route.errorElement||fD);let f=e.concat(o.slice(0,u+1)),h=()=>{let g;return c?g=d:a.route.Component?g=p.createElement(a.route.Component,null):a.route.element?g=a.route.element:g=s,p.createElement(pD,{match:a,routeContext:{outlet:s,matches:f,isDataRoute:n!=null},children:g})};return n&&(a.route.ErrorBoundary||a.route.errorElement||u===0)?p.createElement(hD,{location:n.location,revalidation:n.revalidation,component:d,error:c,children:h(),routeContext:{outlet:null,matches:f,isDataRoute:!0}}):h()},null)}var Gk=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(Gk||{}),nf=function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t}(nf||{});function gD(t){let e=p.useContext(Zf);return e||Oe(!1),e}function vD(t){let e=p.useContext(Vk);return e||Oe(!1),e}function yD(t){let e=p.useContext(ml);return e||Oe(!1),e}function Yk(t){let e=yD(),n=e.matches[e.matches.length-1];return n.route.id||Oe(!1),n.route.id}function xD(){var t;let e=p.useContext(Hk),n=vD(nf.UseRouteError),r=Yk(nf.UseRouteError);return e||((t=n.errors)==null?void 0:t[r])}function _D(){let{router:t}=gD(Gk.UseNavigateStable),e=Yk(nf.UseNavigateStable),n=p.useRef(!1);return Zk(()=>{n.current=!0}),p.useCallback(function(i,o){o===void 0&&(o={}),n.current&&(typeof i=="number"?t.navigate(i):t.navigate(i,tf({fromRouteId:e},o)))},[t,e])}function wD(t){let{basename:e="/",children:n=null,location:r,navigationType:i=wt.Pop,navigator:o,static:l=!1}=t;Xf()&&Oe(!1);let s=e.replace(/^\/*/,"/"),a=p.useMemo(()=>({basename:s,navigator:o,static:l}),[s,o,l]);typeof r=="string"&&(r=Ni(r));let{pathname:u="/",search:c="",hash:d="",state:f=null,key:h="default"}=r,g=p.useMemo(()=>{let m=Zu(u,s);return m==null?null:{location:{pathname:m,search:c,hash:d,state:f,key:h},navigationType:i}},[s,u,c,d,f,h,i]);return g==null?null:p.createElement(Gf.Provider,{value:a},p.createElement(Yf.Provider,{children:n,value:g}))}new Promise(()=>{});function SD(t){let e={hasErrorBoundary:t.ErrorBoundary!=null||t.errorElement!=null};return t.Component&&Object.assign(e,{element:p.createElement(t.Component),Component:void 0}),t.ErrorBoundary&&Object.assign(e,{errorElement:p.createElement(t.ErrorBoundary),ErrorBoundary:void 0}),e}function Vo({children:t}){const e=t.split("/").filter(n=>n);return e.map((n,r)=>r!==e.length-1?x.jsxs(p.Fragment,{children:[x.jsx("span",{children:n}),x.jsx("span",{className:"px-[2px] text-muted",children:"/"})]},`${t}/${n}`):x.jsx(ED,{children:n},t))}function ED({children:t}){if(t.includes(".")){const e=t.split(".");return e.map((n,r)=>r!==e.length-1?x.jsxs(p.Fragment,{children:[x.jsx("span",{children:r===0?n:JSON.parse(n)}),x.jsx("span",{className:"px-[2px] text-muted",children:"."})]},`${t}.${n}`):x.jsx("span",{children:r===0?n:JSON.parse(n)},t))}return x.jsx("span",{children:t})}const Xk=re.createContext(null),CD=t=>{var s,a;const e=re.useContext(Xk),[n,r]=On.splitModuleIdAndModulePath(t),i=(s=e==null?void 0:e[n])==null?void 0:s.source,o=(a=e==null?void 0:e[n])==null?void 0:a.schema;if(!i||!o)throw Error("Could not find module: "+n);const l=On.resolvePath(r,i,o);return{moduleId:n,moduleSource:l.source,moduleSchema:l.schema}},kD=({api:t})=>{var C,N;const{"*":e}=uD(),[n,r]=p.useState(null),[i,o]=p.useState(null),[l,s]=p.useState(),[a]=l?On.splitModuleIdAndModulePath(l):[void 0,void 0],u=a&&((C=n==null?void 0:n[a])==null?void 0:C.source),c=a&&((N=n==null?void 0:n[a])==null?void 0:N.schema),d=Object.entries(n||{}).flatMap(([R,b])=>b.errors?b.errors.fatal?b.errors.fatal.map(L=>({id:R,...L})):[]:[]),f=Object.entries(n||{}).flatMap(([,R])=>R.errors&&R.errors.validation?[R.errors.validation]:[]);if(d&&d.length>0){const R=d.length===1?d[0].message:`Multiple errors detected:
|
|
189
189
|
${d.map((L,F)=>`${F+1}. [${L.id}]: ${L.message}`).join(`
|
|
190
190
|
`)}
|
|
191
191
|
|
|
192
|
-
Showing stack trace of: 1. ${d[0].message}`,b=new Error(R);throw b.stack=d[0].stack,b}f&&f.length>0&&console.warn("Val encountered validation errors:",f),p.useEffect(()=>{s(e?`/${e}`:l)},[e]);const[h,g]=p.useState(null);p.useEffect(()=>{try{new WebSocket(`${window.location.origin.replace("http://","ws://")}/_next/webpack-hmr`).addEventListener("message",b=>{let L;try{L=JSON.parse(b.data)}catch{console.error("Failed to parse HMR")}typeof(L==null?void 0:L.hash)=="string"&&(L==null?void 0:L.action)==="built"&&g(L.hash)})}catch(R){console.warn("Failed to initialize HMR",R)}},[]),p.useEffect(()=>{console.log("(Re)-fetching modules"),t.getTree({patch:!0,includeSchema:!0,includeSource:!0}).then(R=>{zo.isOk(R)?r(R.value.modules):(o("Could not load modules: "+R.error.message),console.error(R.error))})},[h]);const m=d5(t),w=qv(),[v,y]=dM(),{patches:_,setPatchResetId:S}=cM(m,t),E=re.useRef(null),$=p.useCallback(R=>async b=>{const[L,F]=On.splitModuleIdAndModulePath(R),le=await b(On.createPatchJSONPath(F));return t.postPatches(L,le).then(V=>{if(zo.isErr(V))throw V.error;if(!h)return S(H=>H+1),t.getTree({treePath:L,patch:!0,includeSchema:!0,includeSource:!0}).then(H=>{zo.isOk(H)?r(O=>({...O,...H.value.modules})):(o("Could not load modules: "+H.error.message),console.error(H.error))})}).catch(V=>{console.error(V)})},[]);return x.jsx(EC.Provider,{value:{theme:v,setTheme:y,api:t,editMode:"full",session:m,highlight:!1,setHighlight:()=>{},setEditMode:()=>{},setWindowSize:()=>{}},children:x.jsxs("div",{id:"val-fullscreen-container",className:"relative w-full h-[100] overflow-hidden font-serif antialiased bg-background text-primary","data-mode":v,children:[x.jsx("div",{className:"fixed -translate-y-1/2 right-4 top-1/2 z-overlay",children:x.jsx(aM,{direction:"vertical",api:t,patches:_,onCommit:()=>S(R=>R+1)})}),x.jsx("div",{id:"val-fullscreen-hover",ref:E}),x.jsx(Jk.Provider,{value:{hoverElem:E==null?void 0:E.current},children:x.jsx("div",{className:"text-primary",children:x.jsxs(Ta,{children:[x.jsx("div",{className:"px-4 h-[50px] flex items-center justify-center",children:x.jsx($k,{})}),x.jsx($a,{className:"px-4",children:n?x.jsx(MD,{selectedPath:l,paths:Object.keys(n),setSelectedModuleId:R=>{w(R)}}):!i&&x.jsx("div",{className:"py-4",children:"Loading..."})}),x.jsxs("div",{className:"flex items-center justify-start h-[50px] gap-2 font-serif text-xs",children:[x.jsx("button",{onClick:()=>{history.back()},children:x.jsx(oR,{})}),x.jsx("div",{className:"truncate max-w-[300px]",dir:"rtl",title:l,children:x.jsx(Vo,{children:l||"/"})})]}),x.jsxs("div",{className:"p-4",children:[i&&x.jsxs("div",{className:"max-w-xl p-4 text-lg bg-destructive text-destructive-foreground",children:["ERROR: ",i]}),n&&l&&a&&u!==void 0&&c!==void 0&&x.jsx(Xk.Provider,{value:n,children:x.jsx($D,{path:l,source:u,schema:c,setSelectedPath:s,initOnSubmit:$})})]})]})})})]})})},Jk=re.createContext({hoverElem:null}),bD=()=>re.useContext(Jk);function $D({path:t,source:e,schema:n,setSelectedPath:r,initOnSubmit:i}){const[,o]=On.splitModuleIdAndModulePath(t),l=On.resolvePath(o,e,n);if(!l)throw Error("Could not resolve module: "+t);return x.jsx(ey,{path:t,source:l.source,schema:l.schema,setSelectedPath:r,initOnSubmit:i,top:!0})}function ey({path:t,source:e,schema:n,setSelectedPath:r,field:i,initOnSubmit:o,top:l}){if(n.opt)return x.jsx(PD,{path:t,source:e,schema:n,field:i,initOnSubmit:o,setSelectedPath:r});if(e===null)return x.jsx(eb,{source:e,schema:n,path:t,setSelectedPath:r,initOnSubmit:o});if(n.type==="object")return typeof e!="object"||Hl(e)?x.jsxs("div",{children:["ERROR: expected object, but found ",typeof e]}):x.jsx(Qk,{source:e,path:t,schema:n,initOnSubmit:o,setSelectedPath:r,top:l});if(n.type==="array")return typeof e!="object"||!Hl(e)?x.jsxs("div",{children:["ERROR: expected array, but found ",typeof e]}):x.jsxs("div",{children:[i?x.jsx("div",{className:"text-left",children:i}):x.jsx("div",{className:"truncate max-w-[300px]",title:t,dir:"rtl",children:x.jsx(Vo,{children:t})}),x.jsx(qk,{source:e,path:t,schema:n,setSelectedPath:r})]});if(n.type==="record")return typeof e!="object"?x.jsxs("div",{children:["ERROR: expected object for ",n.type,", but found ",typeof e]}):Hl(e)?x.jsxs("div",{children:["ERROR: did not expect array for ",n.type]}):x.jsxs("div",{children:[i?x.jsx("div",{className:"text-left",children:i}):x.jsx("div",{className:"truncate max-w-[300px]",title:t,dir:"rtl",children:x.jsx(Vo,{children:t})}),x.jsx(ND,{source:e,path:t,schema:n,setSelectedPath:r})]});if((n==null?void 0:n.type)==="union"){if(n.key&&typeof e=="object"&&!Hl(e))return x.jsx(TD,{field:i,tag:n.key,source:e,path:t,schema:n,initOnSubmit:o,setSelectedPath:r,top:l})}else if((n==null?void 0:n.type)==="literal")return x.jsx(x.Fragment,{});return x.jsxs("div",{className:"py-2 gap-y-4",children:[i?x.jsx("div",{className:"text-left",children:i}):x.jsx("div",{className:"truncate max-w-[300px]",title:t,dir:"rtl",children:x.jsx(Vo,{children:t})}),x.jsx(bk,{path:t,disabled:!1,source:e,schema:n,onSubmit:o(t)})]})}function TD({tag:t,field:e,path:n,source:r,schema:i,setSelectedPath:o,initOnSubmit:l,top:s}){const[a,u]=p.useState(null),[c,d]=p.useState(null),f=i.items.flatMap(m=>{if(m.type==="object"&&m.items[t]){const w=m.items[t];if(w.type==="literal")return[w.value]}return[]});p.useEffect(()=>{if(a){const m=r[t],w=i.items.find(v=>{if(v.type==="object"&&v.items[t]){const y=v.items[t];return y.type==="literal"?y.value===a:!1}});m&&typeof m=="string"&&w?d({source:r,schema:w}):w?d({schema:w}):(console.error("Could not find source or schema of key",a,r,i),d(null))}else{const m=r==null?void 0:r[t];m&&typeof m=="string"&&u(m)}},[a,r,t,i,f]),f.length!==i.items.length&&console.warn("Not all items have tag:",t);const h=!1,g=l(n);return x.jsxs(Bs,{className:Pn("flex flex-col gap-y-4",{"border-l-2 border-border pl-6":!s}),children:[e?x.jsx("div",{className:"text-left",children:e}):x.jsx("div",{className:"truncate max-w-[300px]",title:n,dir:"rtl",children:x.jsx(Vo,{children:n})}),x.jsxs(Ck,{value:a??void 0,disabled:h,onValueChange:m=>{u(m)},children:[x.jsx(Zv,{children:x.jsx(kk,{placeholder:"Select type"})}),x.jsx(Gv,{children:f.map(m=>x.jsx(Yv,{value:m.toString(),children:m.toString()},m))})]}),x.jsx(Us,{loading:h,enabled:!1,onClick:()=>g(async()=>[])}),c&&x.jsx(ey,{path:n,source:c.source??null,schema:c.schema,setSelectedPath:o,initOnSubmit:l,top:s})]},n)}function Qk({path:t,source:e,schema:n,setSelectedPath:r,initOnSubmit:i,top:o}){return x.jsx("div",{className:Pn("flex flex-col gap-y-1",{"border-l-2 border-border pl-6":!o}),children:Object.entries(n.items).map(([l,s])=>{const a=Nu(t,l);return x.jsx(ey,{path:a,source:(e==null?void 0:e[l])??null,schema:s,setSelectedPath:r,field:l,initOnSubmit:i},a)})},t)}function ND({path:t,source:e,schema:n,setSelectedPath:r}){const i=qv();return x.jsx("div",{className:"flex flex-col gap-4 p-2",children:Object.entries(e).map(([o,l])=>{const s=Nu(t,o);return x.jsx("button",{onClick:()=>{r(s),i(s)},children:x.jsx(RD,{recordKey:o,path:s,source:l,schema:n.item})},s)})},t)}const Xm=170;function RD({recordKey:t,path:e,source:n,schema:r}){const i=re.useRef(null),[o,l]=p.useState(!1);return p.useEffect(()=>{i.current&&i.current.getBoundingClientRect().height>=Xm&&l(!0)},[]),x.jsxs(Xv,{ref:i,className:"relative px-4 pt-2 pb-4 overflow-hidden border gap-y-2",style:{maxHeight:Xm},children:[x.jsx("div",{className:"pb-4 font-serif text-left text-accent",children:t}),x.jsx("div",{className:"text-xs",children:x.jsx(ty,{path:e,source:n,schema:r})}),o&&x.jsx("div",{className:"absolute bottom-0 left-0 w-full h-[20px] bg-gradient-to-b from-transparent to-background"})]},e)}function qk({path:t,source:e,schema:n,setSelectedPath:r}){const i=qv();return x.jsx("div",{className:"flex flex-col gap-4 p-2 pb-8",children:e.map((o,l)=>{const s=Nu(t,l);return x.jsx("button",{onClick:()=>{r(s),i(s)},children:x.jsx(OD,{index:l,path:s,source:o,schema:n.item},s)},s)})},t)}const w_=Xm;function OD({index:t,path:e,source:n,schema:r}){const i=re.useRef(null),[o,l]=p.useState(!1);return p.useEffect(()=>{i.current&&i.current.getBoundingClientRect().height>=w_&&l(!0)},[]),x.jsxs(Xv,{ref:i,className:"relative px-4 pt-2 pb-4 overflow-hidden border gap-y-2",style:{maxHeight:w_},children:[x.jsx("div",{className:"pb-4 font-serif text-left uppercase text-accent",children:t+1<10?`0${t+1}`:t+1}),x.jsx("div",{className:"text-xs",children:x.jsx(ty,{path:e,source:n,schema:r})}),o&&x.jsx("div",{className:"absolute bottom-0 left-0 w-full h-[20px] bg-gradient-to-b from-transparent to-background"})]})}function Nu(t,e){const n=On.createValPathOfItem(t,e);if(!n)throw Error(`Could not create val path: ${t} of ${e==null?void 0:e.toString()}`);return n}function ty({path:t,source:e,schema:n}){const[r,i]=p.useState(null),{hoverElem:o}=bD();if(n.type==="object")return x.jsx("div",{className:"grid grid-cols-[min-content_1fr] gap-2 text-left",children:Object.entries(n.items).map(([l])=>x.jsxs(p.Fragment,{children:[x.jsxs("span",{className:"text-muted",children:[l,":"]}),x.jsx("span",{children:x.jsx(ty,{source:(e==null?void 0:e[l])??null,schema:n.items[l],path:Nu(t,l)})})]},Nu(t,l)))},t);if(n.type==="array")return e===null?x.jsx("span",{className:"text-accent",children:"Empty"},t):Array.isArray(e)?x.jsxs("span",{children:[x.jsx("span",{className:"text-accent",children:e.length}),x.jsx("span",{children:e.length===1?" item":" items"})]},t):x.jsx("span",{className:"px-2 bg-destructive text-destructive-foreground",children:"Unknown length"},t);if(n.type==="richtext")return e===null?x.jsx("span",{className:"text-accent",children:"Empty"},t):typeof e!="object"?x.jsxs("div",{className:"p-4 text-destructive-foreground bg-destructive",children:["ERROR: ",typeof e," not an object"]},t):!(nn in e)||e[nn]!=="richtext"?x.jsx("div",{className:"p-4 text-destructive-foreground bg-destructive",children:"ERROR: object is not richtext"},t):x.jsx(LD,{children:DE(e)},t);if(n.type==="string")return e===null?x.jsx("span",{className:"text-accent",children:"Empty"},t):x.jsx("span",{children:e});if(n.type==="image"){if(e===null)return x.jsx("span",{className:"text-accent",children:"Empty"},t);if(typeof e!="object")return x.jsx("div",{className:"p-4 text-destructive-foreground bg-destructive",children:"ERROR: not an object"},t);if(!(Rn in e)||typeof e[Rn]!="string")return x.jsx("div",{className:"p-4 text-destructive-foreground bg-destructive",children:"ERROR: object is not an image"},t);const l=On.convertFileSource(e).url;return x.jsxs("span",{onMouseOver:s=>{i({x:s.clientX,y:s.clientY})},onMouseLeave:()=>{i(null)},className:"relative flex items-center justify-start gap-1",children:[x.jsx("a",{href:l,className:"overflow-hidden underline truncate ",children:e[Rn]}),r&&o&&Yr.createPortal(x.jsx("img",{className:"absolute z-[5] max-w-[10vw]",style:{left:r.x+10,top:r.y+10},src:l}),o)]},t)}else{if(n.type==="boolean")return e===null?x.jsx("span",{className:"text-accent",children:"Empty"},t):x.jsx("span",{className:"text-accent",children:e?"true":"false"},t);if(n.type==="number")return e===null?x.jsx("span",{className:"text-accent",children:"Empty"},t):x.jsx("span",{className:"text-accent",children:e.toString()});if(n.type==="keyOf")return e===null?x.jsx("span",{className:"text-accent",children:"Empty"},t):x.jsx("span",{className:"text-accent",children:e.toString()},t)}return x.jsxs("div",{children:["TODO: ",n.type]},t)}function PD({path:t,source:e,schema:n,setSelectedPath:r,initOnSubmit:i,field:o}){const[l,s]=p.useState(e!==null),{editMode:a}=jf();return x.jsxs("div",{className:"flex flex-col gap-y-2",children:[x.jsxs("div",{className:"flex items-center justify-start gap-x-4",children:[a==="full"&&x.jsx(Ok,{checked:l,onClick:()=>{s(u=>!u)}}),x.jsx("div",{className:"truncate max-w-[300px]",title:t,dir:"rtl",children:o||x.jsx(Vo,{children:t})})]}),l&&x.jsx(eb,{source:e,schema:n,path:t,setSelectedPath:r,initOnSubmit:i})]},t)}function eb({source:t,path:e,schema:n,setSelectedPath:r,initOnSubmit:i}){if(n.type==="array"){if(typeof t=="object"&&(t===null||Hl(t)))return x.jsx(qk,{source:t===null?[]:t,path:e,schema:n,setSelectedPath:r})}else if(n.type==="object"){if(typeof t=="object"&&(t===null||!Hl(t)))return x.jsx(Qk,{source:t,path:e,schema:n,setSelectedPath:r,initOnSubmit:i})}else if(n.type==="richtext"||n.type==="string"||n.type==="image"||n.type==="number"||n.type==="keyOf")return x.jsx(bk,{path:e,disabled:!1,source:t,schema:n,onSubmit:i(e)},e);return x.jsxs("div",{className:"p-4 bg-destructive text-destructive-foreground",children:["ERROR: unexpected source type ",typeof t," for schema type"," ",n.type]})}function Hl(t){return Array.isArray(t)}function AD(t){const e={};return t.forEach(n=>{const r=n.split("/").filter(i=>i!=="");if(r.length===1)e[""]||(e[""]=[]),e[""].push(r[0]);else if(r.length>1){const i=r.slice(0,r.length-1).join("/"),o=r.slice(-1)[0];e[i]||(e[i]=[]),e[i].push(o)}}),e}function MD({selectedPath:t,paths:e,setSelectedModuleId:n}){const r=AD(e),i=t&&On.splitModuleIdAndModulePath(t)[0];return x.jsx("div",{className:"flex flex-col w-full py-2 text-xs",children:Object.entries(r).map(([o,l])=>x.jsxs("div",{className:"px-4 py-2",children:[o&&x.jsx("div",{className:"font-bold truncate max-w-[300px]",title:o,children:x.jsx(Vo,{children:o})}),x.jsx("div",{className:Pn({"flex flex-col py-2 justify-start items-start":!!o}),children:l.map(s=>{const a=`/${o}/${s}`;return x.jsx("button",{className:Pn("block px-2 py-1 rounded-full",{"bg-accent text-accent-foreground":i===a}),onClick:()=>{n(a)},children:s},a)})})]},`/${o}`))})}const S_={tags:{h1:"font-bold",h2:"font-bold",h3:"font-bold",h4:"font-bold",h5:"font-bold",h6:"font-bold",p:""},classes:{bold:"font-bold",italic:"italic",lineThrough:"line-through"}};function LD({children:t}){const e=t;function n(o,l){const s=S_.tags[o];return s&&l?[l,s].join(" "):s||l}function r(o,l){const s=S_.classes[o];return s&&l?[l,s].join(" "):s||l}function i(o,l){var u,c;if(typeof o=="string")return o;if(o.tag==="p")return x.jsx("p",{className:n("p"),children:o.children.map((d,f)=>i(d,f))},l);if(o.tag==="img")return x.jsx("img",{className:n("img"),src:o.src},l);if(o.tag==="ul")return x.jsx("ul",{className:n("ul"),children:o.children.map((d,f)=>i(d,f))},l);if(o.tag==="ol")return x.jsx("ol",{className:n("ol"),children:o.children.map((d,f)=>i(d,f))},l);if(o.tag==="li")return x.jsx("li",{className:n("li"),children:o.children.map((d,f)=>i(d,f))},l);if(o.tag==="span")return x.jsx("span",{className:o.classes.map(d=>{switch(d){case"bold":return r("bold");case"line-through":return r("lineThrough");case"italic":return r("italic")}}).join(" "),children:o.children.map((d,f)=>i(d,f))},l);if(o.tag==="h1")return x.jsx("h1",{className:n("h1"),children:o.children.map((d,f)=>i(d,f))},l);if(o.tag==="h2")return x.jsx("h2",{className:n("h2"),children:o.children.map((d,f)=>i(d,f))},l);if(o.tag==="h3")return x.jsx("h3",{className:n("h3"),children:o.children.map((d,f)=>i(d,f))},l);if(o.tag==="h4")return x.jsx("h4",{className:n("h4"),children:o.children.map((d,f)=>i(d,f))},l);if(o.tag==="h5")return x.jsx("h5",{className:n("h5"),children:o.children.map((d,f)=>i(d,f))},l);if(o.tag==="h6")return x.jsx("h6",{className:n("h6"),children:o.children.map((d,f)=>i(d,f))},l);if(o.tag==="br")return x.jsx("br",{},l);if(o.tag==="a")return x.jsx("a",{href:o.href,children:o.children.map((d,f)=>i(d,f))},l);console.error("Unknown tag",o.tag);const a=o.tag;return a!=null&&a.tag?re.createElement(a.tag,{key:l,className:(u=a.class)==null?void 0:u.join(" "),children:(c=a.children)==null?void 0:c.map(i)}):null}return x.jsx("span",{"data-val-path":e.valPath,children:e.children.map((o,l)=>i(o,l))})}const DD=p.createContext(null),Qh={didCatch:!1,error:null};class ID extends p.Component{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=Qh}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(){const{error:e}=this.state;if(e!==null){for(var n,r,i=arguments.length,o=new Array(i),l=0;l<i;l++)o[l]=arguments[l];(n=(r=this.props).onReset)===null||n===void 0||n.call(r,{args:o,reason:"imperative-api"}),this.setState(Qh)}}componentDidCatch(e,n){var r,i;(r=(i=this.props).onError)===null||r===void 0||r.call(i,e,n)}componentDidUpdate(e,n){const{didCatch:r}=this.state,{resetKeys:i}=this.props;if(r&&n.error!==null&&jD(e.resetKeys,i)){var o,l;(o=(l=this.props).onReset)===null||o===void 0||o.call(l,{next:i,prev:e.resetKeys,reason:"keys"}),this.setState(Qh)}}render(){const{children:e,fallbackRender:n,FallbackComponent:r,fallback:i}=this.props,{didCatch:o,error:l}=this.state;let s=e;if(o){const a={error:l,resetErrorBoundary:this.resetErrorBoundary};if(p.isValidElement(i))s=i;else if(typeof n=="function")s=n(a);else if(r)s=p.createElement(r,a);else throw l}return p.createElement(DD.Provider,{value:{didCatch:o,error:l,resetErrorBoundary:this.resetErrorBoundary}},s)}}function jD(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return t.length!==e.length||t.some((n,r)=>!Object.is(n,e[r]))}const tb="Collapsible",[zD,nb]=al(tb),[FD,ny]=zD(tb),BD=p.forwardRef((t,e)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:o,onOpenChange:l,...s}=t,[a=!1,u]=xs({prop:r,defaultProp:i,onChange:l});return p.createElement(FD,{scope:n,disabled:o,contentId:Ff(),open:a,onOpenToggle:p.useCallback(()=>u(c=>!c),[u])},p.createElement(Ke.div,ie({"data-state":ry(a),"data-disabled":o?"":void 0},s,{ref:e})))}),UD="CollapsibleTrigger",WD=p.forwardRef((t,e)=>{const{__scopeCollapsible:n,...r}=t,i=ny(UD,n);return p.createElement(Ke.button,ie({type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":ry(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled},r,{ref:e,onClick:nt(t.onClick,i.onOpenToggle)}))}),rb="CollapsibleContent",VD=p.forwardRef((t,e)=>{const{forceMount:n,...r}=t,i=ny(rb,t.__scopeCollapsible);return p.createElement(ks,{present:n||i.open},({present:o})=>p.createElement(HD,ie({},r,{ref:e,present:o})))}),HD=p.forwardRef((t,e)=>{const{__scopeCollapsible:n,present:r,children:i,...o}=t,l=ny(rb,n),[s,a]=p.useState(r),u=p.useRef(null),c=st(e,u),d=p.useRef(0),f=d.current,h=p.useRef(0),g=h.current,m=l.open||s,w=p.useRef(m),v=p.useRef();return p.useEffect(()=>{const y=requestAnimationFrame(()=>w.current=!1);return()=>cancelAnimationFrame(y)},[]),Vn(()=>{const y=u.current;if(y){v.current=v.current||{transitionDuration:y.style.transitionDuration,animationName:y.style.animationName},y.style.transitionDuration="0s",y.style.animationName="none";const _=y.getBoundingClientRect();d.current=_.height,h.current=_.width,w.current||(y.style.transitionDuration=v.current.transitionDuration,y.style.animationName=v.current.animationName),a(r)}},[l.open,r]),p.createElement(Ke.div,ie({"data-state":ry(l.open),"data-disabled":l.disabled?"":void 0,id:l.contentId,hidden:!m},o,{ref:c,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":g?`${g}px`:void 0,...t.style}}),m&&i)});function ry(t){return t?"open":"closed"}const KD=BD,ZD=WD,GD=VD,Eo="Accordion",YD=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[iy,XD,JD]=jC(Eo),[Jf,AI]=al(Eo,[JD,nb]),oy=nb(),ib=re.forwardRef((t,e)=>{const{type:n,...r}=t,i=r,o=r;return re.createElement(iy.Provider,{scope:t.__scopeAccordion},n==="multiple"?re.createElement(tI,ie({},o,{ref:e})):re.createElement(eI,ie({},i,{ref:e})))});ib.propTypes={type(t){const e=t.value||t.defaultValue;return t.type&&!["single","multiple"].includes(t.type)?new Error("Invalid prop `type` supplied to `Accordion`. Expected one of `single | multiple`."):t.type==="multiple"&&typeof e=="string"?new Error("Invalid prop `type` supplied to `Accordion`. Expected `single` when `defaultValue` or `value` is type `string`."):t.type==="single"&&Array.isArray(e)?new Error("Invalid prop `type` supplied to `Accordion`. Expected `multiple` when `defaultValue` or `value` is type `string[]`."):null}};const[ob,QD]=Jf(Eo),[lb,qD]=Jf(Eo,{collapsible:!1}),eI=re.forwardRef((t,e)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},collapsible:o=!1,...l}=t,[s,a]=xs({prop:n,defaultProp:r,onChange:i});return re.createElement(ob,{scope:t.__scopeAccordion,value:s?[s]:[],onItemOpen:a,onItemClose:re.useCallback(()=>o&&a(""),[o,a])},re.createElement(lb,{scope:t.__scopeAccordion,collapsible:o},re.createElement(sb,ie({},l,{ref:e}))))}),tI=re.forwardRef((t,e)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},...o}=t,[l=[],s]=xs({prop:n,defaultProp:r,onChange:i}),a=re.useCallback(c=>s((d=[])=>[...d,c]),[s]),u=re.useCallback(c=>s((d=[])=>d.filter(f=>f!==c)),[s]);return re.createElement(ob,{scope:t.__scopeAccordion,value:l,onItemOpen:a,onItemClose:u},re.createElement(lb,{scope:t.__scopeAccordion,collapsible:!0},re.createElement(sb,ie({},o,{ref:e}))))}),[nI,Qf]=Jf(Eo),sb=re.forwardRef((t,e)=>{const{__scopeAccordion:n,disabled:r,dir:i,orientation:o="vertical",...l}=t,s=re.useRef(null),a=st(s,e),u=XD(n),d=Yg(i)==="ltr",f=nt(t.onKeyDown,h=>{var g;if(!YD.includes(h.key))return;const m=h.target,w=u().filter(R=>{var b;return!((b=R.ref.current)!==null&&b!==void 0&&b.disabled)}),v=w.findIndex(R=>R.ref.current===m),y=w.length;if(v===-1)return;h.preventDefault();let _=v;const S=0,E=y-1,$=()=>{_=v+1,_>E&&(_=S)},C=()=>{_=v-1,_<S&&(_=E)};switch(h.key){case"Home":_=S;break;case"End":_=E;break;case"ArrowRight":o==="horizontal"&&(d?$():C());break;case"ArrowDown":o==="vertical"&&$();break;case"ArrowLeft":o==="horizontal"&&(d?C():$());break;case"ArrowUp":o==="vertical"&&C();break}const N=_%y;(g=w[N].ref.current)===null||g===void 0||g.focus()});return re.createElement(nI,{scope:n,disabled:r,direction:i,orientation:o},re.createElement(iy.Slot,{scope:n},re.createElement(Ke.div,ie({},l,{"data-orientation":o,ref:a,onKeyDown:r?void 0:f}))))}),Jm="AccordionItem",[rI,ly]=Jf(Jm),iI=re.forwardRef((t,e)=>{const{__scopeAccordion:n,value:r,...i}=t,o=Qf(Jm,n),l=QD(Jm,n),s=oy(n),a=Ff(),u=r&&l.value.includes(r)||!1,c=o.disabled||t.disabled;return re.createElement(rI,{scope:n,open:u,disabled:c,triggerId:a},re.createElement(KD,ie({"data-orientation":o.orientation,"data-state":ab(u)},s,i,{ref:e,disabled:c,open:u,onOpenChange:d=>{d?l.onItemOpen(r):l.onItemClose(r)}})))}),oI="AccordionHeader",lI=re.forwardRef((t,e)=>{const{__scopeAccordion:n,...r}=t,i=Qf(Eo,n),o=ly(oI,n);return re.createElement(Ke.h3,ie({"data-orientation":i.orientation,"data-state":ab(o.open),"data-disabled":o.disabled?"":void 0},r,{ref:e}))}),E_="AccordionTrigger",sI=re.forwardRef((t,e)=>{const{__scopeAccordion:n,...r}=t,i=Qf(Eo,n),o=ly(E_,n),l=qD(E_,n),s=oy(n);return re.createElement(iy.ItemSlot,{scope:n},re.createElement(ZD,ie({"aria-disabled":o.open&&!l.collapsible||void 0,"data-orientation":i.orientation,id:o.triggerId},s,r,{ref:e})))}),aI="AccordionContent",uI=re.forwardRef((t,e)=>{const{__scopeAccordion:n,...r}=t,i=Qf(Eo,n),o=ly(aI,n),l=oy(n);return re.createElement(GD,ie({role:"region","aria-labelledby":o.triggerId,"data-orientation":i.orientation},l,r,{ref:e,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...t.style}}))});function ab(t){return t?"open":"closed"}const cI=ib,dI=iI,fI=lI,ub=sI,cb=uI,hI=cI,db=p.forwardRef(({className:t,...e},n)=>x.jsx(dI,{ref:n,className:xt("border-b",t),...e}));db.displayName="AccordionItem";const fb=p.forwardRef(({className:t,children:e,...n},r)=>x.jsx(fI,{className:"flex",children:x.jsxs(ub,{ref:r,className:xt("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",t),...n,children:[e,x.jsx(wS,{className:"w-4 h-4 transition-transform duration-200 shrink-0"})]})}));fb.displayName=ub.displayName;const hb=p.forwardRef(({className:t,children:e,...n},r)=>x.jsx(cb,{ref:r,className:xt("overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",t),...n,children:x.jsx("div",{className:"pt-0 pb-4",children:e})}));hb.displayName=cb.displayName;/**
|
|
192
|
+
Showing stack trace of: 1. ${d[0].message}`,b=new Error(R);throw b.stack=d[0].stack,b}f&&f.length>0&&console.warn("Val encountered validation errors:",f),p.useEffect(()=>{s(e?`/${e}`:l)},[e]);const[h,g]=p.useState(null);p.useEffect(()=>{try{new WebSocket(`${window.location.origin.replace("http://","ws://")}/_next/webpack-hmr`).addEventListener("message",b=>{let L;try{L=JSON.parse(b.data)}catch{console.error("Failed to parse HMR")}typeof(L==null?void 0:L.hash)=="string"&&(L==null?void 0:L.action)==="built"&&g(L.hash)})}catch(R){console.warn("Failed to initialize HMR",R)}},[]),p.useEffect(()=>{console.log("(Re)-fetching modules"),t.getTree({patch:!0,includeSchema:!0,includeSource:!0}).then(R=>{zo.isOk(R)?r(R.value.modules):(o("Could not load modules: "+R.error.message),console.error(R.error))})},[h]);const m=d5(t),w=qv(),[v,y]=dM(),{patches:_,setPatchResetId:S}=cM(m,t),E=re.useRef(null),$=p.useCallback(R=>async b=>{const[L,F]=On.splitModuleIdAndModulePath(R),le=await b(On.createPatchJSONPath(F));return t.postPatches(L,le).then(V=>{if(zo.isErr(V))throw V.error;if(!h)return S(H=>H+1),t.getTree({treePath:L,patch:!0,includeSchema:!0,includeSource:!0}).then(H=>{zo.isOk(H)?r(O=>({...O,...H.value.modules})):(o("Could not load modules: "+H.error.message),console.error(H.error))})}).catch(V=>{console.error(V)})},[]);return x.jsx(EC.Provider,{value:{theme:v,setTheme:y,api:t,editMode:"full",session:m,highlight:!1,setHighlight:()=>{},setEditMode:()=>{},setWindowSize:()=>{}},children:x.jsxs("div",{id:"val-fullscreen-container",className:"relative w-full h-[100] overflow-hidden font-serif antialiased bg-background text-primary","data-mode":v,children:[x.jsx("div",{className:"fixed -translate-y-1/2 right-4 top-1/2 z-overlay",children:x.jsx(aM,{direction:"vertical",api:t,patches:_,onCommit:()=>S(R=>R+1)})}),x.jsx("div",{id:"val-fullscreen-hover",ref:E}),x.jsx(Jk.Provider,{value:{hoverElem:E==null?void 0:E.current},children:x.jsx("div",{className:"text-primary",children:x.jsxs(Ta,{children:[x.jsx("div",{className:"px-4 h-[50px] flex items-center justify-center",children:x.jsx($k,{})}),x.jsx($a,{className:"px-4",children:n?x.jsx(MD,{selectedPath:l,paths:Object.keys(n),setSelectedModuleId:R=>{w(R)}}):!i&&x.jsx("div",{className:"py-4",children:"Loading..."})}),x.jsxs("div",{className:"flex items-center justify-start h-[50px] gap-2 font-serif text-xs",children:[x.jsx("button",{onClick:()=>{history.back()},children:x.jsx(oR,{})}),x.jsx("div",{className:"truncate max-w-[300px] text-left",dir:"rtl",title:l,children:x.jsx(Vo,{children:l||"/"})})]}),x.jsxs("div",{className:"p-4",children:[i&&x.jsxs("div",{className:"max-w-xl p-4 text-lg bg-destructive text-destructive-foreground",children:["ERROR: ",i]}),n&&l&&a&&u!==void 0&&c!==void 0&&x.jsx(Xk.Provider,{value:n,children:x.jsx($D,{path:l,source:u,schema:c,setSelectedPath:s,initOnSubmit:$})})]})]})})})]})})},Jk=re.createContext({hoverElem:null}),bD=()=>re.useContext(Jk);function $D({path:t,source:e,schema:n,setSelectedPath:r,initOnSubmit:i}){const[,o]=On.splitModuleIdAndModulePath(t),l=On.resolvePath(o,e,n);if(!l)throw Error("Could not resolve module: "+t);return x.jsx(ey,{path:t,source:l.source,schema:l.schema,setSelectedPath:r,initOnSubmit:i,top:!0})}function ey({path:t,source:e,schema:n,setSelectedPath:r,field:i,initOnSubmit:o,top:l}){if(n.opt)return x.jsx(PD,{path:t,source:e,schema:n,field:i,initOnSubmit:o,setSelectedPath:r});if(e===null)return x.jsx(eb,{source:e,schema:n,path:t,setSelectedPath:r,initOnSubmit:o});if(n.type==="object")return typeof e!="object"||Kl(e)?x.jsxs("div",{children:["ERROR: expected object, but found ",typeof e]}):x.jsx(Qk,{source:e,path:t,schema:n,initOnSubmit:o,setSelectedPath:r,top:l});if(n.type==="array")return typeof e!="object"||!Kl(e)?x.jsxs("div",{children:["ERROR: expected array, but found ",typeof e]}):x.jsxs("div",{children:[i?x.jsx("div",{className:"text-left",children:i}):x.jsx("div",{className:"truncate max-w-[300px] text-left",title:t,dir:"rtl",children:x.jsx(Vo,{children:t})}),x.jsx(qk,{source:e,path:t,schema:n,setSelectedPath:r})]});if(n.type==="record")return typeof e!="object"?x.jsxs("div",{children:["ERROR: expected object for ",n.type,", but found ",typeof e]}):Kl(e)?x.jsxs("div",{children:["ERROR: did not expect array for ",n.type]}):x.jsxs("div",{children:[i?x.jsx("div",{className:"text-left",children:i}):x.jsx("div",{className:"truncate max-w-[300px] text-left",title:t,dir:"rtl",children:x.jsx(Vo,{children:t})}),x.jsx(ND,{source:e,path:t,schema:n,setSelectedPath:r})]});if((n==null?void 0:n.type)==="union"){if(n.key&&typeof e=="object"&&!Kl(e))return x.jsx(TD,{field:i,tag:n.key,source:e,path:t,schema:n,initOnSubmit:o,setSelectedPath:r,top:l})}else if((n==null?void 0:n.type)==="literal")return x.jsx(x.Fragment,{});return x.jsxs("div",{className:"py-2 gap-y-4",children:[i?x.jsx("div",{className:"text-left",children:i}):x.jsx("div",{className:"truncate max-w-[300px] text-left",title:t,dir:"rtl",children:x.jsx(Vo,{children:t})}),x.jsx(bk,{path:t,disabled:!1,source:e,schema:n,onSubmit:o(t)})]})}function TD({tag:t,field:e,path:n,source:r,schema:i,setSelectedPath:o,initOnSubmit:l,top:s}){const[a,u]=p.useState(null),[c,d]=p.useState(null),f=i.items.flatMap(m=>{if(m.type==="object"&&m.items[t]){const w=m.items[t];if(w.type==="literal")return[w.value]}return[]});p.useEffect(()=>{if(a){const m=r[t],w=i.items.find(v=>{if(v.type==="object"&&v.items[t]){const y=v.items[t];return y.type==="literal"?y.value===a:!1}});m&&typeof m=="string"&&w?d({source:r,schema:w}):w?d({schema:w}):(console.error("Could not find source or schema of key",a,r,i),d(null))}else{const m=r==null?void 0:r[t];m&&typeof m=="string"&&u(m)}},[a,r,t,i,f]),f.length!==i.items.length&&console.warn("Not all items have tag:",t);const h=!1,g=l(n);return x.jsxs(pl,{className:Pn("flex flex-col gap-y-4",{"border-l-2 border-border pl-6":!s}),children:[e?x.jsx("div",{className:"text-left",children:e}):x.jsx("div",{className:"truncate max-w-[300px] text-left",title:n,dir:"rtl",children:x.jsx(Vo,{children:n})}),x.jsxs(Ck,{value:a??void 0,disabled:h,onValueChange:m=>{u(m)},children:[x.jsx(Zv,{children:x.jsx(kk,{placeholder:"Select type"})}),x.jsx(Gv,{children:f.map(m=>x.jsx(Yv,{value:m.toString(),children:m.toString()},m))})]}),x.jsx(Us,{loading:h,enabled:!1,onClick:()=>g(async()=>[])}),c&&x.jsx(ey,{path:n,source:c.source??null,schema:c.schema,setSelectedPath:o,initOnSubmit:l,top:s})]},n)}function Qk({path:t,source:e,schema:n,setSelectedPath:r,initOnSubmit:i,top:o}){return x.jsx("div",{className:Pn("flex flex-col gap-y-1",{"border-l-2 border-border pl-6":!o}),children:Object.entries(n.items).map(([l,s])=>{const a=Nu(t,l);return x.jsx(ey,{path:a,source:(e==null?void 0:e[l])??null,schema:s,setSelectedPath:r,field:l,initOnSubmit:i},a)})},t)}function ND({path:t,source:e,schema:n,setSelectedPath:r}){const i=qv();return x.jsx("div",{className:"flex flex-col gap-4 p-2",children:Object.entries(e).map(([o,l])=>{const s=Nu(t,o);return x.jsx("button",{onClick:()=>{r(s),i(s)},children:x.jsx(RD,{recordKey:o,path:s,source:l,schema:n.item})},s)})},t)}const Xm=170;function RD({recordKey:t,path:e,source:n,schema:r}){const i=re.useRef(null),[o,l]=p.useState(!1);return p.useEffect(()=>{i.current&&i.current.getBoundingClientRect().height>=Xm&&l(!0)},[]),x.jsxs(Xv,{ref:i,className:"relative px-4 pt-2 pb-4 overflow-hidden border gap-y-2",style:{maxHeight:Xm},children:[x.jsx("div",{className:"pb-4 font-serif text-left text-accent",children:t}),x.jsx("div",{className:"text-xs",children:x.jsx(ty,{path:e,source:n,schema:r})}),o&&x.jsx("div",{className:"absolute bottom-0 left-0 w-full h-[20px] bg-gradient-to-b from-transparent to-background"})]},e)}function qk({path:t,source:e,schema:n,setSelectedPath:r}){const i=qv();return x.jsx(pl,{className:"flex flex-col gap-4 p-2 pb-8",children:e.map((o,l)=>{const s=Nu(t,l);return x.jsx("button",{onClick:()=>{r(s),i(s)},children:x.jsx(OD,{index:l,path:s,source:o,schema:n.item},s)},s)})},t)}const w_=Xm;function OD({index:t,path:e,source:n,schema:r}){const i=re.useRef(null),[o,l]=p.useState(!1);return p.useEffect(()=>{i.current&&i.current.getBoundingClientRect().height>=w_&&l(!0)},[]),x.jsxs(Xv,{ref:i,className:"relative px-4 pt-2 pb-4 overflow-hidden border gap-y-2",style:{maxHeight:w_},children:[x.jsx("div",{className:"pb-4 font-serif text-left uppercase text-accent",children:t+1<10?`0${t+1}`:t+1}),x.jsx("div",{className:"text-xs",children:x.jsx(ty,{path:e,source:n,schema:r})}),o&&x.jsx("div",{className:"absolute bottom-0 left-0 w-full h-[20px] bg-gradient-to-b from-transparent to-background"})]})}function Nu(t,e){const n=On.createValPathOfItem(t,e);if(!n)throw Error(`Could not create val path: ${t} of ${e==null?void 0:e.toString()}`);return n}function ty({path:t,source:e,schema:n}){const[r,i]=p.useState(null),{hoverElem:o}=bD();if(n.type==="object")return x.jsx("div",{className:"grid grid-cols-[min-content_1fr] gap-2 text-left",children:Object.entries(n.items).map(([l])=>x.jsxs(p.Fragment,{children:[x.jsxs("span",{className:"text-muted",children:[l,":"]}),x.jsx("span",{children:x.jsx(ty,{source:(e==null?void 0:e[l])??null,schema:n.items[l],path:Nu(t,l)})})]},Nu(t,l)))},t);if(n.type==="array")return e===null?x.jsx("span",{className:"text-accent",children:"Empty"},t):Array.isArray(e)?x.jsxs("span",{children:[x.jsx("span",{className:"text-accent",children:e.length}),x.jsx("span",{children:e.length===1?" item":" items"})]},t):x.jsx("span",{className:"px-2 bg-destructive text-destructive-foreground",children:"Unknown length"},t);if(n.type==="richtext")return e===null?x.jsx("span",{className:"text-accent",children:"Empty"},t):typeof e!="object"?x.jsxs("div",{className:"p-4 text-destructive-foreground bg-destructive",children:["ERROR: ",typeof e," not an object"]},t):!(nn in e)||e[nn]!=="richtext"?x.jsx("div",{className:"p-4 text-destructive-foreground bg-destructive",children:"ERROR: object is not richtext"},t):x.jsx(LD,{children:DE(e)},t);if(n.type==="string")return e===null?x.jsx("span",{className:"text-accent",children:"Empty"},t):x.jsx("span",{children:e});if(n.type==="image"){if(e===null)return x.jsx("span",{className:"text-accent",children:"Empty"},t);if(typeof e!="object")return x.jsx("div",{className:"p-4 text-destructive-foreground bg-destructive",children:"ERROR: not an object"},t);if(!(Rn in e)||typeof e[Rn]!="string")return x.jsx("div",{className:"p-4 text-destructive-foreground bg-destructive",children:"ERROR: object is not an image"},t);const l=On.convertFileSource(e).url;return x.jsxs("span",{onMouseOver:s=>{i({x:s.clientX,y:s.clientY})},onMouseLeave:()=>{i(null)},className:"relative flex items-center justify-start gap-1",children:[x.jsx("a",{href:l,className:"overflow-hidden underline truncate ",children:e[Rn]}),r&&o&&Yr.createPortal(x.jsx("img",{className:"absolute z-[5] max-w-[10vw]",style:{left:r.x+10,top:r.y+10},src:l}),o)]},t)}else{if(n.type==="boolean")return e===null?x.jsx("span",{className:"text-accent",children:"Empty"},t):x.jsx("span",{className:"text-accent",children:e?"true":"false"},t);if(n.type==="number")return e===null?x.jsx("span",{className:"text-accent",children:"Empty"},t):x.jsx("span",{className:"text-accent",children:e.toString()});if(n.type==="keyOf")return e===null?x.jsx("span",{className:"text-accent",children:"Empty"},t):x.jsx("span",{className:"text-accent",children:e.toString()},t)}return x.jsxs("div",{children:["TODO: ",n.type]},t)}function PD({path:t,source:e,schema:n,setSelectedPath:r,initOnSubmit:i,field:o}){const[l,s]=p.useState(e!==null),{editMode:a}=jf();return x.jsxs("div",{className:"flex flex-col gap-y-2",children:[x.jsxs("div",{className:"flex items-center justify-start gap-x-4",children:[a==="full"&&x.jsx(Ok,{checked:l,onClick:()=>{s(u=>!u)}}),x.jsx("div",{className:"truncate max-w-[300px] text-left",title:t,dir:"rtl",children:o||x.jsx(Vo,{children:t})})]}),l&&x.jsx(eb,{source:e,schema:n,path:t,setSelectedPath:r,initOnSubmit:i})]},t)}function eb({source:t,path:e,schema:n,setSelectedPath:r,initOnSubmit:i}){if(n.type==="array"){if(typeof t=="object"&&(t===null||Kl(t)))return x.jsx(qk,{source:t===null?[]:t,path:e,schema:n,setSelectedPath:r})}else if(n.type==="object"){if(typeof t=="object"&&(t===null||!Kl(t)))return x.jsx(Qk,{source:t,path:e,schema:n,setSelectedPath:r,initOnSubmit:i})}else if(n.type==="richtext"||n.type==="string"||n.type==="image"||n.type==="number"||n.type==="keyOf")return x.jsx(bk,{path:e,disabled:!1,source:t,schema:n,onSubmit:i(e)},e);return x.jsxs("div",{className:"p-4 bg-destructive text-destructive-foreground",children:["ERROR: unexpected source type ",typeof t," for schema type"," ",n.type]})}function Kl(t){return Array.isArray(t)}function AD(t){const e={};return t.forEach(n=>{const r=n.split("/").filter(i=>i!=="");if(r.length===1)e[""]||(e[""]=[]),e[""].push(r[0]);else if(r.length>1){const i=r.slice(0,r.length-1).join("/"),o=r.slice(-1)[0];e[i]||(e[i]=[]),e[i].push(o)}}),e}function MD({selectedPath:t,paths:e,setSelectedModuleId:n}){const r=AD(e),i=t&&On.splitModuleIdAndModulePath(t)[0];return x.jsx("div",{className:"flex flex-col w-full py-2 text-xs",children:Object.entries(r).map(([o,l])=>x.jsxs("div",{className:"px-4 py-2",children:[o&&x.jsx("div",{className:"font-bold truncate max-w-[300px] text-left",title:o,children:x.jsx(Vo,{children:o})}),x.jsx("div",{className:Pn({"flex flex-col py-2 justify-start items-start":!!o}),children:l.map(s=>{const a=`/${o}/${s}`;return x.jsx("button",{className:Pn("block px-2 py-1 rounded-full",{"bg-accent text-accent-foreground":i===a}),onClick:()=>{n(a)},children:s},a)})})]},`/${o}`))})}const S_={tags:{h1:"font-bold",h2:"font-bold",h3:"font-bold",h4:"font-bold",h5:"font-bold",h6:"font-bold",p:""},classes:{bold:"font-bold",italic:"italic",lineThrough:"line-through"}};function LD({children:t}){const e=t;function n(o,l){const s=S_.tags[o];return s&&l?[l,s].join(" "):s||l}function r(o,l){const s=S_.classes[o];return s&&l?[l,s].join(" "):s||l}function i(o,l){var u,c;if(typeof o=="string")return o;if(o.tag==="p")return x.jsx("p",{className:n("p"),children:o.children.map((d,f)=>i(d,f))},l);if(o.tag==="img")return x.jsx("img",{className:n("img"),src:o.src},l);if(o.tag==="ul")return x.jsx("ul",{className:n("ul"),children:o.children.map((d,f)=>i(d,f))},l);if(o.tag==="ol")return x.jsx("ol",{className:n("ol"),children:o.children.map((d,f)=>i(d,f))},l);if(o.tag==="li")return x.jsx("li",{className:n("li"),children:o.children.map((d,f)=>i(d,f))},l);if(o.tag==="span")return x.jsx("span",{className:o.classes.map(d=>{switch(d){case"bold":return r("bold");case"line-through":return r("lineThrough");case"italic":return r("italic")}}).join(" "),children:o.children.map((d,f)=>i(d,f))},l);if(o.tag==="h1")return x.jsx("h1",{className:n("h1"),children:o.children.map((d,f)=>i(d,f))},l);if(o.tag==="h2")return x.jsx("h2",{className:n("h2"),children:o.children.map((d,f)=>i(d,f))},l);if(o.tag==="h3")return x.jsx("h3",{className:n("h3"),children:o.children.map((d,f)=>i(d,f))},l);if(o.tag==="h4")return x.jsx("h4",{className:n("h4"),children:o.children.map((d,f)=>i(d,f))},l);if(o.tag==="h5")return x.jsx("h5",{className:n("h5"),children:o.children.map((d,f)=>i(d,f))},l);if(o.tag==="h6")return x.jsx("h6",{className:n("h6"),children:o.children.map((d,f)=>i(d,f))},l);if(o.tag==="br")return x.jsx("br",{},l);if(o.tag==="a")return x.jsx("a",{href:o.href,children:o.children.map((d,f)=>i(d,f))},l);console.error("Unknown tag",o.tag);const a=o.tag;return a!=null&&a.tag?re.createElement(a.tag,{key:l,className:(u=a.class)==null?void 0:u.join(" "),children:(c=a.children)==null?void 0:c.map(i)}):null}return x.jsx("span",{"data-val-path":e.valPath,children:e.children.map((o,l)=>i(o,l))})}const DD=p.createContext(null),Qh={didCatch:!1,error:null};class ID extends p.Component{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=Qh}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(){const{error:e}=this.state;if(e!==null){for(var n,r,i=arguments.length,o=new Array(i),l=0;l<i;l++)o[l]=arguments[l];(n=(r=this.props).onReset)===null||n===void 0||n.call(r,{args:o,reason:"imperative-api"}),this.setState(Qh)}}componentDidCatch(e,n){var r,i;(r=(i=this.props).onError)===null||r===void 0||r.call(i,e,n)}componentDidUpdate(e,n){const{didCatch:r}=this.state,{resetKeys:i}=this.props;if(r&&n.error!==null&&jD(e.resetKeys,i)){var o,l;(o=(l=this.props).onReset)===null||o===void 0||o.call(l,{next:i,prev:e.resetKeys,reason:"keys"}),this.setState(Qh)}}render(){const{children:e,fallbackRender:n,FallbackComponent:r,fallback:i}=this.props,{didCatch:o,error:l}=this.state;let s=e;if(o){const a={error:l,resetErrorBoundary:this.resetErrorBoundary};if(p.isValidElement(i))s=i;else if(typeof n=="function")s=n(a);else if(r)s=p.createElement(r,a);else throw l}return p.createElement(DD.Provider,{value:{didCatch:o,error:l,resetErrorBoundary:this.resetErrorBoundary}},s)}}function jD(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return t.length!==e.length||t.some((n,r)=>!Object.is(n,e[r]))}const tb="Collapsible",[zD,nb]=al(tb),[FD,ny]=zD(tb),BD=p.forwardRef((t,e)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:o,onOpenChange:l,...s}=t,[a=!1,u]=_s({prop:r,defaultProp:i,onChange:l});return p.createElement(FD,{scope:n,disabled:o,contentId:Ff(),open:a,onOpenToggle:p.useCallback(()=>u(c=>!c),[u])},p.createElement(Ke.div,ie({"data-state":ry(a),"data-disabled":o?"":void 0},s,{ref:e})))}),UD="CollapsibleTrigger",WD=p.forwardRef((t,e)=>{const{__scopeCollapsible:n,...r}=t,i=ny(UD,n);return p.createElement(Ke.button,ie({type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":ry(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled},r,{ref:e,onClick:nt(t.onClick,i.onOpenToggle)}))}),rb="CollapsibleContent",VD=p.forwardRef((t,e)=>{const{forceMount:n,...r}=t,i=ny(rb,t.__scopeCollapsible);return p.createElement(bs,{present:n||i.open},({present:o})=>p.createElement(HD,ie({},r,{ref:e,present:o})))}),HD=p.forwardRef((t,e)=>{const{__scopeCollapsible:n,present:r,children:i,...o}=t,l=ny(rb,n),[s,a]=p.useState(r),u=p.useRef(null),c=st(e,u),d=p.useRef(0),f=d.current,h=p.useRef(0),g=h.current,m=l.open||s,w=p.useRef(m),v=p.useRef();return p.useEffect(()=>{const y=requestAnimationFrame(()=>w.current=!1);return()=>cancelAnimationFrame(y)},[]),Vn(()=>{const y=u.current;if(y){v.current=v.current||{transitionDuration:y.style.transitionDuration,animationName:y.style.animationName},y.style.transitionDuration="0s",y.style.animationName="none";const _=y.getBoundingClientRect();d.current=_.height,h.current=_.width,w.current||(y.style.transitionDuration=v.current.transitionDuration,y.style.animationName=v.current.animationName),a(r)}},[l.open,r]),p.createElement(Ke.div,ie({"data-state":ry(l.open),"data-disabled":l.disabled?"":void 0,id:l.contentId,hidden:!m},o,{ref:c,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":g?`${g}px`:void 0,...t.style}}),m&&i)});function ry(t){return t?"open":"closed"}const KD=BD,ZD=WD,GD=VD,Eo="Accordion",YD=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[iy,XD,JD]=jC(Eo),[Jf,AI]=al(Eo,[JD,nb]),oy=nb(),ib=re.forwardRef((t,e)=>{const{type:n,...r}=t,i=r,o=r;return re.createElement(iy.Provider,{scope:t.__scopeAccordion},n==="multiple"?re.createElement(tI,ie({},o,{ref:e})):re.createElement(eI,ie({},i,{ref:e})))});ib.propTypes={type(t){const e=t.value||t.defaultValue;return t.type&&!["single","multiple"].includes(t.type)?new Error("Invalid prop `type` supplied to `Accordion`. Expected one of `single | multiple`."):t.type==="multiple"&&typeof e=="string"?new Error("Invalid prop `type` supplied to `Accordion`. Expected `single` when `defaultValue` or `value` is type `string`."):t.type==="single"&&Array.isArray(e)?new Error("Invalid prop `type` supplied to `Accordion`. Expected `multiple` when `defaultValue` or `value` is type `string[]`."):null}};const[ob,QD]=Jf(Eo),[lb,qD]=Jf(Eo,{collapsible:!1}),eI=re.forwardRef((t,e)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},collapsible:o=!1,...l}=t,[s,a]=_s({prop:n,defaultProp:r,onChange:i});return re.createElement(ob,{scope:t.__scopeAccordion,value:s?[s]:[],onItemOpen:a,onItemClose:re.useCallback(()=>o&&a(""),[o,a])},re.createElement(lb,{scope:t.__scopeAccordion,collapsible:o},re.createElement(sb,ie({},l,{ref:e}))))}),tI=re.forwardRef((t,e)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},...o}=t,[l=[],s]=_s({prop:n,defaultProp:r,onChange:i}),a=re.useCallback(c=>s((d=[])=>[...d,c]),[s]),u=re.useCallback(c=>s((d=[])=>d.filter(f=>f!==c)),[s]);return re.createElement(ob,{scope:t.__scopeAccordion,value:l,onItemOpen:a,onItemClose:u},re.createElement(lb,{scope:t.__scopeAccordion,collapsible:!0},re.createElement(sb,ie({},o,{ref:e}))))}),[nI,Qf]=Jf(Eo),sb=re.forwardRef((t,e)=>{const{__scopeAccordion:n,disabled:r,dir:i,orientation:o="vertical",...l}=t,s=re.useRef(null),a=st(s,e),u=XD(n),d=Yg(i)==="ltr",f=nt(t.onKeyDown,h=>{var g;if(!YD.includes(h.key))return;const m=h.target,w=u().filter(R=>{var b;return!((b=R.ref.current)!==null&&b!==void 0&&b.disabled)}),v=w.findIndex(R=>R.ref.current===m),y=w.length;if(v===-1)return;h.preventDefault();let _=v;const S=0,E=y-1,$=()=>{_=v+1,_>E&&(_=S)},C=()=>{_=v-1,_<S&&(_=E)};switch(h.key){case"Home":_=S;break;case"End":_=E;break;case"ArrowRight":o==="horizontal"&&(d?$():C());break;case"ArrowDown":o==="vertical"&&$();break;case"ArrowLeft":o==="horizontal"&&(d?C():$());break;case"ArrowUp":o==="vertical"&&C();break}const N=_%y;(g=w[N].ref.current)===null||g===void 0||g.focus()});return re.createElement(nI,{scope:n,disabled:r,direction:i,orientation:o},re.createElement(iy.Slot,{scope:n},re.createElement(Ke.div,ie({},l,{"data-orientation":o,ref:a,onKeyDown:r?void 0:f}))))}),Jm="AccordionItem",[rI,ly]=Jf(Jm),iI=re.forwardRef((t,e)=>{const{__scopeAccordion:n,value:r,...i}=t,o=Qf(Jm,n),l=QD(Jm,n),s=oy(n),a=Ff(),u=r&&l.value.includes(r)||!1,c=o.disabled||t.disabled;return re.createElement(rI,{scope:n,open:u,disabled:c,triggerId:a},re.createElement(KD,ie({"data-orientation":o.orientation,"data-state":ab(u)},s,i,{ref:e,disabled:c,open:u,onOpenChange:d=>{d?l.onItemOpen(r):l.onItemClose(r)}})))}),oI="AccordionHeader",lI=re.forwardRef((t,e)=>{const{__scopeAccordion:n,...r}=t,i=Qf(Eo,n),o=ly(oI,n);return re.createElement(Ke.h3,ie({"data-orientation":i.orientation,"data-state":ab(o.open),"data-disabled":o.disabled?"":void 0},r,{ref:e}))}),E_="AccordionTrigger",sI=re.forwardRef((t,e)=>{const{__scopeAccordion:n,...r}=t,i=Qf(Eo,n),o=ly(E_,n),l=qD(E_,n),s=oy(n);return re.createElement(iy.ItemSlot,{scope:n},re.createElement(ZD,ie({"aria-disabled":o.open&&!l.collapsible||void 0,"data-orientation":i.orientation,id:o.triggerId},s,r,{ref:e})))}),aI="AccordionContent",uI=re.forwardRef((t,e)=>{const{__scopeAccordion:n,...r}=t,i=Qf(Eo,n),o=ly(aI,n),l=oy(n);return re.createElement(GD,ie({role:"region","aria-labelledby":o.triggerId,"data-orientation":i.orientation},l,r,{ref:e,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...t.style}}))});function ab(t){return t?"open":"closed"}const cI=ib,dI=iI,fI=lI,ub=sI,cb=uI,hI=cI,db=p.forwardRef(({className:t,...e},n)=>x.jsx(dI,{ref:n,className:xt("border-b",t),...e}));db.displayName="AccordionItem";const fb=p.forwardRef(({className:t,children:e,...n},r)=>x.jsx(fI,{className:"flex",children:x.jsxs(ub,{ref:r,className:xt("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",t),...n,children:[e,x.jsx(wS,{className:"w-4 h-4 transition-transform duration-200 shrink-0"})]})}));fb.displayName=ub.displayName;const hb=p.forwardRef(({className:t,children:e,...n},r)=>x.jsx(cb,{ref:r,className:xt("overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",t),...n,children:x.jsx("div",{className:"pt-0 pb-4",children:e})}));hb.displayName=cb.displayName;/**
|
|
193
193
|
* React Router DOM v6.20.0
|
|
194
194
|
*
|
|
195
195
|
* Copyright (c) Remix Software Inc.
|